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 _OSGPOLYGONFOREGROUNDBASE_H_
00055 #define _OSGPOLYGONFOREGROUNDBASE_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 <OSGForeground.h>
00069
00070 #include <OSGMaterialFields.h>
00071 #include <OSGVec3fFields.h>
00072 #include <OSGPnt2fFields.h>
00073 #include <OSGBoolFields.h>
00074 #include <OSGBoolFields.h>
00075 #include <OSGUInt16Fields.h>
00076 #include <OSGUInt16Fields.h>
00077 #include <OSGReal32Fields.h>
00078 #include <OSGBoolFields.h>
00079
00080 #include <OSGPolygonForegroundFields.h>
00081
00082 OSG_BEGIN_NAMESPACE
00083
00084 class PolygonForeground;
00085 class BinaryDataHandler;
00086
00088
00089 class OSG_SYSTEMLIB_DLLMAPPING PolygonForegroundBase : public Foreground
00090 {
00091 private:
00092
00093 typedef Foreground Inherited;
00094
00095
00096 public:
00097
00098 typedef PolygonForegroundPtr Ptr;
00099
00100 enum
00101 {
00102 MaterialFieldId = Inherited::NextFieldId,
00103 TexCoordsFieldId = MaterialFieldId + 1,
00104 PositionsFieldId = TexCoordsFieldId + 1,
00105 NormalizedXFieldId = PositionsFieldId + 1,
00106 NormalizedYFieldId = NormalizedXFieldId + 1,
00107 AspectHeightFieldId = NormalizedYFieldId + 1,
00108 AspectWidthFieldId = AspectHeightFieldId + 1,
00109 ScaleFieldId = AspectWidthFieldId + 1,
00110 TileFieldId = ScaleFieldId + 1,
00111 NextFieldId = TileFieldId + 1
00112 };
00113
00114 static const OSG::BitVector MaterialFieldMask;
00115 static const OSG::BitVector TexCoordsFieldMask;
00116 static const OSG::BitVector PositionsFieldMask;
00117 static const OSG::BitVector NormalizedXFieldMask;
00118 static const OSG::BitVector NormalizedYFieldMask;
00119 static const OSG::BitVector AspectHeightFieldMask;
00120 static const OSG::BitVector AspectWidthFieldMask;
00121 static const OSG::BitVector ScaleFieldMask;
00122 static const OSG::BitVector TileFieldMask;
00123
00124
00125 static const OSG::BitVector MTInfluenceMask;
00126
00127
00131 static FieldContainerType &getClassType (void);
00132 static UInt32 getClassTypeId (void);
00133
00135
00139 virtual FieldContainerType &getType (void);
00140 virtual const FieldContainerType &getType (void) const;
00141
00142 virtual UInt32 getContainerSize(void) const;
00143
00145
00149 SFMaterialPtr *getSFMaterial (void);
00150 MFVec3f *getMFTexCoords (void);
00151 MFPnt2f *getMFPositions (void);
00152 SFBool *getSFNormalizedX (void);
00153 SFBool *getSFNormalizedY (void);
00154 SFUInt16 *getSFAspectHeight (void);
00155 SFUInt16 *getSFAspectWidth (void);
00156 SFReal32 *getSFScale (void);
00157 SFBool *getSFTile (void);
00158
00159 MaterialPtr &getMaterial (void);
00160 const MaterialPtr &getMaterial (void) const;
00161 bool &getNormalizedX (void);
00162 const bool &getNormalizedX (void) const;
00163 bool &getNormalizedY (void);
00164 const bool &getNormalizedY (void) const;
00165 UInt16 &getAspectHeight (void);
00166 const UInt16 &getAspectHeight (void) const;
00167 UInt16 &getAspectWidth (void);
00168 const UInt16 &getAspectWidth (void) const;
00169 Real32 &getScale (void);
00170 const Real32 &getScale (void) const;
00171 bool &getTile (void);
00172 const bool &getTile (void) const;
00173 Vec3f &getTexCoords (const UInt32 index);
00174 MFVec3f &getTexCoords (void);
00175 const MFVec3f &getTexCoords (void) const;
00176 Pnt2f &getPositions (const UInt32 index);
00177 MFPnt2f &getPositions (void);
00178 const MFPnt2f &getPositions (void) const;
00179
00181
00185 void setMaterial ( const MaterialPtr &value );
00186 void setNormalizedX ( const bool &value );
00187 void setNormalizedY ( const bool &value );
00188 void setAspectHeight ( const UInt16 &value );
00189 void setAspectWidth ( const UInt16 &value );
00190 void setScale ( const Real32 &value );
00191 void setTile ( const bool &value );
00192
00194
00199
00203 virtual UInt32 getBinSize (const BitVector &whichField);
00204 virtual void copyToBin ( BinaryDataHandler &pMem,
00205 const BitVector &whichField);
00206 virtual void copyFromBin( BinaryDataHandler &pMem,
00207 const BitVector &whichField);
00208
00209
00211
00215 static PolygonForegroundPtr create (void);
00216 static PolygonForegroundPtr createEmpty (void);
00217
00220
00224 virtual FieldContainerPtr shallowCopy (void) const;
00225
00227
00228 protected:
00229
00230
00234 SFMaterialPtr _sfMaterial;
00235 MFVec3f _mfTexCoords;
00236 MFPnt2f _mfPositions;
00237 SFBool _sfNormalizedX;
00238 SFBool _sfNormalizedY;
00239 SFUInt16 _sfAspectHeight;
00240 SFUInt16 _sfAspectWidth;
00241 SFReal32 _sfScale;
00242 SFBool _sfTile;
00243
00245
00249 PolygonForegroundBase(void);
00250 PolygonForegroundBase(const PolygonForegroundBase &source);
00251
00253
00257 virtual ~PolygonForegroundBase(void);
00258
00260
00264 #if !defined(OSG_FIXED_MFIELDSYNC)
00265 void executeSyncImpl( PolygonForegroundBase *pOther,
00266 const BitVector &whichField);
00267
00268 virtual void executeSync( FieldContainer &other,
00269 const BitVector &whichField);
00270 #else
00271 void executeSyncImpl( PolygonForegroundBase *pOther,
00272 const BitVector &whichField,
00273 const SyncInfo &sInfo );
00274
00275 virtual void executeSync( FieldContainer &other,
00276 const BitVector &whichField,
00277 const SyncInfo &sInfo);
00278
00279 virtual void execBeginEdit (const BitVector &whichField,
00280 UInt32 uiAspect,
00281 UInt32 uiContainerSize);
00282
00283 void execBeginEditImpl (const BitVector &whichField,
00284 UInt32 uiAspect,
00285 UInt32 uiContainerSize);
00286
00287 virtual void onDestroyAspect(UInt32 uiId, UInt32 uiAspect);
00288 #endif
00289
00291
00292 private:
00293
00294 friend class FieldContainer;
00295
00296 static FieldDescription *_desc[];
00297 static FieldContainerType _type;
00298
00299
00300
00301 void operator =(const PolygonForegroundBase &source);
00302 };
00303
00304
00305
00306
00307
00308
00309 typedef PolygonForegroundBase *PolygonForegroundBaseP;
00310
00311 typedef osgIF<PolygonForegroundBase::isNodeCore,
00312 CoredNodePtr<PolygonForeground>,
00313 FieldContainer::attempt_to_create_CoredNodePtr_on_non_NodeCore_FC
00314 >::_IRet PolygonForegroundNodePtr;
00315
00316 typedef RefPtr<PolygonForegroundPtr> PolygonForegroundRefPtr;
00317
00318 OSG_END_NAMESPACE
00319
00320 #define OSGPOLYGONFOREGROUNDBASE_HEADER_CVSID "@(#)$Id: FCBaseTemplate_h.h,v 1.40 2005/07/20 00:10:14 vossg Exp $"
00321
00322 #endif