Subject: CGAL users discussion list
List archive
- From: "Fernando Cacciola" <>
- To: <>
- Subject: Re: [cgal-discuss] About the Surface_mesh_simplification Example
- Date: Fri, 8 Jun 2007 14:22:22 -0300
- Organization: SciSoft
Hello,
Is this because there is only an adaptor between Polyhedon_3 andYes
boost's graph_traits and no adaptor for other classes even they are
derived from Polyhedon_3? (my own guess)
If so, does it mean that I can not use my own mesh class without
writing the adaptor for my Enriched_polyhedron?
Most of the adaptor templates are specializations, but
derived-to-base conversions are not considered when finding
a match for a template specialization
(while they are considered when finding a match for overload resolution).
This is an unfortunate shortcoming of the C++ template subsystem.
If the idea below fails, yes, I'm afraid you have to write your own adaptor.
A rather long but mechanically simple process to easily produce such an
adaptor is to copy and edit the headers files that define the adapator for
Polyhedron_3.
For example, take this:
CGAL\boost\graph\halfedge_graph_traits_Polyhedron_3.h
and copy it as
halfedge_graph_traits_Enriched_polyhedron.h
into some appropiate folder.
Then within that file replace each "Polyhedron_3" identifier by"Enriched_polyhhedron".
And so on for each of these header files:
CGAL/boost/graph/graph_traits_Polyhedron_3.h
CGAL/boost/graph/halfedge_graph_traits_Polyhedron_3.h
CGAL/boost/graph/properties_Polyhedron_3.h
CGAL/Surface_mesh_simplification/halfedge_collapse_Polyhedron_3.h
Is there any other
way to simplify a mesh instantialized from my own mesh class?
I've never tried this but it might work since generic progamming follows
to some extent the principles of the so called "duck typing"
http://en.wikipedia.org/wiki/Duck_typing
call the function like this, specifying that the type of surface is Polyhedron.
int r = SMS::edge_collapse<Polyhedron> (..)
And let me know if it works.
HTH
Fernando Cacciola
GeometryFactory
- About the Surface_mesh_simplification Example, kevin . kai . xu, 06/08/2007
- Re: [cgal-discuss] About the Surface_mesh_simplification Example, Fernando Cacciola, 06/08/2007
Archive powered by MHonArc 2.6.16.