Subject: CGAL users discussion list
List archive
- From: Andreas Fabri <>
- To:
- Subject: Re: [cgal-discuss] Looping through vertices of a face
- Date: Fri, 12 Jun 2009 17:49:04 +0200
Hi Matthew,
It's -> and not . because f is a Face_handle and not a Face, and
a handle is something like a pointer.
http://www.cgal.org/Manual/3.4/doc_html/cgal_manual/Circulator_ref/Concept_Handle.html
Note that all iterators are also model of the concept Handle
andreas
Matthew Denno wrote:
Thanks so much to both of you for your help. I really appreciate you
taking time to answer my novice questions as I learn.
I think I am starting to learn my way around the documentation so that
I can hopefully figure it out on my own in the future.
One point of confusion for me still, which is probably more of a C++
question than a specific CGAL question is why, for example, in the
documentation it is shown as f.vertex() , but in code that was
provided (and works) it is f -> vertex(). I suspect that in the
documentation it is shown as f.vertex() to indicate that vertex() is a
member of f but why is it accessed using f->vertex()?
On Fri, Jun 12, 2009 at 8:14 AM, Andreas
Fabri<>
wrote:
Hi Matthew,
The triangulation is parameterized with a triangulation datastructure
which is parameterized with a vertex and face class.
______________________________________________
Parameters
The class Triangulation_2<Traits,Tds> has two template parameters. The first
one Traits is the geometric traits, it is to be instantiated by a model of
the concept TriangulationTraits_2.
The second parameter is the triangulation data structure, it has to be
instantiated by a model of the concept TriangulationDataStructure_2. By
default, the triangulation data structure is instantiated by
CGAL::Triangulation_data_structure_2 <
CGAL::Triangulation_vertex_base_2<Gt>, CGAL::Triangulation_face_base_2<Gt> >
.
Source:
http://www.cgal.org/Manual/3.4/doc_html/cgal_manual/Triangulation_2_ref/Class_Triangulation_2.html#Cross_link_anchor_1166
______________________________________________
Whe you click on CGAL::Triangulation_face_base_2<Gt> you find
______________________________________________
Is Model for the Concepts
TriangulationFaceBase_2
http://www.cgal.org/Manual/3.4/doc_html/cgal_manual/Triangulation_2_ref/Class_Triangulation_face_base_2.html
______________________________________________
"Model of a concept" means implementations of a specification,
so when you click on TriangulationFaceBase_2 and there on
TriangulationDSFaceBase_2
you are one click away from what you search
http://www.cgal.org/Manual/3.4/doc_html/cgal_manual/TDS_2_ref/Concept_TriangulationDSFaceBase_2.html#Cross_link_anchor_1178
The whole thing is rather decomposed, but it makes little sense to repeat
the documentation
of the concept for each model.
andreas
Matthew Denno wrote:
Hi,--
I am hoping that someone can point me in the right direction to a
solution for my problem. I am new to both CGAL and C++ so I apologize
if my questions should be obvious.
I started out with one of the example problems. After I have added
the points to the Triangulation, I use a Face_iterator to iterate
through the faces (I think through this part is ok). The problem is I
can't figure out how to access the verticies of each face as I iterate
over them.
If someone could point me in the right direction I would really
appreciate it. Maybe just a hint of what I should look for in the
manual.
The code I have been testing with is below.
Thanks so much.
Matt
#include <fstream>
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Triangulation_2.h>
struct K : CGAL::Exact_predicates_inexact_constructions_kernel {};
typedef CGAL::Triangulation_2<K> Triangulation;
typedef Triangulation::Vertex_circulator Vertex_circulator;
typedef Triangulation::Point Point;
typedef Triangulation::Face_iterator Face_iterator;
typedef Triangulation::Vertex_handle Vertex_handle;
typedef Triangulation::Vertex_iterator Vertex_iterator;
int main() {
std::ifstream in("data/triangulation_prog1.cin");
std::istream_iterator<Point> begin(in);
std::istream_iterator<Point> end;
Triangulation t;
t.insert(begin, end);
for (Face_iterator fit = t.faces_begin();
fit != t.faces_end();
++fit){
//This is where the problem is.
//print out the x and y coordinates of all three verticies of each
face
}
return 0;
}
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://lists-sop.inria.fr/wws/info/cgal-discuss
- [cgal-discuss] Looping through vertices of a face, Matthew Denno, 06/12/2009
- Re: [cgal-discuss] Looping through vertices of a face, Panagiotis Foteinos, 06/12/2009
- Re: [cgal-discuss] Looping through vertices of a face, Andreas Fabri, 06/12/2009
- Re: [cgal-discuss] Looping through vertices of a face, Matthew Denno, 06/12/2009
- Re: [cgal-discuss] Looping through vertices of a face, Andreas Fabri, 06/12/2009
- Re: [cgal-discuss] Looping through vertices of a face, Matthew Denno, 06/15/2009
- Re: [cgal-discuss] Looping through vertices of a face, Andreas Fabri, 06/12/2009
- Re: [cgal-discuss] Looping through vertices of a face, Matthew Denno, 06/12/2009
Archive powered by MHonArc 2.6.16.