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 _OSGPOLYGONBACKGROUNDBASE_H_
00055 #define _OSGPOLYGONBACKGROUNDBASE_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 <OSGBackground.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 <OSGInt32Fields.h>
00079 #include <OSGBoolFields.h>
00080 #include <OSGBoolFields.h>
00081
00082 #include <OSGPolygonBackgroundFields.h>
00083
00084 OSG_BEGIN_NAMESPACE
00085
00086 class PolygonBackground;
00087 class BinaryDataHandler;
00088
00090
00091 class OSG_SYSTEMLIB_DLLMAPPING PolygonBackgroundBase : public Background
00092 {
00093 private:
00094
00095 typedef Background Inherited;
00096
00097
00098 public:
00099
00100 typedef PolygonBackgroundPtr Ptr;
00101
00102 enum
00103 {
00104 MaterialFieldId = Inherited::NextFieldId,
00105 TexCoordsFieldId = MaterialFieldId + 1,
00106 PositionsFieldId = TexCoordsFieldId + 1,
00107 NormalizedXFieldId = PositionsFieldId + 1,
00108 NormalizedYFieldId = NormalizedXFieldId + 1,
00109 AspectHeightFieldId = NormalizedYFieldId + 1,
00110 AspectWidthFieldId = AspectHeightFieldId + 1,
00111 ScaleFieldId = AspectWidthFieldId + 1,
00112 ClearStencilBitFieldId = ScaleFieldId + 1,
00113 CleanupFieldId = ClearStencilBitFieldId + 1,
00114 TileFieldId = CleanupFieldId + 1,
00115 NextFieldId = TileFieldId + 1
00116 };
00117
00118 static const OSG::BitVector MaterialFieldMask;
00119 static const OSG::BitVector TexCoordsFieldMask;
00120 static const OSG::BitVector PositionsFieldMask;
00121 static const OSG::BitVector NormalizedXFieldMask;
00122 static const OSG::BitVector NormalizedYFieldMask;
00123 static const OSG::BitVector AspectHeightFieldMask;
00124 static const OSG::BitVector AspectWidthFieldMask;
00125 static const OSG::BitVector ScaleFieldMask;
00126 static const OSG::BitVector ClearStencilBitFieldMask;
00127 static const OSG::BitVector CleanupFieldMask;
00128 static const OSG::BitVector TileFieldMask;
00129
00130
00131 static const OSG::BitVector MTInfluenceMask;
00132
00133
00137 static FieldContainerType &getClassType (void);
00138 static UInt32 getClassTypeId (void);
00139
00141
00145 virtual FieldContainerType &getType (void);
00146 virtual const FieldContainerType &getType (void) const;
00147
00148 virtual UInt32 getContainerSize(void) const;
00149
00151
00155 SFMaterialPtr *getSFMaterial (void);
00156 MFVec3f *getMFTexCoords (void);
00157 MFPnt2f *getMFPositions (void);
00158 SFBool *getSFNormalizedX (void);
00159 SFBool *getSFNormalizedY (void);
00160 SFUInt16 *getSFAspectHeight (void);
00161 SFUInt16 *getSFAspectWidth (void);
00162 SFReal32 *getSFScale (void);
00163 SFInt32 *getSFClearStencilBit(void);
00164 SFBool *getSFCleanup (void);
00165 SFBool *getSFTile (void);
00166
00167 MaterialPtr &getMaterial (void);
00168 const MaterialPtr &getMaterial (void) const;
00169 bool &getNormalizedX (void);
00170 const bool &getNormalizedX (void) const;
00171 bool &getNormalizedY (void);
00172 const bool &getNormalizedY (void) const;
00173 UInt16 &getAspectHeight (void);
00174 const UInt16 &getAspectHeight (void) const;
00175 UInt16 &getAspectWidth (void);
00176 const UInt16 &getAspectWidth (void) const;
00177 Real32 &getScale (void);
00178 const Real32 &getScale (void) const;
00179 Int32 &getClearStencilBit(void);
00180 const Int32 &getClearStencilBit(void) const;
00181 bool &getCleanup (void);
00182 const bool &getCleanup (void) const;
00183 bool &getTile (void);
00184 const bool &getTile (void) const;
00185 Vec3f &getTexCoords (const UInt32 index);
00186 MFVec3f &getTexCoords (void);
00187 const MFVec3f &getTexCoords (void) const;
00188 Pnt2f &getPositions (const UInt32 index);
00189 MFPnt2f &getPositions (void);
00190 const MFPnt2f &getPositions (void) const;
00191
00193
00197 void setMaterial ( const MaterialPtr &value );
00198 void setNormalizedX ( const bool &value );
00199 void setNormalizedY ( const bool &value );
00200 void setAspectHeight ( const UInt16 &value );
00201 void setAspectWidth ( const UInt16 &value );
00202 void setScale ( const Real32 &value );
00203 void setClearStencilBit( const Int32 &value );
00204 void setCleanup ( const bool &value );
00205 void setTile ( const bool &value );
00206
00208
00213
00217 virtual UInt32 getBinSize (const BitVector &whichField);
00218 virtual void copyToBin ( BinaryDataHandler &pMem,
00219 const BitVector &whichField);
00220 virtual void copyFromBin( BinaryDataHandler &pMem,
00221 const BitVector &whichField);
00222
00223
00225
00229 static PolygonBackgroundPtr create (void);
00230 static PolygonBackgroundPtr createEmpty (void);
00231
00234
00238 virtual FieldContainerPtr shallowCopy (void) const;
00239
00241
00242 protected:
00243
00244
00248 SFMaterialPtr _sfMaterial;
00249 MFVec3f _mfTexCoords;
00250 MFPnt2f _mfPositions;
00251 SFBool _sfNormalizedX;
00252 SFBool _sfNormalizedY;
00253 SFUInt16 _sfAspectHeight;
00254 SFUInt16 _sfAspectWidth;
00255 SFReal32 _sfScale;
00256 SFInt32 _sfClearStencilBit;
00257 SFBool _sfCleanup;
00258 SFBool _sfTile;
00259
00261
00265 PolygonBackgroundBase(void);
00266 PolygonBackgroundBase(const PolygonBackgroundBase &source);
00267
00269
00273 virtual ~PolygonBackgroundBase(void);
00274
00276
00280 #if !defined(OSG_FIXED_MFIELDSYNC)
00281 void executeSyncImpl( PolygonBackgroundBase *pOther,
00282 const BitVector &whichField);
00283
00284 virtual void executeSync( FieldContainer &other,
00285 const BitVector &whichField);
00286 #else
00287 void executeSyncImpl( PolygonBackgroundBase *pOther,
00288 const BitVector &whichField,
00289 const SyncInfo &sInfo );
00290
00291 virtual void executeSync( FieldContainer &other,
00292 const BitVector &whichField,
00293 const SyncInfo &sInfo);
00294
00295 virtual void execBeginEdit (const BitVector &whichField,
00296 UInt32 uiAspect,
00297 UInt32 uiContainerSize);
00298
00299 void execBeginEditImpl (const BitVector &whichField,
00300 UInt32 uiAspect,
00301 UInt32 uiContainerSize);
00302
00303 virtual void onDestroyAspect(UInt32 uiId, UInt32 uiAspect);
00304 #endif
00305
00307
00308 private:
00309
00310 friend class FieldContainer;
00311
00312 static FieldDescription *_desc[];
00313 static FieldContainerType _type;
00314
00315
00316
00317 void operator =(const PolygonBackgroundBase &source);
00318 };
00319
00320
00321
00322
00323
00324
00325 typedef PolygonBackgroundBase *PolygonBackgroundBaseP;
00326
00327 typedef osgIF<PolygonBackgroundBase::isNodeCore,
00328 CoredNodePtr<PolygonBackground>,
00329 FieldContainer::attempt_to_create_CoredNodePtr_on_non_NodeCore_FC
00330 >::_IRet PolygonBackgroundNodePtr;
00331
00332 typedef RefPtr<PolygonBackgroundPtr> PolygonBackgroundRefPtr;
00333
00334 OSG_END_NAMESPACE
00335
00336 #define OSGPOLYGONBACKGROUNDBASE_HEADER_CVSID "@(#)$Id: OSGPolygonBackgroundBase.h,v 1.9 2007/03/09 16:59:50 yjung Exp $"
00337
00338 #endif