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/03share.cpp

    r835 r1039  
    2727 
    2828// a seprate transformation for every copy 
    29 TransformPtr trans[ncopies]; 
     29TransformGlobalRefPtr trans[ncopies]; 
    3030 
    3131 
     
    4444     
    4545    // set the transforms' matrices 
    46     for(UInt16 i=0; i<ncopies; ++i) 
     46    for(UInt16 i=0; i < ncopies; ++i) 
    4747    { 
    4848        m.setTransform(Vec3f(      osgSin(t / 1000.f + i * 4 * ncopies / Pi),  
     
    7070 
    7171    // the connection between GLUT and OpenSG 
    72     GLUTWindowPtr gwin= GLUTWindow::create(); 
     72    GLUTWindowGlobalRefPtr gwin= GLUTWindow::create(); 
    7373    gwin->setGlutId(winid); 
    7474    gwin->init(); 
     
    9797     
    9898    // this time, create just the core of the geometry 
    99     GeometryPtr torus = makeTorusGeo( .5, 2, 8, 12 ); 
     99    GeometryGlobalRefPtr torus = makeTorusGeo( .5, 2, 8, 12 ); 
    100100 
    101101    // create the scene 
     
    110110     
    111111    // create the root Group node 
    112     NodePtr  scene = Node::create(); 
    113     GroupPtr g     = Group::create(); 
     112    NodeGlobalRefPtr  scene = Node::create(); 
     113    GroupGlobalRefPtr g     = Group::create(); 
    114114     
    115115    scene->setCore(g); 
     
    119119    { 
    120120        // create the nodes for the shared Geometry core 
    121         NodePtr geonode = Node::create(); 
     121        NodeRefPtr geonode = Node::create(); 
    122122         
    123123        // assign the Core to the Node 
     
    125125 
    126126        // add a transformation for every Geometry 
    127         NodePtr transnode = Node::create(); 
     127        NodeRefPtr transnode = Node::create(); 
    128128         
    129129        trans[i] = Transform::create(); 
     
    189189        case 27:     
    190190        { 
     191            delete mgr; 
     192         
    191193            OSG::osgExit(); 
    192194            exit(0);