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/05geometry.cpp

    r835 r1039  
    2727 
    2828// The pointer to the transformation 
    29 TransformPtr trans; 
     29TransformGlobalRefPtr trans; 
    3030 
    3131// The pointer to the geometry core 
    32 GeometryPtr geo; 
     32GeometryGlobalRefPtr geo; 
    3333 
    3434 
     
    4949 
    5050    // the connection between GLUT and OpenSG 
    51     GLUTWindowPtr gwin= GLUTWindow::create(); 
     51    GLUTWindowGlobalRefPtr gwin = GLUTWindow::create(); 
    5252    gwin->setGlutId(winid); 
    5353    gwin->init(); 
     
    7474        property, thus the mask is also called the same for each property. 
    7575    */ 
    76     GeoUInt8PropertyPtr type = GeoUInt8Property::create(); 
     76    GeoUInt8PropertyGlobalRefPtr type = GeoUInt8Property::create(); 
    7777    type->addValue(GL_POLYGON  ); 
    7878    type->addValue(GL_TRIANGLES); 
     
    8585        types property. 
    8686    */ 
    87     GeoUInt32PropertyPtr lens = GeoUInt32Property::create(); 
     87    GeoUInt32PropertyGlobalRefPtr lens = GeoUInt32Property::create(); 
    8888    lens->addValue(4); 
    8989    lens->addValue(6); 
     
    9999        general kind. 
    100100    */ 
    101     GeoPnt3fPropertyPtr  pnts = OSG::GeoPnt3fProperty::create(); 
     101    GeoPnt3fPropertyGlobalRefPtr  pnts = OSG::GeoPnt3fProperty::create(); 
    102102    // the 4 points of the polygon 
    103103    pnts->addValue(Pnt3f(-1, -1, -1)); 
     
    129129       Put it all together into a Geometry NodeCore. 
    130130    */ 
    131     geo=Geometry::create(); 
     131    geo = Geometry::create(); 
    132132    geo->setTypes    (type); 
    133133    geo->setLengths  (lens); 
     
    139139     
    140140    // put the geometry core into a node 
    141     NodePtr n = Node::create(); 
     141    NodeGlobalRefPtr n = Node::create(); 
    142142    n->setCore(geo); 
    143143     
    144144    // add a transformation to make it move      
    145     NodePtr scene = Node::create();   
     145    NodeGlobalRefPtr scene = Node::create();   
    146146    trans = Transform::create(); 
    147147    scene->setCore(trans); 
     
    254254        case 27:     
    255255        { 
     256            delete mgr; 
     257         
    256258            OSG::osgExit(); 
    257259            exit(0);