DoorVisual.h
Go to the documentation of this file.
1 #ifndef DOORVISUAL_H
2 #define DOORVISUAL_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>
17 
18 namespace fs = boost::filesystem;
19 
20 namespace tuw_object_rviz {
21 
22  class HasWireframe {
23  public:
24  virtual void generateWireframe() = 0;
25  };
26 
27  class HasBaseframe {
28  public:
29  virtual void generateBaseframe() = 0;
30  };
31 
32  // Default arguments that need to be supplied to all types of DoorVisual
34  DoorVisualDefaultArgs(Ogre::SceneManager* sceneManager, Ogre::SceneNode* parentNode) : sceneManager(sceneManager), parentNode(parentNode) {}
35  Ogre::SceneManager* sceneManager;
36  Ogre::SceneNode* parentNode;
37  };
38 
40  class DoorVisual {
41  public:
43 
44  virtual ~DoorVisual();
45 
46  void setPosition(const Ogre::Vector3& position);
47 
48  const Ogre::Vector3& getPosition() const;
49 
50  void setOrientation(const Ogre::Quaternion& orientation);
51 
52  const Ogre::Quaternion& getOrientation() const;
53 
54  virtual void setScalingFactor(double scalingFactor);
55 
56  void setVisible(bool visible);
57 
58  Ogre::SceneNode* getParentSceneNode();
59 
60  virtual void setHeight(double height);
61 
62  virtual void setWidth(double width);
63 
64  virtual void setOpeningAngle(double oangle, bool clockwise);
65 
66  virtual void update(float deltaTime);
67 
68  virtual Ogre::Matrix3 getRotationMat();
69 
70  virtual void setColor(const Ogre::ColourValue& c) = 0;
71 
72  virtual Ogre::ColourValue& getColor() = 0;
73 
74  virtual double getHeight() = 0;
75 
76  protected:
77  Ogre::SceneManager* m_sceneManager;
78  Ogre::SceneNode *m_sceneNode, *m_parentSceneNode;
79  Ogre::ColourValue m_color;
80  Ogre::Matrix3 R_do;
82  double m_oangle;
83  double m_width, m_height;
84  };
85 
88  public:
89  BoundingBoxDoorVisual ( const DoorVisualDefaultArgs& args, double height = 1.75, double width = 0.6, double scalingFactor = 1.0 );
90 
91  virtual ~BoundingBoxDoorVisual();
92 
93  virtual void setColor(const Ogre::ColourValue& c);
94 
95  virtual Ogre::ColourValue& getColor();
96 
97  virtual double getHeight();
98 
99  virtual void setLineWidth(double lineWidth);
100 
101  virtual void generateWireframe();
102 
103  virtual void generateBaseframe();
104  /*
105  virtual void setScalingFactor(double scalingFactor);
106  */
107 
108  private:
111  double m_scalingFactor, m_lineWidth;
112  double m_thickness;
113  };
114 
115 // /// Visualization of a person as cylinder (body) + sphere (head)
116 // class CylinderDoorVisual : public DoorVisual {
117 // public:
118 // CylinderDoorVisual(const DoorVisualDefaultArgs& args);
119 
120 // virtual ~CylinderDoorVisual();
121 
122 // virtual void setColor(const Ogre::ColourValue& c);
123 
124 // virtual Ogre::ColourValue& getColor();
125 
126 // virtual double getHeight();
127 
128 // private:
129 // rviz::Shape *m_bodyShape, *m_headShape;
130 // };
131 
132 // /// Visualization of a person as a mesh (walking human)
133 // class MeshDoorVisual : public DoorVisual {
134 
135 // private:
136 // Ogre::SceneNode *m_childSceneNode;
137 // Ogre::Entity* entity_;
138 // Ogre::AnimationState* m_animationState;
139 // std::set<Ogre::MaterialPtr> materials_;
140 // float m_walkingSpeed;
141 // public:
142 // MeshDoorVisual ( const DoorVisualDefaultArgs& args );
143 
144 // virtual ~MeshDoorVisual();
145 
146 // virtual void update(float deltaTime);
147 
148 // virtual void setColor(const Ogre::ColourValue& c);
149 
150 // virtual Ogre::ColourValue& getColor();
151 
152 // void setAnimationState(const std::string& nameOfAnimationState);
153 
154 // void setWalkingSpeed(float walkingSpeed);
155 
156 // virtual double getHeight() {
157 // return 1.75;
158 // }
159 
160 // virtual void setScalingFactor(double scalingFactor) {
161 // // Not supported (for some reason causes the mesh to be mirrored vertically).
162 // }
163 // };
164 
165 }
166 
167 #endif // DOORVISUAL_H
Ogre::SceneManager * m_sceneManager
Definition: DoorVisual.h:77
virtual void generateWireframe()=0
Visualization of a person as a wireframe bounding box.
Definition: DoorVisual.h:87
Ogre::SceneManager * sceneManager
Definition: DoorVisual.h:35
rviz::BillboardLine * m_baseframe
Definition: DoorVisual.h:110
void update(const std::string &key, const XmlRpc::XmlRpcValue &v)
Ogre::SceneNode * m_sceneNode
Definition: DoorVisual.h:78
rviz::BillboardLine * m_wireframe
Definition: DoorVisual.h:109
DoorVisualDefaultArgs(Ogre::SceneManager *sceneManager, Ogre::SceneNode *parentNode)
Definition: DoorVisual.h:34
Ogre::ColourValue m_color
Definition: DoorVisual.h:79
Base class for all person visualization types.
Definition: DoorVisual.h:40


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