Show
Ignore:
Timestamp:
11/14/07 17:11:26 (1 year ago)
Author:
cneumann
Message:

changed: started to use new pointer fields
added: ReferenceCountPointer? template
removed: EditHandle? for parent pointer fields

NOTE: Does not compile yet.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/Carsten_PtrWork2/Source/System/Cluster/Window/SortFirst/OSGSortFirstWindowBase.cpp

    r864 r1016  
    5757#include <cstdio> 
    5858#include <boost/assign/list_of.hpp> 
     59#include <boost/bind.hpp> 
    5960 
    6061#include <OSGConfig.h> 
     
    6667#include "OSGSortFirstWindow.h" 
    6768 
    68 #include "boost/bind.hpp" 
    6969 
    7070OSG_BEGIN_NAMESPACE 
     
    8282\***************************************************************************/ 
    8383 
    84 /*! \var std::string     SortFirstWindowBase::_sfCompression 
     84/*! \var string          SortFirstWindowBase::_sfCompression 
    8585     
    8686*/ 
     
    175175    "NULL", 
    176176    0, 
    177     (PrototypeCreateF) &SortFirstWindowBase::createEmpty, 
     177    (ProtoContainerCreateF) &SortFirstWindowBase::createEmpty, 
    178178    SortFirstWindow::initMethod, 
    179179    (InitalInsertDescFunc) &SortFirstWindowBase::classDescInserter, 
     
    195195    "\t<Field\n" 
    196196    "\t\tname=\"compression\"\n" 
    197     "\t\ttype=\"std::string\"\n" 
     197    "\t\ttype=\"string\"\n" 
     198    "        typeNamespace=\"std\"\n" 
    198199    "\t\tcardinality=\"single\"\n" 
    199200    "\t\tvisibility=\"external\"\n" 
     
    245246/*------------------------------ get -----------------------------------*/ 
    246247 
    247 FieldContainerType &SortFirstWindowBase::getType(void) 
     248FieldContainerType & 
     249SortFirstWindowBase::getType(void) 
    248250{ 
    249251    return _type; 
    250252} 
    251253 
    252 const FieldContainerType &SortFirstWindowBase::getType(void) const 
     254FieldContainerType const & 
     255SortFirstWindowBase::getType(void) const 
    253256{ 
    254257    return _type; 
    255258} 
    256259 
    257 UInt32 SortFirstWindowBase::getContainerSize(void) const 
     260UInt32 
     261SortFirstWindowBase::getContainerSize(void) const 
    258262{ 
    259263    return sizeof(SortFirstWindow); 
    260264} 
    261265 
    262 /*------------------------- decorator get ------------------------------*/ 
    263  
    264  
    265 SFString *SortFirstWindowBase::editSFCompression(void) 
    266 
    267     editSField(CompressionFieldMask); 
    268  
    269     return &_sfCompression; 
    270 
    271  
    272 const SFString *SortFirstWindowBase::getSFCompression(void) const 
    273 
    274     return &_sfCompression; 
    275 
    276  
    277 #ifdef OSG_1_GET_COMPAT 
    278 SFString            *SortFirstWindowBase::getSFCompression    (void) 
    279 
    280     return this->editSFCompression    (); 
    281 
    282 #endif 
    283  
    284 SFUInt32 *SortFirstWindowBase::editSFSubtileSize(void) 
    285 
    286     editSField(SubtileSizeFieldMask); 
    287  
    288     return &_sfSubtileSize; 
    289 
    290  
    291 const SFUInt32 *SortFirstWindowBase::getSFSubtileSize(void) const 
    292 
    293     return &_sfSubtileSize; 
    294 
    295  
    296 #ifdef OSG_1_GET_COMPAT 
    297 SFUInt32            *SortFirstWindowBase::getSFSubtileSize    (void) 
    298 
    299     return this->editSFSubtileSize    (); 
    300 
    301 #endif 
    302  
    303 SFBool *SortFirstWindowBase::editSFCompose(void) 
    304 
    305     editSField(ComposeFieldMask); 
    306  
    307     return &_sfCompose; 
    308 
    309  
    310 const SFBool *SortFirstWindowBase::getSFCompose(void) const 
    311 
    312     return &_sfCompose; 
    313 
    314  
    315 #ifdef OSG_1_GET_COMPAT 
    316 SFBool              *SortFirstWindowBase::getSFCompose        (void) 
    317 
    318     return this->editSFCompose        (); 
    319 
    320 #endif 
    321  
    322 MFUInt32 *SortFirstWindowBase::editMFRegion(void) 
    323 
    324     editMField(RegionFieldMask, _mfRegion); 
    325  
    326     return &_mfRegion; 
    327 
    328  
    329 const MFUInt32 *SortFirstWindowBase::getMFRegion(void) const 
    330 
    331     return &_mfRegion; 
    332 
    333  
    334 #ifdef OSG_1_GET_COMPAT 
    335 MFUInt32            *SortFirstWindowBase::getMFRegion         (void) 
    336 
    337     return this->editMFRegion         (); 
    338 
    339 #endif 
    340  
    341 SFBool *SortFirstWindowBase::editSFUseFaceDistribution(void) 
    342 
    343     editSField(UseFaceDistributionFieldMask); 
    344  
    345     return &_sfUseFaceDistribution; 
    346 
    347  
    348 const SFBool *SortFirstWindowBase::getSFUseFaceDistribution(void) const 
    349 
    350     return &_sfUseFaceDistribution; 
    351 
    352  
    353 #ifdef OSG_1_GET_COMPAT 
    354 SFBool              *SortFirstWindowBase::getSFUseFaceDistribution(void) 
    355 
    356     return this->editSFUseFaceDistribution(); 
    357 
    358 #endif 
    359  
    360  
    361  
    362 /*********************************** Non-ptr code ********************************/ 
    363 void SortFirstWindowBase::pushToRegion(const UInt32& value) 
     266/*-------------------------------------------------------------------------*/ 
     267/* Field SFCompression                                                     */ 
     268 
     269/*-------------------------------------------------------------------------*/ 
     270/* Field SFSubtileSize                                                     */ 
     271 
     272/*-------------------------------------------------------------------------*/ 
     273/* Field SFCompose                                                         */ 
     274 
     275/*-------------------------------------------------------------------------*/ 
     276/* Field SFUseFaceDistribution                                             */ 
     277 
     278     
     279/*-------------------------------------------------------------------------*/ 
     280/* Field MFRegion                                                          */ 
     281 
     282void 
     283SortFirstWindowBase::addRegion(MFUInt32::ArgumentType value) 
    364284{ 
    365285    editMField(RegionFieldMask, _mfRegion); 
     
    367287} 
    368288 
    369 void SortFirstWindowBase::insertIntoRegion(UInt32                uiIndex, 
    370                                                    const UInt32& value   ) 
     289void  
     290SortFirstWindowBase::assignRegion( 
     291    MFUInt32 const &value) 
     292
     293    _mfRegion = value; 
     294
     295 
     296void 
     297SortFirstWindowBase::insertRegion( 
     298    UInt32 const uiIndex, 
     299    MFUInt32::ArgumentType value) 
    371300{ 
    372301    editMField(RegionFieldMask, _mfRegion); 
     
    379308} 
    380309 
    381 void SortFirstWindowBase::replaceInRegion(UInt32                uiIndex, 
    382                                                        const UInt32& value   ) 
     310void 
     311SortFirstWindowBase::replaceRegion( 
     312    UInt32 const uiIndex,  
     313    MFUInt32::ArgumentType value) 
    383314{ 
    384315    if(uiIndex >= _mfRegion.size()) 
     
    390321} 
    391322 
    392 void SortFirstWindowBase::replaceInRegion(const UInt32& pOldElem, 
    393                                                         const UInt32& pNewElem) 
    394 
    395     Int32  elemIdx = _mfRegion.findIndex(pOldElem); 
    396  
    397     if(elemIdx != -1) 
     323void 
     324SortFirstWindowBase::replaceRegion( 
     325    MFUInt32::ArgumentType pOldElem, 
     326    MFUInt32::ArgumentType pNewElem ) 
     327
     328    MFUInt32::iterator fieldIt = 
     329        _mfRegion.find(pOldElem); 
     330 
     331    if(fieldIt != _mfRegion.end()) 
    398332    { 
    399333        editMField(RegionFieldMask, _mfRegion); 
     334         
     335        (*fieldIt) = pNewElem; 
     336    } 
     337} 
     338 
     339void 
     340SortFirstWindowBase::subRegion(UInt32 const uiIndex) 
     341{ 
     342    if(uiIndex < _mfRegion.size()) 
     343    { 
     344        editMField(RegionFieldMask, _mfRegion); 
    400345 
    401346        MFUInt32::iterator fieldIt = _mfRegion.begin(); 
    402347 
    403         fieldIt += elemIdx; 
    404  
    405         (*fieldIt) = pNewElem; 
    406     } 
    407 } 
    408  
    409 void SortFirstWindowBase::removeFromRegion(UInt32 uiIndex) 
    410 { 
    411     if(uiIndex < _mfRegion.size()) 
    412     { 
    413         editMField(RegionFieldMask, _mfRegion); 
    414  
    415         MFUInt32::iterator fieldIt = _mfRegion.begin(); 
    416  
    417348        fieldIt += uiIndex; 
     349         
    418350        _mfRegion.erase(fieldIt); 
    419351    } 
    420352} 
    421353 
    422 void SortFirstWindowBase::removeFromRegion(const UInt32& value) 
    423 
    424     Int32 iElemIdx = _mfRegion.findIndex(value); 
    425  
    426     if(iElemIdx != -1) 
    427     { 
    428         editMField(RegionFieldMask, _mfRegion); 
    429  
    430         MFUInt32::iterator fieldIt = _mfRegion.begin(); 
    431  
    432         fieldIt += iElemIdx; 
    433  
     354void 
     355SortFirstWindowBase::subRegion( 
     356    MFUInt32::ArgumentType value) 
     357
     358    MF!@field.FieldTypeCaps!@::iterator fieldIt = 
     359        _mfRegion.find(value); 
     360         
     361    if(fieldIt != _mfRegion.end()) 
     362    { 
    434363        _mfRegion.erase(fieldIt); 
    435364    } 
    436365} 
    437366 
    438 void SortFirstWindowBase::clearRegion(void) 
     367void 
     368SortFirstWindowBase::clearRegion(void) 
    439369{ 
    440370    editMField(RegionFieldMask, _mfRegion); 
     
    442372    _mfRegion.clear(); 
    443373} 
     374 
    444375 
    445376 
     
    567498SortFirstWindowBase::SortFirstWindowBase(void) : 
    568499    Inherited(), 
    569     _sfCompression            (), 
    570     _sfSubtileSize            (UInt32(32)), 
    571     _sfCompose                (bool(true)), 
    572     _mfRegion                (), 
    573     _sfUseFaceDistribution    (bool(false)) 
     500    _sfCompression           (), 
     501    _sfSubtileSize           (UInt32(32)), 
     502    _sfCompose               (bool(true)), 
     503    _mfRegion                (), 
     504    _sfUseFaceDistribution   (bool(false)) 
    574505{ 
    575506} 
     
    577508SortFirstWindowBase::SortFirstWindowBase(const SortFirstWindowBase &source) : 
    578509    Inherited(source), 
    579     _sfCompression            (source._sfCompression            ), 
    580     _sfSubtileSize            (source._sfSubtileSize            ), 
    581     _sfCompose                (source._sfCompose                ), 
    582     _mfRegion                (source._mfRegion                 ), 
    583     _sfUseFaceDistribution    (source._sfUseFaceDistribution    ) 
     510    _sfCompression           (source._sfCompression           ), 
     511    _sfSubtileSize           (source._sfSubtileSize           ), 
     512    _sfCompose               (source._sfCompose               ), 
     513    _mfRegion                (source._mfRegion                ), 
     514    _sfUseFaceDistribution   (source._sfUseFaceDistribution   ) 
    584515{ 
    585516} 
     
    602533    return returnValue; 
    603534} 
    604  
    605535EditFieldHandlePtr SortFirstWindowBase::editHandleCompression    (void) 
    606536{ 
     
    624554    return returnValue; 
    625555} 
    626  
    627556EditFieldHandlePtr SortFirstWindowBase::editHandleSubtileSize    (void) 
    628557{ 
     
    646575    return returnValue; 
    647576} 
    648  
    649577EditFieldHandlePtr SortFirstWindowBase::editHandleCompose        (void) 
    650578{ 
     
    668596    return returnValue; 
    669597} 
    670  
    671598EditFieldHandlePtr SortFirstWindowBase::editHandleRegion         (void) 
    672599{ 
     
    690617    return returnValue; 
    691618} 
    692  
    693619EditFieldHandlePtr SortFirstWindowBase::editHandleUseFaceDistribution(void) 
    694620{ 
     
    750676 
    751677#if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV) 
    752 DataType FieldTraits<SortFirstWindowPtr>::_type("SortFirstWindowPtr", "ClusterWindowPtr"); 
     678DataType FieldTraits<SortFirstWindowInternalRefPtr>::_type( 
     679    "SortFirstWindowInternalRefPtr", 
     680    "ClusterWindowInternalRefPtr"); 
     681DataType FieldTraits<SortFirstWindowWeakRefPtr>::_type( 
     682    "SortFirstWindowWeakRefPtr", 
     683    "ClusterWindowWeakRefPtr"); 
     684DataType FieldTraits<SortFirstWindowParentPtr>::_type( 
     685    "SortFirstWindowParentPtr", 
     686    "ClusterWindowParentPtr"); 
    753687#endif 
    754688