adding additional variables in 3D triangulation data structure

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

adding additional variables in 3D triangulation data structure

Tianyun Su
Hi,
I want to add some additional variables in the CGAL's 3D triangulation
data structures, like vertex and cell, in order to record some
information during analysis.
But i don't know how to do it.
As an alternative way, I create new data structure of vertex and cell
with additional variables. The geometric information need to be
assigned with those from CGAL's 3D triangulation data structures
firstly. But it is time consuming. So, I wonder if I can add some
additional properties in the CGAL's 3D triangulation data structure.

Thanks.


----
Tianyun

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|

Re: adding additional variables in 3D triangulation data structure

Adam Getchell

> On Jul 15, 2016, at 3:59 AM, Tianyun Su <[hidden email]> wrote:
>
> Hi,
> I want to add some additional variables in the CGAL's 3D triangulation
> data structures, like vertex and cell, in order to record some
> information during analysis.

Use CGAL/Triangulation_vertex_base_with_info_3.h and Triangulation_cell_base_with_info_3.h.

For example, if you want to add an unsigned integer to both structures, you can do something like:


// CGAL headers
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Triangulation_vertex_base_with_info_3.h>
#include <CGAL/Triangulation_cell_base_with_info_3.h>
#include <CGAL/Delaunay_triangulation_3.h>

using K = CGAL::Exact_predicates_inexact_constructions_kernel;
using Triangulation = CGAL::Triangulation_3<K>;
// Used so that each timeslice is assigned an integer
using Vb = CGAL::Triangulation_vertex_base_with_info_3<std::uintmax_t, K>;
// Used to mark cell type
using Cb = CGAL::Triangulation_cell_base_with_info_3<std::uintmax_t, K>;


Adam
--
Adam Getchell
about.me/adamgetchell


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|

Re: adding additional variables in 3D triangulation data structure

Adam Getchell
Sorry, the rest of the header might be useful:

>
> // CGAL headers
> #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
> #include <CGAL/Triangulation_vertex_base_with_info_3.h>
> #include <CGAL/Triangulation_cell_base_with_info_3.h>
> #include <CGAL/Delaunay_triangulation_3.h>
>
> using K = CGAL::Exact_predicates_inexact_constructions_kernel;
> using Triangulation = CGAL::Triangulation_3<K>;
> // Used so that each timeslice is assigned an integer
> using Vb = CGAL::Triangulation_vertex_base_with_info_3<std::uintmax_t, K>;
> // Used to mark cell type
> using Cb = CGAL::Triangulation_cell_base_with_info_3<std::uintmax_t, K>;

// Parallel operations
#ifdef CGAL_LINKED_WITH_TBB
using Tds = CGAL::Triangulation_data_structure_3<Vb, Cb, CGAL::Parallel_tag>;
#else
using Tds = CGAL::Triangulation_data_structure_3<Vb, Cb>;
#endif
using Delaunay = CGAL::Delaunay_triangulation_3<K, Tds>;
using Cell_handle = Delaunay::Cell_handle;
using Vertex_handle = Delaunay::Vertex_handle;
using Locate_type = Delaunay::Locate_type;
using Point = Delaunay::Point;

Adam
--
Adam Getchell
about.me/adamgetchell


--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|

Re: adding additional variables in 3D triangulation data structure

Tianyun Su
Hi Adam,
Thank you for your response and instruction. I have not use
Triangulation_vertex_base_with_info_3 or
Triangulation_cell_base_with_info_3 before. Can you give me a more
instruction about assigning and accessing the value of the added
unsigned integer variable?
Thanks again.

Tianyun


On Sat, Jul 16, 2016 at 7:31 AM, Adam Getchell <[hidden email]> wrote:

> Sorry, the rest of the header might be useful:
>
>>
>> // CGAL headers
>> #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
>> #include <CGAL/Triangulation_vertex_base_with_info_3.h>
>> #include <CGAL/Triangulation_cell_base_with_info_3.h>
>> #include <CGAL/Delaunay_triangulation_3.h>
>>
>> using K = CGAL::Exact_predicates_inexact_constructions_kernel;
>> using Triangulation = CGAL::Triangulation_3<K>;
>> // Used so that each timeslice is assigned an integer
>> using Vb = CGAL::Triangulation_vertex_base_with_info_3<std::uintmax_t, K>;
>> // Used to mark cell type
>> using Cb = CGAL::Triangulation_cell_base_with_info_3<std::uintmax_t, K>;
>
> // Parallel operations
> #ifdef CGAL_LINKED_WITH_TBB
> using Tds = CGAL::Triangulation_data_structure_3<Vb, Cb, CGAL::Parallel_tag>;
> #else
> using Tds = CGAL::Triangulation_data_structure_3<Vb, Cb>;
> #endif
> using Delaunay = CGAL::Delaunay_triangulation_3<K, Tds>;
> using Cell_handle = Delaunay::Cell_handle;
> using Vertex_handle = Delaunay::Vertex_handle;
> using Locate_type = Delaunay::Locate_type;
> using Point = Delaunay::Point;
>
> Adam
> --
> Adam Getchell
> about.me/adamgetchell
>
>
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://sympa.inria.fr/sympa/info/cgal-discuss
>
>

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|

Re: adding additional variables in 3D triangulation data structure

andreas.fabri

Please have a look at the example in the manual:

http://doc.cgal.org/latest/Triangulation_3/index.html#Triangulation3secexamplescolor



On 16/07/2016 17:37, Tianyun Su wrote:

> Hi Adam,
> Thank you for your response and instruction. I have not use
> Triangulation_vertex_base_with_info_3 or
> Triangulation_cell_base_with_info_3 before. Can you give me a more
> instruction about assigning and accessing the value of the added
> unsigned integer variable?
> Thanks again.
>
> Tianyun
>
>
> On Sat, Jul 16, 2016 at 7:31 AM, Adam Getchell <[hidden email]> wrote:
>> Sorry, the rest of the header might be useful:
>>
>>>
>>> // CGAL headers
>>> #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
>>> #include <CGAL/Triangulation_vertex_base_with_info_3.h>
>>> #include <CGAL/Triangulation_cell_base_with_info_3.h>
>>> #include <CGAL/Delaunay_triangulation_3.h>
>>>
>>> using K = CGAL::Exact_predicates_inexact_constructions_kernel;
>>> using Triangulation = CGAL::Triangulation_3<K>;
>>> // Used so that each timeslice is assigned an integer
>>> using Vb = CGAL::Triangulation_vertex_base_with_info_3<std::uintmax_t, K>;
>>> // Used to mark cell type
>>> using Cb = CGAL::Triangulation_cell_base_with_info_3<std::uintmax_t, K>;
>>
>> // Parallel operations
>> #ifdef CGAL_LINKED_WITH_TBB
>> using Tds = CGAL::Triangulation_data_structure_3<Vb, Cb, CGAL::Parallel_tag>;
>> #else
>> using Tds = CGAL::Triangulation_data_structure_3<Vb, Cb>;
>> #endif
>> using Delaunay = CGAL::Delaunay_triangulation_3<K, Tds>;
>> using Cell_handle = Delaunay::Cell_handle;
>> using Vertex_handle = Delaunay::Vertex_handle;
>> using Locate_type = Delaunay::Locate_type;
>> using Point = Delaunay::Point;
>>
>> Adam
>> --
>> Adam Getchell
>> about.me/adamgetchell
>>
>>
>> --
>> You are currently subscribed to cgal-discuss.
>> To unsubscribe or access the archives, go to
>> https://sympa.inria.fr/sympa/info/cgal-discuss
>>
>>
>

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|

Re: adding additional variables in 3D triangulation data structure

Tianyun Su
Hello, Adam,
Thank you for your suggestion. I just made a test according to the
example and it can solve my problem.

Tianyun

On Sun, Jul 17, 2016 at 5:51 AM, Andreas Fabri
<[hidden email]> wrote:

>
> Please have a look at the example in the manual:
>
> http://doc.cgal.org/latest/Triangulation_3/index.html#Triangulation3secexamplescolor
>
>
>
>
> On 16/07/2016 17:37, Tianyun Su wrote:
>>
>> Hi Adam,
>> Thank you for your response and instruction. I have not use
>> Triangulation_vertex_base_with_info_3 or
>> Triangulation_cell_base_with_info_3 before. Can you give me a more
>> instruction about assigning and accessing the value of the added
>> unsigned integer variable?
>> Thanks again.
>>
>> Tianyun
>>
>>
>> On Sat, Jul 16, 2016 at 7:31 AM, Adam Getchell <[hidden email]>
>> wrote:
>>>
>>> Sorry, the rest of the header might be useful:
>>>
>>>>
>>>> // CGAL headers
>>>> #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
>>>> #include <CGAL/Triangulation_vertex_base_with_info_3.h>
>>>> #include <CGAL/Triangulation_cell_base_with_info_3.h>
>>>> #include <CGAL/Delaunay_triangulation_3.h>
>>>>
>>>> using K = CGAL::Exact_predicates_inexact_constructions_kernel;
>>>> using Triangulation = CGAL::Triangulation_3<K>;
>>>> // Used so that each timeslice is assigned an integer
>>>> using Vb = CGAL::Triangulation_vertex_base_with_info_3<std::uintmax_t,
>>>> K>;
>>>> // Used to mark cell type
>>>> using Cb = CGAL::Triangulation_cell_base_with_info_3<std::uintmax_t, K>;
>>>
>>>
>>> // Parallel operations
>>> #ifdef CGAL_LINKED_WITH_TBB
>>> using Tds = CGAL::Triangulation_data_structure_3<Vb, Cb,
>>> CGAL::Parallel_tag>;
>>> #else
>>> using Tds = CGAL::Triangulation_data_structure_3<Vb, Cb>;
>>> #endif
>>> using Delaunay = CGAL::Delaunay_triangulation_3<K, Tds>;
>>> using Cell_handle = Delaunay::Cell_handle;
>>> using Vertex_handle = Delaunay::Vertex_handle;
>>> using Locate_type = Delaunay::Locate_type;
>>> using Point = Delaunay::Point;
>>>
>>> Adam
>>> --
>>> Adam Getchell
>>> about.me/adamgetchell
>>>
>>>
>>> --
>>> You are currently subscribed to cgal-discuss.
>>> To unsubscribe or access the archives, go to
>>> https://sympa.inria.fr/sympa/info/cgal-discuss
>>>
>>>
>>
>
> --
> You are currently subscribed to cgal-discuss.
> To unsubscribe or access the archives, go to
> https://sympa.inria.fr/sympa/info/cgal-discuss
>
>

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss


Reply | Threaded
Open this post in threaded view
|

Re: adding additional variables in 3D triangulation data structure

Tianyun Su
Hi, Andreas,
Many thanks for your suggestion of the example. It's really helpful.

On Mon, Jul 18, 2016 at 10:12 AM, Tianyun Su <[hidden email]> wrote:

> Hello, Adam,
> Thank you for your suggestion. I just made a test according to the
> example and it can solve my problem.
>
> Tianyun
>
> On Sun, Jul 17, 2016 at 5:51 AM, Andreas Fabri
> <[hidden email]> wrote:
>>
>> Please have a look at the example in the manual:
>>
>> http://doc.cgal.org/latest/Triangulation_3/index.html#Triangulation3secexamplescolor
>>
>>
>>
>>
>> On 16/07/2016 17:37, Tianyun Su wrote:
>>>
>>> Hi Adam,
>>> Thank you for your response and instruction. I have not use
>>> Triangulation_vertex_base_with_info_3 or
>>> Triangulation_cell_base_with_info_3 before. Can you give me a more
>>> instruction about assigning and accessing the value of the added
>>> unsigned integer variable?
>>> Thanks again.
>>>
>>> Tianyun
>>>
>>>
>>> On Sat, Jul 16, 2016 at 7:31 AM, Adam Getchell <[hidden email]>
>>> wrote:
>>>>
>>>> Sorry, the rest of the header might be useful:
>>>>
>>>>>
>>>>> // CGAL headers
>>>>> #include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
>>>>> #include <CGAL/Triangulation_vertex_base_with_info_3.h>
>>>>> #include <CGAL/Triangulation_cell_base_with_info_3.h>
>>>>> #include <CGAL/Delaunay_triangulation_3.h>
>>>>>
>>>>> using K = CGAL::Exact_predicates_inexact_constructions_kernel;
>>>>> using Triangulation = CGAL::Triangulation_3<K>;
>>>>> // Used so that each timeslice is assigned an integer
>>>>> using Vb = CGAL::Triangulation_vertex_base_with_info_3<std::uintmax_t,
>>>>> K>;
>>>>> // Used to mark cell type
>>>>> using Cb = CGAL::Triangulation_cell_base_with_info_3<std::uintmax_t, K>;
>>>>
>>>>
>>>> // Parallel operations
>>>> #ifdef CGAL_LINKED_WITH_TBB
>>>> using Tds = CGAL::Triangulation_data_structure_3<Vb, Cb,
>>>> CGAL::Parallel_tag>;
>>>> #else
>>>> using Tds = CGAL::Triangulation_data_structure_3<Vb, Cb>;
>>>> #endif
>>>> using Delaunay = CGAL::Delaunay_triangulation_3<K, Tds>;
>>>> using Cell_handle = Delaunay::Cell_handle;
>>>> using Vertex_handle = Delaunay::Vertex_handle;
>>>> using Locate_type = Delaunay::Locate_type;
>>>> using Point = Delaunay::Point;
>>>>
>>>> Adam
>>>> --
>>>> Adam Getchell
>>>> about.me/adamgetchell
>>>>
>>>>
>>>> --
>>>> You are currently subscribed to cgal-discuss.
>>>> To unsubscribe or access the archives, go to
>>>> https://sympa.inria.fr/sympa/info/cgal-discuss
>>>>
>>>>
>>>
>>
>> --
>> You are currently subscribed to cgal-discuss.
>> To unsubscribe or access the archives, go to
>> https://sympa.inria.fr/sympa/info/cgal-discuss
>>
>>

--
You are currently subscribed to cgal-discuss.
To unsubscribe or access the archives, go to
https://sympa.inria.fr/sympa/info/cgal-discuss