Kernelized traits class.

This commit is contained in:
Michael Hoffmann 2003-08-26 14:13:46 +00:00
parent 27bf458a74
commit 1b6415d9fd
12 changed files with 287 additions and 537 deletions

View File

@ -14,14 +14,14 @@ using std::back_inserter;
using std::cout;
using std::endl;
typedef CGAL::Cartesian< double > R;
typedef R::Point_2 Point_2;
typedef R::Line_2 Line_2;
typedef CGAL::Polygon_traits_2< R > P_traits;
typedef std::vector< Point_2 > Cont;
typedef CGAL::Polygon_2< P_traits, Cont > Polygon_2;
typedef CGAL::Creator_uniform_2< double, Point_2 > Creator;
typedef Random_points_in_square_2< Point_2, Creator > Point_generator;
typedef CGAL::Cartesian<double> Kernel;
typedef Kernel::Point_2 Point_2;
typedef Kernel::Line_2 Line_2;
typedef CGAL::Polygon_traits_2<Kernel> P_traits;
typedef std::vector<Point_2> Cont;
typedef CGAL::Polygon_2<P_traits,Cont> Polygon_2;
typedef CGAL::Creator_uniform_2<double,Point_2> Creator;
typedef Random_points_in_square_2<Point_2,Creator> Point_generator;
int main()
{

View File

@ -14,14 +14,14 @@ using std::back_inserter;
using std::cout;
using std::endl;
typedef CGAL::Cartesian< double > R;
typedef R::Point_2 Point_2;
typedef R::Line_2 Line_2;
typedef CGAL::Polygon_traits_2< R > P_traits;
typedef std::vector< Point_2 > Cont;
typedef CGAL::Polygon_2< P_traits, Cont > Polygon_2;
typedef CGAL::Creator_uniform_2< double, Point_2 > Creator;
typedef Random_points_in_square_2< Point_2, Creator > Point_generator;
typedef CGAL::Cartesian<double> Kernel;
typedef Kernel::Point_2 Point_2;
typedef Kernel::Line_2 Line_2;
typedef CGAL::Polygon_traits_2<Kernel> P_traits;
typedef std::vector<Point_2> Cont;
typedef CGAL::Polygon_2<P_traits,Cont> Polygon_2;
typedef CGAL::Creator_uniform_2<double,Point_2> Creator;
typedef Random_points_in_square_2<Point_2,Creator> Point_generator;
int main()
{

View File

@ -14,14 +14,14 @@ using std::back_inserter;
using std::cout;
using std::endl;
typedef CGAL::Cartesian< double > R;
typedef R::Point_2 Point_2;
typedef R::Line_2 Line_2;
typedef CGAL::Polygon_traits_2< R > P_traits;
typedef std::vector< Point_2 > Cont;
typedef CGAL::Polygon_2< P_traits, Cont > Polygon_2;
typedef CGAL::Creator_uniform_2< double, Point_2 > Creator;
typedef Random_points_in_square_2< Point_2, Creator > Point_generator;
typedef CGAL::Cartesian<double> Kernel;
typedef Kernel::Point_2 Point_2;
typedef Kernel::Line_2 Line_2;
typedef CGAL::Polygon_traits_2<Kernel> P_traits;
typedef std::vector<Point_2> Cont;
typedef CGAL::Polygon_2<P_traits,Cont> Polygon_2;
typedef CGAL::Creator_uniform_2<double,Point_2> Creator;
typedef Random_points_in_square_2<Point_2,Creator> Point_generator;
int main()
{

View File

@ -42,22 +42,21 @@
exactly this point is written to \ccc{o}.
\ccPrecond The points denoted by the range [\ccc{points_begin},
\ccc{points_end}) form the boundary of a convex polygon $P$ in
counterclockwise orientation.
\ccc{points_end}) form the boundary of a simple convex polygon $P$
in counterclockwise orientation.
The geometric types and operations to be used for the computation
are specified by the traits class parameter \ccc{t}. The parameter
can be omitted if \ccc{ForwardIterator} refers to a point type from
the 2D-Kernel. In this case, a default traits class
(\ccc{Min_quadrilateral_default_traits_2<R>}) is used.
(\ccc{Min_quadrilateral_default_traits_2<Kernel>}) is used.
\ccRequire
\begin{enumerate}
\item If \ccc{Traits} is specified, it is a model for
\ccc{MinQuadrilateralTraits_2} and the value type \ccc{VT} of
\ccc{ForwardIterator} is \ccc{Traits::Point_2}. Otherwise
\ccc{VT} is \ccc{CGAL::Point_2<R>} for some representation class
\ccc{R}.
\ccc{ForwardIterator} is \ccc{Traits::Point_2}. Otherwise \ccc{VT}
is \ccc{CGAL::Point_2<Kernel>} for some kernel \ccc{Kernel}.
\item \ccc{OutputIterator} accepts \ccc{VT} as value type.
\end{enumerate}
@ -65,7 +64,7 @@
\ccRefIdfierPage{CGAL::min_parallelogram_2}\\
\ccRefIdfierPage{CGAL::min_strip_2}\\
\ccRefConceptPage{MinQuadrilateralTraits_2}\\
\ccRefIdfierPage{CGAL::Min_quadrilateral_default_traits_2<R>}
\ccRefIdfierPage{CGAL::Min_quadrilateral_default_traits_2<Kernel>}
\ccImplementation We use a rotating caliper
\ccIndexMainItem[t]{rotating caliper} algorithm \cite{t-sgprc-83}
@ -111,22 +110,22 @@
exactly this point is written to \ccc{o}.
\ccPrecond The points denoted by the range [\ccc{points_begin},
\ccc{points_end}) form the boundary of a convex polygon $P$ in
counterclockwise orientation.
\ccc{points_end}) form the boundary of a simple convex polygon $P$
in counterclockwise orientation.
The geometric types and operations to be used for the computation
are specified by the traits class parameter \ccc{t}. The parameter
can be omitted if \ccc{ForwardIterator} refers to a point type from
the 2D-Kernel. In this case, a default traits class
(\ccc{Min_quadrilateral_default_traits_2<R>}) is used.
(\ccc{Min_quadrilateral_default_traits_2<Kernel>}) is used.
\ccRequire
\begin{enumerate}
\item If \ccc{Traits} is specified, it is a model for
\ccc{MinQuadrilateralTraits_2} and the value type \ccc{VT} of
\ccc{ForwardIterator} is \ccc{Traits::Point_2}. Otherwise
\ccc{VT} is \ccc{CGAL::Point_2<R>} for some representation class
\ccc{R}.
\ccc{ForwardIterator} is \ccc{Traits::Point_2}. Otherwise
\ccc{VT} is \ccc{CGAL::Point_2<Kernel>} for some Kernel
\ccc{Kernel}.
\item \ccc{OutputIterator} accepts \ccc{VT} as value type.
\end{enumerate}
@ -134,7 +133,7 @@
\ccRefIdfierPage{CGAL::min_rectangle_2}\\
\ccRefIdfierPage{CGAL::min_strip_2}\\
\ccRefConceptPage{MinQuadrilateralTraits_2}\\
\ccRefIdfierPage{CGAL::Min_quadrilateral_default_traits_2<R>}
\ccRefIdfierPage{CGAL::Min_quadrilateral_default_traits_2<Kernel>}
\ccImplementation We use a rotating caliper
\ccIndexMainItem[t]{rotating caliper} algorithm
@ -180,22 +179,21 @@
remains unchanged.
\ccPrecond The points denoted by the range [\ccc{points_begin},
\ccc{points_end}) form the boundary of a convex polygon $P$ in
counterclockwise orientation.
\ccc{points_end}) form the boundary of a simple convex polygon $P$
in counterclockwise orientation.
The geometric types and operations to be used for the computation
are specified by the traits class parameter \ccc{t}. The parameter
can be omitted if \ccc{ForwardIterator} refers to a point type from
the 2D-Kernel. In this case, a default traits class
(\ccc{Min_quadrilateral_default_traits_2<R>}) is used.
(\ccc{Min_quadrilateral_default_traits_2<Kernel>}) is used.
\ccRequire
\begin{enumerate}
\item If \ccc{Traits} is specified, it is a model for
\ccc{MinQuadrilateralTraits_2} and the value type \ccc{VT} of
\ccc{ForwardIterator} is \ccc{Traits::Point_2}. Otherwise
\ccc{VT} is \ccc{CGAL::Point_2<R>} for some representation class
\ccc{R}.
\ccc{ForwardIterator} is \ccc{Traits::Point_2}. Otherwise \ccc{VT}
is \ccc{CGAL::Point_2<Kernel>} for some kernel \ccc{Kernel}.
\item \ccc{OutputIterator} accepts \ccc{VT} as value type.
\end{enumerate}
@ -203,7 +201,7 @@
\ccRefIdfierPage{CGAL::min_rectangle_2}\\
\ccRefIdfierPage{CGAL::min_parallelogram_2}\\
\ccRefConceptPage{MinQuadrilateralTraits_2}\\
\ccRefIdfierPage{CGAL::Min_quadrilateral_default_traits_2<R>}
\ccRefIdfierPage{CGAL::Min_quadrilateral_default_traits_2<Kernel>}
\ccImplementation We use a rotating caliper
\ccIndexMainItem[t]{rotating caliper} algorithm \cite{t-sgprc-83}
@ -217,14 +215,14 @@
\end{ccRefFunction}
\begin{ccRefClass}{Min_quadrilateral_default_traits_2<R>}
\begin{ccRefClass}{Min_quadrilateral_default_traits_2<Kernel>}
\ccCreationVariable{t}\ccTagFullDeclarations
\ccDefinition The class \ccRefName\ is a traits class for the
functions \ccc{min_rectangle_2}, \ccc{min_parallelogram_2} and
\ccc{min_strip_2} using the two-dimensional \cgal\ kernel.
\ccc{min_strip_2} using a two-dimensional \cgal\ kernel.
\ccRequirements The template parameter \ccc{R} is a model for
\ccRequirements The template parameter \ccc{Kernel} is a model for
\ccc{Kernel}.
\ccInclude{CGAL/Min_quadrilateral_traits_2.h}
@ -236,11 +234,13 @@
\ccTwo{Minq_traits::Rotate_direction_by_multiple_of_pi_22}{}
\ccNestedType{Point_2}{typedef to \ccc{R::Point_2}}
\ccNestedType{Point_2}{\ccRefConceptPage{Kernel::Point_2}.}
\ccNestedType{Direction_2}{typedef to \ccc{R::Direction_2}}
\ccNestedType{Vector_2}{\ccRefConceptPage{Kernel::Vector_2}.}
\ccNestedType{Line_2}{typedef to \ccc{R::Line_2}}
\ccNestedType{Direction_2}{\ccRefConceptPage{Kernel::Direction_2}.}
\ccNestedType{Line_2}{\ccRefConceptPage{Kernel::Line_2}.}
\ccNestedType{Rectangle_2}{internal type.}
@ -248,42 +248,19 @@
\ccNestedType{Strip_2}{internal type.}
\ccNestedType{Equal_2}{AdaptableBinaryFunction class\\\ccc{op}:
\ccc{Point_2} $\times$ \ccc{Point_2} $\rightarrow$ \ccc{bool}.\\
Returns true, iff the two points are equal.}
\ccHeading{Predicates}
\ccNestedType{Equal_2}{\ccRefConceptPage{Kernel::Equal_2}.}
\ccNestedType{Less_x_2}{AdaptableBinaryFunction class \\\ccc{op}:
\ccc{Point_2} $\times$ \ccc{Point_2} $\rightarrow$ \ccc{bool}.\\
\ccc{op(p,q)} returns true, iff the $x$-coordinate of \ccc{p} is
smaller than the $x$-coordinate of \ccc{q}.}
\ccNestedType{Less_xy_2}{\ccRefConceptPage{Kernel::Less_xy_2}.}
\ccNestedType{Less_y_2}{AdaptableBinaryFunction class \\\ccc{op}:
\ccc{Point_2} $\times$ \ccc{Point_2} $\rightarrow$ \ccc{bool}.\\
\ccc{op(p,q)} returns true, iff the $y$-coordinate of \ccc{p} is
smaller than the $y$-coordinate of \ccc{q}.}
\ccNestedType{Less_yx_2}{\ccRefConceptPage{Kernel::Less_yx_2}.}
\ccNestedType{Greater_x_2}{AdaptableBinaryFunction class
\\\ccc{op}:
\ccc{Point_2} $\times$ \ccc{Point_2} $\rightarrow$ \ccc{bool}.\\
\ccc{op(p,q)} returns true, iff the $x$-coordinate of \ccc{p} is
greater than the $x$-coordinate of \ccc{q}.}
\ccNestedType{Has_on_negative_side_2}
{\ccRefConceptPage{Kernel::Has_on_negative_side_2}.}
\ccNestedType{Greater_y_2}{AdaptableBinaryFunction class
\\\ccc{op}:
\ccc{Point_2} $\times$ \ccc{Point_2} $\rightarrow$ \ccc{bool}.\\
\ccc{op(p,q)} returns true, iff the $y$-coordinate of \ccc{p} is
greater than the $y$-coordinate of \ccc{q}.}
\ccNestedType{Right_of_implicit_line_2}{Function class \\\ccc{op}:
\ccc{Point_2} $\times$ \ccc{Point_2} $\times$ \ccc{Direction_2}
$\rightarrow$ \ccc{bool}.\\ \ccc{op(p1,p2,d)} returns true, iff
the \ccc{p1} is strictly to the right of the oriented line
through \ccc{p2} with direction \ccc{d}.}
\ccNestedType{Less_rotate_ccw_2}{AdaptableBinaryFunction class
\\\ccc{op}: \ccc{Direction_2} $\times$ \ccc{Direction_2}
$\rightarrow$ \ccc{bool}.\\ \ccc{op(d1,d2)} returns true, iff
the slope of \ccc{d1} is less than the slope of \ccc{d2}.}
\ccNestedType{Compare_angle_with_x_axis_2}
{\ccRefConceptPage{Kernel::Compare_angle_with_x_axis_2}.}
\ccNestedType{Area_less_rectangle_2}{AdaptableBinaryFunction class
\\\ccc{op}: \ccc{Rectangle_2} $\times$ \ccc{Rectangle_2}
@ -301,18 +278,25 @@
\ccc{bool}.\\ \ccc{op(s1,s2)} returns true, iff the width of
$s1$ is strictly less than the width of $s2$.}
\ccNestedType{Rotate_direction_by_multiple_of_pi_2}{
AdaptableBinaryFunction class \\\ccc{op}: \ccc{Direction_2}
$\times$ \ccc{int} $\rightarrow$ \ccc{Direction_2}.\\ For a
direction $d$ and $i,\, 0 \le i < 4$ \ccc{op(d,i)} returns the
direction that results from clockwise rotating $d$ by $i \cdot
\pi$.}
\ccHeading{Constructions}
\ccNestedType{Construct_vector_2}{\ccRefConceptPage{Kernel::Construct_vector_2}.}
\ccNestedType{Construct_vector_from_direction_2}{AdaptableFunctor
\\\ccc{op}: \ccc{Direction_2} $\rightarrow$ \ccc{Vector_2}.\\
\ccc{op(d)} returns a vector in direction \ccc{d}.}
\ccNestedType{Construct_perpendicular_vector_2}
{\ccRefConceptPage{Kernel::Construct_perpendicular_vector_2}.}
\ccNestedType{Construct_direction_2}{AdaptableBinaryFunction class
\\\ccc{op}: \ccc{Point_2} $\times$ \ccc{Point_2} $\rightarrow$
\ccc{Direction_2}.\\ \ccc{op(p,q)} returns the direction of the
vector from $p$ to $q$.}
\ccNestedType{Construct_direction_2}
{\ccRefConceptPage{Kernel::Construct_direction_2}.}
\ccNestedType{Construct_opposite_direction_2}
{\ccRefConceptPage{Kernel::Construct_opposite_direction_2}.}
\ccNestedType{Construct_line_2}{\ccRefConceptPage{Kernel::Construct_line_2}.}
\ccNestedType{Construct_rectangle_2}{Function class \\\ccc{op}:
\ccc{Point_2} $\times$ \ccc{Direction_2} $\times$ \ccc{Point_2}
$\times$ \ccc{Point_2} $\times$ \ccc{Point_2} $\rightarrow$
@ -356,38 +340,15 @@
copy_strip_lines_2(const Strip_2& s, OutputIterator o)
const;}{copies the two lines bounding \ccc{s} to \ccc{o}.}
The following functions just return the corresponding function
object.
\ccThree{Rotate_direction_by_multiple_of_pi_2}{
rotate_direction_by_multiple_of_pi_2_object();}{}
\ccMemberFunction{Equal_2 equal_2_object() const;}{}
\ccGlue\ccMemberFunction{Less_x_2 less_x_2_object() const;}{}
\ccGlue\ccMemberFunction{Less_y_2 less_y_2_object() const;}{}
\ccGlue\ccMemberFunction{Greater_x_2 greater_x_2_object() const;}{}
\ccGlue\ccMemberFunction{Greater_y_2 greater_y_2_object() const;}{}
\ccGlue\ccMemberFunction{Right_of_implicit_line_2
right_of_implicit_line_2_object() const;}{}
\ccGlue\ccMemberFunction{Less_rotate_ccw_2
less_rotate_ccw_2_object() const;}{}
\ccGlue\ccMemberFunction{Area_less_rectangle_2
area_less_rectangle_2_object() const;}{}
\ccGlue\ccMemberFunction{Area_less_parallelogram_2
area_less_parallelogram_2_object() const;}{}
\ccGlue\ccMemberFunction{Width_less_strip_2
width_less_strip_2_object() const;}{}
\ccGlue\ccMemberFunction{Construct_direction_2
construct_direction_2_object() const;}{}
\ccGlue\ccMemberFunction{Construct_rectangle_2
construct_rectangle_2_object() const;}{}
\ccGlue\ccMemberFunction{Construct_parallelogram_2
construct_parallelogram_2_object() const;}{}
\ccGlue\ccMemberFunction{Construct_strip_2
construct_strip_2_object() const;}{}
\ccGlue\ccMemberFunction{Rotate_direction_by_multiple_of_pi_2
rotate_direction_by_multiple_of_pi_2_object() const;}{}
Additionally, for each of the predicate and construction functor
types listed above, there is a member function that requires no
arguments and returns an instance of that functor type. The name of
the member function is the uncapitalized name of the type returned
with the suffix \ccc{_object} appended. For example, for the functor
type \ccc{Construct_vector_2} the following member function exists:
\ccMemberFunction{Construct_vector_2 construct_vector_2_object()
const ;}{}
\ccSeeAlso
\ccRefIdfierPage{CGAL::min_rectangle_2}\\
@ -406,10 +367,12 @@
\ccTypes
\ccTwo{Minq_traits::Rotate_direction_by_multiple_of_pi_22}{}
\ccTwo{Minq_traits::Construct_perpendicular_vector_2}{}
\ccNestedType{Point_2}{type for representing points.}
\ccNestedType{Vector_2}{type for representing vectors.}
\ccNestedType{Direction_2}{type for representing directions.}
\ccNestedType{Line_2}{type for representing lines.}
@ -423,70 +386,58 @@
\ccNestedType{Strip_2}{type for representing strips, that is the
closed region bounded by two parallel lines.}
\ccNestedType{Equal_2}{AdaptableBinaryFunction class\\\ccc{op}:
\ccc{Point_2} $\times$ \ccc{Point_2} $\rightarrow$ \ccc{bool}.\\
Returns true, iff the two points are equal.}
\ccHeading{Predicates}
\ccNestedType{Equal_2}{a model for \ccRefConceptPage{Kernel::Equal_2}.}
\ccNestedType{Less_x_2}{AdaptableBinaryFunction class \\\ccc{op}:
\ccc{Point_2} $\times$ \ccc{Point_2} $\rightarrow$ \ccc{bool}.\\
\ccc{op(p,q)} returns true, iff the $x$-coordinate of \ccc{p} is
smaller than the $x$-coordinate of \ccc{q}.}
\ccNestedType{Less_xy_2}{a model for
\ccRefConceptPage{Kernel::Less_xy_2}.}
\ccNestedType{Less_yx_2}{a model for
\ccRefConceptPage{Kernel::Less_yx_2}.}
\ccNestedType{Less_y_2}{AdaptableBinaryFunction class \\\ccc{op}:
\ccc{Point_2} $\times$ \ccc{Point_2} $\rightarrow$ \ccc{bool}.\\
\ccc{op(p,q)} returns true, iff the $y$-coordinate of \ccc{p} is
smaller than the $y$-coordinate of \ccc{q}.}
\ccNestedType{Has_on_negative_side_2}{a model for
\ccRefConceptPage{Kernel::Has_on_negative_side_2}.}
\ccNestedType{Greater_x_2}{AdaptableBinaryFunction class
\\\ccc{op}:
\ccc{Point_2} $\times$ \ccc{Point_2} $\rightarrow$ \ccc{bool}.\\
\ccc{op(p,q)} returns true, iff the $x$-coordinate of \ccc{p} is
greater than the $x$-coordinate of \ccc{q}.}
\ccNestedType{Compare_angle_with_x_axis_2}{a model for
\ccRefConceptPage{Kernel::Compare_angle_with_x_axis_2}.}
\ccNestedType{Greater_y_2}{AdaptableBinaryFunction class
\\\ccc{op}:
\ccc{Point_2} $\times$ \ccc{Point_2} $\rightarrow$ \ccc{bool}.\\
\ccc{op(p,q)} returns true, iff the $y$-coordinate of \ccc{p} is
greater than the $y$-coordinate of \ccc{q}.}
\ccNestedType{Area_less_rectangle_2}{AdaptableFunctor \\\ccc{op}:
\ccc{Rectangle_2} $\times$ \ccc{Rectangle_2} $\rightarrow$
\ccc{bool}.\\ \ccc{op(r1,r2)} returns true, iff the area of $r1$ is
strictly less than the area of $r2$.}
\ccNestedType{Right_of_implicit_line_2}{Function class \\\ccc{op}:
\ccc{Point_2} $\times$ \ccc{Point_2} $\times$ \ccc{Direction_2}
$\rightarrow$ \ccc{bool}.\\ \ccc{op(p1,p2,d)} returns true, iff
the \ccc{p1} is strictly to the right of the oriented line
through \ccc{p2} with direction \ccc{d}.}
\ccNestedType{Area_less_parallelogram_2}{AdaptableFunctor \\\ccc{op}:
\ccc{Parallelogram_2} $\times$
\ccc{Parallelogram_2} $\rightarrow$ \ccc{bool}.\\
\ccc{op(p1,p2)} returns true, iff the area of $p1$ is strictly less
than the area of $p2$.}
\ccNestedType{Less_rotate_ccw_2}{AdaptableBinaryFunction class
\\\ccc{op}: \ccc{Direction_2} $\times$ \ccc{Direction_2}
$\rightarrow$ \ccc{bool}.\\ \ccc{op(d1,d2)} returns true, iff
the slope of \ccc{d1} is less than the slope of \ccc{d2}.}
\ccNestedType{Width_less_strip_2}{AdaptableFunctor \\\ccc{op}:
\ccc{Strip_2} $\times$ \ccc{Strip_2} $\rightarrow$ \ccc{bool}.\\
\ccc{op(s1,s2)} returns true, iff the width of $s1$ is strictly less
than the width of $s2$.}
\ccNestedType{Area_less_rectangle_2}{AdaptableBinaryFunction class
\\\ccc{op}: \ccc{Rectangle_2} $\times$ \ccc{Rectangle_2}
$\rightarrow$ \ccc{bool}.\\ \ccc{op(r1,r2)} returns true, iff
the area of $r1$ is strictly less than the area of $r2$.}
\ccHeading{Constructions}
\ccNestedType{Construct_vector_2}{a model for
\ccRefConceptPage{Kernel::Construct_vector_2}.}
\ccNestedType{Area_less_parallelogram_2}{AdaptableBinaryFunction
class \\\ccc{op}: \ccc{Parallelogram_2} $\times$
\ccc{Parallelogram_2} $\rightarrow$ \ccc{bool}.\\
\ccc{op(p1,p2)} returns true, iff the area of $p1$ is strictly
less than the area of $p2$.}
\ccNestedType{Construct_vector_from_direction_2}{AdaptableFunctor
\\\ccc{op}: \ccc{Direction_2} $\rightarrow$ \ccc{Vector_2}.\\
\ccc{op(d)} returns a vector in direction \ccc{d}.}
\ccNestedType{Construct_perpendicular_vector_2}{a model for
\ccRefConceptPage{Kernel::Construct_perpendicular_vector_2}.}
\ccNestedType{Width_less_strip_2}{AdaptableBinaryFunction class
\\\ccc{op}: \ccc{Strip_2} $\times$ \ccc{Strip_2} $\rightarrow$
\ccc{bool}.\\ \ccc{op(s1,s2)} returns true, iff the width of
$s1$ is strictly less than the width of $s2$.}
\ccNestedType{Construct_direction_2}{a model for
\ccRefConceptPage{Kernel::Construct_direction_2}.}
\ccNestedType{Rotate_direction_by_multiple_of_pi_2}{
AdaptableBinaryFunction class \\\ccc{op}: \ccc{Direction_2}
$\times$ \ccc{int} $\rightarrow$ \ccc{Direction_2}.\\ For a
direction $d$ and $i,\, 0 \le i < 4$ \ccc{op(d,i)} returns the
direction that results from clockwise rotating $d$ by $i \cdot
\pi$.}
\ccNestedType{Construct_opposite_direction_2}{a model for
\ccRefConceptPage{Kernel::Construct_opposite_direction_2}.}
\ccNestedType{Construct_direction_2}{AdaptableBinaryFunction class
\\\ccc{op}: \ccc{Point_2} $\times$ \ccc{Point_2} $\rightarrow$
\ccc{Direction_2}.\\ \ccc{op(p,q)} returns the direction of the
vector from $p$ to $q$.}
\ccNestedType{Construct_line_2}{a model for
\ccRefConceptPage{Kernel::Construct_line_2}.}
\ccNestedType{Construct_rectangle_2}{Function class \\\ccc{op}:
\ccc{Point_2} $\times$ \ccc{Direction_2} $\times$ \ccc{Point_2}
@ -531,41 +482,19 @@
copy_strip_lines_2(const Strip_2& s, OutputIterator o)
const;}{copies the two lines bounding \ccc{s} to \ccc{o}.}
The following functions just return the corresponding function
object.
\ccThree{Rotate_direction_by_multiple_of_pi_2}{
rotate_direction_by_multiple_of_pi_2_object();}{}
\ccMemberFunction{Equal_2 equal_2_object() const;}{}
\ccGlue\ccMemberFunction{Less_x_2 less_x_2_object() const;}{}
\ccGlue\ccMemberFunction{Less_y_2 less_y_2_object() const;}{}
\ccGlue\ccMemberFunction{Greater_x_2 greater_x_2_object() const;}{}
\ccGlue\ccMemberFunction{Greater_y_2 greater_y_2_object() const;}{}
\ccGlue\ccMemberFunction{Right_of_implicit_line_2
right_of_implicit_line_2_object() const;}{}
\ccGlue\ccMemberFunction{Less_rotate_ccw_2
less_rotate_ccw_2_object() const;}{}
\ccGlue\ccMemberFunction{Area_less_rectangle_2
area_less_rectangle_2_object() const;}{}
\ccGlue\ccMemberFunction{Area_less_parallelogram_2
area_less_parallelogram_2_object() const;}{}
\ccGlue\ccMemberFunction{Width_less_strip_2
width_less_strip_2_object() const;}{}
\ccGlue\ccMemberFunction{Construct_direction_2
construct_direction_2_object() const;}{}
\ccGlue\ccMemberFunction{Construct_rectangle_2
construct_rectangle_2_object() const;}{}
\ccGlue\ccMemberFunction{Construct_parallelogram_2
construct_parallelogram_2_object() const;}{}
\ccGlue\ccMemberFunction{Construct_strip_2
construct_strip_2_object() const;}{}
\ccGlue\ccMemberFunction{Rotate_direction_by_multiple_of_pi_2
rotate_direction_by_multiple_of_pi_2_object() const;}{}
Additionally, for each of the predicate and construction functor
types listed above, there must exist a member function that requires
no arguments and returns an instance of that functor type. The name
of the member function is the uncapitalized name of the type
returned with the suffix \ccc{_object} appended. For example, for
the functor type \ccc{Construct_vector_2} the following member
function must exist:
\ccMemberFunction{Construct_vector_2 construct_vector_2_object()
const ;}{}
\ccHasModels
\ccRefIdfierPage{CGAL::Min_quadrilateral_default_traits_2<R>}
\ccRefIdfierPage{CGAL::Min_quadrilateral_default_traits_2<Kernel>}
\ccSeeAlso
\ccRefIdfierPage{CGAL::min_rectangle_2}\\

View File

@ -14,14 +14,14 @@ using std::back_inserter;
using std::cout;
using std::endl;
typedef CGAL::Cartesian< double > R;
typedef R::Point_2 Point_2;
typedef R::Line_2 Line_2;
typedef CGAL::Polygon_traits_2< R > P_traits;
typedef std::vector< Point_2 > Cont;
typedef CGAL::Polygon_2< P_traits, Cont > Polygon_2;
typedef CGAL::Creator_uniform_2< double, Point_2 > Creator;
typedef Random_points_in_square_2< Point_2, Creator > Point_generator;
typedef CGAL::Cartesian<double> Kernel;
typedef Kernel::Point_2 Point_2;
typedef Kernel::Line_2 Line_2;
typedef CGAL::Polygon_traits_2<Kernel> P_traits;
typedef std::vector<Point_2> Cont;
typedef CGAL::Polygon_2<P_traits,Cont> Polygon_2;
typedef CGAL::Creator_uniform_2<double,Point_2> Creator;
typedef Random_points_in_square_2<Point_2,Creator> Point_generator;
int main()
{

View File

@ -14,14 +14,14 @@ using std::back_inserter;
using std::cout;
using std::endl;
typedef CGAL::Cartesian< double > R;
typedef R::Point_2 Point_2;
typedef R::Line_2 Line_2;
typedef CGAL::Polygon_traits_2< R > P_traits;
typedef std::vector< Point_2 > Cont;
typedef CGAL::Polygon_2< P_traits, Cont > Polygon_2;
typedef CGAL::Creator_uniform_2< double, Point_2 > Creator;
typedef Random_points_in_square_2< Point_2, Creator > Point_generator;
typedef CGAL::Cartesian<double> Kernel;
typedef Kernel::Point_2 Point_2;
typedef Kernel::Line_2 Line_2;
typedef CGAL::Polygon_traits_2<Kernel> P_traits;
typedef std::vector<Point_2> Cont;
typedef CGAL::Polygon_2<P_traits,Cont> Polygon_2;
typedef CGAL::Creator_uniform_2<double,Point_2> Creator;
typedef Random_points_in_square_2<Point_2,Creator> Point_generator;
int main()
{

View File

@ -14,14 +14,14 @@ using std::back_inserter;
using std::cout;
using std::endl;
typedef CGAL::Cartesian< double > R;
typedef R::Point_2 Point_2;
typedef R::Line_2 Line_2;
typedef CGAL::Polygon_traits_2< R > P_traits;
typedef std::vector< Point_2 > Cont;
typedef CGAL::Polygon_2< P_traits, Cont > Polygon_2;
typedef CGAL::Creator_uniform_2< double, Point_2 > Creator;
typedef Random_points_in_square_2< Point_2, Creator > Point_generator;
typedef CGAL::Cartesian<double> Kernel;
typedef Kernel::Point_2 Point_2;
typedef Kernel::Line_2 Line_2;
typedef CGAL::Polygon_traits_2<Kernel> P_traits;
typedef std::vector<Point_2> Cont;
typedef CGAL::Polygon_2<P_traits,Cont> Polygon_2;
typedef CGAL::Creator_uniform_2<double,Point_2> Creator;
typedef Random_points_in_square_2<Point_2,Creator> Point_generator;
int main()
{

View File

@ -42,22 +42,21 @@
exactly this point is written to \ccc{o}.
\ccPrecond The points denoted by the range [\ccc{points_begin},
\ccc{points_end}) form the boundary of a convex polygon $P$ in
counterclockwise orientation.
\ccc{points_end}) form the boundary of a simple convex polygon $P$
in counterclockwise orientation.
The geometric types and operations to be used for the computation
are specified by the traits class parameter \ccc{t}. The parameter
can be omitted if \ccc{ForwardIterator} refers to a point type from
the 2D-Kernel. In this case, a default traits class
(\ccc{Min_quadrilateral_default_traits_2<R>}) is used.
(\ccc{Min_quadrilateral_default_traits_2<Kernel>}) is used.
\ccRequire
\begin{enumerate}
\item If \ccc{Traits} is specified, it is a model for
\ccc{MinQuadrilateralTraits_2} and the value type \ccc{VT} of
\ccc{ForwardIterator} is \ccc{Traits::Point_2}. Otherwise
\ccc{VT} is \ccc{CGAL::Point_2<R>} for some representation class
\ccc{R}.
\ccc{ForwardIterator} is \ccc{Traits::Point_2}. Otherwise \ccc{VT}
is \ccc{CGAL::Point_2<Kernel>} for some kernel \ccc{Kernel}.
\item \ccc{OutputIterator} accepts \ccc{VT} as value type.
\end{enumerate}
@ -65,7 +64,7 @@
\ccRefIdfierPage{CGAL::min_parallelogram_2}\\
\ccRefIdfierPage{CGAL::min_strip_2}\\
\ccRefConceptPage{MinQuadrilateralTraits_2}\\
\ccRefIdfierPage{CGAL::Min_quadrilateral_default_traits_2<R>}
\ccRefIdfierPage{CGAL::Min_quadrilateral_default_traits_2<Kernel>}
\ccImplementation We use a rotating caliper
\ccIndexMainItem[t]{rotating caliper} algorithm \cite{t-sgprc-83}
@ -111,22 +110,22 @@
exactly this point is written to \ccc{o}.
\ccPrecond The points denoted by the range [\ccc{points_begin},
\ccc{points_end}) form the boundary of a convex polygon $P$ in
counterclockwise orientation.
\ccc{points_end}) form the boundary of a simple convex polygon $P$
in counterclockwise orientation.
The geometric types and operations to be used for the computation
are specified by the traits class parameter \ccc{t}. The parameter
can be omitted if \ccc{ForwardIterator} refers to a point type from
the 2D-Kernel. In this case, a default traits class
(\ccc{Min_quadrilateral_default_traits_2<R>}) is used.
(\ccc{Min_quadrilateral_default_traits_2<Kernel>}) is used.
\ccRequire
\begin{enumerate}
\item If \ccc{Traits} is specified, it is a model for
\ccc{MinQuadrilateralTraits_2} and the value type \ccc{VT} of
\ccc{ForwardIterator} is \ccc{Traits::Point_2}. Otherwise
\ccc{VT} is \ccc{CGAL::Point_2<R>} for some representation class
\ccc{R}.
\ccc{ForwardIterator} is \ccc{Traits::Point_2}. Otherwise
\ccc{VT} is \ccc{CGAL::Point_2<Kernel>} for some Kernel
\ccc{Kernel}.
\item \ccc{OutputIterator} accepts \ccc{VT} as value type.
\end{enumerate}
@ -134,7 +133,7 @@
\ccRefIdfierPage{CGAL::min_rectangle_2}\\
\ccRefIdfierPage{CGAL::min_strip_2}\\
\ccRefConceptPage{MinQuadrilateralTraits_2}\\
\ccRefIdfierPage{CGAL::Min_quadrilateral_default_traits_2<R>}
\ccRefIdfierPage{CGAL::Min_quadrilateral_default_traits_2<Kernel>}
\ccImplementation We use a rotating caliper
\ccIndexMainItem[t]{rotating caliper} algorithm
@ -180,22 +179,21 @@
remains unchanged.
\ccPrecond The points denoted by the range [\ccc{points_begin},
\ccc{points_end}) form the boundary of a convex polygon $P$ in
counterclockwise orientation.
\ccc{points_end}) form the boundary of a simple convex polygon $P$
in counterclockwise orientation.
The geometric types and operations to be used for the computation
are specified by the traits class parameter \ccc{t}. The parameter
can be omitted if \ccc{ForwardIterator} refers to a point type from
the 2D-Kernel. In this case, a default traits class
(\ccc{Min_quadrilateral_default_traits_2<R>}) is used.
(\ccc{Min_quadrilateral_default_traits_2<Kernel>}) is used.
\ccRequire
\begin{enumerate}
\item If \ccc{Traits} is specified, it is a model for
\ccc{MinQuadrilateralTraits_2} and the value type \ccc{VT} of
\ccc{ForwardIterator} is \ccc{Traits::Point_2}. Otherwise
\ccc{VT} is \ccc{CGAL::Point_2<R>} for some representation class
\ccc{R}.
\ccc{ForwardIterator} is \ccc{Traits::Point_2}. Otherwise \ccc{VT}
is \ccc{CGAL::Point_2<Kernel>} for some kernel \ccc{Kernel}.
\item \ccc{OutputIterator} accepts \ccc{VT} as value type.
\end{enumerate}
@ -203,7 +201,7 @@
\ccRefIdfierPage{CGAL::min_rectangle_2}\\
\ccRefIdfierPage{CGAL::min_parallelogram_2}\\
\ccRefConceptPage{MinQuadrilateralTraits_2}\\
\ccRefIdfierPage{CGAL::Min_quadrilateral_default_traits_2<R>}
\ccRefIdfierPage{CGAL::Min_quadrilateral_default_traits_2<Kernel>}
\ccImplementation We use a rotating caliper
\ccIndexMainItem[t]{rotating caliper} algorithm \cite{t-sgprc-83}
@ -217,14 +215,14 @@
\end{ccRefFunction}
\begin{ccRefClass}{Min_quadrilateral_default_traits_2<R>}
\begin{ccRefClass}{Min_quadrilateral_default_traits_2<Kernel>}
\ccCreationVariable{t}\ccTagFullDeclarations
\ccDefinition The class \ccRefName\ is a traits class for the
functions \ccc{min_rectangle_2}, \ccc{min_parallelogram_2} and
\ccc{min_strip_2} using the two-dimensional \cgal\ kernel.
\ccc{min_strip_2} using a two-dimensional \cgal\ kernel.
\ccRequirements The template parameter \ccc{R} is a model for
\ccRequirements The template parameter \ccc{Kernel} is a model for
\ccc{Kernel}.
\ccInclude{CGAL/Min_quadrilateral_traits_2.h}
@ -236,11 +234,13 @@
\ccTwo{Minq_traits::Rotate_direction_by_multiple_of_pi_22}{}
\ccNestedType{Point_2}{typedef to \ccc{R::Point_2}}
\ccNestedType{Point_2}{\ccRefConceptPage{Kernel::Point_2}.}
\ccNestedType{Direction_2}{typedef to \ccc{R::Direction_2}}
\ccNestedType{Vector_2}{\ccRefConceptPage{Kernel::Vector_2}.}
\ccNestedType{Line_2}{typedef to \ccc{R::Line_2}}
\ccNestedType{Direction_2}{\ccRefConceptPage{Kernel::Direction_2}.}
\ccNestedType{Line_2}{\ccRefConceptPage{Kernel::Line_2}.}
\ccNestedType{Rectangle_2}{internal type.}
@ -248,42 +248,19 @@
\ccNestedType{Strip_2}{internal type.}
\ccNestedType{Equal_2}{AdaptableBinaryFunction class\\\ccc{op}:
\ccc{Point_2} $\times$ \ccc{Point_2} $\rightarrow$ \ccc{bool}.\\
Returns true, iff the two points are equal.}
\ccHeading{Predicates}
\ccNestedType{Equal_2}{\ccRefConceptPage{Kernel::Equal_2}.}
\ccNestedType{Less_x_2}{AdaptableBinaryFunction class \\\ccc{op}:
\ccc{Point_2} $\times$ \ccc{Point_2} $\rightarrow$ \ccc{bool}.\\
\ccc{op(p,q)} returns true, iff the $x$-coordinate of \ccc{p} is
smaller than the $x$-coordinate of \ccc{q}.}
\ccNestedType{Less_xy_2}{\ccRefConceptPage{Kernel::Less_xy_2}.}
\ccNestedType{Less_y_2}{AdaptableBinaryFunction class \\\ccc{op}:
\ccc{Point_2} $\times$ \ccc{Point_2} $\rightarrow$ \ccc{bool}.\\
\ccc{op(p,q)} returns true, iff the $y$-coordinate of \ccc{p} is
smaller than the $y$-coordinate of \ccc{q}.}
\ccNestedType{Less_yx_2}{\ccRefConceptPage{Kernel::Less_yx_2}.}
\ccNestedType{Greater_x_2}{AdaptableBinaryFunction class
\\\ccc{op}:
\ccc{Point_2} $\times$ \ccc{Point_2} $\rightarrow$ \ccc{bool}.\\
\ccc{op(p,q)} returns true, iff the $x$-coordinate of \ccc{p} is
greater than the $x$-coordinate of \ccc{q}.}
\ccNestedType{Has_on_negative_side_2}
{\ccRefConceptPage{Kernel::Has_on_negative_side_2}.}
\ccNestedType{Greater_y_2}{AdaptableBinaryFunction class
\\\ccc{op}:
\ccc{Point_2} $\times$ \ccc{Point_2} $\rightarrow$ \ccc{bool}.\\
\ccc{op(p,q)} returns true, iff the $y$-coordinate of \ccc{p} is
greater than the $y$-coordinate of \ccc{q}.}
\ccNestedType{Right_of_implicit_line_2}{Function class \\\ccc{op}:
\ccc{Point_2} $\times$ \ccc{Point_2} $\times$ \ccc{Direction_2}
$\rightarrow$ \ccc{bool}.\\ \ccc{op(p1,p2,d)} returns true, iff
the \ccc{p1} is strictly to the right of the oriented line
through \ccc{p2} with direction \ccc{d}.}
\ccNestedType{Less_rotate_ccw_2}{AdaptableBinaryFunction class
\\\ccc{op}: \ccc{Direction_2} $\times$ \ccc{Direction_2}
$\rightarrow$ \ccc{bool}.\\ \ccc{op(d1,d2)} returns true, iff
the slope of \ccc{d1} is less than the slope of \ccc{d2}.}
\ccNestedType{Compare_angle_with_x_axis_2}
{\ccRefConceptPage{Kernel::Compare_angle_with_x_axis_2}.}
\ccNestedType{Area_less_rectangle_2}{AdaptableBinaryFunction class
\\\ccc{op}: \ccc{Rectangle_2} $\times$ \ccc{Rectangle_2}
@ -301,18 +278,25 @@
\ccc{bool}.\\ \ccc{op(s1,s2)} returns true, iff the width of
$s1$ is strictly less than the width of $s2$.}
\ccNestedType{Rotate_direction_by_multiple_of_pi_2}{
AdaptableBinaryFunction class \\\ccc{op}: \ccc{Direction_2}
$\times$ \ccc{int} $\rightarrow$ \ccc{Direction_2}.\\ For a
direction $d$ and $i,\, 0 \le i < 4$ \ccc{op(d,i)} returns the
direction that results from clockwise rotating $d$ by $i \cdot
\pi$.}
\ccHeading{Constructions}
\ccNestedType{Construct_vector_2}{\ccRefConceptPage{Kernel::Construct_vector_2}.}
\ccNestedType{Construct_vector_from_direction_2}{AdaptableFunctor
\\\ccc{op}: \ccc{Direction_2} $\rightarrow$ \ccc{Vector_2}.\\
\ccc{op(d)} returns a vector in direction \ccc{d}.}
\ccNestedType{Construct_perpendicular_vector_2}
{\ccRefConceptPage{Kernel::Construct_perpendicular_vector_2}.}
\ccNestedType{Construct_direction_2}{AdaptableBinaryFunction class
\\\ccc{op}: \ccc{Point_2} $\times$ \ccc{Point_2} $\rightarrow$
\ccc{Direction_2}.\\ \ccc{op(p,q)} returns the direction of the
vector from $p$ to $q$.}
\ccNestedType{Construct_direction_2}
{\ccRefConceptPage{Kernel::Construct_direction_2}.}
\ccNestedType{Construct_opposite_direction_2}
{\ccRefConceptPage{Kernel::Construct_opposite_direction_2}.}
\ccNestedType{Construct_line_2}{\ccRefConceptPage{Kernel::Construct_line_2}.}
\ccNestedType{Construct_rectangle_2}{Function class \\\ccc{op}:
\ccc{Point_2} $\times$ \ccc{Direction_2} $\times$ \ccc{Point_2}
$\times$ \ccc{Point_2} $\times$ \ccc{Point_2} $\rightarrow$
@ -356,38 +340,15 @@
copy_strip_lines_2(const Strip_2& s, OutputIterator o)
const;}{copies the two lines bounding \ccc{s} to \ccc{o}.}
The following functions just return the corresponding function
object.
\ccThree{Rotate_direction_by_multiple_of_pi_2}{
rotate_direction_by_multiple_of_pi_2_object();}{}
\ccMemberFunction{Equal_2 equal_2_object() const;}{}
\ccGlue\ccMemberFunction{Less_x_2 less_x_2_object() const;}{}
\ccGlue\ccMemberFunction{Less_y_2 less_y_2_object() const;}{}
\ccGlue\ccMemberFunction{Greater_x_2 greater_x_2_object() const;}{}
\ccGlue\ccMemberFunction{Greater_y_2 greater_y_2_object() const;}{}
\ccGlue\ccMemberFunction{Right_of_implicit_line_2
right_of_implicit_line_2_object() const;}{}
\ccGlue\ccMemberFunction{Less_rotate_ccw_2
less_rotate_ccw_2_object() const;}{}
\ccGlue\ccMemberFunction{Area_less_rectangle_2
area_less_rectangle_2_object() const;}{}
\ccGlue\ccMemberFunction{Area_less_parallelogram_2
area_less_parallelogram_2_object() const;}{}
\ccGlue\ccMemberFunction{Width_less_strip_2
width_less_strip_2_object() const;}{}
\ccGlue\ccMemberFunction{Construct_direction_2
construct_direction_2_object() const;}{}
\ccGlue\ccMemberFunction{Construct_rectangle_2
construct_rectangle_2_object() const;}{}
\ccGlue\ccMemberFunction{Construct_parallelogram_2
construct_parallelogram_2_object() const;}{}
\ccGlue\ccMemberFunction{Construct_strip_2
construct_strip_2_object() const;}{}
\ccGlue\ccMemberFunction{Rotate_direction_by_multiple_of_pi_2
rotate_direction_by_multiple_of_pi_2_object() const;}{}
Additionally, for each of the predicate and construction functor
types listed above, there is a member function that requires no
arguments and returns an instance of that functor type. The name of
the member function is the uncapitalized name of the type returned
with the suffix \ccc{_object} appended. For example, for the functor
type \ccc{Construct_vector_2} the following member function exists:
\ccMemberFunction{Construct_vector_2 construct_vector_2_object()
const ;}{}
\ccSeeAlso
\ccRefIdfierPage{CGAL::min_rectangle_2}\\
@ -406,10 +367,12 @@
\ccTypes
\ccTwo{Minq_traits::Rotate_direction_by_multiple_of_pi_22}{}
\ccTwo{Minq_traits::Construct_perpendicular_vector_2}{}
\ccNestedType{Point_2}{type for representing points.}
\ccNestedType{Vector_2}{type for representing vectors.}
\ccNestedType{Direction_2}{type for representing directions.}
\ccNestedType{Line_2}{type for representing lines.}
@ -423,70 +386,58 @@
\ccNestedType{Strip_2}{type for representing strips, that is the
closed region bounded by two parallel lines.}
\ccNestedType{Equal_2}{AdaptableBinaryFunction class\\\ccc{op}:
\ccc{Point_2} $\times$ \ccc{Point_2} $\rightarrow$ \ccc{bool}.\\
Returns true, iff the two points are equal.}
\ccHeading{Predicates}
\ccNestedType{Equal_2}{a model for \ccRefConceptPage{Kernel::Equal_2}.}
\ccNestedType{Less_x_2}{AdaptableBinaryFunction class \\\ccc{op}:
\ccc{Point_2} $\times$ \ccc{Point_2} $\rightarrow$ \ccc{bool}.\\
\ccc{op(p,q)} returns true, iff the $x$-coordinate of \ccc{p} is
smaller than the $x$-coordinate of \ccc{q}.}
\ccNestedType{Less_xy_2}{a model for
\ccRefConceptPage{Kernel::Less_xy_2}.}
\ccNestedType{Less_yx_2}{a model for
\ccRefConceptPage{Kernel::Less_yx_2}.}
\ccNestedType{Less_y_2}{AdaptableBinaryFunction class \\\ccc{op}:
\ccc{Point_2} $\times$ \ccc{Point_2} $\rightarrow$ \ccc{bool}.\\
\ccc{op(p,q)} returns true, iff the $y$-coordinate of \ccc{p} is
smaller than the $y$-coordinate of \ccc{q}.}
\ccNestedType{Has_on_negative_side_2}{a model for
\ccRefConceptPage{Kernel::Has_on_negative_side_2}.}
\ccNestedType{Greater_x_2}{AdaptableBinaryFunction class
\\\ccc{op}:
\ccc{Point_2} $\times$ \ccc{Point_2} $\rightarrow$ \ccc{bool}.\\
\ccc{op(p,q)} returns true, iff the $x$-coordinate of \ccc{p} is
greater than the $x$-coordinate of \ccc{q}.}
\ccNestedType{Compare_angle_with_x_axis_2}{a model for
\ccRefConceptPage{Kernel::Compare_angle_with_x_axis_2}.}
\ccNestedType{Greater_y_2}{AdaptableBinaryFunction class
\\\ccc{op}:
\ccc{Point_2} $\times$ \ccc{Point_2} $\rightarrow$ \ccc{bool}.\\
\ccc{op(p,q)} returns true, iff the $y$-coordinate of \ccc{p} is
greater than the $y$-coordinate of \ccc{q}.}
\ccNestedType{Area_less_rectangle_2}{AdaptableFunctor \\\ccc{op}:
\ccc{Rectangle_2} $\times$ \ccc{Rectangle_2} $\rightarrow$
\ccc{bool}.\\ \ccc{op(r1,r2)} returns true, iff the area of $r1$ is
strictly less than the area of $r2$.}
\ccNestedType{Right_of_implicit_line_2}{Function class \\\ccc{op}:
\ccc{Point_2} $\times$ \ccc{Point_2} $\times$ \ccc{Direction_2}
$\rightarrow$ \ccc{bool}.\\ \ccc{op(p1,p2,d)} returns true, iff
the \ccc{p1} is strictly to the right of the oriented line
through \ccc{p2} with direction \ccc{d}.}
\ccNestedType{Area_less_parallelogram_2}{AdaptableFunctor \\\ccc{op}:
\ccc{Parallelogram_2} $\times$
\ccc{Parallelogram_2} $\rightarrow$ \ccc{bool}.\\
\ccc{op(p1,p2)} returns true, iff the area of $p1$ is strictly less
than the area of $p2$.}
\ccNestedType{Less_rotate_ccw_2}{AdaptableBinaryFunction class
\\\ccc{op}: \ccc{Direction_2} $\times$ \ccc{Direction_2}
$\rightarrow$ \ccc{bool}.\\ \ccc{op(d1,d2)} returns true, iff
the slope of \ccc{d1} is less than the slope of \ccc{d2}.}
\ccNestedType{Width_less_strip_2}{AdaptableFunctor \\\ccc{op}:
\ccc{Strip_2} $\times$ \ccc{Strip_2} $\rightarrow$ \ccc{bool}.\\
\ccc{op(s1,s2)} returns true, iff the width of $s1$ is strictly less
than the width of $s2$.}
\ccNestedType{Area_less_rectangle_2}{AdaptableBinaryFunction class
\\\ccc{op}: \ccc{Rectangle_2} $\times$ \ccc{Rectangle_2}
$\rightarrow$ \ccc{bool}.\\ \ccc{op(r1,r2)} returns true, iff
the area of $r1$ is strictly less than the area of $r2$.}
\ccHeading{Constructions}
\ccNestedType{Construct_vector_2}{a model for
\ccRefConceptPage{Kernel::Construct_vector_2}.}
\ccNestedType{Area_less_parallelogram_2}{AdaptableBinaryFunction
class \\\ccc{op}: \ccc{Parallelogram_2} $\times$
\ccc{Parallelogram_2} $\rightarrow$ \ccc{bool}.\\
\ccc{op(p1,p2)} returns true, iff the area of $p1$ is strictly
less than the area of $p2$.}
\ccNestedType{Construct_vector_from_direction_2}{AdaptableFunctor
\\\ccc{op}: \ccc{Direction_2} $\rightarrow$ \ccc{Vector_2}.\\
\ccc{op(d)} returns a vector in direction \ccc{d}.}
\ccNestedType{Construct_perpendicular_vector_2}{a model for
\ccRefConceptPage{Kernel::Construct_perpendicular_vector_2}.}
\ccNestedType{Width_less_strip_2}{AdaptableBinaryFunction class
\\\ccc{op}: \ccc{Strip_2} $\times$ \ccc{Strip_2} $\rightarrow$
\ccc{bool}.\\ \ccc{op(s1,s2)} returns true, iff the width of
$s1$ is strictly less than the width of $s2$.}
\ccNestedType{Construct_direction_2}{a model for
\ccRefConceptPage{Kernel::Construct_direction_2}.}
\ccNestedType{Rotate_direction_by_multiple_of_pi_2}{
AdaptableBinaryFunction class \\\ccc{op}: \ccc{Direction_2}
$\times$ \ccc{int} $\rightarrow$ \ccc{Direction_2}.\\ For a
direction $d$ and $i,\, 0 \le i < 4$ \ccc{op(d,i)} returns the
direction that results from clockwise rotating $d$ by $i \cdot
\pi$.}
\ccNestedType{Construct_opposite_direction_2}{a model for
\ccRefConceptPage{Kernel::Construct_opposite_direction_2}.}
\ccNestedType{Construct_direction_2}{AdaptableBinaryFunction class
\\\ccc{op}: \ccc{Point_2} $\times$ \ccc{Point_2} $\rightarrow$
\ccc{Direction_2}.\\ \ccc{op(p,q)} returns the direction of the
vector from $p$ to $q$.}
\ccNestedType{Construct_line_2}{a model for
\ccRefConceptPage{Kernel::Construct_line_2}.}
\ccNestedType{Construct_rectangle_2}{Function class \\\ccc{op}:
\ccc{Point_2} $\times$ \ccc{Direction_2} $\times$ \ccc{Point_2}
@ -531,41 +482,19 @@
copy_strip_lines_2(const Strip_2& s, OutputIterator o)
const;}{copies the two lines bounding \ccc{s} to \ccc{o}.}
The following functions just return the corresponding function
object.
\ccThree{Rotate_direction_by_multiple_of_pi_2}{
rotate_direction_by_multiple_of_pi_2_object();}{}
\ccMemberFunction{Equal_2 equal_2_object() const;}{}
\ccGlue\ccMemberFunction{Less_x_2 less_x_2_object() const;}{}
\ccGlue\ccMemberFunction{Less_y_2 less_y_2_object() const;}{}
\ccGlue\ccMemberFunction{Greater_x_2 greater_x_2_object() const;}{}
\ccGlue\ccMemberFunction{Greater_y_2 greater_y_2_object() const;}{}
\ccGlue\ccMemberFunction{Right_of_implicit_line_2
right_of_implicit_line_2_object() const;}{}
\ccGlue\ccMemberFunction{Less_rotate_ccw_2
less_rotate_ccw_2_object() const;}{}
\ccGlue\ccMemberFunction{Area_less_rectangle_2
area_less_rectangle_2_object() const;}{}
\ccGlue\ccMemberFunction{Area_less_parallelogram_2
area_less_parallelogram_2_object() const;}{}
\ccGlue\ccMemberFunction{Width_less_strip_2
width_less_strip_2_object() const;}{}
\ccGlue\ccMemberFunction{Construct_direction_2
construct_direction_2_object() const;}{}
\ccGlue\ccMemberFunction{Construct_rectangle_2
construct_rectangle_2_object() const;}{}
\ccGlue\ccMemberFunction{Construct_parallelogram_2
construct_parallelogram_2_object() const;}{}
\ccGlue\ccMemberFunction{Construct_strip_2
construct_strip_2_object() const;}{}
\ccGlue\ccMemberFunction{Rotate_direction_by_multiple_of_pi_2
rotate_direction_by_multiple_of_pi_2_object() const;}{}
Additionally, for each of the predicate and construction functor
types listed above, there must exist a member function that requires
no arguments and returns an instance of that functor type. The name
of the member function is the uncapitalized name of the type
returned with the suffix \ccc{_object} appended. For example, for
the functor type \ccc{Construct_vector_2} the following member
function must exist:
\ccMemberFunction{Construct_vector_2 construct_vector_2_object()
const ;}{}
\ccHasModels
\ccRefIdfierPage{CGAL::Min_quadrilateral_default_traits_2<R>}
\ccRefIdfierPage{CGAL::Min_quadrilateral_default_traits_2<Kernel>}
\ccSeeAlso
\ccRefIdfierPage{CGAL::min_rectangle_2}\\

View File

@ -322,12 +322,6 @@ public:
tmpo = isec(line(r.p1, r.d1), line(r.p2, r.d2));
if (assign(tmp, tmpo)) {
#ifdef CGAL_TRACE
if (!line(r.p1, r.d1).has_on(tmp) ||
!line(r.p2, r.d2).has_on(tmp))
std::cerr << "ERROR!" << std::endl;
else std::cerr << "--- OK1" << std::endl;
#endif // CGAL_TRACE
*o++ = tmp;
} else {
CGAL_optimisation_assertion_code(bool test1 =)
@ -337,12 +331,6 @@ public:
}
tmpo = isec(line(r.p3, r.d1), line(r.p2, r.d2));
if (assign(tmp, tmpo)) {
#ifdef CGAL_TRACE
if (!line(r.p3, r.d1).has_on(tmp) ||
!line(r.p2, r.d2).has_on(tmp))
std::cerr << "ERROR!" << std::endl;
else std::cerr << "--- OK2" << std::endl;
#endif // CGAL_TRACE
*o++ = tmp;
} else {
CGAL_optimisation_assertion_code(bool test1 =)
@ -352,12 +340,6 @@ public:
}
tmpo = isec(line(r.p3, r.d1), line(r.p4, r.d2));
if (assign(tmp, tmpo)) {
#ifdef CGAL_TRACE
if (!line(r.p3, r.d1).has_on(tmp) ||
!line(r.p4, r.d2).has_on(tmp))
std::cerr << "ERROR!" << std::endl;
else std::cerr << "--- OK3" << std::endl;
#endif // CGAL_TRACE
*o++ = tmp;
} else {
CGAL_optimisation_assertion_code(bool test1 =)
@ -367,12 +349,6 @@ public:
}
tmpo = isec(line(r.p1, r.d1), line(r.p4, r.d2));
if (assign(tmp, tmpo)) {
#ifdef CGAL_TRACE
if (!line(r.p1, r.d1).has_on(tmp) ||
!line(r.p4, r.d2).has_on(tmp))
std::cerr << "ERROR!" << std::endl;
else std::cerr << "--- OK4" << std::endl;
#endif // CGAL_TRACE
*o++ = tmp;
} else {
CGAL_optimisation_assertion_code(bool test1 =)

View File

@ -447,13 +447,6 @@ min_rectangle_2(
return t.copy_rectangle_vertices_2(rect_so_far, o);
} // min_rectangle_2( f, l, o , t)
#ifdef CGAL_TRACE
CGAL_END_NAMESPACE
#include <CGAL/IO/Ostream_iterator.h>
#include <CGAL/IO/leda_window.h>
#include <CGAL/leda_real.h>
CGAL_BEGIN_NAMESPACE
#endif // CGAL_TRACE
template < class ForwardIterator, class OutputIterator, class BTraits >
OutputIterator
@ -501,22 +494,6 @@ min_parallelogram_2(ForwardIterator f,
// initialised to the points defining the bounding box
convex_bounding_box_2(first, l, curr, t);
#ifdef CGAL_TRACE
/*
ForwardIterator mmix = std::min_element(first, l, t.less_xy_2_object());
ForwardIterator mmax = std::max_element(first, l, t.less_xy_2_object());
ForwardIterator mmiy = std::min_element(first, l, t.less_yx_2_object());
ForwardIterator mmay = std::max_element(first, l, t.less_yx_2_object());
CGAL_assertion(!t.less_xy_2_object()(*mmix, *(curr[3])));
CGAL_assertion(!t.less_xy_2_object()(*(curr[3]), *mmix));
CGAL_assertion(!t.less_xy_2_object()(*mmax, *(curr[1])));
CGAL_assertion(!t.less_xy_2_object()(*(curr[1]), *mmax));
CGAL_assertion(!t.less_yx_2_object()(*mmiy, *(curr[0])));
CGAL_assertion(!t.less_yx_2_object()(*(curr[0]), *mmiy));
CGAL_assertion(!t.less_yx_2_object()(*mmay, *(curr[2])));
CGAL_assertion(!t.less_yx_2_object()(*(curr[2]), *mmay));
*/
#endif
ForwardIterator low = curr[0];
ForwardIterator upp = curr[2];
@ -644,73 +621,12 @@ min_parallelogram_2(ForwardIterator f,
Parallelogram_2 test_para =
parallelogram(*low, next_dir, *right, d_leftright, *upp, *left);
#ifdef CGAL_TRACE
{
typedef typename
std::iterator_traits< ForwardIterator >::value_type Point;
typedef Polygon_traits_2< typename Traits::Kernel > P_traits;
typedef std::vector< Point > Cont;
typedef CGAL::Polygon_2< P_traits, Cont > Polygon_2;
Polygon_2 p;
t.copy_parallelogram_vertices_2(test_para, std::back_inserter(p));
CGAL_assertion(p.is_simple());
CGAL_assertion(p.is_convex());
cout << "p_area = " << p.area() << endl;
for (ForwardIterator ii = first; ii != l; ++ii)
CGAL_assertion(!p.has_on_unbounded_side(*ii));
}
#endif // CGAL_TRACE
if (area_less(test_para, para_so_far))
para_so_far = test_para;
} // for (;;)
#ifdef CGAL_TRACE
typedef typename
std::iterator_traits< ForwardIterator >::value_type Point;
Point p[4];
t.copy_parallelogram_vertices_2(para_so_far, p);
leda_window w;
w.init(-50, 450, -35);
w.display();
Ostream_iterator< Point, leda_window > oip(w);
//std::ostream_iterator< Point > oipc(std::cerr, "\n");
std::copy(first, l, oip);
w << YELLOW;
w.set_node_width(7);
{
ForwardIterator ii = curr[3];
while (ii != curr[1]) {
*oip++ = *ii;
if (++ii == l) ii = first;
}
*oip++ = *ii;
}
w.set_node_width(5);
w << GREEN << para_so_far.p1 << para_so_far.p2
<< para_so_far.p3 << para_so_far.p4;
{
typedef typename Traits::Line_2 Line_2;
Line_2 l1(para_so_far.p1, para_so_far.d1);
Line_2 l2(para_so_far.p2, para_so_far.d2);
Line_2 l3(para_so_far.p3, para_so_far.d1);
Line_2 l4(para_so_far.p4, para_so_far.d2);
if (l1 == l2) cout << "l1 == l2" << endl;
if (l1 == l3) cout << "l1 == l3" << endl;
if (l1 == l4) cout << "l1 == l4" << endl;
w << BLUE << l1 << l2 << l3 << l4;
}
w.set_node_width(3);
w << RED << p[0] << p[1] << p[2] << p[3];
w.read_mouse();
std::cerr << "ZAP" << std::endl;
*o++ = p[0];
*o++ = p[1];
*o++ = p[2];
*o++ = p[3];
return o;
#endif
return t.copy_parallelogram_vertices_2(para_so_far, o);
} // min_parallelogram_2(f, l, o , t)

View File

@ -42,7 +42,7 @@ compile_and_run()
fi
echo "Executing $1 ... "
echo
if eval 2>&1 $COMMAND > $OUTPUTFILE ; then
if eval $COMMAND > $OUTPUTFILE 2>&1 ; then
echo " succesful execution of $1" >> $ERRORFILE
else
echo " ERROR: execution of $1" >> $ERRORFILE
@ -51,7 +51,7 @@ compile_and_run()
echo " ERROR: not executed $1" >> $ERRORFILE
fi
eval "2>&1 make CGAL_MAKEFILE=$CGAL_MAKEFILE clean > /dev/null "
eval "make CGAL_MAKEFILE=$CGAL_MAKEFILE clean > /dev/null 2>&1 "
}
#---------------------------------------------------------------------#

View File

@ -1 +1 @@
1.24 (26 August 2003)
1.25 (26 August 2003)