Commit fcd768c1 authored by Mike Kremer's avatar Mike Kremer

Adapted example source file to match new refactored namespace structure.

git-svn-id: http://www.openvolumemesh.org/svnrepo/OpenVolumeMesh/trunk@96 66977474-1d4b-4f09-8fe9-267525286df2
parent 232f9c4f
......@@ -6,11 +6,11 @@
#include <OpenVolumeMesh/Geometry/VectorT.hh>
// Include polyhedral mesh kernel
#include <OpenVolumeMesh/PolyhedralMesh/PolyhedralMesh.hh>
#include <OpenVolumeMesh/Mesh/PolyhedralMesh.hh>
// Make some typedefs to facilitate your life
typedef OpenVolumeMesh::Geometry::Vec3f Vec3f;
typedef OpenVolumeMesh::PolyhedralMesh<Vec3f> PolyhedralMeshV3f;
typedef OpenVolumeMesh::GeometryKernel<Vec3f> PolyhedralMeshV3f;
int main(int _argc, char** _argv) {
......@@ -18,43 +18,43 @@ int main(int _argc, char** _argv) {
PolyhedralMeshV3f myMesh;
// Add eight vertices
PolyhedralMeshV3f::VertexHandle v0 = myMesh.add_vertex(Vec3f(-1.0, 0.0, 0.0));
PolyhedralMeshV3f::VertexHandle v1 = myMesh.add_vertex(Vec3f( 0.0, 0.0, 1.0));
PolyhedralMeshV3f::VertexHandle v2 = myMesh.add_vertex(Vec3f( 1.0, 0.0, 0.0));
PolyhedralMeshV3f::VertexHandle v3 = myMesh.add_vertex(Vec3f( 0.0, 0.0,-1.0));
PolyhedralMeshV3f::VertexHandle v4 = myMesh.add_vertex(Vec3f( 0.0, 1.0, 0.0));
OpenVolumeMesh::VertexHandle v0 = myMesh.add_vertex(Vec3f(-1.0, 0.0, 0.0));
OpenVolumeMesh::VertexHandle v1 = myMesh.add_vertex(Vec3f( 0.0, 0.0, 1.0));
OpenVolumeMesh::VertexHandle v2 = myMesh.add_vertex(Vec3f( 1.0, 0.0, 0.0));
OpenVolumeMesh::VertexHandle v3 = myMesh.add_vertex(Vec3f( 0.0, 0.0,-1.0));
OpenVolumeMesh::VertexHandle v4 = myMesh.add_vertex(Vec3f( 0.0, 1.0, 0.0));
std::vector<PolyhedralMeshV3f::VertexHandle> vertices;
std::vector<OpenVolumeMesh::VertexHandle> vertices;
// Add faces
vertices.push_back(v0); vertices.push_back(v1);vertices.push_back(v4);
PolyhedralMeshV3f::FaceHandle f0 = myMesh.add_face(vertices);
OpenVolumeMesh::FaceHandle f0 = myMesh.add_face(vertices);
vertices.clear();
vertices.push_back(v1); vertices.push_back(v2);vertices.push_back(v4);
PolyhedralMeshV3f::FaceHandle f1 = myMesh.add_face(vertices);
OpenVolumeMesh::FaceHandle f1 = myMesh.add_face(vertices);
vertices.clear();
vertices.push_back(v0); vertices.push_back(v1);vertices.push_back(v2);
PolyhedralMeshV3f::FaceHandle f2 = myMesh.add_face(vertices);
OpenVolumeMesh::FaceHandle f2 = myMesh.add_face(vertices);
vertices.clear();
vertices.push_back(v0); vertices.push_back(v4);vertices.push_back(v2);
PolyhedralMeshV3f::FaceHandle f3 = myMesh.add_face(vertices);
OpenVolumeMesh::FaceHandle f3 = myMesh.add_face(vertices);
vertices.clear();
vertices.push_back(v0); vertices.push_back(v4);vertices.push_back(v3);
PolyhedralMeshV3f::FaceHandle f4 = myMesh.add_face(vertices);
OpenVolumeMesh::FaceHandle f4 = myMesh.add_face(vertices);
vertices.clear();
vertices.push_back(v2); vertices.push_back(v3);vertices.push_back(v4);
PolyhedralMeshV3f::FaceHandle f5 = myMesh.add_face(vertices);
OpenVolumeMesh::FaceHandle f5 = myMesh.add_face(vertices);
vertices.clear();
vertices.push_back(v0); vertices.push_back(v2);vertices.push_back(v3);
PolyhedralMeshV3f::FaceHandle f6 = myMesh.add_face(vertices);
OpenVolumeMesh::FaceHandle f6 = myMesh.add_face(vertices);
std::vector<PolyhedralMeshV3f::HalfFaceHandle> halffaces;
std::vector<OpenVolumeMesh::HalfFaceHandle> halffaces;
// Add first tetrahedron
halffaces.push_back(myMesh.halfface_handle(f0, 1));
......@@ -72,11 +72,11 @@ int main(int _argc, char** _argv) {
myMesh.add_cell(halffaces);
// Print positions of vertices to std out
for(PolyhedralMeshV3f::VertexIter v_it = myMesh.vertices_begin();
for(OpenVolumeMesh::VertexIter v_it = myMesh.vertices_begin();
v_it != myMesh.vertices_end(); ++v_it) {
std::cout << "Position of vertex " << v_it->idx() << ": " <<
myMesh.vertex(*v_it).position() << std::endl;
myMesh.vertex(*v_it) << std::endl;
}
return 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment