Functions of 2D and 3D Geometric Kernel

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

Functions of 2D and 3D Geometric Kernel

Kathi
Hello,

I don't manage to use the member functions of a 2D/3D geometric kernel as
listed on https://doc.cgal.org/latest/Kernel_23/classKernel.html .
Maybe the problem arises from the fact that I do not fully understand what a
concept, model etc is and especially how to make use of them in practice.

To make my problem specific:
I am working with the Exact_predicates_exact_constructions_kernel and want
to (for example) compute the squared radius of the smallest orthogonal
circle of two weighted points in 2D.
In the reference manual I found:
Compute_squared_radius_smallest_orthogonal_circle_2, a model of
Kernel::ComputeSquaredRadiusSmallestOrthogonalCircle_2.
But I was not able to use it. I tried CGAL::,
CGAL::Exact_predicates_exact_constructions_kernel::, etc but the function is
never found ("not a member of ...").

It would be very helpful if anybody could provide a minimum working example
which makes use of the function.

Thanks for your help,
Kathi



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

--
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: Functions of 2D and 3D Geometric Kernel

MaelRL

Hello,

You can read about concepts and models are here: https://doc.cgal.org/latest/Manual/tutorial_hello_world.html#intro_concept.

CGAL::Exact_predicates_exact_constructions_kernel is a class that is said to be a model of the 'Kernel' concept because it provides models for the various objects and functors concepts that are required by the concept 'Kernel' (see https://doc.cgal.org/latest/Kernel_23/classKernel.html).

In your case, Compute_squared_radius_smallest_orthogonal_circle_2 is indeed a model of the functor concept ComputeSquaredRadiusSmallestOrthogonalCircle__2, and it can be used as follows:

typedef CGAL::Exact_predicates_exact_constructions_kernel EPECK;
typedef EPECK::FT FT;
typedef EPECK::Weighted_point_2 Weighted_point;
typedef EPECK::Compute_squared_radius_smallest_orthogonal_circle_2 Smallest_circle;

EPECK kernel;
Weighted_point wp1, wp2;
Smallest_circle sc = kernel.compute_squared_radius_smallest_orthogonal_circle_2_object();
FT result = sc(wp1, wp2);

In general, kernel objects and functors are defined because there is a use for it, so if you can search the source code of CGAL to find out how they are used in practice.

On 16/05/2018 11:51, Kathi wrote:
Hello,

I don't manage to use the member functions of a 2D/3D geometric kernel as
listed on https://doc.cgal.org/latest/Kernel_23/classKernel.html .
Maybe the problem arises from the fact that I do not fully understand what a
concept, model etc is and especially how to make use of them in practice.

To make my problem specific:
I am working with the Exact_predicates_exact_constructions_kernel and want
to (for example) compute the squared radius of the smallest orthogonal
circle of two weighted points in 2D.
In the reference manual I found:
Compute_squared_radius_smallest_orthogonal_circle_2, a model of
Kernel::ComputeSquaredRadiusSmallestOrthogonalCircle_2.
But I was not able to use it. I tried CGAL::,
CGAL::Exact_predicates_exact_constructions_kernel::, etc but the function is
never found ("not a member of ...").

It would be very helpful if anybody could provide a minimum working example
which makes use of the function.

Thanks for your help,
Kathi



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