Colors CGAL三角剖分_3上的色点
我试图给点一个颜色,使之成为CGAL上的三角剖分。我只是拿CGAL的例子来描述 我对该示例进行了简单修改,以便能够绘制三角剖分:Colors CGAL三角剖分_3上的色点,colors,point,cgal,triangulation,Colors,Point,Cgal,Triangulation,我试图给点一个颜色,使之成为CGAL上的三角剖分。我只是拿CGAL的例子来描述 我对该示例进行了简单修改,以便能够绘制三角剖分: #include <CGAL/Exact_predicates_inexact_constructions_kernel.h> #include <CGAL/Delaunay_triangulation_3.h> #include <CGAL/Delaunay_triangulation_cell_base_3.h> #includ
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Delaunay_triangulation_3.h>
#include <CGAL/Delaunay_triangulation_cell_base_3.h>
#include <CGAL/Triangulation_vertex_base_with_info_3.h>
#include <CGAL/IO/Color.h>
#include <CGAL/draw_triangulation_3.h>
typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Triangulation_vertex_base_with_info_3<CGAL::Color, K> Vb;
typedef CGAL::Delaunay_triangulation_cell_base_3<K> Cb;
typedef CGAL::Triangulation_data_structure_3<Vb, Cb> Tds;
typedef CGAL::Delaunay_triangulation_3<K, Tds> Delaunay;
typedef Delaunay::Point Point;
int main()
{
Delaunay T;
T.insert(Point(0,0,0));
T.insert(Point(1,0,0));
T.insert(Point(0,1,0));
T.insert(Point(0,0,1));
T.insert(Point(2,2,2));
T.insert(Point(-1,0,1));
// Set the color of finite vertices of degree 6 to red.
Delaunay::Finite_vertices_iterator vit;
for (Delaunay::Vertex_handle v : T.finite_vertex_handles())
if (T.degree(v) == 6)
v->info() = CGAL::Color(0,255,0);
CGAL::draw(T);
return 0;
}
#包括
#包括
#包括
#包括
#包括
#包括
typedef CGAL::精确谓词不精确结构内核K;
typedef CGAL::三角剖分_顶点_底面_与_信息_3 Vb;
typedef CGAL::Delaunay_三角剖分_单元_基底_3 Cb;
typedef CGAL::三角测量数据结构Tds;
typedef CGAL::Delaunay_三角剖分_3Delaunay;
typedef Delaunay::Point;
int main()
{
Delaunay T;
T.插入(点(0,0,0));
T.插入(点(1,0,0));
T.插入(点(0,1,0));
T.插入(点(0,0,1));
T.插入(点(2,2,2));
T.插入(点(-1,0,1));
//将阶数为6的有限顶点的颜色设置为红色。
Delaunay::有限顶点迭代器vit;
对于(Delaunay::顶点句柄v:T.有限顶点句柄())
如果(T度(v)==6)
v->info()=CGAL::Color(0255,0);
CGAL::draw(T);
返回0;
}
但是不管我用什么颜色(0255,0)代码>方法绘图始终在显示的窗口中给出相同的红色点:
我知道代码正在构建一个包含颜色信息的数据结构,但这可能独立于绘图方法,因此我认为窗口不会显示绿色点,因为这不是给点着色的方法。如果是这样,使用“绘制”方法获得带有绿点的三角剖分的方法是什么?“在当前形式下,查看器无法更改顶点或边的颜色 但是更改代码很容易
add_点(vh->point(),vh->info())代码>
在其当前形式中,查看器无法更改顶点或边的颜色 但是更改代码很容易
add_点(vh->point(),vh->info())代码>