Testing the package

This commit is contained in:
Nico Kruithof 2007-01-29 08:13:44 +00:00
parent a1ced1f1ad
commit 850e86b855
5 changed files with 39 additions and 29 deletions

View File

@ -29,7 +29,6 @@ void write_polyhedron_with_normals(SkinSurface &skin,
// Write vertices
int i=p.size_of_vertices ();
for (Vertex_iterator vit = p.vertices_begin();
vit != p.vertices_end(); vit ++) {
Vector n = policy.normal(vit);

View File

@ -106,16 +106,16 @@ Skin_surface_3(WP_iterator begin, WP_iterator end,
observer, verbose);
CGAL_assertion(tmc().dimension() == 3);
{ // NGHK: debug code:
CGAL_assertion(tmc().is_valid());
std::vector<TMC_Vertex_handle> ch_vertices;
tmc().incident_vertices(tmc().infinite_vertex(),
std::back_inserter(ch_vertices));
for (typename std::vector<TMC_Vertex_handle>::iterator
vit = ch_vertices.begin(); vit != ch_vertices.end(); vit++) {
CGAL_assertion(sign(*vit) == POSITIVE);
}
}
// { // NGHK: debug code:
// CGAL_assertion(tmc().is_valid());
// std::vector<TMC_Vertex_handle> ch_vertices;
// tmc().incident_vertices(tmc().infinite_vertex(),
// std::back_inserter(ch_vertices));
// for (typename std::vector<TMC_Vertex_handle>::iterator
// vit = ch_vertices.begin(); vit != ch_vertices.end(); vit++) {
// CGAL_assertion(sign(*vit) == POSITIVE);
// }
// }
}
CGAL_END_NAMESPACE

View File

@ -630,8 +630,6 @@ locate_in_tmc(const Bare_point &p0,
Cartesian_converter<typename Bare_point::R, TMC_Geom_traits> converter_fk;
TMC_Point p_inexact = converter_fk(p0);
Protect_FPU_rounding<false> P(CGAL_FE_TONEAREST);
// Make sure we continue from here with a finite cell.
if ( start == TMC_Cell_handle() )
start = _tmc.infinite_cell();
@ -673,9 +671,17 @@ locate_in_tmc(const Bare_point &p0,
const TMC_Point* backup = pts[i];
pts[i] = &p_inexact;
try {
Protect_FPU_rounding<true> P;
o = TMC_Geom_traits().orientation_3_object()(*pts[0], *pts[1], *pts[2], *pts[3]);
Skin_surface_traits_3<TMC_Geom_traits> filtered_traits(shrink_factor());
std::cout << *pts[i==0?1:0] << " == "
<< get_anchor_point(c->vertex(i==0?1:0)->info(),
filtered_traits)
<< std::endl;
Protect_FPU_rounding<false> P2(CGAL_FE_TONEAREST);
typedef Exact_predicates_exact_constructions_kernel EK;
Cartesian_converter<typename Geometric_traits::Bare_point::R, EK> converter_ek;
@ -695,11 +701,11 @@ locate_in_tmc(const Bare_point &p0,
}
}
std::cout << *pts[i==0?1:0] << " == " << e_pts[i==0?1:0] << std::endl;
//CGAL_assertion(o == orientation(e_pts[0], e_pts[1], e_pts[2], e_pts[3]));
} catch (Interval_nt_advanced::unsafe_comparison) {
Protect_FPU_rounding<false> P(CGAL_FE_TONEAREST);
std::cout << "exact" << std::endl;
typedef Exact_predicates_exact_constructions_kernel EK;
Cartesian_converter<typename Geometric_traits::Bare_point::R, EK> converter_ek;

View File

@ -79,8 +79,8 @@ public:
}
void after_vertex_insertion(Rt_Simplex const &sDel,
Rt_Simplex const &sVor,
TMC_Vertex_handle &vh)
Rt_Simplex const &sVor,
TMC_Vertex_handle &vh)
{
vh->info() = typename SkinSurface_3::Vertex_info(sDel, sVor);
}

View File

@ -137,6 +137,7 @@ public:
observer(observer),
triangulation_incr_builder(triangulated_mixed_complex),
compute_anchor_obj(regular),
construct_anchor_point_3_obj(shrink),
verbose(verbose) {
build();
@ -217,14 +218,14 @@ private:
}
void construct_vertices();
Tmc_Point get_orthocenter(Rt_Simplex const &s);
Tmc_Point get_weighted_circumcenter(Rt_Simplex const &s);
Tmc_Point get_anchor(Rt_Simplex const &sDel, Rt_Simplex const &sVor);
template <class Point>
Point construct_anchor_point(const Point &center_del,
const Point &center_vor) {
return center_del + shrink*(center_vor-center_del);
const Point &center_vor) {
return construct_anchor_point_3_obj(center_del,center_vor);
}
void construct_0_cell(Rt_Vertex_handle rt_vh);
void construct_1_cell(const Rt_Finite_edges_iterator &eit);
void construct_2_cell(const Rt_Finite_facets_iterator &fit);
@ -247,7 +248,11 @@ private:
Construct_weighted_circumcenter_3<
Regular_triangulation_euclidean_traits_3<
Triangulated_mixed_complex_traits> > orthocenter_obj;
Triangulated_mixed_complex_traits> > weighted_circumcenter_obj;
Construct_anchor_point_3<
Regular_triangulation_euclidean_traits_3<
Triangulated_mixed_complex_traits> > construct_anchor_point_3_obj;
Compute_squared_radius_smallest_orthogonal_sphere_3<
Regular_triangulation_euclidean_traits_3<
@ -994,7 +999,7 @@ Mixed_complex_triangulator_3<
RegularTriangulation_3,
TriangulatedMixedComplex_3,
TriangulatedMixedComplexObserver_3>::
get_orthocenter(Rt_Simplex const &s) {
get_weighted_circumcenter(Rt_Simplex const &s) {
Rt_Vertex_handle vh;
Rt_Edge e;
Rt_Facet f;
@ -1008,13 +1013,13 @@ get_orthocenter(Rt_Simplex const &s) {
break;
case 1:
e=s;
result = orthocenter_obj(
result = weighted_circumcenter_obj(
r2t_converter_object(e.first->vertex(e.second)->point()),
r2t_converter_object(e.first->vertex(e.third)->point()));
break;
case 2:
f=s;
result = orthocenter_obj(
result = weighted_circumcenter_obj(
r2t_converter_object(
f.first->vertex((f.second+1)&3)->point()),
r2t_converter_object(
@ -1024,7 +1029,7 @@ get_orthocenter(Rt_Simplex const &s) {
break;
case 3:
ch=s;
result = orthocenter_obj(
result = weighted_circumcenter_obj(
r2t_converter_object(ch->vertex(0)->point()),
r2t_converter_object(ch->vertex(1)->point()),
r2t_converter_object(ch->vertex(2)->point()),
@ -1045,10 +1050,10 @@ Mixed_complex_triangulator_3<
TriangulatedMixedComplexObserver_3>::
get_anchor(Rt_Simplex const &sDel, Rt_Simplex const &sVor)
{
Protect_FPU_rounding<true> P(CGAL_FE_TONEAREST);
Protect_FPU_rounding<true> P;
Tmc_Point dfoc = get_orthocenter(sDel);
Tmc_Point vfoc = get_orthocenter(sVor);
Tmc_Point dfoc = get_weighted_circumcenter(sDel);
Tmc_Point vfoc = get_weighted_circumcenter(sVor);
return construct_anchor_point(dfoc, vfoc);
}