MeshCSG.hh
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2012-2015 Open Source Robotics Foundation
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *
16 */
17 #ifndef _MESHCSG_HH_
18 #define _MESHCSG_HH_
19 
20 #include "gazebo/math/Pose.hh"
21 #include "gazebo/util/system.hh"
22 
23 struct _GtsSurface;
24 typedef _GtsSurface GtsSurface;
25 struct _GPtrArray;
26 typedef _GPtrArray GPtrArray;
27 
28 namespace gazebo
29 {
30  namespace common
31  {
32  class Mesh;
33 
36 
40  {
42  public: enum BooleanOperation {UNION, INTERSECTION, DIFFERENCE};
43 
45  public: MeshCSG();
46 
48  public: virtual ~MeshCSG();
49 
56  public: Mesh *CreateBoolean(const Mesh *_m1, const Mesh *_m2,
57  const int _operation, const math::Pose &_offset = math::Pose::Zero);
58 
60  private: void ConvertMeshToGTS(const Mesh *mesh, GtsSurface *surface);
61 
63  // are within epsilon
66  private: void MergeVertices(GPtrArray * _vertices, double _epsilon);
67  };
69  }
70 }
71 
72 #endif
A 3D mesh.
Definition: Mesh.hh:40
Encapsulates a position and rotation in three space.
Definition: Pose.hh:40
BooleanOperation
An enumeration of the boolean operations.
Definition: MeshCSG.hh:42
Creates CSG meshes.
Definition: MeshCSG.hh:39
Definition: MeshCSG.hh:42
_GPtrArray GPtrArray
Definition: MeshCSG.hh:25
static const Pose Zero
math::Pose(0, 0, 0, 0, 0, 0)
Definition: Pose.hh:43
#define GAZEBO_VISIBLE
Use to represent "symbol visible" if supported.
Definition: system.hh:48
_GtsSurface GtsSurface
Definition: MeshCSG.hh:23