00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037 #ifdef OSG_DOC_FILES_IN_MODULE
00038
00041 #endif
00042
00043 #include <stdlib.h>
00044 #include <stdio.h>
00045
00046 #include "OSGConfig.h"
00047
00048 OSG_BEGIN_NAMESPACE
00049
00050 OSG_ABSTR_FIELD_CONTAINER_INL_DEF(NodeCore, NodeCorePtr)
00051
00052
00053
00054
00055 inline
00056 MFNodePtr &NodeCore::getParents(void)
00057 {
00058 return _parents;
00059 }
00060
00061 inline
00062 const MFNodePtr &NodeCore::getParents(void) const
00063 {
00064 return _parents;
00065 }
00066
00067 inline
00068 MFNodePtr *NodeCore::getMFParents(void)
00069 {
00070 return &_parents;
00071 }
00072
00073
00074
00075
00076 inline
00077 UInt32 NodeCore::getBinSize(const BitVector &whichField)
00078 {
00079 UInt32 returnValue = Inherited::getBinSize(whichField);
00080
00081 if(FieldBits::NoField != (ParentsFieldMask & whichField))
00082 {
00083 returnValue += _parents.getBinSize();
00084 }
00085
00086 return returnValue;
00087 }
00088
00089 inline
00090 void NodeCore::copyToBin( BinaryDataHandler &pMem,
00091 const BitVector &whichField)
00092 {
00093 Inherited::copyToBin(pMem, whichField);
00094
00095 if(FieldBits::NoField != (ParentsFieldMask & whichField))
00096 {
00097 _parents.copyToBin(pMem);
00098 }
00099 }
00100
00101 inline
00102 void NodeCore::copyFromBin( BinaryDataHandler &pMem,
00103 const BitVector &whichField)
00104 {
00105 Inherited::copyFromBin(pMem, whichField);
00106
00107 if(FieldBits::NoField != (ParentsFieldMask & whichField))
00108 {
00109 _parents.copyFromBin(pMem);
00110 }
00111 }
00112
00113
00114
00115
00116 inline
00117 NodeCore::NodeCore(void) :
00118 Inherited(),
00119 _parents ()
00120 {
00121 }
00122
00123 inline
00124 NodeCore::NodeCore(const NodeCore &obj) :
00125 Inherited(obj),
00126 _parents ( )
00127 {
00128 }
00129
00130
00131
00132
00133 inline
00134 NodeCore::~NodeCore(void)
00135 {
00136 }
00137
00138
00139
00140
00141 inline
00142 void NodeCore::onDestroy(void)
00143 {
00144 }
00145
00146
00147
00148
00149 inline
00150 void NodeCore::addParent(const NodePtr &parent)
00151 {
00152 _parents.push_back(parent);
00153 }
00154
00155 inline
00156 void NodeCore::subParent(const NodePtr &parent)
00157 {
00158 MFNodePtr::iterator parentIt = _parents.find(parent);
00159
00160 if(parentIt != _parents.end())
00161 {
00162 _parents.erase(parentIt);
00163 }
00164 }
00165
00166
00167
00168
00169 inline
00170 NodeCorePtr NodeCore::getPtr(void) const
00171 {
00172 return NodeCorePtr(*this);
00173 }
00174
00175
00176
00177
00178 #if !defined(OSG_FIXED_MFIELDSYNC)
00179 inline
00180 void NodeCore::executeSyncImpl( NodeCore *pOther,
00181 const BitVector &whichField)
00182 {
00183 Inherited::executeSyncImpl(pOther, whichField);
00184
00185 if(FieldBits::NoField != (ParentsFieldMask & whichField))
00186 {
00187 _parents.syncWith(pOther->_parents);
00188 }
00189 }
00190
00191 inline
00192 void NodeCore::executeSync( FieldContainer &other,
00193 const BitVector &whichField)
00194 {
00195 this->executeSyncImpl((NodeCore *) &other, whichField);
00196 }
00197 #else
00198 inline
00199 void NodeCore::executeSyncImpl( NodeCore *pOther,
00200 const BitVector &whichField,
00201 const SyncInfo &sInfo )
00202 {
00203 Inherited::executeSyncImpl(pOther, whichField, sInfo);
00204
00205 if(FieldBits::NoField != (ParentsFieldMask & whichField))
00206 {
00207 _parents.syncWith(pOther->_parents, sInfo);
00208 }
00209 }
00210
00211 inline
00212 void NodeCore::executeSync( FieldContainer &other,
00213 const BitVector &whichField,
00214 const SyncInfo &sInfo )
00215 {
00216 this->executeSyncImpl((NodeCore *) &other, whichField, sInfo);
00217 }
00218 #endif
00219
00220
00221
00222
00223 inline
00224 void NodeCore::accumulateMatrix(Matrix &)
00225 {
00226 }
00227
00228
00229
00230
00231 inline
00232 void NodeCore::adjustVolume(Volume &)
00233 {
00234 }
00235
00236 inline
00237 void NodeCore::invalidateVolume(void)
00238 {
00239 for(UInt32 i = 0; i < _parents.size(); i++)
00240 {
00241 _parents[i]->invalidateVolume();
00242 }
00243 }
00244
00245
00246 OSG_END_NAMESPACE
00247
00248 #define OSGNODECORE_INLINE_CVSID "@(#)$Id: $"
00249