hpp-corbaserver  4.9.0
Corba server for Humanoid Path Planner applications
object-map.hh
Go to the documentation of this file.
1 // Copyright (c) 2018, Joseph Mirabel
2 // Authors: Joseph Mirabel (joseph.mirabel@laas.fr)
3 //
4 // This file is part of hpp-corbaserver.
5 // hpp-corbaserver is free software: you can redistribute it
6 // and/or modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation, either version
8 // 3 of the License, or (at your option) any later version.
9 //
10 // hpp-corbaserver is distributed in the hope that it will be
11 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
12 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 // General Lesser Public License for more details. You should have
14 // received a copy of the GNU Lesser General Public License along with
15 // hpp-corbaserver. If not, see <http://www.gnu.org/licenses/>.
16 
17 #ifndef HPP_CORBASERVER_OBJECT_MAP_HH
18 # define HPP_CORBASERVER_OBJECT_MAP_HH
19 
20 # include <pinocchio/fwd.hpp>
21 # include <hpp/fcl/BVH/BVH_model.h>
22 # include <hpp/fcl/shape/geometric_shapes.h>
23 
24 # include <hpp/corbaserver/fwd.hh>
25 # include <hpp/common-idl.hh>
26 
27 namespace hpp {
28  namespace corbaServer {
29  class ObjectMap
30  {
31  public:
32  void createBox (const std::string boxName, value_type x, value_type y, value_type z);
33  void createSphere (const std::string name, value_type radius);
34  void createCylinder (const std::string name, value_type radius, value_type length);
35 
36  void createPolyhedron (const std::string polyhedronName);
37  std::size_t addPoint (const std::string polyhedronName, value_type x, value_type y, value_type z);
38  std::size_t addTriangle (const std::string polyhedronName, std::size_t pt1, std::size_t pt2, std::size_t pt3);
39 
40  CollisionGeometryPtr_t geometry (const std::string name) /*const*/;
41 
42  protected:
43  struct PolyhedronData {
44  std::vector <fcl::Vec3f> pts;
45  std::vector <fcl::Triangle> tris;
46  };
47  typedef std::map <std::string, PolyhedronData> PolyhedronMap_t;
48  typedef std::map <std::string, BasicShapePtr_t> ShapeMap_t;
49 
50  enum GeomType {
51  Shape = 1,
54  };
55 
56  enum ThrowType {
60  };
61 
62  template <GeomType geomType, ThrowType throwType>
63  bool nameExists (const std::string& name) const;
64 
66  ShapeMap_t shapeMap_;
68  PolyhedronMap_t polyhedronMap_;
69  };
70  } // end of namespace corbaServer.
71 } // end of namespace hpp.
72 
73 #endif // HPP_CORBASERVER_OBJECT_MAP_HH
std::map< std::string, BasicShapePtr_t > ShapeMap_t
Definition: object-map.hh:48
Implement CORBA interface ``Obstacle&#39;&#39;.
unsigned long long size_t
Definition: paths.idl:18
std::size_t addTriangle(const std::string polyhedronName, std::size_t pt1, std::size_t pt2, std::size_t pt3)
bool nameExists(const std::string &name) const
pinocchio::value_type value_type
Definition: fwd.hh:80
void createBox(const std::string boxName, value_type x, value_type y, value_type z)
Definition: object-map.hh:51
Definition: object-map.hh:57
Definition: object-map.hh:53
Definition: object-map.hh:52
void createSphere(const std::string name, value_type radius)
void createCylinder(const std::string name, value_type radius, value_type length)
FCL_REAL radius
CollisionGeometryPtr_t geometry(const std::string name)
ThrowType
Definition: object-map.hh:56
GeomType
Definition: object-map.hh:50
void createPolyhedron(const std::string polyhedronName)
FCL_REAL length[2]
Definition: object-map.hh:29
std::size_t addPoint(const std::string polyhedronName, value_type x, value_type y, value_type z)
std::vector< fcl::Triangle > tris
Definition: object-map.hh:45
std::map< std::string, PolyhedronData > PolyhedronMap_t
Definition: object-map.hh:47
boost::shared_ptr< CollisionGeometry_t > CollisionGeometryPtr_t
Definition: fwd.hh:39
ShapeMap_t shapeMap_
Map of basic shapes.
Definition: object-map.hh:66
PolyhedronMap_t polyhedronMap_
Map of polyhedra in construction.
Definition: object-map.hh:68
std::vector< fcl::Vec3f > pts
Definition: object-map.hh:44