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
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 #ifndef _OSGTRANSFORMCHUNKBASE_H_
00055 #define _OSGTRANSFORMCHUNKBASE_H_
00056 #ifdef __sgi
00057 #pragma once
00058 #endif
00059
00060
00061 #include <OSGConfig.h>
00062 #include <OSGSystemDef.h>
00063
00064 #include <OSGBaseTypes.h>
00065 #include <OSGRefPtr.h>
00066 #include <OSGCoredNodePtr.h>
00067
00068 #include <OSGStateChunk.h>
00069
00070 #include <OSGMatrixFields.h>
00071
00072 #include <OSGTransformChunkFields.h>
00073
00074 OSG_BEGIN_NAMESPACE
00075
00076 class TransformChunk;
00077 class BinaryDataHandler;
00078
00080
00081 class OSG_SYSTEMLIB_DLLMAPPING TransformChunkBase : public StateChunk
00082 {
00083 private:
00084
00085 typedef StateChunk Inherited;
00086
00087
00088 public:
00089
00090 typedef TransformChunkPtr Ptr;
00091
00092 enum
00093 {
00094 MatrixFieldId = Inherited::NextFieldId,
00095 NextFieldId = MatrixFieldId + 1
00096 };
00097
00098 static const OSG::BitVector MatrixFieldMask;
00099
00100
00101 static const OSG::BitVector MTInfluenceMask;
00102
00103
00107 static FieldContainerType &getClassType (void);
00108 static UInt32 getClassTypeId (void);
00109
00111
00115 virtual FieldContainerType &getType (void);
00116 virtual const FieldContainerType &getType (void) const;
00117
00118 virtual UInt32 getContainerSize(void) const;
00119
00121
00126 SFMatrix *editSFMatrix (void);
00127 const SFMatrix *getSFMatrix (void) const;
00128 #ifndef OSG_2_PREP
00129 SFMatrix *getSFMatrix (void);
00130 #endif
00131
00132
00133 Matrix &editMatrix (void);
00134 const Matrix &getMatrix (void) const;
00135 #ifndef OSG_2_PREP
00136 Matrix &getMatrix (void);
00137 #endif
00138
00140
00144 void setMatrix ( const Matrix &value );
00145
00147
00152
00156 virtual UInt32 getBinSize (const BitVector &whichField);
00157 virtual void copyToBin ( BinaryDataHandler &pMem,
00158 const BitVector &whichField);
00159 virtual void copyFromBin( BinaryDataHandler &pMem,
00160 const BitVector &whichField);
00161
00162
00164
00168 static TransformChunkPtr create (void);
00169 static TransformChunkPtr createEmpty (void);
00170
00173
00177 virtual FieldContainerPtr shallowCopy (void) const;
00178
00180
00181 protected:
00182
00183
00187 SFMatrix _sfMatrix;
00188
00190
00194 TransformChunkBase(void);
00195 TransformChunkBase(const TransformChunkBase &source);
00196
00198
00202 virtual ~TransformChunkBase(void);
00203
00205
00209 #if !defined(OSG_FIXED_MFIELDSYNC)
00210 void executeSyncImpl( TransformChunkBase *pOther,
00211 const BitVector &whichField);
00212
00213 virtual void executeSync( FieldContainer &other,
00214 const BitVector &whichField);
00215 #else
00216 void executeSyncImpl( TransformChunkBase *pOther,
00217 const BitVector &whichField,
00218 const SyncInfo &sInfo );
00219
00220 virtual void executeSync( FieldContainer &other,
00221 const BitVector &whichField,
00222 const SyncInfo &sInfo);
00223
00224 virtual void execBeginEdit (const BitVector &whichField,
00225 UInt32 uiAspect,
00226 UInt32 uiContainerSize);
00227
00228 void execBeginEditImpl (const BitVector &whichField,
00229 UInt32 uiAspect,
00230 UInt32 uiContainerSize);
00231
00232 virtual void onDestroyAspect(UInt32 uiId, UInt32 uiAspect);
00233 #endif
00234
00236
00237 private:
00238
00239 friend class FieldContainer;
00240
00241 static FieldDescription *_desc[];
00242 static FieldContainerType _type;
00243
00244
00245
00246 void operator =(const TransformChunkBase &source);
00247 };
00248
00249
00250
00251
00252
00253
00254 typedef TransformChunkBase *TransformChunkBaseP;
00255
00256 typedef osgIF<TransformChunkBase::isNodeCore,
00257 CoredNodePtr<TransformChunk>,
00258 FieldContainer::attempt_to_create_CoredNodePtr_on_non_NodeCore_FC
00259 >::_IRet TransformChunkNodePtr;
00260
00261 typedef RefPtr<TransformChunkPtr> TransformChunkRefPtr;
00262
00263 OSG_END_NAMESPACE
00264
00265 #define OSGTRANSFORMCHUNKBASE_HEADER_CVSID "@(#)$Id: FCBaseTemplate_h.h,v 1.41 2008/06/09 07:30:44 vossg Exp $"
00266
00267 #endif