Cleanup BGL for LCC; add shortcut for item with id to simplify definition.

This commit is contained in:
Guillaume Damiand 2017-03-31 17:11:36 -04:00
parent 81d11d7442
commit 755272148a
15 changed files with 241 additions and 207 deletions

View File

@ -8,20 +8,7 @@
typedef CGAL::Simple_cartesian<double> Kernel;
typedef CGAL::Linear_cell_complex_traits<3, Kernel> MyTraits;
struct Myitem
{
template<class Refs>
struct Dart_wrapper
{
typedef CGAL::Tag_true Darts_with_id;
typedef CGAL::Cell_attribute_with_point_and_id< Refs > Vertex_attribute;
typedef CGAL::Cell_attribute_with_id< Refs > Face_attribute;
typedef CGAL::cpp11::tuple<Vertex_attribute, void, Face_attribute> Attributes;
};
};
typedef CGAL::Linear_cell_complex_for_combinatorial_map<2, 3, MyTraits, Myitem> LCC;
typedef CGAL::Linear_cell_complex_for_bgl_combinatorial_map<2, 3, MyTraits> LCC;
typedef boost::graph_traits< LCC > Traits;
typedef Traits::edge_descriptor edge_descriptor;

View File

@ -15,9 +15,7 @@
#include <CGAL/boost/graph/graph_traits_Polyhedron_3.h>
#include <CGAL/Linear_cell_complex_for_combinatorial_map.h>
#include <CGAL/Linear_cell_complex_incremental_builder_v2.h>
#include <CGAL/Linear_cell_complex_constructors.h>
#include <CGAL/Linear_cell_complex_for_bgl_combinatorial_map.h>
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex.h>
#include <CGAL/boost/graph/properties_Linear_cell_complex.h>
@ -40,20 +38,7 @@ typedef Kernel::Triangle_3 Triangle_3;
typedef Kernel::Iso_cuboid_3 Iso_cuboid_3;
typedef CGAL::Linear_cell_complex_traits<3, Kernel> MyTraits;
struct Myitem
{
template<class Refs>
struct Dart_wrapper
{
typedef CGAL::Tag_true Darts_with_id;
typedef CGAL::Cell_attribute_with_point_and_id< Refs > Vertex_attribute;
typedef CGAL::Cell_attribute_with_id< Refs > Face_attribute;
typedef CGAL::cpp11::tuple<Vertex_attribute, void, Face_attribute> Attributes;
};
};
typedef CGAL::Linear_cell_complex_for_combinatorial_map<2, 3, MyTraits, Myitem> LCC;
typedef CGAL::Linear_cell_complex_for_bgl_combinatorial_map<2, 3, MyTraits> LCC;
#ifdef CGAL_USE_SURFACE_MESH
@ -147,7 +132,7 @@ bool read_a_mesh(LCC& lcc, const std::string& str) {
bool success = in.good();
if(success)
{
CGAL::load_off_v2(lcc, in);
CGAL::load_off_for_bgl(lcc, in);
assert(lcc.is_valid());
}
return success;

View File

@ -23,6 +23,7 @@
#include <CGAL/assertions.h>
#include <CGAL/tuple.h>
#include <bitset>
#include <CGAL/Cell_attribute.h>
namespace CGAL {

View File

@ -3,28 +3,16 @@
#include <CGAL/Delaunay_triangulation_3.h>
#include <CGAL/algorithm.h>
#include <CGAL/convex_hull_3_to_face_graph.h>
#include <CGAL/Linear_cell_complex_for_combinatorial_map.h>
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex.h>
#include <CGAL/boost/graph/properties_Linear_cell_complex.h>
#include <list>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::Point_3 Point_3;
typedef CGAL::Delaunay_triangulation_3<K> Delaunay;
typedef Delaunay::Vertex_handle Vertex_handle;
typedef CGAL::Linear_cell_complex_traits<3, K> MyTraits;
struct Myitem
{
template<class Refs>
struct Dart_wrapper
{
typedef CGAL::Tag_true Darts_with_id;
typedef CGAL::Cell_attribute_with_point_and_id< Refs > Vertex_attribute;
typedef CGAL::Cell_attribute_with_id< Refs > Face_attribute;
typedef CGAL::cpp11::tuple<Vertex_attribute, void, Face_attribute> Attributes;
};
};
typedef CGAL::Linear_cell_complex_for_combinatorial_map<2, 3, MyTraits, Myitem> LCC;
typedef CGAL::Linear_cell_complex_traits<3, K> MyTraits;
typedef CGAL::Linear_cell_complex_for_bgl_combinatorial_map<2, 3, MyTraits> LCC;
int main()
{

View File

@ -0,0 +1,162 @@
// Copyright (c) 2017 CNRS and LIRIS' Establishments (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public License as
// published by the Free Software Foundation; either version 3 of the License,
// or (at your option) any later version.
//
// Licensees holding a valid commercial license may use this file in
// accordance with the commercial license agreement provided with the software.
//
// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
//
// $URL$
// $Id$
//
// Author(s) : Guillaume Damiand <guillaume.damiand@liris.cnrs.fr>
//
#ifndef CGAL_LINEAR_CELL_COMPLEX_FOR_BGL_COMBINATORIAL_MAP_H
#define CGAL_LINEAR_CELL_COMPLEX_FOR_BGL_COMBINATORIAL_MAP_H 1
#include <CGAL/Linear_cell_complex_for_combinatorial_map.h>
#include <CGAL/Linear_cell_complex_traits.h>
#include <CGAL/CMap_linear_cell_complex_storages.h>
#include <CGAL/Cell_attribute_with_point.h>
namespace CGAL {
/** @file Linear_cell_complex_for_bgl_combinatorial_map.h
* Definition of a linear cell complex based on combinatorial map, to use with BGL.
* This cmap has points associated to all vertices and faces enables. Moreover
* these cells have id.
*/
struct Linear_cell_complex_bgl_min_items
{
/// Dart_wrapper defines the type of darts used.
template <class LCC>
struct Dart_wrapper
{
typedef CGAL::Tag_true Darts_with_id;
typedef CGAL::Cell_attribute_with_point_and_id<LCC> Vertex_attribute;
typedef CGAL::Cell_attribute_with_id<LCC> Face_attribute;
typedef CGAL::cpp11::tuple<Vertex_attribute, void, Face_attribute> Attributes;
};
};
// Linear_cell_complex_for_bgl_combinatorial_map class.
template < unsigned int d_, unsigned int ambient_dim = d_,
class Traits_ = Linear_cell_complex_traits<ambient_dim>,
class Items_ = Linear_cell_complex_bgl_min_items,
class Alloc_ = CGAL_ALLOCATOR(int),
template<unsigned int,class,class,class,class>
class CMap = Combinatorial_map_base,
class Storage_ = CMap_linear_cell_complex_storage_1<d_, ambient_dim,
Traits_, Items_,
Alloc_> >
class Linear_cell_complex_for_bgl_combinatorial_map:
public Linear_cell_complex_for_combinatorial_map
<d_, ambient_dim, Traits_,
Items_, Alloc_, CMap, Storage_>
{
public:
typedef Linear_cell_complex_for_bgl_combinatorial_map<d_, ambient_dim,
Traits_, Items_, Alloc_, CMap, Storage_> Self;
typedef Linear_cell_complex_for_combinatorial_map<d_, ambient_dim,
Traits_, Items_, Alloc_, CMap, Storage_> Base;
typedef Traits_ Traits;
typedef Items_ Items;
typedef Alloc_ Alloc;
static const unsigned int ambient_dimension = Base::ambient_dimension;
static const unsigned int dimension = Base::dimension;
typedef typename Base::Dart_handle Dart_handle;
typedef typename Base::Dart_const_handle Dart_const_handle;
typedef typename Base::Helper Helper;
typedef typename Base::Point Point;
typedef typename Base::Vector Vector;
typedef typename Base::FT FT;
typedef typename Base::Dart_range Dart_range;
typedef typename Base::template Attribute_type<0>::type Vertex_attribute;
typedef typename Base::template Attribute_handle<0>::type
Vertex_attribute_handle;
typedef typename Base::template Attribute_const_handle<0>::type
Vertex_attribute_const_handle;
typedef typename Base::template Attribute_range<0>::type
Vertex_attribute_range;
typedef typename Base::template Attribute_const_range<0>::type
Vertex_attribute_const_range;
typedef typename Base::template Attribute_type<2>::type Face_attribute;
typedef typename Base::template Attribute_handle<2>::type
Face_attribute_handle;
typedef typename Base::template Attribute_const_handle<2>::type
Face_attribute_const_handle;
typedef typename Base::template Attribute_range<2>::type
Face_attribute_range;
typedef typename Base::template Attribute_const_range<2>::type
Face_attribute_const_range;
typedef typename Base::size_type size_type;
typedef typename Base::Use_index Use_index;
typedef typename Base::Storage Storage;
typedef typename Base::Exception_no_more_available_mark
Exception_no_more_available_mark;
Linear_cell_complex_for_bgl_combinatorial_map() : Base()
{}
/** Copy the given linear cell complex into *this.
* Note that both LCC can have different dimensions and/or non void attributes.
* @param alcc the linear cell complex to copy.
* @post *this is valid.
*/
Linear_cell_complex_for_bgl_combinatorial_map(const Self& alcc) : Base(alcc)
{}
template < class LCC2 >
Linear_cell_complex_for_bgl_combinatorial_map(const LCC2& alcc) : Base(alcc)
{}
template < class LCC2, typename Converters >
Linear_cell_complex_for_bgl_combinatorial_map(const LCC2& alcc,
Converters& converters) :
Base(alcc, converters)
{}
template < class LCC2, typename Converters, typename DartInfoConverter >
Linear_cell_complex_for_bgl_combinatorial_map(const LCC2& alcc,
Converters& converters,
const DartInfoConverter&
dartinfoconverter) :
Base(alcc, converters, dartinfoconverter)
{}
template < class LCC2, typename Converters, typename DartInfoConverter,
typename PointConverter >
Linear_cell_complex_for_bgl_combinatorial_map(const LCC2& alcc,
Converters& converters,
const DartInfoConverter&
dartinfoconverter,
const PointConverter&
pointconverter) :
Base(alcc, converters, dartinfoconverter, pointconverter)
{}
};
} // namespace CGAL
#endif // CGAL_LINEAR_CELL_COMPLEX_FOR_BGL_COMBINATORIAL_MAP_H //
// EOF //

View File

@ -1,4 +1,4 @@
// Copyright (c) 2011 CNRS and LIRIS' Establishments (France).
// Copyright (c) 2017 CNRS and LIRIS' Establishments (France).
// All rights reserved.
//
// This file is part of CGAL (www.cgal.org); you can redistribute it and/or
@ -17,10 +17,10 @@
//
// Author(s) : Guillaume Damiand <guillaume.damiand@liris.cnrs.fr>
//
#ifndef CGAL_LINEAR_CELL_COMPLEX_INCREMENTAL_BUILDER_V2_H
#define CGAL_LINEAR_CELL_COMPLEX_INCREMENTAL_BUILDER_V2_H 1
#ifndef CGAL_LINEAR_CELL_COMPLEX_INCREMENTAL_BUILDER_FOR_BGL_H
#define CGAL_LINEAR_CELL_COMPLEX_INCREMENTAL_BUILDER_FOR_BGL_H 1
#include <CGAL/Linear_cell_complex.h>
#include <CGAL/Linear_cell_complex_constructors.h>
#include <CGAL/IO/Polyhedron_iostream.h>
#include <CGAL/IO/File_header_OFF.h>
#include <CGAL/IO/File_scanner_OFF.h>
@ -35,7 +35,7 @@ namespace CGAL {
* associated with faces, non existing dart having no 2-attribute associated.
*/
template < class LCC_ >
class Linear_cell_complex_incremental_builder_3_v2
class Linear_cell_complex_incremental_builder_for_bgl
{
public:
typedef LCC_ LCC;
@ -44,11 +44,11 @@ namespace CGAL {
typedef typename LCC::Point Point_3;
typedef typename LCC::size_type size_type;
Linear_cell_complex_incremental_builder_3_v2(LCC & alcc) :
Linear_cell_complex_incremental_builder_for_bgl(LCC & alcc) :
lcc(alcc)
{}
Vertex_attribute_handle add_vertex (const Point_3& p)
Vertex_attribute_handle add_vertex(const Point_3& p)
{
Vertex_attribute_handle res = lcc.create_vertex_attribute(p);
vertex_map.push_back(res);
@ -162,8 +162,6 @@ namespace CGAL {
assert(lcc.template is_free<0>(lcc.template beta<2>(other)));
lcc.basic_link_beta_1(it, lcc.template beta<2>(other));
// For BGL halfedge graph, darts of border vertices must be border darts.
// NOT NEEDED ?? lcc.template set_dart_of_attribute<0>(lcc.vertex_attribute(it), it);
++nb;
}
}
@ -218,15 +216,15 @@ namespace CGAL {
typename LCC::template Attribute_handle<2>::type face_attrib;
};
template < class LCC >
void load_off_v2(LCC& alcc, std::istream& in)
template<class LCC>
void load_off_for_bgl(LCC& alcc, std::istream& in)
{
File_header_OFF m_file_header;
File_scanner_OFF scanner( in, m_file_header.verbose());
if ( ! in) return;
m_file_header = scanner; // Remember file header after return.
Linear_cell_complex_incremental_builder_3_v2<LCC> B( alcc);
Linear_cell_complex_incremental_builder_for_bgl<LCC> B( alcc);
B.begin_surface( scanner.size_of_vertices(),
scanner.size_of_facets(),
scanner.size_of_halfedges());
@ -299,14 +297,29 @@ namespace CGAL {
}
template<class LCC>
void load_off_v2(LCC& alcc, const char* filename)
void load_off_for_bgl(LCC& alcc, const char* filename)
{
std::ifstream input(filename);
if (input.is_open())
load_off_v2(alcc, input);
load_off_for_bgl(alcc, input);
}
template < class LCC >
void write_off_for_bgl(LCC& alcc, std::ostream& out)
{
// TODO (pehraps add a selector in the generic write_off function ?
write_off(alcc, out);
}
template < class LCC >
void write_off_for_bgl(LCC& alcc, const char* filename)
{
// TODO (pehraps add a selector in the generic write_off function ?
write_off(alcc, filename);
}
} //namespace CGAL
#endif // CGAL_LINEAR_CELL_COMPLEX_INCREMENTAL_BUILDER_V2_H //
#endif // CGAL_LINEAR_CELL_COMPLEX_INCREMENTAL_BUILDER_FOR_BGL_H //
// EOF //

View File

@ -31,28 +31,30 @@
#include <CGAL/boost/graph/properties_Linear_cell_complex.h>
#include <CGAL/boost/graph/graph_traits_HalfedgeDS.h>
#include <CGAL/Linear_cell_complex_for_combinatorial_map.h>
#include <CGAL/Linear_cell_complex_for_bgl_combinatorial_map.h>
#include <CGAL/Linear_cell_complex_incremental_builder_for_bgl.h>
#include <CGAL/Dart_iterators.h>
#include <CGAL/boost/graph/helpers.h>
#include <CGAL/iterator.h>
#define CGAL_LCC_TEMPLATE_ARGS template < unsigned int d_, unsigned int ambient_dim, \
class Traits_, \
class Items_, \
class Alloc_, \
template<unsigned int, class,class,class,class> \
class LCC, \
class Storage_>
#define CGAL_LCC_TEMPLATE_ARGS_NOTEND template < unsigned int d_, unsigned int ambient_dim, \
class Traits_, \
class Items_, \
class Alloc_, \
template<unsigned int, class,class,class,class> \
class LCC, \
class Storage_,
#define CGAL_LCC_TEMPLATE_ARGS template<unsigned int d_, unsigned int ambient_dim, \
class Traits_, \
class Items_, \
class Alloc_, \
template<unsigned int,class,class,class,class> \
class CMap, \
class Storage_>
#define CGAL_LCC_TEMPLATE_ARGS_NOTEND template<unsigned int d_, unsigned int ambient_dim, \
class Traits_, \
class Items_, \
class Alloc_, \
template<unsigned int,class,class,class,class> \
class CMap, \
class Storage_,
#define CGAL_LCC_TYPE CGAL::Linear_cell_complex_for_combinatorial_map \
<d_, ambient_dim, Traits_, Items_, Alloc_, LCC, Storage_>
#define CGAL_LCC_TYPE CGAL::Linear_cell_complex_for_bgl_combinatorial_map \
<d_, ambient_dim, Traits_, Items_, Alloc_, CMap, Storage_>
namespace CGAL {

View File

@ -21,7 +21,7 @@
#define CGAL_BOOST_GRAPH_PROPERTIES_LINEAR_CELL_COMPLEX_H
#include <CGAL/boost/graph/properties.h>
#include <CGAL/Linear_cell_complex_for_combinatorial_map.h>
#include <CGAL/Linear_cell_complex_for_bgl_combinatorial_map.h>
#include <CGAL/Unique_hash_map.h>
#include <CGAL/boost/graph/properties_Polyhedron_3.h>
@ -29,7 +29,7 @@
class Traits_, \
class Items_, \
class Alloc_, \
template<unsigned int, class, class, class, class> \
template<unsigned int,class,class,class,class> \
class CMap, \
class Storage_
@ -40,7 +40,7 @@
CMap, \
Storage_
#define CGAL_LCC_TYPE CGAL::Linear_cell_complex_for_combinatorial_map\
#define CGAL_LCC_TYPE CGAL::Linear_cell_complex_for_bgl_combinatorial_map\
<d_, ambient_dim, Traits_, Items_, Alloc_, CMap , Storage_>
namespace CGAL {

View File

@ -1,8 +1,5 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Linear_cell_complex_for_combinatorial_map.h>
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex.h>
#include <CGAL/Linear_cell_complex_incremental_builder_v2.h>
#include <CGAL/Linear_cell_complex_constructors.h>
#include <CGAL/Polygon_mesh_processing/corefinement.h>
@ -10,20 +7,8 @@
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef Kernel::Point_3 Point;
typedef CGAL::Linear_cell_complex_traits<3, Kernel> MyTraits;
struct Myitem
{
template<class Refs>
struct Dart_wrapper
{
typedef CGAL::Tag_true Darts_with_id;
typedef CGAL::Cell_attribute_with_point_and_id< Refs > Vertex_attribute;
typedef CGAL::Cell_attribute_with_id< Refs > Face_attribute;
typedef CGAL::cpp11::tuple<Vertex_attribute, void, Face_attribute> Attributes;
};
};
typedef CGAL::Linear_cell_complex_for_combinatorial_map<2, 3, MyTraits, Myitem> LCC;
typedef CGAL::Linear_cell_complex_for_bgl_combinatorial_map<2, 3, MyTraits> LCC;
namespace PMP = CGAL::Polygon_mesh_processing;
@ -34,8 +19,8 @@ int main(int argc, char* argv[])
std::ifstream input(filename1);
LCC mesh1, mesh2;
CGAL::load_off_v2(mesh1, filename1);
CGAL::load_off_v2(mesh2, filename2);
CGAL::load_off_for_bgl(mesh1, filename1);
CGAL::load_off_for_bgl(mesh2, filename2);
std::cout << "Number of vertices before corefinement "
<< num_vertices(mesh1) << " and "
@ -48,10 +33,10 @@ int main(int argc, char* argv[])
<< num_vertices(mesh2) << "\n";
std::ofstream output("mesh1_refined.off");
CGAL::write_off(mesh1, output);
CGAL::write_off_for_bgl(mesh1, output);
output.close();
output.open("mesh2_refined.off");
CGAL::write_off(mesh2, output);
CGAL::write_off_for_bgl(mesh2, output);
output.close();
return 0;

View File

@ -1,7 +1,5 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Linear_cell_complex_for_combinatorial_map.h>
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex.h>
#include <CGAL/Linear_cell_complex_incremental_builder_v2.h>
#include <CGAL/Linear_cell_complex_constructors.h>
#include <CGAL/Polygon_mesh_processing/triangulate_hole.h>
@ -13,20 +11,8 @@
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef Kernel::Point_3 Point;
typedef CGAL::Linear_cell_complex_traits<3, Kernel> MyTraits;
struct Myitem
{
template<class Refs>
struct Dart_wrapper
{
typedef CGAL::Tag_true Darts_with_id;
typedef CGAL::Cell_attribute_with_point_and_id< Refs > Vertex_attribute;
typedef CGAL::Cell_attribute_with_id< Refs > Face_attribute;
typedef CGAL::cpp11::tuple<Vertex_attribute, void, Face_attribute> Attributes;
};
};
typedef CGAL::Linear_cell_complex_for_combinatorial_map<2, 3, MyTraits, Myitem> LCC;
typedef CGAL::Linear_cell_complex_for_bgl_combinatorial_map<2, 3, MyTraits> LCC;
typedef boost::graph_traits<LCC>::halfedge_descriptor halfedge_descriptor;
typedef boost::graph_traits<LCC>::face_descriptor face_descriptor;
@ -37,7 +23,7 @@ int main(int argc, char* argv[])
{
const char* filename = (argc > 1) ? argv[1] : "data/mech-holes-shark.off";
LCC mesh;
CGAL::load_off_v2(mesh, filename);
CGAL::load_off_for_bgl(mesh, filename);
// Incrementally fill the holes
unsigned int nb_holes = 0;
@ -70,7 +56,7 @@ int main(int argc, char* argv[])
std::ofstream out("filled_LCC.off");
out.precision(17);
CGAL::write_off(mesh, out);
CGAL::write_off_for_bgl(mesh, out);
return 0;
}

View File

@ -1,8 +1,6 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Linear_cell_complex_for_combinatorial_map.h>
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex.h>
#include <CGAL/Linear_cell_complex_incremental_builder_v2.h>
#include <CGAL/Linear_cell_complex_constructors.h>
#include "PolyhedralSurf_rings.h"
#include "compute_normals.h"
@ -22,20 +20,8 @@ typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::FT FT;
typedef Kernel::Point_3 Point_3;
typedef Kernel::Vector_3 Vector_3;
typedef CGAL::Linear_cell_complex_traits<3, Kernel> MyTraits;
struct Myitem
{
template<class Refs>
struct Dart_wrapper
{
typedef CGAL::Tag_true Darts_with_id;
typedef CGAL::Cell_attribute_with_point_and_id< Refs > Vertex_attribute;
typedef CGAL::Cell_attribute_with_id< Refs > Face_attribute;
typedef CGAL::cpp11::tuple<Vertex_attribute, void, Face_attribute> Attributes;
};
};
typedef CGAL::Linear_cell_complex_for_combinatorial_map<2, 3, MyTraits, Myitem> LCC;
typedef CGAL::Linear_cell_complex_for_bgl_combinatorial_map<2, 3, MyTraits> LCC;
typedef LCC PolyhedralSurf;
@ -299,7 +285,7 @@ int main()
//load the model from <mesh.off>
PolyhedralSurf P;
CGAL::load_off_v2(P, if_name.c_str());
CGAL::load_off_for_bgl(P, if_name.c_str());
fprintf(stderr, "loadMesh %d Ves %d Facets\n",
(int)num_vertices(P), (int)num_faces(P));
if(verbose)

View File

@ -1,6 +1,5 @@
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Linear_cell_complex_for_combinatorial_map.h>
#include <CGAL/Linear_cell_complex_incremental_builder_v2.h>
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex.h>
#include <CGAL/mesh_segmentation.h>
@ -12,27 +11,14 @@
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef CGAL::Linear_cell_complex_traits<3, Kernel> MyTraits;
struct Myitem
{
template<class Refs>
struct Dart_wrapper
{
typedef CGAL::Tag_true Darts_with_id;
typedef CGAL::Cell_attribute_with_point_and_id< Refs > Vertex_attribute;
typedef CGAL::Cell_attribute_with_id< Refs > Face_attribute;
typedef CGAL::cpp11::tuple<Vertex_attribute, void, Face_attribute> Attributes;
};
};
typedef CGAL::Linear_cell_complex_for_combinatorial_map<2, 3, MyTraits, Myitem> LCC;
typedef CGAL::Linear_cell_complex_for_bgl_combinatorial_map<2, 3, MyTraits> LCC;
typedef typename LCC::Attribute_const_handle<2>::type Facet_const_handle;
int main()
{
// create and read LCC
LCC mesh;
CGAL::load_off_v2(mesh, "data/cactus.off");
CGAL::load_off_for_bgl(mesh, "data/cactus.off");
// create a property-map for SDF values
typedef CGAL::Unique_hash_map<Facet_const_handle, double> Facet_double_map;

View File

@ -1,8 +1,5 @@
#include <iostream>
#include <fstream>
#include <CGAL/Linear_cell_complex_for_combinatorial_map.h>
#include <CGAL/Linear_cell_complex_constructors.h>
#include <CGAL/Linear_cell_complex_incremental_builder_v2.h>
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex.h>
// Simplification function
#include <CGAL/Surface_mesh_simplification/edge_collapse.h>
@ -13,20 +10,7 @@
typedef CGAL::Simple_cartesian<double> Kernel;
typedef CGAL::Linear_cell_complex_traits<3, Kernel> MyTraits;
struct Myitem
{
template<class Refs>
struct Dart_wrapper
{
typedef CGAL::Tag_true Darts_with_id;
typedef CGAL::Cell_attribute_with_point_and_id< Refs > Vertex_attribute;
typedef CGAL::Cell_attribute_with_id< Refs > Face_attribute;
typedef CGAL::cpp11::tuple<Vertex_attribute, void, Face_attribute> Attributes;
};
};
typedef CGAL::Linear_cell_complex_for_combinatorial_map<2, 3, MyTraits, Myitem> LCC;
typedef CGAL::Linear_cell_complex_for_bgl_combinatorial_map<2, 3, MyTraits> LCC;
namespace SMS = CGAL::Surface_mesh_simplification ;
int main( int argc, char** argv )
@ -39,7 +23,7 @@ int main( int argc, char** argv )
LCC lcc;
std::ifstream is(argv[1]);
CGAL::load_off_v2(lcc, is);
CGAL::load_off_for_bgl(lcc, is);
lcc.display_characteristics(std::cout)<<", is_valid="<<CGAL::is_valid(lcc)<<std::endl;
@ -65,8 +49,7 @@ int main( int argc, char** argv )
lcc.display_characteristics(std::cout)<<", is_valid="<<CGAL::is_valid(lcc)<<std::endl;
std::ofstream os(argc > 2 ? argv[2] : "out.off");
CGAL::write_off(lcc, os);
CGAL::write_off_for_bgl(lcc, (argc > 2 ? argv[2] : "out.off"));
return EXIT_SUCCESS;
}
// EOF //

View File

@ -1,5 +1,4 @@
#include <CGAL/Linear_cell_complex_for_combinatorial_map.h>
#include <CGAL/Linear_cell_complex_incremental_builder_v2.h>
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex.h>
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Mean_curvature_flow_skeletonization.h>
@ -8,22 +7,8 @@
typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point;
typedef CGAL::Linear_cell_complex_traits<3, Kernel> MyTraits;
struct Myitem
{
template<class Refs>
struct Dart_wrapper
{
typedef CGAL::Tag_true Darts_with_id;
typedef CGAL::Cell_attribute_with_point_and_id< Refs > Vertex_attribute;
typedef CGAL::Cell_attribute_with_id< Refs > Face_attribute;
typedef CGAL::cpp11::tuple<Vertex_attribute, void, Face_attribute> Attributes;
};
};
typedef CGAL::Linear_cell_complex_for_combinatorial_map<2, 3, MyTraits, Myitem> LCC;
typedef CGAL::Linear_cell_complex_traits<3, Kernel> MyTraits;
typedef CGAL::Linear_cell_complex_for_bgl_combinatorial_map<2, 3, MyTraits> LCC;
typedef boost::graph_traits<LCC>::vertex_descriptor vertex_descriptor;
typedef CGAL::Mean_curvature_flow_skeletonization<LCC> Skeletonization;
@ -36,7 +21,7 @@ typedef Skeleton::edge_descriptor Skeleton_edge;
int main(int argc, char* argv[])
{
LCC lcc;
CGAL::load_off_v2(lcc, "data/elephant.off");
CGAL::load_off_for_bgl(lcc, "data/elephant.off");
Skeleton skeleton;
Skeletonization mcs(lcc);

View File

@ -1,6 +1,4 @@
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Linear_cell_complex_for_combinatorial_map.h>
#include <CGAL/Linear_cell_complex_incremental_builder_v2.h>
#include <CGAL/boost/graph/graph_traits_Linear_cell_complex.h>
#include <CGAL/boost/graph/properties_Linear_cell_complex.h>
#include <CGAL/extract_mean_curvature_flow_skeleton.h>
@ -11,21 +9,8 @@
typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Point_3 Point;
typedef CGAL::Linear_cell_complex_traits<3, Kernel> MyTraits;
struct Myitem
{
template<class Refs>
struct Dart_wrapper
{
typedef CGAL::Tag_true Darts_with_id;
typedef CGAL::Cell_attribute_with_point_and_id< Refs > Vertex_attribute;
typedef CGAL::Cell_attribute_with_id< Refs > Face_attribute;
typedef CGAL::cpp11::tuple<Vertex_attribute, void, Face_attribute> Attributes;
};
};
typedef CGAL::Linear_cell_complex_for_combinatorial_map<2, 3, MyTraits, Myitem> LCC;
typedef CGAL::Linear_cell_complex_traits<3, Kernel> MyTraits;
typedef CGAL::Linear_cell_complex_for_bgl_combinatorial_map<2, 3, MyTraits> LCC;
typedef boost::graph_traits<LCC>::vertex_descriptor vertex_descriptor;
@ -65,7 +50,7 @@ struct Display_polylines{
int main(int argc, char* argv[])
{
LCC lcc;
CGAL::load_off_v2(lcc, "data/elephant.off");
CGAL::load_off_for_bgl(lcc, "data/elephant.off");
Skeleton skeleton;