VisualObject.h
Go to the documentation of this file.
1 /*+-------------------------------------------------------------------------+
2  | MultiVehicle simulator (libmvsim) |
3  | |
4  | Copyright (C) 2014-2020 Jose Luis Blanco Claraco |
5  | Copyright (C) 2017 Borys Tymchenko (Odessa Polytechnic University) |
6  | Distributed under 3-clause BSD License |
7  | See COPYING |
8  +-------------------------------------------------------------------------+ */
9 
10 #pragma once
11 
13 #include <mrpt/poses/CPose3D.h>
14 #include <mvsim/basic_types.h>
15 
16 #include <cstdint>
17 #include <memory>
18 
19 namespace mvsim
20 {
21 class World;
22 
26 {
27  public:
28  VisualObject(World* parent) : m_world(parent) {}
29  virtual ~VisualObject() {}
33 
34  World* getWorldObject() { return m_world; }
35  const World* getWorldObject() const { return m_world; }
36 
40  mrpt::math::TPoint3D& bbmin, mrpt::math::TPoint3D& bbmax) const
41  {
42  bbmin = viz_bbmin_;
43  bbmax = viz_bbmax_;
44  }
45  void showBoundingBox(bool show);
46 
47  protected:
48  bool parseVisual(const rapidxml::xml_node<char>* visual_node);
49 
51 
54  std::shared_ptr<mrpt::opengl::CSetOfObjects> m_glCustomVisual;
55  std::shared_ptr<mrpt::opengl::CSetOfObjects> m_glBoundingBox;
57 
58  virtual void internalGuiUpdate(
59  mrpt::opengl::COpenGLScene& scene, bool childrenOnly = false) = 0;
61 
62  private:
63  mrpt::math::TPoint3D viz_bbmin_{-1.0, -1.0, .0}, viz_bbmax_{1.0, 1.0, 1.0};
64 };
65 } // namespace mvsim
std::shared_ptr< mrpt::opengl::CSetOfObjects > m_glBoundingBox
Definition: VisualObject.h:55
virtual void guiUpdate(mrpt::opengl::COpenGLScene &scene)
std::shared_ptr< mrpt::opengl::CSetOfObjects > m_glCustomVisual
Definition: VisualObject.h:54
scene
int32_t m_glCustomVisualId
Definition: VisualObject.h:56
virtual mrpt::poses::CPose3D internalGuiGetVisualPose()
Definition: VisualObject.h:60
World * getWorldObject()
Definition: VisualObject.h:34
VisualObject(World *parent)
Definition: VisualObject.h:28
mrpt::math::TPoint3D viz_bbmin_
Definition: VisualObject.h:63
void getVisualModelBoundingBox(mrpt::math::TPoint3D &bbmin, mrpt::math::TPoint3D &bbmax) const
Definition: VisualObject.h:39
void showBoundingBox(bool show)
const World * getWorldObject() const
Definition: VisualObject.h:35
bool parseVisual(const rapidxml::xml_node< char > *visual_node)
virtual ~VisualObject()
Definition: VisualObject.h:29
mrpt::math::TPoint3D viz_bbmax_
Definition: VisualObject.h:63
signed int int32_t
virtual void internalGuiUpdate(mrpt::opengl::COpenGLScene &scene, bool childrenOnly=false)=0


mvsim
Author(s):
autogenerated on Fri May 7 2021 03:05:51