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/Manipulators/OSGMoveManipulatorBase.cpp

    r1020 r1032  
    7878 */ 
    7979 
     80     
     81void MoveManipulatorBase::classDescInserter(TypeObject &oType) 
     82{ 
     83    FieldDescriptionBase *pDesc = NULL; 
     84 
     85} 
    8086 
    8187MoveManipulatorBase::TypeObject MoveManipulatorBase::_type( 
     
    106112    "The MoveHandle is used for moving objects. It consist of three axis which can be picked and translated and one center box to translate freely in 3D.\n" 
    107113    ); 
    108  
     114     
    109115/*------------------------------ get -----------------------------------*/ 
    110116 
     
    154160 
    155161//! create a new instance of the class 
    156 MoveManipulatorPtr MoveManipulatorBase::create(void) 
    157 
    158     MoveManipulatorPtr fc; 
     162MoveManipulatorBase::ObjRefPtr 
     163MoveManipulatorBase::create(void) 
     164
     165    ObjRefPtr pFC; 
    159166 
    160167    if(getClassType().getPrototype() != NullFC) 
    161168    { 
    162         fc = dynamic_cast<MoveManipulator::ObjPtr>( 
    163             getClassType().getPrototype()-> shallowCopy()); 
     169        pFC = boost::dynamic_pointer_cast<MoveManipulator>( 
     170            getClassType().getPrototype()->shallowCopy()); 
    164171    } 
    165172 
    166     return fc
     173    return pFC
    167174} 
    168175 
     
    177184} 
    178185 
    179 FieldContainerPtr MoveManipulatorBase::shallowCopy(void) const 
    180 
    181     MoveManipulatorPtr returnValue; 
     186FieldContainerRefPtr 
     187MoveManipulatorBase::shallowCopy(void) const 
     188
     189    ObjPtr returnValue; 
    182190 
    183191    newPtr(returnValue, dynamic_cast<const MoveManipulator *>(this)); 
    184192 
    185     return returnValue
     193    return FieldContainerRefPtr(returnValue)
    186194} 
    187195