mirror of https://github.com/CGAL/cgal
remove files
This commit is contained in:
parent
8b4f2014f3
commit
d7e2819f0c
|
|
@ -21,9 +21,7 @@ if ( CGAL_FOUND )
|
||||||
include( CGAL_CreateSingleSourceCGALProgram )
|
include( CGAL_CreateSingleSourceCGALProgram )
|
||||||
|
|
||||||
include_directories (BEFORE ../../include)
|
include_directories (BEFORE ../../include)
|
||||||
# include_directories (BEFORE ../../../../../trunk/Triangulation_2/include)
|
|
||||||
|
|
||||||
create_single_source_cgal_program( "extract.cpp" )
|
|
||||||
create_single_source_cgal_program( "reconstruction_fct.cpp" )
|
create_single_source_cgal_program( "reconstruction_fct.cpp" )
|
||||||
create_single_source_cgal_program( "reconstruction_class.cpp" )
|
create_single_source_cgal_program( "reconstruction_class.cpp" )
|
||||||
create_single_source_cgal_program( "reconstruction_polyhedron.cpp" )
|
create_single_source_cgal_program( "reconstruction_polyhedron.cpp" )
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ int main()
|
||||||
std::istream_iterator<Point_3>(),
|
std::istream_iterator<Point_3>(),
|
||||||
std::back_inserter(points));
|
std::back_inserter(points));
|
||||||
|
|
||||||
CGAL::advancing_front_surface_reconstruction(points.begin(),
|
CGAL::advancing_front_surface_reconstructionP(points.begin(),
|
||||||
points.end(),
|
points.end(),
|
||||||
P);
|
P);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,473 +0,0 @@
|
||||||
#ifndef CGAL_AFSR_VERTEX_BASE_3_H
|
|
||||||
#define CGAL_AFSR_VERTEX_BASE_3_H
|
|
||||||
|
|
||||||
#include <utility>
|
|
||||||
|
|
||||||
#include <list>
|
|
||||||
#include <map>
|
|
||||||
#include <set>
|
|
||||||
|
|
||||||
#include <CGAL/Triangulation_vertex_base_3.h>
|
|
||||||
|
|
||||||
namespace CGAL {
|
|
||||||
|
|
||||||
template <class K, class VertexBase = Triangulation_vertex_base_3<K> >
|
|
||||||
class AFSR_vertex_base_3 : public VertexBase
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
|
|
||||||
template < typename TDS2 >
|
|
||||||
struct Rebind_TDS {
|
|
||||||
typedef typename VertexBase::template Rebind_TDS<TDS2>::Other Vb2;
|
|
||||||
typedef AFSR_vertex_base_3<K,Vb2> Other;
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
typedef VertexBase Base;
|
|
||||||
typedef typename Base::Vertex_handle Vertex_handle;
|
|
||||||
typedef typename Base::Cell_handle Cell_handle;
|
|
||||||
typedef typename VertexBase::Point Point;
|
|
||||||
typedef double coord_type;
|
|
||||||
|
|
||||||
typedef Triple< Cell_handle, int, int > Edge;
|
|
||||||
typedef std::pair< Edge, int > Edge_incident_facet;
|
|
||||||
typedef std::pair< Edge_incident_facet, Edge_incident_facet > IO_edge_type;
|
|
||||||
|
|
||||||
typedef coord_type criteria;
|
|
||||||
|
|
||||||
typedef std::pair< criteria, IO_edge_type > Radius_edge_type;
|
|
||||||
typedef std::pair< Radius_edge_type, int > Border_elt;
|
|
||||||
typedef std::pair< Vertex_handle, Border_elt > Next_border_elt;
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
//par convention je remplis d'abord first et si necessaire second...
|
|
||||||
typedef std::pair< Next_border_elt*, Next_border_elt*> Intern_successors_type;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
typedef std::pair< criteria, IO_edge_type* > Radius_ptr_type;
|
|
||||||
typedef std::pair< Vertex_handle, Vertex_handle > Edge_like;
|
|
||||||
typedef std::pair< criteria, Edge_like > Incidence_request_elt;
|
|
||||||
typedef std::list< Incidence_request_elt > Incidence_request_type;
|
|
||||||
typedef typename Incidence_request_type::iterator Incidence_request_iterator;
|
|
||||||
|
|
||||||
// typedef std::set< void* > Interior_edge_set_type;
|
|
||||||
|
|
||||||
//-------------------- DATA MEMBERS ---------------------------------
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
int _mark;
|
|
||||||
int _post_mark;
|
|
||||||
Intern_successors_type* _incident_border;
|
|
||||||
|
|
||||||
// Instead of having a set per vertex, there is a global list.
|
|
||||||
static std::list<Vertex_handle> interior_edges;
|
|
||||||
// and two iterators per vertex in this list
|
|
||||||
// Note that ie_last is not past the end
|
|
||||||
// ie_first == ie_last == interior_edge.end() iff the set is empty
|
|
||||||
typename std::list<Vertex_handle>::iterator ie_first, ie_last;
|
|
||||||
|
|
||||||
|
|
||||||
// We do the same for the incidence requests
|
|
||||||
static std::list< Incidence_request_elt > incidence_requests;
|
|
||||||
typename std::list< Incidence_request_elt >::iterator ir_first, ir_last;
|
|
||||||
//-------------------- CONSTRUCTORS ---------------------------------
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
AFSR_vertex_base_3()
|
|
||||||
: VertexBase(), _mark(-1),
|
|
||||||
_post_mark(-1),
|
|
||||||
ie_first(interior_edges.end()), ie_last(interior_edges.end()),
|
|
||||||
ir_first(incidence_requests.end()), ir_last(incidence_requests.end())
|
|
||||||
{
|
|
||||||
_incident_border = new Intern_successors_type(new Next_border_elt(),
|
|
||||||
new Next_border_elt());
|
|
||||||
_incident_border->first->first = NULL;
|
|
||||||
_incident_border->second->first = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
AFSR_vertex_base_3(const Point & p)
|
|
||||||
: VertexBase(p), _mark(-1),
|
|
||||||
_post_mark(-1),
|
|
||||||
ie_first(interior_edges.end()), ie_last(interior_edges.end()),
|
|
||||||
ir_first(incidence_requests.end()), ir_last(incidence_requests.end())
|
|
||||||
{
|
|
||||||
_incident_border = new Intern_successors_type(new Next_border_elt(),
|
|
||||||
new Next_border_elt());
|
|
||||||
_incident_border->first->first = NULL;
|
|
||||||
_incident_border->second->first = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
AFSR_vertex_base_3(const Point & p, Cell_handle f)
|
|
||||||
: VertexBase(p, f), _mark(-1),
|
|
||||||
_post_mark(-1),
|
|
||||||
ie_first(interior_edges.end()), ie_last(interior_edges.end()),
|
|
||||||
ir_first(incidence_requests.end()), ir_last(incidence_requests.end())
|
|
||||||
{
|
|
||||||
_incident_border = new Intern_successors_type(new Next_border_elt(),
|
|
||||||
new Next_border_elt());
|
|
||||||
_incident_border->first->first = NULL;
|
|
||||||
_incident_border->second->first = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
AFSR_vertex_base_3(Cell_handle f)
|
|
||||||
: VertexBase(f), _mark(-1),
|
|
||||||
_post_mark(-1),
|
|
||||||
ie_first(interior_edges.end()), ie_last(interior_edges.end()),
|
|
||||||
ir_first(incidence_requests.end()), ir_last(incidence_requests.end())
|
|
||||||
{
|
|
||||||
_incident_border = new Intern_successors_type(new Next_border_elt(),
|
|
||||||
new Next_border_elt());
|
|
||||||
_incident_border->first->first = NULL;
|
|
||||||
_incident_border->second->first = NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
AFSR_vertex_base_3(const AFSR_vertex_base_3& other)
|
|
||||||
: VertexBase(), _mark(-1),
|
|
||||||
_post_mark(-1),
|
|
||||||
ie_first(interior_edges.end()), ie_last(interior_edges.end()),
|
|
||||||
ir_first(incidence_requests.end()), ir_last(incidence_requests.end())
|
|
||||||
{
|
|
||||||
_incident_border = new Intern_successors_type(new Next_border_elt(),
|
|
||||||
new Next_border_elt());
|
|
||||||
_incident_border->first->first = NULL;
|
|
||||||
_incident_border->second->first = NULL;
|
|
||||||
}
|
|
||||||
//-------------------- DESTRUCTOR -----------------------------------
|
|
||||||
|
|
||||||
~AFSR_vertex_base_3()
|
|
||||||
{
|
|
||||||
if (_incident_border != NULL)
|
|
||||||
{
|
|
||||||
delete _incident_border->first;
|
|
||||||
delete _incident_border->second;
|
|
||||||
delete _incident_border;
|
|
||||||
}
|
|
||||||
if(ir_first != incidence_requests.end()){
|
|
||||||
assert(ir_last != incidence_requests.end());
|
|
||||||
typename std::list< Incidence_request_elt >::iterator b(ir_first), e(ir_last);
|
|
||||||
e++;
|
|
||||||
incidence_requests.erase(b, e);
|
|
||||||
}
|
|
||||||
|
|
||||||
if(ie_first != interior_edges.end()){
|
|
||||||
assert(ie_last != interior_edges.end());
|
|
||||||
typename std::list<Vertex_handle>::iterator b(ie_first), e(ie_last);
|
|
||||||
e++;
|
|
||||||
interior_edges.erase(b, e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------- MEMBER FUNCTIONS -----------------------------
|
|
||||||
|
|
||||||
inline void re_init()
|
|
||||||
{
|
|
||||||
if (_incident_border != NULL)
|
|
||||||
{
|
|
||||||
delete _incident_border->first;
|
|
||||||
delete _incident_border->second;
|
|
||||||
delete _incident_border;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(ir_first != incidence_requests.end()){
|
|
||||||
assert(ir_last != incidence_requests.end());
|
|
||||||
typename std::list< Incidence_request_elt >::iterator b(ir_first), e(ir_last);
|
|
||||||
e++;
|
|
||||||
incidence_requests.erase(b, e);
|
|
||||||
ir_first = incidence_requests.end();
|
|
||||||
ir_last = incidence_requests.end();
|
|
||||||
}
|
|
||||||
|
|
||||||
_incident_border = new Intern_successors_type(new Next_border_elt(),
|
|
||||||
new Next_border_elt());
|
|
||||||
_incident_border->first->first = NULL;
|
|
||||||
_incident_border->second->first = NULL;
|
|
||||||
_mark = -1;
|
|
||||||
_post_mark = -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
|
||||||
|
|
||||||
inline bool is_on_border(const int& i) const
|
|
||||||
{
|
|
||||||
if (_incident_border == NULL) return false; //vh is interior
|
|
||||||
if (_incident_border->first->first != NULL)
|
|
||||||
{
|
|
||||||
if (_incident_border->second->first != NULL)
|
|
||||||
return ((_incident_border->first->second.second == i)||
|
|
||||||
(_incident_border->second->second.second == i));
|
|
||||||
return (_incident_border->first->second.second == i);
|
|
||||||
}
|
|
||||||
return false; //vh is still exterior
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Next_border_elt* get_next_on_border(const int& i) const
|
|
||||||
{
|
|
||||||
if (_incident_border == NULL) return NULL; //vh is interior
|
|
||||||
if (_incident_border->first->first != NULL)
|
|
||||||
if (_incident_border->first->second.second == i)
|
|
||||||
return _incident_border->first;
|
|
||||||
if (_incident_border->second->first != NULL)
|
|
||||||
if (_incident_border->second->second.second == i)
|
|
||||||
return _incident_border->second;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline void remove_border_edge(Vertex_handle v)
|
|
||||||
{
|
|
||||||
if (_incident_border != NULL)
|
|
||||||
{
|
|
||||||
if (_incident_border->second->first == v)
|
|
||||||
{
|
|
||||||
_incident_border->second->first = NULL;
|
|
||||||
set_interior_edge(v);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (_incident_border->first->first == v)
|
|
||||||
{
|
|
||||||
if (_incident_border->second->first != NULL)
|
|
||||||
{
|
|
||||||
Next_border_elt* tmp = _incident_border->first;
|
|
||||||
_incident_border->first = _incident_border->second;
|
|
||||||
_incident_border->second = tmp;
|
|
||||||
_incident_border->second->first = NULL;
|
|
||||||
set_interior_edge(v);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_incident_border->first->first = NULL;
|
|
||||||
set_interior_edge(v);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool is_border_edge(Vertex_handle v) const
|
|
||||||
{
|
|
||||||
if (_incident_border == NULL) return false;
|
|
||||||
return ((_incident_border->first->first == v)||
|
|
||||||
(_incident_border->second->first == v));
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Next_border_elt* get_border_elt(Vertex_handle v) const
|
|
||||||
{
|
|
||||||
if (_incident_border == NULL) return NULL;
|
|
||||||
if (_incident_border->first->first == v) return _incident_border->first;
|
|
||||||
if (_incident_border->second->first == v) return _incident_border->second;
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Next_border_elt* first_incident() const
|
|
||||||
{
|
|
||||||
if (_incident_border == NULL) return NULL;
|
|
||||||
return _incident_border->first;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Next_border_elt* second_incident() const
|
|
||||||
{
|
|
||||||
if (_incident_border == NULL) return NULL;
|
|
||||||
return _incident_border->second;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
inline void set_next_border_elt(const Next_border_elt& elt)
|
|
||||||
{
|
|
||||||
if (_incident_border->first->first == NULL)
|
|
||||||
*_incident_border->first = elt;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (_incident_border->second->first != NULL)
|
|
||||||
std::cerr << "+++probleme de MAJ du bord <Vertex_base>" << std::endl;
|
|
||||||
*_incident_border->second = elt;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
|
||||||
// pour gerer certaines aretes interieures: a savoir celle encore connectee au
|
|
||||||
// bord (en fait seule, les aretes interieures reliant 2 bords nous
|
|
||||||
// interressent...)
|
|
||||||
|
|
||||||
inline bool is_interior_edge(Vertex_handle v) const
|
|
||||||
{
|
|
||||||
|
|
||||||
bool r1;
|
|
||||||
if(ie_first == interior_edges.end()){
|
|
||||||
r1 = false;
|
|
||||||
}else {
|
|
||||||
typename std::list<Vertex_handle>::iterator b(ie_first), e(ie_last);
|
|
||||||
e++;
|
|
||||||
typename std::list<Vertex_handle>::iterator r = std::find(b, e, v);
|
|
||||||
r1 = ( r != e);
|
|
||||||
}
|
|
||||||
|
|
||||||
return r1;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void set_interior_edge(Vertex_handle v)
|
|
||||||
{
|
|
||||||
if(ie_last == interior_edges.end()){ // empty set
|
|
||||||
assert(ie_first == ie_last);
|
|
||||||
ie_last = interior_edges.insert(ie_last, v);
|
|
||||||
ie_first = ie_last;
|
|
||||||
} else {
|
|
||||||
typename std::list<Vertex_handle>::iterator e(ie_last);
|
|
||||||
e++;
|
|
||||||
#ifdef DEBUG
|
|
||||||
typename std::list<Vertex_handle>::iterator r = std::find(ie_first, e, v);
|
|
||||||
#endif
|
|
||||||
assert(r == e);
|
|
||||||
ie_last = interior_edges.insert(e, v);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void remove_interior_edge(Vertex_handle v)
|
|
||||||
{
|
|
||||||
if(ie_first == interior_edges.end()){
|
|
||||||
assert(ie_last == ie_first);
|
|
||||||
} else if(ie_first == ie_last){ // there is only one element
|
|
||||||
if(*ie_first == v){
|
|
||||||
interior_edges.erase(ie_first);
|
|
||||||
ie_last = interior_edges.end();
|
|
||||||
ie_first = ie_last;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
typename std::list<Vertex_handle>::iterator b(ie_first), e(ie_last);
|
|
||||||
e++;
|
|
||||||
typename std::list<Vertex_handle>::iterator r = std::find(b, e, v);
|
|
||||||
if(r != e){
|
|
||||||
if(r == ie_first){
|
|
||||||
ie_first++;
|
|
||||||
}
|
|
||||||
if(r == ie_last){
|
|
||||||
ie_last--;
|
|
||||||
}
|
|
||||||
interior_edges.erase(r);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
|
||||||
|
|
||||||
inline void set_incidence_request(const Incidence_request_elt& ir)
|
|
||||||
{
|
|
||||||
if(ir_last == incidence_requests.end()){
|
|
||||||
assert(ir_first == ir_last);
|
|
||||||
ir_last = incidence_requests.insert(ir_last, ir);
|
|
||||||
ir_first = ir_last;
|
|
||||||
} else {
|
|
||||||
typename std::list<Incidence_request_elt>::iterator e(ir_last);
|
|
||||||
e++;
|
|
||||||
ir_last = incidence_requests.insert(e, ir);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool is_incidence_requested() const
|
|
||||||
{
|
|
||||||
if(ir_last == incidence_requests.end()){
|
|
||||||
assert(ir_first == incidence_requests.end());
|
|
||||||
}
|
|
||||||
return (ir_last != incidence_requests.end());
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Incidence_request_iterator incidence_request_begin()
|
|
||||||
{
|
|
||||||
return ir_first;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline Incidence_request_iterator get_incidence_request_end()
|
|
||||||
{
|
|
||||||
if(ir_last != incidence_requests.end()){
|
|
||||||
assert(ir_first != incidence_requests.end());
|
|
||||||
Incidence_request_iterator it(ir_last);
|
|
||||||
it++;
|
|
||||||
return it;
|
|
||||||
}
|
|
||||||
return ir_last;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void erase_incidence_request()
|
|
||||||
{
|
|
||||||
if(ir_last != incidence_requests.end()){
|
|
||||||
assert(ir_first != incidence_requests.end());
|
|
||||||
ir_last++;
|
|
||||||
incidence_requests.erase(ir_first, ir_last);
|
|
||||||
ir_first = incidence_requests.end();
|
|
||||||
ir_last = incidence_requests.end();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
|
||||||
|
|
||||||
inline bool is_on_border() const
|
|
||||||
{
|
|
||||||
return (_mark > 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool not_interior() const
|
|
||||||
{
|
|
||||||
return (_mark != 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline int number_of_incident_border() const
|
|
||||||
{
|
|
||||||
return _mark;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool is_exterior() const
|
|
||||||
{
|
|
||||||
return (_mark < 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
|
||||||
|
|
||||||
inline void inc_mark()
|
|
||||||
{
|
|
||||||
if (_mark==-1)
|
|
||||||
_mark=1;
|
|
||||||
else
|
|
||||||
_mark++;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void dec_mark()
|
|
||||||
{
|
|
||||||
_mark--;
|
|
||||||
if(_mark == 0)
|
|
||||||
{
|
|
||||||
delete _incident_border->first;
|
|
||||||
delete _incident_border->second;
|
|
||||||
delete _incident_border;
|
|
||||||
_incident_border = NULL;
|
|
||||||
erase_incidence_request();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
|
||||||
|
|
||||||
inline void set_post_mark(const int& i)
|
|
||||||
{
|
|
||||||
_post_mark = i;
|
|
||||||
}
|
|
||||||
|
|
||||||
inline bool is_post_marked(const int& i)
|
|
||||||
{
|
|
||||||
return (_post_mark == i);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
template <class K, class VertexBase>
|
|
||||||
std::list<typename AFSR_vertex_base_3<K,VertexBase>::Vertex_handle> AFSR_vertex_base_3<K,VertexBase>::interior_edges;
|
|
||||||
|
|
||||||
template <class K, class VertexBase>
|
|
||||||
std::list<typename AFSR_vertex_base_3<K,VertexBase>::Incidence_request_elt> AFSR_vertex_base_3<K,VertexBase>::incidence_requests;
|
|
||||||
|
|
||||||
} // namespace CGAL
|
|
||||||
|
|
||||||
#endif //CGAL_AFSR_VERTEX_BASE_3_H
|
|
||||||
|
|
||||||
|
|
@ -2405,6 +2405,35 @@ advancing_front_surface_reconstructionP(PointIterator b,
|
||||||
AFSR::construct_polyhedron(polyhedron, R);
|
AFSR::construct_polyhedron(polyhedron, R);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename PointIterator, typename Kernel, typename Items>
|
||||||
|
void
|
||||||
|
advancing_front_surface_reconstructionP(PointIterator b,
|
||||||
|
PointIterator e,
|
||||||
|
Polyhedron_3<Kernel,Items>& polyhedron,
|
||||||
|
double radius_ratio_bound = 5,
|
||||||
|
double beta = 0.52)
|
||||||
|
{
|
||||||
|
typedef Advancing_front_surface_reconstruction_vertex_base_3<Kernel> LVb;
|
||||||
|
typedef Advancing_front_surface_reconstruction_cell_base_3<Kernel> LCb;
|
||||||
|
|
||||||
|
typedef Triangulation_data_structure_3<LVb,LCb> Tds;
|
||||||
|
typedef Delaunay_triangulation_3<Kernel,Tds> Triangulation_3;
|
||||||
|
|
||||||
|
typedef Advancing_front_surface_reconstruction<Kernel,Triangulation_3> Reconstruction;
|
||||||
|
typedef typename Kernel::Point_3 Point_3;
|
||||||
|
|
||||||
|
Triangulation_3 dt( boost::make_transform_iterator(b, AFSR::Auto_count<Point_3>()),
|
||||||
|
boost::make_transform_iterator(e, AFSR::Auto_count<Point_3>() ) );
|
||||||
|
|
||||||
|
AFSR_options opt;
|
||||||
|
opt.K = radius_ratio_bound;
|
||||||
|
// TODO: What to do with beta???
|
||||||
|
Reconstruction R(dt, opt);
|
||||||
|
R.run(opt);
|
||||||
|
AFSR::construct_polyhedron(polyhedron, R);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace CGAL
|
} // namespace CGAL
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,87 +0,0 @@
|
||||||
// Copyright (c) 2015 INRIA Sophia-Antipolis (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
|
|
||||||
// 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) : Frank Da, David Cohen-Steiner, Andreas Fabri
|
|
||||||
|
|
||||||
#ifndef CGAL_AFSR_VRML_H
|
|
||||||
#define CGAL_AFSR_VRML_H
|
|
||||||
|
|
||||||
namespace CGAL {
|
|
||||||
|
|
||||||
template < class Vb, class Fb>
|
|
||||||
void
|
|
||||||
afsr_vrml_output(const Triangulation_data_structure_2<Vb,Fb>& tds,
|
|
||||||
std::ostream& os, double r, double g, double b,
|
|
||||||
typename Triangulation_data_structure_2<Vb,Fb>::Vertex_handle v, bool skip_infinite)
|
|
||||||
{
|
|
||||||
typedef typename Triangulation_data_structure_2<Vb,Fb>::Vertex_handle Vertex_handle;
|
|
||||||
typedef typename Triangulation_data_structure_2<Vb,Fb>::Vertex_iterator Vertex_iterator;
|
|
||||||
typedef typename Triangulation_data_structure_2<Vb,Fb>::Face_iterator Face_iterator;
|
|
||||||
|
|
||||||
// ouput to a vrml file style
|
|
||||||
// Point are assumed to be 3d points with a stream operator <<
|
|
||||||
// if non NULL, v is the vertex to be output first
|
|
||||||
// if skip_inf is true, the point in the first vertex is not output
|
|
||||||
// and the faces incident to v are not output
|
|
||||||
// (it may be for instance the infinite vertex of the terrain)
|
|
||||||
|
|
||||||
os << "#VRML V2.0 utf8" << std::endl;
|
|
||||||
os << "Shape {\n"
|
|
||||||
<< "appearance Appearance {\n"
|
|
||||||
<< "material Material { diffuseColor " << r << " " << g << " " << b << "}}\n";
|
|
||||||
os << "\tgeometry IndexedFaceSet {" << std::endl;
|
|
||||||
os << "\t\tcoord Coordinate {" << std::endl;
|
|
||||||
os << "\t\t\tpoint [" << std::endl;
|
|
||||||
|
|
||||||
std::map<Vertex_handle,int> vmap;
|
|
||||||
Vertex_iterator vit;
|
|
||||||
Face_iterator fit;
|
|
||||||
|
|
||||||
int inum = 0;
|
|
||||||
for( vit= tds.vertices_begin(); vit != tds.vertices_end() ; ++vit) {
|
|
||||||
if ( v != vit) {
|
|
||||||
vmap[vit] = inum++;
|
|
||||||
os << "\t\t\t\t" << *vit << ","<< std::endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
os << "\t\t\t]" << std::endl;
|
|
||||||
os << "\t\t}" << std::endl;
|
|
||||||
os << "\t\tsolid FALSE\n"
|
|
||||||
"\t\tcoordIndex [" << std::endl;
|
|
||||||
|
|
||||||
// faces
|
|
||||||
for(fit= tds.faces_begin(); fit != tds.faces_end(); ++fit) {
|
|
||||||
if (!skip_infinite || !fit->has_vertex(v)) {
|
|
||||||
os << "\t\t\t";
|
|
||||||
os << vmap[(*fit).vertex(0)] << ", ";
|
|
||||||
os << vmap[(*fit).vertex(1)] << ", ";
|
|
||||||
os << vmap[(*fit).vertex(2)] << ", ";
|
|
||||||
os << "-1, " << std::endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
os << "\t\t]" << std::endl;
|
|
||||||
os << "\t}" << std::endl;
|
|
||||||
os << "}" << std::endl;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
} // namespace CGAL
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
File diff suppressed because it is too large
Load Diff
|
|
@ -1,94 +0,0 @@
|
||||||
// Copyright (c) 1997 INRIA Sophia-Antipolis (France).
|
|
||||||
// All rights reserved.
|
|
||||||
//
|
|
||||||
// This file is part of CGAL (www.cgal.org); you may redistribute it under
|
|
||||||
// the terms of the Q Public License version 1.0.
|
|
||||||
// See the file LICENSE.QPL distributed with CGAL.
|
|
||||||
//
|
|
||||||
// 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.
|
|
||||||
//
|
|
||||||
// $Source: /CVSROOT/CGAL/Packages/Triangulation_2/include/CGAL/Triangulation_vertex_base_2.h,v $
|
|
||||||
// $Revision$ $Date$
|
|
||||||
// $Name: current_submission $
|
|
||||||
//
|
|
||||||
// Author(s) : Mariette Yvinec
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef CGAL_TVB_3_2_H
|
|
||||||
#define CGAL_TVB_3_2_H
|
|
||||||
|
|
||||||
#include <CGAL/basic.h>
|
|
||||||
#include <CGAL/Triangulation_ds_vertex_base_2.h>
|
|
||||||
|
|
||||||
namespace CGAL {
|
|
||||||
|
|
||||||
template < typename GT,
|
|
||||||
typename Vb = Triangulation_ds_vertex_base_2<> >
|
|
||||||
class Tvb_3_2
|
|
||||||
: public Vb
|
|
||||||
|
|
||||||
{
|
|
||||||
typedef typename Vb::Triangulation_data_structure Tds;
|
|
||||||
public:
|
|
||||||
typedef GT Geom_traits;
|
|
||||||
typedef typename GT::Point_3 Point;
|
|
||||||
typedef Tds Triangulation_data_structure;
|
|
||||||
typedef typename Tds::Face_handle Face_handle;
|
|
||||||
typedef typename Tds::Vertex_handle Vertex_handle;
|
|
||||||
|
|
||||||
template < typename TDS2 >
|
|
||||||
struct Rebind_TDS {
|
|
||||||
typedef typename Vb::template Rebind_TDS<TDS2>::Other Vb2;
|
|
||||||
typedef Tvb_3_2<GT, Vb2> Other;
|
|
||||||
};
|
|
||||||
|
|
||||||
private:
|
|
||||||
Point _p;
|
|
||||||
|
|
||||||
public:
|
|
||||||
Tvb_3_2 () : Vb() {}
|
|
||||||
Tvb_3_2(const Point & p) : Vb(), _p(p) {}
|
|
||||||
Tvb_3_2(const Point & p, Face_handle f)
|
|
||||||
: Vb(f), _p(p) {}
|
|
||||||
Tvb_3_2(Face_handle f) : Vb(f) {}
|
|
||||||
|
|
||||||
void set_point(const Point & p) { _p = p; }
|
|
||||||
const Point& point() const { return _p; }
|
|
||||||
|
|
||||||
// the non const version of point() is undocument
|
|
||||||
// but needed to make the point iterator works
|
|
||||||
// using Lutz projection scheme
|
|
||||||
Point& point() { return _p; }
|
|
||||||
|
|
||||||
//the following trivial is_valid to allow
|
|
||||||
// the user of derived face base classes
|
|
||||||
// to add their own purpose checking
|
|
||||||
bool is_valid(bool /* verbose */ = false, int /* level */ = 0) const
|
|
||||||
{return true;}
|
|
||||||
};
|
|
||||||
|
|
||||||
template < class GT, class Vb >
|
|
||||||
std::istream&
|
|
||||||
operator>>(std::istream &is, Tvb_3_2<GT, Vb> &v)
|
|
||||||
// non combinatorial information. Default = point
|
|
||||||
{
|
|
||||||
return is >> static_cast<Vb&>(v) >> v.point();
|
|
||||||
}
|
|
||||||
|
|
||||||
template < class GT, class Vb >
|
|
||||||
std::ostream&
|
|
||||||
operator<<(std::ostream &os, const Tvb_3_2<GT, Vb> &v)
|
|
||||||
// non combinatorial information. Default = point
|
|
||||||
{
|
|
||||||
return os << static_cast<const Vb&>(v) << v.point();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} //namespace CGAL
|
|
||||||
|
|
||||||
#endif //CGAL_TVB_3_2_H
|
|
||||||
Loading…
Reference in New Issue