17 #ifndef _GAZEBO_MESHMANAGER_HH_
18 #define _GAZEBO_MESHMANAGER_HH_
24 #include <boost/thread/mutex.hpp>
26 #include <ignition/math/Plane.hh>
27 #include <ignition/math/Matrix3.hh>
28 #include <ignition/math/Matrix4.hh>
29 #include <ignition/math/Vector2.hh>
45 class ColladaExporter;
69 public:
const Mesh *Load(
const std::string &_filename);
77 public:
void Export(
const Mesh *_mesh,
const std::string &_filename,
78 const std::string &_extension,
bool _exportTextures =
false);
82 public:
bool IsValidFilename(
const std::string &_filename);
90 public:
void GetMeshAABB(
const Mesh *_mesh,
100 public:
void GetMeshAABB(
const Mesh *_mesh,
101 ignition::math::Vector3d &_center,
102 ignition::math::Vector3d &_min_xyz,
103 ignition::math::Vector3d &_max_xyz);
110 public:
void GenSphericalTexCoord(
const Mesh *_mesh,
116 public:
void GenSphericalTexCoord(
const Mesh *_mesh,
117 const ignition::math::Vector3d &_center);
124 public:
void AddMesh(
Mesh *_mesh);
129 public:
const Mesh *GetMesh(
const std::string &_name)
const;
133 public:
bool HasMesh(
const std::string &_name)
const;
140 public:
void CreateSphere(
const std::string &_name,
float _radius,
141 int _rings,
int _segments);
149 public:
void CreateBox(
const std::string &_name,
157 public:
void CreateBox(
const std::string &_name,
158 const ignition::math::Vector3d &_sides,
159 const ignition::math::Vector2d &_uvCoords);
175 public:
void CreateExtrudedPolyline(
const std::string &_name,
176 const std::vector<std::vector<math::Vector2d> > &_vertices,
191 public:
void CreateExtrudedPolyline(
const std::string &_name,
192 const std::vector<std::vector<ignition::math::Vector2d> >
193 &_vertices,
double _height);
201 public:
void CreateCylinder(
const std::string &_name,
213 public:
void CreateCone(
const std::string &_name,
230 public:
void CreateTube(
const std::string &_name,
236 double _arc = 2.0 * M_PI);
245 public:
void CreatePlane(
const std::string &_name,
255 public:
void CreatePlane(
const std::string &_name,
256 const ignition::math::Planed &_plane,
257 const ignition::math::Vector2d &_segments,
258 const ignition::math::Vector2d &_uvTile);
269 public:
void CreatePlane(
const std::string &_name,
283 public:
void CreatePlane(
const std::string &_name,
284 const ignition::math::Vector3d &_normal,
286 const ignition::math::Vector2d &_size,
287 const ignition::math::Vector2d &_segments,
288 const ignition::math::Vector2d &_uvTile);
297 private:
void Tesselate2DMesh(
SubMesh *_sm,
305 public:
void CreateCamera(
const std::string &_name,
float _scale);
308 public:
void CreateBoolean(
const std::string &_name,
const Mesh *_m1,
317 const Mesh *_m2,
const int _operation,
326 public:
void CreateBoolean(
const std::string &_name,
const Mesh *_m1,
327 const Mesh *_m2,
const int _operation,
328 const ignition::math::Pose3d &_offset = ignition::math::Pose3d::Zero);
338 private:
static void ConvertPolylinesToVerticesAndEdges(
339 const std::vector<std::vector<ignition::math::Vector2d> >
342 std::vector<ignition::math::Vector2d> &_vertices,
343 std::vector<ignition::math::Vector2i> &_edges);
352 private:
static size_t AddUniquePointToVerticesTable(
353 std::vector<ignition::math::Vector2d> &_vertices,
354 const ignition::math::Vector2d &_p,
367 private: std::map<std::string, Mesh*> meshes;
370 private: std::vector<std::string> fileExtensions;
372 private: boost::mutex mutex;
A 3D mesh.
Definition: Mesh.hh:44
Encapsulates a position and rotation in three space.
Definition: Pose.hh:37
Generic double x, y vector.
Definition: Vector2d.hh:36
The Vector3 class represents the generic vector containing 3 elements.
Definition: Vector3.hh:39
#define GAZEBO_DEPRECATED(version)
Definition: CommonTypes.hh:47
Singleton template class.
Definition: SingletonT.hh:33
A child mesh.
Definition: Mesh.hh:265
#define GZ_COMMON_VISIBLE
Definition: system.hh:91
A plane and related functions.
Definition: Plane.hh:35
Class used to load Collada mesh files.
Definition: ColladaLoader.hh:46
Maintains and manages all meshes.
Definition: MeshManager.hh:56
Class used to export Collada mesh files.
Definition: ColladaExporter.hh:42
static const Pose Zero
math::Pose(0, 0, 0, 0, 0, 0)
Definition: Pose.hh:40
Class used to load STL mesh files.
Definition: STLLoader.hh:40