CollisionShapeCache.h
Go to the documentation of this file.
1 /*+-------------------------------------------------------------------------+
2  | MultiVehicle simulator (libmvsim) |
3  | |
4  | Copyright (C) 2014-2023 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 #include <mrpt/opengl/CRenderizable.h>
11 #include <mvsim/Shape2p5.h>
12 
13 #include <map>
14 #include <optional>
15 #include <string>
16 
17 namespace mvsim
18 {
20 {
21  public:
22  static CollisionShapeCache& Instance();
23 
25  Shape2p5 get(
26  mrpt::opengl::CRenderizable& obj, float zMin, float zMax,
27  const mrpt::poses::CPose3D& modelPose, const float modelScale,
28  const std::optional<std::string>& modelFile = std::nullopt);
29 
30  void clear() { cache.clear(); }
31 
32  private:
33  CollisionShapeCache() = default;
34  ~CollisionShapeCache() = default;
35 
36  struct Entry
37  {
39  };
40 
41  std::map<std::string, Entry> cache;
42 
46  std::optional<Shape2p5> processSimpleGeometries(
47  const mrpt::opengl::CRenderizable& obj, float zMin, float zMax,
48  const mrpt::poses::CPose3D& modelPose, const float modelScale);
49 
51  mrpt::opengl::CRenderizable& obj, float zMin, float zMax,
52  const mrpt::poses::CPose3D& modelPose, const float modelScale);
53 
55  const size_t actualEdgeCount, double actualRadius, float zMin,
56  float zMax, const mrpt::poses::CPose3D& modelPose,
57  const float modelScale);
58 };
59 
60 } // namespace mvsim
std::map< std::string, Entry > cache
std::optional< Shape2p5 > processSimpleGeometries(const mrpt::opengl::CRenderizable &obj, float zMin, float zMax, const mrpt::poses::CPose3D &modelPose, const float modelScale)
Shape2p5 processCylinderLike(const size_t actualEdgeCount, double actualRadius, float zMin, float zMax, const mrpt::poses::CPose3D &modelPose, const float modelScale)
Shape2p5 processGenericGeometry(mrpt::opengl::CRenderizable &obj, float zMin, float zMax, const mrpt::poses::CPose3D &modelPose, const float modelScale)
static CollisionShapeCache & Instance()


mvsim
Author(s):
autogenerated on Tue Jul 4 2023 03:08:19