mirror of https://github.com/CGAL/cgal
Merge pull request #4671 from maxGimeno/DGAL-Fix_MIN_MAX_issues-maxGimeno
CGAL: Min-max errors on windows
This commit is contained in:
commit
0325219ce6
|
|
@ -855,8 +855,8 @@ void Scene::update_grid_size()
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scene::generate_points_in(const unsigned int nb_points,
|
void Scene::generate_points_in(const unsigned int nb_points,
|
||||||
const double min,
|
const double vmin,
|
||||||
const double max)
|
const double vmax)
|
||||||
{
|
{
|
||||||
if(m_pPolyhedron == NULL)
|
if(m_pPolyhedron == NULL)
|
||||||
{
|
{
|
||||||
|
|
@ -875,7 +875,7 @@ void Scene::generate_points_in(const unsigned int nb_points,
|
||||||
CGAL::Timer timer;
|
CGAL::Timer timer;
|
||||||
timer.start();
|
timer.start();
|
||||||
std::cout << "Generate " << nb_points << " points in interval ["
|
std::cout << "Generate " << nb_points << " points in interval ["
|
||||||
<< min << ";" << max << "]";
|
<< vmin << ";" << vmax << "]";
|
||||||
|
|
||||||
unsigned int nb_trials = 0;
|
unsigned int nb_trials = 0;
|
||||||
Vector vec = random_vector();
|
Vector vec = random_vector();
|
||||||
|
|
@ -892,8 +892,8 @@ void Scene::generate_points_in(const unsigned int nb_points,
|
||||||
if(nb_intersections % 2 != 0)
|
if(nb_intersections % 2 != 0)
|
||||||
signed_distance *= -1.0;
|
signed_distance *= -1.0;
|
||||||
|
|
||||||
if(signed_distance >= min &&
|
if(signed_distance >= vmin &&
|
||||||
signed_distance <= max)
|
signed_distance <= vmax)
|
||||||
{
|
{
|
||||||
m_points.push_back(p);
|
m_points.push_back(p);
|
||||||
if(m_points.size()%(nb_points/10) == 0)
|
if(m_points.size()%(nb_points/10) == 0)
|
||||||
|
|
|
||||||
|
|
@ -192,7 +192,7 @@ public:
|
||||||
void generate_boundary_points(const unsigned int nb_points);
|
void generate_boundary_points(const unsigned int nb_points);
|
||||||
void generate_boundary_segments(const unsigned int nb_slices);
|
void generate_boundary_segments(const unsigned int nb_slices);
|
||||||
void generate_points_in(const unsigned int nb_points,
|
void generate_points_in(const unsigned int nb_points,
|
||||||
const double min, const double max);
|
const double vmin, const double vmax);
|
||||||
|
|
||||||
// algorithms/refine
|
// algorithms/refine
|
||||||
void refine_loop();
|
void refine_loop();
|
||||||
|
|
|
||||||
|
|
@ -109,10 +109,10 @@ QRectF ArrangementDemoGraphicsView::getViewportRect( ) const
|
||||||
QPointF p1 = this->mapToScene( 0, 0 );
|
QPointF p1 = this->mapToScene( 0, 0 );
|
||||||
QPointF p2 = this->mapToScene( this->width( ), this->height( ) );
|
QPointF p2 = this->mapToScene( this->width( ), this->height( ) );
|
||||||
|
|
||||||
double xmin = std::min( p1.x( ), p2.x( ) );
|
double xmin = (std::min)( p1.x( ), p2.x( ) );
|
||||||
double xmax = std::max( p1.x( ), p2.x( ) );
|
double xmax = (std::max)( p1.x( ), p2.x( ) );
|
||||||
double ymin = std::min( p1.y( ), p2.y( ) );
|
double ymin = (std::min)( p1.y( ), p2.y( ) );
|
||||||
double ymax = std::max( p1.y( ), p2.y( ) );
|
double ymax = (std::max)( p1.y( ), p2.y( ) );
|
||||||
|
|
||||||
QRectF res = QRectF( QPointF( xmin, ymin ), QPointF( xmax, ymax ) );
|
QRectF res = QRectF( QPointF( xmin, ymin ), QPointF( xmax, ymax ) );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3024,8 +3024,8 @@ public:
|
||||||
y_dapprox = y_interval_for_curve_end(*this, CGAL::ARR_MIN_END, prec);
|
y_dapprox = y_interval_for_curve_end(*this, CGAL::ARR_MIN_END, prec);
|
||||||
|
|
||||||
// adapt y-interval
|
// adapt y-interval
|
||||||
ymin = CGAL::min(ymin, y_dapprox.first);
|
ymin = (CGAL::min)(ymin, y_dapprox.first);
|
||||||
ymax = CGAL::max(ymax, y_dapprox.second);
|
ymax = (CGAL::max)(ymax, y_dapprox.second);
|
||||||
|
|
||||||
// right end
|
// right end
|
||||||
|
|
||||||
|
|
@ -3105,9 +3105,9 @@ public:
|
||||||
(curr_xy, prec);
|
(curr_xy, prec);
|
||||||
|
|
||||||
// adapt y-interval
|
// adapt y-interval
|
||||||
ymin = CGAL::min(ymin,
|
ymin = (CGAL::min)(ymin,
|
||||||
CGAL::to_double(xy_approx.first));
|
CGAL::to_double(xy_approx.first));
|
||||||
ymax = CGAL::max(ymax,
|
ymax = (CGAL::max)(ymax,
|
||||||
CGAL::to_double(xy_approx.second));
|
CGAL::to_double(xy_approx.second));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -572,7 +572,7 @@ void draw(const Arc_2& arc,
|
||||||
ref_bound = engine.pixel_h_r/CGAL_REFINE_X;
|
ref_bound = engine.pixel_h_r/CGAL_REFINE_X;
|
||||||
|
|
||||||
#ifdef CGAL_CKVA_RENDER_WITH_REFINEMENT
|
#ifdef CGAL_CKVA_RENDER_WITH_REFINEMENT
|
||||||
ref_bound = std::min(ref_bound, Rational(CGAL_REFINE_DOUBLE_APPROX));
|
ref_bound = (std::min)(ref_bound, Rational(CGAL_REFINE_DOUBLE_APPROX));
|
||||||
#endif
|
#endif
|
||||||
Gfx_OUT("computing y-coordinates\n");
|
Gfx_OUT("computing y-coordinates\n");
|
||||||
|
|
||||||
|
|
@ -912,7 +912,7 @@ bool draw(const Point_2& pt, Coord_2& coord) {
|
||||||
const Coordinate_1& x0 = pt.x();
|
const Coordinate_1& x0 = pt.x();
|
||||||
Rational ref_bound = engine.pixel_w_r / 2;
|
Rational ref_bound = engine.pixel_w_r / 2;
|
||||||
#ifdef CGAL_CKVA_RENDER_WITH_REFINEMENT
|
#ifdef CGAL_CKVA_RENDER_WITH_REFINEMENT
|
||||||
ref_bound = std::min(ref_bound, Rational(CGAL_REFINE_DOUBLE_APPROX));
|
ref_bound = (std::min)(ref_bound, Rational(CGAL_REFINE_DOUBLE_APPROX));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typename Curve_kernel_2::Algebraic_kernel_d_1::Approximate_relative_1
|
typename Curve_kernel_2::Algebraic_kernel_d_1::Approximate_relative_1
|
||||||
|
|
@ -932,7 +932,7 @@ bool draw(const Point_2& pt, Coord_2& coord) {
|
||||||
ref_bound = engine.pixel_h_r / CGAL_REFINE_X;
|
ref_bound = engine.pixel_h_r / CGAL_REFINE_X;
|
||||||
|
|
||||||
#ifdef CGAL_CKVA_RENDER_WITH_REFINEMENT
|
#ifdef CGAL_CKVA_RENDER_WITH_REFINEMENT
|
||||||
ref_bound = std::min(ref_bound, Rational(CGAL_REFINE_DOUBLE_APPROX));
|
ref_bound = (std::min)(ref_bound, Rational(CGAL_REFINE_DOUBLE_APPROX));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Coordinate_2 xy(x0, pt.curve(), pt.arcno());
|
Coordinate_2 xy(x0, pt.curve(), pt.arcno());
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,7 @@ struct Regularization_graph
|
||||||
if (get(pmap.rg->is_selected_map, fd))
|
if (get(pmap.rg->is_selected_map, fd))
|
||||||
{
|
{
|
||||||
if (pmap.rg->prevent_unselection)
|
if (pmap.rg->prevent_unselection)
|
||||||
out[0] = std::numeric_limits<double>::max();
|
out[0] = (std::numeric_limits<double>::max)();
|
||||||
else
|
else
|
||||||
out[0] = value;
|
out[0] = value;
|
||||||
out[1] = 0.;
|
out[1] = 0.;
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,8 @@ int nr = 0;
|
||||||
|
|
||||||
double rerr(double exact,double approx) {
|
double rerr(double exact,double approx) {
|
||||||
const double e = std::abs((exact-approx)/exact);
|
const double e = std::abs((exact-approx)/exact);
|
||||||
mine = std::min(mine,e);
|
mine = (std::min)(mine,e);
|
||||||
maxe = std::max(maxe,e);
|
maxe = (std::max)(maxe,e);
|
||||||
avge += e;
|
avge += e;
|
||||||
++nr;
|
++nr;
|
||||||
return e;
|
return e;
|
||||||
|
|
|
||||||
|
|
@ -4,15 +4,15 @@
|
||||||
#include <CGAL/box_intersection_d.h>
|
#include <CGAL/box_intersection_d.h>
|
||||||
|
|
||||||
|
|
||||||
template <typename Polyline>
|
template <typename Poly>
|
||||||
class Polylines_do_intersect
|
class Polylines_do_intersect
|
||||||
{
|
{
|
||||||
typedef typename Polyline::const_iterator Iterator;
|
typedef typename Poly::const_iterator Iterator;
|
||||||
typedef typename std::iterator_traits<Iterator>::value_type Point_2;
|
typedef typename std::iterator_traits<Iterator>::value_type Point_2;
|
||||||
typedef typename CGAL::Kernel_traits<Point_2>::Kernel::Segment_2 Segment_2;
|
typedef typename CGAL::Kernel_traits<Point_2>::Kernel::Segment_2 Segment_2;
|
||||||
typedef CGAL::Bbox_2 Bbox_2;
|
typedef CGAL::Bbox_2 Bbox_2;
|
||||||
|
|
||||||
const Polyline& pA, &pB;
|
const Poly& pA, &pB;
|
||||||
|
|
||||||
struct Box : public CGAL::Box_intersection_d::Box_with_handle_d<double,2,Iterator> {
|
struct Box : public CGAL::Box_intersection_d::Box_with_handle_d<double,2,Iterator> {
|
||||||
|
|
||||||
|
|
@ -31,9 +31,9 @@ class Polylines_do_intersect
|
||||||
|
|
||||||
class Overlap {
|
class Overlap {
|
||||||
|
|
||||||
const Polyline& pA, &pB;
|
const Poly& pA, &pB;
|
||||||
public:
|
public:
|
||||||
Overlap(const Polyline& pA, const Polyline& pB)
|
Overlap(const Poly& pA, const Poly& pB)
|
||||||
: pA(pA), pB(pB)
|
: pA(pA), pB(pB)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
@ -49,7 +49,7 @@ class Polylines_do_intersect
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
Polylines_do_intersect(const Polyline& pA, const Polyline& pB)
|
Polylines_do_intersect(const Poly& pA, const Poly& pB)
|
||||||
: pA(pA), pB(pB)
|
: pA(pA), pB(pB)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
@ -83,22 +83,22 @@ public:
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
template <typename Polyline>
|
template <typename Poly>
|
||||||
bool polylines_do_intersect(const Polyline& pA,const Polyline& pB)
|
bool polylines_do_intersect(const Poly& pA,const Poly& pB)
|
||||||
{
|
{
|
||||||
Polylines_do_intersect<Polyline> pdi(pA,pB);
|
Polylines_do_intersect<Poly> pdi(pA,pB);
|
||||||
return pdi();
|
return pdi();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
|
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
|
||||||
typedef K::Point_2 Point_2;
|
typedef K::Point_2 Point_2;
|
||||||
typedef std::vector<Point_2> Polyline;
|
typedef std::vector<Point_2> CGAL_polyline;
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
Polyline pA = { Point_2(0,0), Point_2(1,0) };
|
CGAL_polyline pA = { Point_2(0,0), Point_2(1,0) };
|
||||||
Polyline pB = { Point_2(0,0), Point_2(0,1), Point_2(2,1) , Point_2(1,0)};
|
CGAL_polyline pB = { Point_2(0,0), Point_2(0,1), Point_2(2,1) , Point_2(1,0)};
|
||||||
|
|
||||||
if(polylines_do_intersect(pA,pB)){
|
if(polylines_do_intersect(pA,pB)){
|
||||||
std::cout << "intersection" << std::endl;
|
std::cout << "intersection" << std::endl;
|
||||||
|
|
|
||||||
|
|
@ -94,7 +94,7 @@ void ASphapeIpelet::protected_run(int fn)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
A.set_alpha(alpha==0?std::max(std::numeric_limits<double>::epsilon(),A.get_nth_alpha(0)/2.):
|
A.set_alpha(alpha==0?(std::max)(std::numeric_limits<double>::epsilon(),A.get_nth_alpha(0)/2.):
|
||||||
(std::size_t) alpha==A.number_of_alphas()?A.get_nth_alpha(alpha-1)+1:A.get_nth_alpha(alpha-1)/2.+A.get_nth_alpha(alpha)/2.);
|
(std::size_t) alpha==A.number_of_alphas()?A.get_nth_alpha(alpha-1)+1:A.get_nth_alpha(alpha-1)/2.+A.get_nth_alpha(alpha)/2.);
|
||||||
for ( Alpha_shape_2::Alpha_shape_edges_iterator it=A.alpha_shape_edges_begin();it!=A.alpha_shape_edges_end();++it)
|
for ( Alpha_shape_2::Alpha_shape_edges_iterator it=A.alpha_shape_edges_begin();it!=A.alpha_shape_edges_end();++it)
|
||||||
draw_in_ipe(A.segment(*it));
|
draw_in_ipe(A.segment(*it));
|
||||||
|
|
|
||||||
|
|
@ -135,8 +135,8 @@ void diagrammeIpelet::protected_run(int fn)
|
||||||
|
|
||||||
Kernel::FT incr_len=(fn<2)?50:75;
|
Kernel::FT incr_len=(fn<2)?50:75;
|
||||||
//slightly increase the size of the Bbox
|
//slightly increase the size of the Bbox
|
||||||
bbox=Iso_rectangle_2(bbox.min()+Kernel::Vector_2(-incr_len,-incr_len),
|
bbox=Iso_rectangle_2((bbox.min)()+Kernel::Vector_2(-incr_len,-incr_len),
|
||||||
bbox.max()+Kernel::Vector_2(incr_len,incr_len));
|
(bbox.max)()+Kernel::Vector_2(incr_len,incr_len));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -90,8 +90,8 @@ void IpeletMesh2::protected_run(int fn)
|
||||||
|
|
||||||
double alpha=0;
|
double alpha=0;
|
||||||
|
|
||||||
int x=static_cast<int>( floor(bbox.max().x()-bbox.min().x()) );
|
int x=static_cast<int>( floor((bbox.max)().x()-(bbox.min)().x()) );
|
||||||
int y=static_cast<int>( floor(bbox.max().y()-bbox.min().y()) );
|
int y=static_cast<int>( floor((bbox.max)().y()-(bbox.min)().y()) );
|
||||||
|
|
||||||
int ret_val;
|
int ret_val;
|
||||||
boost::tie(ret_val,alpha)=request_value_from_user<double>((boost::format("Max edge length (BBox %1%x%2%)") % x % y).str() );
|
boost::tie(ret_val,alpha)=request_value_from_user<double>((boost::format("Max edge length (BBox %1%x%2%)") % x % y).str() );
|
||||||
|
|
|
||||||
|
|
@ -76,7 +76,7 @@ void SubSelectIpelet::protected_run(int fn)
|
||||||
for (std::list<Circle_2>::iterator it=cir_list.begin();it!=cir_list.end();++it)
|
for (std::list<Circle_2>::iterator it=cir_list.begin();it!=cir_list.end();++it)
|
||||||
r_offsets.push_back(sqrt(CGAL::to_double(it->squared_radius())));
|
r_offsets.push_back(sqrt(CGAL::to_double(it->squared_radius())));
|
||||||
|
|
||||||
IpeMatrix tfm (1,0,0,1,-CGAL::to_double(bbox.min().x()),-CGAL::to_double(bbox.min().y()));
|
IpeMatrix tfm (1,0,0,1,-CGAL::to_double((bbox.min)().x()),-CGAL::to_double((bbox.min)().y()));
|
||||||
|
|
||||||
for (std::list<Polygon_2>::iterator it=pol_list.begin();it!=pol_list.end();++it)
|
for (std::list<Polygon_2>::iterator it=pol_list.begin();it!=pol_list.end();++it)
|
||||||
if(!it->is_simple()){
|
if(!it->is_simple()){
|
||||||
|
|
|
||||||
|
|
@ -95,8 +95,8 @@ void MregularIpelet::protected_run(int fn)
|
||||||
draw_in_ipe(rt);
|
draw_in_ipe(rt);
|
||||||
else{//Draw kth Power diagram
|
else{//Draw kth Power diagram
|
||||||
double incr_len=75;
|
double incr_len=75;
|
||||||
bbox=Iso_rectangle_2(bbox.min()+Kernel::Vector_2(-incr_len,-incr_len),
|
bbox=Iso_rectangle_2((bbox.min)()+Kernel::Vector_2(-incr_len,-incr_len),
|
||||||
bbox.max()+Kernel::Vector_2(incr_len,incr_len));
|
(bbox.max)()+Kernel::Vector_2(incr_len,incr_len));
|
||||||
draw_dual_in_ipe(rt,bbox); //draw Voronoi Diagram
|
draw_dual_in_ipe(rt,bbox); //draw Voronoi Diagram
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ void SkeletonIpelet::protected_run(int fn)
|
||||||
std::list<double> offsets;
|
std::list<double> offsets;
|
||||||
//~ "Interior skeleton", "Exterior skeleton","Interior offset","Exterior offset","Interior offsets","Exterior offsets", "Help"
|
//~ "Interior skeleton", "Exterior skeleton","Interior offset","Exterior offset","Interior offsets","Exterior offsets", "Help"
|
||||||
SkeletonPtr ss;
|
SkeletonPtr ss;
|
||||||
double max_edge=std::max((bbox.xmax()-bbox.xmin()),(bbox.ymax()-bbox.ymin()));
|
double max_edge=(std::max)((bbox.xmax()-bbox.xmin()),(bbox.ymax()-bbox.ymin()));
|
||||||
double dist=0.;
|
double dist=0.;
|
||||||
int ret_val=-1;
|
int ret_val=-1;
|
||||||
switch(fn){
|
switch(fn){
|
||||||
|
|
|
||||||
|
|
@ -96,8 +96,8 @@ namespace CGAL_svdlinf {
|
||||||
Kernel::FT incr_len = 75;
|
Kernel::FT incr_len = 75;
|
||||||
// slightly increase the size of the bbox
|
// slightly increase the size of the bbox
|
||||||
bbox = Iso_rectangle_2(
|
bbox = Iso_rectangle_2(
|
||||||
bbox.min()+Kernel::Vector_2(-incr_len,-incr_len),
|
(bbox.min)()+Kernel::Vector_2(-incr_len,-incr_len),
|
||||||
bbox.max()+Kernel::Vector_2(incr_len,incr_len));
|
(bbox.max)()+Kernel::Vector_2(incr_len,incr_len));
|
||||||
|
|
||||||
for (std::list<Segment_2>::iterator
|
for (std::list<Segment_2>::iterator
|
||||||
sit = sg_list.begin();
|
sit = sg_list.begin();
|
||||||
|
|
|
||||||
|
|
@ -256,8 +256,8 @@ public:
|
||||||
_page->DeselectAll();
|
_page->DeselectAll();
|
||||||
|
|
||||||
Iso_rectangle_2 bbox_cgal(
|
Iso_rectangle_2 bbox_cgal(
|
||||||
static_cast<double>(bbox_ipe.Min().iX),static_cast<double>(bbox_ipe.Min().iY),
|
static_cast<double>((bbox_ipe.Min)().iX),static_cast<double>((bbox_ipe.Min)().iY),
|
||||||
static_cast<double>(bbox_ipe.Max().iX),static_cast<double>(bbox_ipe.Max().iY)
|
static_cast<double>((bbox_ipe.Max)().iX),static_cast<double>((bbox_ipe.Max)().iY)
|
||||||
);
|
);
|
||||||
|
|
||||||
return bbox_cgal;
|
return bbox_cgal;
|
||||||
|
|
|
||||||
|
|
@ -58,8 +58,8 @@ public:
|
||||||
m_values.reserve (clusters.size());
|
m_values.reserve (clusters.size());
|
||||||
for (std::size_t i = 0; i < clusters.size(); ++ i)
|
for (std::size_t i = 0; i < clusters.size(); ++ i)
|
||||||
{
|
{
|
||||||
float min_z = std::numeric_limits<float>::max();
|
float min_z = (std::numeric_limits<float>::max)();
|
||||||
float max_z = -std::numeric_limits<float>::min();
|
float max_z = -(std::numeric_limits<float>::min)();
|
||||||
|
|
||||||
for (std::size_t j = 0; j < clusters[i].size(); ++ j)
|
for (std::size_t j = 0; j < clusters[i].size(); ++ j)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ public:
|
||||||
Image_float dem(grid.width(),grid.height());
|
Image_float dem(grid.width(),grid.height());
|
||||||
|
|
||||||
z_max = 0.f;
|
z_max = 0.f;
|
||||||
z_min = std::numeric_limits<float>::max();
|
z_min = (std::numeric_limits<float>::max)();
|
||||||
|
|
||||||
for (std::size_t j = 0; j < grid.height(); ++ j)
|
for (std::size_t j = 0; j < grid.height(); ++ j)
|
||||||
for (std::size_t i = 0; i < grid.width(); ++ i)
|
for (std::size_t i = 0; i < grid.width(); ++ i)
|
||||||
|
|
@ -100,8 +100,8 @@ public:
|
||||||
for (typename Grid::iterator it = grid.indices_begin(i,j); it != end; ++ it)
|
for (typename Grid::iterator it = grid.indices_begin(i,j); it != end; ++ it)
|
||||||
{
|
{
|
||||||
float z = float(get(point_map, *(input.begin()+(*it))).z());
|
float z = float(get(point_map, *(input.begin()+(*it))).z());
|
||||||
z_min = (std::min(z_min, z));
|
z_min = ((std::min)(z_min, z));
|
||||||
z_max = (std::max(z_max, z));
|
z_max = ((std::max)(z_max, z));
|
||||||
mean += z;
|
mean += z;
|
||||||
++ nb;
|
++ nb;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -81,13 +81,13 @@ public:
|
||||||
for (std::size_t i = 0; i < grid.width(); ++ i)
|
for (std::size_t i = 0; i < grid.width(); ++ i)
|
||||||
if (grid.has_points(i,j))
|
if (grid.has_points(i,j))
|
||||||
{
|
{
|
||||||
float z_max = -std::numeric_limits<float>::max();
|
float z_max = -(std::numeric_limits<float>::max)();
|
||||||
|
|
||||||
typename Grid::iterator end = grid.indices_end(i,j);
|
typename Grid::iterator end = grid.indices_end(i,j);
|
||||||
for (typename Grid::iterator it = grid.indices_begin(i,j); it != end; ++ it)
|
for (typename Grid::iterator it = grid.indices_begin(i,j); it != end; ++ it)
|
||||||
{
|
{
|
||||||
float z = float(get(point_map, *(input.begin()+(*it))).z());
|
float z = float(get(point_map, *(input.begin()+(*it))).z());
|
||||||
z_max = (std::max(z_max, z));
|
z_max = ((std::max)(z_max, z));
|
||||||
}
|
}
|
||||||
|
|
||||||
dtm(i,j) = z_max;
|
dtm(i,j) = z_max;
|
||||||
|
|
|
||||||
|
|
@ -81,13 +81,13 @@ public:
|
||||||
for (std::size_t i = 0; i < grid.width(); ++ i)
|
for (std::size_t i = 0; i < grid.width(); ++ i)
|
||||||
if (grid.has_points(i,j))
|
if (grid.has_points(i,j))
|
||||||
{
|
{
|
||||||
float z_min = std::numeric_limits<float>::max();
|
float z_min = (std::numeric_limits<float>::max)();
|
||||||
|
|
||||||
typename Grid::iterator end = grid.indices_end(i,j);
|
typename Grid::iterator end = grid.indices_end(i,j);
|
||||||
for (typename Grid::iterator it = grid.indices_begin(i,j); it != end; ++ it)
|
for (typename Grid::iterator it = grid.indices_begin(i,j); it != end; ++ it)
|
||||||
{
|
{
|
||||||
float z = float(get(point_map, *(input.begin()+(*it))).z());
|
float z = float(get(point_map, *(input.begin()+(*it))).z());
|
||||||
z_min = (std::min(z_min, z));
|
z_min = ((std::min)(z_min, z));
|
||||||
}
|
}
|
||||||
|
|
||||||
dtm(i,j) = z_min;
|
dtm(i,j) = z_min;
|
||||||
|
|
|
||||||
|
|
@ -81,15 +81,15 @@ public:
|
||||||
for (std::size_t i = 0; i < grid.width(); ++ i)
|
for (std::size_t i = 0; i < grid.width(); ++ i)
|
||||||
if (grid.has_points(i,j))
|
if (grid.has_points(i,j))
|
||||||
{
|
{
|
||||||
float z_max = -std::numeric_limits<float>::max();
|
float z_max = -(std::numeric_limits<float>::max)();
|
||||||
float z_min = std::numeric_limits<float>::max();
|
float z_min = (std::numeric_limits<float>::max)();
|
||||||
|
|
||||||
typename Grid::iterator end = grid.indices_end(i,j);
|
typename Grid::iterator end = grid.indices_end(i,j);
|
||||||
for (typename Grid::iterator it = grid.indices_begin(i,j); it != end; ++ it)
|
for (typename Grid::iterator it = grid.indices_begin(i,j); it != end; ++ it)
|
||||||
{
|
{
|
||||||
float z = float(get(point_map, *(input.begin()+(*it))).z());
|
float z = float(get(point_map, *(input.begin()+(*it))).z());
|
||||||
z_max = (std::max(z_max, z));
|
z_max = ((std::max)(z_max, z));
|
||||||
z_min = (std::min(z_min, z));
|
z_min = ((std::min)(z_min, z));
|
||||||
}
|
}
|
||||||
|
|
||||||
dtm(i,j) = z_max - z_min;
|
dtm(i,j) = z_max - z_min;
|
||||||
|
|
|
||||||
|
|
@ -40,15 +40,15 @@ typedef unsigned short compressed_float;
|
||||||
typedef unsigned char compressed_float;
|
typedef unsigned char compressed_float;
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
inline compressed_float compress_float (const float& f, const float& min = 0.f, const float& max = 1.f)
|
inline compressed_float compress_float (const float& f, const float& fmin = 0.f, const float& fmax = 1.f)
|
||||||
{
|
{
|
||||||
return static_cast<compressed_float>
|
return static_cast<compressed_float>
|
||||||
(float(std::numeric_limits<compressed_float>::max()) * (f - min) / (max - min));
|
(float((std::numeric_limits<compressed_float>::max)()) * (f - fmin) / (fmax - fmin));
|
||||||
}
|
}
|
||||||
|
|
||||||
inline float decompress_float (const compressed_float& t, const float& min = 0.f, const float& max = 1.f)
|
inline float decompress_float (const compressed_float& t, const float& fmin = 0.f, const float& fmax = 1.f)
|
||||||
{
|
{
|
||||||
return ((max - min) * (t / float(std::numeric_limits<compressed_float>::max())) + min);
|
return ((fmax - fmin) * (t / float((std::numeric_limits<compressed_float>::max)())) + fmin);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -126,7 +126,7 @@ public:
|
||||||
if (maxz < arz) maxz = arz;
|
if (maxz < arz) maxz = arz;
|
||||||
if (maxz < atz) maxz = atz;
|
if (maxz < atz) maxz = atz;
|
||||||
|
|
||||||
double d = std::max(maxx, std::max(maxy, maxz));
|
double d = (std::max)(maxx, (std::max)(maxy, maxz));
|
||||||
double eps = 3.27418e-11 * d * d * d * d * d * d;
|
double eps = 3.27418e-11 * d * d * d * d * d * d;
|
||||||
|
|
||||||
if (det > eps) return ON_BOUNDED_SIDE;
|
if (det > eps) return ON_BOUNDED_SIDE;
|
||||||
|
|
|
||||||
|
|
@ -38,20 +38,20 @@ int main(int argc, char* argv[])
|
||||||
Point_3 sp = tm.point(source);
|
Point_3 sp = tm.point(source);
|
||||||
|
|
||||||
std::cout << "source: " << sp << " " << source << std::endl;
|
std::cout << "source: " << sp << " " << source << std::endl;
|
||||||
vertex_descriptor far;
|
vertex_descriptor vfar;
|
||||||
double sdistance = 0;
|
double sdistance = 0;
|
||||||
|
|
||||||
for(vertex_descriptor vd : vertices(tm)){
|
for(vertex_descriptor vd : vertices(tm)){
|
||||||
std::cout << vd << " is at distance " << get(vertex_distance, vd) << " to " << source << std::endl;
|
std::cout << vd << " is at distance " << get(vertex_distance, vd) << " to " << source << std::endl;
|
||||||
if(get(vertex_distance, vd) > sdistance){
|
if(get(vertex_distance, vd) > sdistance){
|
||||||
far = vd;
|
vfar = vd;
|
||||||
sdistance = get(vertex_distance, vd);
|
sdistance = get(vertex_distance, vd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << "far: " << tm.point(far) << " " << far << std::endl;
|
std::cout << "vfar: " << tm.point(vfar) << " " << vfar << std::endl;
|
||||||
|
|
||||||
hm.add_source(far);
|
hm.add_source(vfar);
|
||||||
hm.estimate_geodesic_distances(vertex_distance);
|
hm.estimate_geodesic_distances(vertex_distance);
|
||||||
|
|
||||||
for(vertex_descriptor vd : vertices(tm)){
|
for(vertex_descriptor vd : vertices(tm)){
|
||||||
|
|
|
||||||
|
|
@ -42,19 +42,19 @@ int main()
|
||||||
|
|
||||||
//Point_3 sp = sm.point(source);
|
//Point_3 sp = sm.point(source);
|
||||||
|
|
||||||
vertex_descriptor far;
|
vertex_descriptor vfar;
|
||||||
// double sdistance = 0;
|
// double sdistance = 0;
|
||||||
|
|
||||||
for(vertex_descriptor vd : vertices(sm)){
|
for(vertex_descriptor vd : vertices(sm)){
|
||||||
std::cout << vd << " is at distance " << get(heat_intensity, vd) << " from " << source << std::endl;
|
std::cout << vd << " is at distance " << get(heat_intensity, vd) << " from " << source << std::endl;
|
||||||
/*
|
/*
|
||||||
if(squared_distance(sp,sm.point(vd)) > sdistance){
|
if(squared_distance(sp,sm.point(vd)) > sdistance){
|
||||||
far = vd;
|
vfar = vd;
|
||||||
sdistance = squared_distance(sp,sm.point(vd));
|
sdistance = squared_distance(sp,sm.point(vd));
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
}
|
}
|
||||||
hm.add_source(far);
|
hm.add_source(vfar);
|
||||||
hm.estimate_geodesic_distances(heat_intensity);
|
hm.estimate_geodesic_distances(heat_intensity);
|
||||||
|
|
||||||
for(vertex_descriptor vd : vertices(sm)){
|
for(vertex_descriptor vd : vertices(sm)){
|
||||||
|
|
|
||||||
|
|
@ -36,19 +36,19 @@ int main(int argc, char* argv[])
|
||||||
Point_3 sp = sm.point(source);
|
Point_3 sp = sm.point(source);
|
||||||
|
|
||||||
std::cout << "source: " << sp << " " << source << std::endl;
|
std::cout << "source: " << sp << " " << source << std::endl;
|
||||||
vertex_descriptor far;
|
vertex_descriptor vfar;
|
||||||
double sdistance = 0;
|
double sdistance = 0;
|
||||||
|
|
||||||
for(vertex_descriptor vd : vertices(sm)){
|
for(vertex_descriptor vd : vertices(sm)){
|
||||||
if(get(vertex_distance,vd) > sdistance){
|
if(get(vertex_distance,vd) > sdistance){
|
||||||
far = vd;
|
vfar = vd;
|
||||||
sdistance = get(vertex_distance,vd);
|
sdistance = get(vertex_distance,vd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assert(sdistance > 2.9);
|
assert(sdistance > 2.9);
|
||||||
assert(sdistance < CGAL_PI);
|
assert(sdistance < CGAL_PI);
|
||||||
|
|
||||||
hm.add_source(far);
|
hm.add_source(vfar);
|
||||||
assert(hm.sources().size() == 2);
|
assert(hm.sources().size() == 2);
|
||||||
hm.estimate_geodesic_distances(vertex_distance);
|
hm.estimate_geodesic_distances(vertex_distance);
|
||||||
|
|
||||||
|
|
@ -62,7 +62,7 @@ int main(int argc, char* argv[])
|
||||||
assert(sdistance > 1.4);
|
assert(sdistance > 1.4);
|
||||||
assert(sdistance < CGAL_PI/2.0);
|
assert(sdistance < CGAL_PI/2.0);
|
||||||
|
|
||||||
hm.remove_source(far);
|
hm.remove_source(vfar);
|
||||||
assert(hm.sources().size() == 1);
|
assert(hm.sources().size() == 1);
|
||||||
|
|
||||||
hm.clear_sources();
|
hm.clear_sources();
|
||||||
|
|
@ -70,7 +70,7 @@ int main(int argc, char* argv[])
|
||||||
// add range of sources
|
// add range of sources
|
||||||
std::vector<vertex_descriptor> vrange;
|
std::vector<vertex_descriptor> vrange;
|
||||||
vrange.push_back(source);
|
vrange.push_back(source);
|
||||||
vrange.push_back(far);
|
vrange.push_back(vfar);
|
||||||
hm.add_sources(vrange);
|
hm.add_sources(vrange);
|
||||||
assert(hm.sources().size() == 2);
|
assert(hm.sources().size() == 2);
|
||||||
hm.estimate_geodesic_distances(vertex_distance);
|
hm.estimate_geodesic_distances(vertex_distance);
|
||||||
|
|
|
||||||
|
|
@ -36,19 +36,19 @@ int main(int argc, char* argv[])
|
||||||
Point_3 sp = sm.point(source);
|
Point_3 sp = sm.point(source);
|
||||||
|
|
||||||
std::cout << "source: " << sp << " " << source << std::endl;
|
std::cout << "source: " << sp << " " << source << std::endl;
|
||||||
vertex_descriptor far;
|
vertex_descriptor vfar;
|
||||||
double sdistance = 0;
|
double sdistance = 0;
|
||||||
|
|
||||||
for(vertex_descriptor vd : vertices(sm)){
|
for(vertex_descriptor vd : vertices(sm)){
|
||||||
if(get(vertex_distance,vd) > sdistance){
|
if(get(vertex_distance,vd) > sdistance){
|
||||||
far = vd;
|
vfar = vd;
|
||||||
sdistance = get(vertex_distance,vd);
|
sdistance = get(vertex_distance,vd);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
assert(sdistance > 2.9);
|
assert(sdistance > 2.9);
|
||||||
assert(sdistance < CGAL_PI);
|
assert(sdistance < CGAL_PI);
|
||||||
|
|
||||||
hm.add_source(far);
|
hm.add_source(vfar);
|
||||||
assert(hm.sources().size() == 2);
|
assert(hm.sources().size() == 2);
|
||||||
hm.estimate_geodesic_distances(vertex_distance);
|
hm.estimate_geodesic_distances(vertex_distance);
|
||||||
|
|
||||||
|
|
@ -62,7 +62,7 @@ int main(int argc, char* argv[])
|
||||||
assert(sdistance > 1.4);
|
assert(sdistance > 1.4);
|
||||||
assert(sdistance < CGAL_PI/2.0);
|
assert(sdistance < CGAL_PI/2.0);
|
||||||
|
|
||||||
hm.remove_source(far);
|
hm.remove_source(vfar);
|
||||||
assert(hm.sources().size() == 1);
|
assert(hm.sources().size() == 1);
|
||||||
|
|
||||||
hm.clear_sources();
|
hm.clear_sources();
|
||||||
|
|
@ -70,7 +70,7 @@ int main(int argc, char* argv[])
|
||||||
// add range of sources
|
// add range of sources
|
||||||
std::vector<vertex_descriptor> vrange;
|
std::vector<vertex_descriptor> vrange;
|
||||||
vrange.push_back(source);
|
vrange.push_back(source);
|
||||||
vrange.push_back(far);
|
vrange.push_back(vfar);
|
||||||
hm.add_sources(vrange);
|
hm.add_sources(vrange);
|
||||||
assert(hm.sources().size() == 2);
|
assert(hm.sources().size() == 2);
|
||||||
hm.estimate_geodesic_distances(vertex_distance);
|
hm.estimate_geodesic_distances(vertex_distance);
|
||||||
|
|
|
||||||
|
|
@ -318,7 +318,7 @@ MainWindow::on_actionInsertRandomPoints_triggered()
|
||||||
tr("Enter number of random points"),
|
tr("Enter number of random points"),
|
||||||
100,
|
100,
|
||||||
0,
|
0,
|
||||||
std::numeric_limits<int>::max(),
|
(std::numeric_limits<int>::max)(),
|
||||||
1,
|
1,
|
||||||
&ok);
|
&ok);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
double d = std::numeric_limits<double>::denorm_min();
|
double d = std::numeric_limits<double>::denorm_min();
|
||||||
double e = std::numeric_limits<double>::min();
|
double e = (std::numeric_limits<double>::min)();
|
||||||
// Note : denorm_min == min is actually not necessarily a bug.
|
// Note : denorm_min == min is actually not necessarily a bug.
|
||||||
// So a better test should be found.
|
// So a better test should be found.
|
||||||
if (d == 0 || d == e)
|
if (d == 0 || d == e)
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ namespace CGAL {
|
||||||
#ifdef CGAL_EIGEN3_ENABLED
|
#ifdef CGAL_EIGEN3_ENABLED
|
||||||
const int UNKNOWN_DIMENSION=Eigen::Dynamic;
|
const int UNKNOWN_DIMENSION=Eigen::Dynamic;
|
||||||
#else
|
#else
|
||||||
const int UNKNOWN_DIMENSION=std::numeric_limits<int>::max();
|
const int UNKNOWN_DIMENSION=(std::numeric_limits<int>::max)();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Check that dimension d1 is fine for a kernel of dimension d2.
|
// Check that dimension d1 is fine for a kernel of dimension d2.
|
||||||
|
|
|
||||||
|
|
@ -57,8 +57,8 @@ template <typename K>
|
||||||
inline std::enable_if_t<std::is_same<typename K::Rep_tag, Cartesian_tag>::value, std::size_t>
|
inline std::enable_if_t<std::is_same<typename K::Rep_tag, Cartesian_tag>::value, std::size_t>
|
||||||
hash_value (const Iso_rectangle_2<K>& iso_rectangle)
|
hash_value (const Iso_rectangle_2<K>& iso_rectangle)
|
||||||
{
|
{
|
||||||
std::size_t result = hash_value(iso_rectangle.min());
|
std::size_t result = hash_value((iso_rectangle.min)());
|
||||||
boost::hash_combine(result, hash_value(iso_rectangle.max()));
|
boost::hash_combine(result, hash_value((iso_rectangle.max)()));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -126,8 +126,8 @@ template <typename K>
|
||||||
inline std::enable_if_t<std::is_same<typename K::Rep_tag, Cartesian_tag>::value, std::size_t>
|
inline std::enable_if_t<std::is_same<typename K::Rep_tag, Cartesian_tag>::value, std::size_t>
|
||||||
hash_value (const Iso_cuboid_3<K>& iso_cuboid)
|
hash_value (const Iso_cuboid_3<K>& iso_cuboid)
|
||||||
{
|
{
|
||||||
std::size_t result = hash_value(iso_cuboid.min());
|
std::size_t result = hash_value((iso_cuboid.min)());
|
||||||
boost::hash_combine(result, hash_value(iso_cuboid.max()));
|
boost::hash_combine(result, hash_value((iso_cuboid.max)()));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -91,8 +91,8 @@ int main() {
|
||||||
assert(b1.bounded_side(qq1)==CGAL::ON_BOUNDARY);
|
assert(b1.bounded_side(qq1)==CGAL::ON_BOUNDARY);
|
||||||
assert(b1.bounded_side(qq4)==CGAL::ON_UNBOUNDED_SIDE);
|
assert(b1.bounded_side(qq4)==CGAL::ON_UNBOUNDED_SIDE);
|
||||||
assert(b1.bounded_side(mm1)==CGAL::ON_BOUNDED_SIDE);
|
assert(b1.bounded_side(mm1)==CGAL::ON_BOUNDED_SIDE);
|
||||||
// std::cout << "b1.min()=" << b1.min() << std::endl;
|
// std::cout << "(b1.min)()=" << (b1.min)() << std::endl;
|
||||||
// std::cout << "b1.max()=" << b1.max() << std::endl;
|
// std::cout << "(b1.max)()=" << (b1.max)() << std::endl;
|
||||||
std::cout << "volume of b1=" << b1.volume() << std::endl;
|
std::cout << "volume of b1=" << b1.volume() << std::endl;
|
||||||
std::cout << "volume of b4=" << b4.volume() << std::endl;
|
std::cout << "volume of b4=" << b4.volume() << std::endl;
|
||||||
std::cout << "volume of b5=" << b5.volume() << std::endl;
|
std::cout << "volume of b5=" << b5.volume() << std::endl;
|
||||||
|
|
|
||||||
|
|
@ -94,8 +94,8 @@ int main() {
|
||||||
assert(b1.bounded_side(qq1)==CGAL::ON_BOUNDARY);
|
assert(b1.bounded_side(qq1)==CGAL::ON_BOUNDARY);
|
||||||
assert(b1.bounded_side(qq4)==CGAL::ON_UNBOUNDED_SIDE);
|
assert(b1.bounded_side(qq4)==CGAL::ON_UNBOUNDED_SIDE);
|
||||||
assert(b1.bounded_side(mm1)==CGAL::ON_BOUNDED_SIDE);
|
assert(b1.bounded_side(mm1)==CGAL::ON_BOUNDED_SIDE);
|
||||||
// std::cout << "b1.min()=" << b1.min() << std::endl;
|
// std::cout << "(b1.min)()=" << (b1.min)() << std::endl;
|
||||||
// std::cout << "b1.max()=" << b1.max() << std::endl;
|
// std::cout << "(b1.max)()=" << (b1.max)() << std::endl;
|
||||||
std::cout << "volume of b1=" << b1.volume() << std::endl;
|
std::cout << "volume of b1=" << b1.volume() << std::endl;
|
||||||
std::cout << "volume of b4=" << b4.volume() << std::endl;
|
std::cout << "volume of b4=" << b4.volume() << std::endl;
|
||||||
std::cout << "volume of b5=" << b5.volume() << std::endl;
|
std::cout << "volume of b5=" << b5.volume() << std::endl;
|
||||||
|
|
|
||||||
|
|
@ -32,15 +32,15 @@ class Compute_min_angle
|
||||||
operator()(const Cell_handle ch) const
|
operator()(const Cell_handle ch) const
|
||||||
{
|
{
|
||||||
double min_quotient = compute_quotient(ch, 0, 1, 2, 3);
|
double min_quotient = compute_quotient(ch, 0, 1, 2, 3);
|
||||||
min_quotient = std::min(min_quotient,
|
min_quotient = (std::min)(min_quotient,
|
||||||
compute_quotient(ch, 0, 2, 1, 3));
|
compute_quotient(ch, 0, 2, 1, 3));
|
||||||
min_quotient = std::min(min_quotient,
|
min_quotient = (std::min)(min_quotient,
|
||||||
compute_quotient(ch, 0, 3, 1, 2));
|
compute_quotient(ch, 0, 3, 1, 2));
|
||||||
min_quotient = std::min(min_quotient,
|
min_quotient = (std::min)(min_quotient,
|
||||||
compute_quotient(ch, 1, 2, 0, 3));
|
compute_quotient(ch, 1, 2, 0, 3));
|
||||||
min_quotient = std::min(min_quotient,
|
min_quotient = (std::min)(min_quotient,
|
||||||
compute_quotient(ch, 1, 3, 0, 2));
|
compute_quotient(ch, 1, 3, 0, 2));
|
||||||
min_quotient = std::min(min_quotient,
|
min_quotient = (std::min)(min_quotient,
|
||||||
compute_quotient(ch, 2, 3, 0, 1));
|
compute_quotient(ch, 2, 3, 0, 1));
|
||||||
|
|
||||||
const double volume = CGAL::to_double(tr.tetrahedron(ch).volume());
|
const double volume = CGAL::to_double(tr.tetrahedron(ch).volume());
|
||||||
|
|
@ -119,19 +119,19 @@ namespace CGAL {
|
||||||
min_dihedral_angle_aux_compute_quotient(p0, p1, p2, p3, k);
|
min_dihedral_angle_aux_compute_quotient(p0, p1, p2, p3, k);
|
||||||
|
|
||||||
min_quotient =
|
min_quotient =
|
||||||
std::min(min_quotient,
|
(std::min)(min_quotient,
|
||||||
min_dihedral_angle_aux_compute_quotient(p0, p2, p1, p3, k));
|
min_dihedral_angle_aux_compute_quotient(p0, p2, p1, p3, k));
|
||||||
min_quotient =
|
min_quotient =
|
||||||
std::min(min_quotient,
|
(std::min)(min_quotient,
|
||||||
min_dihedral_angle_aux_compute_quotient(p0, p3, p1, p2, k));
|
min_dihedral_angle_aux_compute_quotient(p0, p3, p1, p2, k));
|
||||||
min_quotient =
|
min_quotient =
|
||||||
std::min(min_quotient,
|
(std::min)(min_quotient,
|
||||||
min_dihedral_angle_aux_compute_quotient(p1, p2, p0, p3, k));
|
min_dihedral_angle_aux_compute_quotient(p1, p2, p0, p3, k));
|
||||||
min_quotient =
|
min_quotient =
|
||||||
std::min(min_quotient,
|
(std::min)(min_quotient,
|
||||||
min_dihedral_angle_aux_compute_quotient(p1, p3, p0, p2, k));
|
min_dihedral_angle_aux_compute_quotient(p1, p3, p0, p2, k));
|
||||||
min_quotient =
|
min_quotient =
|
||||||
std::min(min_quotient,
|
(std::min)(min_quotient,
|
||||||
min_dihedral_angle_aux_compute_quotient(p2, p3, p0, p1, k));
|
min_dihedral_angle_aux_compute_quotient(p2, p3, p0, p1, k));
|
||||||
|
|
||||||
// std::cerr << CGAL::sqrt(min_quotient) << " - "
|
// std::cerr << CGAL::sqrt(min_quotient) << " - "
|
||||||
|
|
|
||||||
|
|
@ -443,7 +443,7 @@ private:
|
||||||
pNode->ref_node(candidate.ref_node());
|
pNode->ref_node(candidate.ref_node());
|
||||||
pNode->size() = candidate.size();
|
pNode->size() = candidate.size();
|
||||||
pNode->done() = true;
|
pNode->done() = true;
|
||||||
m_max_size = std::max(m_max_size,pNode->size());
|
m_max_size = (std::max)(m_max_size,pNode->size());
|
||||||
|
|
||||||
// explore neighbors
|
// explore neighbors
|
||||||
for(unsigned int index_neighbor = 0;
|
for(unsigned int index_neighbor = 0;
|
||||||
|
|
|
||||||
|
|
@ -87,9 +87,9 @@ class visual_hull_creator : public CGAL::Modifier_base<SNC_> {
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
visual_hull_creator(Point_3 min, Point_3 max, Point_3 position,
|
visual_hull_creator(Point_3 pmin, Point_3 pmax, Point_3 position,
|
||||||
std::list<std::list<Point_3> > p) :
|
std::list<std::list<Point_3> > p) :
|
||||||
room_min(min), room_max(max), c_pos(position), polygon_list(p) { }
|
room_min(pmin), room_max(pmax), c_pos(position), polygon_list(p) { }
|
||||||
|
|
||||||
/*
|
/*
|
||||||
void recompute_scene() {
|
void recompute_scene() {
|
||||||
|
|
|
||||||
|
|
@ -375,24 +375,24 @@ class Infimaximal_box<Tag_true, Kernel> {
|
||||||
C.create_vertices_of_box_with_plane(h, b);
|
C.create_vertices_of_box_with_plane(h, b);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void compute_min_max(const Plane_3& h, NT orth_coords[3], int& min, int& max) {
|
static void compute_min_max(const Plane_3& h, NT orth_coords[3], int& cmin, int& cmax) {
|
||||||
Vector_3 orth = h.orthogonal_vector();
|
Vector_3 orth = h.orthogonal_vector();
|
||||||
|
|
||||||
orth_coords[0] = CGAL_NTS abs(orth.hx()[0]);
|
orth_coords[0] = CGAL_NTS abs(orth.hx()[0]);
|
||||||
orth_coords[1] = CGAL_NTS abs(orth.hy()[0]);
|
orth_coords[1] = CGAL_NTS abs(orth.hy()[0]);
|
||||||
orth_coords[2] = CGAL_NTS abs(orth.hz()[0]);
|
orth_coords[2] = CGAL_NTS abs(orth.hz()[0]);
|
||||||
|
|
||||||
max = 0;
|
cmax = 0;
|
||||||
if(orth_coords[1] > orth_coords[0])
|
if(orth_coords[1] > orth_coords[0])
|
||||||
max = 1;
|
cmax = 1;
|
||||||
if(orth_coords[2] > orth_coords[max])
|
if(orth_coords[2] > orth_coords[cmax])
|
||||||
max = 2;
|
cmax = 2;
|
||||||
|
|
||||||
min = 0;
|
cmin = 0;
|
||||||
if(orth_coords[1] < orth_coords[0])
|
if(orth_coords[1] < orth_coords[0])
|
||||||
min = 1;
|
cmin = 1;
|
||||||
if(orth_coords[2] < orth_coords[min])
|
if(orth_coords[2] < orth_coords[cmin])
|
||||||
min = 2;
|
cmin = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<typename SNC_structure>
|
template<typename SNC_structure>
|
||||||
|
|
|
||||||
|
|
@ -142,7 +142,7 @@ class Quotient
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CGAL_ROOT_OF_2_ENABLE_HISTOGRAM_OF_NUMBER_OF_DIGIT_ON_THE_COMPLEX_CONSTRUCTOR
|
#ifdef CGAL_ROOT_OF_2_ENABLE_HISTOGRAM_OF_NUMBER_OF_DIGIT_ON_THE_COMPLEX_CONSTRUCTOR
|
||||||
int tam() const { return std::max(num.tam(), den.tam()); }
|
int tam() const { return (std::max)(num.tam(), den.tam()); }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ compute_fitness(const typename Traits::Matrix& R, // rotation matrix
|
||||||
CGAL_assertion(points.size() >= 3);
|
CGAL_assertion(points.size() >= 3);
|
||||||
|
|
||||||
FT xmin, ymin, zmin, xmax, ymax, zmax;
|
FT xmin, ymin, zmin, xmax, ymax, zmax;
|
||||||
xmin = ymin = zmin = FT{std::numeric_limits<double>::max()};
|
xmin = ymin = zmin = FT{(std::numeric_limits<double>::max)()};
|
||||||
xmax = ymax = zmax = FT{std::numeric_limits<double>::lowest()};
|
xmax = ymax = zmax = FT{std::numeric_limits<double>::lowest()};
|
||||||
|
|
||||||
for(const Point& pt : points)
|
for(const Point& pt : points)
|
||||||
|
|
@ -81,7 +81,7 @@ compute_fitness_if_smaller(const typename Traits::Matrix& R, // rotation matrix
|
||||||
CGAL_assertion(points.size() >= 3);
|
CGAL_assertion(points.size() >= 3);
|
||||||
|
|
||||||
FT xmin, ymin, zmin, xmax, ymax, zmax;
|
FT xmin, ymin, zmin, xmax, ymax, zmax;
|
||||||
xmin = ymin = zmin = FT{std::numeric_limits<double>::max()};
|
xmin = ymin = zmin = FT{(std::numeric_limits<double>::max)()};
|
||||||
xmax = ymax = zmax = FT{std::numeric_limits<double>::lowest()};
|
xmax = ymax = zmax = FT{std::numeric_limits<double>::lowest()};
|
||||||
|
|
||||||
// compute every 1%, with a minimum of 1000 iterations
|
// compute every 1%, with a minimum of 1000 iterations
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ void optimize_along_OBB_axes(typename Traits::Matrix& rot,
|
||||||
rotated_points.reserve(points.size());
|
rotated_points.reserve(points.size());
|
||||||
|
|
||||||
FT xmin, ymin, zmin, xmax, ymax, zmax;
|
FT xmin, ymin, zmin, xmax, ymax, zmax;
|
||||||
xmin = ymin = zmin = FT{std::numeric_limits<double>::max()};
|
xmin = ymin = zmin = FT{(std::numeric_limits<double>::max)()};
|
||||||
xmax = ymax = zmax = FT{std::numeric_limits<double>::lowest()};
|
xmax = ymax = zmax = FT{std::numeric_limits<double>::lowest()};
|
||||||
|
|
||||||
for(const Point& pt : points)
|
for(const Point& pt : points)
|
||||||
|
|
|
||||||
|
|
@ -121,7 +121,7 @@ public:
|
||||||
Vertex& get_best_vertex()
|
Vertex& get_best_vertex()
|
||||||
{
|
{
|
||||||
std::size_t simplex_id = static_cast<std::size_t>(-1), vertex_id = static_cast<std::size_t>(-1);
|
std::size_t simplex_id = static_cast<std::size_t>(-1), vertex_id = static_cast<std::size_t>(-1);
|
||||||
FT best_fitness = FT{std::numeric_limits<double>::max()};
|
FT best_fitness = FT{(std::numeric_limits<double>::max)()};
|
||||||
for(std::size_t i=0, ps=m_simplices.size(); i<ps; ++i)
|
for(std::size_t i=0, ps=m_simplices.size(); i<ps; ++i)
|
||||||
{
|
{
|
||||||
for(std::size_t j=0; j<4; ++j)
|
for(std::size_t j=0; j<4; ++j)
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ bool is_equal(const FT d1, const FT d2)
|
||||||
|
|
||||||
bool ok;
|
bool ok;
|
||||||
if(std::is_floating_point<FT>::value)
|
if(std::is_floating_point<FT>::value)
|
||||||
ok = CGAL::abs(d1 - d2) < std::max(epsilon * d1, epsilon);
|
ok = CGAL::abs(d1 - d2) < (std::max)(epsilon * d1, epsilon);
|
||||||
else
|
else
|
||||||
ok = (d1 == d2);
|
ok = (d1 == d2);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -129,10 +129,10 @@ protected:
|
||||||
for(int j = 0; j < covering_sheets[1]; j++){
|
for(int j = 0; j < covering_sheets[1]; j++){
|
||||||
Kernel::Vector_2 shift(i * (orig_domain.xmax() - orig_domain.xmin()),
|
Kernel::Vector_2 shift(i * (orig_domain.xmax() - orig_domain.xmin()),
|
||||||
j * orig_domain.ymax() - orig_domain.ymin());
|
j * orig_domain.ymax() - orig_domain.ymin());
|
||||||
Kernel::Point_2 p1(orig_domain.min());
|
Kernel::Point_2 p1((orig_domain.min)());
|
||||||
Kernel::Point_2 p2(orig_domain.xmin(), orig_domain.ymax());
|
Kernel::Point_2 p2(orig_domain.xmin(), orig_domain.ymax());
|
||||||
Kernel::Point_2 p3(orig_domain.xmax(), orig_domain.ymin());
|
Kernel::Point_2 p3(orig_domain.xmax(), orig_domain.ymin());
|
||||||
Kernel::Point_2 p4(orig_domain.max());
|
Kernel::Point_2 p4((orig_domain.max)());
|
||||||
|
|
||||||
add_segment(p1 + shift, p2 + shift, CGAL::Color(96, 104, 252));
|
add_segment(p1 + shift, p2 + shift, CGAL::Color(96, 104, 252));
|
||||||
add_segment(p1 + shift, p3 + shift, CGAL::Color(96, 104, 252));
|
add_segment(p1 + shift, p3 + shift, CGAL::Color(96, 104, 252));
|
||||||
|
|
|
||||||
|
|
@ -43,9 +43,9 @@ canonicalize_triangle(const typename Triangulation::Periodic_triangle& pt)
|
||||||
Offset o0 = pt[0].second;
|
Offset o0 = pt[0].second;
|
||||||
Offset o1 = pt[1].second;
|
Offset o1 = pt[1].second;
|
||||||
Offset o2 = pt[2].second;
|
Offset o2 = pt[2].second;
|
||||||
int diffx = std::min(o0.x(), std::min(o1.x(), o2.x()));
|
int diffx = (std::min)(o0.x(), (std::min)(o1.x(), o2.x()));
|
||||||
int diffy = std::min(o0.y(), std::min(o1.y(), o2.y()));
|
int diffy = (std::min)(o0.y(), (std::min)(o1.y(), o2.y()));
|
||||||
int diffz = std::min(o0.z(), std::min(o1.z(), o2.z()));
|
int diffz = (std::min)(o0.z(), (std::min)(o1.z(), o2.z()));
|
||||||
Offset diff_off(diffx, diffy, diffz);
|
Offset diff_off(diffx, diffy, diffz);
|
||||||
|
|
||||||
return CGAL::make_array(std::make_pair(pt[0].first, o0 - diff_off),
|
return CGAL::make_array(std::make_pair(pt[0].first, o0 - diff_off),
|
||||||
|
|
@ -64,9 +64,9 @@ canonicalize_tetrahedron(const typename Triangulation::Periodic_tetrahedron& pt)
|
||||||
Offset o2 = pt[2].second;
|
Offset o2 = pt[2].second;
|
||||||
Offset o3 = pt[3].second;
|
Offset o3 = pt[3].second;
|
||||||
|
|
||||||
int diffx = std::min(std::min(o0.x(), o1.x()), std::min(o2.x(), o3.x()));
|
int diffx = (std::min)((std::min)(o0.x(), o1.x()), (std::min)(o2.x(), o3.x()));
|
||||||
int diffy = std::min(std::min(o0.y(), o1.y()), std::min(o2.y(), o3.y()));
|
int diffy = (std::min)((std::min)(o0.y(), o1.y()), (std::min)(o2.y(), o3.y()));
|
||||||
int diffz = std::min(std::min(o0.z(), o1.z()), std::min(o2.z(), o3.z()));
|
int diffz = (std::min)((std::min)(o0.z(), o1.z()), (std::min)(o2.z(), o3.z()));
|
||||||
Offset diff_off(diffx, diffy, diffz);
|
Offset diff_off(diffx, diffy, diffz);
|
||||||
|
|
||||||
return CGAL::make_array(std::make_pair(pt[0].first, o0 - diff_off),
|
return CGAL::make_array(std::make_pair(pt[0].first, o0 - diff_off),
|
||||||
|
|
|
||||||
|
|
@ -184,18 +184,18 @@ struct Segments_function
|
||||||
Segments_function()
|
Segments_function()
|
||||||
: segments(), nb_evals(0)
|
: segments(), nb_evals(0)
|
||||||
{
|
{
|
||||||
const FT min = 1, max = 3;
|
const FT vmin = 1, vmax = 3;
|
||||||
const FT mid = 0.5 * (min + max);
|
const FT mid = 0.5 * (vmin + vmax);
|
||||||
const Point pmid(mid, mid, mid);
|
const Point pmid(mid, mid, mid);
|
||||||
|
|
||||||
segments.push_back(Segment(Point(min, mid, min), pmid));
|
segments.push_back(Segment(Point(vmin, mid, vmin), pmid));
|
||||||
segments.push_back(Segment(Point(max, mid, min), pmid));
|
segments.push_back(Segment(Point(vmax, mid, vmin), pmid));
|
||||||
segments.push_back(Segment(Point(min, mid, max), pmid));
|
segments.push_back(Segment(Point(vmin, mid, vmax), pmid));
|
||||||
segments.push_back(Segment(Point(max, mid, max), pmid));
|
segments.push_back(Segment(Point(vmax, mid, vmax), pmid));
|
||||||
segments.push_back(Segment(Point(mid, min, min), pmid));
|
segments.push_back(Segment(Point(mid, vmin, vmin), pmid));
|
||||||
segments.push_back(Segment(Point(mid, max, min), pmid));
|
segments.push_back(Segment(Point(mid, vmax, vmin), pmid));
|
||||||
segments.push_back(Segment(Point(mid, min, max), pmid));
|
segments.push_back(Segment(Point(mid, vmin, vmax), pmid));
|
||||||
segments.push_back(Segment(Point(mid, max, max), pmid));
|
segments.push_back(Segment(Point(mid, vmax, vmax), pmid));
|
||||||
}
|
}
|
||||||
|
|
||||||
FT operator()(const Point& p)
|
FT operator()(const Point& p)
|
||||||
|
|
@ -204,7 +204,7 @@ struct Segments_function
|
||||||
|
|
||||||
FT min_distance = 1000000;
|
FT min_distance = 1000000;
|
||||||
for (Segments::const_iterator si = segments.begin(); si != segments.end(); ++si)
|
for (Segments::const_iterator si = segments.begin(); si != segments.end(); ++si)
|
||||||
min_distance = std::min(CGAL::squared_distance(p, *si), min_distance);
|
min_distance = (std::min)(CGAL::squared_distance(p, *si), min_distance);
|
||||||
|
|
||||||
return min_distance - 0.01; // Change the squared beam radius here
|
return min_distance - 0.01; // Change the squared beam radius here
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -61,17 +61,17 @@ Point my_rand_p3()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Random int in [0;256).
|
// Random int in [0;256).
|
||||||
int my_rand_int(int min, int max)
|
int my_rand_int(int imin, int imax)
|
||||||
{
|
{
|
||||||
return r->get_int(min, max+1);
|
return r->get_int(imin, imax+1);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Random offset
|
// Random offset
|
||||||
Offset my_rand_o3(int min, int max)
|
Offset my_rand_o3(int imin, int imax)
|
||||||
{
|
{
|
||||||
int x = my_rand_int(min,max);
|
int x = my_rand_int(imin,imax);
|
||||||
int y = my_rand_int(min,max);
|
int y = my_rand_int(imin,imax);
|
||||||
int z = my_rand_int(min,max);
|
int z = my_rand_int(imin,imax);
|
||||||
return Offset(x, y, z);
|
return Offset(x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -351,7 +351,7 @@ MainWindow::on_actionInsertRandomPoints_triggered()
|
||||||
tr("Enter number of random points"),
|
tr("Enter number of random points"),
|
||||||
100,
|
100,
|
||||||
0,
|
0,
|
||||||
std::numeric_limits<int>::max(),
|
(std::numeric_limits<int>::max)(),
|
||||||
1,
|
1,
|
||||||
&ok);
|
&ok);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -608,15 +608,15 @@ protected:
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now we know that all vertices lie in different regions.
|
// Now we know that all vertices lie in different regions.
|
||||||
Hyperbolic_translation min(7, 2, 5);
|
Hyperbolic_translation vmin(7, 2, 5);
|
||||||
Hyperbolic_translation trans;
|
Hyperbolic_translation trans;
|
||||||
for(int i=0; i<3; ++i)
|
for(int i=0; i<3; ++i)
|
||||||
{
|
{
|
||||||
int j = (i + 1) % 3; // the index of the 'next' vertex
|
int j = (i + 1) % 3; // the index of the 'next' vertex
|
||||||
Hyperbolic_translation tmp = fh->translation(i).inverse() * fh->translation(j);
|
Hyperbolic_translation tmp = fh->translation(i).inverse() * fh->translation(j);
|
||||||
if(tmp < min)
|
if(tmp < vmin)
|
||||||
{
|
{
|
||||||
min = tmp;
|
vmin = tmp;
|
||||||
trans = fh->translation(i).inverse();
|
trans = fh->translation(i).inverse();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -106,9 +106,9 @@ int main(int argc, char* argv[])
|
||||||
t.start();
|
t.start();
|
||||||
std::cerr << "bbox"<< std::endl;
|
std::cerr << "bbox"<< std::endl;
|
||||||
Iso_cuboid_3 ic = CGAL::bounding_box(points(m).begin(), points(m).end());
|
Iso_cuboid_3 ic = CGAL::bounding_box(points(m).begin(), points(m).end());
|
||||||
Point_3 p = midpoint(ic.min(), ic.max());
|
Point_3 p = midpoint((ic.min)(), (ic.max)());
|
||||||
double zmin = ic.min().z();
|
double zmin = (ic.min)().z();
|
||||||
double zmax = ic.max().z();
|
double zmax = (ic.max)().z();
|
||||||
double delta = (zmax - zmin)/N;
|
double delta = (zmax - zmin)/N;
|
||||||
|
|
||||||
std::cerr << "slicer"<< std::endl;
|
std::cerr << "slicer"<< std::endl;
|
||||||
|
|
|
||||||
|
|
@ -51,9 +51,9 @@ class Traversal_traits_with_transformation_helper
|
||||||
|
|
||||||
AK::Aff_transformation_3 a_at = c2f(at);
|
AK::Aff_transformation_3 a_at = c2f(at);
|
||||||
|
|
||||||
AK::FT xtrm[6] = { c2f(bbox.min(0)), c2f(bbox.max(0)),
|
AK::FT xtrm[6] = { c2f((bbox.min)(0)), c2f((bbox.max)(0)),
|
||||||
c2f(bbox.min(1)), c2f(bbox.max(1)),
|
c2f((bbox.min)(1)), c2f((bbox.max)(1)),
|
||||||
c2f(bbox.min(2)), c2f(bbox.max(2)) };
|
c2f((bbox.min)(2)), c2f((bbox.max)(2)) };
|
||||||
|
|
||||||
typename AK::Point_3 ps[8];
|
typename AK::Point_3 ps[8];
|
||||||
ps[0] = a_at( AK::Point_3(xtrm[0], xtrm[2], xtrm[4]) );
|
ps[0] = a_at( AK::Point_3(xtrm[0], xtrm[2], xtrm[4]) );
|
||||||
|
|
@ -83,9 +83,9 @@ class Traversal_traits_with_transformation_helper
|
||||||
|
|
||||||
AK::Aff_transformation_3 a_at = c2f(at);
|
AK::Aff_transformation_3 a_at = c2f(at);
|
||||||
|
|
||||||
AK::FT xtrm[6] = { c2f(bbox.min(0)), c2f(bbox.max(0)),
|
AK::FT xtrm[6] = { c2f((bbox.min)(0)), c2f((bbox.max)(0)),
|
||||||
c2f(bbox.min(1)), c2f(bbox.max(1)),
|
c2f((bbox.min)(1)), c2f((bbox.max)(1)),
|
||||||
c2f(bbox.min(2)), c2f(bbox.max(2)) };
|
c2f((bbox.min)(2)), c2f((bbox.max)(2)) };
|
||||||
|
|
||||||
typename AK::Point_3 ps[2];
|
typename AK::Point_3 ps[2];
|
||||||
ps[0] = a_at( AK::Point_3(xtrm[0], xtrm[2], xtrm[4]) );
|
ps[0] = a_at( AK::Point_3(xtrm[0], xtrm[2], xtrm[4]) );
|
||||||
|
|
|
||||||
|
|
@ -1216,7 +1216,7 @@ std::size_t snap_borders(TriangleMesh& tm_A,
|
||||||
border_halfedges(tm_A, std::back_inserter(border_vertices_A));
|
border_halfedges(tm_A, std::back_inserter(border_vertices_A));
|
||||||
border_halfedges(tm_B, std::back_inserter(border_vertices_B));
|
border_halfedges(tm_B, std::back_inserter(border_vertices_B));
|
||||||
|
|
||||||
const FT tol_mx(std::numeric_limits<double>::max());
|
const FT tol_mx((std::numeric_limits<double>::max)());
|
||||||
Tolerance_map tolerance_map_A = get(Vertex_property_tag(), tm_A);
|
Tolerance_map tolerance_map_A = get(Vertex_property_tag(), tm_A);
|
||||||
internal::assign_tolerance_with_local_edge_length_bound(border_vertices_A, tolerance_map_A, tol_mx, tm_A, np_A);
|
internal::assign_tolerance_with_local_edge_length_bound(border_vertices_A, tolerance_map_A, tol_mx, tm_A, np_A);
|
||||||
Tolerance_map tolerance_map_B = get(Vertex_property_tag(), tm_B);
|
Tolerance_map tolerance_map_B = get(Vertex_property_tag(), tm_B);
|
||||||
|
|
@ -1296,7 +1296,7 @@ std::size_t snap_borders(TriangleMesh& tm,
|
||||||
std::vector<halfedge_descriptor> border_vertices;
|
std::vector<halfedge_descriptor> border_vertices;
|
||||||
border_halfedges(tm, std::back_inserter(border_vertices));
|
border_halfedges(tm, std::back_inserter(border_vertices));
|
||||||
|
|
||||||
const FT tol_mx(std::numeric_limits<double>::max());
|
const FT tol_mx((std::numeric_limits<double>::max)());
|
||||||
Tolerance_map tolerance_map = get(Vertex_property_tag(), tm);
|
Tolerance_map tolerance_map = get(Vertex_property_tag(), tm);
|
||||||
internal::assign_tolerance_with_local_edge_length_bound(border_vertices, tolerance_map, tol_mx, tm, np);
|
internal::assign_tolerance_with_local_edge_length_bound(border_vertices, tolerance_map, tol_mx, tm, np);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -868,7 +868,7 @@ std::size_t snap_vertices(const HalfedgeRange_A& halfedge_range_A,
|
||||||
typedef CGAL::dynamic_vertex_property_t<FT> Vertex_property_tag;
|
typedef CGAL::dynamic_vertex_property_t<FT> Vertex_property_tag;
|
||||||
typedef typename boost::property_map<PolygonMesh, Vertex_property_tag>::type Tolerance_map;
|
typedef typename boost::property_map<PolygonMesh, Vertex_property_tag>::type Tolerance_map;
|
||||||
|
|
||||||
const FT max_tol(std::numeric_limits<double>::max());
|
const FT max_tol((std::numeric_limits<double>::max)());
|
||||||
|
|
||||||
Tolerance_map tolerance_map_A = get(Vertex_property_tag(), tm_A);
|
Tolerance_map tolerance_map_A = get(Vertex_property_tag(), tm_A);
|
||||||
internal::assign_tolerance_with_local_edge_length_bound(halfedge_range_A, tolerance_map_A, max_tol, tm_A, np_A);
|
internal::assign_tolerance_with_local_edge_length_bound(halfedge_range_A, tolerance_map_A, max_tol, tm_A, np_A);
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
|
||||||
typedef K::Point_3 Point_3;
|
typedef K::Point_3 Point_3;
|
||||||
|
|
||||||
typedef CGAL::Surface_mesh<Point_3> Mesh;
|
typedef CGAL::Surface_mesh<Point_3> Mesh;
|
||||||
typedef std::vector<std::size_t> Polygon;
|
typedef std::vector<std::size_t> CGAL_polygon;
|
||||||
|
|
||||||
void test_polygon_canonicalization(const bool verbose = false)
|
void test_polygon_canonicalization(const bool verbose = false)
|
||||||
{
|
{
|
||||||
|
|
@ -34,8 +34,8 @@ void test_polygon_canonicalization(const bool verbose = false)
|
||||||
points.push_back(Point_3(1,1,-2)); // #5
|
points.push_back(Point_3(1,1,-2)); // #5
|
||||||
|
|
||||||
// empty
|
// empty
|
||||||
Polygon polygon;
|
CGAL_polygon polygon;
|
||||||
Polygon canonical_polygon = PMP::internal::construct_canonical_polygon(points, polygon, K());
|
CGAL_polygon canonical_polygon = PMP::internal::construct_canonical_polygon(points, polygon, K());
|
||||||
assert(canonical_polygon.empty());
|
assert(canonical_polygon.empty());
|
||||||
|
|
||||||
// 1 point
|
// 1 point
|
||||||
|
|
@ -76,7 +76,7 @@ void test_polygon_canonicalization(const bool verbose = false)
|
||||||
// all cyclic permutations
|
// all cyclic permutations
|
||||||
for(std::size_t i=0, end=polygon.size(); i<end; ++i)
|
for(std::size_t i=0, end=polygon.size(); i<end; ++i)
|
||||||
{
|
{
|
||||||
Polygon cpol = PMP::internal::construct_canonical_polygon(points, polygon, K());
|
CGAL_polygon cpol = PMP::internal::construct_canonical_polygon(points, polygon, K());
|
||||||
if(verbose)
|
if(verbose)
|
||||||
{
|
{
|
||||||
std::cout << "Input polygon:";
|
std::cout << "Input polygon:";
|
||||||
|
|
@ -93,7 +93,7 @@ void test_polygon_canonicalization(const bool verbose = false)
|
||||||
std::reverse(polygon.begin(), polygon.end());
|
std::reverse(polygon.begin(), polygon.end());
|
||||||
for(std::size_t i=0, end=polygon.size(); i<end; ++i)
|
for(std::size_t i=0, end=polygon.size(); i<end; ++i)
|
||||||
{
|
{
|
||||||
Polygon cpol = PMP::internal::construct_canonical_polygon(points, polygon, K());
|
CGAL_polygon cpol = PMP::internal::construct_canonical_polygon(points, polygon, K());
|
||||||
if(verbose)
|
if(verbose)
|
||||||
{
|
{
|
||||||
std::cout << "Input polygon:";
|
std::cout << "Input polygon:";
|
||||||
|
|
@ -112,7 +112,7 @@ void test_merge_duplicate_points(const bool /*verbose*/ = false)
|
||||||
std::cout << "test merge duplicate points... " << std::endl;
|
std::cout << "test merge duplicate points... " << std::endl;
|
||||||
|
|
||||||
std::vector<Point_3> points;
|
std::vector<Point_3> points;
|
||||||
std::vector<Polygon> polygons;
|
std::vector<CGAL_polygon> polygons;
|
||||||
|
|
||||||
// empty
|
// empty
|
||||||
std::size_t res = PMP::merge_duplicate_points_in_polygon_soup(points, polygons);
|
std::size_t res = PMP::merge_duplicate_points_in_polygon_soup(points, polygons);
|
||||||
|
|
@ -126,7 +126,7 @@ void test_merge_duplicate_points(const bool /*verbose*/ = false)
|
||||||
points.push_back(Point_3(1,1,0)); // #5 // identical to #2
|
points.push_back(Point_3(1,1,0)); // #5 // identical to #2
|
||||||
points.push_back(Point_3(0,0,0)); // #6 // idental to #0
|
points.push_back(Point_3(0,0,0)); // #6 // idental to #0
|
||||||
|
|
||||||
Polygon polygon;
|
CGAL_polygon polygon;
|
||||||
polygon.push_back(0); polygon.push_back(1); polygon.push_back(2);
|
polygon.push_back(0); polygon.push_back(1); polygon.push_back(2);
|
||||||
polygons.push_back(polygon);
|
polygons.push_back(polygon);
|
||||||
|
|
||||||
|
|
@ -146,7 +146,7 @@ void test_merge_duplicate_points(const bool /*verbose*/ = false)
|
||||||
|
|
||||||
for(std::size_t i=0, psn=polygons.size(); i<psn; ++i)
|
for(std::size_t i=0, psn=polygons.size(); i<psn; ++i)
|
||||||
{
|
{
|
||||||
const Polygon& polygon = polygons[i];
|
const CGAL_polygon& polygon = polygons[i];
|
||||||
for(std::size_t j=0, pn=polygon.size(); j<pn; ++j)
|
for(std::size_t j=0, pn=polygon.size(); j<pn; ++j)
|
||||||
{
|
{
|
||||||
assert(polygon[j] < points.size());
|
assert(polygon[j] < points.size());
|
||||||
|
|
@ -159,7 +159,7 @@ void test_merge_duplicate_polygons(const bool /*verbose*/ = false)
|
||||||
std::cout << "test duplicate polygons merging..." << std::endl;
|
std::cout << "test duplicate polygons merging..." << std::endl;
|
||||||
|
|
||||||
std::vector<Point_3> points;
|
std::vector<Point_3> points;
|
||||||
std::vector<Polygon> polygons;
|
std::vector<CGAL_polygon> polygons;
|
||||||
|
|
||||||
points.push_back(Point_3(0,0,0)); // #0
|
points.push_back(Point_3(0,0,0)); // #0
|
||||||
points.push_back(Point_3(1,0,0)); // #1
|
points.push_back(Point_3(1,0,0)); // #1
|
||||||
|
|
@ -180,7 +180,7 @@ void test_merge_duplicate_polygons(const bool /*verbose*/ = false)
|
||||||
|
|
||||||
// -------------------------------------------------------
|
// -------------------------------------------------------
|
||||||
// 1 polygon
|
// 1 polygon
|
||||||
Polygon polygon;
|
CGAL_polygon polygon;
|
||||||
polygon.push_back(0); polygon.push_back(1); polygon.push_back(2);
|
polygon.push_back(0); polygon.push_back(1); polygon.push_back(2);
|
||||||
polygons.push_back(polygon);
|
polygons.push_back(polygon);
|
||||||
|
|
||||||
|
|
@ -257,7 +257,7 @@ void test_merge_duplicate_polygons(const bool /*verbose*/ = false)
|
||||||
assert(all_duplicate_polygons[0].size() == 2 && all_duplicate_polygons[1].size() == 3);
|
assert(all_duplicate_polygons[0].size() == 2 && all_duplicate_polygons[1].size() == 3);
|
||||||
|
|
||||||
// Keep one for each duplicate
|
// Keep one for each duplicate
|
||||||
std::vector<Polygon> polygons_copy(polygons);
|
std::vector<CGAL_polygon> polygons_copy(polygons);
|
||||||
res = PMP::merge_duplicate_polygons_in_polygon_soup(points, polygons_copy,
|
res = PMP::merge_duplicate_polygons_in_polygon_soup(points, polygons_copy,
|
||||||
params::all_default());
|
params::all_default());
|
||||||
assert(res == 3 && polygons_copy.size() == 3);
|
assert(res == 3 && polygons_copy.size() == 3);
|
||||||
|
|
@ -281,7 +281,7 @@ void test_simplify_polygons(const bool /*verbose*/ = false)
|
||||||
std::cout << "test simplify_polygons... " << std::endl;
|
std::cout << "test simplify_polygons... " << std::endl;
|
||||||
|
|
||||||
std::vector<Point_3> points;
|
std::vector<Point_3> points;
|
||||||
std::vector<Polygon> polygons;
|
std::vector<CGAL_polygon> polygons;
|
||||||
|
|
||||||
points.push_back(Point_3(0,0,0)); // #0
|
points.push_back(Point_3(0,0,0)); // #0
|
||||||
points.push_back(Point_3(1,2,0)); // #1
|
points.push_back(Point_3(1,2,0)); // #1
|
||||||
|
|
@ -292,7 +292,7 @@ void test_simplify_polygons(const bool /*verbose*/ = false)
|
||||||
points.push_back(Point_3(0,0,0)); // #6
|
points.push_back(Point_3(0,0,0)); // #6
|
||||||
|
|
||||||
// ------
|
// ------
|
||||||
Polygon polygon;
|
CGAL_polygon polygon;
|
||||||
polygon.push_back(0); polygon.push_back(2); polygon.push_back(4);
|
polygon.push_back(0); polygon.push_back(2); polygon.push_back(4);
|
||||||
polygons.push_back(polygon);
|
polygons.push_back(polygon);
|
||||||
|
|
||||||
|
|
@ -355,13 +355,13 @@ void test_remove_invalid_polygons(const bool /*verbose*/ = false)
|
||||||
|
|
||||||
// points are not actually needed since only the size of the polygons is considered
|
// points are not actually needed since only the size of the polygons is considered
|
||||||
std::vector<Point_3> points;
|
std::vector<Point_3> points;
|
||||||
std::vector<Polygon> polygons;
|
std::vector<CGAL_polygon> polygons;
|
||||||
|
|
||||||
std::size_t res = PMP::internal::remove_invalid_polygons_in_polygon_soup(points, polygons);
|
std::size_t res = PMP::internal::remove_invalid_polygons_in_polygon_soup(points, polygons);
|
||||||
assert(res == 0 && polygons.size() == 0);
|
assert(res == 0 && polygons.size() == 0);
|
||||||
|
|
||||||
// non-trivial polygon
|
// non-trivial polygon
|
||||||
Polygon polygon;
|
CGAL_polygon polygon;
|
||||||
polygon.push_back(0); polygon.push_back(2); polygon.push_back(4);
|
polygon.push_back(0); polygon.push_back(2); polygon.push_back(4);
|
||||||
polygons.push_back(polygon);
|
polygons.push_back(polygon);
|
||||||
|
|
||||||
|
|
@ -431,7 +431,7 @@ void test_remove_isolated_points(const bool verbose = false)
|
||||||
std::cout << "test remove_isolated_points... " << std::endl;
|
std::cout << "test remove_isolated_points... " << std::endl;
|
||||||
|
|
||||||
std::vector<Point_3> points;
|
std::vector<Point_3> points;
|
||||||
std::vector<Polygon> polygons;
|
std::vector<CGAL_polygon> polygons;
|
||||||
|
|
||||||
// everything empty
|
// everything empty
|
||||||
std::size_t res = test_remove_isolated_points_data_set(points, polygons, verbose);
|
std::size_t res = test_remove_isolated_points_data_set(points, polygons, verbose);
|
||||||
|
|
@ -449,7 +449,7 @@ void test_remove_isolated_points(const bool verbose = false)
|
||||||
res = test_remove_isolated_points_data_set(points_copy, polygons, verbose);
|
res = test_remove_isolated_points_data_set(points_copy, polygons, verbose);
|
||||||
assert(res == 6 && points_copy.empty() && polygons.empty());
|
assert(res == 6 && points_copy.empty() && polygons.empty());
|
||||||
|
|
||||||
Polygon polygon;
|
CGAL_polygon polygon;
|
||||||
polygon.push_back(0); polygon.push_back(2); polygon.push_back(4);
|
polygon.push_back(0); polygon.push_back(2); polygon.push_back(4);
|
||||||
polygons.push_back(polygon);
|
polygons.push_back(polygon);
|
||||||
|
|
||||||
|
|
@ -467,7 +467,7 @@ void test_slit_pinched_polygons(const bool /*verbose*/ = false)
|
||||||
std::cout << "test split_pinched_polygons... " << std::endl;
|
std::cout << "test split_pinched_polygons... " << std::endl;
|
||||||
|
|
||||||
std::vector<Point_3> points;
|
std::vector<Point_3> points;
|
||||||
std::vector<Polygon> polygons;
|
std::vector<CGAL_polygon> polygons;
|
||||||
|
|
||||||
// everything empty
|
// everything empty
|
||||||
std::size_t res = PMP::internal::split_pinched_polygons_in_polygon_soup<K>(points, polygons);
|
std::size_t res = PMP::internal::split_pinched_polygons_in_polygon_soup<K>(points, polygons);
|
||||||
|
|
@ -481,7 +481,7 @@ void test_slit_pinched_polygons(const bool /*verbose*/ = false)
|
||||||
points.push_back(Point_3(1,1,0)); // #5
|
points.push_back(Point_3(1,1,0)); // #5
|
||||||
|
|
||||||
// no pinch
|
// no pinch
|
||||||
Polygon polygon;
|
CGAL_polygon polygon;
|
||||||
polygon.push_back(0); polygon.push_back(2); polygon.push_back(4);
|
polygon.push_back(0); polygon.push_back(2); polygon.push_back(4);
|
||||||
polygons.push_back(polygon);
|
polygons.push_back(polygon);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -374,12 +374,12 @@ namespace CGAL {
|
||||||
Planar_segment* s = segments[i];
|
Planar_segment* s = segments[i];
|
||||||
const Plane* plane = s->fit_supporting_plane(); // user may provide invalid plane fitting (we always fit)
|
const Plane* plane = s->fit_supporting_plane(); // user may provide invalid plane fitting (we always fit)
|
||||||
|
|
||||||
FT max_dist = -std::numeric_limits<FT>::max();
|
FT max_dist = -(std::numeric_limits<FT>::max)();
|
||||||
for (std::size_t j = 0; j < s->size(); ++j) {
|
for (std::size_t j = 0; j < s->size(); ++j) {
|
||||||
std::size_t idx = s->at(j);
|
std::size_t idx = s->at(j);
|
||||||
const Point& p = points[idx];
|
const Point& p = points[idx];
|
||||||
FT sdist = CGAL::squared_distance(*plane, p);
|
FT sdist = CGAL::squared_distance(*plane, p);
|
||||||
max_dist = std::max(max_dist, std::sqrt(sdist));
|
max_dist = (std::max)(max_dist, std::sqrt(sdist));
|
||||||
}
|
}
|
||||||
|
|
||||||
avg_max_dist += max_dist;
|
avg_max_dist += max_dist;
|
||||||
|
|
|
||||||
|
|
@ -57,9 +57,9 @@ public:
|
||||||
this->validator->setTop(d);
|
this->validator->setTop(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoubleEdit::setRange(double min, double max)
|
void DoubleEdit::setRange(double rmin, double rmax)
|
||||||
{
|
{
|
||||||
this->validator->setRange(min, max, this->validator->decimals());
|
this->validator->setRange(rmin, rmax, this->validator->decimals());
|
||||||
}
|
}
|
||||||
|
|
||||||
double DoubleEdit::getValue()
|
double DoubleEdit::getValue()
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ public:
|
||||||
void setValue(double d);
|
void setValue(double d);
|
||||||
void setMinimum(double d);
|
void setMinimum(double d);
|
||||||
void setMaximum(double d);
|
void setMaximum(double d);
|
||||||
void setRange(double min, double max);
|
void setRange(double rmin, double rmax);
|
||||||
double getValue();
|
double getValue();
|
||||||
double getMinimum();
|
double getMinimum();
|
||||||
double getMaximum();
|
double getMaximum();
|
||||||
|
|
|
||||||
|
|
@ -1006,7 +1006,7 @@ void MainWindow::updateViewersBboxes(bool recenter)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainWindow::computeViewerBBox(CGAL::qglviewer::Vec& min, CGAL::qglviewer::Vec& max)
|
void MainWindow::computeViewerBBox(CGAL::qglviewer::Vec& vmin, CGAL::qglviewer::Vec& vmax)
|
||||||
{
|
{
|
||||||
const Scene::Bbox bbox = scene->bbox();
|
const Scene::Bbox bbox = scene->bbox();
|
||||||
const double xmin = bbox.xmin();
|
const double xmin = bbox.xmin();
|
||||||
|
|
@ -1018,8 +1018,8 @@ void MainWindow::computeViewerBBox(CGAL::qglviewer::Vec& min, CGAL::qglviewer::V
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
min = CGAL::qglviewer::Vec(xmin, ymin, zmin);
|
vmin = CGAL::qglviewer::Vec(xmin, ymin, zmin);
|
||||||
max= CGAL::qglviewer::Vec(xmax, ymax, zmax);
|
vmax= CGAL::qglviewer::Vec(xmax, ymax, zmax);
|
||||||
|
|
||||||
CGAL::qglviewer::Vec bbox_center((xmin+xmax)/2, (ymin+ymax)/2, (zmin+zmax)/2);
|
CGAL::qglviewer::Vec bbox_center((xmin+xmax)/2, (ymin+ymax)/2, (zmin+zmax)/2);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -95,7 +95,7 @@ public:
|
||||||
CGAL::Three::Polyhedron_demo_io_plugin_interface*,
|
CGAL::Three::Polyhedron_demo_io_plugin_interface*,
|
||||||
bool& ok,
|
bool& ok,
|
||||||
bool add_to_scene=true);
|
bool add_to_scene=true);
|
||||||
void computeViewerBBox(CGAL::qglviewer::Vec &min, CGAL::qglviewer::Vec &max);
|
void computeViewerBBox(CGAL::qglviewer::Vec &vmin, CGAL::qglviewer::Vec &vmax);
|
||||||
void updateViewerBbox(Viewer* vi, bool recenter, CGAL::qglviewer::Vec min,
|
void updateViewerBbox(Viewer* vi, bool recenter, CGAL::qglviewer::Vec min,
|
||||||
CGAL::qglviewer::Vec max);
|
CGAL::qglviewer::Vec max);
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
|
|
|
||||||
|
|
@ -102,9 +102,9 @@ private Q_SLOTS:
|
||||||
connect(item, &Scene_surface_mesh_item::aboutToBeDestroyed,
|
connect(item, &Scene_surface_mesh_item::aboutToBeDestroyed,
|
||||||
this, &DoTreesIntersectplugin::cleanup);
|
this, &DoTreesIntersectplugin::cleanup);
|
||||||
|
|
||||||
CGAL::qglviewer::Vec pos((item->bbox().min(0) + item->bbox().max(0))/2.0,
|
CGAL::qglviewer::Vec pos(((item->bbox().min)(0) + (item->bbox().max)(0))/2.0,
|
||||||
(item->bbox().min(1) + item->bbox().max(1))/2.0,
|
((item->bbox().min)(1) + (item->bbox().max)(1))/2.0,
|
||||||
(item->bbox().min(2) + item->bbox().max(2))/2.0);
|
((item->bbox().min)(2) + (item->bbox().max)(2))/2.0);
|
||||||
|
|
||||||
Scene_movable_sm_item* mov_item = new Scene_movable_sm_item(pos,item->face_graph(),"");
|
Scene_movable_sm_item* mov_item = new Scene_movable_sm_item(pos,item->face_graph(),"");
|
||||||
connect(mov_item->manipulatedFrame(), &CGAL::qglviewer::ManipulatedFrame::modified,
|
connect(mov_item->manipulatedFrame(), &CGAL::qglviewer::ManipulatedFrame::modified,
|
||||||
|
|
|
||||||
|
|
@ -527,7 +527,7 @@ void Cluster_classification::change_color (int index, float* vmin, float* vmax)
|
||||||
int cid = m_cluster_id[*it];
|
int cid = m_cluster_id[*it];
|
||||||
if (cid != -1)
|
if (cid != -1)
|
||||||
{
|
{
|
||||||
float v = std::max (0.f, std::min(1.f, m_label_probabilities[corrected_index][cid]));
|
float v = std::max (0.f, (std::min)(1.f, m_label_probabilities[corrected_index][cid]));
|
||||||
m_points->point_set()->set_color(*it, ramp.r(v) * 255, ramp.g(v) * 255, ramp.b(v) * 255);
|
m_points->point_set()->set_color(*it, ramp.r(v) * 255, ramp.g(v) * 255, ramp.b(v) * 255);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -546,8 +546,8 @@ void Cluster_classification::change_color (int index, float* vmin, float* vmax)
|
||||||
|
|
||||||
Feature_handle feature = m_features[corrected_index];
|
Feature_handle feature = m_features[corrected_index];
|
||||||
|
|
||||||
float min = std::numeric_limits<float>::max();
|
float min = (std::numeric_limits<float>::max)();
|
||||||
float max = -std::numeric_limits<float>::max();
|
float max = -(std::numeric_limits<float>::max)();
|
||||||
|
|
||||||
if (vmin != NULL && vmax != NULL
|
if (vmin != NULL && vmax != NULL
|
||||||
&& *vmin != std::numeric_limits<float>::infinity()
|
&& *vmin != std::numeric_limits<float>::infinity()
|
||||||
|
|
|
||||||
|
|
@ -429,7 +429,7 @@ void Point_set_item_classification::change_color (int index, float* vmin, float*
|
||||||
for (Point_set::const_iterator it = m_points->point_set()->begin();
|
for (Point_set::const_iterator it = m_points->point_set()->begin();
|
||||||
it != m_points->point_set()->first_selected(); ++ it)
|
it != m_points->point_set()->first_selected(); ++ it)
|
||||||
{
|
{
|
||||||
float v = std::max (0.f, std::min(1.f, m_label_probabilities[corrected_index][*it]));
|
float v = (std::max)(0.f, (std::min)(1.f, m_label_probabilities[corrected_index][*it]));
|
||||||
m_points->point_set()->set_color(*it, ramp.r(v) * 255, ramp.g(v) * 255, ramp.b(v) * 255);
|
m_points->point_set()->set_color(*it, ramp.r(v) * 255, ramp.g(v) * 255, ramp.b(v) * 255);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -444,8 +444,8 @@ void Point_set_item_classification::change_color (int index, float* vmin, float*
|
||||||
}
|
}
|
||||||
Feature_handle feature = m_features[corrected_index];
|
Feature_handle feature = m_features[corrected_index];
|
||||||
|
|
||||||
float min = std::numeric_limits<float>::max();
|
float min = (std::numeric_limits<float>::max)();
|
||||||
float max = -std::numeric_limits<float>::max();
|
float max = -(std::numeric_limits<float>::max)();
|
||||||
|
|
||||||
if (vmin != NULL && vmax != NULL
|
if (vmin != NULL && vmax != NULL
|
||||||
&& *vmin != std::numeric_limits<float>::infinity()
|
&& *vmin != std::numeric_limits<float>::infinity()
|
||||||
|
|
|
||||||
|
|
@ -118,8 +118,8 @@ class Point_set_item_classification : public Item_classification_base
|
||||||
|
|
||||||
for (std::size_t i = 0; i < m_features.size(); ++ i)
|
for (std::size_t i = 0; i < m_features.size(); ++ i)
|
||||||
{
|
{
|
||||||
float vmin = std::numeric_limits<float>::max();
|
float vmin = (std::numeric_limits<float>::max)();
|
||||||
float vmax = -std::numeric_limits<float>::max();
|
float vmax = -(std::numeric_limits<float>::max)();
|
||||||
float vmean = 0.f;
|
float vmean = 0.f;
|
||||||
std::size_t nb = 0;
|
std::size_t nb = 0;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -151,7 +151,7 @@ void Surface_mesh_item_classification::change_color (int index, float* vmin, flo
|
||||||
{
|
{
|
||||||
for(face_descriptor fd : faces(*(m_mesh->polyhedron())))
|
for(face_descriptor fd : faces(*(m_mesh->polyhedron())))
|
||||||
{
|
{
|
||||||
float v = std::max (0.f, std::min(1.f, m_label_probabilities[corrected_index][fd]));
|
float v = std::max (0.f, (std::min)(1.f, m_label_probabilities[corrected_index][fd]));
|
||||||
m_color[fd] = CGAL::Color((unsigned char)(ramp.r(v) * 255),
|
m_color[fd] = CGAL::Color((unsigned char)(ramp.r(v) * 255),
|
||||||
(unsigned char)(ramp.g(v) * 255),
|
(unsigned char)(ramp.g(v) * 255),
|
||||||
(unsigned char)(ramp.b(v) * 255));
|
(unsigned char)(ramp.b(v) * 255));
|
||||||
|
|
@ -169,8 +169,8 @@ void Surface_mesh_item_classification::change_color (int index, float* vmin, flo
|
||||||
|
|
||||||
Feature_handle feature = m_features[corrected_index];
|
Feature_handle feature = m_features[corrected_index];
|
||||||
|
|
||||||
float min = std::numeric_limits<float>::max();
|
float min = (std::numeric_limits<float>::max)();
|
||||||
float max = -std::numeric_limits<float>::max();
|
float max = -(std::numeric_limits<float>::max)();
|
||||||
|
|
||||||
if (vmin != NULL && vmax != NULL
|
if (vmin != NULL && vmax != NULL
|
||||||
&& *vmin != std::numeric_limits<float>::infinity()
|
&& *vmin != std::numeric_limits<float>::infinity()
|
||||||
|
|
|
||||||
|
|
@ -417,12 +417,12 @@ void Polyhedron_demo_affine_transform_plugin::grid()
|
||||||
Scene_item::Bbox b = item->bbox();
|
Scene_item::Bbox b = item->bbox();
|
||||||
|
|
||||||
|
|
||||||
double x_t(CGAL::sqrt(CGAL::squared_distance(Kernel::Point_3(b.min(0), b.min(1), b.min(2)),
|
double x_t(CGAL::sqrt(CGAL::squared_distance(Kernel::Point_3((b.min)(0), (b.min)(1), (b.min)(2)),
|
||||||
Kernel::Point_3(b.max(0), b.min(1), b.min(2))))),
|
Kernel::Point_3((b.max)(0), (b.min)(1), (b.min)(2))))),
|
||||||
y_t(CGAL::sqrt(CGAL::squared_distance(Kernel::Point_3(b.min(0), b.min(1), b.min(2)),
|
y_t(CGAL::sqrt(CGAL::squared_distance(Kernel::Point_3((b.min)(0), (b.min)(1), (b.min)(2)),
|
||||||
Kernel::Point_3(b.min(0), b.max(1), b.min(2))))),
|
Kernel::Point_3((b.min)(0), (b.max)(1), (b.min)(2))))),
|
||||||
z_t(CGAL::sqrt(CGAL::squared_distance(Kernel::Point_3(b.min(0), b.min(1), b.min(2)),
|
z_t(CGAL::sqrt(CGAL::squared_distance(Kernel::Point_3((b.min)(0), (b.min)(1), (b.min)(2)),
|
||||||
Kernel::Point_3(b.min(0), b.min(1), b.max(2)))));
|
Kernel::Point_3((b.min)(0), (b.min)(1), (b.max)(2)))));
|
||||||
|
|
||||||
GridDialog dialog(mw);
|
GridDialog dialog(mw);
|
||||||
dialog.x_space_doubleSpinBox->setValue(x_t);
|
dialog.x_space_doubleSpinBox->setValue(x_t);
|
||||||
|
|
|
||||||
|
|
@ -116,9 +116,9 @@ bool Create_bbox_mesh_plugin::bbox(bool extended)
|
||||||
bbox.zmax() + delta_z);
|
bbox.zmax() + delta_z);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(bbox.min(0) > bbox.max(0) ||
|
if((bbox.min)(0) > (bbox.max)(0) ||
|
||||||
bbox.min(1) > bbox.max(1) ||
|
(bbox.min)(1) > (bbox.max)(1) ||
|
||||||
bbox.min(2) > bbox.max(2))
|
(bbox.min)(2) > (bbox.max)(2))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -392,16 +392,16 @@ void Scene_edit_box_item::compute_bbox() const
|
||||||
const CGAL::qglviewer::Vec offset = static_cast<CGAL::Three::Viewer_interface*>(CGAL::QGLViewer::QGLViewerPool().first())->offset();
|
const CGAL::qglviewer::Vec offset = static_cast<CGAL::Three::Viewer_interface*>(CGAL::QGLViewer::QGLViewerPool().first())->offset();
|
||||||
|
|
||||||
|
|
||||||
QVector3D min(d->pool[0], d->pool[1], d->pool[2]);
|
QVector3D vmin(d->pool[0], d->pool[1], d->pool[2]);
|
||||||
QVector3D max(d->pool[3], d->pool[4], d->pool[5]);
|
QVector3D vmax(d->pool[3], d->pool[4], d->pool[5]);
|
||||||
|
|
||||||
for(int i=0; i< 3; ++i)
|
for(int i=0; i< 3; ++i)
|
||||||
{
|
{
|
||||||
min[i] += d->frame->translation()[i]-d->center_[i]-offset[i];
|
vmin[i] += d->frame->translation()[i]-d->center_[i]-offset[i];
|
||||||
max[i] += d->frame->translation()[i]-d->center_[i]-offset[i];
|
vmax[i] += d->frame->translation()[i]-d->center_[i]-offset[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
setBbox(Scene_item::Bbox(min.x(),min.y(),min.z(),max.x(),max.y(),max.z()));
|
setBbox(Scene_item::Bbox(vmin.x(),vmin.y(),vmin.z(),vmax.x(),vmax.y(),vmax.z()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -123,10 +123,10 @@ Scene_facegraph_transform_item::compute_bbox() const {
|
||||||
++it) {
|
++it) {
|
||||||
bbox = bbox + get(vpmap, *it).bbox();
|
bbox = bbox + get(vpmap, *it).bbox();
|
||||||
}
|
}
|
||||||
CGAL::qglviewer::Vec min(bbox.xmin(),bbox.ymin(),bbox.zmin());
|
CGAL::qglviewer::Vec vmin(bbox.xmin(),bbox.ymin(),bbox.zmin());
|
||||||
CGAL::qglviewer::Vec max(bbox.xmax(),bbox.ymax(),bbox.zmax());
|
CGAL::qglviewer::Vec vmax(bbox.xmax(),bbox.ymax(),bbox.zmax());
|
||||||
setBbox(Bbox(min.x,min.y,min.z,
|
setBbox(Bbox(vmin.x,vmin.y,vmin.z,
|
||||||
max.x,max.y,max.z));
|
vmax.x,vmax.y,vmax.z));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -490,10 +490,10 @@ public Q_SLOTS:
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cout << "Parameterized with ARAP (SM) computed." << std::endl;
|
std::cout << "Parameterized with ARAP (SM) computed." << std::endl;
|
||||||
xmin = std::numeric_limits<double>::max();
|
xmin = (std::numeric_limits<double>::max)();
|
||||||
xmax = std::numeric_limits<double>::min();
|
xmax = (std::numeric_limits<double>::min)();
|
||||||
ymin = std::numeric_limits<double>::max();
|
ymin = (std::numeric_limits<double>::max)();
|
||||||
ymax = std::numeric_limits<double>::min();
|
ymax = (std::numeric_limits<double>::min)();
|
||||||
uv_map_3 =
|
uv_map_3 =
|
||||||
sm->add_property_map<SMesh::Vertex_index, Point_3>("v:uv3").first;
|
sm->add_property_map<SMesh::Vertex_index, Point_3>("v:uv3").first;
|
||||||
for(SMesh::Vertex_index v : sm->vertices())
|
for(SMesh::Vertex_index v : sm->vertices())
|
||||||
|
|
|
||||||
|
|
@ -307,7 +307,7 @@ void Polyhedron_demo_mesh_segmentation_plugin::apply_Partition_button_clicked(Fa
|
||||||
faces(*pair->first->face_graph()))
|
faces(*pair->first->face_graph()))
|
||||||
{
|
{
|
||||||
if(sdf_pmap[f] != -1
|
if(sdf_pmap[f] != -1
|
||||||
&& sdf_pmap[f] != std::numeric_limits<double>::max())
|
&& sdf_pmap[f] != (std::numeric_limits<double>::max)())
|
||||||
{
|
{
|
||||||
has_sdf_values = true;
|
has_sdf_values = true;
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -149,7 +149,7 @@ void Polyhedron_demo_mesh_simplification_plugin::on_actionSimplify_triggered()
|
||||||
: 0),
|
: 0),
|
||||||
(ui.m_use_edge_length->isChecked()
|
(ui.m_use_edge_length->isChecked()
|
||||||
? ui.m_edge_length->value()
|
? ui.m_edge_length->value()
|
||||||
: std::numeric_limits<double>::max()));
|
: (std::numeric_limits<double>::max)()));
|
||||||
|
|
||||||
if (selection_item)
|
if (selection_item)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -436,9 +436,9 @@ void Polyhedron_demo_offset_meshing_plugin::offset_meshing()
|
||||||
}
|
}
|
||||||
else if(soup_item == 0)
|
else if(soup_item == 0)
|
||||||
return;
|
return;
|
||||||
double X=box.max(0)-box.min(0),
|
double X=(box.max)(0)-(box.min)(0),
|
||||||
Y = box.max(1)-box.min(1),
|
Y = (box.max)(1)-(box.min)(1),
|
||||||
Z = box.max(2)-box.min(2);
|
Z = (box.max)(2)-(box.min)(2);
|
||||||
diag = CGAL::sqrt(X*X+Y*Y+Z*Z);
|
diag = CGAL::sqrt(X*X+Y*Y+Z*Z);
|
||||||
double offset_value = QInputDialog::getDouble(mw,
|
double offset_value = QInputDialog::getDouble(mw,
|
||||||
QString("Choose Offset Value"),
|
QString("Choose Offset Value"),
|
||||||
|
|
|
||||||
|
|
@ -907,7 +907,7 @@ void Polyhedron_demo_parameterization_plugin::parameterize(const Parameterizatio
|
||||||
} //end for each component
|
} //end for each component
|
||||||
|
|
||||||
QApplication::restoreOverrideCursor();
|
QApplication::restoreOverrideCursor();
|
||||||
QPointF min(FLT_MAX, FLT_MAX), max(-FLT_MAX, -FLT_MAX);
|
QPointF pmin(FLT_MAX, FLT_MAX), pmax(-FLT_MAX, -FLT_MAX);
|
||||||
|
|
||||||
SMesh::Property_map<halfedge_descriptor, float> umap;
|
SMesh::Property_map<halfedge_descriptor, float> umap;
|
||||||
SMesh::Property_map<halfedge_descriptor, float> vmap;
|
SMesh::Property_map<halfedge_descriptor, float> vmap;
|
||||||
|
|
@ -926,14 +926,14 @@ void Polyhedron_demo_parameterization_plugin::parameterize(const Parameterizatio
|
||||||
FT v = uv_pm[target(hd, sMesh)].y();
|
FT v = uv_pm[target(hd, sMesh)].y();
|
||||||
put(umap, *it, static_cast<float>(u));
|
put(umap, *it, static_cast<float>(u));
|
||||||
put(vmap, *it, static_cast<float>(v));
|
put(vmap, *it, static_cast<float>(v));
|
||||||
if(u<min.x())
|
if(u<pmin.x())
|
||||||
min.setX(u);
|
pmin.setX(u);
|
||||||
if(u>max.x())
|
if(u>pmax.x())
|
||||||
max.setX(u);
|
pmax.setX(u);
|
||||||
if(v<min.y())
|
if(v<pmin.y())
|
||||||
min.setY(v);
|
pmin.setY(v);
|
||||||
if(v>max.y())
|
if(v>pmax.y())
|
||||||
max.setY(v);
|
pmax.setY(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
Components* components = new Components(0);
|
Components* components = new Components(0);
|
||||||
|
|
@ -948,7 +948,7 @@ void Polyhedron_demo_parameterization_plugin::parameterize(const Parameterizatio
|
||||||
}
|
}
|
||||||
|
|
||||||
Scene_textured_facegraph_item* new_item = new Scene_textured_facegraph_item(tMesh);
|
Scene_textured_facegraph_item* new_item = new Scene_textured_facegraph_item(tMesh);
|
||||||
UVItem *projection = new UVItem(components,new_item->textured_face_graph(), uv_borders, QRectF(min, max));
|
UVItem *projection = new UVItem(components,new_item->textured_face_graph(), uv_borders, QRectF(pmin, pmax));
|
||||||
projection->set_item_name(new_item_name);
|
projection->set_item_name(new_item_name);
|
||||||
|
|
||||||
new_item->setName(new_item_name);
|
new_item->setName(new_item_name);
|
||||||
|
|
|
||||||
|
|
@ -393,10 +393,10 @@ struct Scene_c3t3_item_priv {
|
||||||
|
|
||||||
void invalidate_stats()
|
void invalidate_stats()
|
||||||
{
|
{
|
||||||
min_edges_length = std::numeric_limits<float>::max();
|
min_edges_length = (std::numeric_limits<float>::max)();
|
||||||
max_edges_length = 0;
|
max_edges_length = 0;
|
||||||
mean_edges_length = 0;
|
mean_edges_length = 0;
|
||||||
min_dihedral_angle = std::numeric_limits<float>::max();
|
min_dihedral_angle = (std::numeric_limits<float>::max)();
|
||||||
max_dihedral_angle = 0;
|
max_dihedral_angle = 0;
|
||||||
mean_dihedral_angle = 0;
|
mean_dihedral_angle = 0;
|
||||||
nb_subdomains = 0;
|
nb_subdomains = 0;
|
||||||
|
|
@ -404,8 +404,8 @@ struct Scene_c3t3_item_priv {
|
||||||
nb_cnc = 0;
|
nb_cnc = 0;
|
||||||
nb_vertices = 0;
|
nb_vertices = 0;
|
||||||
nb_tets = 0;
|
nb_tets = 0;
|
||||||
smallest_radius_radius = std::numeric_limits<float>::max();
|
smallest_radius_radius = (std::numeric_limits<float>::max)();
|
||||||
smallest_edge_radius = std::numeric_limits<float>::max();
|
smallest_edge_radius = (std::numeric_limits<float>::max)();
|
||||||
biggest_v_sma_cube = 0;
|
biggest_v_sma_cube = 0;
|
||||||
computed_stats = false;
|
computed_stats = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ struct Scene_polylines_item_private {
|
||||||
{
|
{
|
||||||
nb_vertices = 0;
|
nb_vertices = 0;
|
||||||
nb_edges = 0;
|
nb_edges = 0;
|
||||||
min_length = std::numeric_limits<double>::max();
|
min_length = (std::numeric_limits<double>::max)();
|
||||||
max_length = 0;
|
max_length = 0;
|
||||||
mean_length = 0;
|
mean_length = 0;
|
||||||
computed_stats = false;
|
computed_stats = false;
|
||||||
|
|
|
||||||
|
|
@ -109,8 +109,8 @@ hybrid_bezout_matrix(typename Polynomial_traits_d::Polynomial_d f,
|
||||||
B[i-sub-1][j-1] = s;
|
B[i-sub-1][j-1] = s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (i = std::max(m+1, 1+sub); i <= n; i++) {
|
for (i = (std::max)(m+1, 1+sub); i <= n; i++) {
|
||||||
for (j = i-m; j <= std::min(i, n-sub); j++) {
|
for (j = i-m; j <= (std::min)(i, n-sub); j++) {
|
||||||
B[i-sub-1][j-1] = coeff(g,i-j);
|
B[i-sub-1][j-1] = coeff(g,i-j);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,8 +22,8 @@
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
template <typename fl_t>
|
template <typename fl_t>
|
||||||
fl_t random_float(fl_t min, fl_t max) {
|
fl_t random_float(fl_t fmin, fl_t fmax) {
|
||||||
return fl_t(CGAL::get_default_random().get_double(min, max));
|
return fl_t(CGAL::get_default_random().get_double(fmin, fmax));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <typename K>
|
template <typename K>
|
||||||
|
|
|
||||||
|
|
@ -137,8 +137,8 @@ inline bool is_time_clearly_not_within_possibly_inexact_bisector_time_interval(
|
||||||
{
|
{
|
||||||
FT lSrcT = aBisector->opposite()->vertex()->time() ;
|
FT lSrcT = aBisector->opposite()->vertex()->time() ;
|
||||||
FT lTgtT = aBisector->vertex()->time() ;
|
FT lTgtT = aBisector->vertex()->time() ;
|
||||||
FT lLoT = std::min(lSrcT,lTgtT);
|
FT lLoT = (std::min)(lSrcT,lTgtT);
|
||||||
FT lHiT = std::max(lSrcT,lTgtT);
|
FT lHiT = (std::max)(lSrcT,lTgtT);
|
||||||
|
|
||||||
return ( aT < lLoT || aT > lHiT )
|
return ( aT < lLoT || aT > lHiT )
|
||||||
&& is_possibly_inexact_time_clearly_not_equal_to(aT,lLoT)
|
&& is_possibly_inexact_time_clearly_not_equal_to(aT,lLoT)
|
||||||
|
|
@ -150,8 +150,8 @@ inline bool is_time_clearly_within_possibly_inexact_bisector_time_interval( FT c
|
||||||
{
|
{
|
||||||
FT lSrcT = aBisector->opposite()->vertex()->time() ;
|
FT lSrcT = aBisector->opposite()->vertex()->time() ;
|
||||||
FT lTgtT = aBisector->vertex()->time() ;
|
FT lTgtT = aBisector->vertex()->time() ;
|
||||||
FT lLoT = std::min(lSrcT,lTgtT);
|
FT lLoT = (std::min)(lSrcT,lTgtT);
|
||||||
FT lHiT = std::max(lSrcT,lTgtT);
|
FT lHiT = (std::max)(lSrcT,lTgtT);
|
||||||
|
|
||||||
return ( lLoT < aT && aT < lHiT )
|
return ( lLoT < aT && aT < lHiT )
|
||||||
&& is_possibly_inexact_time_clearly_not_equal_to(aT,lLoT)
|
&& is_possibly_inexact_time_clearly_not_equal_to(aT,lLoT)
|
||||||
|
|
|
||||||
|
|
@ -18,10 +18,10 @@ int main()
|
||||||
{
|
{
|
||||||
typedef CGAL::Point_2<Kernel> Point;
|
typedef CGAL::Point_2<Kernel> Point;
|
||||||
typedef std::vector<Point> Linestring;
|
typedef std::vector<Point> Linestring;
|
||||||
typedef CGAL::Polygon_with_holes_2<Kernel> Polygon;
|
typedef CGAL::Polygon_with_holes_2<Kernel> Cgal_polygon;
|
||||||
typedef std::vector<Point> MultiPoint;
|
typedef std::vector<Point> MultiPoint;
|
||||||
typedef std::vector<Linestring> MultiLinestring;
|
typedef std::vector<Linestring> MultiLinestring;
|
||||||
typedef std::vector<Polygon> MultiPolygon;
|
typedef std::vector<Cgal_polygon> MultiPolygon;
|
||||||
|
|
||||||
Point p;
|
Point p;
|
||||||
{
|
{
|
||||||
|
|
@ -38,7 +38,7 @@ int main()
|
||||||
CGAL_assertion(ls.size() == 3);
|
CGAL_assertion(ls.size() == 3);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
Polygon poly;
|
Cgal_polygon poly;
|
||||||
std::ifstream in("data/polygon.wkt");
|
std::ifstream in("data/polygon.wkt");
|
||||||
CGAL::read_polygon_WKT(in, poly);
|
CGAL::read_polygon_WKT(in, poly);
|
||||||
in.close();
|
in.close();
|
||||||
|
|
|
||||||
|
|
@ -16,10 +16,10 @@
|
||||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
|
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
|
||||||
typedef CGAL::Point_2<Kernel> Point;
|
typedef CGAL::Point_2<Kernel> Point;
|
||||||
typedef std::vector<Point> Linestring;
|
typedef std::vector<Point> Linestring;
|
||||||
typedef CGAL::Polygon_with_holes_2<Kernel> Polygon;
|
typedef CGAL::Polygon_with_holes_2<Kernel> Cgal_polygon;
|
||||||
typedef std::vector<Point> MultiPoint;
|
typedef std::vector<Point> MultiPoint;
|
||||||
typedef std::vector<Linestring> MultiLinestring;
|
typedef std::vector<Linestring> MultiLinestring;
|
||||||
typedef std::vector<Polygon> MultiPolygon;
|
typedef std::vector<Cgal_polygon> MultiPolygon;
|
||||||
|
|
||||||
double fRand(double fMin, double fMax)
|
double fRand(double fMin, double fMax)
|
||||||
{
|
{
|
||||||
|
|
@ -42,7 +42,7 @@ Linestring generate_linestring()
|
||||||
ls.push_back(generate_point(0,15,0,15));
|
ls.push_back(generate_point(0,15,0,15));
|
||||||
return ls;
|
return ls;
|
||||||
}
|
}
|
||||||
Polygon generate_polygon()
|
Cgal_polygon generate_polygon()
|
||||||
{
|
{
|
||||||
Point bl,br, t;
|
Point bl,br, t;
|
||||||
bl = generate_point(-10,-5, -10, -5);
|
bl = generate_point(-10,-5, -10, -5);
|
||||||
|
|
@ -56,22 +56,22 @@ Polygon generate_polygon()
|
||||||
xt(t.x()),
|
xt(t.x()),
|
||||||
ymin(bl.y()),
|
ymin(bl.y()),
|
||||||
ymid((ymax+ymin)/4.0);
|
ymid((ymax+ymin)/4.0);
|
||||||
Polygon::Polygon_2 border;
|
Cgal_polygon::Polygon_2 border;
|
||||||
border.push_back(bl);
|
border.push_back(bl);
|
||||||
border.push_back(t);
|
border.push_back(t);
|
||||||
border.push_back(br);
|
border.push_back(br);
|
||||||
Polygon::Polygon_2 hole1;
|
Cgal_polygon::Polygon_2 hole1;
|
||||||
hole1.push_back(Point((xt+xmax)/2, (ymin+ymid)/2));
|
hole1.push_back(Point((xt+xmax)/2, (ymin+ymid)/2));
|
||||||
hole1.push_back(Point(((xt+xmax)/2), ymid));
|
hole1.push_back(Point(((xt+xmax)/2), ymid));
|
||||||
hole1.push_back(Point(xt+(xmax-xt)/4, (ymin+ymid)/2));
|
hole1.push_back(Point(xt+(xmax-xt)/4, (ymin+ymid)/2));
|
||||||
Polygon::Polygon_2 hole2;
|
Cgal_polygon::Polygon_2 hole2;
|
||||||
hole2.push_back(Point((xt+xmin)/2, (ymin+ymid)/2));
|
hole2.push_back(Point((xt+xmin)/2, (ymin+ymid)/2));
|
||||||
hole2.push_back(Point(((xt+xmin)/2), ymid));
|
hole2.push_back(Point(((xt+xmin)/2), ymid));
|
||||||
hole2.push_back(Point(xmin+(xt-xmin)/4, (ymin+ymid)/2));
|
hole2.push_back(Point(xmin+(xt-xmin)/4, (ymin+ymid)/2));
|
||||||
Polygon::Holes_container holes;
|
Cgal_polygon::Holes_container holes;
|
||||||
holes.push_back(hole1);
|
holes.push_back(hole1);
|
||||||
holes.push_back(hole2);
|
holes.push_back(hole2);
|
||||||
return Polygon(border, holes.begin(), holes.end());
|
return Cgal_polygon(border, holes.begin(), holes.end());
|
||||||
}
|
}
|
||||||
MultiPoint generate_multipoint()
|
MultiPoint generate_multipoint()
|
||||||
{
|
{
|
||||||
|
|
@ -91,7 +91,7 @@ MultiLinestring generate_multilinestring()
|
||||||
}
|
}
|
||||||
MultiPolygon generate_multipolygon()
|
MultiPolygon generate_multipolygon()
|
||||||
{
|
{
|
||||||
Polygon p1=generate_polygon(),
|
Cgal_polygon p1=generate_polygon(),
|
||||||
p2=generate_polygon();
|
p2=generate_polygon();
|
||||||
MultiPolygon polies;
|
MultiPolygon polies;
|
||||||
polies.push_back(p1);
|
polies.push_back(p1);
|
||||||
|
|
@ -134,14 +134,14 @@ int main()
|
||||||
CGAL_assertion(ls == test_ls);
|
CGAL_assertion(ls == test_ls);
|
||||||
|
|
||||||
|
|
||||||
Polygon poly = generate_polygon();
|
Cgal_polygon poly = generate_polygon();
|
||||||
{
|
{
|
||||||
std::ofstream os("test.wkt");
|
std::ofstream os("test.wkt");
|
||||||
os.precision(17);
|
os.precision(17);
|
||||||
CGAL::write_polygon_WKT(os, poly);
|
CGAL::write_polygon_WKT(os, poly);
|
||||||
os.close();
|
os.close();
|
||||||
}
|
}
|
||||||
Polygon test_poly;
|
Cgal_polygon test_poly;
|
||||||
{
|
{
|
||||||
std::ifstream is("test.wkt");
|
std::ifstream is("test.wkt");
|
||||||
CGAL::read_polygon_WKT(is, test_poly);
|
CGAL::read_polygon_WKT(is, test_poly);
|
||||||
|
|
|
||||||
|
|
@ -440,7 +440,7 @@ public:
|
||||||
{
|
{
|
||||||
for (std::size_t i=0; i<parrays_.size(); ++i)
|
for (std::size_t i=0; i<parrays_.size(); ++i)
|
||||||
parrays_[i]->reserve(n);
|
parrays_[i]->reserve(n);
|
||||||
capacity_ = std::max(n, capacity_);
|
capacity_ = (std::max)(n, capacity_);
|
||||||
}
|
}
|
||||||
|
|
||||||
// resize all arrays to size n
|
// resize all arrays to size n
|
||||||
|
|
@ -465,7 +465,7 @@ public:
|
||||||
for (std::size_t i=0; i<parrays_.size(); ++i)
|
for (std::size_t i=0; i<parrays_.size(); ++i)
|
||||||
parrays_[i]->push_back();
|
parrays_[i]->push_back();
|
||||||
++size_;
|
++size_;
|
||||||
capacity_ = (std::max(size_, capacity_));
|
capacity_ = ((std::max)(size_, capacity_));
|
||||||
}
|
}
|
||||||
|
|
||||||
// reset element to its default property values
|
// reset element to its default property values
|
||||||
|
|
|
||||||
|
|
@ -64,17 +64,17 @@ namespace CGAL {
|
||||||
typedef boost::uint32_t size_type;
|
typedef boost::uint32_t size_type;
|
||||||
/// Constructor. %Default construction creates an invalid index.
|
/// Constructor. %Default construction creates an invalid index.
|
||||||
/// We write -1, which is <a href="https://en.cppreference.com/w/cpp/types/numeric_limits">
|
/// We write -1, which is <a href="https://en.cppreference.com/w/cpp/types/numeric_limits">
|
||||||
/// <tt>std::numeric_limits<size_type>::max()</tt></a>
|
/// <tt>(std::numeric_limits<size_type>::max)()</tt></a>
|
||||||
/// as `size_type` is an unsigned type.
|
/// as `size_type` is an unsigned type.
|
||||||
explicit SM_Index(size_type _idx=(std::numeric_limits<size_type>::max)()) : idx_(_idx) {}
|
explicit SM_Index(size_type _idx=(std::numeric_limits<size_type>::max)()) : idx_(_idx) {}
|
||||||
|
|
||||||
/// Get the underlying index of this index
|
/// Get the underlying index of this index
|
||||||
operator size_type() const { return idx_; }
|
operator size_type() const { return idx_; }
|
||||||
|
|
||||||
/// reset index to be invalid (index=std::numeric_limits<size_type>::max())
|
/// reset index to be invalid (index=(std::numeric_limits<size_type>::max)())
|
||||||
void reset() { idx_=(std::numeric_limits<size_type>::max)(); }
|
void reset() { idx_=(std::numeric_limits<size_type>::max)(); }
|
||||||
|
|
||||||
/// return whether the index is valid, i.e., the index is not equal to `%std::numeric_limits<size_type>::max()`.
|
/// return whether the index is valid, i.e., the index is not equal to `%(std::numeric_limits<size_type>::max)()`.
|
||||||
bool is_valid() const {
|
bool is_valid() const {
|
||||||
size_type inf = (std::numeric_limits<size_type>::max)();
|
size_type inf = (std::numeric_limits<size_type>::max)();
|
||||||
return idx_ != inf;
|
return idx_ != inf;
|
||||||
|
|
@ -253,10 +253,10 @@ namespace CGAL {
|
||||||
// compatibility with OpenMesh handles
|
// compatibility with OpenMesh handles
|
||||||
size_type idx() const { return (size_type)halfedge_ / 2; }
|
size_type idx() const { return (size_type)halfedge_ / 2; }
|
||||||
|
|
||||||
// resets index to be invalid (index=std::numeric_limits<size_type>::max())
|
// resets index to be invalid (index=(std::numeric_limits<size_type>::max)())
|
||||||
void reset() { halfedge_.reset(); }
|
void reset() { halfedge_.reset(); }
|
||||||
|
|
||||||
// returns whether the index is valid, i.e., the index is not equal to std::numeric_limits<size_type>::max().
|
// returns whether the index is valid, i.e., the index is not equal to (std::numeric_limits<size_type>::max)().
|
||||||
bool is_valid() const { return halfedge_.is_valid(); }
|
bool is_valid() const { return halfedge_.is_valid(); }
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define CGAL_VSA_INVALID_TAG std::numeric_limits<std::size_t>::max()
|
#define CGAL_VSA_INVALID_TAG (std::numeric_limits<std::size_t>::max)()
|
||||||
|
|
||||||
namespace CGAL {
|
namespace CGAL {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -99,8 +99,8 @@ public:
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
m_minimum = std::min(m_minimum, sample);
|
m_minimum = (std::min)(m_minimum, sample);
|
||||||
m_maximum = std::max(m_maximum, sample);
|
m_maximum = (std::max)(m_maximum, sample);
|
||||||
}
|
}
|
||||||
m_sum += sample;
|
m_sum += sample;
|
||||||
++m_numSamples;
|
++m_numSamples;
|
||||||
|
|
@ -227,7 +227,7 @@ void run_benchmarks(CGAL::Random& rand, size_t numTrials, size_t numSources, siz
|
||||||
outData.constructionTime.add_sample(elapsed.wall);
|
outData.constructionTime.add_sample(elapsed.wall);
|
||||||
|
|
||||||
#if !defined(NDEBUG)
|
#if !defined(NDEBUG)
|
||||||
outData.peakMemoryUsage.add_sample(std::max(shortestPaths.peak_memory_usage(), shortestPaths.current_memory_usage()));
|
outData.peakMemoryUsage.add_sample((std::max)(shortestPaths.peak_memory_usage(), shortestPaths.current_memory_usage()));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (size_t j = 0; j < numQueries; ++j)
|
for (size_t j = 0; j < numQueries; ++j)
|
||||||
|
|
|
||||||
|
|
@ -413,7 +413,7 @@ public:
|
||||||
+ (sizeof(Cone_expansion_event) + (sizeof(Cone_expansion_event*)) * m_peakQueueSize)
|
+ (sizeof(Cone_expansion_event) + (sizeof(Cone_expansion_event*)) * m_peakQueueSize)
|
||||||
+ (sizeof(Cone_tree_node) * m_nodesAtPeakQueue);
|
+ (sizeof(Cone_tree_node) * m_nodesAtPeakQueue);
|
||||||
|
|
||||||
return std::max(peakNodeUsage, peakQueueUsage);
|
return (std::max)(peakNodeUsage, peakQueueUsage);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// \endcond
|
/// \endcond
|
||||||
|
|
|
||||||
|
|
@ -323,13 +323,13 @@ public :
|
||||||
{
|
{
|
||||||
const Point& p = pVertex->point();
|
const Point& p = pVertex->point();
|
||||||
|
|
||||||
xmin = std::min(xmin,p.x());
|
xmin = (std::min)(xmin,p.x());
|
||||||
ymin = std::min(ymin,p.y());
|
ymin = (std::min)(ymin,p.y());
|
||||||
zmin = std::min(zmin,p.z());
|
zmin = (std::min)(zmin,p.z());
|
||||||
|
|
||||||
xmax = std::max(xmax,p.x());
|
xmax = (std::max)(xmax,p.x());
|
||||||
ymax = std::max(ymax,p.y());
|
ymax = (std::max)(ymax,p.y());
|
||||||
zmax = std::max(zmax,p.z());
|
zmax = (std::max)(zmax,p.z());
|
||||||
}
|
}
|
||||||
m_bbox = Iso_cuboid(xmin,ymin,zmin,
|
m_bbox = Iso_cuboid(xmin,ymin,zmin,
|
||||||
xmax,ymax,zmax);
|
xmax,ymax,zmax);
|
||||||
|
|
|
||||||
|
|
@ -130,8 +130,8 @@ int vtkCGALSurfaceMesherContourFilter::RequestData(
|
||||||
return 0;
|
return 0;
|
||||||
Gray_level_image gray_level_image(image, Value);
|
Gray_level_image gray_level_image(image, Value);
|
||||||
|
|
||||||
GT::FT radius = std::max(image.xdim() * image.vx(),
|
GT::FT radius = (std::max)(image.xdim() * image.vx(),
|
||||||
std::max(image.ydim() * image.vy(),
|
(std::max)(image.ydim() * image.vy(),
|
||||||
image.zdim() * image.vz())
|
image.zdim() * image.vz())
|
||||||
);
|
);
|
||||||
GT::Sphere_3 bounding_sphere(GT::Point_3(image.xdim() * image.vx()/2.,
|
GT::Sphere_3 bounding_sphere(GT::Point_3(image.xdim() * image.vx()/2.,
|
||||||
|
|
|
||||||
|
|
@ -37,11 +37,11 @@ public:
|
||||||
|
|
||||||
// For generating all the combinations of |k| distinct elements in the
|
// For generating all the combinations of |k| distinct elements in the
|
||||||
// interval [min, max] (both included)
|
// interval [min, max] (both included)
|
||||||
Combination_enumerator(const int k, const int min, const int max)
|
Combination_enumerator(const int k, const int imin, const int imax)
|
||||||
: combi_(k), k_(k), min_(min), max_(max), max_at_pos_0_(max + 1 - k)
|
: combi_(k), k_(k), min_(imin), max_(imax), max_at_pos_0_(imax + 1 - k)
|
||||||
{
|
{
|
||||||
CGAL_assertion_msg( min <= max, "min is larger than max");
|
CGAL_assertion_msg( imin <= imax, "min is larger than max");
|
||||||
CGAL_assertion_msg( 1 <= k && k <= ( max - min + 1 ), "wrong value of k");
|
CGAL_assertion_msg( 1 <= k && k <= ( imax - imin + 1 ), "wrong value of k");
|
||||||
init();
|
init();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue