1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2000-2006 by the OpenSG Forum *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
15 * This library is free software; you can redistribute it and/or modify it *
16 * under the terms of the GNU Library General Public License as published *
17 * by the Free Software Foundation, version 2. *
19 * This library is distributed in the hope that it will be useful, but *
20 * WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
22 * Library General Public License for more details. *
24 * You should have received a copy of the GNU Library General Public *
25 * License along with this library; if not, write to the Free Software *
26 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGMULTICORE_H_
40 #define _OSGMULTICORE_H_
45 #include "OSGMultiCoreBase.h"
49 /*! \brief MultiCore class. See \ref
50 PageSystemMultiCore for a description.
51 \ingroup GrpSystemNodeCoreGroupsCores
52 \ingroup GrpLibOSGSystem
56 class OSG_SYSTEM_DLLMAPPING MultiCore
: public MultiCoreBase
60 /*========================== PUBLIC =================================*/
64 typedef MultiCoreBase Inherited
;
65 typedef MultiCore Self
;
67 /*---------------------------------------------------------------------*/
71 virtual void changed(ConstFieldMaskArg whichField
,
76 /*---------------------------------------------------------------------*/
77 /*! \name Transformation */
80 UInt32
getNCores (void ) const;
81 Int32
findCore (NodeCore
* const pCore
) const;
82 void insertCore(UInt32 corendex
,
83 NodeCore
* const coreP
);
86 /*---------------------------------------------------------------------*/
87 /*! \name Transformation */
90 const MFUnrecChildNodeCorePtr
*getMFCores( void ) const;
92 NodeCore
*getCores (const UInt32 index
) const;
95 /*---------------------------------------------------------------------*/
96 /*! \name Transformation */
99 void addCore ( NodeCore
* const value
);
100 void assignCoresFrom (const MFUnrecChildNodeCorePtr
& value
);
101 void subCore ( UInt32 uiIndex
);
102 void subCoreByObj ( NodeCore
* const value
);
103 void clearCores ( void );
105 void replaceCore ( UInt32 uiIndex
,
106 NodeCore
* const value
);
108 void replaceCoreByObj( NodeCore
* const pOldElem
,
109 NodeCore
* const pNewElem
);
112 /*---------------------------------------------------------------------*/
113 /*! \name Transformation */
116 virtual void accumulateMatrix(Matrix
&result
);
119 /*---------------------------------------------------------------------*/
123 virtual void dump( UInt32 uiIndent
= 0,
124 const BitVector bvFlags
= 0) const;
127 /*========================= PROTECTED ===============================*/
131 // Variables should all be in MultiCoreBase.
133 /*---------------------------------------------------------------------*/
134 /*! \name Constructors */
138 MultiCore(const MultiCore
&source
);
141 /*---------------------------------------------------------------------*/
142 /*! \name Destructors */
145 virtual ~MultiCore(void);
148 /*---------------------------------------------------------------------*/
152 virtual void adjustVolume (Volume
&volume
);
155 /*---------------------------------------------------------------------*/
159 Action::ResultE
renderEnter (Action
*action
);
160 Action::ResultE
renderLeave (Action
*action
);
162 Action::ResultE
actionEnterFrom(Action
*action
, NodeCore
*pFrom
);
163 Action::ResultE
actionLeaveFrom(Action
*action
, NodeCore
*pFrom
);
166 /*---------------------------------------------------------------------*/
170 static void initMethod(InitPhase ePhase
);
173 /*========================== PRIVATE ================================*/
177 friend class FieldContainer
;
178 friend class MultiCoreBase
;
181 // prohibit default functions (move to 'public' if you need one)
182 void operator =(const MultiCore
&source
);
185 typedef MultiCore
*MultiCoreP
;
187 OSG_SYSTEM_DLLMAPPING
188 void addCoreToNode (Node
*pNode
,
191 template <class ObjectT
>
192 void addCoreToNode (Node
*pNode
,
193 TransitPtr
<ObjectT
> pCore
);
195 OSG_SYSTEM_DLLMAPPING
196 void subCoreFromNode(Node
*pNode
,
198 bool bSimplify
= true);
202 #include "OSGMultiCoreBase.inl"
203 #include "OSGMultiCore.inl"
205 #endif /* _OSGMULTICORE_H_ */