CGAL::Arr_conic_traits_2<Int_kernel, Alg_kernel>

Definition

The class Arr_conic_traits_2<Int_kernel, Alg_kernel> is a model of the ArrangementTraits_2 concept and serves as a traits class for finite segments of algebraic curves of degree 2 at most (conic curves). Both template parameters must be models of the a CGAL Kernel concept: The first, Int_kernel, should be templated with an unbounded integer number-type, which will be used to represent the coefficients of the conic curves. The second parameter, Alg_kernel, should be templated with a number type constructible from an unbounded integer, and that in addition to the arithmetic operations, also support the square-root operation in an exact manner, as well as the extraction of the kth-largest root of a given polynomial with integral coefficients. This number type is used to represent the coordinates of the arrangement vertices. The recommended choice for the two template parameters is Cartesian<CORE::BigInt> as Int_kernel and Cartesian<CORE::Expr> as Alg_kernel.

A general conic curve C is the locus of all points (x,y) satisfying the equation rx2 + sy2 + txy + ux + vy + w = 0, where:

In our representation, all conic coefficients (namely r,s,t,u,v,w) must be integers.

A bounded conic arc is defined as one of the following:

A very useful subset of the set of conic arcs are line segments and circular arcs, since arrangements of circular arcs and line segments have some interesting applications (e.g. offsetting polygons, motion planning for a disc robot, etc.). Circular arcs and line segment are simpler objects and can be dealt with more efficiently than arbitrary arcs. For these reasons, it is possible to construct conic arcs from segments and from circles. Using these constructors is highly recommended: It is more straightforward and also speeds up the arrangement construction.

#include <CGAL/Arr_conic_traits_2.h>

Is Model for the Concept

ArrangementTraits_2

Class Arr_conic_traits_2<Int_kernel,Alg_kernel>::Curve_2

The Curve_2 class nested within the conic arcs' traits can represent arbitrary conic arcs and support their construction in various ways. The copy and default constructor as well as the assignment and equality operators are provided for conic arcs. In addition, an operator<< for the curves is defined for standard output streams and Window_stream.

Creation

Arr_conic_traits_2<Int_kernel,Alg_kernel>::Curve_2 cv ( Int_kernel::Segment_2 seg);
constructs an arc from the line segment seg.


Arr_conic_traits_2<Int_kernel,Alg_kernel>::Curve_2 cv ( Int_kernel::Circle_2 circ);
constructs a circular arc that corresponds to the full circle circ (notice the circle center has integer coordinates and its squared radius is also an integer).


Arr_conic_traits_2<Int_kernel,Alg_kernel>::Curve_2 cv ( Int_kernel::Circle_2 circ,
Orientation orient,
Alg_kernel::Point_2 ps,
Alg_kernel::Point_2 pt);
constructs a circular arc supported by the circle circ and with ps and pt as its endpoints, going in the given orientation.
Precondition: ps and pt both lie on the circle circ.


Arr_conic_traits_2<Int_kernel,Alg_kernel>::Curve_2 cv ( Int_kernel::Point_2 p1,
Int_kernel::Point_2 p2,
Int_kernel::Point_2 p3);
constructs a circular arc going from p1, the source, through p2 to p3, the target (notice all points have integer coordinates). The orientation of the arc is determined automatically.
Precondition: The three points are not collinear.


Arr_conic_traits_2<Int_kernel,Alg_kernel>::Curve_2 cv ( Int_kernel::FT r,
Int_kernel::FT s,
Int_kernel::FT t,
Int_kernel::FT u,
Int_kernel::FT v,
Int_kernel::FT w);
constructs a conic arc that corresponds to the full curve rx2 + sy2 + txy + ux + vy + w = 0.
Precondition: The given curve is an ellipse, that is 4rs - t2 > 0.


Arr_conic_traits_2<Int_kernel,Alg_kernel>::Curve_2 cv ( Int_kernel::FT r,
Int_kernel::FT s,
Int_kernel::FT t,
Int_kernel::FT u,
Int_kernel::FT v,
Int_kernel::FT w,
Orientation orient,
Alg_kernel::Point_2 ps,
Alg_kernel::Point_2 pt);
constructs a conic arc supported by the curve rx2 + sy2 + txy + ux + vy + w = 0 with ps as its source and pt as its target, going in the given orientation.
Precondition: ps and pt both satisfy the equation of the supporting curve and define a bounded segment from it (e.g. in case of a hyperbolic arc, both point should be located on the same branch of the hyperbola.


Arr_conic_traits_2<Int_kernel,Alg_kernel>::Curve_2 cv ( Int_kernel::FT r,
Int_kernel::FT s,
Int_kernel::FT t,
Int_kernel::FT u,
Int_kernel::FT v,
Int_kernel::FT w,
Int_kernel::Line_2 l);
constructs a conic arc supported by the curve rx2 + sy2 + txy + ux + vy + w = 0, and whose endpoints are the intersection points of the curve and the line l. We take the portion of the curve that lies in the positive half-plane defined by l.
Precondition: The line l intersects the conic curve at two points.


Arr_conic_traits_2<Int_kernel,Alg_kernel>::Curve_2 cv ( Int_kernel::Point_2 p1,
Int_kernel::Point_2 p2,
Int_kernel::Point_2 p3,
Int_kernel::Point_2 p4,
Int_kernel::Point_2 p5);
constructs a circular arc going from p1, the source, through p2, p3 and p4 to p5, the target (notice all points have integer coordinates). The orientation of the arc is determined automatically.
Precondition: No three points of the five are not collinear.


Arr_conic_traits_2<Int_kernel,Alg_kernel>::Curve_2 cv ( Int_kernel::FT r,
Int_kernel::FT s,
Int_kernel::FT t,
Int_kernel::FT u,
Int_kernel::FT v,
Int_kernel::FT w,
Orientation orient,
Alg_kernel::Point_2 ps,
Int_kernel::FT r1,
Int_kernel::FT s1,
Int_kernel::FT t1,
Int_kernel::FT u1,
Int_kernel::FT v1,
Int_kernel::FT w1,
Alg_kernel::Point_2 pt,
Int_kernel::FT r2,
Int_kernel::FT s2,
Int_kernel::FT t2,
Int_kernel::FT u2,
Int_kernel::FT v2,
Int_kernel::FT w2);
constructs a conic are supported by the curve rx2 + sy2 + txy + ux + vy + w = 0 with ps as its source and pt as its target, going in the given orientation. In this case ps and pt are just approximations of the endpoints, and their exact values are given implicitly, as the intersections of the supporting curve with r1x2 + s1y2 + t1xy + u1x + v1y + w1 = 0 and r2x2 + s2y2 + t2xy + u2x + v2y + w2 = 0, respectively.
Precondition: The two curves specifying the endpoints really intersect with the supporting conic curve.

Operations

bool cv.is_full_conic ()
returns whether the arc represents a full conic curve (a full ellipse).

Alg_kernel::Point_2
cv.source () returns the source point of the arc.

Alg_kernel::Point_2
cv.target () returns the target point of the arc.

bool cv.is_x_monotone ()
returns true if the arc is x-monotone, false otherwise.

bool cv.is_segment () returns whether the arc is a line segment.

bool cv.is_circular () returns whether the arc is supported by a circle.

#include <CGAL/IO/Conic_arc_2_Window_stream.h>