changed: gcc8 base update
[opensg.git] / Source / System / Dynamics / Skeleton / OSGBaseSkeletonJoint.h
blob9e4311804e3ebb4de93dcb6008b2226645b686f8
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 _OSGBASESKELETONJOINT_H_
40 #define _OSGBASESKELETONJOINT_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include "OSGBaseSkeletonJointBase.h"
46 #include "OSGSkeletonFields.h"
48 OSG_BEGIN_NAMESPACE
50 // forward declaration
51 class Skeleton;
53 /*! \brief BaseSkeletonJoint class. See \ref
54 PageDynamicsBaseSkeletonJoint for a description.
57 class OSG_DYNAMICS_DLLMAPPING BaseSkeletonJoint : public BaseSkeletonJointBase
59 protected:
61 /*========================== PUBLIC =================================*/
63 public:
64 /*---------------------------------------------------------------------*/
65 /*! \name Types */
66 /*! \{ */
68 typedef BaseSkeletonJointBase Inherited;
69 typedef BaseSkeletonJoint Self;
71 class OSG_DYNAMICS_DLLMAPPING JointTraverser
73 public:
74 explicit JointTraverser(Skeleton *skel);
76 void pushMatrix(const Matrix &m);
77 void popMatrix (void );
78 const Matrix &topMatrix (void ) const;
80 Action::ResultE enter(Node * const node );
81 Action::ResultE leave(Node * const node, Action::ResultE res);
83 protected:
84 typedef std::vector<Matrix> MatrixStack;
86 Skeleton *_skel;
87 Matrix _topMatrix;
88 MatrixStack _matStack;
90 private:
91 JointTraverser(const JointTraverser &other);
92 void operator =(const JointTraverser &rhs);
95 static const Int16 INVALID_JOINT_ID;
97 /*! \} */
98 /*---------------------------------------------------------------------*/
99 /*! \name Sync */
100 /*! \{ */
102 virtual void changed(ConstFieldMaskArg whichField,
103 UInt32 origin,
104 BitVector details );
106 /*! \} */
107 /*---------------------------------------------------------------------*/
108 /*! \name Skeleton */
109 /*! \{ */
111 const SFParentSkeletonPtr *getSFSkeleton(void) const;
112 Skeleton *getSkeleton (void) const;
114 virtual Action::ResultE jointUpdateEnter(JointTraverser *jt) = 0;
115 virtual Action::ResultE jointUpdateLeave(JointTraverser *jt) = 0;
117 /*! \} */
118 /*---------------------------------------------------------------------*/
119 /*! \name Output */
120 /*! \{ */
122 virtual void dump( UInt32 uiIndent = 0,
123 const BitVector bvFlags = 0) const;
125 /*! \} */
126 /*========================= PROTECTED ===============================*/
128 protected:
130 // Variables should all be in BaseSkeletonJointBase.
132 /*---------------------------------------------------------------------*/
133 /*! \name Constructors */
134 /*! \{ */
136 BaseSkeletonJoint(void);
137 BaseSkeletonJoint(const BaseSkeletonJoint &source);
139 /*! \} */
140 /*---------------------------------------------------------------------*/
141 /*! \name Destructors */
142 /*! \{ */
144 virtual ~BaseSkeletonJoint(void);
146 /*! \} */
147 /*---------------------------------------------------------------------*/
148 /*! \name Init */
149 /*! \{ */
151 static void initMethod(InitPhase ePhase);
153 /*! \} */
154 /*========================== PRIVATE ================================*/
156 private:
158 friend class FieldContainer;
159 friend class BaseSkeletonJointBase;
161 // prohibit default functions (move to 'public' if you need one)
162 void operator =(const BaseSkeletonJoint &source);
165 typedef BaseSkeletonJoint *BaseSkeletonJointP;
167 OSG_END_NAMESPACE
169 // include this here, so that it is available in the .inl
170 #include "OSGSkeleton.h"
172 #include "OSGBaseSkeletonJointBase.inl"
173 #include "OSGBaseSkeletonJoint.inl"
175 #endif /* _OSGBASESKELETONJOINT_H_ */