From 773f46658c0920334c29aab8f0bd1c47b5c51067 Mon Sep 17 00:00:00 2001 From: Kenneth Vanhoey Date: Thu, 15 May 2014 18:08:47 +0200 Subject: [PATCH] correctifs passage au typage d'orbite --- include/Algo/Decimation/decimation.hpp | 2 +- include/Algo/Geometry/normal.h | 2 +- include/Algo/ProgressiveMesh/pmesh.h | 8 +++---- include/Algo/ProgressiveMesh/pmesh.hpp | 24 +++++++++---------- include/Algo/Render/GL2/colorPerFaceRender.h | 4 ++-- .../Algo/Render/GL2/colorPerFaceRender.hpp | 6 ++--- include/Algo/Render/GL2/dataPerFaceRender.h | 2 +- include/Algo/Render/GL2/dataPerFaceRender.hpp | 2 +- include/Algo/Selection/collector.h | 2 ++ include/Algo/Selection/collector.hpp | 24 +++++++++---------- include/Topology/generic/cells.h | 2 +- 11 files changed, 40 insertions(+), 38 deletions(-) diff --git a/include/Algo/Decimation/decimation.hpp b/include/Algo/Decimation/decimation.hpp index 21437ac6..1c58aac6 100644 --- a/include/Algo/Decimation/decimation.hpp +++ b/include/Algo/Decimation/decimation.hpp @@ -195,7 +195,7 @@ int decimate( return -1 ; // init failed } - unsigned int nbVertices = map.template getNbOrbits() ; + unsigned int nbVertices = Algo::Topo::getNbOrbits(map) ; bool finished = false ; while(!finished) diff --git a/include/Algo/Geometry/normal.h b/include/Algo/Geometry/normal.h index f6a1c589..3912a376 100644 --- a/include/Algo/Geometry/normal.h +++ b/include/Algo/Geometry/normal.h @@ -71,7 +71,7 @@ void computeNormalVertices(typename PFP::MAP& map, const V_ATT& position, V_ATT& template -typename PFP::REAL computeAngleBetweenNormalsOnEdge(typename PFP::MAP& map, Dart d, const V_ATT& position) ; +typename PFP::REAL computeAngleBetweenNormalsOnEdge(typename PFP::MAP& map, Edge d, const V_ATT& position) ; template void computeAnglesBetweenNormalsOnEdges(typename PFP::MAP& map, const V_ATT& position, E_ATT& angles, unsigned int thread = 0) ; diff --git a/include/Algo/ProgressiveMesh/pmesh.h b/include/Algo/ProgressiveMesh/pmesh.h index 237c55a3..3d847eb7 100644 --- a/include/Algo/ProgressiveMesh/pmesh.h +++ b/include/Algo/ProgressiveMesh/pmesh.h @@ -60,7 +60,7 @@ private: MAP& m_map ; VertexAttribute& position ; - DartMarker& inactiveMarker ; + DartMarker& inactiveMarker ; Algo::Surface::Decimation::Selector* m_selector ; std::vector*> m_approximators ; @@ -82,15 +82,15 @@ private: public: ProgressiveMesh( MAP& map, - DartMarker& inactive, + DartMarker& inactive, Algo::Surface::Decimation::SelectorType s, Algo::Surface::Decimation::ApproximatorType a, VertexAttribute& position ) ; ProgressiveMesh( - MAP& map, DartMarker& inactive, + MAP& map, DartMarker& inactive, Algo::Surface::Decimation::Selector* selector, std::vector*>& approximators, - VertexAttribute& position) ; + VertexAttribute& position) ; ~ProgressiveMesh() ; bool initOk() { return m_initOk ; } diff --git a/include/Algo/ProgressiveMesh/pmesh.hpp b/include/Algo/ProgressiveMesh/pmesh.hpp index 507ab08c..8e6ca5ae 100644 --- a/include/Algo/ProgressiveMesh/pmesh.hpp +++ b/include/Algo/ProgressiveMesh/pmesh.hpp @@ -39,7 +39,7 @@ namespace PMesh template ProgressiveMesh::ProgressiveMesh( MAP& map, - DartMarker& inactive, + DartMarker& inactive, Algo::Surface::Decimation::SelectorType s, Algo::Surface::Decimation::ApproximatorType a, VertexAttribute& pos @@ -87,22 +87,22 @@ ProgressiveMesh::ProgressiveMesh( switch(s) { case Algo::Surface::Decimation::S_MapOrder : { - m_selector = new Algo::Surface::Decimation::EdgeSelector_MapOrder(m_map, positionsTable, m_approximators) ; + m_selector = new Algo::Surface::Decimation::EdgeSelector_MapOrder(m_map, position, m_approximators) ; break ; } case Algo::Surface::Decimation::S_Random : { - m_selector = new Algo::Surface::Decimation::EdgeSelector_Random(m_map, positionsTable, m_approximators) ; + m_selector = new Algo::Surface::Decimation::EdgeSelector_Random(m_map, position, m_approximators) ; break ; } case Algo::Surface::Decimation::S_EdgeLength : { - m_selector = new Algo::Surface::Decimation::EdgeSelector_Length(m_map, positionsTable, m_approximators) ; + m_selector = new Algo::Surface::Decimation::EdgeSelector_Length(m_map, position, m_approximators) ; break ; } case Algo::Surface::Decimation::S_QEM : { - m_selector = new Algo::Surface::Decimation::EdgeSelector_QEM(m_map, positionsTable, m_approximators) ; + m_selector = new Algo::Surface::Decimation::EdgeSelector_QEM(m_map, position, m_approximators) ; break ; } case Algo::Surface::Decimation::S_MinDetail : { - m_selector = new Algo::Surface::Decimation::EdgeSelector_MinDetail(m_map, positionsTable, m_approximators) ; + m_selector = new Algo::Surface::Decimation::EdgeSelector_MinDetail(m_map, position, m_approximators) ; break ; } case Algo::Surface::Decimation::S_Curvature : { - m_selector = new Algo::Surface::Decimation::EdgeSelector_Curvature(m_map, positionsTable, m_approximators) ; + m_selector = new Algo::Surface::Decimation::EdgeSelector_Curvature(m_map, position, m_approximators) ; break ; } } CGoGNout << "..done" << CGoGNendl ; @@ -137,11 +137,11 @@ ProgressiveMesh::ProgressiveMesh( template ProgressiveMesh::ProgressiveMesh( - MAP& map, DartMarker& inactive, + MAP& map, DartMarker& inactive, Algo::Surface::Decimation::Selector* selector, std::vector*>& approximators, - VertexAttribute& position + VertexAttribute& position ) : - m_map(map), m_selector(selector), m_approximators(approximators), positionsTable(position), inactiveMarker(inactive) + m_map(map), m_selector(selector), m_approximators(approximators), position(position), inactiveMarker(inactive) { CGoGNout << " initializing approximators.." << CGoGNflush ; for(typename std::vector*>::iterator it = m_approximators.begin(); it != m_approximators.end(); ++it) @@ -187,7 +187,7 @@ ProgressiveMesh::~ProgressiveMesh() template void ProgressiveMesh::createPM(unsigned int percentWantedVertices) { - unsigned int nbVertices = m_map.template getNbOrbits() ; + unsigned int nbVertices = Algo::Topo::getNbOrbits(m_map) ; unsigned int nbWantedVertices = nbVertices * percentWantedVertices / 100 ; CGoGNout << " creating PM (" << nbVertices << " vertices).." << /* flush */ CGoGNendl ; @@ -543,7 +543,7 @@ float ProgressiveMesh::computeDistance2() float distance = 0; // sum of 2-distance between original vertices and new vertices gotoLevel(0) ; // mesh reconstruction from detail vectors - DartMarker mUpdate(m_map) ; + DartMarker mUpdate(m_map) ; for(Dart d = m_map.begin(); d != m_map.end(); m_map.next(d)) // vertices loop { if(!mUpdate.isMarked(d)) diff --git a/include/Algo/Render/GL2/colorPerFaceRender.h b/include/Algo/Render/GL2/colorPerFaceRender.h index 2ba6fbbc..2c2cd301 100644 --- a/include/Algo/Render/GL2/colorPerFaceRender.h +++ b/include/Algo/Render/GL2/colorPerFaceRender.h @@ -71,7 +71,7 @@ public: */ template void updateVBO(Utils::VBO& vboPosition, Utils::VBO& vboColor, typename PFP::MAP& map, - const VertexAttribute& positions, const AttributeHandler& colorPerXXX) ; + const VertexAttribute& positions, const AttributeHandler& colorPerXXX) ; /** * update drawing buffers @@ -85,7 +85,7 @@ public: */ template void updateVBO(Utils::VBO& vboPosition, Utils::VBO& vboNormal, Utils::VBO& vboColor, typename PFP::MAP& map, - const VertexAttribute& positions, const VertexAttribute& normals, const AttributeHandler& colorPerXXX) ; + const VertexAttribute& positions, const VertexAttribute& normals, const AttributeHandler& colorPerXXX) ; /** diff --git a/include/Algo/Render/GL2/colorPerFaceRender.hpp b/include/Algo/Render/GL2/colorPerFaceRender.hpp index afe0d9c1..0b83e8c7 100644 --- a/include/Algo/Render/GL2/colorPerFaceRender.hpp +++ b/include/Algo/Render/GL2/colorPerFaceRender.hpp @@ -51,7 +51,7 @@ m_nbTris(0) template void ColorPerFaceRender::updateVBO(Utils::VBO& vboPosition, Utils::VBO& vboColor, typename PFP::MAP& map, - const VertexAttribute& positions, const AttributeHandler& colorPerXXX) + const VertexAttribute& positions, const AttributeHandler& colorPerXXX) { typedef typename PFP::VEC3 VEC3; typedef typename PFP::REAL REAL; @@ -101,8 +101,8 @@ void ColorPerFaceRender::updateVBO(Utils::VBO& vboPosition, Utils::VBO& vboColor template void ColorPerFaceRender::updateVBO(Utils::VBO& vboPosition, Utils::VBO& vboNormal, Utils::VBO& vboColor, typename PFP::MAP& map, - const VertexAttribute& positions, const VertexAttribute& normals, - const AttributeHandler& colorPerXXX) + const VertexAttribute& positions, const VertexAttribute& normals, + const AttributeHandler& colorPerXXX) { typedef typename PFP::VEC3 VEC3; typedef typename PFP::REAL REAL; diff --git a/include/Algo/Render/GL2/dataPerFaceRender.h b/include/Algo/Render/GL2/dataPerFaceRender.h index b3fe060d..b3b4df52 100644 --- a/include/Algo/Render/GL2/dataPerFaceRender.h +++ b/include/Algo/Render/GL2/dataPerFaceRender.h @@ -70,7 +70,7 @@ public: */ template void updateVBO(Utils::VBO& vboPosition, Utils::VBO& vboData, typename PFP::MAP& map, - const VertexAttribute& positions, const AttributeHandler& dataPerXXX) ; + const VertexAttribute& positions, const AttributeHandler& dataPerXXX) ; /** * draw diff --git a/include/Algo/Render/GL2/dataPerFaceRender.hpp b/include/Algo/Render/GL2/dataPerFaceRender.hpp index 772a07f9..d03b691e 100644 --- a/include/Algo/Render/GL2/dataPerFaceRender.hpp +++ b/include/Algo/Render/GL2/dataPerFaceRender.hpp @@ -50,7 +50,7 @@ m_nbTris(0) template void DataPerFaceRender::updateVBO(Utils::VBO& vboPosition, Utils::VBO& vboData, typename PFP::MAP& map, - const VertexAttribute& positions, const AttributeHandler& dataPerXXX) + const VertexAttribute& positions, const AttributeHandler& dataPerXXX) { typedef typename PFP::VEC3 VEC3; typedef typename PFP::REAL REAL; diff --git a/include/Algo/Selection/collector.h b/include/Algo/Selection/collector.h index 399259de..b864e58b 100644 --- a/include/Algo/Selection/collector.h +++ b/include/Algo/Selection/collector.h @@ -28,6 +28,8 @@ #include "Container/fakeAttribute.h" #include "Geometry/basic.h" +#include "Topology/generic/traversor/traversor2.h" + /***************************************** * Class hierarchy : * Collector (virtual) diff --git a/include/Algo/Selection/collector.hpp b/include/Algo/Selection/collector.hpp index a8b64fc5..7fb0cb21 100644 --- a/include/Algo/Selection/collector.hpp +++ b/include/Algo/Selection/collector.hpp @@ -119,7 +119,7 @@ void Collector_OneRing::collectAll(Dart d) this->insideVertices.push_back(d); - foreach_incident2(this->map, d, [&] (Edge e) + foreach_incident2(this->map, Vertex(d), [&] (Edge e) { this->insideEdges.push_back(e); this->insideFaces.push_back(e.dart); @@ -133,7 +133,7 @@ void Collector_OneRing::collectBorder(Dart d) this->init(d); this->border.reserve(12); - foreach_incident2(this->map, d, [&] (Face f) + foreach_incident2(this->map, Vertex(d), [&] (Face f) { this->border.push_back(this->map.phi1(f.dart)); }); @@ -146,7 +146,7 @@ typename PFP::REAL Collector_OneRing::computeArea(const VertexAttribute::const_iterator it = this->insideFaces.begin(); it != this->insideFaces.end(); ++it) + for (std::vector::const_iterator it = this->insideFaces.begin(); it != this->insideFaces.end(); ++it) area += Algo::Surface::Geometry::triangleArea(this->map, *it, pos); return area; @@ -160,7 +160,7 @@ void Collector_OneRing::computeNormalCyclesTensor (const VertexAttribute::const_iterator it = this->insideEdges.begin(); it != this->insideEdges.end(); ++it) + for (std::vector::const_iterator it = this->insideEdges.begin(); it != this->insideEdges.end(); ++it) { const VEC3 e = Algo::Surface::Geometry::vectorOutOfDart(this->map, *it, pos) ; tensor += Geom::transposed_vectors_mult(e,e) * edgeangle[*it] * (1 / e.norm()) ; @@ -169,7 +169,7 @@ void Collector_OneRing::computeNormalCyclesTensor (const VertexAttribute::const_iterator it = this->border.begin(); it != this->border.end(); ++it) + for (std::vector::const_iterator it = this->border.begin(); it != this->border.end(); ++it) { const VEC3 e = Algo::Surface::Geometry::vectorOutOfDart(this->map, *it, pos) ; tensor += Geom::transposed_vectors_mult(e,e) * edgeangle[*it] * (1 / e.norm()) ; @@ -186,7 +186,7 @@ void Collector_OneRing::computeNormalCyclesTensor (const VertexAttribute::const_iterator it = this->insideEdges.begin(); it != this->insideEdges.end(); ++it) + for (std::vector::const_iterator it = this->insideEdges.begin(); it != this->insideEdges.end(); ++it) { const VEC3 e = Algo::Surface::Geometry::vectorOutOfDart(this->map, *it, pos) ; const REAL edgeangle = Algo::Surface::Geometry::computeAngleBetweenNormalsOnEdge(this->map, *it, pos) ; @@ -196,7 +196,7 @@ void Collector_OneRing::computeNormalCyclesTensor (const VertexAttribute::const_iterator it = this->border.begin(); it != this->border.end(); ++it) + for (std::vector::const_iterator it = this->border.begin(); it != this->border.end(); ++it) { const VEC3 e = Algo::Surface::Geometry::vectorOutOfDart(this->map, *it, pos) ; const REAL edgeangle = Algo::Surface::Geometry::computeAngleBetweenNormalsOnEdge(this->map, *it, pos) ; @@ -272,7 +272,7 @@ typename PFP::REAL Collector_OneRing_AroundEdge::computeArea(const VertexAt REAL area = 0; - for (std::vector::const_iterator it = this->insideFaces.begin(); it != this->insideFaces.end(); ++it) + for (std::vector::const_iterator it = this->insideFaces.begin(); it != this->insideFaces.end(); ++it) area += Algo::Surface::Geometry::triangleArea(this->map, *it, pos); return area; @@ -286,7 +286,7 @@ void Collector_OneRing_AroundEdge::computeNormalCyclesTensor (const VertexA tensor.zero() ; // collect edges inside the neighborhood - for (std::vector::const_iterator it = this->insideEdges.begin(); it != this->insideEdges.end(); ++it) + for (std::vector::const_iterator it = this->insideEdges.begin(); it != this->insideEdges.end(); ++it) { const VEC3 e = Algo::Surface::Geometry::vectorOutOfDart(this->map, *it, pos) ; tensor += Geom::transposed_vectors_mult(e,e) * edgeangle[*it] * (1 / e.norm()) ; @@ -312,7 +312,7 @@ void Collector_OneRing_AroundEdge::computeNormalCyclesTensor (const VertexA tensor.zero() ; // collect edges inside the neighborhood - for (std::vector::const_iterator it = this->insideEdges.begin(); it != this->insideEdges.end(); ++it) + for (std::vector::const_iterator it = this->insideEdges.begin(); it != this->insideEdges.end(); ++it) { const VEC3 e = Algo::Surface::Geometry::vectorOutOfDart(this->map, *it, pos) ; const REAL edgeangle = Algo::Surface::Geometry::computeAngleBetweenNormalsOnEdge(this->map, *it, pos) ; @@ -518,12 +518,12 @@ void Collector_WithinSphere::computeNormalCyclesTensor(const VertexAttribut tensor += Geom::transposed_vectors_mult(e,e) * edgeangle * (1 / e.norm()) ; } // collect edges crossing the neighborhood's border - for (std::vector::const_iterator it = this->border.begin(); it != this->border.end(); ++it) + for (std::vector::iterator it = this->border.begin(); it != this->border.end(); ++it) { const VEC3 e = Algo::Surface::Geometry::vectorOutOfDart(this->map, *it, pos) ; REAL alpha ; Algo::Surface::Geometry::intersectionSphereEdge(this->map, centerPosition, radius, *it, pos, alpha) ; - const REAL edgeangle = Algo::Surface::Geometry::computeAngleBetweenNormalsOnEdge(this->map, *it, pos) ; + const REAL edgeangle = Algo::Surface::Geometry::computeAngleBetweenNormalsOnEdge(this->map, Edge(*it), pos) ; tensor += Geom::transposed_vectors_mult(e,e) * edgeangle * (1 / e.norm()) * alpha ; } diff --git a/include/Topology/generic/cells.h b/include/Topology/generic/cells.h index 69db1428..a54538cb 100644 --- a/include/Topology/generic/cells.h +++ b/include/Topology/generic/cells.h @@ -47,7 +47,7 @@ public: Cell(): dart() {} /// constructor from Dart - inline Cell(Dart d): dart(d) {} + inline Cell(Dart d): dart(d) {} /// copy constructor inline Cell(const Cell& c): dart(c.dart) {} -- GitLab