Ticket #49: NFIO_Attachment_01.diff
| File NFIO_Attachment_01.diff, 12.4 kB (added by cneumann, 2 years ago) |
|---|
-
Source/System/FieldContainer/Mixins/OSGAttachmentMixin.inl
old new 96 96 { 97 97 } 98 98 99 /*-------------------------------------------------------------------------*/ 100 /* Destructor */ 101 99 102 template <class ParentT> inline 100 103 AttachmentMixin<ParentT>::~AttachmentMixin(void) 101 104 { 102 105 } 103 106 104 107 /*-------------------------------------------------------------------------*/ 105 /* Destructor*/108 /* Get */ 106 109 107 110 template <class ParentT> inline 108 111 SFBool &AttachmentMixin<ParentT>::editInternal(void) … … 147 150 } 148 151 149 152 /*-------------------------------------------------------------------------*/ 150 /* Assignment*/153 /* Set */ 151 154 152 155 template <class ParentT> inline 153 156 void AttachmentMixin<ParentT>::setInternal(bool bVal) … … 157 160 _sfInternal.setValue(bVal); 158 161 } 159 162 163 /*-------------------------------------------------------------------------*/ 164 /* your_category */ 165 160 166 template <class ParentT> inline 161 167 void AttachmentMixin<ParentT>::addParent( 162 168 ParentPtrConst &parent, … … 186 192 } 187 193 188 194 /*-------------------------------------------------------------------------*/ 189 /* Comparison*/195 /* Binary Access */ 190 196 197 template <class ParentT> 198 UInt32 199 AttachmentMixin<ParentT>::getBinSize(ConstFieldMaskArg whichField) 200 { 201 UInt32 returnValue = Inherited::getBinSize(whichField); 202 203 if(FieldBits::NoField != (ParentsFieldMask & whichField)) 204 { 205 returnValue += _mfParents.getBinSize(); 206 } 207 208 if(FieldBits::NoField != (InternalFieldMask & whichField)) 209 { 210 returnValue += _sfInternal.getBinSize(); 211 } 212 213 return returnValue; 214 } 215 216 template <class ParentT> 217 void 218 AttachmentMixin<ParentT>::copyToBin(BinaryDataHandler &pMem, 219 ConstFieldMaskArg whichField) 220 { 221 Inherited::copyToBin(pMem, whichField); 222 223 if(FieldBits::NoField != (ParentsFieldMask & whichField)) 224 { 225 _mfParents.copyToBin(pMem); 226 } 227 228 if(FieldBits::NoField != (InternalFieldMask & whichField)) 229 { 230 _sfInternal.copyToBin(pMem); 231 } 232 } 233 234 template <class ParentT> 235 void 236 AttachmentMixin<ParentT>::copyFromBin(BinaryDataHandler &pMem, 237 ConstFieldMaskArg whichField) 238 { 239 Inherited::copyFromBin(pMem, whichField); 240 241 if(FieldBits::NoField != (ParentsFieldMask & whichField)) 242 { 243 _mfParents.copyFromBin(pMem); 244 } 245 246 if(FieldBits::NoField != (InternalFieldMask & whichField)) 247 { 248 _sfInternal.copyFromBin(pMem); 249 } 250 } 251 252 191 253 OSG_END_NAMESPACE 192 254 193 255 #define OSGATTACHMENTMIXIN_INLINE_CVSID "@(#)$Id$" -
Source/System/FieldContainer/Mixins/OSGAttachmentContainerMixin.inl
old new 60 60 oType.addInitialDesc(pDesc); 61 61 } 62 62 63 /*-------------------------------------------------------------------------*/ 64 /* Set */ 63 65 66 template <class ParentT> 67 void 68 AttachmentContainerMixin<ParentT>::pushToField( 69 FieldContainerPtrConstArg pNewElement, 70 const UInt32 uiFieldId ) 71 { 72 Inherited::pushToField(pNewElement, uiFieldId); 73 74 if(uiFieldId == AttachmentsFieldId) 75 { 76 addAttachment(cast_dynamic<AttachmentObjPtr>(pNewElement)); 77 } 78 } 79 80 template <class ParentT> 81 void 82 AttachmentContainerMixin<ParentT>::insertIntoMField( 83 const UInt32 uiIndex, 84 FieldContainerPtrConstArg pNewElement, 85 const UInt32 uiFieldId ) 86 { 87 Inherited::insertIntoMField(uiIndex, pNewElement, uiFieldId); 88 89 FWARNING(("AttachmentContainerMixin::insertIntoMField: NIY\n")); 90 } 91 92 template <class ParentT> 93 void 94 AttachmentContainerMixin<ParentT>::replaceInMField ( 95 const UInt32 uiIndex, 96 FieldContainerPtrConstArg pNewElement, 97 const UInt32 uiFieldId ) 98 { 99 Inherited::replaceInMField(uiIndex, pNewElement, uiFieldId); 100 101 FWARNING(("AttachmentContainerMixin::replaceInMField: NIY\n")); 102 } 103 104 template <class ParentT> 105 void 106 AttachmentContainerMixin<ParentT>::replaceInMField ( 107 FieldContainerPtrConstArg pOldElement, 108 FieldContainerPtrConstArg pNewElement, 109 const UInt32 uiFieldId ) 110 { 111 Inherited::replaceInMField(pOldElement, pNewElement, uiFieldId); 112 113 FWARNING(("AttachmentContainerMixin::replaceInMField: NIY\n")); 114 } 115 116 template <class ParentT> 117 void 118 AttachmentContainerMixin<ParentT>::removeFromMField( 119 const UInt32 uiIndex, 120 const UInt32 uiFieldId ) 121 { 122 Inherited::removeFromMField(uiIndex, uiFieldId); 123 124 FWARNING(("AttachmentContainerMixin::removeFromMField: NIY\n")); 125 } 126 127 template <class ParentT> 128 void 129 AttachmentContainerMixin<ParentT>::removeFromMField( 130 FieldContainerPtrConstArg pElement, 131 const UInt32 uiFieldId ) 132 { 133 Inherited::removeFromMField(pElement, uiFieldId); 134 135 FWARNING(("AttachmentContainerMixin::removeFromMField: NIY\n")); 136 } 137 138 template <class ParentT> 139 void 140 AttachmentContainerMixin<ParentT>::clearField( 141 const UInt32 uiFieldId ) 142 { 143 Inherited::clearField(uiFieldId); 144 145 FWARNING(("AttachmentContainerMixin::clearField: NIY\n")); 146 } 147 148 /*-------------------------------------------------------------------------*/ 149 /* Assignment */ 150 64 151 /** 65 152 * Add an attachment at the binding point. 66 153 * -
Source/System/FieldContainer/Mixins/OSGSimpleAttachment.inl
old new 194 194 UInt32 SimpleAttachment<AttachmentDescT>::getBinSize( 195 195 ConstFieldMaskArg whichField) 196 196 { 197 return 0; 197 UInt32 returnValue = Inherited::getBinSize(whichField); 198 199 if(FieldBits::NoField != (SimpleFieldMask & whichField)) 200 { 201 returnValue += _field.getBinSize(); 202 } 203 204 return returnValue; 198 205 } 199 206 200 207 … … 203 210 BinaryDataHandler &pMem, 204 211 ConstFieldMaskArg whichField) 205 212 { 213 Inherited::copyToBin(pMem, whichField); 214 215 if(FieldBits::NoField != (SimpleFieldMask & whichField)) 216 { 217 _field.copyToBin(pMem); 218 } 206 219 } 207 220 208 221 template <class AttachmentDescT> inline … … 210 223 BinaryDataHandler &pMem, 211 224 ConstFieldMaskArg whichField) 212 225 { 226 Inherited::copyFromBin(pMem, whichField); 227 228 if(FieldBits::NoField != (SimpleFieldMask & whichField)) 229 { 230 _field.copyFromBin(pMem); 231 } 213 232 } 214 233 215 234 template <class AttachmentDescT> inline -
Source/System/FieldContainer/Mixins/OSGAttachmentMixin.h
old new 145 145 /*! \name Binary Access */ 146 146 /*! \{ */ 147 147 148 virtual UInt32 getBinSize (ConstFieldMaskArg whichField); 149 virtual void copyToBin (BinaryDataHandler &pMem, 150 ConstFieldMaskArg whichField); 151 virtual void copyFromBin(BinaryDataHandler &pMem, 152 ConstFieldMaskArg whichField); 153 148 154 /*! \} */ 149 155 /*---------------------------------------------------------------------*/ 150 156 /*! \name your_operators */ -
Source/System/FieldContainer/Mixins/OSGAttachmentContainerMixin.h
old new 117 117 /*! \name Set */ 118 118 /*! \{ */ 119 119 120 virtual void pushToField ( FieldContainerPtrConstArg pNewElement, 121 const UInt32 uiFieldId ); 122 123 virtual void insertIntoMField(const UInt32 uiIndex, 124 FieldContainerPtrConstArg pNewElement, 125 const UInt32 uiFieldId ); 126 127 virtual void replaceInMField (const UInt32 uiIndex, 128 FieldContainerPtrConstArg pNewElement, 129 const UInt32 uiFieldId ); 130 131 virtual void replaceInMField ( FieldContainerPtrConstArg pOldElement, 132 FieldContainerPtrConstArg pNewElement, 133 const UInt32 uiFieldId ); 134 135 virtual void removeFromMField(const UInt32 uiIndex, 136 const UInt32 whichField ); 137 138 virtual void removeFromMField( FieldContainerPtrConstArg pElement, 139 const UInt32 whichField ); 140 141 virtual void clearField (const UInt32 whichField ); 142 120 143 /*! \} */ 121 144 /*---------------------------------------------------------------------*/ 122 145 /*! \name your_category */ -
Source/System/FieldContainer/Base/OSGFieldContainerAttachment.cpp
old new 49 49 50 50 OSG_USING_NAMESPACE 51 51 52 /*-------------------------------------------------------------------------*/ 53 /* Fields */ 54 52 55 void FieldContainerAttachment::classDescInserter(TypeObject &oType) 53 56 { 54 57 Inherited::classDescInserter(oType); -
Source/Base/Field/OSGSysFieldTraits.h
old new 576 576 static Char8 *getMName (void) { return "MFVoidP"; } 577 577 578 578 static void *getDefault (void) { return NULL; } 579 580 // Binary 581 582 // TODO Is it correct to just ignore these for binary ?? 583 584 static UInt32 getBinSize(void * const &) 585 { 586 return 0; 587 } 588 589 static UInt32 getBinSize(void* const*, 590 UInt32 ) 591 { 592 return 0; 593 } 594 595 static void copyToBin(BinaryDataHandler &, 596 void * const & ) 597 { 598 } 599 600 static void copyToBin(BinaryDataHandler &, 601 void * const *, 602 UInt32 ) 603 { 604 } 605 606 static void copyFromBin(BinaryDataHandler &, 607 void * const & ) 608 { 609 } 610 611 static void copyFromBin(BinaryDataHandler &, 612 void * const *, 613 UInt32 ) 614 { 615 } 579 616 }; 580 617 581 618 #endif // !defined(OSG_DO_DOC) || (OSG_DOC_LEVEL >= 3)
