OSGAlgorithmStageBase.h
Go to the documentation of this file.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 _OSGALGORITHMSTAGEBASE_H_
00055 #define _OSGALGORITHMSTAGEBASE_H_
00056 #ifdef __sgi
00057 #pragma once
00058 #endif
00059
00060
00061 #include "OSGConfig.h"
00062 #include "OSGGroupDef.h"
00063
00064
00065
00066 #include "OSGStage.h"
00067
00068 #include "OSGAlgorithmFields.h"
00069 #include "OSGSysFields.h"
00070 #include "OSGMathFields.h"
00071
00072 #include "OSGAlgorithmStageFields.h"
00073
00074 OSG_BEGIN_NAMESPACE
00075
00076 class AlgorithmStage;
00077
00079
00080 class OSG_GROUP_DLLMAPPING AlgorithmStageBase : public Stage
00081 {
00082 public:
00083
00084 typedef Stage Inherited;
00085 typedef Stage ParentContainer;
00086
00087 typedef Inherited::TypeObject TypeObject;
00088 typedef TypeObject::InitPhase InitPhase;
00089
00090 OSG_GEN_INTERNALPTR(AlgorithmStage);
00091
00092
00093
00094 public:
00095
00096 enum
00097 {
00098 AlgorithmFieldId = Inherited::NextFieldId,
00099 ProjectionModeFieldId = AlgorithmFieldId + 1,
00100 CopyViewingFieldId = ProjectionModeFieldId + 1,
00101 ProjectionMatrixFieldId = CopyViewingFieldId + 1,
00102 NextFieldId = ProjectionMatrixFieldId + 1
00103 };
00104
00105 static const OSG::BitVector AlgorithmFieldMask =
00106 (TypeTraits<BitVector>::One << AlgorithmFieldId);
00107 static const OSG::BitVector ProjectionModeFieldMask =
00108 (TypeTraits<BitVector>::One << ProjectionModeFieldId);
00109 static const OSG::BitVector CopyViewingFieldMask =
00110 (TypeTraits<BitVector>::One << CopyViewingFieldId);
00111 static const OSG::BitVector ProjectionMatrixFieldMask =
00112 (TypeTraits<BitVector>::One << ProjectionMatrixFieldId);
00113 static const OSG::BitVector NextFieldMask =
00114 (TypeTraits<BitVector>::One << NextFieldId);
00115
00116 typedef SFUnrecAlgorithmPtr SFAlgorithmType;
00117 typedef SFUInt32 SFProjectionModeType;
00118 typedef SFBool SFCopyViewingType;
00119 typedef SFMatrix SFProjectionMatrixType;
00120
00121
00125 static FieldContainerType &getClassType (void);
00126 static UInt32 getClassTypeId (void);
00127 static UInt16 getClassGroupId(void);
00128
00130
00134 virtual FieldContainerType &getType (void);
00135 virtual const FieldContainerType &getType (void) const;
00136
00137 virtual UInt32 getContainerSize(void) const;
00138
00140
00144 const SFUnrecAlgorithmPtr *getSFAlgorithm (void) const;
00145 SFUnrecAlgorithmPtr *editSFAlgorithm (void);
00146
00147 SFUInt32 *editSFProjectionMode (void);
00148 const SFUInt32 *getSFProjectionMode (void) const;
00149
00150 SFBool *editSFCopyViewing (void);
00151 const SFBool *getSFCopyViewing (void) const;
00152
00153 SFMatrix *editSFProjectionMatrix(void);
00154 const SFMatrix *getSFProjectionMatrix (void) const;
00155
00156
00157 Algorithm * getAlgorithm (void) const;
00158
00159 UInt32 &editProjectionMode (void);
00160 UInt32 getProjectionMode (void) const;
00161
00162 bool &editCopyViewing (void);
00163 bool getCopyViewing (void) const;
00164
00165 Matrix &editProjectionMatrix(void);
00166 const Matrix &getProjectionMatrix (void) const;
00167
00169
00173 void setAlgorithm (Algorithm * const value);
00174 void setProjectionMode (const UInt32 value);
00175 void setCopyViewing (const bool value);
00176 void setProjectionMatrix(const Matrix &value);
00177
00179
00184
00189
00193 virtual UInt32 getBinSize (ConstFieldMaskArg whichField);
00194 virtual void copyToBin (BinaryDataHandler &pMem,
00195 ConstFieldMaskArg whichField);
00196 virtual void copyFromBin(BinaryDataHandler &pMem,
00197 ConstFieldMaskArg whichField);
00198
00199
00201
00205 static AlgorithmStageTransitPtr create (void);
00206 static AlgorithmStage *createEmpty (void);
00207
00208 static AlgorithmStageTransitPtr createLocal (
00209 BitVector bFlags = FCLocal::All);
00210
00211 static AlgorithmStage *createEmptyLocal(
00212 BitVector bFlags = FCLocal::All);
00213
00214 static AlgorithmStageTransitPtr createDependent (BitVector bFlags);
00215
00217
00221 virtual FieldContainerTransitPtr shallowCopy (void) const;
00222 virtual FieldContainerTransitPtr shallowCopyLocal(
00223 BitVector bFlags = FCLocal::All) const;
00224 virtual FieldContainerTransitPtr shallowCopyDependent(
00225 BitVector bFlags) const;
00226
00228
00229
00230 protected:
00231
00232 static TypeObject _type;
00233
00234 static void classDescInserter(TypeObject &oType);
00235 static const Char8 *getClassname (void );
00236
00237
00241 SFUnrecAlgorithmPtr _sfAlgorithm;
00242 SFUInt32 _sfProjectionMode;
00243 SFBool _sfCopyViewing;
00244 SFMatrix _sfProjectionMatrix;
00245
00247
00251 AlgorithmStageBase(void);
00252 AlgorithmStageBase(const AlgorithmStageBase &source);
00253
00255
00259 virtual ~AlgorithmStageBase(void);
00260
00262
00266 void onCreate(const AlgorithmStage *source = NULL);
00267
00269
00273 GetFieldHandlePtr getHandleAlgorithm (void) const;
00274 EditFieldHandlePtr editHandleAlgorithm (void);
00275 GetFieldHandlePtr getHandleProjectionMode (void) const;
00276 EditFieldHandlePtr editHandleProjectionMode (void);
00277 GetFieldHandlePtr getHandleCopyViewing (void) const;
00278 EditFieldHandlePtr editHandleCopyViewing (void);
00279 GetFieldHandlePtr getHandleProjectionMatrix (void) const;
00280 EditFieldHandlePtr editHandleProjectionMatrix(void);
00281
00283
00287 #ifdef OSG_MT_CPTR_ASPECT
00288 virtual void execSyncV( FieldContainer &oFrom,
00289 ConstFieldMaskArg whichField,
00290 AspectOffsetStore &oOffsets,
00291 ConstFieldMaskArg syncMode ,
00292 const UInt32 uiSyncInfo);
00293
00294 void execSync ( AlgorithmStageBase *pFrom,
00295 ConstFieldMaskArg whichField,
00296 AspectOffsetStore &oOffsets,
00297 ConstFieldMaskArg syncMode ,
00298 const UInt32 uiSyncInfo);
00299 #endif
00300
00302
00307
00311 #ifdef OSG_MT_CPTR_ASPECT
00312 virtual FieldContainer *createAspectCopy(
00313 const FieldContainer *pRefAspect) const;
00314 #endif
00315
00317
00321
00325 virtual void resolveLinks(void);
00326
00328
00329
00330 private:
00331
00332
00333
00334 void operator =(const AlgorithmStageBase &source);
00335 };
00336
00337 typedef AlgorithmStageBase *AlgorithmStageBaseP;
00338
00339 typedef CoredNodeRefPtr <AlgorithmStage> AlgorithmStageNodeRefPtr;
00340 typedef CoredNodeMTRefPtr<AlgorithmStage> AlgorithmStageNodeMTRefPtr;
00341
00342 OSG_END_NAMESPACE
00343
00344 #endif