mirror of https://github.com/CGAL/cgal
Misc minor changes
This commit is contained in:
parent
16ce117040
commit
3640902c6f
|
|
@ -81,7 +81,7 @@ public:
|
||||||
typedef Type_of_alpha NT;
|
typedef Type_of_alpha NT;
|
||||||
typedef Type_of_alpha FT;
|
typedef Type_of_alpha FT;
|
||||||
|
|
||||||
//check simplices are correctly instantiated
|
// check that simplices are correctly instantiated
|
||||||
CGAL_static_assertion( (boost::is_same<NT, typename Dt::Face::NT>::value) );
|
CGAL_static_assertion( (boost::is_same<NT, typename Dt::Face::NT>::value) );
|
||||||
CGAL_static_assertion( (boost::is_same<NT, typename Dt::Vertex::NT>::value) );
|
CGAL_static_assertion( (boost::is_same<NT, typename Dt::Vertex::NT>::value) );
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ typedef CGAL::Delaunay_triangulation_3<Gt,Tds> Triangulation_3;
|
||||||
typedef CGAL::Alpha_shape_3<Triangulation_3> Alpha_shape_3;
|
typedef CGAL::Alpha_shape_3<Triangulation_3> Alpha_shape_3;
|
||||||
|
|
||||||
typedef Gt::Point_3 Point;
|
typedef Gt::Point_3 Point;
|
||||||
typedef Alpha_shape_3::Alpha_iterator Alpha_iterator;
|
typedef Alpha_shape_3::Alpha_iterator Alpha_iterator;
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
|
@ -27,21 +27,22 @@ int main()
|
||||||
is >> n;
|
is >> n;
|
||||||
std::cout << "Reading " << n << " points " << std::endl;
|
std::cout << "Reading " << n << " points " << std::endl;
|
||||||
Point p;
|
Point p;
|
||||||
for( ; n>0 ; n--) {
|
for( ; n>0 ; n--)
|
||||||
|
{
|
||||||
is >> p;
|
is >> p;
|
||||||
lp.push_back(p);
|
lp.push_back(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
// compute alpha shape
|
// compute alpha shape
|
||||||
Alpha_shape_3 as(lp.begin(),lp.end());
|
Alpha_shape_3 as(lp.begin(),lp.end());
|
||||||
std::cout << "Alpha shape computed in REGULARIZED mode by default"
|
std::cout << "Alpha shape computed in REGULARIZED mode by default" << std::endl;
|
||||||
<< std::endl;
|
|
||||||
|
|
||||||
// find optimal alpha value
|
// find optimal alpha value
|
||||||
Alpha_iterator opt = as.find_optimal_alpha(1);
|
Alpha_iterator opt = as.find_optimal_alpha(1);
|
||||||
std::cout << "Optimal alpha value to get one connected component is "
|
std::cout << "Optimal alpha value to get one connected component is " << *opt << std::endl;
|
||||||
<< *opt << std::endl;
|
|
||||||
as.set_alpha(*opt);
|
as.set_alpha(*opt);
|
||||||
assert(as.number_of_solid_components() == 1);
|
assert(as.number_of_solid_components() == 1);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,17 +6,17 @@
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
typedef CGAL::Exact_predicates_inexact_constructions_kernel Gt;
|
typedef CGAL::Exact_predicates_inexact_constructions_kernel Gt;
|
||||||
typedef CGAL::Tag_true Alpha_cmp_tag;
|
typedef CGAL::Tag_true Alpha_cmp_tag;
|
||||||
//We use CGAL::Default to skip the complete declaration of base classes
|
//We use CGAL::Default to skip the complete declaration of base classes
|
||||||
typedef CGAL::Alpha_shape_vertex_base_3<Gt,CGAL::Default,Alpha_cmp_tag> Vb;
|
typedef CGAL::Alpha_shape_vertex_base_3<Gt,CGAL::Default,Alpha_cmp_tag> Vb;
|
||||||
typedef CGAL::Alpha_shape_cell_base_3<Gt,CGAL::Default,Alpha_cmp_tag> Fb;
|
typedef CGAL::Alpha_shape_cell_base_3<Gt,CGAL::Default,Alpha_cmp_tag> Fb;
|
||||||
typedef CGAL::Triangulation_data_structure_3<Vb,Fb> Tds;
|
typedef CGAL::Triangulation_data_structure_3<Vb,Fb> Tds;
|
||||||
typedef CGAL::Delaunay_triangulation_3<Gt,Tds> Triangulation_3;
|
typedef CGAL::Delaunay_triangulation_3<Gt,Tds> Triangulation_3;
|
||||||
//Alpha shape with ExactAlphaComparisonTag set to true (note that the tag is also
|
//Alpha shape with ExactAlphaComparisonTag set to true (note that the tag is also
|
||||||
//set to true for Vb and Fb)
|
//set to true for Vb and Fb)
|
||||||
typedef CGAL::Alpha_shape_3<Triangulation_3,Alpha_cmp_tag> Alpha_shape_3;
|
typedef CGAL::Alpha_shape_3<Triangulation_3,Alpha_cmp_tag> Alpha_shape_3;
|
||||||
typedef Gt::Point_3 Point;
|
typedef Gt::Point_3 Point;
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
|
@ -27,8 +27,7 @@ int main()
|
||||||
lp.push_back(Point(49.3696,31.4775,5.33777));
|
lp.push_back(Point(49.3696,31.4775,5.33777));
|
||||||
lp.push_back(Point(49.4264,32.6279,4.6205));
|
lp.push_back(Point(49.4264,32.6279,4.6205));
|
||||||
lp.push_back(Point(49.3127,30.3271,6.05503));
|
lp.push_back(Point(49.3127,30.3271,6.05503));
|
||||||
|
|
||||||
|
|
||||||
// compute alpha shape
|
// compute alpha shape
|
||||||
Alpha_shape_3 as(lp.begin(),lp.end(),0,Alpha_shape_3::GENERAL);
|
Alpha_shape_3 as(lp.begin(),lp.end(),0,Alpha_shape_3::GENERAL);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,9 @@ typedef CGAL::Triangulation_data_structure_3<Vb,Fb> Tds;
|
||||||
typedef CGAL::Delaunay_triangulation_3<K,Tds,CGAL::Fast_location> Delaunay;
|
typedef CGAL::Delaunay_triangulation_3<K,Tds,CGAL::Fast_location> Delaunay;
|
||||||
typedef CGAL::Alpha_shape_3<Delaunay> Alpha_shape_3;
|
typedef CGAL::Alpha_shape_3<Delaunay> Alpha_shape_3;
|
||||||
|
|
||||||
typedef K::Point_3 Point;
|
typedef K::Point_3 Point;
|
||||||
typedef Alpha_shape_3::Alpha_iterator Alpha_iterator;
|
typedef Alpha_shape_3::Alpha_iterator Alpha_iterator;
|
||||||
typedef Alpha_shape_3::NT NT;
|
typedef Alpha_shape_3::NT NT;
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -43,13 +43,13 @@ int main()
|
||||||
std::list<Facet> facets;
|
std::list<Facet> facets;
|
||||||
std::list<Edge> edges;
|
std::list<Edge> edges;
|
||||||
as.get_alpha_shape_cells(std::back_inserter(cells),
|
as.get_alpha_shape_cells(std::back_inserter(cells),
|
||||||
Fixed_alpha_shape_3::INTERIOR);
|
Fixed_alpha_shape_3::INTERIOR);
|
||||||
as.get_alpha_shape_facets(std::back_inserter(facets),
|
as.get_alpha_shape_facets(std::back_inserter(facets),
|
||||||
Fixed_alpha_shape_3::REGULAR);
|
Fixed_alpha_shape_3::REGULAR);
|
||||||
as.get_alpha_shape_facets(std::back_inserter(facets),
|
as.get_alpha_shape_facets(std::back_inserter(facets),
|
||||||
Fixed_alpha_shape_3::SINGULAR);
|
Fixed_alpha_shape_3::SINGULAR);
|
||||||
as.get_alpha_shape_edges(std::back_inserter(edges),
|
as.get_alpha_shape_edges(std::back_inserter(edges),
|
||||||
Fixed_alpha_shape_3::SINGULAR);
|
Fixed_alpha_shape_3::SINGULAR);
|
||||||
std::cout << " The 0-shape has : " << std::endl;
|
std::cout << " The 0-shape has : " << std::endl;
|
||||||
std::cout << cells.size() << " interior tetrahedra" << std::endl;
|
std::cout << cells.size() << " interior tetrahedra" << std::endl;
|
||||||
std::cout << facets.size() << " boundary facets" << std::endl;
|
std::cout << facets.size() << " boundary facets" << std::endl;
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,7 @@ public:
|
||||||
typedef typename internal::Alpha_nt_selector_3<Gt,ExactAlphaComparisonTag,typename Dt::Weighted_tag>::Compute_squared_radius_3 Compute_squared_radius_3;
|
typedef typename internal::Alpha_nt_selector_3<Gt,ExactAlphaComparisonTag,typename Dt::Weighted_tag>::Compute_squared_radius_3 Compute_squared_radius_3;
|
||||||
typedef NT FT;
|
typedef NT FT;
|
||||||
typedef typename Gt::FT Coord_type;
|
typedef typename Gt::FT Coord_type;
|
||||||
|
|
||||||
//checks whether tags are correctly set in Vertex and Cell classes
|
//checks whether tags are correctly set in Vertex and Cell classes
|
||||||
CGAL_static_assertion( (boost::is_same<NT,typename Dt::Cell::NT>::value) );
|
CGAL_static_assertion( (boost::is_same<NT,typename Dt::Cell::NT>::value) );
|
||||||
CGAL_static_assertion( (boost::is_same<NT,typename Dt::Vertex::Alpha_status::NT>::value) );
|
CGAL_static_assertion( (boost::is_same<NT,typename Dt::Vertex::Alpha_status::NT>::value) );
|
||||||
|
|
|
||||||
|
|
@ -12,14 +12,8 @@
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
//
|
//
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// $Date$
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Mariette Yvinec <Mariette.Yvinec@sophia.inria.fr>
|
// Author(s) : Mariette Yvinec <Mariette.Yvinec@sophia.inria.fr>
|
||||||
|
|
||||||
|
|
||||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||||
|
|
||||||
#include <CGAL/Delaunay_triangulation_3.h>
|
#include <CGAL/Delaunay_triangulation_3.h>
|
||||||
|
|
|
||||||
|
|
@ -12,11 +12,6 @@
|
||||||
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||||
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
//
|
//
|
||||||
// $URL$
|
|
||||||
// $Id$
|
|
||||||
// $Date$
|
|
||||||
//
|
|
||||||
//
|
|
||||||
// Author(s) : Mariette Yvinec <Mariette.Yvinec@sophia.inria.fr>
|
// Author(s) : Mariette Yvinec <Mariette.Yvinec@sophia.inria.fr>
|
||||||
|
|
||||||
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
|
||||||
|
|
|
||||||
|
|
@ -907,7 +907,7 @@ public:
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Protected, because inheritors(e.g. periodic triangulation for meshing)
|
// Protected, because inheritors(e.g. periodic triangulation for meshing)
|
||||||
// of the class Periodic_3_Delaunay_triangulation_3 use this class
|
// of the class Periodic_3_regular_triangulation_3 use this class
|
||||||
class Conflict_tester;
|
class Conflict_tester;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue