English 中文(简体)
添加卡介苗点级变量
原标题:Add variable to CGAL s Point class

我正试图将彩色变量(未签名的果园)添加到CGAL s Point_3类,以便我能够在Delaunay三角化之后获得彩色。

我尝试的是利用Triangulation_vertex_base_with_info_3储存类似颜色(在

typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef CGAL::Triangulation_vertex_base_with_info_3<unsigned char, K> Vb;
typedef CGAL::Triangulation_data_structure_3<Vb> Tds;
typedef CGAL::Delaunay_triangulation_3<K, Tds> Triangulation;
typedef Triangulation::Point CGAL_Point;

//...
//here I make a vector of pairs of points and their color

std::vector<std::pair<CGAL_Point, unsigned char> > points;

Point currentPoint;
for (int i=0; i<roiPoints.size(); i++){
    currentPoint=roiPoints[i];
    points.push_back(std::make_pair(CGAL_Point(currentPoint.x, currentPoint.y, currentPoint.z), roiColors[i]));
} 

//...
//triangulation
T.clear();
T.insert(points.begin(), points.end());

我实际上想要实现的是,能够通过三角:Tetrahedron在进行三边活动后进入vert色。

我要说的是P点(x,y,z)。 在进行三边之后,我发现Tetrahedron t,其中载有这一点,P,我可以接触这一四小时的vert(使用t.vertex(0..3)。 这种回报扭曲了3号点,我可以接触以前储存的颜色。

我猜想,这样做的方法是建立我自己的观点类别,其中含有肤色信息。 这容易,但我不理解如何使用这一类别而不是点3。 我发现,我还必须写一下我自己的凯里略来做这件事,并在 但是,我可以指出,我应该把凯里特用作基级,或者我的凯里特甚至应该包含哪些职能。

I even found two similar topics here at stackoverflow: Customizing CGAL Kernel with my own Point class and CGAL: Inheritance and the kernel but they didn t help me.

感谢你的帮助!

最佳回答

From your description, I think you simply need to add the color inside the vertex class. After the locate, you ll have the simplex and will be able to access the color inside the vertices.

here

问题回答

暂无回答




相关问题
Subclass check, is operator or enum check

A couple of friends was discussing the use of inheritance and how to check if a subclass is of a specific type and we decided to post it here on Stack. The debate was about if you should implement a ...

C++ Class Inheritance problem

Hi I have two classes, one called Instruction, one called LDI which inherits from instruction class. class Instruction{ protected: string name; int value; public: Instruction(string ...

Overloading a method in a subclass in C++

Suppose I have some code like this: class Base { public: virtual int Foo(int) = 0; }; class Derived : public Base { public: int Foo(int); virtual double Foo(double) = 0; }; ...

Embedding instead of inheritance in Go

What is your opinion of this design decision? What advantages does it have and what disadvantages? Links: Embedding description

Extending Flex FileReference class to contain another property

I want to extend the FileReference class of Flex to contain a custom property. I want to do this because AS3 doesn t let me pass arguments to functions through event listeners, which makes me feel sad,...

Interface Inheritance in C++

I have the following class structure: class InterfaceA { virtual void methodA =0; } class ClassA : public InterfaceA { void methodA(); } class InterfaceB : public InterfaceA { virtual ...

热门标签