mirror of https://github.com/CGAL/cgal
fix functions calls
This commit is contained in:
parent
e81a41f9d7
commit
20898e4b31
|
|
@ -8,7 +8,7 @@
|
||||||
#include <CGAL/Delaunay_triangulation_3.h>
|
#include <CGAL/Delaunay_triangulation_3.h>
|
||||||
#include <CGAL/Triangulation_vertex_base_with_info_3.h>
|
#include <CGAL/Triangulation_vertex_base_with_info_3.h>
|
||||||
#include <CGAL/Advancing_front_surface_reconstruction.h>
|
#include <CGAL/Advancing_front_surface_reconstruction.h>
|
||||||
#include <CGAL/IO/read_xyz_points.h>
|
#include <CGAL/IO/read_points.h>
|
||||||
#include <CGAL/disable_warnings.h>
|
#include <CGAL/disable_warnings.h>
|
||||||
|
|
||||||
#include <boost/lexical_cast.hpp>
|
#include <boost/lexical_cast.hpp>
|
||||||
|
|
@ -112,10 +112,8 @@ int main (int argc, char* argv[])
|
||||||
|
|
||||||
const char* fname = (argc>1) ? argv[1] : "data/cube.pwn";
|
const char* fname = (argc>1) ? argv[1] : "data/cube.pwn";
|
||||||
// Loading point set from a file.
|
// Loading point set from a file.
|
||||||
std::ifstream stream(fname);
|
|
||||||
|
|
||||||
if (!stream ||
|
if (!CGAL::read_points(fname,
|
||||||
!CGAL::read_XYZ(stream,
|
|
||||||
std::back_inserter(points),
|
std::back_inserter(points),
|
||||||
CGAL::parameters::point_map(Point_map()).
|
CGAL::parameters::point_map(Point_map()).
|
||||||
normal_map(Normal_map())))
|
normal_map(Normal_map())))
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h>
|
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h>
|
||||||
|
|
||||||
#include <CGAL/boost/graph/copy_face_graph.h>
|
#include <CGAL/boost/graph/copy_face_graph.h>
|
||||||
|
#include <CGAL/boost/graph/IO/OFF.h>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
@ -38,7 +39,7 @@ int main(int argc, char* argv[])
|
||||||
Target1 T1;
|
Target1 T1;
|
||||||
{
|
{
|
||||||
CGAL::copy_face_graph(S, T1);
|
CGAL::copy_face_graph(S, T1);
|
||||||
CGAL::write_off("lcc.off", T1);
|
CGAL::write_OFF("lcc.off", T1);
|
||||||
}
|
}
|
||||||
|
|
||||||
S.clear();
|
S.clear();
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#include <CGAL/Simple_cartesian.h>
|
#include <CGAL/Simple_cartesian.h>
|
||||||
|
|
||||||
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h>
|
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h>
|
||||||
#include <CGAL/boost/graph/IO/OFF.h>
|
#include <CGAL/boost/graph/IO/polygon_mesh_io.h>
|
||||||
|
|
||||||
#include <boost/graph/breadth_first_search.hpp>
|
#include <boost/graph/breadth_first_search.hpp>
|
||||||
|
|
||||||
|
|
@ -20,7 +20,7 @@ typedef boost::graph_traits<LCC>::vertex_iterator vertex_iterator;
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
LCC lcc;
|
LCC lcc;
|
||||||
CGAL::read_OFF((argc>1)?argv[1]:"cube.off", lcc);
|
CGAL::read_polygon_mesh((argc>1)?argv[1]:"cube.off", lcc);
|
||||||
|
|
||||||
// This is the vector where the distance gets written to
|
// This is the vector where the distance gets written to
|
||||||
std::vector<int> distance(lcc.vertex_attributes().size());
|
std::vector<int> distance(lcc.vertex_attributes().size());
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h>
|
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h>
|
||||||
#include <CGAL/boost/graph/iterator.h>
|
#include <CGAL/boost/graph/iterator.h>
|
||||||
#include <CGAL/boost/graph/IO/OFF.h>
|
#include <CGAL/boost/graph/IO/polygon_mesh_io.h>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
@ -51,7 +51,7 @@ OutputIterator adjacent_vertices_V2(const LCC& g,
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
LCC lcc;
|
LCC lcc;
|
||||||
CGAL::read_OFF((argc>1)?argv[1]:"cube.off", lcc);
|
CGAL::read_polygon_mesh((argc>1)?argv[1]:"cube.off", lcc);
|
||||||
|
|
||||||
GraphTraits::vertex_iterator vi = vertices(lcc).first;
|
GraphTraits::vertex_iterator vi = vertices(lcc).first;
|
||||||
std::list<vertex_descriptor> V;
|
std::list<vertex_descriptor> V;
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
#include <CGAL/Simple_cartesian.h>
|
#include <CGAL/Simple_cartesian.h>
|
||||||
|
|
||||||
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h>
|
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h>
|
||||||
#include <CGAL/boost/graph/IO/OFF.h>
|
#include <CGAL/boost/graph/IO/polygon_mesh_io.h>
|
||||||
#include <CGAL/property_map.h>
|
#include <CGAL/property_map.h>
|
||||||
|
|
||||||
#include <boost/graph/graph_traits.hpp>
|
#include <boost/graph/graph_traits.hpp>
|
||||||
|
|
@ -70,7 +70,7 @@ int main(int argc, char** argv)
|
||||||
Face_index_map;
|
Face_index_map;
|
||||||
|
|
||||||
LCC lcc;
|
LCC lcc;
|
||||||
CGAL::read_OFF((argc>1)?argv[1]:"cube.off", lcc);
|
CGAL::read_polygon_mesh((argc>1)?argv[1]:"cube.off", lcc);
|
||||||
|
|
||||||
// Ad hoc property_map to store normals. Face_index_map is used to
|
// Ad hoc property_map to store normals. Face_index_map is used to
|
||||||
// map face_descriptors to a contiguous range of indices. See
|
// map face_descriptors to a contiguous range of indices. See
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#include <CGAL/Iterator_range.h>
|
#include <CGAL/Iterator_range.h>
|
||||||
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h>
|
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h>
|
||||||
#include <CGAL/boost/graph/IO/OFF.h>
|
#include <CGAL/boost/graph/IO/polygon_mesh_io.h>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
@ -52,7 +52,7 @@ void fct(const LCC& lcc)
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
LCC lcc;
|
LCC lcc;
|
||||||
CGAL::read_OFF((argc>1)?argv[1]:"cube.off", lcc);
|
CGAL::read_polygon_mesh((argc>1)?argv[1]:"cube.off", lcc);
|
||||||
|
|
||||||
fct(lcc);
|
fct(lcc);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h>
|
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h>
|
||||||
#include <CGAL/boost/graph/iterator.h>
|
#include <CGAL/boost/graph/iterator.h>
|
||||||
#include <CGAL/boost/iterator/transform_iterator.hpp>
|
#include <CGAL/boost/iterator/transform_iterator.hpp>
|
||||||
#include <CGAL/boost/graph/IO/OFF.h>
|
#include <CGAL/boost/graph/IO/polygon_mesh_io.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
@ -43,7 +43,7 @@ struct Source {
|
||||||
int main(int argc, char** argv)
|
int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
LCC lcc;
|
LCC lcc;
|
||||||
CGAL::read_OFF((argc>1)?argv[1]:"cube.off", lcc);
|
CGAL::read_polygon_mesh((argc>1)?argv[1]:"cube.off", lcc);
|
||||||
GraphTraits::vertex_descriptor vd = *(vertices(lcc).first);
|
GraphTraits::vertex_descriptor vd = *(vertices(lcc).first);
|
||||||
|
|
||||||
typedef boost::transform_iterator<Source<LCC>,halfedge_around_target_iterator> adjacent_vertex_iterator;
|
typedef boost::transform_iterator<Source<LCC>,halfedge_around_target_iterator> adjacent_vertex_iterator;
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ int main(int argc, char** argv )
|
||||||
for(halfedge_descriptor hd : CGAL::halfedges_around_target(vd,mesh)){
|
for(halfedge_descriptor hd : CGAL::halfedges_around_target(vd,mesh)){
|
||||||
if(! CGAL::is_border(edge(hd,mesh),mesh)){
|
if(! CGAL::is_border(edge(hd,mesh),mesh)){
|
||||||
CGAL::Euler::flip_edge(hd,mesh);
|
CGAL::Euler::flip_edge(hd,mesh);
|
||||||
CGAL::write_off((argc>2)?argv[2]:"out.off", mesh);
|
CGAL::write_OFF((argc>2)?argv[2]:"out.off", mesh);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
#include <CGAL/Simple_cartesian.h>
|
#include <CGAL/Simple_cartesian.h>
|
||||||
#include <CGAL/Surface_mesh.h>
|
#include <CGAL/Surface_mesh.h>
|
||||||
#include <CGAL/boost/graph/selection.h>
|
#include <CGAL/boost/graph/selection.h>
|
||||||
|
#include <CGAL/boost/graph/IO/OFF.h>
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
@ -20,7 +21,7 @@ int main(int argc, char** argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
Mesh mesh;
|
Mesh mesh;
|
||||||
CGAL::read_off (in, mesh);
|
CGAL::read_OFF (in, mesh);
|
||||||
|
|
||||||
boost::unordered_map<Face_index, bool> is_selected_map;
|
boost::unordered_map<Face_index, bool> is_selected_map;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ int main(int argc, char** argv)
|
||||||
// Output the mesh extracted from subpart n°0
|
// Output the mesh extracted from subpart n°0
|
||||||
std::ofstream out("sm_part_0.off");
|
std::ofstream out("sm_part_0.off");
|
||||||
out.precision(17);
|
out.precision(17);
|
||||||
CGAL::write_off(out, part_sm);
|
CGAL::write_OFF(out, part_sm);
|
||||||
|
|
||||||
// Output all the vertices that are in the part n°0
|
// Output all the vertices that are in the part n°0
|
||||||
std::ofstream outxyz("out.xyz");
|
std::ofstream outxyz("out.xyz");
|
||||||
|
|
|
||||||
|
|
@ -139,10 +139,10 @@ bool write_STL(std::ostream& out,
|
||||||
|
|
||||||
const float coords[12] =
|
const float coords[12] =
|
||||||
{
|
{
|
||||||
static_cast<float>(n.x()), static_cast<float>(n.y()), static_cast<float>(n.z()),
|
static_cast<float>(to_double(n.x())), static_cast<float>(to_double(n.y())), static_cast<float>(to_double(n.z())),
|
||||||
static_cast<float>(p.x()), static_cast<float>(p.y()), static_cast<float>(p.z()),
|
static_cast<float>(to_double(p.x())), static_cast<float>(to_double(p.y())), static_cast<float>(to_double(p.z())),
|
||||||
static_cast<float>(q.x()), static_cast<float>(q.y()), static_cast<float>(q.z()),
|
static_cast<float>(to_double(q.x())), static_cast<float>(to_double(q.y())), static_cast<float>(to_double(q.z())),
|
||||||
static_cast<float>(r.x()), static_cast<float>(r.y()), static_cast<float>(r.z()) };
|
static_cast<float>(to_double(r.x())), static_cast<float>(to_double(r.y())), static_cast<float>(to_double(r.z())) };
|
||||||
|
|
||||||
for(int i=0; i<12; ++i)
|
for(int i=0; i<12; ++i)
|
||||||
out.write(reinterpret_cast<const char *>(&coords[i]), sizeof(coords[i]));
|
out.write(reinterpret_cast<const char *>(&coords[i]), sizeof(coords[i]));
|
||||||
|
|
|
||||||
|
|
@ -144,10 +144,11 @@ bool write_polygon_mesh(const std::string& fname,
|
||||||
if (fname.find(".stl") != std::string::npos) {
|
if (fname.find(".stl") != std::string::npos) {
|
||||||
return write_STL(fname, g, np);
|
return write_STL(fname, g, np);
|
||||||
}
|
}
|
||||||
|
#ifdef CGAL_USE_VTK
|
||||||
if (fname.find(".vtp") != std::string::npos) {
|
if (fname.find(".vtp") != std::string::npos) {
|
||||||
return write_VTP(fname, g, np);
|
return write_VTP(fname, g, np);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@ int main (int argc, char** argv)
|
||||||
Point_set point_set;
|
Point_set point_set;
|
||||||
point_set.add_normal_map();
|
point_set.add_normal_map();
|
||||||
// Reading input in OFF format
|
// Reading input in OFF format
|
||||||
if (!f || !CGAL::read_off_points
|
if (!f || !CGAL::read_OFF
|
||||||
(f,
|
(f,
|
||||||
point_set.index_back_inserter(), // OutputIterator
|
point_set.index_back_inserter(), // OutputIterator
|
||||||
CGAL::parameters::point_map(point_set.point_push_map()).
|
CGAL::parameters::point_map(point_set.point_push_map()).
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ int main (int argc, char** argv)
|
||||||
{
|
{
|
||||||
std::ofstream out ("out.ply");
|
std::ofstream out ("out.ply");
|
||||||
out.precision(17); // Use sufficient precision in ASCII
|
out.precision(17); // Use sufficient precision in ASCII
|
||||||
CGAL::write_ply_point_set (out, point_set); // same as `out << point_set`
|
CGAL::write_PLY (out, point_set); // same as `out << point_set`
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||||
#include <CGAL/Point_set_3.h>
|
#include <CGAL/Point_set_3.h>
|
||||||
#include <CGAL/Point_set_3/IO.h>
|
#include <CGAL/Point_set_3/point_set_io.h>
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
@ -19,7 +19,7 @@ int main (int argc, char** argv)
|
||||||
Point_set point_set;
|
Point_set point_set;
|
||||||
|
|
||||||
// Reading input in XYZ format
|
// Reading input in XYZ format
|
||||||
if (!f || !CGAL::read_XYZ (f, point_set))
|
if (!f || !CGAL::read_XYZ(f, point_set))
|
||||||
{
|
{
|
||||||
std::cerr << "Can't read input file " << std::endl;
|
std::cerr << "Can't read input file " << std::endl;
|
||||||
return EXIT_FAILURE;
|
return EXIT_FAILURE;
|
||||||
|
|
|
||||||
|
|
@ -36,7 +36,7 @@ int main(int argc, char*argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
// Saves point set.
|
// Saves point set.
|
||||||
// Note: write_xyz_points() requires property maps to access each
|
// Note: write_XYZ() requires property maps to access each
|
||||||
// point position and normal.
|
// point position and normal.
|
||||||
std::ofstream out("oni_copy.xyz");
|
std::ofstream out("oni_copy.xyz");
|
||||||
out.precision(17);
|
out.precision(17);
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ int main(int argc, const char** argv)
|
||||||
std::vector<Pwn> pwns1, pwns2;
|
std::vector<Pwn> pwns1, pwns2;
|
||||||
std::ifstream input(fname1);
|
std::ifstream input(fname1);
|
||||||
if (!input ||
|
if (!input ||
|
||||||
!CGAL::read_PLY_points(input, std::back_inserter(pwns1),
|
!CGAL::read_PLY(input, std::back_inserter(pwns1),
|
||||||
CGAL::parameters::point_map (CGAL::First_of_pair_property_map<Pwn>()).
|
CGAL::parameters::point_map (CGAL::First_of_pair_property_map<Pwn>()).
|
||||||
normal_map (Normal_map())))
|
normal_map (Normal_map())))
|
||||||
{
|
{
|
||||||
|
|
@ -38,7 +38,7 @@ int main(int argc, const char** argv)
|
||||||
|
|
||||||
input.open(fname2);
|
input.open(fname2);
|
||||||
if (!input ||
|
if (!input ||
|
||||||
!CGAL::read_PLY_points(input, std::back_inserter(pwns2),
|
!CGAL::read_PLY(input, std::back_inserter(pwns2),
|
||||||
CGAL::parameters::point_map (Point_map()).
|
CGAL::parameters::point_map (Point_map()).
|
||||||
normal_map (Normal_map())))
|
normal_map (Normal_map())))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ int main(int argc, const char** argv)
|
||||||
std::vector<Pwn> pwns1, pwns2;
|
std::vector<Pwn> pwns1, pwns2;
|
||||||
std::ifstream input(fname1);
|
std::ifstream input(fname1);
|
||||||
if (!input ||
|
if (!input ||
|
||||||
!CGAL::read_PLY_points(input, std::back_inserter(pwns1),
|
!CGAL::read_PLY(input, std::back_inserter(pwns1),
|
||||||
CGAL::parameters::point_map (CGAL::First_of_pair_property_map<Pwn>()).
|
CGAL::parameters::point_map (CGAL::First_of_pair_property_map<Pwn>()).
|
||||||
normal_map (Normal_map())))
|
normal_map (Normal_map())))
|
||||||
{
|
{
|
||||||
|
|
@ -41,7 +41,7 @@ int main(int argc, const char** argv)
|
||||||
|
|
||||||
input.open(fname2);
|
input.open(fname2);
|
||||||
if (!input ||
|
if (!input ||
|
||||||
!CGAL::read_PLY_points(input, std::back_inserter(pwns2),
|
!CGAL::read_PLY(input, std::back_inserter(pwns2),
|
||||||
CGAL::parameters::point_map (Point_map()).
|
CGAL::parameters::point_map (Point_map()).
|
||||||
normal_map (Normal_map())))
|
normal_map (Normal_map())))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -545,7 +545,6 @@ read_off_points(
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
typename CGAL_BGL_NP_TEMPLATE_PARAMETERS
|
|
||||||
template <typename OutputIteratorValueType,
|
template <typename OutputIteratorValueType,
|
||||||
typename OutputIterator,
|
typename OutputIterator,
|
||||||
typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||||
|
|
|
||||||
|
|
@ -123,7 +123,7 @@ int main(int argc, char * argv[])
|
||||||
// If XYZ file format:
|
// If XYZ file format:
|
||||||
std::ifstream stream(input_filename.c_str());
|
std::ifstream stream(input_filename.c_str());
|
||||||
if(stream &&
|
if(stream &&
|
||||||
CGAL::read_xyz_points
|
CGAL::read_XYZ
|
||||||
(stream,
|
(stream,
|
||||||
std::back_inserter(points),
|
std::back_inserter(points),
|
||||||
CGAL::parameters::point_map(CGAL::First_of_pair_property_map<PointVectorPair>()).
|
CGAL::parameters::point_map(CGAL::First_of_pair_property_map<PointVectorPair>()).
|
||||||
|
|
|
||||||
|
|
@ -311,7 +311,7 @@ int main(int argc, char * argv[])
|
||||||
{
|
{
|
||||||
std::ifstream stream(input_filename.c_str());
|
std::ifstream stream(input_filename.c_str());
|
||||||
success = stream &&
|
success = stream &&
|
||||||
CGAL::read_off_points(stream,
|
CGAL::read_OFF(stream,
|
||||||
std::back_inserter(points),
|
std::back_inserter(points),
|
||||||
CGAL::parameters::normal_map
|
CGAL::parameters::normal_map
|
||||||
(CGAL::make_normal_of_point_with_normal_map(PointList::value_type()))
|
(CGAL::make_normal_of_point_with_normal_map(PointList::value_type()))
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ std::cout << "=== test_fandisk ===\n";
|
||||||
cov.reserve(nb_points);
|
cov.reserve(nb_points);
|
||||||
std::ifstream stream("data/fandisk.off");
|
std::ifstream stream("data/fandisk.off");
|
||||||
if (!stream ||
|
if (!stream ||
|
||||||
!CGAL::read_off_points(stream,
|
!CGAL::read_OFF(stream,
|
||||||
std::back_inserter(points),
|
std::back_inserter(points),
|
||||||
CGAL::parameters::point_map(pmap)))
|
CGAL::parameters::point_map(pmap)))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@
|
||||||
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h>
|
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex_for_combinatorial_map.h>
|
||||||
|
|
||||||
#include <CGAL/Polygon_mesh_processing/corefinement.h>
|
#include <CGAL/Polygon_mesh_processing/corefinement.h>
|
||||||
|
#include <CGAL/Polygon_mesh_processing/IO/polygon_mesh_io.h>
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
||||||
|
|
@ -20,8 +21,8 @@ int main(int argc, char* argv[])
|
||||||
std::ifstream input(filename1);
|
std::ifstream input(filename1);
|
||||||
|
|
||||||
LCC mesh1, mesh2;
|
LCC mesh1, mesh2;
|
||||||
CGAL::read_OFF(filename1, mesh1);
|
CGAL::Polygon_mesh_processing::IO::read_polygon_mesh(filename1, mesh1);
|
||||||
CGAL::read_OFF(filename2, mesh2);
|
CGAL::Polygon_mesh_processing::IO::read_polygon_mesh(filename2, mesh2);
|
||||||
|
|
||||||
std::cout << "Number of vertices before corefinement "
|
std::cout << "Number of vertices before corefinement "
|
||||||
<< num_vertices(mesh1) << " and "
|
<< num_vertices(mesh1) << " and "
|
||||||
|
|
@ -35,10 +36,10 @@ int main(int argc, char* argv[])
|
||||||
|
|
||||||
std::ofstream output("mesh1_refined.off");
|
std::ofstream output("mesh1_refined.off");
|
||||||
output.precision(17);
|
output.precision(17);
|
||||||
CGAL::write_off(output, mesh1);
|
CGAL::write_OFF(output, mesh1);
|
||||||
output.close();
|
output.close();
|
||||||
output.open("mesh2_refined.off");
|
output.open("mesh2_refined.off");
|
||||||
CGAL::write_off(output, mesh2);
|
CGAL::write_OFF(output, mesh2);
|
||||||
output.close();
|
output.close();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
#include <CGAL/Linear_cell_complex_constructors.h>
|
#include <CGAL/Linear_cell_complex_constructors.h>
|
||||||
|
|
||||||
#include <CGAL/Polygon_mesh_processing/triangulate_hole.h>
|
#include <CGAL/Polygon_mesh_processing/triangulate_hole.h>
|
||||||
|
#include <CGAL/Polygon_mesh_processing/IO/polygon_mesh_io.h>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
|
@ -23,7 +24,7 @@ int main(int argc, char* argv[])
|
||||||
{
|
{
|
||||||
const char* filename = (argc > 1) ? argv[1] : "data/mech-holes-shark.off";
|
const char* filename = (argc > 1) ? argv[1] : "data/mech-holes-shark.off";
|
||||||
LCC mesh;
|
LCC mesh;
|
||||||
CGAL::read_OFF(filename, mesh);
|
CGAL::Polygon_mesh_processing::IO::read_polygon_mesh(filename, mesh);
|
||||||
|
|
||||||
// Incrementally fill the holes
|
// Incrementally fill the holes
|
||||||
unsigned int nb_holes = 0;
|
unsigned int nb_holes = 0;
|
||||||
|
|
@ -56,7 +57,7 @@ int main(int argc, char* argv[])
|
||||||
|
|
||||||
std::ofstream out("filled_LCC.off");
|
std::ofstream out("filled_LCC.off");
|
||||||
out.precision(17);
|
out.precision(17);
|
||||||
CGAL::write_off(out, mesh);
|
CGAL::write_OFF(out, mesh);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@
|
||||||
#include <CGAL/iterator.h>
|
#include <CGAL/iterator.h>
|
||||||
|
|
||||||
#include <CGAL/Polygon_mesh_processing/intersection.h>
|
#include <CGAL/Polygon_mesh_processing/intersection.h>
|
||||||
|
#include <CGAL/Polygon_mesh_processing/IO/polygon_mesh_io.h>
|
||||||
#include <CGAL/Timer.h>
|
#include <CGAL/Timer.h>
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
@ -27,13 +28,13 @@ template <class TriangleMesh>
|
||||||
void run(const char* filename1, const char* filename2, const char* msg)
|
void run(const char* filename1, const char* filename2, const char* msg)
|
||||||
{
|
{
|
||||||
TriangleMesh mesh1;
|
TriangleMesh mesh1;
|
||||||
if ( !CGAL::read_OFF(filename1, mesh1) ) {
|
if ( !CGAL::Polygon_mesh_processing::IO::read_polygon_mesh(filename1, mesh1) ) {
|
||||||
std::cerr << filename1 << " is not a valid off file.\n";
|
std::cerr << filename1 << " is not a valid off file.\n";
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
TriangleMesh mesh2;
|
TriangleMesh mesh2;
|
||||||
if ( !CGAL::read_OFF(filename2, mesh2) ) {
|
if ( !CGAL::Polygon_mesh_processing::IO::read_polygon_mesh(filename2, mesh2) ) {
|
||||||
std::cerr << filename2 << " is not a valid off file.\n";
|
std::cerr << filename2 << " is not a valid off file.\n";
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -73,8 +73,8 @@ Polyhedron_demo_gocad_plugin::load(QFileInfo fileinfo, bool& ok, bool add_to_sce
|
||||||
}
|
}
|
||||||
SMesh& P = * const_cast<SMesh*>(item->polyhedron());
|
SMesh& P = * const_cast<SMesh*>(item->polyhedron());
|
||||||
|
|
||||||
std::string name, color;
|
std::pair<std::string,std::string> name_and_color;
|
||||||
if(! read_GOCAD(in, name, color, P))
|
if(! CGAL::read_GOCAD(in, name_and_color, P))
|
||||||
{
|
{
|
||||||
std::cerr << "Error: Invalid polyhedron" << std::endl;
|
std::cerr << "Error: Invalid polyhedron" << std::endl;
|
||||||
delete item;
|
delete item;
|
||||||
|
|
@ -84,12 +84,12 @@ Polyhedron_demo_gocad_plugin::load(QFileInfo fileinfo, bool& ok, bool add_to_sce
|
||||||
|
|
||||||
t.stop();
|
t.stop();
|
||||||
std::cerr << "Reading took " << t.time() << " sec." << std::endl;
|
std::cerr << "Reading took " << t.time() << " sec." << std::endl;
|
||||||
if(name.size() == 0){
|
if(name_and_color.first.size() == 0){
|
||||||
item->setName(fileinfo.baseName());
|
item->setName(fileinfo.baseName());
|
||||||
} else {
|
} else {
|
||||||
item->setName(name.c_str());
|
item->setName(name_and_color.first.c_str());
|
||||||
}
|
}
|
||||||
QColor qcolor(color.c_str());
|
QColor qcolor(name_and_color.second.c_str());
|
||||||
if(qcolor.isValid())
|
if(qcolor.isValid())
|
||||||
{
|
{
|
||||||
item->setColor(qcolor);
|
item->setColor(qcolor);
|
||||||
|
|
@ -121,7 +121,7 @@ save(QFileInfo fileinfo,QList<CGAL::Three::Scene_item*>& items)
|
||||||
std::ofstream out(fileinfo.filePath().toUtf8());
|
std::ofstream out(fileinfo.filePath().toUtf8());
|
||||||
out.precision (std::numeric_limits<double>::digits10 + 2);
|
out.precision (std::numeric_limits<double>::digits10 + 2);
|
||||||
SMesh* poly = const_cast<SMesh*>(sm_item->polyhedron());
|
SMesh* poly = const_cast<SMesh*>(sm_item->polyhedron());
|
||||||
write_GOCAD(out, qPrintable(fileinfo.baseName()), *poly);
|
CGAL::write_GOCAD(out, qPrintable(fileinfo.baseName()), *poly);
|
||||||
items.pop_front();
|
items.pop_front();
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -222,7 +222,7 @@ bool read_PLY(std::istream& is,
|
||||||
{
|
{
|
||||||
std::vector<std::pair<unsigned int, unsigned int> > dummy_pui;
|
std::vector<std::pair<unsigned int, unsigned int> > dummy_pui;
|
||||||
std::vector<std::pair<float, float> > dummy_pf;
|
std::vector<std::pair<float, float> > dummy_pf;
|
||||||
return IO::internal::read_PLY(is, points, polygons, dummy_pui, std::back_inserter(fcolors), std::back_inserter(vcolors), dummy_pf, verbose);
|
return IO::internal::read_PLY(is, points, polygons, std::back_inserter(dummy_pui), std::back_inserter(fcolors), std::back_inserter(vcolors), std::back_inserter(dummy_pf), verbose);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue