Skip to Content.
Sympa Menu

cgal-discuss - Re: [cgal-discuss] Looping through particles that make up the vertices of the Delaunay triangulation and updating their positions

Subject: CGAL users discussion list

List archive

Re: [cgal-discuss] Looping through particles that make up the vertices of the Delaunay triangulation and updating their positions


Chronological Thread 
  • From: khurshid juraev <>
  • To:
  • Subject: Re: [cgal-discuss] Looping through particles that make up the vertices of the Delaunay triangulation and updating their positions
  • Date: Sun, 12 Apr 2020 17:13:58 +0500
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None ; spf=Pass ; spf=None
  • Ironport-phdr: 9a23:lCNc9R0N1Xj55YVosmDT+DRfVm0co7zxezQtwd8Zse0fLfad9pjvdHbS+e9qxAeQG9mCtrQe1KGK4uigATVGvc/d9ihaMdRlbFwst4Y/p0QYGsmLCEn2frbBThcRO4B8bmJj5GyxKkNPGczzNBX4q3y26iMOSF2kbVImbuv6FZTPgMupyuu854PcYxlShDq6fLh+MAi6oR/eu8ULgYZuMLg9xxnGrnZHf+ld2GdkKU6Okxrm6cq84ZFu/z5Mt/498sJLTLn3cbk/QbFEAzsqNHw46tf2vhfZVwuP4XUcUmQSkhVWBgXO8Q/3UJTsvCbkr+RxwCaVM9H4QrAyQjSi8rxkSAT0hycdNj4263/Yh8pth69Guh2hphh/w4nJYIGJMfd1Y63Qcc8GSWdHQ81cUTFKDIGhYIsVF+cPPfpXoIbgqVUAoxuwGwujCuDoxDJTnHD6wag63v4hEQ3awgAtGc8FvnTOrNXyMacfSeO1zKnVzTXZdPNW2Tb955XVeRAjvPGMR6h/ftTPyUIyEA7FjVWQpZbnPz+P1OQCqXSU7+l7WOKgjm4osQBxojy1ysgwjYnJg5sYx1bZ/it62IY4PcO0RFJ/bNK+E5ZdtzuWO5Z3T84gWW1ltyg3xqUYtZKmciUG0ooryhDDZ/CdboSE/wzvWPyMLTtmmn5ofq+0iQyo/ki60OL8U9G50FZUoSpBldnBrnUN2AbS6siDU/d9+kmh1SuW2wDd5exJL1o4laXcK54mzb4wkoQcvV7fES/xnUX6lK6WdkM69ei08+nrfKnqq5uGO4J3igzyKLkil829DOgiPQUDUXCX+eGm273i+U35Tq9KjvozkqTBs5DaJd4XpqyjDw9XyIks9xW/Aiyp0NQdh3YHLVZFdAibgIjuPlHCOOr4Auung1SwjDdrwOjLMaHuAprXKnjPiarufbdm60FA1Qoz1stf6olPCrABJfLzQlX+uMbZDh8/KQy0wvzoBM9z1oMECiqzBfqSP6rW9FOJ/ekyOPKkZYkPuT+7JeJ2yeTpiCo6mUIHZqmo0dMVdWqxE+oud0aZJ3iqgN4KEk8FuwM/SKrhj1jUAm0bXGq7Q69pvmJzM4mhF4qWHtnw0ozE5z+yG9htXk4DCl2IFi21JYCNWvNJbCzLZ8E9yXoLUr+uT4Jn3har5lejmuhXa9HM8yhdjqrNkd185undjxY3rGUmAMGU0mXLRGZxzDpRG20GmZtnqEk48W+tlLBiiqUBR9NW7vJNFAw9MMyEwg==


Hi, Julien.

I tried writing an example which simulates the solution I suggested:

#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Triangulation_2.h>
#include <iostream>
#include <vector>
#include <set>
typedef CGAL::Exact_predicates_exact_constructions_kernel K;
typedef CGAL::Triangulation_2<K>      Triangulation;
typedef Triangulation::Vertex_handle  Vertex_handle;
typedef Triangulation::Point          Point;
typedef Triangulation::Finite_vertex_handles    Finite_vertex_handles;
typedef Triangulation::Finite_vertices_iterator Finite_vertices_iterator;
typedef Finite_vertex_handles::iterator         Finite_vertex_handles_iterator;
int main()
{
  
  std::vector<Point> points =  { Point(0,0), Point(1,0), Point(0,1) };
  Triangulation T;
  std::set<Vertex_handle> vertices;
  //or std::vector
  //std::vector<Vertex_handle> vertices;

  T.insert(points.begin(), points.end());

  std::cout << "Triangulation_2::Finite_vertices_iterator is like a  Triangulation_2::Vertex_handle\n";  
  
  vertices.insert(T.finite_vertices_begin(), T.finite_vertices_end());
  //or if std::vector
  //vertices.insert(vertices.begin(), T.finite_vertices_begin(), T.finite_vertices_end());
  

  //moving part
  for(Vertex_handle& vh : vertices){

// New position
double New_x = vh.point().x()+2.3;
double New_y = vh.point().y()+2.3;

Point New_point = Point(New_x, New_y);
T.move_point(vh, New_point);
  }
  
  return 0;
}


Regards, Khurshid.



Archive powered by MHonArc 2.6.18.

Top of Page