Ignore:
Timestamp:
05/27/08 10:57:05 (16 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/SceneGraph.cpp

    r2710 r2715  
    3939SceneGraphLeaf::~SceneGraphLeaf() 
    4040{ 
    41     CLEAR_CONTAINER(mGeometry); 
     41        if (mDeleteGeometry) 
     42                CLEAR_CONTAINER(mGeometry); 
    4243} 
    4344 
     
    278279 
    279280 
    280 SceneGraphLeaf::SceneGraphLeaf(): mIsDynamic(false), mHasChanged(true) 
     281SceneGraphLeaf::SceneGraphLeaf():  
     282mIsDynamic(false), mHasChanged(true), mDeleteGeometry(true) 
    281283{ 
    282284        mTrafo = IdentityMatrix(); 
     
    285287 
    286288 
    287 SceneGraphLeaf::SceneGraphLeaf(bool isDynamic): mIsDynamic(isDynamic), mHasChanged(true) 
     289SceneGraphLeaf::SceneGraphLeaf(bool isDynamic):  
     290mIsDynamic(isDynamic), mHasChanged(true), mDeleteGeometry(true) 
    288291{ 
    289292    mTrafo = IdentityMatrix(); 
     
    327330{ 
    328331        // hack: should just pass a IntersectableGroup as a whole 
    329         // instead we duplicate the object container and create a new 
    330         // leaf 
     332        // instead we duplicate the geometry vector 
    331333        mGeometry = copy.mGeometry; 
    332         //for (size_t i = 0; i < copy.mGeometry->size(); ++ i) 
    333         //      mGeometry.push_back(copy.mGeometry[i]); 
    334334 
    335335        mBox = copy.mBox; 
     
    339339        mIntersectable = new SceneGraphLeafIntersectable(this, mBox); 
    340340        mHasChanged = true; 
    341 } 
    342  
    343 } 
     341 
     342        // hack: the geometry should not be deleted here because this 
     343        // is just a copy 
     344        mDeleteGeometry = false; 
     345} 
     346 
     347} 
Note: See TracChangeset for help on using the changeset viewer.