*deprecate the use of geninfo

*naive replacement of void* and geninfo by boost::any.
*old code can be used if CGAL_I_DO_WANT_TO_USE_GENINFO is defined
*info was printed, I simply ignored that for boost::any 
 (it probably made sense why the old implementation of geninfo that was using placement new to write
  inside the void*)
*some sizeof(void*) was used in SNC_structure.h for printing the size of something.
 I guessed this was related to the void* used as info. I left that code untouched.
*testsuite is OK on my machine except Nef_3/example/Nef_3/polygon_construction which also
 does not work with next on my machine
This commit is contained in:
Sébastien Loriot 2012-04-17 18:18:09 +00:00
parent 623bb56ae0
commit 24070082f6
24 changed files with 600 additions and 71 deletions

View File

@ -26,6 +26,9 @@
#include <list>
#include <boost/optional.hpp>
#include <boost/none.hpp>
#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <boost/any.hpp>
#endif
namespace CGAL {
@ -61,7 +64,11 @@ public:
typedef typename Refs::Face_const_handle Face_const_handle;
typedef typename Refs::Halfedge Halfedge;
typedef typename Refs::Face Face;
typedef void* GenPtr;
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
typedef void* GenPtr;
#else
typedef boost::any GenPtr;
#endif
typedef typename Traits::Point Point; // geometric embedding
typedef typename Traits::Mark Mark; // information
@ -76,12 +83,20 @@ private:
GenPtr _i;
public:
Nef_vertex_2() : _h(),_f(),_ivit(),_m(0),_i((GenPtr)0xABCD) {}
Nef_vertex_2() : _h(),_f(),_ivit(),_m(0)
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
,_i((GenPtr)0xABCD)
#endif
{}
// constructs an uninitialized vertex concerning embedding
// and mark. All links are initialized by their default value.
Nef_vertex_2( const Point& p) :
_h(),_f(),_p(p),_ivit(),_m(0),_i((GenPtr)0xABCD) {}
_h(),_f(),_p(p),_ivit(),_m(0)
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
,_i((GenPtr)0xABCD)
#endif
{}
// constructs a vertex with embedding |p| and mark |m|.
// All links are initialized by their default value.
@ -138,7 +153,11 @@ public:
typedef typename Refs::Face_const_handle Face_const_handle;
typedef typename Refs::Vertex Vertex;
typedef typename Refs::Face Face;
typedef void* GenPtr;
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
typedef void* GenPtr;
#else
typedef boost::any GenPtr;
#endif
typedef typename std::list<Halfedge_handle>::iterator fc_iterator;
@ -154,7 +173,11 @@ protected:
public:
Nef_halfedge_2() :
opp(),prv(),nxt(),_v(),_f(),_fcit(),_m(0),_i((GenPtr)0xABCD) {}
opp(),prv(),nxt(),_v(),_f(),_fcit(),_m(0)
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
,_i((GenPtr)0xABCD)
#endif
{}
/*{\Mcreate constructs an uninitialized halfedge concerning embedding
and mark. All links are initialized by their default value.}*/
@ -227,7 +250,11 @@ public:
typedef typename Refs::Face_const_handle Face_const_handle;
typedef typename Refs::Vertex Vertex;
typedef typename Refs::Halfedge Halfedge;
typedef void* GenPtr;
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
typedef void* GenPtr;
#else
typedef boost::any GenPtr;
#endif
typedef typename Traits::Mark Mark; // mark information
@ -300,7 +327,11 @@ private:
GenPtr _i;
public:
Nef_face_2() : _e(),_m(0),_i((GenPtr)0xABCD) {}
Nef_face_2() : _e(),_m(0)
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
,_i((GenPtr)0xABCD)
#endif
{}
/*{\Mcreate constructs an uninitialized face with undefined mark,
empty face cycle list, and empty isolated vertices list.}*/

View File

@ -32,6 +32,10 @@
#define CGAL_NEF_DEBUG 7
#include <CGAL/Nef_2/debug.h>
#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <boost/any.hpp>
#endif
namespace CGAL {
template <typename Iter, typename Move>
@ -132,8 +136,13 @@ typedef typename Traits::Mark Mark;
/*{\Mtypemember All objects (vertices, edges, faces) are attributed by a
|Mark| object.}*/
typedef size_t Size_type;
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
/*{\Mtypemember The size type.}*/
typedef void* GenPtr;
#else
typedef boost::any GenPtr;
#endif
typedef typename HDS::Vertex Vertex;
@ -403,7 +412,11 @@ std::string PE(HH e)
{ std::ostringstream os;
if (e==HH()) return "nil";
os << "[" << PV(e->opposite()->vertex()) << ","
<< PV(e->vertex()) << " " << e->info() << "]";
<< PV(e->vertex()) << " "
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
<< e->info()
#endif
<< "]";
return os.str();
}

View File

@ -21,7 +21,11 @@
#ifndef CGAL_PM_DECORATOR_H
#define CGAL_PM_DECORATOR_H
#include <CGAL/Nef_2/PM_const_decorator.h>
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <CGAL/Nef_2/geninfo.h>
#else
#include <boost/any.hpp>
#endif
#include <CGAL/Unique_hash_map.h>
#include <vector>

View File

@ -25,7 +25,11 @@
#include <CGAL/Unique_hash_map.h>
#include <CGAL/Union_find.h>
#include <CGAL/Nef_2/Segment_overlay_traits.h>
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <CGAL/Nef_2/geninfo.h>
#else
#include <boost/any.hpp>
#endif
#undef CGAL_NEF_DEBUG
#define CGAL_NEF_DEBUG 13
#include <CGAL/Nef_2/debug.h>
@ -49,7 +53,11 @@ struct PMO_from_segs {
Vertex_handle new_vertex(const Point& p)
{ Vertex_handle v = G.new_vertex(p);
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<Halfedge_handle>::create(G.info(v));
#else
G.info(v)=Halfedge_handle();
#endif
return v;
}
@ -78,15 +86,32 @@ struct PMO_from_segs {
{ D.ending_segment(v,it); }
void halfedge_below(Vertex_handle v, Halfedge_handle e) const
{ geninfo<Halfedge_handle>::access(G.info(v)) = e; }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<Halfedge_handle>::access(G.info(v)) = e;
#else
*boost::any_cast<Halfedge_handle>(&G.info(v)) = e;
#endif
}
Halfedge_handle halfedge_below(Vertex_handle v) const
{ return geninfo<Halfedge_handle>::access(G.info(v)); }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
return geninfo<Halfedge_handle>::access(G.info(v));
#else
return
boost::any_cast<Halfedge_handle>(G.info(v));
#endif
}
void clear_temporary_vertex_info() const
{ Vertex_handle v;
for(v = G.vertices_begin(); v!= G.vertices_end(); ++v)
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<Halfedge_handle>::clear(G.info(v));
#else
G.info(v)=boost::any();
#endif
}
@ -634,13 +659,32 @@ struct vertex_info {
};
void assoc_info(Vertex_handle v) const
{ geninfo<vertex_info>::create(info(v)); }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<vertex_info>::create(info(v));
#else
info(v)=vertex_info();
#endif
}
void discard_info(Vertex_handle v) const
{ geninfo<vertex_info>::clear(info(v)); }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<vertex_info>::clear(info(v));
#else
info(v)=boost::any();
#endif
}
vertex_info& ginfo(Vertex_handle v) const
{ return geninfo<vertex_info>::access(info(v)); }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
return geninfo<vertex_info>::access(info(v));
#else
return
*boost::any_cast<vertex_info>(&info(v));
#endif
}
Mark& mark(Vertex_handle v, int i) const
{ return ginfo(v).m[i]; }
@ -667,15 +711,36 @@ struct halfedge_info {
};
void assoc_info(Halfedge_handle e) const
{ geninfo<halfedge_info>::create(info(e));
geninfo<halfedge_info>::create(info(twin(e))); }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<halfedge_info>::create(info(e));
geninfo<halfedge_info>::create(info(twin(e)));
#else
info(e)=halfedge_info();
info(twin(e))=halfedge_info();
#endif
}
void discard_info(Halfedge_handle e) const
{ geninfo<halfedge_info>::clear(info(e));
geninfo<halfedge_info>::clear(info(twin(e))); }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<halfedge_info>::clear(info(e));
geninfo<halfedge_info>::clear(info(twin(e)));
#else
info(e)=boost::any();
info(twin(e))=boost::any();
#endif
}
halfedge_info& ginfo(Halfedge_handle e) const
{ return geninfo<halfedge_info>::access(info(e)); }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
return geninfo<halfedge_info>::access(info(e));
#else
return
*boost::any_cast<halfedge_info>(&info(e));
#endif
}
Mark& mark(Halfedge_handle e, int i) const
// uedge information we store in the smaller one
@ -702,13 +767,32 @@ struct face_info {
};
void assoc_info(Face_handle f) const
{ geninfo<face_info>::create(info(f)); }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<face_info>::create(info(f));
#else
info(f)=face_info();
#endif
}
void discard_info(Face_handle f) const
{ geninfo<face_info>::clear(info(f)); }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<face_info>::clear(info(f));
#else
info(f)=boost::any();
#endif
}
face_info& ginfo(Face_handle f) const
{ return geninfo<face_info>::access(info(f)); }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
return geninfo<face_info>::access(info(f));
#else
return
*boost::any_cast<face_info>(&info(f));
#endif
}
Mark& mark(Face_handle f, int i) const
{ return ginfo(f).m[i]; }

View File

@ -29,7 +29,11 @@
#undef CGAL_NEF_DEBUG
#define CGAL_NEF_DEBUG 17
#include <CGAL/Nef_2/debug.h>
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <CGAL/Nef_2/geninfo.h>
#else
#include <boost/any.hpp>
#endif
#ifdef CGAL_USE_LEDA
#include <CGAL/LEDA_basic.h>
@ -468,27 +472,57 @@ public:
void operator()(Vertex_handle vn, Vertex_const_handle vo) const
{ Face_const_handle f;
if ( Po.is_isolated(vo) ) f = Po.face(vo);
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<VF_pair>::create(info(vn));
geninfo<VF_pair>::access(info(vn)) = VF_pair(vo,f);
#else
info(vn) = VF_pair(vo,f);
#endif
CGAL_NEF_TRACEN("linking to org "<<PV(vn));
}
void operator()(Halfedge_handle hn, Halfedge_const_handle ho) const
{ geninfo<EF_pair>::create(info(hn));
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<EF_pair>::create(info(hn));
geninfo<EF_pair>::access(info(hn)) = EF_pair(ho,Po.face(ho));
#else
info(hn) = EF_pair(ho,Po.face(ho));
#endif
CGAL_NEF_TRACEN("linking to org "<<PE(hn));
}
};
protected:
Vertex_const_handle input_vertex(Vertex_const_handle v) const
{ return geninfo<VF_pair>::const_access(CT.info(v)).first; }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
return geninfo<VF_pair>::const_access(CT.info(v)).first;
#else
return
boost::any_cast<VF_pair>(CT.info(v)).first;
#endif
}
Halfedge_const_handle input_halfedge(Halfedge_const_handle e) const
{ return geninfo<EF_pair>::const_access(CT.info(e)).first; }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
return geninfo<EF_pair>::const_access(CT.info(e)).first;
#else
return
boost::any_cast<EF_pair>(CT.info(e)).first;
#endif
}
Face_const_handle input_face(Halfedge_const_handle e) const
{ return geninfo<EF_pair>::const_access(CT.info(e)).second; }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
return geninfo<EF_pair>::const_access(CT.info(e)).second;
#else
return
boost::any_cast<EF_pair>(CT.info(e)).second;
#endif
}
Object_handle input_object(Vertex_const_handle v) const
@ -547,10 +581,19 @@ protected:
{ Halfedge_handle e_from = previous(e);
Face_const_handle f;
if ( is_closed_at_source(e) ) // source(e) was isolated before
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
f = geninfo<VF_pair>::access(info(source(e))).second;
else
f = geninfo<EF_pair>::access(info(e_from)).second;
f = geninfo<EF_pair>::access(info(e_from)).second;
#else
f =
boost::any_cast<VF_pair>(info(source(e))).second;
else
f =
boost::any_cast<EF_pair>(info(e_from)).second;
#endif
mark(e) = _DP.mark(f);
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<EF_pair>::create(info(e));
geninfo<EF_pair>::create(info(twin(e)));
@ -560,6 +603,10 @@ protected:
geninfo<EF_pair>::access(info(e)).second =
geninfo<EF_pair>::access(info(twin(e))).second = f;
#else
info(e)=EF_pair(Halfedge_const_handle(),f);
info(twin(e))=EF_pair(Halfedge_const_handle(),f);
#endif
CGAL_NEF_TRACEN("CT_new_edge "<<PE(e));
}
};
@ -920,11 +967,19 @@ PM_point_locator<PMD,GEO>::
{ CGAL_NEF_TRACEN("clear_static_point_locator");
Vertex_iterator vit, vend = CT.vertices_end();
for (vit = CT.vertices_begin(); vit != vend; ++vit) {
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<VF_pair>::clear(CT.info(vit));
#else
CT.info(vit)=boost::any();
#endif
}
Halfedge_iterator eit, eend = CT.halfedges_end();
for (eit = CT.halfedges_begin(); eit != eend; ++eit) {
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<EF_pair>::clear(CT.info(eit));
#else
CT.info(eit)=boost::any();
#endif
}
CT.clear();
delete &(CT.plane_map());

View File

@ -33,7 +33,12 @@
#include <list>
#include <vector>
#include <map>
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <CGAL/Nef_2/geninfo.h>
#else
#include <boost/any.hpp>
#endif
#undef CGAL_NEF_DEBUG
#define CGAL_NEF_DEBUG 17
@ -56,7 +61,11 @@ class GenericLocation {
point location. It can store a node or an edge of a graph or the special
value |nil| which is used to signal that no node or edge could be found.
}*/
typedef void* GenPtr;
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
typedef void* GenPtr;
#else
typedef boost::any GenPtr;
#endif
public:
/*{\Mtypes}*/
enum Type { NIL, NODE, EDGE };
@ -85,7 +94,12 @@ public:
if (type != NODE)
CGAL_LEDA_SCOPE::error_handler(1, "Location: not convertible to node");
#endif
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
return geninfo<Node>::const_access(value);
#else
return
*boost::any_cast<Node>(&value);
#endif
}
/*{\Mconversion converts |\Mvar| into a node.\\
\precond |\Mvar| represents a node.}*/
@ -96,7 +110,12 @@ public:
if (type != EDGE)
CGAL_LEDA_SCOPE::error_handler(1, "Location: not convertible to edge");
#endif
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
return geninfo<Edge>::const_access(value);
#else
return
*boost::any_cast<Edge>(&value);
#endif
}
/*{\Mconversion converts |\Mvar| into an edge.\\
\precond |\Mvar| represents an edge.}*/
@ -125,20 +144,33 @@ public:
void init() { type = NIL; }
void init(Node n)
{ type = NODE;
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<Node>::create(value);
geninfo<Node>::access(value) = n;
geninfo<Node>::access(value) = n;
#else
value=n;
#endif
}
void init(Edge e)
{ type = EDGE;
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<Edge>::create(value);
geninfo<Edge>::access(value) = e;
geninfo<Edge>::access(value) = e;
#else
value=e;
#endif
}
void clear()
{
switch(type) {
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
case NODE: geninfo<Node>::clear(value); break;
case EDGE: geninfo<Edge>::clear(value); break;
#else
case NODE: value=boost::any(); break;
case EDGE: value=boost::any(); break;
#endif
case NIL: break;
}
}
@ -148,10 +180,18 @@ public:
type = L.type;
switch(type) {
case NODE:
geninfo<Node>::access(value) = geninfo<Node>::const_access(L.value);
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<Node>::access(value) = geninfo<Node>::const_access(L.value);
#else
*boost_any_cast<Node>(&value) = boost::any_cast<Node>(L.value);
#endif
break;
case EDGE:
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<Edge>::access(value) = geninfo<Edge>::const_access(L.value);
#else
*boost::any_cast<Edge>(&value) = boost::any_cast<Edge>(L.value);
#endif
break;
case NIL: break;
}

View File

@ -21,6 +21,11 @@
#ifndef CGAL_NEF_2_GENINFO_H
#define CGAL_NEF_2_GENINFO_H
//This file is deprecated and something like boost::any or boost::variant should
//be used instead
#include <CGAL/internal/deprecation_warning.h>
#include <CGAL/config.h>
#include <memory>

View File

@ -34,12 +34,20 @@
#define CGAL_NEF_DEBUG 83
#include <CGAL/Nef_2/debug.h>
#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <boost/any.hpp>
#endif
namespace CGAL {
template <typename Refs>
class Halfedge_base
{ // == Halfedge
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
typedef void* GenPtr;
#else
typedef boost::any GenPtr;
#endif
typedef typename Refs::Mark Mark;
typedef typename Refs::Vector_3 Vector_3;
typedef typename Refs::Sphere_point Sphere_point;
@ -131,7 +139,11 @@ class Halfedge_base
std::string debug() const
{ std::stringstream os;
set_pretty_mode(os);
os<<"sv [ "<<point_<<info_<<" ] ";
os<<"sv [ "<<point_
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
<<info_
#endif
<<" ] ";
return os.str();
}

View File

@ -33,11 +33,19 @@
#define CGAL_NEF_DEBUG 83
#include <CGAL/Nef_2/debug.h>
#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <boost/any.hpp>
#endif
namespace CGAL {
template <typename Refs>
class SFace_base {
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
typedef void* GenPtr;
#else
typedef boost::any GenPtr;
#endif
typedef typename Refs::Mark Mark;
typedef typename Refs::Vertex_handle Vertex_handle;
typedef typename Refs::Vertex_const_handle Vertex_const_handle;

View File

@ -33,11 +33,19 @@
#define CGAL_NEF_DEBUG 83
#include <CGAL/Nef_2/debug.h>
#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <boost/any.hpp>
#endif
namespace CGAL {
template <typename Refs>
class SHalfedge_base {
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
typedef void* GenPtr;
#else
typedef boost::any GenPtr;
#endif
typedef typename Refs::Mark Mark;
typedef typename Refs::Sphere_circle Sphere_circle;
@ -199,7 +207,11 @@ class SHalfedge_base {
{ std::stringstream os;
set_pretty_mode(os);
os <<"e[ "<<source_->debug()<<", "
<<twin_->source_->debug()<<" "<<info_<<" ] ";
<<twin_->source_->debug()
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
<<" "<<info_
#endif
<<" ] ";
return os.str();
}

View File

@ -20,8 +20,11 @@
#ifndef CGAL_SNC_FM_DECORATOR_H
#define CGAL_SNC_FM_DECORATOR_H
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <CGAL/Nef_2/geninfo.h>
#else
#include <boost/any.hpp>
#endif
#include <CGAL/Nef_2/Segment_overlay_traits.h>
#include <CGAL/Nef_3/SNC_decorator.h>
#include <CGAL/Lazy_kernel.h>
@ -123,7 +126,12 @@ std::vector<E>& Support;
unsigned edge_number;
Vertex_handle new_vertex(const Point& p) const
{ geninfo<unsigned>::create(p.vertex()->info());
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<unsigned>::create(p.vertex()->info());
#else
p.vertex()->info()=unsigned();
#endif
return p.vertex(); }
Halfedge_handle new_halfedge_pair_at_source(Vertex_handle v)
@ -135,7 +143,12 @@ void supporting_segment(Halfedge_handle e, I it)
void halfedge_below(Vertex_handle v, Halfedge_handle e)
{ CGAL_NEF_TRACEN("halfedge_below point "<< v->point() <<": " << e);
geninfo<unsigned>::access(v->info()) = e; }
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<unsigned>::access(v->info()) = e;
#else
v->info() = e;
#endif
}
// all empty, no update necessary
void link_as_target_and_append(Vertex_handle, Halfedge_handle)
@ -396,7 +409,11 @@ protected:
int fc = FacetCycle[e];
SHalfedge_handle e_min = MinimalEdge[fc];
SHalfedge_handle e_below =
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
Edge_of[geninfo<unsigned>::access(info(e_min->twin()->source()->twin()->source()))];
#else
Edge_of[ boost::any_cast<unsigned>(info(e_min->twin()->source()->twin()->source())) ];
#endif
CGAL_assertion( e_below != SHalfedge_handle() );
CGAL_NEF_TRACEN(" edge below " << debug(e_below));
Halffacet_handle f = e_below->facet();
@ -631,7 +648,11 @@ create_facet_objects(const Plane_3& plane_supporting_facet,
CGAL_forall_iterators(lit,SHalfloops) { l=*lit;
SHalfedge_handle e_below =
Edge_of[geninfo<unsigned>::access(info(l->incident_sface()->center_vertex()))];
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
Edge_of[geninfo<unsigned>::access(info(l->incident_sface()->center_vertex()))];
#else
Edge_of[ boost::any_cast<unsigned>(info(l->incident_sface()->center_vertex())) ];
#endif
CGAL_assertion( e_below != SHalfedge_handle() );
CGAL_NEF_TRACEN("link sloop at vertex "<< l->incident_sface()->center_vertex()->point());

View File

@ -25,7 +25,11 @@
#include <CGAL/basic.h>
#include <CGAL/Union_find.h>
#include <CGAL/Nef_2/Segment_overlay_traits.h>
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <CGAL/Nef_2/geninfo.h>
#else
#include <boost/any.hpp>
#endif
#include <CGAL/Nef_S2/Sphere_geometry.h>
#include <CGAL/Nef_S2/SM_decorator.h>
#include <CGAL/Nef_S2/SM_const_decorator.h>

View File

@ -36,6 +36,10 @@
#define CGAL_NEF_DEBUG 191
#include <CGAL/Nef_2/debug.h>
#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <boost/any.hpp>
#endif
namespace CGAL {
template<typename S> class SM_const_decorator;
@ -116,7 +120,11 @@ public:
SHalfedge_around_sface_const_circulator;
public:
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
typedef void* GenPtr;
#else
typedef boost::any GenPtr;
#endif
SNC_const_decorator() : sncp_(0) {}
SNC_const_decorator(const SNC_structure& W) : sncp_(&W) {}

View File

@ -40,6 +40,10 @@
#define CGAL_NEF_DEBUG 19
#include <CGAL/Nef_2/debug.h>
#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <boost/any.hpp>
#endif
namespace CGAL {
template <typename Map>
@ -155,7 +159,11 @@ class SNC_decorator : public SNC_const_decorator<Map> {
enum {NO_SNC, WITH_SNC};
public:
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
typedef void* GenPtr;
#else
typedef boost::any GenPtr;
#endif
SNC_decorator() : Base(), sncp_() {}
SNC_decorator(SNC_structure& W)

View File

@ -39,6 +39,10 @@
#define CGAL_NEF_DEBUG 293
#include <CGAL/Nef_2/debug.h>
#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <boost/any.hpp>
#endif
namespace CGAL {
template<typename T>
@ -889,7 +893,11 @@ public:
typedef typename Infi_box::Standard_vector Standard_vector;
typedef typename Infi_box::Standard_plane Standard_plane;
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
typedef void* GenPtr;
#else
typedef boost::any GenPtr;
#endif
using Base::visit_shell_objects;

View File

@ -42,6 +42,10 @@
#define CGAL_NEF_DEBUG 37
#include <CGAL/Nef_2/debug.h>
#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <boost/any.hpp>
#endif
namespace CGAL {
// ----------------------------------------------------------------------------
@ -87,7 +91,11 @@ public:
typedef typename SNC_structure::Mark Mark;
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
typedef void* GenPtr;
#else
typedef boost::any GenPtr;
#endif
SNC_ray_shooter() {}
void initialize(SNC_structure* W) { *this = SNC_ray_shooter(*W);}

View File

@ -1212,7 +1212,8 @@ public:
sfaces_.erase(h);
put_sface_node(&*h);
}
//SL: in the following function, I guess the sizeof(void*) is related to the void* info that was
//used together with geninfo to store an arbitrary type. I replaced that with any and did not changed that
std::size_t bytes() {
// bytes used for the SNC_structure
@ -1253,7 +1254,8 @@ public:
return result;
}
//SL: in the following function, I guess the sizeof(void*) is related to the void* info that was
//used together with geninfo to store an arbitrary type. I replaced that with any and did not changed that
std::size_t bytes_reduced() {
// bytes used for the SNC_structure

View File

@ -33,12 +33,20 @@
#define CGAL_NEF_DEBUG 83
#include <CGAL/Nef_2/debug.h>
#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <boost/any.hpp>
#endif
namespace CGAL {
template<class Refs>
class Vertex_base {
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
typedef void* GenPtr;
#else
typedef boost::any GenPtr;
#endif
typedef typename Refs::Mark Mark;
typedef typename Refs::Point_3 Point_3;

View File

@ -36,6 +36,9 @@
#undef CGAL_NEF_DEBUG
#define CGAL_NEF_DEBUG 67
#include <CGAL/Nef_2/debug.h>
#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <boost/any.hpp>
#endif
namespace CGAL {
@ -74,7 +77,12 @@ typedef typename Map::Mark Mark;
typedef size_t Size_type;
/*{\Mtypemember size type.}*/
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
typedef void* GenPtr;
#else
typedef boost::any GenPtr;
#endif
// typedef typename Map::Constructor_const_parameter Constructor_parameter;
typedef typename Map::SVertex_const_handle SVertex_const_handle;

View File

@ -35,6 +35,9 @@
#include <CGAL/Nef_S2/Normalizing.h>
#include <CGAL/Unique_hash_map.h>
#include <CGAL/IO/Verbose_ostream.h>
#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <boost/any.hpp>
#endif
namespace CGAL {
@ -83,7 +86,11 @@ enum { BEFORE = -1, AFTER = 1 };
typedef typename Sphere_kernel::Aff_transformation_3 Aff_transformation_3;
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
typedef void* GenPtr;
#else
typedef boost::any GenPtr;
#endif
typedef typename Map::SVertex SVertex;
typedef typename Map::SVertex_handle SVertex_handle;
typedef typename Map::SVertex_iterator SVertex_iterator;

View File

@ -31,6 +31,9 @@
#include <CGAL/Nef_S2/Sphere_geometry.h>
#include <string>
#include <sstream>
#ifndef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <boost/any.hpp>
#endif
namespace CGAL {
@ -44,7 +47,11 @@ public:
template <typename Refs>
class SVertex
{
typedef void* GenPtr;
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
typedef void* GenPtr;
#else
typedef boost::any GenPtr;
#endif
typedef typename Refs::Mark Mark;
typedef typename Refs::Sphere_point Sphere_point;
typedef typename Refs::SVertex_handle SVertex_handle;
@ -108,7 +115,11 @@ public:
public:
std::string debug() const
{ std::ostringstream os; set_pretty_mode(os);
os<<"V"<<point_<<' '<<info_<<'\0';
os<<"V"<<point_
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
<<' '<<info_
#endif
<<'\0';
std::string res(os.str()); return res;
}
@ -118,7 +129,11 @@ public:
template <typename Refs>
class SHalfedge
{
typedef void* GenPtr;
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
typedef void* GenPtr;
#else
typedef boost::any GenPtr;
#endif
typedef typename Refs::Mark Mark;
typedef typename Refs::Sphere_circle Sphere_circle;
typedef typename Refs::SVertex_handle SVertex_handle;
@ -202,7 +217,11 @@ public:
std::string debug() const
{ std::ostringstream os; set_pretty_mode(os);
os <<"e["<<source_->debug()<<", "
<<twin_->source_->debug()<<" "<<info_<<"]"<<'\0';
<<twin_->source_->debug()<<
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
" "<< info_ <<
#endif
"]"<<'\0';
std::string res(os.str()); return res;
}
@ -211,7 +230,11 @@ public:
template <typename Refs>
class SHalfloop
{
typedef void* GenPtr;
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
typedef void* GenPtr;
#else
typedef boost::any GenPtr;
#endif
typedef typename Refs::Mark Mark;
typedef typename Refs::Sphere_circle Sphere_circle;
typedef typename Refs::SHalfloop_handle SHalfloop_handle;
@ -272,7 +295,11 @@ public:
std::string debug() const
{ std::ostringstream os; set_pretty_mode(os);
os<<"l"<<circle_<<' '<<info_<<'\0';
os<<"l"<<circle_
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
<<' '<<info_
#endif
<<'\0';
std::string res(os.str()); return res;
}
@ -281,7 +308,11 @@ public:
template <typename Refs>
class SFace
{
typedef void* GenPtr;
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
typedef void* GenPtr;
#else
typedef boost::any GenPtr;
#endif
typedef typename Refs::Mark Mark;
typedef typename Refs::Object_handle Object_handle;
typedef typename Refs::Object_list Object_list;

View File

@ -25,7 +25,11 @@
#include <CGAL/basic.h>
#include <CGAL/Union_find.h>
#include <CGAL/Nef_2/Segment_overlay_traits.h>
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <CGAL/Nef_2/geninfo.h>
#else
#include <boost/any.hpp>
#endif
#include <CGAL/Nef_S2/Sphere_geometry.h>
#include <CGAL/Nef_S2/SM_decorator.h>
#include <CGAL/Nef_S2/SM_const_decorator.h>
@ -56,7 +60,11 @@ struct SMO_from_segs {
Vertex_handle new_vertex(const Point& p)
{ Vertex_handle v = G.new_svertex(p);
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<Halfedge_handle>::create(G.info(v));
#else
G.info(v)=Halfedge_handle();
#endif
return v;
}
@ -85,16 +93,35 @@ struct SMO_from_segs {
{ if ( M[it] ) v->mark() = true; }
void halfedge_below(Vertex_handle v, Halfedge_handle e) const
{ geninfo<Halfedge_handle>::access(G.info(v)) = e; }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<Halfedge_handle>::access(G.info(v)) = e;
#else
G.info(v)=e;
#endif
}
Halfedge_handle halfedge_below(Vertex_handle v) const
{ return geninfo<Halfedge_handle>::access(G.info(v)); }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
return geninfo<Halfedge_handle>::access(G.info(v));
#else
return
boost::any_cast<Halfedge_handle>( G.info(v) );
#endif
}
void assert_equal_marks(Vertex_handle v1, Vertex_handle v2) const
{ CGAL_assertion(v1->mark()==v2->mark()); }
void discard_info(Vertex_handle v) const
{ geninfo<Halfedge_handle>::clear(G.info(v)); }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<Halfedge_handle>::clear(G.info(v));
#else
G.info(v)=boost::any();
#endif
}
void assert_equal_marks(Halfedge_handle e1, Halfedge_handle e2) const
{ CGAL_assertion(e1->mark()==e2->mark()); }
@ -104,7 +131,12 @@ struct SMO_from_segs {
void clear_temporary_vertex_info() const
{ Vertex_handle v;
CGAL_forall_svertices(v,G)
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<Halfedge_handle>::clear(G.info(v));
#else
G.info(v)=boost::any();
#endif
}
@ -500,13 +532,32 @@ public:
}; // vertex_info
void assoc_info(SVertex_handle v) const
{ geninfo<vertex_info>::create(info(v)); }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<vertex_info>::create(info(v));
#else
info(v)=vertex_info();
#endif
}
void discard_info(SVertex_handle v) const
{ geninfo<vertex_info>::clear(info(v)); }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<vertex_info>::clear(info(v));
#else
info(v)=boost::any();
#endif
}
vertex_info& ginfo(SVertex_handle v) const
{ return geninfo<vertex_info>::access(info(v)); }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
return geninfo<vertex_info>::access(info(v));
#else
return
*boost::any_cast<vertex_info>(&info(v));
#endif
}
Mark& mark(SVertex_handle v, int i) const
{ return ginfo(v).m[i]; }
@ -532,15 +583,36 @@ public:
};
void assoc_info(SHalfedge_handle e) const
{ geninfo<edge_info>::create(info(e));
geninfo<edge_info>::create(info(e->twin())); }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<edge_info>::create(info(e));
geninfo<edge_info>::create(info(e->twin()));
#else
info(e)=edge_info();
info(e->twin())=edge_info();
#endif
}
void discard_info(SHalfedge_handle e) const
{ geninfo<edge_info>::clear(info(e));
geninfo<edge_info>::clear(info(e->twin())); }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<edge_info>::clear(info(e));
geninfo<edge_info>::clear(info(e->twin()));
#else
info(e)=boost::any();
info(e->twin())=boost::any();
#endif
}
edge_info& ginfo(SHalfedge_handle e) const
{ return geninfo<edge_info>::access(info(e)); }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
return geninfo<edge_info>::access(info(e));
#else
return
*boost::any_cast<edge_info>(&info(e));
#endif
}
Mark& mark(SHalfedge_handle e, int i) const
{ return ginfo(e).m[i]; }
@ -567,13 +639,32 @@ public:
};
void assoc_info(SFace_handle f) const
{ geninfo<face_info>::create(info(f)); }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<face_info>::create(info(f));
#else
info(f)=face_info();
#endif
}
void discard_info(SFace_handle f) const
{ geninfo<face_info>::clear(info(f)); }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<face_info>::clear(info(f));
#else
info(f)=boost::any();
#endif
}
face_info& ginfo(SFace_handle f) const
{ return geninfo<face_info>::access(info(f)); }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
return geninfo<face_info>::access(info(f));
#else
return
*boost::any_cast<face_info>(&info(f));
#endif
}
Mark& mark(SFace_handle f, int i) const
{ return ginfo(f).m[i]; }
@ -1395,7 +1486,10 @@ subdivide(const Map* M0, const Map* M1,
CGAL_assertion_code(SVertex_iterator svi);
CGAL_assertion_code(
for(svi=this->svertices_begin(); svi!=this->svertices_end(); svi++) {
CGAL_NEF_TRACEN("vertex "<<svi->point()<<" info "<<info(svi)<<
CGAL_NEF_TRACEN("vertex "<<svi->point()<<" info "<<
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
info(svi)<<
#endif
" marks "<<mark(svi,0)<<" "<<mark(svi,1));
}
)
@ -1685,8 +1779,11 @@ subdivide(const Map* M0, const Map* M1,
CGAL_assertion_code(SVertex_iterator svi);
CGAL_assertion_code(
for(svi=this->svertices_begin(); svi!=this->svertices_end(); svi++) {
CGAL_NEF_TRACEN("vertex "<<svi->point()<<" info "<<info(svi)<<
" marks "<<mark(svi,0)<<" "<<mark(svi,1));
CGAL_NEF_TRACEN("vertex "<<svi->point()
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
<<" info "<<info(svi)
#endif
<< " marks "<<mark(svi,0)<<" "<<mark(svi,1));
}
)

View File

@ -23,7 +23,11 @@
#include <vector>
#include <CGAL/basic.h>
#include <CGAL/Unique_hash_map.h>
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <CGAL/Nef_2/geninfo.h>
#else
#include <boost/any.hpp>
#endif
#include <CGAL/Nef_2/Object_handle.h>
#include <CGAL/Nef_S2/SM_decorator_traits.h>
#undef CGAL_NEF_DEBUG

View File

@ -24,7 +24,11 @@
#include <CGAL/basic.h>
#include <CGAL/Unique_hash_map.h>
#include <CGAL/Nef_2/Segment_overlay_traits.h>
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
#include <CGAL/Nef_2/geninfo.h>
#else
#include <boost/any.hpp>
#endif
#include <CGAL/Nef_S2/SM_decorator.h>
#include <CGAL/Nef_S2/SM_const_decorator.h>
#include <CGAL/Nef_S2/SM_point_locator.h>
@ -201,13 +205,32 @@ public:
};
void assoc_info(SVertex_handle v) const
{ geninfo<vertex_info>::create(info(v)); }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<vertex_info>::create(info(v));
#else
info(v)=vertex_info();
#endif
}
void discard_info(SVertex_handle v) const
{ geninfo<vertex_info>::clear(info(v)); }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<vertex_info>::clear(info(v));
#else
info(v)=boost::any();
#endif
}
vertex_info& ginfo(SVertex_handle v) const
{ return geninfo<vertex_info>::access(info(v)); }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
return geninfo<vertex_info>::access(info(v));
#else
return
*boost::any_cast<vertex_info>(&info(v));
#endif
}
Object_handle& support(SVertex_handle v) const
{ return ginfo(v).o_; }
@ -224,15 +247,36 @@ public:
};
void assoc_info(SHalfedge_handle e) const
{ geninfo<edge_info>::create(info(e));
geninfo<edge_info>::create(info(e->twin())); }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<edge_info>::create(info(e));
geninfo<edge_info>::create(info(e->twin()));
#else
info(e)=edge_info();
info(e->twin())=edge_info();
#endif
}
void discard_info(SHalfedge_handle e) const
{ geninfo<edge_info>::clear(info(e));
geninfo<edge_info>::clear(info(e->twin())); }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
geninfo<edge_info>::clear(info(e));
geninfo<edge_info>::clear(info(e->twin()));
#else
info(e)=boost::any();
info(e->twin())=boost::any();
#endif
}
edge_info& ginfo(SHalfedge_handle e) const
{ return geninfo<edge_info>::access(info(e)); }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
return geninfo<edge_info>::access(info(e));
#else
return
*boost::any_cast<edge_info>(&info(e));
#endif
}
Object_handle& support(SHalfedge_handle e) const
// uedge information we store in the smaller one
@ -244,7 +288,14 @@ public:
{ return ginfo(e).m_left_; }
const edge_info& ginfo(SHalfedge_const_handle e) const
{ return geninfo<edge_info>::const_access(info(e)); }
{
#ifdef CGAL_I_DO_WANT_TO_USE_GENINFO
return geninfo<edge_info>::const_access(info(e));
#else
return
*boost::any_cast<edge_info>(&info(e));
#endif
}
const Mark& incident_mark(SHalfedge_const_handle e) const
{ return ginfo(e).m_left_; }