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 _OSGPOLYGONCHUNKBASE_H_
00055 #define _OSGPOLYGONCHUNKBASE_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 <OSGGLenumFields.h>
00071 #include <OSGGLenumFields.h>
00072 #include <OSGGLenumFields.h>
00073 #include <OSGGLenumFields.h>
00074 #include <OSGBoolFields.h>
00075 #include <OSGReal32Fields.h>
00076 #include <OSGReal32Fields.h>
00077 #include <OSGBoolFields.h>
00078 #include <OSGBoolFields.h>
00079 #include <OSGBoolFields.h>
00080 #include <OSGInt32Fields.h>
00081
00082 #include <OSGPolygonChunkFields.h>
00083
00084 OSG_BEGIN_NAMESPACE
00085
00086 class PolygonChunk;
00087 class BinaryDataHandler;
00088
00090
00091 class OSG_SYSTEMLIB_DLLMAPPING PolygonChunkBase : public StateChunk
00092 {
00093 private:
00094
00095 typedef StateChunk Inherited;
00096
00097
00098 public:
00099
00100 typedef PolygonChunkPtr Ptr;
00101
00102 enum
00103 {
00104 CullFaceFieldId = Inherited::NextFieldId,
00105 FrontFaceFieldId = CullFaceFieldId + 1,
00106 FrontModeFieldId = FrontFaceFieldId + 1,
00107 BackModeFieldId = FrontModeFieldId + 1,
00108 SmoothFieldId = BackModeFieldId + 1,
00109 OffsetFactorFieldId = SmoothFieldId + 1,
00110 OffsetBiasFieldId = OffsetFactorFieldId + 1,
00111 OffsetPointFieldId = OffsetBiasFieldId + 1,
00112 OffsetLineFieldId = OffsetPointFieldId + 1,
00113 OffsetFillFieldId = OffsetLineFieldId + 1,
00114 StippleFieldId = OffsetFillFieldId + 1,
00115 NextFieldId = StippleFieldId + 1
00116 };
00117
00118 static const OSG::BitVector CullFaceFieldMask;
00119 static const OSG::BitVector FrontFaceFieldMask;
00120 static const OSG::BitVector FrontModeFieldMask;
00121 static const OSG::BitVector BackModeFieldMask;
00122 static const OSG::BitVector SmoothFieldMask;
00123 static const OSG::BitVector OffsetFactorFieldMask;
00124 static const OSG::BitVector OffsetBiasFieldMask;
00125 static const OSG::BitVector OffsetPointFieldMask;
00126 static const OSG::BitVector OffsetLineFieldMask;
00127 static const OSG::BitVector OffsetFillFieldMask;
00128 static const OSG::BitVector StippleFieldMask;
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 SFGLenum *getSFCullFace (void);
00156 SFGLenum *getSFFrontFace (void);
00157 SFGLenum *getSFFrontMode (void);
00158 SFGLenum *getSFBackMode (void);
00159 SFBool *getSFSmooth (void);
00160 SFReal32 *getSFOffsetFactor (void);
00161 SFReal32 *getSFOffsetBias (void);
00162 SFBool *getSFOffsetPoint (void);
00163 SFBool *getSFOffsetLine (void);
00164 SFBool *getSFOffsetFill (void);
00165 MFInt32 *getMFStipple (void);
00166
00167 GLenum &getCullFace (void);
00168 const GLenum &getCullFace (void) const;
00169 GLenum &getFrontFace (void);
00170 const GLenum &getFrontFace (void) const;
00171 GLenum &getFrontMode (void);
00172 const GLenum &getFrontMode (void) const;
00173 GLenum &getBackMode (void);
00174 const GLenum &getBackMode (void) const;
00175 bool &getSmooth (void);
00176 const bool &getSmooth (void) const;
00177 Real32 &getOffsetFactor (void);
00178 const Real32 &getOffsetFactor (void) const;
00179 Real32 &getOffsetBias (void);
00180 const Real32 &getOffsetBias (void) const;
00181 bool &getOffsetPoint (void);
00182 const bool &getOffsetPoint (void) const;
00183 bool &getOffsetLine (void);
00184 const bool &getOffsetLine (void) const;
00185 bool &getOffsetFill (void);
00186 const bool &getOffsetFill (void) const;
00187 Int32 &getStipple (const UInt32 index);
00188 MFInt32 &getStipple (void);
00189 const MFInt32 &getStipple (void) const;
00190
00192
00196 void setCullFace ( const GLenum &value );
00197 void setFrontFace ( const GLenum &value );
00198 void setFrontMode ( const GLenum &value );
00199 void setBackMode ( const GLenum &value );
00200 void setSmooth ( const bool &value );
00201 void setOffsetFactor ( const Real32 &value );
00202 void setOffsetBias ( const Real32 &value );
00203 void setOffsetPoint ( const bool &value );
00204 void setOffsetLine ( const bool &value );
00205 void setOffsetFill ( 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 PolygonChunkPtr create (void);
00230 static PolygonChunkPtr createEmpty (void);
00231
00234
00238 virtual FieldContainerPtr shallowCopy (void) const;
00239
00241
00242 protected:
00243
00244
00248 SFGLenum _sfCullFace;
00249 SFGLenum _sfFrontFace;
00250 SFGLenum _sfFrontMode;
00251 SFGLenum _sfBackMode;
00252 SFBool _sfSmooth;
00253 SFReal32 _sfOffsetFactor;
00254 SFReal32 _sfOffsetBias;
00255 SFBool _sfOffsetPoint;
00256 SFBool _sfOffsetLine;
00257 SFBool _sfOffsetFill;
00258 MFInt32 _mfStipple;
00259
00261
00265 PolygonChunkBase(void);
00266 PolygonChunkBase(const PolygonChunkBase &source);
00267
00269
00273 virtual ~PolygonChunkBase(void);
00274
00276
00280 #if !defined(OSG_FIXED_MFIELDSYNC)
00281 void executeSyncImpl( PolygonChunkBase *pOther,
00282 const BitVector &whichField);
00283
00284 virtual void executeSync( FieldContainer &other,
00285 const BitVector &whichField);
00286 #else
00287 void executeSyncImpl( PolygonChunkBase *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 PolygonChunkBase &source);
00318 };
00319
00320
00321
00322
00323
00324
00325 typedef PolygonChunkBase *PolygonChunkBaseP;
00326
00327 typedef osgIF<PolygonChunkBase::isNodeCore,
00328 CoredNodePtr<PolygonChunk>,
00329 FieldContainer::attempt_to_create_CoredNodePtr_on_non_NodeCore_FC
00330 >::_IRet PolygonChunkNodePtr;
00331
00332 typedef RefPtr<PolygonChunkPtr> PolygonChunkRefPtr;
00333
00334 OSG_END_NAMESPACE
00335
00336 #define OSGPOLYGONCHUNKBASE_HEADER_CVSID "@(#)$Id: FCBaseTemplate_h.h,v 1.40 2005/07/20 00:10:14 vossg Exp $"
00337
00338 #endif