Merge remote-tracking branch 'maxGimeno/PMP-compare_faces_from_meshes-maxGimeno' into gsoc2019-PMPHDist-martinskrodzki

This commit is contained in:
Dmitry Anisimov 2021-06-18 14:45:24 +02:00
commit aaf55dbaa0
904 changed files with 30660 additions and 4530 deletions

View File

@ -65,6 +65,7 @@ jobs:
mkdir -p build_doc && cd build_doc && cmake ../Documentation/doc
- name: Build and Upload Doc
id: build_and_run
if: steps.get_round.outputs.result != 'stop'
run: |
set -ex
@ -77,7 +78,13 @@ jobs:
if [ "$LIST_OF_PKGS" = "" ]; then
exit 1
fi
cd build_doc && make -j2 doc && make -j2 doc_with_postprocessing
cd build_doc && make -j2 doc
make -j2 doc_with_postprocessing 2>tmp.log
if [ -s tmp.log ]; then
content=`cat ./build_doc/tmp.log`
echo ::set-output name=DoxygenError::$(cat tmp.log)
exit 1
fi
cd ..
git clone https://CGAL:${{ secrets.PUSH_TO_CGAL_GITHUB_IO_TOKEN }}@github.com/CGAL/cgal.github.io.git
mkdir -p cgal.github.io/${PR_NUMBER}/$ROUND
@ -99,7 +106,7 @@ jobs:
- name: Post address
uses: actions/github-script@v3
if: steps.get_round.outputs.result != 'stop'
if: ${{ success() && steps.get_round.outputs.result != 'stop' }}
with:
script: |
const address = "The documentation is built. It will be available, after a few minutes, here : https://cgal.github.io/${{ steps.get_pr_number.outputs.result }}/${{ steps.get_round.outputs.result }}/Manual/index.html"
@ -109,3 +116,17 @@ jobs:
issue_number: ${{ github.event.issue.number }},
body: address
});
- name: Post error
uses: actions/github-script@v3
if: ${{ failure() && steps.get_round.outputs.result != 'stop' }}
with:
script: |
const error = "${{steps.build_and_run.outputs.DoxygenError}}"
const msg = "There was an error while building the doc: \n"+error
github.issues.createComment({
owner: "CGAL",
repo: "cgal",
issue_number: ${{ github.event.issue.number }},
body: msg
});

View File

@ -27,7 +27,7 @@ void triangle_mesh(const char* fname)
typedef CGAL::AABB_tree<Traits> Tree;
TriangleMesh tmesh;
if(!CGAL::read_polygon_mesh(fname, tmesh) || CGAL::is_triangle_mesh(tmesh))
if(!CGAL::IO::read_polygon_mesh(fname, tmesh) || CGAL::is_triangle_mesh(tmesh))
{
std::cerr << "Invalid input." << std::endl;
return;

View File

@ -47,7 +47,7 @@ int main(int argc, char* argv[])
const char* filename = (argc > 1) ? argv[1] : "data/tetrahedron.off";
Mesh mesh;
if(!CGAL::read_polygon_mesh(filename, mesh))
if(!CGAL::IO::read_polygon_mesh(filename, mesh))
{
std::cerr << "Invalid input." << std::endl;
return 1;

View File

@ -114,7 +114,7 @@ int main (int argc, char* argv[])
const char* fname = (argc>1) ? argv[1] : "data/cube.pwn";
// Loading point set from a file.
if (!CGAL::read_points(fname, std::back_inserter(points),
if (!CGAL::IO::read_points(fname, std::back_inserter(points),
CGAL::parameters::point_map(Point_map()).
normal_map(Normal_map())))
{

View File

@ -17,7 +17,7 @@ int main(){
CGAL::Gmpq fraction(4,5);
FT::Decompose()(fraction,numerator,denominator);
CGAL::set_pretty_mode(std::cout);
CGAL::IO::set_pretty_mode(std::cout);
std::cout << "decompose fraction: "<< std::endl;
std::cout << "fraction : " << fraction << std::endl;
std::cout << "numerator : " << numerator<< std::endl;

View File

@ -31,7 +31,7 @@ binary_func(const A& a , const B& b){
}
int main(){
CGAL::set_pretty_mode(std::cout);
CGAL::IO::set_pretty_mode(std::cout);
// Function call for ImplicitInteroperable types
std::cout<< binary_func(double(3), int(5)) << std::endl;

View File

@ -56,9 +56,9 @@ public:
Output_rep(const T& tt) : t(tt) {}
std::ostream& operator () (std::ostream& out) const {
if ( needs_parens_as_product(t)) {
return out << "(" << oformat(t) << ")";
return out << "(" << IO::oformat(t) << ")";
} else {
return out << oformat(t);
return out << IO::oformat(t);
}
}
};

View File

@ -20,6 +20,7 @@
#include <CGAL/number_type_config.h>
#include <CGAL/Algebraic_structure_traits.h>
#include <CGAL/Real_embeddable_traits.h>
#include <CGAL/Kernel/Same_uncertainty.h>
namespace CGAL {
CGAL_NTS_BEGIN_NAMESPACE
@ -302,19 +303,21 @@ to_interval( const Real_embeddable& x) {
}
template <typename NT>
NT approximate_sqrt(const NT& nt, CGAL::Null_functor)
typename Coercion_traits<double, NT>::Type
approximate_sqrt(const NT& x, CGAL::Null_functor)
{
return NT(sqrt(CGAL::to_double(nt)));
return sqrt(CGAL::to_double(x));
}
template <typename NT, typename Sqrt>
NT approximate_sqrt(const NT& nt, Sqrt sqrt)
typename Sqrt::result_type
approximate_sqrt(const NT& nt, Sqrt sqrt)
{
return sqrt(nt);
}
template <typename NT>
NT approximate_sqrt(const NT& nt)
decltype(auto) approximate_sqrt(const NT& nt)
{
// the initial version of this function was using Algebraic_category
// for the dispatch but some ring type (like Gmpz) provides a Sqrt
@ -324,6 +327,36 @@ NT approximate_sqrt(const NT& nt)
return approximate_sqrt(nt, Sqrt());
}
template <class NT>
typename Same_uncertainty_nt<Comparison_result, NT>::type
compare_quotients(const NT& xnum, const NT& xden,
const NT& ynum, const NT& yden)
{
// No assumptions on the sign of den are made
// code assumes that SMALLER == - 1;
CGAL_precondition( SMALLER == static_cast<Comparison_result>(-1) );
int xsign = sign(xnum) * sign(xden) ;
int ysign = sign(ynum) * sign(yden) ;
if (xsign == 0) return static_cast<Comparison_result>(-ysign);
if (ysign == 0) return static_cast<Comparison_result>(xsign);
// now (x != 0) && (y != 0)
int diff = xsign - ysign;
if (diff == 0)
{
int msign = sign(xden) * sign(yden);
NT leftop = NT(xnum * yden * msign);
NT rightop = NT(ynum * xden * msign);
return CGAL::compare(leftop, rightop);
}
else
{
return (xsign < ysign) ? SMALLER : LARGER;
}
}
CGAL_NTS_END_NAMESPACE
} //namespace CGAL

View File

@ -49,7 +49,7 @@
#include <CGAL/tss.h>
#include <boost/shared_ptr.hpp>
#include <memory>
namespace CGAL {
@ -393,8 +393,8 @@ public:
Algebraic_curve_kernel_2()
: _m_gcd_cache_2(new Gcd_cache_2())
{
_m_curve_cache_2 = boost::shared_ptr<Curve_cache_2>(new Curve_cache_2(this));
_m_curve_pair_cache_2 = boost::shared_ptr<Curve_pair_cache_2> (new Curve_pair_cache_2(this));
_m_curve_cache_2 = std::shared_ptr<Curve_cache_2>(new Curve_cache_2(this));
_m_curve_pair_cache_2 = std::shared_ptr<Curve_pair_cache_2> (new Curve_pair_cache_2(this));
// std::cout << "CONSTRUCTION Algebraic_curve_kernel_2 " << std::endl;
}
@ -2766,9 +2766,9 @@ public:
protected:
mutable boost::shared_ptr<Curve_cache_2> _m_curve_cache_2;
mutable boost::shared_ptr<Curve_pair_cache_2> _m_curve_pair_cache_2;
mutable boost::shared_ptr<Gcd_cache_2> _m_gcd_cache_2;
mutable std::shared_ptr<Curve_cache_2> _m_curve_cache_2;
mutable std::shared_ptr<Curve_pair_cache_2> _m_curve_pair_cache_2;
mutable std::shared_ptr<Gcd_cache_2> _m_gcd_cache_2;
}; // class Algebraic_curve_kernel_2

View File

@ -436,8 +436,8 @@ std::ostream&
operator << (std::ostream& os,
const CGAL::internal::Algebraic_real_d_1<Coefficient, Rational, HandlePolicy, RepClass >& x){
os << "[" << x.polynomial()
<< ",[" << oformat(x.low())
<< " , " << oformat(x.high()) << " ]]";
<< ",[" << IO::oformat(x.low())
<< " , " << IO::oformat(x.high()) << " ]]";
return os;
}
@ -458,9 +458,9 @@ operator >> (std::istream& is,
is >> poly;
swallow(is, ',');// read the ","
swallow(is, '[');// read the ","
is >> iformat(low);
is >> IO::iformat(low);
swallow(is, ',');// read the ","
is >> iformat(high);
is >> IO::iformat(high);
swallow(is, ']');// read the "]"
swallow(is, ']');// read the "]"
x = ALGNUM(poly, low, high);

View File

@ -2417,7 +2417,7 @@ std::ostream& operator<< (
typedef typename Curve::Asymptote_y Asymptote_y;
switch (::CGAL::get_mode(out)) {
switch (::CGAL::IO::get_mode(out)) {
case ::CGAL::IO::PRETTY: {
out << "--------------- Analysis results ---------------" << std::endl;
@ -2514,7 +2514,7 @@ std::istream& operator>> (
std::istream& is,
Curve_analysis_2< AlgebraicKernelWithAnalysis_2, Rep_ >& curve) {
CGAL_precondition(CGAL::is_ascii(is));
CGAL_precondition(CGAL::IO::is_ascii(is));
typedef AlgebraicKernelWithAnalysis_2 Algebraic_kernel_with_analysis_2;

View File

@ -441,7 +441,7 @@ protected:
}
/*
#if CGAL_ACK_DEBUG_FLAG
::CGAL::set_ascii_mode(CGAL_ACK_DEBUG_PRINT);
::CGAL::IO::set_ascii_mode(CGAL_ACK_DEBUG_PRINT);
CGAL_ACK_DEBUG_PRINT << "Stha: " << (*seq_it) << std::endl;
#endif
*/

View File

@ -675,7 +675,7 @@ template < class AlgebraicCurveKernel_2, class Rep>
std::ostream& operator<< (std::ostream& os,
const Xy_coordinate_2<AlgebraicCurveKernel_2, Rep>& pt)
{
switch (::CGAL::get_mode(os)) {
switch (::CGAL::IO::get_mode(os)) {
case ::CGAL::IO::PRETTY: {
os << "[x-coord: " << CGAL::to_double(pt.x()) << "; curve: " <<
pt.curve().polynomial_2() <<
@ -703,7 +703,7 @@ std::istream& operator >> (
std::istream& is,
Xy_coordinate_2< AlgebraicCurveKernel_2, Rep_>& pt) {
CGAL_precondition(CGAL::is_ascii(is));
CGAL_precondition(CGAL::IO::is_ascii(is));
// this instance's first template argument
typedef AlgebraicCurveKernel_2 Algebraic_curve_kernel_2;

View File

@ -162,7 +162,7 @@ template<typename Arithmetic_kernel> void test_routine() {
CGAL_ACK_DEBUG_PRINT << "P[3(0,P[2(0,-2)(2,2)])(1,P[1(1,-1)])(3,P[1(1,-6)])]" << std::endl;
#endif
f=from_string<Poly_int2>("P[3(0,P[2(0,-2)(2,2)])(1,P[1(1,-1)])(3,P[1(1,-6)])]");
::CGAL::set_pretty_mode(std::cout);
::CGAL::IO::set_pretty_mode(std::cout);
curve=construct_curve_2(f);
assert(curve.number_of_status_lines_with_event()==1);
assert(number_of_objects<Algebraic_kernel_d_2>(curve)==2);

View File

@ -92,7 +92,7 @@ void test_algebraic_curve_kernel_2() {
Poly_2 polys[ACK_2_n_polys];
::CGAL::set_mode(std::cerr, ::CGAL::IO::PRETTY);
::CGAL::IO::set_mode(std::cerr, ::CGAL::IO::PRETTY);
//std::cerr << "constructing curves..\n";
for(int i = 0; i < ACK_2_n_polys; i++) {

View File

@ -291,7 +291,7 @@ void test_algebraic_kernel_1(const AlgebraicKernel_d_1& ak_1){
assert(compare_1(bound,Algebraic_real_1(2)) == SMALLER );
}
CGAL::set_pretty_mode(std::cerr);
CGAL::IO::set_pretty_mode(std::cerr);
// Approximations
bool all_right = true;
@ -408,13 +408,13 @@ void test_algebraic_kernel_1(const AlgebraicKernel_d_1& ak_1){
#define CGAL_TEST_ALGEBRAIC_REAL_IO(_f) \
alg1=_f; \
ss<<CGAL::oformat(alg1); \
ss<<CGAL::IO::oformat(alg1); \
CGAL_assertion(ss.good()); \
ss>>CGAL::iformat(alg2); \
ss>>CGAL::IO::iformat(alg2); \
CGAL_assertion(!ss.fail()); \
ss.clear(); \
assert(alg1==alg2)
// Note: after the reading ss>>CGAL::iformat(alg2) the state of ss can
// Note: after the reading ss>>CGAL::IO::iformat(alg2) the state of ss can
// have the eofbit. The C++ norm says if one tries to write to a stream
// with eofbit, then the failbit will be set. That is why one must
// clear the iostate with ss.clear().
@ -422,7 +422,7 @@ void test_algebraic_kernel_1(const AlgebraicKernel_d_1& ak_1){
Algebraic_real_1 alg1,alg2;
std::stringstream ss;
CGAL::set_ascii_mode(ss);
CGAL::IO::set_ascii_mode(ss);
// test construction from int, Coefficient and Bound
CGAL_TEST_ALGEBRAIC_REAL_IO(construct_algebraic_real_1(int(2)));

View File

@ -20,7 +20,7 @@
#include <CGAL/internal/Exact_type_selector.h>
#include <CGAL/Has_conversion.h>
#include <boost/shared_ptr.hpp>
#include <memory>
#include <boost/type_traits.hpp>
#include <boost/optional.hpp>

View File

@ -23,7 +23,7 @@ template <class Point>
bool
file_input(std::ifstream& is, std::list<Point>& L, int nb=0)
{
CGAL::set_ascii_mode(is);
CGAL::IO::set_ascii_mode(is);
int n;
is >> n;
if (nb != 0 && nb <= n) n=nb;

View File

@ -22,7 +22,7 @@ template <class Weighted_point>
bool
file_input(std::ifstream& is, std::list<Weighted_point>& L)
{
CGAL::set_ascii_mode(is);
CGAL::IO::set_ascii_mode(is);
int n;
is >> n;
std::cout << "Reading " << n << " points" << std::endl;

View File

@ -1966,7 +1966,7 @@ Apollonius_graph_2<Gt,Agds,LTag>::file_output(std::ostream& os) const
CGAL_assertion( n >= 1 );
if( is_ascii(os) ) {
if( IO::is_ascii(os) ) {
os << n << ' ' << m << ' ' << dimension() << std::endl;
} else {
os << n << m << dimension();
@ -1980,24 +1980,24 @@ Apollonius_graph_2<Gt,Agds,LTag>::file_output(std::ostream& os) const
V[infinite_vertex()] = inum++;
// finite vertices
if (is_ascii(os)) os << std::endl;
if (IO::is_ascii(os)) os << std::endl;
for (Finite_vertices_iterator vit = finite_vertices_begin();
vit != finite_vertices_end(); ++vit) {
V[vit] = inum++;
os << vit->site();
if ( is_ascii(os) ) { os << ' '; }
if ( IO::is_ascii(os) ) { os << ' '; }
os << vit->number_of_hidden_sites();
typename Vertex::Hidden_sites_iterator hit;
for (hit = vit->hidden_sites_begin(); hit != vit->hidden_sites_end();
++hit) {
if ( is_ascii(os) ) { os << ' '; }
if ( IO::is_ascii(os) ) { os << ' '; }
os << *hit;
}
// write non-combinatorial info of the vertex
// os << *vit ;
if ( is_ascii(os) ) { os << std::endl; }
if ( IO::is_ascii(os) ) { os << std::endl; }
}
if ( is_ascii(os) ) { os << std::endl; }
if ( IO::is_ascii(os) ) { os << std::endl; }
// vertices of the faces
inum = 0;
@ -2007,25 +2007,25 @@ Apollonius_graph_2<Gt,Agds,LTag>::file_output(std::ostream& os) const
F[fit] = inum++;
for(int j = 0; j < dim ; ++j) {
os << V[ fit->vertex(j) ];
if( is_ascii(os) ) { os << ' '; }
if( IO::is_ascii(os) ) { os << ' '; }
}
// write non-combinatorial info of the face
// os << *fit ;
if( is_ascii(os) ) { os << std::endl; }
if( IO::is_ascii(os) ) { os << std::endl; }
}
if( is_ascii(os) ) { os << std::endl; }
if( IO::is_ascii(os) ) { os << std::endl; }
// neighbor pointers of the faces
for( All_faces_iterator it = all_faces_begin();
it != all_faces_end(); ++it) {
for(int j = 0; j < dimension()+1; ++j){
os << F[ it->neighbor(j) ];
if( is_ascii(os) ) { os << ' '; }
if( IO::is_ascii(os) ) { os << ' '; }
}
if( is_ascii(os) ) { os << std::endl; }
if( IO::is_ascii(os) ) { os << std::endl; }
}
if ( is_ascii(os) ) { os << std::endl; }
if ( IO::is_ascii(os) ) { os << std::endl; }
}

View File

@ -484,7 +484,7 @@ file_output(std::ostream& os) const
// write each level of the hierarchy
for (unsigned int i = 0; i < ag_hierarchy_2__maxlevel; ++i) {
hierarchy[i]->file_output(os);
if ( is_ascii(os) ) { os << std::endl << std::endl; }
if ( IO::is_ascii(os) ) { os << std::endl << std::endl; }
}
Vertex_map* V = new Vertex_map[ag_hierarchy_2__maxlevel];
@ -520,22 +520,22 @@ file_output(std::ostream& os) const
}
// write up and down pointer info
if ( is_ascii(os) ) { os << std::endl << std::endl; }
if ( IO::is_ascii(os) ) { os << std::endl << std::endl; }
for (unsigned int i = 0; i < ag_hierarchy_2__maxlevel; ++i) {
os << i;
if ( is_ascii(os) ) { os << " "; }
if ( IO::is_ascii(os) ) { os << " "; }
os << hierarchy[i]->number_of_vertices();
if ( is_ascii(os) ) { os << std::endl; }
if ( IO::is_ascii(os) ) { os << std::endl; }
for (Finite_vertices_iterator vit = hierarchy[i]->finite_vertices_begin();
vit != hierarchy[i]->finite_vertices_end(); ++vit) {
os << V[i][vit];
if ( is_ascii(os) ) { os << " "; }
if ( IO::is_ascii(os) ) { os << " "; }
os << V_down[i][vit];
if ( is_ascii(os) ) { os << " "; }
if ( IO::is_ascii(os) ) { os << " "; }
os << V_up[i][vit];
if ( is_ascii(os) ) { os << std::endl; }
if ( IO::is_ascii(os) ) { os << std::endl; }
}
if ( is_ascii(os) ) { os << std::endl << std::endl; }
if ( IO::is_ascii(os) ) { os << std::endl << std::endl; }
}
delete[] V;

View File

@ -19,7 +19,7 @@
#include <CGAL/Apollonius_graph_2/basic.h>
#include <CGAL/atomic.h>
#include <atomic>
namespace CGAL {
@ -33,8 +33,8 @@ public:
typedef bool bool_;
typedef unsigned long long_;
#else
typedef CGAL::cpp11::atomic<bool> bool_;
typedef CGAL::cpp11::atomic<unsigned long> long_;
typedef std::atomic<bool> bool_;
typedef std::atomic<unsigned long> long_;
#endif
static bool_ count_cases;

View File

@ -19,7 +19,7 @@
#include <CGAL/Apollonius_graph_2/basic.h>
#include <CGAL/atomic.h>
#include <atomic>
#define AG2_PROFILE_PREDICATES
@ -33,7 +33,7 @@ public:
#ifdef CGAL_NO_ATOMIC
typedef unsigned long long_;
#else
typedef CGAL::cpp11::atomic<unsigned long> long_;
typedef std::atomic<unsigned long> long_;
#endif
// high level predicates

View File

@ -56,7 +56,7 @@ public:
int i = 0;
for(InputIterator it = begin;it != end; it++, i++) {
std::stringstream curr_item;
::CGAL::set_pretty_mode(curr_item);
::CGAL::IO::set_pretty_mode(curr_item);
curr_item << i << "th: ";
curr_item << (*it);
curve_list->insertItem(curr_item.str());

View File

@ -237,7 +237,7 @@ void xAlci_main_window::oc_rasterize_click()
oc_activate_layers();
} else {
// CGAL::set_error_behaviour(CGAL::THROW_EXCEPTION);
::CGAL::set_pretty_mode(std::cout);
::CGAL::IO::set_pretty_mode(std::cout);
Poly_int2 f;
if(!input_poly(f, oc_input->text().ascii()))

View File

@ -194,16 +194,16 @@ void xAlci_main_window::oc_analyse_click()
Poly_int2 ress = fxx*fy*fy - ((fx*fy*fxy)*Poly_int1(2,0)) + fyy*fx*fx,
res1 = f*fx, res2 = f*fy;
CGAL::set_pretty_mode(std::cout);
CGAL::IO::set_pretty_mode(std::cout);
std::cout << "curv:\n " << ress << "\n\n";
std::cout << "fx:\n " << fx << "\n\n";
std::cout << "fy:\n " << fy << "\n\n";
std::cout << "f*fx:\n " << res1 << "\n\n";
std::cout << "f*fy:\n " << res2 << "\n\n";
CGAL::set_ascii_mode(std::cout);
CGAL::IO::set_ascii_mode(std::cout);
std::cout << "f:\n " << f << "\n\n";
CGAL::set_pretty_mode(std::cout);
CGAL::IO::set_pretty_mode(std::cout);
std::cout << "f:\n " << f << "\n\n";
timer.reset();

View File

@ -277,11 +277,11 @@ inline std::ostream & operator<<(std::ostream & os, const Arr::Vertex & vertex)
inline Window_stream & operator<<(Window_stream & ws, Arr & arr)
{
Arr::Edge_iterator ei;
ws << CGAL::blue();
ws << CGAL::IO::blue();
for (ei = arr.edges_begin(); ei != arr.edges_end(); ++ei)
ws << (*ei).curve();
Arr::Vertex_iterator vi;
ws << CGAL::red();
ws << CGAL::IO::red();
for (vi = arr.vertices_begin(); vi != arr.vertices_end(); ++vi)
ws << (*vi).point();
return ws;

View File

@ -31,7 +31,7 @@ struct ArrReader
ArrFormatter arrFormatter;
auto arr = new Arrangement();
CGAL::read(*arr, ifs, arrFormatter);
CGAL::IO::read(*arr, ifs, arrFormatter);
return arr;
}
};
@ -106,7 +106,7 @@ struct ArrWriter
using ArrFormatter = CGAL::Arr_with_history_text_formatter<TextFormatter>;
ArrFormatter arrFormatter;
CGAL::write(*arr, ofs, arrFormatter);
CGAL::IO::write(*arr, ofs, arrFormatter);
}
};

View File

@ -1,6 +1,9 @@
namespace CGAL {
namespace IO {
/*!
\defgroup PkgArrangementOnSurface2Read CGAL::read()
\defgroup PkgArrangementOnSurface2Read CGAL::IO::read()
\ingroup PkgArrangementOnSurface2IO
Reads a given arrangement from a given input stream
@ -37,7 +40,7 @@ std::istream& read (Arrangement_2<Traits,Dcel>& arr,
/// @}
/*!
\defgroup PkgArrangementOnSurface2Write CGAL::write()
\defgroup PkgArrangementOnSurface2Write CGAL::IO::write()
\ingroup PkgArrangementOnSurface2IO
Writes a given arrangement into a given output stream
@ -69,6 +72,8 @@ std::ostream& write (const Arrangement_2<Traits,Dcel>& arr,
/// @}
} // namespace IO
/*!
\ingroup PkgArrangementOnSurface2op_left_shift
Inserts the arrangement object `arr` into the output stream
@ -93,4 +98,4 @@ template<class Traits, class Dcel>
std::istream& operator>>(std::istream& is, Arrangement_2<Traits,Dcel>& arr);
} /* end namespace CGAL*/
} /* end namespace CGAL::IO*/

View File

@ -1,5 +1,7 @@
namespace CGAL {
namespace IO {
/*!
\ingroup PkgArrangementOnSurface2Read
@ -26,6 +28,8 @@ std::ostream& write (const Arrangement_with_history_2<Traits,Dcel>& arr,
std::ostream& os,
WithHistoryFormatter& formatter);
} // namespace IO
/*!
\ingroup PkgArrangementOnSurface2op_left_shift
Inserts the arrangement-with-history object `arr` into the output

View File

@ -203,8 +203,8 @@ implemented as peripheral classes or as free (global) functions.
- `CGAL::locate()`
- `CGAL::decompose()`
- `CGAL::overlay()`
- `CGAL::read()`
- `CGAL::write()`
- `CGAL::IO::read()`
- `CGAL::IO::write()`
- `CGAL::remove_curve()`
- \link PkgArrangementOnSurface2op_left_shift `CGAL::operator<<` \endlink
- \link PkgArrangementOnSurface2op_right_shift `CGAL::operator<<` \endlink

View File

@ -32,7 +32,7 @@ typedef Arr_traits_2::Polynomial_2 Polynomial_2;
int main() {
// For nice printouts
CGAL::set_pretty_mode(std::cout);
CGAL::IO::set_pretty_mode(std::cout);
Arr_traits_2 arr_traits;

View File

@ -119,14 +119,14 @@ int main ()
std::ofstream out_file ("arr_ex_dcel_io.dat");
Formatter formatter;
write (arr, out_file, formatter);
CGAL::IO::write (arr, out_file, formatter);
out_file.close();
// Read the arrangement from the file.
Arrangement_2 arr2;
std::ifstream in_file ("arr_ex_dcel_io.dat");
read (arr2, in_file, formatter);
CGAL::IO::read (arr2, in_file, formatter);
in_file.close();
std::cout << "The arrangement vertices: " << std::endl;

View File

@ -27,9 +27,10 @@ int main()
arr.insert_at_vertices(s4, v4, v1);
// Remove the isolated vertices located in the unbounded face.
Arrangement::Vertex_iterator curr, next = arr.vertices_begin();
for (curr = next++; curr != arr.vertices_end(); curr = next++) {
Arrangement::Vertex_iterator iter = arr.vertices_begin();
while (iter != arr.vertices_end()) {
// Keep an iterator to the next vertex, as curr might be deleted.
Arrangement::Vertex_iterator curr = iter ++;
if (curr->is_isolated() && curr->face() == uf)
arr.remove_isolated_vertex(curr);
}

View File

@ -29,7 +29,7 @@ typedef CGAL::Arrangement_2<Traits_2> Arrangement_2;
int main ()
{
CGAL::set_pretty_mode(std::cout); // for nice printouts.
CGAL::IO::set_pretty_mode(std::cout); // for nice printouts.
// create a polynomial representing x .-)
Polynomial_1 x = CGAL::shift(Polynomial_1(1),1);

View File

@ -31,7 +31,7 @@ typedef CGAL::Arrangement_2<Traits_2> Arrangement_2;
int main ()
{
CGAL::set_pretty_mode(std::cout); // for nice printouts.
CGAL::IO::set_pretty_mode(std::cout); // for nice printouts.
// Traits class object
Traits_2 traits;

View File

@ -29,7 +29,7 @@ typedef CGAL::Arrangement_2<Traits_2> Arrangement_2;
int main ()
{
CGAL::set_pretty_mode(std::cout); // for nice printouts.
CGAL::IO::set_pretty_mode(std::cout); // for nice printouts.
// Traits class object
AK1 ak1;

View File

@ -23,12 +23,12 @@
* The header file for the Arr_circle_segment_traits_2<Kenrel> class.
*/
#include <CGAL/atomic.h>
#include <CGAL/tags.h>
#include <CGAL/Arr_tags.h>
#include <CGAL/Arr_geometry_traits/Circle_segment_2.h>
#include <fstream>
#include <atomic>
namespace CGAL {
@ -80,7 +80,7 @@ public:
#ifdef CGAL_NO_ATOMIC
static unsigned int index;
#else
static CGAL::cpp11::atomic<unsigned int> index;
static std::atomic<unsigned int> index;
#endif
return (++index);
}

View File

@ -23,8 +23,8 @@
*/
#include <fstream>
#include <atomic>
#include <CGAL/atomic.h>
#include <CGAL/tags.h>
#include <CGAL/Arr_tags.h>
#include <CGAL/Arr_geometry_traits/Conic_arc_2.h>
@ -108,7 +108,7 @@ public:
#ifdef CGAL_NO_ATOMIC
static unsigned int index;
#else
static CGAL::cpp11::atomic<unsigned int> index;
static std::atomic<unsigned int> index;
#endif
return (++index);
}

View File

@ -26,9 +26,9 @@
#include <iostream>
#include <string.h>
#include <atomic>
#include <CGAL/basic.h>
#include <CGAL/atomic.h>
#include <CGAL/Arr_enums.h>
#include <CGAL/Arr_tags.h>
@ -958,7 +958,7 @@ public:
#ifdef CGAL_NO_ATOMIC
static size_t counter;
#else
static CGAL::cpp11::atomic<size_t> counter;
static std::atomic<size_t> counter;
#endif
if (doit) ++counter;
return counter;

View File

@ -28,7 +28,7 @@
#include <list>
#include <map>
#include <CGAL/N_step_adaptor_derived.h>
#include <CGAL/In_place_list.h>
#include <CGAL/Compact_container.h>
#include <CGAL/function_objects.h>
#include <CGAL/Iterator_project.h>
#include <CGAL/Arrangement_2/Arrangement_2_iterators.h>
@ -91,6 +91,9 @@ public:
/*! Destructor. */
virtual ~Arr_vertex_base() {}
void* for_compact_container() const { return static_cast<void*>(p_pt); }
void for_compact_container(void* ptr) { p_pt = static_cast<Point*>(ptr); }
// Access/modification for pointer squatting
void* inc() const { return p_inc; }
void set_inc(void * inc) const
@ -183,6 +186,9 @@ public:
/*! Destructor. */
virtual ~Arr_halfedge_base() {}
void* for_compact_container() const { return static_cast<void*>(p_cv); }
void for_compact_container(void* ptr) { p_cv = static_cast<X_monotone_curve*>(ptr); }
/*! Check if the curve pointer is nullptr. */
bool has_null_curve() const { return (p_cv == nullptr); }
@ -284,7 +290,7 @@ template <class V, class H, class F> class Arr_isolated_vertex;
* The default arrangement DCEL vertex class.
*/
template <class V, class H, class F>
class Arr_vertex : public V, public In_place_list_base<Arr_vertex<V,H,F> >
class Arr_vertex : public V
{
public:
@ -351,8 +357,7 @@ public:
* The default arrangement DCEL halfedge class.
*/
template <class V, class H, class F>
class Arr_halfedge : public H,
public In_place_list_base<Arr_halfedge<V,H,F> >
class Arr_halfedge : public H
{
public:
typedef H Base;
@ -532,7 +537,7 @@ public:
*/
template <class V, class H, class F>
class Arr_face : public F,
public In_place_list_base<Arr_face<V,H,F> >
public Compact_container_base
{
public:
typedef F Base;
@ -723,7 +728,7 @@ public:
* Representation of an outer CCB.
*/
template <class V, class H, class F>
class Arr_outer_ccb : public In_place_list_base<Arr_outer_ccb<V,H,F> > {
class Arr_outer_ccb {
public:
typedef Arr_outer_ccb<V,H,F> Self;
typedef Arr_halfedge<V,H,F> Halfedge;
@ -744,6 +749,9 @@ public:
p_f(other.p_f), iter_is_not_singular(other.iter_is_not_singular)
{ if (other.iter_is_not_singular) iter = other.iter; }
void* for_compact_container() const { return static_cast<void*>(p_f); }
void for_compact_container(void* ptr) { p_f = static_cast<Face*>(ptr); }
/*! Get a halfedge along the component (const version). */
const Halfedge* halfedge() const { return (*iter); }
@ -788,7 +796,7 @@ public:
* Representation of an inner CCB.
*/
template <class V, class H, class F>
class Arr_inner_ccb : public In_place_list_base<Arr_inner_ccb<V,H,F> >
class Arr_inner_ccb : public Compact_container_base
{
public:
typedef Arr_inner_ccb<V,H,F> Self;
@ -908,8 +916,7 @@ public:
* Representation of an isolated vertex.
*/
template <class V, class H, class F>
class Arr_isolated_vertex :
public In_place_list_base<Arr_isolated_vertex<V,H,F> > {
class Arr_isolated_vertex {
public:
typedef Arr_isolated_vertex<V,H,F> Self;
typedef Arr_face<V,H,F> Face;
@ -929,6 +936,9 @@ public:
p_f(other.p_f), iter_is_not_singular(other.iter_is_not_singular)
{ if (other.iter_is_not_singular) iv_it = other.iv_it; }
void* for_compact_container() const { return static_cast<void*>(p_f); }
void for_compact_container(void* ptr) { p_f = static_cast<Face*>(ptr); }
/*! Get the containing face (const version). */
const Face* face() const { return (p_f); }
@ -979,13 +989,6 @@ public:
typedef Inner_ccb Hole;
protected:
// The vetices, halfedges and faces are stored in three in-place lists.
typedef In_place_list<Vertex, false> Vertex_list;
typedef In_place_list<Halfedge, false> Halfedge_list;
typedef In_place_list<Face, false> Face_list;
typedef In_place_list<Outer_ccb, false> Outer_ccb_list;
typedef In_place_list<Inner_ccb, false> Inner_ccb_list;
typedef In_place_list<Isolated_vertex, false> Iso_vert_list;
typedef std::allocator_traits<Allocator> Allocator_traits;
typedef typename Allocator_traits::template rebind_alloc<Vertex> Vertex_allocator;
@ -995,6 +998,13 @@ protected:
typedef typename Allocator_traits::template rebind_alloc<Inner_ccb> Inner_ccb_allocator;
typedef typename Allocator_traits::template rebind_alloc<Isolated_vertex> Iso_vert_allocator;
typedef Compact_container<Vertex, Vertex_allocator> Vertex_list;
typedef Compact_container<Halfedge, Halfedge_allocator> Halfedge_list;
typedef Compact_container<Face, Face_allocator> Face_list;
typedef Compact_container<Outer_ccb, Outer_ccb_allocator> Outer_ccb_list;
typedef Compact_container<Inner_ccb, Inner_ccb_allocator> Inner_ccb_list;
typedef Compact_container<Isolated_vertex, Iso_vert_allocator> Iso_vert_list;
public:
typedef typename Halfedge_list::size_type Size;
typedef typename Halfedge_list::size_type size_type;
@ -1011,13 +1021,6 @@ protected:
Inner_ccb_list in_ccbs; // The inner CCBs.
Iso_vert_list iso_verts; // The isolated vertices.
Vertex_allocator vertex_alloc; // An allocator for vertices.
Halfedge_allocator halfedge_alloc; // An allocator for halfedges.
Face_allocator face_alloc; // An allocator for faces.
Outer_ccb_allocator out_ccb_alloc; // An allocator for outer CCBs.
Inner_ccb_allocator in_ccb_alloc; // An allocator for inner CCBs.
Iso_vert_allocator iso_vert_alloc; // Allocator for isolated vertices.
public:
// Definitions of iterators.
typedef typename Vertex_list::iterator Vertex_iterator;
@ -1144,10 +1147,7 @@ public:
/*! Create a new vertex. */
Vertex* new_vertex()
{
Vertex* v = vertex_alloc.allocate(1);
std::allocator_traits<Vertex_allocator>::construct(vertex_alloc,v);
vertices.push_back(*v);
return v;
return &*vertices.emplace();
}
/*! Create a new pair of opposite halfedges. */
@ -1167,37 +1167,25 @@ public:
/*! Create a new face. */
Face* new_face()
{
Face* f = face_alloc.allocate(1);
std::allocator_traits<Face_allocator>::construct(face_alloc, f);
faces.push_back (*f);
return(f);
return &*faces.emplace();
}
/*! Create a new outer CCB. */
Outer_ccb* new_outer_ccb()
{
Outer_ccb* oc = out_ccb_alloc.allocate(1);
std::allocator_traits<Outer_ccb_allocator>::construct(out_ccb_alloc, oc);
out_ccbs.push_back(*oc);
return (oc);
return &*out_ccbs.emplace();
}
/*! Create a new inner CCB. */
Inner_ccb* new_inner_ccb()
{
Inner_ccb* ic = in_ccb_alloc.allocate(1);
std::allocator_traits<Inner_ccb_allocator>::construct(in_ccb_alloc, ic);
in_ccbs.push_back(*ic);
return (ic);
return &*in_ccbs.emplace();
}
/*! Create a new isolated vertex. */
Isolated_vertex* new_isolated_vertex()
{
Isolated_vertex* iv = iso_vert_alloc.allocate(1);
std::allocator_traits<Iso_vert_allocator>::construct(iso_vert_alloc, iv);
iso_verts.push_back(*iv);
return (iv);
return &*iso_verts.emplace();
}
//@}
@ -1206,9 +1194,7 @@ public:
/*! Delete an existing vertex. */
void delete_vertex(Vertex* v)
{
vertices.erase(v);
std::allocator_traits<Vertex_allocator>::destroy(vertex_alloc, v);
vertex_alloc.deallocate(v,1);
vertices.erase (vertices.iterator_to(*v));
}
/*! Delete an existing pair of opposite halfedges. */
@ -1222,33 +1208,25 @@ public:
/*! Delete an existing face. */
void delete_face(Face* f)
{
faces.erase(f);
std::allocator_traits<Face_allocator>::destroy(face_alloc, f);
face_alloc.deallocate(f, 1);
faces.erase (faces.iterator_to(*f));
}
/*! Delete an existing outer CCB. */
void delete_outer_ccb(Outer_ccb* oc)
{
out_ccbs.erase(oc);
std::allocator_traits<Outer_ccb_allocator>::destroy(out_ccb_alloc, oc);
out_ccb_alloc.deallocate(oc, 1);
out_ccbs.erase (out_ccbs.iterator_to(*oc));
}
/*! Delete an existing inner CCB. */
void delete_inner_ccb(Inner_ccb* ic)
{
in_ccbs.erase(ic);
std::allocator_traits<Inner_ccb_allocator>::destroy(in_ccb_alloc, ic);
in_ccb_alloc.deallocate(ic, 1);
in_ccbs.erase (in_ccbs.iterator_to(*ic));
}
/*! Delete an existing isolated vertex. */
void delete_isolated_vertex(Isolated_vertex* iv)
{
iso_verts.erase(iv);
std::allocator_traits<Iso_vert_allocator>::destroy(iso_vert_alloc, iv);
iso_vert_alloc.deallocate(iv, 1);
iso_verts.erase (iso_verts.iterator_to(*iv));
}
/*! Delete all DCEL features. */
@ -1507,18 +1485,13 @@ protected:
/*! Create a new halfedge. */
Halfedge* _new_halfedge()
{
Halfedge* h = halfedge_alloc.allocate(1);
std::allocator_traits<Halfedge_allocator>::construct(halfedge_alloc, h);
halfedges.push_back(*h);
return (h);
return &*halfedges.emplace();
}
/*! Delete an existing halfedge. */
void _delete_halfedge(Halfedge* h)
{
halfedges.erase(h);
std::allocator_traits<Halfedge_allocator>::destroy(halfedge_alloc,h);
halfedge_alloc.deallocate(h, 1);
halfedges.erase (halfedges.iterator_to(*h));
}
};

View File

@ -155,7 +155,7 @@ OutputStream& operator<<(
OutputStream& os,
const Arr_parameter_space& ps) {
switch (::CGAL::get_mode(os)) {
switch (::CGAL::IO::get_mode(os)) {
case ::CGAL::IO::PRETTY:
switch(ps) {
case CGAL::ARR_LEFT_BOUNDARY:
@ -195,7 +195,7 @@ InputStream& operator>>(
InputStream& is,
Arr_parameter_space& ps) {
CGAL_precondition(CGAL::is_ascii(is));
CGAL_precondition(CGAL::IO::is_ascii(is));
int i;
is >> i;

View File

@ -23,7 +23,7 @@
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
#include <boost/variant.hpp>
#include <boost/shared_ptr.hpp>
#include <memory>
#ifdef CGAL_TD_DEBUG
@ -95,7 +95,7 @@ public:
typedef Td_ninetuple<boost::variant<Vertex_const_handle,Point>,
boost::variant<Vertex_const_handle,unsigned char>,
boost::variant<Halfedge_const_handle,
boost::shared_ptr<X_monotone_curve_2> >,
std::shared_ptr<X_monotone_curve_2> >,
Halfedge_const_handle,
unsigned char,
Self*, Self*,
@ -230,7 +230,7 @@ public:
if (type() == TD_EDGE)
{
//ptr()->e2 = (boost::shared_ptr<X_monotone_curve_2>)(new X_monotone_curve_2(top()->curve()));
//ptr()->e2 = (std::shared_ptr<X_monotone_curve_2>)(new X_monotone_curve_2(top()->curve()));
set_curve_for_rem_he(top()->curve());
return;
}
@ -238,8 +238,8 @@ public:
//else if (type() == TD_VERTEX)
Curve_end v_ce(left()->curve_end());
ptr()->e2 = (boost::shared_ptr<X_monotone_curve_2>)(new X_monotone_curve_2(v_ce.cv()));
//CGAL_assertion(boost::get<boost::shared_ptr<X_monotone_curve_2>>( &(ptr()->e2)) != nullptr);
ptr()->e2 = (std::shared_ptr<X_monotone_curve_2>)(new X_monotone_curve_2(v_ce.cv()));
//CGAL_assertion(boost::get<std::shared_ptr<X_monotone_curve_2>>( &(ptr()->e2)) != nullptr);
ptr()->e1 = (v_ce.ce() == ARR_MIN_END ) ? CGAL_TD_CV_MIN_END : CGAL_TD_CV_MAX_END;
@ -255,7 +255,7 @@ public:
{
CGAL_precondition (type() == TD_EDGE);
ptr()->e2 = (boost::shared_ptr<X_monotone_curve_2>)(new X_monotone_curve_2(cv));
ptr()->e2 = (std::shared_ptr<X_monotone_curve_2>)(new X_monotone_curve_2(cv));
}
/*! Set the trapezoid's type flag (Trapezoid/Edge/Vertex). */
@ -537,8 +537,8 @@ public:
CGAL_precondition(is_on_boundaries());
CGAL_assertion(boost::get<unsigned char>( &(ptr()->e1)) != nullptr);
CGAL_assertion(boost::get<boost::shared_ptr<X_monotone_curve_2> >(&(ptr()->e2)) != nullptr);
X_monotone_curve_2* cv_ptr = (boost::get<boost::shared_ptr<X_monotone_curve_2> >(ptr()->e2)).get();
CGAL_assertion(boost::get<std::shared_ptr<X_monotone_curve_2> >(&(ptr()->e2)) != nullptr);
X_monotone_curve_2* cv_ptr = (boost::get<std::shared_ptr<X_monotone_curve_2> >(ptr()->e2)).get();
CGAL_assertion(cv_ptr != nullptr);
Arr_curve_end ce =
@ -555,8 +555,8 @@ public:
CGAL_precondition(is_on_boundaries());
CGAL_assertion(boost::get<unsigned char>( &(ptr()->e1)) != nullptr);
CGAL_assertion(boost::get<boost::shared_ptr<X_monotone_curve_2> >(&(ptr()->e2)) != nullptr);
X_monotone_curve_2* cv_ptr = (boost::get<boost::shared_ptr<X_monotone_curve_2> >(ptr()->e2)).get();
CGAL_assertion(boost::get<std::shared_ptr<X_monotone_curve_2> >(&(ptr()->e2)) != nullptr);
X_monotone_curve_2* cv_ptr = (boost::get<std::shared_ptr<X_monotone_curve_2> >(ptr()->e2)).get();
CGAL_assertion(cv_ptr != nullptr);
Arr_curve_end ce =
@ -572,8 +572,8 @@ public:
CGAL_precondition(type() == TD_VERTEX);
CGAL_assertion(boost::get<unsigned char>( &(ptr()->e1)) != nullptr);
CGAL_assertion(boost::get<boost::shared_ptr<X_monotone_curve_2> >(&(ptr()->e2)) != nullptr);
X_monotone_curve_2* cv_ptr = (boost::get<boost::shared_ptr<X_monotone_curve_2> >(ptr()->e2)).get();
CGAL_assertion(boost::get<std::shared_ptr<X_monotone_curve_2> >(&(ptr()->e2)) != nullptr);
X_monotone_curve_2* cv_ptr = (boost::get<std::shared_ptr<X_monotone_curve_2> >(ptr()->e2)).get();
CGAL_assertion(cv_ptr != nullptr);
Arr_curve_end ce =
@ -587,8 +587,8 @@ public:
{
CGAL_precondition(!is_active() && type() == TD_EDGE);
CGAL_assertion(boost::get<boost::shared_ptr<X_monotone_curve_2> >(&(ptr()->e2)) != nullptr);
X_monotone_curve_2* cv_ptr = (boost::get<boost::shared_ptr<X_monotone_curve_2> >(ptr()->e2)).get();
CGAL_assertion(boost::get<std::shared_ptr<X_monotone_curve_2> >(&(ptr()->e2)) != nullptr);
X_monotone_curve_2* cv_ptr = (boost::get<std::shared_ptr<X_monotone_curve_2> >(ptr()->e2)).get();
CGAL_assertion(cv_ptr != nullptr);
return *cv_ptr;
}

View File

@ -22,7 +22,7 @@
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
#include <boost/variant.hpp>
#include <boost/shared_ptr.hpp>
#include <memory>
#ifdef CGAL_TD_DEBUG

View File

@ -22,7 +22,7 @@
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
#include <boost/variant.hpp>
#include <boost/shared_ptr.hpp>
#include <memory>
#ifdef CGAL_TD_DEBUG
#define CGAL_TD_INLINE

View File

@ -22,7 +22,7 @@
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
#include <boost/variant.hpp>
#include <boost/shared_ptr.hpp>
#include <memory>
#ifdef CGAL_TD_DEBUG

View File

@ -22,7 +22,7 @@
#include <CGAL/Arr_point_location/Trapezoidal_decomposition_2.h>
#include <boost/variant.hpp>
#include <boost/shared_ptr.hpp>
#include <memory>
#ifdef CGAL_TD_DEBUG
@ -115,14 +115,14 @@ public:
public:
//c'tors
Data (boost::shared_ptr<X_monotone_curve_2>& _cv, Dag_node* _p_node)
Data (std::shared_ptr<X_monotone_curve_2>& _cv, Dag_node* _p_node)
: cv(_cv), p_node(_p_node) //, lb(_lb),lt(_lt),rb(_rb),rt(_rt)
{ }
~Data() { }
protected:
boost::shared_ptr<X_monotone_curve_2> cv;
std::shared_ptr<X_monotone_curve_2> cv;
Dag_node* p_node;
};
@ -148,7 +148,7 @@ public:
}
/*! Set the x_monotone_curve_2 for removed edge degenerate trapezoid. */
CGAL_TD_INLINE void set_curve(boost::shared_ptr<X_monotone_curve_2>& cv)
CGAL_TD_INLINE void set_curve(std::shared_ptr<X_monotone_curve_2>& cv)
{
ptr()->cv = cv;
}
@ -159,7 +159,7 @@ public:
//@{
/*! Constructor given Vertex & Halfedge handles. */
Td_inactive_edge (boost::shared_ptr<X_monotone_curve_2>& cv, Dag_node* node = nullptr)
Td_inactive_edge (std::shared_ptr<X_monotone_curve_2>& cv, Dag_node* node = nullptr)
{
PTR = new Data(cv,node);
}

View File

@ -27,7 +27,7 @@
#include <boost/optional.hpp>
#include <boost/variant.hpp>
#include <boost/shared_ptr.hpp>
#include <memory>
#include <cstdlib>
#include <cstring>
@ -1206,7 +1206,7 @@ protected:
void deactivate_vertex (Dag_node& vtx_node) const;
void deactivate_edge (boost::shared_ptr<X_monotone_curve_2>& cv, Dag_node& edge_node) const;
void deactivate_edge (std::shared_ptr<X_monotone_curve_2>& cv, Dag_node& edge_node) const;
//-----------------------------------------------------------------------------
// Description:

View File

@ -244,7 +244,7 @@ deactivate_vertex(Dag_node& vtx_node) const
template <typename Td_traits>
void Trapezoidal_decomposition_2<Td_traits>::
deactivate_edge(boost::shared_ptr<X_monotone_curve_2>& cv,
deactivate_edge(std::shared_ptr<X_monotone_curve_2>& cv,
Dag_node& edge_node) const
{
CGAL_precondition(traits->is_active(edge_node.get_data()));
@ -1870,7 +1870,7 @@ void Trapezoidal_decomposition_2<Td_traits>::remove(Halfedge_const_handle he)
//-----------------------------------
//3. remove the trapezoids that represent the removed halfedge
boost::shared_ptr<X_monotone_curve_2>
std::shared_ptr<X_monotone_curve_2>
removed_cv_ptr(new X_monotone_curve_2(he->curve()));
Base_map_item_iterator last_edge_fragment_it = mid_it;
//Base_trapezoid_iterator last_mid = mid_it;

View File

@ -237,7 +237,7 @@ public:
std::ostream& print (std::ostream& os) const
{
std::pair<double,double> double_p;
switch(::CGAL::get_mode(os))
switch(::CGAL::IO::get_mode(os))
{
case ::CGAL::IO::PRETTY:
double_p = this->to_double();

View File

@ -80,7 +80,7 @@ public:
typedef Triangulation_vertex_base_with_info_2<Vertex_const_handle, Kernel>
Vbb;
typedef Triangulation_hierarchy_vertex_base_2<Vbb> Vb;
//typedef Triangulation_face_base_with_info_2<CGAL::Color,Kernel> Fbt;
//typedef Triangulation_face_base_with_info_2<CGAL::IO::Color,Kernel> Fbt;
typedef Constrained_triangulation_face_base_2<Kernel> Fb;
typedef Triangulation_data_structure_2<Vb,Fb> TDS;
typedef Exact_predicates_tag Itag;

View File

@ -288,6 +288,12 @@ public:
iend (nt)
{}
template <typename T>
I_Filtered_iterator (T* p) :
nt (pointer(p)),
iend (nt)
{}
I_Filtered_iterator (Iterator it, Iterator end) :
nt (it),
iend (end)
@ -305,6 +311,14 @@ public:
++nt;
}
template <typename P>
I_Filtered_iterator& operator= (const P* p)
{
nt = pointer(p);
iend =nt;
return *this;
}
/*! Access operations. */
Iterator current_iterator() const
{
@ -439,6 +453,12 @@ public:
iend (it)
{}
template <typename T>
I_Filtered_const_iterator (T* p) :
nt (pointer(p)),
iend (nt)
{}
I_Filtered_const_iterator (Iterator it, Iterator end) :
nt (it),
iend (end)
@ -465,6 +485,14 @@ public:
// ++nt;
}
template <typename P>
I_Filtered_const_iterator& operator= (const P* p)
{
nt = pointer(p);
iend =nt;
return *this;
}
/*! Access operations. */
Iterator current_iterator() const
{

View File

@ -3164,7 +3164,7 @@ public:
*/
void write(std::ostream& os) const {
switch (::CGAL::get_mode(os)) {
switch (::CGAL::IO::get_mode(os)) {
case ::CGAL::IO::PRETTY:
os << "arc@" << this->id() << "[(sup@" << this->curve().id();
if (this->is_vertical()) {
@ -3214,7 +3214,7 @@ public:
*/
void read(std::istream& is) {
CGAL_precondition(CGAL::is_ascii(is));
CGAL_precondition(CGAL::IO::is_ascii(is));
Rep rep;
@ -3371,7 +3371,7 @@ std::istream& operator>> (
std::istream& is,
Arc_2< CurvedKernelViaAnalysis_2, Rep_ >& arc) {
CGAL_precondition(CGAL::is_ascii(is));
CGAL_precondition(CGAL::IO::is_ascii(is));
//typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2;
//typedef Rep_ Rep;

View File

@ -231,7 +231,7 @@ public:
// avoid compiler warning
(void)arc;
//CGAL::set_pretty_mode(std::cerr);
//CGAL::IO::set_pretty_mode(std::cerr);
CERR("Construct_pt_on_arc: " << CGAL::to_double(x) << ", " << arcno <<
", " << c.id() << "\narc = " << arc << "\n");

View File

@ -615,7 +615,7 @@ public:
*/
void write(std::ostream& os) const {
switch(::CGAL::get_mode(os)) {
switch(::CGAL::IO::get_mode(os)) {
case ::CGAL::IO::PRETTY:
os << "point@" << this->id() << "(";
os << "sup@" << this->curve().id() << "; ";
@ -722,7 +722,7 @@ public:
*/
void read(std::istream& is) {
CGAL_precondition(CGAL::is_ascii(is));
CGAL_precondition(CGAL::IO::is_ascii(is));
Rep rep;
@ -823,7 +823,7 @@ std::istream& operator>> (
std::istream& is,
Point_2< CurvedKernelViaAnalysis_2, Rep_ >& pt) {
CGAL_precondition(CGAL::is_ascii(is));
CGAL_precondition(CGAL::IO::is_ascii(is));
//typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2;
//typedef Rep_ Rep;

View File

@ -2586,8 +2586,8 @@ inline bool is_isolated_pixel(const Pixel_2& /* pix */) {
// DEBUG ONLY
#ifdef Gfx_USE_OUT
void dump_neighbourhood(const Pixel_2& pix) {
CGAL::set_mode(std::cerr, CGAL::IO::PRETTY);
CGAL::set_mode(std::cout, CGAL::IO::PRETTY);
CGAL::IO::set_mode(std::cerr, CGAL::IO::PRETTY);
CGAL::IO::set_mode(std::cout, CGAL::IO::PRETTY);
Stripe box[2]; // 0 - left-right stripe, 1 - bottom-top stripe
//NT inv = NT(1) / NT(one << pix.level);

View File

@ -29,6 +29,8 @@
namespace CGAL {
namespace IO {
/*!
* Write an arrangement to an output stream using a given formatter.
* \param arr The arrangement.
@ -51,6 +53,8 @@ std::ostream&
return (os);
}
} // namespace IO
/*!
* Output operator (importer).
* \param os The output stream.
@ -72,6 +76,8 @@ std::ostream&
return (os);
}
namespace IO {
/*!
* Read an arrangement from an input stream using a given formatter.
* \param arr The arrangement.
@ -94,6 +100,8 @@ std::istream&
return (is);
}
} // namespace IO
/*!
* Output operator (exporter).
* \param is The input stream.
@ -115,6 +123,11 @@ std::istream&
return (is);
}
#ifndef CGAL_NO_DEPRECATED_CODE
using IO::read;
using IO::write;
#endif
} //namespace CGAL
#endif

View File

@ -120,8 +120,8 @@ public:
void write_arrangement_begin()
{
CGAL_assertion(m_out != nullptr);
m_old_out_mode = get_mode(*m_out);
set_ascii_mode(*m_out);
m_old_out_mode = IO::get_mode(*m_out);
IO::set_ascii_mode(*m_out);
_write_comment("BEGIN ARRANGEMENT");
}
@ -277,8 +277,8 @@ public:
void read_arrangement_begin()
{
CGAL_assertion(m_in != nullptr);
m_old_in_mode = get_mode(*m_in);
set_ascii_mode(*m_in);
m_old_in_mode = IO::get_mode(*m_in);
IO::set_ascii_mode(*m_in);
_skip_comments();
}

View File

@ -30,6 +30,8 @@
namespace CGAL {
namespace IO {
/*!
* Write an arrangement with history to an output stream using a given
* formatter.
@ -54,6 +56,8 @@ std::ostream& write
return (os);
}
} // namespace IO
/*!
* Output operator (importer).
* \param os The output stream.
@ -77,6 +81,8 @@ std::ostream& operator<<
return (os);
}
namespace IO {
/*!
* Read an arrangement with history from an input stream using a given
* formatter.
@ -101,6 +107,8 @@ std::istream& read
return (is);
}
} // namespace IO
/*!
* Output operator (exporter).
* \param is The input stream.
@ -124,6 +132,11 @@ std::istream& operator>>
return (is);
}
#ifndef CGAL_NO_DEPRECATED_CODE
using IO::read;
using IO::write;
#endif
} //namespace CGAL
#endif

View File

@ -18,6 +18,9 @@
#include <CGAL/IO/Fig_stream.h>
#include <list>
namespace CGAL {
namespace IO {
/*!
* Write an x-monotone conic arc to a FIG stream.
*/
@ -97,4 +100,6 @@ void write_conic_arc
return;
}
}} // namespace CGAL:IO
#endif

View File

@ -745,7 +745,7 @@ bool Overlay_test<T_Geom_traits, T_Topol_traits>::init()
// Expected arrangement.
Formatter formatter;
CGAL::read(m_arr, p_stream, formatter);
CGAL::IO::read(m_arr, p_stream, formatter);
p_stream.close();
@ -981,13 +981,13 @@ bool Overlay_test<T_Geom_traits, T_Topol_traits>::perform()
Arrangement arr;
Overlay_traits overlay_traits(m_verbose_level);
// Formatter formatter;
// CGAL::write(m_arr2, std::cout, formatter);
// CGAL::IO::write(m_arr2, std::cout, formatter);
CGAL::overlay(m_arr1, m_arr2, arr, overlay_traits);
// Generate the output for debugging purposes
// Formatter formatter;
// CGAL::write(arr, std::cout, formatter);
// CGAL::IO::write(arr, std::cout, formatter);
// Verify the resulting arrangement:
if (!equivalent_arr(arr, m_arr)) {

View File

@ -87,8 +87,8 @@ bool test(const char* points_filename, const char* xcurves_filename,
int main(int argc, char* argv[])
{
#if TEST_GEOM_TRAITS == ALGEBRAIC_GEOM_TRAITS
CGAL::set_pretty_mode(std::cout);
CGAL::set_pretty_mode(std::cerr);
CGAL::IO::set_pretty_mode(std::cout);
CGAL::IO::set_pretty_mode(std::cerr);
#endif
size_t verbose_level = 0;

View File

@ -96,8 +96,8 @@ bool test(const char* filename, int verbose_level)
int main(int argc, char* argv[])
{
#if TEST_GEOM_TRAITS == ALGEBRAIC_GEOM_TRAITS
CGAL::set_pretty_mode(std::cout);
CGAL::set_pretty_mode(std::cerr);
CGAL::IO::set_pretty_mode(std::cout);
CGAL::IO::set_pretty_mode(std::cerr);
#endif
if (argc < 2) {

View File

@ -129,8 +129,8 @@ bool test(const char* filename, int verbose_level)
int main(int argc, char* argv[])
{
#if TEST_GEOM_TRAITS == ALGEBRAIC_GEOM_TRAITS
CGAL::set_pretty_mode(std::cout);
CGAL::set_pretty_mode(std::cerr);
CGAL::IO::set_pretty_mode(std::cout);
CGAL::IO::set_pretty_mode(std::cerr);
#endif
if (argc < 2) {

View File

@ -128,8 +128,8 @@ bool test3(const char* points_filename, const char* xcurves_filename,
int main(int argc, char* argv[])
{
#if TEST_GEOM_TRAITS == ALGEBRAIC_GEOM_TRAITS
CGAL::set_pretty_mode(std::cout);
CGAL::set_pretty_mode(std::cerr);
CGAL::IO::set_pretty_mode(std::cout);
CGAL::IO::set_pretty_mode(std::cerr);
#endif
if (argc < 4) {

View File

@ -91,8 +91,8 @@ bool test1(const char* points_filename, const char* xcurves_filename,
int main(int argc, char* argv[])
{
#if TEST_GEOM_TRAITS == ALGEBRAIC_GEOM_TRAITS
CGAL::set_pretty_mode(std::cout);
CGAL::set_pretty_mode(std::cerr);
CGAL::IO::set_pretty_mode(std::cout);
CGAL::IO::set_pretty_mode(std::cerr);
#endif
if (argc < 5) {

View File

@ -73,8 +73,8 @@ int main(int argc, char* argv[])
{
#if TEST_GEOM_TRAITS == ALGEBRAIC_GEOM_TRAITS
CGAL::set_pretty_mode(std::cout);
CGAL::set_pretty_mode(std::cerr);
CGAL::IO::set_pretty_mode(std::cout);
CGAL::IO::set_pretty_mode(std::cerr);
#endif
Geom_traits traits;

View File

@ -84,8 +84,8 @@ bool test(const char* points_filename, const char* xcurves_filename,
int main(int argc, char* argv[])
{
#if TEST_GEOM_TRAITS == ALGEBRAIC_GEOM_TRAITS
CGAL::set_pretty_mode(std::cout);
CGAL::set_pretty_mode(std::cerr);
CGAL::IO::set_pretty_mode(std::cout);
CGAL::IO::set_pretty_mode(std::cerr);
#endif
size_t verbose_level = 0;

View File

@ -756,8 +756,8 @@ user might encounter.
- `CGAL::alpha_expansion_graphcut()`
\cgalCRPSection{I/O Functions}
- `CGAL::read_polygon_mesh()`
- `CGAL::write_polygon_mesh()`
- `CGAL::IO::read_polygon_mesh()`
- `CGAL::IO::write_polygon_mesh()`
- \link PkgBGLIoFuncsSTL I/O for STL files \endlink
- \link PkgBGLIoFuncsPLY I/O for PLY files \endlink
- \link PkgBGLIoFuncsOBJ I/O for OBJ files \endlink

View File

@ -39,7 +39,7 @@ int main(int argc, char* argv[])
Target1 T1;
{
CGAL::copy_face_graph(S, T1);
CGAL::write_OFF("lcc.off", T1);
CGAL::IO::write_OFF("lcc.off", T1);
}
S.clear();

View File

@ -20,7 +20,7 @@ typedef boost::graph_traits<LCC>::vertex_iterator vertex_iterator;
int main(int argc, char** argv)
{
LCC lcc;
CGAL::read_polygon_mesh((argc>1)?argv[1]:"cube.off", lcc);
CGAL::IO::read_polygon_mesh((argc>1)?argv[1]:"cube.off", lcc);
// This is the vector where the distance gets written to
std::vector<int> distance(lcc.vertex_attributes().size());

View File

@ -51,7 +51,7 @@ OutputIterator adjacent_vertices_V2(const LCC& g,
int main(int argc, char** argv)
{
LCC lcc;
CGAL::read_polygon_mesh((argc>1)?argv[1]:"cube.off", lcc);
CGAL::IO::read_polygon_mesh((argc>1)?argv[1]:"cube.off", lcc);
GraphTraits::vertex_iterator vi = vertices(lcc).first;
std::list<vertex_descriptor> V;

View File

@ -70,7 +70,7 @@ int main(int argc, char** argv)
Face_index_map;
LCC lcc;
CGAL::read_polygon_mesh((argc>1)?argv[1]:"cube.off", lcc);
CGAL::IO::read_polygon_mesh((argc>1)?argv[1]:"cube.off", lcc);
// Ad hoc property_map to store normals. Face_index_map is used to
// map face_descriptors to a contiguous range of indices. See

View File

@ -52,7 +52,7 @@ void fct(const LCC& lcc)
int main(int argc, char** argv)
{
LCC lcc;
CGAL::read_polygon_mesh((argc>1)?argv[1]:"cube.off", lcc);
CGAL::IO::read_polygon_mesh((argc>1)?argv[1]:"cube.off", lcc);
fct(lcc);
return 0;

View File

@ -43,7 +43,7 @@ struct Source {
int main(int argc, char** argv)
{
LCC lcc;
CGAL::read_polygon_mesh((argc>1)?argv[1]:"cube.off", lcc);
CGAL::IO::read_polygon_mesh((argc>1)?argv[1]:"cube.off", lcc);
GraphTraits::vertex_descriptor vd = *(vertices(lcc).first);
typedef boost::transform_iterator<Source<LCC>,halfedge_around_target_iterator> adjacent_vertex_iterator;

View File

@ -28,13 +28,13 @@ int main(int argc, char** argv )
std::vector<vertex_descriptor> V;
const char* filename = (argc>1)?argv[1]:"in.off";
const char* outname= (argc>2)?argv[2]:"out.off";
CGAL::read_polygon_mesh(filename, mesh);
CGAL::IO::read_polygon_mesh(filename, mesh);
for(vertex_descriptor vd : vertices(mesh)){
for(halfedge_descriptor hd : CGAL::halfedges_around_target(vd,mesh)){
if(! CGAL::is_border(edge(hd,mesh),mesh)){
CGAL::Euler::flip_edge(hd,mesh);
CGAL::write_polygon_mesh(outname, mesh);
CGAL::IO::write_polygon_mesh(outname, mesh);
return 0;
}
}

View File

@ -21,7 +21,7 @@ int main(int argc, char** argv)
}
Mesh mesh;
CGAL::read_OFF (in, mesh);
CGAL::IO::read_OFF (in, mesh);
boost::unordered_map<Face_index, bool> is_selected_map;

View File

@ -17,7 +17,7 @@ int main(int argc, char* argv[])
const char* filename = (argc > 1) ? argv[1] : "data/prim.off";
Mesh sm;
if(!CGAL::read_polygon_mesh(filename, sm))
if(!CGAL::IO::read_polygon_mesh(filename, sm))
{
std::cerr << "Invalid input." << std::endl;
return 1;

View File

@ -17,7 +17,7 @@ int main(int argc, char* argv[])
const char* filename = (argc>1) ? argv[1] : "data/prim.off";
Mesh P;
if(!CGAL::read_polygon_mesh(filename, P))
if(!CGAL::IO::read_polygon_mesh(filename, P))
{
std::cerr << "Invalid input." << std::endl;
return 1;

View File

@ -36,7 +36,7 @@ int main(int argc, char* argv[])
const char* filename = (argc>1) ? argv[1] : "data/cube.off";
Mesh sm;
if(!CGAL::read_polygon_mesh(filename, sm))
if(!CGAL::IO::read_polygon_mesh(filename, sm))
{
std::cerr << "Invalid input." << std::endl;
return 1;

View File

@ -40,7 +40,7 @@ int main(int argc, char* argv[])
const char* filename = (argc > 1) ? argv[1] : "data/prim.off";
Mesh primal;
if(!CGAL::read_polygon_mesh(filename, primal))
if(!CGAL::IO::read_polygon_mesh(filename, primal))
{
std::cerr << "Invalid input." << std::endl;
return 1;

View File

@ -17,7 +17,7 @@ int main(int argc, char** argv)
int number_of_parts = (argc>2) ? atoi(argv[2]) : 8;
SM sm;
if(!CGAL::read_polygon_mesh(filename, sm))
if(!CGAL::IO::read_polygon_mesh(filename, sm))
{
std::cerr << "Invalid input." << std::endl;
return 1;
@ -44,7 +44,7 @@ int main(int argc, char** argv)
CGAL::copy_face_graph(filtered_sm, part_sm);
// Output the mesh extracted from subpart n°0
CGAL::write_polygon_mesh("sm_part_0.off", part_sm, CGAL::parameters::stream_precision(17));
CGAL::IO::write_polygon_mesh("sm_part_0.off", part_sm, CGAL::parameters::stream_precision(17));
// Output all the vertices that are in the part n°0
std::ofstream outxyz("out.xyz");

View File

@ -22,7 +22,7 @@ int main()
std::ofstream out("out.inp");
out.precision(17);
CGAL::write_INP(out, "out.inp", "S4R", sm);
CGAL::IO::write_INP(out, "out.inp", "S4R", sm);
return EXIT_SUCCESS;
}

View File

@ -28,6 +28,8 @@
namespace CGAL {
namespace IO {
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
// Write
@ -58,7 +60,7 @@ bool write_3MF(const std::string& filename,
const std::vector<std::string>& names
#ifndef DOXYGEN_RUNNING
, typename boost::disable_if<
IO::internal::is_Point_set_or_Range_or_Iterator<
internal::is_Point_set_or_Range_or_Iterator<
typename boost::range_value<GraphRange>::type> >::type* = nullptr
#endif
)
@ -114,7 +116,7 @@ bool write_3MF(const std::string& filename,
return write_3MF(filename, all_points, all_triangles, names);
}
} // namespace CGAL
} } // namespace CGAL::IO
#endif // defined(CGAL_LINKED_WITH_3MF) || defined(DOXYGEN_RUNNING)

View File

@ -76,7 +76,6 @@ public:
};
} // namespace internal
} // namespace IO
/// \ingroup PkgBGLIoFuncsGOCAD
///
@ -120,14 +119,14 @@ bool read_GOCAD(std::istream& is,
Graph& g,
const CGAL_BGL_NP_CLASS& np
#ifndef DOXYGEN_RUNNING
, typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
#endif
)
{
typedef typename CGAL::GetVertexPointMap<Graph, CGAL_BGL_NP_CLASS>::type VPM;
typedef typename boost::property_traits<VPM>::value_type Point;
IO::internal::GOCAD_builder<Graph, Point> builder(is);
internal::GOCAD_builder<Graph, Point> builder(is);
if(!builder(g, np))
return false;
@ -141,14 +140,14 @@ bool read_GOCAD(std::istream& is,
template <typename Graph>
bool read_GOCAD(std::istream& is, std::pair<std::string, std::string>& name_and_color, Graph& g,
typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
{
return read_GOCAD(is, name_and_color, g, parameters::all_default());
}
template <typename Graph, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
bool read_GOCAD(std::istream& is, Graph& g, const CGAL_BGL_NP_CLASS& np,
typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
{
std::pair<std::string, std::string> dummy;
return read_GOCAD(is, dummy, g, np);
@ -156,7 +155,7 @@ bool read_GOCAD(std::istream& is, Graph& g, const CGAL_BGL_NP_CLASS& np,
template <typename Graph>
bool read_GOCAD(std::istream& is, Graph& g,
typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
{
return read_GOCAD(is, g, parameters::all_default());
}
@ -207,12 +206,12 @@ bool read_GOCAD(const std::string& fname,
Graph& g,
const CGAL_BGL_NP_CLASS& np
#ifndef DOXYGEN_RUNNING
, typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
#endif
)
{
std::ifstream is(fname);
CGAL::set_mode(is, CGAL::IO::ASCII);
CGAL::IO::set_mode(is, CGAL::IO::ASCII);
return read_GOCAD(is, name_and_color, g, np);
}
@ -220,14 +219,14 @@ bool read_GOCAD(const std::string& fname,
template <typename Graph>
bool read_GOCAD(const std::string& fname, std::pair<std::string, std::string>& name_and_color, Graph& g,
typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
{
return read_GOCAD(fname, name_and_color, g, parameters::all_default());
}
template <typename Graph, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
bool read_GOCAD(const std::string& fname, Graph& g, const CGAL_BGL_NP_CLASS& np,
typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
{
std::pair<std::string, std::string> dummy;
return read_GOCAD(fname, dummy, g, np);
@ -235,7 +234,7 @@ bool read_GOCAD(const std::string& fname, Graph& g, const CGAL_BGL_NP_CLASS& np,
template <typename Graph>
bool read_GOCAD(const std::string& fname, Graph& g,
typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
{
return read_GOCAD(fname, g, parameters::all_default());
}
@ -284,7 +283,7 @@ bool write_GOCAD(std::ostream& os,
const Graph& g,
const CGAL_BGL_NP_CLASS& np
#ifndef DOXYGEN_RUNNING
, typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
#endif
)
{
@ -346,7 +345,7 @@ bool write_GOCAD(std::ostream& os,
template <typename Graph>
bool write_GOCAD(std::ostream& os, const char* name, const Graph& g,
typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
{
return write_GOCAD(os, name, g, parameters::all_default());
}
@ -391,7 +390,7 @@ bool write_GOCAD(std::ostream& os,
const Graph& g,
const CGAL_BGL_NP_CLASS& np
#ifndef DOXYGEN_RUNNING
, typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
#endif
)
{
@ -402,7 +401,7 @@ bool write_GOCAD(std::ostream& os,
template <typename Graph>
bool write_GOCAD(std::ostream& os, const Graph& g,
typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
{
return write_GOCAD(os, g, parameters::all_default());
}
@ -447,12 +446,12 @@ bool write_GOCAD(const std::string& fname,
const Graph& g,
const CGAL_BGL_NP_CLASS& np
#ifndef DOXYGEN_RUNNING
, typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
#endif
)
{
std::ofstream os(fname);
CGAL::set_mode(os, CGAL::IO::ASCII);
CGAL::IO::set_mode(os, CGAL::IO::ASCII);
return write_GOCAD(os, fname.c_str(), g, np);
}
@ -461,13 +460,13 @@ bool write_GOCAD(const std::string& fname,
template <typename Graph>
bool write_GOCAD(const std::string& fname, const Graph& g,
typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
{
return write_GOCAD(fname, g, parameters::all_default());
}
/// \endcond
} // namespace CGAL
}} // namespace CGAL::IO
#endif // CGAL_BGL_IO_GOCAD_H

View File

@ -44,7 +44,7 @@ public:
typedef typename GetK<Graph, NamedParameters>::Kernel Kernel;
typedef typename Kernel::Vector_3 Vector;
typedef typename Kernel::Point_2 Texture;
typedef CGAL::Color Color;
typedef CGAL::IO::Color Color;
typedef typename CGAL::GetVertexPointMap<Graph, NamedParameters>::type VPM;

View File

@ -95,7 +95,7 @@ public:
typedef typename GetVertexPointMap<Graph, NamedParameters>::const_type VPM;
typedef typename boost::property_traits<VPM>::reference Point_ref;
typedef CGAL::Color Color;
typedef CGAL::IO::Color Color;
typedef typename internal_np::Lookup_named_param_def<
internal_np::vertex_color_map_t, NamedParameters,
@ -153,7 +153,7 @@ public:
if(has_vertex_colors)
{
const CGAL::Color& vc = get(vcm, v);
const CGAL::IO::Color& vc = get(vcm, v);
m_writer.write_vertex_color(vc.red(), vc.green(), vc.blue()); // @fixme correct?
}
@ -182,7 +182,7 @@ public:
if(has_face_colors)
{
const CGAL::Color& fc = get(fcm, f);
const CGAL::IO::Color& fc = get(fcm, f);
m_writer.write_face_color(fc.red(), fc.green(), fc.blue());
}

View File

@ -23,6 +23,8 @@
namespace CGAL {
namespace IO {
/// \cond SKIP_IN_MANUAL
template <typename Graph, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
@ -96,8 +98,27 @@ bool write_INP(const std::string& fname, const std::string& type, const Graph& g
return write_INP(fname, type, g, parameters::all_default());
}
#ifndef CGAL_NO_DEPRECATED_CODE
template <typename FaceGraph, typename NamedParameters>
CGAL_DEPRECATED bool write_inp(std::ostream& os,
const FaceGraph& g,
std::string name,
std::string type,
const NamedParameters& np)
{
return write_INP(os, name, type, g, np);
}
template <typename FaceGraph>
CGAL_DEPRECATED bool write_inp(std::ostream& os,
const FaceGraph& g,
std::string name,
std::string type)
{
return write_INP(os, name, type, g, parameters::all_default());
}
#endif
/// \endcond
} // namespace CGAL
}} // namespace CGAL::IO
#endif // CGAL_BGL_IO_INP_H

View File

@ -68,7 +68,6 @@ public:
};
} // namespace internal
} // namespace IO
/*!
\ingroup PkgBGLIoFuncsOBJ
@ -115,14 +114,14 @@ bool read_OBJ(std::istream& is,
Graph& g,
const CGAL_BGL_NP_CLASS& np
#ifndef DOXYGEN_RUNNING
, typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
#endif
)
{
typedef typename CGAL::GetVertexPointMap<Graph, CGAL_BGL_NP_CLASS>::type VPM;
typedef typename boost::property_traits<VPM>::value_type Point;
IO::internal::OBJ_builder<Graph, Point> builder(is);
internal::OBJ_builder<Graph, Point> builder(is);
return builder(g, np);
}
@ -130,7 +129,7 @@ bool read_OBJ(std::istream& is,
template <typename Graph>
bool read_OBJ(std::istream& is, Graph& g,
typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
{
return read_OBJ(is, g, parameters::all_default());
}
@ -182,12 +181,12 @@ bool read_OBJ(const std::string& fname,
Graph& g,
const CGAL_BGL_NP_CLASS& np
#ifndef DOXYGEN_RUNNING
, typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
#endif
)
{
std::ifstream is(fname);
CGAL::set_mode(is, CGAL::IO::ASCII);
CGAL::IO::set_mode(is, CGAL::IO::ASCII);
return read_OBJ(is, g, np);
}
@ -195,7 +194,7 @@ bool read_OBJ(const std::string& fname,
template <typename Graph>
bool read_OBJ(const std::string& fname, Graph& g,
typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
{
return read_OBJ(fname, g, parameters::all_default());
}
@ -245,11 +244,11 @@ bool write_OBJ(std::ostream& os,
const Graph& g,
const CGAL_BGL_NP_CLASS& np
#ifndef DOXYGEN_RUNNING
, typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
#endif
)
{
IO::internal::Generic_facegraph_printer<std::ostream, Graph, CGAL::File_writer_wavefront> printer(os);
internal::Generic_facegraph_printer<std::ostream, Graph, CGAL::File_writer_wavefront> printer(os);
return printer(g, np);
}
@ -257,7 +256,7 @@ bool write_OBJ(std::ostream& os,
template <typename Graph>
bool write_OBJ(std::ostream& os, const Graph& g,
typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
{
return write_OBJ(os, g, parameters::all_default());
}
@ -302,12 +301,12 @@ bool write_OBJ(const std::string& fname,
const Graph& g,
const CGAL_BGL_NP_CLASS& np
#ifndef DOXYGEN_RUNNING
, typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
#endif
)
{
std::ofstream os(fname);
CGAL::set_mode(os, CGAL::IO::ASCII);
CGAL::IO::set_mode(os, CGAL::IO::ASCII);
return write_OBJ(os, g, np);
}
@ -315,13 +314,13 @@ bool write_OBJ(const std::string& fname,
template <typename Graph>
bool write_OBJ(const std::string& fname, const Graph& g,
typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
{
return write_OBJ(fname, g, parameters::all_default());
}
/// \endcond
} // namespace CGAL
}} // namespace CGAL::IO
#endif // CGAL_BGL_IO_OBJ_H

View File

@ -78,12 +78,11 @@ bool read_OFF_BGL(std::istream& is,
typedef typename CGAL::GetVertexPointMap<Graph, CGAL_BGL_NP_CLASS>::type VPM;
typedef typename boost::property_traits<VPM>::value_type Point;
IO::internal::OFF_builder<Graph, Point> builder(is);
internal::OFF_builder<Graph, Point> builder(is);
return builder(g, np);
}
} // namespace internal
} // namespace IO
/*!
\ingroup PkgBGLIoFuncsOFF
@ -127,7 +126,7 @@ bool read_OFF_BGL(std::istream& is,
\cgalParamNBegin{vertex_color_map}
\cgalParamDescription{a property map associating colors to the vertices of `g`}
\cgalParamType{a class model of `WritablePropertyMap` with `boost::graph_traits<Graph>::%vertex_descriptor`
as key type and `CGAL::Color` as value type}
as key type and `CGAL::IO::Color` as value type}
\cgalParamDefault{vertex colors that may exist in the input will be ignored}
\cgalParamNEnd
@ -141,7 +140,7 @@ bool read_OFF_BGL(std::istream& is,
\cgalParamNBegin{face_color_map}
\cgalParamDescription{a property map associating colors to the faces of `g`}
\cgalParamType{a class model of `WritablePropertyMap` with `boost::graph_traits<Graph>::%face_descriptor`
as key type and `CGAL::Color` as value type}
as key type and `CGAL::IO::Color` as value type}
\cgalParamDefault{face colors that may exist in the input will be ignored}
\cgalParamNEnd
@ -162,18 +161,18 @@ bool read_OFF(std::istream& is,
Graph& g,
const CGAL_BGL_NP_CLASS& np
#ifndef DOXYGEN_RUNNING
, typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
#endif
)
{
return IO::internal::read_OFF_BGL(is, g, np);
return internal::read_OFF_BGL(is, g, np);
}
/// \cond SKIP_IN_MANUAL
template <typename Graph>
bool read_OFF(std::istream& is, Graph& g,
typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
{
return read_OFF(is, g, parameters::all_default());
}
@ -222,7 +221,7 @@ bool read_OFF(std::istream& is, Graph& g,
\cgalParamNBegin{vertex_color_map}
\cgalParamDescription{a property map associating colors to the vertices of `g`}
\cgalParamType{a class model of `WritablePropertyMap` with `boost::graph_traits<Graph>::%vertex_descriptor`
as key type and `CGAL::Color` as value type}
as key type and `CGAL::IO::Color` as value type}
\cgalParamDefault{vertex colors that may exist in the input will be ignored}
\cgalParamNEnd
@ -236,7 +235,7 @@ bool read_OFF(std::istream& is, Graph& g,
\cgalParamNBegin{face_color_map}
\cgalParamDescription{a property map associating colors to the faces of `g`}
\cgalParamType{a class model of `WritablePropertyMap` with `boost::graph_traits<Graph>::%face_descriptor`
as key type and `CGAL::Color` as value type}
as key type and `CGAL::IO::Color` as value type}
\cgalParamDefault{face colors that may exist in the input will be ignored}
\cgalParamNEnd
@ -257,7 +256,7 @@ bool read_OFF(const std::string& fname,
Graph& g,
const CGAL_BGL_NP_CLASS& np
#ifndef DOXYGEN_RUNNING
, typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
#endif
)
{
@ -269,35 +268,37 @@ bool read_OFF(const std::string& fname,
template <typename Graph>
bool read_OFF(const std::string& fname, Graph& g,
typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
{
return read_OFF(fname, g, parameters::all_default());
}
/// \endcond
} // namespace IO
#ifndef CGAL_NO_DEPRECATED_CODE
/*!
\ingroup PkgBGLIOFctDeprecated
\deprecated This function is deprecated since \cgal 5.2, `CGAL::read_OFF()` should be used instead.
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_OFF()` should be used instead.
*/
template <typename Graph, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
CGAL_DEPRECATED bool read_off(std::istream& is, Graph& g, const CGAL_BGL_NP_CLASS& np)
{
return read_OFF(is, g, np);
return IO::read_OFF(is, g, np);
}
/*!
\ingroup PkgBGLIOFctDeprecated
\deprecated This function is deprecated since \cgal 5.2, `CGAL::read_OFF()` should be used instead.
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_OFF()` should be used instead.
*/
template <typename Graph, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
CGAL_DEPRECATED bool read_off(const char* fname, Graph& g, const CGAL_BGL_NP_CLASS& np)
{
return read_OFF(fname, g, np);
return IO::read_OFF(fname, g, np);
}
template <typename Graph>
@ -312,6 +313,12 @@ CGAL_DEPRECATED bool read_off(const char* fname, Graph& g)
return read_off(fname, g, parameters::all_default());
}
template <typename Graph>
CGAL_DEPRECATED bool read_off(const std::string& fname, Graph& g)
{
return read_off(fname.c_str(), g, parameters::all_default());
}
#endif // CGAL_NO_DEPRECATED_CODE
////////////////////////////////////////////////////////////////////////////////////////////////////
@ -326,12 +333,11 @@ bool write_OFF_BGL(std::ostream& os,
const Graph& g,
const CGAL_BGL_NP_CLASS& np)
{
IO::internal::Generic_facegraph_printer<std::ostream, Graph, CGAL::File_writer_OFF> printer(os);
internal::Generic_facegraph_printer<std::ostream, Graph, CGAL::File_writer_OFF> printer(os);
return printer(g, np);
}
} // namespace internal
} // namespace IO
/*!
\ingroup PkgBGLIoFuncsOFF
@ -365,7 +371,7 @@ bool write_OFF_BGL(std::ostream& os,
\cgalParamNBegin{vertex_color_map}
\cgalParamDescription{a property map associating colors to the vertices of `g`}
\cgalParamType{a class model of `ReadablePropertyMap` with `boost::graph_traits<Graph>::%vertex_descriptor`
as key type and `CGAL::Color` as value type}
as key type and `CGAL::IO::Color` as value type}
\cgalParamDefault{no vertex colors in the output}
\cgalParamNEnd
@ -379,7 +385,7 @@ bool write_OFF_BGL(std::ostream& os,
\cgalParamNBegin{face_color_map}
\cgalParamDescription{a property map associating colors to the faces of `g`}
\cgalParamType{a class model of `ReadablePropertyMap` with `boost::graph_traits<Graph>::%face_descriptor`
as key type and `CGAL::Color` as value type}
as key type and `CGAL::IO::Color` as value type}
\cgalParamDefault{no face colors in the output}
\cgalParamNEnd
@ -400,18 +406,18 @@ bool write_OFF(std::ostream& os,
const Graph& g,
const CGAL_BGL_NP_CLASS& np
#ifndef DOXYGEN_RUNNING
, typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
#endif
)
{
return IO::internal::write_OFF_BGL(os, g, np);
return internal::write_OFF_BGL(os, g, np);
}
/// \cond SKIP_IN_MANUAL
template <typename Graph>
bool write_OFF(std::ostream& os, const Graph& g,
typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
{
return write_OFF(os, g, parameters::all_default());
}
@ -450,7 +456,7 @@ bool write_OFF(std::ostream& os, const Graph& g,
\cgalParamNBegin{vertex_color_map}
\cgalParamDescription{a property map associating colors to the vertices of `g`}
\cgalParamType{a class model of `ReadablePropertyMap` with `boost::graph_traits<Graph>::%vertex_descriptor`
as key type and `CGAL::Color` as value type}
as key type and `CGAL::IO::Color` as value type}
\cgalParamDefault{no vertex colors in the output}
\cgalParamNEnd
@ -464,7 +470,7 @@ bool write_OFF(std::ostream& os, const Graph& g,
\cgalParamNBegin{face_color_map}
\cgalParamDescription{a property map associating colors to the faces of `g`}
\cgalParamType{a class model of `ReadablePropertyMap` with `boost::graph_traits<Graph>::%face_descriptor`
as key type and `CGAL::Color` as value type}
as key type and `CGAL::IO::Color` as value type}
\cgalParamDefault{no face colors in the output}
\cgalParamNEnd
@ -485,7 +491,7 @@ bool write_OFF(const std::string& fname,
const Graph& g,
const CGAL_BGL_NP_CLASS& np
#ifndef DOXYGEN_RUNNING
, typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
#endif
)
{
@ -503,24 +509,26 @@ bool write_OFF(const std::string& fname,
template <typename Graph>
bool write_OFF(const std::string& fname, const Graph& g,
typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
{
return write_OFF(fname, g, parameters::all_default());
}
/// \endcond
} // namespace IO
#ifndef CGAL_NO_DEPRECATED_CODE
/*!
\ingroup PkgBGLIOFctDeprecated
\deprecated This function is deprecated since \cgal 5.2, `CGAL::write_OFF()` should be used instead.
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_OFF()` should be used instead.
*/
template <typename Graph, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
CGAL_DEPRECATED bool write_off(std::ostream& os, const Graph& g, const CGAL_BGL_NP_CLASS& np)
{
return write_OFF(os, g, np);
return IO::write_OFF(os, g, np);
}
template <typename Graph>
@ -531,12 +539,12 @@ CGAL_DEPRECATED bool write_off(std::ostream& os, const Graph& g)
/*!
\ingroup PkgBGLIOFctDeprecated
\deprecated This function is deprecated since \cgal 5.2, `CGAL::write_OFF()` should be used instead.
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_OFF()` should be used instead.
*/
template <typename Graph, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
CGAL_DEPRECATED bool write_off(const char* fname, const Graph& g, const CGAL_BGL_NP_CLASS& np)
{
return write_OFF(fname, g, np);
return IO::write_OFF(fname, g, np);
}
template <typename Graph>

View File

@ -71,12 +71,11 @@ bool read_PLY_BGL(std::istream& is,
typedef typename CGAL::GetVertexPointMap<Graph, CGAL_BGL_NP_CLASS>::type VPM;
typedef typename boost::property_traits<VPM>::value_type Point;
IO::internal::PLY_builder<Graph, Point> builder(is);
internal::PLY_builder<Graph, Point> builder(is);
return builder(g, np);
}
} // namespace internal
} // namespace IO
/*!
\ingroup PkgBGLIoFuncsPLY
@ -114,14 +113,14 @@ bool read_PLY_BGL(std::istream& is,
\cgalParamNBegin{vertex_color_map}
\cgalParamDescription{a property map associating colors to the vertices of `g`}
\cgalParamType{a class model of `WritablePropertyMap` with `boost::graph_traits<Graph>::%vertex_descriptor`
as key type and `CGAL::Color` as value type}
as key type and `CGAL::IO::Color` as value type}
\cgalParamDefault{vertex colors that may exist in the input will be ignored}
\cgalParamNEnd
\cgalParamNBegin{face_color_map}
\cgalParamDescription{a property map associating colors to the faces of `g`}
\cgalParamType{a class model of `WritablePropertyMap` with `boost::graph_traits<Graph>::%face_descriptor`
as key type and `CGAL::Color` as value type}
as key type and `CGAL::IO::Color` as value type}
\cgalParamDefault{face colors that may exist in the input will be ignored}
\cgalParamNEnd
@ -142,20 +141,20 @@ bool read_PLY(std::istream& is,
Graph& g,
const CGAL_BGL_NP_CLASS& np
#ifndef DOXYGEN_RUNNING
, typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
#endif
)
{
return IO::internal::read_PLY_BGL(is, g, np);
return internal::read_PLY_BGL(is, g, np);
}
/// \cond SKIP_IN_MANUAL
template <typename Graph>
bool read_PLY(std::istream& is, Graph& g,
typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
{
return IO::internal::read_PLY_BGL(is, g, parameters::all_default());
return internal::read_PLY_BGL(is, g, parameters::all_default());
}
/// \endcond
@ -200,14 +199,14 @@ bool read_PLY(std::istream& is, Graph& g,
\cgalParamNBegin{vertex_color_map}
\cgalParamDescription{a property map associating colors to the vertices of `g`}
\cgalParamType{a class model of `WritablePropertyMap` with `boost::graph_traits<Graph>::%vertex_descriptor`
as key type and `CGAL::Color` as value type}
as key type and `CGAL::IO::Color` as value type}
\cgalParamDefault{vertex colors that may exist in the input will be ignored}
\cgalParamNEnd
\cgalParamNBegin{face_color_map}
\cgalParamDescription{a property map associating colors to the faces of `g`}
\cgalParamType{a class model of `WritablePropertyMap` with `boost::graph_traits<Graph>::%face_descriptor`
as key type and `CGAL::Color` as value type}
as key type and `CGAL::IO::Color` as value type}
\cgalParamDefault{face colors that may exist in the input will be ignored}
\cgalParamNEnd
@ -228,7 +227,7 @@ bool read_PLY(const std::string& fname,
Graph& g,
const CGAL_BGL_NP_CLASS& np
#ifndef DOXYGEN_RUNNING
, typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
#endif
)
{
@ -236,14 +235,14 @@ bool read_PLY(const std::string& fname,
if(binary)
{
std::ifstream is(fname, std::ios::binary);
CGAL::set_mode(is, CGAL::IO::BINARY);
return IO::internal::read_PLY_BGL(is, g, np);
CGAL::IO::set_mode(is, CGAL::IO::BINARY);
return internal::read_PLY_BGL(is, g, np);
}
else
{
std::ifstream is(fname);
CGAL::set_mode(is, CGAL::IO::ASCII);
return IO::internal::read_PLY_BGL(is, g, np);
CGAL::IO::set_mode(is, CGAL::IO::ASCII);
return internal::read_PLY_BGL(is, g, np);
}
}
@ -251,7 +250,7 @@ bool read_PLY(const std::string& fname,
template <typename Graph>
bool read_PLY(const std::string& fname, Graph& g,
typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
{
return read_PLY(fname, g, parameters::all_default());
}
@ -297,14 +296,14 @@ bool read_PLY(const std::string& fname, Graph& g,
\cgalParamNBegin{vertex_color_map}
\cgalParamDescription{a property map associating colors to the vertices of `g`}
\cgalParamType{a class model of `WritablePropertyMap` with `boost::graph_traits<Graph>::%vertex_descriptor`
as key type and `CGAL::Color` as value type}
as key type and `CGAL::IO::Color` as value type}
\cgalParamDefault{vertex colors that may exist in the input will be ignored}
\cgalParamNEnd
\cgalParamNBegin{face_color_map}
\cgalParamDescription{a property map associating colors to the faces of `g`}
\cgalParamType{a class model of `WritablePropertyMap` with `boost::graph_traits<Graph>::%face_descriptor`
as key type and `CGAL::Color` as value type}
as key type and `CGAL::IO::Color` as value type}
\cgalParamDefault{face colors that may exist in the input will be ignored}
\cgalParamNEnd
@ -324,7 +323,7 @@ bool write_PLY(std::ostream& os,
const std::string& comments,
const CGAL_BGL_NP_CLASS& np
#ifndef DOXYGEN_RUNNING
, typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
#endif
)
{
@ -335,7 +334,7 @@ bool write_PLY(std::ostream& os,
typedef typename CGAL::GetInitializedVertexIndexMap<Graph, CGAL_BGL_NP_CLASS>::const_type VIMap;
typedef typename GetVertexPointMap<Graph, CGAL_BGL_NP_CLASS>::const_type Vpm;
typedef typename boost::property_traits<Vpm>::reference Point_3;
typedef CGAL::Color Color;
typedef CGAL::IO::Color Color;
typedef typename internal_np::Lookup_named_param_def<
internal_np::vertex_color_map_t,
CGAL_BGL_NP_CLASS,
@ -365,7 +364,7 @@ bool write_PLY(std::ostream& os,
// Write header
os << "ply" << std::endl
<< ((get_mode(os) == IO::BINARY) ? "format binary_little_endian 1.0" : "format ascii 1.0") << std::endl
<< ((get_mode(os) == BINARY) ? "format binary_little_endian 1.0" : "format ascii 1.0") << std::endl
<< "comment Generated by the CGAL library" << std::endl;
if(comments != std::string())
@ -380,7 +379,7 @@ bool write_PLY(std::ostream& os,
}
os << "element vertex " << vertices(g).size() << std::endl;
IO::internal::output_property_header(os, make_ply_point_writer (CGAL::Identity_property_map<Point_3>()));
internal::output_property_header(os, make_ply_point_writer (CGAL::Identity_property_map<Point_3>()));
//if vcm is not default add v:color property
if(has_vcolor)
{
@ -391,7 +390,7 @@ bool write_PLY(std::ostream& os,
}
os << "element face " << faces(g).size() << std::endl;
IO::internal::output_property_header(
internal::output_property_header(
os, std::make_pair(CGAL::Identity_property_map<std::vector<std::size_t> >(),
PLY_property<std::vector<int> >("vertex_indices")));
//if fcm is not default add f:color property
@ -407,10 +406,10 @@ bool write_PLY(std::ostream& os,
for(vertex_descriptor vd : vertices(g))
{
Point_3 p = get(vpm, vd);
IO::internal::output_properties(os, &p, make_ply_point_writer (CGAL::Identity_property_map<Point_3>()));
internal::output_properties(os, &p, make_ply_point_writer (CGAL::Identity_property_map<Point_3>()));
if(has_vcolor)
{
const CGAL::Color& c = get(vcm, vd);
const CGAL::IO::Color& c = get(vcm, vd);
if(get_mode(os) == CGAL::IO::ASCII)
os << c << std::endl;
else
@ -425,12 +424,12 @@ bool write_PLY(std::ostream& os,
for(halfedge_descriptor hd : halfedges_around_face(halfedge(fd, g), g))
polygon.push_back(get(vim, target(hd,g)));
IO::internal::output_properties(os, &polygon,
internal::output_properties(os, &polygon,
std::make_pair(CGAL::Identity_property_map<std::vector<std::size_t> >(),
PLY_property<std::vector<int> >("vertex_indices")));
if(has_fcolor)
{
const CGAL::Color& c = get(fcm, fd);
const CGAL::IO::Color& c = get(fcm, fd);
if(get_mode(os) == CGAL::IO::ASCII)
os << c << std::endl;
else
@ -447,21 +446,21 @@ bool write_PLY(std::ostream& os,
template <typename Graph>
bool write_PLY(std::ostream& os, const Graph& g, const std::string& comments,
typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
{
return write_PLY(os, g, comments, parameters::all_default());
}
template <typename Graph, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
bool write_PLY(std::ostream& os, const Graph& g, const CGAL_BGL_NP_CLASS& np,
typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
{
return write_PLY(os, g, std::string(), np);
}
template <typename Graph>
bool write_PLY(std::ostream& os, const Graph& g,
typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
{
return write_PLY(os, g, std::string(), parameters::all_default());
}
@ -507,14 +506,14 @@ bool write_PLY(std::ostream& os, const Graph& g,
\cgalParamNBegin{vertex_color_map}
\cgalParamDescription{a property map associating colors to the vertices of `g`}
\cgalParamType{a class model of `ReadablePropertyMap` with `boost::graph_traits<Graph>::%vertex_descriptor`
as key type and `CGAL::Color` as value type}
as key type and `CGAL::IO::Color` as value type}
\cgalParamDefault{no vertex color in the output}
\cgalParamNEnd
\cgalParamNBegin{face_color_map}
\cgalParamDescription{a property map associating colors to the faces of `g`}
\cgalParamType{a class model of `ReadablePropertyMap` with `boost::graph_traits<Graph>::%face_descriptor`
as key type and `CGAL::Color` as value type}
as key type and `CGAL::IO::Color` as value type}
\cgalParamDefault{no face color in the output}
\cgalParamNEnd
@ -534,7 +533,7 @@ bool write_PLY(const std::string& fname,
const std::string& comments,
const CGAL_BGL_NP_CLASS& np
#ifndef DOXYGEN_RUNNING
, typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
#endif
)
{
@ -542,13 +541,13 @@ bool write_PLY(const std::string& fname,
if(binary)
{
std::ofstream os(fname, std::ios::binary);
CGAL::set_mode(os, CGAL::IO::BINARY);
CGAL::IO::set_mode(os, CGAL::IO::BINARY);
return write_PLY(os, g, comments, np);
}
else
{
std::ofstream os(fname);
CGAL::set_mode(os, CGAL::IO::ASCII);
CGAL::IO::set_mode(os, CGAL::IO::ASCII);
return write_PLY(os, g, comments, np);
}
@ -558,27 +557,27 @@ bool write_PLY(const std::string& fname,
template <typename Graph>
bool write_PLY(const std::string& fname, const Graph& g, const std::string comments,
typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
{
return write_PLY(fname, g, comments, parameters::all_default());
}
template <typename Graph, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
bool write_PLY(const std::string& fname, const Graph& g, const CGAL_BGL_NP_CLASS& np,
typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
{
return write_PLY(fname, g, std::string(), np);
}
template <typename Graph>
bool write_PLY(const std::string& fname, const Graph& g,
typename boost::disable_if<IO::internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
{
return write_PLY(fname, g, std::string(), parameters::all_default());
}
/// \endcond
} // namespace CGAL
} } // namespace CGAL::IO
#endif // CGAL_BGL_IO_PLY_H

View File

@ -63,7 +63,6 @@ public:
};
} // namespace internal
} // namespace IO
/*!
\ingroup PkgBGLIoFuncsSTL
@ -113,7 +112,7 @@ bool read_STL(std::istream& is,
typedef typename boost::property_traits<VPM>::value_type Point;
if(!is.good())
return false;
IO::internal::STL_builder<Graph, Point> builder(is);
internal::STL_builder<Graph, Point> builder(is);
return builder(g, np);
}
@ -173,7 +172,7 @@ bool read_STL(const std::string& fname,
if(binary)
{
std::ifstream is(fname, std::ios::binary);
CGAL::set_mode(is, CGAL::IO::BINARY);
CGAL::IO::set_mode(is, CGAL::IO::BINARY);
if(read_STL(is, g, np))
{
return true;
@ -181,7 +180,7 @@ bool read_STL(const std::string& fname,
g.clear();
}
std::ifstream is(fname);
CGAL::set_mode(is, CGAL::IO::ASCII);
CGAL::IO::set_mode(is, CGAL::IO::ASCII);
typedef typename CGAL::GetVertexPointMap<Graph, CGAL_BGL_NP_CLASS>::type VPM;
VPM vpm = choose_parameter(get_parameter(np, internal_np::vertex_point),
@ -264,7 +263,7 @@ bool write_STL(std::ostream& os,
set_stream_precision_from_NP(os, np);
if(get_mode(os) == IO::BINARY)
if(get_mode(os) == BINARY)
{
os << "FileType: Binary ";
const boost::uint32_t N32 = static_cast<boost::uint32_t>(faces(g).size());
@ -364,13 +363,13 @@ bool write_STL(const std::string& fname, const Graph& g, const CGAL_BGL_NP_CLASS
if(binary)
{
std::ofstream os(fname, std::ios::binary);
CGAL::set_mode(os, CGAL::IO::BINARY);
CGAL::IO::set_mode(os, CGAL::IO::BINARY);
return write_STL(os, g, np);
}
else
{
std::ofstream os(fname);
CGAL::set_mode(os, CGAL::IO::ASCII);
CGAL::IO::set_mode(os, CGAL::IO::ASCII);
return write_STL(os, g, np);
}
@ -385,6 +384,6 @@ bool write_STL(const std::string& fname, const Graph& g) { return write_STL(fnam
/// \endcond
} // namespace CGAL
}} // namespace CGAL::IO
#endif // CGAL_BGL_IO_STL_H

View File

@ -113,7 +113,6 @@ bool vtkPointSet_to_polygon_mesh(vtkPointSet* poly_data,
}
} // namespace internal
} // namespace IO
/*!
* \ingroup PkgBGLIoFuncsVTP
@ -160,13 +159,13 @@ bool read_VTP(const std::string& fname,
}
test.close();
vtkSmartPointer<vtkPointSet> data;
vtkSmartPointer<IO::internal::ErrorObserverVtk> obs =
vtkSmartPointer<IO::internal::ErrorObserverVtk>::New();
vtkSmartPointer<internal::ErrorObserverVtk> obs =
vtkSmartPointer<internal::ErrorObserverVtk>::New();
data = vtkPolyData::SafeDownCast(IO::internal::read_vtk_file<vtkXMLPolyDataReader>(fname, obs)->GetOutput());
data = vtkPolyData::SafeDownCast(internal::read_vtk_file<vtkXMLPolyDataReader>(fname, obs)->GetOutput());
if (obs->GetError())
return false;
return IO::internal::vtkPointSet_to_polygon_mesh(data, g, np);
return internal::vtkPointSet_to_polygon_mesh(data, g, np);
}
/// \cond SKIP_IN_MANUAL
@ -180,7 +179,6 @@ bool read_VTP(const std::string& fname, Graph& g) { return read_VTP(fname, g, pa
////////////////////////////////////////////////////////////////////////////////////////////////////
// Write
namespace IO {
namespace internal {
// writes the polys appended data at the end of the .vtp file
@ -381,7 +379,6 @@ void write_polys_points(std::ostream& os,
}
} // namespace internal
} // namespace IO
/*! \ingroup PkgBGLIoFuncsVTP
*
@ -465,16 +462,16 @@ bool write_VTP(std::ostream& os,
std::size_t offset = 0;
const bool binary = choose_parameter(get_parameter(np, internal_np::use_binary_mode), true);
IO::internal::write_points_tag(os, g, binary, offset, np);
IO::internal::write_polys_tag(os, g, binary, offset, np);
internal::write_points_tag(os, g, binary, offset, np);
internal::write_polys_tag(os, g, binary, offset, np);
os << " </Piece>\n"
<< " </PolyData>\n";
if(binary)
{
os << "<AppendedData encoding=\"raw\">\n_";
IO::internal::write_polys_points(os, g, np);
IO::internal::write_polys(os, g, np);
internal::write_polys_points(os, g, np);
internal::write_polys(os, g, np);
}
os << "</VTKFile>" << std::endl;
@ -534,7 +531,7 @@ bool write_VTP(const std::string& fname, const Graph& g, const CGAL_BGL_NP_CLASS
std::ofstream os;
if(binary){
os.open(fname, std::ios::binary);
CGAL::set_mode(os, CGAL::IO::BINARY);
CGAL::IO::set_mode(os, CGAL::IO::BINARY);
}
else
os.open(fname);
@ -551,17 +548,19 @@ bool write_VTP(const std::string& fname, const Graph& g) { return write_VTP(fnam
/// \endcond
} // namespace IO
#ifndef CGAL_NO_DEPRECATED_CODE
/*!
\ingroup PkgBGLIOFctDeprecated
\deprecated This function is deprecated since \cgal 5.2, `CGAL::write_VTP()` should be used instead.
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_VTP()` should be used instead.
*/
template <typename Graph, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
CGAL_DEPRECATED bool write_vtp(std::ostream& os, const Graph& g, const CGAL_BGL_NP_CLASS& np)
{
return write_VTP(os, g, np);
return IO::write_VTP(os, g, np);
}
template <typename Graph>

View File

@ -30,6 +30,8 @@
namespace CGAL {
namespace IO {
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
// Write
@ -71,7 +73,7 @@ bool write_WRL(std::ostream& os,
const CGAL_BGL_NP_CLASS& np)
{
CGAL::VRML_2_ostream vos(os);
IO::internal::Generic_facegraph_printer<CGAL::VRML_2_ostream, Graph, CGAL::File_writer_VRML_2> printer(vos);
internal::Generic_facegraph_printer<CGAL::VRML_2_ostream, Graph, CGAL::File_writer_VRML_2> printer(vos);
return printer(g, np);
}
@ -118,17 +120,19 @@ bool write_WRL(std::ostream& os, const Graph& g) { return write_WRL(os, g, param
template <typename Graph>
bool write_WRL(const std::string& fname, const Graph& g) { return write_WRL(fname, g, parameters::all_default()); }
} // namespace IO
#ifndef CGAL_NO_DEPRECATED_CODE
/*!
\ingroup PkgBGLIOFctDeprecated
\deprecated This function is deprecated since \cgal 5.2, `CGAL::write_WRL()` should be used instead.
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_WRL()` should be used instead.
*/
template <typename Graph, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
CGAL_DEPRECATED bool write_wrl(std::ostream& os, const Graph& g, const CGAL_BGL_NP_CLASS& np)
{
return write_WRL(os, g, np);
return IO::write_WRL(os, g, np);
}
template <typename Graph>

View File

@ -28,6 +28,8 @@
namespace CGAL {
namespace IO {
////////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////////
// Read
@ -121,7 +123,7 @@ bool read_polygon_mesh(std::istream& is,
*
* \return `true` if reading was successful, `false` otherwise.
*
* \sa \link PMP_IO_grp `CGAL::Polygon_mesh_processing::read_polygon_mesh()`\endlink if the data is not 2-manifold
* \sa \link PMP_IO_grp `CGAL::Polygon_mesh_processing::IO::read_polygon_mesh()`\endlink if the data is not 2-manifold
*/
template <class Graph, typename NamedParameters>
bool read_polygon_mesh(const std::string& fname,
@ -130,7 +132,7 @@ bool read_polygon_mesh(const std::string& fname,
{
const bool verbose = parameters::choose_parameter(parameters::get_parameter(np, internal_np::verbose), false);
const std::string ext = IO::internal::get_file_extension(fname);
const std::string ext = internal::get_file_extension(fname);
if(ext == std::string())
{
if(verbose)
@ -233,7 +235,7 @@ bool write_polygon_mesh(const std::string& fname,
{
const bool verbose = parameters::choose_parameter(parameters::get_parameter(np, internal_np::verbose), false);
const std::string ext = IO::internal::get_file_extension(fname);
const std::string ext = internal::get_file_extension(fname);
if(ext == std::string())
{
if(verbose)
@ -275,6 +277,6 @@ bool write_polygon_mesh(const std::string& fname, Graph& g)
/// \endcond
} // namespace CGAL
}} // namespace CGAL::IO
#endif // CGAL_BOOST_GRAPH_POLYGON_MESH_IO_H

View File

@ -1137,7 +1137,7 @@ void expand_face_selection_for_removal(const FaceRange& faces_to_be_deleted,
//todo: take non-manifold vertices into account.
template<class PolygonMesh, class FaceRange>
bool is_selection_a_topological_disk(const FaceRange& face_selection,
int euler_characteristic_of_selection(const FaceRange& face_selection,
PolygonMesh& pm)
{
typedef typename boost::graph_traits<PolygonMesh>::vertex_descriptor vertex_descriptor;
@ -1154,8 +1154,18 @@ bool is_selection_a_topological_disk(const FaceRange& face_selection,
sel_edges.insert(edge(h,pm));
}
}
return (sel_vertices.size() - sel_edges.size() + face_selection.size() == 1);
return static_cast<int>(sel_vertices.size())
- static_cast<int>(sel_edges.size())
+ static_cast<int>(face_selection.size());
}
template<class PolygonMesh, class FaceRange>
bool is_selection_a_topological_disk(const FaceRange& face_selection,
PolygonMesh& pm)
{
return euler_characteristic_of_selection(face_selection, pm) == 1;
}
} //end of namespace CGAL
#endif //CGAL_BOOST_GRAPH_SELECTION_H

View File

@ -26,11 +26,11 @@ namespace CGAL
struct DefaultColorFunctorFaceGraph
{
template<typename Graph>
CGAL::Color operator()(const Graph&,
CGAL::IO::Color operator()(const Graph&,
typename boost::graph_traits<Graph>::face_descriptor fh) const
{
if (fh==boost::graph_traits<Graph>::null_face()) // use to get the mono color
return CGAL::Color(100, 125, 200); // R G B between 0-255
return CGAL::IO::Color(100, 125, 200); // R G B between 0-255
return get_random_color(CGAL::get_default_random());
}
@ -141,7 +141,7 @@ protected:
{
if (fh!=boost::graph_traits<SM>::null_face())
{
CGAL::Color c=fcolor(sm, fh);
CGAL::IO::Color c=fcolor(sm, fh);
face_begin(c);
auto hd=halfedge(fh, sm);
const auto first_hd = hd;

View File

@ -31,7 +31,7 @@ int main(int argc, char** argv)
Mesh m;
const char* filename = (argc>1) ? argv[1] : "data/genus3.off";
CGAL::read_polygon_mesh(filename, m);
CGAL::IO::read_polygon_mesh(filename, m);
std::cout << " is_valid? " << CGAL::is_valid_polygon_mesh(m) << "\n";
std::cout << "Total time: " << timer.time() << std::endl << std::endl;
@ -48,7 +48,7 @@ int main(int argc, char** argv)
const char* filename = (argc>1) ? argv[1] : "data/blobby.off";
std::vector<Kernel::Point_3> points;
std::vector<std::array<std::size_t, 3> > faces_ids;
CGAL::read_polygon_soup(filename, points, faces_ids);
CGAL::IO::read_polygon_soup(filename, points, faces_ids);
std::cout << " Read soup: " << timer.time() << std::endl;
std::vector<std::array<Mesh::Vertex_index, 3> > triangles;
@ -85,7 +85,7 @@ int main(int argc, char** argv)
std::vector<Kernel::Point_3> points;
std::vector<std::array<std::size_t, 3> > faces_ids;
CGAL::read_polygon_soup(filename, points, faces_ids);
CGAL::IO::read_polygon_soup(filename, points, faces_ids);
std::cout << " Read soup: " << timer.time() << std::endl;
std::vector<std::array<Mesh::Vertex_index, 3> > triangles;

View File

@ -24,7 +24,7 @@ typedef CGAL::Surface_mesh<Point_3> Mesh;
typedef std::vector<Point_3> PointRange;
typedef std::vector<std::size_t> Polygon;
typedef std::vector<Polygon> PolygonRange;
typedef std::vector<CGAL::Color> ColorRange;
typedef std::vector<CGAL::IO::Color> ColorRange;
int main(int argc, char** argv)
{
@ -38,7 +38,7 @@ int main(int argc, char** argv)
std::vector<Mesh> meshes;
//testing reading functions.
if(!CGAL::read_3MF(filename, meshes))
if(!CGAL::IO::read_3MF(filename, meshes))
return 1;
for(std::size_t i = 0; i< meshes.size(); ++i)
{
@ -86,7 +86,7 @@ int main(int argc, char** argv)
triangle.push_back(vertex_id_map[vert]);
}
triangles.push_back(triangle);
colors.push_back(CGAL::Color(255,0,0,255));
colors.push_back(CGAL::IO::Color(255,0,0,255));
}
all_polygons.push_back(triangles);
@ -113,7 +113,7 @@ int main(int argc, char** argv)
triangle.push_back(vertex_id_map[vert]);
}
triangles.push_back(triangle);
colors.push_back(CGAL::Color(0,0,255,255));
colors.push_back(CGAL::IO::Color(0,0,255,255));
}
all_polygons.push_back(triangles);
@ -125,7 +125,7 @@ int main(int argc, char** argv)
meshes[0] = sphere;
meshes[1] = tube;
CGAL::write_3MF("meshes.3mf", meshes, names);
CGAL::IO::write_3MF("meshes.3mf", meshes, names);
std::cout << "OK." << std::endl;
#endif //CGAL_LINKED_WITH_3MF

View File

@ -43,7 +43,7 @@ collapse_edge_test()
const std::string fname = "data/flat_hexahedron.off";
Mesh m;
if(!CGAL::read_OFF(fname, m))
if(!CGAL::IO::read_OFF(fname, m))
std::cout << "Error reading file: " << fname << std::endl;
bool m_is_valid = CGAL::is_valid(m);

Some files were not shown because too many files have changed in this diff Show More