fixed: auto_ptr -> unique_ptr
[opensg.git] / Source / System / FileIO / Collada / OSGColladaInstanceController.h
blob538cc01f8b64fd3d8521029a0d20afa22be60d5f
1 /*---------------------------------------------------------------------------*\
2 * OpenSG *
3 * *
4 * *
5 * Copyright (C) 2009 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 _OSGCOLLADAINSTANCECONTROLLER_H_
40 #define _OSGCOLLADAINSTANCECONTROLLER_H_
42 #include "OSGConfig.h"
44 #ifdef OSG_WITH_COLLADA
46 #include "OSGColladaInstanceGeometry.h"
47 #include "OSGColladaController.h"
48 #include "OSGColladaElementFactoryHelper.h"
50 #include <dom/domController.h>
52 #ifdef OSG_WITH_COLLADA_NAMESPACE
53 namespace ColladaDOM141 {
54 #endif
56 // forward decl
57 class domNode;
58 class domInstance_node;
60 #ifdef OSG_WITH_COLLADA_NAMESPACE
62 #endif
64 OSG_BEGIN_NAMESPACE
66 class OSG_FILEIO_DLLMAPPING ColladaInstanceController
67 : public ColladaInstanceGeometry
69 /*========================== PUBLIC =================================*/
70 public:
71 /*---------------------------------------------------------------------*/
72 /*! \name Types */
73 /*! \{ */
75 typedef ColladaInstanceGeometry Inherited;
76 typedef ColladaInstanceController Self;
78 OSG_GEN_INTERNAL_MEMOBJPTR(ColladaInstanceController);
80 typedef std::vector<domNode *> SkeletonRootStore;
81 typedef SkeletonRootStore::iterator SkeletonRootStoreIt;
82 typedef SkeletonRootStore::const_iterator SkeletonRootStoreConstIt;
84 /*! \} */
85 /*---------------------------------------------------------------------*/
86 /*! \name Create */
87 /*! \{ */
89 static ColladaElementTransitPtr
90 create(daeElement *elem, ColladaGlobal *global);
92 /*! \} */
93 /*---------------------------------------------------------------------*/
94 /*! \name Reading */
95 /*! \{ */
97 virtual void read(ColladaElement *colElemParent);
99 /*! \} */
100 /*---------------------------------------------------------------------*/
101 /*! \name Skeleton */
102 /*! \{ */
104 const SkeletonRootStore &getSkeletonRoots(void );
105 domNode *findJointNode (const std::string &jointSid);
107 /*! \} */
108 /*---------------------------------------------------------------------*/
109 /*! \name Access */
110 /*! \{ */
112 virtual ColladaController *getTargetElem (void) const;
113 virtual daeElement *getTargetDOMElem(void) const;
115 /*! \} */
116 /*========================= PROTECTED ===============================*/
117 protected:
118 /*---------------------------------------------------------------------*/
119 /*! \name Constructors/Destructor */
120 /*! \{ */
122 ColladaInstanceController(daeElement *elem,
123 ColladaGlobal *global);
124 virtual ~ColladaInstanceController(void );
126 /*! \} */
127 /*---------------------------------------------------------------------*/
128 /*! \name Helper Functions */
129 /*! \{ */
131 void readSkeleton(void);
133 #if 0 // obsolete - using daeSidRef instead
134 domNode *findJointNode(const std::string &jointSid,
135 domNode *currNode );
136 domNode *findJointNode(const std::string &jointSid,
137 domInstance_node *currNode );
138 #endif
140 /*! \} */
141 /*---------------------------------------------------------------------*/
143 static ColladaElementRegistrationHelper _regHelper;
145 SkeletonRootStore _skelRoots;
148 OSG_GEN_MEMOBJPTR(ColladaInstanceController);
150 OSG_END_NAMESPACE
152 // #include "OSGColladaInstanceController.inl"
154 #endif // OSG_WITH_COLLADA
156 #endif // _OSGCOLLADAINSTANCECONTROLLER_H_