mirror of https://github.com/CGAL/cgal
Adapted the demo and two Leftover costs to changes in the iterators
value_type.
This commit is contained in:
parent
c72b426896
commit
a6d55f9c46
|
|
@ -36,6 +36,8 @@ void error_handler ( char const* what, char const* expr, char const* file, int l
|
||||||
#include <CGAL/Constrained_Delaunay_triangulation_2.h>
|
#include <CGAL/Constrained_Delaunay_triangulation_2.h>
|
||||||
#include <CGAL/Polyline_constrained_triangulation_2.h>
|
#include <CGAL/Polyline_constrained_triangulation_2.h>
|
||||||
#include <CGAL/Polyline_simplification_2/simplify.h>
|
#include <CGAL/Polyline_simplification_2/simplify.h>
|
||||||
|
#include <CGAL/Polyline_simplification_2/Squared_distance_cost.h>
|
||||||
|
#include <CGAL/Polyline_simplification_2/Scaled_squared_distance_cost.h>
|
||||||
|
|
||||||
// Qt headers
|
// Qt headers
|
||||||
#include <QtGui>
|
#include <QtGui>
|
||||||
|
|
|
||||||
|
|
@ -198,8 +198,8 @@ PolylineSimplificationGraphicsItem<PCT>::paintVertices(QPainter *painter)
|
||||||
for(Vertices_in_constraint_iterator it = this->t->vertices_in_constraint_begin(*cit);
|
for(Vertices_in_constraint_iterator it = this->t->vertices_in_constraint_begin(*cit);
|
||||||
it != this->t->vertices_in_constraint_end(*cit);
|
it != this->t->vertices_in_constraint_end(*cit);
|
||||||
it++){
|
it++){
|
||||||
QPointF point = matrix.map(convert(it->point));
|
QPointF point = matrix.map(convert((*it)->point()));
|
||||||
if ( it->fixed )
|
if ( (*it)->fixed )
|
||||||
painter->setPen(this->fixedVerticesPen());
|
painter->setPen(this->fixedVerticesPen());
|
||||||
else
|
else
|
||||||
painter->setPen(this->verticesPen());
|
painter->setPen(this->verticesPen());
|
||||||
|
|
|
||||||
|
|
@ -63,9 +63,9 @@ public:
|
||||||
Compute_squared_distance compute_squared_distance = pct.geom_traits().compute_squared_distance_2_object() ;
|
Compute_squared_distance compute_squared_distance = pct.geom_traits().compute_squared_distance_2_object() ;
|
||||||
Construct_segment construct_segment = pct.geom_traits().construct_segment_2_object() ;
|
Construct_segment construct_segment = pct.geom_traits().construct_segment_2_object() ;
|
||||||
|
|
||||||
Point const& lP = p->point;
|
Point const& lP = (*p)->point();
|
||||||
Point const& lQ = q->point;
|
Point const& lQ = (*q)->point();
|
||||||
Point const& lR = r->point;
|
Point const& lR = (*r)->point();
|
||||||
|
|
||||||
Segment lP_R = construct_segment(lP, lR) ;
|
Segment lP_R = construct_segment(lP, lR) ;
|
||||||
|
|
||||||
|
|
@ -73,14 +73,14 @@ public:
|
||||||
++p;
|
++p;
|
||||||
|
|
||||||
for ( ;p != r; ++p )
|
for ( ;p != r; ++p )
|
||||||
d1 = (std::max)(d1, compute_squared_distance( lP_R, p->point ) ) ;
|
d1 = (std::max)(d1, compute_squared_distance( lP_R, (*p)->point() ) ) ;
|
||||||
|
|
||||||
FT d2 = (std::numeric_limits<double>::max)() ;
|
FT d2 = (std::numeric_limits<double>::max)() ;
|
||||||
|
|
||||||
Vertex_circulator vc = q->vertex->incident_vertices(), done(vc);
|
Vertex_circulator vc = (*q)->incident_vertices(), done(vc);
|
||||||
do {
|
do {
|
||||||
if((vc != pct.infinite_vertex()) && (vc != p->vertex) && (vc != r->vertex)){
|
if((vc != pct.infinite_vertex()) && (vc != *p) && (vc != *r)){
|
||||||
d2 = (std::min)(d2, compute_squared_distance(vc->point(), q->point));
|
d2 = (std::min)(d2, compute_squared_distance(vc->point(), (*q)->point()));
|
||||||
}
|
}
|
||||||
++vc;
|
++vc;
|
||||||
}while(vc != done);
|
}while(vc != done);
|
||||||
|
|
|
||||||
|
|
@ -60,8 +60,8 @@ public:
|
||||||
Compute_squared_distance compute_squared_distance = pct.geom_traits().compute_squared_distance_2_object() ;
|
Compute_squared_distance compute_squared_distance = pct.geom_traits().compute_squared_distance_2_object() ;
|
||||||
Construct_segment construct_segment = pct.geom_traits().construct_segment_2_object() ;
|
Construct_segment construct_segment = pct.geom_traits().construct_segment_2_object() ;
|
||||||
|
|
||||||
Point const& lP = p->point;
|
Point const& lP = (*p)->point();
|
||||||
Point const& lR = r->point;
|
Point const& lR = (*r)->point();
|
||||||
|
|
||||||
Segment lP_R = construct_segment(lP, lR) ;
|
Segment lP_R = construct_segment(lP, lR) ;
|
||||||
|
|
||||||
|
|
@ -69,14 +69,14 @@ public:
|
||||||
++p;
|
++p;
|
||||||
|
|
||||||
for ( ;p != r; ++p )
|
for ( ;p != r; ++p )
|
||||||
d1 = (std::max)(d1, compute_squared_distance( lP_R, p->point ) ) ;
|
d1 = (std::max)(d1, compute_squared_distance( lP_R, (*p)->point() ) ) ;
|
||||||
|
|
||||||
double d2 = (std::numeric_limits<double>::max)() ;
|
double d2 = (std::numeric_limits<double>::max)() ;
|
||||||
|
|
||||||
Vertex_circulator vc = q->vertex->incident_vertices(), done(vc);
|
Vertex_circulator vc = (*q)->incident_vertices(), done(vc);
|
||||||
do {
|
do {
|
||||||
if((vc != pct.infinite_vertex()) && (vc != p->vertex) && (vc != r->vertex)){
|
if((vc != pct.infinite_vertex()) && (vc != *p) && (vc != *r)){
|
||||||
d2 = (std::min)(d2, compute_squared_distance(vc->point(), q->point));
|
d2 = (std::min)(d2, compute_squared_distance(vc->point(), (*q)->point()));
|
||||||
}
|
}
|
||||||
++vc;
|
++vc;
|
||||||
}while(vc != done);
|
}while(vc != done);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue