Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] vector of points

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] vector of points


Chronological Thread 
  • From: parisa rahmani <>
  • To: "" <>
  • Subject: Re: [cgal-discuss] vector of points
  • Date: Sun, 22 May 2016 17:12:57 +0000 (UTC)
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:GO6uUxW4lK7bf0dPw3vHhQ/+39nV8LGtZVwlr6E/grcLSJyIuqrYZxeEt8tkgFKBZ4jH8fUM07OQ6PCxHzdQqs/Z7zgrS99laVwssY0uhQsuAcqIWwXQDcXBSGgEJvlET0Jv5HqhMEJYS47UblzWpWCuv3ZJQk2sfTR8Kum9IIPOlcP/j7n0oM2CJV4Yz2PlPvtbF1afk0b4joEum4xsK6I8mFPig0BjXKBo/15uPk+ZhB3m5829r9ZJ+iVUvO89pYYbCf2pN54zU7AQID06Pig84sruvB3SBUvVvzpPGlkRx1BDDAHBqR37RZzsqTDSt+xn2SDcM9e8BeQ/Vj2mqqtqUxT1kzwvNjgj8WiRhNYm35hWuBawmxsq24fOYZqcfOB3fqbUe9JSEXBIXvFJXjZpE4q8aIxJBO0Ea7V2tY748kMHtxqlDEG2DePqwzlJzivs1K0Ny+07ORDP3AsnWdkJtSKH/53OKK4OXLXtn+HzxjLZYqYMgDo=

Thanks for the response.

Actually this code was just an example of what I'm going to do.
Because I want to make a delaunay triangulation, I must use an array(vector) of points, but later I want to manipulate the x and y of each point of the vector, how can I access them? in the case of one point it's: point.x() and point.y(), what about an array of points?  


On Sunday, May 22, 2016 9:34 PM, Frédérik Paradis <> wrote:


You have to use the copy constructor like this:
points[0] = Point_2(1.0, 1.0);
Frédérik
 

2016-05-22 12:52 GMT-04:00 parisa rahmani <>:

Hi every one. I'm new to CGAL.
I'm a little bit confused about using vector of points in CGAL.
how can I have access to x and y elements of Point_2, I mean :
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef Kernel::Point_2 Point_2;
typedef std::vector<Point_2> Vector;

Vector points;
points.reserve(5);

int main(){
points[0].x() =1.0;
points[0].y() =1.0;
return 0;}
points[i].x() or points[i].x produces error.

thanks
Parisa






Archive powered by MHonArc 2.6.18.

Top of Page