Subject: CGAL users discussion list
List archive
- From:
- To:
- Subject: About the Surface_mesh_simplification Example
- Date: Fri, 8 Jun 2007 17:18:37 +0200
Hello, all
I have compiled and run (OS: WindowsXP IDE: MS VC++ .NET 7.1) the
Surface_mesh_simplification example provided in CGAL3.3 successfully. But
when I use the mesh class defined by myself, I got a lot of compiling errors.
Specifically, I modified the example as follows:
ORIGIN code in
example/Surface_mesh_simplification/edge_collapse_enriched_polygon.cpp:
typedef CGAL::Polyhedron_3<Kernel, CGAL::Polyhedron_items_with_id_3> Surface;
namespace SMS = CGAL::Surface_mesh_simplification;
typedef SMS::Edge_profile<Surface> Profile;
Surface surface; // mesh
SMS::Count_ratio_stop_predicate<Surface> stop(0.1); // stop condition
int r = SMS::edge_collapse // algorithm
(surface
,stop
,CGAL::get_cost (SMS::Edge_length_cost <Surface>())
.get_placement(SMS::Midpoint_placement<Surface>())
.visitor(&vis)
);
In MY code, I want to let the edge_collapse work with my own mesh class, and
I change the "typedef" for Surface as follows:
typedef double number_type;
typedef CGAL::Simple_cartesian<number_type> Enriched_kernel;
typedef Enriched_polyhedron<Enriched_kernel, Enriched_items> Surface;
where the Enriched_polyhedron is my own mesh class derived from Polyhedon_3:
template <class kernel, class items>
class Enriched_polyhedron : public CGAL::Polyhedron_3<kernel,items>
When I compiled the modified code, the compiler showed me the a large mount
of errors, of which the first one is:
$(BOOSTROOT)\boost\graph\graph_traits.hpp(26) : error C2039:
"vertex_descriptor" : is not a member of "Enriched_polyhedron<kernel,items>"
and I think all the following errors are caused by this error.
Note that all the items for the Enriched_polyhedron have proper id() fields
as required by edge_collapse.
Is this because there is only an adaptor between Polyhedon_3 and 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? Is there any other way to simplify a mesh
instantialized from my own mesh class?
Thank you in advance!
- 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.