fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / Dynamics / Skeleton / OSGCPUSkinningAlgorithm.h
blob47f753d95e3b5a3b686223010448632e15650d08
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 _OSGCPUSKINNINGALGORITHM_H_
40 #define _OSGCPUSKINNINGALGORITHM_H_
41 #ifdef __sgi
42 #pragma once
43 #endif
45 #include "OSGCPUSkinningAlgorithmBase.h"
46 #include "OSGTypedGeoVectorProperty.h"
48 OSG_BEGIN_NAMESPACE
50 class CPUSkinningDataAttachment;
51 class IntersectAction;
53 /*! \brief CPUSkinningAlgorithm class. See \ref
54 PageDynamicsCPUSkinningAlgorithm for a description.
57 class OSG_DYNAMICS_DLLMAPPING CPUSkinningAlgorithm :
58 public CPUSkinningAlgorithmBase
60 protected:
62 /*========================== PUBLIC =================================*/
64 public:
66 typedef CPUSkinningAlgorithmBase Inherited;
67 typedef CPUSkinningAlgorithm Self;
69 typedef SkinnedGeometry::RenderModeE RenderModeE;
71 /*---------------------------------------------------------------------*/
72 /*! \name Execute */
73 /*! \{ */
75 virtual void adjustVolume (Volume &volume);
77 virtual Action::ResultE renderEnter (Action *action);
78 virtual Action::ResultE renderLeave (Action *action);
80 virtual Action::ResultE intersectEnter(Action *action);
82 /*! \} */
83 /*---------------------------------------------------------------------*/
84 /*! \name Access */
85 /*! \{ */
87 virtual RenderModeE getRenderMode(void) const;
89 /*! \} */
90 /*---------------------------------------------------------------------*/
91 /*! \name Sync */
92 /*! \{ */
94 virtual void changed(ConstFieldMaskArg whichField,
95 UInt32 origin,
96 BitVector details );
98 /*! \} */
99 /*---------------------------------------------------------------------*/
100 /*! \name Output */
101 /*! \{ */
103 virtual void dump( UInt32 uiIndent = 0,
104 const BitVector bvFlags = 0) const;
106 /*! \} */
107 /*========================= PROTECTED ===============================*/
109 protected:
111 // Variables should all be in CPUSkinningAlgorithmBase.
113 /*---------------------------------------------------------------------*/
114 /*! \name Constructors */
115 /*! \{ */
117 CPUSkinningAlgorithm(void);
118 CPUSkinningAlgorithm(const CPUSkinningAlgorithm &source);
120 /*! \} */
121 /*---------------------------------------------------------------------*/
122 /*! \name Destructors */
123 /*! \{ */
125 virtual ~CPUSkinningAlgorithm(void);
127 /*! \} */
128 /*---------------------------------------------------------------------*/
129 /*! \name Init */
130 /*! \{ */
132 static void initMethod(InitPhase ePhase);
134 /*! \} */
135 /*---------------------------------------------------------------------*/
136 /*! \name Transform */
137 /*! \{ */
139 void transformGeometry(SkinnedGeometry *skinGeo,
140 Skeleton *skel,
141 CPUSkinningDataAttachment *data );
142 void transformObjectSpaceProperty (const MFMatrix *jointMat,
143 const GeoVec4fProperty *jointIdx,
144 const GeoVec4fProperty *jointWeight,
145 const GeoIntegralProperty *origIdx,
146 const GeoVectorProperty *origProp,
147 GeoVectorProperty *prop );
148 void transformTangentSpaceProperty(const MFMatrix *jointMat,
149 const GeoVec4fProperty *jointIdx,
150 const GeoVec4fProperty *jointWeight,
151 const GeoIntegralProperty *origIdx,
152 const GeoVectorProperty *origProp,
153 GeoVectorProperty *prop );
155 void renderGeometry(RenderAction *ract,
156 SkinnedGeometry *skinGeo,
157 CPUSkinningDataAttachment *data );
158 void drawPrimitives(SkinnedGeometry *skinGeo,
159 CPUSkinningDataAttachment *data,
160 DrawEnv *pEnv );
162 void intersectGeometry(IntersectAction *iact,
163 SkinnedGeometry *skinGeo,
164 CPUSkinningDataAttachment *data);
166 /*! \} */
167 /*---------------------------------------------------------------------*/
168 /*! \name Skeleton Change */
169 /*! \{ */
171 void skeletonChanged(FieldContainer *fc, ConstFieldMaskArg whichField);
173 /*! \} */
174 /*---------------------------------------------------------------------*/
175 /*! \name Sync */
176 /*! \{ */
178 virtual void resolveLinks(void);
180 /*! \} */
181 /*========================== PRIVATE ================================*/
183 private:
185 friend class FieldContainer;
186 friend class CPUSkinningAlgorithmBase;
188 // prohibit default functions (move to 'public' if you need one)
189 void operator =(const CPUSkinningAlgorithm &source);
192 typedef CPUSkinningAlgorithm *CPUSkinningAlgorithmP;
194 OSG_END_NAMESPACE
196 #include "OSGCPUSkinningAlgorithmBase.inl"
197 #include "OSGCPUSkinningAlgorithm.inl"
199 #endif /* _OSGCPUSKINNINGALGORITHM_H_ */