OSGAlgorithmComputeElementBase.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002  *                                OpenSG                                     *
00003  *                                                                           *
00004  *                                                                           *
00005  *               Copyright (C) 2000-2006 by the OpenSG Forum                 *
00006  *                                                                           *
00007  *                            www.opensg.org                                 *
00008  *                                                                           *
00009  *   contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de          *
00010  *                                                                           *
00011 \*---------------------------------------------------------------------------*/
00012 /*---------------------------------------------------------------------------*\
00013  *                                License                                    *
00014  *                                                                           *
00015  * This library is free software; you can redistribute it and/or modify it   *
00016  * under the terms of the GNU Library General Public License as published    *
00017  * by the Free Software Foundation, version 2.                               *
00018  *                                                                           *
00019  * This library is distributed in the hope that it will be useful, but       *
00020  * WITHOUT ANY WARRANTY; without even the implied warranty of                *
00021  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU         *
00022  * Library General Public License for more details.                          *
00023  *                                                                           *
00024  * You should have received a copy of the GNU Library General Public         *
00025  * License along with this library; if not, write to the Free Software       *
00026  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.                 *
00027  *                                                                           *
00028 \*---------------------------------------------------------------------------*/
00029 /*---------------------------------------------------------------------------*\
00030  *                                Changes                                    *
00031  *                                                                           *
00032  *                                                                           *
00033  *                                                                           *
00034  *                                                                           *
00035  *                                                                           *
00036  *                                                                           *
00037 \*---------------------------------------------------------------------------*/
00038
00039 /*****************************************************************************\
00040  *****************************************************************************
00041  **                                                                         **
00042  **                  This file is automatically generated.                  **
00043  **                                                                         **
00044  **          Any changes made to this file WILL be lost when it is          **
00045  **           regenerated, which can become necessary at any time.          **
00046  **                                                                         **
00047  **     Do not change this file, changes should be done in the derived      **
00048  **     class AlgorithmComputeElement
00049  **                                                                         **
00050  *****************************************************************************
00051 \*****************************************************************************/
00052
00053
00054 #ifndef _OSGALGORITHMCOMPUTEELEMENTBASE_H_
00055 #define _OSGALGORITHMCOMPUTEELEMENTBASE_H_
00056 #ifdef __sgi
00057 #pragma once
00058 #endif
00059 
00060
00061 #include "OSGConfig.h"
00062 #include "OSGContribComputeBaseDef.h"
00063
00064 //#include "OSGBaseTypes.h"
00065
00066 #include "OSGComputeElement.h" // Parent
00067
00068 #include "OSGComputeAlgorithmFields.h"  // Algorithm type
00069
00070 #include "OSGAlgorithmComputeElementFields.h"
00071
00072 OSG_BEGIN_NAMESPACE
00073
00074 class AlgorithmComputeElement;
00075
00077
00078 class OSG_CONTRIBCOMPUTEBASE_DLLMAPPING AlgorithmComputeElementBase : public ComputeElement
00079 {
00080   public:
00081
00082     typedef ComputeElement Inherited;
00083     typedef ComputeElement ParentContainer;
00084
00085     typedef Inherited::TypeObject TypeObject;
00086     typedef TypeObject::InitPhase InitPhase;
00087
00088     OSG_GEN_INTERNALPTR(AlgorithmComputeElement);
00089
00090     /*==========================  PUBLIC  =================================*/
00091
00092   public:
00093
00094     enum
00095     {
00096         AlgorithmFieldId = Inherited::NextFieldId,
00097         NextFieldId = AlgorithmFieldId + 1
00098     };
00099
00100     static const OSG::BitVector AlgorithmFieldMask =
00101         (TypeTraits<BitVector>::One << AlgorithmFieldId);
00102     static const OSG::BitVector NextFieldMask =
00103         (TypeTraits<BitVector>::One << NextFieldId);
00104
00105     typedef SFUnrecComputeAlgorithmPtr SFAlgorithmType;
00106
00107     /*---------------------------------------------------------------------*/
00111     static FieldContainerType &getClassType   (void);
00112     static UInt32              getClassTypeId (void);
00113     static UInt16              getClassGroupId(void);
00114
00116     /*---------------------------------------------------------------------*/
00120     virtual       FieldContainerType &getType         (void);
00121     virtual const FieldContainerType &getType         (void) const;
00122
00123     virtual       UInt32              getContainerSize(void) const;
00124
00126     /*---------------------------------------------------------------------*/
00130             const SFUnrecComputeAlgorithmPtr *getSFAlgorithm      (void) const;
00131                   SFUnrecComputeAlgorithmPtr *editSFAlgorithm      (void);
00132
00133
00134                   ComputeAlgorithm * getAlgorithm      (void) const;
00135
00137     /*---------------------------------------------------------------------*/
00141             void setAlgorithm      (ComputeAlgorithm * const value);
00142
00144     /*---------------------------------------------------------------------*/
00149     /*---------------------------------------------------------------------*/
00154     /*---------------------------------------------------------------------*/
00158     virtual UInt32 getBinSize (ConstFieldMaskArg  whichField);
00159     virtual void   copyToBin  (BinaryDataHandler &pMem,
00160                                ConstFieldMaskArg  whichField);
00161     virtual void   copyFromBin(BinaryDataHandler &pMem,
00162                                ConstFieldMaskArg  whichField);
00163
00164
00166     /*---------------------------------------------------------------------*/
00170     static  AlgorithmComputeElementTransitPtr  create          (void);
00171     static  AlgorithmComputeElement           *createEmpty     (void);
00172
00173     static  AlgorithmComputeElementTransitPtr  createLocal     (
00174                                                BitVector bFlags = FCLocal::All);
00175
00176     static  AlgorithmComputeElement            *createEmptyLocal(
00177                                               BitVector bFlags = FCLocal::All);
00178
00179     static  AlgorithmComputeElementTransitPtr  createDependent  (BitVector bFlags);
00180
00182     /*---------------------------------------------------------------------*/
00186     virtual FieldContainerTransitPtr shallowCopy     (void) const;
00187     virtual FieldContainerTransitPtr shallowCopyLocal(
00188                                        BitVector bFlags = FCLocal::All) const;
00189     virtual FieldContainerTransitPtr shallowCopyDependent(
00190                                                       BitVector bFlags) const;
00191
00193     /*=========================  PROTECTED  ===============================*/
00194
00195   protected:
00196
00197     static TypeObject _type;
00198
00199     static       void   classDescInserter(TypeObject &oType);
00200     static const Char8 *getClassname     (void             );
00201
00202     /*---------------------------------------------------------------------*/
00206     SFUnrecComputeAlgorithmPtr _sfAlgorithm;
00207
00209     /*---------------------------------------------------------------------*/
00213     AlgorithmComputeElementBase(void);
00214     AlgorithmComputeElementBase(const AlgorithmComputeElementBase &source);
00215
00217     /*---------------------------------------------------------------------*/
00221     virtual ~AlgorithmComputeElementBase(void);
00222
00224     /*---------------------------------------------------------------------*/
00228     void onCreate(const AlgorithmComputeElement *source = NULL);
00229
00231     /*---------------------------------------------------------------------*/
00235     GetFieldHandlePtr  getHandleAlgorithm       (void) const;
00236     EditFieldHandlePtr editHandleAlgorithm      (void);
00237
00239     /*---------------------------------------------------------------------*/
00243 #ifdef OSG_MT_CPTR_ASPECT
00244     virtual void execSyncV(      FieldContainer    &oFrom,
00245                                  ConstFieldMaskArg  whichField,
00246                                  AspectOffsetStore &oOffsets,
00247                                  ConstFieldMaskArg  syncMode  ,
00248                            const UInt32             uiSyncInfo);
00249
00250             void execSync (      AlgorithmComputeElementBase *pFrom,
00251                                  ConstFieldMaskArg  whichField,
00252                                  AspectOffsetStore &oOffsets,
00253                                  ConstFieldMaskArg  syncMode  ,
00254                            const UInt32             uiSyncInfo);
00255 #endif
00256 
00258     /*---------------------------------------------------------------------*/
00263     /*---------------------------------------------------------------------*/
00267 #ifdef OSG_MT_CPTR_ASPECT
00268     virtual FieldContainer *createAspectCopy(
00269                                     const FieldContainer *pRefAspect) const;
00270 #endif
00271 
00273     /*---------------------------------------------------------------------*/
00277     /*---------------------------------------------------------------------*/
00281     virtual void resolveLinks(void);
00282
00284     /*==========================  PRIVATE  ================================*/
00285
00286   private:
00287     /*---------------------------------------------------------------------*/
00288
00289     // prohibit default functions (move to 'public' if you need one)
00290     void operator =(const AlgorithmComputeElementBase &source);
00291 };
00292
00293 typedef AlgorithmComputeElementBase *AlgorithmComputeElementBaseP;
00294
00295 typedef CoredNodeRefPtr  <AlgorithmComputeElement> AlgorithmComputeElementNodeRefPtr;
00296 typedef CoredNodeMTRefPtr<AlgorithmComputeElement> AlgorithmComputeElementNodeMTRefPtr;
00297
00298 OSG_END_NAMESPACE
00299
00300 #endif /* _OSGALGORITHMCOMPUTEELEMENTBASE_H_ */