Changeset 1072 for branches/Carsten_PtrWork2/Source/System/FieldContainer/Base/OSGAttachmentContainer.cpp
- Timestamp:
- 04/02/08 14:18:07 (8 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/Carsten_PtrWork2/Source/System/FieldContainer/Base/OSGAttachmentContainer.cpp
r1070 r1072 67 67 "Attachments attached to this container.", 68 68 OSG_RC_FIELD_DESC(AttachmentContainer::Attachments), 69 FieldContainerAttachment::ParentsFieldId,70 69 false, 71 70 Field::MFDefaultFlags, … … 108 107 _mfAttachmentBindings() 109 108 { 110 _mfAttachments.setEnclosingFC(this); 111 _mfAttachments.setFieldDescription( 112 dynamic_cast<AttachmentsFieldType::Description *>( 113 getClassType().getFieldDesc(AttachmentsFieldId))); 109 _mfAttachments.setEnclosingObject(this); 110 _mfAttachments.setChildFieldId (AttachmentsFieldId); 111 _mfAttachments.setParentFieldId (MFFieldContainerAttachmentChildPtr::ObjectType::ParentsFieldId); 114 112 } 115 113 … … 119 117 _mfAttachmentBindings( ) 120 118 { 121 _mfAttachments.setEnclosingFC(this); 122 _mfAttachments.setFieldDescription( 123 dynamic_cast<AttachmentsFieldType::Description *>( 124 getClassType().getFieldDesc(AttachmentsFieldId))); 119 _mfAttachments.setEnclosingObject(this); 120 _mfAttachments.setChildFieldId (AttachmentsFieldId); 121 _mfAttachments.setParentFieldId (MFFieldContainerAttachmentChildPtr::ObjectType::ParentsFieldId); 125 122 } 126 123 … … 349 346 { 350 347 return _mfAttachmentBindings; 348 } 349 350 /*-------------------------------------------------------------------------*/ 351 /* Child Linking */ 352 353 bool 354 AttachmentContainer::unlinkChild( 355 FieldContainerPtrConst pChild, 356 UInt16 const childFieldId) 357 { 358 if(childFieldId == AttachmentsFieldId) 359 { 360 FieldContainerAttachmentPtr pTypedChild = 361 dynamic_cast< FieldContainerAttachmentPtr >(pChild); 362 363 if(pTypedChild != NullFC) 364 { 365 Int32 index = _mfAttachments.findIndex(pTypedChild); 366 367 if(index != -1) 368 { 369 subAttachment(pTypedChild); 370 371 return true; 372 } 373 374 FWARNING(("AttachmentContainer::unlinkParent: Child <-> Parent link inconsistent.\n")); 375 376 return false; 377 } 378 379 return false; 380 } 381 382 return Inherited::unlinkChild(pChild, childFieldId); 351 383 } 352 384
