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 _OSGSTACKEDTRANSFORM_H_
40 #define _OSGSTACKEDTRANSFORM_H_
45 #include "OSGStackedTransformBase.h"
49 /*! \brief StackedTransform class. See \ref
50 PageGroupStackedTransform for a description.
53 class OSG_GROUP_DLLMAPPING StackedTransform
: public StackedTransformBase
57 /*========================== 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 /*---------------------------------------------------------------------*/
74 virtual void changed(ConstFieldMaskArg whichField
,
79 /*---------------------------------------------------------------------*/
83 virtual void dump( UInt32 uiIndent
= 0,
84 const BitVector bvFlags
= 0) const;
87 /*---------------------------------------------------------------------*/
88 /*! \name Transformation */
91 virtual void accumulateMatrix(Matrix
&result
);
94 /*---------------------------------------------------------------------*/
95 /*! \name Transformation */
98 TransformationElement
*getElement(const std::string
&szName
) const;
100 template <typename ElementType
>
101 ElementType
*getElement(const std::string
&szName
) const;
104 /*---------------------------------------------------------------------*/
105 /*! \name Transformation */
108 void pushToNamedTransformElements (
109 TransformationElement
* const pValue
,
110 std::string
const & szName
);
112 void insertIntoNamedTransformElements (
114 TransformationElement
* const pValue
,
115 std::string
const & szName
);
117 void replaceInNamedTransformElements (
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
);
131 /*========================= PROTECTED ===============================*/
135 // Variables should all be in StackedTransformBase.
137 Matrix _mTransformation
;
139 /*---------------------------------------------------------------------*/
140 /*! \name Constructors */
143 StackedTransform(void);
144 StackedTransform(const StackedTransform
&source
);
147 /*---------------------------------------------------------------------*/
148 /*! \name Destructors */
151 virtual ~StackedTransform(void);
154 /*---------------------------------------------------------------------*/
158 static void initMethod(InitPhase ePhase
);
161 /*---------------------------------------------------------------------*/
165 virtual void adjustVolume (Volume
&volume
);
168 /*---------------------------------------------------------------------*/
169 /*! \name Intersect & Render */
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 );
182 /*========================== 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
;
198 #include "OSGStackedTransformBase.inl"
199 #include "OSGStackedTransform.inl"
201 #endif /* _OSGSTACKEDTRANSFORM_H_ */