VR-Forces 4.3 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DtArticulatedModelParser.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2007 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 /******************************************************************************
6 ** $RCSfile: DtArticulatedModelParser.h,v $ $Revision: 1.11 $ $State: Exp $
7 ******************************************************************************/
8 
12 
13 #pragma once
14 #include <vrvOsg/vrvOsg.h>
15 #include <vrvOsg/DtModelParser.h>
17 #include <osgSim/MultiSwitch>
18 #include <stack>
19 
20 namespace osg
21 {
22  class Group;
23  class Sequence;
24 }
25 
26 namespace osgSim
27 {
28  class DOFTransform;
29 }
30 
31 namespace makVrv
32 {
33  class DtOsgArticulatedModel;
34 
38  {
39  public:
40 
43 
45  virtual ~DtArticulatedModelParser();
46 
49  static std::string parserFormat();
50 
52 
53 
54  virtual void apply(osg::Group& group);
55  virtual void apply(osg::Sequence& sequence);
56  virtual void apply(osgSim::MultiSwitch& multiswitch);
57  virtual void apply(osgSim::DOFTransform& transform);
58  virtual void apply(osg::Transform& transform);
60 
61  protected:
62 
67  virtual bool parseSwitchDeclaration( const std::string& desc,
68  osgSim::MultiSwitch& multiswitch );
69 
72  const DtModelSemanticsMapper::States::Id* createCustomStateId(
73  const std::string& stateName, DtModelSemanticsMapper& mapper);
74 
79  virtual bool parseStateDeclaration( const std::string& desc,
80  osg::Group& group );
81 
86  virtual bool parseAnnotationDeclaration( const std::string& desc,
87  osg::Group& group );
88 
93  virtual bool parsePartDeclaration(const std::string& desc,
94  osgSim::DOFTransform& transform);
95 
100  virtual bool parseAnimationDeclaration(const std::string& desc,
101  osg::Sequence& sequence);
102 
104  std::vector<int> parseValueList(const std::string& valueList);
105 
108  void pushStateId(int idNumber, osgSim::MultiSwitch* lastStateId);
109 
112  void popStateId();
113 
115  osgSim::MultiSwitch* lastStateId() const;
116 
118  int lastStateIdNumber() const;
119 
120  protected:
121 
122  std::string mySwitchTag;
123  std::string myStateTag;
124  std::string myPartTag;
125  std::string myAnimationTag;
126  std::string mySkipTag;
127  std::string myNoSkipTag;
128  std::string myAnnotationTag;
129 
131  std::stack<osg::ref_ptr<osgSim::MultiSwitch> > myStateIds;
132  std::stack<int> myStateIdNumbers;
133  };
134 
138  {
139  public:
140 
143  static void registerCreator(DtDe& de);
144 
147 
150 
152  virtual DtModelParser* create(DtModel& model);
153  };
154 
155 }

Document ID: Generated on Wed Mar 11 21:20:57 EDT 2015 from SVN revision 150940
Copyright © 2005-2014 VT MÄK. All Rights Reserved (www.mak.com)