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/System/Cluster/Window/SortFirst/OSGSortFirstWindowBase.cpp

    r1020 r1032  
    102102*/ 
    103103 
    104  
     104     
    105105void SortFirstWindowBase::classDescInserter(TypeObject &oType) 
    106106{ 
    107107    FieldDescriptionBase *pDesc = NULL; 
    108  
    109108 
    110109    pDesc = new SFString::Description( 
     
    112111        "compression", 
    113112        "", 
    114         CompressionFieldId, CompressionFieldMask, 
     113        CompressionFieldId, 
     114        CompressionFieldMask, 
    115115        false, 
    116116        Field::SFDefaultFlags, 
    117117        static_cast<FieldEditMethodSig>(&SortFirstWindowBase::editHandleCompression), 
    118         static_cast<FieldGetMethodSig >(&SortFirstWindowBase::getHandleCompression)); 
    119  
    120     oType.addInitialDesc(pDesc); 
    121  
     118        static_cast<FieldGetMethodSig >(&SortFirstWindowBase::getHandleCompression ) ); 
     119         
     120        oType.addInitialDesc(pDesc); 
     121         
     122         
    122123    pDesc = new SFUInt32::Description( 
    123124        SFUInt32::getClassType(), 
    124125        "subtileSize", 
    125126        "", 
    126         SubtileSizeFieldId, SubtileSizeFieldMask, 
     127        SubtileSizeFieldId, 
     128        SubtileSizeFieldMask, 
    127129        false, 
    128130        Field::SFDefaultFlags, 
    129131        static_cast<FieldEditMethodSig>(&SortFirstWindowBase::editHandleSubtileSize), 
    130         static_cast<FieldGetMethodSig >(&SortFirstWindowBase::getHandleSubtileSize)); 
    131  
    132     oType.addInitialDesc(pDesc); 
    133  
     132        static_cast<FieldGetMethodSig >(&SortFirstWindowBase::getHandleSubtileSize ) ); 
     133         
     134        oType.addInitialDesc(pDesc); 
     135         
     136         
    134137    pDesc = new SFBool::Description( 
    135138        SFBool::getClassType(), 
    136139        "compose", 
    137140        "Transmit rendered image to cleint\n", 
    138         ComposeFieldId, ComposeFieldMask, 
     141        ComposeFieldId, 
     142        ComposeFieldMask, 
    139143        false, 
    140144        Field::SFDefaultFlags, 
    141145        static_cast<FieldEditMethodSig>(&SortFirstWindowBase::editHandleCompose), 
    142         static_cast<FieldGetMethodSig >(&SortFirstWindowBase::getHandleCompose)); 
    143  
    144     oType.addInitialDesc(pDesc); 
    145  
     146        static_cast<FieldGetMethodSig >(&SortFirstWindowBase::getHandleCompose ) ); 
     147         
     148        oType.addInitialDesc(pDesc); 
     149         
     150         
    146151    pDesc = new MFUInt32::Description( 
    147152        MFUInt32::getClassType(), 
    148153        "region", 
    149154        "left,right,bottom,top for each viewport\n", 
    150         RegionFieldId, RegionFieldMask, 
     155        RegionFieldId, 
     156        RegionFieldMask, 
    151157        false, 
    152158        Field::MFDefaultFlags, 
    153159        static_cast<FieldEditMethodSig>(&SortFirstWindowBase::editHandleRegion), 
    154         static_cast<FieldGetMethodSig >(&SortFirstWindowBase::getHandleRegion)); 
    155  
    156     oType.addInitialDesc(pDesc); 
    157  
     160        static_cast<FieldGetMethodSig >(&SortFirstWindowBase::getHandleRegion ) ); 
     161         
     162        oType.addInitialDesc(pDesc); 
     163         
     164         
    158165    pDesc = new SFBool::Description( 
    159166        SFBool::getClassType(), 
    160167        "useFaceDistribution", 
    161168        "Enabe, disable analysation of face distribution\n", 
    162         UseFaceDistributionFieldId, UseFaceDistributionFieldMask, 
     169        UseFaceDistributionFieldId, 
     170        UseFaceDistributionFieldMask, 
    163171        false, 
    164172        Field::SFDefaultFlags, 
    165173        static_cast<FieldEditMethodSig>(&SortFirstWindowBase::editHandleUseFaceDistribution), 
    166         static_cast<FieldGetMethodSig >(&SortFirstWindowBase::getHandleUseFaceDistribution)); 
    167  
    168     oType.addInitialDesc(pDesc); 
    169 
    170  
     174        static_cast<FieldGetMethodSig >(&SortFirstWindowBase::getHandleUseFaceDistribution ) ); 
     175         
     176        oType.addInitialDesc(pDesc); 
     177         
     178         
     179
    171180 
    172181SortFirstWindowBase::TypeObject SortFirstWindowBase::_type( 
     
    243252    "Cluster rendering configuration for sort first image composition\n" 
    244253    ); 
    245  
     254     
    246255/*------------------------------ get -----------------------------------*/ 
    247256 
     
    353362 
    354363//! create a new instance of the class 
    355 SortFirstWindowPtr SortFirstWindowBase::create(void) 
    356 
    357     SortFirstWindowPtr fc; 
     364SortFirstWindowBase::ObjRefPtr 
     365SortFirstWindowBase::create(void) 
     366
     367    ObjRefPtr pFC; 
    358368 
    359369    if(getClassType().getPrototype() != NullFC) 
    360370    { 
    361         fc = dynamic_cast<SortFirstWindow::ObjPtr>( 
    362             getClassType().getPrototype()-> shallowCopy()); 
    363     } 
    364  
    365     return fc
     371        pFC = boost::dynamic_pointer_cast<SortFirstWindow>( 
     372            getClassType().getPrototype()->shallowCopy()); 
     373    } 
     374 
     375    return pFC
    366376} 
    367377 
     
    376386} 
    377387 
    378 FieldContainerPtr SortFirstWindowBase::shallowCopy(void) const 
    379 
    380     SortFirstWindowPtr returnValue; 
     388FieldContainerRefPtr 
     389SortFirstWindowBase::shallowCopy(void) const 
     390
     391    ObjPtr returnValue; 
    381392 
    382393    newPtr(returnValue, dynamic_cast<const SortFirstWindow *>(this)); 
    383394 
    384     return returnValue
     395    return FieldContainerRefPtr(returnValue)
    385396} 
    386397