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 _OSGPOINTCHUNKBASE_H_
00055 #define _OSGPOINTCHUNKBASE_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 <OSGReal32Fields.h>
00071 #include <OSGBoolFields.h>
00072 #include <OSGReal32Fields.h>
00073 #include <OSGReal32Fields.h>
00074 #include <OSGReal32Fields.h>
00075 #include <OSGReal32Fields.h>
00076 #include <OSGReal32Fields.h>
00077 #include <OSGReal32Fields.h>
00078 #include <OSGBoolFields.h>
00079 #include <OSGGLenumFields.h>
00080
00081 #include <OSGPointChunkFields.h>
00082
00083 OSG_BEGIN_NAMESPACE
00084
00085 class PointChunk;
00086 class BinaryDataHandler;
00087
00089
00090 class OSG_SYSTEMLIB_DLLMAPPING PointChunkBase : public StateChunk
00091 {
00092 private:
00093
00094 typedef StateChunk Inherited;
00095
00096
00097 public:
00098
00099 typedef PointChunkPtr Ptr;
00100
00101 enum
00102 {
00103 SizeFieldId = Inherited::NextFieldId,
00104 SmoothFieldId = SizeFieldId + 1,
00105 MinSizeFieldId = SmoothFieldId + 1,
00106 MaxSizeFieldId = MinSizeFieldId + 1,
00107 ConstantAttenuationFieldId = MaxSizeFieldId + 1,
00108 LinearAttenuationFieldId = ConstantAttenuationFieldId + 1,
00109 QuadraticAttenuationFieldId = LinearAttenuationFieldId + 1,
00110 FadeThresholdFieldId = QuadraticAttenuationFieldId + 1,
00111 SpriteFieldId = FadeThresholdFieldId + 1,
00112 RModeFieldId = SpriteFieldId + 1,
00113 NextFieldId = RModeFieldId + 1
00114 };
00115
00116 static const OSG::BitVector SizeFieldMask;
00117 static const OSG::BitVector SmoothFieldMask;
00118 static const OSG::BitVector MinSizeFieldMask;
00119 static const OSG::BitVector MaxSizeFieldMask;
00120 static const OSG::BitVector ConstantAttenuationFieldMask;
00121 static const OSG::BitVector LinearAttenuationFieldMask;
00122 static const OSG::BitVector QuadraticAttenuationFieldMask;
00123 static const OSG::BitVector FadeThresholdFieldMask;
00124 static const OSG::BitVector SpriteFieldMask;
00125 static const OSG::BitVector RModeFieldMask;
00126
00127
00128 static const OSG::BitVector MTInfluenceMask;
00129
00130
00134 static FieldContainerType &getClassType (void);
00135 static UInt32 getClassTypeId (void);
00136
00138
00142 virtual FieldContainerType &getType (void);
00143 virtual const FieldContainerType &getType (void) const;
00144
00145 virtual UInt32 getContainerSize(void) const;
00146
00148
00152 SFReal32 *getSFSize (void);
00153 SFBool *getSFSmooth (void);
00154 SFReal32 *getSFMinSize (void);
00155 SFReal32 *getSFMaxSize (void);
00156 SFReal32 *getSFConstantAttenuation(void);
00157 SFReal32 *getSFLinearAttenuation(void);
00158 SFReal32 *getSFQuadraticAttenuation(void);
00159 SFReal32 *getSFFadeThreshold (void);
00160 SFBool *getSFSprite (void);
00161 SFGLenum *getSFRMode (void);
00162
00163 Real32 &getSize (void);
00164 const Real32 &getSize (void) const;
00165 bool &getSmooth (void);
00166 const bool &getSmooth (void) const;
00167 Real32 &getMinSize (void);
00168 const Real32 &getMinSize (void) const;
00169 Real32 &getMaxSize (void);
00170 const Real32 &getMaxSize (void) const;
00171 Real32 &getConstantAttenuation(void);
00172 const Real32 &getConstantAttenuation(void) const;
00173 Real32 &getLinearAttenuation(void);
00174 const Real32 &getLinearAttenuation(void) const;
00175 Real32 &getQuadraticAttenuation(void);
00176 const Real32 &getQuadraticAttenuation(void) const;
00177 Real32 &getFadeThreshold (void);
00178 const Real32 &getFadeThreshold (void) const;
00179 bool &getSprite (void);
00180 const bool &getSprite (void) const;
00181 GLenum &getRMode (void);
00182 const GLenum &getRMode (void) const;
00183
00185
00189 void setSize ( const Real32 &value );
00190 void setSmooth ( const bool &value );
00191 void setMinSize ( const Real32 &value );
00192 void setMaxSize ( const Real32 &value );
00193 void setConstantAttenuation( const Real32 &value );
00194 void setLinearAttenuation( const Real32 &value );
00195 void setQuadraticAttenuation( const Real32 &value );
00196 void setFadeThreshold ( const Real32 &value );
00197 void setSprite ( const bool &value );
00198 void setRMode ( const GLenum &value );
00199
00201
00206
00210 virtual UInt32 getBinSize (const BitVector &whichField);
00211 virtual void copyToBin ( BinaryDataHandler &pMem,
00212 const BitVector &whichField);
00213 virtual void copyFromBin( BinaryDataHandler &pMem,
00214 const BitVector &whichField);
00215
00216
00218
00222 static PointChunkPtr create (void);
00223 static PointChunkPtr createEmpty (void);
00224
00227
00231 virtual FieldContainerPtr shallowCopy (void) const;
00232
00234
00235 protected:
00236
00237
00241 SFReal32 _sfSize;
00242 SFBool _sfSmooth;
00243 SFReal32 _sfMinSize;
00244 SFReal32 _sfMaxSize;
00245 SFReal32 _sfConstantAttenuation;
00246 SFReal32 _sfLinearAttenuation;
00247 SFReal32 _sfQuadraticAttenuation;
00248 SFReal32 _sfFadeThreshold;
00249 SFBool _sfSprite;
00250 SFGLenum _sfRMode;
00251
00253
00257 PointChunkBase(void);
00258 PointChunkBase(const PointChunkBase &source);
00259
00261
00265 virtual ~PointChunkBase(void);
00266
00268
00272 #if !defined(OSG_FIXED_MFIELDSYNC)
00273 void executeSyncImpl( PointChunkBase *pOther,
00274 const BitVector &whichField);
00275
00276 virtual void executeSync( FieldContainer &other,
00277 const BitVector &whichField);
00278 #else
00279 void executeSyncImpl( PointChunkBase *pOther,
00280 const BitVector &whichField,
00281 const SyncInfo &sInfo );
00282
00283 virtual void executeSync( FieldContainer &other,
00284 const BitVector &whichField,
00285 const SyncInfo &sInfo);
00286
00287 virtual void execBeginEdit (const BitVector &whichField,
00288 UInt32 uiAspect,
00289 UInt32 uiContainerSize);
00290
00291 void execBeginEditImpl (const BitVector &whichField,
00292 UInt32 uiAspect,
00293 UInt32 uiContainerSize);
00294
00295 virtual void onDestroyAspect(UInt32 uiId, UInt32 uiAspect);
00296 #endif
00297
00299
00300 private:
00301
00302 friend class FieldContainer;
00303
00304 static FieldDescription *_desc[];
00305 static FieldContainerType _type;
00306
00307
00308
00309 void operator =(const PointChunkBase &source);
00310 };
00311
00312
00313
00314
00315
00316
00317 typedef PointChunkBase *PointChunkBaseP;
00318
00319 typedef osgIF<PointChunkBase::isNodeCore,
00320 CoredNodePtr<PointChunk>,
00321 FieldContainer::attempt_to_create_CoredNodePtr_on_non_NodeCore_FC
00322 >::_IRet PointChunkNodePtr;
00323
00324 typedef RefPtr<PointChunkPtr> PointChunkRefPtr;
00325
00326 OSG_END_NAMESPACE
00327
00328 #define OSGPOINTCHUNKBASE_HEADER_CVSID "@(#)$Id: FCBaseTemplate_h.h,v 1.40 2005/07/20 00:10:14 vossg Exp $"
00329
00330 #endif