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 #ifndef _OSGNODECORE_H_
00038 #define _OSGNODECORE_H_
00039 #ifdef __sgi
00040 #pragma once
00041 #endif
00042
00043 #ifdef OSG_DOC_FILES_IN_MODULE
00044
00047 #endif
00048
00049 #include <map>
00050
00051 #include <OSGSystemDef.h>
00052 #include <OSGBaseTypes.h>
00053 #include <OSGMatrix.h>
00054 #include <OSGAttachmentContainerPtr.h>
00055 #include <OSGAttachmentContainer.h>
00056 #include <OSGNodeFields.h>
00057 #include <OSGDynamicVolume.h>
00058 #include <OSGRefPtr.h>
00059
00060 OSG_BEGIN_NAMESPACE
00061
00062 class BinaryDataHandler;
00063 class NodeCore;
00064
00065
00066 #if !defined(OSG_DO_DOC)
00067 typedef FCPtr<AttachmentContainerPtr, NodeCore> NodeCorePtr;
00068 #endif
00069
00070 typedef RefPtr<NodeCorePtr> NodeCoreRefPtr;
00071
00075 class OSG_SYSTEMLIB_DLLMAPPING NodeCore : public AttachmentContainer
00076 {
00077
00078
00079 protected:
00080
00081 typedef AttachmentContainer Inherited;
00082
00083 public:
00084
00085 typedef MFNodePtr ParentField;
00086 typedef MFNodePtr *ParentFieldPtr;
00087 typedef MFNodePtr::iterator ParentFieldIt;
00088
00089
00090
00091 public:
00092
00093 enum
00094 {
00095 ParentsFieldId = Inherited::NextFieldId,
00096 NextFieldId = ParentsFieldId + 1
00097 };
00098
00099 static const BitVector ParentsFieldMask;
00100
00101
00105 OSG_ABSTR_FIELD_CONTAINER_DECL(NodeCorePtr)
00106
00107
00108
00112 MFNodePtr &getParents (void);
00113 const MFNodePtr &getParents (void) const;
00114
00115 MFNodePtr *getMFParents(void);
00116
00118
00122 virtual UInt32 getBinSize (const BitVector &whichField);
00123
00124 virtual void copyToBin ( BinaryDataHandler &pMem,
00125 const BitVector &whichField);
00126 virtual void copyFromBin( BinaryDataHandler &pMem,
00127 const BitVector &whichField);
00128
00130
00134 virtual void dump( UInt32 uiIndent = 0,
00135 const BitVector bvFlags = 0) const;
00136
00138
00142 virtual void invalidateVolume(void);
00143
00145
00149 static const bool isNodeCore = true;
00150
00152
00153
00154 protected:
00155
00156
00160 static FieldDescription *_desc[];
00161 static FieldContainerType _type;
00162
00164
00168 MFNodePtr _parents;
00169
00171
00175 NodeCore(void);
00176 NodeCore(const NodeCore &obj);
00177
00179
00183 virtual ~NodeCore(void);
00184
00186
00190 virtual void onDestroy(void);
00191
00192 #if defined(OSG_FIXED_MFIELDSYNC)
00193 virtual void onDestroyAspect(UInt32 uiId, UInt32 uiAspect);
00194 #endif
00195
00197
00201 void addParent(const NodePtr &parent);
00202 void subParent(const NodePtr &parent);
00203
00205
00209 NodeCorePtr getPtr(void) const;
00210
00212
00216 #if !defined(OSG_FIXED_MFIELDSYNC)
00217 virtual void executeSync ( FieldContainer &other,
00218 const BitVector &whichField);
00219
00220 void executeSyncImpl( NodeCore *pOther,
00221 const BitVector &whichField);
00222 #else
00223 virtual void executeSync ( FieldContainer &other,
00224 const BitVector &whichField,
00225 const SyncInfo &sInfo );
00226
00227 void executeSyncImpl( NodeCore *pOther,
00228 const BitVector &whichField,
00229 const SyncInfo &sInfo );
00230 #endif
00231
00233
00237 virtual void accumulateMatrix(Matrix &result);
00238
00240
00244 virtual void adjustVolume (Volume &volume);
00245
00247
00248
00249 private:
00250
00251 friend class Node;
00252 friend class Attachment;
00253 friend class FieldContainer;
00254
00255
00256 void operator =(const NodeCore &source);
00257 };
00258
00259 OSG_END_NAMESPACE
00260
00261 #include <OSGNodeCore.inl>
00262
00263 #define OSGNODECORE_HEADER_CVSID "@(#)$Id: $"
00264
00265 #endif