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 _OSGATTACHMENTCONTAINERIMPL_H_
00038 #define _OSGATTACHMENTCONTAINERIMPL_H_
00039 #ifdef __sgi
00040 #pragma once
00041 #endif
00042
00043 #ifdef OSG_DOC_FILES_IN_MODULE
00044
00047 #endif
00048
00049 #include <OSGSystemDef.h>
00050 #include <OSGBaseTypes.h>
00051 #include <OSGMatrix.h>
00052 #include <OSGFieldContainer.h>
00053 #include <OSGSFAttachmentMap.h>
00054 #include <OSGAttachmentPtr.h>
00055
00056 OSG_BEGIN_NAMESPACE
00057
00058 class BinaryDataHandler;
00059
00066 class OSG_SYSTEMLIB_DLLMAPPING AttachmentContainer : public FieldContainer
00067 {
00068
00069
00070 protected:
00071
00072 typedef FieldContainer Inherited;
00073
00074
00075
00076 public:
00077
00078 enum
00079 {
00080 AttachmentsFieldId = Inherited::NextFieldId,
00081 NextFieldId = AttachmentsFieldId + 1
00082 };
00083
00084 static const BitVector AttachmentsFieldMask;
00085
00086
00087
00091 OSG_ABSTR_FIELD_CONTAINER_DECL(AttachmentContainerPtr)
00092
00093
00094
00098 void addAttachment (const AttachmentPtr &fieldContainerP,
00099 UInt16 binding = 0);
00100
00101 void subAttachment (const AttachmentPtr &fieldContainerP,
00102 UInt16 binding = 0);
00103
00104 AttachmentPtr findAttachment( UInt32 groupId,
00105 UInt16 binding = 0);
00106
00107 AttachmentPtr findAttachment(const FieldContainerType &type,
00108 UInt16 binding = 0);
00110
00114 SFAttachmentMap *getSFAttachments(void);
00115
00117
00121 virtual void changed(BitVector whichField,
00122 UInt32 origin );
00123
00125
00129 virtual UInt32 getBinSize (const BitVector &whichField);
00130
00131 virtual void copyToBin ( BinaryDataHandler &pMem,
00132 const BitVector &whichField);
00133 virtual void copyFromBin( BinaryDataHandler &pMem,
00134 const BitVector &whichField);
00135
00137
00141 virtual void dump( UInt32 uiIndent = 0,
00142 const BitVector bvFlags = 0) const;
00143
00145
00146
00147 protected:
00148
00149
00153 static FieldDescription *_desc[];
00154 static FieldContainerType _type;
00155
00157
00161 SFAttachmentMap _attachmentMap;
00162
00164
00168 AttachmentContainer(void);
00169 AttachmentContainer(const AttachmentContainer &source);
00170
00172
00176 virtual ~AttachmentContainer (void);
00177
00179
00183 #if !defined(OSG_FIXED_MFIELDSYNC)
00184 virtual void executeSync ( FieldContainer &other,
00185 const BitVector &whichField);
00186
00187 void executeSyncImpl( AttachmentContainer *pOther,
00188 const BitVector &whichField);
00189 #else
00190 virtual void executeSync ( FieldContainer &other,
00191 const BitVector &whichField,
00192 const SyncInfo &sInfo );
00193
00194 void executeSyncImpl( AttachmentContainer *pOther,
00195 const BitVector &whichField,
00196 const SyncInfo &sInfo );
00197 #endif
00198
00200
00204 AttachmentContainerPtr getPtr(void);
00205
00207
00208
00209 private:
00210
00211 friend class FieldContainer;
00212 friend class FieldContainerType;
00213
00215 void operator =(const AttachmentContainer &source);
00216 };
00217
00218 OSG_END_NAMESPACE
00219
00220 #define OSGATTACHMENTCONTAINER_HEADER_CVSID "@(#)$Id: $"
00221
00222 #endif