mirror of https://github.com/CGAL/cgal
Merge remote-tracking branch 'cgal/master' into gsoc2021-Surface_mesh_simplification-probabilistic-komaromy
This commit is contained in:
commit
34c91aba5f
|
|
@ -96,6 +96,7 @@ jobs:
|
|||
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
|
||||
rm cgal.github.io/${PR_NUMBER}/$ROUND/* -rf
|
||||
for f in $LIST_OF_PKGS
|
||||
do
|
||||
if [ -d ./build_doc/doc_output/$f ]; then
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
#include <fstream>
|
||||
#include <iterator>
|
||||
|
||||
#include <CGAL/assertions.h>
|
||||
#include <cassert>
|
||||
|
||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||
|
||||
|
|
@ -59,11 +58,11 @@ int main()
|
|||
std::list<T_Tree::Primitive::Id> t_primitives;
|
||||
std::list<S_Tree::Primitive::Id> s_primitives;
|
||||
cube_tree.all_intersected_primitives(tet_tree,std::back_inserter(t_primitives));
|
||||
CGAL_assertion(t_primitives.size() == 6);
|
||||
assert(t_primitives.size() == 6);
|
||||
tet_tree.all_intersected_primitives(cube_tree,std::back_inserter(s_primitives));
|
||||
CGAL_assertion(s_primitives.size() == 6);
|
||||
CGAL_assertion(tet_tree.do_intersect(cube_tree));
|
||||
CGAL_assertion(cube_tree.do_intersect(tet_tree));
|
||||
assert(s_primitives.size() == 6);
|
||||
assert(tet_tree.do_intersect(cube_tree));
|
||||
assert(cube_tree.do_intersect(tet_tree));
|
||||
|
||||
std::vector<T_Tree::Primitive::Id> all_primitives;
|
||||
cube_tree.all_intersected_primitives(tet_tree, std::back_inserter(all_primitives));
|
||||
|
|
@ -73,7 +72,7 @@ int main()
|
|||
if((int)prim.first == 5)
|
||||
found_f5 = true;
|
||||
}
|
||||
CGAL_assertion(found_f5);
|
||||
CGAL_USE(found_f5);
|
||||
assert(found_f5);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
#include <iostream>
|
||||
#include <list>
|
||||
#include <utility>
|
||||
#include <cassert>
|
||||
|
||||
#include <CGAL/AABB_face_graph_triangle_primitive.h>
|
||||
#include <CGAL/AABB_halfedge_graph_segment_primitive.h>
|
||||
|
|
@ -149,12 +150,12 @@ public:
|
|||
std::list<S_Tree::Primitive::Id> s_primitives;
|
||||
cube_tree.all_intersected_primitives(tet_tree,
|
||||
std::back_inserter(t_primitives));
|
||||
CGAL_assertion(t_primitives.size() == 6);
|
||||
assert(t_primitives.size() == 6);
|
||||
tet_tree.all_intersected_primitives(cube_tree,
|
||||
std::back_inserter(s_primitives));
|
||||
CGAL_assertion(s_primitives.size() == 6);
|
||||
CGAL_assertion(tet_tree.do_intersect(cube_tree));
|
||||
CGAL_assertion(cube_tree.do_intersect(tet_tree));
|
||||
assert(s_primitives.size() == 6);
|
||||
assert(tet_tree.do_intersect(cube_tree));
|
||||
assert(cube_tree.do_intersect(tet_tree));
|
||||
|
||||
std::vector<T_Tree::Primitive::Id> all_primitives;
|
||||
cube_tree.all_intersected_primitives(tet_tree,
|
||||
|
|
@ -164,8 +165,8 @@ public:
|
|||
if ((int)prim.first == 5)
|
||||
found_f5 = true;
|
||||
}
|
||||
CGAL_assertion(found_f5);
|
||||
CGAL_USE(found_f5);
|
||||
assert(found_f5);
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
#include <boost/functional/value_factory.hpp>
|
||||
#include <boost/array.hpp>
|
||||
|
||||
#include <CGAL/assertions.h>
|
||||
#include <CGAL/algorithm.h>
|
||||
#include <CGAL/point_generators_3.h>
|
||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||
|
|
|
|||
|
|
@ -138,9 +138,8 @@ int main()
|
|||
for(std::vector<Ray>::iterator it = rays.begin(); it != rays.end(); ++it) {
|
||||
primitives2.push_back(tree.first_intersection(*it));
|
||||
}
|
||||
CGAL_assertion_msg(primitives1.size() == primitives2.size(), "Different amount of primitives intersected.");
|
||||
CGAL_assertion_msg(std::equal(primitives1.begin(), primitives1.end(), primitives2.begin()),
|
||||
"Primitives mismatch.");
|
||||
assert(primitives1.size() == primitives2.size()); // Different amount of primitives intersected
|
||||
assert(std::equal(primitives1.begin(), primitives1.end(), primitives2.begin())); // Primitives mismatch
|
||||
std::size_t c = primitives1.size() - std::count(primitives1.begin(), primitives1.end(), boost::none);
|
||||
std::cout << "Intersected " << c << " primitives with " << NB_RAYS << " rays" << std::endl;
|
||||
std::cout << "Primitive method had to sort " << accum/NB_RAYS
|
||||
|
|
|
|||
|
|
@ -53,7 +53,6 @@ int main(int argc, char* argv[])
|
|||
{
|
||||
std::ifstream in((argc>1)?argv[1]:CGAL::data_file_path("points_3/half.xyz"));
|
||||
std::vector<Point_3> points;
|
||||
std::vector<Facet> facets;
|
||||
Mesh m;
|
||||
|
||||
std::copy(std::istream_iterator<Point_3>(in),
|
||||
|
|
|
|||
|
|
@ -191,7 +191,7 @@ namespace CGAL {
|
|||
|
||||
\tparam P must be a functor offering
|
||||
\code
|
||||
FT operator()(Advancing_front_surface_reconstruction,Cell_handle,int)
|
||||
FT operator()(Advancing_front_surface_reconstruction::Cell_handle,int)
|
||||
\endcode
|
||||
returning the priority of the facet `(Cell_handle,int)`. This functor enables the user
|
||||
to choose how candidate triangles are prioritized. If a facet should not appear in the output,
|
||||
|
|
@ -394,7 +394,7 @@ namespace CGAL {
|
|||
bool deal_with_2d;
|
||||
Priority priority;
|
||||
int max_connected_component;
|
||||
double K_init, K_step;
|
||||
coord_type K_init, K_step;
|
||||
std::list<Vertex_handle> interior_edges;
|
||||
std::list< Incidence_request_elt > incidence_requests;
|
||||
typename std::list< Incidence_request_elt >::iterator sentinel;
|
||||
|
|
@ -2581,18 +2581,18 @@ namespace CGAL {
|
|||
be convertible to `Exact_predicates_inexact_constructions_kernel::Point_3` with the `Cartesian_converter`.
|
||||
\tparam IndicesOutputIterator must be an output iterator to which
|
||||
`std::array<std::size_t, 3>` can be assigned.
|
||||
\tparam Priority must be a functor with `double operator()(Advancing_front_surface_reconstruction,Cell_handle,int)` returning the
|
||||
\tparam Priority must be a functor with `double operator()(Advancing_front_surface_reconstruction::Cell_handle,int)` returning the
|
||||
priority of the facet `(Cell_handle,int)`.
|
||||
|
||||
\param b iterator on the first point of the sequence
|
||||
\param e past the end iterator of the point sequence
|
||||
\param out output iterator
|
||||
\param priority enables the user to choose how candidate triangles are prioritized.
|
||||
\param radius_ratio_bound candidates incident to surface triangles which are not in the beta-wedge
|
||||
are discarded, if the ratio of their radius and the radius of the surface triangle is larger than `radius_ratio_bound`.
|
||||
Described in Section \ref AFSR_Boundaries
|
||||
\param beta half the angle of the wedge in which only the radius of triangles counts for the plausibility of candidates.
|
||||
Described in Section \ref AFSR_Selection
|
||||
\param priority allows the user to choose how candidate triangles are prioritized.
|
||||
|
||||
*/
|
||||
template <typename PointInputIterator, typename IndicesOutputIterator, typename Priority>
|
||||
|
|
|
|||
|
|
@ -103,7 +103,7 @@ void test_CR_for(const NT& f){
|
|||
// try chinese remainder
|
||||
do{
|
||||
// chinese remainder failed if q > 2*max_coeff(f)
|
||||
CGAL_postcondition_msg(pq < p*(2*max_coeff), " chinese remainder failed ");
|
||||
assert(pq < p*(2*max_coeff));
|
||||
|
||||
prime_index++;
|
||||
if(prime_index < 1000){
|
||||
|
|
|
|||
|
|
@ -409,9 +409,9 @@ void test_algebraic_kernel_1(const AlgebraicKernel_d_1& ak_1){
|
|||
#define CGAL_TEST_ALGEBRAIC_REAL_IO(_f) \
|
||||
alg1=_f; \
|
||||
ss<<CGAL::IO::oformat(alg1); \
|
||||
CGAL_assertion(ss.good()); \
|
||||
ss>>CGAL::IO::iformat(alg2); \
|
||||
CGAL_assertion(!ss.fail()); \
|
||||
assert(ss.good()); \
|
||||
ss>>CGAL::IO::iformat(alg2); \
|
||||
assert(!ss.fail()); \
|
||||
ss.clear(); \
|
||||
assert(alg1==alg2)
|
||||
// Note: after the reading ss>>CGAL::IO::iformat(alg2) the state of ss can
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
#include <CGAL/Delaunay_triangulation_2.h>
|
||||
|
||||
#include <CGAL/algorithm.h>
|
||||
#include <CGAL/assertions.h>
|
||||
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
|
|
|
|||
|
|
@ -193,7 +193,7 @@ the vertices, edges, facets and cells of the different types
|
|||
`INTERIOR`).
|
||||
|
||||
\subsection AlphaShape3DIO Input/Output
|
||||
It is possible to export a 3D alpha shape to a `std::ostream` or to a `Geomview_stream`
|
||||
It is possible to export a 3D alpha shape to a `std::ostream`
|
||||
using the `operator<<`, see the documentation of the class `Alpha_shape_3` for more information.
|
||||
|
||||
\section AlphaShape3D_ConceptAndModels Concepts and Models
|
||||
|
|
@ -352,4 +352,3 @@ results will suffer from round-off problems.
|
|||
|
||||
*/
|
||||
} /* namespace CGAL */
|
||||
|
||||
|
|
|
|||
|
|
@ -480,15 +480,6 @@ Defined in `CGAL/IO/io.h`
|
|||
std::ostream& operator<<(std::ostream& os,
|
||||
const Alpha_shape_3<Dt,ExactAlphaComparisonTag>& A);
|
||||
|
||||
/*!
|
||||
Inserts the alpha shape `A` for the current alpha value into the Geomview stream `W`.
|
||||
\pre The insert operator must be defined for `GT::Point` and `GT::Triangle`.
|
||||
|
||||
Defined in `CGAL/IO/Geomview_stream.h` and `CGAL/IO/alpha_shape_geomview_ostream_3.h`
|
||||
|
||||
\relates Alpha_shape_3
|
||||
*/
|
||||
Geomview_stream& operator<<(Geomview_stream& W,
|
||||
const Alpha_shape_3<Dt,ExactAlphaComparisonTag>& A);
|
||||
|
||||
} /* end namespace CGAL */
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ Algebraic_foundations
|
|||
Circulator
|
||||
Stream_support
|
||||
Triangulation_3
|
||||
Geomview
|
||||
Periodic_3_triangulation_3
|
||||
Number_types
|
||||
Alpha_shapes_2
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
#include <fstream>
|
||||
#include <vector>
|
||||
|
||||
#include <boost/unordered_set.hpp>
|
||||
#include <boost/unordered_map.hpp>
|
||||
#include <unordered_set>
|
||||
#include <unordered_map>
|
||||
|
||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel Gt;
|
||||
|
||||
|
|
@ -48,7 +48,7 @@ int main()
|
|||
|
||||
// collect alpha-shape facets accessible from the infinity
|
||||
// marks the cells that are in the same component as the infinite vertex by flooding
|
||||
boost::unordered_set< Alpha_shape_3::Cell_handle > marked_cells;
|
||||
std::unordered_set< Alpha_shape_3::Cell_handle > marked_cells;
|
||||
std::vector< Alpha_shape_3::Cell_handle > queue;
|
||||
queue.push_back( as.infinite_cell() );
|
||||
|
||||
|
|
@ -86,7 +86,7 @@ int main()
|
|||
|
||||
// dump into OFF format
|
||||
// assign an id per vertex
|
||||
boost::unordered_map< Alpha_shape_3::Vertex_handle, std::size_t> vids;
|
||||
std::unordered_map< Alpha_shape_3::Vertex_handle, std::size_t> vids;
|
||||
points.clear();
|
||||
|
||||
for(Alpha_shape_3::Facet f : filtered_regular_facets)
|
||||
|
|
|
|||
|
|
@ -24,9 +24,6 @@
|
|||
#include <CGAL/iterator.h>
|
||||
#include <CGAL/Object.h>
|
||||
#include <CGAL/Unique_hash_map.h>
|
||||
#ifdef CGAL_USE_GEOMVIEW
|
||||
#include <CGAL/IO/Geomview_stream.h> // TBC
|
||||
#endif
|
||||
#include <CGAL/Triangulation_utils_3.h>
|
||||
|
||||
#include <boost/type_traits/is_same.hpp>
|
||||
|
|
@ -786,11 +783,6 @@ private:
|
|||
|
||||
//---------------------------------------------------------------------
|
||||
public:
|
||||
#ifdef CGAL_USE_GEOMVIEW
|
||||
void show_triangulation_edges(Geomview_stream &gv) const;
|
||||
void show_alpha_shape_faces(Geomview_stream &gv) const;
|
||||
#endif
|
||||
|
||||
|
||||
// to Debug
|
||||
void print_maps() const;
|
||||
|
|
@ -1950,8 +1942,5 @@ Alpha_shape_3<Dt,EACT>::print_alpha_status(const Alpha_status& as) const
|
|||
|
||||
} //namespace CGAL
|
||||
|
||||
#ifdef CGAL_USE_GEOMVIEW
|
||||
#include <CGAL/IO/alpha_shape_geomview_ostream_3.h>
|
||||
#endif
|
||||
|
||||
#endif //CGAL_ALPHA_SHAPE_3_H
|
||||
|
|
|
|||
|
|
@ -32,9 +32,6 @@
|
|||
#include <CGAL/Triangulation_utils_3.h>
|
||||
#include <CGAL/Unique_hash_map.h>
|
||||
#include <CGAL/iterator.h>
|
||||
#ifdef CGAL_USE_GEOMVIEW
|
||||
#include <CGAL/IO/Geomview_stream.h> // TBC
|
||||
#endif
|
||||
|
||||
#include <CGAL/Alpha_shapes_3/internal/Classification_type.h>
|
||||
|
||||
|
|
@ -727,10 +724,6 @@ private:
|
|||
|
||||
//---------------------------------------------------------------------
|
||||
public:
|
||||
#ifdef CGAL_USE_GEOMVIEW
|
||||
void show_alpha_shape_faces(Geomview_stream &gv) const;
|
||||
#endif
|
||||
|
||||
|
||||
//Iterators
|
||||
|
||||
|
|
|
|||
|
|
@ -1,96 +0,0 @@
|
|||
// Copyright (c) 1997
|
||||
// Utrecht University (The Netherlands),
|
||||
// ETH Zurich (Switzerland),
|
||||
// INRIA Sophia-Antipolis (France),
|
||||
// Max-Planck-Institute Saarbruecken (Germany),
|
||||
// and Tel-Aviv University (Israel). All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org).
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
|
||||
//
|
||||
// Author(s) : Andreas Fabri
|
||||
|
||||
#ifndef CGAL_ALPHA_SHAPE_3_VRML_2_OSTREAM_H
|
||||
#define CGAL_ALPHA_SHAPE_3_VRML_2_OSTREAM_H
|
||||
|
||||
#include <CGAL/license/Alpha_shapes_3.h>
|
||||
|
||||
#include <CGAL/Alpha_shape_3.h>
|
||||
#include <CGAL/IO/VRML/VRML_2_ostream.h>
|
||||
#include <CGAL/number_utils.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
template <class Dt >
|
||||
VRML_2_ostream&
|
||||
operator<<(VRML_2_ostream& os,
|
||||
Alpha_shape_3<Dt> &as)
|
||||
{
|
||||
// Finite vertices coordinates.
|
||||
Alpha_shape_3<Dt>::Alpha_shape_vertices_iterator Vlist_it,
|
||||
Vlist_begin = as.alpha_shape_vertices_begin(),
|
||||
Vlist_end = as.alpha_shape_vertices_end();
|
||||
|
||||
std::map<Alpha_shape_3<Dt>::Vertex_handle, int> V;
|
||||
int number_of_vertex = 0;
|
||||
for( Vlist_it = Vlist_begin; Vlist_it != Vlist_end; Vlist_it++) {
|
||||
V[*Vlist_it] = number_of_vertex++;
|
||||
}
|
||||
|
||||
typename Alpha_shape_3<Dt>::Alpha_shape_facets_iterator Flist_it,
|
||||
Flist_begin = as.alpha_shape_facets_begin(),
|
||||
Flist_end = as.alpha_shape_facets_end();
|
||||
|
||||
std::map<Alpha_shape_3<Dt>::Facet, int> F;
|
||||
int number_of_facets = 0;
|
||||
for( Flist_it = Flist_begin; Flist_it != Flist_end; Flist_it++) {
|
||||
F[*Flist_it] = number_of_facets++;
|
||||
}
|
||||
|
||||
const char *Indent = " ";
|
||||
os << " Group {\n"
|
||||
" children [\n"
|
||||
" Shape {\n"
|
||||
" appearance USE A1\n"
|
||||
" geometry\n"
|
||||
" IndexedFaceSet {\n"
|
||||
" coord Coordinate {\n"
|
||||
" point [ \n"
|
||||
<< Indent << " ";
|
||||
for( Vlist_it = Vlist_begin; Vlist_it != Vlist_end; Vlist_it++) {
|
||||
os << CGAL::to_double((*Vlist_it)->point().x()) << " ";
|
||||
os << CGAL::to_double((*Vlist_it)->point().y()) << " ";
|
||||
os << CGAL::to_double((*Vlist_it)->point().z()) << ",\n" << Indent << " ";
|
||||
}
|
||||
os << "\n ]\n"
|
||||
" } # coord\n"
|
||||
" solid FALSE\n"
|
||||
<< Indent << "coordIndex [\n";
|
||||
// Finite facets indices.
|
||||
for( Flist_it = Flist_begin; Flist_it != Flist_end; Flist_it++){
|
||||
os << Indent << " ";
|
||||
for (int i=0; i<4; i++)
|
||||
if (i != (*Flist_it).second){
|
||||
os << V[(*Flist_it).first->vertex(i)];
|
||||
os << ", ";
|
||||
}
|
||||
if (Flist_it != Flist_end)
|
||||
os << "-1,\n";
|
||||
else
|
||||
os << "-1 \n";
|
||||
}
|
||||
os << Indent << "]\n";
|
||||
" } #IndexedFaceSet\n"
|
||||
" } #Shape\n"
|
||||
" ] #children\n"
|
||||
" } #Group\n";
|
||||
|
||||
return os;
|
||||
}
|
||||
|
||||
} //namespace CGAL
|
||||
|
||||
#endif // CGAL_ALPHA_SHAPE_3_VRML_2_OSTREAM_H
|
||||
|
|
@ -1,190 +0,0 @@
|
|||
// Copyright (c) 1997 INRIA Sophia-Antipolis (France).
|
||||
// All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org).
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
|
||||
//
|
||||
// Author(s) : Tran Kai Frank DA <Frank.Da@sophia.inria.fr>
|
||||
// Mael Rouxel-Labbé
|
||||
|
||||
#ifndef CGAL_IO_ALPHA_SHAPE_GEOMVIEW_OSTREAM_3_H
|
||||
#define CGAL_IO_ALPHA_SHAPE_GEOMVIEW_OSTREAM_3_H
|
||||
|
||||
#include <CGAL/license/Alpha_shapes_3.h>
|
||||
|
||||
#include <CGAL/IO/Geomview_stream.h>
|
||||
#include <CGAL/Alpha_shape_3.h>
|
||||
|
||||
#include <map>
|
||||
#include <utility>
|
||||
|
||||
// TODO :
|
||||
// - Check the correctness when dimension < 3.
|
||||
// - Use the stream color instead of built-in constant/random.
|
||||
// - If interfaces were more similar, we could think of sharing 2d and 3d ?
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
namespace CGAL {
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
template<class Dt,class EACT>
|
||||
void
|
||||
Alpha_shape_3<Dt,EACT>::
|
||||
show_triangulation_edges(Geomview_stream &gv) const
|
||||
{
|
||||
// To become unordered when CGAL's Point_3/Weighted_point_3 has a hash function
|
||||
typedef typename std::map<Point, int> PMap;
|
||||
|
||||
// Used to keep the insertion order in memory
|
||||
typedef typename std::vector<typename PMap::iterator> PMapIterVector;
|
||||
|
||||
PMap P;
|
||||
PMapIterVector PIV;
|
||||
int number_of_points = 0;
|
||||
|
||||
for(Finite_edges_iterator eit=finite_edges_begin(); eit!=finite_edges_end(); ++eit)
|
||||
{
|
||||
Point p = point(eit->first, eit->second);
|
||||
Point q = point(eit->first, eit->third);
|
||||
|
||||
std::pair<typename PMap::iterator, bool> is_p_insert_successful =
|
||||
P.insert(std::make_pair(p, number_of_points));
|
||||
|
||||
if(is_p_insert_successful.second)
|
||||
{
|
||||
++number_of_points;
|
||||
PIV.push_back(is_p_insert_successful.first);
|
||||
}
|
||||
|
||||
std::pair<typename PMap::iterator, bool> is_q_insert_successful =
|
||||
P.insert(std::make_pair(q, number_of_points));
|
||||
|
||||
if(is_q_insert_successful.second)
|
||||
{
|
||||
++number_of_points;
|
||||
PIV.push_back(is_q_insert_successful.first);
|
||||
}
|
||||
}
|
||||
|
||||
// Header
|
||||
gv.set_ascii_mode();
|
||||
gv << "(geometry " << gv.get_new_id("triangulation_edges")
|
||||
<< " {appearance {}{ SKEL \n"
|
||||
<< number_of_points << this->number_of_finite_edges() << "\n";
|
||||
|
||||
// Vertices
|
||||
typename PMapIterVector::iterator Pit, Pbegin = PIV.begin(), Pend = PIV.end();
|
||||
for(Pit = Pbegin; Pit != Pend; ++Pit)
|
||||
gv << this->geom_traits().construct_point_3_object()((*Pit)->first);
|
||||
|
||||
// Finite edges indices
|
||||
for(Finite_edges_iterator eit=finite_edges_begin(); eit!=finite_edges_end(); ++eit) {
|
||||
gv << 2
|
||||
<< P[point(eit->first, eit->second)]
|
||||
<< P[point(eit->first, eit->third)]
|
||||
<< "\n"; // without color
|
||||
// << 4 << drand48() << drand48() << drand48() << 1.0; // random color
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
// This function outputs the facets.
|
||||
template<class Dt,class EACT>
|
||||
void
|
||||
Alpha_shape_3<Dt,EACT>::
|
||||
show_alpha_shape_faces(Geomview_stream &gv) const
|
||||
{
|
||||
// To become unordered when CGAL's Point_3/Weighted_point_3 has a hash function
|
||||
typedef typename std::map<Point, int> PMap;
|
||||
|
||||
// Used to keep the insertion order in memory
|
||||
typedef typename std::vector<typename PMap::iterator> PMapIterVector;
|
||||
|
||||
typename Alpha_shape_3<Dt,EACT>::Alpha_shape_facets_iterator Flist_it,
|
||||
Flist_begin = Alpha_shape_facets_begin(),
|
||||
Flist_end = Alpha_shape_facets_end();
|
||||
|
||||
PMap P;
|
||||
PMapIterVector PIV;
|
||||
int number_of_points = 0;
|
||||
int number_of_facets = std::distance(Flist_begin, Flist_end);
|
||||
|
||||
for(Flist_it = Flist_begin; Flist_it != Flist_end; Flist_it++)
|
||||
{
|
||||
// Collect the points
|
||||
// Note that we cannot simply loop over the vertices using e.g.
|
||||
// Alpha_shape_vertices_begin() because v->point() might not always
|
||||
// be the correct point position (see periodic triangulations for example);
|
||||
// we must instead use tr.point(c,i)
|
||||
for(int i=0; i<4; i++)
|
||||
{
|
||||
if(i != Flist_it->second)
|
||||
{
|
||||
Point p = point(Flist_it->first, i);
|
||||
std::pair<typename PMap::iterator, bool> is_insert_successful =
|
||||
P.insert(std::make_pair(p, number_of_points));
|
||||
|
||||
if(is_insert_successful.second)
|
||||
{
|
||||
++number_of_points;
|
||||
PIV.push_back(is_insert_successful.first);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Header
|
||||
gv.set_binary_mode();
|
||||
gv << "(geometry " << gv.get_new_id("alpha_shape")
|
||||
<< " {appearance {}{ OFF BINARY\n"
|
||||
<< number_of_points << number_of_facets << 0;
|
||||
|
||||
std::cout << number_of_points << " " << number_of_facets << std::endl;
|
||||
|
||||
// Vertices
|
||||
typename PMapIterVector::iterator Pit, Pbegin = PIV.begin(), Pend = PIV.end();
|
||||
for(Pit = Pbegin; Pit != Pend; ++Pit)
|
||||
gv << this->geom_traits().construct_point_3_object()((*Pit)->first);
|
||||
|
||||
// Finite facets indices
|
||||
for(Flist_it = Flist_begin; Flist_it != Flist_end; Flist_it++)
|
||||
{
|
||||
gv << 3;
|
||||
for(int i=0; i<4; i++)
|
||||
if(i != Flist_it->second)
|
||||
gv << P[point(Flist_it->first, i)];
|
||||
gv << 0; // without color
|
||||
// gv << 4 << drand48() << drand48() << drand48() << 1.0; // random color
|
||||
}
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
template < class Dt,class EACT >
|
||||
Geomview_stream&
|
||||
operator<<(Geomview_stream &gv, Alpha_shape_3<Dt,EACT>& A)
|
||||
{
|
||||
bool ascii_bak = gv.get_ascii_mode();
|
||||
bool raw_bak = gv.set_raw(true);
|
||||
|
||||
if(gv.get_wired())
|
||||
A.show_triangulation_edges(gv);
|
||||
else
|
||||
A.show_alpha_shape_faces(gv);
|
||||
|
||||
// Footer
|
||||
gv << "}})";
|
||||
|
||||
gv.set_raw(raw_bak);
|
||||
gv.set_ascii_mode(ascii_bak);
|
||||
return gv;
|
||||
}
|
||||
|
||||
//-------------------------------------------------------------------
|
||||
} //namespace CGAL
|
||||
//-------------------------------------------------------------------
|
||||
|
||||
#endif // CGAL_IO_ALPHA_SHAPE_GEOMVIEW_OSTREAM_3_H
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
#include <CGAL/Polynomial_traits_d.h>
|
||||
#include <CGAL/polynomial_utils.h>
|
||||
|
||||
#include <boost/spirit/include/phoenix.hpp>
|
||||
#include <boost/phoenix.hpp>
|
||||
#include <boost/spirit/include/qi.hpp>
|
||||
|
||||
#include "AlgebraicCurveParser.h"
|
||||
|
|
|
|||
|
|
@ -2213,11 +2213,9 @@ vertex and the remaining one is vertical.
|
|||
\cgalFigureBegin{aos_fig-bounded_vd,bounded_vertical_decomposition.png}
|
||||
An arrangement of four line segments and its vertical decomposition
|
||||
into pseudo trapezoids, as constructed in \ref
|
||||
Arrangement_on_surface_2/bounded_vertical_decomposition.cpp. The
|
||||
segments of \f$\mathcal{S}_1\f$ are drawn in solid lines and the
|
||||
segments of \f$\mathcal{S}_2\f$ are drawn in dark dashed lines. Note
|
||||
that the segment \f$ s\f$ (light dashed line) overlaps one of the
|
||||
segments in \f$\mathcal{S}_1\f$.
|
||||
Arrangement_on_surface_2/bounded_vertical_decomposition.cpp. The
|
||||
segments of the arrangement are drawn in solid blue lines and the
|
||||
segments of the vertical decomposition are drawn in dark dotted lines.
|
||||
\cgalFigureEnd
|
||||
<!-- ------------------------------------------------------------------------- -->
|
||||
|
||||
|
|
@ -3529,6 +3527,29 @@ an \f$x\f$-monotone curve connecting \f$p_1\f$ and \f$p_2\f$.
|
|||
Most traits classes model the `ArrangementTraits_2` concept, and some
|
||||
also model the `ArrangementLandmarkTraits_2` concept.
|
||||
|
||||
<!-- ------------------------------------------------------------------------- -->
|
||||
\subsubsection aos_sssec-tr_additional_concepts The Construct Curve Concept
|
||||
<!-- ------------------------------------------------------------------------- -->
|
||||
|
||||
The concept `ArrangementConstructCurveTraits_2` refines the concept
|
||||
`ArrangementTraits_2`. A model of the
|
||||
`ArrangementConstructCurveTraits_2` concept must support the operation
|
||||
below (in addition to fulfilling the requirements listed by the
|
||||
`ArrangementTraits_2` concept).
|
||||
|
||||
<DL>
|
||||
<DT>\link ArrangementConstructCurveTraits_2::Construct_curve_2 <B>`Construct_curve_2`</B>\endlink:
|
||||
<DD> Given two points \f$p_1\f$ and \f$p_2\f$, construct
|
||||
a curve connecting \f$p_1\f$ and \f$p_2\f$.
|
||||
</DL>
|
||||
|
||||
The `Arr_polyline_traits_2<SubcurveTraits_2>` class template handles
|
||||
polylines; see Section ~\ref arr_sssectr_polylines.
|
||||
The type that substitutes the template parameter `SubcurveTraits_2`
|
||||
when `Arr_polyline_traits_2<SubcurveTraits_2>` is instantiated must be
|
||||
a geometry-traits class that models the concept `ArrangementConstructCurveTraits_2`
|
||||
to enable the construction of polylines from a sequence of two or more points.
|
||||
|
||||
<!-- ------------------------------------------------------------------------- -->
|
||||
\subsubsection aos_ssec-traits-curved Supporting Unbounded Curves or Curved Surfaces
|
||||
<!-- ------------------------------------------------------------------------- -->
|
||||
|
|
@ -4208,18 +4229,19 @@ arr_sssectr_polycurves.
|
|||
<!-- ------------------------------------------------------------------------- -->
|
||||
|
||||
The `Arr_polyline_traits_2<SubcurveTraits_2>` class template handles
|
||||
polylines. It models the following three concepts:
|
||||
polylines. It models the following four concepts:
|
||||
|
||||
- `ArrangementTraits_2`,
|
||||
|
||||
- `ArrangementDirectionalXMonotoneTraits_2`, and
|
||||
- `ArrangementDirectionalXMonotoneTraits_2`
|
||||
|
||||
- `ArrangementConstructXMonotoneCurveTraits_2`; see Package \ref
|
||||
PkgBooleanSetOperations2Ref.
|
||||
- `ArrangementConstructXMonotoneCurveTraits_2`, and
|
||||
|
||||
- `ArrangementConstructCurveTraits_2`.
|
||||
|
||||
The type that substitutes the template parameter `SubcurveTraits_2`
|
||||
when `Arr_polyline_traits_2<SubcurveTraits_2>` is instantiated must be
|
||||
a geometry-traits class that models the same three concepts. We refer
|
||||
a geometry-traits class that models the same four concepts. We refer
|
||||
to the type that substitutes the template parameter `SubcurveTraits_2`
|
||||
as the <em>subcurve traits</em> hereafter. If, in addition, the
|
||||
subcurve traits also models the concept
|
||||
|
|
@ -4383,7 +4405,6 @@ typedef CGAL::Arrangement_2<Traits> Arrangement;
|
|||
\paragraph arr_sssectr_polycurves The Polycurve Traits Class
|
||||
<!-- ------------------------------------------------------------------------- -->
|
||||
|
||||
<!--
|
||||
The traits class `Arr_polycurve_traits_2<SubcurveTraits_2>` handles
|
||||
piecewise curves that are not necessarily linear, such as conic arcs,
|
||||
circular arcs, Bézier curves, or line segments. We call such a
|
||||
|
|
@ -4394,13 +4415,13 @@ is continuous. As a matter of fact, most characteristics of the
|
|||
`Arr_polyline_traits_2<SubcurveTraits_2>` traits class template apply
|
||||
also to the `Arr_polycurve_traits_2<SubcurveTraits_2>` traits class
|
||||
template. The only difference between the two, is that the latter is
|
||||
not a model of the concept
|
||||
`ArrangementConstructXMonotoneCurveTraits_2`, and as such, it is not
|
||||
not a model of the concepts
|
||||
`ArrangementConstructXMonotoneCurveTraits_2` nor
|
||||
`ArrangementConstructCurveTraits_2`, and as such, it is not
|
||||
able to construct a subcurve from only two points. As a consequence,
|
||||
it does not support the operations that (i) construct a polycurve from
|
||||
a sequence of points, and (ii) push a point at the back or at the
|
||||
front of a non-empty polycurve.
|
||||
-->
|
||||
|
||||
<!-- ------------------------------------------------------------------------- -->
|
||||
\subsubsection arr_ssectr_algebraic Traits Classes for Algebraic Curves
|
||||
|
|
|
|||
|
|
@ -448,8 +448,6 @@ namespace CGAL {
|
|||
/*! \deprecated
|
||||
* Add a new point to the polycurvs, which becomes the new target point
|
||||
* of `pi`.
|
||||
* \pre SubcurveTraits_2 is a model of
|
||||
* ArrangementConstructXMonotoneCurveTraits_2.
|
||||
*/
|
||||
void push_back(const Point_2 & p);
|
||||
|
||||
|
|
|
|||
|
|
@ -32,7 +32,8 @@ namespace CGAL {
|
|||
* of the concepts
|
||||
* - `ArrangementTraits_2`,
|
||||
* - `ArrangementDirectionalXMonotoneTraits_2`,
|
||||
* - `ArrangementConstructXMonotoneCurveTraits_2`.
|
||||
* - `ArrangementConstructXMonotoneCurveTraits_2`,
|
||||
* - `ArrangementConstructCurveTraits_2`.
|
||||
*
|
||||
* If, in addition, the GeometryTraits_2 models the concept
|
||||
* `ArrangementApproximateTraits_2` then `Arr_polycurve_traits_2` models
|
||||
|
|
@ -79,6 +80,7 @@ namespace CGAL {
|
|||
* \cgalModels `ArrangementTraits_2`
|
||||
* \cgalModels `ArrangementDirectionalXMonotoneTraits_2`
|
||||
* \cgalModels `ArrangementConstructXMonotoneCurveTraits_2`
|
||||
* \cgalModels `ArrangementConstructCurveTraits_2`
|
||||
* \cgalModels `ArrangementApproximateTraits_2` (if the type that substitutes
|
||||
* the template parameter `SegmentTraits_2` models the concept as well)
|
||||
*
|
||||
|
|
|
|||
|
|
@ -0,0 +1,26 @@
|
|||
namespace ArrTraits {
|
||||
|
||||
/*! \ingroup PkgArrangementOnSurface2ConceptsFunctionObjects
|
||||
* \cgalConcept
|
||||
*
|
||||
* \cgalRefines Functor
|
||||
*
|
||||
* \cgalHasModel ArrangementConstructCurveTraits_2::Construct_curve_2
|
||||
*/
|
||||
class ConstructCurve_2 {
|
||||
public:
|
||||
|
||||
/// \name Operations
|
||||
/// A model of this concept must provide:
|
||||
/// @{
|
||||
|
||||
/*! returns a curve connecting `p1` and `p2` (i.e., the
|
||||
* two input points are its endpoints).
|
||||
*/
|
||||
ArrTraits::Curve_2 operator()(ArrTraits::Point_2 p1, ArrTraits::Point_2 p2);
|
||||
|
||||
/// @}
|
||||
|
||||
}; /* end ArrTraits::ConstructCurve_2 */
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
/*! \ingroup PkgArrangementOnSurface2ConceptsTraits
|
||||
* \cgalConcept
|
||||
*
|
||||
* The concept `ArrangementConstructCurveTraits_2` refines the basic
|
||||
* traits concept `ArrangementBasicTraits_2`. A model of this concept is able
|
||||
* to construct a curve from two points.
|
||||
*
|
||||
* \cgalRefines `ArrangementTraits_2`
|
||||
*
|
||||
* \cgalHasModel `CGAL::Arr_conic_traits_2<RatKernel,AlgKernel,NtTraits>`
|
||||
* \cgalHasModel `CGAL::Arr_geodesic_arc_on_sphere_traits_2`
|
||||
* \cgalHasModel `CGAL::Arr_linear_traits_2<Kernel>`
|
||||
* \cgalHasModel `CGAL::Arr_non_caching_segment_traits_2<Kernel>`
|
||||
* \cgalHasModel `CGAL::Arr_segment_traits_2<Kernel>`
|
||||
* \cgalHasModel `CGAL::Arr_polyline_traits_2<SegmentTraits_2>`
|
||||
* \cgalHasModel `CGAL::Arr_rational_function_traits_2<AlgebraicKernel_d_1>`
|
||||
*
|
||||
* \sa `ArrangementConstructXMonotoneCurveTraits_2`, and
|
||||
* `ArrangementTraits_2`
|
||||
*/
|
||||
class ArrangementConstructCurveTraits_2 {
|
||||
public:
|
||||
/// \name Functor Types
|
||||
/// @{
|
||||
|
||||
/*! models the concept `ArrTraits::ConstructCurve_2`.
|
||||
*/
|
||||
typedef unspecified_type Construct_curve_2;
|
||||
|
||||
/// @}
|
||||
|
||||
/// \name Accessing Functor Objects
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
*/
|
||||
Construct_curve_2 construct_curve_2_object() const;
|
||||
|
||||
/// @}
|
||||
};
|
||||
|
|
@ -16,8 +16,9 @@
|
|||
* \cgalHasModel `CGAL::Arr_rational_function_traits_2<AlgebraicKernel_d_1>`
|
||||
*
|
||||
* \sa `ArrangementApproximateTraits_2`,
|
||||
* `ArrangementXMonotoneTraits_2`, and
|
||||
* `ArrangementTraits_2`
|
||||
* `ArrangementXMonotoneTraits_2`
|
||||
* `ArrangementTraits_2`, and
|
||||
* `ArrangementConstructCurveTraits_2`.
|
||||
*/
|
||||
class ArrangementConstructXMonotoneCurveTraits_2 {
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -117,6 +117,7 @@ implemented as peripheral classes or as free (global) functions.
|
|||
- `ArrangementBasicTopologyTraits`
|
||||
- `ArrangementBasicTraits_2`
|
||||
- `ArrangementConstructXMonotoneCurveTraits_2`
|
||||
- `ArrangementConstructCurveTraits_2`
|
||||
- `ArrangementLandmarkTraits_2`
|
||||
- `ArrangementXMonotoneTraits_2`
|
||||
- `ArrangementTraits_2`
|
||||
|
|
@ -183,6 +184,7 @@ implemented as peripheral classes or as free (global) functions.
|
|||
- `ArrTraits::MakeXMonotone_2`
|
||||
- `ArrTraits::Approximate_2`
|
||||
- `ArrTraits::ConstructXMonotoneCurve_2`
|
||||
- `ArrTraits::ConstructCurve_2`
|
||||
|
||||
\cgalCRPSection{Classes}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
// Constructing an arrangement of algebraic segments.
|
||||
|
||||
#include <iostream>
|
||||
#include <cassert>
|
||||
#include <CGAL/config.h>
|
||||
|
||||
#if (!CGAL_USE_CORE) && (!CGAL_USE_LEDA) && (!(CGAL_USE_GMP && CGAL_USE_MPFI))
|
||||
|
|
@ -52,7 +53,7 @@ int main() {
|
|||
std::vector<X_monotone_curve> segs;
|
||||
for(size_t i = 0; i < pre_segs.size(); ++i) {
|
||||
auto* curr_p = boost::get<X_monotone_curve>(&pre_segs[i]);
|
||||
CGAL_assertion(curr_p);
|
||||
assert(curr_p);
|
||||
segs.push_back(*curr_p);
|
||||
}
|
||||
// Construct an ellipse (C2) with the equation 2*x^2+5*y^2-7=0.
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ int main() {
|
|||
// with (-3, 4) and (4, 3) as its endpoints. We want the arc to be
|
||||
// clockwise-oriented, so it passes through (0, 5) as well.
|
||||
Conic_arc c4(Rat_point(-3, 4), Rat_point(0, 5), Rat_point(4, 3));
|
||||
CGAL_assertion(c4.is_valid());
|
||||
|
||||
insert(arr, c4);
|
||||
|
||||
// Insert a full unit circle (C5) that is centered at (0, 4).
|
||||
|
|
@ -46,7 +46,7 @@ int main() {
|
|||
0, 0, 0, 0, 1, 3, // the line: y = -3.
|
||||
Point(1.41, -2), // approximation of the target.
|
||||
0, 0, 0, 0, 1, 2); // the line: y = -2.
|
||||
CGAL_assertion(c6.is_valid());
|
||||
|
||||
insert(arr, c6);
|
||||
|
||||
// Insert the right half of the circle centered at (4, 2.5) whose radius
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
// using the arrangement of the dual lines.
|
||||
|
||||
#include <cstdlib>
|
||||
#include <cassert>
|
||||
|
||||
#include "arr_linear.h"
|
||||
#include "read_objects.h"
|
||||
|
|
@ -74,7 +75,7 @@ int main(int argc, char* argv[]) {
|
|||
break;
|
||||
}
|
||||
}
|
||||
CGAL_assertion(found_collinear);
|
||||
assert(found_collinear);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ int main() {
|
|||
const Point q{_7_halves, 7};
|
||||
Point_location::result_type obj = pl.locate(q);
|
||||
auto* e = boost::get<Arr_with_hist::Halfedge_const_handle>(&obj);
|
||||
CGAL_assertion(e);
|
||||
|
||||
// Split the edge e to two edges e1 and e2;
|
||||
auto e1 = arr.split_edge(arr.non_const_handle(*e), q);
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
//! \file examples/Arrangement_on_surface_2/face_extension_overlay.cpp
|
||||
// A face overlay of two arrangements with extended face records.
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include <CGAL/basic.h>
|
||||
#include <CGAL/Arr_overlay_2.h>
|
||||
#include <CGAL/Arr_default_overlay_traits.h>
|
||||
|
|
@ -21,7 +23,8 @@ int main() {
|
|||
insert_non_intersecting_curve(arr1, Segment(Point(6, 2), Point(6, 6)));
|
||||
insert_non_intersecting_curve(arr1, Segment(Point(6, 6), Point(2, 6)));
|
||||
insert_non_intersecting_curve(arr1, Segment(Point(2, 6), Point(2, 2)));
|
||||
CGAL_assertion(arr1.number_of_faces() == 2);
|
||||
// 2 because the bounded and the unbounded one
|
||||
assert(arr1.number_of_faces() == 2);
|
||||
|
||||
// Mark just the bounded face.
|
||||
for (auto fit = arr1.faces_begin(); fit != arr1.faces_end(); ++fit)
|
||||
|
|
@ -33,7 +36,6 @@ int main() {
|
|||
insert_non_intersecting_curve(arr2, Segment(Point(7, 4), Point(4, 7)));
|
||||
insert_non_intersecting_curve(arr2, Segment(Point(4, 7), Point(1, 4)));
|
||||
insert_non_intersecting_curve(arr2, Segment(Point(1, 4), Point(4, 1)));
|
||||
CGAL_assertion(arr2.number_of_faces() == 2);
|
||||
|
||||
for (auto fit = arr2.faces_begin(); fit != arr2.faces_end(); ++fit)
|
||||
fit->set_data(fit != arr2.unbounded_face()); // mark the bounded face.
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ int main() {
|
|||
Point q(4, 1);
|
||||
auto obj = pl.locate(q);
|
||||
auto* f = boost::get<Arrangement::Face_const_handle>(&obj);
|
||||
CGAL_assertion(f != nullptr);
|
||||
|
||||
std::cout << "The query point (" << q << ") is located in: ";
|
||||
print_face<Arrangement>(*f);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
//! \file examples/Arrangement_on_surface_2/overlay_color.cpp
|
||||
// The overlay of two arrangement with extended dcel structures
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include <CGAL/basic.h>
|
||||
#include <CGAL/Arr_extended_dcel.h>
|
||||
#include <CGAL/Arr_overlay_2.h>
|
||||
|
|
@ -25,7 +27,7 @@ int main() {
|
|||
insert(arr1, Segment(Point(0, 0), Point(0, 4)));
|
||||
insert(arr1, Segment(Point(2, 0), Point(2, 4)));
|
||||
insert(arr1, Segment(Point(4, 0), Point(4, 4)));
|
||||
CGAL_assertion(arr1.number_of_faces() == 5);
|
||||
assert(arr1.number_of_faces() == 5);
|
||||
for (auto vit = arr1.vertices_begin(); vit != arr1.vertices_end(); ++vit)
|
||||
vit->set_data(vcol1);
|
||||
for (auto hit = arr1.halfedges_begin(); hit != arr1.halfedges_end(); ++hit)
|
||||
|
|
@ -41,7 +43,7 @@ int main() {
|
|||
insert(arr2, Segment(Point(0, 0), Point(0, 6)));
|
||||
insert(arr2, Segment(Point(3, 0), Point(3, 6)));
|
||||
insert(arr2, Segment(Point(6, 0), Point(6, 6)));
|
||||
CGAL_assertion(arr2.number_of_faces() == 5);
|
||||
assert(arr2.number_of_faces() == 5);
|
||||
for (auto vit = arr2.vertices_begin(); vit != arr2.vertices_end(); ++vit)
|
||||
vit->set_data(vcol2);
|
||||
for (auto hit = arr2.halfedges_begin(); hit != arr2.halfedges_end(); ++hit)
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
#include <cassert>
|
||||
#include <CGAL/Arr_point_location_result.h>
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
@ -106,7 +107,7 @@ void shoot_vertical_ray(const VerticalRayShooting& vrs,
|
|||
else if ((e = boost::get<Halfedge_const_handle>(&obj)) ) // hit an edge
|
||||
std::cout << "an edge: " << (*e)->curve() << std::endl;
|
||||
else if ((f = boost::get<Face_const_handle>(&obj))) { // hit nothing
|
||||
CGAL_assertion((*f)->is_unbounded());
|
||||
assert((*f)->is_unbounded());
|
||||
std::cout << "nothing." << std::endl;
|
||||
}
|
||||
else CGAL_error_msg("Invalid object.");
|
||||
|
|
|
|||
|
|
@ -59,7 +59,6 @@ int main() {
|
|||
std::vector<Make_x_monotone_result> obj_vector;
|
||||
bezier_traits.make_x_monotone_2_object()(B, std::back_inserter(obj_vector));
|
||||
auto* x_seg_p = boost::get<Bezier_x_monotone_curve>(&obj_vector[0]);
|
||||
CGAL_assertion(x_seg_p);
|
||||
x_curves.push_back(*x_seg_p);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
// #define CGAL_ARRANGEMENT_ON_SURFACE_INSERT_VERBOSE 1
|
||||
// #define CGAL_ARR_CONSTRUCTION_SL_VISITOR_VERBOSE 1
|
||||
|
||||
#include <cassert>
|
||||
#include <vector>
|
||||
|
||||
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
|
||||
|
|
@ -57,26 +58,26 @@ int main() {
|
|||
X_monotone_curve_2 xcv_sp1 = ctr_xcv(sp, p1);
|
||||
X_monotone_curve_2 xcv_sp2 = ctr_xcv(sp, p2);
|
||||
X_monotone_curve_2 xcv_sp3 = ctr_xcv(sp, p3);
|
||||
CGAL_assertion(xcv_sp1.is_vertical());
|
||||
CGAL_assertion(xcv_sp2.is_vertical());
|
||||
CGAL_assertion(xcv_sp3.is_vertical());
|
||||
assert(xcv_sp1.is_vertical());
|
||||
assert(xcv_sp2.is_vertical());
|
||||
assert(xcv_sp3.is_vertical());
|
||||
xcvs.push_back(xcv_sp1); // 0
|
||||
xcvs.push_back(xcv_sp2); // 1
|
||||
xcvs.push_back(xcv_sp3); // 2
|
||||
|
||||
X_monotone_curve_2 xcv_12 = ctr_xcv(p1, p2);
|
||||
X_monotone_curve_2 xcv_23 = ctr_xcv(p2, p3);
|
||||
CGAL_assertion(!xcv_12.is_vertical());
|
||||
CGAL_assertion(!xcv_23.is_vertical());
|
||||
assert(!xcv_12.is_vertical());
|
||||
assert(!xcv_23.is_vertical());
|
||||
xcvs.push_back(xcv_12); // 3
|
||||
xcvs.push_back(xcv_23); // 4
|
||||
|
||||
X_monotone_curve_2 xcv_np1 = ctr_xcv(np, p1);
|
||||
X_monotone_curve_2 xcv_np2 = ctr_xcv(np, p2);
|
||||
X_monotone_curve_2 xcv_np3 = ctr_xcv(np, p3);
|
||||
CGAL_assertion(xcv_np1.is_vertical());
|
||||
CGAL_assertion(xcv_np2.is_vertical());
|
||||
CGAL_assertion(xcv_np3.is_vertical());
|
||||
assert(xcv_np1.is_vertical());
|
||||
assert(xcv_np2.is_vertical());
|
||||
assert(xcv_np3.is_vertical());
|
||||
xcvs.push_back(xcv_np1); // 5
|
||||
xcvs.push_back(xcv_np2); // 6
|
||||
xcvs.push_back(xcv_np3); // 7
|
||||
|
|
|
|||
|
|
@ -1,13 +1,15 @@
|
|||
#ifndef IS_IN_X_RANGE_H
|
||||
#define IS_IN_X_RANGE_H
|
||||
|
||||
#include <cassert>
|
||||
|
||||
// Check whether the given point is in the x-range of the given curve that
|
||||
// represents a great-circle arc.
|
||||
template <typename GeometryTraits>
|
||||
bool is_in_x_range(const typename GeometryTraits::X_monotone_curve_2& c,
|
||||
const typename GeometryTraits::Point_2& p,
|
||||
const GeometryTraits& traits) {
|
||||
CGAL_assertion(! traits.is_on_y_identification_2_object()(p));
|
||||
assert(! traits.is_on_y_identification_2_object()(p));
|
||||
|
||||
if (traits.is_on_y_identification_2_object()(c)) return false;
|
||||
|
||||
|
|
|
|||
|
|
@ -45,7 +45,6 @@ int main() {
|
|||
if (vh) std::cout << '(' << (*vh)->point() << ')';
|
||||
else {
|
||||
auto* hh = boost::get<Halfedge_const_handle>(&*(curr.first));
|
||||
CGAL_assertion(hh);
|
||||
if (! (*hh)->is_fictitious())
|
||||
std::cout << '[' << (*hh)->curve() << ']';
|
||||
else std::cout << "NONE";
|
||||
|
|
@ -59,7 +58,6 @@ int main() {
|
|||
if (vh) std::cout << '(' << (*vh)->point() << ")\n";
|
||||
else {
|
||||
auto* hh = boost::get<Halfedge_const_handle>(&*(curr.second));
|
||||
CGAL_assertion(hh);
|
||||
if (! (*hh)->is_fictitious())
|
||||
std::cout << '[' << (*hh)->curve() << "]\n";
|
||||
else std::cout << "NONE\n";
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@
|
|||
// Constructing an arrangement of unbounded linear objects using the insertion
|
||||
// function for non-intersecting curves.
|
||||
|
||||
#include <cassert>
|
||||
|
||||
#include "arr_linear.h"
|
||||
#include "arr_print.h"
|
||||
|
||||
|
|
@ -13,7 +15,7 @@ int main() {
|
|||
X_monotone_curve c1 = Line(Point(-1, 0), Point(1, 0));
|
||||
arr.insert_in_face_interior(c1, arr.unbounded_face());
|
||||
Vertex_handle v = insert_point(arr, Point(0,0));
|
||||
CGAL_assertion(! v->is_at_open_boundary());
|
||||
assert(! v->is_at_open_boundary());
|
||||
|
||||
// Add two more rays using the specialized insertion functions.
|
||||
arr.insert_from_right_vertex(Ray(Point(0, 0), Point(-1, 1)), v); // c2
|
||||
|
|
|
|||
|
|
@ -723,29 +723,39 @@ public:
|
|||
return Approximate_2();
|
||||
}
|
||||
|
||||
class Construct_x_monotone_curve_2
|
||||
{
|
||||
//! Functor
|
||||
class Construct_x_monotone_curve_2 {
|
||||
public:
|
||||
|
||||
/*!
|
||||
* Return an x-monotone curve connecting the two given endpoints.
|
||||
/*! Return an x-monotone curve connecting the two given endpoints.
|
||||
* \param p The first point.
|
||||
* \param q The second point.
|
||||
* \pre p and q must not be the same.
|
||||
* \return A segment connecting p and q.
|
||||
*/
|
||||
X_monotone_curve_2 operator() (const Point_2& p,
|
||||
const Point_2& q) const
|
||||
{
|
||||
return (X_monotone_curve_2 (p, q));
|
||||
}
|
||||
X_monotone_curve_2 operator()(const Point_2& p, const Point_2& q) const
|
||||
{ return (X_monotone_curve_2(p, q)); }
|
||||
};
|
||||
|
||||
/*! Get a Construct_x_monotone_curve_2 functor object. */
|
||||
Construct_x_monotone_curve_2 construct_x_monotone_curve_2_object () const
|
||||
{
|
||||
return Construct_x_monotone_curve_2();
|
||||
}
|
||||
{ return Construct_x_monotone_curve_2(); }
|
||||
|
||||
//! Functor
|
||||
class Construct_curve_2 {
|
||||
public:
|
||||
/*! Return a curve connecting the two given endpoints.
|
||||
* \param p The first point.
|
||||
* \param q The second point.
|
||||
* \pre p and q must not be the same.
|
||||
* \return A segment connecting p and q.
|
||||
*/
|
||||
Curve_2 operator()(const Point_2& p, const Point_2& q) const
|
||||
{ return (Curve_2(p, q)); }
|
||||
};
|
||||
|
||||
/*! Get a Construct_curve_2 functor object. */
|
||||
Construct_curve_2 construct_curve_2_object () const
|
||||
{ return Construct_curve_2(); }
|
||||
//@}
|
||||
|
||||
/// \name Functor definitions for the Boolean set-operation traits.
|
||||
|
|
|
|||
|
|
@ -1663,7 +1663,8 @@ public:
|
|||
* Once we do a better dispatching of the functors (LR-ident + TB-contraction),
|
||||
* an implementation of this signature becomes obsolete.
|
||||
*/
|
||||
Comparison_result operator()(const Point_2& p1, const Point_2& p2) const
|
||||
Comparison_result operator()(const Point_2& /* p1 */,
|
||||
const Point_2& /* p2 */) const
|
||||
{
|
||||
CGAL_error(); return EQUAL;
|
||||
}
|
||||
|
|
@ -3106,40 +3107,6 @@ public:
|
|||
return (*this);
|
||||
}
|
||||
|
||||
/*! Construct the minor arc from two endpoint directions. The minor arc
|
||||
* is the one with the smaller angle among the two geodesic arcs with
|
||||
* the given endpoints.
|
||||
* 1. Find out whether the arc is x-monotone.
|
||||
* 2. If it is x-monotone,
|
||||
* 2.1 Find out whether it is vertical, and
|
||||
* 2.2 whether the target is larger than the source (directed right).
|
||||
* The arc is vertical, iff
|
||||
* 1. one of its endpoint direction pierces a pole, or
|
||||
* 2. the projections onto the xy-plane coincide.
|
||||
* \param source the source point.
|
||||
* \param target the target point.
|
||||
* \pre the source and target cannot be equal.
|
||||
* \pre the source and target cannot be antipodal.
|
||||
*/
|
||||
Arr_x_monotone_geodesic_arc_on_sphere_3
|
||||
(const Arr_extended_direction_3& source,
|
||||
const Arr_extended_direction_3& target) :
|
||||
m_source(source),
|
||||
m_target(target),
|
||||
m_is_full(false),
|
||||
m_is_degenerate(false),
|
||||
m_is_empty(false)
|
||||
{
|
||||
// MSVC 10 complains when the casting below is not present probably due
|
||||
// to a bug (in MSVC 10).
|
||||
CGAL_precondition_code(Kernel kernel);
|
||||
CGAL_precondition(!kernel.equal_3_object()
|
||||
(kernel.construct_opposite_direction_3_object()(m_source),
|
||||
(const typename Kernel::Direction_3&)(m_target)));
|
||||
m_normal = construct_normal_3(m_source, m_target);
|
||||
init();
|
||||
}
|
||||
|
||||
/*! Initialize a spherical_arc given that the two endpoint directions
|
||||
* have been set. It is assumed that the arc is the one with the smaller
|
||||
* angle among the two.
|
||||
|
|
@ -3530,109 +3497,6 @@ public:
|
|||
CGAL_precondition(this->has_on(trg));
|
||||
}
|
||||
|
||||
/*! Construct a spherical_arc from two endpoint directions. It is assumed
|
||||
* that the arc is the one with the smaller angle among the two.
|
||||
* 1. Find out whether the arc is x-monotone.
|
||||
* 2. If it is x-monotone,
|
||||
* 2.1 Find out whether it is vertical, and
|
||||
* 2.2 whether the target is larger than the source (directed right).
|
||||
* The arc is vertical, iff
|
||||
* 1. one of its endpoint direction pierces a pole, or
|
||||
* 2. the projections onto the xy-plane coincide.
|
||||
* \param source the source point.
|
||||
* \param target the target point.
|
||||
* \pre the source and target cannot be equal.
|
||||
* \pre the source and target cannot be the opoosite of each other.
|
||||
*/
|
||||
Arr_geodesic_arc_on_sphere_3(const Arr_extended_direction_3& source,
|
||||
const Arr_extended_direction_3& target)
|
||||
{
|
||||
this->set_source(source);
|
||||
this->set_target(target);
|
||||
this->set_is_full(false);
|
||||
this->set_is_degenerate(false);
|
||||
this->set_is_empty(false);
|
||||
|
||||
typedef Arr_geodesic_arc_on_sphere_traits_2<Kernel> Traits;
|
||||
typedef typename Kernel::Direction_2 Direction_2;
|
||||
typedef typename Kernel::Direction_3 Direction_3;
|
||||
|
||||
Kernel kernel;
|
||||
CGAL_precondition(!kernel.equal_3_object()(Direction_3(source),
|
||||
Direction_3(target)));
|
||||
CGAL_precondition(!kernel.equal_3_object()
|
||||
(kernel.construct_opposite_direction_3_object()(source),
|
||||
static_cast<const Direction_3&>(target)));
|
||||
this->m_normal = this->construct_normal_3(source, target);
|
||||
|
||||
// Check whether one of the endpoints coincides with a pole: */
|
||||
if (source.is_max_boundary()) {
|
||||
this->set_is_vertical(true);
|
||||
this->set_is_directed_right(false);
|
||||
set_is_x_monotone(true);
|
||||
return;
|
||||
}
|
||||
if (source.is_min_boundary()) {
|
||||
this->set_is_vertical(true);
|
||||
this->set_is_directed_right(true);
|
||||
set_is_x_monotone(true);
|
||||
return;
|
||||
}
|
||||
if (target.is_max_boundary()) {
|
||||
this->set_is_vertical(true);
|
||||
this->set_is_directed_right(true);
|
||||
set_is_x_monotone(true);
|
||||
return;
|
||||
}
|
||||
if (target.is_min_boundary()) {
|
||||
this->set_is_vertical(true);
|
||||
this->set_is_directed_right(false);
|
||||
set_is_x_monotone(true);
|
||||
return;
|
||||
}
|
||||
|
||||
// None of the enpoints coincide with a pole:
|
||||
Direction_3 normal = this->m_normal;
|
||||
if (z_sign(normal) == ZERO) {
|
||||
// The arc is vertical
|
||||
this->set_is_vertical(true);
|
||||
bool s_is_positive, t_is_positive, plane_is_positive;
|
||||
CGAL::Sign xsign = x_sign(normal);
|
||||
if (xsign == ZERO) {
|
||||
s_is_positive = x_sign(source) == POSITIVE;
|
||||
t_is_positive = x_sign(target) == POSITIVE;
|
||||
plane_is_positive = y_sign(normal) == NEGATIVE;
|
||||
} else {
|
||||
s_is_positive = y_sign(source) == POSITIVE;
|
||||
t_is_positive = y_sign(target) == POSITIVE;
|
||||
plane_is_positive = xsign == POSITIVE;
|
||||
}
|
||||
set_is_x_monotone(s_is_positive == t_is_positive);
|
||||
bool ccw = ((plane_is_positive && s_is_positive) ||
|
||||
(!plane_is_positive && !s_is_positive));
|
||||
this->set_is_directed_right(ccw);
|
||||
return;
|
||||
}
|
||||
|
||||
// The arc is not vertical!
|
||||
this->set_is_vertical(false);
|
||||
Direction_2 s = Traits::project_xy(source);
|
||||
Direction_2 t = Traits::project_xy(target);
|
||||
Orientation orient = Traits::orientation(s, t);
|
||||
|
||||
const Direction_2& d = Traits::identification_xy();
|
||||
if (orient == LEFT_TURN) {
|
||||
this->set_is_directed_right(true);
|
||||
set_is_x_monotone(!kernel.counterclockwise_in_between_2_object()(d, s, t));
|
||||
return;
|
||||
}
|
||||
|
||||
// (orient == RIGHT_TURN)
|
||||
this->set_is_directed_right(false);
|
||||
set_is_x_monotone(!kernel.counterclockwise_in_between_2_object()(d, t, s));
|
||||
return;
|
||||
}
|
||||
|
||||
/*! Construct a spherical_arc from two endpoint directions contained
|
||||
* in a plane.
|
||||
* \param plane the containing plane.
|
||||
|
|
|
|||
|
|
@ -199,6 +199,35 @@ public:
|
|||
_set (rat_coeffs);
|
||||
}
|
||||
|
||||
/*! Construct a segment conic arc from two endpoints.
|
||||
* \param source the source point with rational coordinates.
|
||||
*/
|
||||
_Conic_arc_2(const Point_2& source, const Point_2& target) :
|
||||
_orient (COLLINEAR),
|
||||
_info(static_cast<int>(IS_VALID)),
|
||||
_source(source),
|
||||
_target(target),
|
||||
_extra_data_P(nullptr)
|
||||
{
|
||||
CGAL_precondition(Alg_kernel().compare_xy_2_object()(_source, _target) !=
|
||||
EQUAL);
|
||||
|
||||
// Compose the equation of the underlying line.
|
||||
const Algebraic x1 = source.x();
|
||||
const Algebraic y1 = source.y();
|
||||
const Algebraic x2 = target.x();
|
||||
const Algebraic y2 = target.y();
|
||||
|
||||
// The supporting line is A*x + B*y + C = 0, where:
|
||||
// A = y2 - y1, B = x1 - x2, C = x2*y1 - x1*y2
|
||||
// We use the extra data field to store the equation of this line.
|
||||
_extra_data_P = new Extra_data;
|
||||
_extra_data_P->a = y2 - y1;
|
||||
_extra_data_P->b = x1 - x2;
|
||||
_extra_data_P->c = x2*y1 - x1*y2;
|
||||
_extra_data_P->side = ZERO;
|
||||
}
|
||||
|
||||
/*!
|
||||
* Construct a conic arc from the given line segment.
|
||||
* \param seg The line segment with rational endpoints.
|
||||
|
|
@ -325,7 +354,7 @@ public:
|
|||
// and it squared radius is R^2, that its equation is:
|
||||
// x^2 + y^2 - 2*x0*x - 2*y0*y + (x0^2 + y0^2 - R^2) = 0
|
||||
// Since this equation describes a curve with a negative (clockwise)
|
||||
// orientation, we multiply it by -1 if necessary to obtain a positive
|
||||
// orientation, we multiply it by -1 if nece_Conic_arc_2 ssary to obtain a positive
|
||||
// (counterclockwise) orientation.
|
||||
const Rational _zero (0);
|
||||
Rational rat_coeffs[6];
|
||||
|
|
|
|||
|
|
@ -177,58 +177,27 @@ public:
|
|||
_set();
|
||||
}
|
||||
|
||||
/*!
|
||||
* Construct a special segment connecting to given endpoints (for the usage
|
||||
/*! Construct a special segment connecting to given endpoints (for the usage
|
||||
* of the landmarks point-location strategy).
|
||||
* \param source The source point.
|
||||
* \param target The target point.
|
||||
*/
|
||||
_Conic_x_monotone_arc_2(const Point_2& source, const Point_2& target) :
|
||||
Base()
|
||||
Base(source, target)
|
||||
{
|
||||
// Set the basic properties and clear the _info bits.
|
||||
this->_source = source;
|
||||
this->_target = target;
|
||||
this->_orient = COLLINEAR;
|
||||
this->_info = 0;
|
||||
this->_info |= static_cast<int>(DEGREE_1);
|
||||
|
||||
// Check if the arc is directed right (the target is lexicographically
|
||||
// greater than the source point), or to the left.
|
||||
Alg_kernel ker;
|
||||
Comparison_result dir_res =
|
||||
ker.compare_xy_2_object()(this->_source, this->_target);
|
||||
|
||||
CGAL_precondition (dir_res != EQUAL);
|
||||
// Invalid arc:
|
||||
if (dir_res == EQUAL) return;
|
||||
|
||||
this->_info = (static_cast<int>(Conic_arc_2::IS_VALID) | static_cast<int>(DEGREE_1));
|
||||
if (dir_res == SMALLER)
|
||||
this->_info = (this->_info | IS_DIRECTED_RIGHT);
|
||||
|
||||
// Compose the equation of the underlying line.
|
||||
const Algebraic x1 = source.x(), y1 = source.y();
|
||||
const Algebraic x2 = target.x(), y2 = target.y();
|
||||
|
||||
// The supporting line is A*x + B*y + C = 0, where:
|
||||
//
|
||||
// A = y2 - y1, B = x1 - x2, C = x2*y1 - x1*y2
|
||||
//
|
||||
// We use the extra data field to store the equation of this line.
|
||||
this->_extra_data_P = new typename Base::Extra_data;
|
||||
this->_extra_data_P->a = y2 - y1;
|
||||
this->_extra_data_P->b = x1 - x2;
|
||||
this->_extra_data_P->c = x2*y1 - x1*y2;
|
||||
this->_extra_data_P->side = ZERO;
|
||||
auto cmp_xy = ker.compare_xy_2_object();
|
||||
Comparison_result dir_res = cmp_xy(this->_source, this->_target);
|
||||
if (dir_res == SMALLER) this->_info |= IS_DIRECTED_RIGHT;
|
||||
|
||||
// Check if the segment is vertical.
|
||||
if (CGAL::sign (this->_extra_data_P->b) == ZERO)
|
||||
this->_info = (this->_info | IS_VERTICAL_SEGMENT);
|
||||
if (CGAL::sign(this->_extra_data_P->b) == ZERO)
|
||||
this->_info |= IS_VERTICAL_SEGMENT;
|
||||
|
||||
// Mark that this is a special segment.
|
||||
this->_info = (this->_info | IS_SPECIAL_SEGMENT);
|
||||
|
||||
return;
|
||||
this->_info |= IS_SPECIAL_SEGMENT;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
@ -608,7 +577,7 @@ public:
|
|||
if (_has_same_supporting_conic (arc)) {
|
||||
if ((this->_info & FACING_UP) != 0 && (arc._info & FACING_DOWN) != 0)
|
||||
return LARGER;
|
||||
else if ((this->_info & FACING_DOWN)!= 0 && (arc._info & FACING_UP) != 0)
|
||||
else if ((this->_info & FACING_DOWN) != 0 && (arc._info & FACING_UP) != 0)
|
||||
return SMALLER;
|
||||
|
||||
// In this case the two arcs overlap.
|
||||
|
|
@ -680,7 +649,7 @@ public:
|
|||
// comparison result is trivial.
|
||||
if ((this->_info & FACING_UP) != 0 && (arc._info & FACING_DOWN) != 0)
|
||||
return (LARGER);
|
||||
else if ((this->_info & FACING_DOWN)!= 0 && (arc._info & FACING_UP)!= 0)
|
||||
else if ((this->_info & FACING_DOWN) != 0 && (arc._info & FACING_UP) != 0)
|
||||
return SMALLER;
|
||||
|
||||
// Compute the second-order derivative by y and act according to it.
|
||||
|
|
@ -729,7 +698,7 @@ public:
|
|||
if (_has_same_supporting_conic (arc)) {
|
||||
if ((this->_info & FACING_UP) != 0 && (arc._info & FACING_DOWN) != 0)
|
||||
return LARGER;
|
||||
else if ((this->_info & FACING_DOWN)!= 0 && (arc._info & FACING_UP)!= 0)
|
||||
else if ((this->_info & FACING_DOWN) != 0 && (arc._info & FACING_UP) != 0)
|
||||
return SMALLER;
|
||||
|
||||
// In this case the two arcs overlap.
|
||||
|
|
@ -801,7 +770,7 @@ public:
|
|||
// comparison result is trivial.
|
||||
if ((this->_info & FACING_UP) != 0 && (arc._info & FACING_DOWN) != 0)
|
||||
return LARGER;
|
||||
else if ((this->_info & FACING_DOWN)!= 0 && (arc._info & FACING_UP)!= 0)
|
||||
else if ((this->_info & FACING_DOWN) != 0 && (arc._info & FACING_UP) != 0)
|
||||
return SMALLER;
|
||||
|
||||
// Compute the second-order derivative by y and act according to it.
|
||||
|
|
|
|||
|
|
@ -1535,6 +1535,7 @@ public:
|
|||
/*! Obtain an Approximate_2 functor object. */
|
||||
Approximate_2 approximate_2_object() const { return Approximate_2(); }
|
||||
|
||||
//! Functor
|
||||
class Construct_x_monotone_curve_2 {
|
||||
public:
|
||||
/*! Obtain an x-monotone curve connecting the two given endpoints.
|
||||
|
|
@ -1556,6 +1557,17 @@ public:
|
|||
Construct_x_monotone_curve_2 construct_x_monotone_curve_2_object() const
|
||||
{ return Construct_x_monotone_curve_2(); }
|
||||
//@}
|
||||
|
||||
/// \name Functor definitions for polylines.
|
||||
//@{
|
||||
|
||||
//! Functor
|
||||
typedef Construct_x_monotone_curve_2 Construct_curve_2;
|
||||
|
||||
/*! Obtain a Construct_curve_2 functor object. */
|
||||
Construct_curve_2 construct_curve_2_object() const
|
||||
{ return Construct_x_monotone_curve_2(*this); }
|
||||
//@}
|
||||
};
|
||||
|
||||
/*!
|
||||
|
|
|
|||
|
|
@ -403,6 +403,18 @@ public:
|
|||
Compare_endpoints_xy_2 compare_endpoints_xy_2_object() const
|
||||
{ return Compare_endpoints_xy_2(); }
|
||||
//@}
|
||||
|
||||
//! \name Functor definitions for constructions.
|
||||
//@{
|
||||
|
||||
//! Functor
|
||||
typedef typename Kernel::Construct_segment_2 Construct_curve_2;
|
||||
|
||||
/*! Obtain a Construct_curve_2 functor object. */
|
||||
Construct_curve_2 construct_curve_2_object() const
|
||||
{ return this->construct_segment_2_object(); }
|
||||
|
||||
//@}
|
||||
};
|
||||
|
||||
} //namespace CGAL
|
||||
|
|
|
|||
|
|
@ -163,8 +163,7 @@ public:
|
|||
// { Base::Push_back_2::operator()(xcv, seg); }
|
||||
|
||||
/* Append a point `p` to an existing polyline `cv` at the back. */
|
||||
void operator()(Curve_2& cv, const Point_2& p) const
|
||||
{
|
||||
void operator()(Curve_2& cv, const Point_2& p) const {
|
||||
typedef typename Curve_2::size_type size_type;
|
||||
size_type num_seg = cv.number_of_subcurves();
|
||||
CGAL_precondition(num_seg > 0);
|
||||
|
|
@ -172,8 +171,8 @@ public:
|
|||
|
||||
const Segment_traits_2* seg_traits =
|
||||
this->m_poly_traits.subcurve_traits_2();
|
||||
typename Segment_traits_2::Compare_endpoints_xy_2 cmp_seg_endpts =
|
||||
seg_traits->compare_endpoints_xy_2_object();
|
||||
auto cmp_seg_endpts = seg_traits->compare_endpoints_xy_2_object();
|
||||
auto ctr = seg_traits->construct_curve_2_object();
|
||||
|
||||
/* Since it is desired to maintain `cv` well-oriented, we have
|
||||
* to append the segment [cv[last_seg].target(),p]. The
|
||||
|
|
@ -181,14 +180,12 @@ public:
|
|||
* the target, i.e. the actual end of `cv`.
|
||||
*/
|
||||
if (cmp_seg_endpts(cv[last_seg]) == SMALLER) {
|
||||
typename Segment_traits_2::Construct_max_vertex_2 get_max_v =
|
||||
seg_traits->construct_max_vertex_2_object();
|
||||
cv.push_back(Subcurve_2(get_max_v(cv[last_seg]), p));
|
||||
auto get_max_v = seg_traits->construct_max_vertex_2_object();
|
||||
cv.push_back(ctr(get_max_v(cv[last_seg]), p));
|
||||
}
|
||||
else {
|
||||
typename Segment_traits_2::Construct_min_vertex_2 get_min_v =
|
||||
seg_traits->construct_min_vertex_2_object();
|
||||
cv.push_back(Subcurve_2(get_min_v(cv[last_seg]), p));
|
||||
auto get_min_v = seg_traits->construct_min_vertex_2_object();
|
||||
cv.push_back(ctr(get_min_v(cv[last_seg]), p));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -276,8 +273,7 @@ public:
|
|||
// { Base::Push_front_2::operator()(xcv, seg); }
|
||||
|
||||
/* Append a point `p` to an existing polyline `cv` at the front. */
|
||||
void operator()(Curve_2& cv, const Point_2& p) const
|
||||
{
|
||||
void operator()(Curve_2& cv, const Point_2& p) const {
|
||||
CGAL_precondition_code
|
||||
(
|
||||
typedef typename Curve_2::size_type size_type;
|
||||
|
|
@ -287,18 +283,16 @@ public:
|
|||
|
||||
const Segment_traits_2* geom_traits =
|
||||
this->m_poly_traits.subcurve_traits_2();
|
||||
typename Segment_traits_2::Compare_endpoints_xy_2 cmp_seg_endpts =
|
||||
geom_traits->compare_endpoints_xy_2_object();
|
||||
auto cmp_seg_endpts = geom_traits->compare_endpoints_xy_2_object();
|
||||
auto ctr = geom_traits->construct_curve_2_object();
|
||||
|
||||
if (cmp_seg_endpts(cv[0]) == SMALLER) {
|
||||
typename Segment_traits_2::Construct_min_vertex_2 get_min_v =
|
||||
geom_traits->construct_min_vertex_2_object();
|
||||
cv.push_front(Subcurve_2(p, get_min_v(cv[0])));
|
||||
auto get_min_v = geom_traits->construct_min_vertex_2_object();
|
||||
cv.push_front(ctr(p, get_min_v(cv[0])));
|
||||
}
|
||||
else {
|
||||
typename Segment_traits_2::Construct_max_vertex_2 get_max_v =
|
||||
geom_traits->construct_max_vertex_2_object();
|
||||
cv.push_front(Subcurve_2(p, get_max_v(cv[0])));
|
||||
auto get_max_v = geom_traits->construct_max_vertex_2_object();
|
||||
cv.push_front(ctr(p, get_max_v(cv[0])));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -369,8 +363,11 @@ public:
|
|||
|
||||
/* Obtain an polyline connecting two given endpoints.
|
||||
*/
|
||||
Curve_2 operator()(const Point_2& p, const Point_2& q) const
|
||||
{ return Curve_2(Subcurve_2(p, q)); }
|
||||
Curve_2 operator()(const Point_2& p, const Point_2& q) const {
|
||||
const Segment_traits_2* seg_traits =
|
||||
this->m_poly_traits.subcurve_traits_2();
|
||||
return seg_traits->construct_curve_2_object()(p, q);
|
||||
}
|
||||
|
||||
/* Obtain a polyline consists of one given segment.
|
||||
*/
|
||||
|
|
@ -433,7 +430,9 @@ public:
|
|||
auto point_pair_to_segment = [&](const Zip_iterator_ref& t)->Subcurve_2 {
|
||||
CGAL_precondition_msg(! equal(boost::get<0>(t), boost::get<1>(t)),
|
||||
"Cannot construct a degenerated segment");
|
||||
return Subcurve_2(boost::get<0>(t), boost::get<1>(t));
|
||||
const Segment_traits_2* seg_traits =
|
||||
this->m_poly_traits.subcurve_traits_2();
|
||||
return seg_traits->construct_curve_2_object()(boost::get<0>(t), boost::get<1>(t));
|
||||
};
|
||||
auto begin_next = std::next(begin);
|
||||
auto end_prev = std::prev(end);
|
||||
|
|
|
|||
|
|
@ -900,6 +900,7 @@ public:
|
|||
/*! Obtain an Approximate_2 functor object. */
|
||||
Approximate_2 approximate_2_object() const { return Approximate_2(); }
|
||||
|
||||
//! Functor
|
||||
class Construct_x_monotone_curve_2 {
|
||||
protected:
|
||||
typedef Arr_segment_traits_2<Kernel> Traits;
|
||||
|
|
@ -994,6 +995,17 @@ public:
|
|||
{ return Construct_x_monotone_curve_2(*this); }
|
||||
//@}
|
||||
|
||||
/// \name Functor definitions for polylines.
|
||||
//@{
|
||||
|
||||
//! Functor
|
||||
typedef Construct_x_monotone_curve_2 Construct_curve_2;
|
||||
|
||||
/*! Obtain a Construct_curve_2 functor object. */
|
||||
Construct_curve_2 construct_curve_2_object() const
|
||||
{ return Construct_x_monotone_curve_2(*this); }
|
||||
//@}
|
||||
|
||||
/// \name Functor definitions for the Boolean set-operation traits.
|
||||
//@{
|
||||
|
||||
|
|
|
|||
|
|
@ -134,8 +134,7 @@ public:
|
|||
OutputIterator oi)
|
||||
{
|
||||
const Geometry_traits_2* traits = this->m_sgm.geometry_traits();
|
||||
typename Traits::Construct_point_2 ctr_point =
|
||||
traits->construct_point_2_object();
|
||||
auto ctr_point = traits->construct_point_2_object();
|
||||
Curve_2 cv =
|
||||
traits->construct_curve_2_object()(ctr_point(normal1.direction()),
|
||||
ctr_point(normal2.direction()));
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ before_handle_event(Event* event)
|
|||
*/
|
||||
template <typename Tr, typename Arr, typename Evnt, typename Sbcv>
|
||||
void Arr_spherical_insertion_helper<Tr, Arr, Evnt, Sbcv>::
|
||||
before_handle_event_imp(Event* event, Arr_all_sides_oblivious_tag)
|
||||
before_handle_event_imp(Event* /* event */, Arr_all_sides_oblivious_tag)
|
||||
{ return; }
|
||||
|
||||
/* A notification invoked before the surface-sweep starts handling a given
|
||||
|
|
|
|||
|
|
@ -24,9 +24,10 @@
|
|||
|
||||
#include <boost/variant.hpp>
|
||||
#include <boost/optional.hpp>
|
||||
#include <boost/unordered_map.hpp>
|
||||
#include <boost/variant/apply_visitor.hpp>
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
#include <CGAL/Arr_tags.h>
|
||||
#include <CGAL/Surface_sweep_2/Arr_construction_ss_visitor.h>
|
||||
#include <CGAL/Unique_hash_map.h>
|
||||
|
|
@ -114,7 +115,7 @@ protected:
|
|||
Halfedge_map;
|
||||
|
||||
typedef std::pair<Cell_handle_red, Cell_handle_blue> Handle_info;
|
||||
typedef boost::unordered_map<Vertex_handle, Handle_info, Handle_hash_function>
|
||||
typedef std::unordered_map<Vertex_handle, Handle_info, Handle_hash_function>
|
||||
Vertex_map;
|
||||
|
||||
// Side categoties:
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
*/
|
||||
|
||||
// include this to avoid a VC15 warning
|
||||
#include <CGAL/boost/graph/Named_function_parameters.h>
|
||||
#include <CGAL/Named_function_parameters.h>
|
||||
|
||||
#include <boost/graph/graph_concepts.hpp>
|
||||
#include <CGAL/boost/iterator/counting_iterator.hpp>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
*/
|
||||
|
||||
// include this to avoid a VC15 warning
|
||||
#include <CGAL/boost/graph/Named_function_parameters.h>
|
||||
#include <CGAL/Named_function_parameters.h>
|
||||
|
||||
#include <CGAL/Arrangement_2.h>
|
||||
#include <CGAL/Arrangement_2/graph_traits_dual.h>
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
*/
|
||||
|
||||
// include this to avoid a VC15 warning
|
||||
#include <CGAL/boost/graph/Named_function_parameters.h>
|
||||
#include <CGAL/Named_function_parameters.h>
|
||||
|
||||
#include <CGAL/Arrangement_on_surface_2.h>
|
||||
#include <CGAL/Arrangement_2/graph_traits_dual.h>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
*/
|
||||
|
||||
// include this to avoid a VC15 warning
|
||||
#include <CGAL/boost/graph/Named_function_parameters.h>
|
||||
#include <CGAL/Named_function_parameters.h>
|
||||
|
||||
#include <CGAL/Arrangement_on_surface_with_history_2.h>
|
||||
#include <CGAL/Arrangement_2/graph_traits_dual.h>
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
*/
|
||||
|
||||
// include this to avoid a VC15 warning
|
||||
#include <CGAL/boost/graph/Named_function_parameters.h>
|
||||
#include <CGAL/Named_function_parameters.h>
|
||||
|
||||
#include <CGAL/Arrangement_with_history_2.h>
|
||||
#include <CGAL/Arrangement_2/graph_traits_dual.h>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
#include <boost/iterator/function_output_iterator.hpp>
|
||||
|
||||
#include <array>
|
||||
#include <cassert>
|
||||
|
||||
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
|
||||
typedef CGAL::Arr_segment_traits_2<Kernel> Segment_traits_2;
|
||||
|
|
@ -29,7 +30,7 @@ struct Test_functor
|
|||
{
|
||||
const X_monotone_polyline* poly
|
||||
= CGAL::object_cast<X_monotone_polyline>(&obj);
|
||||
CGAL_assertion_msg (poly != nullptr, "Intersection is not a polyline");
|
||||
assert(poly != nullptr); // Intersection is not a polyline
|
||||
|
||||
typename X_monotone_polyline::Point_const_iterator
|
||||
itref = reference->points_begin(),
|
||||
|
|
@ -38,7 +39,7 @@ struct Test_functor
|
|||
for (; itref != reference->points_end()
|
||||
&& itpoly != poly->points_end();
|
||||
++ itref, ++ itpoly)
|
||||
CGAL_assertion (*itref == *itpoly);
|
||||
assert(*itref == *itpoly);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -35,13 +35,6 @@ EXTRACT_ALL=NO
|
|||
HIDE_UNDOC_MEMBERS = YES
|
||||
HIDE_UNDOC_CLASSES = YES
|
||||
|
||||
MACRO_EXPANSION = YES
|
||||
EXPAND_ONLY_PREDEF = YES
|
||||
EXPAND_AS_DEFINED = CGAL_BGL_NP_TEMPLATE_PARAMETERS \
|
||||
CGAL_BGL_NP_CLASS \
|
||||
CGAL_DEPRECATED
|
||||
|
||||
|
||||
# macros to be used inside the code
|
||||
ALIASES += "cgalAssociatedTypesBegin=<dl class=\"params\"><dt>Associated Types</dt><dd> <table class=\"params\">"
|
||||
ALIASES += "cgalAssociatedTypesEnd=</table> </dd> </dl>"
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ The named parameters in the snippet use the tags `predecessor_map` and `distance
|
|||
and they are concatenated using the dot operator.<BR>
|
||||
|
||||
A similar mechanism was introduced in \cgal, with the small difference that the named parameters
|
||||
tag live in the `CGAL::parameters::` namespace and `CGAL::parameters::all_default()` can be used to indicate
|
||||
tag live in the `CGAL::parameters::` namespace and `CGAL::parameters::default_values()` can be used to indicate
|
||||
that default values of optional named parameters must be used.
|
||||
As in the \bgl, named parameters in \cgal are also concatenated using
|
||||
the dot operator, and a typical usage is thus:
|
||||
|
|
@ -40,7 +40,9 @@ CGAL::copy_face_graph(g1, g2);
|
|||
CGAL::copy_face_graph(g1, g2,
|
||||
CGAL::parameters::vertex_point_map(vpm) //parameter for g1
|
||||
.vertex_to_vertex_map(v2v), //other parameter for g1
|
||||
CGAL::parameters::all_default()); //parameter for g2
|
||||
CGAL::parameters::default_values()); //parameter for g2
|
||||
\endcode
|
||||
*/
|
||||
|
||||
|
||||
˛
|
||||
|
|
|
|||
|
|
@ -683,6 +683,8 @@ user might encounter.
|
|||
|
||||
- `CGAL::set_triangulation_ids()`
|
||||
|
||||
- `CGAL::parameters::default_values()`
|
||||
|
||||
\cgalCRPSection{Iterators}
|
||||
- `CGAL::Halfedge_around_source_iterator`
|
||||
- `CGAL::Halfedge_around_target_iterator`
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <iterator>
|
||||
#include <boost/unordered_map.hpp>
|
||||
#include <unordered_map>
|
||||
|
||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
|
||||
|
||||
|
|
@ -50,8 +50,8 @@ int main(int argc, char* argv[])
|
|||
typedef boost::graph_traits<Source>::vertex_descriptor tm_vertex_descriptor;
|
||||
typedef boost::graph_traits<Source>::halfedge_descriptor tm_halfedge_descriptor;
|
||||
|
||||
boost::unordered_map<source_vertex_descriptor, tm_vertex_descriptor> v2v;
|
||||
boost::unordered_map<source_halfedge_descriptor, tm_halfedge_descriptor> h2h;
|
||||
std::unordered_map<source_vertex_descriptor, tm_vertex_descriptor> v2v;
|
||||
std::unordered_map<source_halfedge_descriptor, tm_halfedge_descriptor> h2h;
|
||||
|
||||
CGAL::copy_face_graph(T1, S, CGAL::parameters::vertex_to_vertex_output_iterator(std::inserter(v2v, v2v.end()))
|
||||
.halfedge_to_halfedge_output_iterator(std::inserter(h2h, h2h.end())));
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ int main(int argc, char** argv)
|
|||
Mesh mesh;
|
||||
CGAL::IO::read_OFF (in, mesh);
|
||||
|
||||
boost::unordered_map<Face_index, bool> is_selected_map;
|
||||
std::unordered_map<Face_index, bool> is_selected_map;
|
||||
|
||||
// randomly select 1/3 of faces
|
||||
std::size_t nb_selected_before = 0;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
#include <fstream>
|
||||
#include <iterator>
|
||||
|
||||
#include <boost/unordered_map.hpp>
|
||||
#include <unordered_map>
|
||||
|
||||
|
||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
|
||||
|
|
@ -56,9 +56,9 @@ int main(int argc, char* argv[])
|
|||
typedef boost::graph_traits<Target2>::face_descriptor tm_face_descriptor;
|
||||
|
||||
// Use an unordered_map to keep track of elements.
|
||||
boost::unordered_map<sm_vertex_descriptor, tm_vertex_descriptor> v2v;
|
||||
boost::unordered_map<sm_halfedge_descriptor, tm_halfedge_descriptor> h2h;
|
||||
boost::unordered_map<sm_face_descriptor, tm_face_descriptor> f2f;
|
||||
std::unordered_map<sm_vertex_descriptor, tm_vertex_descriptor> v2v;
|
||||
std::unordered_map<sm_halfedge_descriptor, tm_halfedge_descriptor> h2h;
|
||||
std::unordered_map<sm_face_descriptor, tm_face_descriptor> f2f;
|
||||
|
||||
CGAL::copy_face_graph(S, T2, CGAL::parameters::vertex_to_vertex_output_iterator(std::inserter(v2v, v2v.end()))
|
||||
.halfedge_to_halfedge_output_iterator(std::inserter(h2h, h2h.end()))
|
||||
|
|
@ -83,9 +83,9 @@ int main(int argc, char* argv[])
|
|||
typedef boost::graph_traits<Source>::face_descriptor tm_face_descriptor;
|
||||
|
||||
|
||||
boost::unordered_map<source_vertex_descriptor, tm_vertex_descriptor> v2v;
|
||||
boost::unordered_map<source_halfedge_descriptor, tm_halfedge_descriptor> h2h;
|
||||
boost::unordered_map<source_face_descriptor, tm_face_descriptor> f2f;
|
||||
std::unordered_map<source_vertex_descriptor, tm_vertex_descriptor> v2v;
|
||||
std::unordered_map<source_halfedge_descriptor, tm_halfedge_descriptor> h2h;
|
||||
std::unordered_map<source_face_descriptor, tm_face_descriptor> f2f;
|
||||
CGAL::copy_face_graph(T1, S, CGAL::parameters::vertex_to_vertex_map(boost::make_assoc_property_map(v2v))
|
||||
.halfedge_to_halfedge_output_iterator(std::inserter(h2h, h2h.end()))
|
||||
.face_to_face_map(boost::make_assoc_property_map(f2f)));
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <cassert>
|
||||
|
||||
typedef CGAL::Simple_cartesian<double> K;
|
||||
typedef CGAL::Surface_mesh<K::Point_3> SM;
|
||||
|
|
@ -39,7 +40,7 @@ int main(int argc, char** argv)
|
|||
// Extract the part n°0 of the partition into a new, independent mesh
|
||||
typedef CGAL::Face_filtered_graph<SM> Filtered_graph;
|
||||
Filtered_graph filtered_sm(sm, 0 /*id of th part*/, face_pid_map);
|
||||
CGAL_assertion(filtered_sm.is_selection_valid());
|
||||
assert(filtered_sm.is_selection_valid());
|
||||
SM part_sm;
|
||||
CGAL::copy_face_graph(filtered_sm, part_sm);
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
#include <CGAL/assertions.h>
|
||||
#include <CGAL/boost/graph/properties.h>
|
||||
#include <CGAL/boost/graph/iterator.h>
|
||||
#include <CGAL/boost/graph/Named_function_parameters.h>
|
||||
#include <CGAL/Named_function_parameters.h>
|
||||
#include <CGAL/boost/graph/named_params_helper.h>
|
||||
#include <CGAL/boost/graph/helpers.h>
|
||||
#include <CGAL/boost/iterator/transform_iterator.hpp>
|
||||
|
|
@ -26,17 +26,12 @@
|
|||
#include <boost/graph/graph_traits.hpp>
|
||||
#include <boost/iterator/filter_iterator.hpp>
|
||||
#include <boost/range/has_range_iterator.hpp>
|
||||
#include <boost/unordered_set.hpp>
|
||||
|
||||
#include <unordered_set>
|
||||
#include <bitset>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#ifdef DOXYGEN_RUNNING
|
||||
#define CGAL_BGL_NP_TEMPLATE_PARAMETERS NamedParameters
|
||||
#define CGAL_BGL_NP_CLASS NamedParameters
|
||||
#endif
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
/*!
|
||||
|
|
@ -152,9 +147,9 @@ struct Face_filtered_graph
|
|||
* \cgalParamNEnd
|
||||
* \cgalNamedParamsEnd
|
||||
*/
|
||||
template <class CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
template <class CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
Face_filtered_graph(const Graph& graph,
|
||||
const CGAL_BGL_NP_CLASS& np)
|
||||
const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
: _graph(const_cast<Graph&>(graph))
|
||||
, fimap(CGAL::get_initialized_face_index_map(graph, np))
|
||||
, vimap(CGAL::get_initialized_vertex_index_map(graph, np))
|
||||
|
|
@ -164,10 +159,6 @@ struct Face_filtered_graph
|
|||
, selected_halfedges(num_halfedges(graph), 0)
|
||||
{}
|
||||
|
||||
Face_filtered_graph(const Graph& graph)
|
||||
:Face_filtered_graph(graph, parameters::all_default())
|
||||
{}
|
||||
|
||||
/*!
|
||||
* \brief Constructor where the set of selected faces is specified as a range of patch ids.
|
||||
*
|
||||
|
|
@ -217,11 +208,11 @@ struct Face_filtered_graph
|
|||
* \cgalParamNEnd
|
||||
* \cgalNamedParamsEnd
|
||||
*/
|
||||
template <typename FacePatchIndexMap, class FacePatchIndexRange, class CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
template <typename FacePatchIndexMap, class FacePatchIndexRange, class CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
Face_filtered_graph(const Graph& graph,
|
||||
const FacePatchIndexRange& selected_face_patch_indices,
|
||||
FacePatchIndexMap face_patch_index_map,
|
||||
const CGAL_BGL_NP_CLASS& np
|
||||
const CGAL_NP_CLASS& np
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
, typename boost::enable_if<
|
||||
typename boost::has_range_const_iterator<FacePatchIndexRange>::type
|
||||
|
|
@ -299,11 +290,11 @@ struct Face_filtered_graph
|
|||
* \cgalParamNEnd
|
||||
* \cgalNamedParamsEnd
|
||||
*/
|
||||
template <typename FacePatchIndexMap, class CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
template <typename FacePatchIndexMap, class CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
Face_filtered_graph(const Graph& graph,
|
||||
typename boost::property_traits<FacePatchIndexMap>::value_type selected_face_patch_index,
|
||||
FacePatchIndexMap face_patch_index_map,
|
||||
const CGAL_BGL_NP_CLASS& np)
|
||||
const CGAL_NP_CLASS& np)
|
||||
: _graph(const_cast<Graph&>(graph)),
|
||||
fimap(CGAL::get_initialized_face_index_map(graph, np)),
|
||||
vimap(CGAL::get_initialized_vertex_index_map(graph, np)),
|
||||
|
|
@ -369,10 +360,10 @@ struct Face_filtered_graph
|
|||
* \cgalParamNEnd
|
||||
* \cgalNamedParamsEnd
|
||||
*/
|
||||
template <typename FaceRange, class CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
template <typename FaceRange, class CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
Face_filtered_graph(const Graph& graph,
|
||||
const FaceRange& selected_faces,
|
||||
const CGAL_BGL_NP_CLASS& np)
|
||||
const CGAL_NP_CLASS& np)
|
||||
: _graph(const_cast<Graph&>(graph)),
|
||||
fimap(CGAL::get_initialized_face_index_map(graph, np)),
|
||||
vimap(CGAL::get_initialized_vertex_index_map(graph, np)),
|
||||
|
|
@ -446,7 +437,7 @@ struct Face_filtered_graph
|
|||
initialize_halfedge_indices();
|
||||
}
|
||||
|
||||
///change the set of selected faces using a patch id
|
||||
/// changes the set of selected faces using a patch id.
|
||||
template<class FacePatchIndexMap>
|
||||
void set_selected_faces(typename boost::property_traits<FacePatchIndexMap>::value_type face_patch_id,
|
||||
FacePatchIndexMap face_patch_index_map)
|
||||
|
|
@ -475,7 +466,7 @@ struct Face_filtered_graph
|
|||
|
||||
reset_indices();
|
||||
}
|
||||
/// change the set of selected faces using a range of patch ids
|
||||
/// changes the set of selected faces using a range of patch ids
|
||||
template<class FacePatchIndexRange, class FacePatchIndexMap>
|
||||
void set_selected_faces(const FacePatchIndexRange& selected_face_patch_indices,
|
||||
FacePatchIndexMap face_patch_index_map
|
||||
|
|
@ -495,8 +486,8 @@ struct Face_filtered_graph
|
|||
selected_halfedges.reset();
|
||||
|
||||
typedef typename boost::property_traits<FacePatchIndexMap>::value_type Patch_index;
|
||||
boost::unordered_set<Patch_index> pids(boost::begin(selected_face_patch_indices),
|
||||
boost::end(selected_face_patch_indices));
|
||||
std::unordered_set<Patch_index> pids(boost::begin(selected_face_patch_indices),
|
||||
boost::end(selected_face_patch_indices));
|
||||
|
||||
for(face_descriptor fd : faces(_graph) )
|
||||
{
|
||||
|
|
@ -515,7 +506,7 @@ struct Face_filtered_graph
|
|||
reset_indices();
|
||||
}
|
||||
|
||||
/// change the set of selected faces using a range of face descriptors
|
||||
/// changes the set of selected faces using a range of face descriptors.
|
||||
template<class FaceRange>
|
||||
void set_selected_faces(const FaceRange& selection)
|
||||
{
|
||||
|
|
@ -578,18 +569,21 @@ struct Face_filtered_graph
|
|||
{
|
||||
return selected_halfedges[get(himap, halfedge(e,_graph))];
|
||||
}
|
||||
///returns the number of selected faces
|
||||
size_type number_of_faces()const
|
||||
|
||||
/// returns the number of selected faces.
|
||||
size_type number_of_faces() const
|
||||
{
|
||||
return selected_faces.count();
|
||||
}
|
||||
///returns the number of selected vertices.
|
||||
size_type number_of_vertices()const
|
||||
|
||||
/// returns the number of selected vertices.
|
||||
size_type number_of_vertices() const
|
||||
{
|
||||
return selected_vertices.count();
|
||||
}
|
||||
///returns the number of selected halfedges.
|
||||
size_type number_of_halfedges()const
|
||||
|
||||
/// returns the number of selected halfedges.
|
||||
size_type number_of_halfedges() const
|
||||
{
|
||||
return selected_halfedges.count();
|
||||
}
|
||||
|
|
@ -621,21 +615,18 @@ struct Face_filtered_graph
|
|||
return bind_property_maps(himap, make_property_map(halfedge_indices) );
|
||||
}
|
||||
|
||||
/// returns `true` if around any vertex of a selected face,
|
||||
/// there is at most one connected set of selected faces.
|
||||
/// returns `true` if around any vertex of a selected face there is at most a single umbrella
|
||||
bool is_selection_valid() const
|
||||
{
|
||||
typedef typename boost::graph_traits<Graph>::vertex_descriptor vertex_descriptor;
|
||||
typedef typename boost::graph_traits<Graph>::halfedge_descriptor halfedge_descriptor;
|
||||
|
||||
// Non-manifoldness can appear either:
|
||||
// - if 'pm' is pinched at a vertex. While traversing the incoming halfedges at this vertex,
|
||||
// we will meet strictly more than one border halfedge.
|
||||
// - if there are multiple umbrellas around a vertex. In that case, we will find a non-visited
|
||||
// halfedge that has for target a vertex that is already visited.
|
||||
// Non-manifoldness can appear if there are multiple umbrellas around a vertex.
|
||||
// In that case, we will find a non-visited halfedge that has for target a vertex
|
||||
// that is already visited.
|
||||
|
||||
boost::unordered_set<vertex_descriptor> vertices_visited;
|
||||
boost::unordered_set<halfedge_descriptor> halfedges_handled;
|
||||
std::unordered_set<vertex_descriptor> vertices_visited;
|
||||
std::unordered_set<halfedge_descriptor> halfedges_handled;
|
||||
|
||||
for(halfedge_descriptor hd : halfedges(*this))
|
||||
{
|
||||
|
|
@ -652,15 +643,11 @@ struct Face_filtered_graph
|
|||
if(!vertices_visited.insert(vd).second)
|
||||
return false;
|
||||
|
||||
std::size_t border_halfedge_counter = 0;
|
||||
|
||||
// Can't simply call halfedges_around_target(vd, *this) because 'halfedge(vd)' is not necessarily 'hd'
|
||||
// Can't call halfedges_around_target(vd, *this) because 'halfedge(vd)' is not necessarily 'hd'
|
||||
halfedge_descriptor ihd = hd;
|
||||
do
|
||||
{
|
||||
halfedges_handled.insert(ihd);
|
||||
if(is_border(ihd, *this))
|
||||
++border_halfedge_counter;
|
||||
|
||||
do
|
||||
{
|
||||
|
|
@ -669,14 +656,32 @@ struct Face_filtered_graph
|
|||
while(!is_in_cc(ihd) && ihd != hd);
|
||||
}
|
||||
while(ihd != hd);
|
||||
|
||||
if(border_halfedge_counter > 1)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// inverts the selected status of faces.
|
||||
void invert_selection()
|
||||
{
|
||||
selected_faces=~selected_faces;
|
||||
selected_halfedges.reset();
|
||||
selected_vertices.reset();
|
||||
|
||||
for(face_descriptor fd : faces(_graph))
|
||||
{
|
||||
if (!selected_faces.test(get(fimap, fd))) continue;
|
||||
for(halfedge_descriptor hd : halfedges_around_face(halfedge(fd, _graph), _graph))
|
||||
{
|
||||
selected_halfedges.set(get(himap, hd));
|
||||
selected_halfedges.set(get(himap, opposite(hd, _graph)));
|
||||
selected_vertices.set(get(vimap, target(hd, _graph)));
|
||||
}
|
||||
}
|
||||
|
||||
reset_indices();
|
||||
}
|
||||
|
||||
private:
|
||||
Graph& _graph;
|
||||
FIM fimap;
|
||||
|
|
@ -1059,7 +1064,8 @@ typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >:
|
|||
next(typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor h,
|
||||
const Face_filtered_graph<Graph, FIMap, VIMap, HIMap> & w)
|
||||
{
|
||||
CGAL_assertion(w.is_in_cc(h));
|
||||
CGAL_precondition(w.is_in_cc(h));
|
||||
|
||||
if(w.is_in_cc(next(h, w.graph())))
|
||||
return next(h, w.graph());
|
||||
|
||||
|
|
@ -1083,8 +1089,8 @@ typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >:
|
|||
prev(typename boost::graph_traits< Face_filtered_graph<Graph, FIMap, VIMap, HIMap> >::halfedge_descriptor h,
|
||||
const Face_filtered_graph<Graph, FIMap, VIMap, HIMap> & w)
|
||||
{
|
||||
CGAL_precondition(w.is_in_cc(h));
|
||||
|
||||
CGAL_assertion(w.is_in_cc(h));
|
||||
if(w.is_in_cc(prev(h, w.graph())))
|
||||
return prev(h, w.graph());
|
||||
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
#include <CGAL/assertions.h>
|
||||
#include <CGAL/boost/graph/IO/Generic_facegraph_builder.h>
|
||||
#include <CGAL/boost/graph/iterator.h>
|
||||
#include <CGAL/boost/graph/Named_function_parameters.h>
|
||||
#include <CGAL/Named_function_parameters.h>
|
||||
#include <CGAL/boost/graph/named_params_helper.h>
|
||||
#include <boost/container/flat_map.hpp>
|
||||
|
||||
|
|
@ -25,11 +25,6 @@
|
|||
#include <iostream>
|
||||
#include <utility>
|
||||
|
||||
#ifdef DOXYGEN_RUNNING
|
||||
#define CGAL_BGL_NP_TEMPLATE_PARAMETERS NamedParameters
|
||||
#define CGAL_BGL_NP_CLASS NamedParameters
|
||||
#endif
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -113,17 +108,17 @@ public:
|
|||
/// \returns `true` if reading was successful and the resulting mesh is valid, `false` otherwise.
|
||||
///
|
||||
template <typename Graph,
|
||||
typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool read_GOCAD(std::istream& is,
|
||||
std::pair<std::string, std::string>& name_and_color,
|
||||
Graph& g,
|
||||
const CGAL_BGL_NP_CLASS& np
|
||||
const CGAL_NP_CLASS& np = parameters::default_values()
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
, 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 CGAL::GetVertexPointMap<Graph, CGAL_NP_CLASS>::type VPM;
|
||||
typedef typename boost::property_traits<VPM>::value_type Point;
|
||||
|
||||
internal::GOCAD_builder<Graph, Point> builder(is);
|
||||
|
|
@ -138,27 +133,14 @@ bool read_GOCAD(std::istream& is,
|
|||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
template <typename Graph>
|
||||
bool read_GOCAD(std::istream& is, std::pair<std::string, std::string>& name_and_color, Graph& g,
|
||||
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,
|
||||
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool read_GOCAD(std::istream& is, Graph& g, const CGAL_NP_CLASS& np = parameters::default_values(),
|
||||
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);
|
||||
}
|
||||
|
||||
template <typename Graph>
|
||||
bool read_GOCAD(std::istream& is, Graph& g,
|
||||
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
|
||||
{
|
||||
return read_GOCAD(is, g, parameters::all_default());
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
|
||||
|
|
@ -200,11 +182,11 @@ bool read_GOCAD(std::istream& is, Graph& g,
|
|||
/// \returns `true` if reading was successful and the resulting mesh is valid, `false` otherwise.
|
||||
///
|
||||
template <typename Graph,
|
||||
typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool read_GOCAD(const std::string& fname,
|
||||
std::pair<std::string, std::string>& name_and_color,
|
||||
Graph& g,
|
||||
const CGAL_BGL_NP_CLASS& np
|
||||
const CGAL_NP_CLASS& np = parameters::default_values()
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
|
||||
#endif
|
||||
|
|
@ -217,28 +199,14 @@ bool read_GOCAD(const std::string& fname,
|
|||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
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<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,
|
||||
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool read_GOCAD(const std::string& fname, Graph& g, const CGAL_NP_CLASS& np = parameters::default_values(),
|
||||
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);
|
||||
}
|
||||
|
||||
template <typename Graph>
|
||||
bool read_GOCAD(const std::string& fname, Graph& g,
|
||||
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
|
||||
{
|
||||
return read_GOCAD(fname, g, parameters::all_default());
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -277,11 +245,11 @@ bool read_GOCAD(const std::string& fname, Graph& g,
|
|||
/// \returns `true` if writing was successful, `false` otherwise.
|
||||
///
|
||||
template <typename Graph,
|
||||
typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool write_GOCAD(std::ostream& os,
|
||||
const char* name,
|
||||
const Graph& g,
|
||||
const CGAL_BGL_NP_CLASS& np
|
||||
const CGAL_NP_CLASS& np = parameters::default_values()
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
|
||||
#endif
|
||||
|
|
@ -295,7 +263,7 @@ bool write_GOCAD(std::ostream& os,
|
|||
using parameters::choose_parameter;
|
||||
using parameters::get_parameter;
|
||||
|
||||
typename CGAL::GetVertexPointMap<Graph, CGAL_BGL_NP_CLASS>::const_type
|
||||
typename CGAL::GetVertexPointMap<Graph, CGAL_NP_CLASS>::const_type
|
||||
vpm = choose_parameter(get_parameter(np, internal_np::vertex_point),
|
||||
get_const_property_map(CGAL::vertex_point, g));
|
||||
|
||||
|
|
@ -341,17 +309,6 @@ bool write_GOCAD(std::ostream& os,
|
|||
return os.good();
|
||||
}
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
template <typename Graph>
|
||||
bool write_GOCAD(std::ostream& os, const char* name, const Graph& g,
|
||||
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
|
||||
{
|
||||
return write_GOCAD(os, name, g, parameters::all_default());
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
|
||||
/// \ingroup PkgBGLIoFuncsGOCAD
|
||||
///
|
||||
/// \brief writes the graph `g` in the \ref IOStreamGocad into `os`.
|
||||
|
|
@ -385,10 +342,10 @@ bool write_GOCAD(std::ostream& os, const char* name, const Graph& g,
|
|||
/// \returns `true` if writing was successful, `false` otherwise.
|
||||
///
|
||||
template <typename Graph,
|
||||
typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool write_GOCAD(std::ostream& os,
|
||||
const Graph& g,
|
||||
const CGAL_BGL_NP_CLASS& np
|
||||
const CGAL_NP_CLASS& np = parameters::default_values()
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
|
||||
#endif
|
||||
|
|
@ -397,17 +354,6 @@ bool write_GOCAD(std::ostream& os,
|
|||
return write_GOCAD(os, "anonymous", g, np);
|
||||
}
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
template <typename Graph>
|
||||
bool write_GOCAD(std::ostream& os, const Graph& g,
|
||||
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
|
||||
{
|
||||
return write_GOCAD(os, g, parameters::all_default());
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
|
||||
/// \ingroup PkgBGLIoFuncsGOCAD
|
||||
///
|
||||
/// \brief writes the graph `g` into a file named `fname`, using the \ref IOStreamGocad.
|
||||
|
|
@ -441,10 +387,10 @@ bool write_GOCAD(std::ostream& os, const Graph& g,
|
|||
/// \sa Overloads of this function for specific models of the concept `FaceGraph`.
|
||||
///
|
||||
template <typename Graph,
|
||||
typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool write_GOCAD(const std::string& fname,
|
||||
const Graph& g,
|
||||
const CGAL_BGL_NP_CLASS& np
|
||||
const CGAL_NP_CLASS& np = parameters::default_values()
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
|
||||
#endif
|
||||
|
|
@ -456,17 +402,6 @@ bool write_GOCAD(const std::string& fname,
|
|||
return write_GOCAD(os, fname.c_str(), g, np);
|
||||
}
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
template <typename Graph>
|
||||
bool write_GOCAD(const std::string& fname, const Graph& g,
|
||||
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::IO
|
||||
|
||||
#endif // CGAL_BGL_IO_GOCAD_H
|
||||
|
|
|
|||
|
|
@ -38,8 +38,8 @@ protected:
|
|||
public:
|
||||
Generic_facegraph_builder(std::istream& in_) : m_is(in_) { }
|
||||
|
||||
template <typename NamedParameters>
|
||||
bool operator()(Graph& g, const NamedParameters& np)
|
||||
template <typename NamedParameters = parameters::Default_named_parameters>
|
||||
bool operator()(Graph& g, const NamedParameters& np = parameters::default_values())
|
||||
{
|
||||
typedef typename GetK<Graph, NamedParameters>::Kernel Kernel;
|
||||
typedef typename Kernel::Vector_3 Vector;
|
||||
|
|
@ -76,10 +76,10 @@ public:
|
|||
using parameters::is_default_parameter;
|
||||
using parameters::get_parameter;
|
||||
|
||||
const bool is_vnm_requested = !(is_default_parameter(get_parameter(np, internal_np::vertex_normal_map)));
|
||||
const bool is_vcm_requested = !(is_default_parameter(get_parameter(np, internal_np::vertex_color_map)));
|
||||
const bool is_vtm_requested = !(is_default_parameter(get_parameter(np, internal_np::vertex_texture_map)));
|
||||
const bool is_fcm_requested = !(is_default_parameter(get_parameter(np, internal_np::face_color_map)));
|
||||
const bool is_vnm_requested = !(is_default_parameter<NamedParameters, internal_np::vertex_normal_map_t>());
|
||||
const bool is_vcm_requested = !(is_default_parameter<NamedParameters, internal_np::vertex_color_map_t>());
|
||||
const bool is_vtm_requested = !(is_default_parameter<NamedParameters, internal_np::vertex_texture_map_t>());
|
||||
const bool is_fcm_requested = !(is_default_parameter<NamedParameters, internal_np::face_color_map_t>());
|
||||
|
||||
std::vector<Vertex_normal> vertex_normals;
|
||||
std::vector<Vertex_color> vertex_colors;
|
||||
|
|
@ -154,8 +154,6 @@ public:
|
|||
return is_valid(g);
|
||||
}
|
||||
|
||||
bool operator()(Graph& g) { return operator()(g, parameters::all_default()); }
|
||||
|
||||
protected:
|
||||
std::istream& m_is;
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
|
||||
#include <CGAL/assertions.h>
|
||||
#include <CGAL/boost/graph/iterator.h>
|
||||
#include <CGAL/boost/graph/Named_function_parameters.h>
|
||||
#include <CGAL/Named_function_parameters.h>
|
||||
#include <CGAL/boost/graph/named_params_helper.h>
|
||||
#include <CGAL/property_map.h>
|
||||
|
||||
|
|
@ -88,9 +88,9 @@ public:
|
|||
Generic_facegraph_printer(Stream& os) : m_os(os) { }
|
||||
Generic_facegraph_printer(Stream& os, FileWriter writer) : m_os(os), m_writer(writer) { }
|
||||
|
||||
template <typename NamedParameters>
|
||||
template <typename NamedParameters = parameters::Default_named_parameters>
|
||||
bool operator()(const Graph& g,
|
||||
const NamedParameters& np)
|
||||
const NamedParameters& np = parameters::default_values())
|
||||
{
|
||||
typedef typename GetVertexPointMap<Graph, NamedParameters>::const_type VPM;
|
||||
typedef typename boost::property_traits<VPM>::reference Point_ref;
|
||||
|
|
@ -122,10 +122,10 @@ public:
|
|||
VPM vpm = choose_parameter(get_parameter(np, internal_np::vertex_point),
|
||||
get_const_property_map(CGAL::vertex_point, g));
|
||||
|
||||
const bool has_vertex_normals = !(is_default_parameter(get_parameter(np, internal_np::vertex_normal_map)));
|
||||
const bool has_vertex_colors = !(is_default_parameter(get_parameter(np, internal_np::vertex_color_map)));
|
||||
const bool has_vertex_textures = !(is_default_parameter(get_parameter(np, internal_np::vertex_texture_map)));
|
||||
const bool has_face_colors = !(is_default_parameter(get_parameter(np, internal_np::face_color_map)));
|
||||
const bool has_vertex_normals = !(is_default_parameter<NamedParameters, internal_np::vertex_normal_map_t>());
|
||||
const bool has_vertex_colors = !(is_default_parameter<NamedParameters, internal_np::vertex_color_map_t>());
|
||||
const bool has_vertex_textures = !(is_default_parameter<NamedParameters, internal_np::vertex_texture_map_t>());
|
||||
const bool has_face_colors = !(is_default_parameter<NamedParameters, internal_np::face_color_map_t>());
|
||||
|
||||
VNM vnm = get_parameter(np, internal_np::vertex_normal_map);
|
||||
VTM vtm = get_parameter(np, internal_np::vertex_texture_map);
|
||||
|
|
@ -193,8 +193,6 @@ public:
|
|||
return m_os.good();
|
||||
}
|
||||
|
||||
bool operator()(const Graph& g) { return operator()(g, parameters::all_default()); }
|
||||
|
||||
protected:
|
||||
Stream& m_os;
|
||||
FileWriter m_writer;
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
#define CGAL_BGL_IO_INP_H
|
||||
|
||||
#include <CGAL/boost/graph/iterator.h>
|
||||
#include <CGAL/boost/graph/Named_function_parameters.h>
|
||||
#include <CGAL/Named_function_parameters.h>
|
||||
#include <CGAL/boost/graph/named_params_helper.h>
|
||||
|
||||
#include <boost/container/flat_map.hpp>
|
||||
|
|
@ -27,18 +27,18 @@ namespace IO {
|
|||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
template <typename Graph, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool write_INP(std::ostream& os,
|
||||
const std::string& name,
|
||||
const std::string& type,
|
||||
const Graph& g,
|
||||
const CGAL_BGL_NP_CLASS& np)
|
||||
const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
typedef typename boost::graph_traits<Graph>::vertex_descriptor vertex_descriptor;
|
||||
typedef typename boost::graph_traits<Graph>::face_descriptor face_descriptor;
|
||||
typedef typename boost::graph_traits<Graph>::vertices_size_type vertices_size_type;
|
||||
|
||||
typedef typename CGAL::GetVertexPointMap<Graph, CGAL_BGL_NP_CLASS>::const_type VPM;
|
||||
typedef typename CGAL::GetVertexPointMap<Graph, CGAL_NP_CLASS>::const_type VPM;
|
||||
typedef typename boost::property_traits<VPM>::reference Point_ref;
|
||||
|
||||
using parameters::choose_parameter;
|
||||
|
|
@ -76,46 +76,26 @@ bool write_INP(std::ostream& os,
|
|||
return os.good();
|
||||
}
|
||||
|
||||
template <typename Graph, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool write_INP(const std::string& fname,
|
||||
const std::string& type,
|
||||
const Graph& g,
|
||||
const CGAL_BGL_NP_CLASS& np)
|
||||
const CGAL_NP_CLASS& np = parameters::default_values() )
|
||||
{
|
||||
std::ofstream os(fname);
|
||||
return write_INP(os, fname, type, g, np);
|
||||
}
|
||||
|
||||
template <typename Graph>
|
||||
bool write_INP(std::ostream& os, const std::string& name, const std::string& type, const Graph& g)
|
||||
{
|
||||
return write_INP(os, name, type, g, parameters::all_default());
|
||||
}
|
||||
|
||||
template <typename Graph>
|
||||
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>
|
||||
template <typename FaceGraph, typename NamedParameters = parameters::Default_named_parameters>
|
||||
CGAL_DEPRECATED bool write_inp(std::ostream& os,
|
||||
const FaceGraph& g,
|
||||
std::string name,
|
||||
std::string type,
|
||||
const NamedParameters& np)
|
||||
const NamedParameters& np = parameters::default_values())
|
||||
{
|
||||
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
|
||||
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
#include <CGAL/assertions.h>
|
||||
#include <CGAL/boost/graph/Euler_operations.h>
|
||||
#include <CGAL/boost/graph/Named_function_parameters.h>
|
||||
#include <CGAL/Named_function_parameters.h>
|
||||
#include <CGAL/boost/graph/named_params_helper.h>
|
||||
|
||||
#include <fstream>
|
||||
|
|
@ -28,11 +28,6 @@
|
|||
#include <utility>
|
||||
#include <vector>
|
||||
|
||||
#ifdef DOXYGEN_RUNNING
|
||||
#define CGAL_BGL_NP_TEMPLATE_PARAMETERS NamedParameters
|
||||
#define CGAL_BGL_NP_CLASS NamedParameters
|
||||
#endif
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -109,33 +104,22 @@ public:
|
|||
\sa Overloads of this function for specific models of the concept `FaceGraph`.
|
||||
*/
|
||||
template <typename Graph,
|
||||
typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool read_OBJ(std::istream& is,
|
||||
Graph& g,
|
||||
const CGAL_BGL_NP_CLASS& np
|
||||
const CGAL_NP_CLASS& np = parameters::default_values()
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
, 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 CGAL::GetVertexPointMap<Graph, CGAL_NP_CLASS>::type VPM;
|
||||
typedef typename boost::property_traits<VPM>::value_type Point;
|
||||
|
||||
internal::OBJ_builder<Graph, Point> builder(is);
|
||||
return builder(g, np);
|
||||
}
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
template <typename Graph>
|
||||
bool read_OBJ(std::istream& is, Graph& g,
|
||||
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
|
||||
{
|
||||
return read_OBJ(is, g, parameters::all_default());
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
|
||||
/*!
|
||||
\ingroup PkgBGLIoFuncsOBJ
|
||||
|
||||
|
|
@ -176,10 +160,10 @@ bool read_OBJ(std::istream& is, Graph& g,
|
|||
\sa Overloads of this function for specific models of the concept `FaceGraph`.
|
||||
*/
|
||||
template <typename Graph,
|
||||
typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool read_OBJ(const std::string& fname,
|
||||
Graph& g,
|
||||
const CGAL_BGL_NP_CLASS& np
|
||||
const CGAL_NP_CLASS& np = parameters::default_values()
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
|
||||
#endif
|
||||
|
|
@ -190,17 +174,6 @@ bool read_OBJ(const std::string& fname,
|
|||
return read_OBJ(is, g, np);
|
||||
}
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
template <typename Graph>
|
||||
bool read_OBJ(const std::string& fname, Graph& g,
|
||||
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
|
||||
{
|
||||
return read_OBJ(fname, g, parameters::all_default());
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Write
|
||||
|
|
@ -239,10 +212,10 @@ bool read_OBJ(const std::string& fname, Graph& g,
|
|||
\sa Overloads of this function for specific models of the concept `FaceGraph`.
|
||||
*/
|
||||
template <typename Graph,
|
||||
typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool write_OBJ(std::ostream& os,
|
||||
const Graph& g,
|
||||
const CGAL_BGL_NP_CLASS& np
|
||||
const CGAL_NP_CLASS& np = parameters::default_values()
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
|
||||
#endif
|
||||
|
|
@ -252,17 +225,6 @@ bool write_OBJ(std::ostream& os,
|
|||
return printer(g, np);
|
||||
}
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
template <typename Graph>
|
||||
bool write_OBJ(std::ostream& os, const Graph& g,
|
||||
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
|
||||
{
|
||||
return write_OBJ(os, g, parameters::all_default());
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
|
||||
/*!
|
||||
\ingroup PkgBGLIoFuncsOBJ
|
||||
|
||||
|
|
@ -296,10 +258,10 @@ bool write_OBJ(std::ostream& os, const Graph& g,
|
|||
\sa Overloads of this function for specific models of the concept `FaceGraph`.
|
||||
*/
|
||||
template <typename Graph,
|
||||
typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool write_OBJ(const std::string& fname,
|
||||
const Graph& g,
|
||||
const CGAL_BGL_NP_CLASS& np
|
||||
const CGAL_NP_CLASS& np = parameters::default_values()
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
|
||||
#endif
|
||||
|
|
@ -310,17 +272,6 @@ bool write_OBJ(const std::string& fname,
|
|||
return write_OBJ(os, g, np);
|
||||
}
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
template <typename Graph>
|
||||
bool write_OBJ(const std::string& fname, const Graph& g,
|
||||
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::IO
|
||||
|
||||
#endif // CGAL_BGL_IO_OBJ_H
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
#include <CGAL/assertions.h>
|
||||
#include <CGAL/boost/graph/Euler_operations.h>
|
||||
#include <CGAL/boost/graph/Named_function_parameters.h>
|
||||
#include <CGAL/Named_function_parameters.h>
|
||||
#include <CGAL/boost/graph/named_params_helper.h>
|
||||
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
|
|
@ -28,12 +28,6 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#ifdef DOXYGEN_RUNNING
|
||||
#define CGAL_BGL_NP_TEMPLATE_PARAMETERS NamedParameters
|
||||
#define CGAL_BGL_NP_CLASS NamedParameters
|
||||
#define CGAL_DEPRECATED
|
||||
#endif
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -70,12 +64,12 @@ public:
|
|||
|
||||
// Because some packages can provide overloads with the same signature to automatically initialize
|
||||
// property maps (see Surface_mesh/IO/ for example)
|
||||
template <typename Graph, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool read_OFF_BGL(std::istream& is,
|
||||
Graph& g,
|
||||
const CGAL_BGL_NP_CLASS& np)
|
||||
const CGAL_NP_CLASS& np)
|
||||
{
|
||||
typedef typename CGAL::GetVertexPointMap<Graph, CGAL_BGL_NP_CLASS>::type VPM;
|
||||
typedef typename CGAL::GetVertexPointMap<Graph, CGAL_NP_CLASS>::type VPM;
|
||||
typedef typename boost::property_traits<VPM>::value_type Point;
|
||||
|
||||
internal::OFF_builder<Graph, Point> builder(is);
|
||||
|
|
@ -156,10 +150,10 @@ bool read_OFF_BGL(std::istream& is,
|
|||
\sa Overloads of this function for specific models of the concept `FaceGraph`.
|
||||
*/
|
||||
template <typename Graph,
|
||||
typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool read_OFF(std::istream& is,
|
||||
Graph& g,
|
||||
const CGAL_BGL_NP_CLASS& np
|
||||
const CGAL_NP_CLASS& np = parameters::default_values()
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
|
||||
#endif
|
||||
|
|
@ -168,17 +162,6 @@ bool read_OFF(std::istream& is,
|
|||
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<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
|
||||
{
|
||||
return read_OFF(is, g, parameters::all_default());
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
|
||||
/*!
|
||||
\ingroup PkgBGLIoFuncsOFF
|
||||
|
||||
|
|
@ -251,10 +234,10 @@ bool read_OFF(std::istream& is, Graph& g,
|
|||
\sa Overloads of this function for specific models of the concept `FaceGraph`.
|
||||
*/
|
||||
template <typename Graph,
|
||||
typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool read_OFF(const std::string& fname,
|
||||
Graph& g,
|
||||
const CGAL_BGL_NP_CLASS& np
|
||||
const CGAL_NP_CLASS& np = parameters::default_values()
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
|
||||
#endif
|
||||
|
|
@ -264,17 +247,6 @@ bool read_OFF(const std::string& fname,
|
|||
return read_OFF(is, g, np);
|
||||
}
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
template <typename Graph>
|
||||
bool read_OFF(const std::string& fname, Graph& g,
|
||||
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
|
||||
|
|
@ -284,8 +256,8 @@ bool read_OFF(const std::string& fname, Graph& g,
|
|||
|
||||
\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)
|
||||
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
CGAL_DEPRECATED bool read_off(std::istream& is, Graph& g, const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
return IO::read_OFF(is, g, np);
|
||||
}
|
||||
|
|
@ -295,28 +267,15 @@ CGAL_DEPRECATED bool read_off(std::istream& is, Graph& g, const CGAL_BGL_NP_CLAS
|
|||
|
||||
\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)
|
||||
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
CGAL_DEPRECATED bool read_off(const char* fname, Graph& g, const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
return IO::read_OFF(fname, g, np);
|
||||
}
|
||||
|
||||
template <typename Graph>
|
||||
CGAL_DEPRECATED bool read_off(std::istream& is, Graph& g)
|
||||
{
|
||||
return read_off(is, g, parameters::all_default());
|
||||
}
|
||||
|
||||
template <typename Graph>
|
||||
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());
|
||||
return read_off(fname.c_str(), g, parameters::default_values());
|
||||
}
|
||||
|
||||
#endif // CGAL_NO_DEPRECATED_CODE
|
||||
|
|
@ -328,10 +287,10 @@ CGAL_DEPRECATED bool read_off(const std::string& fname, Graph& g)
|
|||
namespace IO {
|
||||
namespace internal {
|
||||
|
||||
template <typename Graph, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool write_OFF_BGL(std::ostream& os,
|
||||
const Graph& g,
|
||||
const CGAL_BGL_NP_CLASS& np)
|
||||
const CGAL_NP_CLASS& np)
|
||||
{
|
||||
internal::Generic_facegraph_printer<std::ostream, Graph, CGAL::File_writer_OFF> printer(os);
|
||||
return printer(g, np);
|
||||
|
|
@ -401,10 +360,10 @@ bool write_OFF_BGL(std::ostream& os,
|
|||
\sa Overloads of this function for specific models of the concept `FaceGraph`.
|
||||
*/
|
||||
template <typename Graph,
|
||||
typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool write_OFF(std::ostream& os,
|
||||
const Graph& g,
|
||||
const CGAL_BGL_NP_CLASS& np
|
||||
const CGAL_NP_CLASS& np = parameters::default_values()
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
|
||||
#endif
|
||||
|
|
@ -413,17 +372,6 @@ bool write_OFF(std::ostream& os,
|
|||
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<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
|
||||
{
|
||||
return write_OFF(os, g, parameters::all_default());
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
|
||||
/*!
|
||||
\ingroup PkgBGLIoFuncsOFF
|
||||
|
||||
|
|
@ -486,10 +434,10 @@ bool write_OFF(std::ostream& os, const Graph& g,
|
|||
\sa Overloads of this function for specific models of the concept `FaceGraph`.
|
||||
*/
|
||||
template <typename Graph,
|
||||
typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool write_OFF(const std::string& fname,
|
||||
const Graph& g,
|
||||
const CGAL_BGL_NP_CLASS& np
|
||||
const CGAL_NP_CLASS& np = parameters::default_values()
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
|
||||
#endif
|
||||
|
|
@ -505,17 +453,6 @@ bool write_OFF(const std::string& fname,
|
|||
return write_OFF(os, g, np);
|
||||
}
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
template <typename Graph>
|
||||
bool write_OFF(const std::string& fname, const Graph& g,
|
||||
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
|
||||
|
|
@ -525,33 +462,23 @@ bool write_OFF(const std::string& fname, const Graph& g,
|
|||
|
||||
\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)
|
||||
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
CGAL_DEPRECATED bool write_off(std::ostream& os, const Graph& g, const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
return IO::write_OFF(os, g, np);
|
||||
}
|
||||
|
||||
template <typename Graph>
|
||||
CGAL_DEPRECATED bool write_off(std::ostream& os, const Graph& g)
|
||||
{
|
||||
return write_off(os, g, CGAL::parameters::all_default());
|
||||
}
|
||||
/*!
|
||||
\ingroup PkgBGLIOFctDeprecated
|
||||
|
||||
\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)
|
||||
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
CGAL_DEPRECATED bool write_off(const char* fname, const Graph& g, const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
return IO::write_OFF(fname, g, np);
|
||||
}
|
||||
|
||||
template <typename Graph>
|
||||
CGAL_DEPRECATED bool write_off(const char* fname, const Graph& g)
|
||||
{
|
||||
return write_off(fname, g, parameters::all_default());
|
||||
}
|
||||
#endif // CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
} // namespace CGAL
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
#include <CGAL/IO/helpers.h>
|
||||
|
||||
#include <CGAL/boost/graph/IO/Generic_facegraph_builder.h>
|
||||
#include <CGAL/boost/graph/Named_function_parameters.h>
|
||||
#include <CGAL/Named_function_parameters.h>
|
||||
#include <CGAL/boost/graph/named_params_helper.h>
|
||||
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
|
|
@ -24,11 +24,6 @@
|
|||
#include <fstream>
|
||||
#include <string>
|
||||
|
||||
#ifdef DOXYGEN_RUNNING
|
||||
#define CGAL_BGL_NP_TEMPLATE_PARAMETERS NamedParameters
|
||||
#define CGAL_BGL_NP_CLASS NamedParameters
|
||||
#endif
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -63,12 +58,12 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
template <typename Graph, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool read_PLY_BGL(std::istream& is,
|
||||
Graph& g,
|
||||
const CGAL_BGL_NP_CLASS& np)
|
||||
const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
typedef typename CGAL::GetVertexPointMap<Graph, CGAL_BGL_NP_CLASS>::type VPM;
|
||||
typedef typename CGAL::GetVertexPointMap<Graph, CGAL_NP_CLASS>::type VPM;
|
||||
typedef typename boost::property_traits<VPM>::value_type Point;
|
||||
|
||||
internal::PLY_builder<Graph, Point> builder(is);
|
||||
|
|
@ -136,10 +131,10 @@ bool read_PLY_BGL(std::istream& is,
|
|||
\sa Overloads of this function for specific models of the concept `FaceGraph`.
|
||||
*/
|
||||
template <typename Graph,
|
||||
typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool read_PLY(std::istream& is,
|
||||
Graph& g,
|
||||
const CGAL_BGL_NP_CLASS& np
|
||||
const CGAL_NP_CLASS& np = parameters::default_values()
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
|
||||
#endif
|
||||
|
|
@ -148,17 +143,6 @@ bool read_PLY(std::istream& is,
|
|||
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<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
|
||||
{
|
||||
return internal::read_PLY_BGL(is, g, parameters::all_default());
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
|
||||
/*!
|
||||
\ingroup PkgBGLIoFuncsPLY
|
||||
|
||||
|
|
@ -222,10 +206,10 @@ bool read_PLY(std::istream& is, Graph& g,
|
|||
\sa Overloads of this function for specific models of the concept `FaceGraph`.
|
||||
*/
|
||||
template <typename Graph,
|
||||
typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool read_PLY(const std::string& fname,
|
||||
Graph& g,
|
||||
const CGAL_BGL_NP_CLASS& np
|
||||
const CGAL_NP_CLASS& np = parameters::default_values()
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
|
||||
#endif
|
||||
|
|
@ -246,17 +230,6 @@ bool read_PLY(const std::string& fname,
|
|||
}
|
||||
}
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
template <typename Graph>
|
||||
bool read_PLY(const std::string& fname, Graph& g,
|
||||
typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
|
||||
{
|
||||
return read_PLY(fname, g, parameters::all_default());
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Write
|
||||
|
|
@ -319,11 +292,11 @@ bool read_PLY(const std::string& fname, Graph& g,
|
|||
|
||||
\returns `true` if writing was successful, `false` otherwise.
|
||||
*/
|
||||
template <typename Graph, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool write_PLY(std::ostream& os,
|
||||
const Graph& g,
|
||||
const std::string& comments,
|
||||
const CGAL_BGL_NP_CLASS& np
|
||||
const CGAL_NP_CLASS& np = parameters::default_values()
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
|
||||
#endif
|
||||
|
|
@ -333,17 +306,17 @@ bool write_PLY(std::ostream& os,
|
|||
typedef typename boost::graph_traits<Graph>::halfedge_descriptor halfedge_descriptor;
|
||||
typedef typename boost::graph_traits<Graph>::face_descriptor face_descriptor;
|
||||
|
||||
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 CGAL::GetInitializedVertexIndexMap<Graph, CGAL_NP_CLASS>::const_type VIMap;
|
||||
typedef typename GetVertexPointMap<Graph, CGAL_NP_CLASS>::const_type Vpm;
|
||||
typedef typename boost::property_traits<Vpm>::value_type Point_3;
|
||||
typedef CGAL::IO::Color Color;
|
||||
typedef typename internal_np::Lookup_named_param_def<
|
||||
internal_np::vertex_color_map_t,
|
||||
CGAL_BGL_NP_CLASS,
|
||||
CGAL_NP_CLASS,
|
||||
Constant_property_map<vertex_descriptor, Color> >::type VCM;
|
||||
typedef typename internal_np::Lookup_named_param_def<
|
||||
internal_np::face_color_map_t,
|
||||
CGAL_BGL_NP_CLASS,
|
||||
CGAL_NP_CLASS,
|
||||
Constant_property_map<face_descriptor, Color> >::type FCM;
|
||||
|
||||
using parameters::choose_parameter;
|
||||
|
|
@ -353,8 +326,8 @@ bool write_PLY(std::ostream& os,
|
|||
VCM vcm = choose_parameter(get_parameter(np, internal_np::vertex_color_map), VCM());
|
||||
FCM fcm = choose_parameter(get_parameter(np, internal_np::face_color_map), FCM());
|
||||
|
||||
bool has_vcolor = !is_default_parameter(get_parameter(np, internal_np::vertex_color_map));
|
||||
bool has_fcolor = !is_default_parameter(get_parameter(np, internal_np::face_color_map));
|
||||
bool has_vcolor = !is_default_parameter<CGAL_NP_CLASS, internal_np::vertex_color_map_t>();
|
||||
bool has_fcolor = !is_default_parameter<CGAL_NP_CLASS, internal_np::face_color_map_t>();
|
||||
VIMap vim = CGAL::get_initialized_vertex_index_map(g, np);
|
||||
Vpm vpm = choose_parameter(get_parameter(np, internal_np::vertex_point),
|
||||
get_const_property_map(boost::vertex_point, g));
|
||||
|
|
@ -446,27 +419,13 @@ bool write_PLY(std::ostream& os,
|
|||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
template <typename Graph>
|
||||
bool write_PLY(std::ostream& os, const Graph& g, const std::string& comments,
|
||||
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,
|
||||
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool write_PLY(std::ostream& os, const Graph& g, const CGAL_NP_CLASS& np = parameters::default_values(),
|
||||
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<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
|
||||
{
|
||||
return write_PLY(os, g, std::string(), parameters::all_default());
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
|
||||
/*!
|
||||
|
|
@ -529,11 +488,11 @@ bool write_PLY(std::ostream& os, const Graph& g,
|
|||
|
||||
\returns `true` if writing was successful, `false` otherwise.
|
||||
*/
|
||||
template <typename Graph, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool write_PLY(const std::string& fname,
|
||||
const Graph& g,
|
||||
const std::string& comments,
|
||||
const CGAL_BGL_NP_CLASS& np
|
||||
const CGAL_NP_CLASS& np = parameters::default_values()
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
, typename boost::disable_if<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr
|
||||
#endif
|
||||
|
|
@ -557,27 +516,13 @@ bool write_PLY(const std::string& fname,
|
|||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
template <typename Graph>
|
||||
bool write_PLY(const std::string& fname, const Graph& g, const std::string comments,
|
||||
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,
|
||||
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool write_PLY(const std::string& fname, const Graph& g, const CGAL_NP_CLASS& np = parameters::default_values(),
|
||||
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<internal::is_Point_set_or_Range_or_Iterator<Graph> >::type* = nullptr)
|
||||
{
|
||||
return write_PLY(fname, g, std::string(), parameters::all_default());
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
|
||||
} } // namespace CGAL::IO
|
||||
|
|
|
|||
|
|
@ -23,11 +23,6 @@
|
|||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
#ifdef DOXYGEN_RUNNING
|
||||
#define CGAL_BGL_NP_TEMPLATE_PARAMETERS NamedParameters
|
||||
#define CGAL_BGL_NP_CLASS NamedParameters
|
||||
#endif
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -103,12 +98,12 @@ public:
|
|||
|
||||
\sa Overloads of this function for specific models of the concept `FaceGraph`.
|
||||
*/
|
||||
template <typename Graph, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool read_STL(std::istream& is,
|
||||
Graph& g,
|
||||
const CGAL_BGL_NP_CLASS& np)
|
||||
const CGAL_NP_CLASS& np)
|
||||
{
|
||||
typedef typename CGAL::GetVertexPointMap<Graph, CGAL_BGL_NP_CLASS>::type VPM;
|
||||
typedef typename CGAL::GetVertexPointMap<Graph, CGAL_NP_CLASS>::type VPM;
|
||||
typedef typename boost::property_traits<VPM>::value_type Point;
|
||||
if(!is.good())
|
||||
return false;
|
||||
|
|
@ -160,10 +155,10 @@ bool read_STL(std::istream& is,
|
|||
|
||||
\sa Overloads of this function for specific models of the concept `FaceGraph`.
|
||||
*/
|
||||
template <typename Graph, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool read_STL(const std::string& fname,
|
||||
Graph& g, const
|
||||
CGAL_BGL_NP_CLASS& np)
|
||||
CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
using parameters::choose_parameter;
|
||||
using parameters::get_parameter;
|
||||
|
|
@ -182,7 +177,7 @@ bool read_STL(const std::string& fname,
|
|||
std::ifstream is(fname);
|
||||
CGAL::IO::set_mode(is, CGAL::IO::ASCII);
|
||||
|
||||
typedef typename CGAL::GetVertexPointMap<Graph, CGAL_BGL_NP_CLASS>::type VPM;
|
||||
typedef typename CGAL::GetVertexPointMap<Graph, CGAL_NP_CLASS>::type VPM;
|
||||
VPM vpm = choose_parameter(get_parameter(np, internal_np::vertex_point),
|
||||
get_property_map(CGAL::vertex_point, g));
|
||||
bool v = choose_parameter(get_parameter(np, internal_np::verbose),
|
||||
|
|
@ -193,9 +188,7 @@ bool read_STL(const std::string& fname,
|
|||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
template <typename Graph>
|
||||
bool read_STL(std::istream& is, Graph& g) { return read_STL(is, g, parameters::all_default()); }
|
||||
template <typename Graph>
|
||||
bool read_STL(const std::string& fname, Graph& g) { return read_STL(fname, g, parameters::all_default()); }
|
||||
bool read_STL(std::istream& is, Graph& g) { return read_STL(is, g, parameters::default_values()); }
|
||||
|
||||
/// \endcond
|
||||
|
||||
|
|
@ -241,15 +234,15 @@ bool read_STL(const std::string& fname, Graph& g) { return read_STL(fname, g, pa
|
|||
|
||||
\returns `true` if writing was successful, `false` otherwise.
|
||||
*/
|
||||
template <typename Graph, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool write_STL(std::ostream& os,
|
||||
const Graph& g,
|
||||
const CGAL_BGL_NP_CLASS& np)
|
||||
const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
typedef typename boost::graph_traits<Graph>::halfedge_descriptor halfedge_descriptor;
|
||||
typedef typename boost::graph_traits<Graph>::face_descriptor face_descriptor;
|
||||
|
||||
typedef typename CGAL::GetVertexPointMap<Graph, CGAL_BGL_NP_CLASS>::const_type VPM;
|
||||
typedef typename CGAL::GetVertexPointMap<Graph, CGAL_NP_CLASS>::const_type VPM;
|
||||
typedef typename boost::property_traits<VPM>::reference Point_ref;
|
||||
typedef typename boost::property_traits<VPM>::value_type Point;
|
||||
typedef typename Kernel_traits<Point>::Kernel::Vector_3 Vector;
|
||||
|
|
@ -358,8 +351,8 @@ bool write_STL(std::ostream& os,
|
|||
|
||||
\sa Overloads of this function for specific models of the concept `FaceGraph`.
|
||||
*/
|
||||
template <typename Graph, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
bool write_STL(const std::string& fname, const Graph& g, const CGAL_BGL_NP_CLASS& np)
|
||||
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool write_STL(const std::string& fname, const Graph& g, const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
const bool binary = CGAL::parameters::choose_parameter(CGAL::parameters::get_parameter(np, internal_np::use_binary_mode), true);
|
||||
if(binary)
|
||||
|
|
@ -377,15 +370,6 @@ bool write_STL(const std::string& fname, const Graph& g, const CGAL_BGL_NP_CLASS
|
|||
}
|
||||
}
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
template <typename Graph>
|
||||
bool write_STL(std::ostream& os, const Graph& g) { return write_STL(os, g, parameters::all_default()); }
|
||||
template <typename Graph>
|
||||
bool write_STL(const std::string& fname, const Graph& g) { return write_STL(fname, g, parameters::all_default()); }
|
||||
|
||||
/// \endcond
|
||||
|
||||
}} // namespace CGAL::IO
|
||||
|
||||
#endif // CGAL_BGL_IO_STL_H
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
#include <CGAL/boost/graph/Euler_operations.h>
|
||||
#include <CGAL/boost/graph/iterator.h>
|
||||
#include <CGAL/boost/graph/Named_function_parameters.h>
|
||||
#include <CGAL/Named_function_parameters.h>
|
||||
#include <CGAL/boost/graph/named_params_helper.h>
|
||||
|
||||
#include <fstream>
|
||||
|
|
@ -32,12 +32,6 @@
|
|||
|
||||
#if defined(CGAL_USE_VTK) || defined(DOXYGEN_RUNNING)
|
||||
|
||||
#ifdef DOXYGEN_RUNNING
|
||||
#define CGAL_BGL_NP_TEMPLATE_PARAMETERS NamedParameters
|
||||
#define CGAL_BGL_NP_CLASS NamedParameters
|
||||
#define CGAL_DEPRECATED
|
||||
#endif
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -146,10 +140,10 @@ bool vtkPointSet_to_polygon_mesh(vtkPointSet* poly_data,
|
|||
* \returns `true` if reading was successful, `false` otherwise.
|
||||
*/
|
||||
template<typename Graph,
|
||||
typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool read_VTP(const std::string& fname,
|
||||
Graph& g,
|
||||
const CGAL_BGL_NP_CLASS& np)
|
||||
const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
std::ifstream test(fname);
|
||||
if(!test.good())
|
||||
|
|
@ -168,13 +162,6 @@ bool read_VTP(const std::string& fname,
|
|||
return internal::vtkPointSet_to_polygon_mesh(data, g, np);
|
||||
}
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
template<typename Graph>
|
||||
bool read_VTP(const std::string& fname, Graph& g) { return read_VTP(fname, g, parameters::all_default()); }
|
||||
|
||||
/// \endcond
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Write
|
||||
|
|
@ -425,10 +412,10 @@ void write_polys_points(std::ostream& os,
|
|||
*
|
||||
* \returns `true` if writing was successful, `false` otherwise.
|
||||
*/
|
||||
template<typename Graph, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
template<typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool write_VTP(std::ostream& os,
|
||||
const Graph& g,
|
||||
const CGAL_BGL_NP_CLASS& np)
|
||||
const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
using parameters::get_parameter;
|
||||
using parameters::choose_parameter;
|
||||
|
|
@ -524,8 +511,8 @@ bool write_VTP(std::ostream& os,
|
|||
*
|
||||
* \returns `true` if writing was successful, `false` otherwise.
|
||||
*/
|
||||
template<typename Graph, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
bool write_VTP(const std::string& fname, const Graph& g, const CGAL_BGL_NP_CLASS& np)
|
||||
template<typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool write_VTP(const std::string& fname, const Graph& g, const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
const bool binary = CGAL::parameters::choose_parameter(CGAL::parameters::get_parameter(np, internal_np::use_binary_mode), true);
|
||||
std::ofstream os;
|
||||
|
|
@ -539,14 +526,6 @@ bool write_VTP(const std::string& fname, const Graph& g, const CGAL_BGL_NP_CLASS
|
|||
return write_VTP(os, g, np);
|
||||
}
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
template<typename Graph>
|
||||
bool write_VTP(std::ostream& os, const Graph& g) { return write_VTP(os, g, CGAL::parameters::all_default()); }
|
||||
template<typename Graph>
|
||||
bool write_VTP(const std::string& fname, const Graph& g) { return write_VTP(fname, g, parameters::all_default()); }
|
||||
|
||||
/// \endcond
|
||||
|
||||
} // namespace IO
|
||||
|
||||
|
|
@ -557,18 +536,12 @@ bool write_VTP(const std::string& fname, const Graph& g) { return write_VTP(fnam
|
|||
|
||||
\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)
|
||||
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
CGAL_DEPRECATED bool write_vtp(std::ostream& os, const Graph& g, const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
return IO::write_VTP(os, g, np);
|
||||
}
|
||||
|
||||
template <typename Graph>
|
||||
CGAL_DEPRECATED bool write_vtp(std::ostream& os, const Graph& g)
|
||||
{
|
||||
return write_vtp(os, g, parameters::all_default());
|
||||
}
|
||||
|
||||
#endif // CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
} // namespace CGAL
|
||||
|
|
|
|||
|
|
@ -16,18 +16,12 @@
|
|||
|
||||
#include <CGAL/boost/graph/IO/Generic_facegraph_printer.h>
|
||||
|
||||
#include <CGAL/boost/graph/Named_function_parameters.h>
|
||||
#include <CGAL/Named_function_parameters.h>
|
||||
#include <CGAL/boost/graph/named_params_helper.h>
|
||||
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
|
||||
#ifdef DOXYGEN_RUNNING
|
||||
#define CGAL_BGL_NP_TEMPLATE_PARAMETERS NamedParameters
|
||||
#define CGAL_BGL_NP_CLASS NamedParameters
|
||||
#define CGAL_DEPRECATED
|
||||
#endif
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
namespace IO {
|
||||
|
|
@ -67,10 +61,10 @@ namespace IO {
|
|||
|
||||
\returns `true` if writing was successful, `false` otherwise.
|
||||
*/
|
||||
template <typename Graph, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool write_WRL(std::ostream& os,
|
||||
const Graph& g,
|
||||
const CGAL_BGL_NP_CLASS& np)
|
||||
const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
CGAL::VRML_2_ostream vos(os);
|
||||
internal::Generic_facegraph_printer<CGAL::VRML_2_ostream, Graph, CGAL::File_writer_VRML_2> printer(vos);
|
||||
|
|
@ -108,18 +102,13 @@ bool write_WRL(std::ostream& os,
|
|||
|
||||
\returns `true` if writing was successful, `false` otherwise.
|
||||
*/
|
||||
template <typename Graph, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
bool write_WRL(const std::string& fname, const Graph& g, const CGAL_BGL_NP_CLASS& np)
|
||||
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool write_WRL(const std::string& fname, const Graph& g, const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
std::ofstream os(fname);
|
||||
return write_WRL(os, g, np);
|
||||
}
|
||||
|
||||
template <typename Graph>
|
||||
bool write_WRL(std::ostream& os, const Graph& g) { return write_WRL(os, g, parameters::all_default()); }
|
||||
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
|
||||
|
|
@ -129,18 +118,12 @@ bool write_WRL(const std::string& fname, const Graph& g) { return write_WRL(fnam
|
|||
|
||||
\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)
|
||||
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
CGAL_DEPRECATED bool write_wrl(std::ostream& os, const Graph& g, const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
return IO::write_WRL(os, g, np);
|
||||
}
|
||||
|
||||
template <typename Graph>
|
||||
CGAL_DEPRECATED bool write_wrl(std::ostream& os, const Graph& g)
|
||||
{
|
||||
return write_wrl(os, g, parameters::all_default());
|
||||
}
|
||||
|
||||
#endif // CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
} // namespace CGAL
|
||||
|
|
|
|||
|
|
@ -36,10 +36,10 @@ namespace IO {
|
|||
|
||||
//not for now : some readers will return "ok" despite not managing to read anything
|
||||
/*
|
||||
template <class Graph, typename NamedParameters>
|
||||
template <class Graph, typename NamedParameters = parameters::Default_named_parameters>
|
||||
bool read_polygon_mesh(std::istream& is,
|
||||
Graph& g,
|
||||
const NamedParameters& np)
|
||||
const NamedParameters& np = parameters::default_values())
|
||||
{
|
||||
bool ok = false;
|
||||
ok = read_OFF(is, g, np, false);
|
||||
|
|
@ -70,12 +70,6 @@ bool read_polygon_mesh(std::istream& is,
|
|||
return ok;
|
||||
}
|
||||
|
||||
template <class Graph>
|
||||
bool read_polygon_mesh(std::istream& is,
|
||||
Graph& g)
|
||||
{
|
||||
return read_polygon_mesh(is, g, parameters::all_default());
|
||||
}
|
||||
*/
|
||||
|
||||
/*!
|
||||
|
|
@ -125,10 +119,10 @@ bool read_polygon_mesh(std::istream& is,
|
|||
*
|
||||
* \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>
|
||||
template <class Graph, typename NamedParameters = parameters::Default_named_parameters>
|
||||
bool read_polygon_mesh(const std::string& fname,
|
||||
Graph& g,
|
||||
const NamedParameters& np)
|
||||
const NamedParameters& np = parameters::default_values())
|
||||
{
|
||||
const bool verbose = parameters::choose_parameter(parameters::get_parameter(np, internal_np::verbose), false);
|
||||
|
||||
|
|
@ -164,16 +158,6 @@ bool read_polygon_mesh(const std::string& fname,
|
|||
return false;
|
||||
}
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
template <class Graph>
|
||||
bool read_polygon_mesh(const std::string& fname, Graph& g)
|
||||
{
|
||||
return read_polygon_mesh(fname, g, parameters::all_default());
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Write
|
||||
|
|
@ -228,10 +212,10 @@ bool read_polygon_mesh(const std::string& fname, Graph& g)
|
|||
*
|
||||
* \return `true` if writing was successful, `false` otherwise.
|
||||
*/
|
||||
template <class Graph, typename NamedParameters>
|
||||
template <class Graph, typename NamedParameters = parameters::Default_named_parameters>
|
||||
bool write_polygon_mesh(const std::string& fname,
|
||||
Graph& g,
|
||||
const NamedParameters& np)
|
||||
const NamedParameters& np = parameters::default_values())
|
||||
{
|
||||
const bool verbose = parameters::choose_parameter(parameters::get_parameter(np, internal_np::verbose), false);
|
||||
|
||||
|
|
@ -267,16 +251,6 @@ bool write_polygon_mesh(const std::string& fname,
|
|||
return false;
|
||||
}
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
template <class Graph>
|
||||
bool write_polygon_mesh(const std::string& fname, Graph& g)
|
||||
{
|
||||
return write_polygon_mesh(fname, g, parameters::all_default());
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
|
||||
}} // namespace CGAL::IO
|
||||
|
||||
#endif // CGAL_BOOST_GRAPH_POLYGON_MESH_IO_H
|
||||
|
|
|
|||
|
|
@ -17,7 +17,7 @@
|
|||
#include <CGAL/boost/graph/copy_face_graph.h>
|
||||
#include <CGAL/boost/graph/Face_filtered_graph.h>
|
||||
#include <CGAL/boost/graph/helpers.h>
|
||||
#include <CGAL/boost/graph/Named_function_parameters.h>
|
||||
#include <CGAL/Named_function_parameters.h>
|
||||
#include <CGAL/boost/graph/named_params_helper.h>
|
||||
|
||||
#include <CGAL/assertions.h>
|
||||
|
|
@ -184,20 +184,14 @@ void partition_dual_graph(const TriangleMesh& tm, int nparts,
|
|||
///
|
||||
/// \pre `tm` is a pure triangular surface mesh: there are no edges
|
||||
/// without at least one incident face
|
||||
template<typename TriangleMesh, typename NamedParameters>
|
||||
void partition_dual_graph(const TriangleMesh& tm, int nparts, const NamedParameters& np)
|
||||
template<typename TriangleMesh, typename NamedParameters = parameters::Default_named_parameters>
|
||||
void partition_dual_graph(const TriangleMesh& tm, int nparts, const NamedParameters& np = parameters::default_values())
|
||||
{
|
||||
using parameters::get_parameter;
|
||||
|
||||
return partition_dual_graph(tm, nparts, get_parameter(np, internal_np::METIS_options), np);
|
||||
}
|
||||
|
||||
template<typename TriangleMesh>
|
||||
void partition_dual_graph(const TriangleMesh& tm, const int nparts)
|
||||
{
|
||||
return partition_dual_graph(tm, nparts, CGAL::parameters::all_default());
|
||||
}
|
||||
|
||||
} // end namespace METIS
|
||||
|
||||
} // end namespace CGAL
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
#include <CGAL/boost/graph/copy_face_graph.h>
|
||||
#include <CGAL/boost/graph/Face_filtered_graph.h>
|
||||
#include <CGAL/boost/graph/helpers.h>
|
||||
#include <CGAL/boost/graph/Named_function_parameters.h>
|
||||
#include <CGAL/Named_function_parameters.h>
|
||||
#include <CGAL/boost/graph/named_params_helper.h>
|
||||
|
||||
#include <CGAL/assertions.h>
|
||||
|
|
@ -217,20 +217,14 @@ void partition_graph(const TriangleMesh& tm, int nparts,
|
|||
///
|
||||
/// \pre `tm` is a pure triangular surface mesh: there are no edges
|
||||
/// without at least one incident face
|
||||
template<typename TriangleMesh, typename NamedParameters>
|
||||
void partition_graph(const TriangleMesh& tm, int nparts, const NamedParameters& np)
|
||||
template<typename TriangleMesh, typename NamedParameters = parameters::Default_named_parameters>
|
||||
void partition_graph(const TriangleMesh& tm, int nparts, const NamedParameters& np = parameters::default_values())
|
||||
{
|
||||
using parameters::get_parameter;
|
||||
|
||||
return partition_graph(tm, nparts, get_parameter(np, internal_np::METIS_options), np);
|
||||
}
|
||||
|
||||
template<typename TriangleMesh>
|
||||
void partition_graph(const TriangleMesh& tm, const int nparts)
|
||||
{
|
||||
return partition_graph(tm, nparts, CGAL::parameters::all_default());
|
||||
}
|
||||
|
||||
} // end namespace METIS
|
||||
|
||||
} // end namespace CGAL
|
||||
|
|
|
|||
|
|
@ -19,10 +19,11 @@
|
|||
|
||||
#include <CGAL/circulator.h>
|
||||
#include <CGAL/Unique_hash_map.h>
|
||||
#include <CGAL/assertions.h>
|
||||
|
||||
#include <boost/iterator/iterator_facade.hpp>
|
||||
#include <boost/unordered_set.hpp>
|
||||
|
||||
#include <unordered_set>
|
||||
#include <fstream>
|
||||
#include <functional>
|
||||
#include <iostream>
|
||||
|
|
@ -934,7 +935,7 @@ public:
|
|||
|
||||
void build_TM_vertices_vector(std::vector<TM_vertex_descriptor>& tm_vds) const
|
||||
{
|
||||
assert(tm_vds.empty());
|
||||
CGAL_precondition(tm_vds.empty());
|
||||
|
||||
// If the input is a list of integers, we need to build a correspondence
|
||||
// between vertices and integers.
|
||||
|
|
@ -1008,7 +1009,7 @@ public:
|
|||
TM_halfedge_descriptor add_seams(InputIterator first, InputIterator last)
|
||||
{
|
||||
// must have an even number of input vertices
|
||||
assert(std::distance(first, last) % 2 == 0);
|
||||
CGAL_precondition(std::distance(first, last) % 2 == 0);
|
||||
|
||||
TM_halfedge_descriptor tmhd = boost::graph_traits<TM>::null_halfedge();
|
||||
InputIterator it = first;
|
||||
|
|
|
|||
|
|
@ -20,7 +20,7 @@
|
|||
#endif
|
||||
#include <CGAL/IO/trace.h>
|
||||
|
||||
#include <CGAL/boost/graph/Named_function_parameters.h>
|
||||
#include <CGAL/Named_function_parameters.h>
|
||||
#include <CGAL/boost/graph/named_params_helper.h>
|
||||
|
||||
#include <boost/version.hpp>
|
||||
|
|
@ -508,12 +508,12 @@ template <typename InputGraph,
|
|||
typename EdgeCostMap,
|
||||
typename VertexLabelCostMap,
|
||||
typename VertexLabelMap,
|
||||
typename NamedParameters>
|
||||
typename NamedParameters = parameters::Default_named_parameters>
|
||||
double alpha_expansion_graphcut (const InputGraph& input_graph,
|
||||
EdgeCostMap edge_cost_map,
|
||||
VertexLabelCostMap vertex_label_cost_map,
|
||||
VertexLabelMap vertex_label_map,
|
||||
const NamedParameters& np)
|
||||
const NamedParameters& np = parameters::default_values())
|
||||
{
|
||||
using parameters::choose_parameter;
|
||||
using parameters::get_parameter;
|
||||
|
|
@ -660,22 +660,7 @@ double alpha_expansion_graphcut (const InputGraph& input_graph,
|
|||
return min_cut;
|
||||
}
|
||||
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
// variant with default NP
|
||||
template <typename InputGraph,
|
||||
typename EdgeCostMap,
|
||||
typename VertexLabelCostMap,
|
||||
typename VertexLabelMap>
|
||||
double alpha_expansion_graphcut (const InputGraph& input_graph,
|
||||
EdgeCostMap edge_cost_map,
|
||||
VertexLabelCostMap vertex_label_cost_map,
|
||||
VertexLabelMap vertex_label_map)
|
||||
{
|
||||
return alpha_expansion_graphcut (input_graph, edge_cost_map,
|
||||
vertex_label_cost_map, vertex_label_map,
|
||||
CGAL::parameters::all_default());
|
||||
}
|
||||
|
||||
// Old API
|
||||
inline double alpha_expansion_graphcut (const std::vector<std::pair<std::size_t, std::size_t> >& edges,
|
||||
|
|
|
|||
|
|
@ -20,13 +20,14 @@
|
|||
#include <CGAL/boost/graph/Euler_operations.h>
|
||||
#include <CGAL/boost/graph/iterator.h>
|
||||
#include <CGAL/boost/graph/helpers.h>
|
||||
#include <CGAL/boost/graph/Named_function_parameters.h>
|
||||
#include <CGAL/Named_function_parameters.h>
|
||||
#include <CGAL/boost/graph/named_params_helper.h>
|
||||
#include <CGAL/property_map.h>
|
||||
#include <boost/unordered_map.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/iterator/function_output_iterator.hpp>
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
namespace internal {
|
||||
|
|
@ -351,21 +352,12 @@ inline Emptyset_iterator make_functor(const internal_np::Param_not_found&)
|
|||
Other properties are not copied.
|
||||
*/
|
||||
template <typename SourceMesh, typename TargetMesh,
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
typename T1, typename Tag1, typename Base1,
|
||||
typename T2, typename Tag2, typename Base2
|
||||
#else
|
||||
typename NamedParameters1, typename NamedParameters2
|
||||
#endif
|
||||
typename NamedParameters1 = parameters::Default_named_parameters,
|
||||
typename NamedParameters2 = parameters::Default_named_parameters
|
||||
>
|
||||
void copy_face_graph(const SourceMesh& sm, TargetMesh& tm,
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
const CGAL::Named_function_parameters<T1,Tag1,Base1>& np1,
|
||||
const CGAL::Named_function_parameters<T2,Tag2,Base2>& np2
|
||||
#else
|
||||
const NamedParameters1& np1,
|
||||
const NamedParameters2& np2
|
||||
#endif
|
||||
const NamedParameters1& np1 = parameters::default_values(),
|
||||
const NamedParameters2& np2 = parameters::default_values()
|
||||
)
|
||||
{
|
||||
using parameters::choose_parameter;
|
||||
|
|
@ -384,55 +376,6 @@ void copy_face_graph(const SourceMesh& sm, TargetMesh& tm,
|
|||
get(vertex_point, tm)));
|
||||
}
|
||||
|
||||
template <typename SourceMesh, typename TargetMesh>
|
||||
void copy_face_graph(const SourceMesh& sm, TargetMesh& tm)
|
||||
{
|
||||
copy_face_graph(sm, tm, parameters::all_default(), parameters::all_default());
|
||||
}
|
||||
|
||||
template <typename SourceMesh, typename TargetMesh,
|
||||
typename T, typename Tag, typename Base >
|
||||
void copy_face_graph(const SourceMesh& sm, TargetMesh& tm,
|
||||
const CGAL::Named_function_parameters<T,Tag,Base>& np)
|
||||
{
|
||||
copy_face_graph(sm, tm, np, parameters::all_default());
|
||||
}
|
||||
|
||||
#if !defined(DOXYGEN_RUNNING) && !defined(CGAL_NO_DEPRECATED_CODE)
|
||||
template <typename SourceMesh, typename TargetMesh,
|
||||
typename V2V, typename H2H, typename F2F,
|
||||
typename Src_vpm, typename Tgt_vpm>
|
||||
void copy_face_graph(const SourceMesh& sm, TargetMesh& tm,
|
||||
V2V v2v, H2H h2h, F2F f2f,
|
||||
Src_vpm sm_vpm, Tgt_vpm tm_vpm )
|
||||
{
|
||||
internal::copy_face_graph_impl(sm, tm,
|
||||
v2v, h2h, f2f,
|
||||
sm_vpm, tm_vpm);
|
||||
}
|
||||
|
||||
|
||||
template <typename SourceMesh, typename TargetMesh, typename V2V>
|
||||
void copy_face_graph(const SourceMesh& sm, TargetMesh& tm, V2V v2v)
|
||||
{ copy_face_graph(sm, tm, v2v, Emptyset_iterator(), Emptyset_iterator(),
|
||||
get(vertex_point, sm), get(vertex_point, tm)); }
|
||||
|
||||
template <typename SourceMesh, typename TargetMesh, typename V2V, typename H2H>
|
||||
void copy_face_graph(const SourceMesh& sm, TargetMesh& tm, V2V v2v, H2H h2h)
|
||||
{ copy_face_graph(sm, tm, v2v, h2h, Emptyset_iterator(),
|
||||
get(vertex_point, sm), get(vertex_point, tm)); }
|
||||
|
||||
template <typename SourceMesh, typename TargetMesh, typename V2V, typename H2H, typename F2F>
|
||||
void copy_face_graph(const SourceMesh& sm, TargetMesh& tm, V2V v2v, H2H h2h, F2F f2f)
|
||||
{ copy_face_graph(sm, tm, v2v, h2h, f2f,
|
||||
get(vertex_point, sm), get(vertex_point, tm)); }
|
||||
|
||||
template <typename SourceMesh, typename TargetMesh, typename V2V, typename H2H, typename F2F, typename Src_vpm>
|
||||
void copy_face_graph(const SourceMesh& sm, TargetMesh& tm, V2V v2v, H2H h2h, F2F f2f, Src_vpm sm_vpm)
|
||||
{ copy_face_graph(sm, tm, v2v, h2h, f2f,
|
||||
sm_vpm, get(vertex_point, tm)); }
|
||||
#endif
|
||||
|
||||
} // namespace CGAL
|
||||
|
||||
#endif // CGAL_BOOST_GRAPH_COPY_FACE_GRAPH_H
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
#define CGAL_BOOST_GRAPH_DIJKSTRA_SHORTEST_PATHS_H
|
||||
|
||||
// This will push/pop a VC15 warning
|
||||
#include <CGAL/boost/graph/Named_function_parameters.h>
|
||||
#include <CGAL/Named_function_parameters.h>
|
||||
#include <boost/graph/dijkstra_shortest_paths.hpp>
|
||||
|
||||
#endif // CGAL_BOOST_GRAPH_DIJKSTRA_SHORTEST_PATHS_H
|
||||
|
|
|
|||
|
|
@ -19,6 +19,10 @@
|
|||
#include <CGAL/Random.h>
|
||||
#include <CGAL/function_objects.h>
|
||||
|
||||
#include <array>
|
||||
#include <iterator>
|
||||
#include <vector>
|
||||
|
||||
namespace CGAL {
|
||||
namespace Euler {
|
||||
|
||||
|
|
@ -640,8 +644,9 @@ template<class Graph, class P>
|
|||
typename boost::graph_traits<Graph>::halfedge_descriptor
|
||||
make_icosahedron(Graph& g,
|
||||
const P& center = P(0,0,0),
|
||||
typename CGAL::Kernel_traits<P>::Kernel::FT radius = 1.0)
|
||||
typename CGAL::Kernel_traits<P>::Kernel::FT radius = 1)
|
||||
{
|
||||
typedef typename CGAL::Kernel_traits<P>::Kernel::FT FT;
|
||||
typedef typename boost::property_map<Graph,vertex_point_t>::type Point_property_map;
|
||||
typedef typename boost::graph_traits<Graph>::vertex_descriptor vertex_descriptor;
|
||||
Point_property_map vpmap = get(CGAL::vertex_point, g);
|
||||
|
|
@ -652,70 +657,71 @@ make_icosahedron(Graph& g,
|
|||
for(int i=0; i<12; ++i)
|
||||
v_vertices[i] = add_vertex(g);
|
||||
|
||||
typename CGAL::Kernel_traits<P>::Kernel::FT t = radius * (1.0 + CGAL::approximate_sqrt(5.0)) / 2.0;
|
||||
const FT phi = (FT(1) + CGAL::approximate_sqrt(FT(5))) / FT(2);
|
||||
const FT t = radius / CGAL::approximate_sqrt(1 + square(phi));
|
||||
const FT t_phi = t * phi;
|
||||
|
||||
put(vpmap, v_vertices[0], P(-radius + center.x(), t + center.y(), 0.0 + center.z()));
|
||||
put(vpmap, v_vertices[1], P( radius + center.x(), t + center.y(), 0.0 + center.z()));
|
||||
put(vpmap, v_vertices[2], P(-radius + center.x(), -t + center.y(), 0.0 + center.z()));
|
||||
put(vpmap, v_vertices[3], P( radius + center.x(), -t + center.y(), 0.0 + center.z()));
|
||||
put(vpmap, v_vertices[0], P(center.x(), center.y() + t, center.z() + t_phi));
|
||||
put(vpmap, v_vertices[1], P(center.x(), center.y() + t, center.z() - t_phi));
|
||||
put(vpmap, v_vertices[2], P(center.x(), center.y() - t, center.z() + t_phi));
|
||||
put(vpmap, v_vertices[3], P(center.x(), center.y() - t, center.z() - t_phi));
|
||||
|
||||
put(vpmap, v_vertices[4], P( 0.0 + center.x(), -radius + center.y(), t + center.z()));
|
||||
put(vpmap, v_vertices[5], P( 0.0 + center.x(), radius + center.y(), t + center.z()));
|
||||
put(vpmap, v_vertices[6], P( 0.0 + center.x(), -radius + center.y(), -t + center.z()));
|
||||
put(vpmap, v_vertices[7], P( 0.0 + center.x(), radius + center.y(), -t + center.z()));
|
||||
put(vpmap, v_vertices[4], P(center.x() + t, center.y() + t_phi, center.z()));
|
||||
put(vpmap, v_vertices[5], P(center.x() + t, center.y() - t_phi, center.z()));
|
||||
put(vpmap, v_vertices[6], P(center.x() - t, center.y() + t_phi, center.z()));
|
||||
put(vpmap, v_vertices[7], P(center.x() - t, center.y() - t_phi, center.z()));
|
||||
|
||||
put(vpmap, v_vertices[8], P( t + center.x(), 0.0 + center.y(), -radius + center.z()));
|
||||
put(vpmap, v_vertices[9], P( t + center.x(), 0.0 + center.y(), radius + center.z()));
|
||||
put(vpmap, v_vertices[10], P(-t + center.x(), 0.0 + center.y(), -radius + center.z()));
|
||||
put(vpmap, v_vertices[11], P(-t + center.x(), 0.0 + center.y(), radius + center.z()));
|
||||
put(vpmap, v_vertices[8], P(center.x() + t_phi, center.y(), center.z() + t));
|
||||
put(vpmap, v_vertices[9], P(center.x() + t_phi, center.y(), center.z() - t));
|
||||
put(vpmap, v_vertices[10], P(center.x() - t_phi, center.y(), center.z() + t));
|
||||
put(vpmap, v_vertices[11], P(center.x() - t_phi, center.y(), center.z() - t));
|
||||
|
||||
std::vector<vertex_descriptor> face;
|
||||
face.resize(3);
|
||||
face[1] = v_vertices[0]; face[0] = v_vertices[5]; face[2] = v_vertices[11];
|
||||
std::array<vertex_descriptor, 3> face;
|
||||
face[0] = v_vertices[0]; face[1] = v_vertices[2]; face[2] = v_vertices[8];
|
||||
Euler::add_face(face, g);
|
||||
face[1] = v_vertices[0]; face[0] = v_vertices[1]; face[2] = v_vertices[5];
|
||||
face[0] = v_vertices[0]; face[1] = v_vertices[8]; face[2] = v_vertices[4];
|
||||
Euler::add_face(face, g);
|
||||
face[1] = v_vertices[0]; face[0] = v_vertices[7]; face[2] = v_vertices[1];
|
||||
face[0] = v_vertices[0]; face[1] = v_vertices[4]; face[2] = v_vertices[6];
|
||||
Euler::add_face(face, g);
|
||||
face[1] = v_vertices[0]; face[0] = v_vertices[10]; face[2] = v_vertices[7];
|
||||
face[0] = v_vertices[0]; face[1] = v_vertices[6]; face[2] = v_vertices[10];
|
||||
Euler::add_face(face, g);
|
||||
face[1] = v_vertices[0]; face[0] = v_vertices[11]; face[2] = v_vertices[10];
|
||||
face[0] = v_vertices[0]; face[1] = v_vertices[10]; face[2] = v_vertices[2];
|
||||
Euler::add_face(face, g);
|
||||
|
||||
face[1] = v_vertices[1]; face[0] = v_vertices[9]; face[2] = v_vertices[5];
|
||||
face[0] = v_vertices[1]; face[1] = v_vertices[9]; face[2] = v_vertices[3];
|
||||
Euler::add_face(face, g);
|
||||
face[1] = v_vertices[5]; face[0] = v_vertices[4]; face[2] = v_vertices[11];
|
||||
face[0] = v_vertices[1]; face[1] = v_vertices[3]; face[2] = v_vertices[11];
|
||||
Euler::add_face(face, g);
|
||||
face[1] = v_vertices[11]; face[0] = v_vertices[2]; face[2] = v_vertices[10];
|
||||
face[0] = v_vertices[1]; face[1] = v_vertices[11]; face[2] = v_vertices[6];
|
||||
Euler::add_face(face, g);
|
||||
face[1] = v_vertices[10]; face[0] = v_vertices[6]; face[2] = v_vertices[7];
|
||||
face[0] = v_vertices[1]; face[1] = v_vertices[6]; face[2] = v_vertices[4];
|
||||
Euler::add_face(face, g);
|
||||
face[1] = v_vertices[7]; face[0] = v_vertices[8]; face[2] = v_vertices[1];
|
||||
face[0] = v_vertices[1]; face[1] = v_vertices[4]; face[2] = v_vertices[9];
|
||||
Euler::add_face(face, g);
|
||||
|
||||
face[1] = v_vertices[3]; face[0] = v_vertices[4]; face[2] = v_vertices[9];
|
||||
face[0] = v_vertices[5]; face[1] = v_vertices[8]; face[2] = v_vertices[2];
|
||||
Euler::add_face(face, g);
|
||||
face[1] = v_vertices[3]; face[0] = v_vertices[2]; face[2] = v_vertices[4];
|
||||
face[0] = v_vertices[5]; face[1] = v_vertices[2]; face[2] = v_vertices[7];
|
||||
Euler::add_face(face, g);
|
||||
face[1] = v_vertices[3]; face[0] = v_vertices[6]; face[2] = v_vertices[2];
|
||||
face[0] = v_vertices[5]; face[1] = v_vertices[7]; face[2] = v_vertices[3];
|
||||
Euler::add_face(face, g);
|
||||
face[1] = v_vertices[3]; face[0] = v_vertices[8]; face[2] = v_vertices[6];
|
||||
face[0] = v_vertices[5]; face[1] = v_vertices[3]; face[2] = v_vertices[9];
|
||||
Euler::add_face(face, g);
|
||||
face[1] = v_vertices[3]; face[0] = v_vertices[9]; face[2] = v_vertices[8];
|
||||
face[0] = v_vertices[5]; face[1] = v_vertices[9]; face[2] = v_vertices[8];
|
||||
Euler::add_face(face, g);
|
||||
|
||||
face[1] = v_vertices[4]; face[0] = v_vertices[5]; face[2] = v_vertices[9];
|
||||
face[0] = v_vertices[8]; face[1] = v_vertices[9]; face[2] = v_vertices[4];
|
||||
Euler::add_face(face, g);
|
||||
face[1] = v_vertices[2]; face[0] = v_vertices[11]; face[2] = v_vertices[4];
|
||||
face[0] = v_vertices[3]; face[1] = v_vertices[7]; face[2] = v_vertices[11];
|
||||
Euler::add_face(face, g);
|
||||
face[1] = v_vertices[6]; face[0] = v_vertices[10]; face[2] = v_vertices[2];
|
||||
face[0] = v_vertices[11]; face[1] = v_vertices[7]; face[2] = v_vertices[10];
|
||||
Euler::add_face(face, g);
|
||||
face[1] = v_vertices[8]; face[0] = v_vertices[7]; face[2] = v_vertices[6];
|
||||
face[0] = v_vertices[10]; face[1] = v_vertices[7]; face[2] = v_vertices[2];
|
||||
Euler::add_face(face, g);
|
||||
face[1] = v_vertices[9]; face[0] = v_vertices[1]; face[2] = v_vertices[8];
|
||||
face[0] = v_vertices[6]; face[1] = v_vertices[11]; face[2] = v_vertices[10];
|
||||
Euler::add_face(face, g);
|
||||
|
||||
return halfedge(v_vertices[1], v_vertices[0], g).first;
|
||||
return halfedge(v_vertices[5], v_vertices[0], g).first;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
// Author(s) : Andreas Fabri, Philipp Moeller
|
||||
|
||||
// include this to avoid a VC15 warning
|
||||
#include <CGAL/boost/graph/Named_function_parameters.h>
|
||||
#include <CGAL/Named_function_parameters.h>
|
||||
|
||||
#include <boost/graph/graph_traits.hpp>
|
||||
#include <boost/graph/properties.hpp>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
#define CGAL_BOOST_GRAPH_INITIALIZED_INTERNAL_INDEX_MAPS_HELPERS
|
||||
|
||||
#include <CGAL/assertions.h>
|
||||
#include <CGAL/boost/graph/Named_function_parameters.h>
|
||||
#include <CGAL/Named_function_parameters.h>
|
||||
#include <CGAL/boost/graph/properties.h>
|
||||
#include <CGAL/Dynamic_property_map.h>
|
||||
#include <CGAL/use.h>
|
||||
|
|
@ -271,7 +271,7 @@ get_initialized_index_map(CGAL::internal_np::Param_not_found,
|
|||
|
||||
template <typename PropertyTag, typename Tag, typename DynamicTag,
|
||||
typename Graph,
|
||||
typename NamedParameters = Named_function_parameters<bool, internal_np::all_default_t> >
|
||||
typename NamedParameters = parameters::Default_named_parameters >
|
||||
class GetInitializedIndexMap
|
||||
{
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
#define CGAL_BOOST_GRAPH_NAMED_PARAMETERS_HELPERS_H
|
||||
|
||||
#include <CGAL/boost/graph/internal/initialized_index_maps_helpers.h>
|
||||
#include <CGAL/boost/graph/Named_function_parameters.h>
|
||||
#include <CGAL/Named_function_parameters.h>
|
||||
#include <CGAL/boost/graph/properties.h>
|
||||
#include <CGAL/Dynamic_property_map.h>
|
||||
#include <CGAL/Kernel_traits.h>
|
||||
|
|
@ -122,7 +122,7 @@ namespace CGAL {
|
|||
};
|
||||
|
||||
template<typename PolygonMesh,
|
||||
typename NamedParameters = Named_function_parameters<bool, internal_np::all_default_t> >
|
||||
typename NamedParameters = parameters::Default_named_parameters >
|
||||
class GetVertexPointMap
|
||||
{
|
||||
typedef typename property_map_selector<PolygonMesh, boost::vertex_point_t>::const_type
|
||||
|
|
@ -153,7 +153,7 @@ namespace CGAL {
|
|||
};
|
||||
|
||||
template<typename PolygonMesh,
|
||||
typename NamedParametersGT = Named_function_parameters<bool, internal_np::all_default_t>,
|
||||
typename NamedParametersGT = parameters::Default_named_parameters,
|
||||
typename NamedParametersVPM = NamedParametersGT >
|
||||
class GetGeomTraits
|
||||
{
|
||||
|
|
@ -189,8 +189,7 @@ namespace CGAL {
|
|||
|
||||
#define CGAL_DEF_GET_INDEX_TYPE(CTYPE, DTYPE, STYPE) \
|
||||
template <typename Graph, \
|
||||
typename NamedParameters = \
|
||||
CGAL::Named_function_parameters<bool, CGAL::internal_np::all_default_t> > \
|
||||
typename NamedParameters = parameters::Default_named_parameters> \
|
||||
struct GetInitialized##CTYPE##IndexMap \
|
||||
: public BGL::internal::GetInitializedIndexMap<internal_np::DTYPE##_index_t, \
|
||||
boost::DTYPE##_index_t, \
|
||||
|
|
@ -219,13 +218,13 @@ CGAL_DEF_GET_INDEX_TYPE(Face, face, typename boost::graph_traits<Graph>::faces_s
|
|||
|
||||
#define CGAL_DEF_GET_INITIALIZED_INDEX_MAP(DTYPE, STYPE) \
|
||||
template <typename Graph, \
|
||||
typename NamedParameters> \
|
||||
typename NamedParameters = parameters::Default_named_parameters> \
|
||||
typename BGL::internal::GetInitializedIndexMap<CGAL::internal_np::DTYPE##_index_t, \
|
||||
boost::DTYPE##_index_t, \
|
||||
CGAL::dynamic_##DTYPE##_property_t<STYPE>, \
|
||||
Graph, NamedParameters>::const_type \
|
||||
get_initialized_##DTYPE##_index_map(const Graph& g, \
|
||||
const NamedParameters& np) \
|
||||
const NamedParameters& np = parameters::default_values()) \
|
||||
{ \
|
||||
typedef BGL::internal::GetInitializedIndexMap<CGAL::internal_np::DTYPE##_index_t, \
|
||||
boost::DTYPE##_index_t, \
|
||||
|
|
@ -233,18 +232,9 @@ get_initialized_##DTYPE##_index_map(const Graph& g,
|
|||
Graph, NamedParameters> Index_map_getter; \
|
||||
return Index_map_getter::get_const(CGAL::internal_np::DTYPE##_index_t{}, g, np); \
|
||||
} \
|
||||
template <typename Graph> \
|
||||
typename BGL::internal::GetInitializedIndexMap<CGAL::internal_np::DTYPE##_index_t, \
|
||||
boost::DTYPE##_index_t, \
|
||||
CGAL::dynamic_##DTYPE##_property_t<STYPE>, \
|
||||
Graph>::const_type \
|
||||
get_initialized_##DTYPE##_index_map(const Graph& g) \
|
||||
{ \
|
||||
return get_initialized_##DTYPE##_index_map(g, CGAL::parameters::all_default()); \
|
||||
} \
|
||||
/* same as above, non-const version*/ \
|
||||
template <typename Graph, \
|
||||
typename NamedParameters, \
|
||||
typename NamedParameters = parameters::Default_named_parameters, \
|
||||
/*otherwise compilers will try to use 'Graph := const PM' and things will go badly*/ \
|
||||
std::enable_if_t< \
|
||||
!std::is_const<typename std::remove_reference<Graph>::type>::value, int> = 0> \
|
||||
|
|
@ -253,7 +243,7 @@ typename BGL::internal::GetInitializedIndexMap<CGAL::internal_np::DTYPE##_index_
|
|||
CGAL::dynamic_##DTYPE##_property_t<STYPE>, \
|
||||
Graph, NamedParameters>::type \
|
||||
get_initialized_##DTYPE##_index_map(Graph& g, \
|
||||
const NamedParameters& np) \
|
||||
const NamedParameters& np = parameters::default_values()) \
|
||||
{ \
|
||||
typedef BGL::internal::GetInitializedIndexMap<CGAL::internal_np::DTYPE##_index_t, \
|
||||
boost::DTYPE##_index_t, \
|
||||
|
|
@ -261,17 +251,6 @@ get_initialized_##DTYPE##_index_map(Graph& g,
|
|||
Graph, NamedParameters> Index_map_getter; \
|
||||
return Index_map_getter::get(CGAL::internal_np::DTYPE##_index_t{}, g, np); \
|
||||
} \
|
||||
template <typename Graph, \
|
||||
std::enable_if_t< \
|
||||
!std::is_const<typename std::remove_reference<Graph>::type>::value, int> = 0> \
|
||||
typename BGL::internal::GetInitializedIndexMap<CGAL::internal_np::DTYPE##_index_t, \
|
||||
boost::DTYPE##_index_t, \
|
||||
CGAL::dynamic_##DTYPE##_property_t<STYPE>, \
|
||||
Graph>::type \
|
||||
get_initialized_##DTYPE##_index_map(Graph& g) \
|
||||
{ \
|
||||
return get_initialized_##DTYPE##_index_map(g, CGAL::parameters::all_default()); \
|
||||
}
|
||||
|
||||
CGAL_DEF_GET_INITIALIZED_INDEX_MAP(vertex, typename boost::graph_traits<Graph>::vertices_size_type)
|
||||
CGAL_DEF_GET_INITIALIZED_INDEX_MAP(halfedge, typename boost::graph_traits<Graph>::halfedges_size_type)
|
||||
|
|
@ -280,35 +259,12 @@ CGAL_DEF_GET_INITIALIZED_INDEX_MAP(face, typename boost::graph_traits<Graph>::fa
|
|||
|
||||
#undef CGAL_DEF_GET_INITIALIZED_INDEX_MAP
|
||||
|
||||
template<typename PolygonMesh, typename NamedParameters>
|
||||
class GetFaceNormalMap
|
||||
{
|
||||
struct DummyNormalPmap
|
||||
{
|
||||
typedef typename boost::graph_traits<PolygonMesh>::face_descriptor key_type;
|
||||
typedef typename GetGeomTraits<PolygonMesh, NamedParameters>::type::Vector_3 value_type;
|
||||
typedef value_type reference;
|
||||
typedef boost::readable_property_map_tag category;
|
||||
|
||||
typedef DummyNormalPmap Self;
|
||||
friend value_type get(const Self&, const key_type&) { return CGAL::NULL_VECTOR; }
|
||||
};
|
||||
|
||||
public:
|
||||
typedef DummyNormalPmap NoMap;
|
||||
typedef typename internal_np::Lookup_named_param_def <
|
||||
internal_np::face_normal_t,
|
||||
NamedParameters,
|
||||
DummyNormalPmap//default
|
||||
> ::type type;
|
||||
};
|
||||
|
||||
namespace internal {
|
||||
BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(Has_nested_type_iterator, iterator, false)
|
||||
}
|
||||
|
||||
template<typename PointRange,
|
||||
typename NamedParameters = Named_function_parameters<bool, internal_np::all_default_t>,
|
||||
typename NamedParameters = parameters::Default_named_parameters,
|
||||
bool has_nested_iterator = internal::Has_nested_type_iterator<PointRange>::value,
|
||||
typename NP_TAG = internal_np::point_t
|
||||
>
|
||||
|
|
@ -342,8 +298,75 @@ CGAL_DEF_GET_INITIALIZED_INDEX_MAP(face, typename boost::graph_traits<Graph>::fa
|
|||
typedef typename CGAL::Identity_property_map<const Dummy_point> const_type;
|
||||
};
|
||||
|
||||
namespace Point_set_processing_3 {
|
||||
template <class PointRange, class NamedParameters, typename NP_TAG = internal_np::point_t>
|
||||
struct Point_set_processing_3_np_helper
|
||||
{
|
||||
typedef typename std::iterator_traits<typename PointRange::iterator>::value_type Value_type;
|
||||
typedef CGAL::Identity_property_map<Value_type> DefaultPMap;
|
||||
typedef CGAL::Identity_property_map<const Value_type> DefaultConstPMap;
|
||||
|
||||
typedef typename internal_np::Lookup_named_param_def<NP_TAG,
|
||||
NamedParameters,DefaultPMap> ::type Point_map; // public
|
||||
typedef typename internal_np::Lookup_named_param_def<NP_TAG,
|
||||
NamedParameters,DefaultConstPMap> ::type Const_point_map; // public
|
||||
|
||||
typedef typename boost::property_traits<Point_map>::value_type Point;
|
||||
typedef typename Kernel_traits<Point>::Kernel Default_geom_traits;
|
||||
|
||||
typedef typename internal_np::Lookup_named_param_def <
|
||||
internal_np::geom_traits_t,
|
||||
NamedParameters,
|
||||
Default_geom_traits
|
||||
> ::type Geom_traits; // public
|
||||
|
||||
typedef typename Geom_traits::FT FT; // public
|
||||
|
||||
typedef Constant_property_map<Value_type, typename Geom_traits::Vector_3> DummyNormalMap;
|
||||
|
||||
typedef typename internal_np::Lookup_named_param_def<
|
||||
internal_np::normal_t,
|
||||
NamedParameters,
|
||||
DummyNormalMap
|
||||
> ::type Normal_map; // public
|
||||
|
||||
static Point_map get_point_map(PointRange&, const NamedParameters& np)
|
||||
{
|
||||
return parameters::choose_parameter<Point_map>(parameters::get_parameter(np, internal_np::point_map));
|
||||
}
|
||||
|
||||
static Point_map get_point_map(const NamedParameters& np)
|
||||
{
|
||||
return parameters::choose_parameter<Point_map>(parameters::get_parameter(np, internal_np::point_map));
|
||||
}
|
||||
|
||||
static Const_point_map get_const_point_map(const PointRange&, const NamedParameters& np)
|
||||
{
|
||||
return parameters::choose_parameter<Const_point_map>(parameters::get_parameter(np, internal_np::point_map));
|
||||
}
|
||||
|
||||
static Normal_map get_normal_map(const PointRange&, const NamedParameters& np)
|
||||
{
|
||||
return parameters::choose_parameter<Normal_map>(parameters::get_parameter(np, internal_np::normal_map));
|
||||
}
|
||||
|
||||
static Normal_map get_normal_map(const NamedParameters& np)
|
||||
{
|
||||
return parameters::choose_parameter<Normal_map>(parameters::get_parameter(np, internal_np::normal_map));
|
||||
}
|
||||
|
||||
static Geom_traits get_geom_traits(const PointRange&, const NamedParameters& np)
|
||||
{
|
||||
return parameters::choose_parameter<Geom_traits>(parameters::get_parameter(np, internal_np::geom_traits));
|
||||
}
|
||||
|
||||
static constexpr bool has_normal_map()
|
||||
{
|
||||
return !boost::is_same< typename internal_np::Get_param<typename NamedParameters::base, internal_np::normal_t>::type,
|
||||
internal_np::Param_not_found> ::value;
|
||||
}
|
||||
};
|
||||
|
||||
namespace Point_set_processing_3 {
|
||||
template <typename ValueType>
|
||||
struct Fake_point_range
|
||||
{
|
||||
|
|
@ -357,67 +380,6 @@ CGAL_DEF_GET_INITIALIZED_INDEX_MAP(face, typename boost::graph_traits<Graph>::fa
|
|||
};
|
||||
};
|
||||
|
||||
namespace parameters
|
||||
{
|
||||
template <typename PointRange>
|
||||
Named_function_parameters<bool, internal_np::all_default_t>
|
||||
inline all_default(const PointRange&)
|
||||
{
|
||||
return CGAL::parameters::all_default();
|
||||
}
|
||||
}
|
||||
|
||||
template<typename PointRange>
|
||||
class GetFT
|
||||
{
|
||||
public:
|
||||
typedef typename Kernel_traits<
|
||||
typename std::iterator_traits<
|
||||
typename PointRange::iterator
|
||||
>::value_type
|
||||
>::Kernel::FT type;
|
||||
};
|
||||
|
||||
template<typename PointRange, typename NamedParameters>
|
||||
class GetK
|
||||
{
|
||||
typedef typename GetPointMap<PointRange, NamedParameters>::type Vpm;
|
||||
typedef typename Kernel_traits<
|
||||
typename boost::property_traits<Vpm>::value_type
|
||||
>::Kernel Default_kernel;
|
||||
|
||||
public:
|
||||
typedef typename internal_np::Lookup_named_param_def <
|
||||
internal_np::geom_traits_t,
|
||||
NamedParameters,
|
||||
Default_kernel
|
||||
> ::type Kernel;
|
||||
};
|
||||
|
||||
template<typename PointRange, typename NamedParameters>
|
||||
class GetNormalMap
|
||||
{
|
||||
struct DummyNormalMap
|
||||
{
|
||||
typedef typename std::iterator_traits<typename PointRange::iterator>::value_type key_type;
|
||||
typedef typename GetK<PointRange, NamedParameters>::Kernel::Vector_3 value_type;
|
||||
typedef value_type reference;
|
||||
typedef boost::read_write_property_map_tag category;
|
||||
|
||||
typedef DummyNormalMap Self;
|
||||
friend value_type get(const Self&, const key_type&) { return CGAL::NULL_VECTOR; }
|
||||
friend void put(const Self&, const key_type&, const value_type&) { }
|
||||
};
|
||||
|
||||
public:
|
||||
typedef DummyNormalMap NoMap;
|
||||
typedef typename internal_np::Lookup_named_param_def <
|
||||
internal_np::normal_t,
|
||||
NamedParameters,
|
||||
DummyNormalMap//default
|
||||
> ::type type;
|
||||
};
|
||||
|
||||
template<typename PlaneRange, typename NamedParameters>
|
||||
class GetPlaneMap
|
||||
{
|
||||
|
|
@ -442,19 +404,8 @@ CGAL_DEF_GET_INITIALIZED_INDEX_MAP(face, typename boost::graph_traits<Graph>::fa
|
|||
template<typename NamedParameters>
|
||||
class GetPlaneIndexMap
|
||||
{
|
||||
struct DummyPlaneIndexMap
|
||||
{
|
||||
typedef std::size_t key_type;
|
||||
typedef int value_type;
|
||||
typedef value_type reference;
|
||||
typedef boost::readable_property_map_tag category;
|
||||
|
||||
typedef DummyPlaneIndexMap Self;
|
||||
friend value_type get(const Self&, const key_type&) { return -1; }
|
||||
};
|
||||
|
||||
typedef Constant_property_map<std::size_t, int> DummyPlaneIndexMap;
|
||||
public:
|
||||
typedef DummyPlaneIndexMap NoMap;
|
||||
typedef typename internal_np::Lookup_named_param_def <
|
||||
internal_np::plane_index_t,
|
||||
NamedParameters,
|
||||
|
|
@ -465,23 +416,14 @@ CGAL_DEF_GET_INITIALIZED_INDEX_MAP(face, typename boost::graph_traits<Graph>::fa
|
|||
template<typename PointRange, typename NamedParameters>
|
||||
class GetIsConstrainedMap
|
||||
{
|
||||
struct DummyConstrainedMap
|
||||
{
|
||||
typedef typename std::iterator_traits<typename PointRange::iterator>::value_type key_type;
|
||||
typedef bool value_type;
|
||||
typedef value_type reference;
|
||||
typedef boost::readable_property_map_tag category;
|
||||
|
||||
typedef DummyConstrainedMap Self;
|
||||
friend value_type get(const Self&, const key_type&) { return false; }
|
||||
};
|
||||
|
||||
typedef Static_boolean_property_map<
|
||||
typename std::iterator_traits<typename PointRange::iterator>::value_type,
|
||||
false> Default_map;
|
||||
public:
|
||||
typedef DummyConstrainedMap NoMap;
|
||||
typedef typename internal_np::Lookup_named_param_def <
|
||||
internal_np::point_is_constrained_t,
|
||||
NamedParameters,
|
||||
DummyConstrainedMap //default
|
||||
Default_map //default
|
||||
> ::type type;
|
||||
};
|
||||
|
||||
|
|
@ -566,7 +508,7 @@ CGAL_DEF_GET_INITIALIZED_INDEX_MAP(face, typename boost::graph_traits<Graph>::fa
|
|||
using parameters::choose_parameter;
|
||||
using parameters::is_default_parameter;
|
||||
|
||||
if(!is_default_parameter(get_parameter(np, internal_np::stream_precision)))
|
||||
if(!is_default_parameter<NP, internal_np::stream_precision_t>())
|
||||
{
|
||||
const int precision = choose_parameter<int>(get_parameter(np,
|
||||
internal_np::stream_precision));
|
||||
|
|
|
|||
|
|
@ -14,7 +14,6 @@
|
|||
|
||||
#include <boost/graph/graph_traits.hpp>
|
||||
#include <CGAL/boost/graph/iterator.h>
|
||||
#include <boost/unordered_set.hpp>
|
||||
|
||||
#include <CGAL/boost/graph/Dual.h>
|
||||
#include <boost/graph/filtered_graph.hpp>
|
||||
|
|
@ -22,6 +21,9 @@
|
|||
|
||||
#include <CGAL/boost/graph/alpha_expansion_graphcut.h>
|
||||
#include <CGAL/squared_distance_3.h>
|
||||
#include <CGAL/assertions.h>
|
||||
|
||||
#include <unordered_set>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
@ -498,13 +500,13 @@ reduce_face_selection(
|
|||
\cgalParamNEnd
|
||||
\cgalNamedParamsEnd
|
||||
*/
|
||||
template <typename TriangleMesh, typename IsSelectedMap, typename NamedParameters>
|
||||
template <typename TriangleMesh, typename IsSelectedMap, typename NamedParameters = parameters::Default_named_parameters>
|
||||
void
|
||||
regularize_face_selection_borders(
|
||||
TriangleMesh& mesh,
|
||||
IsSelectedMap is_selected,
|
||||
double weight,
|
||||
const NamedParameters& np)
|
||||
const NamedParameters& np = parameters::default_values())
|
||||
{
|
||||
using parameters::choose_parameter;
|
||||
using parameters::get_parameter;
|
||||
|
|
@ -546,20 +548,6 @@ regularize_face_selection_borders(
|
|||
put(is_selected, fd, graph.labels[get(face_index_map,fd)]);
|
||||
}
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
// variant with default np
|
||||
template <typename TriangleMesh, typename IsSelectedMap>
|
||||
void
|
||||
regularize_face_selection_borders(
|
||||
TriangleMesh& fg,
|
||||
IsSelectedMap is_selected,
|
||||
double weight)
|
||||
{
|
||||
regularize_face_selection_borders (fg, is_selected, weight,
|
||||
CGAL::parameters::all_default());
|
||||
}
|
||||
/// \endcond
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
namespace experimental {
|
||||
|
|
@ -1051,7 +1039,7 @@ void expand_face_selection_for_removal(const FaceRange& faces_to_be_deleted,
|
|||
typedef typename boost::graph_traits<TriangleMesh>::face_descriptor face_descriptor;
|
||||
typedef typename boost::graph_traits<TriangleMesh>::halfedge_descriptor halfedge_descriptor;
|
||||
|
||||
boost::unordered_set<vertex_descriptor> vertices_queue;
|
||||
std::unordered_set<vertex_descriptor> vertices_queue;
|
||||
|
||||
// collect vertices belonging to at least a triangle that will be removed
|
||||
for(face_descriptor fd : faces_to_be_deleted)
|
||||
|
|
@ -1126,7 +1114,7 @@ void expand_face_selection_for_removal(const FaceRange& faces_to_be_deleted,
|
|||
|
||||
for(halfedge_descriptor f_hd : faces_traversed)
|
||||
{
|
||||
assert(target(f_hd, tm) == vd);
|
||||
CGAL_assertion(target(f_hd, tm) == vd);
|
||||
put(is_selected, face(f_hd, tm), true);
|
||||
vertices_queue.insert( target( next(f_hd, tm), tm) );
|
||||
vertices_queue.insert( source(f_hd, tm) );
|
||||
|
|
@ -1144,8 +1132,8 @@ int euler_characteristic_of_selection(const FaceRange& face_selection,
|
|||
typedef typename boost::graph_traits<PolygonMesh>::face_descriptor face_descriptor;
|
||||
typedef typename boost::graph_traits<PolygonMesh>::halfedge_descriptor halfedge_descriptor;
|
||||
typedef typename boost::graph_traits<PolygonMesh>::edge_descriptor edge_descriptor;
|
||||
boost::unordered_set<vertex_descriptor> sel_vertices;
|
||||
boost::unordered_set<edge_descriptor> sel_edges;
|
||||
std::unordered_set<vertex_descriptor> sel_vertices;
|
||||
std::unordered_set<edge_descriptor> sel_edges;
|
||||
for(face_descriptor f : face_selection)
|
||||
{
|
||||
for(halfedge_descriptor h : halfedges_around_face(halfedge(f, pm), pm))
|
||||
|
|
|
|||
|
|
@ -71,8 +71,6 @@ create_single_source_cgal_program("test_Has_member_clear.cpp")
|
|||
|
||||
create_single_source_cgal_program("test_Has_member_id.cpp")
|
||||
|
||||
create_single_source_cgal_program("test_cgal_bgl_named_params.cpp")
|
||||
|
||||
create_single_source_cgal_program("test_bgl_read_write.cpp")
|
||||
|
||||
create_single_source_cgal_program("graph_concept_Face_filtered_graph.cpp")
|
||||
|
|
|
|||
|
|
@ -26,9 +26,10 @@ int main()
|
|||
// ---------------------------------------------- //
|
||||
// two faces incident to the edge to be collapsed //
|
||||
// ---------------------------------------------- //
|
||||
Point_3 p1(0,0,0), p2(1,0,0), p3(0,1,0);
|
||||
{
|
||||
Mesh m;
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(Point_3(),Point_3(),Point_3(),m);
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(p1,p2,p3,m);
|
||||
Mesh::Halfedge_index h2c = CGAL::Euler::add_center_vertex(h, m);
|
||||
/* ECM ecm = */m.add_property_map<Mesh::Edge_index, bool>("ecm", false);
|
||||
bool res = test(h2c, m);
|
||||
|
|
@ -36,7 +37,7 @@ int main()
|
|||
}
|
||||
{
|
||||
Mesh m;
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(Point_3(),Point_3(),Point_3(),m);
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(p1,p2,p3,m);
|
||||
Mesh::Halfedge_index h2c = CGAL::Euler::add_center_vertex(h, m);
|
||||
ECM ecm = m.add_property_map<Mesh::Edge_index, bool>("ecm", false).first;
|
||||
put(ecm, edge(prev(h2c,m), m), true);
|
||||
|
|
@ -46,7 +47,7 @@ int main()
|
|||
}
|
||||
{
|
||||
Mesh m;
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(Point_3(),Point_3(),Point_3(),m);
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(p1,p2,p3,m);
|
||||
Mesh::Halfedge_index h2c = CGAL::Euler::add_center_vertex(h, m);
|
||||
ECM ecm = m.add_property_map<Mesh::Edge_index, bool>("ecm", false).first;
|
||||
put(ecm, edge(next(h2c,m), m), true);
|
||||
|
|
@ -56,7 +57,7 @@ int main()
|
|||
}
|
||||
{
|
||||
Mesh m;
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(Point_3(),Point_3(),Point_3(),m);
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(p1,p2,p3,m);
|
||||
Mesh::Halfedge_index h2c = CGAL::Euler::add_center_vertex(h, m);
|
||||
ECM ecm = m.add_property_map<Mesh::Edge_index, bool>("ecm", false).first;
|
||||
put(ecm, edge(prev(h2c,m), m), true);
|
||||
|
|
@ -67,7 +68,7 @@ int main()
|
|||
// duplicate block + add one border (1)
|
||||
{
|
||||
Mesh m;
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(Point_3(),Point_3(),Point_3(),m);
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(p1,p2,p3,m);
|
||||
Mesh::Halfedge_index h2c = CGAL::Euler::add_center_vertex(h, m);
|
||||
Mesh::Halfedge_index hb1 = opposite(prev(h2c, m), m);
|
||||
assert(is_border(hb1, m));
|
||||
|
|
@ -78,7 +79,7 @@ int main()
|
|||
}
|
||||
{
|
||||
Mesh m;
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(Point_3(),Point_3(),Point_3(),m);
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(p1,p2,p3,m);
|
||||
Mesh::Halfedge_index h2c = CGAL::Euler::add_center_vertex(h, m);
|
||||
Mesh::Halfedge_index hb1 = opposite(prev(h2c, m), m);
|
||||
assert(is_border(hb1, m));
|
||||
|
|
@ -91,7 +92,7 @@ int main()
|
|||
}
|
||||
{
|
||||
Mesh m;
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(Point_3(),Point_3(),Point_3(),m);
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(p1,p2,p3,m);
|
||||
Mesh::Halfedge_index h2c = CGAL::Euler::add_center_vertex(h, m);
|
||||
Mesh::Halfedge_index hb1 = opposite(prev(h2c, m), m);
|
||||
assert(is_border(hb1, m));
|
||||
|
|
@ -104,7 +105,7 @@ int main()
|
|||
}
|
||||
{
|
||||
Mesh m;
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(Point_3(),Point_3(),Point_3(),m);
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(p1,p2,p3,m);
|
||||
Mesh::Halfedge_index h2c = CGAL::Euler::add_center_vertex(h, m);
|
||||
Mesh::Halfedge_index hb1 = opposite(prev(h2c, m), m);
|
||||
assert(is_border(hb1, m));
|
||||
|
|
@ -118,7 +119,7 @@ int main()
|
|||
// duplicate block + add one border (2)
|
||||
{
|
||||
Mesh m;
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(Point_3(),Point_3(),Point_3(),m);
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(p1,p2,p3,m);
|
||||
Mesh::Halfedge_index h2c = CGAL::Euler::add_center_vertex(h, m);
|
||||
Mesh::Halfedge_index hb2 = opposite(next(opposite(h2c,m), m), m);
|
||||
assert(is_border(hb2, m));
|
||||
|
|
@ -129,7 +130,7 @@ int main()
|
|||
}
|
||||
{
|
||||
Mesh m;
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(Point_3(),Point_3(),Point_3(),m);
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(p1,p2,p3,m);
|
||||
Mesh::Halfedge_index h2c = CGAL::Euler::add_center_vertex(h, m);
|
||||
Mesh::Halfedge_index hb2 = opposite(next(opposite(h2c,m), m), m);
|
||||
assert(is_border(hb2, m));
|
||||
|
|
@ -142,7 +143,7 @@ int main()
|
|||
}
|
||||
{
|
||||
Mesh m;
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(Point_3(),Point_3(),Point_3(),m);
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(p1,p2,p3,m);
|
||||
Mesh::Halfedge_index h2c = CGAL::Euler::add_center_vertex(h, m);
|
||||
Mesh::Halfedge_index hb2 = opposite(next(opposite(h2c,m), m), m);
|
||||
assert(is_border(hb2, m));
|
||||
|
|
@ -155,7 +156,7 @@ int main()
|
|||
}
|
||||
{
|
||||
Mesh m;
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(Point_3(),Point_3(),Point_3(),m);
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(p1,p2,p3,m);
|
||||
Mesh::Halfedge_index h2c = CGAL::Euler::add_center_vertex(h, m);
|
||||
Mesh::Halfedge_index hb2 = opposite(next(opposite(h2c,m), m), m);
|
||||
assert(is_border(hb2, m));
|
||||
|
|
@ -169,7 +170,7 @@ int main()
|
|||
// duplicate block + add one border (1)
|
||||
{
|
||||
Mesh m;
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(Point_3(),Point_3(),Point_3(),m);
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(p1,p2,p3,m);
|
||||
Mesh::Halfedge_index h2c = CGAL::Euler::add_center_vertex(h, m);
|
||||
Mesh::Halfedge_index hb1 = opposite(prev(h2c, m), m);
|
||||
assert(is_border(hb1, m));
|
||||
|
|
@ -183,7 +184,7 @@ int main()
|
|||
}
|
||||
{
|
||||
Mesh m;
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(Point_3(),Point_3(),Point_3(),m);
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(p1,p2,p3,m);
|
||||
Mesh::Halfedge_index h2c = CGAL::Euler::add_center_vertex(h, m);
|
||||
Mesh::Halfedge_index hb1 = opposite(prev(h2c, m), m);
|
||||
assert(is_border(hb1, m));
|
||||
|
|
@ -199,7 +200,7 @@ int main()
|
|||
}
|
||||
{
|
||||
Mesh m;
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(Point_3(),Point_3(),Point_3(),m);
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(p1,p2,p3,m);
|
||||
Mesh::Halfedge_index h2c = CGAL::Euler::add_center_vertex(h, m);
|
||||
Mesh::Halfedge_index hb1 = opposite(prev(h2c, m), m);
|
||||
assert(is_border(hb1, m));
|
||||
|
|
@ -215,7 +216,7 @@ int main()
|
|||
}
|
||||
{
|
||||
Mesh m;
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(Point_3(),Point_3(),Point_3(),m);
|
||||
Mesh::Halfedge_index h = CGAL::make_triangle(p1,p2,p3,m);
|
||||
Mesh::Halfedge_index h2c = CGAL::Euler::add_center_vertex(h, m);
|
||||
Mesh::Halfedge_index hb1 = opposite(prev(h2c, m), m);
|
||||
assert(is_border(hb1, m));
|
||||
|
|
@ -235,7 +236,7 @@ int main()
|
|||
// center triangle with 2 border edges (1)
|
||||
{
|
||||
Mesh m;
|
||||
Mesh::Halfedge_index h2c = CGAL::make_triangle(Point_3(),Point_3(),Point_3(),m);
|
||||
Mesh::Halfedge_index h2c = CGAL::make_triangle(p1,p2,p3,m);
|
||||
Mesh::Halfedge_index hb1=opposite(next(h2c,m),m);
|
||||
CGAL::Euler::add_vertex_and_face_to_border(prev(hb1, m), hb1, m);
|
||||
/* ECM ecm = */m.add_property_map<Mesh::Edge_index, bool>("ecm", false);
|
||||
|
|
@ -244,7 +245,7 @@ int main()
|
|||
}
|
||||
{
|
||||
Mesh m;
|
||||
Mesh::Halfedge_index h2c = CGAL::make_triangle(Point_3(),Point_3(),Point_3(),m);
|
||||
Mesh::Halfedge_index h2c = CGAL::make_triangle(p1,p2,p3,m);
|
||||
Mesh::Halfedge_index hb1=opposite(next(h2c,m),m);
|
||||
CGAL::Euler::add_vertex_and_face_to_border(prev(hb1, m), hb1, m);
|
||||
ECM ecm = m.add_property_map<Mesh::Edge_index, bool>("ecm", false).first;
|
||||
|
|
@ -254,7 +255,7 @@ int main()
|
|||
}
|
||||
{
|
||||
Mesh m;
|
||||
Mesh::Halfedge_index h2c = CGAL::make_triangle(Point_3(),Point_3(),Point_3(),m);
|
||||
Mesh::Halfedge_index h2c = CGAL::make_triangle(p1,p2,p3,m);
|
||||
Mesh::Halfedge_index hb1=opposite(next(h2c,m),m);
|
||||
CGAL::Euler::add_vertex_and_face_to_border(prev(hb1, m), hb1, m);
|
||||
ECM ecm = m.add_property_map<Mesh::Edge_index, bool>("ecm", false).first;
|
||||
|
|
@ -265,7 +266,7 @@ int main()
|
|||
// center triangle with 2 border edges (2)
|
||||
{
|
||||
Mesh m;
|
||||
Mesh::Halfedge_index h2c = CGAL::make_triangle(Point_3(),Point_3(),Point_3(),m);
|
||||
Mesh::Halfedge_index h2c = CGAL::make_triangle(p1,p2,p3,m);
|
||||
Mesh::Halfedge_index hb2=opposite(prev(h2c,m),m);
|
||||
CGAL::Euler::add_vertex_and_face_to_border(prev(hb2, m), hb2, m);
|
||||
/* ECM ecm = */m.add_property_map<Mesh::Edge_index, bool>("ecm", false);
|
||||
|
|
@ -274,7 +275,7 @@ int main()
|
|||
}
|
||||
{
|
||||
Mesh m;
|
||||
Mesh::Halfedge_index h2c = CGAL::make_triangle(Point_3(),Point_3(),Point_3(),m);
|
||||
Mesh::Halfedge_index h2c = CGAL::make_triangle(p1,p2,p3,m);
|
||||
Mesh::Halfedge_index hb2=opposite(prev(h2c,m),m);
|
||||
CGAL::Euler::add_vertex_and_face_to_border(prev(hb2, m), hb2, m);
|
||||
ECM ecm = m.add_property_map<Mesh::Edge_index, bool>("ecm", false).first;
|
||||
|
|
@ -284,7 +285,7 @@ int main()
|
|||
}
|
||||
{
|
||||
Mesh m;
|
||||
Mesh::Halfedge_index h2c = CGAL::make_triangle(Point_3(),Point_3(),Point_3(),m);
|
||||
Mesh::Halfedge_index h2c = CGAL::make_triangle(p1,p2,p3,m);
|
||||
Mesh::Halfedge_index hb2=opposite(prev(h2c,m),m);
|
||||
CGAL::Euler::add_vertex_and_face_to_border(prev(hb2, m), hb2, m);
|
||||
ECM ecm = m.add_property_map<Mesh::Edge_index, bool>("ecm", false).first;
|
||||
|
|
@ -295,7 +296,7 @@ int main()
|
|||
// center triangle with 1 border edges
|
||||
{
|
||||
Mesh m;
|
||||
Mesh::Halfedge_index h2c = CGAL::make_triangle(Point_3(),Point_3(),Point_3(),m);
|
||||
Mesh::Halfedge_index h2c = CGAL::make_triangle(p1,p2,p3,m);
|
||||
Mesh::Halfedge_index hb1=opposite(next(h2c,m),m);
|
||||
CGAL::Euler::add_vertex_and_face_to_border(prev(hb1, m), hb1, m);
|
||||
Mesh::Halfedge_index hb2=opposite(prev(h2c,m),m);
|
||||
|
|
@ -306,7 +307,7 @@ int main()
|
|||
}
|
||||
{
|
||||
Mesh m;
|
||||
Mesh::Halfedge_index h2c = CGAL::make_triangle(Point_3(),Point_3(),Point_3(),m);
|
||||
Mesh::Halfedge_index h2c = CGAL::make_triangle(p1,p2,p3,m);
|
||||
Mesh::Halfedge_index hb1=opposite(next(h2c,m),m);
|
||||
CGAL::Euler::add_vertex_and_face_to_border(prev(hb1, m), hb1, m);
|
||||
Mesh::Halfedge_index hb2=opposite(prev(h2c,m),m);
|
||||
|
|
@ -318,7 +319,7 @@ int main()
|
|||
}
|
||||
{
|
||||
Mesh m;
|
||||
Mesh::Halfedge_index h2c = CGAL::make_triangle(Point_3(),Point_3(),Point_3(),m);
|
||||
Mesh::Halfedge_index h2c = CGAL::make_triangle(p1,p2,p3,m);
|
||||
Mesh::Halfedge_index hb1=opposite(next(h2c,m),m);
|
||||
CGAL::Euler::add_vertex_and_face_to_border(prev(hb1, m), hb1, m);
|
||||
Mesh::Halfedge_index hb2=opposite(prev(h2c,m),m);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ test_copy_face_graph_nm_umbrella()
|
|||
CGAL_GRAPH_TRAITS_MEMBERS(T);
|
||||
|
||||
T g;
|
||||
Kernel::Point_3 p;
|
||||
Kernel::Point_3 p(0,0,0);
|
||||
|
||||
CGAL::make_tetrahedron(p, p, p, p, g);
|
||||
CGAL::make_tetrahedron(p, p, p, p, g);
|
||||
|
|
@ -39,8 +39,7 @@ template <typename T>
|
|||
void
|
||||
test_copy_face_graph_isolated_vertices()
|
||||
{
|
||||
typedef Kernel::Point_3 Point_3;
|
||||
|
||||
Kernel::Point_3 p(0,0,0);
|
||||
{
|
||||
T s, t;
|
||||
add_vertex(s);
|
||||
|
|
@ -55,7 +54,7 @@ test_copy_face_graph_isolated_vertices()
|
|||
|
||||
{
|
||||
T s, t;
|
||||
CGAL::make_triangle(Point_3(), Point_3(), Point_3(), s);
|
||||
CGAL::make_triangle(p, p, p, s);
|
||||
add_vertex(s);
|
||||
t=s;
|
||||
CGAL::copy_face_graph(s, t);
|
||||
|
|
@ -63,7 +62,7 @@ test_copy_face_graph_isolated_vertices()
|
|||
|
||||
{
|
||||
T s, t;
|
||||
CGAL::make_triangle(Point_3(), Point_3(), Point_3(), s);
|
||||
CGAL::make_triangle(p, p, p, s);
|
||||
add_vertex(s);
|
||||
add_vertex(t);
|
||||
CGAL::copy_face_graph(s, t);
|
||||
|
|
@ -71,7 +70,7 @@ test_copy_face_graph_isolated_vertices()
|
|||
|
||||
{
|
||||
T s, t;
|
||||
CGAL::make_tetrahedron(Point_3(), Point_3(), Point_3(), Point_3(), s);
|
||||
CGAL::make_tetrahedron(p, p, p, p, s);
|
||||
add_vertex(s);
|
||||
t=s;
|
||||
CGAL::copy_face_graph(s, t);
|
||||
|
|
@ -79,7 +78,7 @@ test_copy_face_graph_isolated_vertices()
|
|||
|
||||
{
|
||||
T s, t;
|
||||
CGAL::make_tetrahedron(Point_3(), Point_3(), Point_3(), Point_3(), s);
|
||||
CGAL::make_tetrahedron(p, p, p, p, s);
|
||||
add_vertex(s);
|
||||
add_vertex(t);
|
||||
CGAL::copy_face_graph(s, t);
|
||||
|
|
@ -480,7 +479,7 @@ test_swap_edges()
|
|||
halfedge_descriptor h1 = *std::next(boost::begin(halfedges(g)), i);
|
||||
halfedge_descriptor h2 = *std::next(boost::begin(halfedges(g)), j);
|
||||
CGAL::internal::swap_edges(h1, h2, g);
|
||||
CGAL_assertion(CGAL::is_valid_polygon_mesh(g));
|
||||
assert(CGAL::is_valid_polygon_mesh(g));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,15 +6,16 @@
|
|||
#include "test_Prefix.h"
|
||||
|
||||
#include <boost/numeric/conversion/cast.hpp>
|
||||
#include <boost/unordered_set.hpp>
|
||||
#include <boost/unordered_map.hpp>
|
||||
|
||||
#include <unordered_map>
|
||||
#include <unordered_set>
|
||||
#include <fstream>
|
||||
#include <map>
|
||||
#include <memory>
|
||||
#include <utility>
|
||||
#include <cassert>
|
||||
|
||||
typedef boost::unordered_set<std::size_t> id_map;
|
||||
typedef std::unordered_set<std::size_t> id_map;
|
||||
|
||||
namespace PMP = CGAL::Polygon_mesh_processing;
|
||||
|
||||
|
|
@ -24,8 +25,8 @@ void test_halfedge_around_vertex_iterator(const Graph& g)
|
|||
typedef typename boost::graph_traits<Graph>::face_descriptor g_face_descriptor;
|
||||
typedef CGAL::Face_filtered_graph<Graph> Adapter;
|
||||
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
||||
boost::unordered_map<g_face_descriptor, std::size_t> map(num_faces(g));
|
||||
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
|
||||
std::unordered_map<g_face_descriptor, std::size_t> map(num_faces(g));
|
||||
PMP::connected_components(g, boost::make_assoc_property_map(map));
|
||||
|
||||
Adapter fg(g, 0, boost::make_assoc_property_map(map));
|
||||
typename boost::graph_traits<Adapter >::vertex_iterator vit, vend;
|
||||
|
|
@ -52,7 +53,7 @@ void test_halfedge_around_face_iterator(const Graph& g)
|
|||
typedef CGAL::Face_filtered_graph<Graph> Adapter;
|
||||
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
||||
std::map<g_face_descriptor, std::size_t> map;
|
||||
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
|
||||
PMP::connected_components(g, boost::make_assoc_property_map(map));
|
||||
Adapter fg(g, 0, boost::make_assoc_property_map(map));
|
||||
|
||||
face_iterator fit, fend;
|
||||
|
|
@ -73,7 +74,7 @@ void test_edge_iterators(const Graph& g)
|
|||
typedef CGAL::Face_filtered_graph<Graph> Adapter;
|
||||
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
||||
std::map<g_face_descriptor, std::size_t> map;
|
||||
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
|
||||
PMP::connected_components(g, boost::make_assoc_property_map(map));
|
||||
Adapter fg(g, 0, boost::make_assoc_property_map(map));
|
||||
|
||||
// do we iterate as many as that?
|
||||
|
|
@ -99,7 +100,7 @@ void test_vertex_iterators(Graph& g)
|
|||
typedef CGAL::Face_filtered_graph<Graph> Adapter;
|
||||
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
||||
std::map<g_face_descriptor, std::size_t> map;
|
||||
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
|
||||
PMP::connected_components(g, boost::make_assoc_property_map(map));
|
||||
Adapter fg(g, 0, boost::make_assoc_property_map(map));
|
||||
vertex_iterator vb, ve;
|
||||
std::size_t count = 0;
|
||||
|
|
@ -129,7 +130,7 @@ void test_out_edges(const Graph& g)
|
|||
typedef CGAL::Face_filtered_graph<Graph> Adapter;
|
||||
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
||||
std::map<g_face_descriptor, std::size_t> map;
|
||||
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
|
||||
PMP::connected_components(g, boost::make_assoc_property_map(map));
|
||||
Adapter fg(g, 0, boost::make_assoc_property_map(map));
|
||||
|
||||
vertex_iterator vb, ve;
|
||||
|
|
@ -158,7 +159,7 @@ void test_in_edges(const Graph& g)
|
|||
typedef CGAL::Face_filtered_graph<Graph> Adapter;
|
||||
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
||||
std::map<g_face_descriptor, std::size_t> map;
|
||||
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
|
||||
PMP::connected_components(g, boost::make_assoc_property_map(map));
|
||||
Adapter fg(g, 0, boost::make_assoc_property_map(map));
|
||||
|
||||
vertex_iterator vb, ve;
|
||||
|
|
@ -185,7 +186,7 @@ void test_in_out_edges(const Graph& g)
|
|||
typedef CGAL::Face_filtered_graph<Graph> Adapter;
|
||||
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
||||
std::map<g_face_descriptor, std::size_t> map;
|
||||
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
|
||||
PMP::connected_components(g, boost::make_assoc_property_map(map));
|
||||
Adapter fg(g, 0, boost::make_assoc_property_map(map));
|
||||
|
||||
// check that the sets of in out edges are the same
|
||||
|
|
@ -227,7 +228,7 @@ void test_edge_find(const Graph& g)
|
|||
typedef CGAL::Face_filtered_graph<Graph> Adapter;
|
||||
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
||||
std::map<g_face_descriptor, std::size_t> map;
|
||||
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
|
||||
PMP::connected_components(g, boost::make_assoc_property_map(map));
|
||||
Adapter fg(g, 0, boost::make_assoc_property_map(map));
|
||||
typedef std::pair<edge_descriptor, bool> ret;
|
||||
|
||||
|
|
@ -251,7 +252,7 @@ void test_faces(const Graph& g)
|
|||
typedef CGAL::Face_filtered_graph<Graph> Adapter;
|
||||
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
||||
std::map<g_face_descriptor, std::size_t> map;
|
||||
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
|
||||
PMP::connected_components(g, boost::make_assoc_property_map(map));
|
||||
Adapter fg(g, 0, boost::make_assoc_property_map(map));
|
||||
|
||||
unsigned int count = 0;
|
||||
|
|
@ -278,7 +279,7 @@ void test_index_property_maps(const Graph& g)
|
|||
|
||||
typedef typename boost::graph_traits<Graph>::face_descriptor g_face_descriptor;
|
||||
std::map<g_face_descriptor, std::size_t> map;
|
||||
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
|
||||
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::default_values());
|
||||
Adapter fg(g, -1, boost::make_assoc_property_map(map));
|
||||
assert(is_empty(fg));
|
||||
|
||||
|
|
@ -325,7 +326,7 @@ void test_read(const Graph& g)
|
|||
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
||||
|
||||
std::map<g_face_descriptor, std::size_t> map;
|
||||
PMP::connected_components(g, boost::make_assoc_property_map(map), CGAL::parameters::all_default());
|
||||
PMP::connected_components(g, boost::make_assoc_property_map(map));
|
||||
Adapter fg(g, 0, boost::make_assoc_property_map(map));
|
||||
assert(fg.is_selection_valid());
|
||||
assert(CGAL::is_valid_polygon_mesh(fg));
|
||||
|
|
@ -416,29 +417,29 @@ void test_mesh(Adapter fga)
|
|||
{
|
||||
CGAL_GRAPH_TRAITS_MEMBERS(Adapter);
|
||||
//check that there is the right number of simplices in fga
|
||||
CGAL_assertion(CGAL::is_valid_polygon_mesh(fga));
|
||||
CGAL_assertion(num_faces(fga) == 2);
|
||||
CGAL_assertion(num_edges(fga) == 5);
|
||||
CGAL_assertion(num_halfedges(fga) == 10);
|
||||
CGAL_assertion(num_vertices(fga) == 4);
|
||||
assert(CGAL::is_valid_polygon_mesh(fga));
|
||||
assert(num_faces(fga) == 2);
|
||||
assert(num_edges(fga) == 5);
|
||||
assert(num_halfedges(fga) == 10);
|
||||
assert(num_vertices(fga) == 4);
|
||||
halfedge_descriptor h = halfedge(*faces(fga).first, fga);
|
||||
CGAL_assertion_code( vertex_descriptor v = source(h, fga));
|
||||
vertex_descriptor v = source(h, fga);
|
||||
//check that next() works inside the patch
|
||||
CGAL_assertion(next(next(next(h, fga), fga), fga) == h);
|
||||
assert(next(next(next(h, fga), fga), fga) == h);
|
||||
//check that next() works on bordure of the patch
|
||||
h = opposite(h, fga);
|
||||
CGAL_assertion(next(next(next(next(h, fga), fga), fga), fga) == h);
|
||||
assert(next(next(next(next(h, fga), fga), fga), fga) == h);
|
||||
//check that prev() works inside the patch
|
||||
h = halfedge(*faces(fga).first, fga);
|
||||
CGAL_assertion(prev(prev(prev(h, fga), fga), fga) == h);
|
||||
assert(prev(prev(prev(h, fga), fga), fga) == h);
|
||||
//check that prev() works on bordure of the patch
|
||||
h = opposite(h, fga);
|
||||
CGAL_assertion(prev(prev(prev(prev(h, fga), fga), fga), fga) == h);
|
||||
assert(prev(prev(prev(prev(h, fga), fga), fga), fga) == h);
|
||||
//check degree
|
||||
CGAL_assertion(degree(v, fga) == 3);
|
||||
assert(degree(v, fga) == 3);
|
||||
//check in_edges and out_edges
|
||||
CGAL_assertion(std::distance(in_edges(v, fga).first ,in_edges(v, fga).second) == 3);
|
||||
CGAL_assertion(std::distance(out_edges(v, fga).first ,out_edges(v, fga).second) == 3);
|
||||
assert(std::distance(in_edges(v, fga).first ,in_edges(v, fga).second) == 3);
|
||||
assert(std::distance(out_edges(v, fga).first ,out_edges(v, fga).second) == 3);
|
||||
|
||||
Mesh copy;
|
||||
CGAL::copy_face_graph(fga, copy);
|
||||
|
|
@ -484,8 +485,8 @@ void test_invalid_selections()
|
|||
face_range.push_back(SM::Face_index(2));
|
||||
face_range.push_back(SM::Face_index(3));
|
||||
|
||||
CGAL::Face_filtered_graph<SM> bad_fg(mesh, face_range);
|
||||
assert(!bad_fg.is_selection_valid());
|
||||
CGAL::Face_filtered_graph<SM> pinched_fg(mesh, face_range);
|
||||
assert(pinched_fg.is_selection_valid());
|
||||
|
||||
// this creates a non-manifold vertex (multiple umbrellas)
|
||||
clear(mesh);
|
||||
|
|
@ -495,8 +496,8 @@ void test_invalid_selections()
|
|||
face_range.clear();
|
||||
merge_vertices(SM::Vertex_index(1337), SM::Vertex_index(87), face_range, mesh);
|
||||
|
||||
CGAL::Face_filtered_graph<SM> bad_fg_2(mesh, face_range);
|
||||
assert(!bad_fg_2.is_selection_valid());
|
||||
CGAL::Face_filtered_graph<SM> many_umbrellas_fg(mesh, face_range);
|
||||
assert(!many_umbrellas_fg.is_selection_valid());
|
||||
}
|
||||
|
||||
int main()
|
||||
|
|
@ -525,7 +526,7 @@ int main()
|
|||
*sm, fccmap, CGAL::parameters::edge_is_constrained_map(Constraint<SM, SM::Property_map<boost::graph_traits<SM>::vertex_descriptor,
|
||||
SM::Point> >(*sm, positions)));
|
||||
|
||||
boost::unordered_set<long unsigned int> pids;
|
||||
std::unordered_set<long unsigned int> pids;
|
||||
pids.insert(0);
|
||||
pids.insert(2);
|
||||
SM_Adapter sm_adapter(*sm, pids, fccmap);
|
||||
|
|
|
|||
|
|
@ -2,12 +2,14 @@
|
|||
#include <CGAL/Surface_mesh.h>
|
||||
#include <CGAL/Surface_mesh/IO.h>
|
||||
|
||||
#include <boost/unordered_map.hpp>
|
||||
|
||||
#include <boost/property_map/property_map.hpp>
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <set>
|
||||
#include <unordered_map>
|
||||
|
||||
#include <CGAL/boost/graph/selection.h>
|
||||
#include <CGAL/boost/graph/helpers.h>
|
||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
|
||||
|
|
@ -83,7 +85,7 @@ int main()
|
|||
input >> sm;
|
||||
|
||||
// define my selection of faces to remove
|
||||
boost::unordered_map<face_descriptor, bool> is_selected_map;
|
||||
std::unordered_map<face_descriptor, bool> is_selected_map;
|
||||
|
||||
const int selection_indices[30] = {652,18,328,698,322,212,808,353,706,869,646,352,788,696,714,796,937,2892,374,697,227,501,786,794,345,16,21,581,347,723};
|
||||
std::set<int> index_set(&selection_indices[0], &selection_indices[0]+30);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include <CGAL/boost/graph/Euler_operations.h>
|
||||
|
||||
#include <boost/unordered_set.hpp>
|
||||
#include <unordered_set>
|
||||
|
||||
// #define CGAL_TEST_PROPERTIES_DEBUG
|
||||
|
||||
|
|
@ -72,7 +72,7 @@ void test_uniqueness(const Graph&,
|
|||
begin2 = boost::begin(range),
|
||||
end = boost::end(range);
|
||||
|
||||
typedef boost::unordered_set<typename IndexPropertyMap::value_type> id_map;
|
||||
typedef std::unordered_set<typename IndexPropertyMap::value_type> id_map;
|
||||
typedef std::pair<typename id_map::iterator, bool> resultp;
|
||||
|
||||
id_map m;
|
||||
|
|
@ -217,7 +217,8 @@ void test_initialized_index_maps_const(const Graph& g)
|
|||
|
||||
// Writable pmap
|
||||
typedef typename boost::graph_traits<Graph>::edge_descriptor edge_descriptor;
|
||||
typedef boost::unordered_map<edge_descriptor, int> EdgeIndexMap;
|
||||
typedef std::unordered_map<edge_descriptor, int,
|
||||
boost::hash<edge_descriptor>> EdgeIndexMap;
|
||||
typedef CGAL::RW_property_map<edge_descriptor, int, EdgeIndexMap> EdgeIdPropertyMap;
|
||||
|
||||
EdgeIndexMap eim;
|
||||
|
|
@ -321,7 +322,8 @@ void test_initialized_index_maps(Graph& g)
|
|||
|
||||
// Writable pmap
|
||||
typedef typename boost::graph_traits<Graph>::edge_descriptor edge_descriptor;
|
||||
typedef boost::unordered_map<edge_descriptor, int> EdgeIndexMap;
|
||||
typedef std::unordered_map<edge_descriptor, int, boost::hash<edge_descriptor>>
|
||||
EdgeIndexMap;
|
||||
typedef CGAL::RW_property_map<edge_descriptor, int, EdgeIndexMap> EdgeIdPropertyMap;
|
||||
|
||||
EdgeIndexMap eim;
|
||||
|
|
|
|||
|
|
@ -1,14 +1,15 @@
|
|||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||
#include <CGAL/Surface_mesh.h>
|
||||
#include <CGAL/Surface_mesh/IO.h>
|
||||
#include <CGAL/boost/graph/selection.h>
|
||||
|
||||
#include <boost/unordered_map.hpp>
|
||||
#include <boost/property_map/property_map.hpp>
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <set>
|
||||
#include <CGAL/boost/graph/selection.h>
|
||||
#include <unordered_map>
|
||||
|
||||
|
||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
|
||||
typedef CGAL::Surface_mesh<Kernel::Point_3> SM;
|
||||
|
|
@ -21,7 +22,7 @@ int main()
|
|||
input >> sm;
|
||||
|
||||
// define my selection of faces to remove
|
||||
boost::unordered_map<face_descriptor, bool> is_selected_map;
|
||||
std::unordered_map<face_descriptor, bool> is_selected_map;
|
||||
|
||||
const int selection_indices[30] = {652,18,328,698,322,212,808,353,706,869,646,352,788,696,714,796,937,2892,374,697,227,501,786,794,345,16,21,581,347,723};
|
||||
std::set<int> index_set(&selection_indices[0], &selection_indices[0]+30);
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
#include <CGAL/use.h>
|
||||
|
||||
#include <boost/numeric/conversion/cast.hpp>
|
||||
#include <boost/unordered_set.hpp>
|
||||
#include <unordered_set>
|
||||
|
||||
typedef boost::unordered_set<std::size_t> id_map;
|
||||
typedef std::unordered_set<std::size_t> id_map;
|
||||
|
||||
template <typename Graph>
|
||||
void test_isolated_vertex()
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ coordinates from the namespace `CGAL::Barycentric_coordinates`.
|
|||
|
||||
\cgalHasModel
|
||||
- All models of `Kernel`
|
||||
- `CGAL::Projection_traits_3<K>`
|
||||
- `CGAL::Projection_traits_xy_3<K>`
|
||||
- `CGAL::Projection_traits_yz_3<K>`
|
||||
- `CGAL::Projection_traits_xz_3<K>`
|
||||
|
|
|
|||
|
|
@ -650,7 +650,7 @@ OutputIterator difference(const General_polygon_with_holes_2<Polygon>& pgn1,
|
|||
// CGAL/Boolean_set_operations_2/do_intersect.h
|
||||
namespace CGAL {
|
||||
|
||||
/*! \addtogroup boolean_do_intersect Intersection Testing Functions
|
||||
/*! \addtogroup boolean_do_intersect Polygon Intersection Testing Functions
|
||||
* \ingroup PkgBooleanSetOperations2Ref
|
||||
* \anchor ref_bso_do_intersect
|
||||
*
|
||||
|
|
@ -1160,7 +1160,7 @@ bool do_intersect(InputIterator1 begin1, InputIterator1 end1,
|
|||
// CGAL/Boolean_set_operations_2/intersection.h
|
||||
namespace CGAL {
|
||||
|
||||
/*! \addtogroup boolean_intersection Intersection Functions
|
||||
/*! \addtogroup boolean_intersection Polygon Intersection Functions
|
||||
* \ingroup PkgBooleanSetOperations2Ref
|
||||
* \anchor ref_bso_intersection
|
||||
*
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@
|
|||
#include <CGAL/Lazy_exact_nt.h>
|
||||
|
||||
#include <list>
|
||||
#include <cassert>
|
||||
|
||||
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
|
||||
typedef Kernel::Point_2 Point_2;
|
||||
|
|
@ -28,7 +29,7 @@ Polygon_2 construct_polygon (const Circle_2& circle)
|
|||
Curve_2 curve (circle);
|
||||
std::list<CGAL::Object> objects;
|
||||
traits.make_x_monotone_2_object() (curve, std::back_inserter(objects));
|
||||
CGAL_assertion (objects.size() == 2);
|
||||
assert(objects.size() == 2);
|
||||
|
||||
// Construct the polygon.
|
||||
Polygon_2 pgn;
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
#include <list>
|
||||
#include <cstdlib>
|
||||
#include <cmath>
|
||||
#include <cassert>
|
||||
|
||||
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
|
||||
typedef Kernel::Point_2 Point_2;
|
||||
|
|
@ -29,7 +30,7 @@ Polygon_2 construct_polygon (const Circle_2& circle)
|
|||
Curve_2 curve (circle);
|
||||
std::list<CGAL::Object> objects;
|
||||
traits.make_x_monotone_2_object() (curve, std::back_inserter(objects));
|
||||
CGAL_assertion (objects.size() == 2);
|
||||
assert(objects.size() == 2);
|
||||
|
||||
// Construct the polygon.
|
||||
Polygon_2 pgn;
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
#include <CGAL/Exact_rational.h>
|
||||
#include <CGAL/Min_sphere_of_spheres_d.h>
|
||||
#include <vector>
|
||||
#include <cassert>
|
||||
|
||||
const int N = 1000; // number of spheres
|
||||
const int LOW = 0, HIGH = 10000; // range of coordinates and radii
|
||||
|
|
@ -29,5 +30,5 @@ int main () {
|
|||
}
|
||||
|
||||
Min_sphere ms(S.begin(),S.end()); // check in the spheres
|
||||
CGAL_assertion(ms.is_valid());
|
||||
assert(ms.is_valid());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
#include <CGAL/Exact_rational.h>
|
||||
#include <CGAL/Min_sphere_of_spheres_d.h>
|
||||
#include <vector>
|
||||
#include <cassert>
|
||||
|
||||
const int N = 1000; // number of spheres
|
||||
const int LOW = 0, HIGH = 10000; // range of coordinates and radii
|
||||
|
|
@ -30,5 +31,5 @@ int main () {
|
|||
}
|
||||
|
||||
Min_sphere ms(S.begin(),S.end()); // check in the spheres
|
||||
CGAL_assertion(ms.is_valid());
|
||||
assert(ms.is_valid());
|
||||
}
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue