OSGNodeCore.h

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002  *                                OpenSG                                     *
00003  *                                                                           *
00004  *                                                                           *
00005  *           Copyright (C) 2003 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 #ifndef _OSGNODEOCRE_H_
00040 #define _OSGNODEOCRE_H_
00041 #ifdef __sgi
00042 #pragma once
00043 #endif
00044 
00045 #include "OSGFieldContainer.h"
00046 #include "OSGAttachmentContainer.h"
00047 
00048 #include "OSGFieldContainerFields.h"
00049 #include "OSGMatrixFwd.h"
00050 #include "OSGFieldContainerFactory.h"
00051 
00052 #ifdef OSG_WINCE
00053 #include "OSGActionBase.h"
00054 #endif
00055 
00056 OSG_BEGIN_NAMESPACE
00057 
00058 class Volume;
00059 class Node;
00060 
00063 
00064 class OSG_SYSTEM_DLLMAPPING NodeCore : public AttachmentContainer
00065 {
00066     /*==========================  PUBLIC  =================================*/
00067 
00068   public:
00069 
00070     typedef AttachmentContainer                              Inherited;
00071     typedef AttachmentContainer                              ParentContainer;
00072 
00073     OSG_GEN_INTERNALPTR(NodeCore);
00074 
00075     typedef Inherited::TypeObject                            TypeObject;
00076 
00077     typedef       MFParentFieldContainerPtr                  ParentField;
00078     typedef const MFParentFieldContainerPtr                 *ParentFieldPtr;
00079     typedef       MFParentFieldContainerPtr::const_iterator  ParentFieldIt;
00080 
00081     static const bool isNodeCore = true;
00082 
00083     OSG_RC_FIRST_FIELD_DECL(Parents);
00084     OSG_RC_LAST_FIELD_DECL (Parents);
00085 
00086     /*---------------------------------------------------------------------*/
00090     OSG_ABSTR_FIELD_CONTAINER_DECL;
00091 
00093     /*---------------------------------------------------------------------*/
00098     /*---------------------------------------------------------------------*/
00103     /*---------------------------------------------------------------------*/
00108     /*---------------------------------------------------------------------*/
00112     const MFParentFieldContainerPtr &getParents(void) const;
00113 
00115     /*---------------------------------------------------------------------*/
00119     const MFParentFieldContainerPtr *getMFParents(void) const;
00120 
00122     /*---------------------------------------------------------------------*/
00126 #if 0
00127     virtual void pushToField     (      FieldContainerPtrConstArg pNewElement, 
00128                                   const UInt32                    uiFieldId  );
00129 
00130     virtual void insertIntoMField(const UInt32                    uiIndex, 
00131                                         FieldContainerPtrConstArg pNewElement, 
00132                                   const UInt32                    uiFieldId  );
00133 
00134     virtual void replaceInMField (const UInt32                    uiIndex,
00135                                         FieldContainerPtrConstArg pNewElement, 
00136                                   const UInt32                    uiFieldId  );
00137 
00138     virtual void replaceInMField (      FieldContainerPtrConstArg pOldElement,
00139                                         FieldContainerPtrConstArg pNewElement, 
00140                                   const UInt32                    uiFieldId  );
00141 
00142     virtual void removeFromMField(const UInt32                    uiIndex, 
00143                                   const UInt32                    uiFieldId  );
00144     
00145     virtual void removeFromMField(      FieldContainerPtrConstArg pElement, 
00146                                   const UInt32                    uiFieldId  );
00147 
00148     virtual void clearField      (const UInt32                    uiFieldId  );
00149 #endif
00150 
00152     /*---------------------------------------------------------------------*/
00157     /*---------------------------------------------------------------------*/
00162     /*---------------------------------------------------------------------*/
00167     /*---------------------------------------------------------------------*/
00172     /*---------------------------------------------------------------------*/
00176     virtual UInt32 getBinSize (ConstFieldMaskArg  whichField);
00177     virtual void   copyToBin  (BinaryDataHandler &pMem,
00178                                ConstFieldMaskArg  whichField);
00179     virtual void   copyFromBin(BinaryDataHandler &pMem,
00180                                ConstFieldMaskArg  whichField);
00181 
00183     /*---------------------------------------------------------------------*/
00188     /*---------------------------------------------------------------------*/
00192     virtual void accumulateMatrix(Matrixr &result);
00193 
00195     /*---------------------------------------------------------------------*/
00199     virtual void adjustVolume    (Volume &volume);
00200 
00202     /*---------------------------------------------------------------------*/
00206     virtual void invalidateVolume(void);
00207 
00209     /*---------------------------------------------------------------------*/
00213     void addParent(
00214               FieldContainerPtrConst &parent, 
00215         const UInt16                  uiStoredInFieldId = InvalidParentEPos);
00216 
00217     void subParent(FieldContainerPtrConst &parent);
00218 
00220     /*---------------------------------------------------------------------*/
00224     virtual void dump(      UInt32    uiIndent = 0, 
00225                       const BitVector bvFlags  = 0) const;
00226 
00227 #ifdef OSG_WINCE
00228 
00229     /*---------------------------------------------------------------------*/
00233     ActionBase::ResultE defaultEnter(Action *action);
00234     ActionBase::ResultE defaultLeave(Action *action);
00235 
00236 #endif
00237 
00239     /*=========================  PROTECTED  ===============================*/
00240 
00241   protected:
00242 
00243     /*---------------------------------------------------------------------*/
00247     static TypeObject _type;
00248 
00249     static void   classDescInserter(TypeObject &oType);
00250     static Char8 *getClassname     (void             );
00251 
00253     /*---------------------------------------------------------------------*/
00257     MFParentFieldContainerPtr _mfParents;
00258 
00260     /*---------------------------------------------------------------------*/
00264     NodeCore(void);
00265     NodeCore(const NodeCore &source);
00266 
00267     virtual ~NodeCore(void);
00268 
00270     /*---------------------------------------------------------------------*/
00274 #ifdef OSG_MT_CPTR_ASPECT
00275     virtual void execSyncV(      FieldContainer    &oFrom,
00276                                  ConstFieldMaskArg  whichField,
00277                                  AspectOffsetStore &oOffsets,
00278                                  ConstFieldMaskArg  syncMode  ,
00279                            const UInt32             uiSyncInfo);
00280 
00281             void execSync (      NodeCore          *pFrom,
00282                                  ConstFieldMaskArg  whichField,
00283                                  AspectOffsetStore &oOffsets,
00284                                  ConstFieldMaskArg  syncMode  ,
00285                            const UInt32             uiSyncInfo);
00286 #endif
00287 
00289     /*---------------------------------------------------------------------*/
00293     GetFieldHandlePtr getHandleParents(void) const;
00294 
00296     /*---------------------------------------------------------------------*/
00300     virtual void resolveLinks(void);
00301 
00303     /*==========================  PRIVATE  ================================*/
00304 
00305   private:
00306 
00307     friend class Node;
00308     
00310     void operator =(const NodeCore &source);
00311 };
00312 
00313 OSG_GEN_CONTAINERPTR(NodeCore);
00314 
00315 typedef RefPtr<NodeCorePtr>        NodeCoreRefPtr;
00316 
00317 OSG_END_NAMESPACE
00318 
00319 #include "OSGNodeCore.inl"
00320 
00321 #endif /* _OSGNODECORE_H_ */