Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef CARTOGRAPHER_RVIZ_SRC_OGRE_SLICE_H_
00018 #define CARTOGRAPHER_RVIZ_SRC_OGRE_SLICE_H_
00019
00020 #include "Eigen/Core"
00021 #include "Eigen/Geometry"
00022 #include "OgreManualObject.h"
00023 #include "OgreMaterial.h"
00024 #include "OgreQuaternion.h"
00025 #include "OgreSceneManager.h"
00026 #include "OgreSceneNode.h"
00027 #include "OgreTexture.h"
00028 #include "OgreVector3.h"
00029 #include "cartographer/io/submap_painter.h"
00030 #include "cartographer/mapping/id.h"
00031
00032 namespace cartographer_rviz {
00033
00034 Ogre::Vector3 ToOgre(const Eigen::Vector3d& v);
00035 Ogre::Quaternion ToOgre(const Eigen::Quaterniond& q);
00036
00037
00038
00039 class OgreSlice {
00040 public:
00041
00042
00043 OgreSlice(const ::cartographer::mapping::SubmapId& id, int slice_id,
00044 Ogre::SceneManager* const scene_manager,
00045 Ogre::SceneNode* const submap_node);
00046 ~OgreSlice();
00047
00048 OgreSlice(const OgreSlice&) = delete;
00049 OgreSlice& operator=(const OgreSlice&) = delete;
00050
00051
00052
00053 void Update(const ::cartographer::io::SubmapTexture& submap_texture);
00054
00055
00056 void SetAlpha(float alpha);
00057
00058
00059 void SetVisibility(bool visibility);
00060
00061
00062
00063 void UpdateOgreNodeVisibility(bool submap_visibility);
00064
00065 private:
00066
00067 const ::cartographer::mapping::SubmapId id_;
00068 const int slice_id_;
00069 Ogre::SceneManager* const scene_manager_;
00070 Ogre::SceneNode* const submap_node_;
00071 Ogre::SceneNode* const slice_node_;
00072 Ogre::ManualObject* const manual_object_;
00073 Ogre::TexturePtr texture_;
00074 Ogre::MaterialPtr material_;
00075 bool visibility_ = true;
00076 };
00077
00078 }
00079
00080 #endif // CARTOGRAPHER_RVIZ_SRC_OGRE_SLICE_H_