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 _OSGMATERIALBASE_H_
00055 #define _OSGMATERIALBASE_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 <OSGAttachmentContainer.h>
00069
00070 #include <OSGInt32Fields.h>
00071
00072 #include <OSGMaterialFields.h>
00073
00074 OSG_BEGIN_NAMESPACE
00075
00076 class Material;
00077 class BinaryDataHandler;
00078
00080
00081 class OSG_SYSTEMLIB_DLLMAPPING MaterialBase : public AttachmentContainer
00082 {
00083 private:
00084
00085 typedef AttachmentContainer Inherited;
00086
00087
00088 public:
00089
00090 typedef MaterialPtr Ptr;
00091
00092 enum
00093 {
00094 SortKeyFieldId = Inherited::NextFieldId,
00095 NextFieldId = SortKeyFieldId + 1
00096 };
00097
00098 static const OSG::BitVector SortKeyFieldMask;
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
00125 SFInt32 *getSFSortKey (void);
00126
00127 Int32 &getSortKey (void);
00128 const Int32 &getSortKey (void) const;
00129
00131
00135 void setSortKey ( const Int32 &value );
00136
00138
00143
00147 virtual UInt32 getBinSize (const BitVector &whichField);
00148 virtual void copyToBin ( BinaryDataHandler &pMem,
00149 const BitVector &whichField);
00150 virtual void copyFromBin( BinaryDataHandler &pMem,
00151 const BitVector &whichField);
00152
00153
00155
00156 protected:
00157
00158
00162 SFInt32 _sfSortKey;
00163
00165
00169 MaterialBase(void);
00170 MaterialBase(const MaterialBase &source);
00171
00173
00177 virtual ~MaterialBase(void);
00178
00180
00184 #if !defined(OSG_FIXED_MFIELDSYNC)
00185 void executeSyncImpl( MaterialBase *pOther,
00186 const BitVector &whichField);
00187
00188 virtual void executeSync( FieldContainer &other,
00189 const BitVector &whichField);
00190 #else
00191 void executeSyncImpl( MaterialBase *pOther,
00192 const BitVector &whichField,
00193 const SyncInfo &sInfo );
00194
00195 virtual void executeSync( FieldContainer &other,
00196 const BitVector &whichField,
00197 const SyncInfo &sInfo);
00198
00199 virtual void execBeginEdit (const BitVector &whichField,
00200 UInt32 uiAspect,
00201 UInt32 uiContainerSize);
00202
00203 void execBeginEditImpl (const BitVector &whichField,
00204 UInt32 uiAspect,
00205 UInt32 uiContainerSize);
00206
00207 virtual void onDestroyAspect(UInt32 uiId, UInt32 uiAspect);
00208 #endif
00209
00211
00212 private:
00213
00214 friend class FieldContainer;
00215
00216 static FieldDescription *_desc[];
00217 static FieldContainerType _type;
00218
00219
00220
00221 void operator =(const MaterialBase &source);
00222 };
00223
00224
00225
00226
00227
00228
00229 typedef MaterialBase *MaterialBaseP;
00230
00231 typedef osgIF<MaterialBase::isNodeCore,
00232 CoredNodePtr<Material>,
00233 FieldContainer::attempt_to_create_CoredNodePtr_on_non_NodeCore_FC
00234 >::_IRet MaterialNodePtr;
00235
00236 typedef RefPtr<MaterialPtr> MaterialRefPtr;
00237
00238 OSG_END_NAMESPACE
00239
00240 #define OSGMATERIALBASE_HEADER_CVSID "@(#)$Id: FCBaseTemplate_h.h,v 1.38 2005/07/08 06:37:35 vossg Exp $"
00241
00242 #endif