TrafficConeVisual.h
Go to the documentation of this file.
1 #ifndef TrafficConeVISUAL_H
2 #define TrafficConeVISUAL_H
3 
6 
7 #include <OgreSceneNode.h>
8 #include <OgreAnimation.h>
9 #include <OgreSharedPtr.h>
10 #include <OgreEntity.h>
11 
13 #include <boost/algorithm/string/predicate.hpp>
14 #include <boost/filesystem.hpp>
16 
17 namespace fs = boost::filesystem;
18 
19 namespace tuw_object_rviz {
20 
21  // Default arguments that need to be supplied to all types of TrafficConeVisual
23  TrafficConeVisualDefaultArgs(Ogre::SceneManager* sceneManager, Ogre::SceneNode* parentNode) : sceneManager(sceneManager), parentNode(parentNode) {}
24  Ogre::SceneManager* sceneManager;
25  Ogre::SceneNode* parentNode;
26  };
27 
30  public:
32 
33  virtual ~TrafficConeVisual();
34 
35  void setPosition(const Ogre::Vector3& position);
36 
37  const Ogre::Vector3& getPosition() const;
38 
39  void setOrientation(const Ogre::Quaternion& orientation);
40 
41  const Ogre::Quaternion& getOrientation() const;
42 
43  virtual void setScalingFactor(double scalingFactor);
44 
45  void setVisible(bool visible);
46 
47  Ogre::SceneNode* getParentSceneNode();
48 
49  virtual void setHeight(double height);
50 
51  virtual void setRadius(double radius);
52 
53  virtual void update(float deltaTime);
54 
55  virtual void setColor(const Ogre::ColourValue& c) = 0;
56 
57  virtual Ogre::ColourValue& getColor() = 0;
58 
59  virtual double getHeight() = 0;
60 
61  protected:
62  Ogre::SceneManager* m_sceneManager;
63  Ogre::SceneNode *m_sceneNode, *m_parentSceneNode;
64  Ogre::ColourValue m_color;
65  double m_width, m_height, m_radius;
66  };
67 
70  public:
71  TrafficConeVisualImpl ( const TrafficConeVisualDefaultArgs& args, double height = 1.75, double radius = 0.6);
72 
73  virtual ~TrafficConeVisualImpl();
74 
75  virtual void setColor(const Ogre::ColourValue& c);
76 
77  virtual Ogre::ColourValue& getColor();
78 
79  virtual double getHeight();
80 
81  virtual void setHeight(double height);
82 
83  virtual void setRadius(double radius);
84 
85  virtual void update(float deltaTime);
86  /*
87  virtual void setScalingFactor(double scalingFactor);
88  */
89 
90  private:
92  double m_height;
93  double m_radius;
94  };
95 
96 // /// Visualization of a person as cylinder (body) + sphere (head)
97 // class CylinderTrafficConeVisual : public TrafficConeVisual {
98 // public:
99 // CylinderTrafficConeVisual(const TrafficConeVisualDefaultArgs& args);
100 
101 // virtual ~CylinderTrafficConeVisual();
102 
103 // virtual void setColor(const Ogre::ColourValue& c);
104 
105 // virtual Ogre::ColourValue& getColor();
106 
107 // virtual double getHeight();
108 
109 // private:
110 // rviz::Shape *m_bodyShape, *m_headShape;
111 // };
112 
113 // /// Visualization of a person as a mesh (walking human)
114 // class MeshTrafficConeVisual : public TrafficConeVisual {
115 
116 // private:
117 // Ogre::SceneNode *m_childSceneNode;
118 // Ogre::Entity* entity_;
119 // Ogre::AnimationState* m_animationState;
120 // std::set<Ogre::MaterialPtr> materials_;
121 // float m_walkingSpeed;
122 // public:
123 // MeshTrafficConeVisual ( const TrafficConeVisualDefaultArgs& args );
124 
125 // virtual ~MeshTrafficConeVisual();
126 
127 // virtual void update(float deltaTime);
128 
129 // virtual void setColor(const Ogre::ColourValue& c);
130 
131 // virtual Ogre::ColourValue& getColor();
132 
133 // void setAnimationState(const std::string& nameOfAnimationState);
134 
135 // void setWalkingSpeed(float walkingSpeed);
136 
137 // virtual double getHeight() {
138 // return 1.75;
139 // }
140 
141 // virtual void setScalingFactor(double scalingFactor) {
142 // // Not supported (for some reason causes the mesh to be mirrored vertically).
143 // }
144 // };
145 
146 }
147 
148 #endif // TrafficConeVISUAL_H
TrafficConeVisualDefaultArgs(Ogre::SceneManager *sceneManager, Ogre::SceneNode *parentNode)
Base class for all person visualization types.
void update(const std::string &key, const XmlRpc::XmlRpcValue &v)
Visualization of a person as a wireframe bounding box.


tuw_object_rviz
Author(s): Florian Beck
autogenerated on Mon Jun 10 2019 15:40:17