Changeset 1032 for branches/Carsten_PtrWork2/Source/System/Cluster/Window/SortLast/OSGSortLastWindowBase.cpp
- Timestamp:
- 12/12/07 18:00:42 (9 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/Carsten_PtrWork2/Source/System/Cluster/Window/SortLast/OSGSortLastWindowBase.cpp
r1020 r1032 95 95 */ 96 96 97 97 98 98 void SortLastWindowBase::classDescInserter(TypeObject &oType) 99 99 { 100 100 FieldDescriptionBase *pDesc = NULL; 101 102 101 103 102 pDesc = new MFNodeInternalPtr::Description( … … 105 104 "groupNodes", 106 105 "", 107 GroupNodesFieldId, GroupNodesFieldMask, 106 GroupNodesFieldId, 107 GroupNodesFieldMask, 108 108 false, 109 109 Field::MFDefaultFlags, 110 110 static_cast<FieldEditMethodSig>(&SortLastWindowBase::editHandleGroupNodes), 111 static_cast<FieldGetMethodSig >(&SortLastWindowBase::getHandleGroupNodes)); 112 113 oType.addInitialDesc(pDesc); 114 111 static_cast<FieldGetMethodSig >(&SortLastWindowBase::getHandleGroupNodes ) ); 112 113 oType.addInitialDesc(pDesc); 114 115 115 116 pDesc = new MFUInt32::Description( 116 117 MFUInt32::getClassType(), 117 118 "groupLengths", 118 119 "", 119 GroupLengthsFieldId, GroupLengthsFieldMask, 120 GroupLengthsFieldId, 121 GroupLengthsFieldMask, 120 122 false, 121 123 Field::MFDefaultFlags, 122 124 static_cast<FieldEditMethodSig>(&SortLastWindowBase::editHandleGroupLengths), 123 static_cast<FieldGetMethodSig >(&SortLastWindowBase::getHandleGroupLengths)); 124 125 oType.addInitialDesc(pDesc); 126 125 static_cast<FieldGetMethodSig >(&SortLastWindowBase::getHandleGroupLengths ) ); 126 127 oType.addInitialDesc(pDesc); 128 129 127 130 pDesc = new SFBool::Description( 128 131 SFBool::getClassType(), 129 132 "groupsChanged", 130 133 "", 131 GroupsChangedFieldId, GroupsChangedFieldMask, 134 GroupsChangedFieldId, 135 GroupsChangedFieldMask, 132 136 true, 133 137 Field::SFDefaultFlags, 134 138 static_cast<FieldEditMethodSig>(&SortLastWindowBase::editHandleGroupsChanged), 135 static_cast<FieldGetMethodSig >(&SortLastWindowBase::getHandleGroupsChanged)); 136 137 oType.addInitialDesc(pDesc); 138 } 139 139 static_cast<FieldGetMethodSig >(&SortLastWindowBase::getHandleGroupsChanged ) ); 140 141 oType.addInitialDesc(pDesc); 142 143 144 } 140 145 141 146 SortLastWindowBase::TypeObject SortLastWindowBase::_type( … … 191 196 "Cluster rendering configuration for sort first image composition\n" 192 197 ); 193 198 194 199 /*------------------------------ get -----------------------------------*/ 195 200 … … 266 271 } 267 272 268 void 273 bool 269 274 SortLastWindowBase::replaceGroupNodes( 270 275 MFNodeInternalPtr::ArgumentType pOldElem, 271 276 MFNodeInternalPtr::ArgumentType pNewElem ) 272 277 { 273 if(pNewElem == NullFC) 274 return; 278 bool retVal = false; 279 280 if(pNewElem != NullFC) 281 return retVal; 275 282 276 283 GroupNodesFieldType::iterator fieldIt = … … 279 286 if(fieldIt != _mfGroupNodes.end()) 280 287 { 288 retVal = true; 289 281 290 editMField(GroupNodesFieldMask, _mfGroupNodes); 282 291 283 292 (*fieldIt) = NodePtr(pNewElem); 284 293 } 294 295 return retVal; 285 296 } 286 297 … … 300 311 } 301 312 302 void 313 bool 303 314 SortLastWindowBase::subGroupNodes( 304 315 MFNodeInternalPtr::ArgumentType value) 305 316 { 317 bool retVal = false; 306 318 GroupNodesFieldType::iterator fieldIt = 307 319 _mfGroupNodes.find(value); … … 309 321 if(fieldIt != _mfGroupNodes.end()) 310 322 { 323 retVal = true; 324 311 325 editMField(GroupNodesFieldMask, _mfGroupNodes); 312 326 313 327 _mfGroupNodes.erase(fieldIt); 314 328 } 329 330 return retVal; 315 331 } 316 332 … … 389 405 390 406 //! create a new instance of the class 391 SortLastWindowPtr SortLastWindowBase::create(void) 392 { 393 SortLastWindowPtr fc; 407 SortLastWindowBase::ObjRefPtr 408 SortLastWindowBase::create(void) 409 { 410 ObjRefPtr pFC; 394 411 395 412 if(getClassType().getPrototype() != NullFC) 396 413 { 397 fc = dynamic_cast<SortLastWindow::ObjPtr>(398 getClassType().getPrototype()-> shallowCopy());399 } 400 401 return fc;414 pFC = boost::dynamic_pointer_cast<SortLastWindow>( 415 getClassType().getPrototype()->shallowCopy()); 416 } 417 418 return pFC; 402 419 } 403 420 … … 412 429 } 413 430 414 FieldContainerPtr SortLastWindowBase::shallowCopy(void) const 415 { 416 SortLastWindowPtr returnValue; 431 FieldContainerRefPtr 432 SortLastWindowBase::shallowCopy(void) const 433 { 434 ObjPtr returnValue; 417 435 418 436 newPtr(returnValue, dynamic_cast<const SortLastWindow *>(this)); 419 437 420 return returnValue;438 return FieldContainerRefPtr(returnValue); 421 439 } 422 440 … … 465 483 ++GroupNodesIt; 466 484 } 485 467 486 } 468 487 } … … 484 503 &_mfGroupNodes, 485 504 this->getType().getFieldDesc(GroupNodesFieldId))); 486 487 // returnValue->setAddMethod(boost::bind(&SortLastWindow::addGroupNodes, 488 // static_cast<SortLastWindow *>(this), _1)); 505 returnValue->setAddFunc( 506 boost::bind( 507 &SortLastWindow::addGroupNodes, 508 static_cast<SortLastWindow *>(this), _1)); 509 returnValue->setInsertFunc( 510 boost::bind( 511 &SortLastWindow::insertGroupNodes, 512 static_cast<SortLastWindow *>(this), _1, _2)); 513 514 void (SortLastWindow::*replaceGroupNodesIndexFunc)( 515 UInt32 const, 516 MFNodeInternalPtr::ArgumentType) = 517 &SortLastWindow::replaceGroupNodes; 518 returnValue->setReplaceIndexFunc( 519 boost::bind( 520 replaceGroupNodesIndexFunc, 521 static_cast<SortLastWindow *>(this), _1, _2)); 522 523 bool (SortLastWindow::*replaceGroupNodesObjectFunc)( 524 MFNodeInternalPtr::ArgumentType, 525 MFNodeInternalPtr::ArgumentType ) = 526 &SortLastWindow::replaceGroupNodes; 527 returnValue->setReplaceObjectFunc( 528 boost::bind( 529 replaceGroupNodesObjectFunc, 530 static_cast<SortLastWindow *>(this), _1, _2)); 531 532 void (SortLastWindow::*subGroupNodesIndexFunc)(UInt32 const) = 533 &SortLastWindow::subGroupNodes; 534 returnValue->setSubIndexFunc( 535 boost::bind( 536 subGroupNodesIndexFunc, 537 static_cast<SortLastWindow *>(this), _1)); 538 539 bool (SortLastWindow::*subGroupNodesObjectFunc)( 540 MFNodeInternalPtr::ArgumentType) = 541 &SortLastWindow::subGroupNodes; 542 returnValue->setSubObjectFunc( 543 boost::bind( 544 subGroupNodesObjectFunc, 545 static_cast<SortLastWindow *>(this), _1)); 546 returnValue->setClearFunc( 547 boost::bind( 548 &SortLastWindow::clearGroupNodes, 549 static_cast<SortLastWindow *>(this))); 489 550 490 551 editMField(GroupNodesFieldMask, _mfGroupNodes);
