52 #include <OpenMesh/Core/IO/MeshIO.hh> 53 #include <OpenMesh/Core/Mesh/PolyMesh_ArrayKernelT.hh> 55 #include <OpenMesh/Core/Mesh/Status.hh> 75 mesh.request_face_status();
76 mesh.request_edge_status();
77 mesh.request_vertex_status();
82 MyMesh::FaceHandle fhandle[6];
96 std::vector<MyMesh::VertexHandle> tmp_face_vhandles;
98 tmp_face_vhandles.clear();
99 tmp_face_vhandles.push_back(vhandle[0]);
100 tmp_face_vhandles.push_back(vhandle[1]);
101 tmp_face_vhandles.push_back(vhandle[2]);
102 tmp_face_vhandles.push_back(vhandle[3]);
103 fhandle[0] = mesh.add_face(tmp_face_vhandles);
105 tmp_face_vhandles.clear();
106 tmp_face_vhandles.push_back(vhandle[7]);
107 tmp_face_vhandles.push_back(vhandle[6]);
108 tmp_face_vhandles.push_back(vhandle[5]);
109 tmp_face_vhandles.push_back(vhandle[4]);
110 fhandle[1] = mesh.add_face(tmp_face_vhandles);
112 tmp_face_vhandles.clear();
113 tmp_face_vhandles.push_back(vhandle[1]);
114 tmp_face_vhandles.push_back(vhandle[0]);
115 tmp_face_vhandles.push_back(vhandle[4]);
116 tmp_face_vhandles.push_back(vhandle[5]);
117 fhandle[2] = mesh.add_face(tmp_face_vhandles);
120 tmp_face_vhandles.clear();
121 tmp_face_vhandles.push_back(vhandle[2]);
122 tmp_face_vhandles.push_back(vhandle[1]);
123 tmp_face_vhandles.push_back(vhandle[5]);
124 tmp_face_vhandles.push_back(vhandle[6]);
125 fhandle[3] = mesh.add_face(tmp_face_vhandles);
128 tmp_face_vhandles.clear();
129 tmp_face_vhandles.push_back(vhandle[3]);
130 tmp_face_vhandles.push_back(vhandle[2]);
131 tmp_face_vhandles.push_back(vhandle[6]);
132 tmp_face_vhandles.push_back(vhandle[7]);
133 fhandle[4] = mesh.add_face(tmp_face_vhandles);
136 tmp_face_vhandles.clear();
137 tmp_face_vhandles.push_back(vhandle[0]);
138 tmp_face_vhandles.push_back(vhandle[3]);
139 tmp_face_vhandles.push_back(vhandle[7]);
140 tmp_face_vhandles.push_back(vhandle[4]);
141 fhandle[5] = mesh.add_face(tmp_face_vhandles);
149 mesh.delete_face(fhandle[0],
false);
151 mesh.delete_face(fhandle[2],
false);
153 mesh.delete_face(fhandle[3],
false);
155 mesh.delete_face(fhandle[4],
false);
157 mesh.delete_face(fhandle[5],
false);
166 mesh.delete_vertex(vhandle[0],
false);
167 mesh.delete_vertex(vhandle[1],
false);
168 mesh.delete_vertex(vhandle[2],
false);
169 mesh.delete_vertex(vhandle[3],
false);
173 mesh.garbage_collection();
178 std::cerr <<
"Cannot write mesh to file 'output.off'" << std::endl;
182 catch( std::exception& x )
184 std::cerr << x.what() << std::endl;
Kernel::VertexHandle VertexHandle
Handle for referencing the corresponding item.
VertexHandle add_vertex(const Point &_p)
Alias for new_vertex(const Point&).
Kernel::Point Point
Coordinate type.
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.