From 1572c7ca1fcca333b5714680cbc18f610ae618c9 Mon Sep 17 00:00:00 2001 From: Thomas Jund Date: Wed, 6 Feb 2013 18:05:45 +0100 Subject: [PATCH] namespace bugs --- .../Algo/BooleanOperator/mergeVertices.hpp | 13 ++++---- include/Algo/Export/exportPov.h | 8 ++--- include/Algo/Import/importSvg.hpp | 8 ++--- include/Algo/MovingObjects/particle_cell_2D.h | 6 ++-- .../Algo/MovingObjects/particle_cell_2D.hpp | 28 ++++++++--------- .../MovingObjects/particle_cell_2D_memo.hpp | 30 +++++++++---------- 6 files changed, 48 insertions(+), 45 deletions(-) diff --git a/include/Algo/BooleanOperator/mergeVertices.hpp b/include/Algo/BooleanOperator/mergeVertices.hpp index 552721a8d..acae96b24 100644 --- a/include/Algo/BooleanOperator/mergeVertices.hpp +++ b/include/Algo/BooleanOperator/mergeVertices.hpp @@ -53,15 +53,16 @@ void mergeVertex(typename PFP::MAP& map, VertexAttribute& po Dart e1 = map.alpha1(e) ; // e1 stores next dart of vertex of e if (e1 == e) notempty = false ; // last dart of vertex of e - else { + else + { map.removeEdgeFromVertex(e) ; // detach e from its vertex } // Searchs where e may be inserted in the vertex of d Dart d1 = d ; do { - if (CGoGN::Algo::BooleanOperator::isBetween(map, positions, e, d, - map.alpha1(d))) break ; + if (isBetween(map, positions, e, d, map.alpha1(d))) + break ; d = map.alpha1(d) ; } while (d != d1) ; @@ -91,8 +92,10 @@ void mergeVertices(typename PFP::MAP& map, VertexAttribute& { if(positions[d1].isNear(positions[d2], precision)) { - if (map.sameVertex(d1,d2)) std::cout << "fusion: sameVertex" << std::endl ; - if (!map.sameVertex(d1,d2)) mergeVertex(map,positions,d1,d2,precision); + if (map.sameVertex(d1,d2)) + std::cout << "fusion: sameVertex" << std::endl ; + if (!map.sameVertex(d1,d2)) + mergeVertex(map,positions,d1,d2,precision); } } } diff --git a/include/Algo/Export/exportPov.h b/include/Algo/Export/exportPov.h index 077384ec9..1ee1483e2 100644 --- a/include/Algo/Export/exportPov.h +++ b/include/Algo/Export/exportPov.h @@ -51,7 +51,7 @@ void exportMeshPlain(std::ofstream& out, typename PFP::MAP& map, VertexAttribute unsigned int nb = map.faceDegree(d); if(nb == 3) - Algo::ExportPov::exportTrianglePlain(out,position[d],position[map.phi1(d)],position[map.phi1(map.phi1(d))]); + exportTrianglePlain(out,position[d],position[map.phi1(d)],position[map.phi1(map.phi1(d))]); else { out << "polygon{ " << nb+1 << std::endl; @@ -115,7 +115,7 @@ void export3MeshPlainSmooth(std::ofstream& out, typename PFP::MAP& map, VertexAt if(!markV.isMarked(dd)) { markV.mark(dd) ; - VEC3 norm = Algo::Geometry::vertexBorderNormal(map,dd,position); + VEC3 norm = Geometry::vertexBorderNormal(map,dd,position); vIndex[vNum] = vCpt++ ; vertices.push_back(vNum) ; @@ -222,7 +222,7 @@ bool exportScenePov(typename PFP::MAP& map, VertexAttribute& out << "count 100 nearest_count 10 error_bound 0.15 recursion_limit 1 low_error_factor 0.2 gray_threshold 0.0 minimum_reuse 0.015 brightness 1 adc_bailout 0.01/2 normal off media off}" << std::endl; out << "max_trace_level 255}" << std::endl; - Algo::ExportPov::exportMeshPlain(out,map,position,"myMesh",good); + exportMeshPlain(out,map,position,"myMesh",good); out << "object {myMesh" << std::endl; out << "translate <" << translate[0] << "," << translate[1] << "," << translate[2] << ">" << std::endl; @@ -266,7 +266,7 @@ bool exportScenePovSmooth(typename PFP::MAP& map, VertexAttribute(out,map,position,"myMesh",good); + export3MeshPlainSmooth(out,map,position,"myMesh",good); out << "object {myMesh" << std::endl; out << "translate <" << translate[0] << "," << translate[1] << "," << translate[2] << ">" << std::endl; diff --git a/include/Algo/Import/importSvg.hpp b/include/Algo/Import/importSvg.hpp index c70c3ac33..fb92cf136 100644 --- a/include/Algo/Import/importSvg.hpp +++ b/include/Algo/Import/importSvg.hpp @@ -350,7 +350,7 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, VertexAttrib ///////////////////////////////////////////////////////////////////////////////////////////// // Merge near vertices - Algo::BooleanOperator::mergeVertices(map,position,1); + BooleanOperator::mergeVertices(map,position,1); std::cout << "importSVG : Merging of vertices." << std::endl; ///////////////////////////////////////////////////////////////////////////////////////////// @@ -521,7 +521,7 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, VertexAttrib { for (Dart d = map.begin() ; d != map.end() ; map.next(d)) { - if(map.isBoundaryMarked(d)) + if(map.isBoundaryMarked2(d)) { map.fillHole(d); } @@ -557,7 +557,7 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, VertexAttrib for (Dart d = map.begin() ; d != map.end() ; map.next(d)) { - if (!map.isBoundaryMarked(d) && brokenL.isMarked(d)) + if (!map.isBoundaryMarked2(d) && brokenL.isMarked(d)) { map.deleteFace(d,false); } @@ -567,7 +567,7 @@ bool importSVG(typename PFP::MAP& map, const std::string& filename, VertexAttrib for (Dart d = map.begin() ; d != map.end() ; map.next(d)) { - if (map.isBoundaryMarked(d)) + if (map.isBoundaryMarked2(d)) buildingMark.mark(d); } diff --git a/include/Algo/MovingObjects/particle_cell_2D.h b/include/Algo/MovingObjects/particle_cell_2D.h index ce382194b..cafc9f81d 100644 --- a/include/Algo/MovingObjects/particle_cell_2D.h +++ b/include/Algo/MovingObjects/particle_cell_2D.h @@ -29,7 +29,7 @@ enum } ; template -class ParticleCell2D : public MovingObjects::ParticleBase +class ParticleCell2D : public Algo::MovingObjects::ParticleBase { public: typedef typename PFP::MAP MAP ; @@ -46,7 +46,7 @@ public: unsigned int crossCell ; ParticleCell2D(MAP& map, Dart belonging_cell, const VEC3& pos, const TAB_POS& tabPos) : - ParticleBase(pos), + Algo::MovingObjects::ParticleBase(pos), m(map), positionAttribut(tabPos), d(belonging_cell), @@ -105,7 +105,7 @@ public: else { // TODO Des petits pas répétés peuvent faire sortir de la cellule actuelle - this->ParticleBase::move(goal) ; + this->Algo::MovingObjects::ParticleBase::move(goal) ; } } } ; diff --git a/include/Algo/MovingObjects/particle_cell_2D.hpp b/include/Algo/MovingObjects/particle_cell_2D.hpp index 27ce79a16..aba74824e 100644 --- a/include/Algo/MovingObjects/particle_cell_2D.hpp +++ b/include/Algo/MovingObjects/particle_cell_2D.hpp @@ -104,7 +104,7 @@ void ParticleCell2D::vertexState(const VEC3& goal) if (Geometry::isPointOnVertex < PFP > (m, d, positionAttribut, goal)) { this->setState(VERTEX) ; - this->ParticleBase < PFP > ::move(goal) ; + this->Algo::MovingObjects::ParticleBase < PFP > ::move(goal) ; return ; } else @@ -147,7 +147,7 @@ void ParticleCell2D::vertexState(const VEC3& goal) this->setState(VERTEX) ; - this->ParticleBase < PFP > ::move(goal) ; + this->Algo::MovingObjects::ParticleBase < PFP > ::move(goal) ; return ; } } @@ -212,19 +212,19 @@ void ParticleCell2D::edgeState(const VEC3& goal, Geom::Orientation2D sideOf if (!Geometry::isPointOnHalfEdge < PFP > (m, d, positionAttribut, goal)) { - this->ParticleBase < PFP > ::move(positionAttribut[d]) ; + this->Algo::MovingObjects::ParticleBase < PFP > ::move(positionAttribut[d]) ; vertexState(goal) ; return ; } else if (!Geometry::isPointOnHalfEdge < PFP > (m, m.phi2(d), positionAttribut, goal)) { d = m.phi2(d) ; - this->ParticleBase < PFP > ::move(positionAttribut[d]) ; + this->Algo::MovingObjects::ParticleBase < PFP > ::move(positionAttribut[d]) ; vertexState(goal) ; return ; } - this->ParticleBase < PFP > ::move(goal) ; + this->Algo::MovingObjects::ParticleBase < PFP > ::move(goal) ; } template @@ -341,16 +341,16 @@ void ParticleCell2D::faceState(const VEC3& goal) d = m.phi1(d) ; break ; case Geom::ALIGNED : - this->ParticleBase::move(goal) ; + this->Algo::MovingObjects::ParticleBase::move(goal) ; edgeState(goal) ; return ; case Geom::RIGHT : - this->ParticleBase::move(intersectLineEdge(goal, this->getPosition(), d)) ; + this->Algo::MovingObjects::ParticleBase::move(intersectLineEdge(goal, this->getPosition(), d)) ; edgeState(goal, Geom::RIGHT) ; return ; } } while (d != dd) ; - this->ParticleBase::move(goal) ; + this->Algo::MovingObjects::ParticleBase::move(goal) ; this->setState(FACE) ; // m_position = Geometry::faceCentroid(m,d,m_positions); @@ -387,19 +387,19 @@ void ParticleCell2D::faceState(const VEC3& goal) break ; case Geom::ALIGNED : // CGoGNout << "pic" << CGoGNendl; - this->ParticleBase::move(goal) ; + this->Algo::MovingObjects::ParticleBase::move(goal) ; edgeState(goal) ; return ; case Geom::RIGHT : // CGoGNout << "smthg went bad(2) " << m_position << CGoGNendl; - this->ParticleBase::move(intersectLineEdge(goal, this->getPosition(), d)) ; + this->Algo::MovingObjects::ParticleBase::move(intersectLineEdge(goal, this->getPosition(), d)) ; // CGoGNout << " " << m_position << CGoGNendl; edgeState(goal, Geom::RIGHT) ; return ; } } while (d != dd) ; - this->ParticleBase::move(goal) ; + this->Algo::MovingObjects::ParticleBase::move(goal) ; this->setState(FACE) ; return ; } @@ -409,7 +409,7 @@ void ParticleCell2D::faceState(const VEC3& goal) switch (getOrientationEdge(goal, d)) { case Geom::LEFT : - this->ParticleBase::move(goal) ; + this->Algo::MovingObjects::ParticleBase::move(goal) ; this->setState(FACE) ; ; break ; @@ -428,12 +428,12 @@ void ParticleCell2D::faceState(const VEC3& goal) if (wsoe == Geom::ALIGNED) { d = m.phi1(d) ; //to check - this->ParticleBase::move(positionAttribut[d]) ; + this->Algo::MovingObjects::ParticleBase::move(positionAttribut[d]) ; vertexState(goal) ; } else { - this->ParticleBase::move(intersectLineEdge(goal, this->getPosition(), d)) ; + this->Algo::MovingObjects::ParticleBase::move(intersectLineEdge(goal, this->getPosition(), d)) ; edgeState(goal, Geom::RIGHT) ; } break ; diff --git a/include/Algo/MovingObjects/particle_cell_2D_memo.hpp b/include/Algo/MovingObjects/particle_cell_2D_memo.hpp index d4d667dfa..d1dd3f390 100644 --- a/include/Algo/MovingObjects/particle_cell_2D_memo.hpp +++ b/include/Algo/MovingObjects/particle_cell_2D_memo.hpp @@ -59,7 +59,7 @@ std::vector ParticleCell2DMemo::move(const VEC3& goal) return memo_cross.get_markedCells(); } else - this->ParticleBase::move(goal) ; + this->Algo::MovingObjects::ParticleBase::move(goal) ; std::vector res; res.push_back(this->d); @@ -87,7 +87,7 @@ void ParticleCell2DMemo::vertexState(const VEC3& current, CellMarkerMemo (this->m, this->d, this->positionAttribut, current)) { this->setState(VERTEX) ; - this->ParticleBase::move(current) ; + this->Algo::MovingObjects::ParticleBase::move(current) ; return ; } else @@ -130,7 +130,7 @@ void ParticleCell2DMemo::vertexState(const VEC3& current, CellMarkerMemod = this->m.phi2_1(this->d) ; } while (this->getOrientationEdge(current, this->m.phi2_1(this->d)) != Geom::RIGHT && dd_vert != this->d) ; - this->ParticleBase::move(current) ; + this->Algo::MovingObjects::ParticleBase::move(current) ; this->setState(VERTEX) ; return ; } @@ -199,7 +199,7 @@ void ParticleCell2DMemo::edgeState(const VEC3& current, CellMarkerMemo (this->m, this->d, this->positionAttribut, current)) { - this->ParticleBase::move(this->positionAttribut[this->d]) ; + this->Algo::MovingObjects::ParticleBase::move(this->positionAttribut[this->d]) ; vertexState(current,memo_cross) ; return ; } @@ -207,12 +207,12 @@ void ParticleCell2DMemo::edgeState(const VEC3& current, CellMarkerMemo (this->m, this->m.phi2(this->d), this->positionAttribut, current)) { this->d = this->m.phi2(this->d) ; - this->ParticleBase::move(this->positionAttribut[this->d]) ; + this->Algo::MovingObjects::ParticleBase::move(this->positionAttribut[this->d]) ; vertexState(current,memo_cross) ; return ; } - this->ParticleBase::move(current) ; + this->Algo::MovingObjects::ParticleBase::move(current) ; } template @@ -253,20 +253,20 @@ void ParticleCell2DMemo::faceState(const VEC3& current, CellMarkerMemod = this->m.phi1(this->d) ; break ; case Geom::ALIGNED : - this->ParticleBase::move(current) ; + this->Algo::MovingObjects::ParticleBase::move(current) ; edgeState(current,memo_cross) ; return ; case Geom::RIGHT : // CGoGNout << "smthg went bad " << m_position << " " << current << CGoGNendl; // CGoGNout << "d1 " << m_positions[d] << " d2 " << m_positions[m.phi1(d)] << CGoGNendl; - this->ParticleBase::move(this->intersectLineEdge(current, this->getPosition(), this->d)) ; + this->Algo::MovingObjects::ParticleBase::move(this->intersectLineEdge(current, this->getPosition(), this->d)) ; // CGoGNout << " " << m_position << CGoGNendl; edgeState(current,memo_cross, Geom::RIGHT) ; return ; } } while (this->d != dd) ; - this->ParticleBase::move(current); + this->Algo::MovingObjects::ParticleBase::move(current); this->setState(FACE) ; // m_position = Geometry::faceCentroid(m,d,m_positions); @@ -303,19 +303,19 @@ void ParticleCell2DMemo::faceState(const VEC3& current, CellMarkerMemoParticleBase::move(current) ; + this->Algo::MovingObjects::ParticleBase::move(current) ; edgeState(current,memo_cross) ; return ; case Geom::RIGHT : // CGoGNout << "smthg went bad(2) " << m_position << CGoGNendl; - this->ParticleBase::move(this->intersectLineEdge(current, this->getPosition(), this->d)) ; + this->Algo::MovingObjects::ParticleBase::move(this->intersectLineEdge(current, this->getPosition(), this->d)) ; // CGoGNout << " " << m_position << CGoGNendl; edgeState(current,memo_cross ,Geom::RIGHT) ; return ; } } while (this->d != dd) ; - this->ParticleBase::move(current) ; + this->Algo::MovingObjects::ParticleBase::move(current) ; this->setState(FACE) ; return ; } @@ -325,7 +325,7 @@ void ParticleCell2DMemo::faceState(const VEC3& current, CellMarkerMemogetOrientationEdge(current, this->d)) { case Geom::LEFT : - this->ParticleBase::move(current) ; + this->Algo::MovingObjects::ParticleBase::move(current) ; this->setState(FACE) ; ; break ; @@ -345,12 +345,12 @@ void ParticleCell2DMemo::faceState(const VEC3& current, CellMarkerMemod = this->m.phi1(this->d) ; //to check - this->ParticleBase::move(this->positionAttribut[this->d]) ; + this->Algo::MovingObjects::ParticleBase::move(this->positionAttribut[this->d]) ; vertexState(current,memo_cross) ; } else { - this->ParticleBase::move(this->intersectLineEdge(current, this->getPosition(), this->d)) ; + this->Algo::MovingObjects::ParticleBase::move(this->intersectLineEdge(current, this->getPosition(), this->d)) ; edgeState(current,memo_cross, Geom::RIGHT) ; } } -- GitLab