#include <OSGNodeImpl.h>
Inheritance diagram for osg::Node:

General Fieldcontainer Declaration | |
| *virtual osg::FieldContainerType & | getType (void) |
| virtual const osg::FieldContainerType & | getType (void) const |
| virtual osg::FieldContainerPtr | shallowCopy (void) const |
| virtual osg::UInt32 | getContainerSize (void) const |
| static osg::FieldContainerType & | getClassType (void) |
| static osg::UInt32 | getClassTypeId (void) |
| static NodePtr | create (void) |
| static NodePtr | createEmpty (void) |
Public Types | |
| typedef NodePtr | Ptr |
| enum | { VolumeFieldId = Inherited::NextFieldId, TravMaskFieldId = VolumeFieldId + 1, ParentFieldId = TravMaskFieldId + 1, ChildrenFieldId = ParentFieldId + 1, CoreFieldId = ChildrenFieldId + 1, NextFieldId = CoreFieldId + 1 } |
Public Member Functions | |
Core | |
| *NodeCorePtr | getCore (void) |
| NodeCorePtr | getCore (void) const |
| void | setCore (const NodeCorePtr &core) |
Parent | |
| *NodePtr | getParent (void) |
Children | |
| *UInt32 | getNChildren (void) const |
| void | addChild (const NodePtr &childP) |
| void | insertChild (UInt32 childIndex, const NodePtr &childP) |
| void | replaceChild (UInt32 childIndex, const NodePtr &childP) |
| bool | replaceChildBy (const NodePtr &childP, const NodePtr &newChildP) |
| return true on success, false on child not found | |
| Int32 | findChild (const NodePtr &childP) const |
| void | subChild (const NodePtr &childP) |
| void | subChild (UInt32 childIndex) |
| NodePtr | getChild (UInt32 childIndex) |
Active / TravMask | |
| *bool | getActive (void) const |
| void | setActive (bool val) |
| void | setTravMask (UInt32 val) |
| UInt32 | getTravMask (void) const |
Children | |
| *NodePtr | clone (void) |
Access Fields | |
| *SFDynamicVolume * | getSFVolume (void) |
| SFUInt32 * | getSFTravMask (void) |
| SFNodePtr * | getSFParent (void) |
| SFNodeCorePtr * | getSFCore (void) |
| MFNodePtr * | getMFChildren (void) |
Transformation | |
| *Matrix | getToWorld (void) |
| void | getToWorld (Matrix &result) |
Volume | |
| *DynamicVolume & | getVolume (bool update) |
| const DynamicVolume & | getVolume (void) const |
| void | getWorldVolume (DynamicVolume &result) |
| void | updateVolume (void) |
| void | invalidateVolume (void) |
Changed | |
| *virtual void | changed (BitVector whichField, UInt32 origin) |
Binary Access | |
| *virtual UInt32 | getBinSize (const BitVector &whichField) |
| virtual void | copyToBin (BinaryDataHandler &pMem, const BitVector &whichField) |
| virtual void | copyFromBin (BinaryDataHandler &pMem, const BitVector &whichField) |
Dump | |
| *virtual void | dump (UInt32 uiIndent=0, const BitVector bvFlags=0) const |
Handle Attachments | |
| *void | addAttachment (const AttachmentPtr &fieldContainerP, UInt16 binding=0) |
| void | subAttachment (const AttachmentPtr &fieldContainerP, UInt16 binding=0) |
| AttachmentPtr | findAttachment (UInt32 groupId, UInt16 binding=0) |
| AttachmentPtr | findAttachment (const FieldContainerType &type, UInt16 binding=0) |
| Field Access *SFAttachmentMap * | getSFAttachments (void) |
Get Instance Type Information | |
| UInt32 | getTypeId (void) const |
| UInt16 | getGroupId (void) const |
| const Char8 * | getTypeName (void) const |
| Generic Field Access *Field * | getField (UInt32 fieldId) |
| Field * | getField (const Char8 *fieldName) |
Handle Attachments | |
| *void | addAttachment (const AttachmentPtr &fieldContainerP, UInt16 binding=0) |
| void | subAttachment (const AttachmentPtr &fieldContainerP, UInt16 binding=0) |
| AttachmentPtr | findAttachment (UInt32 groupId, UInt16 binding=0) |
| AttachmentPtr | findAttachment (const FieldContainerType &type, UInt16 binding=0) |
| Field Access *SFAttachmentMap * | getSFAttachments (void) |
Get Instance Type Information | |
| UInt32 | getTypeId (void) const |
| UInt16 | getGroupId (void) const |
| const Char8 * | getTypeName (void) const |
| Generic Field Access *Field * | getField (UInt32 fieldId) |
| Field * | getField (const Char8 *fieldName) |
Static Public Member Functions | |
Get Class Type Information | |
| static UInt16 | getClassGroupId (void) |
Get Class Type Information | |
| static UInt16 | getClassGroupId (void) |
Static Public Attributes | |
| static const BitVector | VolumeFieldMask |
| static const BitVector | TravMaskFieldMask |
| static const BitVector | ParentFieldMask |
| static const BitVector | ChildrenFieldMask |
| static const BitVector | CoreFieldMask |
| static const BitVector | AttachmentsFieldMask |
| static const BitVector | NextFieldMask |
| static const BitVector | MTInfluenceMask = 0x00 |
CoredNodePtr helper | |
| static const bool | isNodeCore = false |
Protected Types | |
| typedef AttachmentContainer | Inherited |
Protected Member Functions | |
Constructors | |
| * | Node (void) |
| Node (const Node &source) | |
Destructor | |
| *virtual | ~Node (void) |
MT Construction | |
| *void | setParent (const NodePtr &parent) |
| void | onCreate (const Node *source=NULL) |
Sync | |
| *virtual void | executeSync (FieldContainer &other, const BitVector &whichField) |
| void | executeSyncImpl (Node *pOther, const BitVector &whichField) |
Pointer | |
| *NodePtr | getPtr (void) const |
Sync | |
| void | executeSyncImpl (AttachmentContainer *pOther, const BitVector &whichField) |
Sync | |
| void | executeSyncImpl (FieldContainer *pOther, const BitVector &whichField) |
Pointer | |
| *AttachmentContainerPtr | getPtr (void) |
MT Edit | |
| template<class FieldTypeT> | |
| *void | beginEditX (const BitVector &whichField, FieldTypeT &field) |
| template<class FieldTypeT> | |
| void | endEditX (const BitVector &whichField, FieldTypeT &field) |
MT Construction | |
| *void | onCreate (const FieldContainer *source=NULL) |
| void | onCreateAspect (const FieldContainer *aspect0, const FieldContainer *source=NULL) |
MT Destruction | |
| *virtual void | onDestroy (void) |
Sync | |
| void | executeSyncImpl (AttachmentContainer *pOther, const BitVector &whichField) |
Sync | |
| void | executeSyncImpl (FieldContainer *pOther, const BitVector &whichField) |
Pointer | |
| *AttachmentContainerPtr | getPtr (void) |
MT Edit | |
| template<class FieldTypeT> | |
| *void | beginEditX (const BitVector &whichField, FieldTypeT &field) |
| template<class FieldTypeT> | |
| void | endEditX (const BitVector &whichField, FieldTypeT &field) |
MT Construction | |
| *void | onCreate (const FieldContainer *source=NULL) |
| void | onCreateAspect (const FieldContainer *aspect0, const FieldContainer *source=NULL) |
Static Protected Member Functions | |
Create Fieldcontainer | |
| template<class ObjectPtrT> | |
| *static void | newPtr (ObjectPtrT &result, const typename ObjectPtrT::StoredObjectType *prototypeP) |
| template<class ObjectPtrT> | |
| static void | newPtr (ObjectPtrT &result) |
Create Fieldcontainer | |
| template<class ObjectPtrT> | |
| *static void | newPtr (ObjectPtrT &result, const typename ObjectPtrT::StoredObjectType *prototypeP) |
| template<class ObjectPtrT> | |
| static void | newPtr (ObjectPtrT &result) |
Protected Attributes | |
Fields | |
| *SFDynamicVolume | _sfVolume |
| SFUInt32 | _sfTravMask |
| SFNodePtr | _sfParent |
| MFNodePtr | _mfChildren |
| SFNodeCorePtr | _sfCore |
Fields | |
| *SFAttachmentMap | _attachmentMap |
Member | |
| *UInt32 | _shares |
Fields | |
| *SFAttachmentMap | _attachmentMap |
Member | |
| *UInt32 | _shares |
Static Protected Attributes | |
Type information | |
| *static FieldDescription * | _desc [] |
| static FieldContainerType | _type |
| static const NodePtr | NullNode |
Private Member Functions | |
| void | operator= (const Node &source) |
Friends | |
| class | FieldContainer |
| class | FieldContainerType |
Definition at line 75 of file OSGNodeImpl.h.
|
|
Reimplemented from osg::AttachmentContainer. Definition at line 81 of file OSGNodeImpl.h. |
|
|
Definition at line 103 of file OSGNodeImpl.h. |
|
|
Reimplemented from osg::AttachmentContainer. Definition at line 87 of file OSGNodeImpl.h. 00088 { 00089 VolumeFieldId = Inherited::NextFieldId, 00090 TravMaskFieldId = VolumeFieldId + 1, 00091 ParentFieldId = TravMaskFieldId + 1, 00092 ChildrenFieldId = ParentFieldId + 1, 00093 CoreFieldId = ChildrenFieldId + 1, 00094 NextFieldId = CoreFieldId + 1 00095 };
|
|
|
Definition at line 620 of file OSGNode.cpp. 00620 : 00621 Inherited (), 00622 _sfVolume (), 00623 _sfTravMask (TypeTraits<UInt32>::getMax()), 00624 _sfParent (), 00625 _mfChildren (), 00626 _sfCore () 00627 { 00628 }
|
|
|
Definition at line 630 of file OSGNode.cpp. 00630 : 00631 Inherited (source), 00632 _sfVolume (source._sfVolume), 00633 _sfTravMask (source._sfTravMask), 00634 _sfParent (), 00635 _mfChildren (), 00636 _sfCore () 00637 { 00638 }
|
|
|
|
Reimplemented from osg::AttachmentContainer. Definition at line 120 of file OSGNode.cpp. |
|
|
Reimplemented from osg::AttachmentContainer. Definition at line 120 of file OSGNode.cpp. |
|
|
Reimplemented from osg::AttachmentContainer. Referenced by osg::BINWriter::doIndexFC(), and osg::FieldContainerType::initBaseType(). |
|
|
Reimplemented from osg::AttachmentContainer. |
|
|
|
|
|
|
Implements osg::FieldContainer. Definition at line 120 of file OSGNode.cpp. |
|
|
Reimplemented from osg::AttachmentContainer. Definition at line 120 of file OSGNode.cpp. |
|
|
Definition at line 106 of file OSGNodePtrDepImpl.inl. References _sfCore, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). Referenced by getToWorld(), onCreate(), updateVolume(), osg::VRMLWriteAction::writeComponentTransformEnter(), osg::VRMLWriteAction::writeMatGroupEnter(), and osg::VRMLWriteAction::writeTransformEnter(). 00107 { 00108 return _sfCore.getValue(); 00109 }
|
|
|
Definition at line 112 of file OSGNodePtrDepImpl.inl. References _sfCore, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). 00113 { 00114 return _sfCore.getValue(); 00115 }
|
|
|
Definition at line 125 of file OSGNode.cpp. References osg::addRefCP(), osg::beginEditCP(), osg::endEditCP(), osg::NullFC, osg::FieldContainerPtrBase::setParentFieldPos(), and osg::subRefCP(). Referenced by onCreate(). 00126 { 00127 NodePtr thisP = getPtr(); 00128 00129 thisP.setParentFieldPos(CoreFieldId); 00130 00131 addRefCP(core); 00132 00133 if(_sfCore.getValue() != NullFC) 00134 { 00135 beginEditCP(_sfCore.getValue(), NodeCore::ParentsFieldMask); 00136 { 00137 _sfCore.getValue()->subParent(thisP); 00138 } 00139 endEditCP (_sfCore.getValue(), NodeCore::ParentsFieldMask); 00140 00141 subRefCP(_sfCore.getValue()); 00142 } 00143 00144 _sfCore.setValue(core); 00145 00146 if(_sfCore.getValue() != NullFC) 00147 { 00148 beginEditCP(_sfCore.getValue(), NodeCore::ParentsFieldMask); 00149 { 00150 _sfCore.getValue()->addParent(thisP); 00151 } 00152 endEditCP (_sfCore.getValue(), NodeCore::ParentsFieldMask); 00153 } 00154 00155 // TODO Check if required (GV) 00156 invalidateVolume(); 00157 }
|
|
|
Definition at line 72 of file OSGNodeImpl.inl. References _sfParent, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). Referenced by changed(), getToWorld(), getWorldVolume(), and invalidateVolume(). 00073 { 00074 return _sfParent.getValue(); 00075 }
|
|
|
Definition at line 78 of file OSGNodeImpl.inl. References _mfChildren, and osg::MField< FieldTypeT, fieldNameSpace >::size(). 00079 { 00080 return _mfChildren.size(); 00081 }
|
|
|
Definition at line 162 of file OSGNode.cpp. References _mfChildren, osg::addRefCP(), osg::beginEditCP(), ChildrenFieldMask, osg::endEditCP(), getPtr(), invalidateVolume(), osg::NullFC, ParentFieldMask, and osg::MField< FieldTypeT, fieldNameSpace >::push_back(). 00163 { 00164 if(childP != NullFC) 00165 { 00166 // do the ref early, to prevent destroys on getParent(a)->addChild(a) 00167 addRefCP(childP); 00168 00169 // already somebody else's child? 00170 if(childP->getParent() != NullFC) 00171 { 00172 beginEditCP(childP->getParent(), Node::ChildrenFieldMask); 00173 childP->getParent()->subChild(childP); 00174 endEditCP(childP->getParent(), Node::ChildrenFieldMask); 00175 } 00176 00177 _mfChildren.push_back(childP); 00178 00179 beginEditCP(childP, Node::ParentFieldMask); 00180 { 00181 childP->setParent(getPtr()); 00182 } 00183 endEditCP (childP, Node::ParentFieldMask); 00184 00185 // TODO Check if required (GV) 00186 #ifndef OSG_GV_BETA 00187 invalidateVolume(); 00188 #endif 00189 } 00190 }
|
|
||||||||||||
|
Definition at line 192 of file OSGNode.cpp. References _mfChildren, osg::addRefCP(), osg::MField< FieldTypeT, fieldNameSpace >::begin(), osg::beginEditCP(), ChildrenFieldMask, osg::endEditCP(), getPtr(), osg::MField< FieldTypeT, fieldNameSpace >::insert(), invalidateVolume(), osg::NullFC, and ParentFieldMask. 00193 { 00194 MFNodePtr::iterator childIt = _mfChildren.begin(); 00195 00196 if(childP != NullFC) 00197 { 00198 // do the ref early, to prevent destroys on getParent(a)->addChild(a) 00199 addRefCP(childP); 00200 00201 // already somebody else's child? 00202 if(childP->getParent() != NullFC) 00203 { 00204 beginEditCP(childP->getParent(), Node::ChildrenFieldMask); 00205 childP->getParent()->subChild(childP); 00206 endEditCP(childP->getParent(), Node::ChildrenFieldMask); 00207 } 00208 00209 childIt += childIndex; 00210 00211 _mfChildren.insert(childIt, childP); 00212 00213 beginEditCP(childP, Node::ParentFieldMask); 00214 { 00215 childP->setParent(getPtr()); 00216 } 00217 endEditCP (childP, Node::ParentFieldMask); 00218 } 00219 00220 // TODO check if required (GV) 00221 #ifndef OSG_GV_BETA 00222 invalidateVolume(); 00223 #endif 00224 }
|
|
||||||||||||
|
Definition at line 226 of file OSGNode.cpp. References _mfChildren, osg::addRefCP(), osg::beginEditCP(), ChildrenFieldMask, osg::endEditCP(), getPtr(), invalidateVolume(), osg::NullFC, NullNode, ParentFieldMask, osg::MField< FieldTypeT, fieldNameSpace >::size(), and osg::subRefCP(). 00227 { 00228 if(childP != NullFC && childIndex < _mfChildren.size()) 00229 { 00230 // do the ref early, to prevent destroys on getParent(a)->addChild(a) 00231 addRefCP(childP); 00232 00233 // remove the current child 00234 beginEditCP(_mfChildren[childIndex], Node::ParentFieldMask); 00235 { 00236 _mfChildren[childIndex]->setParent(NullNode); 00237 } 00238 endEditCP (_mfChildren[childIndex], Node::ParentFieldMask); 00239 00240 subRefCP(_mfChildren[childIndex]); 00241 00242 // already somebody else's child? 00243 if(childP->getParent() != NullNode) 00244 { 00245 beginEditCP(childP->getParent(), Node::ChildrenFieldMask); 00246 childP->getParent()->subChild(childP); 00247 endEditCP(childP->getParent(), Node::ChildrenFieldMask); 00248 } 00249 00250 // set the new child 00251 _mfChildren[childIndex] = childP; 00252 00253 beginEditCP(childP, Node::ParentFieldMask); 00254 { 00255 childP->setParent(getPtr()); 00256 } 00257 endEditCP (childP, Node::ParentFieldMask); 00258 } 00259 00260 // TODO check if required (GV) 00261 #ifndef OSG_GV_BETA 00262 invalidateVolume(); 00263 #endif 00264 }
|
|
||||||||||||
|
Definition at line 268 of file OSGNode.cpp. References _mfChildren, osg::addRefCP(), osg::beginEditCP(), ChildrenFieldMask, osg::MField< FieldTypeT, fieldNameSpace >::end(), osg::endEditCP(), osg::MField< FieldTypeT, fieldNameSpace >::find(), getPtr(), invalidateVolume(), osg::NullFC, NullNode, ParentFieldMask, and osg::subRefCP(). 00270 { 00271 MFNodePtr::iterator childIt = _mfChildren.find(childP); 00272 00273 if(newChildP != NullFC) 00274 { 00275 if(childIt != _mfChildren.end()) 00276 { 00277 // do the ref early, to prevent destroys on 00278 // getParent(a)->addChild(a) 00279 00280 addRefCP(newChildP); 00281 00282 beginEditCP(childP, Node::ParentFieldMask); 00283 { 00284 childP->setParent(NullNode); 00285 } 00286 endEditCP (childP, Node::ParentFieldMask); 00287 00288 subRefCP(childP); 00289 00290 // already somebody else's child? 00291 if(newChildP->getParent() != NullFC) 00292 { 00293 beginEditCP(newChildP->getParent(), Node::ChildrenFieldMask); 00294 newChildP->getParent()->subChild(newChildP); 00295 endEditCP(newChildP->getParent(), Node::ChildrenFieldMask); 00296 } 00297 00298 (*childIt) = newChildP; 00299 00300 beginEditCP(newChildP, Node::ParentFieldMask); 00301 { 00302 newChildP->setParent(getPtr()); 00303 } 00304 endEditCP (newChildP, Node::ParentFieldMask); 00305 00306 // TODO check if required (GV) 00307 #ifndef OSG_GV_BETA 00308 invalidateVolume(); 00309 #endif 00310 00311 return true; 00312 } 00313 } 00314 00315 return false; 00316 }
|
|
|
Definition at line 318 of file OSGNode.cpp. References _mfChildren, and osg::MField< FieldTypeT, fieldNameSpace >::size(). 00319 { 00320 UInt32 index; 00321 00322 for(index = 0; index < _mfChildren.size(); index++) 00323 { 00324 if( _mfChildren[index] == childP) 00325 break; 00326 } 00327 00328 if(index < _mfChildren.size()) 00329 return index; 00330 else 00331 return -1; 00332 }
|
|
|
Definition at line 334 of file OSGNode.cpp. References _mfChildren, osg::beginEditCP(), osg::MField< FieldTypeT, fieldNameSpace >::end(), osg::endEditCP(), osg::MField< FieldTypeT, fieldNameSpace >::erase(), osg::MField< FieldTypeT, fieldNameSpace >::find(), invalidateVolume(), NullNode, ParentFieldMask, osg::subRefCP(), and SWARNING. 00335 { 00336 MFNodePtr::iterator childIt = _mfChildren.find(childP); 00337 00338 if(childIt != _mfChildren.end()) 00339 { 00340 beginEditCP(childP, Node::ParentFieldMask); 00341 { 00342 childP->setParent(NullNode); 00343 } 00344 endEditCP (childP, Node::ParentFieldMask); 00345 00346 subRefCP(childP); 00347 00348 _mfChildren.erase(childIt); 00349 } 00350 else 00351 { 00352 SWARNING << "Node(" << this << ")::subChild: " << childP 00353 << " is not one of my children!" << std::endl; 00354 } 00355 00356 // TODO check if required (GV) 00357 #ifndef OSG_GV_BETA 00358 invalidateVolume(); 00359 #endif 00360 }
|
|
|
Definition at line 362 of file OSGNode.cpp. References _mfChildren, osg::MField< FieldTypeT, fieldNameSpace >::begin(), osg::beginEditCP(), osg::MField< FieldTypeT, fieldNameSpace >::end(), osg::endEditCP(), osg::MField< FieldTypeT, fieldNameSpace >::erase(), invalidateVolume(), NullNode, ParentFieldMask, and osg::subRefCP(). 00363 { 00364 MFNodePtr::iterator childIt = _mfChildren.begin(); 00365 00366 childIt += childIndex; 00367 00368 if(childIt != _mfChildren.end()) 00369 { 00370 beginEditCP(*childIt, Node::ParentFieldMask); 00371 { 00372 (*childIt)->setParent(NullNode); 00373 } 00374 endEditCP (*childIt, Node::ParentFieldMask); 00375 00376 subRefCP(*childIt); 00377 00378 _mfChildren.erase(childIt); 00379 } 00380 00381 // TODO check if required (GV) 00382 #ifndef OSG_GV_BETA 00383 invalidateVolume(); 00384 #endif 00385 }
|
|
|
Definition at line 84 of file OSGNodeImpl.inl. References _mfChildren, OSG_ASSERT, and osg::MField< FieldTypeT, fieldNameSpace >::size(). 00085 { 00086 OSG_ASSERT((childIndex < _mfChildren.size())); 00087 00088 return _mfChildren[childIndex]; 00089 }
|
|
|
Definition at line 105 of file OSGNodeImpl.inl. References getTravMask(). 00106 { 00107 return getTravMask() == TypeTraits<UInt32>::getMax(); 00108 }
|
|
|
Definition at line 111 of file OSGNodeImpl.inl. References _sfTravMask, and osg::SField< FieldTypeT, fieldNameSpace >::setValue(). 00112 { 00113 _sfTravMask.setValue(val ? TypeTraits<UInt32>::getMax() : 00114 TypeTraits<UInt32>::getZeroElement() ); 00115 }
|
|
|
Definition at line 99 of file OSGNodeImpl.inl. References _sfTravMask, and osg::SField< FieldTypeT, fieldNameSpace >::setValue(). 00100 { 00101 _sfTravMask.setValue(val); 00102 }
|
|
|
Definition at line 93 of file OSGNodeImpl.inl. References _sfTravMask, and osg::SField< FieldTypeT, fieldNameSpace >::getValue(). Referenced by getActive(), and updateVolume(). 00094 { 00095 return _sfTravMask.getValue(); 00096 }
|