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 _OSGBASESKELETONJOINT_H_
40 #define _OSGBASESKELETONJOINT_H_
45 #include "OSGBaseSkeletonJointBase.h"
46 #include "OSGSkeletonFields.h"
50 // forward declaration
53 /*! \brief BaseSkeletonJoint class. See \ref
54 PageDynamicsBaseSkeletonJoint for a description.
57 class OSG_DYNAMICS_DLLMAPPING BaseSkeletonJoint
: public BaseSkeletonJointBase
61 /*========================== PUBLIC =================================*/
64 /*---------------------------------------------------------------------*/
68 typedef BaseSkeletonJointBase Inherited
;
69 typedef BaseSkeletonJoint Self
;
71 class OSG_DYNAMICS_DLLMAPPING JointTraverser
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
);
84 typedef std::vector
<Matrix
> MatrixStack
;
88 MatrixStack _matStack
;
91 JointTraverser(const JointTraverser
&other
);
92 void operator =(const JointTraverser
&rhs
);
95 static const Int16 INVALID_JOINT_ID
;
98 /*---------------------------------------------------------------------*/
102 virtual void changed(ConstFieldMaskArg whichField
,
107 /*---------------------------------------------------------------------*/
108 /*! \name Skeleton */
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;
118 /*---------------------------------------------------------------------*/
122 virtual void dump( UInt32 uiIndent
= 0,
123 const BitVector bvFlags
= 0) const;
126 /*========================= PROTECTED ===============================*/
130 // Variables should all be in BaseSkeletonJointBase.
132 /*---------------------------------------------------------------------*/
133 /*! \name Constructors */
136 BaseSkeletonJoint(void);
137 BaseSkeletonJoint(const BaseSkeletonJoint
&source
);
140 /*---------------------------------------------------------------------*/
141 /*! \name Destructors */
144 virtual ~BaseSkeletonJoint(void);
147 /*---------------------------------------------------------------------*/
151 static void initMethod(InitPhase ePhase
);
154 /*========================== 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
;
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_ */