Gazebo Common

API Reference

4.7.0
gz/common/MeshCSG.hh
Go to the documentation of this file.
1 
2 /*
3  * Copyright (C) 2016 Open Source Robotics Foundation
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17 */
18 #ifndef IGNITION_COMMON_MESHCSG_HH_
19 #define IGNITION_COMMON_MESHCSG_HH_
20 
21 #include <gz/math/Pose3.hh>
22 
23 #include <gz/common/config.hh>
24 #include <gz/common/graphics/Export.hh>
25 
26 struct _GtsSurface;
27 typedef _GtsSurface GtsSurface;
28 struct _GPtrArray;
29 typedef _GPtrArray GPtrArray;
30 
31 namespace ignition
32 {
33  namespace common
34  {
35  class Mesh;
36 
39  class IGNITION_COMMON_GRAPHICS_VISIBLE MeshCSG
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,
58  const math::Pose3d &_offset = math::Pose3d::Zero);
59 
61  private: void ConvertMeshToGTS(const Mesh *mesh, GtsSurface *surface);
62 
64  // are within epsilon
67  private: void MergeVertices(GPtrArray * _vertices, double _epsilon);
68  };
69  }
70 }
71 
72 #endif
_GtsSurface GtsSurface
Definition: gz/common/GTSMeshUtils.hh:29
Forward declarations for the common classes.
_GtsSurface GtsSurface
Definition: gz/common/MeshCSG.hh:26
@ UNION
Definition: gz/common/MeshCSG.hh:42
BooleanOperation
An enumeration of the boolean operations.
Definition: gz/common/MeshCSG.hh:42
Creates CSG meshes.
Definition: gz/common/MeshCSG.hh:39
_GPtrArray GPtrArray
Definition: gz/common/MeshCSG.hh:28
static const Pose3< T > Zero
A 3D mesh.
Definition: gz/common/Mesh.hh:42