mirror of https://github.com/CGAL/cgal
Merge master and resolve conflicts for Installation/CHANGES.md
This commit is contained in:
commit
28932cd065
|
|
@ -50,7 +50,7 @@ jobs:
|
|||
run: |
|
||||
set -x
|
||||
sudo apt-get update && sudo apt-get install -y graphviz ssh bibtex2html
|
||||
sudo pip install lxml
|
||||
sudo pip install lxml
|
||||
sudo pip install 'pyquery==1.4.1' # it seems to be the last py2 compatible version
|
||||
wget --no-verbose -O doxygen_exe https://cgal.geometryfactory.com/~mgimeno/doxygen/build_1_8_13/bin/doxygen
|
||||
sudo mv doxygen_exe /usr/bin/doxygen
|
||||
|
|
@ -92,7 +92,7 @@ jobs:
|
|||
egrep -v " ${PR_NUMBER}\." index.html > tmp.html || true
|
||||
echo "<li><a href=https://cgal.github.io/${PR_NUMBER}/$ROUND/Manual/index.html>Manual for PR ${PR_NUMBER} ($ROUND).</a></li>" >> ./tmp.html
|
||||
mv tmp.html index.html
|
||||
git add ${PR_NUMBER}/$ROUND && git commit -q --amend -m "base commit" && git push -q -f -u origin master
|
||||
git add ${PR_NUMBER}/$ROUND index.html && git commit -q --amend -m "base commit" && git push -q -f -u origin master
|
||||
else
|
||||
exit 1
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -19,18 +19,16 @@
|
|||
#include <QApplication>
|
||||
#include <CGAL/Qt/resources.h>
|
||||
#include <QMimeData>
|
||||
|
||||
#include <CGAL/Qt/init_ogl_context.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
|
||||
CGAL::Qt::init_ogl_context(4,3);
|
||||
QApplication app(argc, argv);
|
||||
app.setOrganizationDomain("inria.fr");
|
||||
app.setOrganizationName("INRIA");
|
||||
app.setApplicationName("AABB tree demo");
|
||||
//for windows
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0))
|
||||
app.setAttribute(Qt::AA_UseDesktopOpenGL);
|
||||
#endif
|
||||
|
||||
// Import resources from libCGALQt (Qt5).
|
||||
CGAL_QT_INIT_RESOURCES;
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ include_directories(BEFORE ./ ./include)
|
|||
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5)
|
||||
|
||||
# Find Qt5 itself
|
||||
find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Gui Svg)
|
||||
find_package(Qt5 QUIET COMPONENTS Script OpenGL Gui Svg)
|
||||
|
||||
if(CGAL_Qt5_FOUND AND Qt5_FOUND)
|
||||
|
||||
|
|
@ -54,7 +54,7 @@ if(CGAL_Qt5_FOUND AND Qt5_FOUND)
|
|||
#${CGAL_Qt5_MOC_FILES}
|
||||
)
|
||||
# Link with Qt libraries
|
||||
target_link_libraries(AABB_demo PRIVATE Qt5::OpenGL Qt5::Gui Qt5::Xml
|
||||
target_link_libraries(AABB_demo PRIVATE Qt5::OpenGL Qt5::Gui
|
||||
CGAL::CGAL CGAL::CGAL_Qt5)
|
||||
|
||||
add_to_cached_list(CGAL_EXECUTABLE_TARGETS AABB_demo)
|
||||
|
|
|
|||
|
|
@ -22,8 +22,6 @@ MainWindow::MainWindow(QWidget* parent)
|
|||
// saves some pointers from ui, for latter use.
|
||||
m_pViewer = ui->viewer;
|
||||
|
||||
// does not save the state of the viewer
|
||||
m_pViewer->setStateFileName(QString());
|
||||
|
||||
// accepts drop events
|
||||
setAcceptDrops(true);
|
||||
|
|
@ -45,6 +43,7 @@ MainWindow::MainWindow(QWidget* parent)
|
|||
|
||||
MainWindow::~MainWindow()
|
||||
{
|
||||
m_pViewer->makeCurrent();
|
||||
delete ui;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -91,8 +91,8 @@ void Scene::compile_shaders()
|
|||
//Vertex source code
|
||||
const char vertex_source[] =
|
||||
{
|
||||
"#version 120 \n"
|
||||
"attribute highp vec4 vertex;\n"
|
||||
"#version 150 \n"
|
||||
"in highp vec4 vertex;\n"
|
||||
"uniform highp mat4 mvp_matrix;\n"
|
||||
"uniform highp mat4 f_matrix;\n"
|
||||
"void main(void)\n"
|
||||
|
|
@ -103,10 +103,11 @@ void Scene::compile_shaders()
|
|||
//Vertex source code
|
||||
const char fragment_source[] =
|
||||
{
|
||||
"#version 120 \n"
|
||||
"#version 150 \n"
|
||||
"uniform highp vec4 color; \n"
|
||||
"out highp vec4 out_color; \n"
|
||||
"void main(void) { \n"
|
||||
"gl_FragColor = color; \n"
|
||||
"out_color = color; \n"
|
||||
"} \n"
|
||||
"\n"
|
||||
};
|
||||
|
|
@ -139,26 +140,27 @@ void Scene::compile_shaders()
|
|||
//Vertex source code
|
||||
const char tex_vertex_source[] =
|
||||
{
|
||||
"#version 120 \n"
|
||||
"attribute highp vec4 vertex;\n"
|
||||
"attribute highp vec2 tex_coord; \n"
|
||||
"#version 150 \n"
|
||||
"in highp vec4 vertex;\n"
|
||||
"in highp vec2 tex_coord; \n"
|
||||
"uniform highp mat4 mvp_matrix;\n"
|
||||
"uniform highp mat4 f_matrix;\n"
|
||||
"varying highp vec2 texc;\n"
|
||||
"out highp vec2 texc;\n"
|
||||
"void main(void)\n"
|
||||
"{\n"
|
||||
" gl_Position = mvp_matrix * f_matrix * vertex;\n"
|
||||
" texc = tex_coord;\n"
|
||||
" texc = tex_coord;\n"
|
||||
"}"
|
||||
};
|
||||
//Vertex source code
|
||||
const char tex_fragment_source[] =
|
||||
{
|
||||
"#version 120 \n"
|
||||
"uniform sampler2D texture;\n"
|
||||
"varying highp vec2 texc;\n"
|
||||
"#version 150 \n"
|
||||
"uniform sampler2D s_texture;\n"
|
||||
"in highp vec2 texc;\n"
|
||||
"out highp vec4 out_color; \n"
|
||||
"void main(void) { \n"
|
||||
"gl_FragColor = texture2D(texture, texc.st);\n"
|
||||
"out_color = vec4(texture(s_texture, texc));\n"
|
||||
"} \n"
|
||||
"\n"
|
||||
};
|
||||
|
|
@ -1319,12 +1321,8 @@ void Scene::deactivate_cutting_plane()
|
|||
}
|
||||
void Scene::initGL()
|
||||
{
|
||||
gl = new QOpenGLFunctions_2_1();
|
||||
if(!gl->initializeOpenGLFunctions())
|
||||
{
|
||||
qFatal("ERROR : OpenGL Functions not initialized. Check your OpenGL Verison (should be >=3.3)");
|
||||
exit(1);
|
||||
}
|
||||
gl = new QOpenGLFunctions();
|
||||
gl->initializeOpenGLFunctions();
|
||||
|
||||
gl->glGenTextures(1, &textureId);
|
||||
compile_shaders();
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ public:
|
|||
|
||||
private:
|
||||
// member data
|
||||
QOpenGLFunctions_2_1 *gl;
|
||||
QOpenGLFunctions *gl;
|
||||
Bbox m_bbox;
|
||||
Polyhedron *m_pPolyhedron;
|
||||
std::list<Point> m_points;
|
||||
|
|
|
|||
|
|
@ -26,7 +26,6 @@
|
|||
#include <CGAL/internal/AABB_tree/Primitive_helper.h>
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
|
||||
/// \file AABB_traits.h
|
||||
|
||||
|
|
@ -274,13 +273,13 @@ public:
|
|||
switch(Traits::longest_axis(bbox))
|
||||
{
|
||||
case AT::CGAL_AXIS_X: // sort along x
|
||||
std::nth_element(first, middle, beyond, boost::bind(Traits::less_x,_1,_2,m_traits));
|
||||
std::nth_element(first, middle, beyond, [this](const Primitive& p1, const Primitive& p2){ return Traits::less_x(p1, p2, this->m_traits); });
|
||||
break;
|
||||
case AT::CGAL_AXIS_Y: // sort along y
|
||||
std::nth_element(first, middle, beyond, boost::bind(Traits::less_y,_1,_2,m_traits));
|
||||
std::nth_element(first, middle, beyond, [this](const Primitive& p1, const Primitive& p2){ return Traits::less_y(p1, p2, this->m_traits); });
|
||||
break;
|
||||
case AT::CGAL_AXIS_Z: // sort along z
|
||||
std::nth_element(first, middle, beyond, boost::bind(Traits::less_z,_1,_2,m_traits));
|
||||
std::nth_element(first, middle, beyond, [this](const Primitive& p1, const Primitive& p2){ return Traits::less_z(p1, p2, this->m_traits); });
|
||||
break;
|
||||
default:
|
||||
CGAL_error();
|
||||
|
|
@ -429,6 +428,11 @@ public:
|
|||
Closest_point closest_point_object() const {return Closest_point(*this);}
|
||||
Compare_distance compare_distance_object() const {return Compare_distance();}
|
||||
|
||||
typedef enum { CGAL_AXIS_X = 0,
|
||||
CGAL_AXIS_Y = 1,
|
||||
CGAL_AXIS_Z = 2} Axis;
|
||||
|
||||
static Axis longest_axis(const Bounding_box& bbox);
|
||||
|
||||
private:
|
||||
/**
|
||||
|
|
@ -447,13 +451,6 @@ private:
|
|||
return internal::Primitive_helper<AT>::get_datum(pr,*this).bbox();
|
||||
}
|
||||
|
||||
|
||||
typedef enum { CGAL_AXIS_X = 0,
|
||||
CGAL_AXIS_Y = 1,
|
||||
CGAL_AXIS_Z = 2} Axis;
|
||||
|
||||
static Axis longest_axis(const Bounding_box& bbox);
|
||||
|
||||
/// Comparison functions
|
||||
static bool less_x(const Primitive& pr1, const Primitive& pr2,const AABB_traits<GeomTraits,AABBPrimitive, BboxMap>& traits)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@ namespace CGAL {
|
|||
Self& operator=(const Self&) = delete;
|
||||
|
||||
/**
|
||||
* @brief Builds the datastructure from a sequence of primitives.
|
||||
* @brief Builds the data structure from a sequence of primitives.
|
||||
* @param first iterator over first primitive to insert
|
||||
* @param beyond past-the-end iterator
|
||||
*
|
||||
|
|
|
|||
|
|
@ -0,0 +1,159 @@
|
|||
|
||||
/*!
|
||||
\ingroup PkgAdvancingFrontSurfaceReconstructionRef
|
||||
\cgalConcept
|
||||
|
||||
The concept `AdvancingFrontSurfaceReconstructionTraits_3` describes the requirements
|
||||
for the the geometric traits of the class `CGAL::Delaunay_triangulation_3`
|
||||
used in the class `CGAL::Advancing_front_surface_reconstruction`.
|
||||
It defines the geometric objects (points, segments...) forming the triangulation
|
||||
together with a few geometric predicates and constructions on these objects.
|
||||
|
||||
\cgalRefines `DelaunayTriangulationTraits_3`
|
||||
|
||||
\cgalHasModel All models of `Kernel`.
|
||||
*/
|
||||
class AdvancingFrontSurfaceReconstructionTraits_3
|
||||
{
|
||||
public:
|
||||
|
||||
/// \name Types
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
The coordinate type.
|
||||
*/
|
||||
typedef unspecified_type FT;
|
||||
|
||||
/*!
|
||||
The vector type.
|
||||
*/
|
||||
typedef unspecified_type Vector_3;
|
||||
|
||||
/*!
|
||||
The sphere type.
|
||||
*/
|
||||
typedef unspecified_type Sphere_3;
|
||||
|
||||
/*!
|
||||
A constructor object that must provide the function operator
|
||||
|
||||
`Vector_3 operator()(Point_3 p, Point_3 q)`,
|
||||
|
||||
which constructs the vector `q-p`.
|
||||
*/
|
||||
typedef unspecified_type Construct_vector_3;
|
||||
|
||||
/*!
|
||||
A constructor object that must provide the function operator
|
||||
|
||||
`Vector_3 operator()(Vector_3 v, Vector_3 w)`,
|
||||
|
||||
which returns the cross product of `v` and `w`.
|
||||
*/
|
||||
typedef unspecified_type Construct_cross_product_vector_3;
|
||||
|
||||
/*!
|
||||
A constructor object that must provide the function operator
|
||||
|
||||
`FT operator()(Vector_3 v, Vector_3 w)`,
|
||||
|
||||
which returns the scalar (inner) product of `v` and `w`.
|
||||
*/
|
||||
typedef unspecified_type Compute_scalar_product_3;
|
||||
|
||||
/*!
|
||||
A constructor object that must provide the function operator
|
||||
|
||||
`Sphere_3 operator()(Point_3 p, Point_3 q, Point_3 r)`,
|
||||
|
||||
which constructs a sphere initialized to the smallest sphere which passes
|
||||
through the points `p`, `q`, and `r`.
|
||||
*/
|
||||
typedef unspecified_type Construct_sphere_3;
|
||||
|
||||
/*!
|
||||
A constructor object that must provide the function operator
|
||||
|
||||
`Point_3 operator()(Sphere_3 s)`,
|
||||
|
||||
which returns the center of the sphere `s`.
|
||||
*/
|
||||
typedef unspecified_type Construct_center_3;
|
||||
|
||||
/*!
|
||||
A constructor object that must provide the function operators
|
||||
|
||||
`FT operator()(Point_3 p, Point_3 q, Point_3 r, Point_3 s)`,
|
||||
|
||||
which returns the squared radius of the sphere passing through `p`, `q` and `r`,
|
||||
and whose center is in the plane defined by these three points.
|
||||
|
||||
and
|
||||
|
||||
`FT operator()(Point_3 p, Point_3 q, Point_3 r, Point_3 s)`,
|
||||
|
||||
which returns the squared radius of the sphere passing through `p`, `q`, `r`, and `s`.
|
||||
|
||||
and
|
||||
|
||||
`FT operator()(Sphere_3 s)`,
|
||||
|
||||
which returns the squared radius of the sphere `s`.
|
||||
*/
|
||||
typedef unspecified_type Compute_squared_radius_3;
|
||||
|
||||
/*!
|
||||
A constructor object that must provide the function operator
|
||||
|
||||
`FT operator()(Point_3 p, Point_3 q)`,
|
||||
|
||||
which returns the squared distance between the points `p` and `q`.
|
||||
*/
|
||||
typedef unspecified_type Compute_squared_distance_3;
|
||||
|
||||
/// @}
|
||||
|
||||
/// \name Operations
|
||||
/// The following functions give access to the predicate and construction objects:
|
||||
/// @{
|
||||
|
||||
/*!
|
||||
gives access to the `Construct_vector_3` construction.
|
||||
*/
|
||||
Construct_vector_3 construct_vector_3_object();
|
||||
|
||||
/*!
|
||||
gives access to the `Construct_cross_product_vector_3` construction.
|
||||
*/
|
||||
Construct_cross_product_vector_3 construct_cross_product_vector_3_object();
|
||||
|
||||
/*!
|
||||
gives access to the `Compute_scalar_product_3` construction.
|
||||
*/
|
||||
Compute_scalar_product_3 compute_scalar_product_3_object();
|
||||
|
||||
/*!
|
||||
gives access to the `Construct_sphere_3` construction.
|
||||
*/
|
||||
Construct_sphere_3 construct_sphere_3_object();
|
||||
|
||||
/*!
|
||||
gives access to the `Construct_center_3` construction.
|
||||
*/
|
||||
Construct_center_3 construct_center_3_object();
|
||||
|
||||
/*!
|
||||
gives access to the `Compute_squared_radius_3` construction.
|
||||
*/
|
||||
Compute_squared_radius_3 compute_squared_radius_3_object();
|
||||
|
||||
/*!
|
||||
gives access to the `Compute_squared_distance_3` construction.
|
||||
*/
|
||||
Compute_squared_distance_3 compute_squared_distance_3_object();
|
||||
|
||||
/// @}
|
||||
|
||||
}; /* end AdvancingFrontSurfaceReconstructionTraits_3 */
|
||||
|
||||
|
|
@ -1,5 +1,8 @@
|
|||
/// \defgroup PkgAdvancingFrontSurfaceReconstructionRef Advancing Front Surface Reconstruction Reference
|
||||
|
||||
/// \defgroup PkgAdvancingFrontSurfaceReconstructionRefConcepts Concepts
|
||||
/// \ingroup PkgAdvancingFrontSurfaceReconstructionRef
|
||||
|
||||
/*!
|
||||
\addtogroup PkgAdvancingFrontSurfaceReconstructionRef
|
||||
|
||||
|
|
@ -25,6 +28,10 @@ of topological singularities. }
|
|||
|
||||
\cgalClassifedRefPages
|
||||
|
||||
\cgalCRPSection{Concepts}
|
||||
|
||||
- `AdvancingFrontSurfaceReconstructionTraits_3`
|
||||
|
||||
\cgalCRPSection{Classes}
|
||||
|
||||
- `CGAL::Advancing_front_surface_reconstruction`
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ Algebraic_foundations
|
|||
Circulator
|
||||
Stream_support
|
||||
TDS_2
|
||||
TDS_3
|
||||
Triangulation_2
|
||||
Triangulation_3
|
||||
Number_types
|
||||
|
|
|
|||
|
|
@ -175,23 +175,42 @@ namespace CGAL {
|
|||
store handles to the vertices and faces of the 3D triangulation, which enables the user to explore the
|
||||
2D as well as 3D neighborhood of vertices and facets of the surface.
|
||||
|
||||
\tparam Dt must be a `Delaunay_triangulation_3` with
|
||||
`Advancing_front_surface_reconstruction_vertex_base_3` and `Advancing_front_surface_reconstruction_cell_base_3` blended into the vertex and cell type.
|
||||
The default uses the `Exact_predicates_inexact_constructions_kernel` as geometric traits class.
|
||||
\tparam Dt must be a `Delaunay_triangulation_3` whose `Traits` template parameter must be a model of
|
||||
`AdvancingFrontSurfaceReconstructionTraits_3` and whose `Tds` template parameter must be
|
||||
a model of `TriangulationDataStructure_3` with `Advancing_front_surface_reconstruction_vertex_base_3` and
|
||||
`Advancing_front_surface_reconstruction_cell_base_3` blended into the vertex and cell type, respectively.
|
||||
The default value is:
|
||||
\code
|
||||
CGAL::Delaunay_triangulation_3<CGAL::Exact_predicates_inexact_constructions_kernel,
|
||||
CGAL::Triangulation_data_structure_3<
|
||||
CGAL::Advancing_front_surface_reconstruction_vertex_base_3<
|
||||
CGAL::Exact_predicates_inexact_constructions_kernel>,
|
||||
CGAL::Advancing_front_surface_reconstruction_cell_base_3<
|
||||
CGAL::Exact_predicates_inexact_constructions_kernel> > >`
|
||||
\endcode
|
||||
|
||||
\tparam P must be a functor with `double operator()(AdvancingFront,Cell_handle,int)` 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,
|
||||
\tparam P must be a functor offering
|
||||
\code
|
||||
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,
|
||||
`infinity()` must be returned. It defaults to a functor that returns the
|
||||
`smallest_radius_delaunay_sphere()`.
|
||||
|
||||
*/
|
||||
template <
|
||||
class Dt = Default,
|
||||
class P = Default>
|
||||
class Advancing_front_surface_reconstruction {
|
||||
|
||||
typedef typename Default::Get<Dt,Delaunay_triangulation_3<Exact_predicates_inexact_constructions_kernel, Triangulation_data_structure_3<Advancing_front_surface_reconstruction_vertex_base_3<Exact_predicates_inexact_constructions_kernel>, Advancing_front_surface_reconstruction_cell_base_3<Exact_predicates_inexact_constructions_kernel> > > >::type Triangulation;
|
||||
template <class Dt = Default,
|
||||
class P = Default>
|
||||
class Advancing_front_surface_reconstruction
|
||||
{
|
||||
typedef typename Default::Get<Dt,
|
||||
Delaunay_triangulation_3<
|
||||
Exact_predicates_inexact_constructions_kernel,
|
||||
Triangulation_data_structure_3<
|
||||
Advancing_front_surface_reconstruction_vertex_base_3<
|
||||
Exact_predicates_inexact_constructions_kernel>,
|
||||
Advancing_front_surface_reconstruction_cell_base_3<
|
||||
Exact_predicates_inexact_constructions_kernel> > > >::type Triangulation;
|
||||
typedef typename Default::Get<P,AFSR::Default_priority>::type Priority;
|
||||
public:
|
||||
|
||||
|
|
@ -202,9 +221,9 @@ namespace CGAL {
|
|||
/*!
|
||||
The type of the 2D triangulation data structure describing the reconstructed surface, being a model of `TriangulationDataStructure_2`.
|
||||
- The type `Triangulation_data_structure_2::Vertex` is model of the concept `TriangulationDataStructure_2::Vertex` and has additionally the
|
||||
method `vertex_3()` that returns a `#Vertex_handle` to the associated 3D vertex.
|
||||
method `vertex_3()` that returns a `Vertex_handle` to the associated 3D vertex.
|
||||
- The type `Triangulation_data_structure_2::Face` is model of the concept `TriangulationDataStructure_2::Face` and has additionally the
|
||||
method `facet()` that returns the associated `#Facet`, and a method `bool is_on_surface()`
|
||||
method `facet()` that returns the associated `Facet`, and a method `bool is_on_surface()`
|
||||
for testing if a face is part of the reconstructed surface or a face incident to a boundary edge.
|
||||
|
||||
In case the surface has boundaries, the 2D surface has one vertex which is associated to the infinite
|
||||
|
|
@ -213,15 +232,20 @@ namespace CGAL {
|
|||
typedef unspecified_type Triangulation_data_structure_2;
|
||||
|
||||
/*!
|
||||
The type of the 3D triangulation.
|
||||
The type of the 3D Delaunay triangulation (the first template parameter).
|
||||
*/
|
||||
typedef unspecified_type Triangulation_3;
|
||||
|
||||
/*!
|
||||
The type of the facet priority functor.
|
||||
The type of the facet priority functor (the second template parameter).
|
||||
*/
|
||||
typedef unspecified_type Priority;
|
||||
|
||||
/*!
|
||||
The number type.
|
||||
*/
|
||||
typedef typename Triangulation_3::Geom_traits::FT FT;
|
||||
|
||||
/*!
|
||||
The point type.
|
||||
*/
|
||||
|
|
@ -245,21 +269,21 @@ namespace CGAL {
|
|||
/*!
|
||||
A bidirectional iterator range which enables to enumerate all points that were removed
|
||||
from the 3D Delaunay triangulation during the surface reconstruction. The value type
|
||||
of the iterator is `#Point`.
|
||||
of the iterator is `Point`.
|
||||
*/
|
||||
typedef unspecified_type Outlier_range;
|
||||
|
||||
/*!
|
||||
A bidirectional iterator range which enables to visit all vertices on a boundary.
|
||||
The value type of the iterator is `Vertex_handle`.
|
||||
*/
|
||||
typedef unspecified_type Vertex_on_boundary_range;
|
||||
|
||||
/*!
|
||||
A bidirectional iterator range which enables to visit all boundaries.
|
||||
The value type of the iterator is `Vertex_on_boundary_range`.
|
||||
*/
|
||||
typedef unspecified_type Boundary_range;
|
||||
|
||||
/*!
|
||||
A bidirectional iterator range which enables to visit all vertices on a boundary.
|
||||
The value type of the iterator is `#Vertex_handle`
|
||||
*/
|
||||
typedef unspecified_type Vertex_on_boundary_range;
|
||||
/// @}
|
||||
#endif
|
||||
|
||||
|
|
@ -268,6 +292,7 @@ namespace CGAL {
|
|||
typedef Advancing_front_surface_reconstruction<Dt,P> Extract;
|
||||
typedef typename Triangulation_3::Geom_traits Geom_traits;
|
||||
|
||||
typedef typename Kernel::FT FT;
|
||||
typedef typename Kernel::FT coord_type;
|
||||
|
||||
typedef typename Kernel::Point_3 Point;
|
||||
|
|
@ -377,7 +402,23 @@ namespace CGAL {
|
|||
std::list<Next_border_elt> nbe_pool;
|
||||
std::list<Intern_successors_type> ist_pool;
|
||||
|
||||
public:
|
||||
Vector construct_vector(const Point& p, const Point& q) const
|
||||
{
|
||||
return T.geom_traits().construct_vector_3_object()(p, q);
|
||||
}
|
||||
|
||||
Vector construct_cross_product(const Vector& v, const Vector& w) const
|
||||
{
|
||||
return T.geom_traits().construct_cross_product_vector_3_object()(v, w);
|
||||
}
|
||||
|
||||
FT compute_scalar_product(const Vector& v, const Vector& w) const
|
||||
{
|
||||
return T.geom_traits().compute_scalar_product_3_object()(v, w);
|
||||
}
|
||||
|
||||
private:
|
||||
Intern_successors_type* new_border()
|
||||
{
|
||||
nbe_pool.resize(nbe_pool.size()+1);
|
||||
|
|
@ -679,12 +720,14 @@ namespace CGAL {
|
|||
++it;
|
||||
}while(collinear(p,q,it->point()));
|
||||
const Point& r = it->point();
|
||||
Vector u = q-r;
|
||||
Vector v = q-p;
|
||||
Vector w = r-p;
|
||||
Vector vw = cross_product(v,w);
|
||||
double len = (std::max)(u*u,(std::max)(v*v,w*w));
|
||||
Point s = p + 10* len * (vw/(vw*vw));
|
||||
Vector u = construct_vector(r, q);
|
||||
Vector v = construct_vector(p, q);
|
||||
Vector w = construct_vector(p, r);
|
||||
Vector vw = construct_cross_product(v,w);
|
||||
double len = (std::max)(compute_scalar_product(u,u),
|
||||
(std::max)(compute_scalar_product(v,v),
|
||||
compute_scalar_product(w,w)));
|
||||
Point s = p + 10 * len * (vw/compute_scalar_product(vw,vw));
|
||||
added_vertex = T.insert(s);
|
||||
}
|
||||
}
|
||||
|
|
@ -736,9 +779,9 @@ namespace CGAL {
|
|||
|
||||
\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
|
||||
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
|
||||
Described in Section \ref AFSR_Selection.
|
||||
|
||||
*/
|
||||
void run(double radius_ratio_bound=5, double beta= 0.52)
|
||||
|
|
@ -1186,7 +1229,7 @@ namespace CGAL {
|
|||
\param index index of the facet in `c`
|
||||
|
||||
*/
|
||||
coord_type
|
||||
FT
|
||||
smallest_radius_delaunay_sphere(const Cell_handle& c,
|
||||
const int& index) const
|
||||
{
|
||||
|
|
@ -1249,16 +1292,16 @@ namespace CGAL {
|
|||
const Point& pp2 = cc->vertex(i2)->point();
|
||||
const Point& pp3 = cc->vertex(i3)->point();
|
||||
|
||||
Sphere facet_sphere(pp1, pp2, pp3);
|
||||
if (squared_distance(facet_sphere.center(), pp0) <
|
||||
facet_sphere.squared_radius())
|
||||
Sphere facet_sphere = T.geom_traits().construct_sphere_3_object()(pp1, pp2, pp3);
|
||||
if (squared_distance(T.geom_traits().construct_center_3_object()(facet_sphere), pp0) <
|
||||
T.geom_traits().compute_squared_radius_3_object()(facet_sphere))
|
||||
{
|
||||
#ifdef AFSR_LAZY
|
||||
value = lazy_squared_radius(cc);
|
||||
#else
|
||||
// qualified with CGAL, to avoid a compilation error with clang
|
||||
if(volume(pp0, pp1, pp2, pp3) != 0){
|
||||
value = CGAL::squared_radius(pp0, pp1, pp2, pp3);
|
||||
value = T.geom_traits().compute_squared_radius_3_object()(pp0, pp1, pp2, pp3);
|
||||
} else {
|
||||
typedef Exact_predicates_exact_constructions_kernel EK;
|
||||
Cartesian_converter<Kernel, EK> to_exact;
|
||||
|
|
@ -1280,26 +1323,30 @@ namespace CGAL {
|
|||
cc = lazy_circumcenter(c);
|
||||
cn = lazy_circumcenter(n);
|
||||
#else
|
||||
cc = CGAL::circumcenter(cp0, cp1, cp2, cp3);
|
||||
cn = CGAL::circumcenter(np0, np1, np2, np3);
|
||||
cc = T.geom_traits().construct_circumcenter_3_object()(cp0, cp1, cp2, cp3);
|
||||
cn = T.geom_traits().construct_circumcenter_3_object()(np0, np1, np2, np3);
|
||||
#endif
|
||||
// computation of the distance of cp1 to the dual segment cc, cn...
|
||||
Vector V(cc - cn), Vc(cc - cp1), Vn(cp1 - cn);
|
||||
coord_type ac(V * Vc), an(V * Vn), norm_V(V * V);
|
||||
Vector V = construct_vector(cn, cc),
|
||||
Vc = construct_vector(cp1, cc),
|
||||
Vn = construct_vector(cn, cp1);
|
||||
coord_type ac = compute_scalar_product(V, Vc),
|
||||
an = compute_scalar_product(V, Vn),
|
||||
norm_V = compute_scalar_product(V, V);
|
||||
if ((ac > 0) && (an > 0))
|
||||
{
|
||||
value = (Vc*Vc) - ac*ac/norm_V;
|
||||
value = compute_scalar_product(Vc, Vc) - ac*ac/norm_V;
|
||||
if ((value < 0)||(norm_V > inv_eps_2)){
|
||||
// qualified with CGAL, to avoid a compilation error with clang
|
||||
value = CGAL::squared_radius(cp1, cp2, cp3);
|
||||
value = T.geom_traits().compute_squared_radius_3_object()(cp1, cp2, cp3);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ac <= 0)
|
||||
value = squared_distance(cc, cp1);
|
||||
value = T.geom_traits().compute_squared_distance_3_object()(cc, cp1);
|
||||
else // (an <= 0)
|
||||
value = squared_distance(cn, cp1);
|
||||
value = T.geom_traits().compute_squared_distance_3_object()(cn, cp1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1314,7 +1361,7 @@ namespace CGAL {
|
|||
|
||||
returns the infinite floating value that prevents a facet to be used.
|
||||
*/
|
||||
coord_type infinity() const { return std::numeric_limits<coord_type>::infinity(); }
|
||||
FT infinity() const { return std::numeric_limits<FT>::infinity(); }
|
||||
/// @}
|
||||
|
||||
//---------------------------------------------------------------------
|
||||
|
|
@ -1341,9 +1388,9 @@ namespace CGAL {
|
|||
const Point& p2 = c->vertex(i2)->point();
|
||||
const Point& pc = c->vertex(i3)->point();
|
||||
|
||||
Vector P2P1 = p1-p2, P2Pn, PnP1;
|
||||
Vector P2P1 = construct_vector(p2, p1), P2Pn, PnP1;
|
||||
|
||||
Vector v2, v1 = cross_product(pc-p2, P2P1);
|
||||
Vector v2, v1 = construct_cross_product(construct_vector(p2, pc), P2P1);
|
||||
|
||||
coord_type norm, norm1 = v1*v1;
|
||||
coord_type norm12 = P2P1*P2P1;
|
||||
|
|
@ -1375,12 +1422,12 @@ namespace CGAL {
|
|||
{
|
||||
const Point& pn = neigh->vertex(n_i3)->point();
|
||||
|
||||
P2Pn = pn-p2;
|
||||
v2 = cross_product(P2P1,P2Pn);
|
||||
P2Pn = construct_vector(p2, pn);
|
||||
v2 = construct_cross_product(P2P1,P2Pn);
|
||||
|
||||
//pas necessaire de normer pour un bon echantillon:
|
||||
// on peut alors tester v1*v2 >= 0
|
||||
norm = sqrt(norm1 * (v2*v2));
|
||||
norm = sqrt(norm1 * compute_scalar_product(v2,v2));
|
||||
pscal = v1*v2;
|
||||
// check if the triangle will produce a sliver on the surface
|
||||
bool sliver_facet = (pscal <= COS_ALPHA_SLIVER*norm);
|
||||
|
|
@ -1394,10 +1441,9 @@ namespace CGAL {
|
|||
// We skip triangles having an internal angle along e
|
||||
// whose cosinus is smaller than -DELTA
|
||||
// that is the angle is larger than arcos(-DELTA)
|
||||
border_facet = !((P2P1*P2Pn >=
|
||||
-DELTA*sqrt(norm12*(P2Pn*P2Pn)))&&
|
||||
(P2P1*PnP1 >=
|
||||
-DELTA*sqrt(norm12*(PnP1*PnP1))));
|
||||
border_facet =
|
||||
!((P2P1*P2Pn >= -DELTA*sqrt(norm12*compute_scalar_product(P2Pn,P2Pn))) &&
|
||||
(P2P1*PnP1 >= -DELTA*sqrt(norm12*compute_scalar_product(PnP1,PnP1))));
|
||||
// \todo investigate why we simply do not skip this triangle
|
||||
// but continue looking for a better candidate
|
||||
// if (!border_facet){
|
||||
|
|
@ -1569,9 +1615,11 @@ namespace CGAL {
|
|||
int n_i3 = (6 - n_ind - n_i1 - n_i2);
|
||||
|
||||
const Point& pn = neigh->vertex(n_i3)->point();
|
||||
Vector v1 = cross_product(pc-p2,p1-p2),
|
||||
v2 = cross_product(p1-p2,pn-p2);
|
||||
coord_type norm = sqrt((v1*v1)*(v2*v2));
|
||||
Vector v1 = construct_cross_product(construct_vector(p2, pc),
|
||||
construct_vector(p2, p1)),
|
||||
v2 = construct_cross_product(construct_vector(p2, p1),
|
||||
construct_vector(p2, pn));
|
||||
coord_type norm = sqrt(compute_scalar_product(v1, v1) * compute_scalar_product(v2, v2));
|
||||
|
||||
if (v1*v2 > COS_BETA*norm)
|
||||
return 1; // label bonne pliure sinon:
|
||||
|
|
@ -2487,9 +2535,9 @@ namespace CGAL {
|
|||
\param out output iterator
|
||||
\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
|
||||
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
|
||||
Described in Section \ref AFSR_Selection.
|
||||
|
||||
*/
|
||||
template <typename PointInputIterator, typename IndicesOutputIterator>
|
||||
|
|
@ -2533,7 +2581,7 @@ 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()(AdvancingFront,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
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ namespace CGAL {
|
|||
\ingroup PkgAlgebraicFoundationsRef
|
||||
|
||||
The template function `compare()` compares the first argument with respect to
|
||||
the second, i.e.\ it returns `CGAL::LARGER` if \f$ x\f$ is larger then \f$ y\f$.
|
||||
the second, i.e.\ it returns `CGAL::LARGER` if \f$ x\f$ is larger than \f$ y\f$.
|
||||
|
||||
In case the argument types `NT1` and `NT2` differ,
|
||||
`compare` is performed with the semantic of the type determined via
|
||||
|
|
|
|||
|
|
@ -302,13 +302,13 @@ to_interval( const Real_embeddable& x) {
|
|||
}
|
||||
|
||||
template <typename NT>
|
||||
NT approximate_sqrt(const NT& nt, CGAL::Field_tag)
|
||||
NT approximate_sqrt(const NT& nt, CGAL::Null_functor)
|
||||
{
|
||||
return NT(sqrt(CGAL::to_double(nt)));
|
||||
}
|
||||
|
||||
template <typename NT>
|
||||
NT approximate_sqrt(const NT& nt, CGAL::Field_with_sqrt_tag)
|
||||
template <typename NT, typename Sqrt>
|
||||
NT approximate_sqrt(const NT& nt, Sqrt sqrt)
|
||||
{
|
||||
return sqrt(nt);
|
||||
}
|
||||
|
|
@ -316,9 +316,12 @@ NT approximate_sqrt(const NT& nt, CGAL::Field_with_sqrt_tag)
|
|||
template <typename NT>
|
||||
NT approximate_sqrt(const NT& nt)
|
||||
{
|
||||
// the initial version of this function was using Algebraic_category
|
||||
// for the dispatch but some ring type (like Gmpz) provides a Sqrt
|
||||
// functor even if not being Field_with_sqrt.
|
||||
typedef CGAL::Algebraic_structure_traits<NT> AST;
|
||||
typedef typename AST::Algebraic_category Algebraic_category;
|
||||
return approximate_sqrt(nt, Algebraic_category());
|
||||
typedef typename AST::Sqrt Sqrt;
|
||||
return approximate_sqrt(nt, Sqrt());
|
||||
}
|
||||
|
||||
CGAL_NTS_END_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -5,23 +5,15 @@ find_package(CGAL REQUIRED COMPONENTS Core)
|
|||
|
||||
find_package(MPFI QUIET)
|
||||
|
||||
if(MPFI_FOUND)
|
||||
|
||||
if(MPFI_FOUND AND NOT CGAL_DISABLE_GMP)
|
||||
include(${CGAL_USE_FILE})
|
||||
include(${MPFI_USE_FILE})
|
||||
include(CGAL_VersionUtils)
|
||||
|
||||
create_single_source_cgal_program("Compare_1.cpp")
|
||||
create_single_source_cgal_program("Construct_algebraic_real_1.cpp")
|
||||
create_single_source_cgal_program("Isolate_1.cpp")
|
||||
create_single_source_cgal_program("Sign_at_1.cpp")
|
||||
create_single_source_cgal_program("Solve_1.cpp")
|
||||
|
||||
else()
|
||||
|
||||
message(
|
||||
STATUS
|
||||
"This program requires the CGAL library and MPFI, and will not be compiled."
|
||||
)
|
||||
|
||||
message(STATUS "This program requires the CGAL, CGAL_Core and MPFI libraries, and will not be compiled.")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -2007,7 +2007,7 @@ public:
|
|||
*
|
||||
* For each status line at an event and each status line that represents
|
||||
* an interval, all y-coordinates are approximated such that their
|
||||
* isolating interval has absolute size smaller then \c precision.
|
||||
* isolating interval has absolute size smaller than \c precision.
|
||||
*/
|
||||
void refine_all(Bound precision) {
|
||||
|
||||
|
|
|
|||
|
|
@ -34,32 +34,36 @@ include(${CGAL_USE_FILE})
|
|||
# ##########################################################
|
||||
|
||||
create_single_source_cgal_program("cyclic.cpp")
|
||||
create_single_source_cgal_program("Algebraic_curve_kernel_2.cpp")
|
||||
create_single_source_cgal_program("algebraic_curve_kernel_2_tools.cpp")
|
||||
create_single_source_cgal_program("Algebraic_kernel_d_1_LEDA.cpp")
|
||||
|
||||
create_single_source_cgal_program(
|
||||
"Algebraic_kernel_d_1_CORE_Integer_rational.cpp")
|
||||
create_single_source_cgal_program(
|
||||
"Algebraic_kernel_d_1_CORE_SqrtII_rational.cpp")
|
||||
create_single_source_cgal_program(
|
||||
"Algebraic_kernel_d_1_CORE_SqrtRI_rational.cpp")
|
||||
create_single_source_cgal_program(
|
||||
"Algebraic_kernel_d_1_CORE_SqrtRR_rational.cpp")
|
||||
|
||||
create_single_source_cgal_program("Algebraic_kernel_d_1_GMP.cpp")
|
||||
create_single_source_cgal_program("Algebraic_kernel_d_2.cpp")
|
||||
create_single_source_cgal_program("Algebraic_real_d_1.cpp")
|
||||
create_single_source_cgal_program("Bitstream_descartes.cpp")
|
||||
create_single_source_cgal_program("Curve_analysis_2.cpp")
|
||||
create_single_source_cgal_program("Curve_pair_analysis_2.cpp")
|
||||
create_single_source_cgal_program("Descartes.cpp")
|
||||
create_single_source_cgal_program("Real_embeddable_traits_extension.cpp")
|
||||
if(RS_FOUND)
|
||||
create_single_source_cgal_program("Algebraic_kernel_rs_gmpq_d_1.cpp")
|
||||
create_single_source_cgal_program("Algebraic_kernel_rs_gmpz_d_1.cpp")
|
||||
if(NOT CGAL_DISABLE_GMP)
|
||||
create_single_source_cgal_program("Algebraic_curve_kernel_2.cpp")
|
||||
create_single_source_cgal_program("algebraic_curve_kernel_2_tools.cpp")
|
||||
create_single_source_cgal_program("Algebraic_kernel_d_1_LEDA.cpp")
|
||||
|
||||
create_single_source_cgal_program(
|
||||
"Algebraic_kernel_d_1_CORE_Integer_rational.cpp")
|
||||
create_single_source_cgal_program(
|
||||
"Algebraic_kernel_d_1_CORE_SqrtII_rational.cpp")
|
||||
create_single_source_cgal_program(
|
||||
"Algebraic_kernel_d_1_CORE_SqrtRI_rational.cpp")
|
||||
create_single_source_cgal_program(
|
||||
"Algebraic_kernel_d_1_CORE_SqrtRR_rational.cpp")
|
||||
|
||||
create_single_source_cgal_program("Algebraic_kernel_d_1_GMP.cpp")
|
||||
create_single_source_cgal_program("Algebraic_kernel_d_2.cpp")
|
||||
create_single_source_cgal_program("Algebraic_real_d_1.cpp")
|
||||
create_single_source_cgal_program("Bitstream_descartes.cpp")
|
||||
create_single_source_cgal_program("Curve_analysis_2.cpp")
|
||||
create_single_source_cgal_program("Curve_pair_analysis_2.cpp")
|
||||
create_single_source_cgal_program("Real_embeddable_traits_extension.cpp")
|
||||
if(RS_FOUND)
|
||||
create_single_source_cgal_program("Algebraic_kernel_rs_gmpq_d_1.cpp")
|
||||
create_single_source_cgal_program("Algebraic_kernel_rs_gmpz_d_1.cpp")
|
||||
else()
|
||||
message(
|
||||
STATUS
|
||||
"NOTICE: Some tests require the RS library, and will not be compiled.")
|
||||
endif()
|
||||
else()
|
||||
message(
|
||||
STATUS
|
||||
"NOTICE: Some tests require the RS library, and will not be compiled.")
|
||||
message(STATUS "NOTICE: Some tests require the CGAL_Core library, and will not be compiled.")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -30,19 +30,19 @@ namespace CGAL {
|
|||
template <typename RT>
|
||||
Comparison_result
|
||||
compare_x(const CGAL::Root_for_spheres_2_3<RT>& r1, const CGAL::Root_for_spheres_2_3<RT>& r2){
|
||||
return compare(r1.x(), r2.x());
|
||||
return CGAL::compare(r1.x(), r2.x());
|
||||
}
|
||||
|
||||
template <typename RT>
|
||||
Comparison_result
|
||||
compare_y(const CGAL::Root_for_spheres_2_3<RT>& r1, const CGAL::Root_for_spheres_2_3<RT>& r2){
|
||||
return compare(r1.y(), r2.y());
|
||||
return CGAL::compare(r1.y(), r2.y());
|
||||
}
|
||||
|
||||
template <typename RT>
|
||||
Comparison_result
|
||||
compare_z(const CGAL::Root_for_spheres_2_3<RT>& r1, const CGAL::Root_for_spheres_2_3<RT>& r2){
|
||||
return compare(r1.z(), r2.z());
|
||||
return CGAL::compare(r1.z(), r2.z());
|
||||
}
|
||||
|
||||
template <typename RT>
|
||||
|
|
|
|||
|
|
@ -134,9 +134,8 @@ All \cgal kernels are models of both concepts.
|
|||
|
||||
The triangulation data structure of the triangulation
|
||||
has to be a model of the concept `TriangulationDataStructure_2`,
|
||||
and it must be parameterized with
|
||||
vertex and face classes which are models of the concepts
|
||||
`AlphaShapeVertex_2` and `AlphaShapeFace_2`.
|
||||
whose vertex and face classes are models of the concepts
|
||||
`AlphaShapeVertex_2` and `AlphaShapeFace_2`, respectively.
|
||||
The classes `Alpha_shape_vertex_base_2<Gt, Vb>` and `Alpha_shape_face_base_2<Gt, Fb>`
|
||||
are models of these concepts and can be used for all type of alpha shapes,
|
||||
provided that the template parameters `Vb` and `Fb` are appropriately chosen,
|
||||
|
|
|
|||
|
|
@ -1,26 +0,0 @@
|
|||
|
||||
namespace CGAL {
|
||||
|
||||
/*!
|
||||
\ingroup PkgAlphaShapes2Ref
|
||||
|
||||
\deprecated The class is deprecated since \cgal 4.10, as the weighted point and the function
|
||||
objects for weighted points are part of the concept `Kernel`. The class is kept for backward
|
||||
compatibility.
|
||||
|
||||
The class `Weighted_alpha_shape_euclidean_traits_2` was the default model for the concept
|
||||
`AlphaShapeTraits_2` for the regular version of Alpha Shapes.
|
||||
|
||||
\tparam K must be a model of `Kernel`.
|
||||
|
||||
\cgalModels `AlphaShapeTraits_2`
|
||||
|
||||
*/
|
||||
template< typename K >
|
||||
class Weighted_alpha_shape_euclidean_traits_2
|
||||
: public K
|
||||
{
|
||||
public:
|
||||
|
||||
}; /* end Weighted_alpha_shape_euclidean_traits_2 */
|
||||
} /* end namespace CGAL */
|
||||
|
|
@ -45,7 +45,7 @@ typedef unspecified_type FT;
|
|||
/*!
|
||||
A default constructor.
|
||||
*/
|
||||
AlphaShapeTraits_2();
|
||||
WeightedAlphaShapeTraits_2();
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -70,12 +70,12 @@ finite number of different \f$ \alpha\f$-shapes and corresponding
|
|||
|
||||
\cgalCRPSection{Concepts}
|
||||
- `AlphaShapeTraits_2`
|
||||
- `WeightedAlphaShapeTraits_2`
|
||||
- `AlphaShapeFace_2`
|
||||
- `AlphaShapeVertex_2`
|
||||
|
||||
\cgalCRPSection{Classes}
|
||||
- `CGAL::Alpha_shape_2<Dt>`
|
||||
- `CGAL::Weighted_alpha_shape_euclidean_traits_2<K>`
|
||||
- `CGAL::Alpha_shape_vertex_base_2<AlphaShapeTraits_2>`
|
||||
- `CGAL::Alpha_shape_face_base_2<AlphaShapeTraits_2, TriangulationFaceBase_2>`
|
||||
|
||||
|
|
|
|||
|
|
@ -1,29 +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>
|
||||
// Andreas Fabri <Andreas.Fabri@geometryfactory.com>
|
||||
|
||||
#ifndef CGAL_ALPHA_SHAPE_EUCLIDEAN_TRAITS_H
|
||||
#define CGAL_ALPHA_SHAPE_EUCLIDEAN_TRAITS_H
|
||||
|
||||
#include <CGAL/license/Alpha_shapes_2.h>
|
||||
|
||||
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
template < class R >
|
||||
class Alpha_shape_euclidean_traits_2 : public R
|
||||
{};
|
||||
|
||||
} //namespace CGAL
|
||||
|
||||
#endif
|
||||
|
|
@ -1,37 +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>
|
||||
// Andreas Fabri <Andreas.Fabri@geometryfactory.com>
|
||||
|
||||
#ifndef CGAL_WEIGHTED_ALPHA_SHAPE_EUCLIDEAN_TRAITS_2_H
|
||||
#define CGAL_WEIGHTED_ALPHA_SHAPE_EUCLIDEAN_TRAITS_2_H
|
||||
|
||||
#include <CGAL/license/Alpha_shapes_2.h>
|
||||
|
||||
#define CGAL_DEPRECATED_HEADER "<CGAL/Weighted_alpha_shape_euclidean_traits_2.h>"
|
||||
#define CGAL_DEPRECATED_MESSAGE_DETAILS \
|
||||
"The kernel K can be used directly as traits since weighted points and "\
|
||||
"the associated function objects are now part of the concept Kernel."
|
||||
#include <CGAL/internal/deprecation_warning.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
template< class K_ >
|
||||
class Weighted_alpha_shape_euclidean_traits_2
|
||||
: public K_
|
||||
{
|
||||
public:
|
||||
Weighted_alpha_shape_euclidean_traits_2() { }
|
||||
Weighted_alpha_shape_euclidean_traits_2(const K_& k) : K_(k) { }
|
||||
};
|
||||
|
||||
} // namespace CGAL
|
||||
|
||||
#endif // CGAL_WEIGHTED_ALPHA_SHAPE_EUCLIDEAN_TRAITS_2_H
|
||||
|
|
@ -12,14 +12,6 @@ when alpha is given as an int.
|
|||
Alpha_shape_3(Dt& dt, bool swap=true, NT alpha = 0, Mode m = REGULARIZED)
|
||||
The triangulation is swapped if swap=true and copied otherwise.
|
||||
|
||||
- suppress the traits classes Alpha_shape_euclidean_traits_3.h
|
||||
and Weighted_alpha_shape_euclidean_traits_3.h
|
||||
their purpose was to rename the Compute_squared_radius_3 constructor.
|
||||
The same can be achieved in class Alpha_shapes_3 using the Weighted_tag
|
||||
of the triangulation
|
||||
|
||||
- same as previous for Alpha_shapes_2
|
||||
|
||||
- test the taking into account of paramater alpha in functions
|
||||
get_alpha_shape_edges
|
||||
get_alpha_shape_facets
|
||||
|
|
|
|||
|
|
@ -5,18 +5,16 @@
|
|||
|
||||
|
||||
#include <CGAL/Qt/resources.h>
|
||||
#include <CGAL/Qt/init_ogl_context.h>
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
QApplication application(argc,argv);
|
||||
CGAL::Qt::init_ogl_context(4,3);
|
||||
|
||||
QApplication application(argc,argv);
|
||||
application.setOrganizationDomain("geometryfactory.com");
|
||||
application.setOrganizationName("GeometryFactory");
|
||||
application.setApplicationName("Alpha Shape Reconstruction");
|
||||
//for Windows
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 3, 0))
|
||||
application.setAttribute(Qt::AA_UseDesktopOpenGL);
|
||||
#endif
|
||||
|
||||
// Import resources from libCGALQt (Qt5).
|
||||
// See https://doc.qt.io/qt-5/qdir.html#Q_INIT_RESOURCE
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ endif()
|
|||
|
||||
find_package(CGAL REQUIRED OPTIONAL_COMPONENTS Qt5)
|
||||
|
||||
find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg)
|
||||
find_package(Qt5 QUIET COMPONENTS Script OpenGL Svg)
|
||||
|
||||
if(CGAL_Qt5_FOUND AND Qt5_FOUND)
|
||||
|
||||
|
|
|
|||
|
|
@ -29,14 +29,14 @@ void Viewer::compile_shaders()
|
|||
//Vertex source code
|
||||
const char vertex_source[] =
|
||||
{
|
||||
"#version 120 \n"
|
||||
"attribute highp vec4 vertex;\n"
|
||||
"attribute highp vec3 normal;\n"
|
||||
"#version 150 \n"
|
||||
"in highp vec4 vertex;\n"
|
||||
"in highp vec3 normal;\n"
|
||||
|
||||
"uniform highp mat4 mvp_matrix;\n"
|
||||
"uniform highp mat4 mv_matrix; \n"
|
||||
"varying highp vec4 fP; \n"
|
||||
"varying highp vec3 fN; \n"
|
||||
"out highp vec4 fP; \n"
|
||||
"out highp vec3 fN; \n"
|
||||
"void main(void)\n"
|
||||
"{\n"
|
||||
" fP = mv_matrix * vertex; \n"
|
||||
|
|
@ -47,15 +47,16 @@ void Viewer::compile_shaders()
|
|||
//Fragment source code
|
||||
const char fragment_source[] =
|
||||
{
|
||||
"#version 120 \n"
|
||||
"varying highp vec4 fP; \n"
|
||||
"varying highp vec3 fN; \n"
|
||||
"#version 150 \n"
|
||||
"in highp vec4 fP; \n"
|
||||
"in highp vec3 fN; \n"
|
||||
"uniform highp vec4 color; \n"
|
||||
"uniform highp vec4 light_pos; \n"
|
||||
"uniform highp vec4 light_diff; \n"
|
||||
"uniform highp vec4 light_spec; \n"
|
||||
"uniform highp vec4 light_amb; \n"
|
||||
"uniform float spec_power ; \n"
|
||||
"out highp vec4 out_color; \n"
|
||||
|
||||
"void main(void) { \n"
|
||||
|
||||
|
|
@ -70,7 +71,7 @@ void Viewer::compile_shaders()
|
|||
" highp vec4 diffuse = abs(dot(N,L)) * light_diff * color; \n"
|
||||
" highp vec4 specular = pow(max(dot(R,V), 0.0), spec_power) * light_spec; \n"
|
||||
|
||||
"gl_FragColor = light_amb*color + diffuse + specular ; \n"
|
||||
"out_color = light_amb*color + diffuse + specular ; \n"
|
||||
"} \n"
|
||||
"\n"
|
||||
};
|
||||
|
|
@ -105,8 +106,8 @@ rendering_program.bind();
|
|||
//Vertex source code
|
||||
const char vertex_source_points[] =
|
||||
{
|
||||
"#version 120 \n"
|
||||
"attribute highp vec4 vertex;\n"
|
||||
"#version 150 \n"
|
||||
"in highp vec4 vertex;\n"
|
||||
|
||||
"uniform highp mat4 mvp_matrix;\n"
|
||||
"uniform highp float point_size;\n"
|
||||
|
|
@ -119,11 +120,12 @@ const char vertex_source_points[] =
|
|||
//Vertex source code
|
||||
const char fragment_source_points[] =
|
||||
{
|
||||
"#version 120 \n"
|
||||
"#version 150 \n"
|
||||
"uniform highp vec4 color; \n"
|
||||
"out highp vec4 out_color; \n"
|
||||
|
||||
"void main(void) { \n"
|
||||
"gl_FragColor = color; \n"
|
||||
"out_color = color; \n"
|
||||
"} \n"
|
||||
"\n"
|
||||
};
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ public:
|
|||
Viewer(QWidget* parent);
|
||||
~Viewer()
|
||||
{
|
||||
makeCurrent();
|
||||
buffers[0].destroy();
|
||||
buffers[1].destroy();
|
||||
buffers[2].destroy();
|
||||
|
|
|
|||
|
|
@ -219,8 +219,8 @@ in the non-weighted case and `WeightedAlphaShapeTraits_3` in the weighted case.
|
|||
All \cgal kernels are models of both concepts.
|
||||
|
||||
The triangulation data structure of the triangulation
|
||||
has to be a model of the concept `TriangulationDataStructure_3`,
|
||||
and it must be parameterized with vertex and cell classes, which are model of the concepts
|
||||
has to be a model of the concept `TriangulationDataStructure_3`
|
||||
whose vertex and cell classes are model of the concepts
|
||||
`AlphaShapeVertex_3` and `AlphaShapeCell_3`.
|
||||
The classes `Alpha_shape_vertex_base_3<Gt>` and `Alpha_shape_cell_base_3<Gt>`
|
||||
are models of these concepts and can be used for all type of alpha shapes,
|
||||
|
|
@ -234,8 +234,8 @@ the traits class are described in the concepts `FixedAlphaShapeTraits_3`
|
|||
in the non-weighted case and `FixedWeightedAlphaShapeTraits_3` in the weighted case.
|
||||
All \cgal kernels are models of both concepts.
|
||||
The triangulation data structure of the triangulation
|
||||
has to be a model of the concept `TriangulationDataStructure_3`,
|
||||
and it must be parameterized with vertex and cell classes, which are model of the concepts
|
||||
has to be a model of the concept `TriangulationDataStructure_3`
|
||||
whose vertex and cell classes are model of the concepts
|
||||
`FixedAlphaShapeVertex_3` and `FixedAlphaShapeCell_3`.
|
||||
The package provides models `Fixed_alpha_shape_vertex_base_3<Gt>`
|
||||
and `Fixed_alpha_shape_cell_base_3<Gt>`, respectively.
|
||||
|
|
|
|||
|
|
@ -1,27 +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>
|
||||
|
||||
#ifndef CGAL_ALPHA_SHAPE_EUCLIDEAN_TRAITS_3_H
|
||||
#define CGAL_ALPHA_SHAPE_EUCLIDEAN_TRAITS_3_H
|
||||
|
||||
#include <CGAL/license/Alpha_shapes_3.h>
|
||||
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
template <class K>
|
||||
class Alpha_shape_euclidean_traits_3 : public K {};
|
||||
|
||||
|
||||
} //namespace CGAL
|
||||
|
||||
#endif //CGAL_ALPHA_SHAPE_EUCLIDEAN_TRAITS_3_H
|
||||
|
|
@ -1,36 +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>
|
||||
|
||||
#ifndef CGAL_WEIGHTED_ALPHA_SHAPE_EUCLIDEAN_TRAITS_3_H
|
||||
#define CGAL_WEIGHTED_ALPHA_SHAPE_EUCLIDEAN_TRAITS_3_H
|
||||
|
||||
#include <CGAL/license/Alpha_shapes_3.h>
|
||||
|
||||
#define CGAL_DEPRECATED_HEADER "<CGAL/Weighted_alpha_shape_euclidean_traits_3.h>"
|
||||
#define CGAL_DEPRECATED_MESSAGE_DETAILS \
|
||||
"The kernel K can be used directly as traits since weighted points and "\
|
||||
"the associated function objects are now part of the concept Kernel."
|
||||
#include <CGAL/internal/deprecation_warning.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
template < class K_ >
|
||||
class Weighted_alpha_shape_euclidean_traits_3
|
||||
: public K_
|
||||
{
|
||||
public:
|
||||
Weighted_alpha_shape_euclidean_traits_3() { }
|
||||
Weighted_alpha_shape_euclidean_traits_3(const K_& k) : K_(k) { }
|
||||
};
|
||||
|
||||
} // namespace CGAL
|
||||
|
||||
#endif // CGAL_WEIGHTED_ALPHA_SHAPE_EUCLIDEAN_TRAITS_3_H
|
||||
|
|
@ -181,7 +181,7 @@ two visible circles.
|
|||
|
||||
The 2D Apollonius graph class
|
||||
`Apollonius_graph_2<ApolloniusGraphTraits_2,ApolloniusGraphDataStructure_2>`
|
||||
follows the design of the triangulation package of \cgal. It is
|
||||
follows the design of the triangulation packages of \cgal. It is
|
||||
parametrized by two arguments:
|
||||
<UL>
|
||||
<LI>the <B>geometric traits</B> class. It provides the basic
|
||||
|
|
|
|||
|
|
@ -4,14 +4,20 @@ namespace CGAL {
|
|||
/*!
|
||||
\ingroup PkgApolloniusGraph2Ref
|
||||
|
||||
The class `Apollonius_graph_2` represents the
|
||||
Apollonius graph. It supports insertions and deletions of sites.
|
||||
It is templated by two template arguments `Gt`, which
|
||||
must be a model of `ApolloniusGraphTraits_2`, and `Agds`,
|
||||
which must be a model of `ApolloniusGraphDataStructure_2`.
|
||||
The second template argument defaults to
|
||||
`CGAL::Triangulation_data_structure_2< CGAL::Apollonius_graph_vertex_base_2<Gt,true>, CGAL::Triangulation_face_base_2<Gt> >`.
|
||||
\cgalModels `DelaunayGraph_2`
|
||||
The class `Apollonius_graph_2` represents the Apollonius graph.
|
||||
It supports insertions and deletions of sites.
|
||||
|
||||
\tparam Gt is the geometric traits class and must be a model of `ApolloniusGraphTraits_2`.
|
||||
|
||||
\tparam Agds is the Apollonius graph data structure and must be a model of `ApolloniusGraphDataStructure_2`
|
||||
whose vertex and face must be models of `ApolloniusGraphVertexBase_2` and `TriangulationFaceBase_2`,
|
||||
respectively.
|
||||
It defaults to:
|
||||
\code
|
||||
CGAL::Triangulation_data_structure_2<
|
||||
CGAL::Apollonius_graph_vertex_base_2<Gt,true>,
|
||||
CGAL::Triangulation_face_base_2<Gt> >`
|
||||
\endcode
|
||||
|
||||
\cgalHeading{Traversal of the Apollonius Graph}
|
||||
|
||||
|
|
@ -40,17 +46,11 @@ ag.incident_edges(ag.infinite_vertex());
|
|||
ag.incident_edges(ag.infinite_vertex(), f);
|
||||
\endcode
|
||||
|
||||
\sa `DelaunayGraph_2`
|
||||
\sa `ApolloniusGraphTraits_2`
|
||||
\sa `ApolloniusGraphDataStructure_2`
|
||||
\sa `ApolloniusGraphVertexBase_2`
|
||||
\sa `TriangulationFaceBase_2`
|
||||
\cgalModels `DelaunayGraph_2`
|
||||
|
||||
\sa `CGAL::Apollonius_graph_traits_2<K,Method_tag>`
|
||||
\sa `CGAL::Apollonius_graph_filtered_traits_2<CK,CM,EK,EM,FK,FM>`
|
||||
\sa `CGAL::Triangulation_data_structure_2<Vb,Fb>`
|
||||
\sa `CGAL::Apollonius_graph_vertex_base_2<Gt,StoreHidden>`
|
||||
\sa `CGAL::Triangulation_face_base_2<Gt>`
|
||||
|
||||
\sa `CGAL::Apollonius_graph_hierarchy_2<Gt,Agds>`
|
||||
*/
|
||||
template< typename Gt, typename Agds >
|
||||
class Apollonius_graph_2 {
|
||||
|
|
@ -92,7 +92,7 @@ typedef Gt::Site_2 Site_2;
|
|||
|
||||
/// \name Handles And Iterators
|
||||
/// The vertices and faces of the Apollonius graph are accessed
|
||||
/// through `handles`, `iterators` and `circulators`. The iterators
|
||||
/// through `handles`, `iterators`, and `circulators`. The iterators
|
||||
/// and circulators are all bidirectional and non-mutable. The
|
||||
/// circulators and iterators are assignable to the corresponding
|
||||
/// handle types, and they are also convertible to the corresponding
|
||||
|
|
@ -261,63 +261,62 @@ operator=(const Apollonius_graph_2<Gt,Agds>& other);
|
|||
/*!
|
||||
Returns a reference to the Apollonius graph traits object.
|
||||
*/
|
||||
Geom_traits geom_traits();
|
||||
const Geom_traits& geom_traits() const;
|
||||
|
||||
/*!
|
||||
Returns a reference to the
|
||||
underlying data structure.
|
||||
*/
|
||||
Data_structure data_structure();
|
||||
const Data_structure& data_structure() const;
|
||||
|
||||
/*!
|
||||
Same as `data_structure()`. This
|
||||
method has been added in compliance with the `DelaunayGraph_2`
|
||||
concept.
|
||||
*/
|
||||
Data_structure tds();
|
||||
const Data_structure& tds() const;
|
||||
|
||||
/*!
|
||||
Returns the dimension of the Apollonius graph.
|
||||
*/
|
||||
int dimension();
|
||||
int dimension() const;
|
||||
|
||||
/*!
|
||||
Returns the number of finite vertices.
|
||||
*/
|
||||
size_type number_of_vertices();
|
||||
size_type number_of_vertices() const;
|
||||
|
||||
/*!
|
||||
Returns the number of visible sites.
|
||||
*/
|
||||
size_type number_of_visible_sites();
|
||||
size_type number_of_visible_sites() const;
|
||||
|
||||
/*!
|
||||
Returns the number of hidden sites.
|
||||
*/
|
||||
size_type number_of_hidden_sites();
|
||||
size_type number_of_hidden_sites() const;
|
||||
|
||||
/*!
|
||||
Returns the number of faces (both finite and infinite) of the
|
||||
Apollonius graph.
|
||||
*/
|
||||
size_type number_of_faces();
|
||||
size_type number_of_faces() const;
|
||||
|
||||
/*!
|
||||
Returns a face incident to the `infinite_vertex`.
|
||||
*/
|
||||
Face_handle infinite_face();
|
||||
Face_handle infinite_face() const;
|
||||
|
||||
/*!
|
||||
Returns the `infinite_vertex`.
|
||||
*/
|
||||
Vertex_handle
|
||||
infinite_vertex();
|
||||
Vertex_handle infinite_vertex() const;
|
||||
|
||||
/*!
|
||||
Returns a vertex distinct from the `infinite_vertex`.
|
||||
\pre The number of (visible) vertices in the Apollonius graph must be at least one.
|
||||
*/
|
||||
Vertex_handle finite_vertex();
|
||||
Vertex_handle finite_vertex() const;
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
@ -337,63 +336,62 @@ Vertex_handle finite_vertex();
|
|||
/*!
|
||||
Starts at an arbitrary finite vertex.
|
||||
*/
|
||||
Finite_vertices_iterator finite_vertices_begin();
|
||||
Finite_vertices_iterator finite_vertices_begin() const;
|
||||
|
||||
/*!
|
||||
Past-the-end iterator.
|
||||
*/
|
||||
Finite_vertices_iterator finite_vertices_end();
|
||||
Finite_vertices_iterator finite_vertices_end() const;
|
||||
|
||||
/*!
|
||||
Starts at an arbitrary finite edge.
|
||||
*/
|
||||
Finite_edges_iterator finite_edges_begin();
|
||||
Finite_edges_iterator finite_edges_begin() const;
|
||||
|
||||
/*!
|
||||
Past-the-end iterator.
|
||||
*/
|
||||
Finite_edges_iterator finite_edges_end();
|
||||
Finite_edges_iterator finite_edges_end() const;
|
||||
|
||||
/*!
|
||||
Starts at an arbitrary finite face.
|
||||
*/
|
||||
Finite_faces_iterator finite_faces_begin();
|
||||
Finite_faces_iterator finite_faces_begin() const;
|
||||
|
||||
/*!
|
||||
Past-the-end iterator.
|
||||
*/
|
||||
Finite_faces_iterator finite_faces_end()
|
||||
const;
|
||||
Finite_faces_iterator finite_faces_end() const;
|
||||
|
||||
/*!
|
||||
Starts at an arbitrary vertex.
|
||||
*/
|
||||
All_vertices_iterator all_vertices_begin();
|
||||
All_vertices_iterator all_vertices_begin() const;
|
||||
|
||||
/*!
|
||||
Past-the-end iterator.
|
||||
*/
|
||||
All_vertices_iterator all_vertices_end();
|
||||
All_vertices_iterator all_vertices_end() const;
|
||||
|
||||
/*!
|
||||
Starts at an arbitrary edge.
|
||||
*/
|
||||
All_edges_iterator all_edges_begin();
|
||||
All_edges_iterator all_edges_begin() const;
|
||||
|
||||
/*!
|
||||
Past-the-end iterator.
|
||||
*/
|
||||
All_edges_iterator all_edges_end();
|
||||
All_edges_iterator all_edges_end() const;
|
||||
|
||||
/*!
|
||||
Starts at an arbitrary face.
|
||||
*/
|
||||
All_faces_iterator all_faces_begin();
|
||||
All_faces_iterator all_faces_begin() const;
|
||||
|
||||
/*!
|
||||
Past-the-end iterator.
|
||||
*/
|
||||
All_faces_iterator all_faces_end();
|
||||
All_faces_iterator all_faces_end() const;
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
@ -407,32 +405,32 @@ All_faces_iterator all_faces_end();
|
|||
/*!
|
||||
Starts at an arbitrary site.
|
||||
*/
|
||||
Sites_iterator sites_begin();
|
||||
Sites_iterator sites_begin() const;
|
||||
|
||||
/*!
|
||||
Past-the-end iterator.
|
||||
*/
|
||||
Sites_iterator sites_end();
|
||||
Sites_iterator sites_end() const;
|
||||
|
||||
/*!
|
||||
Starts at an arbitrary visible site.
|
||||
*/
|
||||
Visible_sites_iterator visible_sites_begin();
|
||||
Visible_sites_iterator visible_sites_begin() const;
|
||||
|
||||
/*!
|
||||
Past-the-end iterator.
|
||||
*/
|
||||
Visible_sites_iterator visible_sites_end();
|
||||
Visible_sites_iterator visible_sites_end() const;
|
||||
|
||||
/*!
|
||||
Starts at an arbitrary hidden site.
|
||||
*/
|
||||
Hidden_sites_iterator hidden_sites_begin();
|
||||
Hidden_sites_iterator hidden_sites_begin() const;
|
||||
|
||||
/*!
|
||||
Past-the-end iterator.
|
||||
*/
|
||||
Hidden_sites_iterator hidden_sites_end();
|
||||
Hidden_sites_iterator hidden_sites_end() const;
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
@ -454,39 +452,39 @@ Hidden_sites_iterator hidden_sites_end();
|
|||
Starts at an arbitrary face incident
|
||||
to `v`.
|
||||
*/
|
||||
Face_circulator incident_faces(Vertex_handle v);
|
||||
Face_circulator incident_faces(Vertex_handle v) const;
|
||||
|
||||
/*!
|
||||
Starts at face `f`.
|
||||
\pre Face `f` is incident to vertex `v`.
|
||||
*/
|
||||
Face_circulator incident_faces(Vertex_handle v, Face_handle f);
|
||||
Face_circulator incident_faces(Vertex_handle v, Face_handle f) const;
|
||||
|
||||
/*!
|
||||
Starts at an arbitrary edge incident
|
||||
to `v`.
|
||||
*/
|
||||
Edge_circulator incident_edges(Vertex_handle v);
|
||||
Edge_circulator incident_edges(Vertex_handle v) const;
|
||||
|
||||
/*!
|
||||
Starts at the first edge of `f` incident to
|
||||
`v`, in counterclockwise order around `v`.
|
||||
\pre Face `f` is incident to vertex `v`.
|
||||
*/
|
||||
Edge_circulator incident_edges(Vertex_handle v, Face_handle f);
|
||||
Edge_circulator incident_edges(Vertex_handle v, Face_handle f) const;
|
||||
|
||||
/*!
|
||||
Starts at an arbitrary vertex incident
|
||||
to `v`.
|
||||
*/
|
||||
Vertex_circulator incident_vertices(Vertex_handle v);
|
||||
Vertex_circulator incident_vertices(Vertex_handle v) const;
|
||||
|
||||
/*!
|
||||
Starts at the first vertex of `f` adjacent to `v`
|
||||
in counterclockwise order around `v`.
|
||||
\pre Face `f` is incident to vertex `v`.
|
||||
*/
|
||||
Vertex_circulator incident_vertices(Vertex_handle v, Face_handle f);
|
||||
Vertex_circulator incident_vertices(Vertex_handle v, Face_handle f) const;
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
@ -516,7 +514,7 @@ bool is_infinite(Face_handle f, int i) const;
|
|||
`true`, iff edge `e` is infinite.
|
||||
*/
|
||||
bool
|
||||
is_infinite(Edge e) const;
|
||||
is_infinite(const Edge& e) const;
|
||||
|
||||
/*!
|
||||
`true`, iff edge `*ec` is infinite.
|
||||
|
|
@ -544,7 +542,7 @@ site `s` in the Apollonius graph. If `s` is visible then the
|
|||
vertex handle of `s` is returned, otherwise
|
||||
`Vertex_handle(nullptr)` is returned.
|
||||
*/
|
||||
Vertex_handle insert(Site_2 s);
|
||||
Vertex_handle insert(const Site_2& s);
|
||||
|
||||
/*!
|
||||
Inserts `s` in the Apollonius graph using the site
|
||||
|
|
@ -553,8 +551,7 @@ the center of `s`. If `s` is visible then the vertex handle of
|
|||
`s` is returned, otherwise `Vertex_handle(nullptr)` is
|
||||
returned.
|
||||
*/
|
||||
Vertex_handle insert(Site_2 s, Vertex_handle
|
||||
vnear);
|
||||
Vertex_handle insert(const Site_2& s, Vertex_handle vnear);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
@ -581,7 +578,7 @@ arbitrarily and one of the nearest neighbors of `p` is
|
|||
returned. If there are no visible sites in the Apollonius diagram
|
||||
`Vertex_handle(nullptr)` is returned.
|
||||
*/
|
||||
Vertex_handle nearest_neighbor(Point_2 p);
|
||||
Vertex_handle nearest_neighbor(const Point_2& p) const;
|
||||
|
||||
/*!
|
||||
Finds the nearest neighbor of the point
|
||||
|
|
@ -591,8 +588,7 @@ arbitrarily and one of the nearest neighbors of `p` is
|
|||
returned. If there are no visible sites in the Apollonius diagram
|
||||
`Vertex_handle(nullptr)` is returned.
|
||||
*/
|
||||
Vertex_handle nearest_neighbor(Point_2 p,
|
||||
Vertex_handle vnear);
|
||||
Vertex_handle nearest_neighbor(const Point_2& p, Vertex_handle vnear) const;
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
@ -645,7 +641,7 @@ the stream `str`.
|
|||
|
||||
*/
|
||||
template< class Stream >
|
||||
Stream& draw_primal(Stream& str);
|
||||
Stream& draw_primal(Stream& str) const;
|
||||
|
||||
/*!
|
||||
Draws the dual of the
|
||||
|
|
@ -658,7 +654,7 @@ Apollonius graph, i.e., the Apollonius diagram, to the stream
|
|||
|
||||
*/
|
||||
template < class Stream >
|
||||
Stream& draw_dual(Stream& str);
|
||||
Stream& draw_dual(Stream& str) const;
|
||||
|
||||
/*!
|
||||
Draws the edge
|
||||
|
|
@ -669,7 +665,7 @@ Draws the edge
|
|||
|
||||
*/
|
||||
template< class Stream >
|
||||
Stream& draw_primal_edge(Edge e, Stream& str);
|
||||
Stream& draw_primal_edge(const Edge& e, Stream& str) const;
|
||||
|
||||
/*!
|
||||
Draws the dual of the
|
||||
|
|
@ -682,7 +678,7 @@ of the Apollonius diagram.
|
|||
|
||||
*/
|
||||
template< class Stream >
|
||||
Stream& draw_dual_edge(Edge e, Stream& str);
|
||||
Stream& draw_dual_edge(const Edge& e, Stream& str) const;
|
||||
|
||||
/*!
|
||||
Writes the current
|
||||
|
|
@ -690,7 +686,7 @@ state of the Apollonius graph to an output stream. In particular,
|
|||
all visible and hidden sites are written as well as the
|
||||
underlying combinatorial data structure.
|
||||
*/
|
||||
void file_output(std::ostream& os);
|
||||
void file_output(std::ostream& os) const;
|
||||
|
||||
/*!
|
||||
Reads the state of the
|
||||
|
|
@ -701,14 +697,12 @@ void file_input(std::istream& is);
|
|||
/*!
|
||||
Writes the current state of the Apollonius graph to an output stream.
|
||||
*/
|
||||
std::ostream& operator<<(std::ostream& os,
|
||||
Apollonius_graph_2<Gt,Agds> ag);
|
||||
std::ostream& operator<<(std::ostream& os, const Apollonius_graph_2<Gt,Agds>& ag) const;
|
||||
|
||||
/*!
|
||||
Reads the state of the Apollonius graph from an input stream.
|
||||
*/
|
||||
std::istream& operator>>(std::istream& is,
|
||||
Apollonius_graph_2<Gt,Agds> ag);
|
||||
std::istream& operator>>(std::istream& is, const Apollonius_graph_2<Gt,Agds>& ag);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
@ -721,9 +715,9 @@ Checks the validity of the Apollonius graph. If `verbose` is
|
|||
is 0, only the data structure is validated. If `level` is 1, then
|
||||
both the data structure and the Apollonius graph are
|
||||
validated. Negative values of `level` always return true, and
|
||||
values greater then 1 are equivalent to `level` being 1.
|
||||
values greater than 1 are equivalent to `level` being 1.
|
||||
*/
|
||||
bool is_valid(bool verbose = false, int level = 1);
|
||||
bool is_valid(bool verbose = false, int level = 1) const;
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
@ -737,12 +731,11 @@ void clear();
|
|||
|
||||
/*!
|
||||
The Apollonius graphs
|
||||
`other` and `ag` are swapped. `ag`.`swap(other)` should
|
||||
be preferred to `ag`` = other` or to `ag``(other)` if
|
||||
`other` and `ag` are swapped. `ag.swap(other)` should
|
||||
be preferred to `ag = other` or to `ag(other)` if
|
||||
`other` is deleted afterwards.
|
||||
*/
|
||||
void swap(Apollonius_graph_2<Gt,Agds>
|
||||
other);
|
||||
void swap(Apollonius_graph_2<Gt,Agds>& other);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,36 +19,34 @@ find the nearest neighbor of \f$ p\f$ as in the
|
|||
we use the nearest neighbor found at level \f$ i+1\f$ to find the nearest
|
||||
neighbor at level \f$ i\f$. This is a variant of the corresponding
|
||||
hierarchy for points found in \cgalCite{d-iirdt-98}.
|
||||
|
||||
The class has two template parameters which have essentially the same
|
||||
meaning as in the `Apollonius_graph_2<Gt,Agds>` class. The first
|
||||
template parameter must be a model of the
|
||||
`ApolloniusGraphTraits_2` concept.
|
||||
The second template parameter must be a model of the
|
||||
`ApolloniusGraphDataStructure_2` concept. However, the vertex base
|
||||
class that is to be used in the Apollonius graph data structure must
|
||||
be a model of the `ApolloniusGraphHierarchyVertexBase_2` concept.
|
||||
The second template parameter defaults to
|
||||
`Triangulation_data_structure_2< Apollonius_graph_hierarchy_vertex_base_2< Apollonius_graph_vertex_base_2<Gt,true> >, Triangulation_face_base_2<Gt> >`.
|
||||
meaning as in the `Apollonius_graph_2<Gt,Agds>` class.
|
||||
|
||||
\tparam Gt is the geometric traits class and must be a model of `ApolloniusGraphTraits_2`.
|
||||
|
||||
\tparam Agds is the Apollonius graph data structure and must be a model of `ApolloniusGraphDataStructure_2`
|
||||
whose vertex and face must be models of `ApolloniusGraphHierarchyVertexBase_2` and `TriangulationFaceBase_2`, respectively.
|
||||
It defaults to:
|
||||
\code
|
||||
CGAL::Triangulation_data_structure_2<
|
||||
CGAL::Apollonius_graph_hierarchy_vertex_base_2<CGAL::Apollonius_graph_vertex_base_2<Gt,true> >,
|
||||
CGAL::Triangulation_face_base_2<Gt> >
|
||||
\endcode
|
||||
|
||||
\cgalHeading{Heritage}
|
||||
|
||||
The `Apollonius_graph_hierarchy_2` class derives publicly from the
|
||||
`Apollonius_graph_2<Gt,Agds>` class. The interface is
|
||||
the same with its base class. In the sequel only the methods
|
||||
overridden are documented.
|
||||
|
||||
\cgalHeading{Types}
|
||||
|
||||
`Apollonius_graph_hierarchy_2` does not introduce other types than those introduced by
|
||||
its base class `Apollonius_graph_2<Gt,Agds>`.
|
||||
|
||||
\sa `ApolloniusGraphDataStructure_2`
|
||||
\sa `ApolloniusGraphTraits_2`
|
||||
\sa `ApolloniusGraphHierarchyVertexBase_2`
|
||||
\sa `CGAL::Apollonius_graph_2<Gt,Agds>`
|
||||
\sa `CGAL::Triangulation_data_structure_2<Vb,Fb>`
|
||||
\sa `CGAL::Apollonius_graph_traits_2<K,Method_tag>`
|
||||
\sa `CGAL::Apollonius_graph_filtered_traits_2<CK,CM,EK,EM,FK,FM>`
|
||||
\sa `CGAL::Apollonius_graph_hierarchy_vertex_base_2<Agvb>`
|
||||
|
||||
*/
|
||||
template< typename Gt, typename Agds >
|
||||
class Apollonius_graph_hierarchy_2 : public CGAL::Apollonius_graph_2<Gt,Agds> {
|
||||
|
|
@ -61,8 +59,7 @@ public:
|
|||
Creates an hierarchy of Apollonius graphs using `gt` as
|
||||
geometric traits.
|
||||
*/
|
||||
Apollonius_graph_hierarchy_2(Gt
|
||||
gt=Gt());
|
||||
Apollonius_graph_hierarchy_2(Gt gt=Gt());
|
||||
|
||||
/*!
|
||||
Creates an Apollonius graph hierarchy using
|
||||
|
|
@ -70,17 +67,15 @@ Creates an Apollonius graph hierarchy using
|
|||
range [`first`, `beyond`).
|
||||
*/
|
||||
template< class Input_iterator >
|
||||
Apollonius_graph_hierarchy_2<Gt,Agds>(Input_iterator
|
||||
first, Input_iterator beyond, Gt gt=Gt());
|
||||
Apollonius_graph_hierarchy_2(Input_iterator first, Input_iterator beyond, Gt gt=Gt());
|
||||
|
||||
/*!
|
||||
Copy constructor. All faces, vertices and inter-level pointers
|
||||
Copy constructor. All faces, vertices, and inter-level pointers
|
||||
are duplicated. After the construction, `agh` and `other` refer
|
||||
to two different Apollonius graph hierarchies: if
|
||||
`other` is modified, `agh` is not.
|
||||
*/
|
||||
Apollonius_graph_hierarchy_2<Gt,Agds>
|
||||
(Apollonius_graph_hierarchy_2<Gt,Agds> other);
|
||||
Apollonius_graph_hierarchy_2(const Apollonius_graph_hierarchy_2<Gt,Agds>& other);
|
||||
|
||||
/*!
|
||||
Assignment. All faces, vertices and inter-level pointers
|
||||
|
|
@ -112,7 +107,7 @@ site `s` in the Apollonius graph hierarchy. If `s`
|
|||
is visible then the vertex handle of `s` is returned, otherwise
|
||||
`Vertex_handle(nullptr)` is returned.
|
||||
*/
|
||||
Vertex_handle insert(Site_2 s);
|
||||
Vertex_handle insert(const Site_2& s);
|
||||
|
||||
/*!
|
||||
Inserts `s` in the Apollonius graph hierarchy using the
|
||||
|
|
@ -124,8 +119,7 @@ A call to this method is equivalent to `agh.insert(s);` and it has
|
|||
been added for the sake of conformity with the interface of the
|
||||
`Apollonius_graph_2<Gt,Agds>` class.
|
||||
*/
|
||||
Vertex_handle insert(Site_2 s, Vertex_handle
|
||||
vnear);
|
||||
Vertex_handle insert(const Site_2& s, Vertex_handle vnear);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
@ -152,7 +146,7 @@ arbitrarily and one of the nearest neighbors of `p` is
|
|||
returned. If there are no visible sites in the Apollonius diagram
|
||||
`Vertex_handle(nullptr)` is returned.
|
||||
*/
|
||||
Vertex_handle nearest_neighbor(Point p);
|
||||
Vertex_handle nearest_neighbor(const Point_2& p) const;
|
||||
|
||||
/*!
|
||||
Finds the nearest neighbor of the point
|
||||
|
|
@ -163,8 +157,7 @@ A call to this method is equivalent to
|
|||
conformity with the interface of the
|
||||
`Apollonius_graph_2<Gt,Agds>` class.
|
||||
*/
|
||||
Vertex_handle nearest_neighbor(Point p,
|
||||
Vertex_handle vnear);
|
||||
Vertex_handle nearest_neighbor(const Point_2& p, Vertex_handle vnear) const;
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
@ -177,7 +170,7 @@ state of the Apollonius graph hierarchy to an output stream. In particular,
|
|||
all visible and hidden sites are written as well as the
|
||||
underlying combinatorial hierarchical data structure.
|
||||
*/
|
||||
void file_output(std::ostream& os);
|
||||
void file_output(std::ostream& os) const;
|
||||
|
||||
/*!
|
||||
Reads the state of the
|
||||
|
|
@ -189,7 +182,7 @@ void file_input(std::istream& is);
|
|||
Writes the current state of the Apollonius graph hierarchy to an
|
||||
output stream.
|
||||
*/
|
||||
std::ostream& operator<<(std::ostream& os, Apollonius_graph_hierarchy_2<Gt,Agds> agh);
|
||||
std::ostream& operator<<(std::ostream& os, Apollonius_graph_hierarchy_2<Gt,Agds> agh) const;
|
||||
|
||||
/*!
|
||||
Reads the state of the Apollonius graph hierarchy from an input stream.
|
||||
|
|
@ -209,7 +202,7 @@ is validated, as well as the inter-level pointers. If `level` is
|
|||
1, then the data structure at all levels is validated, the inter-level
|
||||
pointers are validated and all levels of the Apollonius graph
|
||||
hierarchy are also validated. Negative values of `level` always
|
||||
return `true`, and values greater then 1 are equivalent to
|
||||
return `true`, and values greater than 1 are equivalent to
|
||||
`level` being 1.
|
||||
*/
|
||||
bool is_valid(bool verbose = false, int level = 1) const;
|
||||
|
|
@ -227,11 +220,10 @@ void clear();
|
|||
|
||||
/*!
|
||||
The Apollonius graph hierarchies `other` and `agh` are
|
||||
swapped. `agh`.`swap(other)` should be preferred to `agh`` =
|
||||
other` or to `agh``(other)` if `other` is deleted afterwards.
|
||||
swapped. `agh.swap(other)` should be preferred to `agh = other`
|
||||
or to `agh(other)` if `other` is deleted afterwards.
|
||||
*/
|
||||
void swap(Apollonius_graph_hierarchy_2<Gt,Agds>
|
||||
other);
|
||||
void swap(Apollonius_graph_hierarchy_2<Gt,Agds>& other);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,10 +13,9 @@ of the `ApolloniusGraphVertexBase_2` concept.
|
|||
|
||||
\cgalModels `ApolloniusGraphHierarchyVertexBase_2`
|
||||
|
||||
\sa `ApolloniusGraphVertexBase_2`
|
||||
\sa `ApolloniusGraphHierarchyVertexBase_2`
|
||||
\sa `CGAL::Apollonius_graph_vertex_base_2<Gt,StoreHidden>`
|
||||
|
||||
\sa `CGAL::Triangulation_data_structure_2<Vb,Fb>`
|
||||
\sa `CGAL::Apollonius_graph_hierarchy_2<Gt,Agds>`
|
||||
*/
|
||||
template< typename Agvb >
|
||||
class Apollonius_graph_hierarchy_vertex_base_2 : Agvb {
|
||||
|
|
@ -34,7 +33,7 @@ Apollonius_graph_hierarchy_vertex_base_2();
|
|||
Constructs a vertex associated with the site `s` and
|
||||
embedded at the center of `s`.
|
||||
*/
|
||||
Apollonius_graph_hierarchy_vertex_base_2(Site_2 s);
|
||||
Apollonius_graph_hierarchy_vertex_base_2(const Site_2& s);
|
||||
|
||||
/*!
|
||||
Constructs a vertex associated with
|
||||
|
|
@ -42,7 +41,7 @@ the site `s`, embedded at the center of `s`,
|
|||
and pointing to the face associated with the face
|
||||
handle `f`.
|
||||
*/
|
||||
Apollonius_graph_vertex_base_2(Site_2 s, Face_handle f);
|
||||
Apollonius_graph_hierarchy_vertex_base_2(const Site_2& s, Face_handle f);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,13 +22,8 @@ The way the predicates are evaluated is discussed in
|
|||
|
||||
\cgalModels `ApolloniusGraphTraits_2`
|
||||
|
||||
\sa `Kernel`
|
||||
\sa `ApolloniusGraphTraits_2`
|
||||
\sa `CGAL::Integral_domain_without_division_tag`
|
||||
\sa `CGAL::Field_with_sqrt_tag`
|
||||
\sa `CGAL::Apollonius_graph_2<Gt,Agds>`
|
||||
\sa `CGAL::Apollonius_graph_filtered_traits_2<CK,CM,EK,EM,FK,FM>`
|
||||
|
||||
*/
|
||||
template< typename K, typename Method_tag >
|
||||
class Apollonius_graph_traits_2 {
|
||||
|
|
@ -45,14 +40,13 @@ Apollonius_graph_traits_2<K,Method_tag>();
|
|||
/*!
|
||||
Copy constructor.
|
||||
*/
|
||||
Apollonius_graph_traits_2<K,Method_tag>(Apollonius_graph_traits_2<K,Method_tag> other);
|
||||
Apollonius_graph_traits_2<K,Method_tag>(const Apollonius_graph_traits_2<K,Method_tag>& other);
|
||||
|
||||
/*!
|
||||
Assignment operator.
|
||||
*/
|
||||
Apollonius_graph_traits_2<K,Method_tag>
|
||||
operator=(Apollonius_graph_traits_2<K,Method_tag>
|
||||
other);
|
||||
operator=(const Apollonius_graph_traits_2<K,Method_tag>& other);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,13 +19,8 @@ discarded. By default `StoreHidden` is set to `true`.
|
|||
|
||||
\cgalModels `ApolloniusGraphVertexBase_2`
|
||||
|
||||
\sa `ApolloniusGraphVertexBase_2`
|
||||
\sa `ApolloniusGraphDataStructure_2`
|
||||
\sa `ApolloniusGraphTraits_2`
|
||||
\sa `CGAL::Triangulation_data_structure_2<Vb,Fb>`
|
||||
\sa `CGAL::Apollonius_graph_traits_2<K,Method_tag>`
|
||||
\sa `CGAL::Apollonius_graph_filtered_traits_2<CK,CM,EK,EM,FK,FM>`
|
||||
|
||||
\sa `CGAL::Apollonius_graph_hierarchy_vertex_base_2<Gt>`
|
||||
*/
|
||||
template< typename Gt, typename StoreHidden >
|
||||
class Apollonius_graph_vertex_base_2 {
|
||||
|
|
@ -37,13 +32,13 @@ public:
|
|||
/*!
|
||||
%Default constructor.
|
||||
*/
|
||||
Apollonius_graph_bertex_base_2();
|
||||
Apollonius_graph_vertex_base_2();
|
||||
|
||||
/*!
|
||||
Constructs a vertex associated with the site `s` and
|
||||
embedded at the center of `s`.
|
||||
*/
|
||||
Apollonius_graph_vertex_base_2(Site_2 s);
|
||||
Apollonius_graph_vertex_base_2(const Site_2& s);
|
||||
|
||||
/*!
|
||||
Constructs a vertex associated with
|
||||
|
|
@ -51,7 +46,7 @@ the site `s`, embedded at the center of `s`,
|
|||
and pointing to the face associated with the face
|
||||
handle `f`.
|
||||
*/
|
||||
Apollonius_graph_vertex_base_2(Site_2 s, Face_handle f);
|
||||
Apollonius_graph_vertex_base_2(const Site_2& s, Face_handle f);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,12 +22,9 @@ The I/O operators are defined for `iostream`.
|
|||
The information output in the `iostream` is: the point of the
|
||||
Apollonius site and its weight.
|
||||
|
||||
\sa `Kernel`
|
||||
\sa `ApolloniusSite_2`
|
||||
\sa `CGAL::Qt_widget`
|
||||
\sa `CGAL::Apollonius_graph_traits_2<K,Method_tag>`
|
||||
\sa `CGAL::Apollonius_graph_filtered_traits_2<CK,CM,EK,EM,FK,FM>`
|
||||
|
||||
*/
|
||||
template< typename K >
|
||||
class Apollonius_site_2 {
|
||||
|
|
@ -44,7 +41,7 @@ Apollonius_site_2(Point_2 p=Point_2(), Weight w= Weight(0));
|
|||
/*!
|
||||
Copy constructor.
|
||||
*/
|
||||
Apollonius_site_2(Apollonius_site_2<K> other);
|
||||
Apollonius_site_2(const Apollonius_site_2<K>& other);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
@ -57,8 +54,7 @@ Apollonius site `s` into the stream `os`.
|
|||
\pre The insert operator must be defined for `Point_2` and `Weight`.
|
||||
\relates Apollonius_site_2
|
||||
*/
|
||||
std::ostream& operator<<(std::ostream& os,
|
||||
const Apollonius_site_2<K>& s);
|
||||
std::ostream& operator<<(std::ostream& os, const Apollonius_site_2<K>& s) const;
|
||||
|
||||
/*!
|
||||
Reads an Apollonius site from the stream `is` and assigns it
|
||||
|
|
@ -67,8 +63,7 @@ to `s`.
|
|||
\pre The extract operator must be defined for `Point_2` and `Weight`.
|
||||
\relates Apollonius_site_2
|
||||
*/
|
||||
std::istream& operator>>(std::istream& is,
|
||||
const Apollonius_site_2<K>& s);
|
||||
std::istream& operator>>(std::istream& is, const Apollonius_site_2<K>& s);
|
||||
|
||||
/*!
|
||||
Inserts the Apollonius site `s` into the `Qt_widget` stream `w`.
|
||||
|
|
@ -76,7 +71,6 @@ Inserts the Apollonius site `s` into the `Qt_widget` stream `w`.
|
|||
\pre The insert operator must be defined for `K::Circle_2`.
|
||||
\relates Apollonius_site_2
|
||||
*/
|
||||
Qt_widget& operator<<(Qt_widget& w,
|
||||
const Apollonius_site_2<K>& s);
|
||||
Qt_widget& operator<<(Qt_widget& w, const Apollonius_site_2<K>& s) const;
|
||||
|
||||
} /* end namespace CGAL */
|
||||
|
|
|
|||
|
|
@ -42,10 +42,10 @@ public:
|
|||
/// @{
|
||||
|
||||
/*!
|
||||
Inserts
|
||||
a degree two vertex and two faces adjacent to it that have two common
|
||||
edges. The edge defined by the face handle `f` and the integer
|
||||
`i` is duplicated. It returns a handle to the vertex created.
|
||||
inserts a degree two vertex and two faces adjacent to it that have two common edges.
|
||||
|
||||
The edge defined by the face handle `f` and the integer `i` is duplicated. It returns a handle
|
||||
to the vertex created.
|
||||
*/
|
||||
Vertex_handle insert_degree_2(Face_handle f, int i);
|
||||
|
||||
|
|
|
|||
|
|
@ -19,17 +19,12 @@ next and previous level graphs.
|
|||
`ApolloniusGraphHierarchyVertexBase_2` does not introduce any
|
||||
types in addition to those of `ApolloniusGraphVertexBase_2`.
|
||||
|
||||
\cgalHasModel CGAL::Apollonius_graph_hierarchy_vertex_base_2<CGAL::Apollonius_graph_vertex_base_2<Gt,StoreHidden> >
|
||||
\cgalHasModel `CGAL::Apollonius_graph_hierarchy_vertex_base_2<CGAL::Apollonius_graph_vertex_base_2<Gt,StoreHidden> >`
|
||||
|
||||
\sa `ApolloniusGraphDataStructure_2`
|
||||
\sa `ApolloniusGraphVertexBase_2`
|
||||
\sa `CGAL::Apollonius_graph_hierarchy_2<Gt,Agds>`
|
||||
\sa `CGAL::Triangulation_data_structure_2<Vb,Fb>`
|
||||
\sa `CGAL::Apollonius_graph_vertex_base_2<Gt,StoreHidden>`
|
||||
\sa `CGAL::Apollonius_graph_hierarchy_vertex_base_2<Agvb>`
|
||||
|
||||
*/
|
||||
|
||||
class ApolloniusGraphHierarchyVertexBase_2 {
|
||||
public:
|
||||
|
||||
|
|
@ -37,8 +32,7 @@ public:
|
|||
/// @{
|
||||
|
||||
/*!
|
||||
Default
|
||||
constructor.
|
||||
%Default constructor.
|
||||
*/
|
||||
ApolloniusGraphHierarchyVertexBase_2();
|
||||
|
||||
|
|
|
|||
|
|
@ -3,8 +3,6 @@
|
|||
\ingroup PkgApolloniusGraph2Concepts
|
||||
\cgalConcept
|
||||
|
||||
\cgalRefines `TriangulationVertexBase_2`
|
||||
|
||||
The concept `ApolloniusGraphVertexBase_2` describes the
|
||||
requirements for the vertex base class of the
|
||||
`ApolloniusGraphDataStructure_2` concept. A vertex stores an
|
||||
|
|
@ -12,14 +10,14 @@ Apollonius site and provides access to one of its incident faces
|
|||
through a `Face_handle`. In addition, it maintains a container of
|
||||
sites. The container stores the hidden sites related to the vertex.
|
||||
|
||||
\cgalRefines `TriangulationVertexBase_2`
|
||||
|
||||
\cgalHasModel `CGAL::Apollonius_graph_vertex_base_2<Gt,StoreHidden>`
|
||||
|
||||
\sa `ApolloniusGraphDataStructure_2`
|
||||
\sa `ApolloniusGraphTraits_2`
|
||||
\sa `CGAL::Apollonius_graph_vertex_base_2<Gt,StoreHidden>`
|
||||
|
||||
\sa `CGAL::Apollonius_graph_2<Gt,Agds>`
|
||||
\sa `CGAL::Triangulation_data_structure_2<Vb,Fb>`
|
||||
*/
|
||||
|
||||
class ApolloniusGraphVertexBase_2 {
|
||||
public:
|
||||
|
||||
|
|
@ -77,7 +75,7 @@ typedef unspecified_type Hidden_sites_iterator;
|
|||
/// @{
|
||||
|
||||
/*!
|
||||
Default constructor.
|
||||
%Default constructor.
|
||||
*/
|
||||
ApolloniusGraphVertexBase_2();
|
||||
|
||||
|
|
|
|||
|
|
@ -43,18 +43,18 @@ aforementioned concepts.
|
|||
\cgalCRPSection{Concepts}
|
||||
|
||||
- `ApolloniusSite_2`
|
||||
- `ApolloniusGraphTraits_2`
|
||||
- `ApolloniusGraphDataStructure_2`
|
||||
- `ApolloniusGraphVertexBase_2`
|
||||
- `ApolloniusGraphTraits_2`
|
||||
- `ApolloniusGraphHierarchyVertexBase_2`
|
||||
|
||||
\cgalCRPSection{Classes}
|
||||
|
||||
- `CGAL::Apollonius_graph_2<Gt,Agds>`
|
||||
- `CGAL::Apollonius_site_2<K>`
|
||||
- `CGAL::Apollonius_graph_vertex_base_2<Gt,StoreHidden>`
|
||||
- `CGAL::Apollonius_graph_traits_2<K,Method_tag>`
|
||||
- `CGAL::Apollonius_graph_filtered_traits_2<CK,CM,EK,EM,FK,FM>`
|
||||
- `CGAL::Apollonius_graph_vertex_base_2<Gt,StoreHidden>`
|
||||
- `CGAL::Apollonius_graph_hierarchy_2<Gt,Agds>`
|
||||
- `CGAL::Apollonius_graph_hierarchy_vertex_base_2<Agvb>`
|
||||
|
||||
|
|
|
|||
|
|
@ -3,9 +3,6 @@
|
|||
cmake_minimum_required(VERSION 3.1...3.15)
|
||||
project(Arrangement_on_surface_2_Demo)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
|
||||
|
||||
if(NOT POLICY CMP0070 AND POLICY CMP0053)
|
||||
# Only set CMP0053 to OLD with CMake<3.10, otherwise there is a warning.
|
||||
cmake_policy(SET CMP0053 OLD)
|
||||
|
|
@ -23,6 +20,8 @@ if (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND)
|
|||
add_compile_definitions(QT_NO_KEYWORDS)
|
||||
include_directories( BEFORE ./ )
|
||||
|
||||
# Arrangement package includes
|
||||
add_definitions(-DQT_NO_KEYWORDS)
|
||||
option(COMPILE_UTILS_INCREMENTALLY
|
||||
"Compile files in Utils directory incrementally, or compile them all as a unit. \
|
||||
Incremental compilation will be better for development and consume less \
|
||||
|
|
|
|||
|
|
@ -34,11 +34,11 @@ conveniently embedded as a planar graph, whose vertices are associated
|
|||
with curve endpoints or with isolated points, and whose edges are
|
||||
associated with subcurves. It is easy to see that
|
||||
\f$ \cal A(\cal C) = \cal A(\cal C'')\f$. This graph can be represented using a
|
||||
<I>doubly-connected edge list</I> data-structure (\sc{Dcel} for short),
|
||||
<I>doubly-connected edge list</I> data-structure (\dcel for short),
|
||||
which consists of containers of vertices, edges and faces and
|
||||
maintains the incidence relations among these objects.
|
||||
|
||||
The main idea behind the \sc{Dcel} data-structure is to represent
|
||||
The main idea behind the \dcel data-structure is to represent
|
||||
each edge using a pair of directed <I>halfedges</I>, one going from
|
||||
the \f$ xy\f$-lexicographically smaller (left) endpoint of the curve toward
|
||||
its the \f$ xy\f$-lexicographically larger (right) endpoint, and the other,
|
||||
|
|
@ -75,11 +75,11 @@ as it may have no area, or alternatively it may consist of several
|
|||
connected faces. Every face can have several holes contained in its
|
||||
interior (or no holes at all). In addition, every face may contain
|
||||
isolated vertices in its interior. See \cgalFigureRef{arr_figseg_dcel}
|
||||
for an illustration of the various \sc{Dcel} features. For more details
|
||||
on the \sc{Dcel} data structure see \cgalCite{bkos-cgaa-00} Chapter 2.
|
||||
for an illustration of the various \dcel features. For more details
|
||||
on the \dcel data structure see \cgalCite{bkos-cgaa-00} Chapter 2.
|
||||
|
||||
\cgalFigureBegin{arr_figseg_dcel,arr_segs.png}
|
||||
An arrangement of interior-disjoint line segments with some of the \sc{Dcel} records that represent it. The unbounded face \f$ f_0\f$ has a single connected component that forms a hole inside it, and this hole is comprised of several faces. The half-edge \f$ e\f$ is directed from its source vertex \f$ v_1\f$ to its target vertex \f$ v_2\f$. This edge, together with its twin \f$ e'\f$, correspond to a line segment that connects the points associated with \f$ v_1\f$ and \f$ v_2\f$ and separates the face \f$ f_1\f$ from \f$ f_2\f$. The predecessor \f$ e_{\rm prev}\f$ and successor \f$ e_{\rm next}\f$ of \f$ e\f$ are part of the chain that form the outer boundary of the face \f$ f_2\f$. The face \f$ f_1\f$ has a more complicated structure as it contains two holes in its interior: One hole consists of two adjacent faces \f$ f_3\f$ and \f$ f_4\f$, while the other hole is comprised of two edges. \f$ f_1\f$ also contains two isolated vertices \f$ u_1\f$ and \f$ u_2\f$ in its interior.
|
||||
An arrangement of interior-disjoint line segments with some of the \dcel records that represent it. The unbounded face \f$ f_0\f$ has a single connected component that forms a hole inside it, and this hole is comprised of several faces. The half-edge \f$ e\f$ is directed from its source vertex \f$ v_1\f$ to its target vertex \f$ v_2\f$. This edge, together with its twin \f$ e'\f$, correspond to a line segment that connects the points associated with \f$ v_1\f$ and \f$ v_2\f$ and separates the face \f$ f_1\f$ from \f$ f_2\f$. The predecessor \f$ e_{\rm prev}\f$ and successor \f$ e_{\rm next}\f$ of \f$ e\f$ are part of the chain that form the outer boundary of the face \f$ f_2\f$. The face \f$ f_1\f$ has a more complicated structure as it contains two holes in its interior: One hole consists of two adjacent faces \f$ f_3\f$ and \f$ f_4\f$, while the other hole is comprised of two edges. \f$ f_1\f$ also contains two isolated vertices \f$ u_1\f$ and \f$ u_2\f$ in its interior.
|
||||
\cgalFigureEnd
|
||||
|
||||
The \f$ x\f$-monotone curves of an arrangement are embedded in an
|
||||
|
|
@ -110,7 +110,7 @@ to construct arrangements of different families of curves. In
|
|||
Section \ref arr_secnotif we review the notification mechanism
|
||||
that allows external classes to keep track of the changes that an
|
||||
arrangement instance goes through. Section \ref arr_secex_dcel
|
||||
explains how to extend the \sc{Dcel} records, to store extra data
|
||||
explains how to extend the \dcel records, to store extra data
|
||||
with them, and to efficiently update this data.
|
||||
In Section \ref arr_secoverlay we introduce the fundamental
|
||||
operation of overlaying two arrangements.
|
||||
|
|
@ -127,7 +127,7 @@ the arrangement package. It is used to represent planar
|
|||
arrangements and it provides the interface needed to construct them,
|
||||
traverse them, and maintain them. An arrangement is defined by
|
||||
a geometric <I>traits</I> class that determines the family of planar
|
||||
curves that form the arrangement, and a \sc{Dcel} class, which
|
||||
curves that form the arrangement, and a \dcel class, which
|
||||
represents the <I>topological structure</I> of the planar subdivision.
|
||||
It supplies a minimal set of geometric operations (predicates and
|
||||
constructions) required to construct and maintain the arrangement
|
||||
|
|
@ -159,7 +159,7 @@ parameters of the `Arrangement_2` template:
|
|||
<LI>The `Dcel` template-parameter should be instantiated with a class
|
||||
that is a model of the `ArrangementDcel` concept. The value of this
|
||||
parameter is `Arr_default_dcel<Traits>` by default. However, in
|
||||
many applications it is necessary to extend the \sc{Dcel} features;
|
||||
many applications it is necessary to extend the \dcel features;
|
||||
see Section \ref arr_secex_dcel for further explanations and
|
||||
examples.
|
||||
</UL>
|
||||
|
|
@ -212,7 +212,7 @@ The simplest and most fundamental arrangement operations are the
|
|||
various traversal methods, which allow users to systematically go
|
||||
over the relevant features of the arrangement at hand.
|
||||
|
||||
As mentioned above, the arrangement is represented as a \sc{Dcel},
|
||||
As mentioned above, the arrangement is represented as a \dcel,
|
||||
which stores three containers of vertices, halfedges and faces. Thus,
|
||||
the `Arrangement_2` class supplies iterators for these
|
||||
containers. For example, the methods `vertices_begin()` and
|
||||
|
|
@ -486,7 +486,7 @@ for more details and examples.
|
|||
|
||||
|
||||
\cgalFigureBegin{arr_figex_1,insert.png}
|
||||
The various specialized insertion procedures. The inserted \f$ x\f$-monotone curve is drawn with a light dashed line, surrounded by two solid arrows that represent the pair of twin half-edges added to the \sc{Dcel}. Existing vertices are shown as black dots while new vertices are shown as light dots. Existing half-edges that are affected by the insertion operations are drawn as dashed arrows. (a) Inserting a curve as a new hole inside the face \f$ f\f$. (b) Inserting a curve from an existing vertex \f$ u\f$ that corresponds to one of its endpoints. (c) Inserting an \f$ x\f$-monotone curve whose endpoints are the already existing vertices \f$ u_1\f$ and \f$ u_2\f$. In our case, the new pair of half-edges close a new face \f$ f'\f$, where the hole \f$ h_1\f$, which used to belong to \f$ f\f$, now becomes an enclave in this new face.
|
||||
The various specialized insertion procedures. The inserted \f$ x\f$-monotone curve is drawn with a light dashed line, surrounded by two solid arrows that represent the pair of twin half-edges added to the \dcel. Existing vertices are shown as black dots while new vertices are shown as light dots. Existing half-edges that are affected by the insertion operations are drawn as dashed arrows. (a) Inserting a curve as a new hole inside the face \f$ f\f$. (b) Inserting a curve from an existing vertex \f$ u\f$ that corresponds to one of its endpoints. (c) Inserting an \f$ x\f$-monotone curve whose endpoints are the already existing vertices \f$ u_1\f$ and \f$ u_2\f$. In our case, the new pair of half-edges close a new face \f$ f'\f$, where the hole \f$ h_1\f$, which used to belong to \f$ f\f$, now becomes an enclave in this new face.
|
||||
\cgalFigureEnd
|
||||
|
||||
|
||||
|
|
@ -1349,7 +1349,7 @@ construct it from scratch. (ii) We have to insert \f$ m\f$ input curves
|
|||
to a non-empty arrangement `arr`.
|
||||
|
||||
In the first case, we sweep over the input curves, compute
|
||||
their intersection points and construct the \sc{Dcel} that represents
|
||||
their intersection points and construct the \dcel that represents
|
||||
their planar arrangement. This process is performed in
|
||||
\f$ O\left((m + k)\log m\right)\f$ time, where \f$ k\f$ is the total number
|
||||
of intersection points. The running time is asymptotically better
|
||||
|
|
@ -1567,7 +1567,7 @@ exists. This implied that collinearity indeed exists as explained above.
|
|||
\cgalAdvancedBegin
|
||||
|
||||
\cgalFigureBegin{typenormal,unb_dcel.png}
|
||||
A \sc{Dcel} representing an arrangement of four lines. Halfedges are drawn as thin arrows. The vertices \f$ v_1, \ldots, v_8\f$ lie at infinity, and are not associated with valid points. The halfedges that connect them are fictitious, and are not associated with concrete curves. The face denoted \f$ f_0\f$ (lightly shaded) is the fictitious "unbounded face" which lies outside the bounding rectangle (dashed) that bounds the actual arrangement. The four fictitious vertices \f$ v_{\rm bl}, v_{\rm tl}, v_{\rm br}\f$ and \f$ v_{\rm tr}\f$ represent the four corners of the bounding rectangle.
|
||||
A \dcel representing an arrangement of four lines. Halfedges are drawn as thin arrows. The vertices \f$ v_1, \ldots, v_8\f$ lie at infinity, and are not associated with valid points. The halfedges that connect them are fictitious, and are not associated with concrete curves. The face denoted \f$ f_0\f$ (lightly shaded) is the fictitious "unbounded face" which lies outside the bounding rectangle (dashed) that bounds the actual arrangement. The four fictitious vertices \f$ v_{\rm bl}, v_{\rm tl}, v_{\rm br}\f$ and \f$ v_{\rm tr}\f$ represent the four corners of the bounding rectangle.
|
||||
\cgalFigureEnd
|
||||
|
||||
|
||||
|
|
@ -1580,7 +1580,7 @@ finite curve endpoints and intersection points between curves in
|
|||
straightforward to compute the arrangement induced by this set.
|
||||
However, we would like to operate directly on the unbounded curves
|
||||
without having to preprocess them. Therefore, we use an implicit
|
||||
bounding rectangle embedded in the \sc{Dcel} structure.
|
||||
bounding rectangle embedded in the \dcel structure.
|
||||
\cgalFigureRef{arr_figunb_dcel} shows the arrangement of four lines
|
||||
that subdivide the plane into eight unbounded faces and two bounded
|
||||
ones. Notice that in this case the unbounded faces have outer
|
||||
|
|
@ -1881,7 +1881,7 @@ of the `ArrangementXMonotoneTraits_2` concept.
|
|||
\subsection Arrangement_on_surface_2SupportingUnbounded Supporting Unbounded Curves
|
||||
|
||||
An arrangement that supports unbounded \f$ x\f$-monotone curves maintains
|
||||
an implicit bounding rectangle in the \sc{Dcel} structure; see
|
||||
an implicit bounding rectangle in the \dcel structure; see
|
||||
Section \ref arr_ssecunb_rep. The unbounded ends of vertical rays,
|
||||
vertical lines, and curves with vertical asymptotes are represented
|
||||
by vertices that lie on the bottom or top sides of this bounding
|
||||
|
|
@ -2840,7 +2840,7 @@ Geometric traits-class decorators allow you to attach auxiliary
|
|||
data to curves and to points. The data is automatically manipulated
|
||||
by the decorators and distributed to the constructed geometric entities.
|
||||
Note that additional information can alternatively be maintained by extending
|
||||
the vertex, halfedge, or face types provided by the \sc{Dcel} class used
|
||||
the vertex, halfedge, or face types provided by the \dcel class used
|
||||
by the arrangement; see the details in Section \ref arr_secex_dcel.
|
||||
|
||||
The arrangement package includes a generic traits-class decorator
|
||||
|
|
@ -3065,7 +3065,7 @@ depicted in \cgalFigureRef{arr_figex_19} :
|
|||
|
||||
\cgalExample{Arrangement_on_surface_2/observer.cpp}
|
||||
|
||||
Observers are especially useful when the \sc{Dcel} records are
|
||||
Observers are especially useful when the \dcel records are
|
||||
extended and store additional data, as they help updating this
|
||||
data on-line. See Section \ref arr_secex_dcel for more details
|
||||
and examples.
|
||||
|
|
@ -3080,28 +3080,28 @@ objects and edges (halfedge pairs) are associated with
|
|||
it is possible to extend the traits-class type by using a traits-class
|
||||
decorator, as explained in Section \ref arr_ssecmeta_tr, which may
|
||||
be a sufficient solution for some applications.
|
||||
However, the \sc{Dcel} faces are not associated with any geometric object,
|
||||
However, the \dcel faces are not associated with any geometric object,
|
||||
so it is impossible to extend them using a traits-class decorator.
|
||||
Extending the \sc{Dcel} face records comes handy is such cases. As a matter
|
||||
of fact, it is possible to conveniently extend all \sc{Dcel} records
|
||||
Extending the \dcel face records comes handy is such cases. As a matter
|
||||
of fact, it is possible to conveniently extend all \dcel records
|
||||
(namely vertices, halfedges and faces), which can also be advantageous
|
||||
for some applications.
|
||||
|
||||
All examples presented so far use the default `Arr_default_dcel<Traits>`.
|
||||
This is done implicitly, as this class serves as a default parameter for
|
||||
the `Arrangement_2` template. The default \sc{Dcel} class just associates
|
||||
the `Arrangement_2` template. The default \dcel class just associates
|
||||
points with vertices and \f$ x\f$-monotone curves with halfedge, but nothing more.
|
||||
In this section we show how to use alternative \sc{Dcel} types to extend the
|
||||
desired \sc{Dcel} records.
|
||||
In this section we show how to use alternative \dcel types to extend the
|
||||
desired \dcel records.
|
||||
|
||||
\subsection arr_ssecex_dcel_face Extending the DCEL Faces
|
||||
|
||||
The `Arr_face_extended_dcel<Traits, FaceData>` class-template
|
||||
is used to associate auxiliary data field of type `FaceData` to
|
||||
each face record in the \sc{Dcel}.
|
||||
each face record in the \dcel.
|
||||
|
||||
When an `Arrangement_2` object is parameterized by this
|
||||
\sc{Dcel} class, its nested `Face` type is extended with the access function
|
||||
\dcel class, its nested `Face` type is extended with the access function
|
||||
`data()` and with the modifier `set_data()`. Using these extra
|
||||
functions it is straightforward to access and maintain the auxiliary
|
||||
face-data field.
|
||||
|
|
@ -3135,14 +3135,14 @@ segments:\cgalFootnote{For simplicity, the particular observer used must be atta
|
|||
The `Arr_extended_dcel<Traits, VertexData, HalfedgeData, FaceData>`
|
||||
class-template is used to associate auxiliary data fields of
|
||||
types `VertexData` `HalfedgeData`, and `FaceData` to
|
||||
each \sc{Dcel} vertex, halfedge, and face record types, respectively.
|
||||
each \dcel vertex, halfedge, and face record types, respectively.
|
||||
|
||||
When an `Arrangement_2` object is injected with this
|
||||
\sc{Dcel} class, each one of its nested `Vertex`, `Halfedge` and
|
||||
\dcel class, each one of its nested `Vertex`, `Halfedge` and
|
||||
`Face` classes is extended by the access function `data()`
|
||||
and by the modifier `set_data()`.
|
||||
|
||||
The next example shows how to use a \sc{Dcel} with extended vertex,
|
||||
The next example shows how to use a \dcel with extended vertex,
|
||||
halfedge, and face records. In this example each vertex is associated
|
||||
with a color, which may be blue, red, or white, depending on whether the
|
||||
vertex is isolated, represents a segment endpoint, or whether it
|
||||
|
|
@ -3161,11 +3161,11 @@ is copied to another arrangement instance:
|
|||
\cgalExample{Arrangement_on_surface_2/dcel_extension.cpp}
|
||||
|
||||
\cgalAdvancedBegin
|
||||
The various \sc{Dcel} classes presented in this section are perfectly
|
||||
The various \dcel classes presented in this section are perfectly
|
||||
sufficient for most applications based on the arrangement package.
|
||||
However, users may also use their own implementation of a \sc{Dcel} class
|
||||
However, users may also use their own implementation of a \dcel class
|
||||
to instantiate the `Arrangement_2` class-template, in case they need
|
||||
special functionality from their \sc{Dcel}. Such a class must be a model of the
|
||||
special functionality from their \dcel. Such a class must be a model of the
|
||||
concept `ArrangementDcel`, whose exact specification is listed in the
|
||||
Reference Manual.
|
||||
\cgalAdvancedEnd
|
||||
|
|
@ -3197,16 +3197,16 @@ types nested in geometry traits `Traits_R`. The same holds for all
|
|||
types nested in geometry traits `Traits_B`.
|
||||
The `ovl_traits` parameter is
|
||||
an instance of an <I>overlay traits-class</I>, which enables the creation of
|
||||
`Dcel_R` records in the overlaid arrangement from the \sc{Dcel} features
|
||||
`Dcel_R` records in the overlaid arrangement from the \dcel features
|
||||
of `arr_a` and `arr_b` that they correspond to.
|
||||
|
||||
In principle, we distinguish between three levels of overlay:
|
||||
<DL>
|
||||
<DT><B>Simple overlay:</B><DD>
|
||||
An overlay of two arrangements that store no additional data
|
||||
with their \sc{Dcel} records. That is, they are defined using the default
|
||||
\sc{Dcel} class `Arr_default_dcel`. Typically, the overlaid
|
||||
arrangement in this case stores no extra data with its \sc{Dcel} records as
|
||||
with their \dcel records. That is, they are defined using the default
|
||||
\dcel class `Arr_default_dcel`. Typically, the overlaid
|
||||
arrangement in this case stores no extra data with its \dcel records as
|
||||
well (or if it does, the additional data fields cannot be computed by
|
||||
the overlay operation), so by overlaying the two arrangement we just
|
||||
compute the arrangement of all curves that induce `arr_a` and `arr_b`.
|
||||
|
|
@ -3227,7 +3227,7 @@ the overlaid face.
|
|||
|
||||
The `Arr_face_overlay_traits` class should be used as an overlay
|
||||
traits-class for face-overlay operations. It operates on arrangement, whose
|
||||
\sc{Dcel} representation is based on the `Arr_face_extended_dcel`
|
||||
\dcel representation is based on the `Arr_face_extended_dcel`
|
||||
class-template (see Section \ref arr_ssecex_dcel_face). The face-overlay
|
||||
traits-class is parameterized by a functor that is capable of combining two
|
||||
face-data fields of types `Dcel_A::Face_data` and
|
||||
|
|
@ -3236,11 +3236,11 @@ object. The overlay traits-class uses this functor to properly construct
|
|||
the overlaid faces.
|
||||
<DT><B>Full overlay:</B><DD>
|
||||
An overlay of two arrangements that store additional data
|
||||
fields with all their \sc{Dcel} records. That is, their \sc{Dcel} classes
|
||||
fields with all their \dcel records. That is, their \dcel classes
|
||||
are instantiations of the `Arr_extended_dcel` class-template (see
|
||||
Section \ref arr_ssecex_dcel_all), where the resulting arrangement
|
||||
also extends it \sc{Dcel} records with data fields computed on the basis
|
||||
of the overlapping \sc{Dcel} features of the two input arrangements.
|
||||
also extends it \dcel records with data fields computed on the basis
|
||||
of the overlapping \dcel features of the two input arrangements.
|
||||
</DL>
|
||||
|
||||
In the following subsections we give some examples for the simple and the
|
||||
|
|
@ -3263,8 +3263,8 @@ The next program constructs two simple arrangements, as depicted in
|
|||
\subsection arr_ssecface_ovl Examples for a Face Overlay
|
||||
|
||||
The following example shows how to compute the intersection of two polygons
|
||||
using the `overlay()` function. It uses a face-extended \sc{Dcel} class
|
||||
to define our arrangement class. The \sc{Dcel} extends each face with a Boolean
|
||||
using the `overlay()` function. It uses a face-extended \dcel class
|
||||
to define our arrangement class. The \dcel extends each face with a Boolean
|
||||
flag. A polygon is represented as a <I>marked</I> arrangement face, (whose
|
||||
flag is set). The example uses a face-overlay traits class, instantiated with
|
||||
a functor that simply performs a logical <I>and</I> operations on Boolean flags.
|
||||
|
|
@ -3295,7 +3295,7 @@ when one constructs an arrangement induced by a set \f$ \cal C\f$ of arbitrary
|
|||
planar curves, she or he constructs a collection \f$ \cal C''\f$ of \f$ x\f$-monotone
|
||||
subcurves of \f$ \cal C\f$ that are pairwise disjoint in their interior, and these
|
||||
subcurves are associated with the arrangement edges (more precisely, with the
|
||||
\sc{Dcel} halfedges). Doing so, the connection between the originating input
|
||||
\dcel halfedges). Doing so, the connection between the originating input
|
||||
curves and the arrangement edges is lost. This loss might be acceptable for
|
||||
some applications. However, in many practical cases it is important to
|
||||
determine the input curves that give rise to the final subcurves.
|
||||
|
|
@ -3308,8 +3308,8 @@ used for instantiating the template should be a model of the
|
|||
`ArrangementTraits_2` concept (see Section \ref arr_sssecinsert_gen).
|
||||
That is, it should define the `Curve_2` type (and not just the
|
||||
`X_monotone_curve_2` type). The `Dcel` parameter should model the
|
||||
`ArrangementDcel` concept. Users can use the default \sc{Dcel} class or
|
||||
an extended \sc{Dcel} class according to their needs.
|
||||
`ArrangementDcel` concept. Users can use the default \dcel class or
|
||||
an extended \dcel class according to their needs.
|
||||
|
||||
\subsection arr_ssecarrwh_traverse Traversing an Arrangement with History
|
||||
|
||||
|
|
@ -3362,7 +3362,7 @@ instantiated by the same traits class. In this case, the resulting
|
|||
arrangement will store a consolidated container of input curves, and
|
||||
automatically preserve the cross-mapping between the arrangement edges
|
||||
and the consolidated curve set. Users can employ an overlay-traits class
|
||||
to maintain any type of auxiliary data stored with the \sc{Dcel} features
|
||||
to maintain any type of auxiliary data stored with the \dcel features
|
||||
(see Section \ref arr_secoverlay).
|
||||
|
||||
\subsection arr_ssecmodif_traverse Modifying an Arrangement with History
|
||||
|
|
@ -3503,7 +3503,7 @@ the arrangement features. Thus, they are ideal for arrangements
|
|||
instantiated using the `Arr_default_dcel` class.
|
||||
However, as explained in Section \ref arr_secex_dcel, one can easily
|
||||
extend the arrangement faces by using the `Arr_face_extended_dcel`
|
||||
template, or extend all \sc{Dcel} records by using the `Arr_extended_dcel`
|
||||
template, or extend all \dcel records by using the `Arr_extended_dcel`
|
||||
template. In such cases, it might be crucial that the auxiliary data fields
|
||||
are written to the file and read from there.
|
||||
|
||||
|
|
@ -3520,13 +3520,13 @@ auxiliary data that may be associated with the arrangement features.
|
|||
This is the default formatter used by the arrangement inserter and the
|
||||
arrangement extractor, as defined above.
|
||||
<LI>`Arr_face_extended_text_formatter<Arrangement>` operates on
|
||||
arrangements whose \sc{Dcel} representation is based on the
|
||||
arrangements whose \dcel representation is based on the
|
||||
`Arr_face_extended_dcel<Traits,FaceData>` class (see
|
||||
Section \ref arr_ssecex_dcel_face). It supports reading and writing
|
||||
the auxiliary data objects stored with the arrangement faces provided
|
||||
that the `FaceData` class supports an inserter and an extractor.
|
||||
<LI>`Arr_extended_dcel_text_formatter<Arrangement>` operates on
|
||||
arrangements whose \sc{Dcel} representation is based on the
|
||||
arrangements whose \dcel representation is based on the
|
||||
`Arr_extended_dcel<Traits,VertexData,HalfedgeData,FaceData>` class
|
||||
(see Section \ref arr_ssecex_dcel_all). It supports reading and writing
|
||||
the auxiliary data objects stored with the arrangement vertices, edges
|
||||
|
|
@ -3599,10 +3599,10 @@ the graph algorithms implemented in the <span class="textsc">bgl</span> to `Arra
|
|||
An instance of `Arrangement_2` is adapted to a <span class="textsc">Boost</span> graph through the
|
||||
provision of a set of free functions that operate on the arrangement features
|
||||
and conform with the relevant BGL concepts. Besides the straightforward
|
||||
adaptation, which associates a vertex with each \sc{Dcel} vertex and an edge
|
||||
with each \sc{Dcel} halfedge, the package also offer a <I>dual</I> adaptor, which
|
||||
associates a graph vertex with each \sc{Dcel} face, such that two vertices are
|
||||
connected, iff there is a \sc{Dcel} halfedge that connects the two corresponding
|
||||
adaptation, which associates a vertex with each \dcel vertex and an edge
|
||||
with each \dcel halfedge, the package also offer a <I>dual</I> adaptor, which
|
||||
associates a graph vertex with each \dcel face, such that two vertices are
|
||||
connected, iff there is a \dcel halfedge that connects the two corresponding
|
||||
faces.
|
||||
|
||||
\subsection arr_ssecbgl_primal The Primal Arrangement Representation
|
||||
|
|
@ -3706,7 +3706,7 @@ used for associating arbitrary data with the arrangement faces.
|
|||
In the following example we construct the same arrangement as in
|
||||
example `bgl_primal_adapter.cpp` (see \cgalFigureRef{arr_figex_bgl}),
|
||||
and perform breadth-first search on the graph faces, starting from the
|
||||
unbounded face. We extend the \sc{Dcel} faces
|
||||
unbounded face. We extend the \dcel faces
|
||||
with an unsigned integer, marking the discover time of the face
|
||||
using `boost` visitors and a property-map class that directly accesses
|
||||
the extended data of the faces:
|
||||
|
|
@ -3728,7 +3728,7 @@ of the general ones; e.g., `insert()`.
|
|||
|
||||
<LI>When the curves to be inserted into an arrangement are segments that
|
||||
are pairwise disjoint in their interior, it is more efficient to use
|
||||
the traits class `Arr_non_caching_segment_traits_2` rather then
|
||||
the traits class `Arr_non_caching_segment_traits_2` rather than
|
||||
the default one (`Arr_segment_traits_2`).
|
||||
|
||||
If the segments may intersect each other, the default traits class
|
||||
|
|
@ -3751,7 +3751,7 @@ arrangement. The specialized insertion functions, i.e.,
|
|||
can be used according to the available information. These functions
|
||||
hardly involve any geometric operations, if at all. They accept
|
||||
topologically related parameters, and use them to operate directly on
|
||||
the \sc{Dcel} records, thus saving algebraic operations, which are
|
||||
the \dcel records, thus saving algebraic operations, which are
|
||||
especially expensive when high-degree curves are involved.
|
||||
|
||||
A polygon, represented by a list of segments along its boundary, can
|
||||
|
|
|
|||
|
|
@ -408,7 +408,7 @@ namespace CGAL {
|
|||
size_type number_of_subcurves() const;
|
||||
|
||||
/*! Obtain the \f$ k\f$th subcurve of the polycurve.
|
||||
* \pre \f$k\f$ is not greater then or equal to \f$n-1\f$, where
|
||||
* \pre \f$k\f$ is not greater than or equal to \f$n-1\f$, where
|
||||
* \f$n\f$ is the number of subcurves.
|
||||
*/
|
||||
typename SubcurveTraits_2::X_monotone_curve_2
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ int main()
|
|||
// but not for this instance
|
||||
for(size_t i = 0; i < pre_segs.size(); ++i) {
|
||||
auto* curr_p = boost::get<X_monotone_curve_2>(&pre_segs[i]);;
|
||||
CGAL_assertion(curr_p);
|
||||
CGAL_assertion(curr_p != nullptr);
|
||||
segs.push_back(*curr_p);
|
||||
}
|
||||
// Construct an ellipse with equation 2*x^2+5*y^2-7=0
|
||||
|
|
|
|||
|
|
@ -159,11 +159,11 @@ namespace CGAL {
|
|||
{ return CK_Equal_2()(a0, a1); }
|
||||
|
||||
result_type
|
||||
operator() ( const Line_arc_2 &a0, const Circular_arc_2 &a1) const
|
||||
operator() ( const Line_arc_2 &/*a0*/, const Circular_arc_2 &/*a1*/) const
|
||||
{ return false; }
|
||||
|
||||
result_type
|
||||
operator() ( const Circular_arc_2 &a0, const Line_arc_2 &a1) const
|
||||
operator() ( const Circular_arc_2 &/*a0*/, const Line_arc_2 &/*a1*/) const
|
||||
{ return false; }
|
||||
|
||||
result_type
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@ overlay(const Arrangement_on_surface_2<GeometryTraitsA_2, TopologyTraitsA>& arr1
|
|||
typedef Arrangement_on_surface_2<Rgt2, Rtt> Arr_res;
|
||||
typedef typename Arr_res::Allocator Allocator;
|
||||
|
||||
// some type assertions (not all, but better then nothing).
|
||||
// some type assertions (not all, but better than nothing).
|
||||
#if !defined(CGAL_NO_ASSERTIONS)
|
||||
typedef typename Agt2::Point_2 A_point;
|
||||
typedef typename Bgt2::Point_2 B_point;
|
||||
|
|
|
|||
|
|
@ -4042,7 +4042,7 @@ _defines_outer_ccb_of_new_face(const DHalfedge* he_to,
|
|||
// - No smallest has bin recorded so far, or
|
||||
// - The current target vertex and the recorded vertex are the same and
|
||||
// * The current curve is smaller than the recorded curve, or
|
||||
// - The current curve end is smaller then the recorded curve end.
|
||||
// - The current curve end is smaller than the recorded curve end.
|
||||
// smaller than its source, so we should check whether it is also smaller
|
||||
// Note that we compare the vertices lexicographically: first by the
|
||||
// indices, then by x, then by y.
|
||||
|
|
|
|||
|
|
@ -295,13 +295,6 @@ public:
|
|||
return y;
|
||||
}
|
||||
|
||||
//! \brief the same as \c evaluate but arguments are passed by value
|
||||
//! (needed to substitute variables in bivariate polynomial)
|
||||
inline static NT binded_eval(Poly_1 poly, NT x)
|
||||
{
|
||||
return evaluate(poly, x);
|
||||
}
|
||||
|
||||
//! \brief evalutates a polynomial at certain x-coordinate
|
||||
static NT evaluate(const Poly_1& poly, const NT& x,
|
||||
bool *error_bounds_ = nullptr)
|
||||
|
|
@ -913,10 +906,9 @@ void get_precached_poly(int var, const NT& key, int /* level */, Poly_1& poly)
|
|||
// }
|
||||
|
||||
if(not_cached||not_found) {
|
||||
poly = Poly_1(::boost::make_transform_iterator(coeffs->begin(),
|
||||
boost::bind2nd(std::ptr_fun(binded_eval), key1)),
|
||||
::boost::make_transform_iterator(coeffs->end(),
|
||||
boost::bind2nd(std::ptr_fun(binded_eval), key1)));
|
||||
auto fn = [&key1](const Poly_1& poly){ return evaluate(poly, key1); };
|
||||
poly = Poly_1(::boost::make_transform_iterator(coeffs->begin(), fn),
|
||||
::boost::make_transform_iterator(coeffs->end(), fn));
|
||||
if(not_cached)
|
||||
return;
|
||||
// all available space consumed: drop the least recently used entry
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@
|
|||
|
||||
#include <CGAL/basic.h>
|
||||
#include <CGAL/function_objects.h>
|
||||
#include <boost/functional.hpp>
|
||||
|
||||
/*! \file CGAL/Curved_kernel_via_analysis_2/gfx/Curve_renderer_traits.h
|
||||
* \brief
|
||||
|
|
@ -107,11 +106,13 @@ struct Transform {
|
|||
|
||||
template <class X>
|
||||
OutputPoly_2 operator()(const CGAL::Polynomial<X>& p, Op op = Op()) const {
|
||||
|
||||
Transform<typename OutputPoly_2::NT, typename InputPoly_2::NT, Op> tr;
|
||||
typedef typename InputPoly_2::NT NT_in;
|
||||
typedef typename OutputPoly_2::NT NT_out;
|
||||
Transform<NT_out, NT_in, Op> tr;
|
||||
auto fn = [&op, &tr](const NT_in& v){ return tr(v, op); };
|
||||
return OutputPoly_2(
|
||||
::boost::make_transform_iterator(p.begin(), boost::bind2nd(tr, op)),
|
||||
::boost::make_transform_iterator(p.end(), boost::bind2nd(tr, op)));
|
||||
::boost::make_transform_iterator(p.begin(), fn),
|
||||
::boost::make_transform_iterator(p.end(), fn));
|
||||
}
|
||||
|
||||
OutputPoly_2 operator()(
|
||||
|
|
|
|||
|
|
@ -9,20 +9,6 @@ enable_testing()
|
|||
find_package(CGAL REQUIRED COMPONENTS Core)
|
||||
|
||||
include(${CGAL_USE_FILE})
|
||||
|
||||
if(COMMAND target_compile_options)
|
||||
# Since CMake-2.8.12: New CMake script, that defines the targets and
|
||||
# the CTest test cases.
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/cgal_test.cmake)
|
||||
else()
|
||||
# If CMake version is <= 2.8.11, use the usual CMake script.
|
||||
|
||||
# create a target per cppfile
|
||||
file(
|
||||
GLOB cppfiles
|
||||
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
|
||||
foreach(cppfile ${cppfiles})
|
||||
create_single_source_cgal_program("${cppfile}")
|
||||
endforeach()
|
||||
endif()
|
||||
# Since CMake-2.8.12: New CMake script, that defines the targets and
|
||||
# the CTest test cases.
|
||||
include(${CMAKE_CURRENT_SOURCE_DIR}/cgal_test.cmake)
|
||||
|
|
|
|||
|
|
@ -1424,3 +1424,9 @@ compile_and_run(test_io)
|
|||
compile_and_run(test_sgm)
|
||||
|
||||
compile_and_run(test_polycurve_intersection)
|
||||
if(CGAL_DISABLE_GMP)
|
||||
get_directory_property(LIST_OF_TESTS TESTS)
|
||||
foreach(_test ${LIST_OF_TESTS})
|
||||
set_property(TEST ${_test} APPEND PROPERTY ENVIRONMENT CGAL_DISABLE_GMP=1)
|
||||
endforeach()
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -129,22 +129,36 @@ configure()
|
|||
{
|
||||
echo "Configuring... "
|
||||
rm -rf CMakeCache.txt CMakeFiles/
|
||||
echo "cmake --no-warn-unused-cli ${INIT_FILE:+"-C${INIT_FILE}"} "$CMAKE_GENERATOR" -DRUNNING_CGAL_AUTO_TEST=TRUE \
|
||||
-DCGAL_DIR=\"$CGAL_DIR\" \
|
||||
-DCGAL_CXX_FLAGS:STRING=\"$TESTSUITE_CXXFLAGS -I../../include\" \
|
||||
-DCGAL_EXE_LINKER_FLAGS=\"$TESTSUITE_LDFLAGS\" \
|
||||
-DCMAKE_BUILD_TYPE=NOTFOUND \
|
||||
."
|
||||
if eval 'cmake --no-warn-unused-cli ${INIT_FILE:+"-C${INIT_FILE}"} "$CMAKE_GENERATOR" -DRUNNING_CGAL_AUTO_TEST=TRUE \
|
||||
-DCGAL_DIR="$CGAL_DIR" \
|
||||
-DCGAL_CXX_FLAGS:STRING="$TESTSUITE_CXXFLAGS -I../../include" \
|
||||
-DCGAL_EXE_LINKER_FLAGS="$TESTSUITE_LDFLAGS" \
|
||||
-DCMAKE_BUILD_TYPE=NOTFOUND \
|
||||
.' ; then
|
||||
if [ -f "$INIT_FILE" ]
|
||||
then
|
||||
if eval 'cmake --no-warn-unused-cli ${INIT_FILE:+"-C${INIT_FILE}"} "$CMAKE_GENERATOR" -DRUNNING_CGAL_AUTO_TEST=TRUE \
|
||||
-DCGAL_DIR="$CGAL_DIR" \
|
||||
-DCGAL_CXX_FLAGS:STRING="$CGAL_CXX_FLAGS $TESTSUITE_CXXFLAGS -I../../include" \
|
||||
-DCGAL_EXE_LINKER_FLAGS="$CGAL_EXE_LINKER_FLAGS $TESTSUITE_LDFLAGS" \
|
||||
.' ; then
|
||||
|
||||
echo " successful configuration" >> $ERRORFILE
|
||||
echo " successful configuration" >> $ERRORFILE
|
||||
else
|
||||
echo " ERROR: configuration" >> $ERRORFILE
|
||||
fi
|
||||
else
|
||||
echo " ERROR: configuration" >> $ERRORFILE
|
||||
echo "cmake --no-warn-unused-cli ${INIT_FILE:+"-C${INIT_FILE}"} "$CMAKE_GENERATOR" -DRUNNING_CGAL_AUTO_TEST=TRUE \
|
||||
-DCGAL_DIR=\"$CGAL_DIR\" \
|
||||
-DCGAL_CXX_FLAGS:STRING=\"$TESTSUITE_CXXFLAGS -I../../include\" \
|
||||
-DCGAL_EXE_LINKER_FLAGS=\"$TESTSUITE_LDFLAGS\" \
|
||||
-DCMAKE_BUILD_TYPE=NOTFOUND \
|
||||
."
|
||||
if eval 'cmake --no-warn-unused-cli ${INIT_FILE:+"-C${INIT_FILE}"} "$CMAKE_GENERATOR" -DRUNNING_CGAL_AUTO_TEST=TRUE \
|
||||
-DCGAL_DIR="$CGAL_DIR" \
|
||||
-DCGAL_CXX_FLAGS:STRING="$TESTSUITE_CXXFLAGS -I../../include" \
|
||||
-DCGAL_EXE_LINKER_FLAGS="$TESTSUITE_LDFLAGS" \
|
||||
-DCMAKE_BUILD_TYPE=NOTFOUND \
|
||||
.' ; then
|
||||
|
||||
echo " successful configuration" >> $ERRORFILE
|
||||
else
|
||||
echo " ERROR: configuration" >> $ERRORFILE
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
#include <CGAL/Arr_polyline_traits_2.h>
|
||||
#include <CGAL/Arrangement_2.h>
|
||||
|
||||
#include <boost/function_output_iterator.hpp>
|
||||
#include <boost/iterator/function_output_iterator.hpp>
|
||||
|
||||
#include <array>
|
||||
|
||||
|
|
|
|||
|
|
@ -16,9 +16,9 @@ faces as edges of the dual graph.
|
|||
The scope of \cgal is geometry and not graph algorithms. Nevertheless, this package
|
||||
provides the necessary classes and functions that enable using the
|
||||
algorithms of the <A HREF="https://www.boost.org/libs/graph/doc/index.html">Boost Graph Library</A> \cgalCite{cgal:sll-bgl-02}
|
||||
(\sc{Bgl} for short) with \cgal data structures.
|
||||
(\bgl for short) with \cgal data structures.
|
||||
|
||||
Furthermore, this package extends the \sc{Bgl}
|
||||
Furthermore, this package extends the \bgl
|
||||
by introducing concepts such as `HalfedgeGraph` and `FaceGraph`
|
||||
allowing to handle *halfedges* and *faces*.
|
||||
These concepts reflect the design of the halfedge data structure described
|
||||
|
|
@ -26,7 +26,7 @@ in Chapter \ref PkgHalfedgeDS, with opposite halfedges and circular
|
|||
sequences of halfedges around vertices and around faces.
|
||||
|
||||
This chapter is organized as follows:
|
||||
- The first section, Section \ref BGLA, summarizes the main ideas of the \sc{Bgl}.
|
||||
- The first section, Section \ref BGLA, summarizes the main ideas of the \bgl.
|
||||
- Section \ref BGLHeader then explains where to find header files and the chosen naming conventions, as we blend two
|
||||
different libraries.
|
||||
- The four following sections give examples on how to use CGAL graph and mesh data structures
|
||||
|
|
@ -34,13 +34,13 @@ such as
|
|||
\link PkgSurfaceMesh Surface_mesh \endlink,
|
||||
\link PkgPolyhedron Polyhedron \endlink,
|
||||
\link PkgArrangementOnSurface2 Arrangement_2 \endlink, and the
|
||||
\link PkgTriangulation2 2D triangulation \endlink classes as models of the \sc{Bgl} concepts.
|
||||
\link PkgTriangulation2 2D triangulation \endlink classes as models of the \bgl concepts.
|
||||
- Starting with Section \ref BGLExtensions, we introduce new graph concepts, classes,
|
||||
and functions that extend the functionalities of the \sc{Bgl}.
|
||||
and functions that extend the functionalities of the \bgl.
|
||||
|
||||
\section BGLA A Short Introduction to the Boost Graph Library
|
||||
|
||||
The algorithms of the \sc{Bgl} operate on models of various <I>graph concepts</I>.
|
||||
The algorithms of the \bgl operate on models of various <I>graph concepts</I>.
|
||||
The <I>traits class</I> `boost::graph_traits` enable algorithms to determine the types of vertices and edges
|
||||
(similar to `std::iterator_traits` for iterators).
|
||||
<I>Free functions</I> that operate on graphs enable algorithms to obtain,
|
||||
|
|
@ -53,7 +53,7 @@ arbitrary order.
|
|||
|
||||
\subsection BGLGraphConcepts Graph Concepts
|
||||
|
||||
The \sc{Bgl} introduces several <a href="https://www.boost.org/libs/graph/doc/graph_concepts.html">graph concepts</a>,
|
||||
The \bgl introduces several <a href="https://www.boost.org/libs/graph/doc/graph_concepts.html">graph concepts</a>,
|
||||
which have different sets of characteristics and requirements.
|
||||
For example, iterating through all vertices or all edges in a graph, obtaining the outgoing
|
||||
or in-going edges of a vertex, inserting vertices and edges into a graph,
|
||||
|
|
@ -101,16 +101,16 @@ std::pair<vertex_iterator,vertex_iterator> vertices(const Graph& g);
|
|||
|
||||
\subsection BGLPropertyMaps Property Maps
|
||||
|
||||
Another feature extensively used in the \sc{Bgl} is the *property map*,
|
||||
Another feature extensively used in the \bgl is the *property map*,
|
||||
which is offered by the <a href="https://www.boost.org/libs/property_map/doc/property_map.html">Boost Property Map Library</a>. Property maps
|
||||
are a general purpose interface for mapping key objects to
|
||||
corresponding value objects.
|
||||
|
||||
The \sc{Bgl} uses property maps to associate information with vertices and edges.
|
||||
The \bgl uses property maps to associate information with vertices and edges.
|
||||
This mechanism uses a traits class (`boost::property_traits`) and free
|
||||
functions to read (`get`) and write (`put`) information in vertices,
|
||||
edges, and also in halfedges and faces for models of the \cgal graph concepts.
|
||||
For example, the \sc{Bgl}
|
||||
For example, the \bgl
|
||||
Dijksta's shortest path algorithm writes the predecessor of each vertex, as
|
||||
well as the distance to the source in such a property map.
|
||||
|
||||
|
|
@ -138,14 +138,14 @@ Examples of such event points in graph algorithms are when a vertex is traversed
|
|||
or when all outgoing edges of a vertex have been traversed.<BR>
|
||||
|
||||
See also Section <A HREF="https://www.boost.org/libs/graph/doc/visitor_concepts.html">Visitor Concepts</A>
|
||||
in the \sc{Bgl} manual.
|
||||
in the \bgl manual.
|
||||
|
||||
\subsection BGLNamedParameters Named Parameters
|
||||
|
||||
The notion of <I>named parameters</I> was introduced in the \sc{Bgl},
|
||||
The notion of <I>named parameters</I> was introduced in the \bgl,
|
||||
and allow the user to specify only those parameters which are really needed, by name, making the parameter ordering unimportant.
|
||||
See also <a href="https://www.boost.org/libs/graph/doc/bgl_named_params.html">this page</a>
|
||||
in the manual of the \sc{Bgl} for more information.
|
||||
in the manual of the \bgl for more information.
|
||||
|
||||
Say there is a function `f()` that takes 3 parameters called name, age and gender,
|
||||
and you have variables `n`, `a` and `g` to pass as parameters to that function.
|
||||
|
|
@ -186,32 +186,32 @@ refine(pmesh,
|
|||
\section BGLHeader Header Files, Namespaces, and Naming Conventions
|
||||
|
||||
This package provides the necessary classes and functions that enable using
|
||||
\cgal data structures as models of the \sc{Bgl} graph concepts.
|
||||
\cgal data structures as models of the \bgl graph concepts.
|
||||
To this end, we offer partial specializations of the `boost::graph_traits<Graph>` for various \cgal packages.
|
||||
For each such package, denoted `PACKAGE`, the partial specializations live in
|
||||
the namespace `boost` and are located in the header file `CGAL/boost/graph/graph_traits_PACKAGE.h`.
|
||||
Free functions are in the namespace `CGAL`, and the compiler uses argument-dependent lookup to find them.
|
||||
%Euler operations, described in Section \ref BGLEulerOperations, are in the namespace `CGAL::Euler`, as the function `remove_face()` is at
|
||||
the same time a low-level and an %Euler operation.
|
||||
Concerning the naming conventions, we have to use those of the \sc{Bgl},
|
||||
as to fulfill the requirements of the concepts defined in the \sc{Bgl}.
|
||||
Concerning the naming conventions, we have to use those of the \bgl,
|
||||
as to fulfill the requirements of the concepts defined in the \bgl.
|
||||
|
||||
Note that these partial specializations are often providing more than
|
||||
is required, making these classes not only models of the graph concepts
|
||||
of the \sc{Bgl}, but also models of the CGAL graph concepts, that will be
|
||||
of the \bgl, but also models of the CGAL graph concepts, that will be
|
||||
described in detail in Section \ref BGLExtensions. Correspondence tables
|
||||
between the types of a \cgal data structure and their \sc{Bgl} equivalents
|
||||
between the types of a \cgal data structure and their \bgl equivalents
|
||||
can be found in the \ref PkgBGLTraits documentation page.
|
||||
|
||||
We present in the following sections some examples of utilization of some
|
||||
\cgal data structures as \sc{Bgl} graphs.
|
||||
\cgal data structures as \bgl graphs.
|
||||
|
||||
\section BGLSurface_mesh The Class Surface_mesh as Model of the Boost Graph Concept
|
||||
|
||||
The class `Surface_mesh` is a model of most of the graph concepts of the \sc{Bgl}
|
||||
The class `Surface_mesh` is a model of most of the graph concepts of the \bgl
|
||||
as well as the concepts provided by \cgal. A complete list can
|
||||
be found in the documentation of \link BGLSMGT boost::graph_traits \endlink.
|
||||
The examples show how to use some of the \sc{Bgl} algorithms with `Surface_mesh` and show how to use
|
||||
The examples show how to use some of the \bgl algorithms with `Surface_mesh` and show how to use
|
||||
the concepts provided by \cgal to implement a simple algorithm.
|
||||
|
||||
\subsection BGLExampleMinimumSpanningTreeofaSurfaceMesh Example: Minimum Spanning Tree of a Surface_mesh
|
||||
|
|
@ -221,16 +221,16 @@ More examples can be found in Chapters
|
|||
\ref PkgSurfaceMeshSimplification, \ref PkgSurfaceMeshSegmentation, and \ref PkgSurfaceMeshDeformation.
|
||||
|
||||
The surface mesh class uses integer indices to address vertices and edges,
|
||||
and it comes with a built-in property mechanism that maps nicely on the \sc{Bgl}.
|
||||
and it comes with a built-in property mechanism that maps nicely on the \bgl.
|
||||
|
||||
\cgalExample{BGL_surface_mesh/prim.cpp}
|
||||
|
||||
\section BGLPolyhedral The Class Polyhedron_3 as Model of the Boost Graph Concept
|
||||
|
||||
The class `Polyhedron_3` is a model of most of the graph concepts of the \sc{Bgl}
|
||||
The class `Polyhedron_3` is a model of most of the graph concepts of the \bgl
|
||||
as well as the concepts provided by \cgal. A complete list can
|
||||
be found in the documentation of \link BGLPolyGT boost::graph_traits \endlink.
|
||||
The examples show how to use some of the \sc{Bgl} algorithms with `Polyhedron_3` and show how to use
|
||||
The examples show how to use some of the \bgl algorithms with `Polyhedron_3` and show how to use
|
||||
the concepts provided by \cgal to implement a simple algorithm.
|
||||
|
||||
\subsection BGLExampleMinimumSpanningTreeofaPolyhedral Example: Minimum Spanning Tree of a Polyhedral Surface
|
||||
|
|
@ -243,7 +243,7 @@ More examples can be found in the Chapter
|
|||
|
||||
\subsection BGLExampleUsingVerticesandEdgeswithanID Example: Using Vertices, and Edges with an ID
|
||||
|
||||
The following example program shows a call to the \sc{Bgl}
|
||||
The following example program shows a call to the \bgl
|
||||
Kruskal's minimum spanning tree algorithm accessing the `id()`
|
||||
field stored in a polyhedron vertex.
|
||||
|
||||
|
|
@ -275,7 +275,7 @@ integers in the range `[0, t.number_of_vertices())`.
|
|||
|
||||
\subsection BGLExampleStoringtheVertexIDintheVertex Example: Storing the Vertex ID in the Vertex
|
||||
|
||||
The algorithms of the \sc{Bgl} extensively use of the indices of
|
||||
The algorithms of the \bgl extensively use of the indices of
|
||||
vertices. In the previous example we stored the indices in a `std::map`
|
||||
and turned that map in a property map. This property map was then
|
||||
passed as argument to the shortest path function.
|
||||
|
|
@ -316,7 +316,7 @@ edges in our <I>boost</I> graph.
|
|||
|
||||
Given an `Arrangement_2` instance, we can efficiently traverse its
|
||||
vertices and halfedges. Thus, the arrangement graph is a model of the concepts
|
||||
`VertexListGraph` and `EdgeListGraph` introduced by the \sc{Bgl}.
|
||||
`VertexListGraph` and `EdgeListGraph` introduced by the \bgl.
|
||||
At the same time, we use an iterator adapter of the circulator over the
|
||||
halfedges incident to a vertex (`Halfedge_around_target_circulator` - see
|
||||
Section \ref arr_sssectr_vertex "Traversal Methods for an Arrangement Vertex"
|
||||
|
|
@ -327,11 +327,11 @@ is a model of the concept `BidirectionalGraph` (this concept refines
|
|||
|
||||
It is important to notice that the vertex descriptors we use are
|
||||
`Vertex_handle` objects and <I>not</I> vertex indices. However, in order
|
||||
to gain more efficiency in most \sc{Bgl} algorithm, it is better to have them
|
||||
to gain more efficiency in most \bgl algorithm, it is better to have them
|
||||
indexed \f$ 0, 1, \ldots, (n-1)\f$, where \f$ n\f$ is the number of vertices. We
|
||||
therefore introduce the `Arr_vertex_index_map<Arrangement>` class-template,
|
||||
which maintains a mapping of vertex handles to indices, as required by the
|
||||
\sc{Bgl}. An instance of this class must be attached to a valid arrangement
|
||||
\bgl. An instance of this class must be attached to a valid arrangement
|
||||
vertex when it is created. It uses the notification mechanism (see
|
||||
Section \ref arr_secnotif) to automatically maintain the mapping of vertices
|
||||
to indices, even when new vertices are inserted into the arrangement or
|
||||
|
|
@ -340,7 +340,7 @@ existing vertices are removed.
|
|||
A complete description of the types correspondences
|
||||
can be found in the documentation of \link BGLArgtGT boost::graph_traits \endlink.
|
||||
|
||||
In most algorithm provided by the \sc{Bgl}, the output is given by
|
||||
In most algorithm provided by the \bgl, the output is given by
|
||||
<I>property maps</I>, such that each map entry corresponds to a vertex.
|
||||
For example, when we compute the shortest paths from a given source vertex
|
||||
\f$ s\f$ to all other vertices we can obtain a map of distances and a map of
|
||||
|
|
@ -353,7 +353,7 @@ template allows for an efficient mapping of `Vertex_handle` objects to
|
|||
properties of type `Type`. Note however that unlike the
|
||||
`Arr_vertex_index_map` class, the vertex property-map class is not
|
||||
kept synchronized with the number of vertices in the arrangement, so it
|
||||
should not be reused in calls to the \sc{Bgl} functions in case the arrangement
|
||||
should not be reused in calls to the \bgl functions in case the arrangement
|
||||
is modified in between these calls.
|
||||
|
||||
\cgalFigureBegin{figex_bgl,ex_bgl.png}
|
||||
|
|
@ -362,7 +362,7 @@ An arrangement of 7 line segments, as constructed by `ex_bgl_primal_adapter.cpp`
|
|||
|
||||
In the following example we construct an arrangement of 7 line segments,
|
||||
as shown in \cgalFigureRef{figex_bgl},
|
||||
then use the \sc{Bgl} Dijkstra's shortest-paths algorithm to compute
|
||||
then use the \bgl Dijkstra's shortest-paths algorithm to compute
|
||||
the graph distance of all vertices from the leftmost vertex in the
|
||||
arrangement \f$ v_0\f$. Note the usage of the `Arr_vertex_index_map` and
|
||||
the `Arr_vertex_property_map` classes. The latter one, instantiated by
|
||||
|
|
@ -400,7 +400,7 @@ data with the arrangement faces.
|
|||
In the following example we construct the same arrangement as in
|
||||
example `ex_bgl_primal_adapter.cpp` (see \cgalFigureRef{arr_figex_bgl}),
|
||||
and perform breadth-first search on the graph faces, starting from the
|
||||
unbounded face. We extend the \sc{Dcel} faces
|
||||
unbounded face. We extend the \dcel faces
|
||||
with an unsigned integer, marking the discover time of the face and use a
|
||||
breadth-first-search visitor to obtain these times and update the faces
|
||||
accordingly:
|
||||
|
|
@ -411,9 +411,9 @@ accordingly:
|
|||
|
||||
The previous sections introduced partial specializations
|
||||
and free functions so that several \cgal data structures are adapted as models of some
|
||||
of the \sc{Bgl} graph concepts.
|
||||
of the \bgl graph concepts.
|
||||
In this section, we introduce new concepts, iterators, and property maps inspired
|
||||
by the functionalities of the \sc{Bgl}.
|
||||
by the functionalities of the \bgl.
|
||||
|
||||
\subsection BGLExtensionsGraphConcepts Graph concepts
|
||||
|
||||
|
|
@ -485,7 +485,7 @@ stored in the vertex record.)
|
|||
\subsubsection BGLExampleNormalHalfedgeGraph Example: Calculating Facet Normals using HalfedgeGraph
|
||||
|
||||
The following example program shows a simple algorithm for calculating
|
||||
facet normals for a polyhedron using the \sc{Bgl} API. A
|
||||
facet normals for a polyhedron using the \bgl API. A
|
||||
<a href="https://www.boost.org/libs/property_map/doc/vector_property_map.html">boost::vector_property_map</a>
|
||||
is used to to store the calculated normals instead of changing the Polyhedron items class.
|
||||
|
||||
|
|
@ -579,13 +579,13 @@ as shown in the following example.
|
|||
\subsection BGLSeamMesh The Seam Mesh
|
||||
|
||||
The class `Seam_mesh` allows to mark edges of a mesh as <em>seam edges</em>
|
||||
so that they <em>virtually</em> become border edges when exploring a seam mesh with the \sc{Bgl} API.
|
||||
so that they <em>virtually</em> become border edges when exploring a seam mesh with the \bgl API.
|
||||
The input mesh is referred to as <em>underlying</em> mesh of the seam mesh.
|
||||
We denote `tm` and `sm` the underlying mesh and the seam mesh respectively.
|
||||
|
||||
Figure \cgalFigureRef{fig_Seam_mesh_1} shows an example of mesh on which two
|
||||
edges, defined by the halfedge pairs `h2-h3` and `h6-h7`, are marked as seams.
|
||||
The introduction of virtual borders modifies the elementary \sc{Bgl} graph traversal
|
||||
The introduction of virtual borders modifies the elementary \bgl graph traversal
|
||||
operations: when we circulate around the target of `h7` in the underlying mesh,
|
||||
we traverse `h7`, `h1`, `h3`, `h5`, before arriving at `h7` again.
|
||||
However, when we circulate in the seam mesh, we traverse `h7`, `h1`, `h3*`,
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ concept.
|
|||
|
||||
It is equivalent to `HalfedgeDS_face_base< Refs, Tag_true>`
|
||||
with an added integer field which can be used to index faces
|
||||
in \sc{Bgl} algorithms.
|
||||
in \bgl algorithms.
|
||||
The class contains support for the incident halfedge pointer
|
||||
and the required type definitions.
|
||||
It can be used for deriving own faces.
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ namespace CGAL {
|
|||
The class `HalfedgeDS_halfedge_max_base_with_id` is a model of the `HalfedgeDSHalfedge`
|
||||
concept.
|
||||
It is equivalent to `HalfedgeDS_halfedge_base< Refs, Tag_true, Tag_true, Tag_true>` with an added integer
|
||||
field which can be used to index halfedges in \sc{Bgl} algorithms.
|
||||
field which can be used to index halfedges in \bgl algorithms.
|
||||
The class contains support for the previous, next, opposite, vertex and
|
||||
face pointers and the required type definitions.
|
||||
It can be used for deriving own halfedges.
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ The class `HalfedgeDS_vertex_max_base_with_id` is a model of the `HalfedgeDSVert
|
|||
concept. It is
|
||||
equivalent to `HalfedgeDS_vertex_base< Refs, Tag_true>`
|
||||
with an added integer field which can be used to index vertices
|
||||
in \sc{Bgl} algorithms..
|
||||
in \bgl algorithms..
|
||||
The class contains support for the point and the required type definitions.
|
||||
It can be used for deriving own vertices.
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ namespace CGAL {
|
|||
The class `Polyhedron_items_with_id_3` is a model of the `PolyhedronItems_3`
|
||||
concept. It provides definitions for vertices with points, halfedges,
|
||||
and faces with plane equations, all of them with an additional integer
|
||||
field which can be used to index the items in a \sc{Bgl} algorithm.
|
||||
field which can be used to index the items in a \bgl algorithm.
|
||||
The polyhedron traits class must provide the respective types for
|
||||
the point and the plane equation.
|
||||
Vertices and facets both contain a halfedge handle to an incident
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ namespace CGAL {
|
|||
The class `Triangulation_face_base_with_id_2` is a model of the
|
||||
concept `TriangulationFaceBase_2`, the base face of a
|
||||
2D-triangulation. It provides an integer field that can be used to
|
||||
index faces for \sc{Bgl} algorithms.
|
||||
index faces for \bgl algorithms.
|
||||
|
||||
Note that the user is in charge of setting indices correctly before
|
||||
running a graph algorithm, by calling the function
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ namespace CGAL {
|
|||
The class `Triangulation_vertex_base_with_id_2` is a model of the
|
||||
concept `TriangulationVertexBase_2`, the base vertex of a
|
||||
2D-triangulation. It provides an integer field that can be used to
|
||||
index vertices for \sc{Bgl} algorithms.
|
||||
index vertices for \bgl algorithms.
|
||||
|
||||
Note that the user is in charge of setting indices correctly before
|
||||
running a graph algorithm, by calling the function
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ namespace CGAL {
|
|||
/// \ingroup PkgBGLProperties
|
||||
/// @{
|
||||
|
||||
/// The constant `vertex_index` is a property tag which identifies the <i>index</i> property of a vertex of a \sc{Bgl}
|
||||
/// The constant `vertex_index` is a property tag which identifies the <i>index</i> property of a vertex of a \bgl
|
||||
/// <a href="https://www.boost.org/libs/graph/doc/Graph.html"><code>Graph</code></a>.
|
||||
/// \cgalModels <a href="https://www.boost.org/libs/graph/doc/PropertyTag.html"><code>PropertyTag</code></a>
|
||||
enum vertex_index_t { vertex_index };
|
||||
|
|
@ -15,7 +15,7 @@ enum vertex_index_t { vertex_index };
|
|||
/// \cgalModels <a href="https://www.boost.org/libs/graph/doc/PropertyTag.html"><code>PropertyTag</code></a>
|
||||
enum halfedge_index_t { halfedge_index };
|
||||
|
||||
/// The constant `edge_index` is a property tag which identifies the <i>index</i> property of an edge of a \sc{Bgl}
|
||||
/// The constant `edge_index` is a property tag which identifies the <i>index</i> property of an edge of a \bgl
|
||||
/// <a href="https://www.boost.org/libs/graph/doc/Graph.html"><code>Graph</code></a>.
|
||||
/// \cgalModels <a href="https://www.boost.org/libs/graph/doc/PropertyTag.html"><code>PropertyTag</code></a>
|
||||
enum edge_index_t { edge_index };
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
\ingroup PkgBGLConcepts
|
||||
\cgalConcept
|
||||
|
||||
The concept `HalfedgeGraph` is a refinement of the \sc{Bgl} concept
|
||||
The concept `HalfedgeGraph` is a refinement of the \bgl concept
|
||||
`IncidenceGraph` and adds the notion of a *halfedge*: Each edge is
|
||||
associated with two *opposite* halfedges with source and target vertices swapped.
|
||||
Furthermore, halfedges have a *successor* and *predecessor*,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
\defgroup bgl_namedparameters Named Parameters
|
||||
\ingroup PkgBGLRef
|
||||
|
||||
The algorithms of the Boost Graph Library (\sc{Bgl}) often have many parameters with default
|
||||
The algorithms of the Boost Graph Library (\bgl) often have many parameters with default
|
||||
values that are appropriate for most cases. In general, when no
|
||||
special treatment is applied, the values of such parameters are passed
|
||||
as a sequence. Deviating from the default for a certain parameter
|
||||
|
|
@ -18,7 +18,7 @@ vertex_descriptor s = vertex(A, g);
|
|||
dijkstra_shortest_paths(g, s, predecessor_map(&p[0]).distance_map(&d[0]));
|
||||
\endcode
|
||||
|
||||
In the \sc{Bgl} manual, this is called
|
||||
In the \bgl manual, this is called
|
||||
<a href="https://www.boost.org/libs/graph/doc/bgl_named_params.html">named parameters</a>.
|
||||
The named parameters in the snippet use the tags `predecessor_map` and `distance_map`
|
||||
and they are concatenated using the dot operator.<BR>
|
||||
|
|
@ -26,7 +26,7 @@ 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
|
||||
that default values of optional named parameters must be used.
|
||||
As in the \sc{BGL}, named parameters in \cgal are also concatenated using
|
||||
As in the \bgl, named parameters in \cgal are also concatenated using
|
||||
the dot operator, and a typical usage is thus:
|
||||
|
||||
\code {.cpp}
|
||||
|
|
|
|||
|
|
@ -3,9 +3,9 @@
|
|||
/*! \defgroup PkgBGLConcepts Concepts
|
||||
\ingroup PkgBGLRef
|
||||
|
||||
We extend the Boost Graph Library (\sc{Bgl} for short) with a set of new concepts.
|
||||
We extend the Boost Graph Library (\bgl for short) with a set of new concepts.
|
||||
In order to make this documentation self-contained we here also document
|
||||
concepts that are defined in the original version of the \sc{Bgl}.
|
||||
concepts that are defined in the original version of the \bgl.
|
||||
The documentation of the concepts lists at the same time the functions
|
||||
related to it. Models of the concept and their related functions
|
||||
must be in the same namespace (they will be found by Koenig lookup).
|
||||
|
|
@ -586,9 +586,9 @@ Methods to read and write graphs.
|
|||
\cgalPkgSummaryBegin
|
||||
\cgalPkgAuthors{Andreas Fabri, Fernando Cacciola, Philipp Moeller, and Ron Wein}
|
||||
\cgalPkgDesc{This package provides a framework for interfacing \cgal data structures
|
||||
with the algorithms of the Boost Graph Library, or \sc{BGL} for short.
|
||||
with the algorithms of the Boost Graph Library, or \bgl for short.
|
||||
It allows to run graph algorithms directly on \cgal data structures which are model
|
||||
of the \sc{BGL} graph concepts, for example the shortest path algorithm
|
||||
of the \bgl graph concepts, for example the shortest path algorithm
|
||||
on a Delaunay triangulation in order to compute the Euclidean minimum spanning tree.
|
||||
Furthermore, it introduces several new graph concepts describing halfedge data structures.}
|
||||
\cgalPkgManuals{Chapter_CGAL_and_the_Boost_Graph_Library,PkgBGLRef}
|
||||
|
|
@ -621,7 +621,7 @@ Methods to read and write graphs.
|
|||
|
||||
\cgalCRPSection{%CGAL Classes Adapted for the Graph API}
|
||||
|
||||
A number of \cgal structures have been adapted as graphs for the \sc{Bgl}. All
|
||||
A number of \cgal structures have been adapted as graphs for the \bgl. All
|
||||
adapted types are listed here. The pages document which concepts they
|
||||
model, the properties they support, and any possible caveats that a
|
||||
user might encounter.
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
\ingroup PkgBGLRef
|
||||
|
||||
The \sc{Bgl} defines the class template
|
||||
The \bgl defines the class template
|
||||
<A HREF="https://www.boost.org/libs/graph/doc/graph_traits.html">`boost::graph_traits`</A>
|
||||
as a uniform interface to the properties and types of %graph types.
|
||||
|
||||
|
|
@ -156,7 +156,7 @@ vertex, or walking through the faces container.
|
|||
|
||||
The mapping between vertices, edges, and faces of the triangulation and the
|
||||
graph is rather straightforward, but there are some subtleties. The
|
||||
value type of the \sc{Bgl} iterators is the vertex or edge descriptor,
|
||||
value type of the \bgl iterators is the vertex or edge descriptor,
|
||||
whereas in \cgal all iterators and circulators are also handles and
|
||||
hence have as value type Vertex or Edge.
|
||||
|
||||
|
|
|
|||
|
|
@ -19,23 +19,6 @@ if(NOT Boost_FOUND)
|
|||
|
||||
endif()
|
||||
|
||||
find_package(OpenMesh QUIET)
|
||||
|
||||
if(OpenMesh_FOUND)
|
||||
include(UseOpenMesh)
|
||||
add_definitions(-DCGAL_USE_OPENMESH)
|
||||
else()
|
||||
message(STATUS "Examples that use OpenMesh will not be compiled.")
|
||||
endif()
|
||||
|
||||
find_package(METIS)
|
||||
|
||||
if(METIS_FOUND)
|
||||
include_directories(${METIS_INCLUDE_DIRS})
|
||||
else()
|
||||
message(STATUS "Examples that use the METIS library will not be compiled.")
|
||||
endif()
|
||||
|
||||
# include for local directory
|
||||
|
||||
# include for local package
|
||||
|
|
@ -59,12 +42,21 @@ create_single_source_cgal_program("transform_iterator.cpp")
|
|||
|
||||
create_single_source_cgal_program("copy_polyhedron.cpp")
|
||||
|
||||
find_package( OpenMesh QUIET )
|
||||
if(OpenMesh_FOUND)
|
||||
target_link_libraries( copy_polyhedron PRIVATE ${OPENMESH_LIBRARIES} )
|
||||
target_compile_definitions( copy_polyhedron PRIVATE -DCGAL_USE_OPENMESH )
|
||||
else()
|
||||
message(STATUS "Examples that use OpenMesh will not be compiled.")
|
||||
endif()
|
||||
|
||||
if(METIS_FOUND)
|
||||
create_single_source_cgal_program("polyhedron_partition.cpp")
|
||||
target_link_libraries(polyhedron_partition PRIVATE ${METIS_LIBRARIES})
|
||||
find_package( METIS )
|
||||
if( METIS_FOUND )
|
||||
create_single_source_cgal_program( "polyhedron_partition.cpp" )
|
||||
if( METIS_FOUND )
|
||||
target_include_directories( polyhedron_partition PRIVATE ${METIS_INCLUDE_DIRS} )
|
||||
target_link_libraries( polyhedron_partition PRIVATE ${METIS_LIBRARIES} )
|
||||
else()
|
||||
message( STATUS "Examples that use the METIS library will not be compiled." )
|
||||
endif()
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -13,12 +13,10 @@ create_single_source_cgal_program("surface_mesh_dual.cpp")
|
|||
create_single_source_cgal_program("connected_components.cpp")
|
||||
|
||||
find_package(METIS)
|
||||
|
||||
if(METIS_FOUND)
|
||||
include_directories(${METIS_INCLUDE_DIRS})
|
||||
|
||||
create_single_source_cgal_program("surface_mesh_partition.cpp")
|
||||
target_link_libraries(surface_mesh_partition PRIVATE ${METIS_LIBRARIES})
|
||||
if( METIS_FOUND )
|
||||
create_single_source_cgal_program( "surface_mesh_partition.cpp" )
|
||||
target_include_directories( surface_mesh_partition PRIVATE ${METIS_INCLUDE_DIRS} )
|
||||
target_link_libraries( surface_mesh_partition PRIVATE ${METIS_LIBRARIES} )
|
||||
else()
|
||||
message(STATUS "Examples that use the METIS library will not be compiled.")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
#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/boost/graph/named_params_helper.h>
|
||||
#include <boost/container/flat_map.hpp>
|
||||
|
||||
#include <fstream>
|
||||
|
|
@ -271,7 +271,7 @@ bool read_GOCAD(const std::string& fname, Graph& g,
|
|||
/// \cgalParamNBegin{stream_precision}
|
||||
/// \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
|
||||
/// \cgalParamType{int}
|
||||
/// \cgalParamDefault{`6`}
|
||||
/// \cgalParamDefault{`the precision of the stream `os``}
|
||||
/// \cgalParamNEnd
|
||||
/// \cgalNamedParamsEnd
|
||||
///
|
||||
|
|
@ -303,8 +303,7 @@ bool write_GOCAD(std::ostream& os,
|
|||
if(!os.good())
|
||||
return false;
|
||||
|
||||
const int precision = choose_parameter(get_parameter(np, internal_np::stream_precision), 6);
|
||||
os.precision(precision);
|
||||
set_stream_precision_from_NP(os, np);
|
||||
|
||||
os << "GOCAD TSurf 1\n"
|
||||
"HEADER {\n"
|
||||
|
|
@ -380,7 +379,7 @@ bool write_GOCAD(std::ostream& os, const char* name, const Graph& g,
|
|||
/// \cgalParamNBegin{stream_precision}
|
||||
/// \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
|
||||
/// \cgalParamType{int}
|
||||
/// \cgalParamDefault{`6`}
|
||||
/// \cgalParamDefault{`the precision of the stream `os``}
|
||||
/// \cgalParamNEnd
|
||||
/// \cgalNamedParamsEnd
|
||||
///
|
||||
|
|
@ -454,6 +453,7 @@ bool write_GOCAD(const std::string& fname,
|
|||
{
|
||||
std::ofstream os(fname);
|
||||
CGAL::set_mode(os, CGAL::IO::ASCII);
|
||||
|
||||
return write_GOCAD(os, fname.c_str(), g, np);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -117,8 +117,7 @@ public:
|
|||
if(!m_os.good())
|
||||
return false;
|
||||
|
||||
const int precision = choose_parameter(get_parameter(np, internal_np::stream_precision), 6);
|
||||
m_os.precision(precision);
|
||||
set_stream_precision_from_NP(m_os, np);
|
||||
|
||||
VPM vpm = choose_parameter(get_parameter(np, internal_np::vertex_point),
|
||||
get_const_property_map(CGAL::vertex_point, g));
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ bool read_OBJ(const std::string& fname, Graph& g,
|
|||
\cgalParamNBegin{stream_precision}
|
||||
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
|
||||
\cgalParamType{int}
|
||||
\cgalParamDefault{`6`}
|
||||
\cgalParamDefault{`the precision of the stream `os``}
|
||||
\cgalParamNEnd
|
||||
\cgalNamedParamsEnd
|
||||
|
||||
|
|
@ -285,6 +285,11 @@ bool write_OBJ(std::ostream& os, const Graph& g,
|
|||
\cgalParamExtra{If this parameter is omitted, an internal property map for `CGAL::vertex_point_t`
|
||||
must be available in `Graph`.}
|
||||
\cgalParamNEnd
|
||||
\cgalParamNBegin{stream_precision}
|
||||
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
|
||||
\cgalParamType{int}
|
||||
\cgalParamDefault{`6`}
|
||||
\cgalParamNEnd
|
||||
\cgalNamedParamsEnd
|
||||
|
||||
\returns `true` if writing was successful, `false` otherwise.
|
||||
|
|
|
|||
|
|
@ -284,9 +284,9 @@ bool read_OFF(const std::string& fname, Graph& g,
|
|||
\deprecated This function is deprecated since \cgal 5.2, `CGAL::read_OFF()` should be used instead.
|
||||
*/
|
||||
template <typename Graph, typename CGAL_BGL_NP_TEMPLATE_PARAMETERS>
|
||||
CGAL_DEPRECATED bool read_off(std::ostream& os, Graph& g, const CGAL_BGL_NP_CLASS& np)
|
||||
CGAL_DEPRECATED bool read_off(std::istream& is, Graph& g, const CGAL_BGL_NP_CLASS& np)
|
||||
{
|
||||
return read_OFF(os, g, np);
|
||||
return read_OFF(is, g, np);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
@ -300,6 +300,18 @@ CGAL_DEPRECATED bool read_off(const char* fname, Graph& g, const CGAL_BGL_NP_CLA
|
|||
return 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());
|
||||
}
|
||||
|
||||
#endif // CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -374,7 +386,7 @@ bool write_OFF_BGL(std::ostream& os,
|
|||
\cgalParamNBegin{stream_precision}
|
||||
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
|
||||
\cgalParamType{int}
|
||||
\cgalParamDefault{`6`}
|
||||
\cgalParamDefault{`the precision of the stream `os``}
|
||||
\cgalParamNEnd
|
||||
\cgalNamedParamsEnd
|
||||
|
||||
|
|
@ -483,6 +495,7 @@ bool write_OFF(const std::string& fname,
|
|||
std::cerr<<"Could not create file.";
|
||||
return false;
|
||||
}
|
||||
|
||||
return write_OFF(os, g, np);
|
||||
}
|
||||
|
||||
|
|
@ -510,6 +523,11 @@ CGAL_DEPRECATED bool write_off(std::ostream& os, const Graph& g, const CGAL_BGL_
|
|||
return 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
|
||||
|
||||
|
|
@ -521,6 +539,11 @@ CGAL_DEPRECATED bool write_off(const char* fname, const Graph& g, const CGAL_BGL
|
|||
return 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
|
||||
|
|
|
|||
|
|
@ -311,7 +311,7 @@ bool read_PLY(const std::string& fname, Graph& g,
|
|||
\cgalParamNBegin{stream_precision}
|
||||
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
|
||||
\cgalParamType{int}
|
||||
\cgalParamDefault{`6`}
|
||||
\cgalParamDefault{`the precision of the stream `os``}
|
||||
\cgalParamExtra{This parameter is only meaningful while using ASCII encoding.}
|
||||
\cgalParamNEnd
|
||||
\cgalNamedParamsEnd
|
||||
|
|
@ -361,8 +361,7 @@ bool write_PLY(std::ostream& os,
|
|||
if(!os.good())
|
||||
return false;
|
||||
|
||||
const int precision = choose_parameter(get_parameter(np, internal_np::stream_precision), 6);
|
||||
os.precision(precision);
|
||||
set_stream_precision_from_NP(os, np);
|
||||
|
||||
// Write header
|
||||
os << "ply" << std::endl
|
||||
|
|
@ -550,6 +549,7 @@ bool write_PLY(const std::string& fname,
|
|||
{
|
||||
std::ofstream os(fname);
|
||||
CGAL::set_mode(os, CGAL::IO::ASCII);
|
||||
|
||||
return write_PLY(os, g, comments, np);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -231,7 +231,7 @@ bool read_STL(const std::string& fname, Graph& g) { return read_STL(fname, g, pa
|
|||
\cgalParamNBegin{stream_precision}
|
||||
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
|
||||
\cgalParamType{int}
|
||||
\cgalParamDefault{`6`}
|
||||
\cgalParamDefault{`the precision of the stream `os``}
|
||||
\cgalParamExtra{This parameter is only meaningful while using ASCII encoding.}
|
||||
\cgalParamNEnd
|
||||
\cgalNamedParamsEnd
|
||||
|
|
@ -262,8 +262,7 @@ bool write_STL(std::ostream& os,
|
|||
if(!os.good())
|
||||
return false;
|
||||
|
||||
const int precision = choose_parameter(get_parameter(np, internal_np::stream_precision), 6);
|
||||
os.precision(precision);
|
||||
set_stream_precision_from_NP(os, np);
|
||||
|
||||
if(get_mode(os) == IO::BINARY)
|
||||
{
|
||||
|
|
@ -372,6 +371,7 @@ bool write_STL(const std::string& fname, const Graph& g, const CGAL_BGL_NP_CLASS
|
|||
{
|
||||
std::ofstream os(fname);
|
||||
CGAL::set_mode(os, CGAL::IO::ASCII);
|
||||
|
||||
return write_STL(os, g, np);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -420,7 +420,7 @@ void write_polys_points(std::ostream& os,
|
|||
* \cgalParamNBegin{stream_precision}
|
||||
* \cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
|
||||
* \cgalParamType{int}
|
||||
* \cgalParamDefault{`6`}
|
||||
* \cgalParamDefault{`the precision of the stream `os``}
|
||||
* \cgalParamNEnd
|
||||
* \cgalNamedParamsEnd
|
||||
*
|
||||
|
|
@ -439,8 +439,7 @@ bool write_VTP(std::ostream& os,
|
|||
if(!os.good())
|
||||
return false;
|
||||
|
||||
const int precision = choose_parameter(get_parameter(np, internal_np::stream_precision), 6);
|
||||
os.precision(precision);
|
||||
set_stream_precision_from_NP(os, np);
|
||||
|
||||
os << "<?xml version=\"1.0\"?>\n"
|
||||
<< "<VTKFile type=\"PolyData\" version=\"0.1\"";
|
||||
|
|
@ -539,6 +538,7 @@ bool write_VTP(const std::string& fname, const Graph& g, const CGAL_BGL_NP_CLASS
|
|||
}
|
||||
else
|
||||
os.open(fname);
|
||||
|
||||
return write_VTP(os, g, np);
|
||||
}
|
||||
|
||||
|
|
@ -564,6 +564,12 @@ CGAL_DEPRECATED bool write_vtp(std::ostream& os, const Graph& g, const CGAL_BGL_
|
|||
return 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
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ namespace CGAL {
|
|||
\cgalParamNBegin{stream_precision}
|
||||
\cgalParamDescription{a parameter used to set the precision (i.e. how many digits are generated) of the output stream}
|
||||
\cgalParamType{int}
|
||||
\cgalParamDefault{`6`}
|
||||
\cgalParamDefault{`the precision of the stream `os``}
|
||||
\cgalParamNEnd
|
||||
\cgalNamedParamsEnd
|
||||
|
||||
|
|
@ -70,7 +70,8 @@ bool write_WRL(std::ostream& os,
|
|||
const Graph& g,
|
||||
const CGAL_BGL_NP_CLASS& np)
|
||||
{
|
||||
IO::internal::Generic_facegraph_printer<std::ostream, Graph, CGAL::File_writer_VRML_2> printer(os);
|
||||
CGAL::VRML_2_ostream vos(os);
|
||||
IO::internal::Generic_facegraph_printer<CGAL::VRML_2_ostream, Graph, CGAL::File_writer_VRML_2> printer(vos);
|
||||
return printer(g, np);
|
||||
}
|
||||
|
||||
|
|
@ -108,8 +109,8 @@ bool write_WRL(std::ostream& os,
|
|||
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)
|
||||
{
|
||||
std::ifstream is(fname);
|
||||
return write_WRL(is, g, np);
|
||||
std::ofstream os(fname);
|
||||
return write_WRL(os, g, np);
|
||||
}
|
||||
|
||||
template <typename Graph>
|
||||
|
|
@ -130,6 +131,12 @@ CGAL_DEPRECATED bool write_wrl(std::ostream& os, const Graph& g, const CGAL_BGL_
|
|||
return 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
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@
|
|||
#include <CGAL/property_map.h>
|
||||
#include <boost/unordered_map.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/function_output_iterator.hpp>
|
||||
#include <boost/iterator/function_output_iterator.hpp>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
@ -167,6 +167,8 @@ void copy_face_graph_impl(const SourceMesh& sm, TargetMesh& tm,
|
|||
for(tm_vertex_descriptor v : vertices(tm))
|
||||
{
|
||||
tm_halfedge_descriptor h = halfedge(v, tm);
|
||||
if (h==boost::graph_traits<TargetMesh>::null_halfedge())
|
||||
continue;
|
||||
tm_halfedge_descriptor next_around_vertex=h;
|
||||
do{
|
||||
next_around_vertex=opposite(next(next_around_vertex, tm), tm);
|
||||
|
|
|
|||
|
|
@ -27,6 +27,20 @@
|
|||
|
||||
namespace CGAL {
|
||||
|
||||
namespace parameters
|
||||
{
|
||||
template <class Parameter, class NamedParameters>
|
||||
struct Is_default
|
||||
{
|
||||
typedef typename internal_np::Lookup_named_param_def <
|
||||
Parameter,
|
||||
NamedParameters,
|
||||
internal_np::Param_not_found > ::type NP_type;
|
||||
static const bool value = boost::is_same<NP_type, internal_np::Param_not_found>::value;
|
||||
typedef CGAL::Boolean_tag<value> type;
|
||||
};
|
||||
} // end of parameters namespace
|
||||
|
||||
// forward declarations to avoid dependency to Solver_interface
|
||||
template <typename FT, unsigned int dim>
|
||||
class Default_diagonalize_traits;
|
||||
|
|
@ -560,6 +574,21 @@ CGAL_DEF_GET_INITIALIZED_INDEX_MAP(face, typename boost::graph_traits<Graph>::fa
|
|||
Alpha_expansion_boost_adjacency_list_tag
|
||||
>::type type;
|
||||
};
|
||||
|
||||
template<typename NP>
|
||||
void set_stream_precision_from_NP(std::ostream& os, const NP& np)
|
||||
{
|
||||
using parameters::get_parameter;
|
||||
using parameters::choose_parameter;
|
||||
using parameters::is_default_parameter;
|
||||
|
||||
if(!is_default_parameter(get_parameter(np, internal_np::stream_precision)))
|
||||
{
|
||||
const int precision = choose_parameter<int>(get_parameter(np,
|
||||
internal_np::stream_precision));
|
||||
os.precision(precision);
|
||||
}
|
||||
}
|
||||
} //namespace CGAL
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -61,6 +61,7 @@ CGAL_add_named_parameter(geom_traits_t, geom_traits, geom_traits)
|
|||
CGAL_add_named_parameter(vertex_incident_patches_t, vertex_incident_patches, vertex_incident_patches_map)
|
||||
CGAL_add_named_parameter(density_control_factor_t, density_control_factor, density_control_factor)
|
||||
CGAL_add_named_parameter(use_delaunay_triangulation_t, use_delaunay_triangulation, use_delaunay_triangulation)
|
||||
CGAL_add_named_parameter(use_2d_constrained_delaunay_triangulation_t, use_2d_constrained_delaunay_triangulation, use_2d_constrained_delaunay_triangulation)
|
||||
CGAL_add_named_parameter(fairing_continuity_t, fairing_continuity, fairing_continuity)
|
||||
CGAL_add_named_parameter(sparse_linear_solver_t, sparse_linear_solver, sparse_linear_solver)
|
||||
CGAL_add_named_parameter(number_of_relaxation_steps_t, number_of_relaxation_steps, number_of_relaxation_steps)
|
||||
|
|
@ -117,6 +118,7 @@ CGAL_add_named_parameter(volume_threshold_t, volume_threshold, volume_threshold)
|
|||
CGAL_add_named_parameter(dry_run_t, dry_run, dry_run)
|
||||
CGAL_add_named_parameter(do_not_modify_t, do_not_modify, do_not_modify)
|
||||
CGAL_add_named_parameter(allow_self_intersections_t, allow_self_intersections, allow_self_intersections)
|
||||
CGAL_add_named_parameter(non_manifold_feature_map_t, non_manifold_feature_map, non_manifold_feature_map)
|
||||
CGAL_add_named_parameter(polyhedral_envelope_epsilon_t, polyhedral_envelope_epsilon, polyhedral_envelope_epsilon)
|
||||
|
||||
// List of named parameters that we use in the package 'Surface Mesh Simplification'
|
||||
|
|
|
|||
|
|
@ -561,6 +561,9 @@ regularize_face_selection_borders(
|
|||
/// \endcond
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
namespace experimental {
|
||||
|
||||
// TODO: improve and document if useful
|
||||
//
|
||||
// Variant of regularization without graphcut but with brut-force
|
||||
|
|
@ -703,6 +706,8 @@ regularize_face_selection_borders(
|
|||
put(is_selected, fd, true);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
/// \endcond
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -98,6 +98,8 @@ create_single_source_cgal_program(
|
|||
|
||||
create_single_source_cgal_program( "graph_traits_inheritance.cpp" )
|
||||
|
||||
create_single_source_cgal_program("test_deprecated_io.cpp")
|
||||
|
||||
if(OpenMesh_FOUND)
|
||||
target_link_libraries(test_clear PRIVATE ${OPENMESH_LIBRARIES})
|
||||
target_compile_definitions(test_clear PRIVATE -DCGAL_USE_OPENMESH)
|
||||
|
|
@ -129,6 +131,8 @@ if (VTK_FOUND)
|
|||
if(VTK_LIBRARIES)
|
||||
target_link_libraries(test_bgl_read_write PRIVATE ${VTK_LIBRARIES})
|
||||
target_compile_definitions(test_bgl_read_write PRIVATE -DCGAL_USE_VTK)
|
||||
target_link_libraries(test_deprecated_io PRIVATE ${VTK_LIBRARIES})
|
||||
target_compile_definitions(test_deprecated_io PRIVATE -DCGAL_USE_VTK)
|
||||
else()
|
||||
message(STATUS "Tests that use VTK will not be compiled.")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -35,6 +35,57 @@ test_copy_face_graph_nm_umbrella()
|
|||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
test_copy_face_graph_isolated_vertices()
|
||||
{
|
||||
typedef Kernel::Point_3 Point_3;
|
||||
|
||||
{
|
||||
T s, t;
|
||||
add_vertex(s);
|
||||
CGAL::copy_face_graph(s, t);
|
||||
}
|
||||
|
||||
{
|
||||
T s, t;
|
||||
add_vertex(t);
|
||||
CGAL::copy_face_graph(s, t);
|
||||
}
|
||||
|
||||
{
|
||||
T s, t;
|
||||
CGAL::make_triangle(Point_3(), Point_3(), Point_3(), s);
|
||||
add_vertex(s);
|
||||
t=s;
|
||||
CGAL::copy_face_graph(s, t);
|
||||
}
|
||||
|
||||
{
|
||||
T s, t;
|
||||
CGAL::make_triangle(Point_3(), Point_3(), Point_3(), s);
|
||||
add_vertex(s);
|
||||
add_vertex(t);
|
||||
CGAL::copy_face_graph(s, t);
|
||||
}
|
||||
|
||||
{
|
||||
T s, t;
|
||||
CGAL::make_tetrahedron(Point_3(), Point_3(), Point_3(), Point_3(), s);
|
||||
add_vertex(s);
|
||||
t=s;
|
||||
CGAL::copy_face_graph(s, t);
|
||||
}
|
||||
|
||||
{
|
||||
T s, t;
|
||||
CGAL::make_tetrahedron(Point_3(), Point_3(), Point_3(), Point_3(), s);
|
||||
add_vertex(s);
|
||||
add_vertex(t);
|
||||
CGAL::copy_face_graph(s, t);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void
|
||||
join_face_test()
|
||||
|
|
@ -619,6 +670,7 @@ void
|
|||
test_Euler_operations()
|
||||
{
|
||||
test_copy_face_graph_nm_umbrella<Graph>();
|
||||
test_copy_face_graph_isolated_vertices<Graph>();
|
||||
join_face_test<Graph>();
|
||||
add_vertex_and_face_to_border_test<Graph>();
|
||||
add_face_to_border_test<Graph>();
|
||||
|
|
|
|||
|
|
@ -171,10 +171,10 @@ void test_bgl_OFF(const char* filename)
|
|||
assert(ok);
|
||||
assert(num_vertices(fg) == 8 && num_faces(fg) == 4);
|
||||
|
||||
for(const auto v : vertices(fg))
|
||||
for(auto v : vertices(fg))
|
||||
assert(get(vcm, v) != CGAL::Color());
|
||||
|
||||
for(const auto f : faces(fg))
|
||||
for(auto f : faces(fg))
|
||||
assert(get(fcm, f) != CGAL::Color());
|
||||
|
||||
// write with OFF
|
||||
|
|
@ -192,10 +192,10 @@ void test_bgl_OFF(const char* filename)
|
|||
assert(ok);
|
||||
assert(are_equal_meshes(fg, fg2));
|
||||
|
||||
for(const auto v : vertices(fg2))
|
||||
for(auto v : vertices(fg2))
|
||||
assert(get(vcm2, v) != CGAL::Color());
|
||||
|
||||
for(const auto f : faces(fg2))
|
||||
for(auto f : faces(fg2))
|
||||
assert(get(fcm2, f) != CGAL::Color());
|
||||
}
|
||||
|
||||
|
|
@ -211,7 +211,7 @@ void test_bgl_OFF(const char* filename)
|
|||
assert(ok);
|
||||
assert(are_equal_meshes(fg, fg2));
|
||||
|
||||
for(const auto v : vertices(fg2))
|
||||
for(auto v : vertices(fg2))
|
||||
assert(get(vcm2, v) != CGAL::Color());
|
||||
}
|
||||
}
|
||||
|
|
@ -224,7 +224,7 @@ void test_bgl_OFF(const char* filename)
|
|||
ok = CGAL::read_OFF("data/mesh_with_normals.off", fg, CGAL::parameters::vertex_normal_map(vnm));
|
||||
assert(ok);
|
||||
|
||||
for(const auto v : vertices(fg))
|
||||
for(auto v : vertices(fg))
|
||||
assert(get(vnm, v) != CGAL::NULL_VECTOR);
|
||||
|
||||
// write with OFF
|
||||
|
|
@ -240,7 +240,7 @@ void test_bgl_OFF(const char* filename)
|
|||
assert(ok);
|
||||
assert(are_equal_meshes(fg, fg2));
|
||||
|
||||
for(const auto v : vertices(fg2))
|
||||
for(auto v : vertices(fg2))
|
||||
assert(get(vnm2, v) != CGAL::NULL_VECTOR);
|
||||
}
|
||||
|
||||
|
|
@ -256,7 +256,7 @@ void test_bgl_OFF(const char* filename)
|
|||
assert(ok);
|
||||
assert(are_equal_meshes(fg, fg2));
|
||||
|
||||
for(const auto v : vertices(fg2))
|
||||
for(auto v : vertices(fg2))
|
||||
assert(get(vnm2, v) != CGAL::NULL_VECTOR);
|
||||
}
|
||||
}
|
||||
|
|
@ -278,13 +278,13 @@ void test_bgl_OFF(const char* filename)
|
|||
assert(ok);
|
||||
assert(num_vertices(fg) != 0 && num_faces(fg) != 0);
|
||||
|
||||
for(const auto v : vertices(fg))
|
||||
for(auto v : vertices(fg))
|
||||
{
|
||||
assert(get(vnm2, v) != CGAL::NULL_VECTOR);
|
||||
assert(get(vcm2, v) != CGAL::Color());
|
||||
}
|
||||
|
||||
for(const auto f : faces(fg))
|
||||
for(auto f : faces(fg))
|
||||
assert(get(fcm2, f) != CGAL::Color());
|
||||
fg.clear();
|
||||
is.close();
|
||||
|
|
@ -301,7 +301,7 @@ void test_bgl_OFF(const char* filename)
|
|||
assert(ok);
|
||||
assert(num_vertices(fg) != 0 && num_faces(fg) != 0);
|
||||
|
||||
for(const auto v : vertices(fg))
|
||||
for(auto v : vertices(fg))
|
||||
{
|
||||
assert(get(vnm, v) != CGAL::NULL_VECTOR);
|
||||
assert(get(vcm, v) != CGAL::Color());
|
||||
|
|
@ -328,13 +328,13 @@ void test_bgl_OFF(const char* filename)
|
|||
assert(ok);
|
||||
assert(are_equal_meshes(fg, fg2));
|
||||
|
||||
for(const auto v : vertices(fg2))
|
||||
for(auto v : vertices(fg2))
|
||||
{
|
||||
assert(get(vnm2, v) != CGAL::NULL_VECTOR);
|
||||
assert(get(vcm2, v) != CGAL::Color());
|
||||
}
|
||||
|
||||
for(const auto f : faces(fg2))
|
||||
for(auto f : faces(fg2))
|
||||
assert(get(fcm2, f) != CGAL::Color());
|
||||
}
|
||||
|
||||
|
|
@ -359,13 +359,13 @@ void test_bgl_OFF(const char* filename)
|
|||
assert(ok);
|
||||
assert(are_equal_meshes(fg, fg2));
|
||||
|
||||
for(const auto v : vertices(fg2))
|
||||
for(auto v : vertices(fg2))
|
||||
{
|
||||
assert(get(vnm2, v) != CGAL::NULL_VECTOR);
|
||||
assert(get(vcm2, v) != CGAL::Color());
|
||||
}
|
||||
|
||||
for(const auto f : faces(fg2))
|
||||
for(auto f : faces(fg2))
|
||||
assert(get(fcm2, f) != CGAL::Color());
|
||||
}
|
||||
}
|
||||
|
|
@ -526,12 +526,12 @@ void test_bgl_PLY(const std::string filename,
|
|||
assert(ok);
|
||||
assert(num_vertices(fg) == 4 && num_faces(fg) == 4);
|
||||
|
||||
for(const auto v : vertices(fg))
|
||||
for(auto v : vertices(fg))
|
||||
{
|
||||
assert(get(vcm, v) != CGAL::Color());
|
||||
}
|
||||
|
||||
for(const auto f : faces(fg))
|
||||
for(auto f : faces(fg))
|
||||
assert(get(fcm, f) != CGAL::Color());
|
||||
|
||||
// write with PLY
|
||||
|
|
@ -561,10 +561,10 @@ void test_bgl_PLY(const std::string filename,
|
|||
assert(are_equal_meshes(fg, fg2));
|
||||
|
||||
// @tmp
|
||||
// for(const auto v : vertices(fg2))
|
||||
// for(auto v : vertices(fg2))
|
||||
// assert(get(vcm2, v) != CGAL::Color());
|
||||
|
||||
// for(const auto f : faces(fg2))
|
||||
// for(auto f : faces(fg2))
|
||||
// assert(get(fcm2, f) != CGAL::Color());
|
||||
}
|
||||
|
||||
|
|
@ -586,10 +586,10 @@ void test_bgl_PLY(const std::string filename,
|
|||
assert(are_equal_meshes(fg, fg2));
|
||||
|
||||
// @tmp
|
||||
// for(const auto v : vertices(fg2))
|
||||
// for(auto v : vertices(fg2))
|
||||
// assert(get(vcm2, v) != CGAL::Color());
|
||||
|
||||
// for(const auto f : faces(fg2))
|
||||
// for(auto f : faces(fg2))
|
||||
// assert(get(fcm2, f) != CGAL::Color());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -63,6 +63,7 @@ void test(const NamedParameters& np)
|
|||
assert(get_parameter(np, CGAL::internal_np::vertex_incident_patches).v == 11);
|
||||
assert(get_parameter(np, CGAL::internal_np::density_control_factor).v == 12);
|
||||
assert(get_parameter(np, CGAL::internal_np::use_delaunay_triangulation).v == 13);
|
||||
assert(get_parameter(np, CGAL::internal_np::use_2d_constrained_delaunay_triangulation).v == 4573);
|
||||
assert(get_parameter(np, CGAL::internal_np::fairing_continuity).v == 14);
|
||||
assert(get_parameter(np, CGAL::internal_np::sparse_linear_solver).v == 15);
|
||||
assert(get_parameter(np, CGAL::internal_np::number_of_relaxation_steps).v == 16);
|
||||
|
|
@ -106,6 +107,8 @@ void test(const NamedParameters& np)
|
|||
assert(get_parameter(np, CGAL::internal_np::allow_self_intersections).v == 66);
|
||||
assert(get_parameter(np, CGAL::internal_np::polyhedral_envelope_epsilon).v == 67);
|
||||
assert(get_parameter(np, CGAL::internal_np::maximum_number_of_faces).v == 78910);
|
||||
assert(get_parameter(np, CGAL::internal_np::non_manifold_feature_map).v == 60);
|
||||
assert(get_parameter(np, CGAL::internal_np::filter).v == 61);
|
||||
|
||||
// Named parameters that we use in the package 'Surface Mesh Simplification'
|
||||
assert(get_parameter(np, CGAL::internal_np::get_cost_policy).v == 34);
|
||||
|
|
@ -163,6 +166,7 @@ void test(const NamedParameters& np)
|
|||
check_same_type<11>(get_parameter(np, CGAL::internal_np::vertex_incident_patches));
|
||||
check_same_type<12>(get_parameter(np, CGAL::internal_np::density_control_factor));
|
||||
check_same_type<13>(get_parameter(np, CGAL::internal_np::use_delaunay_triangulation));
|
||||
check_same_type<4573>(get_parameter(np, CGAL::internal_np::use_2d_constrained_delaunay_triangulation));
|
||||
check_same_type<14>(get_parameter(np, CGAL::internal_np::fairing_continuity));
|
||||
check_same_type<15>(get_parameter(np, CGAL::internal_np::sparse_linear_solver));
|
||||
check_same_type<16>(get_parameter(np, CGAL::internal_np::number_of_relaxation_steps));
|
||||
|
|
@ -219,6 +223,8 @@ void test(const NamedParameters& np)
|
|||
check_same_type<62>(get_parameter(np, CGAL::internal_np::halfedges_keeper));
|
||||
check_same_type<64>(get_parameter(np, CGAL::internal_np::do_simplify_border));
|
||||
check_same_type<78910>(get_parameter(np, CGAL::internal_np::maximum_number_of_faces));
|
||||
check_same_type<60>(get_parameter(np, CGAL::internal_np::non_manifold_feature_map));
|
||||
check_same_type<61>(get_parameter(np, CGAL::internal_np::filter));
|
||||
|
||||
// Named parameters that we use in the package 'Surface Mesh Simplification'
|
||||
check_same_type<34>(get_parameter(np, CGAL::internal_np::get_cost_policy));
|
||||
|
|
@ -310,6 +316,7 @@ int main()
|
|||
.vertex_incident_patches_map(A<11>(11))
|
||||
.density_control_factor(A<12>(12))
|
||||
.use_delaunay_triangulation(A<13>(13))
|
||||
.use_2d_constrained_delaunay_triangulation(A<4573>(4573))
|
||||
.fairing_continuity(A<14>(14))
|
||||
.sparse_linear_solver(A<15>(15))
|
||||
.number_of_relaxation_steps(A<16>(16))
|
||||
|
|
@ -344,6 +351,8 @@ int main()
|
|||
.throw_on_self_intersection(A<43>(43))
|
||||
.clip_volume(A<44>(44))
|
||||
.use_compact_clipper(A<45>(45))
|
||||
.non_manifold_feature_map(A<60>(60))
|
||||
.filter(A<61>(61))
|
||||
.apply_per_connected_component(A<46>(46))
|
||||
.output_iterator(A<47>(47))
|
||||
.erase_all_duplicates(A<48>(48))
|
||||
|
|
|
|||
|
|
@ -0,0 +1,58 @@
|
|||
#include <CGAL/internal/disable_deprecation_warnings_and_errors.h>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <CGAL/Surface_mesh.h>
|
||||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/boost/graph/generators.h>
|
||||
|
||||
#include <CGAL/boost/graph/IO/OFF.h>
|
||||
#include <CGAL/boost/graph/IO/VTK.h>
|
||||
#include <CGAL/boost/graph/IO/WRL.h>
|
||||
|
||||
|
||||
typedef CGAL::Simple_cartesian<double> Kernel;
|
||||
typedef Kernel::Point_3 Point_3;
|
||||
typedef CGAL::Surface_mesh<Point_3> SM;
|
||||
|
||||
int main()
|
||||
{
|
||||
// OFF
|
||||
SM sm_in, sm_out;
|
||||
Point_3 p0(0,0,0), p1(1,0,0), p2(0,1,0);
|
||||
CGAL::make_triangle(p0, p1, p2, sm_out);
|
||||
bool ok = CGAL::write_off("tmp.off", sm_out);
|
||||
assert(ok);
|
||||
ok = CGAL::read_off("tmp.off", sm_in);
|
||||
assert(ok);
|
||||
assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1);
|
||||
sm_in.clear();
|
||||
|
||||
std::ofstream os("tmp.off");
|
||||
ok = CGAL::write_off(os, sm_out);
|
||||
assert(ok);
|
||||
os.close();
|
||||
std::ifstream is("tmp.off");
|
||||
ok = CGAL::read_off(is, sm_in);
|
||||
assert(ok);
|
||||
assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1);
|
||||
is.close();
|
||||
sm_in.clear();
|
||||
#ifdef CGAL_USE_VTK
|
||||
//vtk
|
||||
os.open("tmp.vtp");
|
||||
ok = CGAL::write_vtp(os, sm_out);
|
||||
assert(ok);
|
||||
os.close();
|
||||
|
||||
ok = CGAL::read_VTP("tmp.vtp", sm_in);
|
||||
assert(ok);
|
||||
assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1);
|
||||
sm_in.clear();
|
||||
#endif
|
||||
//wrl
|
||||
os.open("tmp.wrl");
|
||||
ok = CGAL::write_wrl(os, sm_out);
|
||||
assert(ok);
|
||||
os.close();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,45 @@
|
|||
/*! \file oriented_side.cpp
|
||||
* Compute the oriented side of a point and a polygon with holes.
|
||||
*/
|
||||
|
||||
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
|
||||
#include <CGAL/Boolean_set_operations_2.h>
|
||||
|
||||
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
|
||||
typedef Kernel::Point_2 Point_2;
|
||||
typedef CGAL::Polygon_2<Kernel> Polygon_2;
|
||||
typedef CGAL::Polygon_with_holes_2<Kernel> Polygon_with_holes_2;
|
||||
|
||||
# define nice(os) ((os == CGAL::ON_ORIENTED_BOUNDARY) ? "on boundary" : \
|
||||
(os == CGAL::POSITIVE) ? "inside" : "outside")
|
||||
|
||||
int main() {
|
||||
Polygon_2 hole;
|
||||
hole.push_back(Point_2(1, 1));
|
||||
hole.push_back(Point_2(1, 2));
|
||||
hole.push_back(Point_2(2, 2));
|
||||
hole.push_back(Point_2(2, 1));
|
||||
|
||||
Polygon_2 out;
|
||||
out.push_back(Point_2(0, 0));
|
||||
out.push_back(Point_2(3, 0));
|
||||
out.push_back(Point_2(3, 3));
|
||||
out.push_back(Point_2(0, 3));
|
||||
|
||||
Polygon_with_holes_2 pwh(out, &hole, &hole+1);
|
||||
std::cout << pwh << std::endl;
|
||||
|
||||
auto os = CGAL::oriented_side(Point_2(0, 0), pwh);
|
||||
std::cout << "(0,0) is : " << nice(os) << std::endl;
|
||||
os = CGAL::oriented_side(Point_2(0.5, 0.5), pwh);
|
||||
std::cout << "(0,0) is : " << nice(os) << std::endl;
|
||||
os = CGAL::oriented_side(Point_2(1, 1), pwh);
|
||||
std::cout << "(0,0) is : " << nice(os) << std::endl;
|
||||
os = CGAL::oriented_side(Point_2(2.5, 2.5), pwh);
|
||||
std::cout << "(0,0) is : " << nice(os) << std::endl;
|
||||
os = CGAL::oriented_side(Point_2(3, 3), pwh);
|
||||
std::cout << "(0,0) is : " << nice(os) << std::endl;
|
||||
os = CGAL::oriented_side(Point_2(3.5, 3.5), pwh);
|
||||
std::cout << "(0,0) is : " << nice(os) << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -809,7 +809,7 @@ OutputIterator complement (const Polygon_with_holes_2<Kernel, Container>& pgn,
|
|||
}
|
||||
|
||||
template <class Arr_traits, typename OutputIterator, class Traits>
|
||||
OutputIterator complement (const General_polygon_with_holes_2<Arr_traits>& pgn,
|
||||
OutputIterator complement (const General_polygon_with_holes_2<General_polygon_2<Arr_traits> >& pgn,
|
||||
OutputIterator oi, Traits& tr)
|
||||
{
|
||||
General_polygon_set_2<Traits> gps(tr);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ find_package(CGAL REQUIRED)
|
|||
|
||||
# Use Eigen
|
||||
find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater)
|
||||
include(CGAL_Eigen_support)
|
||||
include(CGAL_Eigen3_support)
|
||||
|
||||
# create a target per cppfile
|
||||
file(
|
||||
|
|
@ -13,11 +13,11 @@ file(
|
|||
RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
|
||||
foreach(cppfile ${cppfiles})
|
||||
if(NOT (${cppfile} STREQUAL "ellipsoid.cpp") OR TARGET CGAL::Eigen_support)
|
||||
if(NOT (${cppfile} STREQUAL "ellipsoid.cpp") OR TARGET CGAL::Eigen3_support)
|
||||
get_filename_component(target ${cppfile} NAME_WE)
|
||||
create_single_source_cgal_program(${cppfile})
|
||||
if(TARGET CGAL::Eigen_support)
|
||||
target_link_libraries(${target} PRIVATE CGAL::CGAL CGAL::Eigen_support)
|
||||
if(TARGET CGAL::Eigen3_support)
|
||||
target_link_libraries(${target} PRIVATE CGAL::CGAL CGAL::Eigen3_support)
|
||||
else()
|
||||
target_link_libraries(${target} PRIVATE CGAL::CGAL)
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -32,9 +32,10 @@
|
|||
#include <CGAL/QP_solver/QP_full_exact_pricing.h>
|
||||
#include <CGAL/boost/iterator/counting_iterator.hpp>
|
||||
#include <CGAL/boost/iterator/transform_iterator.hpp>
|
||||
#include <boost/functional.hpp>
|
||||
#include <CGAL/NT_converter.h>
|
||||
|
||||
#include <functional>
|
||||
|
||||
// here is how it works. We have d+2 variables:
|
||||
// R (big radius), r (small radius), c (center). The problem is
|
||||
//
|
||||
|
|
@ -258,9 +259,6 @@ private:
|
|||
typedef QP_access_by_index
|
||||
<typename std::vector<Point>::const_iterator, int> Point_by_index;
|
||||
|
||||
typedef boost::binder2nd< std::divides<int> >
|
||||
Divide;
|
||||
|
||||
typedef std::vector<int> Index_vector;
|
||||
|
||||
typedef std::vector<NT> NT_vector;
|
||||
|
|
@ -272,7 +270,7 @@ public:
|
|||
|
||||
typedef CGAL::Join_input_iterator_1<
|
||||
Basic_variable_index_iterator,
|
||||
CGAL::Unary_compose_1<Point_by_index,Divide> >
|
||||
std::function<Point(int)> >
|
||||
Support_point_iterator;
|
||||
|
||||
|
||||
|
|
@ -331,9 +329,7 @@ public:
|
|||
"support_points_begin: not enough points");
|
||||
return Support_point_iterator(
|
||||
solver->basic_original_variable_indices_begin(),
|
||||
CGAL::compose1_1(
|
||||
Point_by_index( points.begin()),
|
||||
boost::bind2nd( std::divides<int>(), 2)));
|
||||
[this](int i){ return Point_by_index(this->points.begin())(i/2); });
|
||||
}
|
||||
|
||||
Support_point_iterator
|
||||
|
|
@ -342,9 +338,7 @@ public:
|
|||
"support_points_begin: not enough points");
|
||||
return Support_point_iterator(
|
||||
solver->basic_original_variable_indices_end(),
|
||||
CGAL::compose1_1(
|
||||
Point_by_index( points.begin()),
|
||||
boost::bind2nd( std::divides<int>(), 2)));
|
||||
[this](int i){ return Point_by_index(this->points.begin())(i/2); });
|
||||
}
|
||||
|
||||
int number_of_inner_support_points() const { return static_cast<int>(inner_indices.size());}
|
||||
|
|
@ -592,9 +586,7 @@ private:
|
|||
bool
|
||||
check_dimension( std::size_t offset = 0)
|
||||
{ return ( std::find_if( points.begin()+offset, points.end(),
|
||||
CGAL::compose1_1( boost::bind2nd(
|
||||
std::not_equal_to<int>(), d),
|
||||
tco.access_dimension_d_object()))
|
||||
[this](const Point& p){ return this->d != this->tco.access_dimension_d_object()(p); })
|
||||
== points.end()); }
|
||||
|
||||
// compute smallest enclosing annulus
|
||||
|
|
|
|||
|
|
@ -290,8 +290,8 @@ bounding_box_2(ForwardIterator f, ForwardIterator l, const Traits& t)
|
|||
return rect(v(rect(*xmin, *ymin), 0), v(rect(*xmax, *ymax), 2));
|
||||
} // bounding_box_2(f, l, t)
|
||||
template < class ForwardIterator >
|
||||
inline typename
|
||||
std::iterator_traits< ForwardIterator >::value_type::R::Iso_rectangle_2
|
||||
inline
|
||||
auto
|
||||
bounding_box_2(ForwardIterator f, ForwardIterator l)
|
||||
// PRE: f != l.
|
||||
{
|
||||
|
|
|
|||
|
|
@ -20,8 +20,7 @@
|
|||
#include <CGAL/basic.h>
|
||||
#include <CGAL/Optimisation/assertions.h>
|
||||
#include <iterator>
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/function.hpp>
|
||||
#include <functional>
|
||||
|
||||
#ifdef CGAL_OPTIMISATION_EXPENSIVE_PRECONDITION_TAG
|
||||
#include <CGAL/Polygon_2_algorithms.h>
|
||||
|
|
@ -70,13 +69,16 @@ convex_bounding_box_2(
|
|||
typedef typename Traits::Point_2 Point_2;
|
||||
typedef typename Traits::Less_xy_2 Less_xy_2;
|
||||
typedef typename Traits::Less_yx_2 Less_yx_2;
|
||||
typedef boost::function2<bool,Point_2,Point_2> Greater_xy_2;
|
||||
typedef boost::function2<bool,Point_2,Point_2> Greater_yx_2;
|
||||
typedef std::function<bool(const Point_2&,
|
||||
const Point_2&)> Greater_xy_2;
|
||||
typedef Greater_xy_2 Greater_yx_2;
|
||||
|
||||
Less_xy_2 less_xy_2 = t.less_xy_2_object();
|
||||
Less_yx_2 less_yx_2 = t.less_yx_2_object();
|
||||
Greater_xy_2 greater_xy_2 = boost::bind(less_xy_2, _2, _1);
|
||||
Greater_yx_2 greater_yx_2 = boost::bind(less_yx_2, _2, _1);
|
||||
Greater_xy_2 greater_xy_2 = [&less_xy_2](const Point_2& p1, const Point_2& p2)
|
||||
{ return less_xy_2(p2, p1); };
|
||||
Greater_yx_2 greater_yx_2 = [&less_yx_2](const Point_2& p1, const Point_2& p2)
|
||||
{ return less_yx_2(p2, p1); };
|
||||
|
||||
if (less_xy_2(*minx, *f) ||
|
||||
(less_yx_2(*minx, *f) && !less_xy_2(*f, *minx)))
|
||||
|
|
@ -268,21 +270,21 @@ namespace Optimisation {
|
|||
// ---------------------------------------------------------------
|
||||
// Right_of_implicit_line_2
|
||||
// ---------------------------------------------------------------
|
||||
typedef boost::function3<bool,Point_2,Point_2,Direction_2>
|
||||
typedef std::function<bool(const Point_2&, const Point_2& , const Direction_2&)>
|
||||
Right_of_implicit_line_2;
|
||||
|
||||
Right_of_implicit_line_2 right_of_implicit_line_2_object() const {
|
||||
return boost::bind(has_on_negative_side_2_object(),
|
||||
boost::bind(construct_line_2_object(), _2, _3),
|
||||
_1);
|
||||
return [this](const Point_2& p1, const Point_2& p2, const Direction_2& d)
|
||||
{ return this->has_on_negative_side_2_object()(this->construct_line_2_object()(p2, d), p1); };
|
||||
}
|
||||
|
||||
typedef boost::function2<Direction_2,Point_2,Point_2>
|
||||
typedef std::function<Direction_2(const Point_2&, const Point_2&)>
|
||||
Construct_direction_2;
|
||||
|
||||
Construct_direction_2 construct_direction_2_object() const {
|
||||
return boost::bind(Base::construct_direction_2_object(),
|
||||
boost::bind(construct_vector_2_object(), _1, _2));
|
||||
return [this](const Point_2& p1, const Point_2& p2)
|
||||
{ return this->Base::construct_direction_2_object()(
|
||||
this->construct_vector_2_object()(p1, p2)); };
|
||||
}
|
||||
|
||||
template < class Kernel >
|
||||
|
|
@ -324,13 +326,11 @@ namespace Optimisation {
|
|||
rotate_direction_by_multiple_of_pi_2_object() const
|
||||
{ return Rotate_direction_by_multiple_of_pi_2(*this); }
|
||||
|
||||
typedef boost::function2<bool,Direction_2,Direction_2>
|
||||
typedef std::function<bool(const Direction_2&, const Direction_2&)>
|
||||
Less_angle_with_x_axis_2;
|
||||
Less_angle_with_x_axis_2 less_angle_with_x_axis_2_object() const {
|
||||
return boost::bind(std::equal_to<Comparison_result>(),
|
||||
boost::bind(compare_angle_with_x_axis_2_object(),
|
||||
_1, _2),
|
||||
SMALLER);
|
||||
return [this](const Direction_2& d1, const Direction_2& d2)
|
||||
{ return this->compare_angle_with_x_axis_2_object()(d1, d2) == SMALLER; };
|
||||
}
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@
|
|||
#include <algorithm>
|
||||
#include <iterator>
|
||||
#include <vector>
|
||||
#include <boost/bind.hpp>
|
||||
|
||||
#if defined(BOOST_MSVC)
|
||||
# pragma warning(push)
|
||||
|
|
@ -235,14 +234,16 @@ struct Staircases : public Loc_domain< Traits_ > {
|
|||
do {
|
||||
brstc.push_back(*i++);
|
||||
i = find_if(i, ysort.end(),
|
||||
boost::bind(this->traits.less_x_2_object(), brstc.back(), _1));
|
||||
[this](const Point_2& p)
|
||||
{ return this->traits.less_x_2_object()(this->brstc.back(), p);});
|
||||
} while (i != ysort.end());
|
||||
// top-left
|
||||
Riterator j = ysort.rbegin();
|
||||
do {
|
||||
tlstc.push_back(*j++);
|
||||
j = find_if(j, ysort.rend(),
|
||||
boost::bind(this->traits.less_x_2_object(), _1, tlstc.back()));
|
||||
[this](const Point_2& p)
|
||||
{ return this->traits.less_x_2_object()(p, this->tlstc.back());});
|
||||
} while (j != ysort.rend());
|
||||
|
||||
// build left-bottom and right-top staircases
|
||||
|
|
@ -252,14 +253,16 @@ struct Staircases : public Loc_domain< Traits_ > {
|
|||
do {
|
||||
lbstc.push_back(*i++);
|
||||
i = find_if(i, xsort.end(),
|
||||
boost::bind(this->traits.less_y_2_object(), _1, lbstc.back()));
|
||||
[this](const Point_2& p)
|
||||
{ return this->traits.less_y_2_object()(p, this->lbstc.back());});
|
||||
} while (i != xsort.end());
|
||||
// right-top
|
||||
j = xsort.rbegin();
|
||||
do {
|
||||
rtstc.push_back(*j++);
|
||||
j = find_if(j, xsort.rend(),
|
||||
boost::bind(this->traits.less_y_2_object(), rtstc.back(), _1));
|
||||
[this](const Point_2& p)
|
||||
{ return this->traits.less_y_2_object()(this->rtstc.back(), p);});
|
||||
} while (j != xsort.rend());
|
||||
} // Staircases(b, e, t)
|
||||
|
||||
|
|
@ -300,16 +303,20 @@ struct Staircases : public Loc_domain< Traits_ > {
|
|||
min_element_if(
|
||||
this->pts.begin(), this->pts.end(),
|
||||
this->traits.less_x_2_object(),
|
||||
boost::bind(std::logical_and< bool >(),
|
||||
boost::bind(this->traits.less_x_2_object(), p, _1),
|
||||
boost::bind(this->traits.less_y_2_object(), p, _1)));
|
||||
[&p, this](const Point_2& pt)
|
||||
{
|
||||
return this->traits.less_x_2_object()(p, pt) &&
|
||||
this->traits.less_y_2_object()(p, pt);
|
||||
});
|
||||
Citerator j =
|
||||
max_element_if(
|
||||
this->pts.begin(), this->pts.end(),
|
||||
this->traits.less_x_2_object(),
|
||||
boost::bind(std::logical_and< bool >(),
|
||||
boost::bind(this->traits.less_x_2_object(), _1, q),
|
||||
boost::bind(this->traits.less_y_2_object(), q, _1)));
|
||||
[&q, this](const Point_2& pt)
|
||||
{
|
||||
return this->traits.less_x_2_object()(pt, q) &&
|
||||
this->traits.less_y_2_object()(q, pt);
|
||||
});
|
||||
return Intervall(i == this->pts.end() ? this->maxx : *i,
|
||||
j == this->pts.end() ? this->minx : *j);
|
||||
} // top_intervall()
|
||||
|
|
@ -326,16 +333,20 @@ struct Staircases : public Loc_domain< Traits_ > {
|
|||
min_element_if(
|
||||
this->pts.begin(), this->pts.end(),
|
||||
this->traits.less_x_2_object(),
|
||||
boost::bind(std::logical_and< bool >(),
|
||||
boost::bind(this->traits.less_x_2_object(), p, _1),
|
||||
boost::bind(this->traits.less_y_2_object(), _1, p)));
|
||||
[&p, this](const Point_2& pt)
|
||||
{
|
||||
return this->traits.less_x_2_object()(p, pt) &&
|
||||
this->traits.less_y_2_object()(pt, p);
|
||||
});
|
||||
Citerator j =
|
||||
max_element_if(
|
||||
this->pts.begin(), this->pts.end(),
|
||||
this->traits.less_x_2_object(),
|
||||
boost::bind(std::logical_and< bool >(),
|
||||
boost::bind(this->traits.less_x_2_object(), _1, q),
|
||||
boost::bind(this->traits.less_y_2_object(), _1, q)));
|
||||
[&q, this](const Point_2& pt)
|
||||
{
|
||||
return this->traits.less_x_2_object()(pt, q) &&
|
||||
this->traits.less_y_2_object()(pt, q);
|
||||
});
|
||||
return Intervall(i == this->pts.end() ? this->maxx : *i,
|
||||
j == this->pts.end() ? this->minx : *j);
|
||||
} // bottom_intervall()
|
||||
|
|
@ -352,16 +363,20 @@ struct Staircases : public Loc_domain< Traits_ > {
|
|||
min_element_if(
|
||||
this->pts.begin(), this->pts.end(),
|
||||
this->traits.less_y_2_object(),
|
||||
boost::bind(std::logical_and< bool >(),
|
||||
boost::bind(this->traits.less_x_2_object(), _1, p),
|
||||
boost::bind(this->traits.less_y_2_object(), p, _1)));
|
||||
[&p, this](const Point_2& pt)
|
||||
{
|
||||
return this->traits.less_x_2_object()(pt, p) &&
|
||||
this->traits.less_y_2_object()(p, pt);
|
||||
});
|
||||
Citerator j =
|
||||
max_element_if(
|
||||
this->pts.begin(), this->pts.end(),
|
||||
this->traits.less_y_2_object(),
|
||||
boost::bind(std::logical_and< bool >(),
|
||||
boost::bind(this->traits.less_x_2_object(), _1, q),
|
||||
boost::bind(this->traits.less_y_2_object(), _1, q)));
|
||||
[&q, this](const Point_2& pt)
|
||||
{
|
||||
return this->traits.less_x_2_object()(pt, q) &&
|
||||
this->traits.less_y_2_object()(pt, q);
|
||||
});
|
||||
return Intervall(i == this->pts.end() ? this->maxy : *i,
|
||||
j == this->pts.end() ? this->miny : *j);
|
||||
} // left_intervall()
|
||||
|
|
@ -378,16 +393,20 @@ struct Staircases : public Loc_domain< Traits_ > {
|
|||
min_element_if(
|
||||
this->pts.begin(), this->pts.end(),
|
||||
this->traits.less_y_2_object(),
|
||||
boost::bind(std::logical_and< bool >(),
|
||||
boost::bind(this->traits.less_x_2_object(), p, _1),
|
||||
boost::bind(this->traits.less_y_2_object(), p, _1)));
|
||||
[&p, this](const Point_2& pt)
|
||||
{
|
||||
return this->traits.less_x_2_object()(p, pt) &&
|
||||
this->traits.less_y_2_object()(p, pt);
|
||||
});
|
||||
Citerator j =
|
||||
max_element_if(
|
||||
this->pts.begin(), this->pts.end(),
|
||||
this->traits.less_y_2_object(),
|
||||
boost::bind(std::logical_and< bool >(),
|
||||
boost::bind(this->traits.less_x_2_object(), q, _1),
|
||||
boost::bind(this->traits.less_y_2_object(), _1, q)));
|
||||
[&q, this](const Point_2& pt)
|
||||
{
|
||||
return this->traits.less_x_2_object()(q, pt) &&
|
||||
this->traits.less_y_2_object()(pt, q);
|
||||
});
|
||||
return Intervall(i == this->pts.end() ? this->maxy : *i,
|
||||
j == this->pts.end() ? this->miny : *j);
|
||||
} // right_intervall()
|
||||
|
|
@ -487,6 +506,7 @@ two_cover_points(
|
|||
using std::less;
|
||||
|
||||
typedef typename Traits::FT FT;
|
||||
typedef typename Traits::Point_2 Point_2;
|
||||
typename Traits::Infinity_distance_2 dist =
|
||||
d.traits.infinity_distance_2_object();
|
||||
typename Traits::Signed_infinity_distance_2 sdist =
|
||||
|
|
@ -504,11 +524,8 @@ two_cover_points(
|
|||
if (d.end() ==
|
||||
find_if(d.begin(),
|
||||
d.end(),
|
||||
boost::bind(less<FT>(),
|
||||
d.r,
|
||||
boost::bind(Min<FT>(),
|
||||
boost::bind(dist, d[0], _1),
|
||||
boost::bind(dist, d[2], _1)))))
|
||||
[&dist,&d](const Point_2& p)
|
||||
{ return d.r < Min<FT>()(dist(d[0], p), dist(d[2],p)); }))
|
||||
{
|
||||
*o++ = d[0];
|
||||
*o++ = d[2];
|
||||
|
|
@ -520,11 +537,8 @@ two_cover_points(
|
|||
if (d.end() ==
|
||||
find_if(d.begin(),
|
||||
d.end(),
|
||||
boost::bind(less<FT>(),
|
||||
d.r,
|
||||
boost::bind(Min<FT>(),
|
||||
boost::bind(dist, d[1], _1),
|
||||
boost::bind(dist, d[3], _1)))))
|
||||
[&dist,&d](const Point_2& p)
|
||||
{ return d.r < Min<FT>()(dist(d[1], p), dist(d[3],p)); }))
|
||||
{
|
||||
*o++ = d[1];
|
||||
*o++ = d[3];
|
||||
|
|
@ -551,7 +565,6 @@ three_cover_points(
|
|||
CGAL_optimisation_precondition(!d.empty());
|
||||
|
||||
// typedefs:
|
||||
typedef typename Traits::FT FT;
|
||||
typedef typename Traits::Point_2 Point_2;
|
||||
typedef typename Loc_domain< Traits >::Iterator Iterator;
|
||||
typename Traits::Infinity_distance_2 dist =
|
||||
|
|
@ -565,7 +578,8 @@ three_cover_points(
|
|||
|
||||
// find first point not covered by the rectangle at d[k]
|
||||
Iterator i = find_if(d.begin(), d.end(),
|
||||
boost::bind(less<FT>(), d.r, boost::bind(dist, corner, _1)));
|
||||
[&d,&dist, &corner](const Point_2& p)
|
||||
{ return d.r < dist(corner, p); });
|
||||
|
||||
// are all points already covered?
|
||||
if (i == d.end()) {
|
||||
|
|
@ -608,12 +622,12 @@ three_cover_points(
|
|||
|
||||
CGAL_optimisation_expensive_assertion(
|
||||
save_end == find_if(d.end(), save_end,
|
||||
boost::bind(less<FT>(), d.r, boost::bind(dist, corner, _1))));
|
||||
[&d, &dist, &corner](const Point_2& p)
|
||||
{ return d.r < dist(corner, p); }));
|
||||
CGAL_optimisation_expensive_assertion(
|
||||
d.end() == find_if(d.begin(), d.end(),
|
||||
boost::bind(std::greater_equal<FT>(),
|
||||
d.r,
|
||||
boost::bind(dist, corner, _1))));
|
||||
[&d,&dist, &corner](const Point_2& p)
|
||||
{ return d.r >= dist(corner, p); }));
|
||||
|
||||
|
||||
two_cover_points(d, o, ok);
|
||||
|
|
@ -702,7 +716,8 @@ four_cover_points(Staircases< Traits >& d, OutputIterator o, bool& ok)
|
|||
|
||||
// find first point not covered by the rectangle at d[k]
|
||||
Iterator i = find_if(d.begin(), d.end(),
|
||||
boost::bind(less<FT>(), d.r, boost::bind(dist, corner, _1)));
|
||||
[&d,&dist,&corner](const Point_2& p)
|
||||
{ return d.r < dist(corner, p); });
|
||||
|
||||
// are all points already covered?
|
||||
if (i == d.end()) {
|
||||
|
|
@ -745,12 +760,12 @@ four_cover_points(Staircases< Traits >& d, OutputIterator o, bool& ok)
|
|||
|
||||
CGAL_optimisation_expensive_assertion(
|
||||
save_end == find_if(d.end(), save_end,
|
||||
boost::bind(less<FT>(), d.r, boost::bind(dist, corner, _1))));
|
||||
[&d,&dist,&corner](const Point_2& p)
|
||||
{ return d.r < dist(corner, p); }));
|
||||
CGAL_optimisation_expensive_assertion(
|
||||
d.end() == find_if(d.begin(), d.end(),
|
||||
boost::bind(std::greater_equal<FT>(),
|
||||
d.r,
|
||||
boost::bind(dist, corner, _1))));
|
||||
[&d,&dist,&corner](const Point_2& p)
|
||||
{ return d.r >= dist(corner, p); }));
|
||||
|
||||
|
||||
three_cover_points(d, o, ok);
|
||||
|
|
|
|||
|
|
@ -22,8 +22,6 @@
|
|||
#include <CGAL/Rectangular_p_center_traits_2.h>
|
||||
#include <algorithm>
|
||||
#include <vector>
|
||||
#include <boost/bind.hpp>
|
||||
#include <boost/function.hpp>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
@ -38,8 +36,6 @@ rectangular_2_center_2(
|
|||
Traits& t)
|
||||
{
|
||||
using std::pair;
|
||||
using std::greater;
|
||||
using std::less;
|
||||
|
||||
typedef typename Traits::Iso_rectangle_2 Rectangle;
|
||||
typedef typename Traits::Point_2 Point;
|
||||
|
|
@ -53,7 +49,6 @@ rectangular_2_center_2(
|
|||
P_below_right;
|
||||
typedef typename Traits::Construct_point_2_below_left_implicit_point_2
|
||||
P_below_left;
|
||||
typedef boost::function1<FT, Point> Gamma;
|
||||
|
||||
// fetch function objects from traits class
|
||||
CVertex v = t.construct_vertex_2_object();
|
||||
|
|
@ -72,15 +67,15 @@ rectangular_2_center_2(
|
|||
|
||||
// two cases: top-left & bottom-right or top-right & bottom-left
|
||||
Min< FT > minft;
|
||||
Gamma gamma1 =
|
||||
boost::bind(minft, boost::bind(dist, v(bb, 0), _1), boost::bind(dist, v(bb, 2), _1));
|
||||
Gamma gamma2 =
|
||||
boost::bind(minft, boost::bind(dist, v(bb, 1), _1), boost::bind(dist, v(bb, 3), _1));
|
||||
auto gamma1 =
|
||||
[&minft, &bb, &dist, &v](const Point& p){ return minft(dist( v(bb, 0), p), dist(v(bb, 2),p));};
|
||||
auto gamma2 =
|
||||
[&minft, &bb, &dist, &v](const Point& p){ return minft(dist( v(bb, 1), p), dist(v(bb, 3),p));};
|
||||
|
||||
pair< ForwardIterator, ForwardIterator > cand =
|
||||
min_max_element(f, l,
|
||||
boost::bind(greater<FT>(), boost::bind(gamma1, _1), boost::bind(gamma1, _2)),
|
||||
boost::bind(less<FT>(), boost::bind(gamma2, _1), boost::bind(gamma2, _2)));
|
||||
[&gamma1](const Point& p1, const Point& p2){ return std::greater<FT>()(gamma1(p1), gamma1(p2)); },
|
||||
[&gamma2](const Point& p1, const Point& p2){ return std::less<FT>()(gamma2(p1), gamma2(p2)); });
|
||||
|
||||
// return the result
|
||||
if (gamma1(*cand.first) < gamma2(*cand.second)) {
|
||||
|
|
@ -106,9 +101,6 @@ rectangular_3_center_2_type1(
|
|||
typename Traits::FT& rad,
|
||||
Traits& t)
|
||||
{
|
||||
using std::max;
|
||||
using std::less;
|
||||
|
||||
typedef typename Traits::FT FT;
|
||||
typedef typename Traits::Iso_rectangle_2 Rectangle;
|
||||
typedef typename Traits::Point_2 Point;
|
||||
|
|
@ -124,7 +116,6 @@ rectangular_3_center_2_type1(
|
|||
P_below_right;
|
||||
typedef typename Traits::Construct_point_2_below_left_implicit_point_2
|
||||
P_below_left;
|
||||
typedef boost::function1<FT, Point> Gamma;
|
||||
|
||||
// fetch function objects from traits class
|
||||
Rect rect = t.construct_iso_rectangle_2_object();
|
||||
|
|
@ -158,14 +149,14 @@ rectangular_3_center_2_type1(
|
|||
RandomAccessIterator e = l;
|
||||
bool b_empty = true;
|
||||
Min< FT > minft;
|
||||
Gamma gamma = boost::bind(minft,
|
||||
boost::bind(dist, v(r, i), _1),
|
||||
boost::bind(dist, v(r, 2 + i), _1));
|
||||
auto gamma = [&minft, &dist, &v, &r, i](const Point& p)
|
||||
{ return minft(dist(v(r, i), p), dist(v(r, 2 + i), p)); };
|
||||
|
||||
while (e - s > 1) {
|
||||
// step (a)
|
||||
RandomAccessIterator m = s + (e - s - 1) / 2;
|
||||
std::nth_element(s, m, e, boost::bind(less<FT>(), boost::bind(gamma, _1), boost::bind(gamma, _2)));
|
||||
std::nth_element(s, m, e, [&gamma](const Point& p1, const Point& p2)
|
||||
{return gamma(p1) < gamma(p2);});
|
||||
|
||||
// step (b)
|
||||
Rectangle b_prime = bounding_box_2(m + 1, e, t);
|
||||
|
|
@ -220,8 +211,9 @@ struct Rectangular_3_center_2_type2_operations_base {
|
|||
typedef typename R::Infinity_distance_2 Infinity_distance_2;
|
||||
typedef typename R::Less_x_2 Less_x_2;
|
||||
typedef typename R::Less_y_2 Less_y_2;
|
||||
typedef boost::function2<bool,Point_2,Point_2> Greater_x_2;
|
||||
typedef boost::function2<bool,Point_2,Point_2> Greater_y_2;
|
||||
typedef std::function<bool(const Point_2& ,
|
||||
const Point_2&)> Greater_x_2;
|
||||
typedef Greater_x_2 Greater_y_2;
|
||||
typedef Min< Point_2, Less_x_2 > Min_x_2;
|
||||
typedef Max< Point_2, Less_x_2 > Max_x_2;
|
||||
typedef Min< Point_2, Less_y_2 > Min_y_2;
|
||||
|
|
@ -236,15 +228,15 @@ struct Rectangular_3_center_2_type2_operations_base {
|
|||
Construct_point_2_below_right_implicit_point_2;
|
||||
typedef typename R::Construct_point_2_below_left_implicit_point_2
|
||||
Construct_point_2_below_left_implicit_point_2;
|
||||
typedef boost::function1<FT,Point_2> Delta;
|
||||
typedef std::function<FT(const Point_2&)> Delta;
|
||||
|
||||
Delta delta() const { return delta_; }
|
||||
Less_x_2 less_x_2_object() const { return r_.less_x_2_object(); }
|
||||
Less_y_2 less_y_2_object() const { return r_.less_y_2_object(); }
|
||||
Greater_x_2 greater_x_2_object() const
|
||||
{ return boost::bind(less_x_2_object(),_2,_1); }
|
||||
{ return [this](const Point_2& p1, const Point_2& p2){ return this->less_x_2_object()(p2, p1); }; }
|
||||
Greater_y_2 greater_y_2_object() const
|
||||
{ return boost::bind(less_y_2_object(),_2,_1); }
|
||||
{ return [this](const Point_2& p1, const Point_2& p2){ return this->less_y_2_object()(p2, p1); }; }
|
||||
Infinity_distance_2 distance() const
|
||||
{ return r_.infinity_distance_2_object(); }
|
||||
Construct_vertex_2 construct_vertex_2_object() const
|
||||
|
|
@ -277,7 +269,7 @@ struct Rectangular_3_center_2_type2_operations_base {
|
|||
public:
|
||||
|
||||
Rectangular_3_center_2_type2_operations_base(R& r, const Point_2& p)
|
||||
: r_(r), delta_(boost::bind(r.infinity_distance_2_object(), p, _1))
|
||||
: r_(r), delta_([&r, &p](const Point_2& q){ return r.infinity_distance_2_object()(p, q); })
|
||||
{}
|
||||
|
||||
};
|
||||
|
|
@ -846,10 +838,6 @@ rectangular_3_center_2_type2(
|
|||
Operations op)
|
||||
{
|
||||
BOOST_USING_STD_MAX();
|
||||
using std::less;
|
||||
using std::greater;
|
||||
using std::greater_equal;
|
||||
using std::not_equal_to;
|
||||
using std::logical_and;
|
||||
using std::max_element;
|
||||
using std::find_if;
|
||||
|
|
@ -894,7 +882,7 @@ rectangular_3_center_2_type2(
|
|||
{
|
||||
// First try whether the best radius so far can be reached at all
|
||||
RandomAccessIterator m =
|
||||
partition(f, l, boost::bind(greater< FT >(), rad, boost::bind(op.delta(), _1)));
|
||||
partition(f, l, [&rad, &op](const Point& p){ return rad > op.delta()(p); });
|
||||
IP pos = min_max_element(m, l, op.compare_x(), op.compare_y());
|
||||
// extreme points of the two other squares
|
||||
Point q_t =
|
||||
|
|
@ -905,11 +893,11 @@ rectangular_3_center_2_type2(
|
|||
op.place_y_square(op.place_y_square(Q_r_empty, Q_r, *pos.second, r),
|
||||
r,
|
||||
rad);
|
||||
boost::function1<bool,FT> le_rad = boost::bind(greater_equal<FT>(), rad, _1);
|
||||
auto le_rad = [&rad](const FT& v){return rad >= v;};
|
||||
RandomAccessIterator b1 =
|
||||
partition(m, l, boost::bind(le_rad, boost::bind(op.distance(), q_t, _1)));
|
||||
partition(m, l, [&le_rad, &op, q_t](const Point& p){ return le_rad(op.distance()(q_t, p)); });
|
||||
RandomAccessIterator b2 =
|
||||
partition(b1, l, boost::bind(le_rad, boost::bind(op.distance(), q_r, _1)));
|
||||
partition(b1, l, [&le_rad, &op, q_r](const Point& p){ return le_rad(op.distance()(q_r, p)); });
|
||||
|
||||
if (b2 != l)
|
||||
return o;
|
||||
|
|
@ -921,8 +909,7 @@ rectangular_3_center_2_type2(
|
|||
while (e - s > 6) {
|
||||
std::ptrdiff_t cutoff = (e - s) / 2;
|
||||
RandomAccessIterator m = s + cutoff - 1;
|
||||
std::nth_element(s, m, e,
|
||||
boost::bind(less<FT>(), boost::bind(op.delta(), _1), boost::bind(op.delta(), _2)));
|
||||
std::nth_element(s, m, e, [&op](const Point& p1, const Point& p2){ return op.delta()(p1) < op.delta()(p2); });
|
||||
|
||||
// step (b)
|
||||
IP pos = min_max_element(m + 1, e, op.compare_x(), op.compare_y());
|
||||
|
|
@ -935,13 +922,11 @@ rectangular_3_center_2_type2(
|
|||
Point q_r = op.place_y_square(q_r_afap, r, op.delta()(*m));
|
||||
|
||||
// check for covering
|
||||
boost::function1<bool,FT>
|
||||
le_delta_m = boost::bind(greater_equal<FT>(), op.delta()(*m), _1);
|
||||
auto le_delta_m = [&op, m](const FT& v){ return op.delta()(*m) >= v; };
|
||||
RandomAccessIterator b1 =
|
||||
partition(m + 1, e,
|
||||
boost::bind(le_delta_m, boost::bind(op.distance(), q_t, _1)));
|
||||
partition(m + 1, e, [&le_delta_m, &op, & q_t](const Point& p){ return le_delta_m(op.distance()(q_t, p)); });
|
||||
RandomAccessIterator b2 =
|
||||
partition(b1, e, boost::bind(le_delta_m, boost::bind(op.distance(), q_r, _1)));
|
||||
partition(b1, e, [&le_delta_m, &op, & q_r](const Point& p){ return le_delta_m(op.distance()(q_r, p)); });
|
||||
|
||||
if (b2 != e)
|
||||
s = m;
|
||||
|
|
@ -960,7 +945,7 @@ rectangular_3_center_2_type2(
|
|||
std::ptrdiff_t cutoff = (e - s) / fraction;
|
||||
RandomAccessIterator m = s + cutoff - 1;
|
||||
std::nth_element(s, m, e,
|
||||
boost::bind(less<FT>(), boost::bind(op.delta(), _1), boost::bind(op.delta(), _2)));
|
||||
[&op](const Point& p1, const Point& p2){ return op.delta()(p1) < op.delta()(p2); });
|
||||
|
||||
// step (b)
|
||||
IP pos = min_max_element(m + 1, e, op.compare_x(), op.compare_y());
|
||||
|
|
@ -1007,16 +992,16 @@ rectangular_3_center_2_type2(
|
|||
// partition the range [m+1, e) into ranges
|
||||
// [m+1, b1), [b1, b2), [b2, b3) and [b3, e)
|
||||
// R G cap q_t G cap q_r none
|
||||
boost::function1<bool,FT>
|
||||
le_delta_m = boost::bind(greater_equal<FT>(), op.delta()(*m), _1);
|
||||
auto le_delta_m = [&op, m](const FT& v){ return op.delta()(*m) >= v; };
|
||||
RandomAccessIterator b2 =
|
||||
partition(m + 1, e, boost::bind(le_delta_m, boost::bind(op.distance(), q_t, _1)));
|
||||
partition(m + 1, e,
|
||||
[&le_delta_m, &op, &q_t](const Point& p) { return le_delta_m(op.distance()(q_t, p)); });
|
||||
RandomAccessIterator b1 =
|
||||
partition(m + 1, b2,
|
||||
boost::bind(le_delta_m, boost::bind(op.distance(), q_r, _1)));
|
||||
[&le_delta_m, &op, &q_r](const Point& p) { return le_delta_m(op.distance()(q_r, p)); });
|
||||
RandomAccessIterator b3 =
|
||||
partition(b2, e, boost::bind(le_delta_m, boost::bind(op.distance(), q_r, _1)));
|
||||
|
||||
partition(b2, e,
|
||||
[&le_delta_m, &op, &q_r](const Point& p) { return le_delta_m(op.distance()(q_r, p)); });
|
||||
|
||||
// step (c)
|
||||
if (b3 != e ||
|
||||
|
|
@ -1100,9 +1085,8 @@ rectangular_3_center_2_type2(
|
|||
// step 1
|
||||
RandomAccessIterator s_m = s_b + (s_e - s_b - 1) / 2;
|
||||
std::nth_element(s_b, s_m, s_e,
|
||||
boost::bind(less<FT>(),
|
||||
boost::bind(op.delta(), _1),
|
||||
boost::bind(op.delta(), _2)));
|
||||
[&op](const Point& p1, const Point& p2)
|
||||
{ return op.delta()(p1) < op.delta()(p2); });
|
||||
|
||||
// step 2 (as above)
|
||||
Point q_t_m = q_t_afap;
|
||||
|
|
@ -1138,14 +1122,17 @@ CGAL_3CENTER_REPEAT_CHECK:
|
|||
// partition the range [s_b+1, e) into ranges
|
||||
// [s_b+1, b1), [b1, b2), [b2, b3) and [b3, e)
|
||||
// R G cap q_t G cap q_r none
|
||||
boost::function1<bool,FT>
|
||||
le_delta_sb = boost::bind(greater_equal<FT>(), op.delta()(*s_b), _1);
|
||||
b2 = partition(s_b + 1, e, boost::bind(le_delta_sb,
|
||||
boost::bind(op.distance(), q_t, _1)));
|
||||
b1 = partition(s_b + 1, b2, boost::bind(le_delta_sb,
|
||||
boost::bind(op.distance(), q_r, _1)));
|
||||
auto le_delta_sb = [&op, s_b](const FT& v){ return op.delta()(*s_b) >= v;} ;
|
||||
|
||||
b2 = partition(s_b + 1, e,
|
||||
[&le_delta_sb, &op, &q_t](const Point& p)
|
||||
{ return le_delta_sb(op.distance()(q_t, p)); });
|
||||
b1 = partition(s_b + 1, b2,
|
||||
[&le_delta_sb, &op, &q_r](const Point& p)
|
||||
{ return le_delta_sb(op.distance()(q_r, p)); });
|
||||
b3 = partition(b2, e,
|
||||
boost::bind(le_delta_sb, boost::bind(op.distance(), q_r, _1)));
|
||||
[&le_delta_sb, &op, &q_r](const Point& p)
|
||||
{ return le_delta_sb(op.distance()(q_r, p)); });
|
||||
|
||||
if (b3 != e ||
|
||||
(!Q_t_empty && op.compute_x_distance(q_t, Q_t) > op.delta()(*s_b)) ||
|
||||
|
|
@ -1183,7 +1170,7 @@ CGAL_3CENTER_REPEAT_CHECK:
|
|||
std::vector< Point > tmppts(f, l);
|
||||
RandomAccessIterator ii =
|
||||
partition(tmppts.begin(), tmppts.end(),
|
||||
boost::bind(le_delta_sb, boost::bind(op.delta(), _1)));
|
||||
[&le_delta_sb, &op](const FT& v){ return le_delta_sb(op.delta()(v)); });
|
||||
IP tmppos = min_max_element(ii, tmppts.end(),
|
||||
op.compare_x(), op.compare_y());
|
||||
)
|
||||
|
|
@ -1228,12 +1215,8 @@ CGAL_3CENTER_REPEAT_CHECK:
|
|||
// we have to take the next smaller radius
|
||||
RandomAccessIterator next =
|
||||
max_element_if(s, s_b,
|
||||
boost::bind(less<FT>(),
|
||||
boost::bind(op.delta(), _1),
|
||||
boost::bind(op.delta(), _2)),
|
||||
boost::bind(not_equal_to<FT>(),
|
||||
op.delta()(*s_b),
|
||||
boost::bind(op.delta(), _1)));
|
||||
[&op](const Point& p1, const Point& p2){ return op.delta()(p1) < op.delta()(p2); },
|
||||
[&op, s_b](const Point& p){ return op.delta()(*s_b) != op.delta()(p); });
|
||||
rho_max = op.delta()(*s_b);
|
||||
q_t_at_rho_max = q_t, q_r_at_rho_max = q_r;
|
||||
CGAL_optimisation_assertion(op.delta()(*next) < op.delta()(*s_b));
|
||||
|
|
@ -1243,14 +1226,13 @@ CGAL_3CENTER_REPEAT_CHECK:
|
|||
q_r = op.place_y_square(q_r_afap, r, op.delta()(*next));
|
||||
|
||||
// again check for covering
|
||||
boost::function1<bool,FT>
|
||||
le_delta_next = boost::bind(greater_equal<FT>(), op.delta()(*next), _1);
|
||||
auto le_delta_next = [&op, next](const FT& v){ return op.delta()(*next) >= v; };
|
||||
b2 = partition(s_b, e,
|
||||
boost::bind(le_delta_next, boost::bind(op.distance(), q_t, _1)));
|
||||
[&op, &le_delta_next, &q_t](const Point& p){ return le_delta_next( op.distance()(q_t,p) ); });
|
||||
b1 = partition(s_b, b2,
|
||||
boost::bind(le_delta_next, boost::bind(op.distance(), q_r, _1)));
|
||||
[&op, &le_delta_next, &q_r](const Point& p){ return le_delta_next( op.distance()(q_r,p) ); });
|
||||
b3 = partition(b2, e,
|
||||
boost::bind(le_delta_next, boost::bind(op.distance(), q_r, _1)));
|
||||
[&op, &le_delta_next, &q_r](const Point& p){ return le_delta_next( op.distance()(q_r,p) ); });
|
||||
|
||||
if (b3 != e ||
|
||||
(!Q_t_empty && op.compute_x_distance(q_t, Q_t) > op.delta()(*next)) ||
|
||||
|
|
@ -1304,7 +1286,7 @@ CGAL_3CENTER_REPEAT_CHECK:
|
|||
Point q_t_afap = op.place_x_square(Q_t_empty, Q_t, r);
|
||||
Point q_r_afap = op.place_y_square(Q_r_empty, Q_r, r);
|
||||
if (s != e) {
|
||||
sort(s, e, boost::bind(less<FT>(), boost::bind(op.delta(), _1), boost::bind(op.delta(), _2)));
|
||||
sort(s, e, [&op](const Point& p1, const Point& p2){ return op.delta()(p1) < op.delta()(p2);});
|
||||
rho_max = op.delta()(*--t);
|
||||
} else
|
||||
rho_max = rho_min;
|
||||
|
|
@ -1347,16 +1329,15 @@ CGAL_3CENTER_REPEAT_CHECK:
|
|||
q_r = op.place_y_square(q_r_afap, r, try_rho);
|
||||
|
||||
// check for covering
|
||||
boost::function1<bool,FT>
|
||||
greater_rho_max = boost::bind(less<FT>(), try_rho, _1);
|
||||
auto greater_rho_max = [&try_rho](const FT& v){ return try_rho < v; };
|
||||
if ((!Q_t_empty && op.compute_x_distance(q_t, Q_t) > try_rho) ||
|
||||
(!Q_r_empty && op.compute_y_distance(q_r, Q_r) > try_rho) ||
|
||||
e != find_if(
|
||||
t + 1,
|
||||
e,
|
||||
boost::bind(logical_and<bool>(),
|
||||
boost::bind(greater_rho_max, boost::bind(op.distance(), q_t, _1)),
|
||||
boost::bind(greater_rho_max, boost::bind(op.distance(), q_r, _1)))))
|
||||
[&greater_rho_max, &q_t, &q_r, &op](const Point& p)
|
||||
{ return greater_rho_max(op.distance()(q_t,p)) &&
|
||||
greater_rho_max(op.distance()(q_r,p)); }))
|
||||
{
|
||||
rho_min = try_rho;
|
||||
q_t_q_r_cover_at_rho_min = 0;
|
||||
|
|
@ -1393,17 +1374,15 @@ CGAL_3CENTER_REPEAT_CHECK:
|
|||
CGAL_optimisation_assertion(rho_min >= 0);
|
||||
FT rad_2 = q_t_q_r_cover_at_rho_min;
|
||||
if (s_at_rho_min != e_at_rho_min) {
|
||||
boost::function1<FT,Point>
|
||||
mydist = boost::bind(Min<FT>(),
|
||||
boost::bind(op.distance(), q_t_at_rho_min, _1),
|
||||
boost::bind(op.distance(), q_r_at_rho_min, _1));
|
||||
auto mydist = [&q_t_at_rho_min, &q_r_at_rho_min, &op](const Point& p)
|
||||
{ return Min<FT>()( op.distance()(q_t_at_rho_min, p),
|
||||
op.distance()(q_r_at_rho_min, p)); };
|
||||
rad_2 =
|
||||
max BOOST_PREVENT_MACRO_SUBSTITUTION (
|
||||
rad_2,
|
||||
mydist(*max_element(s_at_rho_min, e_at_rho_min,
|
||||
boost::bind(less< FT >(),
|
||||
boost::bind(mydist, _1),
|
||||
boost::bind(mydist, _2)))));
|
||||
[&mydist](const Point& p1, const Point& p2)
|
||||
{ return mydist(p1) < mydist(p2); })));
|
||||
}
|
||||
CGAL_optimisation_assertion(rad_2 == 0 || rad_2 > rho_min);
|
||||
|
||||
|
|
|
|||
|
|
@ -316,7 +316,6 @@ rectangular_p_center_2_matrix_search(
|
|||
const Traits& t)
|
||||
{
|
||||
typedef typename Traits::FT FT;
|
||||
using std::minus;
|
||||
|
||||
return rectangular_p_center_2_matrix_search(
|
||||
f,
|
||||
|
|
@ -325,7 +324,9 @@ rectangular_p_center_2_matrix_search(
|
|||
r,
|
||||
pf,
|
||||
t,
|
||||
boost::bind(Max<FT>(), 0, boost::bind(minus<FT>(), _1, _2)));
|
||||
std::function<FT(const FT&, const FT&)>(
|
||||
[](const FT& a, const FT& b) { return Max<FT>()(0, std::minus<FT>()(a,b)); }
|
||||
));
|
||||
|
||||
} // Pcenter_matrix_search( ... )
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ include(${CGAL_USE_FILE})
|
|||
|
||||
# Use Eigen
|
||||
find_package(Eigen3 3.1.0 QUIET) #(3.1.0 or greater)
|
||||
include(CGAL_Eigen_support)
|
||||
include(CGAL_Eigen3_support)
|
||||
|
||||
# create a target per cppfile
|
||||
file(
|
||||
|
|
@ -19,11 +19,11 @@ file(
|
|||
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp)
|
||||
foreach(cppfile ${cppfiles})
|
||||
if(NOT (${cppfile} STREQUAL "Approximate_min_ellipsoid_d.cpp")
|
||||
OR TARGET CGAL::Eigen_support)
|
||||
OR TARGET CGAL::Eigen3_support)
|
||||
get_filename_component(target ${cppfile} NAME_WE)
|
||||
create_single_source_cgal_program(${cppfile})
|
||||
if(TARGET CGAL::Eigen_support)
|
||||
target_link_libraries(${target} PRIVATE CGAL::CGAL CGAL::Eigen_support)
|
||||
if(TARGET CGAL::Eigen3_support)
|
||||
target_link_libraries(${target} PRIVATE CGAL::CGAL CGAL::Eigen3_support)
|
||||
else()
|
||||
target_link_libraries(${target} PRIVATE CGAL::CGAL)
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@
|
|||
#include <CGAL/atomic.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <array>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
@ -63,8 +64,9 @@ class Box_d;
|
|||
template<class NT_, int N>
|
||||
class Box_d< NT_, N, ID_NONE> {
|
||||
protected:
|
||||
NT_ lo[N];
|
||||
NT_ hi[N];
|
||||
std::array<NT_,N> lo;
|
||||
std::array<NT_,N> hi;
|
||||
|
||||
public:
|
||||
typedef NT_ NT;
|
||||
typedef std::size_t ID;
|
||||
|
|
@ -72,8 +74,8 @@ public:
|
|||
Box_d() {}
|
||||
Box_d(bool complete) { init(complete); }
|
||||
Box_d(NT l[N], NT h[N]) {
|
||||
std::copy( l, l + N, lo );
|
||||
std::copy( h, h + N, hi );
|
||||
std::copy( l, l + N, &lo[0] );
|
||||
std::copy( h, h + N, &hi[0] );
|
||||
}
|
||||
void init (bool complete = false) {
|
||||
NT inf = box_limits<NT>::inf();
|
||||
|
|
|
|||
|
|
@ -1,39 +0,0 @@
|
|||
/****************************************************************************
|
||||
* Core Library Version 1.7, August 2004
|
||||
* Copyright (c) 1995-2004 Exact Computation Project
|
||||
* All rights reserved.
|
||||
*
|
||||
* This file is part of CGAL (www.cgal.org).
|
||||
*
|
||||
* File: BigFloat.cpp
|
||||
* Synopsis:
|
||||
* BigFloat numbers with error bounds
|
||||
*
|
||||
* EXACTNESS PROPERTY:
|
||||
* ==================
|
||||
* For BigFloats that are exact (i.e., error=0),
|
||||
* addition/subtraction and multiplication return the
|
||||
* exact result (i.e., error=0). We also introduce the operation
|
||||
* div2(), which simply divides a BigFloat by 2,
|
||||
* but this again preserves exactness. Such exactness
|
||||
* properties are used in our Newton iteration/Sturm Sequences.
|
||||
*
|
||||
* Written by
|
||||
* Chee Yap <yap@cs.nyu.edu>
|
||||
* Chen Li <chenli@cs.nyu.edu>
|
||||
* Zilin Du <zilin@cs.nyu.edu>
|
||||
*
|
||||
* WWW URL: http://cs.nyu.edu/exact/
|
||||
* Email: exact@cs.nyu.edu
|
||||
*
|
||||
* $URL$
|
||||
* $Id$
|
||||
* SPDX-License-Identifier: LGPL-3.0-or-later
|
||||
***************************************************************************/
|
||||
|
||||
#ifndef CGAL_HEADER_ONLY
|
||||
|
||||
#include <CGAL/CORE/BigFloat.h>
|
||||
#include <CGAL/CORE/BigFloat_impl.h>
|
||||
|
||||
#endif
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue