Show
Ignore:
Timestamp:
12/12/07 18:00:42 (9 months ago)
Author:
cneumann
Message:

added: generic interface
changed: factory functions return RefPtr?

The unittests don't pass right now, because of the change
to the factory functions, which leads to containers
being immediately destroyed as they are not assigned to
a RefPtr?.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/Carsten_PtrWork2/Source/Contrib/VTK/OSGVTKMapperBase.h

    r1020 r1032  
    112112    OSG_GEN_INTERNALPTR(VTKMapper); 
    113113 
    114     typedef WeakRefCountPtrBuilder<VTKMapper>::Ptr ObjWeakRefPtr; 
    115     typedef MTRefCountPtrBuilder  <VTKMapper>::Ptr ObjMTRefPtr; 
    116     typedef RefCountPtrBuilder    <VTKMapper>::Ptr ObjRefPtr; 
    117     typedef ParentPtrBuilder      <VTKMapper>::Ptr ObjParentPtr; 
     114    typedef MTRefCountPtrBuilder      <VTKMapper>::Ptr ObjMTRefPtr; 
     115    typedef RefCountPtrBuilder        <VTKMapper>::Ptr ObjRefPtr; 
     116    typedef ParentPtrBuilder          <VTKMapper>::Ptr ObjParentPtr; 
     117    typedef WeakRefCountPtrBuilder    <VTKMapper>::Ptr ObjWeakRefPtr; 
     118    typedef InternalRefCountPtrBuilder<VTKMapper>::Ptr ObjInternalRefPtr; 
    118119     
    119120    /*! \}                                                                 */ 
     
    224225            UInt32 const uiIndex, 
    225226            MFNodeInternalPtr::ArgumentType value); 
    226     void replaceGeoRoots( 
     227    bool replaceGeoRoots( 
    227228            MFNodeInternalPtr::ArgumentType pOldElem, 
    228             MFNodeInternalPtr::ArgumentType pNewElem); 
     229            MFNodeInternalPtr::ArgumentType pNewElem ); 
    229230    void subGeoRoots(UInt32 const uiIndex); 
    230     void subGeoRoots(MFNodeInternalPtr::ArgumentType value); 
     231    bool subGeoRoots(MFNodeInternalPtr::ArgumentType value); 
    231232    void clearGeoRoots(void); 
    232233     
     
    259260            UInt32 const uiIndex, 
    260261            MFGeometryInternalPtr::ArgumentType value); 
    261     void replaceGeometries( 
     262    bool replaceGeometries( 
    262263            MFGeometryInternalPtr::ArgumentType pOldElem, 
    263             MFGeometryInternalPtr::ArgumentType pNewElem); 
     264            MFGeometryInternalPtr::ArgumentType pNewElem ); 
    264265    void subGeometries(UInt32 const uiIndex); 
    265     void subGeometries(MFGeometryInternalPtr::ArgumentType value); 
     266    bool subGeometries(MFGeometryInternalPtr::ArgumentType value); 
    266267    void clearGeometries(void); 
    267268     
     
    294295            UInt32 const uiIndex, 
    295296            MFChunkMaterialInternalPtr::ArgumentType value); 
    296     void replaceMaterials( 
     297    bool replaceMaterials( 
    297298            MFChunkMaterialInternalPtr::ArgumentType pOldElem, 
    298             MFChunkMaterialInternalPtr::ArgumentType pNewElem); 
     299            MFChunkMaterialInternalPtr::ArgumentType pNewElem ); 
    299300    void subMaterials(UInt32 const uiIndex); 
    300     void subMaterials(MFChunkMaterialInternalPtr::ArgumentType value); 
     301    bool subMaterials(MFChunkMaterialInternalPtr::ArgumentType value); 
    301302    void clearMaterials(void); 
    302303     
     
    329330            UInt32 const uiIndex, 
    330331            MFMaterialChunkInternalPtr::ArgumentType value); 
    331     void replaceMaterialChunks( 
     332    bool replaceMaterialChunks( 
    332333            MFMaterialChunkInternalPtr::ArgumentType pOldElem, 
    333             MFMaterialChunkInternalPtr::ArgumentType pNewElem); 
     334            MFMaterialChunkInternalPtr::ArgumentType pNewElem ); 
    334335    void subMaterialChunks(UInt32 const uiIndex); 
    335     void subMaterialChunks(MFMaterialChunkInternalPtr::ArgumentType value); 
     336    bool subMaterialChunks(MFMaterialChunkInternalPtr::ArgumentType value); 
    336337    void clearMaterialChunks(void); 
    337338     
     
    364365            UInt32 const uiIndex, 
    365366            MFGeoPnt3fPropertyInternalPtr::ArgumentType value); 
    366     void replacePositions( 
     367    bool replacePositions( 
    367368            MFGeoPnt3fPropertyInternalPtr::ArgumentType pOldElem, 
    368             MFGeoPnt3fPropertyInternalPtr::ArgumentType pNewElem); 
     369            MFGeoPnt3fPropertyInternalPtr::ArgumentType pNewElem ); 
    369370    void subPositions(UInt32 const uiIndex); 
    370     void subPositions(MFGeoPnt3fPropertyInternalPtr::ArgumentType value); 
     371    bool subPositions(MFGeoPnt3fPropertyInternalPtr::ArgumentType value); 
    371372    void clearPositions(void); 
    372373     
     
    399400            UInt32 const uiIndex, 
    400401            MFGeoUInt32PropertyInternalPtr::ArgumentType value); 
    401     void replaceLength( 
     402    bool replaceLength( 
    402403            MFGeoUInt32PropertyInternalPtr::ArgumentType pOldElem, 
    403             MFGeoUInt32PropertyInternalPtr::ArgumentType pNewElem); 
     404            MFGeoUInt32PropertyInternalPtr::ArgumentType pNewElem ); 
    404405    void subLength(UInt32 const uiIndex); 
    405     void subLength(MFGeoUInt32PropertyInternalPtr::ArgumentType value); 
     406    bool subLength(MFGeoUInt32PropertyInternalPtr::ArgumentType value); 
    406407    void clearLength(void); 
    407408     
     
    434435            UInt32 const uiIndex, 
    435436            MFGeoUInt8PropertyInternalPtr::ArgumentType value); 
    436     void replaceTypes( 
     437    bool replaceTypes( 
    437438            MFGeoUInt8PropertyInternalPtr::ArgumentType pOldElem, 
    438             MFGeoUInt8PropertyInternalPtr::ArgumentType pNewElem); 
     439            MFGeoUInt8PropertyInternalPtr::ArgumentType pNewElem ); 
    439440    void subTypes(UInt32 const uiIndex); 
    440     void subTypes(MFGeoUInt8PropertyInternalPtr::ArgumentType value); 
     441    bool subTypes(MFGeoUInt8PropertyInternalPtr::ArgumentType value); 
    441442    void clearTypes(void); 
    442443     
     
    469470            UInt32 const uiIndex, 
    470471            MFGeoColor4fPropertyInternalPtr::ArgumentType value); 
    471     void replaceColors( 
     472    bool replaceColors( 
    472473            MFGeoColor4fPropertyInternalPtr::ArgumentType pOldElem, 
    473             MFGeoColor4fPropertyInternalPtr::ArgumentType pNewElem); 
     474            MFGeoColor4fPropertyInternalPtr::ArgumentType pNewElem ); 
    474475    void subColors(UInt32 const uiIndex); 
    475     void subColors(MFGeoColor4fPropertyInternalPtr::ArgumentType value); 
     476    bool subColors(MFGeoColor4fPropertyInternalPtr::ArgumentType value); 
    476477    void clearColors(void); 
    477478     
     
    504505            UInt32 const uiIndex, 
    505506            MFGeoVec3fPropertyInternalPtr::ArgumentType value); 
    506     void replaceNormals( 
     507    bool replaceNormals( 
    507508            MFGeoVec3fPropertyInternalPtr::ArgumentType pOldElem, 
    508             MFGeoVec3fPropertyInternalPtr::ArgumentType pNewElem); 
     509            MFGeoVec3fPropertyInternalPtr::ArgumentType pNewElem ); 
    509510    void subNormals(UInt32 const uiIndex); 
    510     void subNormals(MFGeoVec3fPropertyInternalPtr::ArgumentType value); 
     511    bool subNormals(MFGeoVec3fPropertyInternalPtr::ArgumentType value); 
    511512    void clearNormals(void); 
    512513     
     
    528529    /*! \{                                                                 */ 
    529530 
    530     static  VTKMapperPtr create     (void); 
     531    static  ObjRefPtr        create     (void); 
    531532    static  VTKMapperPtr createEmpty(void); 
    532533 
     
    536537    /*! \{                                                                 */ 
    537538 
    538     virtual FieldContainerPtr shallowCopy(void) const; 
     539    virtual FieldContainerRefPtr shallowCopy(void) const; 
    539540 
    540541    /*! \}                                                                 */ 
     
    653654}; 
    654655 
    655 typedef VTKMapperBase::ObjRefPtr      VTKMapperRefPtr; 
    656 typedef VTKMapperBase::ObjMTRefPtr    VTKMapperMTRefPtr; 
    657 typedef VTKMapperBase::ObjWeakRefPtr  VTKMapperWeakRefPtr; 
    658 typedef VTKMapperBase::ObjParentPtr   VTKMapperParentPtr; 
     656typedef VTKMapperBase::ObjRefPtr         VTKMapperRefPtr; 
     657typedef VTKMapperBase::ObjMTRefPtr       VTKMapperMTRefPtr; 
     658typedef VTKMapperBase::ObjWeakRefPtr     VTKMapperWeakRefPtr; 
     659typedef VTKMapperBase::ObjParentPtr      VTKMapperParentPtr; 
     660typedef VTKMapperBase::ObjInternalRefPtr VTKMapperInternalPtr; 
    659661 
    660662typedef boost::mpl::if_<