45 #include <OpenMesh/Core/IO/MeshIO.hh> 46 #include <OpenMesh/Core/Mesh/PolyMesh_ArrayKernelT.hh> 48 #include <OpenMesh/Core/Mesh/Status.hh> 73 MyMesh::FaceHandle fhandle[6];
87 std::vector<MyMesh::VertexHandle> tmp_face_vhandles;
89 tmp_face_vhandles.clear();
90 tmp_face_vhandles.push_back(vhandle[0]);
91 tmp_face_vhandles.push_back(vhandle[1]);
92 tmp_face_vhandles.push_back(vhandle[2]);
93 tmp_face_vhandles.push_back(vhandle[3]);
94 fhandle[0] = mesh.add_face(tmp_face_vhandles);
96 tmp_face_vhandles.clear();
97 tmp_face_vhandles.push_back(vhandle[7]);
98 tmp_face_vhandles.push_back(vhandle[6]);
99 tmp_face_vhandles.push_back(vhandle[5]);
100 tmp_face_vhandles.push_back(vhandle[4]);
101 fhandle[1] = mesh.add_face(tmp_face_vhandles);
103 tmp_face_vhandles.clear();
104 tmp_face_vhandles.push_back(vhandle[1]);
105 tmp_face_vhandles.push_back(vhandle[0]);
106 tmp_face_vhandles.push_back(vhandle[4]);
107 tmp_face_vhandles.push_back(vhandle[5]);
108 fhandle[2] = mesh.add_face(tmp_face_vhandles);
111 tmp_face_vhandles.clear();
112 tmp_face_vhandles.push_back(vhandle[2]);
113 tmp_face_vhandles.push_back(vhandle[1]);
114 tmp_face_vhandles.push_back(vhandle[5]);
115 tmp_face_vhandles.push_back(vhandle[6]);
116 fhandle[3] = mesh.add_face(tmp_face_vhandles);
119 tmp_face_vhandles.clear();
120 tmp_face_vhandles.push_back(vhandle[3]);
121 tmp_face_vhandles.push_back(vhandle[2]);
122 tmp_face_vhandles.push_back(vhandle[6]);
123 tmp_face_vhandles.push_back(vhandle[7]);
124 fhandle[4] = mesh.add_face(tmp_face_vhandles);
127 tmp_face_vhandles.clear();
128 tmp_face_vhandles.push_back(vhandle[0]);
129 tmp_face_vhandles.push_back(vhandle[3]);
130 tmp_face_vhandles.push_back(vhandle[7]);
131 tmp_face_vhandles.push_back(vhandle[4]);
132 fhandle[5] = mesh.add_face(tmp_face_vhandles);
140 mesh.delete_face(fhandle[0],
false);
142 mesh.delete_face(fhandle[2],
false);
144 mesh.delete_face(fhandle[3],
false);
146 mesh.delete_face(fhandle[4],
false);
148 mesh.delete_face(fhandle[5],
false);
157 mesh.delete_vertex(vhandle[0],
false);
158 mesh.delete_vertex(vhandle[1],
false);
159 mesh.delete_vertex(vhandle[2],
false);
160 mesh.delete_vertex(vhandle[3],
false);
164 mesh.garbage_collection();
169 std::cerr <<
"Cannot write mesh to file 'output.off'" << std::endl;
173 catch( std::exception& x )
175 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.
Add status to mesh item (all items)