1 /*---------------------------------------------------------------------------*\
5 * Copyright (C) 2009 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 _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
{
58 class domInstance_node
;
60 #ifdef OSG_WITH_COLLADA_NAMESPACE
66 class OSG_FILEIO_DLLMAPPING ColladaInstanceController
67 : public ColladaInstanceGeometry
69 /*========================== PUBLIC =================================*/
71 /*---------------------------------------------------------------------*/
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
;
85 /*---------------------------------------------------------------------*/
89 static ColladaElementTransitPtr
90 create(daeElement
*elem
, ColladaGlobal
*global
);
93 /*---------------------------------------------------------------------*/
97 virtual void read(ColladaElement
*colElemParent
);
100 /*---------------------------------------------------------------------*/
101 /*! \name Skeleton */
104 const SkeletonRootStore
&getSkeletonRoots(void );
105 domNode
*findJointNode (const std::string
&jointSid
);
108 /*---------------------------------------------------------------------*/
112 virtual ColladaController
*getTargetElem (void) const;
113 virtual daeElement
*getTargetDOMElem(void) const;
116 /*========================= PROTECTED ===============================*/
118 /*---------------------------------------------------------------------*/
119 /*! \name Constructors/Destructor */
122 ColladaInstanceController(daeElement
*elem
,
123 ColladaGlobal
*global
);
124 virtual ~ColladaInstanceController(void );
127 /*---------------------------------------------------------------------*/
128 /*! \name Helper Functions */
131 void readSkeleton(void);
133 #if 0 // obsolete - using daeSidRef instead
134 domNode
*findJointNode(const std::string
&jointSid
,
136 domNode
*findJointNode(const std::string
&jointSid
,
137 domInstance_node
*currNode
);
141 /*---------------------------------------------------------------------*/
143 static ColladaElementRegistrationHelper _regHelper
;
145 SkeletonRootStore _skelRoots
;
148 OSG_GEN_MEMOBJPTR(ColladaInstanceController
);
152 // #include "OSGColladaInstanceController.inl"
154 #endif // OSG_WITH_COLLADA
156 #endif // _OSGCOLLADAINSTANCECONTROLLER_H_