Developer Documentation
Loading...
Searching...
No Matches
mymesh.cc
1#include <OpenMesh/Core/Mesh/TriMesh_ArrayKernelT.hh>
2
3
4// define traits
6{
7 // use double valued coordinates
9
10 // use vertex normals and vertex colors
11 VertexAttributes( OpenMesh::DefaultAttributer::Normal |
12 OpenMesh::DefaultAttributer::Color );
13
14 // store the previous halfedge
15 HalfedgeAttributes( OpenMesh::DefaultAttributer::PrevHalfedge );
16
17 // use face normals
18 FaceAttributes( OpenMesh::DefaultAttributer::Normal );
19
20 // store a face handle for each vertex
21 VertexTraits
22 {
23 typename Base::Refs::FaceHandle my_face_handle;
24 };
25
26};
27
28
29// Select mesh type (TriMesh) and kernel (ArrayKernel)
30// and define my personal mesh type (MyMesh)
32
33int main(int argc, char **argv)
34{
35 MyMesh mesh;
36
37 // -------------------- Add dynamic data
38
39 // for each vertex an extra double value
41 mesh.add_property( vprop_double );
42
43 // for the mesh an extra string
45 mesh.add_property( mprop_string );
46
47 // -------------------- do something
48
49 ...;
50
51}
#define VertexAttributes(_i)
Macro for defining the vertex attributes. See Specifying your MyMesh.
Definition Traits.hh:79
#define HalfedgeAttributes(_i)
Macro for defining the halfedge attributes. See Specifying your MyMesh.
Definition Traits.hh:82
#define FaceAttributes(_i)
Macro for defining the face attributes. See Specifying your MyMesh.
Definition Traits.hh:88