Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] How to get a Face_handle pointer from a Polyhedron model?

Subject: CGAL users discussion list

List archive

[cgal-discuss] How to get a Face_handle pointer from a Polyhedron model?


Chronological Thread 
  • From: Liang <>
  • To:
  • Subject: [cgal-discuss] How to get a Face_handle pointer from a Polyhedron model?
  • Date: Tue, 9 Aug 2011 08:19:50 -0700 (PDT)

Hi all,

Currently I am working on the extension of Polyhedron_3 class. I followed
the example:

===============================================================
#include &lt;CGAL/Simple_cartesian.h&gt;
#include &lt;CGAL/IO/Color.h&gt;
#include &lt;CGAL/Polyhedron_3.h&gt;

// A face type with a color member variable.
template <class Refs>
struct My_face : public CGAL::HalfedgeDS_face_base<Refs> {
CGAL::Color color;
};

// An items type using my face.
struct My_items : public CGAL::Polyhedron_items_3 {
template <class Refs, class Traits>
struct Face_wrapper {
typedef My_face<Refs> Face;
};
};

typedef CGAL::Simple_cartesian<double> Kernel;
typedef CGAL::Polyhedron_3&lt;Kernel, My_items&gt; Polyhedron;
typedef Polyhedron::Halfedge_handle Halfedge_handle;

int main() {
Polyhedron P;
Halfedge_handle h = P.make_tetrahedron();
h->facet()->color = CGAL::RED;
return 0;
}
===============================================================

The definition part is basically the same as the example's. But in our
situation, we load a model into a Polyhedron variable from an off. file. I
suppose if I can get the Face_handle pointer from this Polyhedron model,
then I will be able to refer to the added attribute of each face in the
model. The problem is how to get that Face_handle pointer?

Thanks,

Liang


--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/How-to-get-a-Face-handle-pointer-from-a-Polyhedron-model-tp3730281p3730281.html
Sent from the cgal-discuss mailing list archive at Nabble.com.



Archive powered by MHonArc 2.6.16.

Top of Page