Developer Documentation
mymesh.cc
1 #include <OpenMesh/Core/Mesh/TriMesh_ArrayKernelT.hh>
2 
3 
4 // define traits
6 {
7  // use double valued coordinates
8  typedef OpenMesh::Vec3d Point;
9 
10  // use vertex normals and vertex colors
11  VertexAttributes( OpenMesh::DefaultAttributer::Normal |
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 
33 int 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 }
Add storage for previous halfedge (halfedges). The bit is set by default in the DefaultTraits.
Definition: Attributes.hh:84
Add colors to mesh item (vertices/faces/edges)
Definition: Attributes.hh:83