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 #include "OSGBaseTypes.h"
00065
00066 #include "OSGStage.h"
00067
00068 #include "OSGAlgorithmFields.h"
00069 #include "OSGUInt32Fields.h"
00070 #include "OSGMatrixFields.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 ProjectionMatrixFieldId = ProjectionModeFieldId + 1,
00101 NextFieldId = ProjectionMatrixFieldId + 1
00102 };
00103
00104 static const OSG::BitVector AlgorithmFieldMask =
00105 (TypeTraits<BitVector>::One << AlgorithmFieldId);
00106 static const OSG::BitVector ProjectionModeFieldMask =
00107 (TypeTraits<BitVector>::One << ProjectionModeFieldId);
00108 static const OSG::BitVector ProjectionMatrixFieldMask =
00109 (TypeTraits<BitVector>::One << ProjectionMatrixFieldId);
00110 static const OSG::BitVector NextFieldMask =
00111 (TypeTraits<BitVector>::One << NextFieldId);
00112
00113
00117 static FieldContainerType &getClassType (void);
00118 static UInt32 getClassTypeId (void);
00119 static UInt16 getClassGroupId(void);
00120
00122
00126 virtual FieldContainerType &getType (void);
00127 virtual const FieldContainerType &getType (void) const;
00128
00129 virtual UInt32 getContainerSize(void) const;
00130
00132
00136 const SFAlgorithmPtr *getSFAlgorithm (void) const;
00137
00138 #ifdef OSG_1_GET_COMPAT
00139 SFUInt32 *getSFProjectionMode (void);
00140 #endif
00141 SFUInt32 *editSFProjectionMode (void);
00142 const SFUInt32 *getSFProjectionMode (void) const;
00143
00144 #ifdef OSG_1_GET_COMPAT
00145 SFMatrix *getSFProjectionMatrix (void);
00146 #endif
00147 SFMatrix *editSFProjectionMatrix(void);
00148 const SFMatrix *getSFProjectionMatrix (void) const;
00149
00150
00151 AlgorithmPtrConst getAlgorithm (void) const;
00152
00153 #ifdef OSG_1_GET_COMPAT
00154 UInt32 &getProjectionMode (void);
00155 #endif
00156 UInt32 &editProjectionMode (void);
00157 const UInt32 &getProjectionMode (void) const;
00158
00159 #ifdef OSG_1_GET_COMPAT
00160 Matrix &getProjectionMatrix (void);
00161 #endif
00162 Matrix &editProjectionMatrix(void);
00163 const Matrix &getProjectionMatrix (void) const;
00164
00166
00170 void setAlgorithm (AlgorithmPtrConstArg value);
00171 void setProjectionMode (const UInt32 &value);
00172 void setProjectionMatrix(const Matrix &value);
00173
00175
00180
00185
00189 virtual UInt32 getBinSize (ConstFieldMaskArg whichField);
00190 virtual void copyToBin (BinaryDataHandler &pMem,
00191 ConstFieldMaskArg whichField);
00192 virtual void copyFromBin(BinaryDataHandler &pMem,
00193 ConstFieldMaskArg whichField);
00194
00195
00197
00201 static AlgorithmStagePtr create (void);
00202 static AlgorithmStagePtr createEmpty(void);
00203
00205
00209 virtual FieldContainerPtr shallowCopy(void) const;
00210
00212
00213
00214 protected:
00215
00216 static TypeObject _type;
00217
00218 static void classDescInserter(TypeObject &oType);
00219 static Char8 *getClassname (void );
00220
00221
00225 SFAlgorithmPtr _sfAlgorithm;
00226 SFUInt32 _sfProjectionMode;
00227 SFMatrix _sfProjectionMatrix;
00228
00230
00234 AlgorithmStageBase(void);
00235 AlgorithmStageBase(const AlgorithmStageBase &source);
00236
00238
00242 virtual ~AlgorithmStageBase(void);
00243
00245
00249 void onCreate(const AlgorithmStage *source = NULL);
00250
00252
00256 GetFieldHandlePtr getHandleAlgorithm (void) const;
00257 EditFieldHandlePtr editHandleAlgorithm (void);
00258 GetFieldHandlePtr getHandleProjectionMode (void) const;
00259 EditFieldHandlePtr editHandleProjectionMode (void);
00260 GetFieldHandlePtr getHandleProjectionMatrix (void) const;
00261 EditFieldHandlePtr editHandleProjectionMatrix(void);
00262
00264
00268 #ifdef OSG_MT_CPTR_ASPECT
00269 virtual void execSyncV( FieldContainer &oFrom,
00270 ConstFieldMaskArg whichField,
00271 AspectOffsetStore &oOffsets,
00272 ConstFieldMaskArg syncMode ,
00273 const UInt32 uiSyncInfo);
00274
00275 void execSync ( AlgorithmStageBase *pFrom,
00276 ConstFieldMaskArg whichField,
00277 AspectOffsetStore &oOffsets,
00278 ConstFieldMaskArg syncMode ,
00279 const UInt32 uiSyncInfo);
00280 #endif
00281
00283
00288
00292 #ifdef OSG_MT_CPTR_ASPECT
00293 virtual FieldContainerPtr createAspectCopy(void) const;
00294 #endif
00295
00297
00301
00305 virtual void resolveLinks(void);
00306
00308
00309
00310 private:
00311
00312
00313 void operator =(const AlgorithmStageBase &source);
00314 };
00315
00316 typedef AlgorithmStageBase *AlgorithmStageBaseP;
00317
00319 typedef RefPtr<AlgorithmStagePtr> AlgorithmStageRefPtr;
00320
00321 typedef boost::mpl::if_<
00322 boost::mpl::bool_<AlgorithmStageBase::isNodeCore>,
00323 CoredNodePtr<AlgorithmStage>,
00324 FieldContainer::attempt_to_create_CoredNodePtr_on_non_NodeCore_FC>::type
00325
00326 AlgorithmStageNodePtr;
00327
00328 OSG_END_NAMESPACE
00329
00330 #endif