From 4ef2e4aeae2cfcf68dcbbe59efdbbeee3600ab86 Mon Sep 17 00:00:00 2001 From: cignoni Date: Fri, 2 Dec 2005 00:49:50 +0000 Subject: [PATCH] Reformatted --- .../trimesh_optional/trimesh_optional.cpp | 38 +++++++++---------- 1 file changed, 18 insertions(+), 20 deletions(-) diff --git a/apps/sample/trimesh_optional/trimesh_optional.cpp b/apps/sample/trimesh_optional/trimesh_optional.cpp index e4541df6..edd37bd9 100644 --- a/apps/sample/trimesh_optional/trimesh_optional.cpp +++ b/apps/sample/trimesh_optional/trimesh_optional.cpp @@ -21,42 +21,40 @@ using namespace vcg; using namespace std; - - class CEdge; // dummy prototype never used class CFace; class CFaceOcf; +class CFaceOcc; class CVertex; class CVertexOcf; -// Opt stuff - +// Optional stuff has two suffixes: // OCF Optional Component Fast +// OCC Optional Component Compact + class CVertex : public VertexSimp2< CVertex, CEdge, CFace, vert::Coord3f, vert::Normal3f >{}; class CVertexOcf : public VertexSimp2< CVertexOcf, CEdge, CFaceOcf, vert::Coord3f, vert::Normal3f >{}; +class CVertexOcc : public VertexSimp2< CVertexOcc, CEdge, CFaceOcc, vert::Coord3f, vert::Normal3f >{}; -class CFace : public FaceSimp2< CVertex, CEdge, CFace, face::FFAdj, face::VertexRef, face::Flag, face::Normal3f > {}; -class CFaceOcf : public FaceSimp2< CVertexOcf, CEdge, CFaceOcf, face::InfoOcf, face::FFAdjOcf, face::VertexRef, face::Flag, face::Normal3fOcf > {}; +class CFace : public FaceSimp2< CVertex, CEdge, CFace, face::FFAdj, face::VertexRef, face::BitFlags, face::Normal3f > {}; +class CFaceOcf : public FaceSimp2< CVertexOcf, CEdge, CFaceOcf, face::InfoOcf, face::FFAdjOcf, face::VertexRef, face::BitFlags, face::Normal3fOcf > {}; +class CFaceOcc : public FaceSimp2< CVertexOcc, CEdge, CFaceOcc, face::FFAdjOcc, face::VertexRef, face::BitFlags, face::Normal3fOcc > {}; -class CMeshOcf : public vcg::tri::TriMesh< vector, face::vector_ocf > {}; -class CMesh : public vcg::tri::TriMesh< vector, vector > {}; +class CMesh : public vcg::tri::TriMesh< vector, vector > {}; +class CMeshOcf : public vcg::tri::TriMesh< vector, face::vector_ocf > {}; +class CMeshOcc : public vcg::tri::TriMesh< vector_occ, vector_occ > {}; -// OCC Optional Component Compact -class CFaceOcc; -class CVertexOcc : public VertexSimp2< CVertexOcc,CEdge, CFaceOcc,vert::Coord3f,vert::Normal3f >{}; -class CFaceOcc : public FaceSimp2< CVertexOcc, CEdge, CFaceOcc,face::VertexRef,vcg::face::Normal3fOcc,face::FFAdjOcc,face::Flag> {}; -class CMeshOcc : public vcg::tri::TriMesh< vector_occ, vector_occ > {}; int main(int , char **) { CMesh cm; - CMeshOcf cmo; + CMeshOcf cmof; CMeshOcc cmoc; tri::Tetrahedron(cm); - tri::Tetrahedron(cmo); + tri::Tetrahedron(cmof); tri::Tetrahedron(cmoc); printf("Generated mesh has %i vertices and %i triangular faces\n",cm.vn,cm.fn); @@ -66,7 +64,7 @@ int main(int , char **) /// normals are not normalized cmoc.face.EnableAttribute(); - cmo.face.EnableFFAdjacency(); + cmof.face.EnableFFAdjacency(); printf("Size of CFace %3i\n",sizeof(CFace)); @@ -74,15 +72,15 @@ int main(int , char **) printf("Size of CFaceOcc %3i\n",sizeof(CFaceOcc)); vcg::tri::UpdateTopology::FaceFace(cm); - vcg::tri::UpdateTopology::FaceFace(cmo); + vcg::tri::UpdateTopology::FaceFace(cmof); vcg::tri::UpdateTopology::FaceFace(cmoc); vcg::tri::UpdateFlags::FaceBorderFromFF(cm); - vcg::tri::UpdateFlags::FaceBorderFromFF(cmo); + vcg::tri::UpdateFlags::FaceBorderFromFF(cmof); vcg::tri::UpdateFlags::FaceBorderFromFF(cmoc); vcg::tri::UpdateNormals::PerVertexNormalized(cm); - vcg::tri::UpdateNormals::PerVertexNormalized(cmo); + vcg::tri::UpdateNormals::PerVertexNormalized(cmof); vcg::tri::UpdateNormals::PerVertexNormalized(cmoc); @@ -93,7 +91,7 @@ int main(int , char **) t0=clock(); Refine(cm,MidPointButterfly(),0); t1=clock(); - Refine(cmo,MidPointButterfly(),0); + Refine(cmof,MidPointButterfly(),0); t2=clock(); Refine(cmoc,MidPointButterfly(),0); t3=clock();