Subject: CGAL users discussion list
List archive
- From: QYInst <>
- To:
- Subject: [cgal-discuss] Clear polyhedron_incremental_builder
- Date: Mon, 17 Aug 2015 05:26:24 -0700 (PDT)
Once created a polyhedron with polyhedron_incremental_builder, is there any
way to clear it?
For example, in the example of CGAL:
#include <CGAL/Simple_cartesian.h>
#include <CGAL/Polyhedron_incremental_builder_3.h>
#include <CGAL/Polyhedron_3.h>
// A modifier creating a triangle with the incremental builder.
template <class HDS>
class Build_triangle : public CGAL::Modifier_base<HDS> {
public:
Build_triangle() {}
void operator()( HDS& hds) {
// Postcondition: hds is a valid polyhedral surface.
CGAL::Polyhedron_incremental_builder_3<HDS> B( hds, true);
B.begin_surface( 3, 1, 6);
typedef typename HDS::Vertex Vertex;
typedef typename Vertex::Point Point;
B.add_vertex( Point( 0, 0, 0));
B.add_vertex( Point( 1, 0, 0));
B.add_vertex( Point( 0, 1, 0));
B.begin_facet();
B.add_vertex_to_facet( 0);
B.add_vertex_to_facet( 1);
B.add_vertex_to_facet( 2);
B.end_facet();
B.end_surface();
}
};
typedef CGAL::Simple_cartesian<double> Kernel;
typedef CGAL::Polyhedron_3<Kernel> Polyhedron;
typedef Polyhedron::HalfedgeDS HalfedgeDS;
int main() {
Polyhedron P;
Build_triangle<HalfedgeDS> triangle;
P.delegate( triangle);
CGAL_assertion( P.is_triangle( P.halfedges_begin()));
return 0;
}
The modifier created a triangle with
Build_triangle<HalfedgeDS> triangle;
I would like to include it in a loop and create many polyhedrons. But I have
to clear the variable "triangle" once I want to build a new one. Is there a
easy way to do that?
Thank you very much for any suggestions.
--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Clear-polyhedron-incremental-builder-tp4661076.html
Sent from the cgal-discuss mailing list archive at Nabble.com.
- [cgal-discuss] Clear polyhedron_incremental_builder, QYInst, 08/17/2015
- Re: [cgal-discuss] Clear polyhedron_incremental_builder, QYInst, 08/17/2015
Archive powered by MHonArc 2.6.18.