fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / NodeCores / Groups / Misc / OSGStackedTransform.h
blob32acaf3acec02be4593ca565a94c9b15f01261a4
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2000-2006 by the OpenSG Forum *
6 * *
7 * www.opensg.org *
8 * *
9 * contact: dirk@opensg.org, gerrit.voss@vossg.org, jbehr@zgdv.de *
10 * *
11 \*---------------------------------------------------------------------------*/
12 /*---------------------------------------------------------------------------*\
13 * License *
14 * *
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. *
18 * *
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. *
23 * *
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. *
27 * *
28 \*---------------------------------------------------------------------------*/
29 /*---------------------------------------------------------------------------*\
30 * Changes *
31 * *
32 * *
33 * *
34 * *
35 * *
36 * *
37 \*---------------------------------------------------------------------------*/
39 #ifndef _OSGSTACKEDTRANSFORM_H_
40 #define _OSGSTACKEDTRANSFORM_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include "OSGStackedTransformBase.h"
47 OSG_BEGIN_NAMESPACE
49 /*! \brief StackedTransform class. See \ref
50 PageGroupStackedTransform for a description.
53 class OSG_GROUP_DLLMAPPING StackedTransform : public StackedTransformBase
55 protected:
57 /*========================== PUBLIC =================================*/
59 public:
61 typedef StackedTransformBase Inherited;
62 typedef StackedTransform Self;
64 static std::string TranslateName;
65 static std::string RotateXName;
66 static std::string RotateYName;
67 static std::string RotateZName;
68 static std::string ScaleName;
70 /*---------------------------------------------------------------------*/
71 /*! \name Sync */
72 /*! \{ */
74 virtual void changed(ConstFieldMaskArg whichField,
75 UInt32 origin,
76 BitVector details );
78 /*! \} */
79 /*---------------------------------------------------------------------*/
80 /*! \name Output */
81 /*! \{ */
83 virtual void dump( UInt32 uiIndent = 0,
84 const BitVector bvFlags = 0) const;
86 /*! \} */
87 /*---------------------------------------------------------------------*/
88 /*! \name Transformation */
89 /*! \{ */
91 virtual void accumulateMatrix(Matrix &result);
93 /*! \} */
94 /*---------------------------------------------------------------------*/
95 /*! \name Transformation */
96 /*! \{ */
98 TransformationElement *getElement(const std::string &szName) const;
100 template <typename ElementType>
101 ElementType *getElement(const std::string &szName) const;
103 /*! \} */
104 /*---------------------------------------------------------------------*/
105 /*! \name Transformation */
106 /*! \{ */
108 void pushToNamedTransformElements (
109 TransformationElement * const pValue,
110 std::string const & szName);
112 void insertIntoNamedTransformElements (
113 UInt32 uiIndex,
114 TransformationElement * const pValue,
115 std::string const & szName);
117 void replaceInNamedTransformElements (
118 UInt32 uiIndex,
119 TransformationElement * const pValue,
120 std::string const & szName);
122 void replaceObjInNamedTransformElements(
123 TransformationElement * const pOldElem,
124 TransformationElement * const pNewElem,
125 std::string const & szName);
127 void removeFromNamedTransformElements (
128 std::string const & szName);
130 /*! \} */
131 /*========================= PROTECTED ===============================*/
133 protected:
135 // Variables should all be in StackedTransformBase.
137 Matrix _mTransformation;
139 /*---------------------------------------------------------------------*/
140 /*! \name Constructors */
141 /*! \{ */
143 StackedTransform(void);
144 StackedTransform(const StackedTransform &source);
146 /*! \} */
147 /*---------------------------------------------------------------------*/
148 /*! \name Destructors */
149 /*! \{ */
151 virtual ~StackedTransform(void);
153 /*! \} */
154 /*---------------------------------------------------------------------*/
155 /*! \name Init */
156 /*! \{ */
158 static void initMethod(InitPhase ePhase);
160 /*! \} */
161 /*---------------------------------------------------------------------*/
162 /*! \name Volume */
163 /*! \{ */
165 virtual void adjustVolume (Volume &volume);
167 /*! \} */
168 /*---------------------------------------------------------------------*/
169 /*! \name Intersect & Render */
170 /*! \{ */
172 Action::ResultE intersectEnter (Action *action);
173 Action::ResultE intersectLeave (Action *action);
175 Action::ResultE renderEnter (Action *action);
176 Action::ResultE renderLeave (Action *action);
178 void updateTransform (void );
179 void invalidateTransform(void );
181 /*! \} */
182 /*========================== PRIVATE ================================*/
184 private:
186 friend class FieldContainer;
187 friend class StackedTransformBase;
188 friend class TransformationElement;
190 // prohibit default functions (move to 'public' if you need one)
191 void operator =(const StackedTransform &source);
194 typedef StackedTransform *StackedTransformP;
196 OSG_END_NAMESPACE
198 #include "OSGStackedTransformBase.inl"
199 #include "OSGStackedTransform.inl"
201 #endif /* _OSGSTACKEDTRANSFORM_H_ */