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 _OSGPROJECTIONCAMERADECORATORBASE_H_
00055 #define _OSGPROJECTIONCAMERADECORATORBASE_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 <OSGStereoCameraDecorator.h>
00069
00070 #include <OSGNodeFields.h>
00071 #include <OSGPnt3fFields.h>
00072 #include <OSGPlaneFields.h>
00073 #include <OSGPlaneFields.h>
00074 #include <OSGPlaneFields.h>
00075 #include <OSGReal32Fields.h>
00076 #include <OSGReal32Fields.h>
00077
00078 #include <OSGProjectionCameraDecoratorFields.h>
00079
00080 OSG_BEGIN_NAMESPACE
00081
00082 class ProjectionCameraDecorator;
00083 class BinaryDataHandler;
00084
00086
00087 class OSG_SYSTEMLIB_DLLMAPPING ProjectionCameraDecoratorBase : public StereoCameraDecorator
00088 {
00089 private:
00090
00091 typedef StereoCameraDecorator Inherited;
00092
00093
00094 public:
00095
00096 typedef ProjectionCameraDecoratorPtr Ptr;
00097
00098 enum
00099 {
00100 UserFieldId = Inherited::NextFieldId,
00101 SurfaceFieldId = UserFieldId + 1,
00102 LeftFieldId = SurfaceFieldId + 1,
00103 BottomFieldId = LeftFieldId + 1,
00104 NormalFieldId = BottomFieldId + 1,
00105 WidthFieldId = NormalFieldId + 1,
00106 HeightFieldId = WidthFieldId + 1,
00107 NextFieldId = HeightFieldId + 1
00108 };
00109
00110 static const OSG::BitVector UserFieldMask;
00111 static const OSG::BitVector SurfaceFieldMask;
00112 static const OSG::BitVector LeftFieldMask;
00113 static const OSG::BitVector BottomFieldMask;
00114 static const OSG::BitVector NormalFieldMask;
00115 static const OSG::BitVector WidthFieldMask;
00116 static const OSG::BitVector HeightFieldMask;
00117
00118
00119 static const OSG::BitVector MTInfluenceMask;
00120
00121
00125 static FieldContainerType &getClassType (void);
00126 static UInt32 getClassTypeId (void);
00127
00129
00133 virtual FieldContainerType &getType (void);
00134 virtual const FieldContainerType &getType (void) const;
00135
00136 virtual UInt32 getContainerSize(void) const;
00137
00139
00143 SFNodePtr *getSFUser (void);
00144 MFPnt3f *getMFSurface (void);
00145 SFReal32 *getSFWidth (void);
00146 SFReal32 *getSFHeight (void);
00147
00148 NodePtr &getUser (void);
00149 const NodePtr &getUser (void) const;
00150 Real32 &getWidth (void);
00151 const Real32 &getWidth (void) const;
00152 Real32 &getHeight (void);
00153 const Real32 &getHeight (void) const;
00154 Pnt3f &getSurface (const UInt32 index);
00155 MFPnt3f &getSurface (void);
00156 const MFPnt3f &getSurface (void) const;
00157
00159
00163 void setUser ( const NodePtr &value );
00164 void setWidth ( const Real32 &value );
00165 void setHeight ( const Real32 &value );
00166
00168
00173
00177 virtual UInt32 getBinSize (const BitVector &whichField);
00178 virtual void copyToBin ( BinaryDataHandler &pMem,
00179 const BitVector &whichField);
00180 virtual void copyFromBin( BinaryDataHandler &pMem,
00181 const BitVector &whichField);
00182
00183
00185
00189 static ProjectionCameraDecoratorPtr create (void);
00190 static ProjectionCameraDecoratorPtr createEmpty (void);
00191
00194
00198 virtual FieldContainerPtr shallowCopy (void) const;
00199
00201
00202 protected:
00203
00204
00208 SFNodePtr _sfUser;
00209 MFPnt3f _mfSurface;
00210 SFPlane _sfLeft;
00211 SFPlane _sfBottom;
00212 SFPlane _sfNormal;
00213 SFReal32 _sfWidth;
00214 SFReal32 _sfHeight;
00215
00217
00221 ProjectionCameraDecoratorBase(void);
00222 ProjectionCameraDecoratorBase(const ProjectionCameraDecoratorBase &source);
00223
00225
00229 virtual ~ProjectionCameraDecoratorBase(void);
00230
00232
00236 SFPlane *getSFLeft (void);
00237 SFPlane *getSFBottom (void);
00238 SFPlane *getSFNormal (void);
00239
00240 Plane &getLeft (void);
00241 const Plane &getLeft (void) const;
00242 Plane &getBottom (void);
00243 const Plane &getBottom (void) const;
00244 Plane &getNormal (void);
00245 const Plane &getNormal (void) const;
00246
00248
00252 void setLeft (const Plane &value);
00253 void setBottom (const Plane &value);
00254 void setNormal (const Plane &value);
00255
00257
00261 #if !defined(OSG_FIXED_MFIELDSYNC)
00262 void executeSyncImpl( ProjectionCameraDecoratorBase *pOther,
00263 const BitVector &whichField);
00264
00265 virtual void executeSync( FieldContainer &other,
00266 const BitVector &whichField);
00267 #else
00268 void executeSyncImpl( ProjectionCameraDecoratorBase *pOther,
00269 const BitVector &whichField,
00270 const SyncInfo &sInfo );
00271
00272 virtual void executeSync( FieldContainer &other,
00273 const BitVector &whichField,
00274 const SyncInfo &sInfo);
00275
00276 virtual void execBeginEdit (const BitVector &whichField,
00277 UInt32 uiAspect,
00278 UInt32 uiContainerSize);
00279
00280 void execBeginEditImpl (const BitVector &whichField,
00281 UInt32 uiAspect,
00282 UInt32 uiContainerSize);
00283
00284 virtual void onDestroyAspect(UInt32 uiId, UInt32 uiAspect);
00285 #endif
00286
00288
00289 private:
00290
00291 friend class FieldContainer;
00292
00293 static FieldDescription *_desc[];
00294 static FieldContainerType _type;
00295
00296
00297
00298 void operator =(const ProjectionCameraDecoratorBase &source);
00299 };
00300
00301
00302
00303
00304
00305
00306 typedef ProjectionCameraDecoratorBase *ProjectionCameraDecoratorBaseP;
00307
00308 typedef osgIF<ProjectionCameraDecoratorBase::isNodeCore,
00309 CoredNodePtr<ProjectionCameraDecorator>,
00310 FieldContainer::attempt_to_create_CoredNodePtr_on_non_NodeCore_FC
00311 >::_IRet ProjectionCameraDecoratorNodePtr;
00312
00313 typedef RefPtr<ProjectionCameraDecoratorPtr> ProjectionCameraDecoratorRefPtr;
00314
00315 OSG_END_NAMESPACE
00316
00317 #define OSGPROJECTIONCAMERADECORATORBASE_HEADER_CVSID "@(#)$Id: FCBaseTemplate_h.h,v 1.40 2005/07/20 00:10:14 vossg Exp $"
00318
00319 #endif