mirror of https://github.com/CGAL/cgal
Compare commits
141 Commits
f503ce9359
...
d1d3ea5248
| Author | SHA1 | Date |
|---|---|---|
|
|
d1d3ea5248 | |
|
|
b3e2f204a4 | |
|
|
fdef97e88e | |
|
|
1f4a934d0f | |
|
|
106f9659b1 | |
|
|
72cfcc4156 | |
|
|
b2eb8d9331 | |
|
|
74cf183ba2 | |
|
|
2ae34a22ba | |
|
|
7b906084dd | |
|
|
589c5d59a5 | |
|
|
add575c358 | |
|
|
90f6b74bf4 | |
|
|
84ece78f82 | |
|
|
a827db20db | |
|
|
d8b2a56fe3 | |
|
|
81952a1c18 | |
|
|
5a77ef7ab6 | |
|
|
c87a0d8b29 | |
|
|
4ef2b0a350 | |
|
|
d5ed4e0eae | |
|
|
ab99c7de81 | |
|
|
c225dd0c34 | |
|
|
79f93a46df | |
|
|
91193bf866 | |
|
|
edd1868f50 | |
|
|
2ec7520d96 | |
|
|
d731405249 | |
|
|
fb1686fca1 | |
|
|
833d425ca3 | |
|
|
2157a3350b | |
|
|
8b7010fb33 | |
|
|
a712bd69a0 | |
|
|
510db0c4d3 | |
|
|
4b9ca293c7 | |
|
|
748fa237da | |
|
|
d0a7b6748b | |
|
|
952eb52c5f | |
|
|
d19ae8a395 | |
|
|
1b830ee23c | |
|
|
37262f5f7e | |
|
|
89c0551c82 | |
|
|
5b547309e7 | |
|
|
20d1c99950 | |
|
|
7840dc8506 | |
|
|
1d27b1ae44 | |
|
|
17586da7a4 | |
|
|
5a28105560 | |
|
|
b9c05d8e3a | |
|
|
263dc8b49b | |
|
|
13f5968eaa | |
|
|
60782f879f | |
|
|
48e2387253 | |
|
|
66de6cba3d | |
|
|
4018082784 | |
|
|
f51867ac36 | |
|
|
02883a4196 | |
|
|
dc2f51ba03 | |
|
|
8476307276 | |
|
|
3fbdc2deed | |
|
|
61baefa79a | |
|
|
289716dbab | |
|
|
06787e2246 | |
|
|
8d4877b025 | |
|
|
81e0122efa | |
|
|
afc4f72b26 | |
|
|
b54a4268d0 | |
|
|
f9bf2571dd | |
|
|
ce87535e11 | |
|
|
0cf1ff531b | |
|
|
388632e0fa | |
|
|
1d9c84f9ef | |
|
|
7977b1f22d | |
|
|
1c61ef7de9 | |
|
|
143a8e1e88 | |
|
|
6bc33ee1ac | |
|
|
076ffc109f | |
|
|
15760cfc78 | |
|
|
b38b13e2ef | |
|
|
1e991ff6ad | |
|
|
605afd3fe5 | |
|
|
c6b19ed0e3 | |
|
|
496239a0ed | |
|
|
63cc54c367 | |
|
|
68d2be2798 | |
|
|
e170d7b0de | |
|
|
f2e16bd0c9 | |
|
|
8daad7fc09 | |
|
|
5bfaaac650 | |
|
|
ff6a91eb61 | |
|
|
cb19aa7feb | |
|
|
fcf02c4ceb | |
|
|
ecd2ed13f8 | |
|
|
c165dcaa8f | |
|
|
69a00534f8 | |
|
|
b6e9acb9d3 | |
|
|
a7edfa506f | |
|
|
6acfaaedac | |
|
|
0f86fa6d23 | |
|
|
c63c2a24e2 | |
|
|
51d035d9d9 | |
|
|
6b729748e1 | |
|
|
9a134d2145 | |
|
|
338b31bf32 | |
|
|
400c1da751 | |
|
|
a2cfa40a26 | |
|
|
f75ddf8eda | |
|
|
9e588e9b1a | |
|
|
a9621595e5 | |
|
|
717f6aff44 | |
|
|
e45f8faaa7 | |
|
|
c75cc8aabd | |
|
|
3d0a5e54a2 | |
|
|
90a376de17 | |
|
|
eef2bea7b1 | |
|
|
f147e0f0cc | |
|
|
d9c4f603ee | |
|
|
9f07b04778 | |
|
|
0e61fdc8e1 | |
|
|
41ecef0fa3 | |
|
|
23526e4c3b | |
|
|
1c07d4c3b4 | |
|
|
f747db2774 | |
|
|
2d0dfd2822 | |
|
|
b9f983a515 | |
|
|
e622f3e03e | |
|
|
f21e9b18ba | |
|
|
8cacb534a5 | |
|
|
e79ee242bd | |
|
|
cc5297554c | |
|
|
95b4eba11e | |
|
|
be12df3dc1 | |
|
|
125a0d6041 | |
|
|
924bfdf2c3 | |
|
|
b54a2eab1a | |
|
|
042cb277fb | |
|
|
c40da70441 | |
|
|
24e1c96f62 | |
|
|
b80c1d8f48 | |
|
|
99613eb99c | |
|
|
8e5c5b84f3 |
|
|
@ -509,8 +509,7 @@ the requirement for traversal of all faces in a graph.
|
|||
/// I/O Functions for the \ref IOStream3MF
|
||||
/// \ingroup PkgBGLIOFct
|
||||
|
||||
/// \defgroup PkgBGLIOFctDeprecated I/O Functions (Deprecated)
|
||||
/// \ingroup PkgBGLIOFct
|
||||
|
||||
|
||||
/*!
|
||||
\addtogroup PkgBGLPropertiesDynamic
|
||||
|
|
|
|||
|
|
@ -247,36 +247,7 @@ bool read_OFF(const std::string& fname,
|
|||
|
||||
} // namespace IO
|
||||
|
||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
/*!
|
||||
\ingroup PkgBGLIOFctDeprecated
|
||||
|
||||
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_OFF()` should be used instead.
|
||||
*/
|
||||
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
CGAL_DEPRECATED bool read_off(std::istream& is, Graph& g, const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
return IO::read_OFF(is, g, np);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup PkgBGLIOFctDeprecated
|
||||
|
||||
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_OFF()` should be used instead.
|
||||
*/
|
||||
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
CGAL_DEPRECATED bool read_off(const char* fname, Graph& g, const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
return IO::read_OFF(fname, g, np);
|
||||
}
|
||||
template <typename Graph>
|
||||
CGAL_DEPRECATED bool read_off(const std::string& fname, Graph& g)
|
||||
{
|
||||
return read_off(fname.c_str(), g, parameters::default_values());
|
||||
}
|
||||
|
||||
#endif // CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
@ -453,31 +424,6 @@ bool write_OFF(const std::string& fname,
|
|||
|
||||
} // namespace IO
|
||||
|
||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
/*!
|
||||
\ingroup PkgBGLIOFctDeprecated
|
||||
|
||||
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_OFF()` should be used instead.
|
||||
*/
|
||||
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
CGAL_DEPRECATED bool write_off(std::ostream& os, const Graph& g, const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
return IO::write_OFF(os, g, np);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup PkgBGLIOFctDeprecated
|
||||
|
||||
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_OFF()` should be used instead.
|
||||
*/
|
||||
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
CGAL_DEPRECATED bool write_off(const char* fname, const Graph& g, const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
return IO::write_OFF(fname, g, np);
|
||||
}
|
||||
|
||||
#endif // CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
} // namespace CGAL
|
||||
|
||||
|
|
|
|||
|
|
@ -529,20 +529,7 @@ bool write_VTP(const std::string& fname, const Graph& g, const CGAL_NP_CLASS& np
|
|||
|
||||
} // namespace IO
|
||||
|
||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
/*!
|
||||
\ingroup PkgBGLIOFctDeprecated
|
||||
|
||||
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_VTP()` should be used instead.
|
||||
*/
|
||||
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
CGAL_DEPRECATED bool write_vtp(std::ostream& os, const Graph& g, const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
return IO::write_VTP(os, g, np);
|
||||
}
|
||||
|
||||
#endif // CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
} // namespace CGAL
|
||||
|
||||
|
|
|
|||
|
|
@ -111,20 +111,7 @@ bool write_WRL(const std::string& fname, const Graph& g, const CGAL_NP_CLASS& np
|
|||
|
||||
} // namespace IO
|
||||
|
||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
/*!
|
||||
\ingroup PkgBGLIOFctDeprecated
|
||||
|
||||
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_WRL()` should be used instead.
|
||||
*/
|
||||
template <typename Graph, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
CGAL_DEPRECATED bool write_wrl(std::ostream& os, const Graph& g, const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
return IO::write_WRL(os, g, np);
|
||||
}
|
||||
|
||||
#endif // CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
} // namespace CGAL
|
||||
|
||||
|
|
|
|||
|
|
@ -871,7 +871,54 @@ private:
|
|||
*/
|
||||
template <typename Graph>
|
||||
class Face_around_face_circulator
|
||||
{};
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
: public boost::iterator_adaptor<
|
||||
Face_around_face_circulator<Graph> // Derived
|
||||
, Halfedge_around_face_circulator<Graph> // Base
|
||||
, typename boost::graph_traits<Graph>::face_descriptor // Value
|
||||
, Bidirectional_circulator_tag // CategoryOrTraversal
|
||||
, typename boost::graph_traits<Graph>::face_descriptor // Reference
|
||||
>
|
||||
#endif
|
||||
{
|
||||
internal::Opposite_face<Graph> fct;
|
||||
typedef typename boost::graph_traits<Graph>::halfedge_descriptor halfedge_descriptor;
|
||||
|
||||
public:
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
typedef std::size_t size_type;
|
||||
#endif
|
||||
|
||||
Face_around_face_circulator()
|
||||
{}
|
||||
|
||||
Face_around_face_circulator(halfedge_descriptor h, const Graph& g)
|
||||
: Face_around_face_circulator::iterator_adaptor_(Halfedge_around_face_circulator<Graph>(h,g)), fct(g)
|
||||
{}
|
||||
|
||||
#ifndef DOXYGEN_RUNNING
|
||||
|
||||
explicit operator bool() const
|
||||
{
|
||||
return (! (this->base_reference() == nullptr));
|
||||
}
|
||||
|
||||
bool operator== (void*) const
|
||||
{
|
||||
return this->base_reference()== nullptr;
|
||||
}
|
||||
|
||||
bool operator!= (void*) const
|
||||
{
|
||||
return this->base_reference()!= nullptr;
|
||||
}
|
||||
|
||||
private:
|
||||
friend class boost::iterator_core_access;
|
||||
typename boost::graph_traits<Graph>::face_descriptor dereference() const { return fct(*this->base_reference()); }
|
||||
#endif
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* \ingroup PkgBGLIterators
|
||||
|
|
|
|||
|
|
@ -38,7 +38,6 @@ create_single_source_cgal_program("test_graph_traits.cpp")
|
|||
create_single_source_cgal_program("test_Properties.cpp")
|
||||
create_single_source_cgal_program("bench_read_from_stream_vs_add_face_and_add_faces.cpp")
|
||||
create_single_source_cgal_program("graph_traits_inheritance.cpp" )
|
||||
create_single_source_cgal_program("test_deprecated_io.cpp")
|
||||
|
||||
find_package(OpenMesh QUIET)
|
||||
if(OpenMesh_FOUND)
|
||||
|
|
@ -69,8 +68,6 @@ if (VTK_FOUND AND VTK_LIBRARIES)
|
|||
message(STATUS "VTK ${VTK_VERSION} found ${VTK_LIBRARIES}")
|
||||
target_link_libraries(test_bgl_read_write PRIVATE ${VTK_LIBRARIES})
|
||||
target_compile_definitions(test_bgl_read_write PRIVATE -DCGAL_USE_VTK -DNOMINMAX)
|
||||
target_link_libraries(test_deprecated_io PRIVATE ${VTK_LIBRARIES})
|
||||
target_compile_definitions(test_deprecated_io PRIVATE -DCGAL_USE_VTK -DNOMINMAX)
|
||||
else()
|
||||
message(STATUS "Tests that use VTK will not be compiled.")
|
||||
endif() #VTK_FOUND
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ typedef GraphTraits::edge_descriptor edge_descriptor;
|
|||
typedef GraphTraits::out_edge_iterator out_edge_iterator;
|
||||
typedef GraphTraits::in_edge_iterator in_edge_iterator;
|
||||
|
||||
typedef CGAL::Face_around_face_circulator<Polyhedron> face_around_face_circulator;
|
||||
typedef CGAL::Halfedge_around_face_circulator<Polyhedron> halfedge_around_face_circulator;
|
||||
typedef CGAL::Halfedge_around_target_circulator<Polyhedron> halfedge_around_target_circulator;
|
||||
typedef CGAL::Vertex_around_target_circulator<Polyhedron> vertex_around_target_circulator;
|
||||
|
|
@ -32,6 +33,7 @@ typedef CGAL::Vertex_around_target_iterator<Polyhedron> vertex_around_target_ite
|
|||
int main(int argc, char* argv[])
|
||||
{
|
||||
|
||||
BOOST_CONCEPT_ASSERT((CGAL::Concepts::BidirectionalCirculator<face_around_face_circulator>));
|
||||
BOOST_CONCEPT_ASSERT((CGAL::Concepts::BidirectionalCirculator<halfedge_around_face_circulator>));
|
||||
BOOST_CONCEPT_ASSERT((CGAL::Concepts::BidirectionalCirculator<halfedge_around_target_circulator>));
|
||||
BOOST_CONCEPT_ASSERT((CGAL::Concepts::BidirectionalCirculator<vertex_around_target_circulator>));
|
||||
|
|
@ -62,6 +64,14 @@ int main(int argc, char* argv[])
|
|||
}while(hafc != done);
|
||||
}
|
||||
|
||||
{
|
||||
face_around_face_circulator fafc(hd,P), done(fafc);
|
||||
|
||||
do {
|
||||
++fafc;
|
||||
}while(fafc != done);
|
||||
}
|
||||
|
||||
{
|
||||
halfedge_around_target_circulator havc(hd,P), done(havc);
|
||||
vertex_descriptor vd = target(hd,P);
|
||||
|
|
|
|||
|
|
@ -1,59 +0,0 @@
|
|||
#include <CGAL/Installation/internal/disable_deprecation_warnings_and_errors.h>
|
||||
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <CGAL/Surface_mesh.h>
|
||||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/boost/graph/generators.h>
|
||||
|
||||
#include <CGAL/boost/graph/IO/OFF.h>
|
||||
#include <CGAL/boost/graph/IO/VTK.h>
|
||||
#include <CGAL/boost/graph/IO/WRL.h>
|
||||
|
||||
|
||||
typedef CGAL::Simple_cartesian<double> Kernel;
|
||||
typedef Kernel::Point_3 Point_3;
|
||||
typedef CGAL::Surface_mesh<Point_3> SM;
|
||||
|
||||
int main()
|
||||
{
|
||||
// OFF
|
||||
SM sm_in, sm_out;
|
||||
Point_3 p0(0,0,0), p1(1,0,0), p2(0,1,0);
|
||||
CGAL::make_triangle(p0, p1, p2, sm_out);
|
||||
bool ok = CGAL::write_off("tmp_deprecated.off", sm_out);
|
||||
assert(ok);
|
||||
ok = CGAL::read_off("tmp_deprecated.off", sm_in);
|
||||
assert(ok);
|
||||
assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1);
|
||||
sm_in.clear();
|
||||
|
||||
std::ofstream os("tmp_deprecated.off");
|
||||
ok = CGAL::write_off(os, sm_out);
|
||||
assert(ok);
|
||||
os.close();
|
||||
std::ifstream is("tmp_deprecated.off");
|
||||
ok = CGAL::read_off(is, sm_in);
|
||||
assert(ok);
|
||||
assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1);
|
||||
is.close();
|
||||
sm_in.clear();
|
||||
#ifdef CGAL_USE_VTK
|
||||
//vtk
|
||||
os.open("tmp_deprecated.vtp");
|
||||
ok = CGAL::write_vtp(os, sm_out);
|
||||
assert(ok);
|
||||
os.close();
|
||||
|
||||
ok = CGAL::IO::read_VTP("tmp_deprecated.vtp", sm_in);
|
||||
assert(ok);
|
||||
assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1);
|
||||
sm_in.clear();
|
||||
#endif
|
||||
//wrl
|
||||
os.open("tmp_deprecated.wrl");
|
||||
ok = CGAL::write_wrl(os, sm_out);
|
||||
assert(ok);
|
||||
os.close();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
@ -0,0 +1,221 @@
|
|||
// Copyright (c) 2025 GeometryFactory (France).
|
||||
// All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org)
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
|
||||
//
|
||||
//
|
||||
// Author(s) : Andreas Fabri
|
||||
|
||||
#ifndef CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_4_H
|
||||
#define CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_4_H
|
||||
|
||||
#include <CGAL/Profile_counter.h>
|
||||
#include <CGAL/Filtered_kernel/internal/Static_filters/Static_filter_error.h>
|
||||
#include <CGAL/determinant.h>
|
||||
#include <cmath>
|
||||
|
||||
namespace CGAL { namespace internal { namespace Static_filters_predicates {
|
||||
|
||||
|
||||
|
||||
template < typename K_base >
|
||||
class Orientation_4
|
||||
: public K_base::Orientation_4
|
||||
{
|
||||
typedef typename K_base::Orientation Orientation;
|
||||
typedef typename K_base::Point_4 Point_4;
|
||||
typedef typename K_base::Orientation_4 Base;
|
||||
|
||||
public:
|
||||
using Base::operator();
|
||||
|
||||
Orientation
|
||||
operator()(const Point_4 &p, const Point_4 &q,
|
||||
const Point_4 &r, const Point_4 &s,
|
||||
const Point_4 &t) const
|
||||
{
|
||||
CGAL_BRANCH_PROFILER_3("semi-static failures/attempts/calls to : Orientation_4", tmp);
|
||||
|
||||
double p0, p1, p2, p3, q0, q1, q2, q3, r0, r1, r2, r3, s0, s1, s2, s3, t0, t1, t2, t3;
|
||||
|
||||
if (fit_in_double(p.c0(), p0) && fit_in_double(p.c1(), p1) &&
|
||||
fit_in_double(p.c2(), p2) && fit_in_double(p.c3(), p3) &&
|
||||
fit_in_double(q.c0(), q0) && fit_in_double(q.c1(), q1) &&
|
||||
fit_in_double(q.c2(), q2) && fit_in_double(q.c3(), q3) &&
|
||||
fit_in_double(r.c0(), r0) && fit_in_double(r.c1(), r1) &&
|
||||
fit_in_double(r.c2(), r2) && fit_in_double(r.c3(), r3) &&
|
||||
fit_in_double(s.c0(), s0) && fit_in_double(s.c1(), s1) &&
|
||||
fit_in_double(s.c2(), s2) && fit_in_double(s.c3(), s3) &&
|
||||
fit_in_double(t.c0(), t0) && fit_in_double(t.c1(), t1) &&
|
||||
fit_in_double(t.c2(), t2) && fit_in_double(t.c3(), t3) )
|
||||
{
|
||||
CGAL_assertion_code(Orientation should_be = Base::operator()(p, q, r, s, t));
|
||||
double m01;
|
||||
m01 = (q0 - p0);
|
||||
double m02;
|
||||
m02 = (r0 - p0);
|
||||
double m03;
|
||||
m03 = (s0 - p0);
|
||||
double m04;
|
||||
m04 = (t0 - p0);
|
||||
double m11;
|
||||
m11 = (q1 - p1);
|
||||
double m12;
|
||||
m12 = (r1 - p1);
|
||||
double m13;
|
||||
m13 = (s1 - p1);
|
||||
double m14;
|
||||
m14 = (t1 - p1);
|
||||
double m21;
|
||||
m21 = (q2 - p2);
|
||||
double m22;
|
||||
m22 = (r2 - p2);
|
||||
double m23;
|
||||
m23 = (s2 - p2);
|
||||
double m24;
|
||||
m24 = (t2 - p2);
|
||||
double m31;
|
||||
m31 = (q3 - p3);
|
||||
double m32;
|
||||
m32 = (r3 - p3);
|
||||
double m33;
|
||||
m33 = (s3 - p3);
|
||||
double m34;
|
||||
m34 = (t3 - p3);
|
||||
double det;
|
||||
det = ::CGAL::determinant( m01, m02, m03, m04, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34 );
|
||||
double eps;
|
||||
double max1 = CGAL::abs(m01);
|
||||
double am = CGAL::abs(m02);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m03);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m11);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m12);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m13);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m23);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
|
||||
|
||||
double max2 = CGAL::abs(m01);
|
||||
am = CGAL::abs(m02);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m11);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m12);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m21);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m22);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m23);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m33);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
|
||||
|
||||
double max3 = CGAL::abs(m04);
|
||||
am = CGAL::abs(m14);
|
||||
if( (max3 < am) ) { max3 = am; }
|
||||
am = CGAL::abs(m24);
|
||||
if( (max3 < am) ) { max3 = am; }
|
||||
am = CGAL::abs(m34);
|
||||
if( (max3 < am) ) { max3 = am; }
|
||||
|
||||
|
||||
double max4 = CGAL::abs(m11);
|
||||
am = CGAL::abs(m12);
|
||||
if( (max4 < am) ) { max4 = am; }
|
||||
am = CGAL::abs(m21);
|
||||
if( (max4 < am) ) { max4 = am; }
|
||||
am = CGAL::abs(m22);
|
||||
if( (max4 < am) ) { max4 = am; }
|
||||
am = CGAL::abs(m31);
|
||||
if( (max4 < am) ) { max4 = am; }
|
||||
am = CGAL::abs(m32);
|
||||
if( (max4 < am) ) { max4 = am; }
|
||||
|
||||
|
||||
double lower_bound_1;
|
||||
double upper_bound_1;
|
||||
lower_bound_1 = max1;
|
||||
upper_bound_1 = max1;
|
||||
if( (max2 < lower_bound_1) )
|
||||
{
|
||||
lower_bound_1 = max2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (max2 > upper_bound_1) )
|
||||
{
|
||||
upper_bound_1 = max2;
|
||||
}
|
||||
}
|
||||
if( (max3 < lower_bound_1) )
|
||||
{
|
||||
lower_bound_1 = max3;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (max3 > upper_bound_1) )
|
||||
{
|
||||
upper_bound_1 = max3;
|
||||
}
|
||||
}
|
||||
if( (max4 < lower_bound_1) )
|
||||
{
|
||||
lower_bound_1 = max4;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (max4 > upper_bound_1) )
|
||||
{
|
||||
upper_bound_1 = max4;
|
||||
}
|
||||
}
|
||||
if( (lower_bound_1 < 2.89273249588395272840e-74) )
|
||||
{
|
||||
return Base::operator()(p, q, r, s, t);
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (upper_bound_1 > 7.23700557733225900010e+75) )
|
||||
{
|
||||
return Base::operator()(p, q, r, s, t);
|
||||
}
|
||||
eps = (3.17768858673611327578e-14 * (((max4 * max2) * max1) * max3));
|
||||
if( (det > eps) )
|
||||
{
|
||||
CGAL_assertion(should_be == POSITIVE);
|
||||
return POSITIVE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (det < -eps) )
|
||||
{
|
||||
CGAL_assertion(should_be == NEGATIVE);
|
||||
return NEGATIVE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Base::operator()(p, q, r, s, t);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return Base::operator()(p, q, r, s, t);
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
} } } // namespace CGAL::internal::Static_filters_predicates
|
||||
|
||||
#endif // CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_4_H
|
||||
|
|
@ -0,0 +1,289 @@
|
|||
// Copyright (c) 2025 GeometryFactory (France).
|
||||
// All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org)
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
|
||||
//
|
||||
//
|
||||
// Author(s) : Andreas Fabri
|
||||
|
||||
#ifndef CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_5_H
|
||||
#define CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_5_H
|
||||
|
||||
#include <CGAL/Profile_counter.h>
|
||||
#include <CGAL/Filtered_kernel/internal/Static_filters/Static_filter_error.h>
|
||||
#include <CGAL/determinant.h>
|
||||
#include <cmath>
|
||||
|
||||
namespace CGAL { namespace internal { namespace Static_filters_predicates {
|
||||
|
||||
|
||||
|
||||
template < typename K_base >
|
||||
class Orientation_5
|
||||
: public K_base::Orientation_5
|
||||
{
|
||||
typedef typename K_base::Orientation Orientation;
|
||||
typedef typename K_base::Point_5 Point_5;
|
||||
typedef typename K_base::Orientation_5 Base;
|
||||
|
||||
public:
|
||||
using Base::operator();
|
||||
|
||||
Orientation
|
||||
operator()(const Point_5 &p, const Point_5 &q,
|
||||
const Point_5 &r, const Point_5 &s,
|
||||
const Point_5 &t, const Point_5 &u) const
|
||||
{
|
||||
CGAL_BRANCH_PROFILER_3("semi-static failures/attempts/calls to : Orientation_5", tmp);
|
||||
|
||||
double p0, p1, p2, p3, p4, q0, q1, q2, q3, q4, r0, r1, r2, r3, r4, s0, s1, s2, s3, s4, t0, t1, t2, t3, t4, u0, u1, u2, u3, u4;
|
||||
|
||||
if (fit_in_double(p.c0(), p0) && fit_in_double(p.c1(), p1) &&
|
||||
fit_in_double(p.c2(), p2) && fit_in_double(p.c3(), p3) &&
|
||||
fit_in_double(p.c4(), p4) &&
|
||||
fit_in_double(q.c0(), q0) && fit_in_double(q.c1(), q1) &&
|
||||
fit_in_double(q.c2(), q2) && fit_in_double(q.c3(), q3) &&
|
||||
fit_in_double(q.c4(), q4) &&
|
||||
fit_in_double(r.c0(), r0) && fit_in_double(r.c1(), r1) &&
|
||||
fit_in_double(r.c2(), r2) && fit_in_double(r.c3(), r3) &&
|
||||
fit_in_double(r.c4(), r4) &&
|
||||
fit_in_double(s.c0(), s0) && fit_in_double(s.c1(), s1) &&
|
||||
fit_in_double(s.c2(), s2) && fit_in_double(s.c3(), s3) &&
|
||||
fit_in_double(s.c4(), s4) &&
|
||||
fit_in_double(t.c0(), t0) && fit_in_double(t.c1(), t1) &&
|
||||
fit_in_double(t.c2(), t2) && fit_in_double(t.c3(), t3) &&
|
||||
fit_in_double(t.c4(), t4) &&
|
||||
fit_in_double(u.c0(), u0) && fit_in_double(u.c1(), u1) &&
|
||||
fit_in_double(u.c2(), u2) && fit_in_double(u.c3(), u3) &&
|
||||
fit_in_double(u.c4(), u4))
|
||||
|
||||
{
|
||||
CGAL_assertion_code(Orientation should_be = Base::operator()(p, q, r, s, t, u));
|
||||
double m01;
|
||||
m01 = (q0 - p0);
|
||||
double m02;
|
||||
m02 = (r0 - p0);
|
||||
double m03;
|
||||
m03 = (s0 - p0);
|
||||
double m04;
|
||||
m04 = (t0 - p0);
|
||||
double m05;
|
||||
m05 = (u0 - p0);
|
||||
double m11;
|
||||
m11 = (q1 - p1);
|
||||
double m12;
|
||||
m12 = (r1 - p1);
|
||||
double m13;
|
||||
m13 = (s1 - p1);
|
||||
double m14;
|
||||
m14 = (t1 - p1);
|
||||
double m15;
|
||||
m15 = (u1 - p1);
|
||||
double m21;
|
||||
m21 = (q2 - p2);
|
||||
double m22;
|
||||
m22 = (r2 - p2);
|
||||
double m23;
|
||||
m23 = (s2 - p2);
|
||||
double m24;
|
||||
m24 = (t2 - p2);
|
||||
double m25;
|
||||
m25 = (u2 - p2);
|
||||
double m31;
|
||||
m31 = (q3 - p3);
|
||||
double m32;
|
||||
m32 = (r3 - p3);
|
||||
double m33;
|
||||
m33 = (s3 - p3);
|
||||
double m34;
|
||||
m34 = (t3 - p3);
|
||||
double m35;
|
||||
m35 = (u3 - p3);
|
||||
double m41;
|
||||
m41 = (q4 - p4);
|
||||
double m42;
|
||||
m42 = (r4 - p4);
|
||||
double m43;
|
||||
m43 = (s4 - p4);
|
||||
double m44;
|
||||
m44 = (t4 - p4);
|
||||
double m45;
|
||||
m45 = (u4 - p4);
|
||||
double det;
|
||||
det = ::CGAL::determinant( m01, m02, m03, m04, m05, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25, m31, m32, m33, m34, m35, m41, m42, m43, m44, m45 );
|
||||
double eps;
|
||||
double max1 = CGAL::abs(m01);
|
||||
double am = CGAL::abs(m02);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m03);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m11);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m12);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m13);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m21);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m22);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m23);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m33);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
|
||||
|
||||
double max2 = CGAL::abs(m01);
|
||||
am = CGAL::abs(m02);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m11);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m12);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m21);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m22);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m23);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m31);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m32);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m33);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m43);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
|
||||
|
||||
double max3 = CGAL::abs(m04);
|
||||
am = CGAL::abs(m14);
|
||||
if( (max3 < am) ) { max3 = am; }
|
||||
am = CGAL::abs(m24);
|
||||
if( (max3 < am) ) { max3 = am; }
|
||||
am = CGAL::abs(m34);
|
||||
if( (max3 < am) ) { max3 = am; }
|
||||
am = CGAL::abs(m44);
|
||||
if( (max3 < am) ) { max3 = am; }
|
||||
|
||||
|
||||
double max4 = CGAL::abs(m05);
|
||||
am = CGAL::abs(m15);
|
||||
if( (max4 < am) ) { max4 = am; }
|
||||
am = CGAL::abs(m25);
|
||||
if( (max4 < am) ) { max4 = am; }
|
||||
am = CGAL::abs(m35);
|
||||
if( (max4 < am) ) { max4 = am; }
|
||||
am = CGAL::abs(m45);
|
||||
if( (max4 < am) ) { max4 = am; }
|
||||
|
||||
|
||||
double max5 = CGAL::abs(m11);
|
||||
am = CGAL::abs(m12);
|
||||
if( (max5 < am) ) { max5 = am; }
|
||||
am = CGAL::abs(m21);
|
||||
if( (max5 < am) ) { max5 = am; }
|
||||
am = CGAL::abs(m22);
|
||||
if( (max5 < am) ) { max5 = am; }
|
||||
am = CGAL::abs(m31);
|
||||
if( (max5 < am) ) { max5 = am; }
|
||||
am = CGAL::abs(m32);
|
||||
if( (max5 < am) ) { max5 = am; }
|
||||
am = CGAL::abs(m41);
|
||||
if( (max5 < am) ) { max5 = am; }
|
||||
am = CGAL::abs(m42);
|
||||
if( (max5 < am) ) { max5 = am; }
|
||||
|
||||
double lower_bound_1;
|
||||
double upper_bound_1;
|
||||
lower_bound_1 = max5;
|
||||
upper_bound_1 = max5;
|
||||
if( (max1 < lower_bound_1) )
|
||||
{
|
||||
lower_bound_1 = max1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (max1 > upper_bound_1) )
|
||||
{
|
||||
upper_bound_1 = max1;
|
||||
}
|
||||
}
|
||||
if( (max2 < lower_bound_1) )
|
||||
{
|
||||
lower_bound_1 = max2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (max2 > upper_bound_1) )
|
||||
{
|
||||
upper_bound_1 = max2;
|
||||
}
|
||||
}
|
||||
if( (max3 < lower_bound_1) )
|
||||
{
|
||||
lower_bound_1 = max3;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (max3 > upper_bound_1) )
|
||||
{
|
||||
upper_bound_1 = max3;
|
||||
}
|
||||
}
|
||||
if( (max4 < lower_bound_1) )
|
||||
{
|
||||
lower_bound_1 = max4;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (max4 > upper_bound_1) )
|
||||
{
|
||||
upper_bound_1 = max4;
|
||||
}
|
||||
}
|
||||
if( (lower_bound_1 < 9.99657131447050328602e-60) )
|
||||
{
|
||||
return Base::operator()(p, q, r, s, t, u);
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (upper_bound_1 > 3.21387608851797912384e+60) )
|
||||
{
|
||||
return Base::operator()(p, q, r, s, t, u);
|
||||
}
|
||||
eps = (2.22889232457534740153e-13 * ((((max5 * max2) * max1) * max3) * max4));
|
||||
if( (det > eps) )
|
||||
{
|
||||
CGAL_assertion(should_be == POSITIVE);
|
||||
return POSITIVE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (det < -eps) )
|
||||
{
|
||||
CGAL_assertion(should_be == NEGATIVE);
|
||||
return NEGATIVE;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Base::operator()(p, q, r, s, t, u);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return Base::operator()(p, q, r, s, t, u);
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
} } } // namespace CGAL::internal::Static_filters_predicates
|
||||
|
||||
#endif // CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_5_H
|
||||
|
|
@ -0,0 +1,358 @@
|
|||
// Copyright (c) 2025 GeometryFactory (France).
|
||||
// All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org)
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
|
||||
//
|
||||
//
|
||||
// Author(s) : Andreas Fabri
|
||||
|
||||
#ifndef CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_6_H
|
||||
#define CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_6_H
|
||||
|
||||
#include <CGAL/Profile_counter.h>
|
||||
#include <CGAL/Filtered_kernel/internal/Static_filters/Static_filter_error.h>
|
||||
#include <CGAL/determinant.h>
|
||||
#include <cmath>
|
||||
|
||||
namespace CGAL { namespace internal { namespace Static_filters_predicates {
|
||||
|
||||
|
||||
|
||||
template < typename K_base >
|
||||
class Orientation_6
|
||||
: public K_base::Orientation_6
|
||||
{
|
||||
typedef typename K_base::Orientation Orientation;
|
||||
typedef typename K_base::Point_6 Point_6;
|
||||
typedef typename K_base::Orientation_6 Base;
|
||||
|
||||
public:
|
||||
using Base::operator();
|
||||
|
||||
Orientation
|
||||
operator()(const Point_6 &p, const Point_6 &q,
|
||||
const Point_6 &r, const Point_6 &s,
|
||||
const Point_6 &t, const Point_6 &u, const Point_6 &v) const
|
||||
{
|
||||
CGAL_BRANCH_PROFILER_3("semi-static failures/attempts/calls to : Orientation_6", tmp);
|
||||
|
||||
double p0, p1, p2, p3, p4, p5, q0, q1, q2, q3, q4, q5, r0, r1, r2, r3, r4, r5, s0, s1, s2, s3, s4, s5, t0, t1, t2, t3, t4, t5, u0, u1, u2, u3, u4, u5, v0, v1, v2, v3, v4, v5;
|
||||
if (fit_in_double(p.c0(), p0) && fit_in_double(p.c1(), p1) &&
|
||||
fit_in_double(p.c2(), p2) && fit_in_double(p.c3(), p3) &&
|
||||
fit_in_double(p.c4(), p4) && fit_in_double(p.c5(), p5) &&
|
||||
|
||||
fit_in_double(q.c0(), q0) && fit_in_double(q.c1(), q1) &&
|
||||
fit_in_double(q.c2(), q2) && fit_in_double(q.c3(), q3) &&
|
||||
fit_in_double(q.c4(), q4) && fit_in_double(q.c5(), q5) &&
|
||||
|
||||
fit_in_double(r.c0(), r0) && fit_in_double(r.c1(), r1) &&
|
||||
fit_in_double(r.c2(), r2) && fit_in_double(r.c3(), r3) &&
|
||||
fit_in_double(r.c4(), r4) && fit_in_double(r.c5(), r5) &&
|
||||
|
||||
fit_in_double(s.c0(), s0) && fit_in_double(s.c1(), s1) &&
|
||||
fit_in_double(s.c2(), s2) && fit_in_double(s.c3(), s3) &&
|
||||
fit_in_double(s.c4(), s4) && fit_in_double(s.c5(), s5) &&
|
||||
|
||||
fit_in_double(t.c0(), t0) && fit_in_double(t.c1(), t1) &&
|
||||
fit_in_double(t.c2(), t2) && fit_in_double(t.c3(), t3) &&
|
||||
fit_in_double(t.c4(), t4) && fit_in_double(t.c5(), t5) &&
|
||||
|
||||
fit_in_double(u.c0(), u0) && fit_in_double(u.c1(), u1) &&
|
||||
fit_in_double(u.c2(), u2) && fit_in_double(u.c3(), u3) &&
|
||||
fit_in_double(u.c4(), u4) && fit_in_double(u.c5(), u5) &&
|
||||
|
||||
fit_in_double(v.c0(), v0) && fit_in_double(v.c1(), v1) &&
|
||||
fit_in_double(v.c2(), v2) && fit_in_double(v.c3(), v3) &&
|
||||
fit_in_double(v.c4(), v4) && fit_in_double(v.c5(), v5))
|
||||
{
|
||||
CGAL_assertion_code(Orientation should_be = Base::operator()(p, q, r, s, t, u, v));
|
||||
double m01;
|
||||
m01 = (q0 - p0);
|
||||
double m02;
|
||||
m02 = (r0 - p0);
|
||||
double m03;
|
||||
m03 = (s0 - p0);
|
||||
double m04;
|
||||
m04 = (t0 - p0);
|
||||
double m05;
|
||||
m05 = (u0 - p0);
|
||||
double m06;
|
||||
m06 = (v0 - p0);
|
||||
double m11;
|
||||
m11 = (q1 - p1);
|
||||
double m12;
|
||||
m12 = (r1 - p1);
|
||||
double m13;
|
||||
m13 = (s1 - p1);
|
||||
double m14;
|
||||
m14 = (t1 - p1);
|
||||
double m15;
|
||||
m15 = (u1 - p1);
|
||||
double m16;
|
||||
m16 = (v1 - p1);
|
||||
double m21;
|
||||
m21 = (q2 - p2);
|
||||
double m22;
|
||||
m22 = (r2 - p2);
|
||||
double m23;
|
||||
m23 = (s2 - p2);
|
||||
double m24;
|
||||
m24 = (t2 - p2);
|
||||
double m25;
|
||||
m25 = (u2 - p2);
|
||||
double m26;
|
||||
m26 = (v2 - p2);
|
||||
double m31;
|
||||
m31 = (q3 - p3);
|
||||
double m32;
|
||||
m32 = (r3 - p3);
|
||||
double m33;
|
||||
m33 = (s3 - p3);
|
||||
double m34;
|
||||
m34 = (t3 - p3);
|
||||
double m35;
|
||||
m35 = (u3 - p3);
|
||||
double m36;
|
||||
m36 = (v3 - p3);
|
||||
double m41;
|
||||
m41 = (q4 - p4);
|
||||
double m42;
|
||||
m42 = (r4 - p4);
|
||||
double m43;
|
||||
m43 = (s4 - p4);
|
||||
double m44;
|
||||
m44 = (t4 - p4);
|
||||
double m45;
|
||||
m45 = (u4 - p4);
|
||||
double m46;
|
||||
m46 = (v4 - p4);
|
||||
double m51;
|
||||
m51 = (q5 - p5);
|
||||
double m52;
|
||||
m52 = (r5 - p5);
|
||||
double m53;
|
||||
m53 = (s5 - p5);
|
||||
double m54;
|
||||
m54 = (t5 - p5);
|
||||
double m55;
|
||||
m55 = (u5 - p5);
|
||||
double m56;
|
||||
m56 = (v5 - p5);
|
||||
double det;
|
||||
det = ::CGAL::determinant( m01, m02, m03, m04, m05, m06, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26, m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56 );
|
||||
double eps;
|
||||
double max1 = CGAL::abs(m01);
|
||||
double am = CGAL::abs(m02);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m11);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m12);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m21);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m22);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m31);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m32);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m41);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m42);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
|
||||
|
||||
double max2 = CGAL::abs(m03);
|
||||
am = CGAL::abs(m11);
|
||||
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m12);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m13);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m21);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m22);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m23);
|
||||
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m31);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m32);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m33);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m41);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m42);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m43);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m51);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m52);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
|
||||
|
||||
double max3 = CGAL::abs(m04);
|
||||
am = CGAL::abs(m14);
|
||||
if( (max3 < am) ) { max3 = am; }
|
||||
am = CGAL::abs(m24);
|
||||
if( (max3 < am) ) { max3 = am; }
|
||||
am = CGAL::abs(m34);
|
||||
if( (max3 < am) ) { max3 = am; }
|
||||
am = CGAL::abs(m44);
|
||||
if( (max3 < am) ) { max3 = am; }
|
||||
am = CGAL::abs(m54);
|
||||
if( (max3 < am) ) { max3 = am; }
|
||||
|
||||
double max4 = CGAL::abs(m05);
|
||||
am = CGAL::abs(m15);
|
||||
if( (max4 < am) ) { max4 = am; }
|
||||
am = CGAL::abs(m25);
|
||||
if( (max4 < am) ) { max3 = am; }
|
||||
am = CGAL::abs(m35);
|
||||
if( (max4 < am) ) { max4= am; }
|
||||
am = CGAL::abs(m45);
|
||||
if( (max4 < am) ) { max4 = am; }
|
||||
am = CGAL::abs(m55);
|
||||
if( (max4 < am) ) { max4 = am; }
|
||||
|
||||
double max5 = CGAL::abs(m06);
|
||||
am = CGAL::abs(m16);
|
||||
if( (max5 < am) ) { max5 = am; }
|
||||
am = CGAL::abs(m26);
|
||||
if( (max5 < am) ) { max5 = am; }
|
||||
am = CGAL::abs(m36);
|
||||
if( (max5 < am) ) { max5 = am; }
|
||||
am = CGAL::abs(m46);
|
||||
if( (max5 < am) ) { max5 = am; }
|
||||
am = CGAL::abs(m56);
|
||||
if( (max5 < am) ) { max5 = am; }
|
||||
|
||||
|
||||
double max6 = CGAL::abs(m13);
|
||||
am = CGAL::abs(m21);
|
||||
if( (max6 < am) ) { max6 = am; }
|
||||
am = CGAL::abs(m22);
|
||||
if( (max6 < am) ) { max6 = am; }
|
||||
am = CGAL::abs(m23);
|
||||
if( (max6 < am) ) { max6 = am; }
|
||||
am = CGAL::abs(m31);
|
||||
if( (max6 < am) ) { max6 = am; }
|
||||
am = CGAL::abs(m32);
|
||||
if( (max6 < am) ) { max6 = am; }
|
||||
am = CGAL::abs(m33);
|
||||
if( (max6 < am) ) { max6 = am; }
|
||||
am = CGAL::abs(m41);
|
||||
if( (max6 < am) ) { max6 = am; }
|
||||
am = CGAL::abs(m42);
|
||||
if( (max6 < am) ) { max6 = am; }
|
||||
am = CGAL::abs(m43);
|
||||
if( (max6 < am) ) { max6 = am; }
|
||||
am = CGAL::abs(m51);
|
||||
if( (max6 < am) ) { max6 = am; }
|
||||
am = CGAL::abs(m52);
|
||||
if( (max6 < am) ) { max6 = am; }
|
||||
am = CGAL::abs(m53);
|
||||
am = CGAL::abs(m53);
|
||||
if( (max6 < am) ) { max6 = am; }
|
||||
|
||||
|
||||
double lower_bound_1;
|
||||
double upper_bound_1;
|
||||
lower_bound_1 = max6;
|
||||
upper_bound_1 = max6;
|
||||
if( (max5 < lower_bound_1) )
|
||||
{
|
||||
lower_bound_1 = max5;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (max5 > upper_bound_1) )
|
||||
{
|
||||
upper_bound_1 = max5;
|
||||
}
|
||||
}
|
||||
if( (max1 < lower_bound_1) )
|
||||
{
|
||||
lower_bound_1 = max1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (max1 > upper_bound_1) )
|
||||
{
|
||||
upper_bound_1 = max1;
|
||||
}
|
||||
}
|
||||
if( (max2 < lower_bound_1) )
|
||||
{
|
||||
lower_bound_1 = max2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (max2 > upper_bound_1) )
|
||||
{
|
||||
upper_bound_1 = max2;
|
||||
}
|
||||
}
|
||||
if( (max3 < lower_bound_1) )
|
||||
{
|
||||
lower_bound_1 = max3;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (max3 > upper_bound_1) )
|
||||
{
|
||||
upper_bound_1 = max3;
|
||||
}
|
||||
}
|
||||
if( (max4 < lower_bound_1) )
|
||||
{
|
||||
lower_bound_1 = max4;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (max4 > upper_bound_1) )
|
||||
{
|
||||
upper_bound_1 = max4;
|
||||
}
|
||||
}
|
||||
if( (lower_bound_1 < 4.82472686053427214432e-50) )
|
||||
{
|
||||
return Base::operator()(p, q, r, s, t, u, v);
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (upper_bound_1 > 1.87072209578355511223e+50) )
|
||||
{
|
||||
return Base::operator()(p, q, r, s, t, u, v);
|
||||
}
|
||||
eps = (1.76403842114300859158e-12 * (((((max1 * max2) * max6) * max3) * max4) * max5));
|
||||
if( (det > eps) )
|
||||
{
|
||||
CGAL_assertion(should_be == POSITIVE);
|
||||
return POSITIVE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (det < -eps) )
|
||||
{
|
||||
CGAL_assertion(should_be == NEGATIVE);
|
||||
return NEGATIVE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return Base::operator()(p, q, r, s, t, u, v);
|
||||
}
|
||||
};
|
||||
|
||||
} } } // namespace CGAL::internal::Static_filters_predicates
|
||||
|
||||
#endif // CGAL_INTERNAL_STATIC_FILTERS_ORIENTATION_6_H
|
||||
|
|
@ -229,14 +229,14 @@ print_dag(const Return_base_tag&, std::ostream& os, int level)
|
|||
|
||||
struct Depth_base {
|
||||
#ifdef CGAL_PROFILE
|
||||
int depth_;
|
||||
mutable int depth_;
|
||||
|
||||
Depth_base()
|
||||
: depth_(0)
|
||||
{}
|
||||
|
||||
int depth() const { return depth_; }
|
||||
void set_depth(int i)
|
||||
void set_depth(int i) const
|
||||
{
|
||||
depth_ = i;
|
||||
CGAL_HISTOGRAM_PROFILER(std::string("[Lazy_kernel DAG depths]"), i);
|
||||
|
|
@ -244,7 +244,7 @@ struct Depth_base {
|
|||
}
|
||||
#else
|
||||
int depth() const { return 0; }
|
||||
void set_depth(int) {}
|
||||
void set_depth(int) const {}
|
||||
#endif
|
||||
};
|
||||
|
||||
|
|
@ -656,6 +656,7 @@ class Lazy_rep_n final :
|
|||
auto* p = new typename Base::Indirect(ec()( CGAL::exact( std::get<I>(l) ) ... ) );
|
||||
this->set_at(p);
|
||||
this->set_ptr(p);
|
||||
this->set_depth(0);
|
||||
if(!noprune || is_currently_single_threaded())
|
||||
lazy_reset_member(l);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,17 @@
|
|||
# Release History
|
||||
|
||||
## [Release 6.2](https://github.com/CGAL/cgal/releases/tag/v6.2)
|
||||
|
||||
Release date: July 2026
|
||||
|
||||
### [Linear Cell Complex](https://doc.cgal.org/6.2/Manual/packages.html#PkgLinearCellComplex)
|
||||
|
||||
- **API Changes**: The following import functions have been deprecated and renamed for better naming clarity and consistency:
|
||||
- `import_from_plane_graph()` → `read_plane_graph_in_lcc()`
|
||||
- `import_from_polyhedron_3()` → `polyhedron_3_to_lcc()`
|
||||
- `import_from_triangulation_3()` → `triangulation_3_to_lcc()`
|
||||
- The old function names are still available but marked as deprecated for backward compatibility.
|
||||
|
||||
## [Release 6.1](https://github.com/CGAL/cgal/releases/tag/v6.1)
|
||||
|
||||
Release date: Sept 2025
|
||||
|
|
|
|||
|
|
@ -17,12 +17,12 @@
|
|||
#define CGAL_VERSION_H
|
||||
|
||||
#ifndef SWIG
|
||||
#define CGAL_VERSION 6.1
|
||||
#define CGAL_VERSION 6.2-dev
|
||||
#define CGAL_GIT_HASH abcdef
|
||||
#endif
|
||||
#define CGAL_VERSION_NR 1060100930
|
||||
#define CGAL_VERSION_NR 1060200900
|
||||
#define CGAL_SVN_REVISION 99999
|
||||
#define CGAL_RELEASE_DATE 20250901
|
||||
#define CGAL_RELEASE_DATE 20260401
|
||||
|
||||
#include <CGAL/version_macros.h>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
set(CGAL_MAJOR_VERSION 6)
|
||||
set(CGAL_MINOR_VERSION 1)
|
||||
set(CGAL_MINOR_VERSION 2)
|
||||
set(CGAL_BUGFIX_VERSION 0)
|
||||
include(${CMAKE_CURRENT_LIST_DIR}/CGALConfigBuildVersion.cmake)
|
||||
set(CGAL_VERSION_PUBLIC_RELEASE_VERSION "6.1")
|
||||
set(CGAL_VERSION_PUBLIC_RELEASE_VERSION "6.2-dev")
|
||||
set(CGAL_VERSION_PUBLIC_RELEASE_NAME "CGAL-${CGAL_VERSION_PUBLIC_RELEASE_VERSION}")
|
||||
|
||||
if (CGAL_BUGFIX_VERSION AND CGAL_BUGFIX_VERSION GREATER 0)
|
||||
|
|
|
|||
|
|
@ -89,6 +89,44 @@ double operator[](int i)const;
|
|||
Cartesian_const_iterator_d cartesian_begin()const;
|
||||
/*! returns an iterator pointing beyond the last %Cartesian coordinate. */
|
||||
Cartesian_const_iterator_d cartesian_end()const;
|
||||
|
||||
/*! returns whether the points coincide. */
|
||||
friend bool operator==(Point_d,Point_d);
|
||||
/*! returns whether the points are distinct. */
|
||||
friend bool operator!=(Point_d,Point_d);
|
||||
};
|
||||
|
||||
/*!
|
||||
represents a vector in the Euclidean space
|
||||
\cgalModels{DefaultConstructible,Assignable}
|
||||
*/
|
||||
class Vector_d {
|
||||
public:
|
||||
/*! introduces a vector with coordinates (x0, x1, ...) where the number of
|
||||
coordinates matches the dimension.
|
||||
\pre `DimensionTag` is a fixed dimension, not `Dynamic_dimension_tag`. */
|
||||
Vector_d(double x0, double x1, ...);
|
||||
|
||||
/*! introduces a vector with coordinate set `[first,end)`.
|
||||
\pre If `DimensionTag` is a fixed dimension, it matches `distance(first,end)`.
|
||||
\tparam ForwardIterator has its value type that is convertible to `double`.
|
||||
*/
|
||||
template<typename ForwardIterator>
|
||||
Vector_d(ForwardIterator first, ForwardIterator end);
|
||||
|
||||
/*! returns the i-th coordinate of a vector.
|
||||
\pre `i` is non-negative and less than the dimension. */
|
||||
double operator[](int i)const;
|
||||
|
||||
/*! returns an iterator pointing to the zeroth %Cartesian coordinate. */
|
||||
Cartesian_const_iterator_d cartesian_begin()const;
|
||||
/*! returns an iterator pointing beyond the last %Cartesian coordinate. */
|
||||
Cartesian_const_iterator_d cartesian_end()const;
|
||||
|
||||
/*! returns whether the vectors coincide. */
|
||||
friend bool operator==(Vector_d,Vector_d);
|
||||
/*! returns whether the vectors are distinct. */
|
||||
friend bool operator!=(Vector_d,Vector_d);
|
||||
};
|
||||
|
||||
/*!
|
||||
|
|
|
|||
|
|
@ -77,6 +77,48 @@ double operator[](int i)const;
|
|||
Cartesian_const_iterator_d cartesian_begin()const;
|
||||
/*! returns an iterator pointing beyond the last Cartesian coordinate. */
|
||||
Cartesian_const_iterator_d cartesian_end()const;
|
||||
|
||||
/*! returns whether the points coincide. This may not be safe
|
||||
if the points are the result of inexact constructions. */
|
||||
friend bool operator==(Point_d,Point_d);
|
||||
/*! returns whether the points are distinct. This may not be safe
|
||||
if the points are the result of inexact constructions. */
|
||||
friend bool operator!=(Point_d,Point_d);
|
||||
};
|
||||
|
||||
/*!
|
||||
represents a vector in the Euclidean space
|
||||
\cgalModels{DefaultConstructible,Assignable}
|
||||
*/
|
||||
class Vector_d {
|
||||
public:
|
||||
/*! introduces a vector with coordinates (x0, x1, ...) where the number of
|
||||
coordinates matches the dimension.
|
||||
\pre `DimensionTag` is a fixed dimension, not `Dynamic_dimension_tag`. */
|
||||
Vector_d(double x0, double x1, ...);
|
||||
|
||||
/*! introduces a vector with coordinate set `[first,end)`.
|
||||
\pre If `DimensionTag` is a fixed dimension, it matches `distance(first,end)`.
|
||||
\tparam InputIterator has its value type that is convertible to `double`.
|
||||
*/
|
||||
template<typename InputIterator>
|
||||
Vector_d(InputIterator first, InputIterator end);
|
||||
|
||||
/*! returns the i-th coordinate of a vector.
|
||||
\pre `i` is non-negative and less than the dimension. */
|
||||
double operator[](int i)const;
|
||||
|
||||
/*! returns an iterator pointing to the zeroth Cartesian coordinate. */
|
||||
Cartesian_const_iterator_d cartesian_begin()const;
|
||||
/*! returns an iterator pointing beyond the last Cartesian coordinate. */
|
||||
Cartesian_const_iterator_d cartesian_end()const;
|
||||
|
||||
/*! returns whether the vectors coincide. This may not be safe
|
||||
if the vectors are the result of inexact constructions. */
|
||||
friend bool operator==(Vector_d,Vector_d);
|
||||
/*! returns whether the vectors are distinct. This may not be safe
|
||||
if the vectors are the result of inexact constructions. */
|
||||
friend bool operator!=(Vector_d,Vector_d);
|
||||
};
|
||||
|
||||
/*!
|
||||
|
|
|
|||
|
|
@ -1795,8 +1795,8 @@ bool MainWindow::loadScript(QFileInfo info)
|
|||
QString program;
|
||||
QString filename = info.absoluteFilePath();
|
||||
QFile script_file(filename);
|
||||
script_file.open(QIODevice::ReadOnly);
|
||||
if(!script_file.isReadable()) {
|
||||
bool success = script_file.open(QIODevice::ReadOnly);
|
||||
if((! success) || (!script_file.isReadable())) {
|
||||
throw std::ios_base::failure(script_file.errorString().toStdString());
|
||||
}
|
||||
program = script_file.readAll();
|
||||
|
|
@ -2747,9 +2747,9 @@ void MainWindow::exportStatistics()
|
|||
if(filename.isEmpty())
|
||||
return;
|
||||
QFile output(filename);
|
||||
output.open(QIODevice::WriteOnly | QIODevice::Text);
|
||||
bool success = output.open(QIODevice::WriteOnly | QIODevice::Text);
|
||||
|
||||
if(!output.isOpen()){
|
||||
if((! success) || (!output.isOpen())){
|
||||
qDebug() << "- Error, unable to open" << "outputFilename" << "for output";
|
||||
}
|
||||
QTextStream outStream(&output);
|
||||
|
|
|
|||
|
|
@ -93,18 +93,20 @@ bool Camera_positions_list::save(QString filename) {
|
|||
if(m_model->rowCount() <1)
|
||||
return false;
|
||||
QFile file(filename);
|
||||
file.open(QIODevice::WriteOnly);
|
||||
QTextStream out(&file);
|
||||
for(int i = 0; i < m_model->rowCount(); ++i)
|
||||
{
|
||||
QStandardItem* item = m_model->item(i);
|
||||
out << item->data(Qt::DisplayRole).toString()
|
||||
<< "\n"
|
||||
<< item->data(Qt::UserRole).toString()
|
||||
<< "\n";
|
||||
if(file.open(QIODevice::WriteOnly)){
|
||||
QTextStream out(&file);
|
||||
for(int i = 0; i < m_model->rowCount(); ++i)
|
||||
{
|
||||
QStandardItem* item = m_model->item(i);
|
||||
out << item->data(Qt::DisplayRole).toString()
|
||||
<< "\n"
|
||||
<< item->data(Qt::UserRole).toString()
|
||||
<< "\n";
|
||||
}
|
||||
file.close();
|
||||
return true;
|
||||
}
|
||||
file.close();
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
void Camera_positions_list::on_saveButton_pressed()
|
||||
|
|
@ -129,19 +131,24 @@ void Camera_positions_list::on_openButton_pressed()
|
|||
|
||||
void Camera_positions_list::load(QString filename) {
|
||||
QFile file(filename);
|
||||
std::clog << "Loading camera positions " << qPrintable(filename) << std::endl;
|
||||
file.open(QIODevice::ReadOnly);
|
||||
QTextStream input(&file);
|
||||
while(!input.atEnd()) {
|
||||
QString text = input.readLine(1000);
|
||||
QString coord = input.readLine(1000);
|
||||
if(text.isNull() || coord.isNull()) return;
|
||||
CGAL::qglviewer::Frame frame;
|
||||
if(Three::activeViewer()->readFrame(coord, frame))
|
||||
{
|
||||
addItem(text,
|
||||
Three::activeViewer()->dumpFrame(frame));
|
||||
|
||||
if(file.open(QIODevice::ReadOnly)){
|
||||
std::clog << "Loading camera positions " << qPrintable(filename) << std::endl;
|
||||
|
||||
QTextStream input(&file);
|
||||
while(!input.atEnd()) {
|
||||
QString text = input.readLine(1000);
|
||||
QString coord = input.readLine(1000);
|
||||
if(text.isNull() || coord.isNull()) return;
|
||||
CGAL::qglviewer::Frame frame;
|
||||
if(Three::activeViewer()->readFrame(coord, frame))
|
||||
{
|
||||
addItem(text,
|
||||
Three::activeViewer()->dumpFrame(frame));
|
||||
}
|
||||
}
|
||||
}else {
|
||||
std::clog << "Loading camera positions " << qPrintable(filename) << " failed" << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -35,6 +35,9 @@ target_link_libraries(off_to_nef_plugin PRIVATE scene_nef_polyhedron_item)
|
|||
cgal_lab_plugin(polylines_io_plugin Polylines_io_plugin KEYWORDS Viewer Mesh_3)
|
||||
target_link_libraries(polylines_io_plugin PRIVATE scene_polylines_item)
|
||||
|
||||
cgal_lab_plugin(spheres_io_plugin Spheres_io_plugin KEYWORDS Viewer Mesh_3)
|
||||
target_link_libraries(spheres_io_plugin PRIVATE scene_basic_objects)
|
||||
|
||||
cgal_lab_plugin(wkt_plugin WKT_io_plugin KEYWORDS Viewer PointSetProcessing Mesh_3)
|
||||
target_link_libraries(wkt_plugin PRIVATE scene_polylines_item)
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,162 @@
|
|||
#include "Scene_spheres_item.h"
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <CGAL/Three/CGAL_Lab_io_plugin_interface.h>
|
||||
#include <CGAL/Three/CGAL_Lab_plugin_interface.h>
|
||||
#include <CGAL/Three/CGAL_Lab_plugin_helper.h>
|
||||
|
||||
#include <CGAL/Three/Three.h>
|
||||
#include <fstream>
|
||||
#include <QVariant>
|
||||
#include <QMessageBox>
|
||||
#include <QInputDialog>
|
||||
|
||||
using namespace CGAL::Three;
|
||||
|
||||
class CGAL_Lab_spheres_io_plugin :
|
||||
public QObject,
|
||||
public CGAL_Lab_io_plugin_interface,
|
||||
public CGAL_Lab_plugin_helper
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_INTERFACES(CGAL::Three::CGAL_Lab_plugin_interface CGAL::Three::CGAL_Lab_io_plugin_interface)
|
||||
Q_PLUGIN_METADATA(IID "com.geometryfactory.CGALLab.PluginInterface/1.0" FILE "spheres_io_plugin.json")
|
||||
Q_PLUGIN_METADATA(IID "com.geometryfactory.CGALLab.IOPluginInterface/1.90")
|
||||
|
||||
public:
|
||||
// To silent a warning -Woverloaded-virtual
|
||||
// See https://stackoverflow.com/questions/9995421/gcc-woverloaded-virtual-warnings
|
||||
|
||||
using CGAL_Lab_io_plugin_interface::init;
|
||||
//! Configures the widget
|
||||
void init(QMainWindow* mainWindow,
|
||||
CGAL::Three::Scene_interface* scene_interface,
|
||||
Messages_interface*) override{
|
||||
//get the references
|
||||
this->scene = scene_interface;
|
||||
this->mw = mainWindow;
|
||||
|
||||
}
|
||||
QString name() const override{ return "spheres_io_plugin"; }
|
||||
QString nameFilters() const override{ return "Spheres files (*.spheres.txt)"; }
|
||||
bool canLoad(QFileInfo fileinfo) const override;
|
||||
QList<Scene_item*> load(QFileInfo fileinfo, bool& ok, bool add_to_scene=true) override;
|
||||
|
||||
bool canSave(const CGAL::Three::Scene_item*) override;
|
||||
bool save(QFileInfo fileinfo,QList<CGAL::Three::Scene_item*>&) override;
|
||||
bool applicable(QAction* ) const override {
|
||||
return false;
|
||||
}
|
||||
QList<QAction*> actions() const override{
|
||||
|
||||
return QList<QAction*>();
|
||||
}
|
||||
|
||||
bool isDefaultLoader(const Scene_item* item) const override{
|
||||
if(qobject_cast<const Scene_spheres_item*>(item))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
bool CGAL_Lab_spheres_io_plugin::canLoad(QFileInfo fileinfo) const{
|
||||
if(!fileinfo.suffix().contains("cgal"))
|
||||
return true;
|
||||
std::ifstream in(fileinfo.filePath().toUtf8());
|
||||
if(!in) {
|
||||
return false;
|
||||
}
|
||||
int first;
|
||||
if(!(in >> first)
|
||||
|| first <= 0)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
QList<Scene_item*>
|
||||
CGAL_Lab_spheres_io_plugin::
|
||||
load(QFileInfo fileinfo, bool& ok, bool add_to_scene){
|
||||
|
||||
// Open file
|
||||
std::ifstream ifs(fileinfo.filePath().toUtf8());
|
||||
if(!ifs) {
|
||||
std::cerr << "Error! Cannot open file " << (const char*)fileinfo.filePath().toUtf8() << std::endl;
|
||||
ok = false;
|
||||
return QList<Scene_item*>();
|
||||
}
|
||||
|
||||
if(fileinfo.size() == 0)
|
||||
{
|
||||
CGAL::Three::Three::warning( tr("The file you are trying to load is empty."));
|
||||
Scene_spheres_item* item = new Scene_spheres_item(nullptr, 0, false, false);
|
||||
item->setName(fileinfo.completeBaseName());
|
||||
ok = true;
|
||||
if(add_to_scene)
|
||||
CGAL::Three::Three::scene()->addItem(item);
|
||||
return QList<Scene_item*>()<<item;
|
||||
}
|
||||
|
||||
double x, y, z, r;
|
||||
std::vector<std::array<double, 4> > spheres;
|
||||
while (ifs >> x && ifs >> y && ifs >> z && ifs >> r)
|
||||
spheres.push_back({x, y, z, r});
|
||||
|
||||
std::vector<QColor> colors;
|
||||
if (true) {
|
||||
colors.resize(spheres.size());
|
||||
for (QColor &c : colors)
|
||||
c = generate_random_color();
|
||||
}
|
||||
else {
|
||||
colors.reserve(spheres.size());
|
||||
compute_deterministic_color_map(QColor(180, 120, 130, 255), spheres.size(), std::back_inserter(colors));
|
||||
}
|
||||
|
||||
Scene_spheres_item* item = new Scene_spheres_item(nullptr, spheres.size(), false, true);
|
||||
item->setName(fileinfo.completeBaseName());
|
||||
|
||||
for (std::size_t i = 0;i<spheres.size();i++) {
|
||||
const std::array<double, 4>& s = spheres[i];
|
||||
item->add_sphere(CGAL::Epick::Sphere_3(CGAL::Epick::Point_3(s[0], s[1], s[2]), s[3] * s[3]), i, CGAL::IO::Color(colors[i].red(), colors[i].green(), colors[i].blue()));
|
||||
}
|
||||
|
||||
std::cerr << "Number of spheres loaded: " << spheres.size() << std::endl;
|
||||
|
||||
item->invalidateOpenGLBuffers();
|
||||
|
||||
item->setRenderingMode(Gouraud);
|
||||
CGAL::Three::Three::scene()->addItem(item);
|
||||
item->computeElements();
|
||||
|
||||
return QList<Scene_item*>()<<item;
|
||||
}
|
||||
|
||||
bool CGAL_Lab_spheres_io_plugin::canSave(const CGAL::Three::Scene_item* item)
|
||||
{
|
||||
return qobject_cast<const Scene_spheres_item*>(item) != 0;
|
||||
}
|
||||
|
||||
bool CGAL_Lab_spheres_io_plugin::
|
||||
save(QFileInfo fileinfo,QList<CGAL::Three::Scene_item*>& items)
|
||||
{
|
||||
Scene_item* item = items.front();
|
||||
const Scene_spheres_item* sphere_item =
|
||||
qobject_cast<const Scene_spheres_item*>(item);
|
||||
|
||||
if(!sphere_item)
|
||||
return false;
|
||||
|
||||
std::ofstream out(fileinfo.filePath().toUtf8());
|
||||
|
||||
out.precision (std::numeric_limits<double>::digits10 + 2);
|
||||
|
||||
if(!out) {
|
||||
std::cerr << "Error! Cannot open file " << (const char*)fileinfo.filePath().toUtf8() << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#include "Spheres_io_plugin.moc"
|
||||
|
|
@ -47,7 +47,7 @@ public:
|
|||
QString ext = fileinfo.suffix();
|
||||
bool res = true;
|
||||
if(ext == "off")
|
||||
CGAL::import_from_polyhedron_3_flux < Scene_lcc_item::LCC > (lcc, ifs);
|
||||
CGAL::polyhedron_3_flux_to_lcc < Scene_lcc_item::LCC > (lcc, ifs);
|
||||
else
|
||||
{
|
||||
res = CGAL::load_combinatorial_map(ifs, lcc);
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@
|
|||
#include<fstream>
|
||||
#include <CGAL/Three/Triangle_container.h>
|
||||
#include <CGAL/Three/Edge_container.h>
|
||||
#include <CGAL/Three/Three.h>
|
||||
#include <QApplication>
|
||||
#include <QMenu>
|
||||
|
||||
using namespace CGAL::Three;
|
||||
|
||||
|
|
@ -43,9 +45,7 @@ struct Scene_spheres_item_priv
|
|||
model_sphere_is_up = false;
|
||||
}
|
||||
|
||||
~Scene_spheres_item_priv()
|
||||
{
|
||||
}
|
||||
~Scene_spheres_item_priv() {}
|
||||
|
||||
void pick(int &id)const;
|
||||
|
||||
|
|
@ -85,6 +85,15 @@ void Scene_spheres_item_priv::pick(int& id) const
|
|||
id = -1;
|
||||
}
|
||||
|
||||
if (id != -1 && spheres[id].size() == 1) {
|
||||
const Sphere& sphere = spheres[id][0].first;
|
||||
Three::information(QString("Selected sphere: center (%1, %2, %3) radius %4").
|
||||
arg(sphere.center().x(), 0, 'g', 10).
|
||||
arg(sphere.center().y(), 0, 'g', 10).
|
||||
arg(sphere.center().z(), 0, 'g', 10).
|
||||
arg(CGAL::approximate_sqrt(sphere.squared_radius()), 0, 'g', 10));
|
||||
}
|
||||
|
||||
int offset = 0;
|
||||
float color[4];
|
||||
for(std::size_t i=0; i<spheres.size(); ++i)
|
||||
|
|
@ -112,8 +121,10 @@ void Scene_spheres_item_priv::pick(int& id) const
|
|||
}
|
||||
}
|
||||
|
||||
Scene_spheres_item::Scene_spheres_item(Scene_group_item* parent, std::size_t max_index, bool planed, bool pickable)
|
||||
Scene_spheres_item::Scene_spheres_item(Scene_group_item* parent, std::size_t max_index, bool planed, bool pickable) : Scene_group_item()
|
||||
{
|
||||
connected_alpha_slider = false;
|
||||
rendering_mode = Gouraud;
|
||||
setParent(parent);
|
||||
d = new Scene_spheres_item_priv(planed, max_index, this, pickable);
|
||||
if(pickable)
|
||||
|
|
@ -173,6 +184,9 @@ void Scene_spheres_item_priv::initializeBuffers(CGAL::Three::Viewer_interface *v
|
|||
|
||||
void Scene_spheres_item::draw(Viewer_interface *viewer) const
|
||||
{
|
||||
if (renderingMode() != Gouraud || !visible())
|
||||
return;
|
||||
|
||||
if(!isInit(viewer))
|
||||
initGL(viewer);
|
||||
if ( getBuffersFilled() &&
|
||||
|
|
@ -201,6 +215,7 @@ void Scene_spheres_item::draw(Viewer_interface *viewer) const
|
|||
}
|
||||
else
|
||||
{
|
||||
getTriangleContainer(0)->setAlpha(alpha());
|
||||
getTriangleContainer(0)->draw(viewer, false);
|
||||
}
|
||||
if(d->pickable && (d->spheres.size() > 1 && viewer->inDrawWithNames()))
|
||||
|
|
@ -218,6 +233,9 @@ void Scene_spheres_item::draw(Viewer_interface *viewer) const
|
|||
|
||||
void Scene_spheres_item::drawEdges(Viewer_interface *viewer) const
|
||||
{
|
||||
if (renderingMode() != Wireframe || !visible())
|
||||
return;
|
||||
|
||||
if(!isInit(viewer))
|
||||
initGL(viewer);
|
||||
if ( getBuffersFilled() &&
|
||||
|
|
@ -295,6 +313,18 @@ void Scene_spheres_item::invalidateOpenGLBuffers()
|
|||
getTriangleContainer(1)->reset_vbos(COLORS);
|
||||
}
|
||||
getEdgeContainer(0)->reset_vbos(NOT_INSTANCED);
|
||||
compute_bbox();
|
||||
}
|
||||
|
||||
QMenu* Scene_spheres_item::contextMenu() {
|
||||
QMenu* menu = Scene_item_rendering_helper::contextMenu();
|
||||
|
||||
if (!connected_alpha_slider && alphaSlider() != nullptr) {
|
||||
connect(alphaSlider(), &QSlider::valueChanged, [this]() {redraw(); });
|
||||
connected_alpha_slider = true;
|
||||
}
|
||||
|
||||
return menu;
|
||||
}
|
||||
|
||||
QString
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
#define SCENE_SPHERES_ITEM_H
|
||||
#include "Scene_basic_objects_config.h"
|
||||
#include "create_sphere.h"
|
||||
#include "Color_map.h"
|
||||
|
||||
#include <CGAL/Three/Scene_group_item.h>
|
||||
#include <CGAL/Three/Scene_item_rendering_helper.h>
|
||||
|
|
@ -24,7 +25,7 @@ struct Scene_spheres_item_priv;
|
|||
* have a Scene_spheres_item child).
|
||||
*/
|
||||
class SCENE_BASIC_OBJECTS_EXPORT Scene_spheres_item
|
||||
: public CGAL::Three::Scene_item_rendering_helper
|
||||
: public CGAL::Three::Scene_group_item
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
|
|
@ -37,6 +38,7 @@ public:
|
|||
|
||||
~Scene_spheres_item();
|
||||
|
||||
Bbox bbox() const override { return _bbox; }
|
||||
bool isFinite() const override{ return true; }
|
||||
bool isEmpty() const override{ return false; }
|
||||
Scene_item* clone() const override{return nullptr;}
|
||||
|
|
@ -57,10 +59,12 @@ public:
|
|||
void setColor(QColor c) override;
|
||||
bool save(const std::string &file_name) const;
|
||||
|
||||
QMenu *contextMenu() override;
|
||||
|
||||
void initializeBuffers(Viewer_interface *) const override;
|
||||
void computeElements() const override;
|
||||
bool eventFilter(QObject *watched, QEvent *event)override;
|
||||
|
||||
Q_SIGNALS:
|
||||
void on_color_changed();
|
||||
void picked(std::size_t id) const;
|
||||
|
|
@ -68,6 +72,7 @@ Q_SIGNALS:
|
|||
protected:
|
||||
friend struct Scene_spheres_item_priv;
|
||||
Scene_spheres_item_priv* d;
|
||||
bool connected_alpha_slider;
|
||||
};
|
||||
|
||||
#endif // SCENE_SPHERES_ITEM_H
|
||||
|
|
|
|||
|
|
@ -375,7 +375,7 @@ void MainWindow::load_off (const QString & fileName, bool clear)
|
|||
|
||||
std::ifstream ifs (qPrintable (fileName));
|
||||
|
||||
CGAL::import_from_polyhedron_3_flux < LCC > (*scene.lcc, ifs);
|
||||
CGAL::polyhedron_3_flux_to_lcc < LCC > (*scene.lcc, ifs);
|
||||
|
||||
#ifdef CGAL_PROFILE_LCC_DEMO
|
||||
timer.stop();
|
||||
|
|
@ -415,7 +415,7 @@ void MainWindow::load_3DTDS (const QString & fileName, bool clear)
|
|||
T.insert (std::istream_iterator < Point_3 >(ifs),
|
||||
std::istream_iterator < Point_3 >() );
|
||||
|
||||
CGAL::import_from_triangulation_3 < LCC, Triangulation >(*scene.lcc, T);
|
||||
CGAL::triangulation_3_to_lcc < LCC, Triangulation >(*scene.lcc, T);
|
||||
|
||||
#ifdef CGAL_PROFILE_LCC_DEMO
|
||||
timer.stop();
|
||||
|
|
@ -673,7 +673,7 @@ void MainWindow::on_actionCompute_Voronoi_3D_triggered ()
|
|||
std::map<Triangulation::Cell_handle,
|
||||
LCC::Dart_descriptor > vol_to_dart;
|
||||
|
||||
dh = CGAL::import_from_triangulation_3 < LCC, Triangulation >
|
||||
dh = CGAL::triangulation_3_to_lcc < LCC, Triangulation >
|
||||
(delaunay_lcc, T, &vol_to_dart);
|
||||
|
||||
Dart_descriptor ddh=delaunay_lcc.dual(*scene.lcc, dh);
|
||||
|
|
|
|||
|
|
@ -24,13 +24,20 @@ Here a small example:
|
|||
<B>Middle</B>: the 2D linear cell complex reconstructed if combinatorial maps are the combinatorial data-structure.
|
||||
<B>Right</B>: the 2D linear cell complex reconstructed if generalized maps are the combinatorial data-structure.
|
||||
|
||||
\sa `CGAL::import_from_triangulation_3<LCC,Triangulation>`
|
||||
\sa `CGAL::import_from_polyhedron_3<LCC,Polyhedron>`
|
||||
|
||||
\sa `CGAL::triangulation_3_to_lcc<LCC,Triangulation>`
|
||||
\sa `CGAL::polyhedron_3_to_lcc<LCC,Polyhedron>`
|
||||
*/
|
||||
template<class LCC>
|
||||
typename LCC::Dart_descriptor import_from_plane_graph(LCC& lcc,
|
||||
typename LCC::Dart_descriptor read_plane_graph_in_lcc(LCC& lcc,
|
||||
std::istream& ais);
|
||||
|
||||
/*!
|
||||
\ingroup PkgLinearCellComplexConstructions
|
||||
\deprecated Use `read_plane_graph_in_lcc()` instead.
|
||||
*/
|
||||
template<class LCC>
|
||||
[[deprecated("Use read_plane_graph_in_lcc instead")]]
|
||||
typename LCC::Dart_descriptor import_from_plane_graph(LCC& lcc, std::istream& ais);
|
||||
|
||||
} /* namespace CGAL */
|
||||
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ namespace CGAL{
|
|||
Imports `apoly` (a `Polyhedron_3`) into `lcc`, a model of the `LinearCellComplex` concept. Objects are added in `lcc`, existing darts are not modified. Returns a dart created during the import.
|
||||
\pre \link GenericMap::dimension `LCC::dimension`\endlink \f$ \geq\f$ 2 and \link LinearCellComplex::ambient_dimension `LCC::ambient_dimension`\endlink==3.
|
||||
|
||||
\sa `CGAL::import_from_plane_graph<LCC>`
|
||||
\sa `CGAL::import_from_triangulation_3<LCC,Triangulation>`
|
||||
\sa `CGAL::read_plane_graph_in_lcc<LCC>`
|
||||
\sa `CGAL::triangulation_3_to_lcc<LCC,Triangulation>`
|
||||
*/
|
||||
template<class LCC,class Polyhedron>
|
||||
typename LCC::Dart_descriptor import_from_polyhedron_3(LCC& lcc,
|
||||
typename LCC::Dart_descriptor polyhedron_3_to_lcc(LCC& lcc,
|
||||
const Polyhedron &apoly);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,13 +3,23 @@ namespace CGAL{
|
|||
/*!
|
||||
\ingroup PkgLinearCellComplexConstructions
|
||||
|
||||
Imports `atr` (a `Triangulation_3`) into `lcc`, a model of the `LinearCellComplex` concept. Objects are added in `lcc`, existing darts are not modified. Returns a dart created during the import.
|
||||
\pre \link GenericMap::dimension `LCC::dimension`\endlink \f$ \geq\f$ 3 and \link LinearCellComplex::ambient_dimension `LCC::ambient_dimension`\endlink==3.
|
||||
Imports `atr` (a `Triangulation_3`) into `lcc`, a model of the `LinearCellComplex` concept.
|
||||
Objects are added in `lcc`, existing darts are not modified. Returns a dart created during the import.
|
||||
\pre \link GenericMap::dimension `LCC::dimension`\endlink \f$ \geq\f$ 3 and
|
||||
\link LinearCellComplex::ambient_dimension `LCC::ambient_dimension`\endlink==3.
|
||||
|
||||
\sa `CGAL::import_from_plane_graph<LCC>`
|
||||
\sa `CGAL::import_from_polyhedron_3<LCC,Polyhedron>`
|
||||
\sa `CGAL::read_plane_graph_in_lcc<LCC>`
|
||||
\sa `CGAL::polyhedron_3_to_lcc<LCC,Polyhedron>`
|
||||
*/
|
||||
|
||||
template <class LCC,class Triangulation_>
|
||||
typename LCC::Dart_descriptor import_from_triangulation_3(LCC& lcc,
|
||||
const Triangulation_&atr);
|
||||
typename LCC::Dart_descriptor triangulation_3_to_lcc(LCC& lcc, const Triangulation_&atr);
|
||||
|
||||
template <class LCC, class Triangulation_>
|
||||
[[deprecated("Use triangulation_3_to_lcc instead")]]
|
||||
typename LCC::Dart_descriptor import_from_triangulation_3(LCC& lcc, const Triangulation_& atr)
|
||||
{
|
||||
return triangulation_3_to_lcc(lcc, atr);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -64,8 +64,8 @@ which constructs a vector as the difference of points `p2-p1`, and
|
|||
\link LinearCellComplexTraits::Vector ` Vector `\endlink `operator() (const CGAL::Origin&, const ` \link Point ` Point`\endlink`& p)`
|
||||
which constructs a vector as the difference of point `p` and a point at the origin
|
||||
(used in \link CGAL::barycenter `barycenter`\endlink
|
||||
and `CGAL::import_from_plane_graph`).
|
||||
*/
|
||||
and `CGAL::read_plane_graph_in_lcc`).*/
|
||||
|
||||
typedef unspecified_type Construct_vector;
|
||||
|
||||
/*!
|
||||
|
|
@ -104,7 +104,7 @@ a model of \link Kernel::Direction_2 `Direction_2`\endlink.
|
|||
typedef unspecified_type Direction_2;
|
||||
|
||||
/*!
|
||||
a model of \link Kernel::ConstructDirection_2 `ConstructDirection_2`\endlink (used in `CGAL::import_from_plane_graph`).
|
||||
a model of \link Kernel::ConstructDirection_2 `ConstructDirection_2`\endlink (used in `CGAL::read_plane_graph_in_lcc`).
|
||||
*/
|
||||
typedef unspecified_type Construct_direction_2;
|
||||
|
||||
|
|
|
|||
|
|
@ -105,11 +105,12 @@ There are several member functions allowing to insert specific configurations of
|
|||
|
||||
There are two functions allowing to build a linear cell complex from two other \cgal data types:
|
||||
<UL>
|
||||
<LI>\link CGAL::import_from_triangulation_3 `import_from_triangulation_3(lcc,atr)`\endlink: adds in `lcc` all the tetrahedra present in `atr`, a \link CGAL::Triangulation_3 `Triangulation_3`\endlink;
|
||||
<LI>\link CGAL::import_from_polyhedron_3 `import_from_polyhedron_3(lcc,ap)`\endlink: adds in `lcc` all the cells present in `ap`, a `Polyhedron_3`.
|
||||
|
||||
<LI>\link CGAL::triangulation_3_to_lcc `triangulation_3_to_lcc(lcc,atr)`\endlink: adds in `lcc` all the tetrahedra present in `atr`, a \link CGAL::Triangulation_3 `Triangulation_3`\endlink;
|
||||
<LI>\link CGAL::polyhedron_3_to_lcc `polyhedron_3_to_lcc(lcc,ap)`\endlink: adds in `lcc` all the cells present in `ap`, a `Polyhedron_3`.
|
||||
</UL>
|
||||
|
||||
Lastly, the function \link CGAL::import_from_plane_graph `import_from_plane_graph(lcc,ais)`\endlink adds in `lcc` all the cells reconstructed from the planar graph read in `ais`, a `std::istream` (see the \link CGAL::import_from_plane_graph `reference manual`\endlink for the file format).
|
||||
Lastly, the function \link CGAL::read_plane_graph_in_lcc `read_plane_graph_in_lcc(lcc,ais)`\endlink adds in `lcc` all the cells reconstructed from the planar graph read in `ais`, a `std::istream` (see the \link CGAL::read_plane_graph_in_lcc `reference manual`\endlink for the file format).
|
||||
|
||||
\subsection Linear_cell_complexModificationOperations Modification Operations
|
||||
\anchor ssecmodifop
|
||||
|
|
|
|||
|
|
@ -62,9 +62,9 @@
|
|||
|
||||
\cgalCRPSection{Global Functions}
|
||||
\cgalCRPSubsection{Constructions for Linear Cell Complex}
|
||||
- `CGAL::import_from_plane_graph<LCC>`
|
||||
- `CGAL::import_from_triangulation_3<LCC,Triangulation>`
|
||||
- `CGAL::import_from_polyhedron_3<LCC,Polyhedron>`
|
||||
- `CGAL::read_plane_graph_in_lcc<LCC>` (formerly `import_from_plane_graph`)
|
||||
- `CGAL::triangulation_3_to_lcc<LCC,Triangulation>` (formerly `import_from_triangulation_3`)
|
||||
- `CGAL::polyhedron_3_to_lcc<LCC,Polyhedron>` (formerly `import_from_polyhedron_3`)
|
||||
|
||||
\cgalCRPSubsection{Operations for Linear Cell Complex}
|
||||
- `CGAL::compute_normal_of_cell_0<LCC>`
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ create_single_source_cgal_program(
|
|||
"linear_cell_complex_3_with_colored_vertices.cpp")
|
||||
create_single_source_cgal_program("linear_cell_complex_3_with_mypoint.cpp")
|
||||
create_single_source_cgal_program("linear_cell_complex_4.cpp")
|
||||
create_single_source_cgal_program("plane_graph_to_lcc_2.cpp")
|
||||
create_single_source_cgal_program("read_plane_graph_in_lcc_2.cpp")
|
||||
create_single_source_cgal_program("voronoi_2.cpp")
|
||||
create_single_source_cgal_program("voronoi_3.cpp")
|
||||
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ Examples for Linear_cell_complex package:
|
|||
Three "basic" examples, detailed in the user manual.
|
||||
|
||||
|
||||
* plane_graph_to_lcc_2.cpp
|
||||
* read_plane_graph_in_lcc_2.cpp
|
||||
|
||||
Program allowing to transform a planar graph into a 2D linear cell complex.
|
||||
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ int main(int narg, char** argv)
|
|||
|
||||
std::ifstream is(filename.c_str());
|
||||
std::cout<<"Import plane graph from "<<filename<<std::endl;
|
||||
CGAL::import_from_plane_graph(lcc, is);
|
||||
CGAL::read_plane_graph_in_lcc(lcc, is);
|
||||
|
||||
// Display the lcc characteristics.
|
||||
std::cout<<"LCC characteristics:"<<std::endl<<" ";
|
||||
|
|
@ -134,7 +134,7 @@ int main(int narg, char** argv)
|
|||
std::map<Triangulation::Cell_handle,
|
||||
LCC_3::Dart_descriptor > vol_to_dart;
|
||||
|
||||
Dart_descriptor d=CGAL::import_from_triangulation_3<LCC_3, Triangulation>
|
||||
Dart_descriptor d=CGAL::triangulation_3_to_lcc<LCC_3, Triangulation>
|
||||
(lcc, T, &vol_to_dart);
|
||||
|
||||
std::cout<<"Delaunay triangulation :"<<std::endl<<" ";
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@
|
|||
#include <map>
|
||||
#include <vector>
|
||||
#include <list>
|
||||
#include <CGAL/config.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
@ -36,7 +37,7 @@ namespace CGAL {
|
|||
* Imports a plane-embedded graph from a list of points and edges represented as pairs of vertex indices
|
||||
*/
|
||||
template< class LCC >
|
||||
typename LCC::Dart_descriptor import_from_plane_graph(LCC& alcc,
|
||||
typename LCC::Dart_descriptor read_plane_graph_in_lcc(LCC& alcc,
|
||||
const std::vector<typename LCC::Point>& vertices,
|
||||
const std::vector<size_t>& edge_indices)
|
||||
{
|
||||
|
|
@ -130,6 +131,21 @@ namespace CGAL {
|
|||
return first;
|
||||
}
|
||||
|
||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||
/*!
|
||||
\deprecated This function is deprecated since CGAL 6.2. Use `read_plane_graph_in_lcc()` instead.
|
||||
*/
|
||||
template< class LCC >
|
||||
CGAL_DEPRECATED
|
||||
typename LCC::Dart_descriptor
|
||||
import_from_plane_graph(LCC& alcc,
|
||||
const std::vector<typename LCC::Point>& vertices,
|
||||
const std::vector<size_t>& edge_indices)
|
||||
{
|
||||
return read_plane_graph_in_lcc(alcc, vertices, edge_indices);
|
||||
}
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Imports a plane-embedded graph from a file into a LinearCellComplex.
|
||||
*
|
||||
|
|
@ -138,7 +154,7 @@ namespace CGAL {
|
|||
* @return A dart created during the conversion.
|
||||
*/
|
||||
template< class LCC >
|
||||
typename LCC::Dart_descriptor import_from_plane_graph(LCC& alcc,
|
||||
typename LCC::Dart_descriptor read_plane_graph_in_lcc(LCC& alcc,
|
||||
std::istream& ais)
|
||||
{
|
||||
using FT = typename LCC::FT;
|
||||
|
|
@ -185,18 +201,44 @@ namespace CGAL {
|
|||
edge_indices.push_back(v2);
|
||||
}
|
||||
|
||||
return import_from_plane_graph(alcc, vertices, edge_indices);
|
||||
return read_plane_graph_in_lcc(alcc, vertices, edge_indices);
|
||||
}
|
||||
|
||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||
/*!
|
||||
\deprecated This function is deprecated since CGAL 6.2. Use `read_plane_graph_in_lcc()` instead.
|
||||
*/
|
||||
template< class LCC >
|
||||
CGAL_DEPRECATED
|
||||
typename LCC::Dart_descriptor
|
||||
import_from_plane_graph(LCC& alcc, std::istream& ais)
|
||||
{
|
||||
return read_plane_graph_in_lcc(alcc, ais);
|
||||
}
|
||||
#endif
|
||||
|
||||
template < class LCC >
|
||||
typename LCC::Dart_descriptor
|
||||
import_from_plane_graph(LCC& alcc, const char* filename)
|
||||
read_plane_graph_in_lcc(LCC& alcc, const char* filename)
|
||||
{
|
||||
std::ifstream input(filename);
|
||||
if (!input.is_open()) return alcc.null_descriptor;
|
||||
return import_from_plane_graph(alcc, input);
|
||||
return read_plane_graph_in_lcc(alcc, input);
|
||||
}
|
||||
|
||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||
/*!
|
||||
\deprecated This function is deprecated since CGAL 6.2. Use `read_plane_graph_in_lcc()` instead.
|
||||
*/
|
||||
template< class LCC >
|
||||
CGAL_DEPRECATED
|
||||
typename LCC::Dart_descriptor
|
||||
import_from_plane_graph(LCC& alcc, const char* filename)
|
||||
{
|
||||
return read_plane_graph_in_lcc(alcc, filename);
|
||||
}
|
||||
#endif
|
||||
|
||||
template < class LCC >
|
||||
bool load_off(LCC& alcc, std::istream& in)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -36,3 +36,13 @@ add_executable(Linear_cell_complex_copy_test_index Linear_cell_complex_copy_test
|
|||
target_compile_definitions(Linear_cell_complex_copy_test_index PRIVATE USE_COMPACT_CONTAINER_WITH_INDEX)
|
||||
target_link_libraries(Linear_cell_complex_copy_test_index PRIVATE CGAL CGAL::Data)
|
||||
cgal_add_compilation_test(Linear_cell_complex_copy_test_index)
|
||||
|
||||
# Alias tests (test old function names, with deprecated warnings disabled)
|
||||
create_single_source_cgal_program(test_triangulation_alias.cpp ${hfiles})
|
||||
target_compile_definitions(test_triangulation_alias PRIVATE CGAL_NO_DEPRECATION_WARNINGS)
|
||||
|
||||
create_single_source_cgal_program(test_polyhedron_3_alias.cpp ${hfiles})
|
||||
target_compile_definitions(test_polyhedron_3_alias PRIVATE CGAL_NO_DEPRECATION_WARNINGS)
|
||||
|
||||
create_single_source_cgal_program(test_plane_graph_alias.cpp ${hfiles})
|
||||
target_compile_definitions(test_plane_graph_alias PRIVATE CGAL_NO_DEPRECATION_WARNINGS)
|
||||
|
|
|
|||
|
|
@ -382,7 +382,7 @@ bool test_LCC_2()
|
|||
std::cout<<"Error: impossible to open 'data/graph.txt'"<<std::endl;
|
||||
return false;
|
||||
}
|
||||
CGAL::import_from_plane_graph<LCC>(lcc,in);
|
||||
CGAL::read_plane_graph_in_lcc<LCC>(lcc,in);
|
||||
if ( !check_number_of_cells_2(lcc, 66, 166, 104, 2) )
|
||||
return false;
|
||||
lcc.clear();
|
||||
|
|
@ -431,7 +431,7 @@ struct Test_change_orientation_LCC_2<LCC, CGAL::Combinatorial_map_tag>
|
|||
std::cout<<"Error: impossible to open 'data/graph.txt'"<<std::endl;
|
||||
return false;
|
||||
}
|
||||
CGAL::import_from_plane_graph<LCC>(lcc,in);
|
||||
CGAL::read_plane_graph_in_lcc<LCC>(lcc,in);
|
||||
|
||||
trace_test_begin();
|
||||
|
||||
|
|
|
|||
|
|
@ -997,7 +997,7 @@ bool test_LCC_3()
|
|||
}
|
||||
in >> P;
|
||||
|
||||
CGAL::import_from_polyhedron_3<LCC>(lcc,P);
|
||||
CGAL::polyhedron_3_to_lcc<LCC>(lcc,P);
|
||||
if ( !check_number_of_cells_3(lcc, 1539, 4434, 2894, 2, 2) )
|
||||
return false;
|
||||
|
||||
|
|
@ -1029,7 +1029,7 @@ bool test_LCC_3()
|
|||
}
|
||||
T.insert ( std::istream_iterator < Point >(in),
|
||||
std::istream_iterator < Point >() );
|
||||
CGAL::import_from_triangulation_3<LCC>(lcc,T);
|
||||
CGAL::triangulation_3_to_lcc<LCC>(lcc,T);
|
||||
if ( !lcc.is_valid() )
|
||||
return false;
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,35 @@
|
|||
#include <CGAL/Installation/internal/disable_deprecation_warnings_and_errors.h>
|
||||
#include <CGAL/Linear_cell_complex_for_combinatorial_map.h>
|
||||
#include <CGAL/Linear_cell_complex_constructors.h>
|
||||
#include <cassert>
|
||||
#include <sstream>
|
||||
#include <cstdlib>
|
||||
|
||||
typedef CGAL::Linear_cell_complex_for_combinatorial_map<2> LCC;
|
||||
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||
LCC lcc1, lcc2;
|
||||
|
||||
// Planar graph with 3 vertices and 3 edges (triangle)
|
||||
std::stringstream input;
|
||||
input << "3 3\n0.0 0.0\n1.0 0.0\n0.0 1.0\n0 1\n1 2\n2 0\n";
|
||||
|
||||
// Test new function
|
||||
auto d1 = CGAL::read_plane_graph_in_lcc(lcc1, input);
|
||||
assert(d1 != LCC::null_descriptor);
|
||||
|
||||
// Rewind input stream for second test
|
||||
input.clear();
|
||||
input.seekg(0, std::ios::beg);
|
||||
|
||||
// Test deprecated function
|
||||
auto d2 = CGAL::import_from_plane_graph(lcc2, input);
|
||||
assert(d2 != LCC::null_descriptor);
|
||||
#endif // CGAL_NO_DEPRECATED_CODE
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
#include <CGAL/Linear_cell_complex_for_combinatorial_map.h>
|
||||
#include <CGAL/Installation/internal/disable_deprecation_warnings_and_errors.h>
|
||||
#include <CGAL/Polyhedron_3.h>
|
||||
#include <CGAL/Polyhedron_3_to_lcc.h>
|
||||
#include <sstream>
|
||||
#include <cassert>
|
||||
#include <cstdlib>
|
||||
|
||||
typedef CGAL::Linear_cell_complex_for_combinatorial_map<3> LCC;
|
||||
typedef CGAL::Polyhedron_3<LCC::Traits> Polyhedron;
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||
std::stringstream ss("OFF\n0 0 0\n");
|
||||
|
||||
Polyhedron P;
|
||||
ss >> P;
|
||||
|
||||
LCC lcc1, lcc2;
|
||||
|
||||
auto d1 = CGAL::polyhedron_3_to_lcc(lcc1, P);
|
||||
assert(d1 == LCC::null_descriptor);
|
||||
|
||||
auto d2 = CGAL::import_from_polyhedron_3<LCC>(lcc2, P);
|
||||
assert(d2 == LCC::null_descriptor);
|
||||
#endif // CGAL_NO_DEPRECATED_CODE
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,29 @@
|
|||
#include <CGAL/Linear_cell_complex_for_combinatorial_map.h>
|
||||
#include <CGAL/Installation/internal/disable_deprecation_warnings_and_errors.h>
|
||||
#include <CGAL/Delaunay_triangulation_3.h>
|
||||
#include <CGAL/Triangulation_3_to_lcc.h>
|
||||
#include <cassert>
|
||||
#include <cstdlib>
|
||||
|
||||
typedef CGAL::Linear_cell_complex_for_combinatorial_map<3> LCC_3;
|
||||
typedef CGAL::Delaunay_triangulation_3<LCC_3::Traits> Triangulation;
|
||||
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||
LCC_3 lcc1, lcc2;
|
||||
Triangulation T;
|
||||
|
||||
assert(T.dimension() == -1);
|
||||
|
||||
auto d1 = CGAL::triangulation_3_to_lcc(lcc1, T);
|
||||
assert(d1 == LCC_3::null_descriptor);
|
||||
|
||||
auto d2 = CGAL::import_from_triangulation_3(lcc2, T);
|
||||
assert(d2 == LCC_3::null_descriptor);
|
||||
#endif // CGAL_NO_DEPRECATED_CODE
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
||||
|
|
@ -18,6 +18,9 @@
|
|||
#include <CGAL/Filtered_kernel/internal/Static_filters/Side_of_oriented_circle_2.h>
|
||||
#include <CGAL/Filtered_kernel/internal/Static_filters/Orientation_3.h>
|
||||
#include <CGAL/Filtered_kernel/internal/Static_filters/Side_of_oriented_sphere_3.h>
|
||||
#include <CGAL/Filtered_kernel/internal/Static_filters/Orientation_4.h>
|
||||
#include <CGAL/Filtered_kernel/internal/Static_filters/Orientation_5.h>
|
||||
#include <CGAL/Filtered_kernel/internal/Static_filters/Orientation_6.h>
|
||||
|
||||
namespace CGAL {
|
||||
namespace SFA { // static filter adapter
|
||||
|
|
@ -151,6 +154,150 @@ template <class Base_,class R_> struct Side_of_oriented_sphere_3 : private Store
|
|||
return typename internal::Static_filters_predicates::Side_of_oriented_sphere_3<Adapter>()(P(this->kernel(),c,A),P(this->kernel(),c,B),P(this->kernel(),c,C),P(this->kernel(),c,D),P(this->kernel(),c,E));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
template <class Base_,class R_> struct Adapter_4 {
|
||||
typedef typename Get_type<R_, Orientation_tag>::type Orientation;
|
||||
typedef typename Get_type<R_, Oriented_side_tag>::type Oriented_side;
|
||||
typedef typename Get_type<R_, Point_tag>::type Point;
|
||||
typedef typename Get_functor<R_, Compute_point_cartesian_coordinate_tag>::type CC;
|
||||
typedef typename Get_functor<Base_, Orientation_of_points_tag>::type Orientation_base;
|
||||
struct Point_4 {
|
||||
R_ const&r; CC const&c; Point const& p;
|
||||
Point_4(R_ const&r_, CC const&c_, Point const&p_):r(r_),c(c_),p(p_){}
|
||||
decltype(auto) c0()const{return c(p,0);}
|
||||
decltype(auto) c1()const{return c(p,1);}
|
||||
decltype(auto) c2()const{return c(p,2);}
|
||||
decltype(auto) c3()const{return c(p,3);}
|
||||
};
|
||||
struct Orientation_4 {
|
||||
typedef typename Get_type<R_, Orientation_tag>::type result_type;
|
||||
auto operator()(Point_4 const&A, Point_4 const&B, Point_4 const&C,
|
||||
Point_4 const&D, Point_4 const&E)const{
|
||||
Point const* t[6]={&A.p,&B.p,&C.p,&D.p,&E.p};
|
||||
return Orientation_base(A.r)(make_transforming_iterator<Dereference_functor>(t+0),make_transforming_iterator<Dereference_functor>(t+5));
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
template <class Base_,class R_> struct Orientation_of_points_4 : private Store_kernel<R_> {
|
||||
CGAL_FUNCTOR_INIT_STORE(Orientation_of_points_4)
|
||||
typedef typename Get_type<R_, Point_tag>::type Point;
|
||||
typedef typename Get_type<R_, Orientation_tag>::type result_type;
|
||||
typedef typename Get_functor<R_, Compute_point_cartesian_coordinate_tag>::type CC;
|
||||
typedef Adapter_4<Base_, R_> Adapter;
|
||||
template<class Iter> result_type operator()(Iter f, Iter CGAL_assertion_code(e))const{
|
||||
CC c(this->kernel());
|
||||
Point const& A=*f;
|
||||
Point const& B=*++f;
|
||||
Point const& C=*++f;
|
||||
Point const& D=*++f;
|
||||
Point const& E=*++f;
|
||||
CGAL_assertion(++f==e);
|
||||
typedef typename Adapter::Point_4 P;
|
||||
return typename internal::Static_filters_predicates::Orientation_4<Adapter>()(P(this->kernel(),c,A),P(this->kernel(),c,B),P(this->kernel(),c,C),
|
||||
P(this->kernel(),c,D),P(this->kernel(),c,E));
|
||||
}
|
||||
};
|
||||
|
||||
template <class Base_,class R_> struct Adapter_5 {
|
||||
typedef typename Get_type<R_, Orientation_tag>::type Orientation;
|
||||
typedef typename Get_type<R_, Oriented_side_tag>::type Oriented_side;
|
||||
typedef typename Get_type<R_, Point_tag>::type Point;
|
||||
typedef typename Get_functor<R_, Compute_point_cartesian_coordinate_tag>::type CC;
|
||||
typedef typename Get_functor<Base_, Orientation_of_points_tag>::type Orientation_base;
|
||||
struct Point_5 {
|
||||
R_ const&r; CC const&c; Point const& p;
|
||||
Point_5(R_ const&r_, CC const&c_, Point const&p_):r(r_),c(c_),p(p_){}
|
||||
decltype(auto) c0()const{return c(p,0);}
|
||||
decltype(auto) c1()const{return c(p,1);}
|
||||
decltype(auto) c2()const{return c(p,2);}
|
||||
decltype(auto) c3()const{return c(p,3);}
|
||||
decltype(auto) c4()const{return c(p,4);}
|
||||
};
|
||||
struct Orientation_5 {
|
||||
typedef typename Get_type<R_, Orientation_tag>::type result_type;
|
||||
auto operator()(Point_5 const&A, Point_5 const&B, Point_5 const&C,
|
||||
Point_5 const&D, Point_5 const&E, Point_5 const&F)const{
|
||||
Point const* t[6]={&A.p,&B.p,&C.p,&D.p,&E.p,&F.p};
|
||||
return Orientation_base(A.r)(make_transforming_iterator<Dereference_functor>(t+0),make_transforming_iterator<Dereference_functor>(t+6));
|
||||
}
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
template <class Base_,class R_> struct Orientation_of_points_5 : private Store_kernel<R_> {
|
||||
CGAL_FUNCTOR_INIT_STORE(Orientation_of_points_5)
|
||||
typedef typename Get_type<R_, Point_tag>::type Point;
|
||||
typedef typename Get_type<R_, Orientation_tag>::type result_type;
|
||||
typedef typename Get_functor<R_, Compute_point_cartesian_coordinate_tag>::type CC;
|
||||
typedef Adapter_5<Base_, R_> Adapter;
|
||||
template<class Iter> result_type operator()(Iter f, Iter CGAL_assertion_code(e))const{
|
||||
CC c(this->kernel());
|
||||
Point const& A=*f;
|
||||
Point const& B=*++f;
|
||||
Point const& C=*++f;
|
||||
Point const& D=*++f;
|
||||
Point const& E=*++f;
|
||||
Point const& F=*++f;
|
||||
CGAL_assertion(++f==e);
|
||||
typedef typename Adapter::Point_5 P;
|
||||
return typename internal::Static_filters_predicates::Orientation_5<Adapter>()(P(this->kernel(),c,A),P(this->kernel(),c,B),P(this->kernel(),c,C),
|
||||
P(this->kernel(),c,D),P(this->kernel(),c,E),P(this->kernel(),c,F));
|
||||
}
|
||||
};
|
||||
|
||||
template <class Base_,class R_> struct Adapter_6 {
|
||||
typedef typename Get_type<R_, Orientation_tag>::type Orientation;
|
||||
typedef typename Get_type<R_, Oriented_side_tag>::type Oriented_side;
|
||||
typedef typename Get_type<R_, Point_tag>::type Point;
|
||||
typedef typename Get_functor<R_, Compute_point_cartesian_coordinate_tag>::type CC;
|
||||
typedef typename Get_functor<Base_, Orientation_of_points_tag>::type Orientation_base;
|
||||
struct Point_6 {
|
||||
R_ const&r; CC const&c; Point const& p;
|
||||
Point_6(R_ const&r_, CC const&c_, Point const&p_):r(r_),c(c_),p(p_){}
|
||||
decltype(auto) c0()const{return c(p,0);}
|
||||
decltype(auto) c1()const{return c(p,1);}
|
||||
decltype(auto) c2()const{return c(p,2);}
|
||||
decltype(auto) c3()const{return c(p,3);}
|
||||
decltype(auto) c4()const{return c(p,4);}
|
||||
decltype(auto) c5()const{return c(p,5);}
|
||||
};
|
||||
struct Orientation_6 {
|
||||
typedef typename Get_type<R_, Orientation_tag>::type result_type;
|
||||
auto operator()(Point_6 const&A, Point_6 const&B, Point_6 const&C,
|
||||
Point_6 const&D, Point_6 const&E, Point_6 const&F, Point_6 const&G)const{
|
||||
Point const* t[7]={&A.p,&B.p,&C.p,&D.p,&E.p,&F.p,&G.p};
|
||||
return Orientation_base(A.r)(make_transforming_iterator<Dereference_functor>(t+0),make_transforming_iterator<Dereference_functor>(t+7));
|
||||
}
|
||||
};
|
||||
};
|
||||
template <class Base_,class R_> struct Orientation_of_points_6 : private Store_kernel<R_> {
|
||||
CGAL_FUNCTOR_INIT_STORE(Orientation_of_points_6)
|
||||
typedef typename Get_type<R_, Point_tag>::type Point;
|
||||
typedef typename Get_type<R_, Orientation_tag>::type result_type;
|
||||
typedef typename Get_functor<R_, Compute_point_cartesian_coordinate_tag>::type CC;
|
||||
typedef Adapter_6<Base_, R_> Adapter;
|
||||
template<class Iter> result_type operator()(Iter f, Iter CGAL_assertion_code(e))const{
|
||||
CC c(this->kernel());
|
||||
Point const& A=*f;
|
||||
Point const& B=*++f;
|
||||
Point const& C=*++f;
|
||||
Point const& D=*++f;
|
||||
Point const& E=*++f;
|
||||
Point const& F=*++f;
|
||||
Point const& G=*++f;
|
||||
CGAL_assertion(++f==e);
|
||||
typedef typename Adapter::Point_6 P;
|
||||
return typename internal::Static_filters_predicates::Orientation_6<Adapter>()(P(this->kernel(),c,A),P(this->kernel(),c,B),P(this->kernel(),c,C),
|
||||
P(this->kernel(),c,D),P(this->kernel(),c,E),P(this->kernel(),c,F),
|
||||
P(this->kernel(),c,G));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
} // namespace SFA
|
||||
|
||||
template <class Dim_ /* should be implicit */, class R_, class Derived_=Default>
|
||||
|
|
@ -194,5 +341,44 @@ struct Cartesian_static_filters<Dimension_tag<3>, R_, Derived_> : public R_ {
|
|||
typedef SFA::Side_of_oriented_sphere_3<R_,Derived> type;
|
||||
};
|
||||
};
|
||||
|
||||
#ifndef CGAL_NO_STATIC_FILTER_456
|
||||
|
||||
template <class R_, class Derived_>
|
||||
struct Cartesian_static_filters<Dimension_tag<4>, R_, Derived_> : public R_ {
|
||||
constexpr Cartesian_static_filters(){}
|
||||
constexpr Cartesian_static_filters(int d):R_(d){}
|
||||
typedef Cartesian_static_filters<Dimension_tag<4>, R_, Derived_> Self;
|
||||
typedef typename Default::Get<Derived_,Self>::type Derived;
|
||||
template <class T, class=void> struct Functor : Inherit_functor<R_, T> {};
|
||||
template <class D> struct Functor <Orientation_of_points_tag,D> {
|
||||
typedef SFA::Orientation_of_points_4<R_,Derived> type;
|
||||
};
|
||||
};
|
||||
|
||||
template <class R_, class Derived_>
|
||||
struct Cartesian_static_filters<Dimension_tag<5>, R_, Derived_> : public R_ {
|
||||
constexpr Cartesian_static_filters(){}
|
||||
constexpr Cartesian_static_filters(int d):R_(d){}
|
||||
typedef Cartesian_static_filters<Dimension_tag<5>, R_, Derived_> Self;
|
||||
typedef typename Default::Get<Derived_,Self>::type Derived;
|
||||
template <class T, class=void> struct Functor : Inherit_functor<R_, T> {};
|
||||
template <class D> struct Functor <Orientation_of_points_tag,D> {
|
||||
typedef SFA::Orientation_of_points_5<R_,Derived> type;
|
||||
};
|
||||
};
|
||||
|
||||
template <class R_, class Derived_>
|
||||
struct Cartesian_static_filters<Dimension_tag<6>, R_, Derived_> : public R_ {
|
||||
constexpr Cartesian_static_filters(){}
|
||||
constexpr Cartesian_static_filters(int d):R_(d){}
|
||||
typedef Cartesian_static_filters<Dimension_tag<6>, R_, Derived_> Self;
|
||||
typedef typename Default::Get<Derived_,Self>::type Derived;
|
||||
template <class T, class=void> struct Functor : Inherit_functor<R_, T> {};
|
||||
template <class D> struct Functor <Orientation_of_points_tag,D> {
|
||||
typedef SFA::Orientation_of_points_6<R_,Derived> type;
|
||||
};
|
||||
};
|
||||
#endif
|
||||
} // namespace CGAL
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -137,6 +137,12 @@ public:
|
|||
|
||||
friend auto operator!=(Point_d const&p, Point_d const&q) { return !(p==q); }
|
||||
|
||||
// May be accidentally inherited from the base class otherwise
|
||||
friend auto operator< (Point_d const&p, Point_d const&q) = delete;
|
||||
friend auto operator> (Point_d const&p, Point_d const&q) = delete;
|
||||
friend auto operator<=(Point_d const&p, Point_d const&q) = delete;
|
||||
friend auto operator>=(Point_d const&p, Point_d const&q) = delete;
|
||||
|
||||
friend std::ostream& operator <<(std::ostream& os, const Point_d& p)
|
||||
{
|
||||
auto b = p.cartesian_begin();
|
||||
|
|
|
|||
|
|
@ -130,6 +130,19 @@ public:
|
|||
return SLBase()(rep());
|
||||
}
|
||||
|
||||
friend auto operator==(Vector_d const&p, Vector_d const&q) {
|
||||
typedef typename Get_functor<Kbase, Equal_vectors_tag>::type EPBase;
|
||||
return EPBase()(p.rep(), q.rep());
|
||||
}
|
||||
|
||||
friend auto operator!=(Vector_d const&p, Vector_d const&q) { return !(p==q); }
|
||||
|
||||
// May be accidentally inherited from the base class otherwise
|
||||
friend auto operator< (Vector_d const&p, Vector_d const&q) = delete;
|
||||
friend auto operator> (Vector_d const&p, Vector_d const&q) = delete;
|
||||
friend auto operator<=(Vector_d const&p, Vector_d const&q) = delete;
|
||||
friend auto operator>=(Vector_d const&p, Vector_d const&q) = delete;
|
||||
|
||||
friend std::ostream& operator <<(std::ostream& os, const Vector_d& v)
|
||||
{
|
||||
auto b = v.cartesian_begin();
|
||||
|
|
|
|||
|
|
@ -1279,6 +1279,36 @@ template<class R_> struct Equal_points : private Store_kernel<R_> {
|
|||
|
||||
CGAL_KD_DEFAULT_FUNCTOR(Equal_points_tag,(CartesianDKernelFunctors::Equal_points<K>),(),(Construct_ttag<Point_cartesian_const_iterator_tag>));
|
||||
|
||||
namespace CartesianDKernelFunctors {
|
||||
template<class R_> struct Equal_vectors : private Store_kernel<R_> {
|
||||
CGAL_FUNCTOR_INIT_STORE(Equal_vectors)
|
||||
typedef R_ R;
|
||||
typedef typename Get_type<R, Bool_tag>::type result_type;
|
||||
typedef typename Get_functor<R, Construct_ttag<Vector_cartesian_const_iterator_tag> >::type CI;
|
||||
// TODO: This is_exact thing should be reengineered.
|
||||
// the goal is to have a way to tell: don't filter this
|
||||
typedef typename CGAL::Uses_no_arithmetic<CI> Uses_no_arithmetic;
|
||||
|
||||
template<class V,class W>
|
||||
result_type operator()(V const&a, W const&b)const{
|
||||
CI c(this->kernel());
|
||||
|
||||
|
||||
auto a_begin=c(a,Begin_tag());
|
||||
auto b_begin=c(b,Begin_tag());
|
||||
auto a_end=c(a,End_tag());
|
||||
|
||||
result_type res = true;
|
||||
// Is using CGAL::possibly for Uncertain really an optimization?
|
||||
do res = res & (*a_begin++ == *b_begin++);
|
||||
while(a_begin!=a_end && possibly(res));
|
||||
return res;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
CGAL_KD_DEFAULT_FUNCTOR(Equal_vectors_tag,(CartesianDKernelFunctors::Equal_vectors<K>),(),(Construct_ttag<Vector_cartesian_const_iterator_tag>));
|
||||
|
||||
namespace CartesianDKernelFunctors {
|
||||
template<class R_> struct Oriented_side : private Store_kernel<R_> {
|
||||
CGAL_FUNCTOR_INIT_STORE(Oriented_side)
|
||||
|
|
|
|||
|
|
@ -282,6 +282,7 @@ namespace CGAL {
|
|||
CGAL_DECL_PREDICATE(Less_lexicographically);
|
||||
CGAL_DECL_PREDICATE(Less_or_equal_lexicographically);
|
||||
CGAL_DECL_PREDICATE(Equal_points);
|
||||
CGAL_DECL_PREDICATE(Equal_vectors);
|
||||
CGAL_DECL_PREDICATE(Has_on_positive_side);
|
||||
CGAL_DECL_PREDICATE_(Orientation); // duplicate with the type
|
||||
CGAL_DECL_PREDICATE_(Oriented_side); // duplicate with the type
|
||||
|
|
|
|||
|
|
@ -0,0 +1,254 @@
|
|||
// Copyright (c) 2025
|
||||
// INRIA Saclay-Ile de France (France)
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org)
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
|
||||
//
|
||||
// Author(s) : Andreas Fabri
|
||||
|
||||
// Files needed as input for the static filter generator
|
||||
|
||||
#if 0
|
||||
|
||||
double determinant(
|
||||
double a00, double a01, double a02, double a03,
|
||||
double a10, double a11, double a12, double a13,
|
||||
double a20, double a21, double a22, double a23,
|
||||
double a30, double a31, double a32, double a33)
|
||||
{
|
||||
double m01 = a10*a01 - a00*a11;
|
||||
double m02 = a20*a01 - a00*a21;
|
||||
double m03 = a30*a01 - a00*a31;
|
||||
double m12 = a20*a11 - a10*a21;
|
||||
double m13 = a30*a11 - a10*a31;
|
||||
double m23 = a30*a21 - a20*a31;
|
||||
|
||||
double m012 = m12*a02 - m02*a12 + m01*a22;
|
||||
double m013 = m13*a02 - m03*a12 + m01*a32;
|
||||
double m023 = m23*a02 - m03*a22 + m02*a32;
|
||||
double m123 = m23*a12 - m13*a22 + m12*a32;
|
||||
|
||||
double m0123 = m123*a03 - m023*a13 + m013*a23 - m012*a33;
|
||||
return m0123;
|
||||
}
|
||||
|
||||
int orientationC4(double p0, double p1, double p2, double p3,
|
||||
double q0, double q1, double q2, double q3,
|
||||
double r0, double r1, double r2, double r3,
|
||||
double s0, double s1, double s2, double s3,
|
||||
double t0, double t1, double t2, double t3)
|
||||
group p0 q0 r0 t0 q0;
|
||||
group p1 q1 r1 t1 q1;
|
||||
group p2 q2 r2 t2 q2;
|
||||
group p3 q3 r3 t3 q3;
|
||||
{
|
||||
|
||||
double m01;
|
||||
m01 = (q0 - p0);
|
||||
double m02;
|
||||
m02 = (r0 - p0);
|
||||
double m03;
|
||||
m03 = (s0 - p0);
|
||||
double m04;
|
||||
m04 = (t0 - p0);
|
||||
|
||||
double m11;
|
||||
m11 = (q1 - p1);
|
||||
double m12;
|
||||
m12 = (r1 - p1);
|
||||
double m13;
|
||||
m13 = (s1 - p1);
|
||||
double m14;
|
||||
m14 = (t1 - p1);
|
||||
|
||||
double m21;
|
||||
m21 = (q2 - p2);
|
||||
double m22;
|
||||
m22 = (r2 - p2);
|
||||
double m23;
|
||||
m23 = (s2 - p2);
|
||||
double m24;
|
||||
m24 = (t2 - p2);
|
||||
|
||||
double m31;
|
||||
m31 = (q3 - p3);
|
||||
double m32;
|
||||
m32 = (r3 - p3);
|
||||
double m33;
|
||||
m33 = (s3 - p3);
|
||||
double m34;
|
||||
m34 = (t3 - p3);
|
||||
|
||||
double det = determinant(m01, m02, m03, m04,
|
||||
m11, m12, m13, m14,
|
||||
m21, m22, m23, m24,
|
||||
m31, m32, m33, m34);
|
||||
return sign(det);
|
||||
|
||||
|
||||
}
|
||||
|
||||
//===========generated ==================
|
||||
|
||||
inline int orientationC4( double p0, double p1, double p2, double p3, double q0, double q1, double q2, double q3, double r0, double r1, double r2, double r3, double s0, double s1, double s2, double s3, double t0, double t1, double t2, double t3) {
|
||||
double m01;
|
||||
m01 = (q0 - p0);
|
||||
double m02;
|
||||
m02 = (r0 - p0);
|
||||
double m03;
|
||||
m03 = (s0 - p0);
|
||||
double m04;
|
||||
m04 = (t0 - p0);
|
||||
double m11;
|
||||
m11 = (q1 - p1);
|
||||
double m12;
|
||||
m12 = (r1 - p1);
|
||||
double m13;
|
||||
m13 = (s1 - p1);
|
||||
double m14;
|
||||
m14 = (t1 - p1);
|
||||
double m21;
|
||||
m21 = (q2 - p2);
|
||||
double m22;
|
||||
m22 = (r2 - p2);
|
||||
double m23;
|
||||
m23 = (s2 - p2);
|
||||
double m24;
|
||||
m24 = (t2 - p2);
|
||||
double m31;
|
||||
m31 = (q3 - p3);
|
||||
double m32;
|
||||
m32 = (r3 - p3);
|
||||
double m33;
|
||||
m33 = (s3 - p3);
|
||||
double m34;
|
||||
m34 = (t3 - p3);
|
||||
double det;
|
||||
det = determinant( m01, m02, m03, m04, m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34 );
|
||||
int int_tmp_result;
|
||||
double eps;
|
||||
double max1 = CGAL::abs(m01);
|
||||
double am = CGAL::abs(m02);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m03);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m11);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m12);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m13);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m23);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
|
||||
|
||||
double max2 = CGAL::abs(m01);
|
||||
am = CGAL::abs(m02);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m11);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m12);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m21);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m22);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m23);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m33);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
|
||||
|
||||
double max3 = CGAL::abs(m04);
|
||||
am = CGAL::abs(m14);
|
||||
if( (max3 < am) ) { max3 = am; }
|
||||
am = CGAL::abs(m24);
|
||||
if( (max3 < am) ) { max3 = am; }
|
||||
am = CGAL::abs(m34);
|
||||
if( (max3 < am) ) { max3 = am; }
|
||||
|
||||
|
||||
double max4 = CGAL::abs(m11);
|
||||
am = CGAL::abs(m12);
|
||||
if( (max4 < am) ) { max4 = am; }
|
||||
am = CGAL::abs(m21);
|
||||
if( (max4 < am) ) { max4 = am; }
|
||||
am = CGAL::abs(m22);
|
||||
if( (max4 < am) ) { max4 = am; }
|
||||
am = CGAL::abs(m31);
|
||||
if( (max4 < am) ) { max4 = am; }
|
||||
am = CGAL::abs(m32);
|
||||
if( (max4 < am) ) { max4 = am; }
|
||||
|
||||
|
||||
double lower_bound_1;
|
||||
double upper_bound_1;
|
||||
lower_bound_1 = max1;
|
||||
upper_bound_1 = max1;
|
||||
if( (max2 < lower_bound_1) )
|
||||
{
|
||||
lower_bound_1 = max2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (max2 > upper_bound_1) )
|
||||
{
|
||||
upper_bound_1 = max2;
|
||||
}
|
||||
}
|
||||
if( (max3 < lower_bound_1) )
|
||||
{
|
||||
lower_bound_1 = max3;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (max3 > upper_bound_1) )
|
||||
{
|
||||
upper_bound_1 = max3;
|
||||
}
|
||||
}
|
||||
if( (max4 < lower_bound_1) )
|
||||
{
|
||||
lower_bound_1 = max4;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (max4 > upper_bound_1) )
|
||||
{
|
||||
upper_bound_1 = max4;
|
||||
}
|
||||
}
|
||||
if( (lower_bound_1 < 2.89273249588395272840e-74) )
|
||||
{
|
||||
return FPG_UNCERTAIN_VALUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (upper_bound_1 > 7.23700557733225900010e+75) )
|
||||
{
|
||||
return FPG_UNCERTAIN_VALUE;
|
||||
}
|
||||
eps = (3.17768858673611327578e-14 * (((max4 * max2) * max1) * max3));
|
||||
if( (det > eps) )
|
||||
{
|
||||
int_tmp_result = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (det < -eps) )
|
||||
{
|
||||
int_tmp_result = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FPG_UNCERTAIN_VALUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return int_tmp_result;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,345 @@
|
|||
// Copyright (c) 2025
|
||||
// INRIA Saclay-Ile de France (France)
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org)
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
|
||||
//
|
||||
// Author(s) : Andreas Fabri
|
||||
|
||||
// Files needed as input for the static filter generator
|
||||
|
||||
#if 0
|
||||
|
||||
double
|
||||
determinant(
|
||||
double a00, double a01, double a02, double a03, double a04,
|
||||
double a10, double a11, double a12, double a13, double a14,
|
||||
double a20, double a21, double a22, double a23, double a24,
|
||||
double a30, double a31, double a32, double a33, double a34,
|
||||
double a40, double a41, double a42, double a43, double a44)
|
||||
{
|
||||
double m01 = a10*a01 - a00*a11;
|
||||
double m02 = a20*a01 - a00*a21;
|
||||
double m03 = a30*a01 - a00*a31;
|
||||
double m04 = a40*a01 - a00*a41;
|
||||
double m12 = a20*a11 - a10*a21;
|
||||
double m13 = a30*a11 - a10*a31;
|
||||
double m14 = a40*a11 - a10*a41;
|
||||
double m23 = a30*a21 - a20*a31;
|
||||
double m24 = a40*a21 - a20*a41;
|
||||
double m34 = a40*a31 - a30*a41;
|
||||
double m012 = m12*a02 - m02*a12 + m01*a22;
|
||||
double m013 = m13*a02 - m03*a12 + m01*a32;
|
||||
double m014 = m14*a02 - m04*a12 + m01*a42;
|
||||
double m023 = m23*a02 - m03*a22 + m02*a32;
|
||||
double m024 = m24*a02 - m04*a22 + m02*a42;
|
||||
double m034 = m34*a02 - m04*a32 + m03*a42;
|
||||
double m123 = m23*a12 - m13*a22 + m12*a32;
|
||||
double m124 = m24*a12 - m14*a22 + m12*a42;
|
||||
double m134 = m34*a12 - m14*a32 + m13*a42;
|
||||
double m234 = m34*a22 - m24*a32 + m23*a42;
|
||||
double m0123 = m123*a03 - m023*a13 + m013*a23 - m012*a33;
|
||||
double m0124 = m124*a03 - m024*a13 + m014*a23 - m012*a43;
|
||||
double m0134 = m134*a03 - m034*a13 + m014*a33 - m013*a43;
|
||||
double m0234 = m234*a03 - m034*a23 + m024*a33 - m023*a43;
|
||||
double m1234 = m234*a13 - m134*a23 + m124*a33 - m123*a43;
|
||||
double m01234 = m1234*a04 - m0234*a14 + m0134*a24 - m0124*a34 + m0123*a44;
|
||||
return m01234;
|
||||
}
|
||||
|
||||
int orientationC5(double p0, double p1, double p2, double p3, double p4,
|
||||
double q0, double q1, double q2, double q3, double q4,
|
||||
double r0, double r1, double r2, double r3, double r4,
|
||||
double s0, double s1, double s2, double s3, double s4,
|
||||
double t0, double t1, double t2, double t3, double t4,
|
||||
double u0, double u1, double u2, double u3, double u4)
|
||||
group p0 q0 r0 t0 q0 u0;
|
||||
group p1 q1 r1 t1 q1 u1;
|
||||
group p2 q2 r2 t2 q2 u2;
|
||||
group p3 q3 r3 t3 q3 u3;
|
||||
group p4 q4 r4 t4 q4 u4;
|
||||
{
|
||||
double m01;
|
||||
m01 = (q0 - p0);
|
||||
double m02;
|
||||
m02 = (r0 - p0);
|
||||
double m03;
|
||||
m03 = (s0 - p0);
|
||||
double m04;
|
||||
m04 = (t0 - p0);
|
||||
double m05;
|
||||
m05 = (u0 - p0);
|
||||
|
||||
double m11;
|
||||
m11 = (q1 - p1);
|
||||
double m12;
|
||||
m12 = (r1 - p1);
|
||||
double m13;
|
||||
m13 = (s1 - p1);
|
||||
double m14;
|
||||
m14 = (t1 - p1);
|
||||
double m15;
|
||||
m15 = (u1 - p1);
|
||||
|
||||
double m21;
|
||||
m21 = (q2 - p2);
|
||||
double m22;
|
||||
m22 = (r2 - p2);
|
||||
double m23;
|
||||
m23 = (s2 - p2);
|
||||
double m24;
|
||||
m24 = (t2 - p2);
|
||||
double m25;
|
||||
m25 = (u2 - p2);
|
||||
|
||||
double m31;
|
||||
m31 = (q3 - p3);
|
||||
double m32;
|
||||
m32 = (r3 - p3);
|
||||
double m33;
|
||||
m33 = (s3 - p3);
|
||||
double m34;
|
||||
m34 = (t3 - p3);
|
||||
double m35;
|
||||
m35 = (u3 - p3);
|
||||
|
||||
double m41;
|
||||
m41 = (q4 - p4);
|
||||
double m42;
|
||||
m42 = (r4 - p4);
|
||||
double m43;
|
||||
m43 = (s4 - p4);
|
||||
double m44;
|
||||
m44 = (t4 - p4);
|
||||
double m45;
|
||||
m45 = (u4 - p4);
|
||||
|
||||
double det = determinant(m01, m02, m03, m04, m05,
|
||||
m11, m12, m13, m14, m15,
|
||||
m21, m22, m23, m24, m25,
|
||||
m31, m32, m33, m34, m35,
|
||||
m41, m42, m43, m44, m45);
|
||||
return sign(det);
|
||||
}
|
||||
|
||||
//===========generated ==================
|
||||
|
||||
inline int orientationC5( double p0, double p1, double p2, double p3, double p4, double q0, double q1, double q2, double q3, double q4, double r0, double r1, double r2, double r3, double r4, double s0, double s1, double s2, double s3, double s4, double t0, double t1, double t2, double t3, double t4, double u0, double u1, double u2, double u3, double u4) {
|
||||
double m01;
|
||||
m01 = (q0 - p0);
|
||||
double m02;
|
||||
m02 = (r0 - p0);
|
||||
double m03;
|
||||
m03 = (s0 - p0);
|
||||
double m04;
|
||||
m04 = (t0 - p0);
|
||||
double m05;
|
||||
m05 = (u0 - p0);
|
||||
double m11;
|
||||
m11 = (q1 - p1);
|
||||
double m12;
|
||||
m12 = (r1 - p1);
|
||||
double m13;
|
||||
m13 = (s1 - p1);
|
||||
double m14;
|
||||
m14 = (t1 - p1);
|
||||
double m15;
|
||||
m15 = (u1 - p1);
|
||||
double m21;
|
||||
m21 = (q2 - p2);
|
||||
double m22;
|
||||
m22 = (r2 - p2);
|
||||
double m23;
|
||||
m23 = (s2 - p2);
|
||||
double m24;
|
||||
m24 = (t2 - p2);
|
||||
double m25;
|
||||
m25 = (u2 - p2);
|
||||
double m31;
|
||||
m31 = (q3 - p3);
|
||||
double m32;
|
||||
m32 = (r3 - p3);
|
||||
double m33;
|
||||
m33 = (s3 - p3);
|
||||
double m34;
|
||||
m34 = (t3 - p3);
|
||||
double m35;
|
||||
m35 = (u3 - p3);
|
||||
double m41;
|
||||
m41 = (q4 - p4);
|
||||
double m42;
|
||||
m42 = (r4 - p4);
|
||||
double m43;
|
||||
m43 = (s4 - p4);
|
||||
double m44;
|
||||
m44 = (t4 - p4);
|
||||
double m45;
|
||||
m45 = (u4 - p4);
|
||||
double det;
|
||||
det = determinant( m01, m02, m03, m04, m05, m11, m12, m13, m14, m15, m21, m22, m23, m24, m25, m31, m32, m33, m34, m35, m41, m42, m43, m44, m45 );
|
||||
int int_tmp_result;
|
||||
double eps;
|
||||
double max1 = CGAL::abs(m01);
|
||||
double am = CGAL::abs(m02);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m03);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m11);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m12);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m13);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m21);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m22);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m23);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m33);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
|
||||
|
||||
double max2 = CGAL::abs(m01);
|
||||
am = CGAL::abs(m02);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m11);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m12);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m21);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m22);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m23);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m31);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m32);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m33);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m43);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
|
||||
|
||||
double max3 = CGAL::abs(m04);
|
||||
am = CGAL::abs(m14);
|
||||
if( (max3 < am) ) { max3 = am; }
|
||||
am = CGAL::abs(m24);
|
||||
if( (max3 < am) ) { max3 = am; }
|
||||
am = CGAL::abs(m34);
|
||||
if( (max3 < am) ) { max3 = am; }
|
||||
am = CGAL::abs(m44);
|
||||
if( (max3 < am) ) { max3 = am; }
|
||||
|
||||
|
||||
double max4 = CGAL::abs(m05);
|
||||
am = CGAL::abs(m15);
|
||||
if( (max4 < am) ) { max4 = am; }
|
||||
am = CGAL::abs(m25);
|
||||
if( (max4 < am) ) { max4 = am; }
|
||||
am = CGAL::abs(m35);
|
||||
if( (max4 < am) ) { max4 = am; }
|
||||
am = CGAL::abs(m45);
|
||||
if( (max4 < am) ) { max4 = am; }
|
||||
|
||||
|
||||
double max5 = CGAL::abs(m11);
|
||||
am = CGAL::abs(m12);
|
||||
if( (max5 < am) ) { max5 = am; }
|
||||
am = CGAL::abs(m21);
|
||||
if( (max5 < am) ) { max5 = am; }
|
||||
am = CGAL::abs(m22);
|
||||
if( (max5 < am) ) { max5 = am; }
|
||||
am = CGAL::abs(m31);
|
||||
if( (max5 < am) ) { max5 = am; }
|
||||
am = CGAL::abs(m32);
|
||||
if( (max5 < am) ) { max5 = am; }
|
||||
am = CGAL::abs(m41);
|
||||
if( (max5 < am) ) { max5 = am; }
|
||||
am = CGAL::abs(m42);
|
||||
if( (max5 < am) ) { max5 = am; }
|
||||
|
||||
double lower_bound_1;
|
||||
double upper_bound_1;
|
||||
lower_bound_1 = max5;
|
||||
upper_bound_1 = max5;
|
||||
if( (max1 < lower_bound_1) )
|
||||
{
|
||||
lower_bound_1 = max1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (max1 > upper_bound_1) )
|
||||
{
|
||||
upper_bound_1 = max1;
|
||||
}
|
||||
}
|
||||
if( (max2 < lower_bound_1) )
|
||||
{
|
||||
lower_bound_1 = max2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (max2 > upper_bound_1) )
|
||||
{
|
||||
upper_bound_1 = max2;
|
||||
}
|
||||
}
|
||||
if( (max3 < lower_bound_1) )
|
||||
{
|
||||
lower_bound_1 = max3;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (max3 > upper_bound_1) )
|
||||
{
|
||||
upper_bound_1 = max3;
|
||||
}
|
||||
}
|
||||
if( (max4 < lower_bound_1) )
|
||||
{
|
||||
lower_bound_1 = max4;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (max4 > upper_bound_1) )
|
||||
{
|
||||
upper_bound_1 = max4;
|
||||
}
|
||||
}
|
||||
if( (lower_bound_1 < 9.99657131447050328602e-60) )
|
||||
{
|
||||
return FPG_UNCERTAIN_VALUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (upper_bound_1 > 3.21387608851797912384e+60) )
|
||||
{
|
||||
return FPG_UNCERTAIN_VALUE;
|
||||
}
|
||||
eps = (2.22889232457534740153e-13 * ((((max5 * max2) * max1) * max3) * max4));
|
||||
if( (det > eps) )
|
||||
{
|
||||
int_tmp_result = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (det < -eps) )
|
||||
{
|
||||
int_tmp_result = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FPG_UNCERTAIN_VALUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return int_tmp_result;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -0,0 +1,477 @@
|
|||
// Copyright (c) 2025
|
||||
// INRIA Saclay-Ile de France (France)
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org)
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: LGPL-3.0-or-later OR LicenseRef-Commercial
|
||||
//
|
||||
// Author(s) : Andreas Fabri
|
||||
|
||||
// Files needed as input for the static filter generator
|
||||
|
||||
#if 0
|
||||
double
|
||||
determinant(
|
||||
double a00, double a01, double a02, double a03, double a04, double a05,
|
||||
double a10, double a11, double a12, double a13, double a14, double a15,
|
||||
double a20, double a21, double a22, double a23, double a24, double a25,
|
||||
double a30, double a31, double a32, double a33, double a34, double a35,
|
||||
double a40, double a41, double a42, double a43, double a44, double a45,
|
||||
double a50, double a51, double a52, double a53, double a54, double a55)
|
||||
{
|
||||
double m01 = a00*a11 - a10*a01;
|
||||
double m02 = a00*a21 - a20*a01;
|
||||
double m03 = a00*a31 - a30*a01;
|
||||
double m04 = a00*a41 - a40*a01;
|
||||
double m05 = a00*a51 - a50*a01;
|
||||
double m12 = a10*a21 - a20*a11;
|
||||
double m13 = a10*a31 - a30*a11;
|
||||
double m14 = a10*a41 - a40*a11;
|
||||
double m15 = a10*a51 - a50*a11;
|
||||
double m23 = a20*a31 - a30*a21;
|
||||
double m24 = a20*a41 - a40*a21;
|
||||
double m25 = a20*a51 - a50*a21;
|
||||
double m34 = a30*a41 - a40*a31;
|
||||
double m35 = a30*a51 - a50*a31;
|
||||
double m45 = a40*a51 - a50*a41;
|
||||
|
||||
double m012 = m01*a22 - m02*a12 + m12*a02;
|
||||
double m013 = m01*a32 - m03*a12 + m13*a02;
|
||||
double m014 = m01*a42 - m04*a12 + m14*a02;
|
||||
double m015 = m01*a52 - m05*a12 + m15*a02;
|
||||
double m023 = m02*a32 - m03*a22 + m23*a02;
|
||||
double m024 = m02*a42 - m04*a22 + m24*a02;
|
||||
double m025 = m02*a52 - m05*a22 + m25*a02;
|
||||
double m034 = m03*a42 - m04*a32 + m34*a02;
|
||||
double m035 = m03*a52 - m05*a32 + m35*a02;
|
||||
double m045 = m04*a52 - m05*a42 + m45*a02;
|
||||
double m123 = m12*a32 - m13*a22 + m23*a12;
|
||||
double m124 = m12*a42 - m14*a22 + m24*a12;
|
||||
double m125 = m12*a52 - m15*a22 + m25*a12;
|
||||
double m134 = m13*a42 - m14*a32 + m34*a12;
|
||||
double m135 = m13*a52 - m15*a32 + m35*a12;
|
||||
double m145 = m14*a52 - m15*a42 + m45*a12;
|
||||
double m234 = m23*a42 - m24*a32 + m34*a22;
|
||||
double m235 = m23*a52 - m25*a32 + m35*a22;
|
||||
double m245 = m24*a52 - m25*a42 + m45*a22;
|
||||
double m345 = m34*a52 - m35*a42 + m45*a32;
|
||||
|
||||
double m0123 = m012*a33 - m013*a23 + m023*a13 - m123*a03;
|
||||
double m0124 = m012*a43 - m014*a23 + m024*a13 - m124*a03;
|
||||
double m0125 = m012*a53 - m015*a23 + m025*a13 - m125*a03;
|
||||
double m0134 = m013*a43 - m014*a33 + m034*a13 - m134*a03;
|
||||
double m0135 = m013*a53 - m015*a33 + m035*a13 - m135*a03;
|
||||
double m0145 = m014*a53 - m015*a43 + m045*a13 - m145*a03;
|
||||
double m0234 = m023*a43 - m024*a33 + m034*a23 - m234*a03;
|
||||
double m0235 = m023*a53 - m025*a33 + m035*a23 - m235*a03;
|
||||
double m0245 = m024*a53 - m025*a43 + m045*a23 - m245*a03;
|
||||
double m0345 = m034*a53 - m035*a43 + m045*a33 - m345*a03;
|
||||
double m1234 = m123*a43 - m124*a33 + m134*a23 - m234*a13;
|
||||
double m1235 = m123*a53 - m125*a33 + m135*a23 - m235*a13;
|
||||
double m1245 = m124*a53 - m125*a43 + m145*a23 - m245*a13;
|
||||
double m1345 = m134*a53 - m135*a43 + m145*a33 - m345*a13;
|
||||
double m2345 = m234*a53 - m235*a43 + m245*a33 - m345*a23;
|
||||
|
||||
double m01234 = m0123*a44 - m0124*a34 + m0134*a24 - m0234*a14 + m1234*a04;
|
||||
double m01235 = m0123*a54 - m0125*a34 + m0135*a24 - m0235*a14 + m1235*a04;
|
||||
double m01245 = m0124*a54 - m0125*a44 + m0145*a24 - m0245*a14 + m1245*a04;
|
||||
double m01345 = m0134*a54 - m0135*a44 + m0145*a34 - m0345*a14 + m1345*a04;
|
||||
double m02345 = m0234*a54 - m0235*a44 + m0245*a34 - m0345*a24 + m2345*a04;
|
||||
double m12345 = m1234*a54 - m1235*a44 + m1245*a34 - m1345*a24 + m2345*a14;
|
||||
|
||||
double m012345 = m01234*a55 - m01235*a45 + m01245*a35 - m01345*a25
|
||||
+ m02345*a15 - m12345*a05;
|
||||
return m012345;
|
||||
}
|
||||
|
||||
int orientationC6(double p0, double p1, double p2, double p3, double p4, double p5,
|
||||
double q0, double q1, double q2, double q3, double q4, double q5,
|
||||
double r0, double r1, double r2, double r3, double r4, double r5,
|
||||
double s0, double s1, double s2, double s3, double s4, double s5,
|
||||
double t0, double t1, double t2, double t3, double t4, double t5,
|
||||
double u0, double u1, double u2, double u3, double u4, double u5,
|
||||
double v0, double v1, double v2, double v3, double v4, double v5)
|
||||
group p0 q0 r0 t0 q0 u0 v0;
|
||||
group p1 q1 r1 t1 q1 u1 v1;
|
||||
group p2 q2 r2 t2 q2 u2 v2;
|
||||
group p3 q3 r3 t3 q3 u3 v3;
|
||||
group p4 q4 r4 t4 q4 u4 v4;
|
||||
group p5 q5 r5 t5 q5 u5 v5;
|
||||
{
|
||||
double m01;
|
||||
m01 = (q0 - p0);
|
||||
double m02;
|
||||
m02 = (r0 - p0);
|
||||
double m03;
|
||||
m03 = (s0 - p0);
|
||||
double m04;
|
||||
m04 = (t0 - p0);
|
||||
double m05;
|
||||
m05 = (u0 - p0);
|
||||
double m06;
|
||||
m06 = (v0 - p0);
|
||||
|
||||
double m11;
|
||||
m11 = (q1 - p1);
|
||||
double m12;
|
||||
m12 = (r1 - p1);
|
||||
double m13;
|
||||
m13 = (s1 - p1);
|
||||
double m14;
|
||||
m14 = (t1 - p1);
|
||||
double m15;
|
||||
m15 = (u1 - p1);
|
||||
double m16;
|
||||
m16 = (v1 - p1);
|
||||
|
||||
double m21;
|
||||
m21 = (q2 - p2);
|
||||
double m22;
|
||||
m22 = (r2 - p2);
|
||||
double m23;
|
||||
m23 = (s2 - p2);
|
||||
double m24;
|
||||
m24 = (t2 - p2);
|
||||
double m25;
|
||||
m25 = (u2 - p2);
|
||||
double m26;
|
||||
m26 = (v2 - p2);
|
||||
|
||||
double m31;
|
||||
m31 = (q3 - p3);
|
||||
double m32;
|
||||
m32 = (r3 - p3);
|
||||
double m33;
|
||||
m33 = (s3 - p3);
|
||||
double m34;
|
||||
m34 = (t3 - p3);
|
||||
double m35;
|
||||
m35 = (u3 - p3);
|
||||
double m36;
|
||||
m36 = (v3 - p3);
|
||||
|
||||
double m41;
|
||||
m41 = (q4 - p4);
|
||||
double m42;
|
||||
m42 = (r4 - p4);
|
||||
double m43;
|
||||
m43 = (s4 - p4);
|
||||
double m44;
|
||||
m44 = (t4 - p4);
|
||||
double m45;
|
||||
m45 = (u4 - p4);
|
||||
double m46;
|
||||
m46 = (v4 - p4);
|
||||
|
||||
double m51;
|
||||
m51 = (q5 - p5);
|
||||
double m52;
|
||||
m52 = (r5 - p5);
|
||||
double m53;
|
||||
m53 = (s5 - p5);
|
||||
double m54;
|
||||
m54 = (t5 - p5);
|
||||
double m55;
|
||||
m55 = (u5 - p5);
|
||||
double m56;
|
||||
m56 = (v5 - p5);
|
||||
|
||||
double det = determinant(m01, m02, m03, m04, m05, m06,
|
||||
m11, m12, m13, m14, m15, m16,
|
||||
m21, m22, m23, m24, m25, m26,
|
||||
m31, m32, m33, m34, m35, m36,
|
||||
m41, m42, m43, m44, m45, m46,
|
||||
m51, m52, m53, m54, m55, m56);
|
||||
return sign(det);
|
||||
}
|
||||
|
||||
//===========generated ==================
|
||||
|
||||
inline int orientationC6( double p0, double p1, double p2, double p3, double p4, double p5, double q0, double q1, double q2, double q3, double q4, double q5, double r0, double r1, double r2, double r3, double r4, double r5, double s0, double s1, double s2, double s3, double s4, double s5, double t0, double t1, double t2, double t3, double t4, double t5, double u0, double u1, double u2, double u3, double u4, double u5, double v0, double v1, double v2, double v3, double v4, double v5) {
|
||||
double m01;
|
||||
m01 = (q0 - p0);
|
||||
double m02;
|
||||
m02 = (r0 - p0);
|
||||
double m03;
|
||||
m03 = (s0 - p0);
|
||||
double m04;
|
||||
m04 = (t0 - p0);
|
||||
double m05;
|
||||
m05 = (u0 - p0);
|
||||
double m06;
|
||||
m06 = (v0 - p0);
|
||||
double m11;
|
||||
m11 = (q1 - p1);
|
||||
double m12;
|
||||
m12 = (r1 - p1);
|
||||
double m13;
|
||||
m13 = (s1 - p1);
|
||||
double m14;
|
||||
m14 = (t1 - p1);
|
||||
double m15;
|
||||
m15 = (u1 - p1);
|
||||
double m16;
|
||||
m16 = (v1 - p1);
|
||||
double m21;
|
||||
m21 = (q2 - p2);
|
||||
double m22;
|
||||
m22 = (r2 - p2);
|
||||
double m23;
|
||||
m23 = (s2 - p2);
|
||||
double m24;
|
||||
m24 = (t2 - p2);
|
||||
double m25;
|
||||
m25 = (u2 - p2);
|
||||
double m26;
|
||||
m26 = (v2 - p2);
|
||||
double m31;
|
||||
m31 = (q3 - p3);
|
||||
double m32;
|
||||
m32 = (r3 - p3);
|
||||
double m33;
|
||||
m33 = (s3 - p3);
|
||||
double m34;
|
||||
m34 = (t3 - p3);
|
||||
double m35;
|
||||
m35 = (u3 - p3);
|
||||
double m36;
|
||||
m36 = (v3 - p3);
|
||||
double m41;
|
||||
m41 = (q4 - p4);
|
||||
double m42;
|
||||
m42 = (r4 - p4);
|
||||
double m43;
|
||||
m43 = (s4 - p4);
|
||||
double m44;
|
||||
m44 = (t4 - p4);
|
||||
double m45;
|
||||
m45 = (u4 - p4);
|
||||
double m46;
|
||||
m46 = (v4 - p4);
|
||||
double m51;
|
||||
m51 = (q5 - p5);
|
||||
double m52;
|
||||
m52 = (r5 - p5);
|
||||
double m53;
|
||||
m53 = (s5 - p5);
|
||||
double m54;
|
||||
m54 = (t5 - p5);
|
||||
double m55;
|
||||
m55 = (u5 - p5);
|
||||
double m56;
|
||||
m56 = (v5 - p5);
|
||||
double det;
|
||||
det = determinant( m01, m02, m03, m04, m05, m06, m11, m12, m13, m14, m15, m16, m21, m22, m23, m24, m25, m26, m31, m32, m33, m34, m35, m36, m41, m42, m43, m44, m45, m46, m51, m52, m53, m54, m55, m56 );
|
||||
int int_tmp_result;
|
||||
double eps;
|
||||
double max1 = CGAL::abs(m01);
|
||||
double am = CGAL::abs(m02);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m11);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m12);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m21);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m22);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m31);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m32);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m41);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
am = CGAL::abs(m42);
|
||||
if( (max1 < am) ) { max1 = am; }
|
||||
|
||||
|
||||
double max2 = CGAL::abs(m03);
|
||||
am = CGAL::abs(m11);
|
||||
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m12);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m13);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m21);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m22);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m23);
|
||||
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m31);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m32);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m33);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m41);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m42);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m43);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m51);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
am = CGAL::abs(m52);
|
||||
if( (max2 < am) ) { max2 = am; }
|
||||
|
||||
|
||||
double max3 = CGAL::abs(m04);
|
||||
am = CGAL::abs(m14);
|
||||
if( (max3 < am) ) { max3 = am; }
|
||||
am = CGAL::abs(m24);
|
||||
if( (max3 < am) ) { max3 = am; }
|
||||
am = CGAL::abs(m34);
|
||||
if( (max3 < am) ) { max3 = am; }
|
||||
am = CGAL::abs(m44);
|
||||
if( (max3 < am) ) { max3 = am; }
|
||||
am = CGAL::abs(m54);
|
||||
if( (max3 < am) ) { max3 = am; }
|
||||
|
||||
double max4 = CGAL::abs(m05);
|
||||
am = CGAL::abs(m15);
|
||||
if( (max4 < am) ) { max4 = am; }
|
||||
am = CGAL::abs(m25);
|
||||
if( (max4 < am) ) { max4 = am; }
|
||||
am = CGAL::abs(m35);
|
||||
if( (max4 < am) ) { max4 = am; }
|
||||
am = CGAL::abs(m45);
|
||||
if( (max4 < am) ) { max4 = am; }
|
||||
am = CGAL::abs(m55);
|
||||
if( (max4 < am) ) { max4 = am; }
|
||||
|
||||
|
||||
double max5 = CGAL::abs(m06);
|
||||
am = CGAL::abs(m16);
|
||||
if( (max5 < am) ) { max5 = am; }
|
||||
am = CGAL::abs(m26);
|
||||
if( (max5 < am) ) { max5 = am; }
|
||||
am = CGAL::abs(m36);
|
||||
if( (max5 < am) ) { max5 = am; }
|
||||
am = CGAL::abs(m46);
|
||||
if( (max5 < am) ) { max5 = am; }
|
||||
am = CGAL::abs(m56);
|
||||
if( (max5 < am) ) { max5 = am; }
|
||||
|
||||
|
||||
double max6 = CGAL::abs(m13);
|
||||
am = CGAL::abs(m21);
|
||||
if( (max6 < am) ) { max6 = am; }
|
||||
am = CGAL::abs(m22);
|
||||
if( (max6 < am) ) { max6 = am; }
|
||||
am = CGAL::abs(m23);
|
||||
if( (max6 < am) ) { max6 = am; }
|
||||
am = CGAL::abs(m31);
|
||||
if( (max6 < am) ) { max6 = am; }
|
||||
am = CGAL::abs(m32);
|
||||
if( (max6 < am) ) { max6 = am; }
|
||||
am = CGAL::abs(m33);
|
||||
if( (max6 < am) ) { max6 = am; }
|
||||
am = CGAL::abs(m41);
|
||||
if( (max6 < am) ) { max6 = am; }
|
||||
am = CGAL::abs(m42);
|
||||
if( (max6 < am) ) { max6 = am; }
|
||||
am = CGAL::abs(m43);
|
||||
if( (max6 < am) ) { max6 = am; }
|
||||
am = CGAL::abs(m51);
|
||||
if( (max6 < am) ) { max6 = am; }
|
||||
am = CGAL::abs(m52);
|
||||
if( (max6 < am) ) { max6 = am; }
|
||||
am = CGAL::abs(m53);
|
||||
if( (max6 < am) ) { max6 = am; }
|
||||
|
||||
|
||||
double lower_bound_1;
|
||||
double upper_bound_1;
|
||||
lower_bound_1 = max6;
|
||||
upper_bound_1 = max6;
|
||||
if( (max5 < lower_bound_1) )
|
||||
{
|
||||
lower_bound_1 = max5;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (max5 > upper_bound_1) )
|
||||
{
|
||||
upper_bound_1 = max5;
|
||||
}
|
||||
}
|
||||
if( (max1 < lower_bound_1) )
|
||||
{
|
||||
lower_bound_1 = max1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (max1 > upper_bound_1) )
|
||||
{
|
||||
upper_bound_1 = max1;
|
||||
}
|
||||
}
|
||||
if( (max2 < lower_bound_1) )
|
||||
{
|
||||
lower_bound_1 = max2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (max2 > upper_bound_1) )
|
||||
{
|
||||
upper_bound_1 = max2;
|
||||
}
|
||||
}
|
||||
if( (max3 < lower_bound_1) )
|
||||
{
|
||||
lower_bound_1 = max3;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (max3 > upper_bound_1) )
|
||||
{
|
||||
upper_bound_1 = max3;
|
||||
}
|
||||
}
|
||||
if( (max4 < lower_bound_1) )
|
||||
{
|
||||
lower_bound_1 = max4;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (max4 > upper_bound_1) )
|
||||
{
|
||||
upper_bound_1 = max4;
|
||||
}
|
||||
}
|
||||
if( (lower_bound_1 < 4.82472686053427214432e-50) )
|
||||
{
|
||||
return FPG_UNCERTAIN_VALUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (upper_bound_1 > 1.87072209578355511223e+50) )
|
||||
{
|
||||
return FPG_UNCERTAIN_VALUE;
|
||||
}
|
||||
eps = (1.76403842114300859158e-12 * (((((max1 * max2) * max6) * max3) * max4) * max5));
|
||||
if( (det > eps) )
|
||||
{
|
||||
int_tmp_result = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
if( (det < -eps) )
|
||||
{
|
||||
int_tmp_result = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
return FPG_UNCERTAIN_VALUE;
|
||||
}
|
||||
}
|
||||
}
|
||||
return int_tmp_result;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
@ -277,6 +277,7 @@ void test2(){
|
|||
P x4=cp(0,0);
|
||||
P x5=cp(0,-1);
|
||||
P tab2[]={x1,x2,x3,x4};
|
||||
assert(x1==x1 && x1!=x2);
|
||||
assert(dp(x1,x2)[1]==2);
|
||||
assert(po(tab2+0,tab2+3)==CGAL::COUNTERCLOCKWISE);
|
||||
assert(sos(tab2+0,tab2+3,x4)==CGAL::ON_POSITIVE_SIDE);
|
||||
|
|
@ -285,6 +286,7 @@ void test2(){
|
|||
assert(y1.squared_length()==2);
|
||||
assert(sl(y1)==2);
|
||||
V y2=cv(3,-3);
|
||||
assert(y1==y1 && y1!=y2);
|
||||
assert(spr(y1,y2)==6);
|
||||
assert(dv(y2,y1)[0]==2);
|
||||
V tab3[]={y1,y2};
|
||||
|
|
|
|||
|
|
@ -1312,7 +1312,7 @@ OutputIterator
|
|||
adjacent_vertices(Vertex_handle v, OutputIterator vertices) const;
|
||||
|
||||
/*!
|
||||
Returns the degree of a vertex, that is, the number of adjacent vertices.
|
||||
Returns the degree of `v`, that is, the number of adjacent vertices.
|
||||
\pre `v` \f$ \neq\f$ `Vertex_handle()`, `t`.`is_vertex(v)`.
|
||||
*/
|
||||
size_type degree(Vertex_handle v) const;
|
||||
|
|
|
|||
|
|
@ -547,91 +547,6 @@ bool read_LAS(const std::string& fname, OutputIterator output, const CGAL_NP_CLA
|
|||
|
||||
} // namespace IO
|
||||
|
||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
using IO::make_las_point_reader;
|
||||
namespace LAS_property = IO::LAS_property;
|
||||
|
||||
template <typename OutputIteratorValueType,
|
||||
typename OutputIterator,
|
||||
typename PointMap >
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_las_points(), please update your code")
|
||||
bool read_las_points(std::istream& is, ///< input stream.
|
||||
OutputIterator output, ///< output iterator over points.
|
||||
PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3.
|
||||
{
|
||||
return read_las_points<OutputIteratorValueType>(is, output, CGAL::parameters::point_map (point_map));
|
||||
}
|
||||
|
||||
template <typename OutputIterator,
|
||||
typename PointMap >
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_las_points(), please update your code")
|
||||
bool read_las_points(std::istream& is, ///< input stream.
|
||||
OutputIterator output, ///< output iterator over points.
|
||||
PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3.
|
||||
{
|
||||
return read_las_points<typename value_type_traits<OutputIterator>::type>(is, output,
|
||||
CGAL::parameters::point_map(point_map));
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
|
||||
|
||||
template <typename OutputIteratorValueType,
|
||||
typename OutputIterator,
|
||||
typename ... PropertyHandler>
|
||||
CGAL_DEPRECATED bool read_las_points_with_properties(std::istream& is,
|
||||
OutputIterator output,
|
||||
PropertyHandler&& ... properties)
|
||||
{
|
||||
return IO::read_LAS_with_properties(is, output, std::forward<PropertyHandler>(properties)...);
|
||||
}
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
template <typename OutputIterator,
|
||||
typename ... PropertyHandler>
|
||||
CGAL_DEPRECATED bool read_las_points_with_properties(std::istream& is,
|
||||
OutputIterator output,
|
||||
PropertyHandler&& ... properties)
|
||||
{
|
||||
return IO::read_LAS_with_properties<typename value_type_traits<OutputIterator>::type>(is, output, std::forward<PropertyHandler>(properties)...);
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
|
||||
template <typename OutputIteratorValueType,
|
||||
typename OutputIterator,
|
||||
typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
CGAL_DEPRECATED bool read_las_points(std::istream& is,
|
||||
OutputIterator output,
|
||||
const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
using parameters::choose_parameter;
|
||||
using parameters::get_parameter;
|
||||
|
||||
typename CGAL::GetPointMap<Point_set_processing_3::Fake_point_range<OutputIteratorValueType>, CGAL_NP_CLASS>::type point_map =
|
||||
choose_parameter<typename CGAL::GetPointMap<Point_set_processing_3::Fake_point_range<OutputIteratorValueType>, CGAL_NP_CLASS>::type>(get_parameter(np, internal_np::point_map));
|
||||
|
||||
return IO::read_LAS(is, output, make_las_point_reader(point_map));
|
||||
}
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
|
||||
// variant with default output iterator value type
|
||||
template <typename OutputIterator, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
CGAL_DEPRECATED bool read_las_points(std::istream& is, OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
return IO::read_LAS<typename value_type_traits<OutputIterator>::type>(is, output, np);
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
|
||||
#endif // CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
} // namespace CGAL
|
||||
|
||||
#endif // CGAL_POINT_SET_PROCESSING_READ_LAS_POINTS_H
|
||||
|
|
|
|||
|
|
@ -271,174 +271,6 @@ bool read_OFF(const std::string& fname, OutputIterator output, const CGAL_NP_CLA
|
|||
|
||||
} // namespace IO
|
||||
|
||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
template <typename OutputIteratorValueType,
|
||||
typename OutputIterator,
|
||||
typename PointPMap,
|
||||
typename NormalPMap,
|
||||
typename Kernel>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points_and_normals(), please update your code")
|
||||
bool read_off_points_and_normals(std::istream& is, ///< input stream.
|
||||
OutputIterator output, ///< output iterator over points.
|
||||
PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
|
||||
NormalPMap normal_map, ///< property map: value_type of OutputIterator -> Vector_3.
|
||||
const Kernel& /*kernel*/) ///< geometric traits.
|
||||
{
|
||||
return IO::read_OFF<OutputIteratorValueType>(is, output,
|
||||
parameters::point_map(point_map)
|
||||
.normal_map(normal_map)
|
||||
.geom_traits(Kernel()));
|
||||
}
|
||||
|
||||
template <typename OutputIterator,
|
||||
typename PointPMap,
|
||||
typename NormalPMap,
|
||||
typename Kernel>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points_and_normals(), please update your code")
|
||||
bool read_off_points_and_normals(std::istream& is, ///< input stream.
|
||||
OutputIterator output, ///< output iterator over points.
|
||||
PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
|
||||
NormalPMap normal_map, ///< property map: value_type of OutputIterator -> Vector_3.
|
||||
const Kernel& kernel) ///< geometric traits.
|
||||
{
|
||||
return IO::read_OFF<typename value_type_traits<OutputIterator>::type>(is, output,
|
||||
parameters::point_map(point_map)
|
||||
.normal_map(normal_map)
|
||||
.geom_traits(kernel));
|
||||
}
|
||||
|
||||
template <typename OutputIteratorValueType,
|
||||
typename OutputIterator,
|
||||
typename PointPMap,
|
||||
typename NormalPMap>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points_and_normals(), please update your code")
|
||||
bool read_off_points_and_normals(std::istream& is, ///< input stream.
|
||||
OutputIterator output, ///< output iterator over points.
|
||||
PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
|
||||
NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
|
||||
{
|
||||
return IO::read_OFF<OutputIteratorValueType>(is, output, parameters::point_map(point_map)
|
||||
.normal_map(normal_map));
|
||||
}
|
||||
|
||||
template <typename OutputIterator,
|
||||
typename PointPMap,
|
||||
typename NormalPMap>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points_and_normals(), please update your code")
|
||||
bool read_off_points_and_normals(std::istream& is, ///< input stream.
|
||||
OutputIterator output, ///< output iterator over points.
|
||||
PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
|
||||
NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
|
||||
{
|
||||
return IO::read_OFF<typename value_type_traits<OutputIterator>::type>(is, output,
|
||||
parameters::point_map(point_map)
|
||||
.normal_map(normal_map));
|
||||
}
|
||||
|
||||
template <typename OutputIteratorValueType,
|
||||
typename OutputIterator,
|
||||
typename NormalPMap>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points_and_normals(), please update your code")
|
||||
bool read_off_points_and_normals(std::istream& is, ///< input stream.
|
||||
OutputIterator output, ///< output iterator over points.
|
||||
NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
|
||||
{
|
||||
return IO::read_OFF<OutputIteratorValueType>(is, output, parameters::normal_map(normal_map));
|
||||
}
|
||||
|
||||
template <typename OutputIterator,
|
||||
typename NormalPMap>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points_and_normals(), please update your code")
|
||||
bool read_off_points_and_normals(std::istream& is, ///< input stream.
|
||||
OutputIterator output, ///< output iterator over points.
|
||||
NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
|
||||
{
|
||||
return IO::read_OFF<typename value_type_traits<OutputIterator>::type>(is, output, parameters::normal_map(normal_map));
|
||||
}
|
||||
|
||||
template <typename OutputIteratorValueType,
|
||||
typename OutputIterator,
|
||||
typename PointPMap,
|
||||
typename Kernel
|
||||
>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points(), please update your code")
|
||||
bool read_off_points(std::istream& is, ///< input stream.
|
||||
OutputIterator output, ///< output iterator over points.
|
||||
PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
|
||||
const Kernel& kernel) ///< geometric traits.
|
||||
{
|
||||
return read_off_points<OutputIteratorValueType>(is, output, parameters::point_map(point_map)
|
||||
.geom_traits(kernel));
|
||||
}
|
||||
|
||||
template <typename OutputIterator,
|
||||
typename PointPMap,
|
||||
typename Kernel>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points(), please update your code")
|
||||
bool read_off_points(std::istream& is, ///< input stream.
|
||||
OutputIterator output, ///< output iterator over points.
|
||||
PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
|
||||
const Kernel& kernel) ///< geometric traits.
|
||||
{
|
||||
return read_off_points<typename value_type_traits<OutputIterator>::type>(is, output,
|
||||
parameters::point_map(point_map)
|
||||
.geom_traits (kernel));
|
||||
}
|
||||
|
||||
template <typename OutputIteratorValueType,
|
||||
typename OutputIterator,
|
||||
typename PointPMap>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points(), please update your code")
|
||||
bool read_off_points(std::istream& is, ///< input stream.
|
||||
OutputIterator output, ///< output iterator over points.
|
||||
PointPMap point_map) ///< property map: value_type of OutputIterator -> Point_3.
|
||||
{
|
||||
return read_off_points<OutputIteratorValueType>(is, output, parameters::point_map (point_map));
|
||||
}
|
||||
|
||||
template <typename OutputIterator, typename PointPMap>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_off_points(), please update your code")
|
||||
bool read_off_points(std::istream& is, ///< input stream.
|
||||
OutputIterator output, ///< output iterator over points.
|
||||
PointPMap point_map) ///< property map: value_type of OutputIterator -> Point_3.
|
||||
{
|
||||
return read_off_points<typename value_type_traits<OutputIterator>::type>(is, output, parameters::point_map(point_map));
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
|
||||
template <typename OutputIteratorValueType,
|
||||
typename OutputIterator,
|
||||
typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
CGAL_DEPRECATED bool read_off_points(std::istream& is,
|
||||
OutputIterator output,
|
||||
const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
return IO::read_OFF(is, output, np);
|
||||
}
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
template <typename OutputIteratorValueType, typename OutputIterator>
|
||||
CGAL_DEPRECATED bool read_off_points(std::istream& is, OutputIterator output)
|
||||
{
|
||||
return IO::read_OFF(is, output);
|
||||
}
|
||||
|
||||
// variant with default output iterator value type
|
||||
template <typename OutputIterator, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
CGAL_DEPRECATED bool read_off_points(std::istream& is, OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
return IO::read_OFF(is, output, np);
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
|
||||
#endif //CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
} // namespace CGAL
|
||||
|
||||
#endif // CGAL_POINT_SET_PROCESSING_READ_OFF_POINTS_H
|
||||
|
|
|
|||
|
|
@ -358,114 +358,6 @@ bool read_PLY(const std::string& fname, OutputIterator output, const CGAL_NP_CLA
|
|||
|
||||
} // namespace IO
|
||||
|
||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
template <typename OutputIteratorValueType,
|
||||
typename OutputIterator,
|
||||
typename PointMap,
|
||||
typename NormalMap>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_ply_points_and_normals(), please update your code")
|
||||
bool read_ply_points_and_normals(std::istream& is, ///< input stream.
|
||||
OutputIterator output, ///< output iterator over points.
|
||||
PointMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
|
||||
NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
|
||||
{
|
||||
return IO::read_PLY<OutputIteratorValueType>(is, output, parameters::point_map(point_map)
|
||||
.normal_map(normal_map));
|
||||
}
|
||||
|
||||
template <typename OutputIterator,
|
||||
typename PointMap,
|
||||
typename NormalMap>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_ply_points_and_normals(), please update your code")
|
||||
bool read_ply_points_and_normals(std::istream& is, ///< input stream.
|
||||
OutputIterator output, ///< output iterator over points.
|
||||
PointMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
|
||||
NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
|
||||
{
|
||||
return IO::read_PLY<typename value_type_traits<OutputIterator>::type>(is, output, parameters::point_map(point_map)
|
||||
.normal_map(normal_map));
|
||||
}
|
||||
|
||||
template <typename OutputIteratorValueType,
|
||||
typename OutputIterator,
|
||||
typename NormalMap>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_ply_points_and_normals(), please update your code")
|
||||
bool read_ply_points_and_normals(std::istream& is, ///< input stream.
|
||||
OutputIterator output, ///< output iterator over points.
|
||||
NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
|
||||
{
|
||||
return IO::read_PLY<OutputIteratorValueType>(is, output, parameters::normal_map(normal_map));
|
||||
}
|
||||
|
||||
template <typename OutputIterator, typename NormalMap>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_ply_points_and_normals(), please update your code")
|
||||
bool read_ply_points_and_normals(std::istream& is, ///< input stream.
|
||||
OutputIterator output, ///< output iterator over points.
|
||||
NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
|
||||
{
|
||||
return IO::read_PLY<typename value_type_traits<OutputIterator>::type>(is, output, parameters::normal_map(normal_map));
|
||||
}
|
||||
|
||||
template <typename OutputIteratorValueType,
|
||||
typename OutputIterator,
|
||||
typename PointMap>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_ply_points(), please update your code")
|
||||
bool read_ply_points(std::istream& is, ///< input stream.
|
||||
OutputIterator output, ///< output iterator over points.
|
||||
PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3.
|
||||
{
|
||||
return IO::read_PLY<OutputIteratorValueType>(is, output, parameters::point_map(point_map));
|
||||
}
|
||||
|
||||
template <typename OutputIterator,
|
||||
typename PointMap>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_ply_points(), please update your code")
|
||||
bool read_ply_points(std::istream& is, ///< input stream.
|
||||
OutputIterator output, ///< output iterator over points.
|
||||
PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3.
|
||||
{
|
||||
return IO::read_PLY<typename value_type_traits<OutputIterator>::type>(is, output, parameters::point_map(point_map));
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
|
||||
template <typename OutputIteratorValueType, typename OutputIterator, typename ... PropertyHandler>
|
||||
CGAL_DEPRECATED bool read_ply_points_with_properties(std::istream& is, OutputIterator output, PropertyHandler&& ... properties)
|
||||
{
|
||||
return IO::read_PLY_with_properties(is, output, std::forward<PropertyHandler>(properties)...);
|
||||
}
|
||||
|
||||
|
||||
template <typename OutputIteratorValueType, typename OutputIterator, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
CGAL_DEPRECATED bool read_ply_points(std::istream& is, OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
return IO::read_PLY(is, output, np);
|
||||
}
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
template <typename OutputIterator,
|
||||
typename ... PropertyHandler>
|
||||
CGAL_DEPRECATED bool read_ply_points_with_properties(std::istream& is, OutputIterator output, PropertyHandler&& ... properties)
|
||||
{
|
||||
return IO::read_PLY_with_properties<typename value_type_traits<OutputIterator>::type>(is, output, std::forward<PropertyHandler>(properties)...);
|
||||
}
|
||||
|
||||
// variant with default output iterator value type
|
||||
template <typename OutputIterator,
|
||||
typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
CGAL_DEPRECATED bool read_ply_points(std::istream& is, OutputIterator output, const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
return IO::read_PLY<typename value_type_traits<OutputIterator>::type>(is, output, np);
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
|
||||
#endif // CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
} // namespace CGAL
|
||||
|
||||
#undef TRY_TO_GENERATE_POINT_PROPERTY
|
||||
|
|
|
|||
|
|
@ -251,173 +251,6 @@ bool read_XYZ(const std::string& fname, OutputIterator output, const CGAL_NP_CLA
|
|||
|
||||
|
||||
|
||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
template <typename OutputIteratorValueType,
|
||||
typename OutputIterator,
|
||||
typename PointPMap,
|
||||
typename NormalPMap,
|
||||
typename Kernel>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points_and_normals(), please update your code")
|
||||
bool read_xyz_points_and_normals(std::istream& is, ///< input stream.
|
||||
OutputIterator output, ///< output iterator over points.
|
||||
PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
|
||||
NormalPMap normal_map, ///< property map: value_type of OutputIterator -> Vector_3.
|
||||
const Kernel& /*kernel*/) ///< geometric traits.
|
||||
{
|
||||
return IO::read_XYZ<OutputIteratorValueType>(is, output,
|
||||
parameters::point_map(point_map)
|
||||
.normal_map(normal_map)
|
||||
.geom_traits(Kernel()));
|
||||
}
|
||||
|
||||
template <typename OutputIterator,
|
||||
typename PointPMap,
|
||||
typename NormalPMap,
|
||||
typename Kernel>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points_and_normals(), please update your code")
|
||||
bool read_xyz_points_and_normals(std::istream& is, ///< input stream.
|
||||
OutputIterator output, ///< output iterator over points.
|
||||
PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
|
||||
NormalPMap normal_map, ///< property map: value_type of OutputIterator -> Vector_3.
|
||||
const Kernel& kernel) ///< geometric traits.
|
||||
{
|
||||
return IO::read_XYZ<typename value_type_traits<OutputIterator>::type>(is, output,
|
||||
parameters::point_map(point_map)
|
||||
.normal_map(normal_map)
|
||||
.geom_traits(kernel));
|
||||
}
|
||||
|
||||
template <typename OutputIteratorValueType,
|
||||
typename OutputIterator,
|
||||
typename PointPMap,
|
||||
typename NormalPMap>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points_and_normals(), please update your code")
|
||||
bool read_xyz_points_and_normals(std::istream& is, ///< input stream.
|
||||
OutputIterator output, ///< output iterator over points.
|
||||
PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
|
||||
NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
|
||||
{
|
||||
return IO::read_XYZ<OutputIteratorValueType>(is, output,
|
||||
parameters::point_map(point_map)
|
||||
.normal_map(normal_map));
|
||||
}
|
||||
|
||||
template <typename OutputIterator,
|
||||
typename PointPMap,
|
||||
typename NormalPMap>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points_and_normals(), please update your code")
|
||||
bool read_xyz_points_and_normals(std::istream& is, ///< input stream.
|
||||
OutputIterator output, ///< output iterator over points.
|
||||
PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
|
||||
NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
|
||||
{
|
||||
return IO::read_XYZ<typename value_type_traits<OutputIterator>::type>(is, output,
|
||||
parameters::point_map(point_map)
|
||||
.normal_map(normal_map));
|
||||
}
|
||||
|
||||
template <typename OutputIteratorValueType,
|
||||
typename OutputIterator,
|
||||
typename NormalPMap>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points_and_normals(), please update your code")
|
||||
bool read_xyz_points_and_normals(std::istream& is, ///< input stream.
|
||||
OutputIterator output, ///< output iterator over points.
|
||||
NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
|
||||
{
|
||||
return IO::read_XYZ<OutputIteratorValueType>(is, output, parameters::normal_map(normal_map));
|
||||
}
|
||||
|
||||
template <typename OutputIterator,
|
||||
typename NormalPMap>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points_and_normals(), please update your code")
|
||||
bool read_xyz_points_and_normals(std::istream& is, ///< input stream.
|
||||
OutputIterator output, ///< output iterator over points.
|
||||
NormalPMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
|
||||
{
|
||||
return IO::read_XYZ<typename value_type_traits<OutputIterator>::type>(is, output,
|
||||
parameters::normal_map(normal_map));
|
||||
}
|
||||
|
||||
template <typename OutputIteratorValueType,
|
||||
typename OutputIterator,
|
||||
typename PointPMap,
|
||||
typename Kernel>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points(), please update your code")
|
||||
bool read_xyz_points(std::istream& is, ///< input stream.
|
||||
OutputIterator output, ///< output iterator over points.
|
||||
PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
|
||||
const Kernel& kernel) ///< geometric traits.
|
||||
{
|
||||
return IO::read_XYZ<OutputIteratorValueType>(is, output,
|
||||
parameters::point_map(point_map)
|
||||
.geom_traits(kernel));
|
||||
}
|
||||
|
||||
template <typename OutputIterator,
|
||||
typename PointPMap,
|
||||
typename Kernel>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points(), please update your code")
|
||||
bool read_xyz_points(std::istream& is, ///< input stream.
|
||||
OutputIterator output, ///< output iterator over points.
|
||||
PointPMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
|
||||
const Kernel& kernel) ///< geometric traits.
|
||||
{
|
||||
return IO::read_XYZ<typename value_type_traits<OutputIterator>::type>(is, output,
|
||||
parameters::point_map(point_map)
|
||||
.geom_traits(kernel));
|
||||
}
|
||||
|
||||
template <typename OutputIteratorValueType,
|
||||
typename OutputIterator,
|
||||
typename PointPMap>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points(), please update your code")
|
||||
bool read_xyz_points(std::istream& is, ///< input stream.
|
||||
OutputIterator output, ///< output iterator over points.
|
||||
PointPMap point_map) ///< property map: value_type of OutputIterator -> Point_3.
|
||||
{
|
||||
return IO::read_XYZ<OutputIteratorValueType>(is, output, parameters::point_map(point_map));
|
||||
}
|
||||
|
||||
template <typename OutputIterator,
|
||||
typename PointPMap>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::read_xyz_points(), please update your code")
|
||||
bool read_xyz_points(std::istream& is, ///< input stream.
|
||||
OutputIterator output, ///< output iterator over points.
|
||||
PointPMap point_map) ///< property map: value_type of OutputIterator -> Point_3.
|
||||
{
|
||||
return IO::read_XYZ<typename value_type_traits<OutputIterator>::type>(is, output,
|
||||
parameters::point_map(point_map));
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
|
||||
|
||||
template <typename OutputIteratorValueType,
|
||||
typename OutputIterator,
|
||||
typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
CGAL_DEPRECATED bool read_xyz_points(std::istream& is,
|
||||
OutputIterator output,
|
||||
const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
return IO::read_XYZ(is, output, np);
|
||||
}
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
template <typename OutputIterator,
|
||||
typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
CGAL_DEPRECATED bool read_xyz_points(std::istream& is,
|
||||
OutputIterator output,
|
||||
const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
return IO::read_XYZ<typename value_type_traits<OutputIterator>::type>(is, output, np);
|
||||
}
|
||||
/// \endcond
|
||||
|
||||
#endif //CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
} // namespace CGAL
|
||||
|
||||
#endif // CGAL_POINT_SET_PROCESSING_READ_XYZ_POINTS_H
|
||||
|
|
|
|||
|
|
@ -379,59 +379,6 @@ bool write_LAS(const std::string& filename,
|
|||
|
||||
} // namespace IO
|
||||
|
||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
using IO::make_las_point_writer;
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
template <typename ForwardIterator,
|
||||
typename PointMap>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_las_points(), please update your code")
|
||||
bool write_las_points(std::ostream& os, ///< output stream.
|
||||
ForwardIterator first, ///< first input point.
|
||||
ForwardIterator beyond, ///< past-the-end input point.
|
||||
PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3.
|
||||
{
|
||||
CGAL::Iterator_range<ForwardIterator> points (first, beyond);
|
||||
return IO::write_LAS(os, points, parameters::point_map(point_map));
|
||||
}
|
||||
|
||||
template <typename ForwardIterator>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_las_points(), please update your code")
|
||||
bool write_las_points(std::ostream& os, ///< output stream.
|
||||
ForwardIterator first, ///< first input point.
|
||||
ForwardIterator beyond) ///< past-the-end input point.
|
||||
{
|
||||
CGAL::Iterator_range<ForwardIterator> points (first, beyond);
|
||||
return IO::write_LAS(os, points);
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
|
||||
template <typename PointRange,
|
||||
typename PointMap,
|
||||
typename ... PropertyHandler>
|
||||
CGAL_DEPRECATED bool write_las_points_with_properties(std::ostream& os,
|
||||
const PointRange& points,
|
||||
std::tuple<PointMap,
|
||||
IO::LAS_property::X,
|
||||
IO::LAS_property::Y,
|
||||
IO::LAS_property::Z> point_property,
|
||||
PropertyHandler&& ... properties)
|
||||
{
|
||||
return IO::write_LAS_with_properties(os, points, point_property, std::forward<PropertyHandler>(properties)...);
|
||||
}
|
||||
|
||||
|
||||
template <typename PointRange, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
bool write_las_points(std::ostream& os, const PointRange& points, const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
return IO::write_LAS(os, points, np);
|
||||
}
|
||||
|
||||
#endif //CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
} // namespace CGAL
|
||||
|
||||
#endif // CGAL_POINT_SET_PROCESSING_WRITE_LAS_POINTS_H
|
||||
|
|
|
|||
|
|
@ -198,107 +198,6 @@ bool write_OFF(const std::string& filename,
|
|||
|
||||
} // IO namespace
|
||||
|
||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
template <typename ForwardIterator,
|
||||
typename PointMap,
|
||||
typename NormalMap,
|
||||
typename Kernel>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_off_points_and_normals(), please update your code")
|
||||
bool write_off_points_and_normals(std::ostream& os, ///< output stream.
|
||||
ForwardIterator first, ///< iterator over the first input point.
|
||||
ForwardIterator beyond, ///< past-the-end iterator over the input points.
|
||||
PointMap point_map, ///< property map: value_type of ForwardIterator -> Point_3.
|
||||
NormalMap normal_map, ///< property map: value_type of ForwardIterator -> Vector_3.
|
||||
const Kernel& /*kernel*/) ///< geometric traits.
|
||||
{
|
||||
CGAL::Iterator_range<ForwardIterator> points(first, beyond);
|
||||
return write_off_points(os, points,
|
||||
CGAL::parameters::point_map(point_map)
|
||||
.normal_map(normal_map)
|
||||
.geom_traits(Kernel()));
|
||||
}
|
||||
|
||||
template <typename ForwardIterator,
|
||||
typename PointMap,
|
||||
typename NormalMap
|
||||
>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_off_points_and_normals(), please update your code")
|
||||
bool write_off_points_and_normals(std::ostream& os, ///< output stream.
|
||||
ForwardIterator first, ///< first input point.
|
||||
ForwardIterator beyond, ///< past-the-end input point.
|
||||
PointMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
|
||||
NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
|
||||
{
|
||||
CGAL::Iterator_range<ForwardIterator> points(first, beyond);
|
||||
return write_off_points(os, points,
|
||||
parameters::point_map(point_map)
|
||||
.normal_map(normal_map));
|
||||
}
|
||||
|
||||
template <typename ForwardIterator,
|
||||
typename NormalMap>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_off_points_and_normals(), please update your code")
|
||||
bool write_off_points_and_normals(std::ostream& os, ///< output stream.
|
||||
ForwardIterator first, ///< first input point.
|
||||
ForwardIterator beyond, ///< past-the-end input point.
|
||||
NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
|
||||
{
|
||||
CGAL::Iterator_range<ForwardIterator> points(first, beyond);
|
||||
return write_off_points(os, points, parameters::normal_map (normal_map));
|
||||
}
|
||||
|
||||
template <typename ForwardIterator,
|
||||
typename PointMap,
|
||||
typename Kernel>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_off_points(), please update your code")
|
||||
bool write_off_points(std::ostream& os, ///< output stream.
|
||||
ForwardIterator first, ///< iterator over the first input point.
|
||||
ForwardIterator beyond, ///< past-the-end iterator over the input points.
|
||||
PointMap point_map, ///< property map: value_type of ForwardIterator -> Point_3.
|
||||
const Kernel&) ///< geometric traits.
|
||||
{
|
||||
CGAL::Iterator_range<ForwardIterator> points(first, beyond);
|
||||
return write_off_points(os, points,
|
||||
parameters::point_map(point_map)
|
||||
.geom_traits(Kernel()));
|
||||
}
|
||||
|
||||
template <typename ForwardIterator,
|
||||
typename PointMap>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_off_points(), please update your code")
|
||||
bool write_off_points(std::ostream& os, ///< output stream.
|
||||
ForwardIterator first, ///< first input point.
|
||||
ForwardIterator beyond, ///< past-the-end input point.
|
||||
PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3.
|
||||
{
|
||||
CGAL::Iterator_range<ForwardIterator> points(first, beyond);
|
||||
return write_off_points(os, points, parameters::point_map (point_map));
|
||||
}
|
||||
|
||||
template <typename ForwardIterator
|
||||
>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_off_points(), please update your code")
|
||||
bool write_off_points(std::ostream& os, ///< output stream.
|
||||
ForwardIterator first, ///< first input point.
|
||||
ForwardIterator beyond) ///< past-the-end input point.
|
||||
{
|
||||
CGAL::Iterator_range<ForwardIterator> points(first, beyond);
|
||||
return write_off_points(os, points);
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
|
||||
template <typename PointRange, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
CGAL_DEPRECATED bool write_off_points(std::ostream& os, const PointRange& points, const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
return IO::write_OFF(os, points, np);
|
||||
}
|
||||
|
||||
#endif // CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
} // namespace CGAL
|
||||
|
||||
#endif // CGAL_POINT_SET_PROCESSING_WRITE_OFF_POINTS_H
|
||||
|
|
|
|||
|
|
@ -298,80 +298,6 @@ bool write_PLY(const std::string& filename,
|
|||
|
||||
} // namespace IO
|
||||
|
||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
template <typename ForwardIterator,
|
||||
typename PointMap,
|
||||
typename VectorMap>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_ply_points_and_normals(), please update your code")
|
||||
bool write_ply_points_and_normals(std::ostream& os, ///< output stream.
|
||||
ForwardIterator first, ///< first input point.
|
||||
ForwardIterator beyond, ///< past-the-end input point.
|
||||
PointMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
|
||||
VectorMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
|
||||
{
|
||||
CGAL::Iterator_range<ForwardIterator> points (first, beyond);
|
||||
return IO::write_PLY(os, points, parameters::point_map(point_map)
|
||||
.normal_map(normal_map));
|
||||
}
|
||||
|
||||
template <typename ForwardIterator,
|
||||
typename VectorMap>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_ply_points_and_normals(), please update your code")
|
||||
bool write_ply_points_and_normals(std::ostream& os, ///< output stream.
|
||||
ForwardIterator first, ///< first input point.
|
||||
ForwardIterator beyond, ///< past-the-end input point.
|
||||
VectorMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
|
||||
{
|
||||
CGAL::Iterator_range<ForwardIterator> points(first, beyond);
|
||||
return IO::write_PLY(os, points, parameters::normal_map (normal_map));
|
||||
}
|
||||
|
||||
template <typename ForwardIterator,
|
||||
typename PointMap >
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_ply_points(), please update your code")
|
||||
bool write_ply_points(std::ostream& os, ///< output stream.
|
||||
ForwardIterator first, ///< first input point.
|
||||
ForwardIterator beyond, ///< past-the-end input point.
|
||||
PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3.
|
||||
{
|
||||
CGAL::Iterator_range<ForwardIterator> points(first, beyond);
|
||||
return IO::write_PLY(os, points, parameters::point_map(point_map));
|
||||
}
|
||||
|
||||
template <typename ForwardIterator >
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_ply_points(), please update your code")
|
||||
bool write_ply_points(std::ostream& os, ///< output stream.
|
||||
ForwardIterator first, ///< first input point.
|
||||
ForwardIterator beyond) ///< past-the-end input point.
|
||||
{
|
||||
CGAL::Iterator_range<ForwardIterator> points (first, beyond);
|
||||
return IO::write_PLY(os, points);
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
|
||||
|
||||
template <typename PointRange,
|
||||
typename ... PropertyHandler>
|
||||
CGAL_DEPRECATED bool write_ply_points_with_properties(std::ostream& os, ///< output stream.
|
||||
const PointRange& points, ///< input point range.
|
||||
PropertyHandler&& ... properties) ///< parameter pack of property handlers
|
||||
{
|
||||
return IO::write_PLY_with_properties(os, points, std::forward<PropertyHandler>(properties)...);
|
||||
}
|
||||
|
||||
|
||||
template <typename PointRange, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
CGAL_DEPRECATED bool write_ply_points(std::ostream& os, const PointRange& points, const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
return IO::write_PLY(os, points, np);
|
||||
}
|
||||
|
||||
#endif // CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
} // namespace CGAL
|
||||
|
||||
#endif // CGAL_POINT_SET_PROCESSING_WRITE_PLY_POINTS_H
|
||||
|
|
|
|||
|
|
@ -189,106 +189,6 @@ bool write_XYZ(const std::string& filename,
|
|||
|
||||
} // namespace IO
|
||||
|
||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
/// \cond SKIP_IN_MANUAL
|
||||
|
||||
template <typename ForwardIterator,
|
||||
typename PointMap,
|
||||
typename NormalMap,
|
||||
typename Kernel>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_xyz_points_and_normals(), please update your code")
|
||||
bool write_xyz_points_and_normals(std::ostream& os, ///< output stream.
|
||||
ForwardIterator first, ///< iterator over the first input point.
|
||||
ForwardIterator beyond, ///< past-the-end iterator over the input points.
|
||||
PointMap point_map, ///< property map: value_type of ForwardIterator -> Point_3.
|
||||
NormalMap normal_map, ///< property map: value_type of ForwardIterator -> Vector_3.
|
||||
const Kernel& /*kernel*/) ///< geometric traits.
|
||||
{
|
||||
CGAL::Iterator_range<ForwardIterator> points(first, beyond);
|
||||
return IO::write_XYZ(os, points,
|
||||
parameters::point_map(point_map)
|
||||
.normal_map(normal_map)
|
||||
.geom_traits(Kernel()));
|
||||
}
|
||||
|
||||
template <typename ForwardIterator,
|
||||
typename PointMap,
|
||||
typename NormalMap>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_xyz_points_and_normals(), please update your code")
|
||||
bool write_xyz_points_and_normals(std::ostream& os, ///< output stream.
|
||||
ForwardIterator first, ///< first input point.
|
||||
ForwardIterator beyond, ///< past-the-end input point.
|
||||
PointMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
|
||||
NormalMap normal_map) ///< property map: value_type of OutputIterator -> Vector_3.
|
||||
{
|
||||
CGAL::Iterator_range<ForwardIterator> points (first, beyond);
|
||||
return IO::write_XYZ(os, points,
|
||||
parameters::point_map(point_map)
|
||||
.normal_map(normal_map));
|
||||
}
|
||||
|
||||
template <typename ForwardIterator,
|
||||
typename NormalMap
|
||||
>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_xyz_points_and_normals(), please update your code")
|
||||
bool write_xyz_points_and_normals(std::ostream& os, ///< output stream.
|
||||
ForwardIterator first, ///< first input point.
|
||||
ForwardIterator beyond, ///< past-the-end input point.
|
||||
NormalMap normal_map) ///< property map: value_type of ForwardIterator -> Vector_3.
|
||||
{
|
||||
CGAL::Iterator_range<ForwardIterator> points(first, beyond);
|
||||
return IO::write_XYZ(os, points, parameters::normal_map(normal_map));
|
||||
}
|
||||
|
||||
template <typename ForwardIterator,
|
||||
typename PointMap,
|
||||
typename Kernel>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_xyz_points(), please update your code")
|
||||
bool write_xyz_points(std::ostream& os, ///< output stream.
|
||||
ForwardIterator first, ///< first input point.
|
||||
ForwardIterator beyond, ///< past-the-end input point.
|
||||
PointMap point_map, ///< property map: value_type of OutputIterator -> Point_3.
|
||||
const Kernel& kernel)
|
||||
{
|
||||
CGAL::Iterator_range<ForwardIterator> points (first, beyond);
|
||||
return IO::write_XYZ(os, points, parameters::point_map(point_map)
|
||||
.geom_traits (kernel));
|
||||
}
|
||||
|
||||
template <typename ForwardIterator,
|
||||
typename PointMap>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_xyz_points(), please update your code")
|
||||
bool write_xyz_points(std::ostream& os, ///< output stream.
|
||||
ForwardIterator first, ///< first input point.
|
||||
ForwardIterator beyond, ///< past-the-end input point.
|
||||
PointMap point_map) ///< property map: value_type of OutputIterator -> Point_3.
|
||||
{
|
||||
CGAL::Iterator_range<ForwardIterator> points(first, beyond);
|
||||
return IO::write_XYZ(os, points, parameters::point_map(point_map));
|
||||
}
|
||||
|
||||
template <typename ForwardIterator>
|
||||
CGAL_DEPRECATED_MSG("you are using the deprecated V1 API of CGAL::write_xyz_points(), please update your code")
|
||||
bool write_xyz_points(std::ostream& os, ///< output stream.
|
||||
ForwardIterator first, ///< first input point.
|
||||
ForwardIterator beyond) ///< past-the-end input point.
|
||||
{
|
||||
CGAL::Iterator_range<ForwardIterator> points (first, beyond);
|
||||
return IO::write_XYZ(os, points);
|
||||
}
|
||||
|
||||
/// \endcond
|
||||
|
||||
|
||||
template <typename PointRange, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
CGAL_DEPRECATED bool write_xyz_points(std::ostream& os, const PointRange& points, const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
return IO::write_XYZ(os, points, np);
|
||||
}
|
||||
|
||||
#endif // CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
} // namespace CGAL
|
||||
|
||||
#endif // CGAL_POINT_SET_PROCESSING_WRITE_XYZ_POINTS_H
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ endif()
|
|||
# Executables that do *not* require Eigen
|
||||
create_single_source_cgal_program( "read_test.cpp" )
|
||||
create_single_source_cgal_program( "test_read_write_point_set.cpp" )
|
||||
create_single_source_cgal_program( "test_deprecated_io_point_set.cpp" )
|
||||
create_single_source_cgal_program( "test_poisson_eliminate.cpp" )
|
||||
create_single_source_cgal_program( "read_test_with_different_pmaps.cpp" )
|
||||
create_single_source_cgal_program( "analysis_test.cpp" )
|
||||
|
|
@ -39,7 +38,6 @@ if(NOT MSVC_VERSION OR MSVC_VERSION GREATER_EQUAL 1919 OR MSVC_VERSION LESS 1910
|
|||
include(CGAL_LASLIB_support)
|
||||
if (TARGET CGAL::LASLIB_support)
|
||||
target_link_libraries(test_read_write_point_set PRIVATE ${CGAL_libs} CGAL::LASLIB_support)
|
||||
target_link_libraries(test_deprecated_io_point_set PRIVATE ${CGAL_libs} CGAL::LASLIB_support)
|
||||
else()
|
||||
message(STATUS "NOTICE: the LAS reader test requires LASlib and will not be compiled.")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -1,241 +0,0 @@
|
|||
#include <CGAL/Installation/internal/disable_deprecation_warnings_and_errors.h>
|
||||
|
||||
#include <CGAL/Simple_cartesian.h>
|
||||
|
||||
#include <CGAL/Point_set_3.h>
|
||||
#include <CGAL/IO/read_points.h>
|
||||
#include <CGAL/IO/write_points.h>
|
||||
|
||||
// Just to try and create ambiguities
|
||||
#include <CGAL/boost/graph/io.h>
|
||||
#include <CGAL/IO/io.h>
|
||||
|
||||
#include <CGAL/property_map.h>
|
||||
|
||||
#include <vector>
|
||||
#include <cassert>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
|
||||
typedef CGAL::Simple_cartesian<double> Kernel;
|
||||
typedef Kernel::Point_3 Point_3;
|
||||
typedef Kernel::Vector_3 Vector_3;
|
||||
typedef std::array<unsigned short, 4> Color;
|
||||
typedef std::pair<Point_3, Color> PointWithColor;
|
||||
typedef CGAL::Nth_of_tuple_property_map<1, PointWithColor> Color_map;
|
||||
|
||||
struct GetRedMap
|
||||
{
|
||||
typedef PointWithColor key_type;
|
||||
typedef unsigned short value_type;
|
||||
typedef const value_type& reference;
|
||||
typedef boost::lvalue_property_map_tag category;
|
||||
};
|
||||
unsigned short get(const GetRedMap&, const PointWithColor& p)
|
||||
{
|
||||
return p.second[0];
|
||||
}
|
||||
|
||||
struct GetGreenMap
|
||||
{
|
||||
typedef PointWithColor key_type;
|
||||
typedef unsigned short value_type;
|
||||
typedef const value_type& reference;
|
||||
typedef boost::lvalue_property_map_tag category;
|
||||
};
|
||||
unsigned short get(const GetGreenMap&, const PointWithColor& p)
|
||||
{
|
||||
return p.second[1];
|
||||
}
|
||||
|
||||
struct GetBlueMap
|
||||
{
|
||||
typedef PointWithColor key_type;
|
||||
typedef unsigned short value_type;
|
||||
typedef const value_type& reference;
|
||||
typedef boost::lvalue_property_map_tag category;
|
||||
};
|
||||
unsigned short get(const GetBlueMap&, const PointWithColor& p)
|
||||
{
|
||||
return p.second[2];
|
||||
}
|
||||
|
||||
struct GetAlphaMap
|
||||
{
|
||||
typedef PointWithColor key_type;
|
||||
typedef unsigned short value_type;
|
||||
typedef const value_type& reference;
|
||||
typedef boost::lvalue_property_map_tag category;
|
||||
};
|
||||
|
||||
unsigned short get(const GetAlphaMap&, const PointWithColor& p)
|
||||
{
|
||||
return p.second[3];
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
std::vector<PointWithColor> points(3);
|
||||
points[0] = std::make_pair(Point_3(1,0,0), Color{255,0,0,255});
|
||||
points[1] = std::make_pair(Point_3(0,1,0), Color{0,255,0,255});
|
||||
points[2] = std::make_pair(Point_3(0,0,1), Color{0,0,255,255});
|
||||
|
||||
bool ok;
|
||||
std::vector<Point_3> ps;
|
||||
ps.push_back(Point_3(1,0,0));
|
||||
ps.push_back(Point_3(0,1,0));
|
||||
ps.push_back(Point_3(0,0,1));
|
||||
|
||||
std::string input;
|
||||
|
||||
//LAS
|
||||
#ifdef CGAL_LINKED_WITH_LASLIB
|
||||
|
||||
{
|
||||
std::ostringstream os(std::ios::binary);
|
||||
ok = CGAL::write_las_points_with_properties(os, points,
|
||||
CGAL::make_las_point_writer(CGAL::First_of_pair_property_map<PointWithColor>()),
|
||||
std::make_pair(GetRedMap(),CGAL::LAS_property::R()),
|
||||
std::make_pair(GetGreenMap(), CGAL::LAS_property::G()),
|
||||
std::make_pair(GetBlueMap(), CGAL::LAS_property::B()),
|
||||
std::make_pair(GetAlphaMap(), CGAL::LAS_property::I())
|
||||
);
|
||||
assert(ok);
|
||||
os.flush();
|
||||
input = os.str();
|
||||
|
||||
}
|
||||
|
||||
{
|
||||
points.clear();
|
||||
std::istringstream is(input, std::ios::binary);
|
||||
ok = CGAL::read_las_points_with_properties(is, std::back_inserter (points),
|
||||
CGAL::make_las_point_reader(CGAL::First_of_pair_property_map<PointWithColor>()),
|
||||
std::make_tuple(CGAL::Second_of_pair_property_map<PointWithColor>(),
|
||||
CGAL::Construct_array(),
|
||||
CGAL::LAS_property::R(),
|
||||
CGAL::LAS_property::G(),
|
||||
CGAL::LAS_property::B(),
|
||||
CGAL::LAS_property::I()));
|
||||
assert(ok);
|
||||
assert(points.size() == 3);
|
||||
assert(points[1].second[1] == 255);
|
||||
}
|
||||
|
||||
{
|
||||
std::ostringstream os(std::ios_base::binary);
|
||||
CGAL::write_las_points(os, ps);
|
||||
assert(ok);
|
||||
os.flush();
|
||||
input = os.str();
|
||||
}
|
||||
|
||||
{
|
||||
ps.clear();
|
||||
std::istringstream is(input, std::ios::binary);
|
||||
ok = CGAL::read_las_points(is, std::back_inserter (ps));
|
||||
assert(ok);
|
||||
assert(ps.size() == 3);
|
||||
}
|
||||
#endif
|
||||
|
||||
//PLY
|
||||
{
|
||||
std::ostringstream os;
|
||||
assert(os.good());
|
||||
ok = CGAL::write_ply_points_with_properties(os, points,
|
||||
CGAL::make_ply_point_writer (CGAL::First_of_pair_property_map<PointWithColor>()),
|
||||
std::make_pair(GetRedMap(),CGAL::PLY_property<unsigned short>("red")),
|
||||
std::make_pair(GetGreenMap(), CGAL::PLY_property<unsigned short>("green")),
|
||||
std::make_pair(GetBlueMap(), CGAL::PLY_property<unsigned short>("blue")),
|
||||
std::make_pair(GetAlphaMap(), CGAL::PLY_property<unsigned short>("alpha"))
|
||||
);
|
||||
assert(! os.fail());
|
||||
assert(ok);
|
||||
os.flush();
|
||||
input = os.str();
|
||||
}
|
||||
|
||||
{
|
||||
std::istringstream is(input);
|
||||
assert(is.good());
|
||||
points.clear();
|
||||
ok = CGAL::read_ply_points_with_properties(is, std::back_inserter (points),
|
||||
CGAL::make_ply_point_reader(CGAL::First_of_pair_property_map<PointWithColor>()),
|
||||
std::make_tuple(CGAL::Second_of_pair_property_map<PointWithColor>(),
|
||||
CGAL::Construct_array(),
|
||||
CGAL::PLY_property<unsigned short>("red"),
|
||||
CGAL::PLY_property<unsigned short>("green"),
|
||||
CGAL::PLY_property<unsigned short>("blue"),
|
||||
CGAL::PLY_property<unsigned short>("alpha")));
|
||||
assert(! is.fail());
|
||||
assert(ok);
|
||||
assert(points.size() == 3);
|
||||
assert(points[1].second[1] == 255);
|
||||
}
|
||||
|
||||
{
|
||||
std::ostringstream os;
|
||||
assert(os.good());
|
||||
ok = CGAL::write_ply_points(os, ps);
|
||||
assert(! os.fail());
|
||||
assert(ok);
|
||||
os.flush();
|
||||
input = os.str();
|
||||
}
|
||||
|
||||
{
|
||||
std::istringstream is(input);
|
||||
assert(is.good());
|
||||
ps.clear();
|
||||
ok = CGAL::read_ply_points(is, std::back_inserter (ps));
|
||||
assert(! is.fail());
|
||||
assert(ok);
|
||||
assert(ps.size() == 3);
|
||||
}
|
||||
|
||||
//OFF
|
||||
{
|
||||
std::ostringstream os;
|
||||
assert(os.good());
|
||||
ok = CGAL::write_off_points(os, ps);
|
||||
assert(! os.fail());
|
||||
assert(ok);
|
||||
os.flush();
|
||||
input = os.str();
|
||||
}
|
||||
|
||||
{
|
||||
std::istringstream is(input);
|
||||
assert(is.good());
|
||||
ps.clear();
|
||||
ok = CGAL::read_off_points(is, std::back_inserter (ps));
|
||||
assert(! is.fail());
|
||||
assert(ok);
|
||||
assert(ps.size() == 3);
|
||||
}
|
||||
|
||||
//XYZ
|
||||
{
|
||||
std::ostringstream os;
|
||||
assert(os.good());
|
||||
ok = CGAL::write_xyz_points(os, ps);
|
||||
assert(! os.fail());
|
||||
assert(ok);
|
||||
os.flush();
|
||||
input = os.str();
|
||||
}
|
||||
|
||||
{
|
||||
std::istringstream is(input);
|
||||
assert(is.good());
|
||||
ps.clear();
|
||||
ok = CGAL::read_xyz_points(is, std::back_inserter (ps));
|
||||
assert(! is.fail());
|
||||
assert(ok);
|
||||
assert(ps.size() == 3);
|
||||
}
|
||||
|
||||
std::cout << "Done" << std::endl;
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
@ -278,6 +278,7 @@ template <typename PolygonMesh, typename FaceNormalVector, typename K>
|
|||
bool does_enclose_other_normals(const std::size_t i, const std::size_t j, const std::size_t k,
|
||||
const typename K::Vector_3& nb,
|
||||
const typename K::FT sp_bi,
|
||||
typename boost::graph_traits<PolygonMesh>::face_descriptor ¬_enclose_normal,
|
||||
const std::vector<typename boost::graph_traits<PolygonMesh>::face_descriptor>& incident_faces,
|
||||
const FaceNormalVector& face_normals,
|
||||
const K& traits)
|
||||
|
|
@ -291,6 +292,7 @@ bool does_enclose_other_normals(const std::size_t i, const std::size_t j, const
|
|||
|
||||
// check that this min circle defined by the diameter contains the other points
|
||||
const std::size_t nif = incident_faces.size();
|
||||
bool enclose_other_normals=true;
|
||||
for(std::size_t l=0; l<nif; ++l)
|
||||
{
|
||||
if(l == i || l == j || l == k)
|
||||
|
|
@ -311,11 +313,18 @@ bool does_enclose_other_normals(const std::size_t i, const std::size_t j, const
|
|||
if(CGAL::abs(sp_bi - sp_bl) <= sp_diff_bound)
|
||||
continue;
|
||||
|
||||
if(sp_bl < sp_bi)
|
||||
return false;
|
||||
//Get the normal farthest from the center
|
||||
if(sp_bl < sp_bi){
|
||||
if(enclose_other_normals){
|
||||
enclose_other_normals=false;
|
||||
not_enclose_normal=incident_faces[l];
|
||||
} else if(sp_bl < sp(nb, get(face_normals, not_enclose_normal))){
|
||||
not_enclose_normal=incident_faces[l];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
return enclose_other_normals;
|
||||
}
|
||||
|
||||
template <typename GT>
|
||||
|
|
@ -385,156 +394,160 @@ typename GT::Vector_3 compute_normals_bisector(const typename GT::Vector_3& ni,
|
|||
return nb;
|
||||
}
|
||||
|
||||
template <typename PolygonMesh, typename FaceNormalVector, typename GT>
|
||||
typename GT::Vector_3
|
||||
compute_most_visible_normal_2_points(std::vector<typename boost::graph_traits<PolygonMesh>::face_descriptor>& incident_faces,
|
||||
const FaceNormalVector& face_normals,
|
||||
const GT& traits)
|
||||
{
|
||||
typedef typename GT::FT FT;
|
||||
typedef typename GT::Vector_3 Vector_3;
|
||||
typedef typename boost::property_traits<FaceNormalVector>::reference Vector_ref;
|
||||
|
||||
typename GT::Compute_scalar_product_3 sp_3 = traits.compute_scalar_product_3_object();
|
||||
typename GT::Construct_vector_3 cv_3 = traits.construct_vector_3_object();
|
||||
|
||||
#ifdef CGAL_PMP_COMPUTE_NORMAL_DEBUG_PP
|
||||
std::cout << "Trying to find enclosing normal with 2 normals" << std::endl;
|
||||
#endif
|
||||
|
||||
FT min_sp = -1;
|
||||
Vector_3 n = cv_3(CGAL::NULL_VECTOR);
|
||||
|
||||
const std::size_t nif = incident_faces.size();
|
||||
for(std::size_t i=0; i<nif; ++i)
|
||||
{
|
||||
for(std::size_t j=i+1; j<nif; ++j)
|
||||
{
|
||||
const Vector_ref ni = get(face_normals, incident_faces[i]);
|
||||
const Vector_ref nj = get(face_normals, incident_faces[j]);
|
||||
|
||||
const Vector_3 nb = compute_normals_bisector(ni, nj, traits);
|
||||
|
||||
// Degeneracies like ni == -nj or a numerical error in the construction of 'nb' can happen.
|
||||
if(traits.equal_3_object()(nb, CGAL::NULL_VECTOR))
|
||||
return CGAL::NULL_VECTOR;
|
||||
|
||||
FT sp_bi = sp_3(nb, ni);
|
||||
sp_bi = (std::max)(FT(0), sp_bi);
|
||||
if(sp_bi <= min_sp)
|
||||
continue;
|
||||
|
||||
if(!does_enclose_other_normals<PolygonMesh>(i, j, -1 /*NA*/, nb, sp_bi, incident_faces, face_normals, traits))
|
||||
continue;
|
||||
|
||||
min_sp = sp_bi;
|
||||
n = nb;
|
||||
}
|
||||
}
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
template <typename PolygonMesh, typename FaceNormalVector, typename GT>
|
||||
typename GT::Vector_3
|
||||
compute_most_visible_normal_3_points(const std::vector<typename boost::graph_traits<PolygonMesh>::face_descriptor>& incident_faces,
|
||||
const FaceNormalVector& face_normals,
|
||||
const GT& traits)
|
||||
{
|
||||
typedef typename GT::FT FT;
|
||||
typedef typename GT::Vector_3 Vector_3;
|
||||
typedef typename boost::property_traits<FaceNormalVector>::reference Vector_ref;
|
||||
|
||||
#ifdef CGAL_PMP_COMPUTE_NORMAL_DEBUG_PP
|
||||
std::cout << "Trying to find enclosing normal with 3 normals" << std::endl;
|
||||
#endif
|
||||
|
||||
FT min_sp = -1;
|
||||
|
||||
Vector_3 n = traits.construct_vector_3_object()(CGAL::NULL_VECTOR);
|
||||
|
||||
const std::size_t nif = incident_faces.size();
|
||||
for(std::size_t i=0; i<nif; ++i)
|
||||
{
|
||||
for(std::size_t j=i+1; j<nif; ++j)
|
||||
{
|
||||
for(std::size_t k=j+1; k<nif; ++k)
|
||||
{
|
||||
const Vector_ref ni = get(face_normals, incident_faces[i]);
|
||||
const Vector_ref nj = get(face_normals, incident_faces[j]);
|
||||
const Vector_ref nk = get(face_normals, incident_faces[k]);
|
||||
|
||||
if(ni == CGAL::NULL_VECTOR || nj == CGAL::NULL_VECTOR || nk == CGAL::NULL_VECTOR)
|
||||
continue;
|
||||
|
||||
Vector_3 nb = compute_normals_bisector(ni, nj, nk, traits);
|
||||
if(traits.equal_3_object()(nb, CGAL::NULL_VECTOR))
|
||||
return nb;
|
||||
|
||||
FT sp_bi = traits.compute_scalar_product_3_object()(nb, ni);
|
||||
if(sp_bi < FT(0))
|
||||
{
|
||||
nb = traits.construct_opposite_vector_3_object()(nb);
|
||||
sp_bi = - sp_bi;
|
||||
}
|
||||
|
||||
if(sp_bi <= min_sp)
|
||||
continue;
|
||||
|
||||
if(!does_enclose_other_normals<PolygonMesh>(i, j, k, nb, sp_bi, incident_faces, face_normals, traits))
|
||||
continue;
|
||||
|
||||
min_sp = sp_bi;
|
||||
n = nb;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef CGAL_PMP_COMPUTE_NORMAL_DEBUG_PP
|
||||
std::cout << "Best normal from 3-normals-approach: " << n << std::endl;
|
||||
#endif
|
||||
|
||||
return n;
|
||||
}
|
||||
|
||||
// Inspired by Aubry et al. On the most 'normal' normal
|
||||
template <typename PolygonMesh, typename FaceNormalVector, typename GT>
|
||||
typename GT::Vector_3
|
||||
compute_vertex_normal_most_visible_min_circle(typename boost::graph_traits<PolygonMesh>::vertex_descriptor v,
|
||||
const FaceNormalVector& face_normals,
|
||||
const PolygonMesh& pmesh,
|
||||
const GT& traits)
|
||||
{
|
||||
const GT& traits){
|
||||
typedef typename boost::graph_traits<PolygonMesh>::face_descriptor face_descriptor;
|
||||
|
||||
typedef typename GT::FT FT;
|
||||
typedef typename GT::Vector_3 Vector_3;
|
||||
typedef typename boost::property_traits<FaceNormalVector>::reference Vector_ref;
|
||||
|
||||
typename GT::Compute_scalar_product_3 sp_3 = traits.compute_scalar_product_3_object();
|
||||
typename GT::Construct_cross_product_vector_3 cp_3 = traits.construct_cross_product_vector_3_object();
|
||||
|
||||
std::vector<face_descriptor> incident_faces;
|
||||
incident_faces.reserve(8);
|
||||
for(face_descriptor f : CGAL::faces_around_target(halfedge(v, pmesh), pmesh))
|
||||
{
|
||||
if(f == boost::graph_traits<PolygonMesh>::null_face())
|
||||
// Remove degenerate and redundant faces
|
||||
if((f == boost::graph_traits<PolygonMesh>::null_face()) || (get(face_normals, f)==NULL_VECTOR) )
|
||||
continue;
|
||||
|
||||
if(! incident_faces.empty()){
|
||||
if(get(face_normals, incident_faces.back()) == get(face_normals, f) )
|
||||
continue;
|
||||
}
|
||||
incident_faces.push_back(f);
|
||||
}
|
||||
|
||||
if(incident_faces.size() == 0)
|
||||
return NULL_VECTOR;
|
||||
if(incident_faces.size() == 1)
|
||||
return get(face_normals, incident_faces.front());
|
||||
|
||||
Vector_3 res = compute_most_visible_normal_2_points<PolygonMesh>(incident_faces, face_normals, traits);
|
||||
std::array<face_descriptor, 3> circum_points;
|
||||
short int circum_points_size=2;
|
||||
circum_points[0]=incident_faces[0];
|
||||
circum_points[1]=incident_faces[1];
|
||||
|
||||
if(res != CGAL::NULL_VECTOR) // found a valid normal through 2 point min circle
|
||||
return res;
|
||||
// Get the farthest point from circum_points[0]
|
||||
const Vector_ref n0 = get(face_normals, circum_points[0]);
|
||||
const Vector_ref n1 = get(face_normals, circum_points[1]);
|
||||
FT sp_min = sp_3(n0, n1);
|
||||
for(size_t i=2; i<incident_faces.size(); ++i){
|
||||
const Vector_ref ni = get(face_normals, incident_faces[i]);
|
||||
FT sp = sp_3(n0, ni);
|
||||
if(sp < sp_min){
|
||||
sp_min=sp;
|
||||
circum_points[1]=incident_faces[i];
|
||||
}
|
||||
}
|
||||
|
||||
// The vertex has only two incident faces with opposite normals (fold)...
|
||||
// @todo devise something based on the directions of the 2/3/4 incident edges?
|
||||
if(incident_faces.size() == 2 && res == CGAL::NULL_VECTOR)
|
||||
return res;
|
||||
// At each step, we get a vertex outside of the current circumcircle to define a larger circumcircle
|
||||
while(true)
|
||||
{
|
||||
Vector_3 center;
|
||||
FT radius; //Here, 'radius' refers to the negative scalar product between one circum_point and the center.
|
||||
const Vector_ref ni = get(face_normals, circum_points[0]);
|
||||
const Vector_ref nj = get(face_normals, circum_points[1]);
|
||||
|
||||
CGAL_assertion(incident_faces.size() >= 2);
|
||||
if(circum_points_size==2){
|
||||
center = compute_normals_bisector(ni, nj, traits);
|
||||
} else {
|
||||
CGAL_assertion(circum_points_size==3);
|
||||
const Vector_ref nk = get(face_normals, circum_points[2]);
|
||||
center = compute_normals_bisector(ni, nj, nk, traits);
|
||||
}
|
||||
|
||||
return compute_most_visible_normal_3_points<PolygonMesh>(incident_faces, face_normals, traits);
|
||||
if(center==NULL_VECTOR)
|
||||
return NULL_VECTOR;
|
||||
|
||||
radius = -sp_3(ni, center);
|
||||
|
||||
if(is_positive(radius))
|
||||
return NULL_VECTOR; // The circle is larger than a hemisphere, so no normal is visible to all
|
||||
|
||||
face_descriptor f_out;
|
||||
if(does_enclose_other_normals<PolygonMesh>(-1,-2,-3, center, -radius, f_out, incident_faces, face_normals, traits))
|
||||
return center;
|
||||
const Vector_ref no = get(face_normals, f_out);
|
||||
|
||||
if(circum_points_size==2){
|
||||
circum_points[2]=f_out;
|
||||
circum_points_size=3;
|
||||
} else {
|
||||
if(is_negative(sp_3(center, no)))
|
||||
return NULL_VECTOR; // The circle will become bigger than a hemisphere, no normal visible by all
|
||||
|
||||
const Vector_ref nk = get(face_normals, circum_points[2]);
|
||||
|
||||
// We need to remove one of the previous points
|
||||
// We keep the farthest point from the new one
|
||||
// Then we divide the sphere in two along the equator that passes through the first point and the center
|
||||
// We remove the previous point that lies in the same hemisphere as the new one
|
||||
|
||||
// move the farthest point to f_out at the beginning of circum_points
|
||||
FT sp_ni_no = sp_3(ni, no);
|
||||
FT sp_nj_no = sp_3(nj, no);
|
||||
FT sp_nk_no = sp_3(nk, no);
|
||||
|
||||
if(sp_nj_no < sp_nk_no){
|
||||
if(sp_nj_no < sp_ni_no){
|
||||
std::swap(circum_points[0], circum_points[1]);
|
||||
}
|
||||
} else {
|
||||
if(sp_nk_no < sp_ni_no){
|
||||
std::swap(circum_points[0], circum_points[2]);
|
||||
}
|
||||
}
|
||||
|
||||
// Get the new vectors
|
||||
const Vector_ref n0 = get(face_normals, circum_points[0]);
|
||||
const Vector_ref n1 = get(face_normals, circum_points[1]);
|
||||
const Vector_ref n2 = get(face_normals, circum_points[2]);
|
||||
|
||||
// Search for the points that lie in the same hemisphere as f_out compared to ni
|
||||
Vector_3 n_middle = cp_3(n0, center);
|
||||
FT sp_no_nm = sp_3(no, n_middle);
|
||||
FT sp_n1_nm = sp_3(n1, n_middle);
|
||||
FT sp_n2_nm = sp_3(n2, n_middle);
|
||||
|
||||
//We use the same bound than above in does_enclose_other_normals
|
||||
const FT nmn = CGAL::approximate_sqrt(traits.compute_squared_length_3_object()(n_middle));
|
||||
const FT sp_diff_bound = nmn*0.00017453292431333;
|
||||
CGAL_assertion((CGAL::sign(sp_n1_nm)!=CGAL::sign(sp_n2_nm)) || (abs(sp_n1_nm)<=sp_diff_bound) || (abs(sp_n2_nm)<=sp_diff_bound));
|
||||
if((abs(sp_n1_nm)<=sp_diff_bound) || (abs(sp_n2_nm)<=sp_diff_bound))
|
||||
return NULL_VECTOR; // The case is nearly degenerate and leads to geometric inconsistencies due to numerical errors
|
||||
|
||||
if( CGAL::sign(sp_no_nm) == CGAL::sign(sp_n1_nm)){
|
||||
circum_points[1]=f_out;
|
||||
} else {
|
||||
circum_points[2]=f_out;
|
||||
}
|
||||
}
|
||||
|
||||
// Delete one vertex if it is included in the circumcircle of the other two
|
||||
const Vector_ref ni2 = get(face_normals, circum_points[0]);
|
||||
const Vector_ref nj2 = get(face_normals, circum_points[1]);
|
||||
const Vector_ref nk2 = get(face_normals, circum_points[2]);
|
||||
Vector_3 center_ni_nj = compute_normals_bisector(ni2, nj2, traits);
|
||||
Vector_3 center_ni_nk = compute_normals_bisector(ni2, nk2, traits);
|
||||
Vector_3 center_nj_nk = compute_normals_bisector(nj2, nk2, traits);
|
||||
|
||||
if(sp_3(center_ni_nj, nk2) > sp_3(center_ni_nj, ni2)){
|
||||
circum_points_size=2;
|
||||
} else if(sp_3(center_ni_nk, nj2) > sp_3(center_ni_nk, ni2)){
|
||||
std::swap(circum_points[1],circum_points[2]);
|
||||
circum_points_size=2;
|
||||
} else if(sp_3(center_nj_nk, ni2) > sp_3(center_nj_nk, nj2)){
|
||||
std::swap(circum_points[0],circum_points[2]);
|
||||
circum_points_size=2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <typename PolygonMesh, typename FaceNormalVector, typename VertexPointMap, typename GT>
|
||||
|
|
@ -727,7 +740,6 @@ compute_vertex_normal(typename boost::graph_traits<PolygonMesh>::vertex_descript
|
|||
std::cout << "get normal at f " << face(h, pmesh) << " : " << get(face_normals, face(h, pmesh)) << std::endl;
|
||||
}
|
||||
#endif
|
||||
|
||||
Vector_3 normal = internal::compute_vertex_normal_most_visible_min_circle(v, face_normals, pmesh, traits);
|
||||
if(traits.equal_3_object()(normal, CGAL::NULL_VECTOR)) // can't always find a most visible normal
|
||||
{
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ project(Polygon_mesh_processing_Tests)
|
|||
# CGAL and its components
|
||||
find_package(CGAL REQUIRED COMPONENTS Core)
|
||||
|
||||
create_single_source_cgal_program("slow_compute_normal.cpp")
|
||||
create_single_source_cgal_program("test_pmp_triangle.cpp")
|
||||
create_single_source_cgal_program("test_hausdorff_bounded_error_distance.cpp")
|
||||
create_single_source_cgal_program("test_pmp_read_polygon_mesh.cpp")
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -0,0 +1,39 @@
|
|||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||
#include <CGAL/Surface_mesh.h>
|
||||
#include <CGAL/Timer.h>
|
||||
#include <CGAL/Polygon_mesh_processing/compute_normal.h>
|
||||
#include <CGAL/Polygon_mesh_processing/IO/polygon_mesh_io.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
|
||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
|
||||
|
||||
typedef K::Point_3 Point;
|
||||
typedef K::Vector_3 Vector;
|
||||
|
||||
typedef CGAL::Surface_mesh<Point> Mesh;
|
||||
typedef boost::graph_traits<Mesh>::vertex_descriptor vertex_descriptor;
|
||||
typedef boost::graph_traits<Mesh>::face_descriptor face_descriptor;
|
||||
|
||||
namespace PMP = CGAL::Polygon_mesh_processing;
|
||||
|
||||
int main()
|
||||
{
|
||||
const std::string filename = "./data/slow_compute_normal.off";
|
||||
|
||||
Mesh mesh;
|
||||
if(!PMP::IO::read_polygon_mesh(filename, mesh))
|
||||
{
|
||||
std::cerr << "Invalid input." << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
CGAL::Timer t;
|
||||
t.start();
|
||||
std::cout << "compute_vertex_normal" << std::endl;
|
||||
PMP::compute_vertex_normal(vertex_descriptor(523), mesh);
|
||||
std::cout << t.time() << " sec." << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -34,13 +34,6 @@ polyhedral surface.
|
|||
template <class Traits>
|
||||
bool read_OFF( std::istream& in, CGAL::Polyhedron_3<Traits>& P);
|
||||
|
||||
/*!
|
||||
\deprecated This function is deprecated since \cgal 5.3,
|
||||
\ref read_OFF(std::istream&, Polyhedron_3<Traits>&) should be used instead.
|
||||
*/
|
||||
template <class Traits>
|
||||
bool read_off( std::istream& in, CGAL::Polyhedron_3<Traits>& P);
|
||||
|
||||
} // namespace IO
|
||||
|
||||
/*!
|
||||
|
|
@ -79,12 +72,6 @@ This function overloads the generic function \link PkgBGLIoFuncsOFF `write_OFF(s
|
|||
template <class Traits>
|
||||
bool write_OFF( std::ostream& out, const CGAL::Polyhedron_3<Traits>& P);
|
||||
|
||||
/*!
|
||||
\deprecated This function is deprecated since \cgal 5.3,
|
||||
\ref CGAL::IO::write_OFF(std::ostream&, const Polyhedron_3<Traits>&) should be used instead.
|
||||
*/
|
||||
template <class Traits>
|
||||
bool write_off( std::ostream& out, const CGAL::Polyhedron_3<Traits>& P);
|
||||
|
||||
} // namespace IO
|
||||
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
#include <iostream>
|
||||
#include <map>
|
||||
#include <CGAL/Polyhedron_3.h>
|
||||
#include <CGAL/config.h>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
|
|
@ -30,7 +31,7 @@ namespace CGAL {
|
|||
* @return A dart created during the conversion.
|
||||
*/
|
||||
template< class LCC, class Polyhedron >
|
||||
typename LCC::Dart_descriptor import_from_polyhedron_3(LCC& alcc,
|
||||
typename LCC::Dart_descriptor polyhedron_3_to_lcc(LCC& alcc,
|
||||
const Polyhedron &apoly)
|
||||
{
|
||||
static_assert( LCC::dimension>=2 && LCC::ambient_dimension==3 );
|
||||
|
|
@ -94,6 +95,21 @@ namespace CGAL {
|
|||
return firstAll;
|
||||
}
|
||||
|
||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
/*!
|
||||
\deprecated This function is deprecated since CGAL 6.2. Use `polyhedron_3_to_lcc()` instead.
|
||||
*/
|
||||
template< class LCC, class Polyhedron >
|
||||
CGAL_DEPRECATED
|
||||
typename LCC::Dart_descriptor
|
||||
import_from_polyhedron_3(LCC& alcc, const Polyhedron &apoly)
|
||||
{
|
||||
return polyhedron_3_to_lcc<LCC, Polyhedron>(alcc, apoly);
|
||||
}
|
||||
|
||||
#endif // CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
/** Convert a Polyhedron_3 read into a flux into 3D linear cell complex.
|
||||
* @param alcc the linear cell complex where Polyhedron_3 will be converted.
|
||||
* @param ais the istream where read the Polyhedron_3.
|
||||
|
|
@ -101,7 +117,7 @@ namespace CGAL {
|
|||
*/
|
||||
template < class LCC >
|
||||
typename LCC::Dart_descriptor
|
||||
import_from_polyhedron_3_flux(LCC& alcc, std::istream& ais)
|
||||
polyhedron_3_flux_to_lcc(LCC& alcc, std::istream& ais)
|
||||
{
|
||||
if (!ais.good())
|
||||
{
|
||||
|
|
@ -110,7 +126,7 @@ namespace CGAL {
|
|||
}
|
||||
CGAL::Polyhedron_3<typename LCC::Traits> P;
|
||||
ais >> P;
|
||||
return import_from_polyhedron_3<LCC, CGAL::Polyhedron_3
|
||||
return polyhedron_3_to_lcc<LCC, CGAL::Polyhedron_3
|
||||
<typename LCC::Traits> > (alcc, P);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,34 +22,5 @@
|
|||
|
||||
#include <CGAL/boost/graph/io.h>
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
/*!
|
||||
\ingroup PkgSurfaceMeshIOFuncDeprecated
|
||||
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_polygon_mesh()` should be used instead.
|
||||
*/
|
||||
template <typename K>
|
||||
CGAL_DEPRECATED bool read_mesh(Surface_mesh<K>& sm, const std::string& filename)
|
||||
{
|
||||
return IO::read_polygon_mesh(filename, sm);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup PkgSurfaceMeshIOFuncDeprecated
|
||||
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_polygon_mesh()` should be used instead.
|
||||
*/
|
||||
template <typename K>
|
||||
CGAL_DEPRECATED bool write_mesh(const Surface_mesh<K>& mesh, const std::string& filename)
|
||||
{
|
||||
return IO::write_polygon_mesh(filename, mesh);
|
||||
}
|
||||
|
||||
#endif // CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
} // namespace CGAL
|
||||
|
||||
#endif // CGAL_SURFACE_MESH_IO_H
|
||||
|
|
|
|||
|
|
@ -137,20 +137,6 @@ bool read_3MF(const std::string& filename,
|
|||
|
||||
} // namespace IO
|
||||
|
||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
/*!
|
||||
\ingroup PkgSurfaceMeshIOFuncDeprecated
|
||||
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_3MF()` should be used instead.
|
||||
*/
|
||||
template<typename Point>
|
||||
CGAL_DEPRECATED int read_3mf(const std::string& filename, std::vector<CGAL::Surface_mesh<Point> >& output)
|
||||
{
|
||||
return IO::read_3MF(filename, output);
|
||||
}
|
||||
|
||||
#endif // CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
} // namespace CGAL
|
||||
|
||||
#endif // defined(CGAL_LINKED_WITH_3MF) || defined(DOXYGEN_RUNNING)
|
||||
|
|
|
|||
|
|
@ -347,30 +347,6 @@ bool read_OFF(const std::string& fname,
|
|||
|
||||
} // namespace IO
|
||||
|
||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
/*!
|
||||
\ingroup PkgSurfaceMeshIOFuncDeprecated
|
||||
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_OFF(std::istream&, const Surface_mesh<Point>&)` should be used instead.
|
||||
*/
|
||||
template <typename Point, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
CGAL_DEPRECATED bool read_off(std::istream& is, Surface_mesh<Point>& sm, const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
return IO::read_OFF(is, sm, np);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup PkgSurfaceMeshIOFuncDeprecated
|
||||
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_OFF(std::istream&, const Surface_mesh<Point>&)` should be used instead.
|
||||
*/
|
||||
template <typename Point>
|
||||
CGAL_DEPRECATED bool read_off(Surface_mesh<Point>& sm, const std::string& filename)
|
||||
{
|
||||
return IO::read_OFF(filename, sm, parameters::default_values());
|
||||
}
|
||||
#endif // CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Write
|
||||
|
||||
|
|
@ -549,30 +525,6 @@ bool write_OFF(std::ostream& os,
|
|||
|
||||
} // namespace IO
|
||||
|
||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
/*!
|
||||
\ingroup PkgSurfaceMeshIOFuncDeprecated
|
||||
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_OFF(std::ostream&, const Surface_mesh<Point>&)` should be used instead.
|
||||
*/
|
||||
template <typename Point, typename CGAL_NP_TEMPLATE_PARAMETERS>
|
||||
CGAL_DEPRECATED bool write_off(std::ostream& os, const Surface_mesh<Point>& sm, const CGAL_NP_CLASS& np = parameters::default_values())
|
||||
{
|
||||
return IO::write_OFF(os, sm, np);
|
||||
}
|
||||
|
||||
/*!
|
||||
\ingroup PkgSurfaceMeshIOFuncDeprecated
|
||||
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_OFF(std::ostream&, const Surface_mesh<Point>&)` should be used instead.
|
||||
*/
|
||||
template <typename Point>
|
||||
CGAL_DEPRECATED bool write_off(const Surface_mesh<Point>& sm, const std::string& filename)
|
||||
{
|
||||
return IO::write_OFF(filename, sm, parameters::default_values());
|
||||
}
|
||||
|
||||
#endif // CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
} // namespace CGAL
|
||||
|
||||
#endif // CGAL_SURFACE_MESH_IO_OFF_H
|
||||
|
|
|
|||
|
|
@ -169,10 +169,7 @@ public:
|
|||
const std::string& name = property->name();
|
||||
if(name == "vertex1" || name == "vertex2")
|
||||
return true;
|
||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||
if(name == "v0" || name == "v1")
|
||||
return true;
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -888,21 +885,7 @@ bool read_PLY(std::istream& is, Surface_mesh<P>& sm)
|
|||
|
||||
} // namespace IO
|
||||
|
||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
/*!
|
||||
\ingroup PkgSurfaceMeshIOFuncDeprecated
|
||||
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::read_PLY(std::ostream&, const Surface_mesh<Point>&)` should be used instead.
|
||||
*/
|
||||
template <typename P>
|
||||
CGAL_DEPRECATED bool read_ply(std::istream& is, Surface_mesh<P>& sm, std::string& comments)
|
||||
{
|
||||
return IO::read_PLY(is, sm, comments);
|
||||
}
|
||||
|
||||
#endif // CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Write
|
||||
|
||||
|
|
@ -1155,26 +1138,6 @@ bool write_PLY(std::ostream& os, const Surface_mesh<P>& sm, const CGAL_NP_CLASS&
|
|||
|
||||
} // namespace IO
|
||||
|
||||
#ifndef CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
/*!
|
||||
\ingroup PkgSurfaceMeshIOFuncDeprecated
|
||||
\deprecated This function is deprecated since \cgal 5.3, `CGAL::IO::write_PLY(std::ostream&, const Surface_mesh<Point>&)` should be used instead.
|
||||
*/
|
||||
|
||||
template <typename P>
|
||||
CGAL_DEPRECATED bool write_ply(std::ostream& os, const Surface_mesh<P>& sm, const std::string& comments)
|
||||
{
|
||||
return IO::write_PLY(os, sm, comments);
|
||||
}
|
||||
|
||||
template <typename P>
|
||||
CGAL_DEPRECATED bool write_ply(std::ostream& os, const Surface_mesh<P>& sm)
|
||||
{
|
||||
return write_PLY(os, sm, "");
|
||||
}
|
||||
#endif // CGAL_NO_DEPRECATED_CODE
|
||||
|
||||
} // namespace CGAL
|
||||
|
||||
#endif // CGAL_SURFACE_MESH_IO_PLY_H
|
||||
|
|
|
|||
|
|
@ -15,15 +15,3 @@ foreach(cppfile ${cppfiles})
|
|||
create_single_source_cgal_program("${cppfile}")
|
||||
endforeach()
|
||||
|
||||
find_path(3MF_INCLUDE_DIR
|
||||
NAMES Model/COM/NMR_DLLInterfaces.h
|
||||
DOC "Path to lib3MF headers"
|
||||
)
|
||||
find_library(3MF_LIBRARIES NAMES 3MF DOC "Path to the lib3MF library")
|
||||
if(3MF_LIBRARIES AND 3MF_INCLUDE_DIR AND EXISTS "${3MF_INCLUDE_DIR}/Model/COM/NMR_DLLInterfaces.h")
|
||||
include_directories(${3MF_INCLUDE_DIR})
|
||||
target_link_libraries(test_deprecated_io_sm PRIVATE ${3MF_LIBRARIES})
|
||||
target_compile_definitions(test_deprecated_io_sm PRIVATE -DCGAL_LINKED_WITH_3MF)
|
||||
else()
|
||||
message(STATUS "NOTICE: read_3mf requires the lib3MF library, and will not be tested.")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -1,70 +0,0 @@
|
|||
#include <CGAL/Installation/internal/disable_deprecation_warnings_and_errors.h>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <CGAL/Surface_mesh.h>
|
||||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/boost/graph/generators.h>
|
||||
#include <CGAL/Surface_mesh/IO/3MF.h>
|
||||
#include <CGAL/Surface_mesh/IO/OFF.h>
|
||||
#include <CGAL/Surface_mesh/IO/PLY.h>
|
||||
|
||||
|
||||
typedef CGAL::Simple_cartesian<double> Kernel;
|
||||
typedef Kernel::Point_3 Point_3;
|
||||
typedef CGAL::Surface_mesh<Point_3> SM;
|
||||
|
||||
int main()
|
||||
{
|
||||
// OFF
|
||||
SM sm_in, sm_out;
|
||||
Point_3 p0(0,0,0), p1(1,0,0), p2(0,1,0);
|
||||
CGAL::make_triangle(p0, p1, p2, sm_out);
|
||||
bool ok = CGAL::write_off(sm_out, "tmp.off");
|
||||
assert(ok);
|
||||
ok = CGAL::read_off(sm_in, "tmp.off");
|
||||
assert(ok);
|
||||
assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1);
|
||||
sm_in.clear();
|
||||
|
||||
std::ofstream os("tmp.off");
|
||||
ok = CGAL::write_off(os, sm_out);
|
||||
assert(ok);
|
||||
os.close();
|
||||
std::ifstream is("tmp.off");
|
||||
ok = CGAL::read_off(is, sm_in);
|
||||
assert(ok);
|
||||
assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1);
|
||||
is.close();
|
||||
sm_in.clear();
|
||||
|
||||
//PLY
|
||||
os.open("tmp.ply");
|
||||
std::string comments;
|
||||
ok = CGAL::write_ply(os, sm_out, comments);
|
||||
assert(ok);
|
||||
os.close();
|
||||
is.open("tmp.ply");
|
||||
ok = CGAL::read_ply(is, sm_in, comments);
|
||||
assert(ok);
|
||||
assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1);
|
||||
is.close();
|
||||
sm_in.clear();
|
||||
|
||||
#ifdef CGAL_LINKED_WITH_3MF
|
||||
// 3mf
|
||||
std::vector<SM> output_3mf;
|
||||
ok = CGAL::read_3mf("test.3mf", output_3mf);
|
||||
assert(ok);
|
||||
assert(output_3mf.size() == 2);
|
||||
sm_in.clear();
|
||||
#endif
|
||||
|
||||
//others
|
||||
ok = CGAL::write_mesh(sm_out, "tmp.off");
|
||||
assert(ok);
|
||||
ok = CGAL::read_mesh(sm_in, "tmp.ply");
|
||||
assert(ok);
|
||||
assert(num_vertices(sm_in) == 3 && num_faces(sm_in) == 1);
|
||||
sm_in.clear();
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
@ -1,5 +1,6 @@
|
|||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/Surface_mesh.h>
|
||||
#include <CGAL/IO/polygon_mesh_io.h>
|
||||
#include <CGAL/Timer.h>
|
||||
|
||||
#include <CGAL/Surface_mesh_simplification/edge_collapse.h>
|
||||
|
|
@ -36,8 +37,8 @@ int main(int argc, char** argv)
|
|||
{
|
||||
Surface_mesh surface_mesh;
|
||||
const std::string filename = (argc > 1) ? argv[1] : CGAL::data_file_path("meshes/fold.off");
|
||||
std::ifstream is(filename);
|
||||
if(!is || !(is >> surface_mesh))
|
||||
|
||||
if(!CGAL::IO::read_polygon_mesh(filename, surface_mesh))
|
||||
{
|
||||
std::cerr << "Failed to read input mesh: " << filename << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
|
|
|
|||
|
|
@ -13,6 +13,8 @@
|
|||
|
||||
#include <CGAL/license/Surface_mesh_simplification.h>
|
||||
|
||||
#include <CGAL/internal/robust_cross_product.h>
|
||||
|
||||
#include <CGAL/determinant.h>
|
||||
#include <CGAL/Null_matrix.h>
|
||||
#include <CGAL/number_utils.h>
|
||||
|
|
@ -183,17 +185,19 @@ MatrixC33<R> cofactors_matrix(const MatrixC33<R>& m)
|
|||
{
|
||||
typedef typename R::RT RT;
|
||||
|
||||
RT c00 = determinant(m.r1().y(),m.r1().z(),m.r2().y(),m.r2().z());
|
||||
RT c01 = -determinant(m.r1().x(),m.r1().z(),m.r2().x(),m.r2().z());
|
||||
RT c02 = determinant(m.r1().x(),m.r1().y(),m.r2().x(),m.r2().y());
|
||||
using ::CGAL::Surface_mesh_simplification::internal::diff_of_products;
|
||||
|
||||
RT c10 = -determinant(m.r0().y(),m.r0().z(),m.r2().y(),m.r2().z());
|
||||
RT c11 = determinant(m.r0().x(),m.r0().z(),m.r2().x(),m.r2().z());
|
||||
RT c12 = -determinant(m.r0().x(),m.r0().y(),m.r2().x(),m.r2().y());
|
||||
RT c00 = diff_of_products(m.r1().y(), m.r2().z(), m.r2().y(), m.r1().z());
|
||||
RT c01 = -diff_of_products(m.r1().x(), m.r2().z(), m.r2().x(), m.r1().z());
|
||||
RT c02 = diff_of_products(m.r1().x(), m.r2().y(), m.r2().x(), m.r1().y());
|
||||
|
||||
RT c20 = determinant(m.r0().y(),m.r0().z(),m.r1().y(),m.r1().z());
|
||||
RT c21 = -determinant(m.r0().x(),m.r0().z(),m.r1().x(),m.r1().z());
|
||||
RT c22 = determinant(m.r0().x(),m.r0().y(),m.r1().x(),m.r1().y());
|
||||
RT c10 = -diff_of_products(m.r0().y(), m.r2().z(), m.r2().y(), m.r0().z());
|
||||
RT c11 = diff_of_products(m.r0().x(), m.r2().z(), m.r2().x(), m.r0().z());
|
||||
RT c12 = -diff_of_products(m.r0().x(), m.r2().y(), m.r2().x(), m.r0().y());
|
||||
|
||||
RT c20 = diff_of_products(m.r0().y(), m.r1().z(), m.r1().y(), m.r0().z());
|
||||
RT c21 = -diff_of_products(m.r0().x(), m.r1().z(), m.r1().x(), m.r0().z());
|
||||
RT c22 = diff_of_products(m.r0().x(), m.r1().y(), m.r1().x(), m.r0().y());
|
||||
|
||||
return MatrixC33<R>(c00,c01,c02,
|
||||
c10,c11,c12,
|
||||
|
|
@ -211,7 +215,9 @@ std::optional< MatrixC33<R> > inverse_matrix(const MatrixC33<R>& m)
|
|||
{
|
||||
typedef typename R::RT RT;
|
||||
typedef MatrixC33<R> Matrix;
|
||||
typedef std::optional<Matrix> result_type;
|
||||
typedef std::optional<Matrix> result_type;
|
||||
|
||||
using ::CGAL::Surface_mesh_simplification::internal::diff_of_products;
|
||||
|
||||
result_type rInverse;
|
||||
|
||||
|
|
@ -219,17 +225,17 @@ std::optional< MatrixC33<R> > inverse_matrix(const MatrixC33<R>& m)
|
|||
|
||||
if(! CGAL_NTS is_zero(det))
|
||||
{
|
||||
RT c00 = (m.r1().y()*m.r2().z() - m.r1().z()*m.r2().y()) / det;
|
||||
RT c01 = (m.r2().y()*m.r0().z() - m.r0().y()*m.r2().z()) / det;
|
||||
RT c02 = (m.r0().y()*m.r1().z() - m.r1().y()*m.r0().z()) / det;
|
||||
RT c00 = diff_of_products(m.r1().y(),m.r2().z(),m.r2().y(),m.r1().z()) / det;
|
||||
RT c01 = diff_of_products(m.r2().y(),m.r0().z(),m.r0().y(),m.r2().z()) / det;
|
||||
RT c02 = diff_of_products(m.r0().y(),m.r1().z(),m.r1().y(),m.r0().z()) / det;
|
||||
|
||||
RT c10 = (m.r1().z()*m.r2().x() - m.r1().x()*m.r2().z()) / det;
|
||||
RT c11 = (m.r0().x()*m.r2().z() - m.r2().x()*m.r0().z()) / det;
|
||||
RT c12 = (m.r1().x()*m.r0().z() - m.r0().x()*m.r1().z()) / det;
|
||||
RT c10 = diff_of_products(m.r2().x(),m.r1().z(),m.r1().x(),m.r2().z()) / det;
|
||||
RT c11 = diff_of_products(m.r0().x(),m.r2().z(),m.r2().x(),m.r0().z()) / det;
|
||||
RT c12 = diff_of_products(m.r1().x(),m.r0().z(),m.r0().x(),m.r1().z()) / det;
|
||||
|
||||
RT c20 = (m.r1().x()*m.r2().y() - m.r2().x()*m.r1().y()) / det;
|
||||
RT c21 = (m.r2().x()*m.r0().y() - m.r0().x()*m.r2().y()) / det;
|
||||
RT c22 = (m.r0().x()*m.r1().y() - m.r0().y()*m.r1().x()) / det;
|
||||
RT c20 = diff_of_products(m.r1().x(),m.r2().y(),m.r2().x(),m.r1().y()) / det;
|
||||
RT c21 = diff_of_products(m.r2().x(),m.r0().y(),m.r0().x(),m.r2().y()) / det;
|
||||
RT c22 = diff_of_products(m.r0().x(),m.r1().y(),m.r1().x(),m.r0().y()) / det;
|
||||
|
||||
rInverse = result_type(Matrix(c00,c01,c02,
|
||||
c10,c11,c12,
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@
|
|||
#include <CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Edge_profile.h>
|
||||
|
||||
#include <CGAL/Cartesian/MatrixC33.h>
|
||||
#include <CGAL/internal/robust_cross_product.h>
|
||||
|
||||
#include <limits>
|
||||
#include <vector>
|
||||
|
|
@ -101,6 +102,8 @@ private :
|
|||
void extract_triangle_data();
|
||||
void extract_boundary_data();
|
||||
|
||||
double maxBb;
|
||||
|
||||
void add_boundary_preservation_constraints(const Boundary_data_vector& aBdry);
|
||||
void add_volume_preservation_constraints(const Triangle_data_vector& triangles);
|
||||
void add_boundary_and_volume_optimization_constraints(const Boundary_data_vector& aBdry,
|
||||
|
|
@ -119,42 +122,6 @@ private :
|
|||
const Geom_traits& geom_traits() const { return mProfile.geom_traits(); }
|
||||
const TM& surface() const { return mProfile.surface(); }
|
||||
|
||||
#if 0
|
||||
// a*b - c*d
|
||||
// The next two functions are from https://stackoverflow.com/questions/63665010/accurate-floating-point-computation-of-the-sum-and-difference-of-two-products
|
||||
static double diff_of_products_kahan(const double a, const double b, const double c, const double d)
|
||||
{
|
||||
double w = d * c;
|
||||
double e = std::fma(c, -d, w);
|
||||
double f = std::fma(a, b, -w);
|
||||
return f + e;
|
||||
}
|
||||
|
||||
static double diff_of_products_cht(const double a, const double b, const double c, const double d)
|
||||
{
|
||||
double p1 = a * b;
|
||||
double p2 = c * d;
|
||||
double e1 = std::fma (a, b, -p1);
|
||||
double e2 = std::fma (c, -d, p2);
|
||||
double r = p1 - p2;
|
||||
double e = e1 + e2;
|
||||
return r + e;
|
||||
}
|
||||
|
||||
static double diff_of_products(const double a, const double b, const double c, const double d)
|
||||
{
|
||||
// the next two are equivalent in results and speed
|
||||
return diff_of_products_kahan(a, b, c, d);
|
||||
// return diff_of_products_cht(a, b, c, d);
|
||||
}
|
||||
|
||||
template <typename OFT>
|
||||
static OFT diff_of_products(const OFT& a, const OFT& b, const OFT& c, const OFT& d)
|
||||
{
|
||||
return a*b - c*d;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __AVX__
|
||||
static Vector SL_cross_product_avx(const Vector& A, const Vector& B)
|
||||
{
|
||||
|
|
@ -185,67 +152,10 @@ private :
|
|||
}
|
||||
#endif
|
||||
|
||||
static Vector SL_cross_product(const Vector& a, const Vector& b)
|
||||
{
|
||||
const FT ax=a.x(), ay=a.y(), az=a.z();
|
||||
const FT bx=b.x(), by=b.y(), bz=b.z();
|
||||
|
||||
auto compute_minor = [](double ai, double bi, double aj, double bj)
|
||||
{
|
||||
// The main idea is that we expect ai and bi (and aj and bj) to have roughly the same magnitude
|
||||
// since this function is used to compute the cross product of two vectors that are defined
|
||||
// as (ORIGIN, pa) and (ORIGIN, pb) and pa and pb are part of the same triangle.
|
||||
//
|
||||
// We can abuse this fact to trade 2 extra subtractions to lower the error.
|
||||
return ai * (bj - aj) + aj * (ai - bi);
|
||||
};
|
||||
|
||||
// ay*
|
||||
FT x = compute_minor(ay, by, az, bz);
|
||||
FT y = compute_minor(az, bz, ax, bx);
|
||||
FT z = compute_minor(ax, bx, ay, by);
|
||||
|
||||
return Vector(x, y, z);
|
||||
}
|
||||
|
||||
#if 0
|
||||
static Vector exact_cross_product(const Vector& a, const Vector& b)
|
||||
{
|
||||
CGAL::Cartesian_converter<Geom_traits, CGAL::Exact_predicates_exact_constructions_kernel> to_exact;
|
||||
CGAL::Cartesian_converter<CGAL::Exact_predicates_exact_constructions_kernel, Geom_traits> to_approx;
|
||||
auto exv = cross_product(to_exact(a), to_exact(b));
|
||||
exv.exact();
|
||||
return to_approx(exv);
|
||||
}
|
||||
#endif
|
||||
|
||||
static Vector X_product(const Vector& u, const Vector& v)
|
||||
{
|
||||
#if 0
|
||||
// this can create large errors and spiky meshes for kernels with inexact constructions
|
||||
return CGAL::cross_product(u,v);
|
||||
#elif 0
|
||||
// improves the problem mentioned above a bit, but not enough
|
||||
return { std::fma(u.y(), v.z(), -u.z()*v.y()),
|
||||
std::fma(u.z(), v.x(), -u.x()*v.z()),
|
||||
std::fma(u.x(), v.y(), -u.y()*v.x()) };
|
||||
#elif 0
|
||||
// this is the best without resorting to exact, but it inflicts a 20% slowdown
|
||||
return { diff_of_products(u.y(), v.z(), u.z(), v.y()),
|
||||
diff_of_products(u.z(), v.x(), u.x(), v.z()),
|
||||
diff_of_products(u.x(), v.y(), u.y(), v.x()) };
|
||||
#elif 1
|
||||
// balanced solution based on abusing the fact that here we expect u and v to have similar coordinates
|
||||
return SL_cross_product(u, v);
|
||||
#elif 0
|
||||
// obviously too slow
|
||||
return exact_cross_product(u, v);
|
||||
#endif
|
||||
}
|
||||
|
||||
static Vector point_cross_product(const Point& a, const Point& b)
|
||||
{
|
||||
return X_product(a-ORIGIN, b-ORIGIN);
|
||||
return robust_cross_product<Geom_traits>(a-ORIGIN, b-ORIGIN);
|
||||
}
|
||||
|
||||
// This is the (uX)(Xu) product described in the Lindstrom-Turk paper
|
||||
|
|
@ -352,17 +262,21 @@ LindstromTurkCore<TM,K>::
|
|||
extract_triangle_data()
|
||||
{
|
||||
mTriangle_data.reserve(mProfile.triangles().size());
|
||||
|
||||
maxBb = 0.0;
|
||||
for(const Triangle& tri : mProfile.triangles())
|
||||
{
|
||||
const Point_reference p0 = get_point(tri.v0);
|
||||
const Point_reference p1 = get_point(tri.v1);
|
||||
const Point_reference p2 = get_point(tri.v2);
|
||||
|
||||
maxBb=(std::max)({maxBb,CGAL::abs(p0.x()),CGAL::abs(p0.y()),CGAL::abs(p0.z()),
|
||||
CGAL::abs(p1.x()),CGAL::abs(p1.y()),CGAL::abs(p1.z()),
|
||||
CGAL::abs(p2.x()),CGAL::abs(p2.y()),CGAL::abs(p2.z())});
|
||||
|
||||
Vector v01 = p1 - p0;
|
||||
Vector v02 = p2 - p0;
|
||||
|
||||
Vector lNormalV = cross_product(v01,v02);
|
||||
Vector lNormalV = robust_cross_product<Geom_traits>(v01,v02);
|
||||
FT lNormalL = point_cross_product(p0,p1) * (p2 - ORIGIN);
|
||||
|
||||
CGAL_SMS_LT_TRACE(1, " Extracting triangle v" << tri.v0 << "->v" << tri.v1 << "->v" << tri.v2
|
||||
|
|
@ -370,6 +284,7 @@ extract_triangle_data()
|
|||
|
||||
mTriangle_data.push_back(Triangle_data(lNormalV,lNormalL));
|
||||
}
|
||||
maxBb *= 2.0; // to avoid numerical problems
|
||||
}
|
||||
|
||||
template<class TM, class K>
|
||||
|
|
@ -394,11 +309,12 @@ compute_placement()
|
|||
// A1 * v = b1
|
||||
// A2 * v = b2
|
||||
//
|
||||
// Which in matrix form is : A * v = b
|
||||
// Which in matrix form is: A * v = b
|
||||
//
|
||||
// (with 'A' a 3x3 matrix and 'b' a vector)
|
||||
//
|
||||
// The member variable mConstrinas contains A and b. Indidivual constraints (Ai,bi) can be added to it.
|
||||
// The member variables mConstraints_A and mConstraints_b contain A and b.
|
||||
// Indidivual constraints (Ai,bi) can be added to it.
|
||||
// Once 3 such constraints have been added 'v' is directly solved a:
|
||||
//
|
||||
// v = b*inverse(A)
|
||||
|
|
@ -421,7 +337,7 @@ compute_placement()
|
|||
// In that case there is simply no good vertex placement
|
||||
if(mConstraints_n == 3)
|
||||
{
|
||||
// If the matrix is singular it's inverse cannot be computed so an 'absent' value is returned.
|
||||
// If the matrix is singular its inverse cannot be computed so an 'absent' value is returned.
|
||||
std::optional<Matrix> lOptional_Ai = inverse_matrix(mConstraints_A);
|
||||
if(lOptional_Ai)
|
||||
{
|
||||
|
|
@ -686,7 +602,10 @@ add_constraint_if_alpha_compatible(const Vector& Ai,
|
|||
FT l = CGAL_NTS sqrt(slai);
|
||||
CGAL_SMS_LT_TRACE(3, " l: " << n_to_string(l));
|
||||
|
||||
if(!CGAL_NTS is_zero(l))
|
||||
// Due to double number type, l may have a small value instead of zero (example sum of the face normals of a tetrahedron for volume constraint)
|
||||
// if bi is greater than maxBb, we consider that l is zero
|
||||
CGAL_SMS_LT_TRACE(3, " error consider: " << (CGAL::abs(bi) / maxBb));
|
||||
if(l > (CGAL::abs(bi) / maxBb))
|
||||
{
|
||||
Vector Ain = Ai / l;
|
||||
FT bin = bi / l;
|
||||
|
|
@ -861,6 +780,7 @@ add_constraint_from_gradient(const Matrix& H,
|
|||
}
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} // namespace internal
|
||||
|
|
|
|||
|
|
@ -114,8 +114,9 @@ inline std::string optional_to_string(const std::optional<T>& o) {
|
|||
namespace internal { namespace { bool cgal_enable_sms_trace = true; } }
|
||||
#define CGAL_SMS_TRACE_IMPL(m) \
|
||||
if(::internal::cgal_enable_sms_trace) { \
|
||||
std::ostringstream ss; ss << m; std::string s = ss.str(); \
|
||||
/*Surface_simplification_external_trace(s)*/ std::cerr << s << std::endl; \
|
||||
std::ostringstream ss; ss << m; \
|
||||
std::string s = ss.str(); \
|
||||
Surface_simplification_external_trace(s); \
|
||||
}
|
||||
|
||||
#define CGAL_SMS_DEBUG_CODE(code) code
|
||||
|
|
|
|||
|
|
@ -296,6 +296,8 @@ private:
|
|||
|
||||
void insert_in_PQ(const halfedge_descriptor h, Edge_data& data)
|
||||
{
|
||||
CGAL_SMS_TRACE(5, "Insert " << edge_to_string(h) << " in PQ");
|
||||
|
||||
CGAL_assertion(is_primary_edge(h));
|
||||
CGAL_expensive_assertion(!data.is_in_PQ());
|
||||
CGAL_expensive_assertion(!mPQ->contains(h));
|
||||
|
|
@ -594,12 +596,33 @@ loop()
|
|||
|
||||
std::optional<halfedge_descriptor> opt_h;
|
||||
|
||||
// #define CGAL_SURF_SIMPL_INTERMEDIATE_STEPS_PRINTING
|
||||
#ifdef CGAL_SURF_SIMPL_INTERMEDIATE_STEPS_PRINTING
|
||||
int i_rm = 0;
|
||||
#endif
|
||||
|
||||
while((opt_h = pop_from_PQ()))
|
||||
for(;;)
|
||||
{
|
||||
#ifdef CGAL_SURFACE_SIMPLIFICATION_ENABLE_TRACE
|
||||
if(5 <= CGAL_SURFACE_SIMPLIFICATION_ENABLE_TRACE)
|
||||
{
|
||||
CGAL_SMS_TRACE_IMPL("== Current queue ==");
|
||||
|
||||
auto mPQ_clone = *mPQ;
|
||||
std::optional<halfedge_descriptor> opt_th;
|
||||
while((opt_th = mPQ_clone.extract_top()))
|
||||
{
|
||||
CGAL_SMS_TRACE_IMPL("\t" + edge_to_string(*opt_th));
|
||||
Cost_type tcost = get_data(*opt_th).cost();
|
||||
if(tcost)
|
||||
CGAL_SMS_TRACE_IMPL("\t" + std::to_string(CGAL::to_double(*tcost)));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if(!(opt_h = pop_from_PQ()))
|
||||
break;
|
||||
|
||||
CGAL_SMS_TRACE(1, "Popped " << edge_to_string(*opt_h));
|
||||
CGAL_assertion(!is_constrained(*opt_h));
|
||||
|
||||
|
|
@ -639,7 +662,7 @@ loop()
|
|||
|
||||
m_visitor.OnNonCollapsable(profile);
|
||||
|
||||
CGAL_SMS_TRACE(1, edge_to_string(*opt_h) << " NOT Collapsible" );
|
||||
CGAL_SMS_TRACE(1, edge_to_string(*opt_h) << " NOT Collapsible (filter)" );
|
||||
}
|
||||
|
||||
#ifdef CGAL_SURF_SIMPL_INTERMEDIATE_STEPS_PRINTING
|
||||
|
|
@ -660,7 +683,7 @@ loop()
|
|||
|
||||
m_visitor.OnNonCollapsable(profile);
|
||||
|
||||
CGAL_SMS_TRACE(1, edge_to_string(*opt_h) << " NOT Collapsible" );
|
||||
CGAL_SMS_TRACE(1, edge_to_string(*opt_h) << " NOT Collapsible (topology)" );
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
@ -823,7 +846,10 @@ is_collapse_topologically_valid(const Profile& profile)
|
|||
{
|
||||
/// ensure two constrained edges cannot get merged
|
||||
if(is_edge_adjacent_to_a_constrained_edge(profile, m_ecm))
|
||||
{
|
||||
CGAL_SMS_TRACE(3," edge to collapse is adjacent to a constrained edge.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if(profile.is_v0_v1_a_border())
|
||||
{
|
||||
|
|
|
|||
|
|
@ -0,0 +1,143 @@
|
|||
// Copyright (c) 2025 GeometryFactory (France). All rights reserved.
|
||||
//
|
||||
// This file is part of CGAL (www.cgal.org).
|
||||
//
|
||||
// $URL$
|
||||
// $Id$
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later OR LicenseRef-Commercial
|
||||
//
|
||||
// Author(s) : Mael Rouxel-Labbé
|
||||
//
|
||||
#ifndef CGAL_SMS_INTERNAL_ROBUST_CROSS_PRODUCT_H
|
||||
#define CGAL_SMS_INTERNAL_ROBUST_CROSS_PRODUCT_H
|
||||
|
||||
#include <CGAL/license/Surface_mesh_simplification.h>
|
||||
|
||||
#include <CGAL/Surface_mesh_simplification/internal/Common.h>
|
||||
|
||||
#include <optional>
|
||||
|
||||
namespace CGAL {
|
||||
namespace Surface_mesh_simplification {
|
||||
namespace internal {
|
||||
|
||||
// a*b - c*d
|
||||
// The next two functions are from https://stackoverflow.com/questions/63665010/accurate-floating-point-computation-of-the-sum-and-difference-of-two-products
|
||||
inline double diff_of_products_kahan(const double a, const double b, const double c, const double d)
|
||||
{
|
||||
double w = d * c;
|
||||
double e = std::fma(c, -d, w);
|
||||
double f = std::fma(a, b, -w);
|
||||
return f + e;
|
||||
}
|
||||
|
||||
inline double diff_of_products_cht(const double a, const double b, const double c, const double d)
|
||||
{
|
||||
double p1 = a * b;
|
||||
double p2 = c * d;
|
||||
double e1 = std::fma (a, b, -p1);
|
||||
double e2 = std::fma (c, -d, p2);
|
||||
double r = p1 - p2;
|
||||
double e = e1 + e2;
|
||||
return r + e;
|
||||
}
|
||||
|
||||
inline double diff_of_products(const double a, const double b, const double c, const double d)
|
||||
{
|
||||
#if 0
|
||||
// this can create large errors with inexact constructions
|
||||
return a*b - c*d;
|
||||
// the next two are equivalent in results and speed
|
||||
#elif 1
|
||||
return diff_of_products_kahan(a, b, c, d);
|
||||
#elif 0
|
||||
return diff_of_products_cht(a, b, c, d);
|
||||
#endif
|
||||
}
|
||||
|
||||
template <typename OFT>
|
||||
inline OFT diff_of_products(const OFT& a, const OFT& b, const OFT& c, const OFT& d)
|
||||
{
|
||||
return a*b - c*d;
|
||||
}
|
||||
|
||||
// balanced solution based on abusing the fact that here we expect u and v to have similar coordinates
|
||||
template<class GeomTraits>
|
||||
typename GeomTraits::Vector_3 similar_coordinates_cross_product(const typename GeomTraits::Vector_3& u,
|
||||
const typename GeomTraits::Vector_3& v)
|
||||
{
|
||||
using FT = typename GeomTraits::FT;
|
||||
using Vector = typename GeomTraits::Vector_3;
|
||||
|
||||
const FT& ux = u.x();
|
||||
const FT& uy = u.y();
|
||||
const FT& uz = u.z();
|
||||
const FT& vx = v.x();
|
||||
const FT& vy = v.y();
|
||||
const FT& vz = v.z();
|
||||
|
||||
auto minor = [](const FT& ui, const FT& vi, const FT& uj, const FT& vj)
|
||||
{
|
||||
// The main idea is that we expect ai and bi (and aj and bj) to have roughly the same magnitude
|
||||
// since this function is used to compute the cross product of two vectors that are defined
|
||||
// as (ORIGIN, pa) and (ORIGIN, pb) and pa and pb are part of the same triangle.
|
||||
//
|
||||
// We can abuse this fact to trade 2 extra subtractions to lower the error.
|
||||
return ui * (vj - uj) + uj * (ui - vi);
|
||||
};
|
||||
|
||||
// ay*
|
||||
FT x = minor(uy, vy, uz, vz);
|
||||
FT y = minor(uz, vz, ux, vx);
|
||||
FT z = minor(ux, vx, uy, vy);
|
||||
|
||||
return Vector(x, y, z);
|
||||
}
|
||||
|
||||
#if 0
|
||||
template<class GeomTraits>
|
||||
typename GeomTraits::Vector_3 exact_cross_product(const typename GeomTraits::Vector_3& a,
|
||||
const typename GeomTraits::Vector_3& b)
|
||||
{
|
||||
CGAL::Cartesian_converter<GeomTraits, CGAL::Exact_predicates_exact_constructions_kernel> to_exact;
|
||||
CGAL::Cartesian_converter<CGAL::Exact_predicates_exact_constructions_kernel, GeomTraits> to_approx;
|
||||
auto exv = cross_product(to_exact(a), to_exact(b));
|
||||
exv.exact();
|
||||
return to_approx(exv);
|
||||
}
|
||||
#endif
|
||||
|
||||
template<class GeomTraits>
|
||||
typename GeomTraits::Vector_3 robust_cross_product(const typename GeomTraits::Vector_3& u,
|
||||
const typename GeomTraits::Vector_3& v)
|
||||
{
|
||||
#if 0
|
||||
// this can create large errors and spiky meshes for kernels with inexact constructions
|
||||
return CGAL::cross_product(u,v);
|
||||
#elif 0
|
||||
// improves the problem mentioned above a bit, but not enough
|
||||
return { std::fma(u.y(), v.z(), -u.z()*v.y()),
|
||||
std::fma(u.z(), v.x(), -u.x()*v.z()),
|
||||
std::fma(u.x(), v.y(), -u.y()*v.x()) };
|
||||
#elif 0
|
||||
// this is the best without resorting to exact, but it inflicts a 20% slowdown
|
||||
return { diff_of_products(u.y(), v.z(), u.z(), v.y()),
|
||||
diff_of_products(u.z(), v.x(), u.x(), v.z()),
|
||||
diff_of_products(u.x(), v.y(), u.y(), v.x()) };
|
||||
#elif 0
|
||||
// obviously too slow
|
||||
return exact_cross_product(u, v);
|
||||
#elif 1
|
||||
// balanced solution based on abusing the fact that in this package, we usually have that
|
||||
// u and v to have similar coordinates
|
||||
return similar_coordinates_cross_product<GeomTraits>(u, v);
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace CGAL
|
||||
} // namespace Surface_mesh_simplification
|
||||
} // namespace internal
|
||||
|
||||
#endif // CGAL_SMS_INTERNAL_ROBUST_CROSS_PRODUCT_H
|
||||
|
||||
|
||||
|
|
@ -6,6 +6,7 @@ project(Surface_mesh_simplification_Tests)
|
|||
|
||||
find_package(CGAL REQUIRED)
|
||||
|
||||
create_single_source_cgal_program("issue_8213.cpp")
|
||||
create_single_source_cgal_program("edge_collapse_topology.cpp")
|
||||
create_single_source_cgal_program("test_edge_collapse_bounded_distance.cpp")
|
||||
create_single_source_cgal_program("test_edge_collapse_Envelope.cpp")
|
||||
|
|
|
|||
|
|
@ -0,0 +1,13 @@
|
|||
OFF
|
||||
5 4 0
|
||||
|
||||
0.60153250345565623 3.2925554343503594 -0.93390733763467004
|
||||
0.50125687092531912 3.266008536541555 -0.80580753798383942
|
||||
0.57499779785916183 3.2558452065056969 -0.97860403852322797
|
||||
0.56586410588624558 3.2541065339825863 -0.99341202997519495
|
||||
0.56756366821062887 3.2478315549358072 -0.99100621040927039
|
||||
|
||||
3 0 1 2
|
||||
3 1 3 2
|
||||
3 1 0 3
|
||||
3 0 4 3
|
||||
|
|
@ -0,0 +1,75 @@
|
|||
#include <CGAL/Simple_cartesian.h>
|
||||
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
|
||||
|
||||
#include <CGAL/Surface_mesh.h>
|
||||
|
||||
#define CGAL_CHECK_EXPENSIVE
|
||||
|
||||
#define CGAL_SURFACE_SIMPLIFICATION_ENABLE_TRACE 5
|
||||
#define CGAL_SURFACE_SIMPLIFICATION_ENABLE_LT_TRACE 4
|
||||
|
||||
void Surface_simplification_external_trace(const std::string& s)
|
||||
{
|
||||
std::cout << s << std::endl;
|
||||
}
|
||||
|
||||
#include <CGAL/Surface_mesh_simplification/edge_collapse.h>
|
||||
#include <CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Bounded_normal_change_filter.h>
|
||||
#include <CGAL/Surface_mesh_simplification/Policies/Edge_collapse/Face_count_stop_predicate.h>
|
||||
#include <CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk_cost.h>
|
||||
#include <CGAL/Surface_mesh_simplification/Policies/Edge_collapse/LindstromTurk_placement.h>
|
||||
|
||||
#include <CGAL/Polygon_mesh_processing/bbox.h>
|
||||
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
namespace SMS = CGAL::Surface_mesh_simplification;
|
||||
namespace PMP = CGAL::Polygon_mesh_processing;
|
||||
|
||||
using Kernel = CGAL::Simple_cartesian<double>;
|
||||
// using Kernel = CGAL::Exact_predicates_exact_constructions_kernel;
|
||||
|
||||
using Surface_mesh = CGAL::Surface_mesh<Kernel::Point_3>;
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
std::cout.precision(17);
|
||||
std::cerr.precision(17);
|
||||
|
||||
const char* filename = (argc > 1) ? argv[1] : "data/issue_8213.off";
|
||||
|
||||
Surface_mesh sm;
|
||||
|
||||
if(!CGAL::IO::read_polygon_mesh(filename, sm))
|
||||
{
|
||||
std::cerr << "Error: failed to read input data" << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
|
||||
CGAL::Bbox_3 bb = PMP::bbox(sm);
|
||||
std::cout << "Bbox:" << bb << std::endl;
|
||||
std::cout << "Input mesh has " << num_vertices(sm) << " vertices" << std::endl;
|
||||
std::cout << "Input mesh has " << num_faces(sm) << " faces" << std::endl;
|
||||
|
||||
SMS::Face_count_stop_predicate<Surface_mesh> stop(1);
|
||||
SMS::edge_collapse(sm, stop,
|
||||
CGAL::parameters::get_cost(SMS::LindstromTurk_cost<Surface_mesh>())
|
||||
.get_placement(SMS::LindstromTurk_placement<Surface_mesh>()));
|
||||
|
||||
CGAL::IO::write_OFF(std::cout, sm, CGAL::parameters::stream_precision(17));
|
||||
|
||||
for(auto v : vertices(sm))
|
||||
{
|
||||
// To be within the bounding box isn't a guarantee, but here it is a sufficient test
|
||||
// to check if things went awry
|
||||
if(!CGAL::do_overlap(bb, sm.point(v).bbox()))
|
||||
{
|
||||
std::cerr << "Error: " << sm.point(v) << " is outside the initial bbox" << std::endl;
|
||||
return EXIT_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
@ -960,7 +960,7 @@ OutputIterator
|
|||
adjacent_vertices(Vertex_handle v, OutputIterator vertices) const;
|
||||
|
||||
/*!
|
||||
Returns the degree of a vertex, that is, the number of incident vertices.
|
||||
Returns the degree of `v`, that is, the number of incident vertices.
|
||||
\pre `v` \f$ \neq\f$ `Vertex_handle()`, `tds.is_vertex(v)`.
|
||||
*/
|
||||
size_type degree(Vertex_handle v) const;
|
||||
|
|
|
|||
|
|
@ -91,6 +91,13 @@ private:
|
|||
std::vector<bool> m_free_vertices{};
|
||||
bool m_flip_smooth_steps{false};
|
||||
|
||||
struct Move
|
||||
{
|
||||
Vector_3 move;
|
||||
int neighbors;
|
||||
FT mass;
|
||||
};
|
||||
|
||||
public:
|
||||
Tetrahedral_remeshing_smoother(const SizingFunction& sizing,
|
||||
const CellSelector& cell_selector,
|
||||
|
|
@ -627,8 +634,8 @@ private:
|
|||
const C3t3& c3t3,
|
||||
const bool boundary_edge = false) const
|
||||
{
|
||||
const auto mwi = midpoint_with_info(e, boundary_edge, c3t3);
|
||||
const FT s = sizing_at_midpoint(e, mwi.dim, mwi.index, m_sizing, c3t3, m_cell_selector);
|
||||
const auto [pt, dim, index] = midpoint_with_info(e, boundary_edge, c3t3);
|
||||
const FT s = sizing_at_midpoint(e, pt, dim, index, m_sizing, c3t3, m_cell_selector);
|
||||
const FT density = 1. / s; //density = 1 / size^(dimension)
|
||||
//edge dimension is 1, so density = 1 / size
|
||||
//to have mass = length * density with no dimension
|
||||
|
|
@ -655,9 +662,8 @@ private:
|
|||
auto& tr = c3t3.triangulation();
|
||||
|
||||
const std::size_t nbv = tr.number_of_vertices();
|
||||
std::vector<Vector_3> moves(nbv, CGAL::NULL_VECTOR);
|
||||
std::vector<int> neighbors(nbv, 0);
|
||||
std::vector<FT> masses(nbv, 0.);
|
||||
const Move default_move{CGAL::NULL_VECTOR, 0 /*neighbors*/, 0. /*mass*/};
|
||||
std::vector<Move> moves(nbv, default_move);
|
||||
|
||||
//collect neighbors
|
||||
for (const Edge& e : c3t3.edges_in_complex())
|
||||
|
|
@ -683,33 +689,35 @@ private:
|
|||
|
||||
if (vh0_moving)
|
||||
{
|
||||
moves[i0] += density * Vector_3(p0, p1);
|
||||
neighbors[i0]++;
|
||||
masses[i0] += density;
|
||||
moves[i0].move += density * Vector_3(p0, p1);
|
||||
moves[i0].mass += density;
|
||||
++moves[i0].neighbors;
|
||||
}
|
||||
if (vh1_moving)
|
||||
{
|
||||
moves[i1] += density * Vector_3(p1, p0);
|
||||
neighbors[i1]++;
|
||||
masses[i1] += density;
|
||||
moves[i1].move += density * Vector_3(p1, p0);
|
||||
moves[i1].mass += density;
|
||||
++moves[i1].neighbors;
|
||||
}
|
||||
}
|
||||
|
||||
// iterate over map of <vertex, id>
|
||||
for (auto [v, vid] : m_vertex_id)
|
||||
// iterate over vertices and move
|
||||
for(Vertex_handle v : tr.finite_vertex_handles())
|
||||
{
|
||||
const std::size_t vid = vertex_id(v);
|
||||
|
||||
if (!is_free(vid) || !is_on_feature(v))
|
||||
continue;
|
||||
|
||||
const Point_3 current_pos = point(v->point());
|
||||
|
||||
const std::size_t nb_neighbors = neighbors[vid];
|
||||
const std::size_t nb_neighbors = moves[vid].neighbors;
|
||||
if(nb_neighbors == 0)
|
||||
continue;
|
||||
|
||||
CGAL_assertion(masses[vid] > 0);
|
||||
CGAL_assertion(moves[vid].mass > 0);
|
||||
const Vector_3 move = (nb_neighbors > 0)
|
||||
? moves[vid] / masses[vid]
|
||||
? moves[vid].move / moves[vid].mass
|
||||
: CGAL::NULL_VECTOR;
|
||||
|
||||
const Point_3 smoothed_position = current_pos + move;
|
||||
|
|
@ -771,9 +779,8 @@ std::size_t smooth_vertices_on_surfaces(C3t3& c3t3,
|
|||
auto& tr = c3t3.triangulation();
|
||||
|
||||
const std::size_t nbv = tr.number_of_vertices();
|
||||
std::vector<Vector_3> moves(nbv, CGAL::NULL_VECTOR);
|
||||
std::vector<int> neighbors(nbv, 0);
|
||||
std::vector<FT> masses(nbv, 0.);
|
||||
const Move default_move{CGAL::NULL_VECTOR, 0 /*neighbors*/, 0. /*mass*/};
|
||||
std::vector<Move> moves(nbv, default_move);
|
||||
|
||||
for (const Edge& e : tr.finite_edges())
|
||||
{
|
||||
|
|
@ -797,26 +804,28 @@ std::size_t smooth_vertices_on_surfaces(C3t3& c3t3,
|
|||
|
||||
if (vh0_moving)
|
||||
{
|
||||
moves[i0] += density * Vector_3(p0, p1);
|
||||
neighbors[i0]++;
|
||||
masses[i0] += density;
|
||||
moves[i0].move += density * Vector_3(p0, p1);
|
||||
moves[i0].mass += density;
|
||||
++moves[i0].neighbors;
|
||||
}
|
||||
if (vh1_moving)
|
||||
{
|
||||
moves[i1] += density * Vector_3(p1, p0);
|
||||
neighbors[i1]++;
|
||||
masses[i1] += density;
|
||||
moves[i1].move += density * Vector_3(p1, p0);
|
||||
moves[i1].mass += density;
|
||||
++moves[i1].neighbors;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// iterate over map of <vertex, id>
|
||||
for (auto [v, vid] : m_vertex_id)
|
||||
// iterate over vertices and move
|
||||
for(Vertex_handle v : tr.finite_vertex_handles())
|
||||
{
|
||||
const std::size_t vid = vertex_id(v);
|
||||
|
||||
if (!is_free(vid) || v->in_dimension() != 2)
|
||||
continue;
|
||||
|
||||
const std::size_t nb_neighbors = neighbors[vid];
|
||||
const std::size_t nb_neighbors = moves[vid].neighbors;
|
||||
const Point_3 current_pos = point(v->point());
|
||||
|
||||
const auto& incident_surface_patches = vertices_surface_indices.at(v);
|
||||
|
|
@ -830,7 +839,7 @@ std::size_t smooth_vertices_on_surfaces(C3t3& c3t3,
|
|||
|
||||
if (nb_neighbors > 1)
|
||||
{
|
||||
const Vector_3 move = moves[vid] / masses[vid];
|
||||
const Vector_3 move = moves[vid].move / moves[vid].mass;
|
||||
const Point_3 smoothed_position = point(v->point()) + move;
|
||||
|
||||
#ifdef CGAL_TET_REMESHING_SMOOTHING_WITH_MLS
|
||||
|
|
@ -969,9 +978,9 @@ std::size_t smooth_internal_vertices(C3t3& c3t3,
|
|||
auto& tr = c3t3.triangulation();
|
||||
|
||||
const std::size_t nbv = tr.number_of_vertices();
|
||||
std::vector<Vector_3> moves(nbv, CGAL::NULL_VECTOR);
|
||||
std::vector<int> neighbors(nbv, 0);/*for dim 3 vertices, start counting directly from 0*/
|
||||
std::vector<FT> masses(nbv, 0.);
|
||||
const Move default_move{CGAL::NULL_VECTOR, 0 /*neighbors*/, 0. /*mass*/};
|
||||
std::vector<Move> moves(nbv, default_move);
|
||||
/*for dim 3 vertices, start counting neighbors directly from 0*/
|
||||
|
||||
for (const Edge& e : tr.finite_edges())
|
||||
{
|
||||
|
|
@ -979,8 +988,7 @@ std::size_t smooth_internal_vertices(C3t3& c3t3,
|
|||
continue;
|
||||
else
|
||||
{
|
||||
const Vertex_handle vh0 = e.first->vertex(e.second);
|
||||
const Vertex_handle vh1 = e.first->vertex(e.third);
|
||||
const auto [vh0, vh1] = make_vertex_pair(e);
|
||||
|
||||
const std::size_t& i0 = vertex_id(vh0);
|
||||
const std::size_t& i1 = vertex_id(vh1);
|
||||
|
|
@ -997,31 +1005,32 @@ std::size_t smooth_internal_vertices(C3t3& c3t3,
|
|||
|
||||
if (vh0_moving)
|
||||
{
|
||||
moves[i0] += density * Vector_3(p0, p1);
|
||||
neighbors[i0]++;
|
||||
masses[i0] += density;
|
||||
moves[i0].move += density * Vector_3(p0, p1);
|
||||
moves[i0].mass += density;
|
||||
++moves[i0].neighbors;
|
||||
}
|
||||
if (vh1_moving)
|
||||
{
|
||||
moves[i1] += density * Vector_3(p1, p0);
|
||||
neighbors[i1]++;
|
||||
masses[i1] += density;
|
||||
moves[i1].move += density * Vector_3(p1, p0);
|
||||
moves[i1].mass += density;
|
||||
++moves[i1].neighbors;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// iterate over map of <vertex, id>
|
||||
for (auto [v, vid] : m_vertex_id)
|
||||
// iterate over vertices and move
|
||||
for(Vertex_handle v : tr.finite_vertex_handles())
|
||||
{
|
||||
const std::size_t vid = vertex_id(v);
|
||||
if (!is_free(vid))
|
||||
continue;
|
||||
|
||||
if (c3t3.in_dimension(v) == 3 && neighbors[vid] > 1)
|
||||
if (c3t3.in_dimension(v) == 3 && moves[vid].neighbors > 1)
|
||||
{
|
||||
#ifdef CGAL_TETRAHEDRAL_REMESHING_DEBUG
|
||||
os_vol << "2 " << point(v->point());
|
||||
#endif
|
||||
const Vector_3 move = moves[vid] / masses[vid];// static_cast<FT>(neighbors[vid]);
|
||||
const Vector_3 move = moves[vid].move / moves[vid].mass;// static_cast<FT>(neighbors[vid]);
|
||||
Point_3 new_pos = point(v->point()) + move;
|
||||
if (check_inversion_and_move(v, new_pos, inc_cells[vid], tr, total_move)){
|
||||
nb_done_3d++;
|
||||
|
|
|
|||
|
|
@ -1439,6 +1439,7 @@ auto sizing_at_vertex(const Vertex_handle v,
|
|||
|
||||
template<typename Sizing, typename C3t3, typename Cell_selector>
|
||||
auto sizing_at_midpoint(const typename C3t3::Edge& e,
|
||||
const typename C3t3::Triangulation::Geom_traits::Point_3& m, // edge midpoint
|
||||
const int dim,
|
||||
const typename C3t3::Index& index,
|
||||
const Sizing& sizing,
|
||||
|
|
@ -1446,17 +1447,13 @@ auto sizing_at_midpoint(const typename C3t3::Edge& e,
|
|||
const Cell_selector& cell_selector)
|
||||
{
|
||||
using FT = typename C3t3::Triangulation::Geom_traits::FT;
|
||||
using Point_3 = typename C3t3::Triangulation::Geom_traits::Point_3;
|
||||
|
||||
auto cp = c3t3.triangulation().geom_traits().construct_point_3_object();
|
||||
const Point_3 m = CGAL::midpoint(cp(e.first->vertex(e.second)->point()),
|
||||
cp(e.first->vertex(e.third)->point()));
|
||||
|
||||
const FT size = sizing(m, dim, index);
|
||||
|
||||
if (dim < 3 && size == 0)
|
||||
{
|
||||
const auto u = e.first->vertex(e.second);
|
||||
const auto v = e.first->vertex(e.third);
|
||||
const auto [u, v] = make_vertex_pair(e);
|
||||
|
||||
const FT size_at_u = sizing(cp(u->point()), u->in_dimension(), u->index());
|
||||
const FT size_at_v = sizing(cp(v->point()), v->in_dimension(), v->index());
|
||||
|
|
@ -1572,7 +1569,6 @@ auto midpoint_with_info(const typename C3t3::Edge& e,
|
|||
const C3t3& c3t3)
|
||||
{
|
||||
using Tr = typename C3t3::Triangulation;
|
||||
using Vertex_handle = typename Tr::Vertex_handle;
|
||||
using Gt = typename Tr::Geom_traits;
|
||||
using Point_3 = typename Gt::Point_3;
|
||||
using Index = typename C3t3::Index;
|
||||
|
|
@ -1584,9 +1580,7 @@ auto midpoint_with_info(const typename C3t3::Edge& e,
|
|||
Index index;
|
||||
};
|
||||
|
||||
const auto vs = c3t3.triangulation().vertices(e);
|
||||
const Vertex_handle u = vs[0];
|
||||
const Vertex_handle v = vs[1];
|
||||
const auto [u, v] = make_vertex_pair(e);
|
||||
|
||||
const auto& gt = c3t3.triangulation().geom_traits();
|
||||
auto cp = gt.construct_point_3_object();
|
||||
|
|
|
|||
|
|
@ -16,6 +16,7 @@ create_single_source_cgal_program("test_tetrahedral_remeshing_with_features.cpp"
|
|||
create_single_source_cgal_program("test_tetrahedral_remeshing_of_one_subdomain.cpp")
|
||||
create_single_source_cgal_program("test_tetrahedral_remeshing_io.cpp")
|
||||
create_single_source_cgal_program("test_tetrahedral_remeshing_from_mesh_file.cpp")
|
||||
create_single_source_cgal_program("test_tetrahedral_remeshing_determinism.cpp")
|
||||
|
||||
# Test MLS projection
|
||||
add_executable(test_tetrahedral_remeshing_mls
|
||||
|
|
|
|||
|
|
@ -0,0 +1,104 @@
|
|||
//#define CGAL_TETRAHEDRAL_REMESHING_VERBOSE
|
||||
//#define CGAL_TETRAHEDRAL_REMESHING_DEBUG
|
||||
|
||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||
|
||||
#include <CGAL/Tetrahedral_remeshing/Remeshing_triangulation_3.h>
|
||||
#include <CGAL/tetrahedral_remeshing.h>
|
||||
#include <CGAL/Tetrahedral_remeshing/tetrahedral_remeshing_io.h>
|
||||
#include <CGAL/Random.h>
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <cassert>
|
||||
|
||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
|
||||
|
||||
typedef CGAL::Tetrahedral_remeshing::Remeshing_triangulation_3<K> Remeshing_triangulation;
|
||||
|
||||
template<typename T3>
|
||||
void generate_input_one_subdomain(const std::size_t nbv, T3& tr)
|
||||
{
|
||||
CGAL::Random rng;
|
||||
|
||||
typedef typename T3::Point Point;
|
||||
std::vector<Point> pts;
|
||||
while (pts.size() < nbv)
|
||||
{
|
||||
const float x = rng.uniform_real(-10.f, 10.f);
|
||||
const float y = rng.uniform_real(-10.f, 10.f);
|
||||
const float z = rng.uniform_real(-10.f, 10.f);
|
||||
|
||||
pts.push_back(Point(x, y, z));
|
||||
}
|
||||
tr.insert(pts.begin(), pts.end());
|
||||
|
||||
for (typename T3::Cell_handle c : tr.finite_cell_handles())
|
||||
c->set_subdomain_index(1);
|
||||
|
||||
assert(tr.is_valid(true));
|
||||
|
||||
#ifdef CGAL_TETRAHEDRAL_REMESHING_GENERATE_INPUT_FILES
|
||||
std::ofstream out("data/triangulation_one_subdomain.binary.cgal",
|
||||
std::ios_base::out | std::ios_base::binary);
|
||||
CGAL::save_binary_triangulation(out, tr);
|
||||
out.close();
|
||||
#endif
|
||||
}
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
std::cout << "CGAL Random seed = " << CGAL::get_default_random().get_seed() << std::endl;
|
||||
|
||||
// Collect options
|
||||
std::size_t nb_runs = 5;
|
||||
|
||||
Remeshing_triangulation tr;
|
||||
generate_input_one_subdomain(1000, tr);
|
||||
|
||||
const int target_edge_length = (argc > 1) ? atoi(argv[1]) : 1;
|
||||
|
||||
std::ofstream ofs0("in.mesh");
|
||||
CGAL::IO::write_MEDIT(ofs0, tr);
|
||||
ofs0.close();
|
||||
|
||||
const Remeshing_triangulation tr_ref = tr; // Keep a reference for comparison
|
||||
|
||||
std::vector<std::string> output_tr;
|
||||
output_tr.reserve(nb_runs);
|
||||
|
||||
for(std::size_t i = 0; i < nb_runs; ++i)
|
||||
{
|
||||
std::cout << "Run " << i << " of " << nb_runs << std::endl;
|
||||
|
||||
tr = tr_ref; // Reset triangulation to reference
|
||||
CGAL::tetrahedral_isotropic_remeshing(tr, target_edge_length);
|
||||
|
||||
std::ostringstream oss;
|
||||
CGAL::IO::write_MEDIT(oss, tr);
|
||||
output_tr.push_back(oss.str());
|
||||
oss.clear();
|
||||
|
||||
if(i == 0)
|
||||
continue; // skip first run, it is the reference
|
||||
else
|
||||
{
|
||||
if(0 != output_tr[i-1].compare(output_tr[i]))
|
||||
{
|
||||
std::cerr << "******************************************" << std::endl;
|
||||
std::cerr << "*** Run " << i << " differs from run " << i-1 << std::endl;
|
||||
assert(false); // This should not happen
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cout << "******************************************" << std::endl;
|
||||
std::cout << "*** Run " << i << " is identical to run " << i - 1 << std::endl;
|
||||
std::cout << "******************************************" << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
||||
|
|
@ -11,10 +11,17 @@ include(CGAL_Eigen3_support)
|
|||
if(TARGET CGAL::Eigen3_support)
|
||||
include_directories(BEFORE "include")
|
||||
|
||||
create_single_source_cgal_program("generate_d.cpp")
|
||||
create_single_source_cgal_program("bench4d.cpp")
|
||||
create_single_source_cgal_program("bench5d.cpp")
|
||||
create_single_source_cgal_program("bench6d.cpp")
|
||||
create_single_source_cgal_program("delaunay.cpp")
|
||||
target_link_libraries(delaunay PRIVATE CGAL::Eigen3_support)
|
||||
create_single_source_cgal_program("Td_vs_T2_and_T3.cpp")
|
||||
target_link_libraries(Td_vs_T2_and_T3 PRIVATE CGAL::Eigen3_support)
|
||||
target_link_libraries(bench4d PRIVATE CGAL::Eigen3_support)
|
||||
target_link_libraries(bench5d PRIVATE CGAL::Eigen3_support)
|
||||
target_link_libraries(bench6d PRIVATE CGAL::Eigen3_support)
|
||||
else()
|
||||
message("NOTICE: Executables in this directory require Eigen 3.1 (or greater), and will not be compiled.")
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -0,0 +1,64 @@
|
|||
// Switch off the static filters for 4, 5, and 6 points.
|
||||
// #define CGAL_NO_STATIC_FILTER_456
|
||||
|
||||
#include <CGAL/Epick_d.h>
|
||||
#include <CGAL/Triangulation.h>
|
||||
#include <CGAL/algorithm.h>
|
||||
#include <CGAL/Timer.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <iterator>
|
||||
#include <vector>
|
||||
|
||||
typedef CGAL::Epick_d< CGAL::Dimension_tag<4> > K;
|
||||
typedef CGAL::Triangulation_vertex<K> Vertex;
|
||||
typedef CGAL::Triangulation_ds_full_cell<void,CGAL::TDS_full_cell_mirror_storage_policy> DS_full_cell;
|
||||
typedef CGAL::Triangulation_full_cell<K,CGAL::No_full_cell_data, DS_full_cell> Full_cell;
|
||||
typedef CGAL::Triangulation_data_structure<CGAL::Dimension_tag<4>,
|
||||
Vertex,
|
||||
Full_cell> TDS;
|
||||
typedef CGAL::Triangulation<K,TDS> Triangulation;
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
const int D = 4; // we work in Euclidean 4-space
|
||||
|
||||
std::vector<Triangulation::Point> points;
|
||||
std::ifstream in("points_4.txt");
|
||||
Triangulation::Point p;
|
||||
int d;
|
||||
in >> d;
|
||||
assert(d == D);
|
||||
int n;
|
||||
in >> n;
|
||||
std::cout << n << " points in dimension " << d << std::endl;
|
||||
points.reserve(n);
|
||||
while (in >> p) {
|
||||
points.push_back(p);
|
||||
}
|
||||
CGAL::Timer timer;
|
||||
timer.start();
|
||||
Triangulation t(D); // create triangulation
|
||||
assert(t.empty());
|
||||
|
||||
//std::array<double, 4> ar = { 0, 0, 0, 0};
|
||||
//Triangulation::Point orig(ar.begin(), ar.end());
|
||||
//t.insert(orig); // insert origin
|
||||
t.insert(points.begin(), points.end()); // compute triangulation
|
||||
|
||||
std::cout << "Time taken to insert "<< points.size() << " points: " << timer.time() << " seconds." << std::endl;
|
||||
timer.reset();
|
||||
assert( t.is_valid() );
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - STEP 2
|
||||
typedef Triangulation::Face Face;
|
||||
typedef std::vector<Face> Faces;
|
||||
Faces edges;
|
||||
std::back_insert_iterator<Faces> out(edges);
|
||||
t.tds().incident_faces(t.infinite_vertex(), 1, out);
|
||||
// collect faces of dimension 1 (edges) incident to the infinite vertex
|
||||
std::cout << "There are " << edges.size()
|
||||
<< " vertices on the convex hull." << std::endl;
|
||||
std::cout << "Time taken to find edges: " << timer.time() << " seconds." << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,64 @@
|
|||
// Switch off the static filters for 4, 5, and 6 points.
|
||||
// #define CGAL_NO_STATIC_FILTER_456
|
||||
|
||||
#include <CGAL/Epick_d.h>
|
||||
#include <CGAL/Triangulation.h>
|
||||
#include <CGAL/algorithm.h>
|
||||
#include <CGAL/Timer.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <iterator>
|
||||
#include <vector>
|
||||
|
||||
typedef CGAL::Epick_d< CGAL::Dimension_tag<5> > K;
|
||||
typedef CGAL::Triangulation_vertex<K> Vertex;
|
||||
typedef CGAL::Triangulation_ds_full_cell<void,CGAL::TDS_full_cell_mirror_storage_policy> DS_full_cell;
|
||||
typedef CGAL::Triangulation_full_cell<K,CGAL::No_full_cell_data, DS_full_cell> Full_cell;
|
||||
typedef CGAL::Triangulation_data_structure<CGAL::Dimension_tag<5>,
|
||||
Vertex,
|
||||
Full_cell> TDS;
|
||||
typedef CGAL::Triangulation<K,TDS> Triangulation;
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
const int D = 5; // we work in Euclidean 5-space
|
||||
|
||||
std::vector<Triangulation::Point> points;
|
||||
std::ifstream in("points_5.txt");
|
||||
Triangulation::Point p;
|
||||
int d;
|
||||
in >> d;
|
||||
assert(d == D);
|
||||
int n;
|
||||
in >> n;
|
||||
points.reserve(n);
|
||||
while (in >> p) {
|
||||
points.push_back(p);
|
||||
}
|
||||
|
||||
CGAL::Timer timer;
|
||||
timer.start();
|
||||
Triangulation t(D); // create triangulation
|
||||
assert(t.empty());
|
||||
|
||||
//std::array<double, 5> ar = { 0, 0, 0, 0, 0 };
|
||||
//Triangulation::Point orig(ar.begin(), ar.end());
|
||||
//t.insert(orig); // insert origin
|
||||
t.insert(points.begin(), points.end()); // compute triangulation
|
||||
|
||||
std::cout << "Time taken to insert "<< points.size() << " points: " << timer.time() << " seconds." << std::endl;
|
||||
timer.reset();
|
||||
assert( t.is_valid() );
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - STEP 2
|
||||
typedef Triangulation::Face Face;
|
||||
typedef std::vector<Face> Faces;
|
||||
Faces edges;
|
||||
std::back_insert_iterator<Faces> out(edges);
|
||||
t.tds().incident_faces(t.infinite_vertex(), 1, out);
|
||||
// collect faces of dimension 1 (edges) incident to the infinite vertex
|
||||
std::cout << "There are " << edges.size()
|
||||
<< " vertices on the convex hull." << std::endl;
|
||||
std::cout << "Time taken to find edges: " << timer.time() << " seconds." << std::endl;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,83 @@
|
|||
|
||||
#include <CGAL/Epick_d.h>
|
||||
#include <CGAL/Triangulation.h>
|
||||
#include <CGAL/algorithm.h>
|
||||
#include <CGAL/Timer.h>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <iterator>
|
||||
#include <vector>
|
||||
|
||||
typedef CGAL::Epick_d< CGAL::Dimension_tag<6> > K;
|
||||
typedef CGAL::Triangulation_vertex<K, std::ptrdiff_t> Vertex;
|
||||
typedef CGAL::Triangulation_ds_full_cell<void,CGAL::TDS_full_cell_mirror_storage_policy> DS_full_cell;
|
||||
typedef CGAL::Triangulation_full_cell<K,CGAL::No_full_cell_data, DS_full_cell> Full_cell;
|
||||
typedef CGAL::Triangulation_data_structure<CGAL::Dimension_tag<6>,
|
||||
Vertex,
|
||||
Full_cell> TDS;
|
||||
typedef CGAL::Triangulation<K,TDS> Triangulation;
|
||||
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
const int D = 6; // we work in Euclidean 6-space
|
||||
|
||||
std::vector<Triangulation::Point> points;
|
||||
std::ifstream in(argv[1]);
|
||||
Triangulation::Point p;
|
||||
int d;
|
||||
in >> d;
|
||||
assert(d == D);
|
||||
int n;
|
||||
in >> n;
|
||||
points.reserve(n);
|
||||
while (in >> p) {
|
||||
points.push_back(p);
|
||||
}
|
||||
|
||||
CGAL::Timer timer;
|
||||
timer.start();
|
||||
Triangulation t(D); // create triangulation
|
||||
assert(t.empty());
|
||||
|
||||
|
||||
t.insert_and_index(points.begin(), points.end()); // compute triangulation
|
||||
|
||||
std::cout << "Time taken to insert "<< points.size() << " points: " << timer.time() << " seconds." << std::endl;
|
||||
timer.reset();
|
||||
assert( t.is_valid() );
|
||||
|
||||
std::vector<Triangulation::Full_cell_handle> infinite_cells;
|
||||
t.tds().incident_full_cells(t.infinite_vertex(), std::back_inserter(infinite_cells));
|
||||
|
||||
return 0;
|
||||
std::set<std::pair<std::ptrdiff_t, std::ptrdiff_t>> edges;
|
||||
|
||||
for(auto ch : infinite_cells) {
|
||||
std::vector<Triangulation::Vertex_handle> vertices;
|
||||
std::cout << "cell" << std::endl;
|
||||
vertices.reserve(D);
|
||||
for(int i = 0; i < D + 1; ++i) {
|
||||
if(ch->vertex(i) != t.infinite_vertex()) {
|
||||
vertices.push_back(ch->vertex(i));
|
||||
std::cout << ch->vertex(i)->data() << " ";
|
||||
}
|
||||
}
|
||||
std::cout << std::endl;
|
||||
for (int i = 0; i < D-1; i++) {
|
||||
for (int j = 0; j < D-1; j++) {
|
||||
|
||||
if((i != j) && (vertices[i]->data() < vertices[j]->data())) {
|
||||
edges.insert(std::make_pair(vertices[i]->data(), vertices[j]->data()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for(auto pair : edges) {
|
||||
std::cout << "edge between vertices " << pair.first << " and " << pair.second << std::endl;
|
||||
}
|
||||
|
||||
std::cout << "Time taken to find edges: " << timer.time() << " seconds." << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,24 @@
|
|||
#include <CGAL/Random.h>
|
||||
#include <array>
|
||||
#include <iostream>
|
||||
|
||||
int main() {
|
||||
CGAL::Random rng;
|
||||
std::cout.precision(17);
|
||||
std ::cout << 4 << std::endl;
|
||||
std::cout << 100000 << std::endl;
|
||||
for(int i = 0; i < 100000; ++i) {
|
||||
std::array<double, 4> arr;
|
||||
double slength = 0;
|
||||
for(int i = 0; i < arr.size(); ++i) {
|
||||
arr[i] = rng.get_double(-1, 1);
|
||||
slength += arr[i] * arr[i];
|
||||
}
|
||||
slength = std::sqrt(slength);
|
||||
for(int i = 0; i < arr.size(); ++i) {
|
||||
arr[i] /= slength;
|
||||
}
|
||||
std::cout << "4 " << arr[0] << " " << arr[1] << " " << arr[2] << " " << arr[3] /* << " " << arr[4] /* << " " << arr[5] */ << std::endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
|
||||
namespace CGAL {
|
||||
|
||||
/*!
|
||||
\ingroup PkgTriangulationsRef
|
||||
A tag class to indicate that no mirror indices are stored in full cells.
|
||||
*/
|
||||
class TDS_full_cell_default_storage_policy
|
||||
{};
|
||||
}
|
||||
|
|
@ -0,0 +1,11 @@
|
|||
|
||||
namespace CGAL {
|
||||
|
||||
/*!
|
||||
\ingroup PkgTriangulationsRef
|
||||
A tag class to indicate that mirror indices are stored in full cells.
|
||||
\pre The dimension is not larger than 127.
|
||||
*/
|
||||
class TDS_full_cell_mirror_storage_policy
|
||||
{};
|
||||
}
|
||||
|
|
@ -520,7 +520,7 @@ position `p`. Returns a handle to that vertex.
|
|||
\pre The boundary of the union of full cells incident to `f` must be a triangulation of a
|
||||
sphere of dimension `tr`.`current_dimension()`).
|
||||
*/
|
||||
Vertex_handle collapse_face(const Point & p, const Face & f);
|
||||
Vertex_handle contract_face(const Point & p, const Face & f);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ which is also the unique vertex and the unique full cell in the
|
|||
`TriangulationDataStructure`.
|
||||
In a
|
||||
geometric realization of the `TriangulationDataStructure` (<I>e.g.</I>, in a
|
||||
`Triangulation<TriangulationTraits_, TriangulationDataStructure_>` or a
|
||||
`Delaunay_triangulation<DelaunayTriangulationTraits_, TriangulationDataStructure_>`), this vertex
|
||||
`CGAL::Triangulation<TriangulationTraits_, TriangulationDataStructure_>` or a
|
||||
`CGAL::Delaunay_triangulation<DelaunayTriangulationTraits_, TriangulationDataStructure_>`), this vertex
|
||||
corresponds to <I>the vertex at infinity</I>.
|
||||
|
||||
<DT><B>0</B><DD> This corresponds to two vertices, each incident to one \f$ 0\f$-face;
|
||||
|
|
@ -456,14 +456,14 @@ Insertion in a hole, \f$ d=2\f$
|
|||
\cgalAdvancedEnd
|
||||
*/
|
||||
template< class ForwardIterator > Vertex_handle
|
||||
insert_in_hole(ForwardIterator start, ForwardIterator end, Facet f);
|
||||
insert_in_hole(ForwardIterator s, ForwardIterator e, Facet f);
|
||||
|
||||
/*!
|
||||
Same as above, but handles to the new full cells are
|
||||
appended to the `out` output iterator.
|
||||
*/
|
||||
template< class ForwardIterator, class OutputIterator >
|
||||
Vertex_handle insert_in_hole(ForwardIterator start, ForwardIterator end, Facet
|
||||
Vertex_handle insert_in_hole(ForwardIterator s, ForwardIterator e, Facet
|
||||
f, OutputIterator out);
|
||||
|
||||
/*!
|
||||
|
|
@ -594,7 +594,7 @@ Calls `delete_full_cell` over an iterator range of value type `Full_cell_handle`
|
|||
\cgalAdvancedEnd
|
||||
*/
|
||||
template< typename ForwardIterator > void
|
||||
delete_full_cells(ForwardIterator start, ForwardIterator end);
|
||||
delete_full_cells(ForwardIterator s, ForwardIterator e);
|
||||
|
||||
/// @}
|
||||
|
||||
|
|
|
|||
|
|
@ -101,6 +101,8 @@ The latter two concepts are also abbreviated respectively as `TrVertex` and `TrF
|
|||
- `CGAL::Triangulation_ds_vertex<TriangulationDataStructure_>`
|
||||
- `CGAL::Triangulation_ds_full_cell<TriangulationDataStructure_, TriangulationDSFullCellStoragePolicy>`
|
||||
- `CGAL::Triangulation_face<TriangulationDataStructure_>`
|
||||
- `CGAL::TDS_full_cell_default_storage_policy`
|
||||
- `CGAL::TDS_full_cell_mirror_storage_policy`
|
||||
|
||||
\cgalCRPSection{(Geometric) Triangulations}
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,8 @@
|
|||
#include <CGAL/Triangulation_vertex.h>
|
||||
#include <CGAL/Iterator_project.h>
|
||||
#include <CGAL/spatial_sort.h>
|
||||
#include <CGAL/Spatial_sort_traits_adapter_d.h>
|
||||
#include <CGAL/property_map.h> // for CGAL::Identity_property_map
|
||||
#include <CGAL/Dimension.h>
|
||||
#include <CGAL/iterator.h>
|
||||
#include <CGAL/Default.h>
|
||||
|
|
@ -721,6 +723,34 @@ public:
|
|||
}
|
||||
return number_of_vertices() - n;
|
||||
}
|
||||
|
||||
|
||||
template< typename RandomAccessIterator >
|
||||
size_type insert_and_index(RandomAccessIterator start, RandomAccessIterator end)
|
||||
{
|
||||
size_type n = number_of_vertices();
|
||||
std::vector<std::ptrdiff_t> indices(boost::counting_iterator<std::ptrdiff_t>(0),
|
||||
boost::counting_iterator<std::ptrdiff_t>(end - start));
|
||||
|
||||
using Point_property_map = boost::iterator_property_map<RandomAccessIterator,
|
||||
CGAL::Identity_property_map<std::ptrdiff_t>>;
|
||||
using Search_traits_d = CGAL::Spatial_sort_traits_adapter_d<Geom_traits, Point_property_map>;
|
||||
|
||||
CGAL::spatial_sort(indices.begin(), indices.end(), Search_traits_d(start));
|
||||
Full_cell_handle hint = Full_cell_handle();
|
||||
|
||||
for (auto index : indices) {
|
||||
typename Triangulation::Vertex_handle pos = insert(*(start+index), hint);
|
||||
if (pos != nullptr) {
|
||||
// Save index value as data to retrieve it after insertion
|
||||
pos->data() = n+index;
|
||||
hint = pos->full_cell();
|
||||
}
|
||||
}
|
||||
return number_of_vertices() - n;
|
||||
}
|
||||
|
||||
|
||||
Vertex_handle insert(const Point &, Locate_type, const Face &, const Facet &, Full_cell_handle);
|
||||
Vertex_handle insert(const Point &, Full_cell_handle start = Full_cell_handle());
|
||||
Vertex_handle insert(const Point &, Vertex_handle);
|
||||
|
|
|
|||
|
|
@ -30,8 +30,11 @@
|
|||
#include <algorithm>
|
||||
#include <vector>
|
||||
#include <queue>
|
||||
#include <stack>
|
||||
#include <set>
|
||||
|
||||
#include <boost/iterator/counting_iterator.hpp>
|
||||
|
||||
namespace CGAL {
|
||||
|
||||
template< class Dimen,
|
||||
|
|
@ -138,7 +141,7 @@ protected: // DATA MEMBERS
|
|||
int dmax_, dcur_; // dimension of the current triangulation
|
||||
Vertex_container vertices_; // list of all vertices
|
||||
Full_cell_container full_cells_; // list of all full cells
|
||||
|
||||
mutable std::vector<Full_cell_handle> visited;
|
||||
private:
|
||||
|
||||
void clean_dynamic_memory()
|
||||
|
|
@ -306,10 +309,10 @@ public:
|
|||
return s->mirror_index(i);
|
||||
}
|
||||
|
||||
int mirror_vertex(Full_cell_handle s, int i) const /* Concept */
|
||||
Vertex_handle mirror_vertex(Full_cell_handle s, int i) const /* Concept */
|
||||
{
|
||||
CGAL_precondition(Full_cell_handle() != s && check_range(i));
|
||||
return s->mirror_vertex(i);
|
||||
return s->mirror_vertex(i, current_dimension());
|
||||
}
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - FACETS OPERATIONS
|
||||
|
|
@ -365,7 +368,7 @@ protected:
|
|||
public:
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - REMOVALS
|
||||
|
||||
Vertex_handle collapse_face(const Face &); /* Concept */
|
||||
Vertex_handle contract_face(const Face &); /* Concept */
|
||||
void remove_decrease_dimension(Vertex_handle, Vertex_handle); /* Concept */
|
||||
|
||||
// - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - INSERTIONS
|
||||
|
|
@ -374,12 +377,12 @@ public:
|
|||
Vertex_handle insert_in_face(const Face &); /* Concept */
|
||||
Vertex_handle insert_in_facet(const Facet &); /* Concept */
|
||||
template< typename Forward_iterator >
|
||||
Vertex_handle insert_in_hole(Forward_iterator, Forward_iterator, Facet); /* Concept */
|
||||
Vertex_handle insert_in_hole(Forward_iterator, Forward_iterator, const Facet&); /* Concept */
|
||||
template< typename Forward_iterator, typename OutputIterator >
|
||||
Vertex_handle insert_in_hole(Forward_iterator, Forward_iterator, Facet, OutputIterator); /* Concept */
|
||||
Vertex_handle insert_in_hole(Forward_iterator, Forward_iterator, const Facet&, OutputIterator); /* Concept */
|
||||
|
||||
template< typename OutputIterator >
|
||||
Full_cell_handle insert_in_tagged_hole(Vertex_handle, Facet, OutputIterator);
|
||||
Full_cell_handle insert_in_tagged_hole(Vertex_handle, const Facet&, OutputIterator);
|
||||
|
||||
Vertex_handle insert_increase_dimension(Vertex_handle=Vertex_handle()); /* Concept */
|
||||
|
||||
|
|
@ -667,8 +670,10 @@ Triangulation_data_structure<Dim, Vb, Fcb>
|
|||
TraversalPredicate & tp,
|
||||
OutputIterator & out) const /* Concept */
|
||||
{
|
||||
CGAL_precondition(visited.empty());
|
||||
std::queue<Full_cell_handle> queue;
|
||||
set_visited(start, true);
|
||||
visited.push_back(start);
|
||||
queue.push(start);
|
||||
const int cur_dim = current_dimension();
|
||||
Facet ft;
|
||||
|
|
@ -684,6 +689,7 @@ Triangulation_data_structure<Dim, Vb, Fcb>
|
|||
if( ! get_visited(n) )
|
||||
{
|
||||
set_visited(n, true);
|
||||
visited.push_back(n);
|
||||
if( tp(Facet(s, i)) )
|
||||
queue.push(n);
|
||||
else
|
||||
|
|
@ -691,7 +697,9 @@ Triangulation_data_structure<Dim, Vb, Fcb>
|
|||
}
|
||||
}
|
||||
}
|
||||
clear_visited_marks(start);
|
||||
for(auto fch : visited)
|
||||
set_visited(fch, false);
|
||||
visited.clear();
|
||||
return ft;
|
||||
}
|
||||
|
||||
|
|
@ -776,13 +784,13 @@ Triangulation_data_structure<Dim, Vb, Fcb>
|
|||
template <class Dim, class Vb, class Fcb>
|
||||
typename Triangulation_data_structure<Dim, Vb, Fcb>::Vertex_handle
|
||||
Triangulation_data_structure<Dim, Vb, Fcb>
|
||||
::collapse_face(const Face & f) /* Concept */
|
||||
::contract_face(const Face & f) /* Concept */
|
||||
{
|
||||
const int fd = f.face_dimension();
|
||||
CGAL_precondition( (1 <= fd ) && (fd < current_dimension()));
|
||||
std::vector<Full_cell_handle> simps;
|
||||
// save the Face's vertices:
|
||||
Full_cell s;
|
||||
Full_cell s(current_dimension());
|
||||
for( int i = 0; i <= fd; ++i )
|
||||
s.set_vertex(i, f.vertex(i));
|
||||
// compute the star of f
|
||||
|
|
@ -926,7 +934,7 @@ template <class Dim, class Vb, class Fcb >
|
|||
template < typename OutputIterator >
|
||||
typename Triangulation_data_structure<Dim, Vb, Fcb>::Full_cell_handle
|
||||
Triangulation_data_structure<Dim, Vb, Fcb>
|
||||
::insert_in_tagged_hole(Vertex_handle v, Facet f,
|
||||
::insert_in_tagged_hole(Vertex_handle v, const Facet& f,
|
||||
OutputIterator new_full_cells)
|
||||
{
|
||||
CGAL_assertion_msg(is_boundary_facet(f), "starting facet should be on the hole boundary");
|
||||
|
|
@ -934,13 +942,13 @@ Triangulation_data_structure<Dim, Vb, Fcb>
|
|||
const int cur_dim = current_dimension();
|
||||
Full_cell_handle new_s;
|
||||
|
||||
std::queue<IITH_task> task_queue;
|
||||
std::stack<IITH_task, std::vector<IITH_task>> task_queue;
|
||||
task_queue.push(
|
||||
IITH_task(f, mirror_index(full_cell(f), index_of_covertex(f))) );
|
||||
|
||||
while (!task_queue.empty())
|
||||
{
|
||||
IITH_task task = task_queue.front();
|
||||
IITH_task task = task_queue.top();
|
||||
task_queue.pop();
|
||||
|
||||
Full_cell_handle old_s = full_cell(task.boundary_facet);
|
||||
|
|
@ -1028,7 +1036,7 @@ template< class Dim, class Vb, class Fcb >
|
|||
template< typename Forward_iterator, typename OutputIterator >
|
||||
typename Triangulation_data_structure<Dim, Vb, Fcb>::Vertex_handle
|
||||
Triangulation_data_structure<Dim, Vb, Fcb>
|
||||
::insert_in_hole(Forward_iterator start, Forward_iterator end, Facet f,
|
||||
::insert_in_hole(Forward_iterator start, Forward_iterator end, const Facet& f,
|
||||
OutputIterator out) /* Concept */
|
||||
{
|
||||
CGAL_expensive_precondition(
|
||||
|
|
@ -1047,7 +1055,7 @@ template< class Dim, class Vb, class Fcb >
|
|||
template< typename Forward_iterator >
|
||||
typename Triangulation_data_structure<Dim, Vb, Fcb>::Vertex_handle
|
||||
Triangulation_data_structure<Dim, Vb, Fcb>
|
||||
::insert_in_hole(Forward_iterator start, Forward_iterator end, Facet f) /* Concept */
|
||||
::insert_in_hole(Forward_iterator start, Forward_iterator end, const Facet& f) /* Concept */
|
||||
{
|
||||
Emptyset_iterator out;
|
||||
return insert_in_hole(start, end, f, out);
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue