mirror of https://github.com/CGAL/cgal
construct interior vertex
This commit is contained in:
parent
8bd571a638
commit
f88aacb40a
|
|
@ -1327,6 +1327,7 @@ Curved_kernel_via_analysis_2/doc_tex/Curved_kernel_via_analysis_2_ref/Compare_y_
|
||||||
Curved_kernel_via_analysis_2/doc_tex/Curved_kernel_via_analysis_2_ref/Compare_y_at_x_right_2.tex -text
|
Curved_kernel_via_analysis_2/doc_tex/Curved_kernel_via_analysis_2_ref/Compare_y_at_x_right_2.tex -text
|
||||||
Curved_kernel_via_analysis_2/doc_tex/Curved_kernel_via_analysis_2_ref/Compare_y_near_boundary_2.tex -text
|
Curved_kernel_via_analysis_2/doc_tex/Curved_kernel_via_analysis_2_ref/Compare_y_near_boundary_2.tex -text
|
||||||
Curved_kernel_via_analysis_2/doc_tex/Curved_kernel_via_analysis_2_ref/Construct_arc_2.tex -text
|
Curved_kernel_via_analysis_2/doc_tex/Curved_kernel_via_analysis_2_ref/Construct_arc_2.tex -text
|
||||||
|
Curved_kernel_via_analysis_2/doc_tex/Curved_kernel_via_analysis_2_ref/Construct_interior_vertex_2.tex -text
|
||||||
Curved_kernel_via_analysis_2/doc_tex/Curved_kernel_via_analysis_2_ref/Construct_max_vertex_2.tex -text
|
Curved_kernel_via_analysis_2/doc_tex/Curved_kernel_via_analysis_2_ref/Construct_max_vertex_2.tex -text
|
||||||
Curved_kernel_via_analysis_2/doc_tex/Curved_kernel_via_analysis_2_ref/Construct_min_vertex_2.tex -text
|
Curved_kernel_via_analysis_2/doc_tex/Curved_kernel_via_analysis_2_ref/Construct_min_vertex_2.tex -text
|
||||||
Curved_kernel_via_analysis_2/doc_tex/Curved_kernel_via_analysis_2_ref/Construct_point_2.tex -text
|
Curved_kernel_via_analysis_2/doc_tex/Curved_kernel_via_analysis_2_ref/Construct_point_2.tex -text
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,194 @@
|
||||||
|
% +------------------------------------------------------------------------+
|
||||||
|
% | Reference manual page: Construct_interior_vertex_2.tex
|
||||||
|
% +------------------------------------------------------------------------+
|
||||||
|
% | 27.03.2008 Author
|
||||||
|
% | Package: Curved_kernel_via_analysis_2
|
||||||
|
% |
|
||||||
|
\RCSdef{\RCSConstructmaxvertexRev}{$Id: header.tex 40270 2007-09-07 15:29:10Z lsaboret $}
|
||||||
|
\RCSdefDate{\RCSConstructmaxvertexDate}{$Date: 2007-09-07 17:29:10 +0200 (Fri, 07 Sep 2007) $}
|
||||||
|
% |
|
||||||
|
\ccRefPageBegin
|
||||||
|
%%RefPage: end of header, begin of main body
|
||||||
|
% +------------------------------------------------------------------------+
|
||||||
|
|
||||||
|
|
||||||
|
\begin{ccRefFunctionObjectClass}[CGALi::Curved_kernel_via_analysis_2_Functors::]{Construct_interior_vertex_2} %% add template arg's if necessary
|
||||||
|
\ccRefLabel{Construct_interior_vertex_2}
|
||||||
|
|
||||||
|
%% \ccHtmlCrossLink{} %% add further rules for cross referencing links
|
||||||
|
%% \ccHtmlIndexC[class]{} %% add further index entries
|
||||||
|
|
||||||
|
\ccDefinition
|
||||||
|
|
||||||
|
%The function object class \ccRefName\ does this and that.
|
||||||
|
|
||||||
|
% The section below is automatically generated. Do not edit!
|
||||||
|
%START-AUTO(\ccInclude)
|
||||||
|
|
||||||
|
\ccInclude{CGAL/Curved_kernel_via_analysis_2/Curved_kernel_via_analysis_2_functors.h}
|
||||||
|
|
||||||
|
%END-AUTO(\ccInclude)
|
||||||
|
|
||||||
|
% The section below is automatically generated. Do not edit!
|
||||||
|
%START-AUTO(\ccDefinition)
|
||||||
|
|
||||||
|
Functor constructing an interior point of on an arc.
|
||||||
|
|
||||||
|
%END-AUTO(\ccDefinition)
|
||||||
|
|
||||||
|
|
||||||
|
\ccParameters
|
||||||
|
|
||||||
|
% The section below is automatically generated. Do not edit!
|
||||||
|
%START-AUTO(\ccParameters)
|
||||||
|
|
||||||
|
template$<$ \\
|
||||||
|
class \ccc{CurvedKernelViaAnalysis_2}$>$ \\
|
||||||
|
class \ccc{Construct_interior_vertex_2};
|
||||||
|
|
||||||
|
%END-AUTO(\ccParameters)
|
||||||
|
|
||||||
|
|
||||||
|
\ccInheritsFrom
|
||||||
|
|
||||||
|
% The section below is automatically generated. Do not edit!
|
||||||
|
%START-AUTO(\ccInheritsFrom)
|
||||||
|
|
||||||
|
\ccc{Curved_kernel_via_analysis_2_functor_base<CurvedKernelViaAnalysis_2>}
|
||||||
|
|
||||||
|
%END-AUTO(\ccInheritsFrom)
|
||||||
|
|
||||||
|
|
||||||
|
\ccIsModel
|
||||||
|
|
||||||
|
\ccTypes
|
||||||
|
|
||||||
|
%\ccCreation
|
||||||
|
%\ccCreationVariable{a} %% choose variable name
|
||||||
|
|
||||||
|
%% \ccIncludeExampleCode{Curved_kernel_via_analysis_2/Construct_max_vertex_2.C}
|
||||||
|
|
||||||
|
% The section below is automatically generated. Do not edit!
|
||||||
|
%START-AUTO(\ccTypes)
|
||||||
|
|
||||||
|
\ccNestedType{Curved_kernel_via_analysis_2}
|
||||||
|
{
|
||||||
|
this instance' first template parameter
|
||||||
|
}
|
||||||
|
\ccGlue
|
||||||
|
\ccNestedType{Base}
|
||||||
|
{
|
||||||
|
the base type
|
||||||
|
}
|
||||||
|
\ccGlue
|
||||||
|
\ccNestedType{Curve_2}
|
||||||
|
{
|
||||||
|
the curve type
|
||||||
|
}
|
||||||
|
\ccGlue
|
||||||
|
\ccNestedType{Point_2}
|
||||||
|
{
|
||||||
|
the point type
|
||||||
|
}
|
||||||
|
\ccGlue
|
||||||
|
\ccNestedType{Arc_2}
|
||||||
|
{
|
||||||
|
the arc type
|
||||||
|
}
|
||||||
|
\ccGlue
|
||||||
|
\ccNestedType{Curve_analysis_2}
|
||||||
|
{
|
||||||
|
type of curve analaysis
|
||||||
|
}
|
||||||
|
\ccGlue
|
||||||
|
\ccNestedType{X_coordinate_1}
|
||||||
|
{
|
||||||
|
the x-coordinate type
|
||||||
|
}
|
||||||
|
\ccGlue
|
||||||
|
\ccNestedType{result_type}
|
||||||
|
{
|
||||||
|
the result type
|
||||||
|
}
|
||||||
|
\ccGlue
|
||||||
|
\ccNestedType{Curve_kernel_2}
|
||||||
|
{
|
||||||
|
[inherited] \\
|
||||||
|
type of curve kernel
|
||||||
|
}
|
||||||
|
\ccGlue
|
||||||
|
|
||||||
|
%END-AUTO(\ccTypes)
|
||||||
|
|
||||||
|
\ccHeading{Variables}
|
||||||
|
|
||||||
|
% The section below is automatically generated. Do not edit!
|
||||||
|
%START-AUTO(\ccHeading{Variables})
|
||||||
|
|
||||||
|
\ccVariable{Curved_kernel_via_analysis_2* _m_curved_kernel;}
|
||||||
|
{
|
||||||
|
[protected, inherited] \\
|
||||||
|
stores pointer to \ccc{Curved_kernel_via_analysis_2}
|
||||||
|
}
|
||||||
|
\ccGlue
|
||||||
|
|
||||||
|
%END-AUTO(\ccHeading{Variables})
|
||||||
|
|
||||||
|
\ccCreation
|
||||||
|
\ccCreationVariable{a} %% choose variable name for \ccMethod below
|
||||||
|
|
||||||
|
% The section below is automatically generated. Do not edit!
|
||||||
|
%START-AUTO(\ccCreation)
|
||||||
|
|
||||||
|
\ccConstructor{Construct_interior_vertex_2(Curved_kernel_via_analysis_2 * kernel);}
|
||||||
|
{
|
||||||
|
Standard constructor.
|
||||||
|
}
|
||||||
|
\ccGlue
|
||||||
|
\begin{description}
|
||||||
|
\item[Parameters:]
|
||||||
|
\begin{description}
|
||||||
|
\item[kernel]The kernel \end{description}
|
||||||
|
\end{description}
|
||||||
|
\ccGlue
|
||||||
|
|
||||||
|
%END-AUTO(\ccCreation)
|
||||||
|
|
||||||
|
\ccOperations
|
||||||
|
|
||||||
|
% The section below is automatically generated. Do not edit!
|
||||||
|
%START-AUTO(\ccOperations)
|
||||||
|
|
||||||
|
\ccMethod{result_type operator()(const Arc_2& cv) const;}
|
||||||
|
{
|
||||||
|
Get an interior point on the arc.
|
||||||
|
}
|
||||||
|
\ccGlue
|
||||||
|
\begin{description}
|
||||||
|
\item[Parameters:]
|
||||||
|
\begin{description}
|
||||||
|
\item[arc]The arc. \end{description}
|
||||||
|
\end{description}
|
||||||
|
\begin{description}
|
||||||
|
\item[Returns:]A point on the interior of the arc.\end{description}
|
||||||
|
\ccGlue
|
||||||
|
\ccMethod{Curved_kernel_via_analysis_2* _ckva() const;}
|
||||||
|
{
|
||||||
|
[protected, inherited] \\
|
||||||
|
Return pointer to curved kernel.
|
||||||
|
}
|
||||||
|
\ccGlue
|
||||||
|
\begin{description}
|
||||||
|
\item[Returns:]Pointer to stored kernel \end{description}
|
||||||
|
\ccGlue
|
||||||
|
|
||||||
|
%END-AUTO(\ccOperations)
|
||||||
|
|
||||||
|
\end{ccRefFunctionObjectClass}
|
||||||
|
|
||||||
|
% +------------------------------------------------------------------------+
|
||||||
|
%%RefPage: end of main body, begin of footer
|
||||||
|
\ccRefPageEnd
|
||||||
|
% EOF
|
||||||
|
% +------------------------------------------------------------------------+
|
||||||
|
|
||||||
|
|
@ -269,6 +269,12 @@ functor
|
||||||
functor
|
functor
|
||||||
}
|
}
|
||||||
\ccGlue
|
\ccGlue
|
||||||
|
\ccNestedType{Construct_interior_vertex_2}
|
||||||
|
{
|
||||||
|
[inherited] \\
|
||||||
|
functor
|
||||||
|
}
|
||||||
|
\ccGlue
|
||||||
\ccNestedType{Compare_x_near_boundary_2}
|
\ccNestedType{Compare_x_near_boundary_2}
|
||||||
{
|
{
|
||||||
[inherited] \\
|
[inherited] \\
|
||||||
|
|
@ -535,6 +541,12 @@ returns instance of functor
|
||||||
returns instance of functor
|
returns instance of functor
|
||||||
}
|
}
|
||||||
\ccGlue
|
\ccGlue
|
||||||
|
\ccMethod{Construct_interior_vertex_2 construct_max_vertex_2_object() const;}
|
||||||
|
{
|
||||||
|
[inherited] \\
|
||||||
|
returns instance of functor
|
||||||
|
}
|
||||||
|
\ccGlue
|
||||||
\ccMethod{Compare_x_near_boundary_2 compare_x_near_boundary_2_object() const;}
|
\ccMethod{Compare_x_near_boundary_2 compare_x_near_boundary_2_object() const;}
|
||||||
{
|
{
|
||||||
[inherited] \\
|
[inherited] \\
|
||||||
|
|
|
||||||
|
|
@ -119,6 +119,11 @@ functor
|
||||||
functor
|
functor
|
||||||
}
|
}
|
||||||
\ccGlue
|
\ccGlue
|
||||||
|
\ccNestedType{Construct_interior_vertex_2}
|
||||||
|
{
|
||||||
|
functor
|
||||||
|
}
|
||||||
|
\ccGlue
|
||||||
\ccNestedType{Compare_x_near_boundary_2}
|
\ccNestedType{Compare_x_near_boundary_2}
|
||||||
{
|
{
|
||||||
functor
|
functor
|
||||||
|
|
@ -245,6 +250,11 @@ returns instance of functor
|
||||||
returns instance of functor
|
returns instance of functor
|
||||||
}
|
}
|
||||||
\ccGlue
|
\ccGlue
|
||||||
|
\ccMethod{Construct_max_vertex_2 construct_interior_vertex_2_object() const;}
|
||||||
|
{
|
||||||
|
returns instance of functor
|
||||||
|
}
|
||||||
|
\ccGlue
|
||||||
\ccMethod{Compare_x_near_boundary_2 compare_x_near_boundary_2_object() const;}
|
\ccMethod{Compare_x_near_boundary_2 compare_x_near_boundary_2_object() const;}
|
||||||
{
|
{
|
||||||
returns instance of functor
|
returns instance of functor
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ kernel.
|
||||||
\ccRefIdfierPage{Parameter_space_in_y_2}\\
|
\ccRefIdfierPage{Parameter_space_in_y_2}\\
|
||||||
\ccRefIdfierPage{Construct_min_vertex_2}\\
|
\ccRefIdfierPage{Construct_min_vertex_2}\\
|
||||||
\ccRefIdfierPage{Construct_max_vertex_2}\\
|
\ccRefIdfierPage{Construct_max_vertex_2}\\
|
||||||
|
\ccRefIdfierPage{Construct_interior_vertex_2}\\
|
||||||
\ccRefIdfierPage{Compare_x_near_boundary_2}\\
|
\ccRefIdfierPage{Compare_x_near_boundary_2}\\
|
||||||
\ccRefIdfierPage{Compare_y_near_boundary_2}\\
|
\ccRefIdfierPage{Compare_y_near_boundary_2}\\
|
||||||
\ccRefIdfierPage{Compare_y_at_x_2}\\
|
\ccRefIdfierPage{Compare_y_at_x_2}\\
|
||||||
|
|
|
||||||
|
|
@ -25,6 +25,7 @@
|
||||||
\input{Curved_kernel_via_analysis_2_ref/Parameter_space_in_y_2}
|
\input{Curved_kernel_via_analysis_2_ref/Parameter_space_in_y_2}
|
||||||
\input{Curved_kernel_via_analysis_2_ref/Construct_min_vertex_2}
|
\input{Curved_kernel_via_analysis_2_ref/Construct_min_vertex_2}
|
||||||
\input{Curved_kernel_via_analysis_2_ref/Construct_max_vertex_2}
|
\input{Curved_kernel_via_analysis_2_ref/Construct_max_vertex_2}
|
||||||
|
\input{Curved_kernel_via_analysis_2_ref/Construct_interior_vertex_2}
|
||||||
\input{Curved_kernel_via_analysis_2_ref/Compare_x_near_boundary_2}
|
\input{Curved_kernel_via_analysis_2_ref/Compare_x_near_boundary_2}
|
||||||
\input{Curved_kernel_via_analysis_2_ref/Compare_y_near_boundary_2}
|
\input{Curved_kernel_via_analysis_2_ref/Compare_y_near_boundary_2}
|
||||||
\input{Curved_kernel_via_analysis_2_ref/Compare_y_at_x_2}
|
\input{Curved_kernel_via_analysis_2_ref/Compare_y_at_x_2}
|
||||||
|
|
|
||||||
|
|
@ -707,6 +707,114 @@ public:
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/*!\brief
|
||||||
|
* Functor constructing an interior point of on an arc.
|
||||||
|
*/
|
||||||
|
template < class CurvedKernelViaAnalysis_2 >
|
||||||
|
class Construct_interior_vertex_2 : public
|
||||||
|
Curved_kernel_via_analysis_2_functor_base< CurvedKernelViaAnalysis_2 > {
|
||||||
|
|
||||||
|
public:
|
||||||
|
//! this instance' first template parameter
|
||||||
|
typedef CurvedKernelViaAnalysis_2 Curved_kernel_via_analysis_2;
|
||||||
|
|
||||||
|
//! the base type
|
||||||
|
typedef
|
||||||
|
Curved_kernel_via_analysis_2_functor_base< Curved_kernel_via_analysis_2 >
|
||||||
|
Base;
|
||||||
|
|
||||||
|
CGAL_CKvA_2_GRAB_BASE_FUNCTOR_TYPES;
|
||||||
|
|
||||||
|
//! the result type
|
||||||
|
typedef Point_2 result_type;
|
||||||
|
|
||||||
|
/*!\brief
|
||||||
|
* Standard constructor
|
||||||
|
*
|
||||||
|
* \param kernel The kernel
|
||||||
|
*/
|
||||||
|
Construct_interior_vertex_2(Curved_kernel_via_analysis_2 *kernel) :
|
||||||
|
Base(kernel) {
|
||||||
|
}
|
||||||
|
|
||||||
|
/*!\brief
|
||||||
|
* Get an interior point on the arc.
|
||||||
|
*
|
||||||
|
* \param arc The arc.
|
||||||
|
* \return A point on the interior of the arc.
|
||||||
|
*/
|
||||||
|
result_type operator()(const Arc_2& arc) const {
|
||||||
|
|
||||||
|
typedef typename Curved_kernel_via_analysis_2::Curve_2 Curve_analysis_2;
|
||||||
|
|
||||||
|
typedef typename Curved_kernel_via_analysis_2::Curve_kernel_2
|
||||||
|
Algebraic_curve_kernel_2;
|
||||||
|
typedef typename Algebraic_curve_kernel_2::Boundary Boundary;
|
||||||
|
typedef typename Algebraic_curve_kernel_2::X_coordinate_1 X_coordinate_1;
|
||||||
|
|
||||||
|
typedef CGAL::Polynomial<Boundary> Poly_rat_1;
|
||||||
|
typedef CGAL::Polynomial< Poly_rat_1 > Poly_rat_2;
|
||||||
|
|
||||||
|
typedef CGAL::Polynomial_traits_d< Poly_rat_1 > PT_rat_1;
|
||||||
|
typedef CGAL::Polynomial_traits_d< Poly_rat_2 > PT_rat_2;
|
||||||
|
|
||||||
|
typedef CGAL::Fraction_traits< Poly_rat_2 > FT_2;
|
||||||
|
|
||||||
|
if (!arc.is_vertical())
|
||||||
|
{
|
||||||
|
Boundary x_coord = arc.boundary_in_x_range_interior();
|
||||||
|
int arcno = arc.arcno();
|
||||||
|
const Curve_analysis_2& ca = arc.curve();
|
||||||
|
|
||||||
|
Point_2 p = Curved_kernel_via_analysis_2::instance().
|
||||||
|
construct_point_on_arc_2_object()
|
||||||
|
(X_coordinate_1(x_coord), ca, arcno, arc);
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
Boundary y_coord = 0;
|
||||||
|
if (arc.is_finite(ARR_MIN_END))
|
||||||
|
{
|
||||||
|
if (arc.is_finite(ARR_MAX_END))
|
||||||
|
{
|
||||||
|
// We need torefine the interval because there is a chance that
|
||||||
|
// the low of the upper point is below the high of the lower point.
|
||||||
|
y_coord = Curved_kernel_via_analysis_2::instance().kernel().
|
||||||
|
boundary_between_y_2_object() (arc.curve_end(ARR_MIN_END).xy(),
|
||||||
|
arc.curve_end(ARR_MAX_END).xy());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
y_coord = Curved_kernel_via_analysis_2::instance().kernel().
|
||||||
|
upper_boundary_y_2_object() (arc.curve_end(ARR_MIN_END).xy());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (arc.is_finite(ARR_MAX_END))
|
||||||
|
{
|
||||||
|
y_coord = Curved_kernel_via_analysis_2::instance().kernel().
|
||||||
|
lower_boundary_y_2_object()(arc.curve_end(ARR_MAX_END).xy());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*! \todo Try to remove this polynomial stuff */
|
||||||
|
typename PT_rat_1::Construct_polynomial cp1;
|
||||||
|
Poly_rat_2 poly2 = typename PT_rat_2::Construct_polynomial()
|
||||||
|
(cp1(-y_coord), cp1(Boundary(1)));
|
||||||
|
|
||||||
|
typename FT_2::Denominator_type dummy;
|
||||||
|
typename FT_2::Numerator_type curve_poly;
|
||||||
|
typename FT_2::Decompose() (poly2, curve_poly, dummy);
|
||||||
|
|
||||||
|
Curve_analysis_2 curve(curve_poly);
|
||||||
|
Point_2 p = Curved_kernel_via_analysis_2::instance().
|
||||||
|
construct_point_on_arc_2_object()(arc.x(), curve, 0, arc);
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/*!\brief
|
/*!\brief
|
||||||
* Functor that compares x-coordinates of two interior points
|
* Functor that compares x-coordinates of two interior points
|
||||||
*/
|
*/
|
||||||
|
|
@ -2384,6 +2492,8 @@ public:
|
||||||
construct_min_vertex_2_object);
|
construct_min_vertex_2_object);
|
||||||
CGAL_CKvA_2_functor_cons(Construct_max_vertex_2,
|
CGAL_CKvA_2_functor_cons(Construct_max_vertex_2,
|
||||||
construct_max_vertex_2_object);
|
construct_max_vertex_2_object);
|
||||||
|
CGAL_CKvA_2_functor_cons(Construct_interior_vertex_2,
|
||||||
|
construct_interior_vertex_2_object);
|
||||||
CGAL_CKvA_2_functor_pred(Compare_x_near_boundary_2,
|
CGAL_CKvA_2_functor_pred(Compare_x_near_boundary_2,
|
||||||
compare_x_near_boundary_2_object);
|
compare_x_near_boundary_2_object);
|
||||||
CGAL_CKvA_2_functor_pred(Compare_y_near_boundary_2,
|
CGAL_CKvA_2_functor_pred(Compare_y_near_boundary_2,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue