Rumba C++ SDK
Mesh.h
Go to the documentation of this file.
1 /*
2 
3  *
4  ***
5  *****
6  ********************* Mercenaries Engineering SARL
7  ***************** Copyright (C) 2018
8  *************
9  ********* http://www.mercenaries-engineering.com
10  ***********
11  **** ****
12  ** **
13 
14 */
15 #pragma once
16 
17 #include "Points.h"
18 #include "SpanSpan.h"
19 
20  namespace maquina
21  {
23 
33  class MAQUINA_EXPORT Mesh : public Points
34  {
35  public:
37  Mesh();
38 
40 
43  Mesh(
44  const BufferConstV3f& points,
45  const BufferConstUInt32& indices,
46  const BufferConstUInt32& offsets
47  );
48 
50 
51  Mesh(const Value &v);
52 
54  SpanSpan<const uint32_t, const uint32_t> position_topology() const;
55  SpanSpan< const uint32_t, const uint32_t > vertex_to_faces() const;
56  SpanSpan< const uint32_t, const uint32_t > vertex_to_edges() const;
57  SpanSpan< const uint32_t, const uint32_t > edges_to_faces() const;
58  SpanSpan< const uint32_t, const uint32_t > adjacent_vertices() const;
59 
61 
66  Mesh triangulate() const;
67 
69 
72  void compute_triangle_indices(BufferV3i &result) const;
73 
75 
79  void compute_triangle_face_varying_indices(BufferV3i &result) const;
80 
82 
87  int closest_face(const Imath::V3f &p,
88  float &max_distance,
89  Imath::V3f* closest_pos = nullptr
90  ) const;
91 
93 
94  Imath::V3f normal(
95  int face,
96  int corner
97  ) const;
98 
100  Imath::V3f smooth_normal(int vertex) const;
101 
103  Mesh(const std::shared_ptr<Impl>& impl) { _impl=impl; }
104  };
105  }
Definition: ImathFrame.h:42
A mesh value.
Definition: Mesh.h:33
This version of the SDK is unstable, i-e, it may change with no warning.
Definition: AddCurveAction.h:20
#define MAQUINA_EXPORT
Definition: Export.h:31
A writable buffer for basic types like floats, integers, Imath::V3f, Imath::M44f..
Definition: Buffer.h:106
A set of 3d points.
Definition: Points.h:26
A view on a "vector of sub-vectors of values" container.
Definition: SpanSpan.h:29
Base class of all Rumba values.
Definition: Value.h:34