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 #define OSG_COMPILEMATERIALINST
00055
00056 #include <stdlib.h>
00057 #include <stdio.h>
00058
00059 #include <OSGConfig.h>
00060
00061 #include "OSGMaterialBase.h"
00062 #include "OSGMaterial.h"
00063
00064
00065 OSG_USING_NAMESPACE
00066
00067 const OSG::BitVector MaterialBase::SortKeyFieldMask =
00068 (TypeTraits<BitVector>::One << MaterialBase::SortKeyFieldId);
00069
00070 const OSG::BitVector MaterialBase::MTInfluenceMask =
00071 (Inherited::MTInfluenceMask) |
00072 (static_cast<BitVector>(0x0) << Inherited::NextFieldId);
00073
00074
00075
00076
00081
00082
00083 FieldDescription *MaterialBase::_desc[] =
00084 {
00085 new FieldDescription(SFInt32::getClassType(),
00086 "sortKey",
00087 SortKeyFieldId, SortKeyFieldMask,
00088 false,
00089 (FieldAccessMethod) &MaterialBase::getSFSortKey)
00090 };
00091
00092
00093 FieldContainerType MaterialBase::_type(
00094 "Material",
00095 "AttachmentContainer",
00096 NULL,
00097 NULL,
00098 Material::initMethod,
00099 _desc,
00100 sizeof(_desc));
00101
00102
00103
00104
00105
00106 FieldContainerType &MaterialBase::getType(void)
00107 {
00108 return _type;
00109 }
00110
00111 const FieldContainerType &MaterialBase::getType(void) const
00112 {
00113 return _type;
00114 }
00115
00116
00117 UInt32 MaterialBase::getContainerSize(void) const
00118 {
00119 return sizeof(Material);
00120 }
00121
00122
00123 #if !defined(OSG_FIXED_MFIELDSYNC)
00124 void MaterialBase::executeSync( FieldContainer &other,
00125 const BitVector &whichField)
00126 {
00127 this->executeSyncImpl((MaterialBase *) &other, whichField);
00128 }
00129 #else
00130 void MaterialBase::executeSync( FieldContainer &other,
00131 const BitVector &whichField, const SyncInfo &sInfo )
00132 {
00133 this->executeSyncImpl((MaterialBase *) &other, whichField, sInfo);
00134 }
00135 void MaterialBase::execBeginEdit(const BitVector &whichField,
00136 UInt32 uiAspect,
00137 UInt32 uiContainerSize)
00138 {
00139 this->execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00140 }
00141
00142 void MaterialBase::onDestroyAspect(UInt32 uiId, UInt32 uiAspect)
00143 {
00144 Inherited::onDestroyAspect(uiId, uiAspect);
00145
00146 }
00147 #endif
00148
00149
00150
00151 #ifdef OSG_WIN32_ICL
00152 #pragma warning (disable : 383)
00153 #endif
00154
00155 MaterialBase::MaterialBase(void) :
00156 _sfSortKey (Int32(0)),
00157 Inherited()
00158 {
00159 }
00160
00161 #ifdef OSG_WIN32_ICL
00162 #pragma warning (default : 383)
00163 #endif
00164
00165 MaterialBase::MaterialBase(const MaterialBase &source) :
00166 _sfSortKey (source._sfSortKey ),
00167 Inherited (source)
00168 {
00169 }
00170
00171
00172
00173 MaterialBase::~MaterialBase(void)
00174 {
00175 }
00176
00177
00178
00179 UInt32 MaterialBase::getBinSize(const BitVector &whichField)
00180 {
00181 UInt32 returnValue = Inherited::getBinSize(whichField);
00182
00183 if(FieldBits::NoField != (SortKeyFieldMask & whichField))
00184 {
00185 returnValue += _sfSortKey.getBinSize();
00186 }
00187
00188
00189 return returnValue;
00190 }
00191
00192 void MaterialBase::copyToBin( BinaryDataHandler &pMem,
00193 const BitVector &whichField)
00194 {
00195 Inherited::copyToBin(pMem, whichField);
00196
00197 if(FieldBits::NoField != (SortKeyFieldMask & whichField))
00198 {
00199 _sfSortKey.copyToBin(pMem);
00200 }
00201
00202
00203 }
00204
00205 void MaterialBase::copyFromBin( BinaryDataHandler &pMem,
00206 const BitVector &whichField)
00207 {
00208 Inherited::copyFromBin(pMem, whichField);
00209
00210 if(FieldBits::NoField != (SortKeyFieldMask & whichField))
00211 {
00212 _sfSortKey.copyFromBin(pMem);
00213 }
00214
00215
00216 }
00217
00218 #if !defined(OSG_FIXED_MFIELDSYNC)
00219 void MaterialBase::executeSyncImpl( MaterialBase *pOther,
00220 const BitVector &whichField)
00221 {
00222
00223 Inherited::executeSyncImpl(pOther, whichField);
00224
00225 if(FieldBits::NoField != (SortKeyFieldMask & whichField))
00226 _sfSortKey.syncWith(pOther->_sfSortKey);
00227
00228
00229 }
00230 #else
00231 void MaterialBase::executeSyncImpl( MaterialBase *pOther,
00232 const BitVector &whichField,
00233 const SyncInfo &sInfo )
00234 {
00235
00236 Inherited::executeSyncImpl(pOther, whichField, sInfo);
00237
00238 if(FieldBits::NoField != (SortKeyFieldMask & whichField))
00239 _sfSortKey.syncWith(pOther->_sfSortKey);
00240
00241
00242
00243 }
00244
00245 void MaterialBase::execBeginEditImpl (const BitVector &whichField,
00246 UInt32 uiAspect,
00247 UInt32 uiContainerSize)
00248 {
00249 Inherited::execBeginEditImpl(whichField, uiAspect, uiContainerSize);
00250
00251 }
00252 #endif
00253
00254
00255
00256 #include <OSGSFieldTypeDef.inl>
00257 #include <OSGMFieldTypeDef.inl>
00258
00259 OSG_BEGIN_NAMESPACE
00260
00261 #if !defined(OSG_DO_DOC) || defined(OSG_DOC_DEV)
00262 DataType FieldDataTraits<MaterialPtr>::_type("MaterialPtr", "AttachmentContainerPtr");
00263 #endif
00264
00265 OSG_DLLEXPORT_SFIELD_DEF1(MaterialPtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
00266 OSG_DLLEXPORT_MFIELD_DEF1(MaterialPtr, OSG_SYSTEMLIB_DLLTMPLMAPPING);
00267
00268 OSG_END_NAMESPACE
00269
00270
00271
00272
00273
00274 #ifdef OSG_SGI_CC
00275 #pragma set woff 1174
00276 #endif
00277
00278 #ifdef OSG_LINUX_ICC
00279 #pragma warning( disable : 177 )
00280 #endif
00281
00282 namespace
00283 {
00284 static Char8 cvsid_cpp [] = "@(#)$Id: FCBaseTemplate_cpp.h,v 1.42 2004/08/03 05:53:03 dirk Exp $";
00285 static Char8 cvsid_hpp [] = OSGMATERIALBASE_HEADER_CVSID;
00286 static Char8 cvsid_inl [] = OSGMATERIALBASE_INLINE_CVSID;
00287
00288 static Char8 cvsid_fields_hpp[] = OSGMATERIALFIELDS_HEADER_CVSID;
00289 }
00290