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/06indexgeometry.cpp

    r835 r1039  
    2020 
    2121// The pointer to the transformation 
    22 TransformPtr trans; 
     22TransformGlobalRefPtr trans; 
    2323 
    2424// The SimpleSceneManager to manage simple applications 
     
    5656 
    5757    // the connection between GLUT and OpenSG 
    58     GLUTWindowPtr gwin= GLUTWindow::create(); 
     58    GLUTWindowGlobalRefPtr gwin= GLUTWindow::create(); 
    5959    gwin->setGlutId(winid); 
    6060    gwin->init(); 
     
    7373        The initial setup is the same as in the geometry... 
    7474    */ 
    75     GeoUInt8PropertyPtr type = GeoUInt8Property::create(); 
     75    GeoUInt8PropertyGlobalRefPtr type = GeoUInt8Property::create(); 
    7676    type->addValue(GL_POLYGON  ); 
    7777    type->addValue(GL_TRIANGLES); 
    7878    type->addValue(GL_QUADS    ); 
    7979 
    80     GeoUInt32PropertyPtr lens = GeoUInt32Property::create(); 
     80    GeoUInt32PropertyGlobalRefPtr lens = GeoUInt32Property::create(); 
    8181    lens->addValue(4); 
    8282    lens->addValue(6); 
     
    8686        This time, only unique positions are stored. 
    8787    */ 
    88     GeoPnt3fPropertyPtr pnts = GeoPnt3fProperty::create(); 
     88    GeoPnt3fPropertyGlobalRefPtr pnts = GeoPnt3fProperty::create(); 
    8989    // the base 
    9090    pnts->addValue(Pnt3f(-1, -1, -1)); 
     
    111111        Colors also have their own types, they are neither Points nor Vectors. 
    112112    */ 
    113     GeoVec3fPropertyPtr colors = GeoVec3fProperty::create(); 
     113    GeoVec3fPropertyGlobalRefPtr colors = GeoVec3fProperty::create(); 
    114114    // the base 
    115115    colors->addValue(Color3f(1, 1, 0)); 
     
    138138        for the vertices. 
    139139    */ 
    140     GeoUInt32PropertyPtr indices = GeoUInt32Property::create(); 
     140    GeoUInt32PropertyGlobalRefPtr indices = GeoUInt32Property::create(); 
    141141    // indices for the polygon 
    142142    indices->addValue(0); 
     
    168168       Put it all together into a Geometry NodeCore. 
    169169    */ 
    170     GeometryPtr geo=Geometry::create(); 
     170    GeometryGlobalRefPtr geo = Geometry::create(); 
    171171    geo->setTypes    (type); 
    172172    geo->setLengths  (lens); 
     
    177177     
    178178    // put the geometry core into a node 
    179     NodePtr n = Node::create(); 
     179    NodeGlobalRefPtr n = Node::create(); 
    180180    n->setCore(geo); 
    181181     
    182182    // add a transformation to make it move      
    183     NodePtr scene = Node::create();   
     183    NodeGlobalRefPtr scene = Node::create();   
    184184    trans = Transform::create(); 
    185185    scene->setCore(trans); 
     
    240240        case 27:     
    241241        { 
     242            delete mgr; 
     243         
    242244            OSG::osgExit(); 
    243245            exit(0);