Show
Ignore:
Timestamp:
12/12/07 18:00:42 (1 year 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/OSGRotateManipulatorBase.cpp

    r1020 r1032  
    7878 */ 
    7979 
     80     
     81void RotateManipulatorBase::classDescInserter(TypeObject &oType) 
     82{ 
     83    FieldDescriptionBase *pDesc = NULL; 
     84 
     85} 
    8086 
    8187RotateManipulatorBase::TypeObject RotateManipulatorBase::_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 RotateManipulatorPtr RotateManipulatorBase::create(void) 
    157 
    158     RotateManipulatorPtr fc; 
     162RotateManipulatorBase::ObjRefPtr 
     163RotateManipulatorBase::create(void) 
     164
     165    ObjRefPtr pFC; 
    159166 
    160167    if(getClassType().getPrototype() != NullFC) 
    161168    { 
    162         fc = dynamic_cast<RotateManipulator::ObjPtr>( 
    163             getClassType().getPrototype()-> shallowCopy()); 
     169        pFC = boost::dynamic_pointer_cast<RotateManipulator>( 
     170            getClassType().getPrototype()->shallowCopy()); 
    164171    } 
    165172 
    166     return fc
     173    return pFC
    167174} 
    168175 
     
    177184} 
    178185 
    179 FieldContainerPtr RotateManipulatorBase::shallowCopy(void) const 
    180 
    181     RotateManipulatorPtr returnValue; 
     186FieldContainerRefPtr 
     187RotateManipulatorBase::shallowCopy(void) const 
     188
     189    ObjPtr returnValue; 
    182190 
    183191    newPtr(returnValue, dynamic_cast<const RotateManipulator *>(this)); 
    184192 
    185     return returnValue
     193    return FieldContainerRefPtr(returnValue)
    186194} 
    187195