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 _OSGORTHOGRAPHICCAMERABASE_H_
00055 #define _OSGORTHOGRAPHICCAMERABASE_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 <OSGCamera.h>
00069
00070 #include <OSGReal32Fields.h>
00071 #include <OSGReal32Fields.h>
00072 #include <OSGReal32Fields.h>
00073
00074 #include <OSGOrthographicCameraFields.h>
00075
00076 OSG_BEGIN_NAMESPACE
00077
00078 class OrthographicCamera;
00079 class BinaryDataHandler;
00080
00082
00083 class OSG_SYSTEMLIB_DLLMAPPING OrthographicCameraBase : public Camera
00084 {
00085 private:
00086
00087 typedef Camera Inherited;
00088
00089
00090 public:
00091
00092 typedef OrthographicCameraPtr Ptr;
00093
00094 enum
00095 {
00096 VerticalSizeFieldId = Inherited::NextFieldId,
00097 HorizontalSizeFieldId = VerticalSizeFieldId + 1,
00098 AspectFieldId = HorizontalSizeFieldId + 1,
00099 NextFieldId = AspectFieldId + 1
00100 };
00101
00102 static const OSG::BitVector VerticalSizeFieldMask;
00103 static const OSG::BitVector HorizontalSizeFieldMask;
00104 static const OSG::BitVector AspectFieldMask;
00105
00106
00107 static const OSG::BitVector MTInfluenceMask;
00108
00109
00113 static FieldContainerType &getClassType (void);
00114 static UInt32 getClassTypeId (void);
00115
00117
00121 virtual FieldContainerType &getType (void);
00122 virtual const FieldContainerType &getType (void) const;
00123
00124 virtual UInt32 getContainerSize(void) const;
00125
00127
00132 SFReal32 *editSFVerticalSize (void);
00133 const SFReal32 *getSFVerticalSize (void) const;
00134 #ifndef OSG_2_PREP
00135 SFReal32 *getSFVerticalSize (void);
00136 #endif
00137
00138 SFReal32 *editSFHorizontalSize (void);
00139 const SFReal32 *getSFHorizontalSize (void) const;
00140 #ifndef OSG_2_PREP
00141 SFReal32 *getSFHorizontalSize (void);
00142 #endif
00143
00144 SFReal32 *editSFAspect (void);
00145 const SFReal32 *getSFAspect (void) const;
00146 #ifndef OSG_2_PREP
00147 SFReal32 *getSFAspect (void);
00148 #endif
00149
00150
00151 Real32 &editVerticalSize (void);
00152 const Real32 &getVerticalSize (void) const;
00153 #ifndef OSG_2_PREP
00154 Real32 &getVerticalSize (void);
00155 #endif
00156
00157 Real32 &editHorizontalSize (void);
00158 const Real32 &getHorizontalSize (void) const;
00159 #ifndef OSG_2_PREP
00160 Real32 &getHorizontalSize (void);
00161 #endif
00162
00163 Real32 &editAspect (void);
00164 const Real32 &getAspect (void) const;
00165 #ifndef OSG_2_PREP
00166 Real32 &getAspect (void);
00167 #endif
00168
00170
00174 void setVerticalSize ( const Real32 &value );
00175 void setHorizontalSize ( const Real32 &value );
00176 void setAspect ( const Real32 &value );
00177
00179
00184
00188 virtual UInt32 getBinSize (const BitVector &whichField);
00189 virtual void copyToBin ( BinaryDataHandler &pMem,
00190 const BitVector &whichField);
00191 virtual void copyFromBin( BinaryDataHandler &pMem,
00192 const BitVector &whichField);
00193
00194
00196
00200 static OrthographicCameraPtr create (void);
00201 static OrthographicCameraPtr createEmpty (void);
00202
00205
00209 virtual FieldContainerPtr shallowCopy (void) const;
00210
00212
00213 protected:
00214
00215
00219 SFReal32 _sfVerticalSize;
00220 SFReal32 _sfHorizontalSize;
00221 SFReal32 _sfAspect;
00222
00224
00228 OrthographicCameraBase(void);
00229 OrthographicCameraBase(const OrthographicCameraBase &source);
00230
00232
00236 virtual ~OrthographicCameraBase(void);
00237
00239
00243 #if !defined(OSG_FIXED_MFIELDSYNC)
00244 void executeSyncImpl( OrthographicCameraBase *pOther,
00245 const BitVector &whichField);
00246
00247 virtual void executeSync( FieldContainer &other,
00248 const BitVector &whichField);
00249 #else
00250 void executeSyncImpl( OrthographicCameraBase *pOther,
00251 const BitVector &whichField,
00252 const SyncInfo &sInfo );
00253
00254 virtual void executeSync( FieldContainer &other,
00255 const BitVector &whichField,
00256 const SyncInfo &sInfo);
00257
00258 virtual void execBeginEdit (const BitVector &whichField,
00259 UInt32 uiAspect,
00260 UInt32 uiContainerSize);
00261
00262 void execBeginEditImpl (const BitVector &whichField,
00263 UInt32 uiAspect,
00264 UInt32 uiContainerSize);
00265
00266 virtual void onDestroyAspect(UInt32 uiId, UInt32 uiAspect);
00267 #endif
00268
00270
00271 private:
00272
00273 friend class FieldContainer;
00274
00275 static FieldDescription *_desc[];
00276 static FieldContainerType _type;
00277
00278
00279
00280 void operator =(const OrthographicCameraBase &source);
00281 };
00282
00283
00284
00285
00286
00287
00288 typedef OrthographicCameraBase *OrthographicCameraBaseP;
00289
00290 typedef osgIF<OrthographicCameraBase::isNodeCore,
00291 CoredNodePtr<OrthographicCamera>,
00292 FieldContainer::attempt_to_create_CoredNodePtr_on_non_NodeCore_FC
00293 >::_IRet OrthographicCameraNodePtr;
00294
00295 typedef RefPtr<OrthographicCameraPtr> OrthographicCameraRefPtr;
00296
00297 OSG_END_NAMESPACE
00298
00299 #define OSGORTHOGRAPHICCAMERABASE_HEADER_CVSID "@(#)$Id: OSGOrthographicCameraBase.h,v 1.6 2008/11/04 15:23:45 pdaehne Exp $"
00300
00301 #endif