Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Assign z-coordinate as extra information in a point

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Assign z-coordinate as extra information in a point


Chronological Thread 
  • From: "Sebastien Loriot (GeometryFactory)" <>
  • To:
  • Subject: Re: [cgal-discuss] Assign z-coordinate as extra information in a point
  • Date: Fri, 02 May 2014 09:12:19 +0200
  • Organization: GeometryFactory

vit->point().z()

Sebastien.

On 05/02/2014 08:53 AM, Adam Getchell wrote:
Hello all,

I would like to assign the z-coordinate of a point inserted into a
Delaunay triangulation as an extra bit of information, the timeslice number.

In brief, I have:

template <typename T>
void make_S3_simplicial_complex(T* S3, int number_of_simplices, int
number_of_timeslices) {
/// Start with a 3D sphere with two simplices
S3->insert(typename T::Point(0,0,0));
S3->insert(typename T::Point(1, 0, 0));
S3->insert(typename T::Point(0, 1, 0));
S3->insert(typename T::Point(0, 0, 1));
S3->insert(typename T::Point(0, 0, -1));

/// Store the timeslice number in each vertex
Delaunay::Finite_vertices_iterator vit;
for (vit = S3->finite_vertices_begin(); vit !=
S3->finite_vertices_end(); ++vit)
vit->info() = 1;

/// Debugging: print out each vertex and the timeslice number associated
for (vit = S3->finite_vertices_begin(); vit !=
S3->finite_vertices_end(); ++vit)
std::cout << '(' << vit->point() << ") (timeslice = " <<
vit->info() << ")" << std::endl;

assert(S3->dimension() == 3);

Where I'd like to use:

vit->info() = vit->z()

or

vit->info() = vit->point()::cartesian(2)

or the appropriate member function.

Here's the full code listing:

https://github.com/acgetchell/CDT-plusplus/blob/master/spherical_3_complex.h

Which currently compiles.

Any pointers greatly appreciated!

Thank you!

--
Adam Getchell
about.me/adamgetchell <http://about.me/adamgetchell>
"Invincibility is in oneself, vulnerability in the opponent." -- Sun Tzu




Archive powered by MHonArc 2.6.18.

Top of Page