44 #include <OpenMesh/Core/IO/MeshIO.hh> 45 #include <OpenMesh/Core/Mesh/PolyMesh_ArrayKernelT.hh> 47 #include <OpenMesh/Core/Mesh/Status.hh> 67 mesh.request_face_status();
68 mesh.request_edge_status();
69 mesh.request_vertex_status();
74 MyMesh::FaceHandle fhandle[6];
88 std::vector<MyMesh::VertexHandle> tmp_face_vhandles;
90 tmp_face_vhandles.clear();
91 tmp_face_vhandles.push_back(vhandle[0]);
92 tmp_face_vhandles.push_back(vhandle[1]);
93 tmp_face_vhandles.push_back(vhandle[2]);
94 tmp_face_vhandles.push_back(vhandle[3]);
95 fhandle[0] = mesh.add_face(tmp_face_vhandles);
97 tmp_face_vhandles.clear();
98 tmp_face_vhandles.push_back(vhandle[7]);
99 tmp_face_vhandles.push_back(vhandle[6]);
100 tmp_face_vhandles.push_back(vhandle[5]);
101 tmp_face_vhandles.push_back(vhandle[4]);
102 fhandle[1] = mesh.add_face(tmp_face_vhandles);
104 tmp_face_vhandles.clear();
105 tmp_face_vhandles.push_back(vhandle[1]);
106 tmp_face_vhandles.push_back(vhandle[0]);
107 tmp_face_vhandles.push_back(vhandle[4]);
108 tmp_face_vhandles.push_back(vhandle[5]);
109 fhandle[2] = mesh.add_face(tmp_face_vhandles);
112 tmp_face_vhandles.clear();
113 tmp_face_vhandles.push_back(vhandle[2]);
114 tmp_face_vhandles.push_back(vhandle[1]);
115 tmp_face_vhandles.push_back(vhandle[5]);
116 tmp_face_vhandles.push_back(vhandle[6]);
117 fhandle[3] = mesh.add_face(tmp_face_vhandles);
120 tmp_face_vhandles.clear();
121 tmp_face_vhandles.push_back(vhandle[3]);
122 tmp_face_vhandles.push_back(vhandle[2]);
123 tmp_face_vhandles.push_back(vhandle[6]);
124 tmp_face_vhandles.push_back(vhandle[7]);
125 fhandle[4] = mesh.add_face(tmp_face_vhandles);
128 tmp_face_vhandles.clear();
129 tmp_face_vhandles.push_back(vhandle[0]);
130 tmp_face_vhandles.push_back(vhandle[3]);
131 tmp_face_vhandles.push_back(vhandle[7]);
132 tmp_face_vhandles.push_back(vhandle[4]);
133 fhandle[5] = mesh.add_face(tmp_face_vhandles);
141 mesh.delete_face(fhandle[0],
false);
143 mesh.delete_face(fhandle[2],
false);
145 mesh.delete_face(fhandle[3],
false);
147 mesh.delete_face(fhandle[4],
false);
149 mesh.delete_face(fhandle[5],
false);
158 mesh.delete_vertex(vhandle[0],
false);
159 mesh.delete_vertex(vhandle[1],
false);
160 mesh.delete_vertex(vhandle[2],
false);
161 mesh.delete_vertex(vhandle[3],
false);
165 mesh.garbage_collection();
170 std::cerr <<
"Cannot write mesh to file 'output.off'" << std::endl;
174 catch( std::exception& x )
176 std::cerr << x.what() << std::endl;
Kernel::Point Point
Coordinate type.
VertexHandle add_vertex(const Point &_p)
Alias for new_vertex(const Point&).
bool write_mesh(const Mesh &_mesh, const std::string &_filename, Options _opt=Options::Default, std::streamsize _precision=6)
Write a mesh to the file _filename.
Kernel::VertexHandle VertexHandle
Handle for referencing the corresponding item.