17 #ifndef GAZEBO_COMMON_MESHMANAGER_HH_ 18 #define GAZEBO_COMMON_MESHMANAGER_HH_ 24 #include <ignition/math/Plane.hh> 25 #include <ignition/math/Pose3.hh> 26 #include <ignition/math/Vector2.hh> 27 #include <ignition/math/Vector3.hh> 41 class MeshManagerPrivate;
63 public:
const Mesh *Load(
const std::string &_filename);
71 public:
void Export(
const Mesh *_mesh,
const std::string &_filename,
72 const std::string &_extension,
bool _exportTextures =
false);
76 public:
bool IsValidFilename(
const std::string &_filename);
83 public:
void GetMeshAABB(
const Mesh *_mesh,
84 ignition::math::Vector3d &_center,
85 ignition::math::Vector3d &_min_xyz,
86 ignition::math::Vector3d &_max_xyz);
91 public:
void GenSphericalTexCoord(
const Mesh *_mesh,
92 const ignition::math::Vector3d &_center);
99 public:
void AddMesh(
Mesh *_mesh);
104 public:
const Mesh *GetMesh(
const std::string &_name)
const;
108 public:
bool HasMesh(
const std::string &_name)
const;
115 public:
void CreateSphere(
const std::string &_name,
float _radius,
116 int _rings,
int _segments);
122 public:
void CreateBox(
const std::string &_name,
123 const ignition::math::Vector3d &_sides,
124 const ignition::math::Vector2d &_uvCoords);
138 public:
void CreateExtrudedPolyline(
const std::string &_name,
139 const std::vector<std::vector<ignition::math::Vector2d> >
140 &_vertices,
double _height);
148 public:
void CreateCylinder(
const std::string &_name,
160 public:
void CreateCone(
const std::string &_name,
177 public:
void CreateTube(
const std::string &_name,
183 double _arc = 2.0 * M_PI);
190 public:
void CreatePlane(
const std::string &_name,
191 const ignition::math::Planed &_plane,
192 const ignition::math::Vector2d &_segments,
193 const ignition::math::Vector2d &_uvTile);
202 public:
void CreatePlane(
const std::string &_name,
203 const ignition::math::Vector3d &_normal,
205 const ignition::math::Vector2d &_size,
206 const ignition::math::Vector2d &_segments,
207 const ignition::math::Vector2d &_uvTile);
216 private:
void Tesselate2DMesh(
SubMesh *_sm,
224 public:
void CreateCamera(
const std::string &_name,
float _scale);
227 public:
void CreateBoolean(
const std::string &_name,
const Mesh *_m1,
234 const Mesh *_m2,
const int _operation,
235 const ignition::math::Pose3d &_offset = ignition::math::Pose3d::Zero);
245 private:
static void ConvertPolylinesToVerticesAndEdges(
246 const std::vector<std::vector<ignition::math::Vector2d> >
249 std::vector<ignition::math::Vector2d> &_vertices,
250 std::vector<ignition::math::Vector2i> &_edges);
259 private:
static size_t AddUniquePointToVerticesTable(
260 std::vector<ignition::math::Vector2d> &_vertices,
261 const ignition::math::Vector2d &_p,
269 private: MeshManagerPrivate *dataPtr;
A 3D mesh.
Definition: Mesh.hh:42
Forward declarations for the common classes.
Definition: Animation.hh:26
Singleton template class.
Definition: SingletonT.hh:33
A child mesh.
Definition: Mesh.hh:214
common
Definition: MeshManager.hh:34
Maintains and manages all meshes.
Definition: MeshManager.hh:50
#define GZ_SINGLETON_DECLARE(visibility, n1, n2, singletonType)
Helper to declare typed SingletonT.
Definition: SingletonT.hh:61