diff --git a/Apps/Examples/Debug/CMakeLists.txt b/Apps/Examples/Debug/CMakeLists.txt index 16fb6eaef6b5e3f75e17b64682c96a086444db4c..666369655f7e29d3d1665c36ad23d9bf331deb3c 100644 --- a/Apps/Examples/Debug/CMakeLists.txt +++ b/Apps/Examples/Debug/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 2.8) project(examplesD) diff --git a/Apps/Examples/Release/CMakeLists.txt b/Apps/Examples/Release/CMakeLists.txt index ed1f85f1b109f51ef1c24a16d5e119f47bb08178..bb47f66e51a1ab79a75bde9631da3508ed8f1d95 100644 --- a/Apps/Examples/Release/CMakeLists.txt +++ b/Apps/Examples/Release/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 2.8) project(examples) diff --git a/Apps/Examples/clipping.cpp b/Apps/Examples/clipping.cpp index 06d1523b23ef0d5c9a5046023b03128116177601..82bf692da0bddd52545bb73004af9f221a16eca1 100644 --- a/Apps/Examples/clipping.cpp +++ b/Apps/Examples/clipping.cpp @@ -186,10 +186,7 @@ void Clipping::slot_spinBox_GridResolution(int i) void Clipping::slot_pushButton_changePlanesColor() { - QColor NewColor; - QColorDialog ColDialog; - - NewColor = ColDialog.getColor(); + QColor NewColor = QColorDialog::getColor(); int r, g, b; NewColor.getRgb(&r, &g, &b); diff --git a/Apps/Tuto/CMakeLists.txt b/Apps/Tuto/CMakeLists.txt index 60c4e3d4a5aaa8a73f1d921a602d14b4f99c2568..161c5d4766fba67414308e97e87571c78e82651d 100644 --- a/Apps/Tuto/CMakeLists.txt +++ b/Apps/Tuto/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 2.8) project(Tutos) diff --git a/build/CMakeLists.txt b/build/CMakeLists.txt index 5d3ab6b4c8364c63e8d5d8ea4abad08eb3c7076f..57b9f699763dc18b7e6c641b79b29d6fa200e2d4 100644 --- a/build/CMakeLists.txt +++ b/build/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 2.8) project(CGoGN) diff --git a/build/Debug/CMakeLists.txt b/build/Debug/CMakeLists.txt index 24ac94c55b46c4846dd2baf05f96c4369cc7217c..1a8607f15873a924eb37cb04236779a5dd03560e 100644 --- a/build/Debug/CMakeLists.txt +++ b/build/Debug/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 2.8) project(CGoGNDebug) diff --git a/build/Release/CMakeLists.txt b/build/Release/CMakeLists.txt index 512990e979f60a7c84da8e1b7e3949512a36f4df..5c7459ad1a8f38916c065cf2f7a187a3bcfccb99 100644 --- a/build/Release/CMakeLists.txt +++ b/build/Release/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 2.6) +cmake_minimum_required(VERSION 2.8) project(CGoGNRelease) diff --git a/include/Algo/ImplicitHierarchicalMesh/ihm.h b/include/Algo/ImplicitHierarchicalMesh/ihm.h index c59a703458efeb7c96fc26bee8e75f3f38059ed0..7e3caa0c67b7332f959da6e23387f1e4774a09c2 100644 --- a/include/Algo/ImplicitHierarchicalMesh/ihm.h +++ b/include/Algo/ImplicitHierarchicalMesh/ihm.h @@ -25,8 +25,7 @@ #ifndef __IMPLICIT_HIERARCHICAL_MAP__ #define __IMPLICIT_HIERARCHICAL_MAP__ -#include "Topology/map/map2.h" -#include "Topology/generic/embeddedMap2.h" +#include "Topology/map/embeddedMap2.h" namespace CGoGN { @@ -39,7 +38,7 @@ namespace IHM template class AttributeHandler_IHM ; -class ImplicitHierarchicalMap : public EmbeddedMap2 +class ImplicitHierarchicalMap : public EmbeddedMap2 { template friend class AttributeHandler_IHM ; diff --git a/include/Algo/ImplicitHierarchicalMesh/ihm.hpp b/include/Algo/ImplicitHierarchicalMesh/ihm.hpp index 466dbf901ffcaac27f2e67478abc783232532921..466498f7c33504fe046f76bbba056a07add0be9c 100644 --- a/include/Algo/ImplicitHierarchicalMesh/ihm.hpp +++ b/include/Algo/ImplicitHierarchicalMesh/ihm.hpp @@ -253,7 +253,7 @@ inline bool ImplicitHierarchicalMap::foreach_dart_of_cc(Dart d, FunctorType& f, inline void ImplicitHierarchicalMap::splitFace(Dart d, Dart e) { - EmbeddedMap2::splitFace(d, e) ; + EmbeddedMap2::splitFace(d, e) ; if(isOrbitEmbedded(FACE)) { unsigned int cur = m_curLevel ; diff --git a/include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp b/include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp index 1cf221d4c8c8a18bdaa56f8ebbb06fad3859f1af..fa7b42287471b49cfa6347667083f22385e32c27 100644 --- a/include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp +++ b/include/Algo/ImplicitHierarchicalMesh/subdivision3.hpp @@ -297,354 +297,354 @@ Dart subdivideVolumeGen(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& pos std::vector newEdges; //save darts from inner edges newEdges.reserve(50); -// //Second step : deconnect each corner, close each hole, subdivide each new face into 3 -// for (std::vector::iterator edge = oldEdges.begin(); edge != oldEdges.end(); ++edge) -// { -// //std::vector::iterator edge = oldEdges.begin(); -// Dart e = *edge; -// -// Dart f1 = map.phi1(*edge); -// //Dart f2 = map.phi2(f1); -// -// do -// { -// if(map.phi1(map.phi1(map.phi1(e))) != e) -// { -// map.unsewFaces(map.phi1(map.phi1(e))); //remplacer par une boucle qui découd toute la face et non juste une face carre (jusqu'a phi_1(e)) -// } -// -// map.unsewFaces(map.phi1(e)); -// -// -// e = map.phi2(map.phi_1(e)); -// } -// while(e != *edge); -// -// map.closeHole(f1); -// -// //degree du sommet exterieur -// unsigned int cornerDegree = map.Map2::vertexDegree(*edge); -// -// //tourner autour du sommet pour connaitre le brin d'un sommet de valence < cornerDegree -// bool found = false; -// Dart stop = e; -// do -// { -// -// if(map.Map2::vertexDegree(map.phi2(map.phi1(e))) < cornerDegree) -// { -// stop = map.phi2(map.phi1(e)); -// found = true; -// } -// -// e = map.phi2(map.phi_1(e)); -// } -// while(!found && e != *edge); -// -// //si il existe un sommet de degre inferieur au degree du coin -// if(found) -// { -// //chercher le brin de faible degree suivant -// bool found2 = false; -// Dart dd = map.phi1(stop); -// -// do -// { -// if(map.Map2::vertexDegree(dd) < cornerDegree) -// found2 = true; -// else -// dd = map.phi1(dd); -// } -// while(!found2); -// -// //cas de la pyramide -// if(dd == stop) -// { -// //std::cout << "pyramide" << std::endl; -// map.splitFace(dd, map.phi1(map.phi1(dd))); -// } -// else -// { -// map.splitFace(dd, stop); -// -// //calcul de la taille des faces de chaque cote de stop -// if(!( (map.Map2::faceDegree(map.phi_1(stop)) == 3 && map.Map2::faceDegree(map.phi2(map.phi_1(stop))) == 4) || -// (map.Map2::faceDegree(map.phi_1(stop)) == 4 && map.Map2::faceDegree(map.phi2(map.phi_1(stop))) == 3) )) -// { -// //std::cout << "octaedre ou hexaedre" << std::endl; -// -// Dart ne = map.phi_1(stop) ; -// map.cutEdge(ne); -// position[map.phi1(ne)] = volCenter; -// stop = map.phi2(map.phi1(ne)); -// -// bool finished = false; -// Dart it = map.phi2(ne); -// -// do -// { -// //chercher le brin de faible degree suivant -// bool found2 = false; -// Dart dd = map.phi1(it); -// -// do -// { -// if(dd == stop) -// finished = true; -// else if(map.Map2::vertexDegree(dd) < cornerDegree) -// found2 = true; -// else -// dd = map.phi1(dd); -// } -// while(!found2 & !finished); -// -// if(found2) -// { -// map.splitFace(it,dd); -// } -// -// it = map.phi_1(dd); -// -// if(it == stop) -// finished = true; -// -// } -// while(!finished); -// -// } -// else -// { -// //std::cout << "prisme" << std::endl; -// //tester si besoin de fermer f2 (par exemple pas besoin pour hexa... mais pour tet, octa, prisme oui) -// //map.closeHole(f2); -// } -// -// } -// -// } -// //sinon cas du tetraedre -// else -// { -// //std::cout << "tetraedre" << std::endl; -// //tester si besoin de fermer f2 (par exemple pas besoin pour hexa... mais pour tet, octa, prisme oui) -// //map.closeHole(f2); -// } -// -// } -// -// //std::cout << "1ere etape finished" << std::endl; -// -// CellMarker mtf(map, FACE); -// -// //Etape 2 -// for (std::vector >::iterator edges = subdividedfacesT.begin(); edges != subdividedfacesT.end(); ++edges) -// { -// Dart f1 = (*edges).first; -// Dart f2 = (*edges).second; -// -////Fonction isTetrahedron ?? -//// //if(Algo::Modelisation::Tetrahedron::isTetrahedron(map,f2)) -// if( (map.Map2::faceDegree(f2) == 3 && map.Map2::faceDegree(map.phi2(f2)) == 3 && -// map.Map2::faceDegree(map.phi2(map.phi_1(f2))) == 3) && map.Map2::vertexDegree(f2) == 3) -// { //cas du tetrahedre -// -// //std::cout << "ajout d'une face" << std::endl; -// -// if(map.phi3(map.phi2(f2)) == map.phi2(f2)) -// { -// Dart nf = map.newFace(3); -// map.sewVolumes(map.phi2(f2),nf); -// } -// -// if(map.phi2(map.phi3(map.phi2(f2))) == map.phi3(map.phi2(f2))) -// { -// map.sewFaces(map.phi3(map.phi2(f2)), f1); -// } -// } -// else -// { -// if(!mtf.isMarked(f1)) -// { -// mtf.mark(f1); -// -// map.closeHole(f1); -// -// if(map.Map2::faceDegree(map.phi2(f2)) == 3) -// { -// //std::cout << "ajout d'un tetraedre" << std::endl; -// Dart x = Algo::Modelisation::trianguleFace(map, map.phi2(f1)); -// position[x] = volCenter; -// } -// else -// { -// //std::cout << "ajout d'un prisme" << std::endl; -// //Dart x = Algo::Modelisation::extrudeFace(map,position,map.phi2(f1),5.0); -// Dart c = Algo::Modelisation::trianguleFace(map, map.phi2(f1)); -// -// Dart cc = c; -// // cut edges -// do -// { -// -// typename PFP::VEC3 p1 = position[cc] ; -// typename PFP::VEC3 p2 = position[map.phi1(cc)] ; -// -// map.cutEdge(cc); -// -// position[map.phi1(cc)] = (p1 + p2) * typename PFP::REAL(0.5) ; -// -// cc = map.phi2(map.phi_1(cc)); -// }while (cc != c); -// -// // cut faces -// do -// { -// Dart d1 = map.phi1(cc); -// Dart d2 = map.phi_1(cc); -// map.splitFace(d1,d2); -// cc = map.phi2(map.phi_1(cc));//map.Map2::alpha1(cc); -// }while (cc != c); -// -// //merge central faces by removing edges -// bool notFinished=true; -// do -// { -// Dart d1 = map.Map2::alpha1(cc); -// if (d1 == cc) // last edge is pending edge inside of face -// notFinished = false; -// map.deleteFace(cc); -// cc = d1; -// } while (notFinished); -// -// -// map.closeHole(map.phi1(map.phi1(map.phi2(f1)))); -// -// } -// } -// } -// -// } -// -// //std::cout << "2e etape finished" << std::endl; -// -// -// { -// //Third step : 3-sew internal faces -// for (std::vector >::iterator it = subdividedfacesT.begin(); it != subdividedfacesT.end(); ++it) -// { -// Dart f1 = (*it).first; -// Dart f2 = (*it).second; -// -// -// -// if(map.phi3(map.phi2(f1)) == map.phi2(f1) && map.phi3(map.phi2(f2)) == map.phi2(f2)) -// { -// if(map.getEmbedding(VERTEX, map.phi_1(map.phi2(f2))) == map.getEmbedding(VERTEX, map.phi_1(map.phi2(f1)))) -// { -// map.Map3::sewVolumes(map.phi2(f2), map.phi2(f1)); -// } -// else -// { -// -// //id pour toutes les faces interieures -// map.sewVolumes(map.phi2(f2), map.phi2(f1)); -// -// -// } -// -// //Fais a la couture !!!!! -// unsigned int idface = map.getNewFaceId(); -// map.setFaceId(map.phi2(f1),idface, FACE); -// } -// -// -// //FAIS a la couture !!!!!!! -// //id pour toutes les aretes exterieurs des faces quadrangulees -// unsigned int idedge = map.getEdgeId(f1); -// map.setEdgeId(map.phi2(f1), idedge, DART); -// map.setEdgeId( map.phi2(f2), idedge, DART); -// -// } -// -// //LA copie de L'id est a gerer avec le sewVolumes normalement !!!!!! -// //id pour les aretes interieurs : (i.e. 16 pour un octa) -// DartMarker mne(map); -// for(std::vector::iterator it = newEdges.begin() ; it != newEdges.end() ; ++it) -// { -// if(!mne.isMarked(*it)) -// { -// unsigned int idedge = map.getNewEdgeId(); -// map.setEdgeId(*it, idedge, EDGE); -// mne.markOrbit(EDGE,*it); -// } -// } -// } -// -// { -// //Third step : 3-sew internal faces -// for (std::vector >::iterator it = subdividedfacesQ.begin(); it != subdividedfacesQ.end(); ++it) -// { -// Dart f1 = (*it).first; -// Dart f2 = (*it).second; -// -// if(map.phi3(map.phi2(f1)) == map.phi2(f1) && map.phi3(map.phi2(f2)) == map.phi2(f2)) -// { -// //id pour toutes les faces interieures -// map.sewVolumes(map.phi2(f2), map.phi2(f1)); -// -// //Fais a la couture !!!!! -// unsigned int idface = map.getNewFaceId(); -// map.setFaceId(map.phi2(f1),idface, FACE); -// } -// -// //FAIS a la couture !!!!!!! -// //id pour toutes les aretes exterieurs des faces quadrangulees -// unsigned int idedge = map.getEdgeId(f1); -// map.setEdgeId(map.phi2(f1), idedge, DART); -// map.setEdgeId( map.phi2(f2), idedge, DART); -// } -// //LA copie de L'id est a gerer avec le sewVolumes normalement !!!!!! -// //id pour les aretes interieurs : (i.e. 16 pour un octa) -// DartMarker mne(map); -// for(std::vector::iterator it = newEdges.begin() ; it != newEdges.end() ; ++it) -// { -// if(!mne.isMarked(*it)) -// { -// unsigned int idedge = map.getNewEdgeId(); -// map.setEdgeId(*it, idedge, EDGE); -// mne.markOrbit(EDGE,*it); -// } -// } -// } -// -// -// //cas tordu pour le prisme -// for (std::vector >::iterator it = subdividedfacesT.begin(); it != subdividedfacesT.end(); ++it) -// { -// Dart f1 = (*it).first; -// Dart f2 = (*it).second; -// -// if( !(map.Map2::faceDegree(f2) == 3 && map.Map2::faceDegree(map.phi2(f2)) == 3 && -// map.Map2::faceDegree(map.phi2(map.phi1(f2))) == 3 && map.Map2::faceDegree(map.phi2(map.phi_1(f2))) == 3)) -// { -// -// -// if(map.phi2(map.phi1(map.phi1(map.phi2(f1)))) == map.phi3(map.phi2(map.phi1(map.phi1(map.phi2(f1))))) && -// map.phi2(map.phi3(map.phi2(map.phi3(map.phi2(map.phi3(map.phi2(map.phi2(map.phi1(map.phi1(map.phi2(f1))))))))))) == -// map.phi3(map.phi2(map.phi3(map.phi2(map.phi3(map.phi2(map.phi3(map.phi2(map.phi2(map.phi1(map.phi1(map.phi2(f1)))))))))))) -// ) -// { -// map.sewVolumes(map.phi2(map.phi1(map.phi1(map.phi2(f1)))), -// map.phi2(map.phi3(map.phi2(map.phi3(map.phi2(map.phi3(map.phi1(map.phi1(map.phi2(f1)))))))))); -// } -// -// } -// -// } -// -// -// map.setCurrentLevel(cur) ; -// + //Second step : deconnect each corner, close each hole, subdivide each new face into 3 + for (std::vector::iterator edge = oldEdges.begin(); edge != oldEdges.end(); ++edge) + { + //std::vector::iterator edge = oldEdges.begin(); + Dart e = *edge; + + Dart f1 = map.phi1(*edge); + //Dart f2 = map.phi2(f1); + + do + { + if(map.phi1(map.phi1(map.phi1(e))) != e) + { + map.unsewFaces(map.phi1(map.phi1(e))); //remplacer par une boucle qui découd toute la face et non juste une face carre (jusqu'a phi_1(e)) + } + + map.unsewFaces(map.phi1(e)); + + + e = map.phi2(map.phi_1(e)); + } + while(e != *edge); + + map.closeHole(f1); + + //degree du sommet exterieur + unsigned int cornerDegree = map.Map2::vertexDegree(*edge); + + //tourner autour du sommet pour connaitre le brin d'un sommet de valence < cornerDegree + bool found = false; + Dart stop = e; + do + { + + if(map.Map2::vertexDegree(map.phi2(map.phi1(e))) < cornerDegree) + { + stop = map.phi2(map.phi1(e)); + found = true; + } + + e = map.phi2(map.phi_1(e)); + } + while(!found && e != *edge); + + //si il existe un sommet de degre inferieur au degree du coin + if(found) + { + //chercher le brin de faible degree suivant + bool found2 = false; + Dart dd = map.phi1(stop); + + do + { + if(map.Map2::vertexDegree(dd) < cornerDegree) + found2 = true; + else + dd = map.phi1(dd); + } + while(!found2); + + //cas de la pyramide + if(dd == stop) + { + //std::cout << "pyramide" << std::endl; + map.splitFace(dd, map.phi1(map.phi1(dd))); + } + else + { + map.splitFace(dd, stop); + + //calcul de la taille des faces de chaque cote de stop + if(!( (map.Map2::faceDegree(map.phi_1(stop)) == 3 && map.Map2::faceDegree(map.phi2(map.phi_1(stop))) == 4) || + (map.Map2::faceDegree(map.phi_1(stop)) == 4 && map.Map2::faceDegree(map.phi2(map.phi_1(stop))) == 3) )) + { + //std::cout << "octaedre ou hexaedre" << std::endl; + + Dart ne = map.phi_1(stop) ; + map.cutEdge(ne); + position[map.phi1(ne)] = volCenter; + stop = map.phi2(map.phi1(ne)); + + bool finished = false; + Dart it = map.phi2(ne); + + do + { + //chercher le brin de faible degree suivant + bool found2 = false; + Dart dd = map.phi1(it); + + do + { + if(dd == stop) + finished = true; + else if(map.Map2::vertexDegree(dd) < cornerDegree) + found2 = true; + else + dd = map.phi1(dd); + } + while(!found2 & !finished); + + if(found2) + { + map.splitFace(it,dd); + } + + it = map.phi_1(dd); + + if(it == stop) + finished = true; + + } + while(!finished); + + } + else + { + //std::cout << "prisme" << std::endl; + //tester si besoin de fermer f2 (par exemple pas besoin pour hexa... mais pour tet, octa, prisme oui) + //map.closeHole(f2); + } + + } + + } + //sinon cas du tetraedre + else + { + //std::cout << "tetraedre" << std::endl; + //tester si besoin de fermer f2 (par exemple pas besoin pour hexa... mais pour tet, octa, prisme oui) + //map.closeHole(f2); + } + + } + + //std::cout << "1ere etape finished" << std::endl; + + CellMarker mtf(map, FACE); + + //Etape 2 + for (std::vector >::iterator edges = subdividedfacesT.begin(); edges != subdividedfacesT.end(); ++edges) + { + Dart f1 = (*edges).first; + Dart f2 = (*edges).second; + +//Fonction isTetrahedron ?? +// //if(Algo::Modelisation::Tetrahedron::isTetrahedron(map,f2)) + if( (map.Map2::faceDegree(f2) == 3 && map.Map2::faceDegree(map.phi2(f2)) == 3 && + map.Map2::faceDegree(map.phi2(map.phi_1(f2))) == 3) && map.Map2::vertexDegree(f2) == 3) + { //cas du tetrahedre + + //std::cout << "ajout d'une face" << std::endl; + + if(map.phi3(map.phi2(f2)) == map.phi2(f2)) + { + Dart nf = map.newFace(3); + map.sewVolumes(map.phi2(f2),nf); + } + + if(map.phi2(map.phi3(map.phi2(f2))) == map.phi3(map.phi2(f2))) + { + map.sewFaces(map.phi3(map.phi2(f2)), f1); + } + } + else + { + if(!mtf.isMarked(f1)) + { + mtf.mark(f1); + + map.closeHole(f1); + + if(map.Map2::faceDegree(map.phi2(f2)) == 3) + { + //std::cout << "ajout d'un tetraedre" << std::endl; + Dart x = Algo::Modelisation::trianguleFace(map, map.phi2(f1)); + position[x] = volCenter; + } + else + { + //std::cout << "ajout d'un prisme" << std::endl; + //Dart x = Algo::Modelisation::extrudeFace(map,position,map.phi2(f1),5.0); + Dart c = Algo::Modelisation::trianguleFace(map, map.phi2(f1)); + + Dart cc = c; + // cut edges + do + { + + typename PFP::VEC3 p1 = position[cc] ; + typename PFP::VEC3 p2 = position[map.phi1(cc)] ; + + map.cutEdge(cc); + + position[map.phi1(cc)] = (p1 + p2) * typename PFP::REAL(0.5) ; + + cc = map.phi2(map.phi_1(cc)); + }while (cc != c); + + // cut faces + do + { + Dart d1 = map.phi1(cc); + Dart d2 = map.phi_1(cc); + map.splitFace(d1,d2); + cc = map.phi2(map.phi_1(cc));//map.Map2::alpha1(cc); + }while (cc != c); + + //merge central faces by removing edges + bool notFinished=true; + do + { + Dart d1 = map.Map2::alpha1(cc); + if (d1 == cc) // last edge is pending edge inside of face + notFinished = false; + map.deleteFace(cc); + cc = d1; + } while (notFinished); + + + map.closeHole(map.phi1(map.phi1(map.phi2(f1)))); + + } + } + } + + } + + //std::cout << "2e etape finished" << std::endl; + + + { + //Third step : 3-sew internal faces + for (std::vector >::iterator it = subdividedfacesT.begin(); it != subdividedfacesT.end(); ++it) + { + Dart f1 = (*it).first; + Dart f2 = (*it).second; + + + + if(map.phi3(map.phi2(f1)) == map.phi2(f1) && map.phi3(map.phi2(f2)) == map.phi2(f2)) + { + if(map.getEmbedding(VERTEX, map.phi_1(map.phi2(f2))) == map.getEmbedding(VERTEX, map.phi_1(map.phi2(f1)))) + { + map.Map3::sewVolumes(map.phi2(f2), map.phi2(f1)); + } + else + { + + //id pour toutes les faces interieures + map.sewVolumes(map.phi2(f2), map.phi2(f1)); + + + } + + //Fais a la couture !!!!! + unsigned int idface = map.getNewFaceId(); + map.setFaceId(map.phi2(f1),idface, FACE); + } + + + //FAIS a la couture !!!!!!! + //id pour toutes les aretes exterieurs des faces quadrangulees + unsigned int idedge = map.getEdgeId(f1); + map.setEdgeId(map.phi2(f1), idedge, DART); + map.setEdgeId( map.phi2(f2), idedge, DART); + + } + + //LA copie de L'id est a gerer avec le sewVolumes normalement !!!!!! + //id pour les aretes interieurs : (i.e. 16 pour un octa) + DartMarker mne(map); + for(std::vector::iterator it = newEdges.begin() ; it != newEdges.end() ; ++it) + { + if(!mne.isMarked(*it)) + { + unsigned int idedge = map.getNewEdgeId(); + map.setEdgeId(*it, idedge, EDGE); + mne.markOrbit(EDGE,*it); + } + } + } + + { + //Third step : 3-sew internal faces + for (std::vector >::iterator it = subdividedfacesQ.begin(); it != subdividedfacesQ.end(); ++it) + { + Dart f1 = (*it).first; + Dart f2 = (*it).second; + + if(map.phi3(map.phi2(f1)) == map.phi2(f1) && map.phi3(map.phi2(f2)) == map.phi2(f2)) + { + //id pour toutes les faces interieures + map.sewVolumes(map.phi2(f2), map.phi2(f1)); + + //Fais a la couture !!!!! + unsigned int idface = map.getNewFaceId(); + map.setFaceId(map.phi2(f1),idface, FACE); + } + + //FAIS a la couture !!!!!!! + //id pour toutes les aretes exterieurs des faces quadrangulees + unsigned int idedge = map.getEdgeId(f1); + map.setEdgeId(map.phi2(f1), idedge, DART); + map.setEdgeId( map.phi2(f2), idedge, DART); + } + //LA copie de L'id est a gerer avec le sewVolumes normalement !!!!!! + //id pour les aretes interieurs : (i.e. 16 pour un octa) + DartMarker mne(map); + for(std::vector::iterator it = newEdges.begin() ; it != newEdges.end() ; ++it) + { + if(!mne.isMarked(*it)) + { + unsigned int idedge = map.getNewEdgeId(); + map.setEdgeId(*it, idedge, EDGE); + mne.markOrbit(EDGE,*it); + } + } + } + + + //cas tordu pour le prisme + for (std::vector >::iterator it = subdividedfacesT.begin(); it != subdividedfacesT.end(); ++it) + { + Dart f1 = (*it).first; + Dart f2 = (*it).second; + + if( !(map.Map2::faceDegree(f2) == 3 && map.Map2::faceDegree(map.phi2(f2)) == 3 && + map.Map2::faceDegree(map.phi2(map.phi1(f2))) == 3 && map.Map2::faceDegree(map.phi2(map.phi_1(f2))) == 3)) + { + + + if(map.phi2(map.phi1(map.phi1(map.phi2(f1)))) == map.phi3(map.phi2(map.phi1(map.phi1(map.phi2(f1))))) && + map.phi2(map.phi3(map.phi2(map.phi3(map.phi2(map.phi3(map.phi2(map.phi2(map.phi1(map.phi1(map.phi2(f1))))))))))) == + map.phi3(map.phi2(map.phi3(map.phi2(map.phi3(map.phi2(map.phi3(map.phi2(map.phi2(map.phi1(map.phi1(map.phi2(f1)))))))))))) + ) + { + map.sewVolumes(map.phi2(map.phi1(map.phi1(map.phi2(f1)))), + map.phi2(map.phi3(map.phi2(map.phi3(map.phi2(map.phi3(map.phi1(map.phi1(map.phi2(f1)))))))))); + } + + } + + } + + + map.setCurrentLevel(cur) ; + return subdividedfacesQ.begin()->first; } diff --git a/src/Topology/map/map3.cpp b/src/Topology/map/map3.cpp index ed9d141d17edf97899284b4c76a1febb0201296d..c50c7311cc3423564bf07e1a043fd6e14e3aa963 100644 --- a/src/Topology/map/map3.cpp +++ b/src/Topology/map/map3.cpp @@ -875,11 +875,12 @@ bool Map3::foreach_dart_of_vertex(Dart d, FunctorType& f, unsigned int thread) DartMarkerStore mv(*this,thread); // Lock a marker bool found = false; // Last functor return value - std::list darts_list; //Darts that are traversed + std::vector darts_list; //Darts that are traversed + darts_list.reserve(512); darts_list.push_back(d); //Start with the dart d mv.mark(d); - for(std::list::iterator darts = darts_list.begin(); !found && darts != darts_list.end() ; ++darts) + for(std::vector::iterator darts = darts_list.begin(); !found && darts != darts_list.end() ; ++darts) { Dart dc = *darts; diff --git a/src/Utils/qtgl.cpp b/src/Utils/qtgl.cpp index e9cc62b24d02ca827c5d7989aa8542563acfd30a..f7bcb71c860ec3a0814298676e12e3bca8eaa4ef 100644 --- a/src/Utils/qtgl.cpp +++ b/src/Utils/qtgl.cpp @@ -336,8 +336,8 @@ void GLWidget::keyPressEvent(QKeyEvent* event) m_state_modifier = event->modifiers(); int k = event->key(); -// if ( (k >= 65) && (k <= 91) && !(event->modifiers() & Qt::ShiftModifier) ) -// k += 32; + if ( (k >= 65) && (k <= 91) && !(event->modifiers() & Qt::ShiftModifier) ) + k += 32; if (m_cbs) m_cbs->cb_keyPress(k);