mirror of https://github.com/CGAL/cgal
Working on the error in the hierarchy and removing compiler warnings
This commit is contained in:
parent
02fdc5b53e
commit
89c6b1d4a7
|
|
@ -2,7 +2,6 @@
|
||||||
#include <CGAL/Periodic_2_triangulation_traits_2.h>
|
#include <CGAL/Periodic_2_triangulation_traits_2.h>
|
||||||
#include <CGAL/Periodic_2_Delaunay_triangulation_2.h>
|
#include <CGAL/Periodic_2_Delaunay_triangulation_2.h>
|
||||||
|
|
||||||
#include <iostream>
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
|
@ -21,37 +20,29 @@ typedef PDT::Iso_rectangle Iso_rectangle;
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
std::cout << __FILE__ << ", " << __LINE__ << std::endl;
|
|
||||||
Iso_rectangle domain(-1, -1, 2, 2); // The cube for the periodic domain
|
Iso_rectangle domain(-1, -1, 2, 2); // The cube for the periodic domain
|
||||||
|
|
||||||
std::cout << __FILE__ << ", " << __LINE__ << std::endl;
|
|
||||||
// construction from a list of points :
|
// construction from a list of points :
|
||||||
std::list<Point> L;
|
std::list<Point> L;
|
||||||
L.push_front(Point(0, 0));
|
L.push_front(Point(0, 0));
|
||||||
L.push_front(Point(1, 0));
|
L.push_front(Point(1, 0));
|
||||||
L.push_front(Point(0, 1));
|
L.push_front(Point(0, 1));
|
||||||
|
|
||||||
std::cout << __FILE__ << ", " << __LINE__ << std::endl;
|
|
||||||
PDT T(L.begin(), L.end(), domain); // Put the domain with the constructor
|
PDT T(L.begin(), L.end(), domain); // Put the domain with the constructor
|
||||||
|
|
||||||
std::cout << __FILE__ << ", " << __LINE__ << std::endl;
|
size_t n = T.number_of_vertices();
|
||||||
int n = T.number_of_vertices();
|
|
||||||
|
|
||||||
std::cout << __FILE__ << ", " << __LINE__ << std::endl;
|
|
||||||
// insertion from a vector :
|
// insertion from a vector :
|
||||||
std::vector<Point> V(3);
|
std::vector<Point> V(3);
|
||||||
V[0] = Point(0, 0);
|
V[0] = Point(0, 0);
|
||||||
V[1] = Point(1, 1);
|
V[1] = Point(1, 1);
|
||||||
V[2] = Point(-1, -1);
|
V[2] = Point(-1, -1);
|
||||||
|
|
||||||
std::cout << __FILE__ << ", " << __LINE__ << std::endl;
|
|
||||||
n = n + T.insert(V.begin(), V.end());
|
n = n + T.insert(V.begin(), V.end());
|
||||||
|
|
||||||
assert( n == 5 ); // 6 points have been inserted, one is a duplicate
|
assert( n == 5 ); // 6 points have been inserted, one is a duplicate
|
||||||
std::cout << __FILE__ << ", " << __LINE__ << std::endl;
|
|
||||||
assert( T.is_valid() ); // checking validity of T
|
assert( T.is_valid() ); // checking validity of T
|
||||||
|
|
||||||
std::cout << __FILE__ << ", " << __LINE__ << std::endl;
|
|
||||||
Locate_type lt;
|
Locate_type lt;
|
||||||
int li;
|
int li;
|
||||||
Point p(0, 0);
|
Point p(0, 0);
|
||||||
|
|
@ -60,35 +51,26 @@ int main()
|
||||||
assert( lt == PDT::VERTEX );
|
assert( lt == PDT::VERTEX );
|
||||||
assert( fh->vertex(li)->point() == p );
|
assert( fh->vertex(li)->point() == p );
|
||||||
|
|
||||||
std::cout << __FILE__ << ", " << __LINE__ << std::endl;
|
|
||||||
Vertex_handle v = fh->vertex( (li + 1) % 3 );
|
Vertex_handle v = fh->vertex( (li + 1) % 3 );
|
||||||
// v is another vertex of c
|
// v is another vertex of c
|
||||||
std::cout << __FILE__ << ", " << __LINE__ << std::endl;
|
|
||||||
Face_handle nb = fh->neighbor(li);
|
Face_handle nb = fh->neighbor(li);
|
||||||
// nb = neighbor of fh opposite to the vertex associated with p
|
// nb = neighbor of fh opposite to the vertex associated with p
|
||||||
// nb must have vertex v :
|
// nb must have vertex v :
|
||||||
std::cout << __FILE__ << ", " << __LINE__ << std::endl;
|
|
||||||
int nli;
|
int nli;
|
||||||
assert( nb->has_vertex( v, nli ) );
|
assert( nb->has_vertex( v, nli ) );
|
||||||
// nli is the index of v in nc
|
// nli is the index of v in nc
|
||||||
|
|
||||||
std::cout << __FILE__ << ", " << __LINE__ << std::endl;
|
|
||||||
std::ofstream oFileT("output.tri", std::ios::out);
|
std::ofstream oFileT("output.tri", std::ios::out);
|
||||||
// writing file output;
|
// writing file output;
|
||||||
oFileT << T;
|
oFileT << T;
|
||||||
|
|
||||||
std::cout << __FILE__ << ", " << __LINE__ << std::endl;
|
|
||||||
PDT T1;
|
PDT T1;
|
||||||
std::ifstream iFileT("output.tri", std::ios::in);
|
std::ifstream iFileT("output.tri", std::ios::in);
|
||||||
// reading file output;
|
// reading file output;
|
||||||
std::cout << __FILE__ << ", " << __LINE__ << std::endl;
|
|
||||||
iFileT >> T1;
|
iFileT >> T1;
|
||||||
assert( T1.is_valid() );
|
assert( T1.is_valid() );
|
||||||
std::cout << __FILE__ << ", " << __LINE__ << std::endl;
|
|
||||||
assert( T1.number_of_vertices() == T.number_of_vertices() );
|
assert( T1.number_of_vertices() == T.number_of_vertices() );
|
||||||
std::cout << __FILE__ << ", " << __LINE__ << std::endl;
|
|
||||||
assert( T1.number_of_faces() == T.number_of_faces() );
|
assert( T1.number_of_faces() == T.number_of_faces() );
|
||||||
std::cout << __FILE__ << ", " << __LINE__ << std::endl;
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1107,7 +1107,7 @@ remove(Vertex_handle v)
|
||||||
CGAL_assertion(this->virtual_vertices_reverse().find(v) != this->virtual_vertices_reverse().end());
|
CGAL_assertion(this->virtual_vertices_reverse().find(v) != this->virtual_vertices_reverse().end());
|
||||||
|
|
||||||
const std::vector<Vertex_handle> &virtual_copies = this->virtual_vertices_reverse().find(v)->second;
|
const std::vector<Vertex_handle> &virtual_copies = this->virtual_vertices_reverse().find(v)->second;
|
||||||
for (size_t i = 0; i < 8; ++i)
|
for (int i = 0; i < 8; ++i)
|
||||||
{
|
{
|
||||||
remove_single_vertex(virtual_copies[i], Offset((i + 1) / 3, (i + 1) % 3));
|
remove_single_vertex(virtual_copies[i], Offset((i + 1) / 3, (i + 1) % 3));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4343,6 +4343,8 @@ Periodic_2_triangulation_2<Gt, Tds>::save(std::ostream& os) const
|
||||||
}
|
}
|
||||||
std::cout << "Line:" << __LINE__ << " cover[0]:" << cover[0] << " cover[1]:" << cover[1] << " n*c0*c1:" << (n * cover[0]*cover[1]) << std::endl;
|
std::cout << "Line:" << __LINE__ << " cover[0]:" << cover[0] << " cover[1]:" << cover[1] << " n*c0*c1:" << (n * cover[0]*cover[1]) << std::endl;
|
||||||
|
|
||||||
|
std::cout << "save, #Vertices: " << n << std::endl;
|
||||||
|
|
||||||
if (n == 0)
|
if (n == 0)
|
||||||
return os;
|
return os;
|
||||||
|
|
||||||
|
|
@ -4354,7 +4356,7 @@ Periodic_2_triangulation_2<Gt, Tds>::save(std::ostream& os) const
|
||||||
for (Vertex_iterator it = vertices_begin(); it != vertices_end(); ++it)
|
for (Vertex_iterator it = vertices_begin(); it != vertices_end(); ++it)
|
||||||
{
|
{
|
||||||
V[it] = i++;
|
V[it] = i++;
|
||||||
os << it->point();
|
os << (*it);
|
||||||
if (is_ascii(os))
|
if (is_ascii(os))
|
||||||
os << std::endl;
|
os << std::endl;
|
||||||
}
|
}
|
||||||
|
|
@ -4415,7 +4417,7 @@ Periodic_2_triangulation_2<Gt, Tds>::save(std::ostream& os) const
|
||||||
if(is_ascii(os)) os << "\n";
|
if(is_ascii(os)) os << "\n";
|
||||||
|
|
||||||
std::cout << "save, face check: " << inum << " == " << m << std::endl;
|
std::cout << "save, face check: " << inum << " == " << m << std::endl;
|
||||||
CGAL_assertion(inum == m);
|
CGAL_assertion(m == (size_type)inum);
|
||||||
|
|
||||||
// neighbor pointers of the faces
|
// neighbor pointers of the faces
|
||||||
for( Face_iterator it = faces_begin();
|
for( Face_iterator it = faces_begin();
|
||||||
|
|
|
||||||
|
|
@ -80,6 +80,25 @@ private:
|
||||||
Vertex_handle _down; // same vertex one level below
|
Vertex_handle _down; // same vertex one level below
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template < class Tds >
|
||||||
|
inline
|
||||||
|
std::istream&
|
||||||
|
operator>>(std::istream &is, Periodic_2_triangulation_hierarchy_vertex_base_2<Tds> &)
|
||||||
|
// no combinatorial information.
|
||||||
|
{
|
||||||
|
return is;
|
||||||
|
}
|
||||||
|
|
||||||
|
template < class Tds >
|
||||||
|
inline
|
||||||
|
std::ostream&
|
||||||
|
operator<<(std::ostream &os,
|
||||||
|
const Periodic_2_triangulation_hierarchy_vertex_base_2<Tds> &)
|
||||||
|
// no combinatorial information.
|
||||||
|
{
|
||||||
|
return os;
|
||||||
|
}
|
||||||
|
|
||||||
} //namespace CGAL
|
} //namespace CGAL
|
||||||
|
|
||||||
#endif // CGAL_PERIODIC_2_TRIANGULATION_HIERARCHY_VERTEX_BASE_2_H
|
#endif // CGAL_PERIODIC_2_TRIANGULATION_HIERARCHY_VERTEX_BASE_2_H
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue