Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Getting a Triangle from Facet_iterator

Subject: CGAL users discussion list

List archive

[cgal-discuss] Getting a Triangle from Facet_iterator


Chronological Thread 
  • From: Sidnei Basei <>
  • To:
  • Subject: [cgal-discuss] Getting a Triangle from Facet_iterator
  • Date: Fri, 25 Jan 2013 13:44:21 -0800 (PST)

Hello,

I'm new in CGAL library and I didn't found any example showing how I can get
triangles from facet iterator.

Please, check my code bellow... and help me please....


#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Triangulation_3.h>

#include <iostream>
#include <fstream>
#include <cassert>
#include <vector>
#include <fstream>

typedef CGAL::Exact_predicates_inexact_constructions_kernel K;

typedef CGAL::Triangulation_3<K> Triangulation;

typedef Triangulation::Cell_handle Cell_handle;
typedef Triangulation::Vertex_handle Vertex_handle;
typedef Triangulation::Locate_type Locate_type;
typedef Triangulation::Point Point;

int main()
{
// construction from a list of points :
std::vector<Point> P;



std::ifstream is("/Users/srb/Downloads/tora_teste3.csv");
int n;
is >> n;
std::cout << "Reading " << n << " points " << std::endl;

for( ; n>0 ; n--) {
Point p;
is >> p;
P.push_back(p);
}

std::cout << "Readed: " << P.size() << std::endl;

std::cout << "iniciando. ... " << std::endl;


Triangulation T(P.begin(), P.end());
Triangulation::Facet_iterator it;

unsigned int cc=0;
for(it=T.facets_begin();it!=T.facets_end();it++) {
/// --- I'll integrate with OpenGL here...
// T.triangle() <---- i want get a triangle here!!!
}

std::cout << T.number_of_facets() << " cc: " << cc << std::endl; //
number_of_facets and cc are equals

return 0;
}



Thanks in advance.



--
View this message in context:
http://cgal-discuss.949826.n4.nabble.com/Getting-a-Triangle-from-Facet-iterator-tp4656587.html
Sent from the cgal-discuss mailing list archive at Nabble.com.



Archive powered by MHonArc 2.6.18.

Top of Page