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 _OSGTEXGENCHUNKBASE_H_
00055 #define _OSGTEXGENCHUNKBASE_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 <OSGVec4fFields.h>
00075 #include <OSGVec4fFields.h>
00076 #include <OSGVec4fFields.h>
00077 #include <OSGVec4fFields.h>
00078 #include <OSGNodeFields.h>
00079 #include <OSGNodeFields.h>
00080 #include <OSGNodeFields.h>
00081 #include <OSGNodeFields.h>
00082
00083 #include <OSGTexGenChunkFields.h>
00084
00085 OSG_BEGIN_NAMESPACE
00086
00087 class TexGenChunk;
00088 class BinaryDataHandler;
00089
00091
00092 class OSG_SYSTEMLIB_DLLMAPPING TexGenChunkBase : public StateChunk
00093 {
00094 private:
00095
00096 typedef StateChunk Inherited;
00097
00098
00099 public:
00100
00101 typedef TexGenChunkPtr Ptr;
00102
00103 enum
00104 {
00105 GenFuncSFieldId = Inherited::NextFieldId,
00106 GenFuncTFieldId = GenFuncSFieldId + 1,
00107 GenFuncRFieldId = GenFuncTFieldId + 1,
00108 GenFuncQFieldId = GenFuncRFieldId + 1,
00109 GenFuncSPlaneFieldId = GenFuncQFieldId + 1,
00110 GenFuncTPlaneFieldId = GenFuncSPlaneFieldId + 1,
00111 GenFuncRPlaneFieldId = GenFuncTPlaneFieldId + 1,
00112 GenFuncQPlaneFieldId = GenFuncRPlaneFieldId + 1,
00113 SBeaconFieldId = GenFuncQPlaneFieldId + 1,
00114 TBeaconFieldId = SBeaconFieldId + 1,
00115 RBeaconFieldId = TBeaconFieldId + 1,
00116 QBeaconFieldId = RBeaconFieldId + 1,
00117 NextFieldId = QBeaconFieldId + 1
00118 };
00119
00120 static const OSG::BitVector GenFuncSFieldMask;
00121 static const OSG::BitVector GenFuncTFieldMask;
00122 static const OSG::BitVector GenFuncRFieldMask;
00123 static const OSG::BitVector GenFuncQFieldMask;
00124 static const OSG::BitVector GenFuncSPlaneFieldMask;
00125 static const OSG::BitVector GenFuncTPlaneFieldMask;
00126 static const OSG::BitVector GenFuncRPlaneFieldMask;
00127 static const OSG::BitVector GenFuncQPlaneFieldMask;
00128 static const OSG::BitVector SBeaconFieldMask;
00129 static const OSG::BitVector TBeaconFieldMask;
00130 static const OSG::BitVector RBeaconFieldMask;
00131 static const OSG::BitVector QBeaconFieldMask;
00132
00133
00134 static const OSG::BitVector MTInfluenceMask;
00135
00136
00140 static FieldContainerType &getClassType (void);
00141 static UInt32 getClassTypeId (void);
00142
00144
00148 virtual FieldContainerType &getType (void);
00149 virtual const FieldContainerType &getType (void) const;
00150
00151 virtual UInt32 getContainerSize(void) const;
00152
00154
00158 SFGLenum *getSFGenFuncS (void);
00159 SFGLenum *getSFGenFuncT (void);
00160 SFGLenum *getSFGenFuncR (void);
00161 SFGLenum *getSFGenFuncQ (void);
00162 SFVec4f *getSFGenFuncSPlane (void);
00163 SFVec4f *getSFGenFuncTPlane (void);
00164 SFVec4f *getSFGenFuncRPlane (void);
00165 SFVec4f *getSFGenFuncQPlane (void);
00166 SFNodePtr *getSFSBeacon (void);
00167 SFNodePtr *getSFTBeacon (void);
00168 SFNodePtr *getSFRBeacon (void);
00169 SFNodePtr *getSFQBeacon (void);
00170
00171 GLenum &getGenFuncS (void);
00172 const GLenum &getGenFuncS (void) const;
00173 GLenum &getGenFuncT (void);
00174 const GLenum &getGenFuncT (void) const;
00175 GLenum &getGenFuncR (void);
00176 const GLenum &getGenFuncR (void) const;
00177 GLenum &getGenFuncQ (void);
00178 const GLenum &getGenFuncQ (void) const;
00179 Vec4f &getGenFuncSPlane (void);
00180 const Vec4f &getGenFuncSPlane (void) const;
00181 Vec4f &getGenFuncTPlane (void);
00182 const Vec4f &getGenFuncTPlane (void) const;
00183 Vec4f &getGenFuncRPlane (void);
00184 const Vec4f &getGenFuncRPlane (void) const;
00185 Vec4f &getGenFuncQPlane (void);
00186 const Vec4f &getGenFuncQPlane (void) const;
00187 NodePtr &getSBeacon (void);
00188 const NodePtr &getSBeacon (void) const;
00189 NodePtr &getTBeacon (void);
00190 const NodePtr &getTBeacon (void) const;
00191 NodePtr &getRBeacon (void);
00192 const NodePtr &getRBeacon (void) const;
00193 NodePtr &getQBeacon (void);
00194 const NodePtr &getQBeacon (void) const;
00195
00197
00201 void setGenFuncS ( const GLenum &value );
00202 void setGenFuncT ( const GLenum &value );
00203 void setGenFuncR ( const GLenum &value );
00204 void setGenFuncQ ( const GLenum &value );
00205 void setGenFuncSPlane ( const Vec4f &value );
00206 void setGenFuncTPlane ( const Vec4f &value );
00207 void setGenFuncRPlane ( const Vec4f &value );
00208 void setGenFuncQPlane ( const Vec4f &value );
00209 void setSBeacon ( const NodePtr &value );
00210 void setTBeacon ( const NodePtr &value );
00211 void setRBeacon ( const NodePtr &value );
00212 void setQBeacon ( const NodePtr &value );
00213
00215
00220
00224 virtual UInt32 getBinSize (const BitVector &whichField);
00225 virtual void copyToBin ( BinaryDataHandler &pMem,
00226 const BitVector &whichField);
00227 virtual void copyFromBin( BinaryDataHandler &pMem,
00228 const BitVector &whichField);
00229
00230
00232
00236 static TexGenChunkPtr create (void);
00237 static TexGenChunkPtr createEmpty (void);
00238
00241
00245 virtual FieldContainerPtr shallowCopy (void) const;
00246
00248
00249 protected:
00250
00251
00255 SFGLenum _sfGenFuncS;
00256 SFGLenum _sfGenFuncT;
00257 SFGLenum _sfGenFuncR;
00258 SFGLenum _sfGenFuncQ;
00259 SFVec4f _sfGenFuncSPlane;
00260 SFVec4f _sfGenFuncTPlane;
00261 SFVec4f _sfGenFuncRPlane;
00262 SFVec4f _sfGenFuncQPlane;
00263 SFNodePtr _sfSBeacon;
00264 SFNodePtr _sfTBeacon;
00265 SFNodePtr _sfRBeacon;
00266 SFNodePtr _sfQBeacon;
00267
00269
00273 TexGenChunkBase(void);
00274 TexGenChunkBase(const TexGenChunkBase &source);
00275
00277
00281 virtual ~TexGenChunkBase(void);
00282
00284
00288 #if !defined(OSG_FIXED_MFIELDSYNC)
00289 void executeSyncImpl( TexGenChunkBase *pOther,
00290 const BitVector &whichField);
00291
00292 virtual void executeSync( FieldContainer &other,
00293 const BitVector &whichField);
00294 #else
00295 void executeSyncImpl( TexGenChunkBase *pOther,
00296 const BitVector &whichField,
00297 const SyncInfo &sInfo );
00298
00299 virtual void executeSync( FieldContainer &other,
00300 const BitVector &whichField,
00301 const SyncInfo &sInfo);
00302
00303 virtual void execBeginEdit (const BitVector &whichField,
00304 UInt32 uiAspect,
00305 UInt32 uiContainerSize);
00306
00307 void execBeginEditImpl (const BitVector &whichField,
00308 UInt32 uiAspect,
00309 UInt32 uiContainerSize);
00310
00311 virtual void onDestroyAspect(UInt32 uiId, UInt32 uiAspect);
00312 #endif
00313
00315
00316 private:
00317
00318 friend class FieldContainer;
00319
00320 static FieldDescription *_desc[];
00321 static FieldContainerType _type;
00322
00323
00324
00325 void operator =(const TexGenChunkBase &source);
00326 };
00327
00328
00329
00330
00331
00332
00333 typedef TexGenChunkBase *TexGenChunkBaseP;
00334
00335 typedef osgIF<TexGenChunkBase::isNodeCore,
00336 CoredNodePtr<TexGenChunk>,
00337 FieldContainer::attempt_to_create_CoredNodePtr_on_non_NodeCore_FC
00338 >::_IRet TexGenChunkNodePtr;
00339
00340 typedef RefPtr<TexGenChunkPtr> TexGenChunkRefPtr;
00341
00342 OSG_END_NAMESPACE
00343
00344 #define OSGTEXGENCHUNKBASE_HEADER_CVSID "@(#)$Id: FCBaseTemplate_h.h,v 1.40 2005/07/20 00:10:14 vossg Exp $"
00345
00346 #endif