mirror of https://github.com/CGAL/cgal
More errors and warnigns
This commit is contained in:
parent
9bf61b7977
commit
c74bca8d65
|
|
@ -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;
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -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));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue