Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Add information in Triangulation while inserting a range of points

Subject: CGAL users discussion list

List archive

[cgal-discuss] Add information in Triangulation while inserting a range of points


Chronological Thread 
  • From: sanlingtonCGAL <>
  • To:
  • Subject: [cgal-discuss] Add information in Triangulation while inserting a range of points
  • Date: Sun, 12 May 2019 21:25:02 -0500 (CDT)
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None ; spf=Fail ; spf=Pass
  • Ironport-phdr: 9a23:x9swRRLhhrDQ95+7BNmcpTZWNBhigK39O0sv0rFitYgRLvzxwZ3uMQTl6Ol3ixeRBMOHsqsC2rGd7v2ocFdDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXdrXKo8DEdBAj0OxZrKeTpAI7SiNm82/yv95HJbAhEmSexbal2IRi4ognctskbipZ+J6gszRfEvmFGcPlMy2NyIlKTkRf85sOu85Nm7i9dpfEv+dNeXKvjZ6g3QqBWAzogM2Au+c3krgLDQheV5nsdSWoZjBxFCBXY4R7gX5fxtiz6tvdh2CSfIMb7Q6w4VSik4qx2ThLjlSUJOCMj8GzPhMJ+jLxVrhG8qRNw34Hab5qYNOZ8c6/BYd8WWXZNUthXWidcAo28dYwPD+8ZMOZDtYb9oV8OrRq4BQmjGOPvzTlIi2H306Am1eoqDAbL3Bc6ENIItHTUrdP1NKgOUeCyyqnF1ijPYvJY1Dvn9IfIdRUhrOiKULltf8TRzkwvGBnEjlWWsYHlOSma2f8WvGif8eVsT/6gi2kiqw1pvjevyd0jio3TioIS0FDE+iN0y5s2K92gUEN3fNqpHZ9KuyyUNIZ6WMAvTmBytCs7y7ALv4OwcjIQx5Q93RHfbuSKc4iW7RLnU+acOTF4iX1/dLK5nRm96lOvyuniWcWuzFlKqS9FnsHNtnALyRPT9tCKRuZ580qlwzqC2QPe5vtHLE01j6bWKp8szqY1lpUJsETDGiH2mF/xjK+Tbkgk4fKn6+LjYrXnoJ+cOJN0igb4Mqk1h8CyAOo1PhISUGic/OSwzKfj8lHhQLVWkv02lbHUv4zVJcsBoq61GhJa0oc46xmjEjemy88YkGIcLFNFfRKHl5LmN0vPIPD+F/e/gk6jnC1lx/DcbfXdBcDGIXHH1bvgZr1g8FV0yQwpzNkZ6YgHJKsGJafoU0n1tdrXEhg/GCOd566zE9x70oIYVn6IBIfAbviUuliNsLF8a9KQbZMY7W6uY8Mu4OTj2CdgxA0tOJKx1J5SU0iWW/RrJ0LAPCjq3pEHGG0Augd4R+vv2gTbDWxjIk2qVqd53QkVTZq8BNaRH972xreG2XXjR8wEViV9ElmJVEzQWcCBUvYIZjiVJ54zy2JfE7OmTt192A==

Hi,

I know the Delaunay and Regular triangulation in CGAL can already add
information to vertices while inserting /a range of points/, as introduced
in
https://doc.cgal.org/latest/Triangulation_3/index.html#Triangulation_3Delaunay

But it seems that the Triangulation_2/3 (not Delaunay triangulation or
Regular triangulation) can't do that, am I correct?

What I want to do is to construct Triangulation by inserting a range of
points, and each point or vertex would carry extra information, like an
index.
I am using codes like:

#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Triangulation_3.h>
#include <CGAL/Triangulation_cell_base_3.h>
#include <CGAL/Triangulation_vertex_base_with_info_3.h>
#include <vector>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Triangulation_vertex_base_with_info_3<unsigned, K> Vb;
typedef CGAL::Triangulation_cell_base_3<K> Cb;
typedef CGAL::Triangulation_data_structure_3<Vb, Cb> Tds;
//Use the Fast_location tag. Default or Compact_location works too.
typedef CGAL::Triangulation_3<K, Tds> Triangulation;
typedef Triangulation::Point
Point;
int main()
{
std::vector< std::pair<Point, unsigned> > points;
points.push_back(std::make_pair(Point(0, 0, 0), 0));
points.push_back(std::make_pair(Point(1, 0, 0), 1));
points.push_back(std::make_pair(Point(0, 1, 0), 2));
points.push_back(std::make_pair(Point(0, 0, 1), 3));
points.push_back(std::make_pair(Point(2, 2, 2), 4));
points.push_back(std::make_pair(Point(-1, 0, 1), 5));

Triangulation T(points.begin(), points.end());
CGAL_assertion(T.number_of_vertices() == 6);

return 0;
}

The above codes are similar to those in the manual document, I just replaced
the Delaunay with Triangulation. But the compiler gave me errors like:

c:\program files (x86)\microsoft visual
studio\2017\community\vc\tools\msvc\14.16.27023\include\xmemory0(881): error
C2664: 'CGAL::Point_3<Kernel_>::Point_3(CGAL::Point_3<Kernel_> &&)': cannot
convert argument 1 from '_Ty' to 'const CGAL::Origin &'
1> with
1> [
1> Kernel_=CGAL::Epick
1> ]
1> and
1> [
1> _Ty=std::pair<Point,unsigned int>
1> ]
1>c:\program files (x86)\microsoft visual
studio\2017\community\vc\tools\msvc\14.16.27023\include\xmemory0(879): note:
Reason: cannot convert from '_Ty' to 'const CGAL::Origin'
1> with
1> [
1> _Ty=std::pair<Point,unsigned int>
1> ]


What should I do to add information to point/vertex of a Triangulation while
inserting a range of points?

Thank you.





--
Sent from: http://cgal-discuss.949826.n4.nabble.com/



Archive powered by MHonArc 2.6.18.

Top of Page