Changeset 1016 for branches/Carsten_PtrWork2/Source/System/Cluster/Window/SortFirst/OSGSortFirstWindowBase.cpp
- Timestamp:
- 11/14/07 17:11:26 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/Carsten_PtrWork2/Source/System/Cluster/Window/SortFirst/OSGSortFirstWindowBase.cpp
r864 r1016 57 57 #include <cstdio> 58 58 #include <boost/assign/list_of.hpp> 59 #include <boost/bind.hpp> 59 60 60 61 #include <OSGConfig.h> … … 66 67 #include "OSGSortFirstWindow.h" 67 68 68 #include "boost/bind.hpp"69 69 70 70 OSG_BEGIN_NAMESPACE … … 82 82 \***************************************************************************/ 83 83 84 /*! \var st d::stringSortFirstWindowBase::_sfCompression84 /*! \var string SortFirstWindowBase::_sfCompression 85 85 86 86 */ … … 175 175 "NULL", 176 176 0, 177 (Proto typeCreateF) &SortFirstWindowBase::createEmpty,177 (ProtoContainerCreateF) &SortFirstWindowBase::createEmpty, 178 178 SortFirstWindow::initMethod, 179 179 (InitalInsertDescFunc) &SortFirstWindowBase::classDescInserter, … … 195 195 "\t<Field\n" 196 196 "\t\tname=\"compression\"\n" 197 "\t\ttype=\"std::string\"\n" 197 "\t\ttype=\"string\"\n" 198 " typeNamespace=\"std\"\n" 198 199 "\t\tcardinality=\"single\"\n" 199 200 "\t\tvisibility=\"external\"\n" … … 245 246 /*------------------------------ get -----------------------------------*/ 246 247 247 FieldContainerType &SortFirstWindowBase::getType(void) 248 FieldContainerType & 249 SortFirstWindowBase::getType(void) 248 250 { 249 251 return _type; 250 252 } 251 253 252 const FieldContainerType &SortFirstWindowBase::getType(void) const 254 FieldContainerType const & 255 SortFirstWindowBase::getType(void) const 253 256 { 254 257 return _type; 255 258 } 256 259 257 UInt32 SortFirstWindowBase::getContainerSize(void) const 260 UInt32 261 SortFirstWindowBase::getContainerSize(void) const 258 262 { 259 263 return sizeof(SortFirstWindow); 260 264 } 261 265 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 282 void 283 SortFirstWindowBase::addRegion(MFUInt32::ArgumentType value) 364 284 { 365 285 editMField(RegionFieldMask, _mfRegion); … … 367 287 } 368 288 369 void SortFirstWindowBase::insertIntoRegion(UInt32 uiIndex, 370 const UInt32& value ) 289 void 290 SortFirstWindowBase::assignRegion( 291 MFUInt32 const &value) 292 { 293 _mfRegion = value; 294 } 295 296 void 297 SortFirstWindowBase::insertRegion( 298 UInt32 const uiIndex, 299 MFUInt32::ArgumentType value) 371 300 { 372 301 editMField(RegionFieldMask, _mfRegion); … … 379 308 } 380 309 381 void SortFirstWindowBase::replaceInRegion(UInt32 uiIndex, 382 const UInt32& value ) 310 void 311 SortFirstWindowBase::replaceRegion( 312 UInt32 const uiIndex, 313 MFUInt32::ArgumentType value) 383 314 { 384 315 if(uiIndex >= _mfRegion.size()) … … 390 321 } 391 322 392 void SortFirstWindowBase::replaceInRegion(const UInt32& pOldElem, 393 const UInt32& pNewElem) 394 { 395 Int32 elemIdx = _mfRegion.findIndex(pOldElem); 396 397 if(elemIdx != -1) 323 void 324 SortFirstWindowBase::replaceRegion( 325 MFUInt32::ArgumentType pOldElem, 326 MFUInt32::ArgumentType pNewElem ) 327 { 328 MFUInt32::iterator fieldIt = 329 _mfRegion.find(pOldElem); 330 331 if(fieldIt != _mfRegion.end()) 398 332 { 399 333 editMField(RegionFieldMask, _mfRegion); 334 335 (*fieldIt) = pNewElem; 336 } 337 } 338 339 void 340 SortFirstWindowBase::subRegion(UInt32 const uiIndex) 341 { 342 if(uiIndex < _mfRegion.size()) 343 { 344 editMField(RegionFieldMask, _mfRegion); 400 345 401 346 MFUInt32::iterator fieldIt = _mfRegion.begin(); 402 347 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 417 348 fieldIt += uiIndex; 349 418 350 _mfRegion.erase(fieldIt); 419 351 } 420 352 } 421 353 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 354 void 355 SortFirstWindowBase::subRegion( 356 MFUInt32::ArgumentType value) 357 { 358 MF!@field.FieldTypeCaps!@::iterator fieldIt = 359 _mfRegion.find(value); 360 361 if(fieldIt != _mfRegion.end()) 362 { 434 363 _mfRegion.erase(fieldIt); 435 364 } 436 365 } 437 366 438 void SortFirstWindowBase::clearRegion(void) 367 void 368 SortFirstWindowBase::clearRegion(void) 439 369 { 440 370 editMField(RegionFieldMask, _mfRegion); … … 442 372 _mfRegion.clear(); 443 373 } 374 444 375 445 376 … … 567 498 SortFirstWindowBase::SortFirstWindowBase(void) : 568 499 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)) 574 505 { 575 506 } … … 577 508 SortFirstWindowBase::SortFirstWindowBase(const SortFirstWindowBase &source) : 578 509 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 ) 584 515 { 585 516 } … … 602 533 return returnValue; 603 534 } 604 605 535 EditFieldHandlePtr SortFirstWindowBase::editHandleCompression (void) 606 536 { … … 624 554 return returnValue; 625 555 } 626 627 556 EditFieldHandlePtr SortFirstWindowBase::editHandleSubtileSize (void) 628 557 { … … 646 575 return returnValue; 647 576 } 648 649 577 EditFieldHandlePtr SortFirstWindowBase::editHandleCompose (void) 650 578 { … … 668 596 return returnValue; 669 597 } 670 671 598 EditFieldHandlePtr SortFirstWindowBase::editHandleRegion (void) 672 599 { … … 690 617 return returnValue; 691 618 } 692 693 619 EditFieldHandlePtr SortFirstWindowBase::editHandleUseFaceDistribution(void) 694 620 { … … 750 676 751 677 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV) 752 DataType FieldTraits<SortFirstWindowPtr>::_type("SortFirstWindowPtr", "ClusterWindowPtr"); 678 DataType FieldTraits<SortFirstWindowInternalRefPtr>::_type( 679 "SortFirstWindowInternalRefPtr", 680 "ClusterWindowInternalRefPtr"); 681 DataType FieldTraits<SortFirstWindowWeakRefPtr>::_type( 682 "SortFirstWindowWeakRefPtr", 683 "ClusterWindowWeakRefPtr"); 684 DataType FieldTraits<SortFirstWindowParentPtr>::_type( 685 "SortFirstWindowParentPtr", 686 "ClusterWindowParentPtr"); 753 687 #endif 754 688
