Show
Ignore:
Timestamp:
01/16/08 16:07:40 (1 year ago)
Author:
cneumann
Message:

changed: - factory functions return a TransitPtr? that can not be implicitly

converted to C Ptr. Should help with porting.

added: - GlobalRefPtr?, needed for cases where upon return from main

a RefPtr? goes out of scope (it would attempt to access the
FCFactory which is already shutdown at that point).

status: - vrml loader does not compile (needs porting to ref ptr)

  • tutorials compile, run and exit cleanly
  • multithreading and cluster are untested, yet
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/Carsten_PtrWork2/Tutorials/08materials.cpp

    r835 r1039  
    3030 
    3131// a separate transformation for every object 
    32 TransformPtr cyltrans, tortrans; 
     32TransformGlobalRefPtr cyltrans, tortrans; 
    3333 
    3434 
     
    7373 
    7474    // the connection between GLUT and OpenSG 
    75     GLUTWindowPtr gwin= GLUTWindow::create(); 
     75    GLUTWindowGlobalRefPtr gwin= GLUTWindow::create(); 
    7676    gwin->setGlutId(winid); 
    7777    gwin->init(); 
     
    8484    // The scene group 
    8585     
    86     NodePtr  scene = Node::create(); 
    87     GroupPtr g     = Group::create(); 
     86    NodeGlobalRefPtr  scene = Node::create(); 
     87    GroupGlobalRefPtr g     = Group::create(); 
    8888     
    8989    scene->setCore(g); 
    9090     
    9191    // The cylinder and its transformation 
    92     NodePtr     cyl    = Node::create(); 
    93     GeometryPtr cylgeo = makeCylinderGeo( 1.4, .3, 8, true, true, true ); 
     92    NodeGlobalRefPtr     cyl    = Node::create(); 
     93    GeometryGlobalRefPtr cylgeo = makeCylinderGeo( 1.4, .3, 8, true, true, true ); 
    9494     
    9595    cyl->setCore(cylgeo); 
     
    9797    cyltrans = Transform::create(); 
    9898 
    99     NodePtr cyltransnode = Node::create(); 
     99    NodeGlobalRefPtr cyltransnode = Node::create(); 
    100100    cyltransnode->setCore (cyltrans); 
    101101    cyltransnode->addChild(cyl     ); 
     
    105105     
    106106    // The torus and its transformation 
    107     NodePtr     torus    = Node::create(); 
    108     GeometryPtr torusgeo = makeTorusGeo( .2, 1, 8, 12 ); 
     107    NodeGlobalRefPtr     torus    = Node::create(); 
     108    GeometryGlobalRefPtr torusgeo = makeTorusGeo( .2, 1, 8, 12 ); 
    109109     
    110110    torus->setCore(torusgeo); 
     
    112112    tortrans = Transform::create(); 
    113113 
    114     NodePtr tortransnode = Node::create(); 
     114    NodeGlobalRefPtr tortransnode = Node::create(); 
    115115    tortransnode->setCore (tortrans); 
    116116    tortransnode->addChild(torus   ); 
     
    139139    */ 
    140140     
    141     SimpleMaterialPtr m1 = SimpleMaterial::create(); 
     141    SimpleMaterialGlobalRefPtr m1 = SimpleMaterial::create(); 
    142142     
    143143    // when everything is changed, not setting the mask is ok 
     
    198198    */ 
    199199     
    200     ImagePtr image = Image::create(); 
     200    ImageGlobalRefPtr image = Image::create(); 
    201201    
    202202    if(argc > 1) 
     
    212212    } 
    213213     
    214     SimpleTexturedMaterialPtr m2 = SimpleTexturedMaterial::create(); 
     214    SimpleTexturedMaterialGlobalRefPtr m2 = SimpleTexturedMaterial::create(); 
    215215     
    216216    m2->setAmbient      (Color3f(0.3,0.3,0.3)); 
     
    285285        case 27:     
    286286        { 
     287            delete mgr; 
     288         
    287289            OSG::osgExit(); 
    288290            exit(0);