minor corrections for recompiling all the samples and removal of some warnings:
removed deprecated LIBPATH
This commit is contained in:
parent
ef6048e639
commit
d52126591c
|
@ -3,7 +3,6 @@
|
|||
######################################################################
|
||||
|
||||
TARGET = aabb_binary_tree
|
||||
LIBPATH +=
|
||||
DEPENDPATH += .
|
||||
INCLUDEPATH += . ../../..
|
||||
CONFIG += console
|
||||
|
|
|
@ -155,7 +155,7 @@ int main(int argc, char *argv[]) {
|
|||
vcg::tri::io::PlyInfo pi;
|
||||
|
||||
// pm.hedge.reserve(100000);
|
||||
if(false){
|
||||
if(true){
|
||||
/*
|
||||
first way:
|
||||
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
|
||||
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>::RemoveZeroAreaFace(mesh);
|
||||
|
|
|
@ -2,10 +2,9 @@
|
|||
# Automatically generated by qmake (2.00a) ven 24. giu 14:14:20 2005
|
||||
######################################################################
|
||||
|
||||
TARGET = polygonmesh_base
|
||||
LIBPATH +=
|
||||
TARGET = polygonmesh_base
|
||||
DEPENDPATH += .
|
||||
INCLUDEPATH += . ../../..
|
||||
CONFIG += console stl
|
||||
TEMPLATE = app
|
||||
SOURCES += polygonmesh.cpp ../../../wrap/ply/plylib.cpp
|
||||
SOURCES += polygonmesh.cpp ../../../wrap/ply/plylib.cpp
|
||||
|
|
|
@ -16,8 +16,7 @@ SUBDIRS = trimesh_base \
|
|||
trimesh_hole \
|
||||
polygonmesh_base \
|
||||
aabb_binary_tree \
|
||||
edgemesh_grid \
|
||||
trimesh_attribute
|
||||
trimesh_attribute
|
||||
|
||||
sources.files = *.pro
|
||||
sources.path = .
|
||||
|
|
|
@ -5,9 +5,8 @@
|
|||
# env MINGW_IN_SHELL=1 qmake -spec win32-g++
|
||||
|
||||
TARGET = trimesh_attribute
|
||||
LIBPATH +=
|
||||
DEPENDPATH += .
|
||||
INCLUDEPATH += . ../../..
|
||||
CONFIG += console stl
|
||||
TEMPLATE = app
|
||||
SOURCES += trimesh_attribute.cpp ../../../wrap/ply/plylib.cpp
|
||||
SOURCES += trimesh_attribute.cpp ../../../wrap/ply/plylib.cpp
|
||||
|
|
|
@ -5,9 +5,8 @@
|
|||
# env MINGW_IN_SHELL=1 qmake -spec win32-g++
|
||||
|
||||
TARGET = trimesh_ball_pivoting
|
||||
LIBPATH +=
|
||||
DEPENDPATH += .
|
||||
INCLUDEPATH += . ../../..
|
||||
CONFIG += console stl
|
||||
TEMPLATE = app
|
||||
SOURCES += trimesh_ball_pivoting.cpp ../../../wrap/ply/plylib.cpp
|
||||
SOURCES += trimesh_ball_pivoting.cpp ../../../wrap/ply/plylib.cpp
|
||||
|
|
|
@ -3,11 +3,10 @@
|
|||
######################################################################
|
||||
|
||||
TARGET = trimesh_base
|
||||
LIBPATH +=
|
||||
DEPENDPATH += .
|
||||
INCLUDEPATH += . ../../..
|
||||
CONFIG += console stl
|
||||
TEMPLATE = app
|
||||
SOURCES += trimesh_base.cpp ../../../wrap/ply/plylib.cpp
|
||||
# Mac specific Config required to avoid to make application bundles
|
||||
CONFIG -= app_bundle
|
||||
CONFIG -= app_bundle
|
||||
|
|
|
@ -5,9 +5,8 @@
|
|||
# env MINGW_IN_SHELL=1 qmake -spec win32-g++
|
||||
|
||||
TARGET = trimesh_clustering
|
||||
LIBPATH +=
|
||||
DEPENDPATH += .
|
||||
INCLUDEPATH += . ../../..
|
||||
CONFIG += console stl
|
||||
TEMPLATE = app
|
||||
SOURCES += trimesh_clustering.cpp ../../../wrap/ply/plylib.cpp
|
||||
SOURCES += trimesh_clustering.cpp ../../../wrap/ply/plylib.cpp
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#include <vector>
|
||||
#include <iostream>
|
||||
|
||||
#include<vcg/space/triangle3.h>
|
||||
#include<vcg/simplex/vertex/base.h>
|
||||
#include<vcg/simplex/face/base.h>
|
||||
#include<vcg/simplex/face/topology.h>
|
||||
|
@ -60,15 +61,14 @@ template <class MESH>
|
|||
bool NormalTest(typename face::Pos<typename MESH::FaceType> pos)
|
||||
{
|
||||
//giro intorno al vertice e controllo le normali
|
||||
float accum=0;
|
||||
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);
|
||||
face::Pos<typename MESH::FaceType> aux=pos;
|
||||
do{
|
||||
aux.FlipF();
|
||||
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;
|
||||
}while(aux != pos && !aux.IsBorder());
|
||||
|
||||
|
@ -128,7 +128,6 @@ int main(int argc,char ** argv){
|
|||
}
|
||||
AVG=sumA/numA;
|
||||
|
||||
tri::Hole<MyMesh> holeFiller;
|
||||
switch(algorithm)
|
||||
{
|
||||
case 1: tri::Hole<MyMesh>::EarCuttingFill<tri::TrivialEar<MyMesh> >(m,holeSize,false); break;
|
||||
|
|
|
@ -3,10 +3,9 @@
|
|||
######################################################################
|
||||
|
||||
TARGET = trimesh_hole
|
||||
LIBPATH +=
|
||||
DEPENDPATH += .
|
||||
INCLUDEPATH += . ../../..
|
||||
CONFIG += console stl
|
||||
TEMPLATE = app
|
||||
SOURCES += trimesh_hole.cpp ../../../wrap/ply/plylib.cpp
|
||||
HEADERS += ../../../wrap/ply/plylib.h
|
||||
HEADERS += ../../../wrap/ply/plylib.h
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
TARGET = trimesh_intersection
|
||||
LIBPATH +=
|
||||
DEPENDPATH += .
|
||||
INCLUDEPATH += . ../../..
|
||||
CONFIG += console stl
|
||||
TEMPLATE = app
|
||||
SOURCES += trimesh_intersection.cpp ../../../wrap/ply/plylib.cpp
|
||||
SOURCES += trimesh_intersection.cpp ../../../wrap/ply/plylib.cpp
|
||||
|
|
|
@ -2,5 +2,4 @@ INCLUDEPATH += . ../../..
|
|||
CONFIG += console stl
|
||||
TEMPLATE = app
|
||||
# Input
|
||||
HEADERS += trivial_walker.h simple_volume.h
|
||||
SOURCES += trimesh_isosurface.cpp ../../../wrap/ply/plylib.cpp
|
||||
|
|
|
@ -3,11 +3,10 @@
|
|||
######################################################################
|
||||
|
||||
TARGET = trimesh_join
|
||||
LIBPATH +=
|
||||
DEPENDPATH += .
|
||||
INCLUDEPATH += . ../../..
|
||||
CONFIG += console stl
|
||||
TEMPLATE = app
|
||||
HEADERS += ../../../vcg/complex/trimesh/subset.h
|
||||
|
||||
SOURCES += trimesh_join.cpp ../../../wrap/ply/plylib.cpp
|
||||
SOURCES += trimesh_join.cpp ../../../wrap/ply/plylib.cpp
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#ifndef _MESH_DEF_
|
||||
#define _MESH_DEF_
|
||||
|
||||
#include<vcg/complex/trimesh/base.h>
|
||||
#include<vcg/simplex/vertex/base.h>
|
||||
#include<vcg/simplex/face/base.h>
|
||||
#include<vcg/simplex/face/topology.h>
|
||||
|
@ -8,36 +9,28 @@
|
|||
#include<vcg/simplex/vertex/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 CFaceOcf;
|
||||
class CFaceOcc;
|
||||
|
||||
class CVertex;
|
||||
class CVertexOcf;
|
||||
class CVertexOcc;
|
||||
|
||||
|
||||
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 MyUsedTypesOcc: public vcg::UsedTypes<vcg::Use<CVertexOcc>::AsVertexType,vcg::Use<CFaceOcc>::AsFaceType>{};
|
||||
|
||||
// Optional stuff has two suffixes:
|
||||
// OCF Optional Component Fast
|
||||
// OCC Optional Component Compact
|
||||
|
||||
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 CVertexOcc : public vcg::Vertex< MyUsedTypesOcc,vcg::vertex::Coord3f, vcg::vertex::BitFlags,vcg::vertex::Normal3f >{};
|
||||
|
||||
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 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 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 CMeshOcf : public vcg::tri::TriMesh< std::vector<CVertexOcf>, vcg::face::vector_ocf<CFaceOcf> > {};
|
||||
class CMeshOcc : public vcg::tri::TriMesh< vcg::vector_occ<CVertexOcc>, vcg::vector_occ<CFaceOcc > > {};
|
||||
class CMeshOcf : public vcg::tri::TriMesh< vcg::vertex::vector_ocf<CVertexOcf>, vcg::face::vector_ocf<CFaceOcf> > {};
|
||||
|
||||
#endif
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#include<vcg/complex/trimesh/update/topology.h>
|
||||
#include<vcg/complex/trimesh/update/flag.h>
|
||||
#include<vcg/complex/trimesh/update/normal.h>
|
||||
#include<vcg/complex/trimesh/update/bounding.h>
|
||||
#include <vcg/complex/trimesh/refine.h>
|
||||
|
||||
using namespace vcg;
|
||||
|
@ -21,59 +22,73 @@ int main(int , char **)
|
|||
|
||||
CMesh cm;
|
||||
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(cmof);
|
||||
tri::Tetrahedron(cmoc);
|
||||
|
||||
printf("Generated mesh has %i vertices and %i triangular faces\n",cm.vn,cm.fn);
|
||||
|
||||
/// 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.
|
||||
/// 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<CMeshOcf>::FaceFace(cmof);
|
||||
vcg::tri::UpdateTopology<CMeshOcc>::FaceFace(cmoc);
|
||||
|
||||
vcg::tri::UpdateFlags<CMesh >::FaceBorderFromFF(cm);
|
||||
vcg::tri::UpdateFlags<CMeshOcf>::FaceBorderFromFF(cmof);
|
||||
vcg::tri::UpdateFlags<CMeshOcc>::FaceBorderFromFF(cmoc);
|
||||
|
||||
vcg::tri::UpdateNormals<CMesh >::PerVertexNormalized(cm);
|
||||
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]);
|
||||
int t0=0,t1=0,t2=0,t3=0;
|
||||
while(t3-t0<3000)
|
||||
while(t1-t0<200)
|
||||
{
|
||||
t0=clock();
|
||||
Refine(cm,MidPointButterfly<CMesh>(),0);
|
||||
t1=clock();
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -5,9 +5,8 @@
|
|||
# env MINGW_IN_SHELL=1 qmake -spec win32-g++
|
||||
|
||||
TARGET = trimesh_optional
|
||||
LIBPATH +=
|
||||
DEPENDPATH += .
|
||||
INCLUDEPATH += . ../../..
|
||||
CONFIG += console stl
|
||||
TEMPLATE = app
|
||||
SOURCES += trimesh_optional.cpp ../../../wrap/ply/plylib.cpp
|
||||
SOURCES += trimesh_optional.cpp ../../../wrap/ply/plylib.cpp
|
||||
|
|
|
@ -5,7 +5,6 @@
|
|||
# env MINGW_IN_SHELL=1 qmake -spec win32-g++
|
||||
|
||||
TARGET = trimesh_refine
|
||||
LIBPATH +=
|
||||
DEPENDPATH += .
|
||||
INCLUDEPATH += . ../../..
|
||||
CONFIG += console stl
|
||||
|
|
|
@ -3,9 +3,8 @@
|
|||
######################################################################
|
||||
|
||||
TARGET = trimesh_smooth
|
||||
LIBPATH +=
|
||||
DEPENDPATH += .
|
||||
INCLUDEPATH += . ../../..
|
||||
CONFIG += console stl
|
||||
TEMPLATE = app
|
||||
SOURCES += trimesh_smooth.cpp ../../../wrap/ply/plylib.cpp
|
||||
SOURCES += trimesh_smooth.cpp ../../../wrap/ply/plylib.cpp
|
||||
|
|
|
@ -3,9 +3,8 @@
|
|||
######################################################################
|
||||
|
||||
TARGET = trimesh_topology
|
||||
LIBPATH +=
|
||||
DEPENDPATH += .
|
||||
DEPENDPATH += .
|
||||
INCLUDEPATH += . ../../..
|
||||
CONFIG += console stl
|
||||
TEMPLATE = app
|
||||
SOURCES += trimesh_topology.cpp
|
||||
SOURCES += trimesh_topology.cpp
|
||||
|
|
Loading…
Reference in New Issue