Merge branch 'master' into VSA-lingjie

This commit is contained in:
Laurent Rineau 2019-01-10 10:13:09 +01:00 committed by GitHub
commit c9fb876574
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
233 changed files with 4948 additions and 2563 deletions

View File

@ -1297,7 +1297,7 @@ void Scene::refine_loop()
return; return;
} }
std::cout << "Loop subdivision..."; std::cout << "Loop subdivision...";
CGAL::Subdivision_method_3::Loop_subdivision(*m_pPolyhedron, 1); CGAL::Subdivision_method_3::Loop_subdivision(*m_pPolyhedron);
std::cout << "done (" << m_pPolyhedron->size_of_facets() << " facets)" << std::endl; std::cout << "done (" << m_pPolyhedron->size_of_facets() << " facets)" << std::endl;
clear_internal_data(); clear_internal_data();

View File

@ -1,5 +1,5 @@
#include <iostream> #include <iostream>
#include <boost/iterator.hpp> #include <boost/iterator/iterator_adaptor.hpp>
#include <CGAL/Simple_cartesian.h> #include <CGAL/Simple_cartesian.h>
#include <CGAL/AABB_tree.h> #include <CGAL/AABB_tree.h>

View File

@ -31,10 +31,18 @@
#include <boost/type_traits/is_same.hpp> #include <boost/type_traits/is_same.hpp>
#include <boost/variant/apply_visitor.hpp> #include <boost/variant/apply_visitor.hpp>
#if BOOST_VERSION >= 105000 #if BOOST_VERSION >= 105000
#include <boost/heap/priority_queue.hpp> # if defined(BOOST_MSVC)
# pragma warning(push)
# pragma warning(disable: 4996)
# endif
# include <boost/heap/priority_queue.hpp>
# if defined(BOOST_MSVC)
# pragma warning(pop)
# endif
#else #else
#include <queue> # include <queue>
#endif #endif
#include <CGAL/assertions.h> #include <CGAL/assertions.h>
namespace CGAL { namespace CGAL {

View File

@ -325,27 +325,27 @@ efficiency.
The following example illustrates the construction of `AlgebraicKernel_d_1::Algebraic_real_1` The following example illustrates the construction of `AlgebraicKernel_d_1::Algebraic_real_1`
using `AlgebraicKernel_d_1::Construct_algebraic_real_1`: using `AlgebraicKernel_d_1::Construct_algebraic_real_1`:
<SMALL>\cgalExample{Algebraic_kernel_d/Construct_algebraic_real_1.cpp}</SMALL> \cgalExample{Algebraic_kernel_d/Construct_algebraic_real_1.cpp}
\subsection CGALAK1Solving Solving Univariate Polynomials \subsection CGALAK1Solving Solving Univariate Polynomials
The following example illustrates the construction of `AlgebraicKernel_d_1::Algebraic_real_1` The following example illustrates the construction of `AlgebraicKernel_d_1::Algebraic_real_1`
using `AlgebraicKernel_d_1::Solve_1`: <SMALL>\cgalExample{Algebraic_kernel_d/Solve_1.cpp} </SMALL> using `AlgebraicKernel_d_1::Solve_1`: \cgalExample{Algebraic_kernel_d/Solve_1.cpp}
\subsection CGALAK1EGCompare_1 Comparison and Approximation of Algebraic Real Numbers \subsection CGALAK1EGCompare_1 Comparison and Approximation of Algebraic Real Numbers
The following example illustrates the comparison of `AlgebraicKernel_d_1::Algebraic_real_1` numbers: The following example illustrates the comparison of `AlgebraicKernel_d_1::Algebraic_real_1` numbers:
<SMALL>\cgalExample{Algebraic_kernel_d/Compare_1.cpp}</SMALL> \cgalExample{Algebraic_kernel_d/Compare_1.cpp}
\subsection CGALAK1EGIsolate_1 Isolation of Algebraic Real Numbers with respect to roots of other polynomials \subsection CGALAK1EGIsolate_1 Isolation of Algebraic Real Numbers with respect to roots of other polynomials
The following example illustrates the isolation of `AlgebraicKernel_d_1::Algebraic_real_1` numbers: The following example illustrates the isolation of `AlgebraicKernel_d_1::Algebraic_real_1` numbers:
<SMALL>\cgalExample{Algebraic_kernel_d/Isolate_1.cpp}</SMALL> \cgalExample{Algebraic_kernel_d/Isolate_1.cpp}
\subsection CGALAK1EGSign_at_1 Interplay with Polynomials \subsection CGALAK1EGSign_at_1 Interplay with Polynomials
The following example illustrates the sign evaluation of `AlgebraicKernel_d_1::Algebraic_real_1` numbers in polynomials: The following example illustrates the sign evaluation of `AlgebraicKernel_d_1::Algebraic_real_1` numbers in polynomials:
<SMALL>\cgalExample{Algebraic_kernel_d/Sign_at_1.cpp}</SMALL> \cgalExample{Algebraic_kernel_d/Sign_at_1.cpp}
\section Algebraic_kernel_dDesign Design and Implementation History \section Algebraic_kernel_dDesign Design and Implementation History

View File

@ -1524,17 +1524,11 @@ compute_intermediate_values_and_slices() const {
#if CGAL_ACK_DEBUG_FLAG #if CGAL_ACK_DEBUG_FLAG
CGAL_ACK_DEBUG_PRINT << "Prepare intermediate slices.." << std::flush; CGAL_ACK_DEBUG_PRINT << "Prepare intermediate slices.." << std::flush;
#endif #endif
std::size_t size = event_x_coordinates().size()+1;
this->ptr()->intermediate_values=std::vector<Lazy_bound>(); this->ptr()->intermediate_values=std::vector<Lazy_bound>();
this->ptr()->intermediate_slices=std::vector<Lazy_status_line_CPA_1>(); this->ptr()->intermediate_slices=std::vector<Lazy_status_line_CPA_1>();
this->ptr()->intermediate_values.get().resize(size);
for(size_type i=0; this->ptr()->intermediate_slices.get().resize(size);
i<=static_cast<size_type>(event_x_coordinates().size());
i++) {
this->ptr()->intermediate_values.get().push_back(Lazy_bound());
this->ptr()->intermediate_slices.get().push_back
(Lazy_status_line_CPA_1());
}
#if CGAL_ACK_DEBUG_FLAG #if CGAL_ACK_DEBUG_FLAG
CGAL_ACK_DEBUG_PRINT << "done" << std::endl; CGAL_ACK_DEBUG_PRINT << "done" << std::endl;
#endif #endif

View File

@ -8,6 +8,10 @@ if(NOT POLICY CMP0070 AND POLICY CMP0053)
cmake_policy(SET CMP0053 OLD) cmake_policy(SET CMP0053 OLD)
endif() endif()
if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL COMPONENTS Core Qt5 ) find_package(CGAL COMPONENTS Core Qt5 )
find_package( Qt5 QUIET COMPONENTS Gui Widgets) find_package( Qt5 QUIET COMPONENTS Gui Widgets)

View File

@ -2209,10 +2209,10 @@ representing line segments.
A polyline can be constructed given one of the following inputs: A polyline can be constructed given one of the following inputs:
- <b>A range of \a points</b>, where two succeeding points in the - <b>A range of <em>points</em></b>, where two succeeding points in the
range represent the endpoints of a segment of the polyline. range represent the endpoints of a segment of the polyline.
- <b>A range of \a segments</b>. Note that , if the types - <b>A range of <em>segments</em></b>. Note that , if the types
`SubcurveTraits_2::Curve_2` and `SubcurveTraits_2::X_monotone_curve_2` are `SubcurveTraits_2::Curve_2` and `SubcurveTraits_2::X_monotone_curve_2` are
not the same, then when `Make_x_monotone_2` is invoked the segments not the same, then when `Make_x_monotone_2` is invoked the segments
that compose the polyline will be broken into \f$x\f$-monotone that compose the polyline will be broken into \f$x\f$-monotone
@ -2681,7 +2681,7 @@ manner whenever possible. Thus, it resorts to exact computations only when
the approximate computation fails to produce an unambiguous result. the approximate computation fails to produce an unambiguous result.
Note that most arrangement vertices are therefore associated with approximated Note that most arrangement vertices are therefore associated with approximated
points. You cannot access the coordinates of such points and obtain them as points. You cannot access the coordinates of such points and obtain them as
algebraic numbers, and only access to the approximate coordinates in possible. algebraic numbers, and only access to the approximate coordinates is possible.
See the Reference Manual for the exact interface of the `Point_2`, See the Reference Manual for the exact interface of the `Point_2`,
`Curve_2` and `X_monotone_curve_2` defined by the traits class. `Curve_2` and `X_monotone_curve_2` defined by the traits class.

View File

@ -167,7 +167,7 @@ virtual void before_detach ();
issued immediately after the observer has been detached from its issued immediately after the observer has been detached from its
arrangement instance. arrangement instance.
*/ */
virtual void after_attach (); virtual void after_detach ();
/// @} /// @}

View File

@ -242,6 +242,11 @@ private:
/*! Set the marked-face index */ /*! Set the marked-face index */
void set_marked_facet_index(size_type id) {m_marked_facet_index = id;} void set_marked_facet_index(size_type id) {m_marked_facet_index = id;}
/*! Add vertices to the current facet. */
template <typename Iterator, typename Builder>
void add_vertices_to_facet(Iterator begin, Iterator end, Builder& B)
{ for (Iterator it = begin; it != end; ++it) B.add_vertex_to_facet(*it); }
/*! builds the polyhedron */ /*! builds the polyhedron */
void operator()(HDS& hds) void operator()(HDS& hds)
{ {
@ -262,11 +267,11 @@ private:
for (CoordIndexIter it = m_indices_begin; it != m_indices_end; ++it) { for (CoordIndexIter it = m_indices_begin; it != m_indices_end; ++it) {
Polyhedron_facet_handle fh = B.begin_facet(); Polyhedron_facet_handle fh = B.begin_facet();
if (counter == m_marked_facet_index) fh->set_marked(true); if (counter == m_marked_facet_index) fh->set_marked(true);
//! \todo EF: when upgrading to C++11 change the type of the following //! \todo EF: when upgrading to C++11 enable the following code and
// iterator to auto. Better yet, use for (auto blah : foo). // remove add_vertices_to_facet().
for (std::vector<size_t>::const_iterator iit = it->begin(); // for (const auto& facet : *it) B.add_vertex_to_facet(facet);
iit != it->end(); ++iit) // B.end_facet();
B.add_vertex_to_facet(*iit); add_vertices_to_facet(it->begin(), it->end(), B);
B.end_facet(); B.end_facet();
++counter; ++counter;
} }

View File

@ -197,7 +197,7 @@ function(run_test_alt name datafile)
set(command ${name} ${datafile} ${ARGN}) set(command ${name} ${datafile} ${ARGN})
string(MAKE_C_IDENTIFIER "${name} ${ARGV4} ${ARGV5}" test_name) string(MAKE_C_IDENTIFIER "${name} ${ARGV4} ${ARGV5}" test_name)
add_test(NAME ${test_name} COMMAND ${command} add_test(NAME ${test_name} COMMAND ${command}
WORKING_DIRECTORY ${CGAL_CURRENT_SOURCE_DIR}) WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
set_property(TEST "${test_name}" set_property(TEST "${test_name}"
APPEND PROPERTY DEPENDS "compilation_of__${name}") APPEND PROPERTY DEPENDS "compilation_of__${name}")
if(POLICY CMP0066) # CMake 3.7 or later if(POLICY CMP0066) # CMake 3.7 or later

View File

@ -708,6 +708,7 @@ user might encounter.
## I/O Functions ## ## I/O Functions ##
- \link PkgBGLIOFct CGAL::read_off() \endlink - \link PkgBGLIOFct CGAL::read_off() \endlink
- \link PkgBGLIOFct CGAL::write_off() \endlink - \link PkgBGLIOFct CGAL::write_off() \endlink
- \link PkgBGLIOFct CGAL::write_wrl() \endlink
*/ */

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

@ -25,10 +25,10 @@ int main()
Point_3(1,-1,-1), Point_3(1,-1,-1),
Point_3(1,1,-1), Point_3(1,1,-1),
Point_3(-1,1,-1), Point_3(-1,1,-1),
Point_3(-1,1,1),
Point_3(-1,-1,1), Point_3(-1,-1,1),
Point_3(1,-1,1), Point_3(1,-1,1),
Point_3(1,1,1), Point_3(1,1,1),
Point_3(-1,1,1),
sm sm
); );
@ -45,10 +45,10 @@ int main()
Point_3(0.5,-0.5,-0.5), Point_3(0.5,-0.5,-0.5),
Point_3(0.5,0.5,-0.5), Point_3(0.5,0.5,-0.5),
Point_3(-0.5,0.5,-0.5), Point_3(-0.5,0.5,-0.5),
Point_3(-0.5,0.5,0.5),
Point_3(-0.5,-0.5,0.5), Point_3(-0.5,-0.5,0.5),
Point_3(0.5,-0.5,0.5), Point_3(0.5,-0.5,0.5),
Point_3(0.5,0.5,0.5), Point_3(0.5,0.5,0.5),
Point_3(-0.5,0.5,0.5),
poly poly
); );
pvertex_descriptor pvd = * vertices(pmesh).first; pvertex_descriptor pvd = * vertices(pmesh).first;

View File

@ -585,8 +585,16 @@ add_face(const VertexRange& vr, Graph& g)
std::vector<vertex_descriptor> vertices(vr.begin(), vr.end()); // quick and dirty copy std::vector<vertex_descriptor> vertices(vr.begin(), vr.end()); // quick and dirty copy
unsigned int n = (unsigned int)vertices.size(); unsigned int n = (unsigned int)vertices.size();
//check that every vertex is unique
std::sort(vertices.begin(), vertices.end());
if(std::adjacent_find(vertices.begin(), vertices.end()) != vertices.end()){
return boost::graph_traits<Graph>::null_face();
}
std::copy(vr.begin(), vr.end(), vertices.begin());
// don't allow degenerated faces // don't allow degenerated faces
CGAL_assertion(n > 2); if(n <= 2){
return boost::graph_traits<Graph>::null_face();
}
std::vector<halfedge_descriptor> halfedges(n); std::vector<halfedge_descriptor> halfedges(n);
std::vector<bool> is_new(n); std::vector<bool> is_new(n);

View File

@ -129,7 +129,7 @@ struct Face_filtered_graph
* a property map containing an index for each face initialized from 0 to `num_vertices(graph)` * a property map containing an index for each face initialized from 0 to `num_vertices(graph)`
* \cgalParamEnd * \cgalParamEnd
* \cgalParamBegin{vertex_index_map} * \cgalParamBegin{vertex_index_map}
* a property map containing an index for each vertex initialized 0 to `num_vertices(vertex)` * a property map containing an index for each vertex initialized 0 to `num_vertices(graph)`
* \cgalParamEnd * \cgalParamEnd
* \cgalParamBegin{halfedge_index_map} * \cgalParamBegin{halfedge_index_map}
* a property map containing an index for each halfedge initialized 0 to `num_halfedges(graph)` * a property map containing an index for each halfedge initialized 0 to `num_halfedges(graph)`
@ -189,7 +189,7 @@ struct Face_filtered_graph
* a property map containing an index for each face initialized from 0 to `num_vertices(graph)` * a property map containing an index for each face initialized from 0 to `num_vertices(graph)`
* \cgalParamEnd * \cgalParamEnd
* \cgalParamBegin{vertex_index_map} * \cgalParamBegin{vertex_index_map}
* a property map containing an index for each vertex initialized 0 to `num_vertices(vertex)` * a property map containing an index for each vertex initialized 0 to `num_vertices(graph)`
* \cgalParamEnd * \cgalParamEnd
* \cgalParamBegin{halfedge_index_map} * \cgalParamBegin{halfedge_index_map}
* a property map containing an index for each halfedge initialized 0 to `num_halfedges(graph)` * a property map containing an index for each halfedge initialized 0 to `num_halfedges(graph)`
@ -236,7 +236,7 @@ struct Face_filtered_graph
* a property map containing an index for each face initialized from 0 to `num_vertices(graph)` * a property map containing an index for each face initialized from 0 to `num_vertices(graph)`
* \cgalParamEnd * \cgalParamEnd
* \cgalParamBegin{vertex_index_map} * \cgalParamBegin{vertex_index_map}
* a property map containing an index for each vertex initialized 0 to `num_vertices(vertex)` * a property map containing an index for each vertex initialized 0 to `num_vertices(graph)`
* \cgalParamEnd * \cgalParamEnd
* \cgalParamBegin{halfedge_index_map} * \cgalParamBegin{halfedge_index_map}
* a property map containing an index for each halfedge initialized 0 to `num_halfedges(graph)` * a property map containing an index for each halfedge initialized 0 to `num_halfedges(graph)`

View File

@ -36,12 +36,15 @@
#include <boost/graph/graph_traits.hpp> #include <boost/graph/graph_traits.hpp>
#include <boost/tuple/tuple.hpp> #include <boost/tuple/tuple.hpp>
#include <cstdlib>
namespace CGAL { namespace CGAL {
namespace METIS { namespace METIS {
template<typename TriangleMesh, typename METIS_options, typename NamedParameters> template<typename TriangleMesh, typename METIS_options, typename NamedParameters>
void partition_dual_graph(const TriangleMesh& tm, int nparts, void partition_dual_graph(const TriangleMesh& tm,
int nparts,
METIS_options options, // options array METIS_options options, // options array
const NamedParameters& np) const NamedParameters& np)
{ {
@ -93,11 +96,11 @@ void partition_dual_graph(const TriangleMesh& tm, int nparts,
idx_t objval; idx_t objval;
// partition info for the nodes // partition info for the nodes
idx_t* npart = (idx_t*) calloc(nn, sizeof(idx_t)); idx_t* npart = (idx_t*) calloc(num_vertices(tm), sizeof(idx_t));
CGAL_assertion(npart != NULL); CGAL_assertion(npart != NULL);
// partition info for the elements // partition info for the elements
idx_t* epart = (idx_t*) calloc(ne, sizeof(idx_t)); idx_t* epart = (idx_t*) calloc(num_faces(tm), sizeof(idx_t));
CGAL_assertion(epart != NULL); CGAL_assertion(epart != NULL);
// do not support Fortran-style arrays // do not support Fortran-style arrays
@ -118,6 +121,12 @@ void partition_dual_graph(const TriangleMesh& tm, int nparts,
Output_face_partition_ids fo; Output_face_partition_ids fo;
vo(tm, indices, npart, get_param(np, internal_np::vertex_partition_id)); vo(tm, indices, npart, get_param(np, internal_np::vertex_partition_id));
fo(tm, epart, get_param(np, internal_np::face_partition_id)); fo(tm, epart, get_param(np, internal_np::face_partition_id));
delete[] eptr;
delete[] eind;
std::free(npart);
std::free(epart);
} }
template<typename TriangleMesh, typename NamedParameters> template<typename TriangleMesh, typename NamedParameters>

View File

@ -34,6 +34,8 @@
#include <boost/graph/graph_traits.hpp> #include <boost/graph/graph_traits.hpp>
#include <boost/tuple/tuple.hpp> #include <boost/tuple/tuple.hpp>
#include <cstdlib>
namespace CGAL { namespace CGAL {
namespace METIS { namespace METIS {
@ -76,7 +78,8 @@ struct Output_face_partition_ids
}; };
template<typename TriangleMesh, typename METIS_options, typename NamedParameters> template<typename TriangleMesh, typename METIS_options, typename NamedParameters>
void partition_graph(const TriangleMesh& tm, int nparts, void partition_graph(const TriangleMesh& tm,
int nparts,
METIS_options options, // pointer to the options array METIS_options options, // pointer to the options array
const NamedParameters& np) const NamedParameters& np)
{ {
@ -125,11 +128,11 @@ void partition_graph(const TriangleMesh& tm, int nparts,
idx_t objval; idx_t objval;
// partition info for the nodes // partition info for the nodes
idx_t* npart = (idx_t*) calloc(nn, sizeof(idx_t)); idx_t* npart = (idx_t*) calloc(num_vertices(tm), sizeof(idx_t));
CGAL_assertion(npart != NULL); CGAL_assertion(npart != NULL);
// partition info for the elements // partition info for the elements
idx_t* epart = (idx_t*) calloc(ne, sizeof(idx_t)); idx_t* epart = (idx_t*) calloc(num_faces(tm), sizeof(idx_t));
CGAL_assertion(epart != NULL); CGAL_assertion(epart != NULL);
// do not support Fortran-style arrays // do not support Fortran-style arrays
@ -150,6 +153,12 @@ void partition_graph(const TriangleMesh& tm, int nparts,
Output_face_partition_ids fo; Output_face_partition_ids fo;
vo(tm, indices, npart, get_param(np, internal_np::vertex_partition_id)); vo(tm, indices, npart, get_param(np, internal_np::vertex_partition_id));
fo(tm, epart, get_param(np, internal_np::face_partition_id)); fo(tm, epart, get_param(np, internal_np::face_partition_id));
delete[] eptr;
delete[] eind;
std::free(npart);
std::free(epart);
} }
template<typename TriangleMesh, typename NamedParameters> template<typename TriangleMesh, typename NamedParameters>

View File

@ -837,6 +837,8 @@ make_quad(const P& p0, const P& p1, const P& p2, const P& p3, Graph& g)
* \ingroup PkgBGLHelperFct * \ingroup PkgBGLHelperFct
* \brief Creates an isolated hexahedron * \brief Creates an isolated hexahedron
* with its vertices initialized to `p0`, `p1`, ...\ , and `p7`, and adds it to the graph `g`. * with its vertices initialized to `p0`, `p1`, ...\ , and `p7`, and adds it to the graph `g`.
* \image html hexahedron.png
* \image latex hexahedron.png
* \returns the halfedge that has the target vertex associated with `p0`, in the face with the vertices with the points `p0`, `p1`, `p2`, and `p3`. * \returns the halfedge that has the target vertex associated with `p0`, in the face with the vertices with the points `p0`, `p1`, `p2`, and `p3`.
**/ **/
template<typename Graph, typename P> template<typename Graph, typename P>
@ -868,16 +870,16 @@ make_hexahedron(const P& p0, const P& p1, const P& p2, const P& p3,
ppmap[v6] = p6; ppmap[v6] = p6;
ppmap[v7] = p7; ppmap[v7] = p7;
halfedge_descriptor ht = internal::make_quad(v7, v4, v5, v6, g); halfedge_descriptor ht = internal::make_quad(v4, v5, v6, v7, g);
halfedge_descriptor hb = prev(internal::make_quad(v1, v0, v3, v2, g),g); halfedge_descriptor hb = prev(internal::make_quad(v0, v3, v2, v1, g),g);
for(int i=0; i <4; i++){ for(int i=0; i <4; i++){
halfedge_descriptor h = halfedge(add_edge(g),g); halfedge_descriptor h = halfedge(add_edge(g),g);
set_target(h,target(hb,g),g); set_target(h,target(hb,g),g);
set_next(h,opposite(hb,g),g); set_next(h,opposite(hb,g),g);
set_next(opposite(next(ht,g),g),h,g); set_next(opposite(prev(ht,g),g),h,g);
h = opposite(h,g); h = opposite(h,g);
set_target(h,target(ht,g),g); set_target(h,source(prev(ht,g),g),g);
set_next(h,opposite(ht,g),g); set_next(h,opposite(next(next(ht,g),g),g),g);
set_next(opposite(next(hb,g),g),h,g); set_next(opposite(next(hb,g),g),h,g);
hb = next(hb,g); hb = next(hb,g);
ht = prev(ht,g); ht = prev(ht,g);
@ -892,6 +894,8 @@ make_hexahedron(const P& p0, const P& p1, const P& p2, const P& p3,
* \ingroup PkgBGLHelperFct * \ingroup PkgBGLHelperFct
* \brief Creates an isolated tetrahedron * \brief Creates an isolated tetrahedron
* with its vertices initialized to `p0`, `p1`, `p2`, and `p3`, and adds it to the graph `g`. * with its vertices initialized to `p0`, `p1`, `p2`, and `p3`, and adds it to the graph `g`.
* \image html tetrahedron.png
* \image latex tetrahedron.png
* \returns the halfedge that has the target vertex associated with `p0`, in the face with the vertices with the points `p0`, `p1`, and `p2`. * \returns the halfedge that has the target vertex associated with `p0`, in the face with the vertices with the points `p0`, `p1`, and `p2`.
**/ **/
template<typename Graph, typename P> template<typename Graph, typename P>
@ -1081,7 +1085,7 @@ make_regular_prism(
* \ingroup PkgBGLHelperFct * \ingroup PkgBGLHelperFct
* \brief Creates a pyramid, outward oriented, having `nb_vertices` vertices in its base and adds it to the graph `g`. * \brief Creates a pyramid, outward oriented, having `nb_vertices` vertices in its base and adds it to the graph `g`.
* *
* If `center` is (0, 0, 0), then the first point of the base is (`radius`, 0`, 0) * If `center` is `(0, 0, 0)`, then the first point of the base is `(radius, 0, 0)`
* \param nb_vertices the number of vertices in the base. It must be greater than or equal to 3. * \param nb_vertices the number of vertices in the base. It must be greater than or equal to 3.
* \param g the graph in which the pyramid will be created * \param g the graph in which the pyramid will be created
* \param base_center the center of the circle in which the base is inscribed. * \param base_center the center of the circle in which the base is inscribed.

View File

@ -36,6 +36,89 @@
#include <CGAL/boost/graph/named_function_params.h> #include <CGAL/boost/graph/named_function_params.h>
namespace CGAL { namespace CGAL {
/*!
\ingroup PkgBGLIOFct
writes the graph `g` in the wrl format (VRML 2.0).
\cgalNamedParamsBegin
* \cgalParamBegin{vertex_point_map} the property map with the points associated to the vertices of `g`.
* If this parameter is omitted, an internal property map for
* `CGAL::vertex_point_t` should be available in `FaceGraph`\cgalParamEnd
* \cgalNamedParamsEnd
*/
template <typename FaceGraph, typename NamedParameters>
bool write_wrl(std::ostream& os,
const FaceGraph& g,
const NamedParameters& np)
{
typedef typename boost::graph_traits<FaceGraph>::vertex_descriptor vertex_descriptor;
typedef typename boost::graph_traits<FaceGraph>::face_descriptor face_descriptor;
typedef typename boost::graph_traits<FaceGraph>::vertices_size_type vertices_size_type;
typename Polygon_mesh_processing::GetVertexPointMap<FaceGraph, NamedParameters>::const_type
vpm = choose_param(get_param(np, internal_np::vertex_point),
get_const_property_map(CGAL::vertex_point, g));
boost::container::flat_map<vertex_descriptor,vertices_size_type> reindex;
int n = 0;
os << "#VRML V2.0 utf8\n"
"Group {\n"
"children [\n"
"Shape {\n"
"appearance DEF A1 Appearance {\n"
"material Material {\n"
"diffuseColor .6 .5 .9\n"
"}\n"
"}\n"
"appearance\n"
"Appearance {\n"
"material DEF Material Material {}\n"
"}\n"
"}\n"
"Group {\n"
"children [\n"
"Shape {\n"
"appearance Appearance { material USE Material }\n"
"geometry IndexedFaceSet {\n"
"convex FALSE\n"
"solid FALSE\n"
"coord Coordinate {\n"
"point [\n";
BOOST_FOREACH(vertex_descriptor v, vertices(g)){
os << get(vpm,v) << ",\n";
reindex[v]=n++;
}
os << "] #point\n"
"} #coord Coordinate\n"
"coordIndex [\n";
BOOST_FOREACH(face_descriptor f, faces(g)){
BOOST_FOREACH(vertex_descriptor v, vertices_around_face(halfedge(f,g),g)){
os << reindex[v] << ",";
}
os << "-1,\n";
}
os << "] #coordIndex\n"
"} #geometry\n"
"} #Shape\n"
"] #children\n"
"} #group\n"
"]\n"
"}\n";
return os.good();
}
template <typename FaceGraph>
bool write_wrl(std::ostream& os,
const FaceGraph& g)
{
return write_wrl(os, g,
parameters::all_default());
}
/*! /*!
\ingroup PkgBGLIOFct \ingroup PkgBGLIOFct
writes the graph `g` in the OFF format. writes the graph `g` in the OFF format.

View File

@ -325,11 +325,17 @@ namespace CGAL {
template<typename PointRange, typename NamedParameters> template<typename PointRange, typename NamedParameters>
class GetK class GetK
{ {
typedef typename boost::property_traits< typedef typename GetPointMap<PointRange, NamedParameters>::type Vpm;
typename GetPointMap<PointRange, NamedParameters>::type typedef typename Kernel_traits<
>::value_type Point; typename boost::property_traits<Vpm>::value_type
>::Kernel Default_kernel;
public: public:
typedef typename CGAL::Kernel_traits<Point>::Kernel Kernel; typedef typename boost::lookup_named_param_def <
internal_np::geom_traits_t,
NamedParameters,
Default_kernel
> ::type Kernel;
}; };
template<typename PointRange, typename NamedParameters> template<typename PointRange, typename NamedParameters>
@ -399,6 +405,29 @@ namespace CGAL {
> ::type type; > ::type type;
}; };
template<typename PointRange, typename NamedParameters>
class GetIsConstrainedMap
{
struct DummyConstrainedMap
{
typedef typename std::iterator_traits<typename PointRange::iterator>::value_type key_type;
typedef bool value_type;
typedef value_type reference;
typedef boost::readable_property_map_tag category;
typedef DummyConstrainedMap Self;
friend reference get(const Self&, const key_type&) { return false; }
};
public:
typedef DummyConstrainedMap NoMap;
typedef typename boost::lookup_named_param_def <
internal_np::point_is_constrained_t,
NamedParameters,
DummyConstrainedMap //default
> ::type type;
};
} // namespace Point_set_processing_3 } // namespace Point_set_processing_3
template<typename NamedParameters, typename DefaultSolver> template<typename NamedParameters, typename DefaultSolver>

View File

@ -117,6 +117,7 @@ CGAL_add_named_parameter(plane_t, plane_map, plane_map)
CGAL_add_named_parameter(plane_index_t, plane_index_map, plane_index_map) CGAL_add_named_parameter(plane_index_t, plane_index_map, plane_index_map)
CGAL_add_named_parameter(select_percentage_t, select_percentage, select_percentage) CGAL_add_named_parameter(select_percentage_t, select_percentage, select_percentage)
CGAL_add_named_parameter(require_uniform_sampling_t, require_uniform_sampling, require_uniform_sampling) CGAL_add_named_parameter(require_uniform_sampling_t, require_uniform_sampling, require_uniform_sampling)
CGAL_add_named_parameter(point_is_constrained_t, point_is_constrained, point_is_constrained_map)
// List of named parameters used in Surface_mesh_approximation package // List of named parameters used in Surface_mesh_approximation package
CGAL_add_named_parameter(verbose_level_t, verbose_level, verbose_level) CGAL_add_named_parameter(verbose_level_t, verbose_level, verbose_level)
@ -137,3 +138,4 @@ CGAL_add_named_parameter(face_proxy_map_t, face_proxy_map, face_proxy_map)
CGAL_add_named_parameter(proxies_t, proxies, proxies) CGAL_add_named_parameter(proxies_t, proxies, proxies)
CGAL_add_named_parameter(anchors_t, anchors, anchors) CGAL_add_named_parameter(anchors_t, anchors, anchors)
CGAL_add_named_parameter(triangles_t, triangles, triangles) CGAL_add_named_parameter(triangles_t, triangles, triangles)

View File

@ -97,6 +97,8 @@ create_single_source_cgal_program( "test_graph_traits.cpp" )
create_single_source_cgal_program( "test_Properties.cpp" ) create_single_source_cgal_program( "test_Properties.cpp" )
create_single_source_cgal_program( "test_wrl.cpp" )
if(OpenMesh_FOUND) if(OpenMesh_FOUND)
target_link_libraries( test_clear PRIVATE ${OPENMESH_LIBRARIES}) target_link_libraries( test_clear PRIVATE ${OPENMESH_LIBRARIES})
target_link_libraries( test_Euler_operations PRIVATE ${OPENMESH_LIBRARIES}) target_link_libraries( test_Euler_operations PRIVATE ${OPENMESH_LIBRARIES})

View File

@ -132,7 +132,7 @@ int main()
assert(CGAL::is_triangle_mesh(m)); assert(CGAL::is_triangle_mesh(m));
assert(CGAL::is_valid_polygon_mesh(m)); assert(CGAL::is_valid_polygon_mesh(m));
m.clear(); m.clear();
hd = CGAL::make_hexahedron(a,b,c,d,aa,bb,cc,dd,m); hd = CGAL::make_hexahedron(a,b,c,d,dd,aa,bb,cc,m);
assert(CGAL::is_hexahedron(hd,m)); assert(CGAL::is_hexahedron(hd,m));
assert(CGAL::is_quad_mesh(m)); assert(CGAL::is_quad_mesh(m));
assert(CGAL::is_valid_polygon_mesh(m)); assert(CGAL::is_valid_polygon_mesh(m));

18
BGL/test/BGL/test_wrl.cpp Normal file
View File

@ -0,0 +1,18 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Surface_mesh.h>
#include <CGAL/boost/graph/helpers.h>
#include <CGAL/boost/graph/io.h>
#include <iostream>
typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point;
typedef CGAL::Surface_mesh<Point> Mesh;
int main()
{
Mesh sm;
CGAL::make_tetrahedron(Point(0,0,0), Point(1,0,0), Point(1,1,0), Point(0,0,1), sm);
CGAL::write_wrl(std::cout, sm);
return 0;
}

View File

@ -74,7 +74,7 @@ polygon vertices is referred to as the polygon <B>(outer) boundary</B>.
<LI>A polygon whose curves are pairwise disjoint in their interior, and whose vertices' degree equals two is defined as a <B>Simple polygon</B>. Such a polygon has a well-defined interior and exterior and is topologically equivalent to a disk. Note that while traversing the edges of the relatively simple polygon illustrated above (B), no curve is crossed over. <LI>A polygon whose curves are pairwise disjoint in their interior, and whose vertices' degree equals two is defined as a <B>Simple polygon</B>. Such a polygon has a well-defined interior and exterior and is topologically equivalent to a disk. Note that while traversing the edges of the relatively simple polygon illustrated above (B), no curve is crossed over.
<LI>A <B>Relatively simple</B> polygon allows vertices with a degree\f$\gt 2\f$, but all of its edges are disjoint in their interior. Furthermore, it must be an orientable polygon. Namely when it is inserted into an arrangement and its outer boundary is traversed, the same face is adjacent to all of the halfedges (no crossing over any curve during the traversal). <LI>A <B>Relatively simple</B> polygon allows vertices with a degree\f$> 2\f$, but all of its edges are disjoint in their interior. Furthermore, it must be an orientable polygon. Namely when it is inserted into an arrangement and its outer boundary is traversed, the same face is adjacent to all of the halfedges (no crossing over any curve during the traversal).
Note that while polygon C has the same curves as polygon B, traversal of the curves leads to crossing over a previously traversed curve, and is therefore neither simple nor relatively simple. Note that while polygon C has the same curves as polygon B, traversal of the curves leads to crossing over a previously traversed curve, and is therefore neither simple nor relatively simple.
<LI>A polygon in our context must be relatively simple and its outer boundary vertices must be ordered in a counterclockwise direction around the interior of the polygon. <LI>A polygon in our context must be relatively simple and its outer boundary vertices must be ordered in a counterclockwise direction around the interior of the polygon.

View File

@ -13,28 +13,28 @@ x\in\E^d \mid x^T E x + x^T e + \eta\leq 0 \}\f$, where \f$ E\f$ is some
positive definite matrix from the set \f$ \mathbb{R}^{d\times d}\f$, \f$ e\f$ is some positive definite matrix from the set \f$ \mathbb{R}^{d\times d}\f$, \f$ e\f$ is some
real \f$ d\f$-vector, and \f$ \eta\in\mathbb{R}\f$. A pointset \f$ P\subseteq \E^d\f$ is real \f$ d\f$-vector, and \f$ \eta\in\mathbb{R}\f$. A pointset \f$ P\subseteq \E^d\f$ is
called <I>full-dimensional</I> if its affine hull has dimension \f$ d\f$. called <I>full-dimensional</I> if its affine hull has dimension \f$ d\f$.
For a finite, full-dimensional pointset \f$ P\f$ we denote by \f$ \mel(P)\f$ the For a finite, full-dimensional pointset \f$ P\f$ we denote by \f$ (P)\f$ the
smallest ellipsoid that contains all points of \f$ P\f$; this ellipsoid smallest ellipsoid that contains all points of \f$ P\f$; this ellipsoid
exists and is unique. exists and is unique.
For a given finite and full-dimensional pointset \f$ P\subset \E^d\f$ and a For a given finite and full-dimensional pointset \f$ P\subset \E^d\f$ and a
real number \f$ \epsilon\ge 0\f$, we say that an ellipsoid \f$ {\cal real number \f$ \epsilon\ge 0\f$, we say that an ellipsoid \f$ {\cal
E}\subset\E^d\f$ is an <I>\f$ (1+\epsilon)\f$-appoximation</I> to \f$ \mel(P)\f$ if E}\subset\E^d\f$ is an <I>\f$ (1+\epsilon)\f$-appoximation</I> to \f$ (P)\f$ if
\f$ P\subset {\cal E}\f$ and \f$ \vol({\cal E}) \leq (1+\epsilon) \f$ P\subset {\cal E}\f$ and \f$ ({\cal E}) \leq (1+\epsilon)
\vol(\mel(P))\f$. In other words, an \f$ (1+\epsilon)\f$-approximation to ((P))\f$. In other words, an \f$ (1+\epsilon)\f$-approximation to
\f$ \mel(P)\f$ is an enclosing ellipsoid whose volume is by at most a \f$ (P)\f$ is an enclosing ellipsoid whose volume is by at most a
factor of \f$ 1+\epsilon\f$ larger than the volume of the smallest factor of \f$ 1+\epsilon\f$ larger than the volume of the smallest
enclosing ellipsoid of \f$ P\f$. enclosing ellipsoid of \f$ P\f$.
Given this notation, an object of class `Approximate_min_ellipsoid_d` represents an Given this notation, an object of class `Approximate_min_ellipsoid_d` represents an
\f$ (1+\epsilon)\f$-approximation to \f$ \mel(P)\f$ for a given finite and \f$ (1+\epsilon)\f$-approximation to \f$ (P)\f$ for a given finite and
full-dimensional multiset of points \f$ P\subset\E^d\f$ and a real constant full-dimensional multiset of points \f$ P\subset\E^d\f$ and a real constant
\f$ \epsilon>0\f$.\cgalFootnote{A <I>multiset</I> is a set where elements may have multiplicity greater than \f$ 1\f$.} When an \f$ \epsilon>0\f$.\cgalFootnote{A <I>multiset</I> is a set where elements may have multiplicity greater than \f$ 1\f$.} When an
`Approximate_min_ellipsoid_d<Traits>` object is constructed, an `Approximate_min_ellipsoid_d<Traits>` object is constructed, an
iterator over the points \f$ P\f$ and the number \f$ \epsilon\f$ have to be iterator over the points \f$ P\f$ and the number \f$ \epsilon\f$ have to be
specified; the number \f$ \epsilon\f$ defines the <I>desired specified; the number \f$ \epsilon\f$ defines the <I>desired
approximation ratio</I> \f$ 1+\epsilon\f$. The underlying algorithm will then approximation ratio</I> \f$ 1+\epsilon\f$. The underlying algorithm will then
try to compute an \f$ (1+\epsilon)\f$-approximation to \f$ \mel(P)\f$, and one of try to compute an \f$ (1+\epsilon)\f$-approximation to \f$ (P)\f$, and one of
the following two cases takes place. the following two cases takes place.
<UL> <UL>
<LI>The algorithm determines that \f$ P\f$ is not full-dimensional (see <LI>The algorithm determines that \f$ P\f$ is not full-dimensional (see
@ -44,7 +44,7 @@ the following two cases takes place.
in all cases decide correctly whether \f$ P\f$ is full-dimensional or in all cases decide correctly whether \f$ P\f$ is full-dimensional or
not. If `is_full_dimensional()` returns `false`, the points not. If `is_full_dimensional()` returns `false`, the points
lie in such a "thin" subspace of \f$ \E^d\f$ that the algorithm is lie in such a "thin" subspace of \f$ \E^d\f$ that the algorithm is
incapable of computing an approximation to \f$ \mel(P)\f$. More incapable of computing an approximation to \f$ (P)\f$. More
precisely, if `is_full_dimensional()` returns `false`, there precisely, if `is_full_dimensional()` returns `false`, there
exist two parallel hyperplanes in \f$ \E^d\f$ with the points \f$ P\f$ in exist two parallel hyperplanes in \f$ \E^d\f$ with the points \f$ P\f$ in
between so that the distance \f$ \delta\f$ between the hyperplanes is between so that the distance \f$ \delta\f$ between the hyperplanes is
@ -55,7 +55,7 @@ If \f$ P\f$ is not full-dimensional, linear algebra techniques should be
used to determine an affine subspace \f$ S\f$ of \f$ \E^d\f$ that contains the used to determine an affine subspace \f$ S\f$ of \f$ \E^d\f$ that contains the
points \f$ P\f$ as a (w.r.t.\ \f$ S\f$) full-dimensional pointset; once \f$ S\f$ is points \f$ P\f$ as a (w.r.t.\ \f$ S\f$) full-dimensional pointset; once \f$ S\f$ is
determined, the algorithm can be invoked again to compute an determined, the algorithm can be invoked again to compute an
approximation to (the lower-dimensional) \f$ \mel(P)\f$ in \f$ S\f$. Since approximation to (the lower-dimensional) \f$ (P)\f$ in \f$ S\f$. Since
`is_full_dimensional()` might (due to rounding errors, see `is_full_dimensional()` might (due to rounding errors, see
above) return `false` even though \f$ P\f$ is full-dimensional, the above) return `false` even though \f$ P\f$ is full-dimensional, the
lower-dimensional subspace \f$ S\f$ containing \f$ P\f$ need not exist. lower-dimensional subspace \f$ S\f$ containing \f$ P\f$ need not exist.
@ -66,7 +66,7 @@ ellipsoid of the projected points within \f$ H\f$; the fitting can be
done for instance using the `linear_least_squares_fitting()` done for instance using the `linear_least_squares_fitting()`
function from the \cgal package `Principal_component_analysis`. function from the \cgal package `Principal_component_analysis`.
<LI>The algorithm determines that \f$ P\f$ is full-dimensional. In this <LI>The algorithm determines that \f$ P\f$ is full-dimensional. In this
case, it provides an approximation \f$ {\cal E}\f$ to \f$ \mel(P)\f$, but case, it provides an approximation \f$ {\cal E}\f$ to \f$ (P)\f$, but
depending on the input problem (i.e., on the pair \f$ (P,\epsilon)\f$), depending on the input problem (i.e., on the pair \f$ (P,\epsilon)\f$),
it may not have achieved the desired approximation ratio but merely it may not have achieved the desired approximation ratio but merely
some <I>worse</I> approximation ratio \f$ 1+\epsilon'>1+\epsilon\f$. The some <I>worse</I> approximation ratio \f$ 1+\epsilon'>1+\epsilon\f$. The
@ -126,7 +126,7 @@ Cholesky-decomposition. The algorithm's running time is
To illustrate the usage of `Approximate_min_ellipsoid_d` we give two examples in 2D. The To illustrate the usage of `Approximate_min_ellipsoid_d` we give two examples in 2D. The
first program generates a random set \f$ P\subset\E^2\f$ and outputs the first program generates a random set \f$ P\subset\E^2\f$ and outputs the
points and a \f$ 1.01\f$-approximation of \f$ \mel(P)\f$ as an EPS-file, which points and a \f$ 1.01\f$-approximation of \f$ (P)\f$ as an EPS-file, which
you can view using <TT>gv</TT>, for instance. (In both examples you can you can view using <TT>gv</TT>, for instance. (In both examples you can
change the variables `n` and `d` to experiment with the code.) change the variables `n` and `d` to experiment with the code.)
@ -204,7 +204,7 @@ typedef unspecified_type Axis_direction_iterator;
/*! /*!
initializes `ame` to an \f$ (1+\epsilon)\f$-approximation of initializes `ame` to an \f$ (1+\epsilon)\f$-approximation of
\f$ \mel(P)\f$ with \f$ P\f$ being the set of points in the range \f$ (P)\f$ with \f$ P\f$ being the set of points in the range
[`first`,`last`). The number \f$ \epsilon\f$ in this will [`first`,`last`). The number \f$ \epsilon\f$ in this will
be at most `eps`, if possible. However, due to the be at most `eps`, if possible. However, due to the
limited precision in the algorithm's underlying arithmetic, it limited precision in the algorithm's underlying arithmetic, it
@ -260,7 +260,7 @@ unsigned int number_of_points( ) const;
returns a number returns a number
\f$ \epsilon'\f$ such that the computed approximation is (under exact \f$ \epsilon'\f$ such that the computed approximation is (under exact
arithmetic) guaranteed to be an \f$ (1+\epsilon')\f$-approximation to arithmetic) guaranteed to be an \f$ (1+\epsilon')\f$-approximation to
\f$ \mel(P)\f$. \f$ (P)\f$.
\pre `ame.is_full_dimensional() == true`. \pre `ame.is_full_dimensional() == true`.
\post \f$ \epsilon'>0\f$. \post \f$ \epsilon'>0\f$.
*/ */
@ -404,7 +404,7 @@ bool is_full_dimensional( ) const;
/// An object `ame` is valid iff <UL> <LI>`ame` contains all points of /// An object `ame` is valid iff <UL> <LI>`ame` contains all points of
/// its defining set \f$ P\f$, <LI>`ame` is an \f$ /// its defining set \f$ P\f$, <LI>`ame` is an \f$
/// (1+\epsilon')\f$-approximation to the smallest ellipsoid \f$ /// (1+\epsilon')\f$-approximation to the smallest ellipsoid \f$
/// \mel(P)\f$ of \f$ P\f$, <LI>The ellipsoid represented by `ame` /// (P)\f$ of \f$ P\f$, <LI>The ellipsoid represented by `ame`
/// fulfills the inclusion ( \ref eqapproximate_min_ellipsoid_incl /// fulfills the inclusion ( \ref eqapproximate_min_ellipsoid_incl
/// ). </UL> /// ). </UL>
/// @{ /// @{
@ -426,7 +426,7 @@ bool is_valid( bool verbose = false) const;
/*! /*!
Writes the points \f$ P\f$ and the computed approximation to Writes the points \f$ P\f$ and the computed approximation to
\f$ \mel(P)\f$ as an EPS-file under pathname `name`. \pre The dimension of points \f$ P\f$ must be \f$ 2\f$. \f$ (P)\f$ as an EPS-file under pathname `name`. \pre The dimension of points \f$ P\f$ must be \f$ 2\f$.
<I>Note:</I> this <I>Note:</I> this
routine is provided as a debugging routine; future version of routine is provided as a debugging routine; future version of
\cgal might not provide it anymore. \cgal might not provide it anymore.

View File

@ -360,7 +360,20 @@ class Min_ellipse_2 {
// default constructor // default constructor
inline inline
Min_ellipse_2( const Traits& traits = Traits()) Min_ellipse_2()
: n_support_points( 0)
{
// allocate support points' array
support_points = new Point[ 5];
// initialize ellipse
tco.ellipse.set();
CGAL_optimisation_postcondition( is_empty());
}
inline
Min_ellipse_2( const Traits& traits )
: tco( traits), n_support_points( 0) : tco( traits), n_support_points( 0)
{ {
// allocate support points' array // allocate support points' array

View File

@ -5,6 +5,10 @@ project( CGALimageIO_Examples )
cmake_minimum_required(VERSION 3.1) cmake_minimum_required(VERSION 3.1)
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
find_package(CGAL QUIET COMPONENTS ImageIO ) find_package(CGAL QUIET COMPONENTS ImageIO )
if(CGAL_ImageIO_FOUND) if(CGAL_ImageIO_FOUND)

View File

@ -168,7 +168,7 @@ unsigned int ImageIO_limit_len(size_t to_be_read)
CGAL_INLINE_FUNCTION CGAL_INLINE_FUNCTION
size_t ImageIO_write(const _image *im, const void *buf, size_t len) { size_t ImageIO_write(const _image *im, const void *buf, size_t len) {
size_t to_be_written = len; size_t to_be_written = len;
int l = -1; std::ptrdiff_t l = -1;
char *b = (char*)buf; char *b = (char*)buf;
switch(im->openMode) { switch(im->openMode) {

View File

@ -63,6 +63,7 @@ read_vtk_image_data(vtkImageData* vtk_image)
_image* image = ::_initImage(); _image* image = ::_initImage();
const int* dims = vtk_image->GetDimensions(); const int* dims = vtk_image->GetDimensions();
const double* spacing = vtk_image->GetSpacing(); const double* spacing = vtk_image->GetSpacing();
const double* offset = vtk_image->GetOrigin();
image->vectMode = VM_SCALAR; image->vectMode = VM_SCALAR;
image->xdim = dims[0]; image->xdim = dims[0];
image->ydim = dims[1]; image->ydim = dims[1];
@ -71,6 +72,9 @@ read_vtk_image_data(vtkImageData* vtk_image)
image->vx = spacing[0]; image->vx = spacing[0];
image->vy = spacing[1]; image->vy = spacing[1];
image->vz = spacing[2]; image->vz = spacing[2];
image->tx = offset[0];
image->ty = offset[1];
image->tz = offset[2];
image->endianness = ::_getEndianness(); image->endianness = ::_getEndianness();
int vtk_type = vtk_image->GetScalarType(); int vtk_type = vtk_image->GetScalarType();
if(vtk_type == VTK_SIGNED_CHAR) vtk_type = VTK_CHAR; if(vtk_type == VTK_SIGNED_CHAR) vtk_type = VTK_CHAR;

View File

@ -6,6 +6,10 @@ project( CGAL_ImageIO_Tests )
cmake_minimum_required(VERSION 3.1) cmake_minimum_required(VERSION 3.1)
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
find_package(CGAL QUIET COMPONENTS ImageIO ) find_package(CGAL QUIET COMPONENTS ImageIO )
if ( CGAL_FOUND ) if ( CGAL_FOUND )

View File

@ -28,6 +28,7 @@
#include <CGAL/determinant.h> #include <CGAL/determinant.h>
#include <CGAL/number_utils.h> #include <CGAL/number_utils.h>
#include <boost/type_traits/is_integral.hpp>
namespace CGAL { namespace CGAL {
@ -284,7 +285,16 @@ line_get_pointC2(const FT &a, const FT &b, const FT &c, int i,
{ {
if (CGAL_NTS is_zero(b)) if (CGAL_NTS is_zero(b))
{ {
x = (-b-c)/a + i * b; // Laurent Rineau, 2018/12/07: I add this CGAL_assume to calm
// down a warning from MSVC 2017:
// > include\cgal\constructions\kernel_ftc2.h(287) :
// > warning C4723: potential divide by 0
// The test `!boost::is_integral<FT>::value` is there to avoid
// that `a != 0` is tested on anything but integral types, for
// performance reasons.
CGAL_assume(!boost::is_integral<FT>::value || a != FT(0));
x = -c/a;
y = 1 - i * a; y = 1 - i * a;
} }
else else

View File

@ -6,6 +6,10 @@ if(NOT POLICY CMP0070 AND POLICY CMP0053)
cmake_policy(SET CMP0053 OLD) cmake_policy(SET CMP0053 OLD)
endif() endif()
if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL COMPONENTS Qt5) find_package(CGAL COMPONENTS Qt5)
find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL)

View File

@ -1,6 +1,6 @@
/*! /// \defgroup PkgClassificationRef Classification Reference
\defgroup PkgClassificationRef Classification Reference
/*!
\defgroup PkgClassificationConcepts Concepts \defgroup PkgClassificationConcepts Concepts
\ingroup PkgClassificationRef \ingroup PkgClassificationRef

View File

@ -38,6 +38,7 @@
# pragma warning(disable:4267) # pragma warning(disable:4267)
# pragma warning(disable:4275) # pragma warning(disable:4275)
# pragma warning(disable:4251) # pragma warning(disable:4251)
# pragma warning(disable:4996)
#endif #endif
#include <CGAL/Classification/internal/auxiliary/random-forest/node-gini.hpp> #include <CGAL/Classification/internal/auxiliary/random-forest/node-gini.hpp>

View File

@ -1,5 +1,3 @@
// PRETTY PACKAGE NAME should equal the project title in Doxyfile.in
/// \defgroup PkgConeSpanners2Ref Cone-Based Spanners Reference /// \defgroup PkgConeSpanners2Ref Cone-Based Spanners Reference
/*! /*!

View File

@ -93,7 +93,7 @@ function(configure_doxygen_package CGAL_PACKAGE_NAME)
file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "STRIP_FROM_INC_PATH = ${CGAL_PACKAGE_DOC_DIR}/\n") file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "STRIP_FROM_INC_PATH = ${CGAL_PACKAGE_DOC_DIR}/\n")
file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "STRIP_FROM_INC_PATH += ${CGAL_PACKAGE_DIR}/include/\n") file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "STRIP_FROM_INC_PATH += ${CGAL_PACKAGE_DIR}/include/\n")
file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "ALIASES += \"cgalPkgDescriptionBegin{2}=\\details \"\n") file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "ALIASES += \"cgalPkgDescriptionBegin{2}=\\details \"\n")
file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "ALIASES += \"cgalPkgManuals{2}=<BR>\"\n") file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "ALIASES += \"cgalPkgManuals{2}=<div class=\\\"PkgManuals\\\"></div>\"\n")
file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "INPUT = ${CGAL_PACKAGE_DOC_DIR}\n") file(APPEND ${CGAL_DOC_PACKAGE_DEFAULTS} "INPUT = ${CGAL_PACKAGE_DOC_DIR}\n")
if(NOT EXISTS "${CGAL_PACKAGE_DOC_DIR}/CGAL") if(NOT EXISTS "${CGAL_PACKAGE_DOC_DIR}/CGAL")
# This package has in-source documentation. # This package has in-source documentation.

View File

@ -102,7 +102,7 @@
,howpublished = {American National Standards Institute, 11 West 42nd ,howpublished = {American National Standards Institute, 11 West 42nd
Street, New York 10036} Street, New York 10036}
,year = 1998 ,year = 1998
,url = "http://webstore.ansi.org/" ,url = "https://webstore.ansi.org/"
,update = "04.03 kettner, 01.06 hoffmann" ,update = "04.03 kettner, 01.06 hoffmann"
} }
@ -281,8 +281,8 @@ Boissonnat}
,author = {Gavin Bell and Anthony Parisi and Mark Pesce} ,author = {Gavin Bell and Anthony Parisi and Mark Pesce}
,title = {VRML The Virtual Reality Modeling Language: ,title = {VRML The Virtual Reality Modeling Language:
Version 1.0 Specification} Version 1.0 Specification}
,howpublished = {\url{http://www.web3d.org/x3d/specifications/vrml/VRML1.0/index.html}} ,howpublished = {\url{http://www.web3d.org/standards}}
,url = "http://www.web3d.org/x3d/specifications/vrml/VRML1.0/index.html" ,url = "http://www.web3d.org/standards"
,month = {May 26} ,month = {May 26}
,year = 1995 ,year = 1995
,update = "13.04 lrineau" ,update = "13.04 lrineau"
@ -325,7 +325,7 @@ Boissonnat}
,school = "Universit\'e de {Nice-Sophia Antipolis}" ,school = "Universit\'e de {Nice-Sophia Antipolis}"
,address = "France" ,address = "France"
,year = 2010 ,year = 2010
,url = "http://tel.archives-ouvertes.fr/tel-00552215/" ,url = "https://tel.archives-ouvertes.fr/tel-00552215/"
} }
@article{cgal:cc-rgbss-78 @article{cgal:cc-rgbss-78
@ -448,7 +448,7 @@ note="Conference version: Symp. on Geometry Processing 2003"
, year = 2009 , year = 2009
, volume = 5757 , volume = 5757
, pages = "37--48" , pages = "37--48"
, note = "Full version available as INRIA Research Report 6823 \url{http://hal.inria.fr/inria-00356871}" , note = "Full version available as INRIA Research Report 6823 \url{https://hal.inria.fr/inria-00356871}"
} }
@inproceedings{cgal:pt-rs-14, @inproceedings{cgal:pt-rs-14,
@ -607,7 +607,7 @@ Mourrain and Monique Teillaud"
, nickname = "ALENEX '03" , nickname = "ALENEX '03"
, year = 2003 , year = 2003
, pages = "37--44" , pages = "37--44"
, url = "http://hal.inria.fr/inria-00344517/" , url = "https://hal.inria.fr/inria-00344517/"
} }
@article{ cgal:dpt-wt-02 @article{ cgal:dpt-wt-02
@ -626,7 +626,7 @@ Teillaud"
, author = "Olivier Devillers and Monique Teillaud" , author = "Olivier Devillers and Monique Teillaud"
, title = "Perturbations and Vertex Removal in a {3D Delaunay} Triangulation" , title = "Perturbations and Vertex Removal in a {3D Delaunay} Triangulation"
, booktitle = "Proc. 14th ACM-SIAM Sympos. Discrete Algorithms (SODA)" , booktitle = "Proc. 14th ACM-SIAM Sympos. Discrete Algorithms (SODA)"
, url = "http://hal.inria.fr/inria-00166710/" , url = "https://hal.inria.fr/inria-00166710/"
, year = 2003 , year = 2003
, pages = "313-319" , pages = "313-319"
} }
@ -1535,7 +1535,7 @@ ABSTRACT = {We present the first complete, exact and efficient C++ implementatio
,title = {The {LEDA} {U}ser {M}anual} ,title = {The {LEDA} {U}ser {M}anual}
,organization = {Algorithmic Solutions} ,organization = {Algorithmic Solutions}
,address = {66123 Saarbr\"ucken, Germany} ,address = {66123 Saarbr\"ucken, Germany}
,url = {http://www.algorithmic-solutions.info/leda_manual/manual.html} ,url = {http://www.algorithmic-solutions.info/leda_manual/MANUAL.html}
} }
@article{ cgal:mog-vbcfe-11 @article{ cgal:mog-vbcfe-11
@ -1593,7 +1593,7 @@ ABSTRACT = {We present the first complete, exact and efficient C++ implementatio
title = {{MPFR} - The Multiple Precision Floating-Point Reliable title = {{MPFR} - The Multiple Precision Floating-Point Reliable
Library}, Library},
howpublished = {The {MPFR} Team}, howpublished = {The {MPFR} Team},
url = {http://mpfr.org}, url = {https://mpfr.org},
update = "09.11 penarand" update = "09.11 penarand"
} }
@ -1774,7 +1774,6 @@ ABSTRACT = {We present the first complete, exact and efficient C++ implementatio
key = {RS}, key = {RS},
title = {{RS - A} Software for real solving of algebraic systems}, title = {{RS - A} Software for real solving of algebraic systems},
howpublished = {{R}ouillier, {F}abrice}, howpublished = {{R}ouillier, {F}abrice},
url = {http://www.loria.fr/equipes/vegas/rs/},
update = "09.11 penarand" update = "09.11 penarand"
} }
@ -1908,7 +1907,6 @@ ABSTRACT = {We present the first complete, exact and efficient C++ implementatio
@misc{ cgal:sgcsi-stlpg-97 @misc{ cgal:sgcsi-stlpg-97
,author = {{Silicon Graphics Computer Systems{,} Inc.}} ,author = {{Silicon Graphics Computer Systems{,} Inc.}}
,title = {Standard Template Library Programmer's Guide} ,title = {Standard Template Library Programmer's Guide}
,url = {http://www.sgi.com/Technology/STL/}
,year = 1997 ,year = 1997
,annote = {Web reference to the STL from SGI. ,annote = {Web reference to the STL from SGI.
recommended C++ and STL reference material.} recommended C++ and STL reference material.}
@ -1950,7 +1948,7 @@ ABSTRACT = {We present the first complete, exact and efficient C++ implementatio
,month = dec ,month = dec
,year = {2000} ,year = {2000}
,issn = {0946-011X} ,issn = {0946-011X}
,url = {http://www.mpi-sb.mpg.de/~mehlhorn/ftp/InfiFrames.ps} ,url = {https://www.mpi-sb.mpg.de/~mehlhorn/ftp/InfiFrames.ps}
} }
@InProceedings{cgal:sp-mrbee-05 @InProceedings{cgal:sp-mrbee-05
@ -2040,7 +2038,7 @@ location = {Salt Lake City, Utah, USA}
, pages = "75:1-75:9" , pages = "75:1-75:9"
, note = "SIGGRAPH '2009 Conference Proceedings" , note = "SIGGRAPH '2009 Conference Proceedings"
, volume = "28(3)" , volume = "28(3)"
, url = "http://hal.inria.fr/inria-00359288" , url = "https://hal.inria.fr/inria-00359288"
, geombib = "not yet" , geombib = "not yet"
, x-editorial-board = {yes} , x-editorial-board = {yes}
, x-proceedings = {yes} , x-proceedings = {yes}
@ -2173,7 +2171,7 @@ location = {Salt Lake City, Utah, USA}
howpublished = {Stefan Walk (ETH Zurich, Department of Civil, howpublished = {Stefan Walk (ETH Zurich, Department of Civil,
Environmental and Geomatic Engineering, Institute of Environmental and Geomatic Engineering, Institute of
Geodesy and Photogrammetry)}, Geodesy and Photogrammetry)},
url = {http://www.prs.igp.ethz.ch/research/Source_code_and_datasets.html}, url = {https://www.prs.igp.ethz.ch/research/Source_code_and_datasets.html},
year = 2014 year = 2014
@inproceedings{ cgal:wk-srhvs-05, @inproceedings{ cgal:wk-srhvs-05,
@ -2262,7 +2260,7 @@ location = {Salt Lake City, Utah, USA}
editor = "L{\'{a}}szl{\'{o}} Szirmay Kalos", editor = "L{\'{a}}szl{\'{o}} Szirmay Kalos",
pages = "210--218", pages = "210--218",
year = "1998", year = "1998",
url = "citeseer.ist.psu.edu/article/felkel98straight.html" url = "http://citeseer.ist.psu.edu/article/felkel98straight.html"
} }
@inproceedings{ cgal:ee-rrccpp-98, @inproceedings{ cgal:ee-rrccpp-98,
@ -2271,7 +2269,7 @@ location = {Salt Lake City, Utah, USA}
booktitle = "Symposium on Computational Geometry", booktitle = "Symposium on Computational Geometry",
pages = "58--67", pages = "58--67",
year = "1998", year = "1998",
url = "citeseer.ist.psu.edu/eppstein98raising.html" url = "http://citeseer.ist.psu.edu/eppstein98raising.html"
} }
@inproceedings{ cgal:ld-agrm-03, @inproceedings{ cgal:ld-agrm-03,
@ -2324,7 +2322,7 @@ pages = {69-79},
ee = {http://link.springer.de/link/service/series/0558/bibs/1766/17660069.htm}, ee = {http://link.springer.de/link/service/series/0558/bibs/1766/17660069.htm},
crossref = {cgal:jlm-isgp-98}, crossref = {cgal:jlm-isgp-98},
bibsource = {DBLP, http://dblp.uni-trier.de}, bibsource = {DBLP, http://dblp.uni-trier.de},
url = "http://www.boost.org/community/exception_safety.html" url = "https://www.boost.org/community/exception_safety.html"
} }
@misc{ cgal:asprs-lasf-13 @misc{ cgal:asprs-lasf-13
@ -2332,7 +2330,7 @@ url = "http://www.boost.org/community/exception_safety.html"
,title = "LASer ({LAS}) File Format Exchange Activities" ,title = "LASer ({LAS}) File Format Exchange Activities"
,howpublished = {American Society for Photogrammetry \& Remote Sensing} ,howpublished = {American Society for Photogrammetry \& Remote Sensing}
,year = 2013 ,year = 2013
,url = "https://www.asprs.org/committee-general/laser-las-file-format-exchange-activities.html" ,url = "https://www.asprs.org/divisions-committees/lidar-division/laser-las-file-format-exchange-activities"
} }
@article{cgal:as-solri-92 @article{cgal:as-solri-92
@ -2466,7 +2464,7 @@ author = "Pedro M.M. de Castro and Frederic Cazals and Sebastien Loriot and Moni
AUTHOR = {Otfried Cheong}, AUTHOR = {Otfried Cheong},
EDITION = {6.0pre32}, EDITION = {6.0pre32},
YEAR = {2009}, YEAR = {2009},
URL = {http://tclab.kaist.ac.kr/ipe/} URL = {http://ipe.otfried.org/}
} }
@misc{cgal:t-ocdl-05, @misc{cgal:t-ocdl-05,
@ -2484,7 +2482,7 @@ author = "Pedro M.M. de Castro and Frederic Cazals and Sebastien Loriot and Moni
editor = "Jacob E. Goodman, J\'anos Pach and Emo Welzl", editor = "Jacob E. Goodman, J\'anos Pach and Emo Welzl",
year = {2005}, year = {2005},
pages = {439-458}, pages = {439-458},
URL = {http://www.msri.org/communications/books/Book52/files/23liu.pdf}, URL = {http://library.msri.org/books/Book52/files/23liu.pdf},
publisher = {MSRI Publications} publisher = {MSRI Publications}
} }
@ -2497,7 +2495,7 @@ author = "Pedro M.M. de Castro and Frederic Cazals and Sebastien Loriot and Moni
, volume = "40" , volume = "40"
, number = "1" , number = "1"
, pages = "61-78" , pages = "61-78"
, url = "http://hal.inria.fr/inria-00344310/" , url = "https://hal.inria.fr/inria-00344310/"
, doi = "10.1016/j.comgeo.2007.06.003" , doi = "10.1016/j.comgeo.2007.06.003"
, x-international-audience = "yes" , x-international-audience = "yes"
, x-editorial-board = "yes" , x-editorial-board = "yes"
@ -2517,7 +2515,7 @@ author = "Pedro M.M. de Castro and Frederic Cazals and Sebastien Loriot and Moni
, title = "Complexity of {Delaunay} triangulation for points on lower-dimensional polyhedra" , title = "Complexity of {Delaunay} triangulation for points on lower-dimensional polyhedra"
, booktitle = "Proc. 18th ACM-SIAM Sympos. Discrete Algorithms" , booktitle = "Proc. 18th ACM-SIAM Sympos. Discrete Algorithms"
, nickname = "SODA" , nickname = "SODA"
, url = "http://hal.inria.fr/inria-00182835/" , url = "https://hal.inria.fr/inria-00182835/"
, year = 2007 , year = 2007
, pages = "1106--1113" , pages = "1106--1113"
} }
@ -2643,7 +2641,7 @@ ADDRESS = "Saarbr{\"u}cken, Germany"
author={Sorkine, Olga}, author={Sorkine, Olga},
year={2009}, year={2009},
pages={1-6}, pages={1-6},
howpublished = {http://igl.ethz.ch/projects/ARAP/} url = {https://igl.ethz.ch/projects/ARAP/}
@book{cgal:bc:m-dbc-27, @book{cgal:bc:m-dbc-27,
Address = {Leipzig}, Address = {Leipzig},
@ -2789,7 +2787,7 @@ pages = "207--221"
journal = {CoRR}, journal = {CoRR},
year = {2014}, year = {2014},
volume = {abs/1403.3905}, volume = {abs/1403.3905},
url = {http://arxiv.org/abs/1403.3905}, url = {https://arxiv.org/abs/1403.3905},
timestamp = {Wed, 17 Sep 2014 16:30:16 +0200}, timestamp = {Wed, 17 Sep 2014 16:30:16 +0200},
biburl = {http://dblp.uni-trier.de/rec/bib/journals/corr/BungiuHHHK14}, biburl = {http://dblp.uni-trier.de/rec/bib/journals/corr/BungiuHHHK14},
bibsource = {dblp computer science bibliography, http://dblp.org} bibsource = {dblp computer science bibliography, http://dblp.org}

View File

@ -7010,7 +7010,6 @@ cell neighborhood in $O(m)$ time."
, type = "Research {Report}" , type = "Research {Report}"
, institution = "Xerox PARC" , institution = "Xerox PARC"
, year = 1997 , year = 1997
, url = "http://www.geom.umn.edu/~nina/papers/crust.ps.gz"
, precedes = "abe-cbscc-98" , precedes = "abe-cbscc-98"
, update = "00.03 devillers, 98.03 devillers" , update = "00.03 devillers, 98.03 devillers"
} }
@ -11387,7 +11386,7 @@ method that uses very different techniques."
, address = "BP93, 06902 Sophia-Antipolis, France" , address = "BP93, 06902 Sophia-Antipolis, France"
, month = jun , month = jun
, year = 1993 , year = 1993
, url = "http://www.inria.fr/cgi-bin/wais_ra_sophia?question=1990" , url = "https://hal.inria.fr/inria-00074682"
, keywords = "parallel algorithms, hypercube, multisearching, point location" , keywords = "parallel algorithms, hypercube, multisearching, point location"
, update = "95.09 devillers, 95.01 devillers, 93.09 devillers+milone+mitchell" , update = "95.09 devillers, 95.01 devillers, 93.09 devillers+milone+mitchell"
} }
@ -19005,7 +19004,6 @@ $O(n^2)$ in the plane."
, address = "Berlin" , address = "Berlin"
, year = 1997 , year = 1997
, isbn = "3-540-61270-X" , isbn = "3-540-61270-X"
, url = "http://www.cs.ruu.nl/geobook/"
, keywords = "textbook" , keywords = "textbook"
, update = "98.03 agarwal+mitchell, 97.11 oostrum+orourke" , update = "98.03 agarwal+mitchell, 97.11 oostrum+orourke"
} }
@ -19734,7 +19732,7 @@ $O(n^2)$ in the plane."
, booktitle = "Proc. 11th Canad. Conf. Comput. Geom." , booktitle = "Proc. 11th Canad. Conf. Comput. Geom."
, year = 1999 , year = 1999
, pages = "13--16" , pages = "13--16"
, note = "Full version: http://arXiv.org/abs/cs/9908003/" , note = "Full version: https://arXiv.org/abs/cs/9908003/"
, url = "http://www.cs.ubc.ca/conferences/CCCG/elec_proc/elecproc.html" , url = "http://www.cs.ubc.ca/conferences/CCCG/elec_proc/elecproc.html"
, update = "01.11 orourke, 00.03 orourke" , update = "01.11 orourke, 00.03 orourke"
} }
@ -24218,7 +24216,7 @@ must lie in the halfplanes delimited by the query lines."
, volume = 8 , volume = 8
, year = 1992 , year = 1992
, pages = "51--71" , pages = "51--71"
, url = "http://www-sop.inria.fr/prisme/publis/bdsty-arsol-92.ps.gz" , url = "https://hal.inria.fr/inria-00090675"
, keywords = "randomized algorithms, Delaunay triangulation, semi-dynamic algorithms, arrangement of line-segments" , keywords = "randomized algorithms, Delaunay triangulation, semi-dynamic algorithms, arrangement of line-segments"
, succeeds = "bdsty-olgag-91i" , succeeds = "bdsty-olgag-91i"
, update = "99.11 bibrelex, 99.07 devillers, 98.07 bibrelex, 97.03 devillers, 96.01 devillers, 95.09 devillers, 95.01 devillers" , update = "99.11 bibrelex, 99.07 devillers, 98.07 bibrelex, 97.03 devillers, 96.01 devillers, 95.09 devillers, 95.01 devillers"
@ -24669,7 +24667,6 @@ present a polynomial-time exact algorithm to solve this problem."
, address = "UK" , address = "UK"
, year = 1998 , year = 1998
, note = "Translated by Herv{\'e} Br{\"o}nnimann" , note = "Translated by Herv{\'e} Br{\"o}nnimann"
, url = "http://www.cup.cam.ac.uk/Scripts/webbook.asp?isbn=0521563224"
, succeeds = "by-ga-95" , succeeds = "by-ga-95"
, update = "99.11 devillers, 99.07 devillers, 99.03 bibrelex+devillers, 98.07 devillers" , update = "99.11 devillers, 99.07 devillers, 99.03 bibrelex+devillers, 98.07 devillers"
, annote = "translated from {\cite{by-ga-95}} by Herv{\'e} Br{\"o}nnimann" , annote = "translated from {\cite{by-ga-95}} by Herv{\'e} Br{\"o}nnimann"
@ -24681,7 +24678,6 @@ present a polynomial-time exact algorithm to solve this problem."
, publisher = "Ediscience international" , publisher = "Ediscience international"
, address = "Paris" , address = "Paris"
, year = 1995 , year = 1995
, url = "http://www-sop.inria.fr/prisme/personnel/yvinec/livre.html"
, precedes = "by-ag-98" , precedes = "by-ag-98"
, update = "99.07 devillers, 99.03 bibrelex, 98.07 devillers, 96.01 devillers" , update = "99.07 devillers, 99.03 bibrelex, 98.07 devillers, 96.01 devillers"
} }
@ -27495,7 +27491,7 @@ and solids on dynamically evolving grids without remeshing."
, year = 1999 , year = 1999
, pages = "173--197" , pages = "173--197"
, note = "Special Issue on Real Numbers and Computers" , note = "Special Issue on Real Numbers and Computers"
, url = "http://www-sop.inria.fr/prisme/personnel/pion/publis/TCS.ps.gz" , url = "https://hal.inria.fr/inria-00344324"
, succeeds = "bepp-cegpu-97" , succeeds = "bepp-cegpu-97"
, update = "99.07 devillers" , update = "99.07 devillers"
} }
@ -44299,7 +44295,7 @@ Contains C code."
, booktitle = "Proc. 14th Annu. ACM Sympos. Comput. Geom." , booktitle = "Proc. 14th Annu. ACM Sympos. Comput. Geom."
, year = 1998 , year = 1998
, pages = "106--115" , pages = "106--115"
, url = "http://www-sop.inria.fr/prisme/publis/d-iirdt-98.ps.gz" , url = "https://hal.inria.fr/hal-01179446"
, archive = "XXX:cs.CG/9907024" , archive = "XXX:cs.CG/9907024"
, update = "99.11 bibrelex+devillers, 99.07 devillers, 98.11 devillers" , update = "99.11 bibrelex+devillers, 99.07 devillers, 98.11 devillers"
, abstract = "We propose a new data structure to compute the Delaunay triangulation of a set of points in the plane. It combines good worst case complexity, fast behavior on real data, and small memory occupation. The location structure is organized into several levels. The lowest level just consists of the triangulation, then each level contains the triangulation of a small sample of the levels below. Point location is done by marching in a triangulation to determine the nearest neighbor of the query at that level, then the march restarts from that neighbor at the level below. Using a small sample (3 {\%}) allows a small memory occupation; the march and the use of the nearest neighbor to change levels quickly locate the query." , abstract = "We propose a new data structure to compute the Delaunay triangulation of a set of points in the plane. It combines good worst case complexity, fast behavior on real data, and small memory occupation. The location structure is organized into several levels. The lowest level just consists of the triangulation, then each level contains the triangulation of a small sample of the levels below. Point location is done by marching in a triangulation to determine the nearest neighbor of the query at that level, then the march restarts from that neighbor at the level below. Using a small sample (3 {\%}) allows a small memory occupation; the march and the use of the nearest neighbor to change levels quickly locate the query."
@ -44337,7 +44333,7 @@ Contains C code."
, year = 2009 , year = 2009
, type = "Research Report" , type = "Research Report"
, number = 7104 , number = 7104
, url = "http://hal.inria.fr/inria-00433107/" , url = "https://hal.inria.fr/inria-00433107/"
} }
@inproceedings{d-ddt-99 @inproceedings{d-ddt-99
@ -44363,7 +44359,7 @@ Contains C code."
, number = 1 , number = 1
, year = 1992 , year = 1992
, pages = "97--111" , pages = "97--111"
, url = "http://www-sop.inria.fr/prisme/publis/d-rysoa-92.ps.gz" , url = "https://hal.inria.fr/inria-00167206"
, archive = "XXX:cs.CG/9810007" , archive = "XXX:cs.CG/9810007"
, keywords = "randomized algorithms, Delaunay triangulation, skeleton, medial axis, minimum spanning tree, simple polygon" , keywords = "randomized algorithms, Delaunay triangulation, skeleton, medial axis, minimum spanning tree, simple polygon"
, succeeds = "d-sroa-91" , succeeds = "d-sroa-91"
@ -44583,7 +44579,7 @@ respectively, we obtain a speedup of $\frac p{\log p}$."
, number = 3 , number = 3
, year = 1995 , year = 1995
, pages = "157--164" , pages = "157--164"
, url = "http://www-sop.inria.fr/prisme/biblio/search.html" , url = "https://hal.inria.fr/inria-00074391"
, succeeds = "dg-iafch-94" , succeeds = "dg-iafch-94"
, cites = "a-dcgp-85, bcddy-acchs-92, r-chada-92" , cites = "a-dcgp-85, bcddy-acchs-92, r-chada-92"
, update = "99.11 devillers, 99.07 devillers, 96.01 devillers" , update = "99.11 devillers, 99.07 devillers, 96.01 devillers"
@ -44838,7 +44834,7 @@ respectively, we obtain a speedup of $\frac p{\log p}$."
, volume = 20 , volume = 20
, year = 1998 , year = 1998
, pages = "523--547" , pages = "523--547"
, url = "http://www-sop.inria.fr/prisme/publis/dp-papaf-98.ps.gz" , url = "https://hal.inria.fr/inria-00090653"
, archive = "XXX:cs.CG/9907029" , archive = "XXX:cs.CG/9907029"
, succeeds = "dp-papaf-96" , succeeds = "dp-papaf-96"
, cites = "b-g-87, bkmnsu-egcl-95, bms-hcvdl-94, fv-eeacg-93, lpt-rpqiv-96, mn-iga-94, y-tegc-97" , cites = "b-g-87, bkmnsu-egcl-95, bms-hcvdl-94, fv-eeacg-93, lpt-rpqiv-96, mn-iga-94, y-tegc-97"
@ -52318,7 +52314,6 @@ library."
, month = jan , month = jan
, year = 1994 , year = 1994
, pages = "43--72" , pages = "43--72"
, url = "https://users.cs.duke.edu/~edels/Papers/1994-J-04-3DAlphaShapes.pdf"
, comments = "Software in \url{ftp://cs.uiuc.edu/pub/edels/geometry/alpha-2.1a.tar.Z}" , comments = "Software in \url{ftp://cs.uiuc.edu/pub/edels/geometry/alpha-2.1a.tar.Z}"
, update = "94.09 orourke" , update = "94.09 orourke"
} }
@ -68865,7 +68860,7 @@ generated in O(dn2d+1) time. We present a simple proof that the (d -
@misc{g-ggmpa @misc{g-ggmpa
, author = "Torbj{\"o}rn Granlund" , author = "Torbj{\"o}rn Granlund"
, title = "{GMP}, The {GNU} Multiple Precision Arithmetic Library" , title = "{GMP}, The {GNU} Multiple Precision Arithmetic Library"
, url = "http://gmplib.org/" , url = "https://gmplib.org/"
, update = "02.03 devillers" , update = "02.03 devillers"
} }
@ -85658,7 +85653,7 @@ fitting method."
, title = "The {CORE} Library Project" , title = "The {CORE} Library Project"
, edition = "1.2" , edition = "1.2"
, year = 1999 , year = 1999
, url = "http://www.cs.nyu.edu/exact/core/" , url = "https://www.cs.nyu.edu/exact/core/"
, update = "00.03 devillers" , update = "00.03 devillers"
} }
@ -140391,7 +140386,7 @@ code."
, publisher = "INRIA Sophia-Antipolis" , publisher = "INRIA Sophia-Antipolis"
, year = 1999 , year = 1999
, pages = "175--178" , pages = "175--178"
, url = "ftp://ftp-sop.inria.fr/geometrica/publis/t-3tc-99.pdf" , url = "https://hal.inria.fr/inria-00167199"
, update = "00.03 bibrelex+devillers, 99.07 bibrelex" , update = "00.03 bibrelex+devillers, 99.07 bibrelex"
} }
@ -150728,7 +150723,6 @@ This improves previous bound of $O(mt+m\log m)$ in
, address = "Singapore" , address = "Singapore"
, year = 1995 , year = 1995
, pages = "452--492" , pages = "452--492"
, url = "http://cs.nyu.edu/cs/faculty/yap/papers/paradigm.ps"
, keywords = "survey paper, numeral computing, exact compuation, fixed-precision, multiprecision number packages" , keywords = "survey paper, numeral computing, exact compuation, fixed-precision, multiprecision number packages"
, update = "98.07 icking+vismara, 97.11 icking, 97.03 devillers+pocchiola" , update = "98.07 icking+vismara, 97.11 icking, 97.03 devillers+pocchiola"
, abstract = "A survey of the approaches to non-robustness of geometric algorithms, and especially the exact computation approach. Also surveys available big-number packages." , abstract = "A survey of the approaches to non-robustness of geometric algorithms, and especially the exact computation approach. Also surveys available big-number packages."
@ -151944,7 +151938,7 @@ pages = {179--189}
, number = "RR-8467" , number = "RR-8467"
, month = "Feb" , month = "Feb"
, year = "2014" , year = "2014"
, url = "http://hal.inria.fr/hal-00943409" , url = "https://hal.inria.fr/hal-00943409"
} }
@article{XinWang2009improvingchenandhan, @article{XinWang2009improvingchenandhan,

View File

@ -250,9 +250,9 @@ ALIASES = "sc{1}=<span style=\"font-variant: small-caps;\">\1</sp
"cgalFigureBegin{8}=\anchor fig__\1 \n <CENTER> <TABLE border=0> <TR> <TD> \image html \2 \n \image latex \2 \"\" width=2.1cm \n </TD> <TD> \image html \3 \n \image latex \3 \"\" width=2.1cm \n </TD> <TD> \image html \4 \n \image latex \4 \"\" width=2.1cm \n </TD> <TD> \image html \5 \n \image latex \5 \"\" width=2.1cm \n </TD> <TD> \image html \6 \n \image latex \6 \"\" width=2.1cm \n </TD> <TD> \image html \7 \n \image latex \7 \"\" width=2.1cm \n </TD> <TD> \image html \8 \n \image latex \8 \"\" width=2.1cm \n </TD> </TR> </TABLE> </CENTER> \htmlonly <div class=\"cgal_figure_caption\"> \endhtmlonly \n \latexonly \n \endlatexonly \ref fig__\1" \ "cgalFigureBegin{8}=\anchor fig__\1 \n <CENTER> <TABLE border=0> <TR> <TD> \image html \2 \n \image latex \2 \"\" width=2.1cm \n </TD> <TD> \image html \3 \n \image latex \3 \"\" width=2.1cm \n </TD> <TD> \image html \4 \n \image latex \4 \"\" width=2.1cm \n </TD> <TD> \image html \5 \n \image latex \5 \"\" width=2.1cm \n </TD> <TD> \image html \6 \n \image latex \6 \"\" width=2.1cm \n </TD> <TD> \image html \7 \n \image latex \7 \"\" width=2.1cm \n </TD> <TD> \image html \8 \n \image latex \8 \"\" width=2.1cm \n </TD> </TR> </TABLE> </CENTER> \htmlonly <div class=\"cgal_figure_caption\"> \endhtmlonly \n \latexonly \n \endlatexonly \ref fig__\1" \
"cgalFigureBegin{9}=\anchor fig__\1 \n <CENTER> <TABLE border=0> <TR> <TD> \image html \2 \n \image latex \2 \"\" width=1.9cm \n </TD> <TD> \image html \3 \n \image latex \3 \"\" width=1.9cm \n </TD> <TD> \image html \4 \n \image latex \4 \"\" width=1.9cm \n </TD> <TD> \image html \5 \n \image latex \5 \"\" width=1.9cm \n </TD> <TD> \image html \6 \n \image latex \6 \"\" width=1.9cm \n </TD> <TD> \image html \7 \n \image latex \7 \"\" width=1.9cm \n </TD> <TD> \image html \8 \n \image latex \8 \"\" width=1.9cm \n </TD> <TD> \image html \9 \n \image latex \9 \"\" width=1.9cm \n </TD> </TR> </TABLE> </CENTER> \htmlonly <div class=\"cgal_figure_caption\"> \endhtmlonly \n \latexonly \n \endlatexonly \ref fig__\1" \ "cgalFigureBegin{9}=\anchor fig__\1 \n <CENTER> <TABLE border=0> <TR> <TD> \image html \2 \n \image latex \2 \"\" width=1.9cm \n </TD> <TD> \image html \3 \n \image latex \3 \"\" width=1.9cm \n </TD> <TD> \image html \4 \n \image latex \4 \"\" width=1.9cm \n </TD> <TD> \image html \5 \n \image latex \5 \"\" width=1.9cm \n </TD> <TD> \image html \6 \n \image latex \6 \"\" width=1.9cm \n </TD> <TD> \image html \7 \n \image latex \7 \"\" width=1.9cm \n </TD> <TD> \image html \8 \n \image latex \8 \"\" width=1.9cm \n </TD> <TD> \image html \9 \n \image latex \9 \"\" width=1.9cm \n </TD> </TR> </TABLE> </CENTER> \htmlonly <div class=\"cgal_figure_caption\"> \endhtmlonly \n \latexonly \n \endlatexonly \ref fig__\1" \
"cgalFigureBegin{10}=\anchor fig__\1 \n <CENTER> <TABLE border=0> <TR> <TD> \image html \2 \n \image latex \2 \"\" width=1.6cm \n </TD> <TD> \image html \3 \n \image latex \3 \"\" width=1.6cm \n </TD> <TD> \image html \4 \n \image latex \4 \"\" width=1.6cm \n </TD> <TD> \image html \5 \n \image latex \5 \"\" width=1.6cm \n </TD> <TD> \image html \6 \n \image latex \6 \"\" width=1.6cm \n </TD> <TD> \image html \7 \n \image latex \7 \"\" width=1.6cm \n </TD> <TD> \image html \8 \n \image latex \8 \"\" width=1.6cm \n </TD> <TD> \image html \9 \n \image latex \9 \"\" width=1.6cm \n </TD> <TD> \image html \10 \n \image latex \10 \"\" width=1.6cm \n </TD> </TR> </TABLE> </CENTER> \htmlonly <div class=\"cgal_figure_caption\"> \endhtmlonly \n \latexonly \n \endlatexonly \ref fig__\1" \ "cgalFigureBegin{10}=\anchor fig__\1 \n <CENTER> <TABLE border=0> <TR> <TD> \image html \2 \n \image latex \2 \"\" width=1.6cm \n </TD> <TD> \image html \3 \n \image latex \3 \"\" width=1.6cm \n </TD> <TD> \image html \4 \n \image latex \4 \"\" width=1.6cm \n </TD> <TD> \image html \5 \n \image latex \5 \"\" width=1.6cm \n </TD> <TD> \image html \6 \n \image latex \6 \"\" width=1.6cm \n </TD> <TD> \image html \7 \n \image latex \7 \"\" width=1.6cm \n </TD> <TD> \image html \8 \n \image latex \8 \"\" width=1.6cm \n </TD> <TD> \image html \9 \n \image latex \9 \"\" width=1.6cm \n </TD> <TD> \image html \10 \n \image latex \10 \"\" width=1.6cm \n </TD> </TR> </TABLE> </CENTER> \htmlonly <div class=\"cgal_figure_caption\"> \endhtmlonly \n \latexonly \n \endlatexonly \ref fig__\1" \
"cgalFigureEnd=\htmlonly </div> \endhtmlonly <br>" \ "cgalFigureEnd=\htmlonly </div> <br> \endhtmlonly" \
"cgalFigureCaptionBegin{1}=\htmlonly <div class=\"cgal_figure_caption\"> \endhtmlonly \ref fig__\1" \ "cgalFigureCaptionBegin{1}=\htmlonly <div class=\"cgal_figure_caption\"> \endhtmlonly \ref fig__\1" \
"cgalFigureCaptionEnd=\htmlonly </div> \endhtmlonly <br>" \ "cgalFigureCaptionEnd=\htmlonly </div> <br> \endhtmlonly" \
"cgalConcept=\details <div id=\"CGALConcept\"></div>\n \brief" \ "cgalConcept=\details <div id=\"CGALConcept\"></div>\n \brief" \
"cgalConceptNamespace=\details <div id=\"CGALConceptNS\"></div>\n \brief" \ "cgalConceptNamespace=\details <div id=\"CGALConceptNS\"></div>\n \brief" \
"cgalRefines=\xrefitem refines \"Refines\" \"Refinement Relationships\"" \ "cgalRefines=\xrefitem refines \"Refines\" \"Refinement Relationships\"" \

View File

@ -1,4 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>

View File

@ -1,8 +1,8 @@
<!-- HTML header for doxygen 1.8.13--> <!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<link rel="icon" type="image/png" href="$relpath$../Manual/g-196x196-doc.png"> <link rel="icon" type="image/png" href="$relpath$../Manual/g-196x196-doc.png"/>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen $doxygenversion"/> <meta name="generator" content="Doxygen $doxygenversion"/>

View File

@ -1,8 +1,8 @@
<!-- HTML header for doxygen 1.8.13--> <!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<link rel="icon" type="image/png" href="$relpath$../Manual/g-196x196-doc.png"> <link rel="icon" type="image/png" href="$relpath$../Manual/g-196x196-doc.png" />
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen $doxygenversion"/> <meta name="generator" content="Doxygen $doxygenversion"/>

View File

@ -242,29 +242,29 @@ ALIASES = "sc{1}=<span style=\"font-variant: small-caps;\">\1</sp
"cgalExample{1}=<br><b>File</b> \ref \1 \include \1" \ "cgalExample{1}=<br><b>File</b> \ref \1 \include \1" \
"cgalFigureAnchor{1}=\anchor fig__\1" \ "cgalFigureAnchor{1}=\anchor fig__\1" \
"cgalFigureRef{1}=\ref fig__\1" \ "cgalFigureRef{1}=\ref fig__\1" \
"cgalFigureBegin{2}=\anchor fig__\1 ^^ \image html \2 ^^ \image latex \2 \"\" width=15cm ^^ \htmlonly <div class=\"cgal_figure_caption\"> \endhtmlonly \latexonly ^^ \endlatexonly ^^ \ref fig__\1" \ "cgalFigureBegin{2}=\anchor fig__\1 ^^ \image html \2 ^^ \image latex \2 \"\" width=15cm ^^ \htmlonly[block] <div class=\"cgal_figure_caption\"> \endhtmlonly \latexonly ^^ \endlatexonly ^^ \ref fig__\1" \
"cgalFigureBegin{3}=\anchor fig__\1 ^^ <CENTER> <TABLE border=0> <TR> <TD> \image html \2 ^^ \image latex \2 \"\" width=7.5cm ^^ </TD> <TD> \image html \3 ^^ \image latex \3 \"\" width=7.5cm ^^ </TD> </TR> </TABLE> </CENTER> \htmlonly <div class=\"cgal_figure_caption\"> \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \ "cgalFigureBegin{3}=\anchor fig__\1 ^^ <CENTER> <TABLE border=0> <TR> <TD> \image html \2 ^^ \image latex \2 \"\" width=7.5cm ^^ </TD> <TD> \image html \3 ^^ \image latex \3 \"\" width=7.5cm ^^ </TD> </TR> </TABLE> </CENTER> \htmlonly[block] <div class=\"cgal_figure_caption\"> \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \
"cgalFigureBegin{4}=\anchor fig__\1 ^^ <CENTER> <TABLE border=0> <TR> <TD> \image html \2 ^^ \image latex \2 \"\" width=5cm ^^ </TD> <TD> \image html \3 ^^ \image latex \3 \"\" width=5cm ^^ </TD> <TD> \image html \4 ^^ \image latex \4 \"\" width=5cm ^^ </TD> </TR> </TABLE> </CENTER> \htmlonly <div class=\"cgal_figure_caption\"> \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \ "cgalFigureBegin{4}=\anchor fig__\1 ^^ <CENTER> <TABLE border=0> <TR> <TD> \image html \2 ^^ \image latex \2 \"\" width=5cm ^^ </TD> <TD> \image html \3 ^^ \image latex \3 \"\" width=5cm ^^ </TD> <TD> \image html \4 ^^ \image latex \4 \"\" width=5cm ^^ </TD> </TR> </TABLE> </CENTER> \htmlonly[block] <div class=\"cgal_figure_caption\"> \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \
"cgalFigureBegin{5}=\anchor fig__\1 ^^ <CENTER> <TABLE border=0> <TR> <TD> \image html \2 ^^ \image latex \2 \"\" width=3.75cm ^^ </TD> <TD> \image html \3 ^^ \image latex \3 \"\" width=3.75cm ^^ </TD> <TD> \image html \4 ^^ \image latex \4 \"\" width=3.75cm ^^ </TD> <TD> \image html \5 ^^ \image latex \5 \"\" width=3.75cm ^^ </TD> </TR> </TABLE> </CENTER> \htmlonly <div class=\"cgal_figure_caption\"> \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \ "cgalFigureBegin{5}=\anchor fig__\1 ^^ <CENTER> <TABLE border=0> <TR> <TD> \image html \2 ^^ \image latex \2 \"\" width=3.75cm ^^ </TD> <TD> \image html \3 ^^ \image latex \3 \"\" width=3.75cm ^^ </TD> <TD> \image html \4 ^^ \image latex \4 \"\" width=3.75cm ^^ </TD> <TD> \image html \5 ^^ \image latex \5 \"\" width=3.75cm ^^ </TD> </TR> </TABLE> </CENTER> \htmlonly[block] <div class=\"cgal_figure_caption\"> \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \
"cgalFigureBegin{6}=\anchor fig__\1 ^^ <CENTER> <TABLE border=0> <TR> <TD> \image html \2 ^^ \image latex \2 \"\" width=3cm ^^ </TD> <TD> \image html \3 ^^ \image latex \3 \"\" width=3cm ^^ </TD> <TD> \image html \4 ^^ \image latex \4 \"\" width=3cm ^^ </TD> <TD> \image html \5 ^^ \image latex \5 \"\" width=3cm ^^ </TD> <TD> \image html \6 ^^ \image latex \6 \"\" width=3cm ^^ </TD> </TR> </TABLE> </CENTER> \htmlonly <div class=\"cgal_figure_caption\"> \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \ "cgalFigureBegin{6}=\anchor fig__\1 ^^ <CENTER> <TABLE border=0> <TR> <TD> \image html \2 ^^ \image latex \2 \"\" width=3cm ^^ </TD> <TD> \image html \3 ^^ \image latex \3 \"\" width=3cm ^^ </TD> <TD> \image html \4 ^^ \image latex \4 \"\" width=3cm ^^ </TD> <TD> \image html \5 ^^ \image latex \5 \"\" width=3cm ^^ </TD> <TD> \image html \6 ^^ \image latex \6 \"\" width=3cm ^^ </TD> </TR> </TABLE> </CENTER> \htmlonly[block] <div class=\"cgal_figure_caption\"> \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \
"cgalFigureBegin{7}=\anchor fig__\1 ^^ <CENTER> <TABLE border=0> <TR> <TD> \image html \2 ^^ \image latex \2 \"\" width=2.5cm ^^ </TD> <TD> \image html \3 ^^ \image latex \3 \"\" width=2.5cm ^^ </TD> <TD> \image html \4 ^^ \image latex \4 \"\" width=2.5cm ^^ </TD> <TD> \image html \5 ^^ \image latex \5 \"\" width=2.5cm ^^ </TD> <TD> \image html \6 ^^ \image latex \6 \"\" width=2.5cm ^^ </TD> <TD> \image html \7 ^^ \image latex \7 \"\" width=2.5cm ^^ </TD> </TR> </TABLE> </CENTER> \htmlonly <div class=\"cgal_figure_caption\"> \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \ "cgalFigureBegin{7}=\anchor fig__\1 ^^ <CENTER> <TABLE border=0> <TR> <TD> \image html \2 ^^ \image latex \2 \"\" width=2.5cm ^^ </TD> <TD> \image html \3 ^^ \image latex \3 \"\" width=2.5cm ^^ </TD> <TD> \image html \4 ^^ \image latex \4 \"\" width=2.5cm ^^ </TD> <TD> \image html \5 ^^ \image latex \5 \"\" width=2.5cm ^^ </TD> <TD> \image html \6 ^^ \image latex \6 \"\" width=2.5cm ^^ </TD> <TD> \image html \7 ^^ \image latex \7 \"\" width=2.5cm ^^ </TD> </TR> </TABLE> </CENTER> \htmlonly[block] <div class=\"cgal_figure_caption\"> \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \
"cgalFigureBegin{8}=\anchor fig__\1 ^^ <CENTER> <TABLE border=0> <TR> <TD> \image html \2 ^^ \image latex \2 \"\" width=2.1cm ^^ </TD> <TD> \image html \3 ^^ \image latex \3 \"\" width=2.1cm ^^ </TD> <TD> \image html \4 ^^ \image latex \4 \"\" width=2.1cm ^^ </TD> <TD> \image html \5 ^^ \image latex \5 \"\" width=2.1cm ^^ </TD> <TD> \image html \6 ^^ \image latex \6 \"\" width=2.1cm ^^ </TD> <TD> \image html \7 ^^ \image latex \7 \"\" width=2.1cm ^^ </TD> <TD> \image html \8 ^^ \image latex \8 \"\" width=2.1cm ^^ </TD> </TR> </TABLE> </CENTER> \htmlonly <div class=\"cgal_figure_caption\"> \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \ "cgalFigureBegin{8}=\anchor fig__\1 ^^ <CENTER> <TABLE border=0> <TR> <TD> \image html \2 ^^ \image latex \2 \"\" width=2.1cm ^^ </TD> <TD> \image html \3 ^^ \image latex \3 \"\" width=2.1cm ^^ </TD> <TD> \image html \4 ^^ \image latex \4 \"\" width=2.1cm ^^ </TD> <TD> \image html \5 ^^ \image latex \5 \"\" width=2.1cm ^^ </TD> <TD> \image html \6 ^^ \image latex \6 \"\" width=2.1cm ^^ </TD> <TD> \image html \7 ^^ \image latex \7 \"\" width=2.1cm ^^ </TD> <TD> \image html \8 ^^ \image latex \8 \"\" width=2.1cm ^^ </TD> </TR> </TABLE> </CENTER> \htmlonly[block] <div class=\"cgal_figure_caption\"> \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \
"cgalFigureBegin{9}=\anchor fig__\1 ^^ <CENTER> <TABLE border=0> <TR> <TD> \image html \2 ^^ \image latex \2 \"\" width=1.9cm ^^ </TD> <TD> \image html \3 ^^ \image latex \3 \"\" width=1.9cm ^^ </TD> <TD> \image html \4 ^^ \image latex \4 \"\" width=1.9cm ^^ </TD> <TD> \image html \5 ^^ \image latex \5 \"\" width=1.9cm ^^ </TD> <TD> \image html \6 ^^ \image latex \6 \"\" width=1.9cm ^^ </TD> <TD> \image html \7 ^^ \image latex \7 \"\" width=1.9cm ^^ </TD> <TD> \image html \8 ^^ \image latex \8 \"\" width=1.9cm ^^ </TD> <TD> \image html \9 ^^ \image latex \9 \"\" width=1.9cm ^^ </TD> </TR> </TABLE> </CENTER> \htmlonly <div class=\"cgal_figure_caption\"> \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \ "cgalFigureBegin{9}=\anchor fig__\1 ^^ <CENTER> <TABLE border=0> <TR> <TD> \image html \2 ^^ \image latex \2 \"\" width=1.9cm ^^ </TD> <TD> \image html \3 ^^ \image latex \3 \"\" width=1.9cm ^^ </TD> <TD> \image html \4 ^^ \image latex \4 \"\" width=1.9cm ^^ </TD> <TD> \image html \5 ^^ \image latex \5 \"\" width=1.9cm ^^ </TD> <TD> \image html \6 ^^ \image latex \6 \"\" width=1.9cm ^^ </TD> <TD> \image html \7 ^^ \image latex \7 \"\" width=1.9cm ^^ </TD> <TD> \image html \8 ^^ \image latex \8 \"\" width=1.9cm ^^ </TD> <TD> \image html \9 ^^ \image latex \9 \"\" width=1.9cm ^^ </TD> </TR> </TABLE> </CENTER> \htmlonly[block] <div class=\"cgal_figure_caption\"> \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \
"cgalFigureBegin{10}=\anchor fig__\1 ^^ <CENTER> <TABLE border=0> <TR> <TD> \image html \2 ^^ \image latex \2 \"\" width=1.6cm ^^ </TD> <TD> \image html \3 ^^ \image latex \3 \"\" width=1.6cm ^^ </TD> <TD> \image html \4 ^^ \image latex \4 \"\" width=1.6cm ^^ </TD> <TD> \image html \5 ^^ \image latex \5 \"\" width=1.6cm ^^ </TD> <TD> \image html \6 ^^ \image latex \6 \"\" width=1.6cm ^^ </TD> <TD> \image html \7 ^^ \image latex \7 \"\" width=1.6cm ^^ </TD> <TD> \image html \8 ^^ \image latex \8 \"\" width=1.6cm ^^ </TD> <TD> \image html \9 ^^ \image latex \9 \"\" width=1.6cm ^^ </TD> <TD> \image html \10 ^^ \image latex \10 \"\" width=1.6cm ^^ </TD> </TR> </TABLE> </CENTER> \htmlonly <div class=\"cgal_figure_caption\"> \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \ "cgalFigureBegin{10}=\anchor fig__\1 ^^ <CENTER> <TABLE border=0> <TR> <TD> \image html \2 ^^ \image latex \2 \"\" width=1.6cm ^^ </TD> <TD> \image html \3 ^^ \image latex \3 \"\" width=1.6cm ^^ </TD> <TD> \image html \4 ^^ \image latex \4 \"\" width=1.6cm ^^ </TD> <TD> \image html \5 ^^ \image latex \5 \"\" width=1.6cm ^^ </TD> <TD> \image html \6 ^^ \image latex \6 \"\" width=1.6cm ^^ </TD> <TD> \image html \7 ^^ \image latex \7 \"\" width=1.6cm ^^ </TD> <TD> \image html \8 ^^ \image latex \8 \"\" width=1.6cm ^^ </TD> <TD> \image html \9 ^^ \image latex \9 \"\" width=1.6cm ^^ </TD> <TD> \image html \10 ^^ \image latex \10 \"\" width=1.6cm ^^ </TD> </TR> </TABLE> </CENTER> \htmlonly[block] <div class=\"cgal_figure_caption\"> \endhtmlonly ^^ \latexonly ^^ \endlatexonly \ref fig__\1" \
"cgalFigureEnd=\htmlonly </div> \endhtmlonly <br>" \ "cgalFigureEnd=\htmlonly[block] </div> \endhtmlonly <br>" \
"cgalFigureCaptionBegin{1}=\htmlonly <div class=\"cgal_figure_caption\"> \endhtmlonly \ref fig__\1" \ "cgalFigureCaptionBegin{1}=\htmlonly[block] <div class=\"cgal_figure_caption\"> \endhtmlonly \ref fig__\1" \
"cgalFigureCaptionEnd=\htmlonly </div> \endhtmlonly <br>" \ "cgalFigureCaptionEnd=\htmlonly[block] </div> \endhtmlonly <br>" \
"cgalConcept=\details <div id=\"CGALConcept\"></div>^^ \brief" \ "cgalConcept=\details <div id=\"CGALConcept\"></div>^^ \brief" \
"cgalConceptNamespace=\details <div id=\"CGALConceptNS\"></div>^^ \brief" \ "cgalConceptNamespace=\details <div id=\"CGALConceptNS\"></div>^^ \brief" \
"cgalRefines=\xrefitem refines \"Refines\" \"Refinement Relationships\"" \ "cgalRefines=\xrefitem refines \"Refines\" \"Refinement Relationships\"" \
"cgalModels=\xrefitem models \"Is Model Of\" \"Is Model Relationships\"" \ "cgalModels=\xrefitem models \"Is Model Of\" \"Is Model Relationships\"" \
"cgalGeneralizes=\xrefitem generalizes \"Generalizes\" \"Generalization Relationships\"" \ "cgalGeneralizes=\xrefitem generalizes \"Generalizes\" \"Generalization Relationships\"" \
"cgalHasModel=\xrefitem hasModels \"Has Models\" \"Has Model Relationships\"" \ "cgalHasModel=\xrefitem hasModels \"Has Models\" \"Has Model Relationships\"" \
"cgalDebugBegin=\htmlonly <div class=\"CGALDebug\"> <div>Debugging Support</div> \endhtmlonly ^^" \ "cgalDebugBegin=\htmlonly[block] <div class=\"CGALDebug\"> <div>Debugging Support</div> \endhtmlonly ^^" \
"cgalDebugEnd=\htmlonly </div> \endhtmlonly" \ "cgalDebugEnd=\htmlonly[block] </div> \endhtmlonly" \
"cgalDebugFunction=This is a function for debugging purpose." \ "cgalDebugFunction=This is a function for debugging purpose." \
"cgalAdvancedBegin=\htmlonly <div class=\"CGALAdvanced\"> <div>Advanced</div> \endhtmlonly ^^" \ "cgalAdvancedBegin=\htmlonly[block] <div class=\"CGALAdvanced\"> <div>Advanced</div> \endhtmlonly ^^" \
"cgalAdvancedEnd=\htmlonly </div> \endhtmlonly" \ "cgalAdvancedEnd=\htmlonly[block] </div> \endhtmlonly" \
"cgalAdvancedFunction=This is an advanced function." \ "cgalAdvancedFunction=This is an advanced function." \
"cgalAdvancedClass=This is an advanced class." \ "cgalAdvancedClass=This is an advanced class." \
"cgalRequiresCPP11=\warning This function requires a C++11 compiler." \ "cgalRequiresCPP11=\warning This function requires a C++11 compiler." \
@ -287,11 +287,11 @@ ALIASES = "sc{1}=<span style=\"font-variant: small-caps;\">\1</sp
"cgalModifEnd=\htmlonly </div> \endhtmlonly \latexonly END MODIFICATIONS \endlatexonly" \ "cgalModifEnd=\htmlonly </div> \endhtmlonly \latexonly END MODIFICATIONS \endlatexonly" \
"cgalPkgBib{1}=<B>BibTeX:</B> <a href=\"../Manual/how_to_cite_cgal.html#\1-${CGAL_RELEASE_YEAR_ID}\">\1-${CGAL_RELEASE_YEAR_ID}</a><BR>" \ "cgalPkgBib{1}=<B>BibTeX:</B> <a href=\"../Manual/how_to_cite_cgal.html#\1-${CGAL_RELEASE_YEAR_ID}\">\1-${CGAL_RELEASE_YEAR_ID}</a><BR>" \
"cgalFootnote{1}=<span class=\"footnote\">\1</span>" \ "cgalFootnote{1}=<span class=\"footnote\">\1</span>" \
"cgalAutoToc=\htmlonly <div id=\"autotoc\" class=\"toc\"></div> \endhtmlonly" \ "cgalAutoToc=\htmlonly[block] <div id=\"autotoc\" class=\"toc\"></div> \endhtmlonly" \
"cgalTagTrue=\link CGAL::Tag_true `CGAL::Tag_true`\endlink" \ "cgalTagTrue=\link CGAL::Tag_true `CGAL::Tag_true`\endlink" \
"cgalTagFalse=\link CGAL::Tag_false `CGAL::Tag_false`\endlink" \ "cgalTagFalse=\link CGAL::Tag_false `CGAL::Tag_false`\endlink" \
"cgalHeading{1}= <B>\1</B><BR>" \ "cgalHeading{1}= <B>\1</B><BR>" \
"cgalClassifedRefPages=\htmlonly <h2 class=\"groupheader\">Classified Reference Pages</h2> \endhtmlonly" \ "cgalClassifedRefPages=\htmlonly[block] <h2 class=\"groupheader\">Classified Reference Pages</h2> \endhtmlonly" \
"cgalCite{1}=<!-- -->\cite \1" "cgalCite{1}=<!-- -->\cite \1"
# This tag can be used to specify a number of word-keyword mappings (TCL only). # This tag can be used to specify a number of word-keyword mappings (TCL only).

View File

@ -1,4 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>

View File

@ -1,8 +1,8 @@
<!-- HTML header for doxygen 1.8.13--> <!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<link rel="icon" type="image/png" href="$relpath$../Manual/g-196x196-doc.png"> <link rel="icon" type="image/png" href="$relpath$../Manual/g-196x196-doc.png"/>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen $doxygenversion"/> <meta name="generator" content="Doxygen $doxygenversion"/>

View File

@ -1,8 +1,8 @@
<!-- HTML header for doxygen 1.8.13--> <!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<link rel="icon" type="image/png" href="$relpath$../Manual/g-196x196-doc.png"> <link rel="icon" type="image/png" href="$relpath$../Manual/g-196x196-doc.png"/>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen $doxygenversion"/> <meta name="generator" content="Doxygen $doxygenversion"/>

View File

@ -1,4 +1,4 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>

View File

@ -1,7 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<link rel="icon" type="image/png" href="$relpath$../Manual/g-196x196-doc.png"> <link rel="icon" type="image/png" href="$relpath$../Manual/g-196x196-doc.png"/>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME--> <!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->

View File

@ -1,7 +1,7 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"> <html xmlns="http://www.w3.org/1999/xhtml">
<head> <head>
<link rel="icon" type="image/png" href="$relpath$../Manual/g-196x196-doc.png"> <link rel="icon" type="image/png" href="$relpath$../Manual/g-196x196-doc.png"/>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/> <meta http-equiv="X-UA-Compatible" content="IE=9"/>
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME--> <!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->

View File

@ -62,7 +62,7 @@ def conceptify_ns(d):
def write_out_html(d, fn): def write_out_html(d, fn):
f = codecs.open(fn, 'w', encoding='utf-8') f = codecs.open(fn, 'w', encoding='utf-8')
# this is the normal doxygen doctype, which is thrown away by pyquery # this is the normal doxygen doctype, which is thrown away by pyquery
f.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n') f.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\n')
f.write('<html xmlns=\"http://www.w3.org/1999/xhtml\">') f.write('<html xmlns=\"http://www.w3.org/1999/xhtml\">')
f.write(d.html()) f.write(d.html())
f.write('\n') f.write('\n')

View File

@ -277,7 +277,7 @@ triangle (2D and 3D) and in tetrahedra (3D). Basically, in order to generate
a random point in a \f$N\f$-simplex (a triangle for \f$N = 2\f$, and tetrahedron a random point in a \f$N\f$-simplex (a triangle for \f$N = 2\f$, and tetrahedron
for \f$N = 3\f$), we generate numbers \f$a_1,a_2,\ldots,a_N\f$ identically and independently for \f$N = 3\f$), we generate numbers \f$a_1,a_2,\ldots,a_N\f$ identically and independently
uniformly distributed in \f$(0,1)\f$, we sort them, we let \f$a_0 = 0\f$ and \f$a_{N+1} = 1\f$, uniformly distributed in \f$(0,1)\f$, we sort them, we let \f$a_0 = 0\f$ and \f$a_{N+1} = 1\f$,
and then \f$a_{i+1}a_i\f$, for \f$i = 1,\ldots,N\f$ becomes its and then \f$a_{i+1}-a_i\f$, for \f$i = 1,\ldots,N\f$ becomes its
barycentric coordinates with respect to the simplex. barycentric coordinates with respect to the simplex.
Maxime Gimemo introduced the random generators on 2D and 3D triangle meshes. Maxime Gimemo introduced the random generators on 2D and 3D triangle meshes.

View File

@ -151,6 +151,7 @@ void
Random_points_in_cube_d<P>:: Random_points_in_cube_d<P>::
generate_point() { generate_point() {
typedef typename Kernel_traits<P>::Kernel::RT RT; typedef typename Kernel_traits<P>::Kernel::RT RT;
CGAL_assume(dimension>0);
std::vector<RT> coord(dimension); std::vector<RT> coord(dimension);
for(int i=0; i<dimension; ++i) for(int i=0; i<dimension; ++i)
coord[i]=RT(this->d_range * ( 2 * this->_rnd.get_double() - 1.0)); coord[i]=RT(this->d_range * ( 2 * this->_rnd.get_double() - 1.0));

View File

@ -288,8 +288,10 @@ int main()
Polyhedron polyhedron; Polyhedron polyhedron;
// A cube // A cube
make_hexahedron(Point_3(-0.5,-0.5,-0.5), Point_3(0.5,-0.5,-0.5), Point_3(0.5,0.5,-0.5), Point_3(-0.5,0.5,-0.5), make_hexahedron(
Point_3(-0.5,0.5,0.5), Point_3(-0.5,-0.5,0.5), Point_3(0.5,-0.5,0.5), Point_3(0.5,0.5,0.5), Point_3(-0.5,-0.5,-0.5), Point_3(0.5,-0.5,-0.5), Point_3(0.5,0.5,-0.5),
Point_3(-0.5,0.5,-0.5), Point_3(-0.5,0.5,0.5), Point_3(-0.5,-0.5,0.5),
Point_3(0.5,-0.5,0.5), Point_3(0.5,0.5,0.5),
polyhedron); polyhedron);
boost::graph_traits<Polyhedron>::halfedge_descriptor facets[6]; boost::graph_traits<Polyhedron>::halfedge_descriptor facets[6];

View File

@ -363,19 +363,6 @@ operator<<(Geomview_stream& gs, const Bbox_2& b);
Geomview_stream& Geomview_stream&
operator<<(Geomview_stream& gs, const Bbox_3& b); operator<<(Geomview_stream& gs, const Bbox_3& b);
/*!
Inserts the bounding box `b` into the stream `gs`.
\relates Geomview_stream
*/
Geomview_stream&
operator<<(Geomview_stream& gs, const Bbox_3& b);
/*!
Inserts the bounding box `b` into the stream `gs`.
\relates Geomview_stream
*/
Geomview_stream&
operator<<(Geomview_stream& gs, const Bbox_3& b);
/// @} /// @}

View File

@ -9,6 +9,10 @@ if(NOT POLICY CMP0070 AND POLICY CMP0053)
cmake_policy(SET CMP0053 OLD) cmake_policy(SET CMP0053 OLD)
endif() endif()
if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL COMPONENTS Qt5) find_package(CGAL COMPONENTS Qt5)
find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg)

View File

@ -9,6 +9,10 @@ if(NOT POLICY CMP0070 AND POLICY CMP0053)
cmake_policy(SET CMP0053 OLD) cmake_policy(SET CMP0053 OLD)
endif() endif()
if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL COMPONENTS Qt5) find_package(CGAL COMPONENTS Qt5)
find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg)

View File

@ -9,6 +9,10 @@ if(NOT POLICY CMP0070 AND POLICY CMP0053)
cmake_policy(SET CMP0053 OLD) cmake_policy(SET CMP0053 OLD)
endif() endif()
if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL COMPONENTS Qt5) find_package(CGAL COMPONENTS Qt5)
find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg)

View File

@ -9,6 +9,10 @@ if(NOT POLICY CMP0070 AND POLICY CMP0053)
cmake_policy(SET CMP0053 OLD) cmake_policy(SET CMP0053 OLD)
endif() endif()
if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL COMPONENTS Qt5) find_package(CGAL COMPONENTS Qt5)

View File

@ -8,6 +8,10 @@ if(NOT POLICY CMP0070 AND POLICY CMP0053)
cmake_policy(SET CMP0053 OLD) cmake_policy(SET CMP0053 OLD)
endif() endif()
if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL COMPONENTS Qt5) find_package(CGAL COMPONENTS Qt5)
find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg)

View File

@ -8,6 +8,10 @@ if(NOT POLICY CMP0070 AND POLICY CMP0053)
cmake_policy(SET CMP0053 OLD) cmake_policy(SET CMP0053 OLD)
endif() endif()
if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL COMPONENTS Qt5) find_package(CGAL COMPONENTS Qt5)
find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg)

View File

@ -9,6 +9,10 @@ if(NOT POLICY CMP0070 AND POLICY CMP0053)
cmake_policy(SET CMP0053 OLD) cmake_policy(SET CMP0053 OLD)
endif() endif()
if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL COMPONENTS Qt5) find_package(CGAL COMPONENTS Qt5)
find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg)

View File

@ -9,6 +9,10 @@ if(NOT POLICY CMP0070 AND POLICY CMP0053)
cmake_policy(SET CMP0053 OLD) cmake_policy(SET CMP0053 OLD)
endif() endif()
if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL COMPONENTS Qt5) find_package(CGAL COMPONENTS Qt5)
find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg)

View File

@ -6,6 +6,10 @@ if(NOT POLICY CMP0070 AND POLICY CMP0053)
cmake_policy(SET CMP0053 OLD) cmake_policy(SET CMP0053 OLD)
endif() endif()
if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL COMPONENTS Qt5) find_package(CGAL COMPONENTS Qt5)
@ -30,12 +34,6 @@ qt5_add_resources ( CGAL_Qt5_RESOURCE_FILES ./Periodic_2_triangulation_2.qrc )
qt5_generate_moc( Periodic_2_Delaunay_triangulation_2.cpp Periodic_2_triangulation_2.moc ) qt5_generate_moc( Periodic_2_Delaunay_triangulation_2.cpp Periodic_2_triangulation_2.moc )
# find header files for projects that can show them # find header files for projects that can show them
cmake_minimum_required(VERSION 3.1)
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)
endif()
file(GLOB headers "*.h") file(GLOB headers "*.h")
file(GLOB QT_headers "include/CGAL/Qt/*.h") file(GLOB QT_headers "include/CGAL/Qt/*.h")
file(GLOB P2T2_headers "../../../include/CGAL/*.h") file(GLOB P2T2_headers "../../../include/CGAL/*.h")

View File

@ -9,6 +9,10 @@ if(NOT POLICY CMP0070 AND POLICY CMP0053)
cmake_policy(SET CMP0053 OLD) cmake_policy(SET CMP0053 OLD)
endif() endif()
if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL COMPONENTS Qt5 Core) find_package(CGAL COMPONENTS Qt5 Core)
find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater) find_package(Eigen3 3.1.0) #(requires 3.1.0 or greater)

View File

@ -9,6 +9,10 @@ if(NOT POLICY CMP0070 AND POLICY CMP0053)
cmake_policy(SET CMP0053 OLD) cmake_policy(SET CMP0053 OLD)
endif() endif()
if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL COMPONENTS Qt5 Core) find_package(CGAL COMPONENTS Qt5 Core)
set( QT_USE_QTXML TRUE ) set( QT_USE_QTXML TRUE )

View File

@ -9,6 +9,10 @@ if(NOT POLICY CMP0070 AND POLICY CMP0053)
cmake_policy(SET CMP0053 OLD) cmake_policy(SET CMP0053 OLD)
endif() endif()
if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL COMPONENTS Qt5 Core) find_package(CGAL COMPONENTS Qt5 Core)
set( QT_USE_QTXML TRUE ) set( QT_USE_QTXML TRUE )

View File

@ -9,6 +9,10 @@ if(NOT POLICY CMP0070 AND POLICY CMP0053)
cmake_policy(SET CMP0053 OLD) cmake_policy(SET CMP0053 OLD)
endif() endif()
if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL COMPONENTS Qt5) find_package(CGAL COMPONENTS Qt5)
find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg)

View File

@ -9,6 +9,10 @@ if(NOT POLICY CMP0070 AND POLICY CMP0053)
cmake_policy(SET CMP0053 OLD) cmake_policy(SET CMP0053 OLD)
endif() endif()
if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL COMPONENTS Qt5) find_package(CGAL COMPONENTS Qt5)
find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg) find_package(Qt5 QUIET COMPONENTS Xml Script OpenGL Svg)

View File

@ -9,6 +9,10 @@ if(NOT POLICY CMP0070 AND POLICY CMP0053)
cmake_policy(SET CMP0053 OLD) cmake_policy(SET CMP0053 OLD)
endif() endif()
if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL COMPONENTS Qt5) find_package(CGAL COMPONENTS Qt5)

View File

@ -426,25 +426,7 @@ public:
const Local_point& S=facet[id]; const Local_point& S=facet[id];
const Local_point& T=facet[(id+1==facet.size())?0:id+1]; const Local_point& T=facet[(id+1==facet.size())?0:id+1];
Local_vector V1=Local_vector((T-S).x(), (T-S).y(), (T-S).z()); Local_vector V1=Local_vector((T-S).x(), (T-S).y(), (T-S).z());
if(std::isnan(S.x()) || const Local_point& U=facet[(id+2>=facet.size())?id+2-facet.size():id+2];
std::isnan(S.y()) ||
std::isnan(S.z()))
{
return false;
}
if(std::isnan(T.x()) ||
std::isnan(T.y()) ||
std::isnan(T.z()))
{
return false;
}
const Local_point& U=facet[(id+2==facet.size())?0:id+2];
if(std::isnan(U.x()) ||
std::isnan(U.y()) ||
std::isnan(U.z()))
{
return false;
}
Local_vector V2=Local_vector((U-T).x(), (U-T).y(), (U-T).z()); Local_vector V2=Local_vector((U-T).x(), (U-T).y(), (U-T).z());
orientation = Local_kernel::Orientation_3()(V1, V2, normal); orientation = Local_kernel::Orientation_3()(V1, V2, normal);
@ -465,7 +447,7 @@ public:
const Local_point& T=facet[(id+1==facet.size())?0:id+1]; const Local_point& T=facet[(id+1==facet.size())?0:id+1];
Local_vector V1=Local_vector((T-S).x(), (T-S).y(), (T-S).z()); Local_vector V1=Local_vector((T-S).x(), (T-S).y(), (T-S).z());
const Local_point& U=facet[(id+2==facet.size())?0:id+2]; const Local_point& U=facet[(id+2>=facet.size())?id+2-facet.size():id+2];
Local_vector V2=Local_vector((U-T).x(), (U-T).y(), (U-T).z()); Local_vector V2=Local_vector((U-T).x(), (U-T).y(), (U-T).z());
local_orientation=Local_kernel::Orientation_3()(V1, V2, normal) ; local_orientation=Local_kernel::Orientation_3()(V1, V2, normal) ;

View File

@ -740,7 +740,7 @@ protected:
setKeyDescription(::Qt::Key_E, "Toggles edges display"); setKeyDescription(::Qt::Key_E, "Toggles edges display");
setKeyDescription(::Qt::Key_F, "Toggles faces display"); setKeyDescription(::Qt::Key_F, "Toggles faces display");
setKeyDescription(::Qt::Key_G, "Switch between flat/Gouraud shading display"); setKeyDescription(::Qt::Key_G, "Switch between flat/Gouraud shading display");
setKeyDescription(::Qt::Key_M, "Toggles mono color for all faces"); setKeyDescription(::Qt::Key_M, "Toggles mono color");
setKeyDescription(::Qt::Key_N, "Inverse direction of normals"); setKeyDescription(::Qt::Key_N, "Inverse direction of normals");
setKeyDescription(::Qt::Key_V, "Toggles vertices display"); setKeyDescription(::Qt::Key_V, "Toggles vertices display");
setKeyDescription(::Qt::Key_Plus, "Increase size of edges"); setKeyDescription(::Qt::Key_Plus, "Increase size of edges");
@ -935,8 +935,11 @@ protected:
} }
virtual QString helpString() const virtual QString helpString() const
{ return helpString("CGAL Basic Viewer"); }
virtual QString helpString(const char* title) const
{ {
QString text("<h2>C G A L B a s i c V i e w e r</h2>"); QString text(QString("<h2>")+QString(title)+QString("</h2>"));
text += "Use the mouse to move the camera around the object. "; text += "Use the mouse to move the camera around the object. ";
text += "You can respectively revolve around, zoom and translate with " text += "You can respectively revolve around, zoom and translate with "
"the three mouse buttons. "; "the three mouse buttons. ";
@ -966,7 +969,7 @@ protected:
return text; return text;
} }
private: protected:
bool m_draw_vertices; bool m_draw_vertices;
bool m_draw_edges; bool m_draw_edges;
bool m_draw_faces; bool m_draw_faces;

View File

@ -37,6 +37,14 @@ Release date: March 2019
- Added the class `CGAL::Rigid_triangle_mesh_collision_detection` to detect intersections between meshes - Added the class `CGAL::Rigid_triangle_mesh_collision_detection` to detect intersections between meshes
and volumes undergoing affine transformations. and volumes undergoing affine transformations.
### Point Set Processing
- `CGAL::mst_orient_normals()` can now be called with a set of user-selected
seed points that are known to be already oriented. A new optional named
parameter `point_is_constrained_map` is added for this purpose. The
original behavior (using one unique and automatically selected seed) is
kept if this parameter is not used.
### 3D Fast Intersection and Distance Computation ### 3D Fast Intersection and Distance Computation
- The primitives `AABB_face_graph_triangle_primitive` and - The primitives `AABB_face_graph_triangle_primitive` and
@ -59,6 +67,10 @@ Release date: March 2019
`Arr_polyline_traits_2`, `Arr_polycurve_traits_2`, and `Arr_polyline_traits_2`, `Arr_polycurve_traits_2`, and
`Arr_polycurve_basic_traits_2`. `Arr_polycurve_basic_traits_2`.
### CGAL and the Boost Graph Library (BGL)
- Add function `write_wrl()` for writing into VRML 2.0 format.
Release 4.13 Release 4.13
------------ ------------

View File

@ -21,9 +21,6 @@ if ( LEDA_FOUND AND NOT LEDA_SETUP )
link_libraries( ${LEDA_LIBRARIES} ) link_libraries( ${LEDA_LIBRARIES} )
endif() endif()
if (LEDA_CGAL_FRIEND_INJECTION)
message( STATUS "${LEDA_CGAL_FRIEND_INJECTION}" )
endif()
if (LEDA_CGAL_NO_STRICT_ALIASING) if (LEDA_CGAL_NO_STRICT_ALIASING)
message( STATUS "${LEDA_CGAL_NO_STRICT_ALIASING}" ) message( STATUS "${LEDA_CGAL_NO_STRICT_ALIASING}" )
endif() endif()

View File

@ -42,7 +42,7 @@ endif()
# Process a list, and replace items contains a file pattern (like # Process a list, and replace items contains a file pattern (like
# `*.off`) by the sublist that corresponds to the globbing of the # `*.off`) by the sublist that corresponds to the globbing of the
# pattern in the directory `${CGAL_CURRENT_SOURCE_DIR}`. # pattern in the directory `${CMAKE_CURRENT_SOURCE_DIR}`.
# #
# #
# For example: the `file # For example: the `file
@ -71,7 +71,7 @@ function(expand_list_with_globbing list_name)
list(GET input_list ${n} item_n) list(GET input_list ${n} item_n)
# message(STATUS "argument ${n} is ${item_n}") # message(STATUS "argument ${n} is ${item_n}")
if(item_n MATCHES ".*\\*.*") if(item_n MATCHES ".*\\*.*")
file(GLOB files RELATIVE ${CGAL_CURRENT_SOURCE_DIR} ${item_n}) file(GLOB files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${item_n})
list(APPEND output_list ${files}) list(APPEND output_list ${files})
else() else()
list(APPEND output_list ${item_n}) list(APPEND output_list ${item_n})
@ -97,7 +97,7 @@ function(cgal_setup_test_properties test_name)
endif() endif()
set_property(TEST "${test_name}" set_property(TEST "${test_name}"
APPEND PROPERTY LABELS "${PROJECT_NAME}") APPEND PROPERTY LABELS "${PROJECT_NAME}")
# message(STATUS " working dir: ${CGAL_CURRENT_SOURCE_DIR}") # message(STATUS " working dir: ${CMAKE_CURRENT_SOURCE_DIR}")
set_property(TEST "${test_name}" set_property(TEST "${test_name}"
PROPERTY WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) PROPERTY WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
if(exe_name) if(exe_name)
@ -198,7 +198,7 @@ function(cgal_add_test exe_name)
return() return()
endif() endif()
# message("Add test ${test_name}") # message("Add test ${test_name}")
set(cin_file "${CGAL_CURRENT_SOURCE_DIR}/${exe_name}.cin") set(cin_file "${CMAKE_CURRENT_SOURCE_DIR}/${exe_name}.cin")
if(NOT ARGS AND EXISTS ${cin_file}) if(NOT ARGS AND EXISTS ${cin_file})
add_test(NAME ${test_name} add_test(NAME ${test_name}
COMMAND ${TIME_COMMAND} ${CMAKE_COMMAND} COMMAND ${TIME_COMMAND} ${CMAKE_COMMAND}
@ -213,11 +213,11 @@ function(cgal_add_test exe_name)
else() else()
if(NOT ARGS AND NOT cgal_add_test_TEST_NAME) if(NOT ARGS AND NOT cgal_add_test_TEST_NAME)
if(ARGC GREATER 2 AND ARGV2) if(ARGC GREATER 2 AND ARGV2)
set(cmd_file "${CGAL_CURRENT_SOURCE_DIR}/${ARGV2}.cmd") set(cmd_file "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV2}.cmd")
elseif(ARGC GREATER 1 AND ARGV1 AND NOT EXISTS ${cmd_file}) elseif(ARGC GREATER 1 AND ARGV1 AND NOT EXISTS ${cmd_file})
set(cmd_file "${CGAL_CURRENT_SOURCE_DIR}/${ARGV1}.cmd") set(cmd_file "${CMAKE_CURRENT_SOURCE_DIR}/${ARGV1}.cmd")
elseif(NOT EXISTS ${cmd_file}) elseif(NOT EXISTS ${cmd_file})
set(cmd_file "${CGAL_CURRENT_SOURCE_DIR}/${exe_name}.cmd") set(cmd_file "${CMAKE_CURRENT_SOURCE_DIR}/${exe_name}.cmd")
endif() endif()
if(EXISTS ${cmd_file}) if(EXISTS ${cmd_file})
file(STRINGS "${cmd_file}" CMD_LINES) file(STRINGS "${cmd_file}" CMD_LINES)

View File

@ -92,11 +92,6 @@ if ( LEDA_INCLUDE_DIR AND LEDA_LIBRARIES)
if ( CMAKE_COMPILER_IS_GNUCXX ) if ( CMAKE_COMPILER_IS_GNUCXX )
get_dependency_version (GCC) get_dependency_version (GCC)
if ( NOT "${GCC_VERSION}" VERSION_LESS "4.1" )
set(LEDA_CGAL_FRIEND_INJECTION TRUE)
typed_cache_set( INTERNAL "Add -ffriend-injection on gcc >= 4.1" LEDA_CGAL_FRIEND_INJECTION "Using LEDA with gcc version 4.1 or later: Adding -ffriend-injection")
uniquely_add_flags (LEDA_CXX_FLAGS "-ffriend-injection")
endif()
if ( NOT "${GCC_VERSION}" VERSION_LESS "4.4" ) if ( NOT "${GCC_VERSION}" VERSION_LESS "4.4" )
set(LEDA_CGAL_NO_STRICT_ALIASING TRUE) set(LEDA_CGAL_NO_STRICT_ALIASING TRUE)
typed_cache_set( INTERNAL "Add -fno-strict-aliasing on gcc >= 4.4" LEDA_CGAL_NO_STRICT_ALIASING "Using LEDA with gcc version 4.4 or later: Adding -fno-strict-aliasing") typed_cache_set( INTERNAL "Add -fno-strict-aliasing on gcc >= 4.4" LEDA_CGAL_NO_STRICT_ALIASING "Using LEDA with gcc version 4.4 or later: Adding -fno-strict-aliasing")

View File

@ -9,11 +9,6 @@ include(${CGAL_MODULES_DIR}/CGAL_Macros.cmake)
cgal_setup_module_path() cgal_setup_module_path()
# Save the current source directory. That variable can be changed by
# a `CMakeLists.txt`, for `CMakeLists.txt` files that are created in
# the binary directory.
set(CGAL_CURRENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
if(NOT USE_CGAL_FILE_INCLUDED) if(NOT USE_CGAL_FILE_INCLUDED)
set(USE_CGAL_FILE_INCLUDED 1) set(USE_CGAL_FILE_INCLUDED 1)

View File

@ -11,11 +11,6 @@ get_filename_component(CGAL_CONFIG_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
set(CGAL_HEADER_ONLY TRUE) set(CGAL_HEADER_ONLY TRUE)
# Save the current source directory. That variable can be changed by
# a `CMakeLists.txt`, for `CMakeLists.txt` files that are created in
# the binary directory.
set(CGAL_CURRENT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
function(cgal_detect_branch_build VAR_NAME) function(cgal_detect_branch_build VAR_NAME)
if(IS_DIRECTORY ${CGAL_CONFIG_DIR}/../../../../Installation/package_info/Installation/) if(IS_DIRECTORY ${CGAL_CONFIG_DIR}/../../../../Installation/package_info/Installation/)
set(${VAR_NAME} TRUE PARENT_SCOPE) set(${VAR_NAME} TRUE PARENT_SCOPE)
@ -26,7 +21,11 @@ endfunction()
cgal_detect_branch_build(BRANCH_BUILD) cgal_detect_branch_build(BRANCH_BUILD)
if(BRANCH_BUILD) if(BRANCH_BUILD)
set(CGAL_ROOT ${CGAL_CONFIG_DIR}/../../../..) set(CGAL_ROOT ${CGAL_CONFIG_DIR})
get_filename_component(CGAL_ROOT "${CGAL_ROOT}" DIRECTORY)
get_filename_component(CGAL_ROOT "${CGAL_ROOT}" DIRECTORY)
get_filename_component(CGAL_ROOT "${CGAL_ROOT}" DIRECTORY)
get_filename_component(CGAL_ROOT "${CGAL_ROOT}" DIRECTORY)
set(CGAL_INSTALLATION_PACKAGE_DIR ${CGAL_ROOT}/Installation) set(CGAL_INSTALLATION_PACKAGE_DIR ${CGAL_ROOT}/Installation)
set(CGAL_GRAPHICSVIEW_PACKAGE_DIR ${CGAL_ROOT}/GraphicsView) set(CGAL_GRAPHICSVIEW_PACKAGE_DIR ${CGAL_ROOT}/GraphicsView)
set(CGAL_MODULES_DIR ${CGAL_ROOT}/Installation/cmake/modules) set(CGAL_MODULES_DIR ${CGAL_ROOT}/Installation/cmake/modules)
@ -43,7 +42,10 @@ if(BRANCH_BUILD)
endif() endif()
endforeach() endforeach()
else() else()
set(CGAL_ROOT ${CGAL_CONFIG_DIR}/../../..) set(CGAL_ROOT ${CGAL_CONFIG_DIR})
get_filename_component(CGAL_ROOT "${CGAL_ROOT}" DIRECTORY)
get_filename_component(CGAL_ROOT "${CGAL_ROOT}" DIRECTORY)
get_filename_component(CGAL_ROOT "${CGAL_ROOT}" DIRECTORY)
# not BRANCH_BUILD: it can be an installed CGAL, or the tarball layout # not BRANCH_BUILD: it can be an installed CGAL, or the tarball layout
if(EXISTS ${CGAL_CONFIG_DIR}/CGAL_add_test.cmake) if(EXISTS ${CGAL_CONFIG_DIR}/CGAL_add_test.cmake)
@ -66,6 +68,9 @@ include(${CGAL_MODULES_DIR}/CGAL_CreateSingleSourceCGALProgram.cmake)
include(${CGAL_MODULES_DIR}/CGAL_Macros.cmake) include(${CGAL_MODULES_DIR}/CGAL_Macros.cmake)
include(${CGAL_MODULES_DIR}/CGAL_Common.cmake) include(${CGAL_MODULES_DIR}/CGAL_Common.cmake)
set(CGAL_USE_FILE ${CGAL_MODULES_DIR}/UseCGAL.cmake)
if(CGAL_BUILDING_LIBS) if(CGAL_BUILDING_LIBS)
foreach(comp ${CGAL_FIND_COMPONENTS}) foreach(comp ${CGAL_FIND_COMPONENTS})
if(CGAL_${comp}_FOUND) if(CGAL_${comp}_FOUND)
@ -139,8 +144,6 @@ endforeach()
# Temporary? Change the CMAKE module path # Temporary? Change the CMAKE module path
cgal_setup_module_path() cgal_setup_module_path()
set(CGAL_USE_FILE ${CGAL_MODULES_DIR}/UseCGAL.cmake)
include("${CGAL_MODULES_DIR}/CGAL_parse_version_h.cmake") include("${CGAL_MODULES_DIR}/CGAL_parse_version_h.cmake")
cgal_parse_version_h( "${CGAL_INSTALLATION_PACKAGE_DIR}/include/CGAL/version.h" cgal_parse_version_h( "${CGAL_INSTALLATION_PACKAGE_DIR}/include/CGAL/version.h"
"CGAL_VERSION_NAME" "CGAL_VERSION_NAME"

View File

@ -199,7 +199,7 @@ Monge_via_jet_fitting();
This operator performs all the computations. The \f$ N\f$ input points are This operator performs all the computations. The \f$ N\f$ input points are
given by the `InputIterator` parameters which value-type are given by the `InputIterator` parameters which value-type are
`Data_kernel::Point_3`, `d` is the degree of the fitted `Data_kernel::Point_3`, `d` is the degree of the fitted
polynomial, `d'` is the degree of the expected Monge polynomial, \c d' is the degree of the expected Monge
coefficients. \pre \f$ N \geq N_{d}:=(d+1)(d+2)/2\f$, \f$ 1 \leq d' \leq\min(d,4) \f$. coefficients. \pre \f$ N \geq N_{d}:=(d+1)(d+2)/2\f$, \f$ 1 \leq d' \leq\min(d,4) \f$.
*/ */
template <class InputIterator> Monge_form template <class InputIterator> Monge_form

View File

@ -77,13 +77,11 @@ the surface can locally be written as the graph of a bivariate
function. Letting \f$ h.o.t.\f$ stand for <I>higher order terms</I>, one function. Letting \f$ h.o.t.\f$ stand for <I>higher order terms</I>, one
has : has :
\f[ \f{equation}{
\begin{equation}
z(x,y)=J_{B,d}(x,y) + h.o.t. \ ; \quad z(x,y)=J_{B,d}(x,y) + h.o.t. \ ; \quad
J_{B,d}(x,y)=\ccSum{k=0}{d}{(\ccSum{i=0}{i}{ J_{B,d}(x,y)=\ccSum{k=0}{d}{(\ccSum{i=0}{i}{
\frac{B_{k-i,i}x^{k-i}y^{i}}{i!(k-i)!}})}. \frac{B_{k-i,i}x^{k-i}y^{i}}{i!(k-i)!}})}.
\end{equation} \f}
\f]
The degree \f$ d\f$ polynomial \f$ J_{B,d}\f$ is the Taylor expansion of the The degree \f$ d\f$ polynomial \f$ J_{B,d}\f$ is the Taylor expansion of the
function \f$ z\f$, and is called its <I>\f$ d\f$-jet</I>. Notice that a \f$ d\f$-jet contains function \f$ z\f$, and is called its <I>\f$ d\f$-jet</I>. Notice that a \f$ d\f$-jet contains
@ -343,12 +341,10 @@ The fitting process consists of finding the coefficients
\f$ A_{i,j}\f$ of the degree \f$ d\f$ polynomial \f$ A_{i,j}\f$ of the degree \f$ d\f$ polynomial
\anchor eqanswer \anchor eqanswer
\f[ \f{equation}{
\begin{equation}
J_{A,d}= \ccSum{k=0}{d}{(\ccSum{i=0}{k}{ J_{A,d}= \ccSum{k=0}{d}{(\ccSum{i=0}{k}{
\frac{A_{k-i,i}x^{k-i}y^{i}}{i!(k-i)!}})}. \frac{A_{k-i,i}x^{k-i}y^{i}}{i!(k-i)!}})}.
\end{equation} \f}
\f]
Denote \f$ p_i=(x_i,y_i,z_i), \ i=1,\ldots , N\f$ the coordinates of the Denote \f$ p_i=(x_i,y_i,z_i), \ i=1,\ldots , N\f$ the coordinates of the
sample points of \f$ P^+\f$. sample points of \f$ P^+\f$.
@ -362,7 +358,7 @@ given by
A = & (A_{0,0}, A_{1,0},A_{0,1}, \ldots , A_{0,d})^T \\ A = & (A_{0,0}, A_{1,0},A_{0,1}, \ldots , A_{0,d})^T \\
Z= &(z_1, z_2,\ldots , z_N)^T \\ Z= &(z_1, z_2,\ldots , z_N)^T \\
M= &(1,x_i,\ y_i,\ \frac{x_i^2}{2},\ldots , M= &(1,x_i,\ y_i,\ \frac{x_i^2}{2},\ldots ,
\ \frac{x_iy_i^{d-1}}{(d-1)!},\ \frac{y_i^d}{d!})_{i=1,...,N}\\ \ \frac{x_iy_i^{d-1}}{(d-1)!},\ \frac{y_i^d}{d!})_{i=1,...,N}
\f} \f}
The equations for interpolation become \f$ MA=Z\f$. For approximation, the The equations for interpolation become \f$ MA=Z\f$. For approximation, the
@ -395,8 +391,7 @@ The number \f$ r\f$, which is the number of non zero singular values, is
strictly lower than \f$ N_d\f$ if the system is under constrained. In any strictly lower than \f$ N_d\f$ if the system is under constrained. In any
case, the unique solution which minimize \f$ ||A||_2\f$ is given by: case, the unique solution which minimize \f$ ||A||_2\f$ is given by:
\f[ \f{equation}{
\begin{equation}
A= V A= V
\left( \begin{array}{cc} \left( \begin{array}{cc}
D_r^{-1} & 0_{N_d-r,\ r}\\ D_r^{-1} & 0_{N_d-r,\ r}\\
@ -404,8 +399,7 @@ D_r^{-1} & 0_{N_d-r,\ r}\\
\end{array} \end{array}
\right) \right)
U^TZ. U^TZ.
\end{equation} \f}
\f]
One can provide the condition number of the matrix \f$ M\f$ (after One can provide the condition number of the matrix \f$ M\f$ (after
preconditioning) which is the ratio of the maximal and the minimal preconditioning) which is the ratio of the maximal and the minimal
@ -491,22 +485,18 @@ We use explicit formula. The implicit equation of the fitted
polynomial surface in the fitting-basis with origin the point polynomial surface in the fitting-basis with origin the point
\f$ (0,0,A_{0,0})\f$ is \f$ Q=0\f$ with \f$ (0,0,A_{0,0})\f$ is \f$ Q=0\f$ with
\f[ \f{equation}{
\begin{equation}
Q=-w-A_{0,0} +\ccSum{i,j}{}{\frac{A_{i,j}u^iv^j}{i!j!}}. Q=-w-A_{0,0} +\ccSum{i,j}{}{\frac{A_{i,j}u^iv^j}{i!j!}}.
\end{equation} \f}
\f]
The equation in the Monge basis is obtained by substituting \f$ (u,v,w)\f$ The equation in the Monge basis is obtained by substituting \f$ (u,v,w)\f$
by \f$ P^T_{F\rightarrow M}(x,y,z)\f$. Denote \f$ f(x,y,z)=0\f$ this implicit by \f$ P^T_{F\rightarrow M}(x,y,z)\f$. Denote \f$ f(x,y,z)=0\f$ this implicit
equation. By definition of the Monge basis, we have locally (at equation. By definition of the Monge basis, we have locally (at
\f$ (0,0,0)\f$) \f$ (0,0,0)\f$)
\f[ \f{equation}{
\begin{equation}
f(x,y,z)=0 \Leftrightarrow z=g(x,y) f(x,y,z)=0 \Leftrightarrow z=g(x,y)
\end{equation} \f}
\f]
and the Taylor expansion of \f$ g\f$ at \f$ (0,0)\f$ are the Monge coefficients and the Taylor expansion of \f$ g\f$ at \f$ (0,0)\f$ are the Monge coefficients
sought. sought.
@ -526,7 +516,7 @@ f_{0,0,1} ^{2}}}
\\ \\
&b_1=g_{2,1}=-{\frac {- f_{0,1,1} f_{2,0,0} + f_{2,1,0} f_{0,0,1} }{ f_{0,0,1} ^{2}}} &b_1=g_{2,1}=-{\frac {- f_{0,1,1} f_{2,0,0} + f_{2,1,0} f_{0,0,1} }{ f_{0,0,1} ^{2}}}
\\ \\
& .... \\ & ....
\f} \f}

View File

@ -40,7 +40,7 @@ _test_io_for(const T& t)
} }
std::ifstream iFile(TEST_FILENAME, std::ios::in); std::ifstream iFile(TEST_FILENAME, std::ios::in);
T u; T u = t;
iFile >> u; iFile >> u;
assert(!iFile.fail()); assert(!iFile.fail());
assert(u == t); assert(u == t);

View File

@ -28,7 +28,7 @@
int main() int main()
{ {
try { try {
CGAL::Point_3<CGAL::Epick> a, b, c, d; CGAL::Point_3<CGAL::Epick> a(CGAL::ORIGIN), b(a), c(a), d(a);
CGAL::squared_radius(a, b, c, d); CGAL::squared_radius(a, b, c, d);
} catch(...) {} } catch(...) {}
return EXIT_SUCCESS; return EXIT_SUCCESS;

View File

@ -96,8 +96,8 @@ InputIterator first, InputIterator last);
introduces a introduces a
variable `v` of type `Vector_d<Kernel>` in dimension `d` variable `v` of type `Vector_d<Kernel>` in dimension `d`
initialized to the vector with homogeneous coordinates as defined by initialized to the vector with homogeneous coordinates as defined by
`H = set [first,last)` and `D`: \f$ (\pmH[0], `H = set [first,last)` and `D`: \f$ (\pm H_0,
\pmH[1], \ldots, \pmH[d-1], \pmD)\f$. The sign \pm H_1, \ldots, \pm H_{D-1}, \pm H_D)\f$. The sign
chosen is the sign of \f$ D\f$. chosen is the sign of \f$ D\f$.
\pre `D` is non-zero, the iterator range defines a \f$ d\f$-tuple of `RT`. \pre `D` is non-zero, the iterator range defines a \f$ d\f$-tuple of `RT`.

View File

@ -46,7 +46,7 @@ if ( NOT (CGAL_FOUND AND CGAL_Qt5_FOUND AND Qt5_FOUND ) )
else() else()
add_definitions(-DQT_NO_KEYWORDS) add_definitions(-DCGAL_USE_BASIC_VIEWER -DQT_NO_KEYWORDS)
# ui file, created wih Qt Designer # ui file, created wih Qt Designer
qt5_wrap_ui(uis MainWindow.ui CreateMesh.ui CreateMenger.ui qt5_wrap_ui(uis MainWindow.ui CreateMesh.ui CreateMenger.ui
@ -64,7 +64,7 @@ add_executable(Linear_cell_complex_3_demo
add_to_cached_list(CGAL_EXECUTABLE_TARGETS Linear_cell_complex_3_demo) add_to_cached_list(CGAL_EXECUTABLE_TARGETS Linear_cell_complex_3_demo)
target_link_libraries(Linear_cell_complex_3_demo PRIVATE target_link_libraries(Linear_cell_complex_3_demo PUBLIC
CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui Qt5::OpenGL) CGAL::CGAL CGAL::CGAL_Qt5 Qt5::Gui Qt5::OpenGL)
include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake) include(${CGAL_MODULES_DIR}/CGAL_add_test.cmake)

View File

@ -39,7 +39,7 @@ void subdivide_lcc_pqq (LCC & m);
#define DELAY_STATUSMSG 1500 #define DELAY_STATUSMSG 1500
MainWindow::MainWindow (QWidget * parent):CGAL::Qt::DemosMainWindow (parent), MainWindow::MainWindow (QWidget * parent) : CGAL::Qt::DemosMainWindow (parent),
nbcube (0), nbcube (0),
dialogmesh (this), dialogmesh (this),
dialogmenger(this), dialogmenger(this),
@ -78,7 +78,7 @@ MainWindow::MainWindow (QWidget * parent):CGAL::Qt::DemosMainWindow (parent),
QObject::connect(&dialogmesh, SIGNAL(accepted()), QObject::connect(&dialogmesh, SIGNAL(accepted()),
this, SLOT(onCreateMeshOk())); this, SLOT(onCreateMeshOk()));
this->viewer->setScene(&scene); this->viewer->setScene(&scene, false);
connect_actions (); connect_actions ();
this->addAboutDemo (":/cgal/help/about_Linear_cell_complex_3.html"); this->addAboutDemo (":/cgal/help/about_Linear_cell_complex_3.html");

View File

@ -19,928 +19,44 @@
// Author(s) : Guillaume Damiand <guillaume.damiand@liris.cnrs.fr> // Author(s) : Guillaume Damiand <guillaume.damiand@liris.cnrs.fr>
// Contributor(s): Kumar Snehasish <kumar.snehasish@gmail.com> // Contributor(s): Kumar Snehasish <kumar.snehasish@gmail.com>
// //
#include "Viewer.h" #include "Viewer.h"
#include <CGAL/Linear_cell_complex_operations.h>
#include <CGAL/bounding_box.h>
#include <CGAL/Qt/CreateOpenGLContext.h>
#include <CGAL/Qt/viewer_actions.h>
#include <CGAL/Qt/vec.h> #include <CGAL/Qt/vec.h>
#include <QDebug>
//Vertex source code Viewer::Viewer(QWidget* parent) :
const char vertex_source[] = Base(parent, NULL, ""),
{ m_previous_scene_empty(true)
"#version 120 \n" {}
"attribute highp vec4 vertex;\n"
"attribute highp vec3 normal;\n"
"attribute highp vec3 color;\n"
"uniform highp mat4 mvp_matrix;\n" void Viewer::setScene(Scene* scene_, bool doredraw)
"uniform highp mat4 mv_matrix; \n"
"uniform highp float point_size; \n"
"varying highp vec4 fP; \n"
"varying highp vec3 fN; \n"
"varying highp vec4 fColor; \n"
"void main(void)\n"
"{\n"
" gl_PointSize = point_size; \n"
" fP = mv_matrix * vertex; \n"
" fN = mat3(mv_matrix)* normal; \n"
" fColor = vec4(color, 1.0); \n"
" gl_Position = mvp_matrix * vertex;\n"
"}"
};
//Vertex source code
const char fragment_source[] =
{
"#version 120 \n"
"varying highp vec4 fP; \n"
"varying highp vec3 fN; \n"
"varying highp vec4 fColor; \n"
"uniform vec4 light_pos; \n"
"uniform vec4 light_diff; \n"
"uniform vec4 light_spec; \n"
"uniform vec4 light_amb; \n"
"uniform float spec_power ; \n"
"void main(void) { \n"
" vec3 L = light_pos.xyz - fP.xyz; \n"
" vec3 V = -fP.xyz; \n"
" vec3 N = normalize(fN); \n"
" L = normalize(L); \n"
" V = normalize(V); \n"
" vec3 R = reflect(-L, N); \n"
" vec4 diffuse = max(dot(N,L), 0.0) * light_diff * fColor; \n"
" vec4 specular = pow(max(dot(R,V), 0.0), spec_power) * light_spec; \n"
"gl_FragColor = light_amb*fColor + diffuse ; \n"
"} \n"
"\n"
};
//Vertex source code
const char vertex_source_p_l[] =
{
"#version 120 \n"
"attribute highp vec4 vertex;\n"
"uniform highp mat4 mvp_matrix;\n"
"uniform highp float point_size; \n"
"void main(void)\n"
"{\n"
" gl_PointSize = point_size; \n"
" gl_Position = mvp_matrix * vertex;\n"
"}"
};
//Vertex source code
const char fragment_source_p_l[] =
{
"#version 120 \n"
"uniform highp vec4 color; \n"
"void main(void) { \n"
"gl_FragColor = color; \n"
"} \n"
"\n"
};
Viewer::Viewer(QWidget* parent)
: CGAL::QGLViewer(parent),
wireframe(false),
flatShading(true),
edges(true),
vertices(true),
inverse_normal(false),
size_points(7.),
size_edges(3.1),
ambient(0.6f, 0.5f, 0.5f, 0.5f),
m_previous_scene_empty(true),
are_buffers_initialized(false)
{ {
} scene = scene_;
set_lcc(scene->lcc, doredraw);
Viewer::~Viewer()
{
for (int i=0; i<NB_VBO_BUFFERS; ++i)
buffers[i].destroy();
for (int i=0; i<NB_VAO_BUFFERS; ++i)
vao[i].destroy();
}
void Viewer::compile_shaders()
{
rendering_program.removeAllShaders();
rendering_program_p_l.removeAllShaders();
// Create the buffers
for (int i=0; i<NB_VBO_BUFFERS; ++i)
if(!buffers[i].isCreated() && !buffers[i].create())
{
std::cerr<<"VBO Creation number "<<i<<" FAILED"<<std::endl;
}
for (int i=0; i<NB_VAO_BUFFERS; ++i)
if(!vao[i].isCreated() && !vao[i].create())
{
std::cerr<<"VAO Creation number "<<i<<" FAILED"<<std::endl;
}
//The Facets
QOpenGLShader *vertex_shader = new QOpenGLShader(QOpenGLShader::Vertex);
if(!vertex_shader->compileSourceCode(vertex_source))
{
std::cerr<<"Compiling vertex source FAILED"<<std::endl;
}
QOpenGLShader *fragment_shader= new QOpenGLShader(QOpenGLShader::Fragment);
if(!fragment_shader->compileSourceCode(fragment_source))
{
std::cerr<<"Compiling fragmentsource FAILED"<<std::endl;
}
if(!rendering_program.addShader(vertex_shader))
{
std::cerr<<"adding vertex shader FAILED"<<std::endl;
}
if(!rendering_program.addShader(fragment_shader))
{
std::cerr<<"adding fragment shader FAILED"<<std::endl;
}
if(!rendering_program.link())
{
std::cerr<<"linking Program FAILED"<<std::endl;
}
rendering_program.bind();
vertex_shader = new QOpenGLShader(QOpenGLShader::Vertex);
if(!vertex_shader->compileSourceCode(vertex_source_p_l))
{
std::cerr<<"Compiling vertex source FAILED"<<std::endl;
}
fragment_shader= new QOpenGLShader(QOpenGLShader::Fragment);
if(!fragment_shader->compileSourceCode(fragment_source_p_l))
{
std::cerr<<"Compiling fragmentsource FAILED"<<std::endl;
}
if(!rendering_program_p_l.addShader(vertex_shader))
{
std::cerr<<"adding vertex shader FAILED"<<std::endl;
}
if(!rendering_program_p_l.addShader(fragment_shader))
{
std::cerr<<"adding fragment shader FAILED"<<std::endl;
}
if(!rendering_program_p_l.link())
{
std::cerr<<"linking Program FAILED"<<std::endl;
}
rendering_program_p_l.bind();
}
void Viewer::initialize_buffers()
{
//points of the facets
vao[0].bind();
buffers[0].bind();
buffers[0].allocate(pos_facets.data(),
static_cast<int>(pos_facets.size()*sizeof(float)));
vertexLocation[0] = rendering_program.attributeLocation("vertex");
rendering_program.bind();
rendering_program.enableAttributeArray(vertexLocation[0]);
rendering_program.setAttributeBuffer(vertexLocation[0],GL_FLOAT,0,3);
rendering_program.release();
buffers[0].release();
//normals of the facets
buffers[1].bind();
buffers[1].allocate(flat_normals.data(),
static_cast<int>(flat_normals.size()*sizeof(float)));
normalsLocation = rendering_program.attributeLocation("normal");
rendering_program.bind();
rendering_program.enableAttributeArray(normalsLocation);
rendering_program.setAttributeBuffer(normalsLocation,GL_FLOAT,0,3);
buffers[1].release();
//colors of the facets
buffers[2].bind();
buffers[2].allocate(colors.data(),
static_cast<int>(colors.size()*sizeof(float)));
colorsLocation = rendering_program.attributeLocation("color");
rendering_program.bind();
rendering_program.enableAttributeArray(colorsLocation);
rendering_program.setAttributeBuffer(colorsLocation,GL_FLOAT,0,3);
buffers[2].release();
rendering_program.release();
vao[0].release();
vao[1].bind();
//points of the facets
buffers[3].bind();
buffers[3].allocate(pos_facets.data(), static_cast<int>(pos_facets.size()*sizeof(float)));
vertexLocation[0] = rendering_program.attributeLocation("vertex");
rendering_program.bind();
rendering_program.enableAttributeArray(vertexLocation[0]);
rendering_program.setAttributeBuffer(vertexLocation[0],GL_FLOAT,0,3);
rendering_program.release();
buffers[3].release();
//normals of the facets
buffers[4].bind();
buffers[4].allocate(smooth_normals.data(),
static_cast<int>(smooth_normals.size()*sizeof(float)));
normalsLocation = rendering_program.attributeLocation("normal");
rendering_program.bind();
rendering_program.enableAttributeArray(normalsLocation);
rendering_program.setAttributeBuffer(normalsLocation,GL_FLOAT,0,3);
buffers[4].release();
//colors of the facets
buffers[5].bind();
buffers[5].allocate(colors.data(), static_cast<int>(colors.size()*sizeof(float)));
colorsLocation = rendering_program.attributeLocation("color");
rendering_program.bind();
rendering_program.enableAttributeArray(colorsLocation);
rendering_program.setAttributeBuffer(colorsLocation,GL_FLOAT,0,3);
buffers[5].release();
rendering_program.release();
vao[1].release();
//The lines
vao[2].bind();
buffers[6].bind();
buffers[6].allocate(pos_lines.data(), static_cast<int>(pos_lines.size()*sizeof(float)));
vertexLocation[2] = rendering_program_p_l.attributeLocation("vertex");
rendering_program_p_l.bind();
rendering_program_p_l.enableAttributeArray(vertexLocation[2]);
rendering_program_p_l.setAttributeBuffer(vertexLocation[2],GL_FLOAT,0,3);
buffers[6].release();
rendering_program_p_l.release();
vao[2].release();
//The points
vao[3].bind();
buffers[7].bind();
buffers[7].allocate(pos_points.data(), static_cast<int>(pos_points.size()*sizeof(float)));
vertexLocation[2] = rendering_program_p_l.attributeLocation("vertex");
rendering_program_p_l.bind();
rendering_program_p_l.enableAttributeArray(vertexLocation[2]);
rendering_program_p_l.setAttributeBuffer(vertexLocation[2],GL_FLOAT,0,3);
buffers[7].release();
rendering_program_p_l.release();
vao[3].release();
are_buffers_initialized = true;
}
void Viewer::compute_face(Dart_handle dh, LCC::size_type markface)
{
LCC &lcc = *scene->lcc;
CGAL::mark_cell<LCC, 2>(lcc, dh, markface);
double r = (double)lcc.info<3>(dh).color().r()/255.0;
double g = (double)lcc.info<3>(dh).color().g()/255.0;
double b = (double)lcc.info<3>(dh).color().b()/255.0;
if ( !lcc.is_free(dh, 3) )
{
r += (double)lcc.info<3>(lcc.beta(dh,3)).color().r()/255.0;
g += (double)lcc.info<3>(lcc.beta(dh,3)).color().g()/255.0;
b += (double)lcc.info<3>(lcc.beta(dh,3)).color().b()/255.0;
r /= 2; g /= 2; b /= 2;
}
//compute flat normals
LCC::Vector normal = CGAL::compute_normal_of_cell_2(lcc,dh);
normal = normal/(CGAL::sqrt(normal*normal));
if (inverse_normal)
normal=normal*-1;
if (lcc.beta<1,1,1>(dh)!=dh)
{
try // Try catch to avoir crash of triangulation
{
P_traits cdt_traits(normal);
CDT cdt(cdt_traits);
// Iterates on the vector of facet handles
CDT::Vertex_handle previous = NULL, first = NULL;
for (LCC::Dart_of_orbit_range<1>::const_iterator
he_circ = lcc.darts_of_orbit<1>(dh).begin(),
he_circ_end = lcc.darts_of_orbit<1>(dh).end();
he_circ!=he_circ_end; ++he_circ)
{
CDT::Vertex_handle vh = cdt.insert(lcc.point(he_circ));
if(first == NULL)
{ first = vh; }
vh->info().v = CGAL::compute_normal_of_cell_0<LCC>(lcc, he_circ);
if (inverse_normal) vh->info().v=vh->info().v*-1;
if(previous!=NULL && previous != vh)
{ cdt.insert_constraint(previous, vh); }
previous = vh;
}
if (previous!=NULL)
cdt.insert_constraint(previous, first);
// sets mark is_external
for(CDT::All_faces_iterator fit = cdt.all_faces_begin(),
fitend = cdt.all_faces_end(); fit!=fitend; ++fit)
{
fit->info().is_external = true;
fit->info().is_process = false;
}
//check if the facet is external or internal
std::queue<CDT::Face_handle> face_queue;
CDT::Face_handle face_internal = NULL;
face_queue.push(cdt.infinite_vertex()->face());
while(! face_queue.empty() )
{
CDT::Face_handle fh = face_queue.front();
face_queue.pop();
if(!fh->info().is_process)
{
fh->info().is_process = true;
for(int i = 0; i <3; ++i)
{
if(!cdt.is_constrained(std::make_pair(fh, i)))
{
face_queue.push(fh->neighbor(i));
}
else if (face_internal==NULL)
{
face_internal = fh->neighbor(i);
}
}
}
}
if ( face_internal!=NULL )
face_queue.push(face_internal);
while(! face_queue.empty() )
{
CDT::Face_handle fh = face_queue.front();
face_queue.pop();
if(!fh->info().is_process)
{
fh->info().is_process = true;
fh->info().is_external = false;
for(int i = 0; i <3; ++i)
{
if(!cdt.is_constrained(std::make_pair(fh, i)))
{
face_queue.push(fh->neighbor(i));
}
}
}
}
//iterates on the internal faces to add the vertices to the positions
//and the normals to the appropriate vectors
for(CDT::Finite_faces_iterator ffit = cdt.finite_faces_begin(),
ffitend = cdt.finite_faces_end(); ffit != ffitend; ++ffit)
{
if(!ffit->info().is_external)
{
flat_normals.push_back(normal.x());
flat_normals.push_back(normal.y());
flat_normals.push_back(normal.z());
flat_normals.push_back(normal.x());
flat_normals.push_back(normal.y());
flat_normals.push_back(normal.z());
flat_normals.push_back(normal.x());
flat_normals.push_back(normal.y());
flat_normals.push_back(normal.z());
smooth_normals.push_back(ffit->vertex(0)->info().v.x());
smooth_normals.push_back(ffit->vertex(0)->info().v.y());
smooth_normals.push_back(ffit->vertex(0)->info().v.z());
smooth_normals.push_back(ffit->vertex(1)->info().v.x());
smooth_normals.push_back(ffit->vertex(1)->info().v.y());
smooth_normals.push_back(ffit->vertex(1)->info().v.z());
smooth_normals.push_back(ffit->vertex(2)->info().v.x());
smooth_normals.push_back(ffit->vertex(2)->info().v.y());
smooth_normals.push_back(ffit->vertex(2)->info().v.z());
pos_facets.push_back(ffit->vertex(0)->point().x());
pos_facets.push_back(ffit->vertex(0)->point().y());
pos_facets.push_back(ffit->vertex(0)->point().z());
pos_facets.push_back(ffit->vertex(1)->point().x());
pos_facets.push_back(ffit->vertex(1)->point().y());
pos_facets.push_back(ffit->vertex(1)->point().z());
pos_facets.push_back(ffit->vertex(2)->point().x());
pos_facets.push_back(ffit->vertex(2)->point().y());
pos_facets.push_back(ffit->vertex(2)->point().z());
colors.push_back(r);colors.push_back(g);colors.push_back(b);
colors.push_back(r);colors.push_back(g);colors.push_back(b);
colors.push_back(r);colors.push_back(g);colors.push_back(b);
}
}
}
catch(...)
{ // Triangulation crash: the face is not filled
}
}
else
{ // The face is a triangle
colors.push_back(r);colors.push_back(g);colors.push_back(b);
colors.push_back(r);colors.push_back(g);colors.push_back(b);
colors.push_back(r);colors.push_back(g);colors.push_back(b);
flat_normals.push_back(normal.x());
flat_normals.push_back(normal.y());
flat_normals.push_back(normal.z());
flat_normals.push_back(normal.x());
flat_normals.push_back(normal.y());
flat_normals.push_back(normal.z());
flat_normals.push_back(normal.x());
flat_normals.push_back(normal.y());
flat_normals.push_back(normal.z());
for (LCC::Dart_of_orbit_range<1>::const_iterator
orbitIter = lcc.darts_of_orbit<1>(dh).begin();
orbitIter.cont(); ++orbitIter)
{
//compute Smooth normals
LCC::Vector normal = CGAL::compute_normal_of_cell_0(lcc,orbitIter);
normal = normal/(CGAL::sqrt(normal*normal));
if (inverse_normal) normal=normal*-1;
smooth_normals.push_back(normal.x());
smooth_normals.push_back(normal.y());
smooth_normals.push_back(normal.z());
const LCC::Point& p = lcc.point(orbitIter);
pos_facets.push_back(p.x());
pos_facets.push_back(p.y());
pos_facets.push_back(p.z());
}
}
}
void Viewer::compute_edge(Dart_handle dh, LCC::size_type markedge)
{
LCC &lcc = *scene->lcc;
CGAL::mark_cell<LCC, 1>(lcc, dh, markedge);
const LCC::Point& p = lcc.point(dh);
Dart_handle d2 = lcc.other_extremity(dh);
if ( d2!=NULL )
{
const LCC::Point& p2 = lcc.point(d2);
pos_lines.push_back(p.x());
pos_lines.push_back(p.y());
pos_lines.push_back(p.z());
pos_lines.push_back(p2.x());
pos_lines.push_back(p2.y());
pos_lines.push_back(p2.z());
}
}
void Viewer::compute_vertex(Dart_handle dh, LCC::size_type markvertex, bool& empty)
{
LCC &lcc = *scene->lcc;
CGAL::mark_cell<LCC, 0>(lcc, dh, markvertex);
const LCC::Point& p = lcc.point(dh);
pos_points.push_back(p.x());
pos_points.push_back(p.y());
pos_points.push_back(p.z());
if ( empty )
{
bb = p.bbox();
empty = false;
}
else
bb = bb + p.bbox();
}
void Viewer::compute_elements()
{
LCC &lcc = *scene->lcc;
pos_facets.clear();
flat_normals.clear();
smooth_normals.clear();
colors.clear();
pos_lines.clear();
pos_points.clear();
if ( lcc.is_empty() )
{
bb = LCC::Point(CGAL::ORIGIN).bbox();
bb = bb + LCC::Point(1,1,1).bbox(); // To avoid a warning from Qglviewer
return;
}
LCC::size_type markvertex = lcc.get_new_mark();
LCC::size_type markedge = lcc.get_new_mark();
LCC::size_type markface = lcc.get_new_mark();
bool empty = true;
for (LCC::Attribute_range<3>::type::iterator it=lcc.attributes<3>().begin(),
itend=lcc.attributes<3>().end(); it!=itend; ++it )
{
if ( it->info().is_visible() )
{
for(LCC::Dart_of_cell_range<3>::iterator
dartIter=lcc.darts_of_cell<3>(lcc.dart_of_attribute<3>(it)).begin();
dartIter.cont(); ++dartIter)
{
if ( it->info().is_filled() && !lcc.is_marked(dartIter, markface) )
compute_face(dartIter, markface);
if ( !lcc.is_marked(dartIter, markedge) )
compute_edge(dartIter, markedge);
if ( !lcc.is_marked(dartIter, markvertex) )
compute_vertex(dartIter, markvertex, empty);
}
}
}
if ( empty )
{
bb = LCC::Point(CGAL::ORIGIN).bbox();
bb = bb + LCC::Point(1,1,1).bbox(); // To avoid a warning from Qglviewer
}
for (LCC::Dart_range::iterator it=lcc.darts().begin(),
itend=lcc.darts().end(); it!=itend; ++it )
{
lcc.unmark(it, markvertex);
lcc.unmark(it, markedge);
lcc.unmark(it, markface);
}
lcc.free_mark(markvertex);
lcc.free_mark(markedge);
lcc.free_mark(markface);
}
void Viewer::attrib_buffers(CGAL::QGLViewer* viewer)
{
QMatrix4x4 mvpMatrix;
QMatrix4x4 mvMatrix;
double mat[16];
viewer->camera()->getModelViewProjectionMatrix(mat);
for(int i=0; i < 16; i++)
{
mvpMatrix.data()[i] = (float)mat[i];
}
viewer->camera()->getModelViewMatrix(mat);
for(int i=0; i < 16; i++)
{
mvMatrix.data()[i] = (float)mat[i];
}
// define material
QVector4D diffuse( 0.9f,
0.9f,
0.9f,
0.9f );
QVector4D specular( 0.0f,
0.0f,
0.0f,
1.0f );
QVector4D position((bb.xmax()-bb.xmin())/2, (bb.ymax()-bb.ymin())/2,bb.zmax(), 0.0 );
GLfloat shininess = 1.0f;
rendering_program.bind();
mvpLocation[0] = rendering_program.uniformLocation("mvp_matrix");
mvLocation = rendering_program.uniformLocation("mv_matrix");
lightLocation[0] = rendering_program.uniformLocation("light_pos");
lightLocation[1] = rendering_program.uniformLocation("light_diff");
lightLocation[2] = rendering_program.uniformLocation("light_spec");
lightLocation[3] = rendering_program.uniformLocation("light_amb");
lightLocation[4] = rendering_program.uniformLocation("spec_power");
rendering_program.setUniformValue(lightLocation[0], position);
rendering_program.setUniformValue(lightLocation[1], diffuse);
rendering_program.setUniformValue(lightLocation[2], specular);
rendering_program.setUniformValue(lightLocation[3], ambient);
rendering_program.setUniformValue(lightLocation[4], shininess);
rendering_program.setUniformValue(mvpLocation[0], mvpMatrix);
rendering_program.setUniformValue(mvLocation, mvMatrix);
rendering_program.release();
rendering_program_p_l.bind();
mvpLocation[1] = rendering_program_p_l.uniformLocation("mvp_matrix");
colorLocation = rendering_program_p_l.uniformLocation("color");
rendering_program.setUniformValue(mvpLocation[1], mvpMatrix);
rendering_program_p_l.release();
} }
void Viewer::sceneChanged() void Viewer::sceneChanged()
{ {
compute_elements(); Base::compute_elements();
this->camera()->setSceneBoundingBox(CGAL::qglviewer::Vec(bb.xmin(), this->camera()->
bb.ymin(), setSceneBoundingBox(CGAL::qglviewer::Vec(m_bounding_box.xmin(),
bb.zmin()), m_bounding_box.ymin(),
CGAL::qglviewer::Vec(bb.xmax(), m_bounding_box.zmin()),
bb.ymax(), CGAL::qglviewer::Vec(m_bounding_box.xmax(),
bb.zmax())); m_bounding_box.ymax(),
are_buffers_initialized = false; m_bounding_box.zmax()));
Base::redraw();
if (m_previous_scene_empty) if (m_previous_scene_empty)
this->showEntireScene(); { this->showEntireScene(); }
else
this->update();
m_previous_scene_empty = scene->lcc->is_empty(); // for the next call to sceneChanged m_previous_scene_empty = scene->lcc->is_empty(); // for the next call to sceneChanged
} }
void Viewer::draw()
{
if(scene)
{
glEnable(GL_DEPTH_TEST);
if(!are_buffers_initialized)
initialize_buffers();
QColor color;
if ( !wireframe )
{
if(flatShading)
{
vao[0].bind();
attrib_buffers(this);
rendering_program.bind();
glDrawArrays(GL_TRIANGLES, 0, static_cast<GLsizei>(pos_facets.size()/3));
rendering_program.release();
vao[0].release();
}
else
{
vao[1].bind();
attrib_buffers(this);
rendering_program.bind();
glDrawArrays(GL_TRIANGLES, 0, static_cast<GLsizei>(pos_facets.size()/3));
rendering_program.release();
vao[1].release();
}
}
if(edges)
{
vao[2].bind();
attrib_buffers(this);
color.setRgbF(0.2f, 0.2f, 0.7f);
rendering_program_p_l.bind();
rendering_program_p_l.setAttributeValue(colorLocation,color);
glLineWidth(size_edges);
glDrawArrays(GL_LINES, 0, static_cast<GLsizei>(pos_lines.size()/3));
rendering_program_p_l.release();
vao[2].release();
}
if(vertices)
{
vao[3].bind();
attrib_buffers(this);
color.setRgbF(.2f,.2f,.6f);
rendering_program_p_l.bind();
rendering_program_p_l.setAttributeValue(colorLocation,color);
rendering_program_p_l.setUniformValue("point_size", GLfloat(size_points));
glDrawArrays(GL_POINTS, 0, static_cast<GLsizei>(pos_points.size()/3));
rendering_program_p_l.release();
vao[3].release();
}
}
}
void Viewer::init()
{
// Restore previous viewer state.
restoreStateFromFile();
initializeOpenGLFunctions();
// Define 'Control+Q' as the new exit shortcut (default was 'Escape')
setShortcut(CGAL::qglviewer::EXIT_VIEWER, Qt::CTRL+Qt::Key_Q);
// Add custom key description (see keyPressEvent).
setKeyDescription(Qt::Key_W, "Toggles wire frame display");
setKeyDescription(Qt::Key_F, "Toggles flat shading display");
setKeyDescription(Qt::Key_E, "Toggles edges display");
setKeyDescription(Qt::Key_V, "Toggles vertices display");
setKeyDescription(Qt::Key_N, "Inverse direction of normals");
setKeyDescription(Qt::Key_Plus, "Increase size of edges");
setKeyDescription(Qt::Key_Minus, "Decrease size of edges");
setKeyDescription(Qt::Key_Plus+Qt::ShiftModifier, "Increase size of vertices");
setKeyDescription(Qt::Key_Minus+Qt::ShiftModifier, "Decrease size of vertices");
setKeyDescription(Qt::Key_PageDown, "Increase light (all colors, use shift/alt/ctrl for one rgb component)");
setKeyDescription(Qt::Key_PageUp, "Decrease light (all colors, use shift/alt/ctrl for one rgb component)");
// Light default parameters
glLineWidth(size_edges);
glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(1.0f,1.0f);
glClearColor(1.0f,1.0f,1.0f,0.0f);
glDisable(GL_BLEND);
glDisable(GL_LINE_SMOOTH);
glDisable(GL_POLYGON_SMOOTH_HINT);
glBlendFunc(GL_ONE, GL_ZERO);
glHint(GL_LINE_SMOOTH_HINT, GL_FASTEST);
compile_shaders();
}
void Viewer::keyPressEvent(QKeyEvent *e) void Viewer::keyPressEvent(QKeyEvent *e)
{ {
const Qt::KeyboardModifiers modifiers = e->modifiers(); // const Qt::KeyboardModifiers modifiers = e->modifiers();
Base::keyPressEvent(e);
if ((e->key()==Qt::Key_W) && (modifiers==Qt::NoButton))
{
wireframe = !wireframe;
if (wireframe)
{
displayMessage("Wireframe.");
}
else
{
displayMessage("Filled faces.");
}
update();
}
else if ((e->key()==Qt::Key_F) && (modifiers==Qt::NoButton))
{
flatShading = !flatShading;
if (flatShading)
displayMessage("Flat shading.");
else
displayMessage("Gouraud shading.");
update();
}
else if ((e->key()==Qt::Key_E) && (modifiers==Qt::NoButton))
{
edges = !edges;
displayMessage(QString("Draw edges=%1.").arg(edges?"true":"false"));
update();
}
else if ((e->key()==Qt::Key_V) && (modifiers==Qt::NoButton))
{
vertices = !vertices;
displayMessage(QString("Draw vertices=%1.").arg(vertices?"true":"false"));
update();
}
else if ((e->key()==Qt::Key_N) && (modifiers==Qt::NoButton))
{
inverse_normal = !inverse_normal;
displayMessage(QString("Inverse normal=%1.").arg(inverse_normal?"true":"false"));
sceneChanged();
}
else if ((e->key()==Qt::Key_Plus) && (modifiers==Qt::KeypadModifier))
{
size_edges+=.5;
displayMessage(QString("Size of edges=%1.").arg(size_edges));
update();
}
else if ((e->key()==Qt::Key_Minus) && (modifiers==Qt::KeypadModifier))
{
if (size_edges>.5) size_edges-=.5;
displayMessage(QString("Size of edges=%1.").arg(size_edges));
update();
}
else if ((e->key()==Qt::Key_Plus) && (modifiers==(Qt::ShiftModifier|Qt::KeypadModifier)))
{
size_points+=.5;
displayMessage(QString("Size of points=%1.").arg(size_points));
update();
}
else if ((e->key()==Qt::Key_Minus) && (modifiers==(Qt::ShiftModifier|Qt::KeypadModifier)))
{
if (size_points>.5) size_points-=.5;
displayMessage(QString("Size of points=%1.").arg(size_points));
update();
}
else if ((e->key()==Qt::Key_PageUp) && (modifiers==Qt::NoButton))
{
ambient.setX(ambient.x()+.1);
if (ambient.x()>1.) ambient.setX(1.);
ambient.setY(ambient.x()+.1);
if (ambient.y()>1.) ambient.setY(1.);
ambient.setZ(ambient.x()+.1);
if (ambient.z()>1.) ambient.setZ(1.);
displayMessage(QString("Light color=(%1 %2 %3).").
arg(ambient.x()).arg(ambient.y()).arg(ambient.z()));
update();
}
else if ((e->key()==Qt::Key_PageDown) && (modifiers==Qt::NoButton))
{
ambient.setX(ambient.x()-.1);
if (ambient.x()<0.) ambient.setX(0.);
ambient.setY(ambient.y()-.1);
if (ambient.y()<0.) ambient.setY(0.);
ambient.setZ(ambient.z()-.1);
if (ambient.z()<0.) ambient.setZ(0.);
displayMessage(QString("Light color=(%1 %2 %3).").
arg(ambient.x()).arg(ambient.y()).arg(ambient.z()));
update();
}
else if ((e->key()==Qt::Key_PageUp) && (modifiers==Qt::ShiftModifier))
{
ambient.setX(ambient.x()+.1);
if (ambient.x()>1.) ambient.setX(1.);
displayMessage(QString("Light color=(%1 %2 %3).").
arg(ambient.x()).arg(ambient.y()).arg(ambient.z()));
update();
}
else if ((e->key()==Qt::Key_PageUp) && (modifiers==Qt::AltModifier))
{
ambient.setY(ambient.y()+.1);
if (ambient.y()>1.) ambient.setY(1.);
displayMessage(QString("Light color=(%1 %2 %3).").
arg(ambient.x()).arg(ambient.y()).arg(ambient.z()));
update();
}
else if ((e->key()==Qt::Key_PageUp) && (modifiers==Qt::ControlModifier))
{
ambient.setZ(ambient.z()+.1);
if (ambient.z()>1.) ambient.setZ(1.);
displayMessage(QString("Light color=(%1 %2 %3).").
arg(ambient.x()).arg(ambient.y()).arg(ambient.z()));
update();
}
else if ((e->key()==Qt::Key_PageDown) && (modifiers==Qt::ShiftModifier))
{
ambient.setX(ambient.x()-.1);
if (ambient.x()<0.) ambient.setX(0.);
displayMessage(QString("Light color=(%1 %2 %3).").
arg(ambient.x()).arg(ambient.y()).arg(ambient.z()));
update();
}
else if ((e->key()==Qt::Key_PageDown) && (modifiers==Qt::AltModifier))
{
ambient.setY(ambient.y()-.1);
if (ambient.y()<0.) ambient.setY(0.);
displayMessage(QString("Light color=(%1 %2 %3).").
arg(ambient.x()).arg(ambient.y()).arg(ambient.z()));
update();
}
else if ((e->key()==Qt::Key_PageDown) && (modifiers==Qt::ControlModifier))
{
ambient.setZ(ambient.z()-.1);
if (ambient.z()<0.) ambient.setZ(0.);
displayMessage(QString("Light color=(%1 %2 %3).").
arg(ambient.x()).arg(ambient.y()).arg(ambient.z()));
update();
}
else
CGAL::QGLViewer::keyPressEvent(e);
} }
QString Viewer::helpString() const QString Viewer::helpString() const
{ { return Base::helpString("LCC Demo"); }
QString text("<h2>L C C V i e w e r</h2>");
text += "Use the mouse to move the camera around the object. ";
text += "You can respectively revolve around, zoom and translate with "
"the three mouse buttons. ";
text += "Left and middle buttons pressed together rotate around the "
"camera view direction axis<br><br>";
text += "Pressing <b>Alt</b> and one of the function keys "
"(<b>F1</b>..<b>F12</b>) defines a camera keyFrame. ";
text += "Simply press the function key again to restore it. Several "
"keyFrames define a ";
text += "camera path. Paths are saved when you quit the application and "
"restored at next start.<br><br>";
text += "Press <b>F</b> to display the frame rate, <b>A</b> for the "
"world axis, ";
text += "<b>Alt+Return</b> for full screen mode and <b>Control+S</b> to "
"save a snapshot. ";
text += "See the <b>Keyboard</b> tab in this window for a complete "
"shortcut list.<br><br>";
text += "Double clicks automates single click actions: A left button "
"double click aligns the closer axis with the camera (if close enough). ";
text += "A middle button double click fits the zoom of the camera and "
"the right button re-centers the scene.<br><br>";
text += "A left button double click while holding right button pressed "
"defines the camera <i>Revolve Around Point</i>. ";
text += "See the <b>Mouse</b> tab and the documentation web pages for "
"details.<br><br>";
text += "Press <b>Escape</b> to exit the viewer.";
return text;
}

View File

@ -23,96 +23,114 @@
#define VIEWER_H #define VIEWER_H
#include "typedefs.h" #include "typedefs.h"
#include <CGAL/draw_linear_cell_complex.h>
#include <vector> // Functor used by SimpleLCCViewerQt to colorize of not elements.
#include <QMap> struct MyDrawingFunctorLCC
#include <CGAL/Qt/qglviewer.h> {
#include <QKeyEvent> /// @return true iff the volume containing dh is drawn.
#include <QOpenGLFunctions_2_1> template<typename LCC>
#include <QOpenGLVertexArrayObject> bool draw_volume(const LCC& alcc,
#include <QGLBuffer> typename LCC::Dart_const_handle dh) const
#include <QOpenGLShaderProgram> { return alcc.template info<3>(dh).is_visible(); }
/// @return true iff the face containing dh is drawn.
template<typename LCC>
bool draw_face(const LCC&,
typename LCC::Dart_const_handle) const
{ return true; }
/// @return true iff the edge containing dh is drawn.
template<typename LCC>
bool draw_edge(const LCC&,
typename LCC::Dart_const_handle) const
{ return true; }
/// @return true iff the vertex containing dh is drawn.
template<typename LCC>
bool draw_vertex(const LCC&,
typename LCC::Dart_const_handle) const
{ return true; }
#define NB_VBO_BUFFERS 8 /// @return true iff the volume containing dh is drawn in wireframe.
#define NB_VAO_BUFFERS 4 template<typename LCC>
bool volume_wireframe(const LCC& alcc,
typename LCC::Dart_const_handle dh) const
{ return !(alcc.template info<3>(dh).is_filled()); }
/// @return true iff the face containing dh is drawn in wireframe.
template<typename LCC>
bool face_wireframe(const LCC&,
typename LCC::Dart_const_handle) const
{ return false; }
class Viewer : public CGAL::QGLViewer /// @return true iff the volume containing dh is colored.
template<typename LCC>
bool colored_volume(const LCC&,
typename LCC::Dart_const_handle) const
{ return true; }
/// @return true iff the face containing dh is colored.
/// if we have also colored_volume(alcc, dh), the volume color is
/// ignored and only the face color is considered.
template<typename LCC>
bool colored_face(const LCC&,
typename LCC::Dart_const_handle) const
{ return false; }
/// @return true iff the edge containing dh is colored.
template<typename LCC>
bool colored_edge(const LCC&,
typename LCC::Dart_const_handle) const
{ return false; }
/// @return true iff the vertex containing dh is colored.
template<typename LCC>
bool colored_vertex(const LCC&,
typename LCC::Dart_const_handle) const
{ return false; }
/// @return the color of the volume containing dh
/// used only if colored_volume(alcc, dh) and !colored_face(alcc, dh)
template<typename LCC>
CGAL::Color volume_color(const LCC& alcc,
typename LCC::Dart_const_handle dh) const
{ return alcc.template info<3>(dh).color(); }
/// @return the color of the face containing dh
/// used only if colored_face(alcc, dh)
template<typename LCC>
CGAL::Color face_color(const LCC& alcc,
typename LCC::Dart_const_handle dh) const
{
CGAL::Random random((unsigned int)(alcc.darts().index(dh)));
return get_random_color(random);
}
/// @return the color of the edge containing dh
/// used only if colored_edge(alcc, dh)
template<typename LCC>
CGAL::Color edge_color(const LCC&,
typename LCC::Dart_const_handle) const
{ return CGAL::Color(0, 0, 0); }
/// @return the color of the vertex containing dh
/// used only if colored_vertex(alcc, dh)
template<typename LCC>
CGAL::Color vertex_color(const LCC&,
typename LCC::Dart_const_handle) const
{ return CGAL::Color(0, 0, 0); }
};
class Viewer : public CGAL::SimpleLCCViewerQt<LCC, MyDrawingFunctorLCC>
{ {
Q_OBJECT Q_OBJECT
typedef LCC::Dart_handle Dart_handle; typedef CGAL::SimpleLCCViewerQt<LCC, MyDrawingFunctorLCC> Base;
typedef LCC::Dart_const_handle Dart_const_handle;
public: public:
Viewer(QWidget* parent); Viewer(QWidget* parent);
void setScene(Scene* scene_, bool doredraw=true);
~Viewer();
void setScene(Scene* scene_)
{ scene = scene_; }
public:
void draw();
virtual void init();
void keyPressEvent(QKeyEvent *e); void keyPressEvent(QKeyEvent *e);
virtual QString helpString() const; virtual QString helpString() const;
public Q_SLOTS: public Q_SLOTS:
void sceneChanged(); void sceneChanged();
private:
void initialize_buffers();
void attrib_buffers(CGAL::QGLViewer*);
void compile_shaders();
void compute_elements();
void compute_face(Dart_handle dh, LCC::size_type markface);
void compute_edge(Dart_handle dh, LCC::size_type markedge);
void compute_vertex(Dart_handle dh, LCC::size_type markvertex, bool& empty);
private: private:
Scene* scene; Scene* scene;
bool wireframe;
bool flatShading;
bool edges;
bool vertices;
bool inverse_normal;
double size_points;
double size_edges;
QVector4D ambient;
bool m_previous_scene_empty; bool m_previous_scene_empty;
bool are_buffers_initialized;
//Shaders elements
int vertexLocation[3];
int normalsLocation;
int mvpLocation[2];
int mvLocation;
int colorLocation;
int colorsLocation;
int lightLocation[5];
std::vector<float> pos_points;
std::vector<float> pos_lines;
std::vector<float> pos_facets;
std::vector<float> smooth_normals;
std::vector<float> flat_normals;
std::vector<float> colors;
QGLBuffer buffers[NB_VBO_BUFFERS];
QOpenGLVertexArrayObject vao[NB_VAO_BUFFERS];
QOpenGLShaderProgram rendering_program;
QOpenGLShaderProgram rendering_program_p_l;
CGAL::Bbox_3 bb;
}; };
#endif #endif

View File

@ -9,6 +9,10 @@ if(NOT POLICY CMP0070 AND POLICY CMP0053)
cmake_policy(SET CMP0053 OLD) cmake_policy(SET CMP0053 OLD)
endif() endif()
if(POLICY CMP0071)
cmake_policy(SET CMP0071 NEW)
endif()
find_package(CGAL COMPONENTS Qt5) find_package(CGAL COMPONENTS Qt5)
if(CGAL_Qt5_FOUND) if(CGAL_Qt5_FOUND)

View File

@ -31,15 +31,96 @@ namespace CGAL
{ {
// Default color functor; user can change it to have its own face color // Default color functor; user can change it to have its own face color
struct DefaultColorFunctorLCC struct DefaultDrawingFunctorLCC
{ {
/// @return true iff the volume containing dh is drawn.
template<typename LCC> template<typename LCC>
static CGAL::Color run(const LCC& alcc, bool draw_volume(const LCC&,
typename LCC::Dart_const_handle dh) typename LCC::Dart_const_handle) const
{ { return true; }
if (dh==alcc.null_handle) // use to get the mono color /// @return true iff the face containing dh is drawn.
return CGAL::Color(100, 125, 200); // R G B between 0-255 template<typename LCC>
bool draw_face(const LCC&,
typename LCC::Dart_const_handle) const
{ return true; }
/// @return true iff the edge containing dh is drawn.
template<typename LCC>
bool draw_edge(const LCC&,
typename LCC::Dart_const_handle) const
{ return true; }
/// @return true iff the vertex containing dh is drawn.
template<typename LCC>
bool draw_vertex(const LCC&,
typename LCC::Dart_const_handle) const
{ return true; }
/// @return true iff the volume containing dh is drawn in wireframe.
template<typename LCC>
bool volume_wireframe(const LCC&,
typename LCC::Dart_const_handle) const
{ return false; }
/// @return true iff the face containing dh is drawn in wireframe.
template<typename LCC>
bool face_wireframe(const LCC&,
typename LCC::Dart_const_handle) const
{ return false; }
/// @return true iff the volume containing dh is colored.
template<typename LCC>
bool colored_volume(const LCC&,
typename LCC::Dart_const_handle) const
{ return true; }
/// @return true iff the face containing dh is colored.
/// if we have also colored_volume(alcc, dh), the volume color is
/// ignored and only the face color is considered.
template<typename LCC>
bool colored_face(const LCC&,
typename LCC::Dart_const_handle) const
{ return false; }
/// @return true iff the edge containing dh is colored.
template<typename LCC>
bool colored_edge(const LCC&,
typename LCC::Dart_const_handle) const
{ return false; }
/// @return true iff the vertex containing dh is colored.
template<typename LCC>
bool colored_vertex(const LCC&,
typename LCC::Dart_const_handle) const
{ return false; }
/// @return the color of the volume containing dh
/// used only if colored_volume(alcc, dh) and !colored_face(alcc, dh)
template<typename LCC>
CGAL::Color volume_color(const LCC& alcc,
typename LCC::Dart_const_handle dh) const
{
CGAL::Random random((unsigned int)(alcc.darts().index(dh)));
return get_random_color(random);
}
/// @return the color of the face containing dh
/// used only if colored_face(alcc, dh)
template<typename LCC>
CGAL::Color face_color(const LCC& alcc,
typename LCC::Dart_const_handle dh) const
{
CGAL::Random random((unsigned int)(alcc.darts().index(dh)));
return get_random_color(random);
}
/// @return the color of the edge containing dh
/// used only if colored_edge(alcc, dh)
template<typename LCC>
CGAL::Color edge_color(const LCC& alcc,
typename LCC::Dart_const_handle dh) const
{
CGAL::Random random((unsigned int)(alcc.darts().index(dh)));
return get_random_color(random);
}
/// @return the color of the vertex containing dh
/// used only if colored_vertex(alcc, dh)
template<typename LCC>
CGAL::Color vertex_color(const LCC& alcc,
typename LCC::Dart_const_handle dh) const
{
CGAL::Random random((unsigned int)(alcc.darts().index(dh))); CGAL::Random random((unsigned int)(alcc.darts().index(dh)));
return get_random_color(random); return get_random_color(random);
} }
@ -73,7 +154,7 @@ struct LCC_geom_utils<LCC, Kernel, 2>
}; };
// Viewer class for LCC // Viewer class for LCC
template<class LCC, class ColorFunctor> template<class LCC, class DrawingFunctorLCC>
class SimpleLCCViewerQt : public Basic_viewer_qt class SimpleLCCViewerQt : public Basic_viewer_qt
{ {
typedef Basic_viewer_qt Base; typedef Basic_viewer_qt Base;
@ -89,42 +170,68 @@ public:
/// @param anofaces if true, do not draw faces (faces are not computed; this can be /// @param anofaces if true, do not draw faces (faces are not computed; this can be
/// usefull for very big object where this time could be long) /// usefull for very big object where this time could be long)
SimpleLCCViewerQt(QWidget* parent, SimpleLCCViewerQt(QWidget* parent,
const LCC& alcc, const LCC* alcc=NULL,
const char* title="Basic LCC Viewer", const char* title="Basic LCC Viewer",
bool anofaces=false, bool anofaces=false,
const ColorFunctor& fcolor=ColorFunctor()) : const DrawingFunctorLCC& drawing_functor=DrawingFunctorLCC()) :
// First draw: vertices; edges, faces; multi-color; inverse normal // First draw: vertices; edges, faces; multi-color; inverse normal
Base(parent, title, true, true, true, false, true), Base(parent, title, true, true, true, false, true),
lcc(alcc), lcc(alcc),
m_nofaces(anofaces), m_nofaces(anofaces),
m_fcolor(fcolor) m_random_face_color(false),
m_drawing_functor(drawing_functor)
{ {
compute_elements(); compute_elements();
} }
protected: protected:
void compute_face(Dart_const_handle dh) void set_lcc(const LCC* alcc, bool doredraw=true)
{ {
lcc=alcc;
compute_elements();
if (doredraw) { redraw(); }
}
void compute_face(Dart_const_handle dh, Dart_const_handle voldh)
{
if (m_nofaces || !m_drawing_functor.draw_face(*lcc, dh)) return;
// We fill only closed faces. // We fill only closed faces.
Dart_const_handle cur=dh; Dart_const_handle cur=dh;
Dart_const_handle min=dh; Dart_const_handle min=dh;
do do
{ {
if (!lcc.is_next_exist(cur)) return; // open face=>not filled if (!lcc->is_next_exist(cur)) return; // open face=>not filled
if (cur<min) min=cur; if (cur<min) min=cur;
cur=lcc.next(cur); cur=lcc->next(cur);
} }
while(cur!=dh); while(cur!=dh);
CGAL::Color c=m_fcolor.run(lcc, dh); if (m_random_face_color)
face_begin(c); {
CGAL::Random random((unsigned int)(lcc->darts().index(dh)));
CGAL::Color c=get_random_color(random);
face_begin(c);
}
else if (m_drawing_functor.colored_face(*lcc, dh))
{
CGAL::Color c=m_drawing_functor.face_color(*lcc, dh);
face_begin(c);
}
else if (m_drawing_functor.colored_volume(*lcc, voldh))
{
CGAL::Color c=m_drawing_functor.volume_color(*lcc, voldh);
face_begin(c);
}
else
{ face_begin(); }
cur=dh; cur=dh;
do do
{ {
add_point_in_face(lcc.point(cur), LCC_geom_utils<LCC, Local_kernel>:: add_point_in_face(lcc->point(cur), LCC_geom_utils<LCC, Local_kernel>::
get_vertex_normal(lcc, cur)); get_vertex_normal(*lcc, cur));
cur=lcc.next(cur); cur=lcc->next(cur);
} }
while(cur!=dh); while(cur!=dh);
@ -133,77 +240,143 @@ protected:
void compute_edge(Dart_const_handle dh) void compute_edge(Dart_const_handle dh)
{ {
Point p1 = lcc.point(dh); if (!m_drawing_functor.draw_edge(*lcc, dh)) return;
Dart_const_handle d2 = lcc.other_extremity(dh);
Point p1 = lcc->point(dh);
Dart_const_handle d2 = lcc->other_extremity(dh);
if (d2!=NULL) if (d2!=NULL)
{ add_segment(p1, lcc.point(d2)); } {
if (m_drawing_functor.colored_edge(*lcc, dh))
{ add_segment(p1, lcc->point(d2), m_drawing_functor.edge_color(*lcc, dh)); }
else
{ add_segment(p1, lcc->point(d2)); }
}
} }
void compute_vertex(Dart_const_handle dh) void compute_vertex(Dart_const_handle dh)
{ add_point(lcc.point(dh)); } {
if (!m_drawing_functor.draw_vertex(*lcc, dh)) return;
if (m_drawing_functor.colored_vertex(*lcc, dh))
{ add_point(lcc->point(dh), m_drawing_functor.vertex_color(*lcc, dh)); }
else
{ add_point(lcc->point(dh)); }
}
void compute_elements() void compute_elements()
{ {
clear(); clear();
if (lcc==NULL) return;
typename LCC::size_type markvolumes = lcc->get_new_mark();
typename LCC::size_type markfaces = lcc->get_new_mark();
typename LCC::size_type markedges = lcc->get_new_mark();
typename LCC::size_type markvertices = lcc->get_new_mark();
typename LCC::size_type markfaces = lcc.get_new_mark(); for (typename LCC::Dart_range::const_iterator it=lcc->darts().begin(),
typename LCC::size_type markedges = lcc.get_new_mark(); itend=lcc->darts().end(); it!=itend; ++it )
typename LCC::size_type markvertices = lcc.get_new_mark();
for (typename LCC::Dart_range::const_iterator it=lcc.darts().begin(),
itend=lcc.darts().end(); it!=itend; ++it )
{ {
if ( !m_nofaces && !lcc.is_marked(it, markfaces) ) if (!lcc->is_marked(it, markvolumes) &&
m_drawing_functor.draw_volume(*lcc, it))
{ {
compute_face(it); for (typename LCC::template Dart_of_cell_basic_range<3>::
CGAL::mark_cell<LCC, 2>(lcc, it, markfaces); const_iterator itv=lcc->template darts_of_cell_basic<3>(it, markvolumes).begin(),
} itvend=lcc->template darts_of_cell_basic<3>(it, markvolumes).end();
itv!=itvend; ++itv)
if ( !lcc.is_marked(it, markedges) ) {
{ lcc->mark(itv, markvolumes); // To be sure that all darts of the basic iterator will be marked
compute_edge(it); if (!lcc->is_marked(itv, markfaces) &&
CGAL::mark_cell<LCC, 1>(lcc, it, markedges); m_drawing_functor.draw_face(*lcc, itv))
} {
if (!m_drawing_functor.volume_wireframe(*lcc, itv) &&
if ( !lcc.is_marked(it, markvertices) ) !m_drawing_functor.face_wireframe(*lcc, itv))
{ { compute_face(itv, it); }
compute_vertex(it); for (typename LCC::template Dart_of_cell_basic_range<2>::
CGAL::mark_cell<LCC, 0>(lcc, it, markvertices); const_iterator itf=lcc->template darts_of_cell_basic<2>(itv, markfaces).begin(),
itfend=lcc->template darts_of_cell_basic<2>(itv, markfaces).end();
itf!=itfend; ++itf)
{
if (!m_drawing_functor.volume_wireframe(*lcc, itv) &&
!m_drawing_functor.face_wireframe(*lcc, itv))
{ lcc->mark(itf, markfaces); } // To be sure that all darts of the basic iterator will be marked
if ( !lcc->is_marked(itf, markedges) &&
m_drawing_functor.draw_edge(*lcc, itf))
{
compute_edge(itf);
for (typename LCC::template Dart_of_cell_basic_range<1>::
const_iterator ite=lcc->template darts_of_cell_basic<1>(itf, markedges).begin(),
iteend=lcc->template darts_of_cell_basic<1>(itf, markedges).end();
ite!=iteend; ++ite)
{
lcc->mark(ite, markedges); // To be sure that all darts of the basic iterator will be marked
if ( !lcc->is_marked(ite, markvertices) &&
m_drawing_functor.draw_vertex(*lcc, ite))
{
compute_vertex(ite);
CGAL::mark_cell<LCC, 0>(*lcc, ite, markvertices);
}
}
}
}
}
}
} }
} }
lcc.free_mark(markfaces); for (typename LCC::Dart_range::const_iterator it=lcc->darts().begin(),
lcc.free_mark(markedges); itend=lcc->darts().end(); it!=itend; ++it )
lcc.free_mark(markvertices); {
} lcc->unmark(it, markvertices);
lcc->unmark(it, markedges);
lcc->unmark(it, markfaces);
lcc->unmark(it, markvolumes);
}
lcc->free_mark(markvolumes);
lcc->free_mark(markfaces);
lcc->free_mark(markedges);
lcc->free_mark(markvertices);
}
virtual void init()
{
Base::init();
setKeyDescription(::Qt::Key_C, "Toggles random face colors");
}
virtual void keyPressEvent(QKeyEvent *e) virtual void keyPressEvent(QKeyEvent *e)
{ {
// Test key pressed: const ::Qt::KeyboardModifiers modifiers = e->modifiers();
// const ::Qt::KeyboardModifiers modifiers = e->modifiers(); if ((e->key()==::Qt::Key_C) && (modifiers==::Qt::NoButton))
// if ((e->key()==Qt::Key_PageUp) && (modifiers==Qt::NoButton)) { ... } {
m_random_face_color=!m_random_face_color;
displayMessage(QString("Random face color=%1.").arg(m_random_face_color?"true":"false"));
compute_elements();
redraw();
}
else
{ Base::keyPressEvent(e); } // Call the base method to process others/classicals key
// Call: * compute_elements() if the model changed, followed by // Call: * compute_elements() if the model changed, followed by
// * redraw() if some viewing parameters changed that implies some // * redraw() if some viewing parameters changed that implies some
// modifications of the buffers // modifications of the buffers
// (eg. type of normal, color/mono) // (eg. type of normal, color/mono)
// * update() just to update the drawing // * update() just to update the drawing
// Call the base method to process others/classicals key
Base::keyPressEvent(e);
} }
protected: protected:
const LCC& lcc; const LCC* lcc;
bool m_nofaces; bool m_nofaces;
const ColorFunctor& m_fcolor; bool m_random_face_color;
const DrawingFunctorLCC& m_drawing_functor;
}; };
template<class LCC, class ColorFunctor> template<class LCC, class DrawingFunctorLCC>
void draw(const LCC& alcc, void draw(const LCC& alcc,
const char* title, const char* title,
bool nofill, bool nofill,
const ColorFunctor& fcolor) const DrawingFunctorLCC& drawing_functor)
{ {
#if defined(CGAL_TEST_SUITE) #if defined(CGAL_TEST_SUITE)
bool cgal_test_suite=true; bool cgal_test_suite=true;
@ -216,11 +389,11 @@ void draw(const LCC& alcc,
int argc=1; int argc=1;
const char* argv[2]={"lccviewer","\0"}; const char* argv[2]={"lccviewer","\0"};
QApplication app(argc,const_cast<char**>(argv)); QApplication app(argc,const_cast<char**>(argv));
SimpleLCCViewerQt<LCC, ColorFunctor> mainwindow(app.activeWindow(), SimpleLCCViewerQt<LCC, DrawingFunctorLCC> mainwindow(app.activeWindow(),
alcc, &alcc,
title, title,
nofill, nofill,
fcolor); drawing_functor);
mainwindow.show(); mainwindow.show();
app.exec(); app.exec();
} }
@ -229,8 +402,8 @@ void draw(const LCC& alcc,
template<class LCC> template<class LCC>
void draw(const LCC& alcc, const char* title, bool nofill) void draw(const LCC& alcc, const char* title, bool nofill)
{ {
DefaultColorFunctorLCC c; DefaultDrawingFunctorLCC f;
draw(alcc, title, nofill, c); draw(alcc, title, nofill, f);
} }
template<class LCC> template<class LCC>

View File

@ -71,7 +71,7 @@ int main(int argc, char** argv)
std::cerr << "Assignment f2=f...\n"; std::cerr << "Assignment f2=f...\n";
f2 = f; // check the assignment f2 = f; // check the assignment
std::cerr << "Auto-assignment f=f...\n"; std::cerr << "Auto-assignment f=f...\n";
f2 = f2; // check the auto-assignment f2 = (Map&)f2; // check the auto-assignment
std::cerr << "Copy-construction...\n"; std::cerr << "Copy-construction...\n";
Map f3(f); // check the copy constructor Map f3(f); // check the copy constructor

View File

@ -14,6 +14,10 @@ if ( MESH_3_VERBOSE )
add_definitions(-DCGAL_MESH_3_VERBOSE) add_definitions(-DCGAL_MESH_3_VERBOSE)
endif() endif()
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
find_package(CGAL COMPONENTS ImageIO) find_package(CGAL COMPONENTS ImageIO)
if ( CGAL_FOUND ) if ( CGAL_FOUND )

View File

@ -1048,6 +1048,11 @@ public:
{ {
// Lock the element area on the grid // Lock the element area on the grid
Element element = derivd.extract_element_from_container_value(ce); Element element = derivd.extract_element_from_container_value(ce);
// This is safe to do with the concurrent compact container because even if the element `ce`
// gets removed from the TDS at this point, it is not actually deleted in the cells container and
// `ce->vertex(0-3)` still points to a vertex of the vertices container whose `.point()`
// can be safely accessed (even if that vertex has itself also been removed from the TDS).
bool locked = derivd.try_lock_element(element, FIRST_GRID_LOCK_RADIUS); bool locked = derivd.try_lock_element(element, FIRST_GRID_LOCK_RADIUS);
if( locked ) if( locked )

View File

@ -6,6 +6,9 @@ project( Mesh_3_Tests )
cmake_minimum_required(VERSION 3.1) cmake_minimum_required(VERSION 3.1)
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW)
endif()
find_package(CGAL QUIET COMPONENTS ImageIO) find_package(CGAL QUIET COMPONENTS ImageIO)

View File

@ -314,7 +314,9 @@ struct Tester
// Test edge iterators // Test edge iterators
//------------------------------------------------------- //-------------------------------------------------------
std::cout << "Test edge iterators\n"; std::cout << "Test edge iterators\n";
const Edge& edge_to_modify = *(c3t3.edges_in_complex_begin()); typename C3t3::Edges_in_complex_iterator eit = c3t3.edges_in_complex_begin();
assert(eit != c3t3.edges_in_complex_end());
const Edge& edge_to_modify = *eit;
c3t3.remove_from_complex(edge_to_modify); c3t3.remove_from_complex(edge_to_modify);
c3t3.add_to_complex(edge_to_modify,curve_index_bis); c3t3.add_to_complex(edge_to_modify,curve_index_bis);

View File

@ -40,8 +40,15 @@
#endif #endif
#ifdef CGAL_USE_BOOST_BIMAP #ifdef CGAL_USE_BOOST_BIMAP
# if defined(BOOST_MSVC)
# pragma warning(push)
# pragma warning(disable: 4996)
# endif
#include <CGAL/boost/bimap.hpp> #include <CGAL/boost/bimap.hpp>
#include <boost/bimap/multiset_of.hpp> #include <boost/bimap/multiset_of.hpp>
# if defined(BOOST_MSVC)
# pragma warning(pop)
# endif
#endif #endif
namespace CGAL { namespace CGAL {

View File

@ -102,7 +102,7 @@ int main()
assert(mod_x == CGAL::modular_image(int_x)); assert(mod_x == CGAL::modular_image(int_x));
int_x -= int_x; int_x = CGAL::mod(int_x, prime); int_x -= int_x; int_x = CGAL::mod(int_x, prime);
mod_x -= mod_x; mod_x -= (CGAL::Residue&)mod_x;
} }
{ {
CGAL::Residue::set_current_prime(67111043); CGAL::Residue::set_current_prime(67111043);

View File

@ -343,36 +343,45 @@ void collect_polygon_mesh_info(
} //end of namespace nef_to_pm } //end of namespace nef_to_pm
template <class Output_kernel, class Nef_polyhedron>
template <class Nef_polyhedron, class Polygon_mesh> void convert_nef_polyhedron_to_polygon_soup(const Nef_polyhedron& nef,
void convert_nef_polyhedron_to_polygon_mesh(const Nef_polyhedron& nef, Polygon_mesh& pm, bool triangulate_all_faces = false) std::vector<typename Output_kernel::Point_3>& points,
std::vector< std::vector<std::size_t> >& polygons,
bool triangulate_all_faces = false)
{ {
typedef typename Nef_polyhedron::Point_3 Point_3; typedef typename Nef_polyhedron::Point_3 Point_3;
typedef typename boost::property_traits<typename boost::property_map<Polygon_mesh, vertex_point_t>::type>::value_type PM_Point;
typedef typename Kernel_traits<PM_Point>::Kernel PM_Kernel;
typedef typename Kernel_traits<Point_3>::Kernel Nef_Kernel; typedef typename Kernel_traits<Point_3>::Kernel Nef_Kernel;
typedef Cartesian_converter<Nef_Kernel, PM_Kernel> Converter; typedef Cartesian_converter<Nef_Kernel, Output_kernel> Converter;
typedef typename Output_kernel::Point_3 Out_point;
typename Nef_polyhedron::Volume_const_iterator vol_it = nef.volumes_begin(), typename Nef_polyhedron::Volume_const_iterator vol_it = nef.volumes_begin(),
vol_end = nef.volumes_end(); vol_end = nef.volumes_end();
if ( Nef_polyhedron::Infi_box::extended_kernel() ) ++vol_it; // skip Infi_box if ( Nef_polyhedron::Infi_box::extended_kernel() ) ++vol_it; // skip Infi_box
CGAL_assertion ( vol_it != vol_end ); CGAL_assertion ( vol_it != vol_end );
++vol_it; // skip unbounded volume ++vol_it; // skip unbounded volume
Converter to_output;
for (;vol_it!=vol_end;++vol_it)
nef_to_pm::collect_polygon_mesh_info<Out_point>(points,
polygons,
nef,
vol_it->shells_begin(),
to_output,
triangulate_all_faces);
}
template <class Nef_polyhedron, class Polygon_mesh>
void convert_nef_polyhedron_to_polygon_mesh(const Nef_polyhedron& nef, Polygon_mesh& pm, bool triangulate_all_faces = false)
{
typedef typename boost::property_traits<typename boost::property_map<Polygon_mesh, vertex_point_t>::type>::value_type PM_Point;
typedef typename Kernel_traits<PM_Point>::Kernel PM_Kernel;
std::vector<PM_Point> points; std::vector<PM_Point> points;
std::vector< std::vector<std::size_t> > polygons; std::vector< std::vector<std::size_t> > polygons;
Converter to_inexact; convert_nef_polyhedron_to_polygon_soup<PM_Kernel>(nef, points, polygons, triangulate_all_faces);
for (;vol_it!=vol_end;++vol_it)
nef_to_pm::collect_polygon_mesh_info<PM_Point>(points,
polygons,
nef,
vol_it->shells_begin(),
to_inexact,
triangulate_all_faces);
Polygon_mesh_processing::polygon_soup_to_polygon_mesh(points, polygons, pm); Polygon_mesh_processing::polygon_soup_to_polygon_mesh(points, polygons, pm);
} }
} //end of namespace CGAL } //end of namespace CGAL

View File

@ -71,6 +71,23 @@ VVector convert(const CGAL::Vector_3<R>& v)
CGAL::to_double(v.y()), CGAL::to_double(v.y()),
CGAL::to_double(v.z())); } CGAL::to_double(v.z())); }
template <typename R>
VVector normalize_and_convert(const CGAL::Vector_3<R>& v)
{
typename R::FT xa = CGAL::abs(v.x());
typename R::FT ya = CGAL::abs(v.y());
typename R::FT za = CGAL::abs(v.z());
typename R::FT m = (std::max)((std::max)(xa,ya),za);
if (m==0) {
return VVector(0,0,0);
} else {
double xd = CGAL::to_double(v.x()/m);
double yd = CGAL::to_double(v.y()/m);
double zd = CGAL::to_double(v.z()/m);
VVector u(xd,yd,zd);
return u / CGAL_NTS sqrt(u*u) ; // normalize
}
}
const double refinement_angle = 0.1; const double refinement_angle = 0.1;
const double shrink_fac = 0.995; const double shrink_fac = 0.995;
@ -80,8 +97,7 @@ class Approximator {
public: public:
static VPoint approximate(const CGAL::Sphere_point<R>& p) { static VPoint approximate(const CGAL::Sphere_point<R>& p) {
VVector v = convert(p-CGAL::ORIGIN); VVector v = normalize_and_convert(p-CGAL::ORIGIN);
v = v / CGAL_NTS sqrt(v*v) ; // normalize
return CGAL::ORIGIN+v; return CGAL::ORIGIN+v;
} }

View File

@ -350,6 +350,11 @@ public:
f->mark() == true); f->mark() == true);
} }
bool is_sphere() const
{
return is_plane();
}
void extract_complement() void extract_complement()
{ CGAL_NEF_TRACEN("extract complement"); { CGAL_NEF_TRACEN("extract complement");
if ( this->is_shared() ) clone_rep(); if ( this->is_shared() ) clone_rep();
@ -375,7 +380,7 @@ public:
SHalfedge_iterator e; SHalfedge_iterator e;
CGAL_forall_svertices(v,D) v->mark() = false; CGAL_forall_svertices(v,D) v->mark() = false;
CGAL_forall_sedges(e,D) e->mark() = false; CGAL_forall_sedges(e,D) e->mark() = false;
if ( D.has_sloop() ) D.shalfloop()->mark() = false; if ( D.has_shalfloop() ) D.shalfloop()->mark() = false;
D.simplify(); D.simplify();
} }
@ -390,7 +395,7 @@ public:
CGAL_forall_svertices(v,D) v->mark() = true; CGAL_forall_svertices(v,D) v->mark() = true;
CGAL_forall_sedges(e,D) e->mark() = true; CGAL_forall_sedges(e,D) e->mark() = true;
CGAL_forall_sfaces(f,D) f->mark() = false; CGAL_forall_sfaces(f,D) f->mark() = false;
if ( D.has_sloop() ) D.shalfloop()->mark() = D.shalfoop()->twin() = true; if ( D.has_shalfloop() ) D.shalfloop()->mark() = D.shalfoop()->twin()->mark() = true;
D.simplify(); D.simplify();
} }

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