Subject: CGAL users discussion list
List archive
- From: Fernando Cacciola <>
- To:
- Subject: Re: [cgal-discuss] Progressive Mesh
- Date: Thu, 29 Jan 2009 20:00:00 -0200
Rob,
Fernando,
I went with the first method just to get things working, and it seems
to have turned out fairly well!
Great :)
One other idea I had, and on which I
thought you might give me some direction, is on overloading the
EdgeCollapse class
(CGAL/Surface_mesh_simplification/Detail/Edge_collapse.h). Basically,
I'd like to register a visitor callback that is executed *directly
after* an edge collapse. My vertices and halfedges have some custom
attributes, and I'd like to modify the attributes of surrounding
halfedges and vertices after a collapse. Currently, there is no
callback executed after an edge collapse, so this is not possible. I
could go into the EdgeCollapse source code and modify it to allow this
callback, but I'd rather write a simple class which extends or adapts
EdgeCollapse and just re-implements the Collapse function to allow that
extra callback. Can you think of a good way to do this (as the
functions in EdgeCollapse are not declared virtual)? Thanks again for
all your help!
In cases like this what I often do is:
1.Make a verbatim copy of the class header(s) under a new name
2.Rename the class within the copy
3.Make changes right there in the renamed class, or based on the renamed class inheriting from it BUT only after having refactored it out to add or extend polymorhism support.
C++ just lacks what other OO languages call modules (Ruby) or extension methods (CLI 3.5) which is technically what you need here.
Best
Fernando
- Re: [cgal-discuss] Progressive Mesh, (continued)
- Re: [cgal-discuss] Progressive Mesh, Rob Patro, 01/27/2009
- Re: [cgal-discuss] Progressive Mesh, Fernando Cacciola, 01/27/2009
- Re: [cgal-discuss] Progressive Mesh, Fernando Cacciola, 01/28/2009
- Re: [cgal-discuss] Progressive Mesh, Rob Patro, 01/28/2009
- Re: [cgal-discuss] Progressive Mesh, Fernando Cacciola, 01/28/2009
- Re: [cgal-discuss] Progressive Mesh, Rob Patro, 01/28/2009
- Re: [cgal-discuss] Progressive Mesh, Fernando Cacciola, 01/28/2009
- Re: [cgal-discuss] Progressive Mesh, Rob Patro, 01/29/2009
- Re: [cgal-discuss] Progressive Mesh, Fernando Cacciola, 01/29/2009
- Re: [cgal-discuss] Progressive Mesh, Rob Patro, 01/29/2009
- Re: [cgal-discuss] Progressive Mesh, Fernando Cacciola, 01/29/2009
- [cgal-discuss] 2d delaunay_triangulation sample data (dot cgal), Ali Salami, 01/31/2009
- RE: [cgal-discuss] Progressive Mesh, Max, 01/27/2009
- [cgal-discuss] CGAL 3.4, Max, 01/27/2009
- Re: [cgal-discuss] CGAL 3.4, Peter Hachenberger, 01/29/2009
- RE: [cgal-discuss] CGAL 3.4, Max, 01/30/2009
- RE: [cgal-discuss] CGAL 3.4, Peter Hachenberger, 01/31/2009
- RE: [cgal-discuss] CGAL 3.4, Max, 01/30/2009
- Re: [cgal-discuss] CGAL 3.4, Peter Hachenberger, 01/29/2009
- [cgal-discuss] CGAL 3.4, Max, 01/27/2009
Archive powered by MHonArc 2.6.16.