Commit c5a42b54 authored by Pierre Kraemer's avatar Pierre Kraemer

Merge cgogn:~untereiner/CGoGN into nolazy

parents 28268981 8c3a2251
......@@ -84,6 +84,13 @@ bool exportCTM(typename PFP::MAP& the_map, const typename PFP::TVEC3& position,
template <typename PFP>
bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const typename PFP::TVEC3& position, const typename PFP::TVEC3 frame[3], const typename PFP::TVEC3 colorPTM[6], const FunctorSelect& good = SelectorTrue()) ;
/**
* export pout l'InESS
*/
template <typename PFP>
bool exportInESS(typename PFP::MAP& map, const char *filename, const typename PFP::TVEC3& position);
} // namespace Export
} // namespace Algo
......
......@@ -515,6 +515,23 @@ bool exportPLYPTM(typename PFP::MAP& map, const char* filename, const typename P
return true ;
}*/
template <typename PFP>
bool exportInESS(typename PFP::MAP& map, const char *filename, const typename PFP::TVEC3& position)
{
typedef typename PFP::MAP MAP;
typedef typename PFP::VEC3 VEC3;
std::ofstream out(filename, std::ios::out) ;
if (!out.good())
{
CGoGNerr << "Unable to open file " << CGoGNendl ;
return false ;
}
}
} // namespace Export
} // namespace Algo
......
......@@ -94,17 +94,17 @@ public:
virtual void next(Dart& d) ;
virtual bool foreach_dart_of_vertex(Dart d, FunctorType& f) ;
virtual bool foreach_dart_of_vertex(Dart d, FunctorType& f, unsigned int thread = 0) ;
virtual bool foreach_dart_of_edge(Dart d, FunctorType& f) ;
virtual bool foreach_dart_of_edge(Dart d, FunctorType& f, unsigned int thread = 0) ;
bool foreach_dart_of_oriented_face(Dart d, FunctorType& f);
virtual bool foreach_dart_of_face(Dart d, FunctorType& f) ;
bool foreach_dart_of_oriented_face(Dart d, FunctorType& f, unsigned int thread = 0);
virtual bool foreach_dart_of_face(Dart d, FunctorType& f, unsigned int thread = 0) ;
bool foreach_dart_of_oriented_volume(Dart d, FunctorType& f);
virtual bool foreach_dart_of_volume(Dart d, FunctorType& f) ;
bool foreach_dart_of_oriented_volume(Dart d, FunctorType& f, unsigned int thread = 0);
virtual bool foreach_dart_of_volume(Dart d, FunctorType& f, unsigned int thread = 0) ;
virtual bool foreach_dart_of_cc(Dart d, FunctorType& f) ;
virtual bool foreach_dart_of_cc(Dart d, FunctorType& f, unsigned int thread = 0) ;
/***************************************************
* MAP MANIPULATION *
......
......@@ -160,7 +160,7 @@ inline void ImplicitHierarchicalMap::next(Dart& d)
} while(d != Map2::end() && m_dartLevel[d] > m_curLevel) ;
}
inline bool ImplicitHierarchicalMap::foreach_dart_of_vertex(Dart d, FunctorType& f)
inline bool ImplicitHierarchicalMap::foreach_dart_of_vertex(Dart d, FunctorType& f, unsigned int thread)
{
Dart dNext = d;
do
......@@ -172,7 +172,7 @@ inline bool ImplicitHierarchicalMap::foreach_dart_of_vertex(Dart d, FunctorType&
return false;
}
inline bool ImplicitHierarchicalMap::foreach_dart_of_edge(Dart d, FunctorType& f)
inline bool ImplicitHierarchicalMap::foreach_dart_of_edge(Dart d, FunctorType& f, unsigned int thread)
{
if (f(d))
return true;
......@@ -184,7 +184,7 @@ inline bool ImplicitHierarchicalMap::foreach_dart_of_edge(Dart d, FunctorType& f
return false;
}
inline bool ImplicitHierarchicalMap::foreach_dart_of_oriented_face(Dart d, FunctorType& f)
inline bool ImplicitHierarchicalMap::foreach_dart_of_oriented_face(Dart d, FunctorType& f, unsigned int thread)
{
Dart dNext = d ;
do
......@@ -196,12 +196,12 @@ inline bool ImplicitHierarchicalMap::foreach_dart_of_oriented_face(Dart d, Funct
return false ;
}
inline bool ImplicitHierarchicalMap::foreach_dart_of_face(Dart d, FunctorType& f)
inline bool ImplicitHierarchicalMap::foreach_dart_of_face(Dart d, FunctorType& f, unsigned int thread)
{
return foreach_dart_of_oriented_face(d, f) ;
}
inline bool ImplicitHierarchicalMap::foreach_dart_of_oriented_volume(Dart d, FunctorType& f)
inline bool ImplicitHierarchicalMap::foreach_dart_of_oriented_volume(Dart d, FunctorType& f, unsigned int thread)
{
DartMarkerStore mark(*this); // Lock a marker
bool found = false; // Last functor return value
......@@ -237,12 +237,12 @@ inline bool ImplicitHierarchicalMap::foreach_dart_of_oriented_volume(Dart d, Fun
return found;
}
inline bool ImplicitHierarchicalMap::foreach_dart_of_volume(Dart d, FunctorType& f)
inline bool ImplicitHierarchicalMap::foreach_dart_of_volume(Dart d, FunctorType& f, unsigned int thread)
{
return foreach_dart_of_oriented_volume(d, f) ;
}
inline bool ImplicitHierarchicalMap::foreach_dart_of_cc(Dart d, FunctorType& f)
inline bool ImplicitHierarchicalMap::foreach_dart_of_cc(Dart d, FunctorType& f, unsigned int thread)
{
return foreach_dart_of_oriented_volume(d, f) ;
}
......
......@@ -106,17 +106,17 @@ public:
virtual void next(Dart& d) ;
virtual bool foreach_dart_of_vertex(Dart d, FunctorType& f) ;
virtual bool foreach_dart_of_vertex(Dart d, FunctorType& f, unsigned int thread = 0) ;
virtual bool foreach_dart_of_edge(Dart d, FunctorType& f) ;
virtual bool foreach_dart_of_edge(Dart d, FunctorType& f, unsigned int thread = 0) ;
bool foreach_dart_of_oriented_face(Dart d, FunctorType& f);
virtual bool foreach_dart_of_face(Dart d, FunctorType& f) ;
bool foreach_dart_of_oriented_face(Dart d, FunctorType& f, unsigned int thread = 0);
virtual bool foreach_dart_of_face(Dart d, FunctorType& f, unsigned int thread = 0) ;
bool foreach_dart_of_oriented_volume(Dart d, FunctorType& f);
virtual bool foreach_dart_of_volume(Dart d, FunctorType& f) ;
bool foreach_dart_of_oriented_volume(Dart d, FunctorType& f, unsigned int thread = 0);
virtual bool foreach_dart_of_volume(Dart d, FunctorType& f, unsigned int thread = 0) ;
virtual bool foreach_dart_of_cc(Dart d, FunctorType& f) ;
virtual bool foreach_dart_of_cc(Dart d, FunctorType& f, unsigned int thread = 0) ;
/****************************************************
......
......@@ -238,7 +238,7 @@ inline void ImplicitHierarchicalMap3::next(Dart& d)
} while(d != Map3::end() && m_dartLevel[d] > m_curLevel) ;
}
inline bool ImplicitHierarchicalMap3::foreach_dart_of_vertex(Dart d, FunctorType& f)
inline bool ImplicitHierarchicalMap3::foreach_dart_of_vertex(Dart d, FunctorType& f, unsigned int thread)
{
DartMarkerStore mv(*this); // Lock a marker
bool found = false; // Last functor return value
......@@ -276,7 +276,7 @@ inline bool ImplicitHierarchicalMap3::foreach_dart_of_vertex(Dart d, FunctorType
return found;
}
inline bool ImplicitHierarchicalMap3::foreach_dart_of_edge(Dart d, FunctorType& f)
inline bool ImplicitHierarchicalMap3::foreach_dart_of_edge(Dart d, FunctorType& f, unsigned int thread)
{
Dart dNext = d;
......@@ -296,7 +296,7 @@ inline bool ImplicitHierarchicalMap3::foreach_dart_of_edge(Dart d, FunctorType&
return false;
}
inline bool ImplicitHierarchicalMap3::foreach_dart_of_oriented_face(Dart d, FunctorType& f)
inline bool ImplicitHierarchicalMap3::foreach_dart_of_oriented_face(Dart d, FunctorType& f, unsigned int thread)
{
Dart dNext = d ;
do
......@@ -308,7 +308,7 @@ inline bool ImplicitHierarchicalMap3::foreach_dart_of_oriented_face(Dart d, Func
return false ;
}
inline bool ImplicitHierarchicalMap3::foreach_dart_of_face(Dart d, FunctorType& f)
inline bool ImplicitHierarchicalMap3::foreach_dart_of_face(Dart d, FunctorType& f, unsigned int thread)
{
if (foreach_dart_of_oriented_face(d,f)) return true;
......@@ -317,7 +317,7 @@ inline bool ImplicitHierarchicalMap3::foreach_dart_of_face(Dart d, FunctorType&
return false;
}
inline bool ImplicitHierarchicalMap3::foreach_dart_of_oriented_volume(Dart d, FunctorType& f)
inline bool ImplicitHierarchicalMap3::foreach_dart_of_oriented_volume(Dart d, FunctorType& f, unsigned int thread)
{
DartMarkerStore mark(*this); // Lock a marker
bool found = false; // Last functor return value
......@@ -353,12 +353,12 @@ inline bool ImplicitHierarchicalMap3::foreach_dart_of_oriented_volume(Dart d, Fu
return found;
}
inline bool ImplicitHierarchicalMap3::foreach_dart_of_volume(Dart d, FunctorType& f)
inline bool ImplicitHierarchicalMap3::foreach_dart_of_volume(Dart d, FunctorType& f, unsigned int thread)
{
return foreach_dart_of_oriented_volume(d, f) ;
}
inline bool ImplicitHierarchicalMap3::foreach_dart_of_cc(Dart d, FunctorType& f)
inline bool ImplicitHierarchicalMap3::foreach_dart_of_cc(Dart d, FunctorType& f, unsigned int thread)
{
return foreach_dart_of_oriented_volume(d, f) ;
}
......
......@@ -286,7 +286,7 @@ void subdivideVolume(typename PFP::MAP& map, Dart d, typename PFP::TVEC3& positi
map.unsewFaces(map.phi1(map.phi1(e)));
//TODO utile ?
if(map.phi2(map.phi1(e)) != map.phi1(e))
//if(map.phi2(map.phi1(e)) != map.phi1(e))
map.unsewFaces(map.phi1(e));
e = map.phi2(map.phi_1(e));
......
......@@ -72,7 +72,7 @@ template <typename PFP>
bool importTs(typename PFP::MAP& the_map, const std::string& filename, std::vector<std::string>& attrNames, float scaleFactor = 1.0f);
template <typename PFP>
bool importInESSSurfacique(typename PFP::MAP& the_map, const std::string& filename, std::vector<std::string>& attrNames);
bool importInESSSurfacique(typename PFP::MAP& the_map, const std::string& filename, std::vector<std::string>& attrNames, std::vector<std::pair<typename PFP::VEC3, typename PFP::VEC3> >& influences);
template <typename PFP>
bool importInESSVolumique(typename PFP::MAP& the_map, const std::string& filename, std::vector<std::string>& attrNames);
......
......@@ -23,6 +23,7 @@
*******************************************************************************/
#include "Algo/Modelisation/polyhedron.h"
#include "Algo/Modelisation/primitives3d.h"
#include <vector>
#include "Geometry/bounding_box.h"
#include <set>
......@@ -51,7 +52,7 @@ typename PFP::VEC3 stringToEmb(std::string s)
typename PFP::VEC3 coord(x,y,z);
CGoGNout << coord << CGoGNendl;
//CGoGNout << coord << CGoGNendl;
return coord;
}
......@@ -72,7 +73,7 @@ inline unsigned int gcd(unsigned int a, unsigned int b)
}
template <typename PFP>
bool importInESSSurfacique(typename PFP::MAP& map, const std::string& filename, std::vector<std::string>& attrNames)
bool importInESSSurfacique(typename PFP::MAP& map, const std::string& filename, std::vector<std::string>& attrNames, std::vector<std::pair<typename PFP::VEC3, typename PFP::VEC3> > &influences)
{
typedef typename PFP::VEC3 VEC3;
......@@ -134,6 +135,11 @@ bool importInESSSurfacique(typename PFP::MAP& map, const std::string& filename,
sy.insert(c1[1]);
sy.insert(c2[1]);
// Second Column (nil)
bg = line.substr(posData);
//std::cout << bg << std::endl;
size++;
while ( std::getline( fp, line ) )
......@@ -147,11 +153,9 @@ bool importInESSSurfacique(typename PFP::MAP& map, const std::string& filename,
VEC3 c1 = stringToEmb<PFP>(bg.substr(0, posCoord));
VEC3 c2 = stringToEmb<PFP>(bg.substr(posCoord+3));
std::cout << std::endl;
//std::cout << std::endl;
coordonnees.push_back(std::pair<VEC3,VEC3>(c1,c2));
// coordonneesX.insert(std::pair<int, unsigned int >(c1[0],size));
// coordonneesY.insert(std::pair<int, unsigned int >(c1[1],size));
sx.insert(c1[0]);
sx.insert(c2[0]);
......@@ -159,22 +163,25 @@ bool importInESSSurfacique(typename PFP::MAP& map, const std::string& filename,
sy.insert(c1[1]);
sy.insert(c2[1]);
//Second Column
bg = line.substr(posData);
posCoord = bg.find(") (");
//std::cout << bg << std::endl;
c1 = stringToEmb<PFP>(bg.substr(1, posCoord+1));
//CGoGNout << c1 << CGoGNendl;
c2 = stringToEmb<PFP>(bg.substr(posCoord+3));
//CGoGNout << c2 << CGoGNendl;
influences.push_back(std::pair<VEC3,VEC3>(c1,c2));
size++;
}
fp.close();
// std::cout << "setx" << std::endl;
// for (std::set<int>::iterator it = sx.begin() ; it != sx.end(); ++it)
// std::cout << " " << *it;
// std::cout << std::endl;
//
// std::cout << "sety" << std::endl;
// for (std::set<int>::iterator it = sy.begin() ; it != sy.end(); ++it)
// std::cout << " " << *it;
// std::cout << std::endl;
//
// Creation de la grille
//
......@@ -186,11 +193,10 @@ bool importInESSSurfacique(typename PFP::MAP& map, const std::string& filename,
int cy = sy.size();
prim.grid_topo(cx-1,cy-1);
//tableau des brins (un par sommet)
std::vector<Dart> tableVertDarts = prim.getVertexDarts();
std::pair<std::multimap<int, unsigned int>::iterator,std::multimap<int, unsigned int>::iterator > retX;
for(int i=0; i<cy; ++i)
{
//std::cout << "cood y =" << *sity << std::endl;
......@@ -201,7 +207,7 @@ bool importInESSSurfacique(typename PFP::MAP& map, const std::string& filename,
Dart d = tableVertDarts[i*(cx)+j];
position[d] = VEC3(*sitx, *sity, 0);
objects[d] = -1;
objects[d] = 0;
++sitx;
}
......@@ -213,7 +219,6 @@ bool importInESSSurfacique(typename PFP::MAP& map, const std::string& filename,
//
// Coloriage
//
for(int i=0; i<cy; ++i)
{
//std::cout << "cood y =" << *sity << std::endl;
......@@ -223,232 +228,36 @@ bool importInESSSurfacique(typename PFP::MAP& map, const std::string& filename,
{
Dart d = tableVertDarts[i*(cx)+j];
//Calcul du centre de ce quad
VEC3 c = Algo::Geometry::faceCentroid<PFP>(map, d, position);
if(objects[d] == 0)
{
//std::cout << "center=" << c << std::endl;
int place = 0;
//Calcul du centre de ce quad
VEC3 c = Algo::Geometry::faceCentroid<PFP>(map, d, position);
//Comparaison avec toutes les coordonnees si le point se trouve dedans
for(typename std::vector<std::pair<VEC3,VEC3> >::iterator it = coordonnees.begin(); it != coordonnees.end() ; ++it)
{
//comparaison si la coord du centre se situe dans l'intervalle de la boite anglobante
//std::cout << "c1=" << (*it).first << " c2=" << (*it).second << std::endl;
//std::cout << "center=" << c << std::endl;
if((*it).first[0] < c[0] && c[0] < (*it).second[0] && (*it).first[1] < c[1] && c[1] < (*it).second[1])
int i = 1;
//Comparaison avec toutes les coordonnees si le point se trouve dedans
for(typename std::vector<std::pair<VEC3,VEC3> >::iterator it = coordonnees.begin(); it != coordonnees.end() ; ++it)
{
objects[d] = place;
//std::cout << "i=" << place << std::endl;
std::cout << "place=" << place << std::endl;
//comparaison si la coord du centre se situe dans l'intervalle de la boite anglobante
//std::cout << "c1=" << (*it).first << " c2=" << (*it).second << std::endl;
if((*it).first[0] <= c[0] && c[0] < (*it).second[0] &&
(*it).first[1] <= c[1] && c[1] < (*it).second[1])
{
objects[d] = i ;
}
++i;
}
++place;
}
}
++sitx;
}
++sity;
}
// for(int i=0; i<cy; ++i)
// {
// std::cout << "cood y =" << *sity << std::endl;
// std::set<int>::iterator sitx = sx.begin();
//
// for(int j=0; j<cx;++j)
// {
// Dart d = tableVertDarts[i*(cx)+j];
//
// //Amelioration : tester si le brin est marque d'abord
// if(!fm.isMarked(d))
// {
// //chercher dans la multimap X le début des sommets dont la cle vaut *sitx
//// retX = coordonneesX.lower_bound(*sitx);
// bool end = false;
//
// std::cout << "sitx=" << *sitx << std::endl;
// std::cout << "sity=" << *sity << std::endl;
// //chercher dans ce sous ensemble avec une indirection vers les coordonnnes le couple de coordonnees dans le first a une valeur Y qui vaut *sitY
// for(std::multimap<int, unsigned int>::iterator retX = coordonneesX.lower_bound(*sitx) ; !end && retX != coordonneesX.end() ; ++retX)
// {
// std::cout << (*retX).second << std::endl;
// std::cout << coordonnees[(*retX).second].first << std::endl;
//
// //si ce plongement est le debut d'une boite englobante
// if(coordonnees[(*retX).second].first[1] == *sity)
// {
// std::cout << "plop" << std::endl;
// //on plonge un brin de cette face
// //objects[d] = (*retX).second;
//
// //on marque les brins de la face
// //fm.markOrbit(FACE_ORBIT, d);
//
//
//// Dart e = d;
//// do
//// {
//// //se balader dans la carte vers l'autre extremite de la boite englobante tout en marquant les faces
////
//// //Tout en incrementant les y
////
//// Dart f = e;
//// do
//// {
//// //on plonge un brin de cette face
//// objects[f] = (*retX).second;
////
//// //on marque les brins de la face
//// fm.markOrbit(FACE_ORBIT, f);
////
//// //d'abord sur les x tant que le x de la fin de la boite englobante n'a pas ete atteint
////
//// f = map.phi1(map.phi2(map.phi1(f)));
//// }
//// while(position[f][1] <= coordonnees[(*retX).second].second[1]);
////
//// e = map.phi2(map.phi_1(map.phi_1(e)));
//// }
//// while(position[e][0] <= coordonnees[(*retX).second].second[0]);
//
// }
// }
//
// std::cout << std::endl << std::endl;
// }
//
// ++sitx;
// }
// ++sity;
// }
// std::pair<std::multimap<int, unsigned int>::iterator,std::multimap<int, unsigned int>::iterator > retX;
// std::pair<std::multimap<int, unsigned int>::iterator,std::multimap<int, unsigned int>::iterator > retY;
//
// for(int i=0; i<cy; ++i)
// {
// std::cout << "cood y =" << *sity << std::endl;
// std::set<int>::iterator sitx = sx.begin();
//
// for(int j=0; j<cx;++j)
// {
// Dart d = tableVertDarts[i*(cx)+j];
//
// std::cout << "sitx=" << *sitx << std::endl;
// std::cout << "sity=" << *sity << std::endl;
//
// //chercher dans la multimap X le sous ensemble de sommets dont la cle vaut *sitx
// retX = coordonneesX.equal_range(*sitx);
//
// //chercher dans ce sous ensemble avec une indirection vers les coordonnnes le couple de coordonnees dans le first a une valeur Y qui vaut *sitY
// typename std::multimap<int, unsigned int>::iterator it;
// for (it=retX.first; it!=retX.second; ++it)
// {
// std::cout << (*it).second << std::endl;
// std::cout << coordonnees[(*it).second].first << std::endl << std::endl;
//
// //plonger le brin de cette face avec la valeur de l'indirection
// if(coordonnees[(*it).second].first[1] == *sity)
// objects[d] = (*it).second;
// }
// std::cout << std::endl;
// ++sitx;
// }
// ++sity;
// }
// Dart e = d;
// do
// {
// //se balader dans la carte vers l'autre extremite de la boite englobante tout en marquant les faces
//
// //Tout en incrementant les y
//
// Dart f = e;
// do
// {
// //on plonge un brin de cette face
// objects[f] = (*retX).second;
//
// //on marque les brins de la face
// fm.mark(FACE_ORBIT, f);
//
// //d'abord sur les x tant que le x de la fin de la boite englobante n'a pas ete atteint
//
// f = map.phi1(map.phi2(map.phi1(f)));
// }
// while(position[f][1] < coordonnees[(*retX).second].second[1]);
//
// e = map.phi2(map.phi_1(map.phi_1(e)));
//
// }
// while(position[e][0] < coordonnees[(*retX).second].second[0]);
// unsigned int em;
// AttributeContainer& container = map.getAttributeContainer(VERTEX_CELL) ;
// typename std::vector<std::pair<VEC3,VEC3> >::iterator it = coordonnees.begin();
// // ++it;
//
// while( it != coordonnees.end())
// {
// std::cout << "x=" << (*it).first << "y=" << (*it).second << std::endl;
//
//
// Dart d = map.newFace(4);
//
// std::pair<VEC3,VEC3> c = *it;
// VEC3 c1 = c.first;
// VEC3 c2 = c.second;
//
// em = container.insertLine();
// position[em] = c1;
// map.setDartEmbedding(VERTEX_ORBIT, d, em);
// d = map.phi1(d);
//
// em = container.insertLine();
// position[em] = VEC3(c2[0],c1[1],c2[2]);
// map.setDartEmbedding(VERTEX_ORBIT, d, em);
// d = map.phi1(d);
//
// em = container.insertLine();
// position[em] = c2;
// map.setDartEmbedding(VERTEX_ORBIT, d, em);
// d = map.phi1(d);
//
// em = container.insertLine();
// position[em] = VEC3(c1[0],c2[1],c1[2]);
// map.setDartEmbedding(VERTEX_ORBIT, d, em);
// d = map.phi1(d);
//
// ++it;
// }
//
// Coloriage des cases de la grille en fonction des boites englobantes
//
// Dart d = map.begin();
// Dart e = d;
// do
// {
//
//
// }while(e != d);
// DartMarkerStore mark(map);
//
// for(Dart d = map.begin() ; d != map.end() ; map.next(d))
// {
// VEC3 a = map.getEmbedding(VERTEX_ORBIT);
//
//
// }
//IDEE : marquage des brins lors du plongement en fonction
std::cout << "coord size : " << coordonnees.size() << std::endl;
return true;
......@@ -482,10 +291,11 @@ bool importInESSVolumique(typename PFP::MAP& map, const std::string& filename, s
std::ifstream fp(filename.c_str(), std::ios::in);
if (!fp.good())
{
std::cerr << "Unable to open file " << filename << std::endl;
CGoGNerr << "Unable to open file " << filename << CGoGNendl;
return false;
}
//
// Lecture du fichier
//
......@@ -508,6 +318,10 @@ bool importInESSVolumique(typename PFP::MAP& map, const std::string& filename, s
VEC3 c2 = stringToEmb<PFP>(bg.substr(posCoord+3));
std::cout << std::endl;
float x = c1[0];
float y = c1[1];
float z = c1[2];
//coordonnees.push_back(std::pair<VEC3,VEC3>(c1,c2));
// coordonneesX.insert(std::pair<int, unsigned int >(c1[0],size));
// coordonneesY.insert(std::pair<int, unsigned int >(c1[1],size));
......@@ -546,6 +360,124 @@ bool importInESSVolumique(typename PFP::MAP& map, const std::string& filename, s
fp.close();
// std::cout << "setx" << std::endl;
// for (std::set<int>::iterator it = sx.begin() ; it != sx.end(); ++it)
// std::cout << " " << *it;
// std::cout << std::endl;
//
// std::cout << "sety" << std::endl;
// for (std::set<int>::iterator it = sy.begin() ; it != sy.end(); ++it)
// std::cout << " " << *it;
// std::cout << std::endl;