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 _OSGSURFACEBASE_H_
00055 #define _OSGSURFACEBASE_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 <OSGGeometry.h>
00069
00070 #include <OSGUInt32Fields.h>
00071 #include <OSGUInt32Fields.h>
00072 #include <OSGReal32Fields.h>
00073 #include <OSGReal32Fields.h>
00074 #include <OSGGeoPositionsFields.h>
00075 #include <OSGReal32Fields.h>
00076 #include <OSGUInt32Fields.h>
00077 #include <OSGUInt32Fields.h>
00078 #include <OSGUInt32Fields.h>
00079 #include <OSGPnt3fFields.h>
00080 #include <OSGReal32Fields.h>
00081 #include <OSGUInt32Fields.h>
00082 #include <OSGBoolFields.h>
00083 #include <OSGGeoTexCoordsFields.h>
00084 #include <OSGUInt32Fields.h>
00085 #include <OSGInt32Fields.h>
00086
00087 #include <OSGSurfaceFields.h>
00088
00089 OSG_BEGIN_NAMESPACE
00090
00091 class Surface;
00092 class BinaryDataHandler;
00093
00095
00096 class OSG_SYSTEMLIB_DLLMAPPING SurfaceBase : public Geometry
00097 {
00098 private:
00099
00100 typedef Geometry Inherited;
00101
00102
00103 public:
00104
00105 typedef SurfacePtr Ptr;
00106
00107 enum
00108 {
00109 DimUFieldId = Inherited::NextFieldId,
00110 DimVFieldId = DimUFieldId + 1,
00111 KnotsUFieldId = DimVFieldId + 1,
00112 KnotsVFieldId = KnotsUFieldId + 1,
00113 ControlPointsFieldId = KnotsVFieldId + 1,
00114 ErrorFieldId = ControlPointsFieldId + 1,
00115 NumCurvesFieldId = ErrorFieldId + 1,
00116 KnotLengthsFieldId = NumCurvesFieldId + 1,
00117 DimensionsFieldId = KnotLengthsFieldId + 1,
00118 CurveControlPointsFieldId = DimensionsFieldId + 1,
00119 KnotsFieldId = CurveControlPointsFieldId + 1,
00120 CurvesPerLoopFieldId = KnotsFieldId + 1,
00121 IsDelaunayFieldId = CurvesPerLoopFieldId + 1,
00122 TextureControlPointsFieldId = IsDelaunayFieldId + 1,
00123 DirtyMaskFieldId = TextureControlPointsFieldId + 1,
00124 SurfaceGLIdFieldId = DirtyMaskFieldId + 1,
00125 NextFieldId = SurfaceGLIdFieldId + 1
00126 };
00127
00128 static const OSG::BitVector DimUFieldMask;
00129 static const OSG::BitVector DimVFieldMask;
00130 static const OSG::BitVector KnotsUFieldMask;
00131 static const OSG::BitVector KnotsVFieldMask;
00132 static const OSG::BitVector ControlPointsFieldMask;
00133 static const OSG::BitVector ErrorFieldMask;
00134 static const OSG::BitVector NumCurvesFieldMask;
00135 static const OSG::BitVector KnotLengthsFieldMask;
00136 static const OSG::BitVector DimensionsFieldMask;
00137 static const OSG::BitVector CurveControlPointsFieldMask;
00138 static const OSG::BitVector KnotsFieldMask;
00139 static const OSG::BitVector CurvesPerLoopFieldMask;
00140 static const OSG::BitVector IsDelaunayFieldMask;
00141 static const OSG::BitVector TextureControlPointsFieldMask;
00142 static const OSG::BitVector DirtyMaskFieldMask;
00143 static const OSG::BitVector SurfaceGLIdFieldMask;
00144
00145
00146 static const OSG::BitVector MTInfluenceMask;
00147
00148
00152 static FieldContainerType &getClassType (void);
00153 static UInt32 getClassTypeId (void);
00154
00156
00160 virtual FieldContainerType &getType (void);
00161 virtual const FieldContainerType &getType (void) const;
00162
00163 virtual UInt32 getContainerSize(void) const;
00164
00166
00170 SFUInt32 *getSFDimU (void);
00171 SFUInt32 *getSFDimV (void);
00172 MFReal32 *getMFKnotsU (void);
00173 MFReal32 *getMFKnotsV (void);
00174 SFGeoPositionsPtr *getSFControlPoints (void);
00175 SFReal32 *getSFError (void);
00176 SFBool *getSFIsDelaunay (void);
00177 SFGeoTexCoordsPtr *getSFTextureControlPoints(void);
00178
00179 UInt32 &getDimU (void);
00180 const UInt32 &getDimU (void) const;
00181 UInt32 &getDimV (void);
00182 const UInt32 &getDimV (void) const;
00183 GeoPositionsPtr &getControlPoints (void);
00184 const GeoPositionsPtr &getControlPoints (void) const;
00185 Real32 &getError (void);
00186 const Real32 &getError (void) const;
00187 bool &getIsDelaunay (void);
00188 const bool &getIsDelaunay (void) const;
00189 GeoTexCoordsPtr &getTextureControlPoints(void);
00190 const GeoTexCoordsPtr &getTextureControlPoints(void) const;
00191 Real32 &getKnotsU (const UInt32 index);
00192 MFReal32 &getKnotsU (void);
00193 const MFReal32 &getKnotsU (void) const;
00194 Real32 &getKnotsV (const UInt32 index);
00195 MFReal32 &getKnotsV (void);
00196 const MFReal32 &getKnotsV (void) const;
00197
00199
00203 void setDimU ( const UInt32 &value );
00204 void setDimV ( const UInt32 &value );
00205 void setControlPoints ( const GeoPositionsPtr &value );
00206 void setError ( const Real32 &value );
00207 void setIsDelaunay ( const bool &value );
00208 void setTextureControlPoints( const GeoTexCoordsPtr &value );
00209
00211
00216
00220 virtual UInt32 getBinSize (const BitVector &whichField);
00221 virtual void copyToBin ( BinaryDataHandler &pMem,
00222 const BitVector &whichField);
00223 virtual void copyFromBin( BinaryDataHandler &pMem,
00224 const BitVector &whichField);
00225
00226
00228
00232 static SurfacePtr create (void);
00233 static SurfacePtr createEmpty (void);
00234
00237
00241 virtual FieldContainerPtr shallowCopy (void) const;
00242
00244
00245 protected:
00246
00247
00251 SFUInt32 _sfDimU;
00252 SFUInt32 _sfDimV;
00253 MFReal32 _mfKnotsU;
00254 MFReal32 _mfKnotsV;
00255 SFGeoPositionsPtr _sfControlPoints;
00256 SFReal32 _sfError;
00257 SFUInt32 _sfNumCurves;
00258 MFUInt32 _mfKnotLengths;
00259 MFUInt32 _mfDimensions;
00260 MFPnt3f _mfCurveControlPoints;
00261 MFReal32 _mfKnots;
00262 MFUInt32 _mfCurvesPerLoop;
00263 SFBool _sfIsDelaunay;
00264 SFGeoTexCoordsPtr _sfTextureControlPoints;
00265 SFUInt32 _sfDirtyMask;
00266 SFInt32 _sfSurfaceGLId;
00267
00269
00273 SurfaceBase(void);
00274 SurfaceBase(const SurfaceBase &source);
00275
00277
00281 virtual ~SurfaceBase(void);
00282
00284
00288 SFUInt32 *getSFNumCurves (void);
00289 MFUInt32 *getMFKnotLengths (void);
00290 MFUInt32 *getMFDimensions (void);
00291 MFPnt3f *getMFCurveControlPoints(void);
00292 MFReal32 *getMFKnots (void);
00293 MFUInt32 *getMFCurvesPerLoop (void);
00294 SFUInt32 *getSFDirtyMask (void);
00295 SFInt32 *getSFSurfaceGLId (void);
00296
00297 UInt32 &getNumCurves (void);
00298 const UInt32 &getNumCurves (void) const;
00299 UInt32 &getDirtyMask (void);
00300 const UInt32 &getDirtyMask (void) const;
00301 Int32 &getSurfaceGLId (void);
00302 const Int32 &getSurfaceGLId (void) const;
00303 UInt32 &getKnotLengths (UInt32 index);
00304 MFUInt32 &getKnotLengths (void);
00305 const MFUInt32 &getKnotLengths (void) const;
00306 UInt32 &getDimensions (UInt32 index);
00307 MFUInt32 &getDimensions (void);
00308 const MFUInt32 &getDimensions (void) const;
00309 Pnt3f &getCurveControlPoints(UInt32 index);
00310 MFPnt3f &getCurveControlPoints(void);
00311 const MFPnt3f &getCurveControlPoints(void) const;
00312 Real32 &getKnots (UInt32 index);
00313 MFReal32 &getKnots (void);
00314 const MFReal32 &getKnots (void) const;
00315 UInt32 &getCurvesPerLoop (UInt32 index);
00316 MFUInt32 &getCurvesPerLoop (void);
00317 const MFUInt32 &getCurvesPerLoop (void) const;
00318
00320
00324 void setNumCurves (const UInt32 &value);
00325 void setDirtyMask (const UInt32 &value);
00326 void setSurfaceGLId (const Int32 &value);
00327
00329
00333 #if !defined(OSG_FIXED_MFIELDSYNC)
00334 void executeSyncImpl( SurfaceBase *pOther,
00335 const BitVector &whichField);
00336
00337 virtual void executeSync( FieldContainer &other,
00338 const BitVector &whichField);
00339 #else
00340 void executeSyncImpl( SurfaceBase *pOther,
00341 const BitVector &whichField,
00342 const SyncInfo &sInfo );
00343
00344 virtual void executeSync( FieldContainer &other,
00345 const BitVector &whichField,
00346 const SyncInfo &sInfo);
00347
00348 virtual void execBeginEdit (const BitVector &whichField,
00349 UInt32 uiAspect,
00350 UInt32 uiContainerSize);
00351
00352 void execBeginEditImpl (const BitVector &whichField,
00353 UInt32 uiAspect,
00354 UInt32 uiContainerSize);
00355
00356 virtual void onDestroyAspect(UInt32 uiId, UInt32 uiAspect);
00357 #endif
00358
00360
00361 private:
00362
00363 friend class FieldContainer;
00364
00365 static FieldDescription *_desc[];
00366 static FieldContainerType _type;
00367
00368
00369
00370 void operator =(const SurfaceBase &source);
00371 };
00372
00373
00374
00375
00376
00377
00378 typedef SurfaceBase *SurfaceBaseP;
00379
00380 typedef osgIF<SurfaceBase::isNodeCore,
00381 CoredNodePtr<Surface>,
00382 FieldContainer::attempt_to_create_CoredNodePtr_on_non_NodeCore_FC
00383 >::_IRet SurfaceNodePtr;
00384
00385 typedef RefPtr<SurfacePtr> SurfaceRefPtr;
00386
00387 OSG_END_NAMESPACE
00388
00389 #define OSGSURFACEBASE_HEADER_CVSID "@(#)$Id: FCBaseTemplate_h.h,v 1.38 2005/07/08 06:37:35 vossg Exp $"
00390
00391 #endif