From 69000a6af75bb994f8211bbd35f7a00c61012f21 Mon Sep 17 00:00:00 2001 From: cignoni Date: Tue, 9 Oct 2012 08:43:35 +0000 Subject: [PATCH] Yet another big cleaning pass to the samples --- .../aabb_binary_tree/aabb_binary_tree.cpp | 31 ++++++--- .../aabb_binary_tree/aabb_binary_tree.pro | 9 +-- apps/sample/common.pri | 6 ++ apps/sample/polygonmesh_base/polygonmesh.cpp | 63 +++++++------------ .../polygonmesh_base/polygonmesh_base.pro | 11 +--- .../trimesh_attribute/trimesh_attribute.cpp | 20 ++---- .../trimesh_attribute/trimesh_attribute.pro | 11 +--- .../trimesh_ball_pivoting.cpp | 37 ++++++----- .../trimesh_ball_pivoting.pro | 11 +--- apps/sample/trimesh_base/trimesh_base.pro | 11 +--- .../trimesh_clustering/trimesh_clustering.pro | 11 +--- apps/sample/trimesh_edge/trimesh_edge.cpp | 25 ++++---- apps/sample/trimesh_edge/trimesh_edge.pro | 10 +-- apps/sample/trimesh_hole/trimesh_hole.cpp | 23 +++++++ apps/sample/trimesh_hole/trimesh_hole.pro | 10 +-- .../trimesh_intersection.cpp | 22 +++++++ .../trimesh_intersection.pro | 5 +- .../trimesh_isosurface/trimesh_isosurface.cpp | 33 +++++++--- .../trimesh_isosurface/trimesh_isosurface.pro | 6 +- apps/sample/trimesh_join/trimesh_join.cpp | 30 ++++++--- apps/sample/trimesh_join/trimesh_join.pro | 11 +--- .../sample/trimesh_optional/mesh_definition.h | 36 ----------- .../trimesh_optional/trimesh_optional.cpp | 57 ++++++++++++++--- .../trimesh_optional/trimesh_optional.pro | 11 +--- apps/sample/trimesh_refine/trimesh_refine.pro | 13 +--- apps/sample/trimesh_smooth/trimesh_smooth.pro | 9 +-- .../trimesh_topology/trimesh_topology.pro | 11 +--- 27 files changed, 250 insertions(+), 283 deletions(-) create mode 100644 apps/sample/common.pri delete mode 100644 apps/sample/trimesh_optional/mesh_definition.h diff --git a/apps/sample/aabb_binary_tree/aabb_binary_tree.cpp b/apps/sample/aabb_binary_tree/aabb_binary_tree.cpp index e50de8c0..e07ff678 100644 --- a/apps/sample/aabb_binary_tree/aabb_binary_tree.cpp +++ b/apps/sample/aabb_binary_tree/aabb_binary_tree.cpp @@ -1,20 +1,35 @@ -// standard headers +/**************************************************************************** +* VCGLib o o * +* Visual and Computer Graphics Library o o * +* _ O _ * +* Copyright(C) 2004-2012 \/)\/ * +* Visual Computing Lab /\/| * +* ISTI - Italian National Research Council | * +* \ * +* All rights reserved. * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * +* for more details. * +* * +****************************************************************************/ #include -// stl headers -#include - -// vcg headers - -#include #include +#include #include #include #include #include #include #include - #include typedef float AScalarType; diff --git a/apps/sample/aabb_binary_tree/aabb_binary_tree.pro b/apps/sample/aabb_binary_tree/aabb_binary_tree.pro index 6fbedf2e..e3762600 100644 --- a/apps/sample/aabb_binary_tree/aabb_binary_tree.pro +++ b/apps/sample/aabb_binary_tree/aabb_binary_tree.pro @@ -1,10 +1,3 @@ -###################################################################### -# Automatically generated by qmake (2.00a) ven 24. giu 14:14:20 2005 -###################################################################### - +include(../common.pri) TARGET = aabb_binary_tree -DEPENDPATH += . -INCLUDEPATH += . ../../.. -CONFIG += console -TEMPLATE = app SOURCES += aabb_binary_tree.cpp diff --git a/apps/sample/common.pri b/apps/sample/common.pri new file mode 100644 index 00000000..1dfbea12 --- /dev/null +++ b/apps/sample/common.pri @@ -0,0 +1,6 @@ +DEPENDPATH += . +INCLUDEPATH += . ../../.. +CONFIG += console stl +TEMPLATE = app +# Mac specific Config required to avoid to make application bundles +CONFIG -= app_bundle diff --git a/apps/sample/polygonmesh_base/polygonmesh.cpp b/apps/sample/polygonmesh_base/polygonmesh.cpp index 689cb8b9..99191dc0 100644 --- a/apps/sample/polygonmesh_base/polygonmesh.cpp +++ b/apps/sample/polygonmesh_base/polygonmesh.cpp @@ -1,52 +1,37 @@ /**************************************************************************** - * VCGLib o o * - * Visual and Computer Graphics Library o o * - * _ O _ * - * Copyright(C) 2004 \/)\/ * - * Visual Computing Lab /\/| * - * ISTI - Italian National Research Council | * - * \ * - * All rights reserved. * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License as published by * - * the Free Software Foundation; either version 2 of the License, or * - * (at your option) any later version. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * - * for more details. * - * * - ****************************************************************************/ +* VCGLib o o * +* Visual and Computer Graphics Library o o * +* _ O _ * +* Copyright(C) 2004-2012 \/)\/ * +* Visual Computing Lab /\/| * +* ISTI - Italian National Research Council | * +* \ * +* All rights reserved. * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * +* for more details. * +* * +****************************************************************************/ -#include - -/*include the base definition for the vertex */ -#include - -/*include the base definition for the face */ -#include - -/*include the base definition for the edge */ -#include - -/*include the base definition for the trimesh*/ #include /*include the algorithms for updating: */ -#include /* topology */ -#include /* bounding box */ -#include /* normal */ +#include +#include +#include /*include the algorithms for mesh fixing */ #include -/*include the importer from disk*/ #include - -/*include the exporter to disk (in ply)*/ #include /* include the support for polygon meshes (function to convert from/to trimesh)*/ diff --git a/apps/sample/polygonmesh_base/polygonmesh_base.pro b/apps/sample/polygonmesh_base/polygonmesh_base.pro index 320a510d..d5454334 100644 --- a/apps/sample/polygonmesh_base/polygonmesh_base.pro +++ b/apps/sample/polygonmesh_base/polygonmesh_base.pro @@ -1,10 +1,3 @@ -###################################################################### -# Automatically generated by qmake (2.00a) ven 24. giu 14:14:20 2005 -###################################################################### - -TARGET = polygonmesh_base -DEPENDPATH += . -INCLUDEPATH += . ../../.. -CONFIG += console stl -TEMPLATE = app +include(../common.pri) +TARGET = polygonmesh_base SOURCES += polygonmesh.cpp ../../../wrap/ply/plylib.cpp diff --git a/apps/sample/trimesh_attribute/trimesh_attribute.cpp b/apps/sample/trimesh_attribute/trimesh_attribute.cpp index 2796fa74..b4507443 100644 --- a/apps/sample/trimesh_attribute/trimesh_attribute.cpp +++ b/apps/sample/trimesh_attribute/trimesh_attribute.cpp @@ -34,18 +34,11 @@ class MyFace : public vcg::Face< MyUsedTypes, vcg::face::VertexRef, vcg::face class MyMesh : public vcg::tri::TriMesh< std::vector, std::vector > {}; - -float Irradiance(MyMesh::VertexType v){ - // ..... - return 1.0; -} - int main() { - - MyMesh m; //...here m is filled + // add a per-vertex attribute with type float named "Irradiance" MyMesh::PerVertexAttributeHandle ih = vcg::tri::Allocator::AddPerVertexAttribute (m,std::string("Irradiance")); @@ -56,15 +49,15 @@ int main() // add a per-vertex attribute with type bool and no name specified MyMesh::PerVertexAttributeHandle blocked_h = vcg::tri::Allocator::AddPerVertexAttribute (m); - // add a per-vertex attribute with type bool and no name specified + // add a per-face attribute with type bool and no name specified MyMesh::PerFaceAttributeHandle blocked_hf = vcg::tri::Allocator::AddPerFaceAttribute (m); MyMesh::VertexIterator vi; int i = 0; for(vi = m.vert.begin(); vi != m.vert.end(); ++vi,++i){ - ih[vi] = Irradiance(*vi); // [] operator takes a iterator - ih[*vi] = Irradiance(*vi); // or a MyMesh::VertexType object - ih[&*vi]= Irradiance(*vi); // or a pointer to it - ih[i] = Irradiance(*vi); // or an integer index + ih[vi] = 1.0f; // [] operator takes a iterator + ih[*vi] = 1.0f; // or a MyMesh::VertexType object + ih[&*vi]= 1.0f; // or a pointer to it + ih[i] = 1.0f; // or an integer index } // Once created with AddPerVertexAttribute, an handle to the attribute can be obtained as follows @@ -80,7 +73,6 @@ int main() vcg::tri::Allocator::DeletePerVertexAttribute(m,blocked_h); bool res ; - res = vcg::tri::Allocator::IsValidHandle(m,ih);printf("%d\n",res); res = vcg::tri::Allocator::IsValidHandle(m,blocked_hf);printf("%d\n",res); vcg::tri::Allocator::DeletePerVertexAttribute(m,ih); diff --git a/apps/sample/trimesh_attribute/trimesh_attribute.pro b/apps/sample/trimesh_attribute/trimesh_attribute.pro index 4c204169..8da4c00d 100644 --- a/apps/sample/trimesh_attribute/trimesh_attribute.pro +++ b/apps/sample/trimesh_attribute/trimesh_attribute.pro @@ -1,12 +1,3 @@ -###################################################################### -# Automatically generated by qmake (2.00a) ven 24. giu 14:14:20 2005 -###################################################################### -# To solve issue related to slash vs. backslash under cygwin try: -# env MINGW_IN_SHELL=1 qmake -spec win32-g++ - +include(../common.pri) TARGET = trimesh_attribute -DEPENDPATH += . -INCLUDEPATH += . ../../.. -CONFIG += console stl -TEMPLATE = app SOURCES += trimesh_attribute.cpp ../../../wrap/ply/plylib.cpp diff --git a/apps/sample/trimesh_ball_pivoting/trimesh_ball_pivoting.cpp b/apps/sample/trimesh_ball_pivoting/trimesh_ball_pivoting.cpp index c37a4bb6..6a9560bf 100644 --- a/apps/sample/trimesh_ball_pivoting/trimesh_ball_pivoting.cpp +++ b/apps/sample/trimesh_ball_pivoting/trimesh_ball_pivoting.cpp @@ -1,13 +1,25 @@ - -// mesh definition -//#include -//#include -//#include - -#include -#include -#include - +/**************************************************************************** +* VCGLib o o * +* Visual and Computer Graphics Library o o * +* _ O _ * +* Copyright(C) 2004-2012 \/)\/ * +* Visual Computing Lab /\/| * +* ISTI - Italian National Research Council | * +* \ * +* All rights reserved. * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * +* for more details. * +* * +****************************************************************************/ #include #include @@ -20,11 +32,6 @@ #include #include -// std -#include -#include -#include - using namespace vcg; using namespace std; diff --git a/apps/sample/trimesh_ball_pivoting/trimesh_ball_pivoting.pro b/apps/sample/trimesh_ball_pivoting/trimesh_ball_pivoting.pro index 2cf3fb21..f94391c2 100644 --- a/apps/sample/trimesh_ball_pivoting/trimesh_ball_pivoting.pro +++ b/apps/sample/trimesh_ball_pivoting/trimesh_ball_pivoting.pro @@ -1,12 +1,3 @@ -###################################################################### -# Automatically generated by qmake (2.00a) ven 24. giu 14:14:20 2005 -###################################################################### -# To solve issue related to slash vs. backslash under cygwin try: -# env MINGW_IN_SHELL=1 qmake -spec win32-g++ - +include(../common.pri) TARGET = trimesh_ball_pivoting -DEPENDPATH += . -INCLUDEPATH += . ../../.. -CONFIG += console stl -TEMPLATE = app SOURCES += trimesh_ball_pivoting.cpp ../../../wrap/ply/plylib.cpp diff --git a/apps/sample/trimesh_base/trimesh_base.pro b/apps/sample/trimesh_base/trimesh_base.pro index 3b4478ca..20e584c7 100644 --- a/apps/sample/trimesh_base/trimesh_base.pro +++ b/apps/sample/trimesh_base/trimesh_base.pro @@ -1,12 +1,3 @@ -###################################################################### -# Automatically generated by qmake (2.00a) ven 24. giu 14:14:20 2005 -###################################################################### - +include(../common.pri) TARGET = trimesh_base -DEPENDPATH += . -INCLUDEPATH += . ../../.. -CONFIG += console stl -TEMPLATE = app SOURCES += trimesh_base.cpp -# Mac specific Config required to avoid to make application bundles -CONFIG -= app_bundle diff --git a/apps/sample/trimesh_clustering/trimesh_clustering.pro b/apps/sample/trimesh_clustering/trimesh_clustering.pro index bde71b7d..44354378 100644 --- a/apps/sample/trimesh_clustering/trimesh_clustering.pro +++ b/apps/sample/trimesh_clustering/trimesh_clustering.pro @@ -1,12 +1,3 @@ -###################################################################### -# Automatically generated by qmake (2.00a) ven 24. giu 14:14:20 2005 -###################################################################### -# To solve issue related to slash vs. backslash under cygwin try: -# env MINGW_IN_SHELL=1 qmake -spec win32-g++ - +include(../common.pri) TARGET = trimesh_clustering -DEPENDPATH += . -INCLUDEPATH += . ../../.. -CONFIG += console stl -TEMPLATE = app SOURCES += trimesh_clustering.cpp ../../../wrap/ply/plylib.cpp diff --git a/apps/sample/trimesh_edge/trimesh_edge.cpp b/apps/sample/trimesh_edge/trimesh_edge.cpp index 39a36b57..b3dca32f 100644 --- a/apps/sample/trimesh_edge/trimesh_edge.cpp +++ b/apps/sample/trimesh_edge/trimesh_edge.cpp @@ -2,7 +2,7 @@ * VCGLib o o * * Visual and Computer Graphics Library o o * * _ O _ * -* Copyright(C) 2004-2009 \/)\/ * +* Copyright(C) 2004-2012 \/)\/ * * Visual Computing Lab /\/| * * ISTI - Italian National Research Council | * * \ * @@ -20,17 +20,19 @@ * for more details. * * * ****************************************************************************/ -#include -#include -#include +// This sample require gl. +#ifndef GLU_VERSIONS +#ifdef __APPLE__ +#include +#else +#ifdef _WIN32 + #include +#endif +#include +#endif +#endif -#include - -#include -#include - -#include #include #include @@ -41,12 +43,11 @@ // topology computation #include #include +#include #include #include #include -// normals -#include #include #include #include diff --git a/apps/sample/trimesh_edge/trimesh_edge.pro b/apps/sample/trimesh_edge/trimesh_edge.pro index 50a39fbb..ca958971 100644 --- a/apps/sample/trimesh_edge/trimesh_edge.pro +++ b/apps/sample/trimesh_edge/trimesh_edge.pro @@ -1,10 +1,4 @@ +include(../common.pri) TARGET = trimesh_edge -DEPENDPATH += . ../../.. -INCLUDEPATH += . ../../.. -CONFIG += console stl opengl -TEMPLATE = app +CONFIG += opengl SOURCES += trimesh_edge.cpp ../../../wrap/ply/plylib.cpp -HEADERS += ../../../vcg/complex/algorithms/update/topology.h -HEADERS += ../../../wrap/gl/glu_tessellator_cap.h -# Mac specific Config required to avoid to make application bundles -CONFIG -= app_bundle diff --git a/apps/sample/trimesh_hole/trimesh_hole.cpp b/apps/sample/trimesh_hole/trimesh_hole.cpp index 2d693ca2..0fe17a66 100644 --- a/apps/sample/trimesh_hole/trimesh_hole.cpp +++ b/apps/sample/trimesh_hole/trimesh_hole.cpp @@ -1,3 +1,26 @@ +/**************************************************************************** +* VCGLib o o * +* Visual and Computer Graphics Library o o * +* _ O _ * +* Copyright(C) 2004-2012 \/)\/ * +* Visual Computing Lab /\/| * +* ISTI - Italian National Research Council | * +* \ * +* All rights reserved. * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * +* for more details. * +* * +****************************************************************************/ + #include #include #include diff --git a/apps/sample/trimesh_hole/trimesh_hole.pro b/apps/sample/trimesh_hole/trimesh_hole.pro index c795b904..d1c24fba 100644 --- a/apps/sample/trimesh_hole/trimesh_hole.pro +++ b/apps/sample/trimesh_hole/trimesh_hole.pro @@ -1,11 +1,3 @@ -###################################################################### -# Automatically generated by qmake (2.00a) ven 24. giu 14:14:20 2005 -###################################################################### - +include(../common.pri) TARGET = trimesh_hole -DEPENDPATH += . -INCLUDEPATH += . ../../.. -CONFIG += console stl -TEMPLATE = app SOURCES += trimesh_hole.cpp ../../../wrap/ply/plylib.cpp -HEADERS += ../../../wrap/ply/plylib.h diff --git a/apps/sample/trimesh_intersection/trimesh_intersection.cpp b/apps/sample/trimesh_intersection/trimesh_intersection.cpp index d500decc..96b7d1e3 100644 --- a/apps/sample/trimesh_intersection/trimesh_intersection.cpp +++ b/apps/sample/trimesh_intersection/trimesh_intersection.cpp @@ -1,3 +1,25 @@ +/**************************************************************************** +* VCGLib o o * +* Visual and Computer Graphics Library o o * +* _ O _ * +* Copyright(C) 2004-2012 \/)\/ * +* Visual Computing Lab /\/| * +* ISTI - Italian National Research Council | * +* \ * +* All rights reserved. * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * +* for more details. * +* * +****************************************************************************/ #include #include diff --git a/apps/sample/trimesh_intersection/trimesh_intersection.pro b/apps/sample/trimesh_intersection/trimesh_intersection.pro index fade31de..e3b6b91e 100644 --- a/apps/sample/trimesh_intersection/trimesh_intersection.pro +++ b/apps/sample/trimesh_intersection/trimesh_intersection.pro @@ -1,6 +1,3 @@ +include(../common.pri) TARGET = trimesh_intersection -DEPENDPATH += . -INCLUDEPATH += . ../../.. -CONFIG += console stl -TEMPLATE = app SOURCES += trimesh_intersection.cpp ../../../wrap/ply/plylib.cpp diff --git a/apps/sample/trimesh_isosurface/trimesh_isosurface.cpp b/apps/sample/trimesh_isosurface/trimesh_isosurface.cpp index d8128719..565f7efe 100644 --- a/apps/sample/trimesh_isosurface/trimesh_isosurface.cpp +++ b/apps/sample/trimesh_isosurface/trimesh_isosurface.cpp @@ -1,22 +1,35 @@ -#include -#include -#include -#include -#include -#include +/**************************************************************************** +* VCGLib o o * +* Visual and Computer Graphics Library o o * +* _ O _ * +* Copyright(C) 2004-2012 \/)\/ * +* Visual Computing Lab /\/| * +* ISTI - Italian National Research Council | * +* \ * +* All rights reserved. * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * +* for more details. * +* * +****************************************************************************/ #include -#include +#include #include #include #include #include - - using namespace std; using namespace vcg; - typedef float ScalarType; class MyFace; diff --git a/apps/sample/trimesh_isosurface/trimesh_isosurface.pro b/apps/sample/trimesh_isosurface/trimesh_isosurface.pro index 0fed9402..dbd44e21 100644 --- a/apps/sample/trimesh_isosurface/trimesh_isosurface.pro +++ b/apps/sample/trimesh_isosurface/trimesh_isosurface.pro @@ -1,5 +1,3 @@ -INCLUDEPATH += . ../../.. -CONFIG += console stl -TEMPLATE = app -# Input +include(../common.pri) +TARGET = trimesh_isosurface SOURCES += trimesh_isosurface.cpp ../../../wrap/ply/plylib.cpp diff --git a/apps/sample/trimesh_join/trimesh_join.cpp b/apps/sample/trimesh_join/trimesh_join.cpp index 3f51d3ec..66f7acb5 100644 --- a/apps/sample/trimesh_join/trimesh_join.cpp +++ b/apps/sample/trimesh_join/trimesh_join.cpp @@ -1,17 +1,31 @@ -#include - -#include -#include -#include - +/**************************************************************************** +* VCGLib o o * +* Visual and Computer Graphics Library o o * +* _ O _ * +* Copyright(C) 2004-2012 \/)\/ * +* Visual Computing Lab /\/| * +* ISTI - Italian National Research Council | * +* \ * +* All rights reserved. * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * +* for more details. * +* * +****************************************************************************/ #include -#include #include #include #include #include - // input output #include #include diff --git a/apps/sample/trimesh_join/trimesh_join.pro b/apps/sample/trimesh_join/trimesh_join.pro index 87aa5493..60d33ae9 100644 --- a/apps/sample/trimesh_join/trimesh_join.pro +++ b/apps/sample/trimesh_join/trimesh_join.pro @@ -1,12 +1,3 @@ -###################################################################### -# Automatically generated by qmake (2.00a) ven 24. giu 14:14:20 2005 -###################################################################### - +include(../common.pri) TARGET = trimesh_join -DEPENDPATH += . -INCLUDEPATH += . ../../.. -CONFIG += console stl -TEMPLATE = app -HEADERS += ../../../vcg/complex/trimesh/subset.h - SOURCES += trimesh_join.cpp ../../../wrap/ply/plylib.cpp diff --git a/apps/sample/trimesh_optional/mesh_definition.h b/apps/sample/trimesh_optional/mesh_definition.h deleted file mode 100644 index 6acd33d5..00000000 --- a/apps/sample/trimesh_optional/mesh_definition.h +++ /dev/null @@ -1,36 +0,0 @@ -#ifndef _MESH_DEF_ -#define _MESH_DEF_ - -#include -#include -#include -#include - -#include -#include - - - -class CFace; -class CFaceOcf; - -class CVertex; -class CVertexOcf; - - -struct MyUsedTypes: public vcg::UsedTypes::AsVertexType,vcg::Use::AsFaceType>{}; -struct MyUsedTypesOcf: public vcg::UsedTypes::AsVertexType,vcg::Use::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::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 CMesh : public vcg::tri::TriMesh< std::vector, std::vector > {}; -class CMeshOcf : public vcg::tri::TriMesh< vcg::vertex::vector_ocf, vcg::face::vector_ocf > {}; - -#endif diff --git a/apps/sample/trimesh_optional/trimesh_optional.cpp b/apps/sample/trimesh_optional/trimesh_optional.cpp index f279a3fd..e4d1d696 100644 --- a/apps/sample/trimesh_optional/trimesh_optional.cpp +++ b/apps/sample/trimesh_optional/trimesh_optional.cpp @@ -1,8 +1,30 @@ -#include -#include +/**************************************************************************** +* VCGLib o o * +* Visual and Computer Graphics Library o o * +* _ O _ * +* Copyright(C) 2004-2012 \/)\/ * +* Visual Computing Lab /\/| * +* ISTI - Italian National Research Council | * +* \ * +* All rights reserved. * +* * +* This program is free software; you can redistribute it and/or modify * +* it under the terms of the GNU General Public License as published by * +* the Free Software Foundation; either version 2 of the License, or * +* (at your option) any later version. * +* * +* This program is distributed in the hope that it will be useful, * +* but WITHOUT ANY WARRANTY; without even the implied warranty of * +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +* GNU General Public License (http://www.gnu.org/licenses/gpl.txt) * +* for more details. * +* * +****************************************************************************/ +#include + +#include +#include -#include "mesh_definition.h" -#include #include #include #include @@ -10,19 +32,36 @@ #include #include +class CFace; +class CFaceOcf; + +class CVertex; +class CVertexOcf; + +struct MyUsedTypes: public vcg::UsedTypes::AsVertexType,vcg::Use::AsFaceType>{}; +struct MyUsedTypesOcf: public vcg::UsedTypes::AsVertexType,vcg::Use::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::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 CMesh : public vcg::tri::TriMesh< std::vector, std::vector > {}; +class CMeshOcf : public vcg::tri::TriMesh< vcg::vertex::vector_ocf, vcg::face::vector_ocf > {}; + + using namespace vcg; using namespace std; int main(int , char **) { - - - CMesh cm; CMeshOcf cmof; - - tri::Tetrahedron(cm); tri::Tetrahedron(cmof); diff --git a/apps/sample/trimesh_optional/trimesh_optional.pro b/apps/sample/trimesh_optional/trimesh_optional.pro index df3533d5..0661b04e 100644 --- a/apps/sample/trimesh_optional/trimesh_optional.pro +++ b/apps/sample/trimesh_optional/trimesh_optional.pro @@ -1,12 +1,3 @@ -###################################################################### -# Automatically generated by qmake (2.00a) ven 24. giu 14:14:20 2005 -###################################################################### -# To solve issue related to slash vs. backslash under cygwin try: -# env MINGW_IN_SHELL=1 qmake -spec win32-g++ - +include(../common.pri) TARGET = trimesh_optional -DEPENDPATH += . -INCLUDEPATH += . ../../.. -CONFIG += console stl -TEMPLATE = app SOURCES += trimesh_optional.cpp ../../../wrap/ply/plylib.cpp diff --git a/apps/sample/trimesh_refine/trimesh_refine.pro b/apps/sample/trimesh_refine/trimesh_refine.pro index 8a29b514..5446afff 100644 --- a/apps/sample/trimesh_refine/trimesh_refine.pro +++ b/apps/sample/trimesh_refine/trimesh_refine.pro @@ -1,14 +1,3 @@ -###################################################################### -# Automatically generated by qmake (2.00a) ven 24. giu 14:14:20 2005 -###################################################################### -# To solve issue related to slash vs. backslash under cygwin try: -# env MINGW_IN_SHELL=1 qmake -spec win32-g++ - +include(../common.pri) TARGET = trimesh_refine -DEPENDPATH += . -INCLUDEPATH += . ../../.. -CONFIG += console stl -TEMPLATE = app SOURCES += trimesh_refine.cpp ../../../wrap/ply/plylib.cpp -# Mac specific Config required to avoid to make application bundles -CONFIG -= app_bundle diff --git a/apps/sample/trimesh_smooth/trimesh_smooth.pro b/apps/sample/trimesh_smooth/trimesh_smooth.pro index 56de5000..1050639c 100644 --- a/apps/sample/trimesh_smooth/trimesh_smooth.pro +++ b/apps/sample/trimesh_smooth/trimesh_smooth.pro @@ -1,10 +1,3 @@ -###################################################################### -# Automatically generated by qmake (2.00a) ven 24. giu 14:14:20 2005 -###################################################################### - +include(../common.pri) TARGET = trimesh_smooth -DEPENDPATH += . -INCLUDEPATH += . ../../.. -CONFIG += console stl -TEMPLATE = app SOURCES += trimesh_smooth.cpp ../../../wrap/ply/plylib.cpp diff --git a/apps/sample/trimesh_topology/trimesh_topology.pro b/apps/sample/trimesh_topology/trimesh_topology.pro index e695bcbe..409eb9f7 100644 --- a/apps/sample/trimesh_topology/trimesh_topology.pro +++ b/apps/sample/trimesh_topology/trimesh_topology.pro @@ -1,12 +1,3 @@ -###################################################################### -# Automatically generated by qmake (2.00a) ven 24. giu 14:14:20 2005 -###################################################################### - +include(../common.pri) TARGET = trimesh_topology -DEPENDPATH += . -INCLUDEPATH += . ../../.. -CONFIG += console stl -TEMPLATE = app SOURCES += trimesh_topology.cpp -# Mac specific Config required to avoid to make application bundles -CONFIG -= app_bundle