52 #include <OpenMesh/Core/IO/MeshIO.hh> 53 #include <OpenMesh/Core/Mesh/PolyMesh_ArrayKernelT.hh> 55 #include <OpenMesh/Core/Mesh/Status.hh> 80 MyMesh::FaceHandle fhandle[6];
94 std::vector<MyMesh::VertexHandle> tmp_face_vhandles;
96 tmp_face_vhandles.clear();
97 tmp_face_vhandles.push_back(vhandle[0]);
98 tmp_face_vhandles.push_back(vhandle[1]);
99 tmp_face_vhandles.push_back(vhandle[2]);
100 tmp_face_vhandles.push_back(vhandle[3]);
101 fhandle[0] = mesh.add_face(tmp_face_vhandles);
103 tmp_face_vhandles.clear();
104 tmp_face_vhandles.push_back(vhandle[7]);
105 tmp_face_vhandles.push_back(vhandle[6]);
106 tmp_face_vhandles.push_back(vhandle[5]);
107 tmp_face_vhandles.push_back(vhandle[4]);
108 fhandle[1] = mesh.add_face(tmp_face_vhandles);
110 tmp_face_vhandles.clear();
111 tmp_face_vhandles.push_back(vhandle[1]);
112 tmp_face_vhandles.push_back(vhandle[0]);
113 tmp_face_vhandles.push_back(vhandle[4]);
114 tmp_face_vhandles.push_back(vhandle[5]);
115 fhandle[2] = mesh.add_face(tmp_face_vhandles);
118 tmp_face_vhandles.clear();
119 tmp_face_vhandles.push_back(vhandle[2]);
120 tmp_face_vhandles.push_back(vhandle[1]);
121 tmp_face_vhandles.push_back(vhandle[5]);
122 tmp_face_vhandles.push_back(vhandle[6]);
123 fhandle[3] = mesh.add_face(tmp_face_vhandles);
126 tmp_face_vhandles.clear();
127 tmp_face_vhandles.push_back(vhandle[3]);
128 tmp_face_vhandles.push_back(vhandle[2]);
129 tmp_face_vhandles.push_back(vhandle[6]);
130 tmp_face_vhandles.push_back(vhandle[7]);
131 fhandle[4] = mesh.add_face(tmp_face_vhandles);
134 tmp_face_vhandles.clear();
135 tmp_face_vhandles.push_back(vhandle[0]);
136 tmp_face_vhandles.push_back(vhandle[3]);
137 tmp_face_vhandles.push_back(vhandle[7]);
138 tmp_face_vhandles.push_back(vhandle[4]);
139 fhandle[5] = mesh.add_face(tmp_face_vhandles);
147 mesh.delete_face(fhandle[0],
false);
149 mesh.delete_face(fhandle[2],
false);
151 mesh.delete_face(fhandle[3],
false);
153 mesh.delete_face(fhandle[4],
false);
155 mesh.delete_face(fhandle[5],
false);
164 mesh.delete_vertex(vhandle[0],
false);
165 mesh.delete_vertex(vhandle[1],
false);
166 mesh.delete_vertex(vhandle[2],
false);
167 mesh.delete_vertex(vhandle[3],
false);
171 mesh.garbage_collection();
176 std::cerr <<
"Cannot write mesh to file 'output.off'" << std::endl;
180 catch( std::exception& x )
182 std::cerr << x.what() << std::endl;
Add status to mesh item (all items)
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.