VR-Forces 4.1 Class Documentation
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 parsePartDeclaration(const std::string& desc,
87  osgSim::DOFTransform& transform);
88 
93  virtual bool parseAnimationDeclaration(const std::string& desc,
94  osg::Sequence& sequence);
95 
97  std::vector<int> parseValueList(const std::string& valueList);
98 
101  void pushStateId(int idNumber, osgSim::MultiSwitch* lastStateId);
102 
105  void popStateId();
106 
108  osgSim::MultiSwitch* lastStateId() const;
109 
111  int lastStateIdNumber() const;
112 
113  protected:
114 
115  std::string mySwitchTag;
116  std::string myStateTag;
117  std::string myPartTag;
118  std::string myAnimationTag;
119  std::string mySkipTag;
120  std::string myNoSkipTag;
121 
123  std::stack<osg::ref_ptr<osgSim::MultiSwitch> > myStateIds;
124  std::stack<int> myStateIdNumbers;
125  };
126 
130  {
131  public:
132 
135  static void registerCreator(DtDe& de);
136 
139 
142 
144  virtual DtModelParser* create(DtModel& model);
145  };
146 
147 }

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)