minor corrections for recompiling all the samples and removal of some warnings:

removed deprecated LIBPATH
This commit is contained in:
ganovelli 2011-03-31 15:47:27 +00:00
parent ef6048e639
commit d52126591c
19 changed files with 65 additions and 72 deletions

View File

@ -3,7 +3,6 @@
###################################################################### ######################################################################
TARGET = aabb_binary_tree TARGET = aabb_binary_tree
LIBPATH +=
DEPENDPATH += . DEPENDPATH += .
INCLUDEPATH += . ../../.. INCLUDEPATH += . ../../..
CONFIG += console CONFIG += console

View File

@ -155,7 +155,7 @@ int main(int argc, char *argv[]) {
vcg::tri::io::PlyInfo pi; vcg::tri::io::PlyInfo pi;
// pm.hedge.reserve(100000); // pm.hedge.reserve(100000);
if(false){ if(true){
/* /*
first way: first way:
1) read a polygon mesh that will be automatically converted in a triangle mesh tagging 1) read a polygon mesh that will be automatically converted in a triangle mesh tagging
@ -163,7 +163,8 @@ if(false){
2) make some cleaning 2) make some cleaning
3) import the tagged triangle mesh in a polygon mesh 3) import the tagged triangle mesh in a polygon mesh
*/ */
vcg::tri::io::ImporterOBJ<CMesh>::Open(mesh,argv[1],loadmask); // vcg::tri::io::ImporterOBJ<CMesh>::Open(mesh,argv[1],loadmask);
vcg::tri::io::ImporterOFF<CMesh>::Open(mesh,argv[1],loadmask);
vcg::tri::Clean<CMesh>::RemoveUnreferencedVertex(mesh); vcg::tri::Clean<CMesh>::RemoveUnreferencedVertex(mesh);
vcg::tri::Clean<CMesh>::RemoveZeroAreaFace(mesh); vcg::tri::Clean<CMesh>::RemoveZeroAreaFace(mesh);

View File

@ -3,7 +3,6 @@
###################################################################### ######################################################################
TARGET = polygonmesh_base TARGET = polygonmesh_base
LIBPATH +=
DEPENDPATH += . DEPENDPATH += .
INCLUDEPATH += . ../../.. INCLUDEPATH += . ../../..
CONFIG += console stl CONFIG += console stl

View File

@ -16,8 +16,7 @@ SUBDIRS = trimesh_base \
trimesh_hole \ trimesh_hole \
polygonmesh_base \ polygonmesh_base \
aabb_binary_tree \ aabb_binary_tree \
edgemesh_grid \ trimesh_attribute
trimesh_attribute
sources.files = *.pro sources.files = *.pro
sources.path = . sources.path = .

View File

@ -5,7 +5,6 @@
# env MINGW_IN_SHELL=1 qmake -spec win32-g++ # env MINGW_IN_SHELL=1 qmake -spec win32-g++
TARGET = trimesh_attribute TARGET = trimesh_attribute
LIBPATH +=
DEPENDPATH += . DEPENDPATH += .
INCLUDEPATH += . ../../.. INCLUDEPATH += . ../../..
CONFIG += console stl CONFIG += console stl

View File

@ -5,7 +5,6 @@
# env MINGW_IN_SHELL=1 qmake -spec win32-g++ # env MINGW_IN_SHELL=1 qmake -spec win32-g++
TARGET = trimesh_ball_pivoting TARGET = trimesh_ball_pivoting
LIBPATH +=
DEPENDPATH += . DEPENDPATH += .
INCLUDEPATH += . ../../.. INCLUDEPATH += . ../../..
CONFIG += console stl CONFIG += console stl

View File

@ -3,7 +3,6 @@
###################################################################### ######################################################################
TARGET = trimesh_base TARGET = trimesh_base
LIBPATH +=
DEPENDPATH += . DEPENDPATH += .
INCLUDEPATH += . ../../.. INCLUDEPATH += . ../../..
CONFIG += console stl CONFIG += console stl

View File

@ -5,7 +5,6 @@
# env MINGW_IN_SHELL=1 qmake -spec win32-g++ # env MINGW_IN_SHELL=1 qmake -spec win32-g++
TARGET = trimesh_clustering TARGET = trimesh_clustering
LIBPATH +=
DEPENDPATH += . DEPENDPATH += .
INCLUDEPATH += . ../../.. INCLUDEPATH += . ../../..
CONFIG += console stl CONFIG += console stl

View File

@ -1,6 +1,7 @@
#include <vector> #include <vector>
#include <iostream> #include <iostream>
#include<vcg/space/triangle3.h>
#include<vcg/simplex/vertex/base.h> #include<vcg/simplex/vertex/base.h>
#include<vcg/simplex/face/base.h> #include<vcg/simplex/face/base.h>
#include<vcg/simplex/face/topology.h> #include<vcg/simplex/face/topology.h>
@ -60,15 +61,14 @@ template <class MESH>
bool NormalTest(typename face::Pos<typename MESH::FaceType> pos) bool NormalTest(typename face::Pos<typename MESH::FaceType> pos)
{ {
//giro intorno al vertice e controllo le normali //giro intorno al vertice e controllo le normali
float accum=0;
typename MESH::ScalarType thr = 0.0f; typename MESH::ScalarType thr = 0.0f;
typename MESH::CoordType NdP = Normal<typename MESH::FaceType>(*pos.f); typename MESH::CoordType NdP = vcg::Normal<typename MESH::FaceType>(*pos.f);
typename MESH::CoordType tmp, oop, soglia = typename MESH::CoordType(thr,thr,thr); typename MESH::CoordType tmp, oop, soglia = typename MESH::CoordType(thr,thr,thr);
face::Pos<typename MESH::FaceType> aux=pos; face::Pos<typename MESH::FaceType> aux=pos;
do{ do{
aux.FlipF(); aux.FlipF();
aux.FlipE(); aux.FlipE();
oop = Abs(tmp - Normal<typename MESH::FaceType>(*pos.f)); oop = Abs(tmp - ::vcg::Normal<typename MESH::FaceType>(*pos.f));
if(oop < soglia )return false; if(oop < soglia )return false;
}while(aux != pos && !aux.IsBorder()); }while(aux != pos && !aux.IsBorder());
@ -128,7 +128,6 @@ int main(int argc,char ** argv){
} }
AVG=sumA/numA; AVG=sumA/numA;
tri::Hole<MyMesh> holeFiller;
switch(algorithm) switch(algorithm)
{ {
case 1: tri::Hole<MyMesh>::EarCuttingFill<tri::TrivialEar<MyMesh> >(m,holeSize,false); break; case 1: tri::Hole<MyMesh>::EarCuttingFill<tri::TrivialEar<MyMesh> >(m,holeSize,false); break;

View File

@ -3,7 +3,6 @@
###################################################################### ######################################################################
TARGET = trimesh_hole TARGET = trimesh_hole
LIBPATH +=
DEPENDPATH += . DEPENDPATH += .
INCLUDEPATH += . ../../.. INCLUDEPATH += . ../../..
CONFIG += console stl CONFIG += console stl

View File

@ -1,5 +1,4 @@
TARGET = trimesh_intersection TARGET = trimesh_intersection
LIBPATH +=
DEPENDPATH += . DEPENDPATH += .
INCLUDEPATH += . ../../.. INCLUDEPATH += . ../../..
CONFIG += console stl CONFIG += console stl

View File

@ -2,5 +2,4 @@ INCLUDEPATH += . ../../..
CONFIG += console stl CONFIG += console stl
TEMPLATE = app TEMPLATE = app
# Input # Input
HEADERS += trivial_walker.h simple_volume.h
SOURCES += trimesh_isosurface.cpp ../../../wrap/ply/plylib.cpp SOURCES += trimesh_isosurface.cpp ../../../wrap/ply/plylib.cpp

View File

@ -3,7 +3,6 @@
###################################################################### ######################################################################
TARGET = trimesh_join TARGET = trimesh_join
LIBPATH +=
DEPENDPATH += . DEPENDPATH += .
INCLUDEPATH += . ../../.. INCLUDEPATH += . ../../..
CONFIG += console stl CONFIG += console stl

View File

@ -1,6 +1,7 @@
#ifndef _MESH_DEF_ #ifndef _MESH_DEF_
#define _MESH_DEF_ #define _MESH_DEF_
#include<vcg/complex/trimesh/base.h>
#include<vcg/simplex/vertex/base.h> #include<vcg/simplex/vertex/base.h>
#include<vcg/simplex/face/base.h> #include<vcg/simplex/face/base.h>
#include<vcg/simplex/face/topology.h> #include<vcg/simplex/face/topology.h>
@ -8,36 +9,28 @@
#include<vcg/simplex/vertex/component_ocf.h> #include<vcg/simplex/vertex/component_ocf.h>
#include<vcg/simplex/face/component_ocf.h> #include<vcg/simplex/face/component_ocf.h>
#include<vcg/simplex/vertex/component_occ.h>
#include<vcg/simplex/face/component_occ.h>
#include<vcg/complex/trimesh/base.h>
class CFace; class CFace;
class CFaceOcf; class CFaceOcf;
class CFaceOcc;
class CVertex; class CVertex;
class CVertexOcf; class CVertexOcf;
class CVertexOcc;
struct MyUsedTypes: public vcg::UsedTypes<vcg::Use<CVertex>::AsVertexType,vcg::Use<CFace>::AsFaceType>{}; struct MyUsedTypes: public vcg::UsedTypes<vcg::Use<CVertex>::AsVertexType,vcg::Use<CFace>::AsFaceType>{};
struct MyUsedTypesOcf: public vcg::UsedTypes<vcg::Use<CVertexOcf>::AsVertexType,vcg::Use<CFaceOcf>::AsFaceType>{}; struct MyUsedTypesOcf: public vcg::UsedTypes<vcg::Use<CVertexOcf>::AsVertexType,vcg::Use<CFaceOcf>::AsFaceType>{};
struct MyUsedTypesOcc: public vcg::UsedTypes<vcg::Use<CVertexOcc>::AsVertexType,vcg::Use<CFaceOcc>::AsFaceType>{};
// Optional stuff has two suffixes: // Optional stuff has two suffixes:
// OCF Optional Component Fast // OCF Optional Component Fast
// OCC Optional Component Compact // OCC Optional Component Compact
class CVertex : public vcg::Vertex< MyUsedTypes, vcg::vertex::Coord3f, vcg::vertex::BitFlags,vcg::vertex::Normal3f >{}; class CVertex : public vcg::Vertex< MyUsedTypes, vcg::vertex::Coord3f, vcg::vertex::BitFlags,vcg::vertex::Normal3f >{};
class CVertexOcf : public vcg::Vertex< MyUsedTypesOcf,vcg::vertex::Coord3f, vcg::vertex::BitFlags,vcg::vertex::Normal3f,vcg::vertex::Radiusf >{}; class CVertexOcf : public vcg::Vertex< MyUsedTypesOcf,vcg::vertex::InfoOcf,vcg::vertex::Coord3f,vcg::vertex::QualityfOcf, vcg::vertex::BitFlags,vcg::vertex::Normal3f,vcg::vertex::RadiusfOcf >{};
class CVertexOcc : public vcg::Vertex< MyUsedTypesOcc,vcg::vertex::Coord3f, vcg::vertex::BitFlags,vcg::vertex::Normal3f >{};
class CFace : public vcg::Face< MyUsedTypes, vcg::face::FFAdj, vcg::face::VertexRef, vcg::face::BitFlags, vcg::face::Normal3f > {}; class CFace : public vcg::Face< MyUsedTypes, vcg::face::FFAdj, vcg::face::VertexRef, vcg::face::BitFlags, vcg::face::Normal3f > {};
class CFaceOcf : public vcg::Face< MyUsedTypesOcf, vcg::face::InfoOcf, vcg::face::FFAdjOcf, vcg::face::VertexRef, vcg::face::BitFlags, vcg::face::Normal3fOcf > {}; class CFaceOcf : public vcg::Face< MyUsedTypesOcf, vcg::face::InfoOcf, vcg::face::FFAdjOcf, vcg::face::VertexRef, vcg::face::BitFlags, vcg::face::Normal3fOcf > {};
class CFaceOcc : public vcg::Face< MyUsedTypesOcc, vcg::face::FFAdjOcc, vcg::face::VertexRef, vcg::face::BitFlags, vcg::face::Normal3fOcc > {};
class CMesh : public vcg::tri::TriMesh< std::vector<CVertex >, std::vector<CFace > > {}; class CMesh : public vcg::tri::TriMesh< std::vector<CVertex >, std::vector<CFace > > {};
class CMeshOcf : public vcg::tri::TriMesh< std::vector<CVertexOcf>, vcg::face::vector_ocf<CFaceOcf> > {}; class CMeshOcf : public vcg::tri::TriMesh< vcg::vertex::vector_ocf<CVertexOcf>, vcg::face::vector_ocf<CFaceOcf> > {};
class CMeshOcc : public vcg::tri::TriMesh< vcg::vector_occ<CVertexOcc>, vcg::vector_occ<CFaceOcc > > {};
#endif #endif

View File

@ -7,6 +7,7 @@
#include<vcg/complex/trimesh/update/topology.h> #include<vcg/complex/trimesh/update/topology.h>
#include<vcg/complex/trimesh/update/flag.h> #include<vcg/complex/trimesh/update/flag.h>
#include<vcg/complex/trimesh/update/normal.h> #include<vcg/complex/trimesh/update/normal.h>
#include<vcg/complex/trimesh/update/bounding.h>
#include <vcg/complex/trimesh/refine.h> #include <vcg/complex/trimesh/refine.h>
using namespace vcg; using namespace vcg;
@ -21,59 +22,73 @@ int main(int , char **)
CMesh cm; CMesh cm;
CMeshOcf cmof; CMeshOcf cmof;
CMeshOcc cmoc;
CMesh::VertexPointer v = cm.face[0].V(0);
cmoc.face.EnableAttribute<CFaceOcc::NormalType>();
CMeshOcc::FaceIterator fi = vcg::tri::Allocator<CMeshOcc>::AddFaces(cmoc,1);
(*fi).N() = vcg::Point3f(9,9,9);
tri::Tetrahedron(cm); tri::Tetrahedron(cm);
tri::Tetrahedron(cmof); tri::Tetrahedron(cmof);
tri::Tetrahedron(cmoc);
printf("Generated mesh has %i vertices and %i triangular faces\n",cm.vn,cm.fn); printf("Generated mesh has %i vertices and %i triangular faces\n",cm.vn,cm.fn);
/// Calculates both vertex and face normals. /// Calculates both vertex and face normals.
/// The normal of a vertex v is the weigthed average of the normals of the faces incident on v. /// The normal of a vertex v is the weigthed average of the normals of the faces incident on v.
/// normals are not normalized /// normals are not normalized
cmof.face.EnableFFAdjacency();
cmoc.face.EnableAttribute<CFaceOcc::FFAdjType>();
cmof.face.EnableFFAdjacency();
printf("Size of CFace %3i\n",sizeof(CFace));
printf("Size of CFaceOcf %3i\n",sizeof(CFaceOcf));
printf("Size of CFaceOcc %3i\n",sizeof(CFaceOcc));
vcg::tri::UpdateTopology<CMesh >::FaceFace(cm); vcg::tri::UpdateTopology<CMesh >::FaceFace(cm);
vcg::tri::UpdateTopology<CMeshOcf>::FaceFace(cmof); vcg::tri::UpdateTopology<CMeshOcf>::FaceFace(cmof);
vcg::tri::UpdateTopology<CMeshOcc>::FaceFace(cmoc);
vcg::tri::UpdateFlags<CMesh >::FaceBorderFromFF(cm); vcg::tri::UpdateFlags<CMesh >::FaceBorderFromFF(cm);
vcg::tri::UpdateFlags<CMeshOcf>::FaceBorderFromFF(cmof); vcg::tri::UpdateFlags<CMeshOcf>::FaceBorderFromFF(cmof);
vcg::tri::UpdateFlags<CMeshOcc>::FaceBorderFromFF(cmoc);
vcg::tri::UpdateNormals<CMesh >::PerVertexNormalized(cm); vcg::tri::UpdateNormals<CMesh >::PerVertexNormalized(cm);
vcg::tri::UpdateNormals<CMeshOcf>::PerVertexNormalized(cmof); vcg::tri::UpdateNormals<CMeshOcf>::PerVertexNormalized(cmof);
vcg::tri::UpdateNormals<CMeshOcc>::PerVertexNormalized(cmoc);
printf("Normal of face 0 is %f %f %f\n\n",cm.face[0].N()[0],cm.face[0].N()[1],cm.face[0].N()[2]); printf("Normal of face 0 is %f %f %f\n\n",cm.face[0].N()[0],cm.face[0].N()[1],cm.face[0].N()[2]);
int t0=0,t1=0,t2=0,t3=0; int t0=0,t1=0,t2=0,t3=0;
while(t3-t0<3000) while(t1-t0<200)
{ {
t0=clock(); t0=clock();
Refine(cm,MidPointButterfly<CMesh>(),0); Refine(cm,MidPointButterfly<CMesh>(),0);
t1=clock(); t1=clock();
Refine(cmof,MidPointButterfly<CMeshOcf>(),0); Refine(cmof,MidPointButterfly<CMeshOcf>(),0);
t2=clock();
Refine(cmoc,MidPointButterfly<CMeshOcc>(),0);
t3=clock();
printf("Mesh is %i %i in Std:%i Ocf:%i Occ:%i\n",cm.vn,cm.fn,t1-t0,t2-t1,t3-t2);
} }
cmof.vert.EnableRadius();
cmof.vert.EnableQuality();
unsigned int hh = 0;
for(CMeshOcf::VertexIterator vi = cmof.vert.begin(); vi!=cmof.vert.end();++vi,++hh){
if(hh%3==0)
vcg::tri::Allocator<CMeshOcf>::DeleteVertex(cmof,*vi);
}
for(CMeshOcf::VertexIterator vi = cmof.vert.begin(); vi!=cmof.vert.end();++vi)
{
if(!(*vi).IsD())
{
float q =vi->Q();
float r =vi->R();
int ii = vi - cmof.vert.begin();
assert(q==r);
}
}
tri::Allocator<CMeshOcf>::CompactVertexVector(cmof);
tri::UpdateBounding<CMeshOcf>::Box(cmof);
for(CMeshOcf::VertexIterator vi = cmof.vert.begin(); vi!=cmof.vert.end();++vi)
{
if(!(*vi).IsD())
{
float q =vi->Q();
float r =vi->R();
int ii = vi - cmof.vert.begin();
assert(q==r);
}
}
return 0; return 0;
} }

View File

@ -5,7 +5,6 @@
# env MINGW_IN_SHELL=1 qmake -spec win32-g++ # env MINGW_IN_SHELL=1 qmake -spec win32-g++
TARGET = trimesh_optional TARGET = trimesh_optional
LIBPATH +=
DEPENDPATH += . DEPENDPATH += .
INCLUDEPATH += . ../../.. INCLUDEPATH += . ../../..
CONFIG += console stl CONFIG += console stl

View File

@ -5,7 +5,6 @@
# env MINGW_IN_SHELL=1 qmake -spec win32-g++ # env MINGW_IN_SHELL=1 qmake -spec win32-g++
TARGET = trimesh_refine TARGET = trimesh_refine
LIBPATH +=
DEPENDPATH += . DEPENDPATH += .
INCLUDEPATH += . ../../.. INCLUDEPATH += . ../../..
CONFIG += console stl CONFIG += console stl

View File

@ -3,7 +3,6 @@
###################################################################### ######################################################################
TARGET = trimesh_smooth TARGET = trimesh_smooth
LIBPATH +=
DEPENDPATH += . DEPENDPATH += .
INCLUDEPATH += . ../../.. INCLUDEPATH += . ../../..
CONFIG += console stl CONFIG += console stl

View File

@ -3,7 +3,6 @@
###################################################################### ######################################################################
TARGET = trimesh_topology TARGET = trimesh_topology
LIBPATH +=
DEPENDPATH += . DEPENDPATH += .
INCLUDEPATH += . ../../.. INCLUDEPATH += . ../../..
CONFIG += console stl CONFIG += console stl