diff --git a/.gitattributes b/.gitattributes index 820e9a42166..cdb961b82aa 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,4 +1,15 @@ * text=auto !eol +Old_Packages/Doc23/doc_tex/kernel/IsoCuboid.gif svneol=native#unset +Old_Packages/Doc23/doc_tex/kernel/arrlinthree.gif svneol=native#unset +Old_Packages/Doc23/doc_tex/kernel/arrlintwo.gif svneol=native#unset +Old_Packages/Doc23/doc_tex/kernel/arrthree.gif svneol=native#unset +Old_Packages/Doc23/doc_tex/kernel/arrthree2.gif svneol=native#unset +Old_Packages/Doc23/doc_tex/kernel/arrtwo.gif svneol=native#unset +Old_Packages/Doc23/doc_tex/kernel/arrtwo2.gif svneol=native#unset +Old_Packages/Doc23/doc_tex/kernel/compare1.gif svneol=native#unset +Old_Packages/Doc23/doc_tex/kernel/compare2.gif svneol=native#unset +Old_Packages/Doc23/doc_tex/kernel/transvecthree.gif svneol=native#unset +Old_Packages/Doc23/doc_tex/kernel/transvectwo.gif svneol=native#unset Old_Packages/Stl_port/stlport/bug/algorithm svneol=native#unset Old_Packages/Stl_port/stlport/bug/bitset svneol=native#unset Old_Packages/Stl_port/stlport/bug/cassert svneol=native#unset @@ -277,6 +288,20 @@ Packages/Installation/doc_tex/installation/Fig/c-simp.ipe -text Packages/Installation/doc_tex/installation/Fig/g-simp.ipe -text Packages/Installation/doc_tex/installation/Fig/l-simp.ipe -text Packages/Interval_arithmetic/src/Interval_arithmetic/workaround_4_ms.obj -text svneol=unset#unset +Packages/Kernel_23/doc_tex/kernel/IsoCuboid.eps -text +Packages/Kernel_23/doc_tex/kernel/IsoCuboid.gif -text svneol=unset#unset +Packages/Kernel_23/doc_tex/kernel/arrlinthree.gif -text svneol=unset#unset +Packages/Kernel_23/doc_tex/kernel/arrlintwo.gif -text svneol=unset#unset +Packages/Kernel_23/doc_tex/kernel/arrthree.gif -text svneol=unset#unset +Packages/Kernel_23/doc_tex/kernel/arrthree2.gif -text svneol=unset#unset +Packages/Kernel_23/doc_tex/kernel/arrtwo.gif -text svneol=unset#unset +Packages/Kernel_23/doc_tex/kernel/arrtwo2.gif -text svneol=unset#unset +Packages/Kernel_23/doc_tex/kernel/compare1.gif -text svneol=unset#unset +Packages/Kernel_23/doc_tex/kernel/compare1.ipe -text +Packages/Kernel_23/doc_tex/kernel/compare2.gif -text svneol=unset#unset +Packages/Kernel_23/doc_tex/kernel/compare2.ipe -text +Packages/Kernel_23/doc_tex/kernel/transvecthree.gif -text svneol=unset#unset +Packages/Kernel_23/doc_tex/kernel/transvectwo.gif -text svneol=unset#unset Packages/Manual_tools/src/mstring.doc -text Packages/Matrix_search/doc_tex/Optimisation/Optimisation_ref/MatrixSearch_pcenter1.gif svneol=native#unset Packages/Matrix_search/doc_tex/Optimisation/Optimisation_ref/MatrixSearch_pcenter2.gif svneol=native#unset diff --git a/Old_Packages/Doc23/changes.txt b/Old_Packages/Doc23/changes.txt new file mode 100644 index 00000000000..a7ff5e294fb --- /dev/null +++ b/Old_Packages/Doc23/changes.txt @@ -0,0 +1,28 @@ +2.7 (26 Sep 2000) + +- links for Cartesian and intersection suppressed in many places (certainly + not all where necessary) +- orientation and opposite are not linked anymore +- spacing for Kernel fixed (uses \ccAdditionalRefSkip length - thanks to Susan) +- operators now show up in the postscript version again with Vector/Point (don't + know the exact reason for this problem related to operator Layout + +2.6 (07 Sep 2000) + +- circumcenter page fixed +- ray (Ray_2, Ray_3) .... A segment (Segment_2, Segment_3) + in kernel_geometry.tex + +2.5 (17 Aug 2000) + +- ccCreationVariable set to fo for Kernel::FunctionObjects +- ccSeeAlso added in a number of places +- rational_rotation_approximation documented +- dimension fixes in 3D functionality: _2 replaced by _3 + (copy and paste errors) +- html does not work for operator* !!!??? no fix yet! + +2.4 (10 Aug 2000) + +- converted to RefManual + diff --git a/Old_Packages/Doc23/doc_tex/kernel/IsoCuboid.eps b/Old_Packages/Doc23/doc_tex/kernel/IsoCuboid.eps new file mode 100644 index 00000000000..71feddd0e78 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/IsoCuboid.eps @@ -0,0 +1,185 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: IsoCuboid.eps +%%Creator: fig2dev Version 3.2.3 Patchlevel +%%CreationDate: Tue Aug 8 14:12:52 2000 +%%For: stschirr@mpii01807 (Stefan Schirra) +%%BoundingBox: 0 0 258 136 +%%Magnification: 0.5000 +%%EndComments +/$F2psDict 200 dict def +$F2psDict begin +$F2psDict /mtrx matrix put +/col-1 {0 setgray} bind def +/col0 {0.000 0.000 0.000 srgb} bind def +/col1 {0.000 0.000 1.000 srgb} bind def +/col2 {0.000 1.000 0.000 srgb} bind def +/col3 {0.000 1.000 1.000 srgb} bind def +/col4 {1.000 0.000 0.000 srgb} bind def +/col5 {1.000 0.000 1.000 srgb} bind def +/col6 {1.000 1.000 0.000 srgb} bind def +/col7 {1.000 1.000 1.000 srgb} bind def +/col8 {0.000 0.000 0.560 srgb} bind def +/col9 {0.000 0.000 0.690 srgb} bind def +/col10 {0.000 0.000 0.820 srgb} bind def +/col11 {0.530 0.810 1.000 srgb} bind def +/col12 {0.000 0.560 0.000 srgb} bind def +/col13 {0.000 0.690 0.000 srgb} bind def +/col14 {0.000 0.820 0.000 srgb} bind def +/col15 {0.000 0.560 0.560 srgb} bind def +/col16 {0.000 0.690 0.690 srgb} bind def +/col17 {0.000 0.820 0.820 srgb} bind def +/col18 {0.560 0.000 0.000 srgb} bind def +/col19 {0.690 0.000 0.000 srgb} bind def +/col20 {0.820 0.000 0.000 srgb} bind def +/col21 {0.560 0.000 0.560 srgb} bind def +/col22 {0.690 0.000 0.690 srgb} bind def +/col23 {0.820 0.000 0.820 srgb} bind def +/col24 {0.500 0.190 0.000 srgb} bind def +/col25 {0.630 0.250 0.000 srgb} bind def +/col26 {0.750 0.380 0.000 srgb} bind def +/col27 {1.000 0.500 0.500 srgb} bind def +/col28 {1.000 0.630 0.630 srgb} bind def +/col29 {1.000 0.750 0.750 srgb} bind def +/col30 {1.000 0.880 0.880 srgb} bind def +/col31 {1.000 0.840 0.000 srgb} bind def + +end +save +newpath 0 136 moveto 0 0 lineto 258 0 lineto 258 136 lineto closepath clip newpath +-6.0 217.0 translate +1 -1 scale + +/cp {closepath} bind def +/ef {eofill} bind def +/gr {grestore} bind def +/gs {gsave} bind def +/sa {save} bind def +/rs {restore} bind def +/l {lineto} bind def +/m {moveto} bind def +/rm {rmoveto} bind def +/n {newpath} bind def +/s {stroke} bind def +/sh {show} bind def +/slc {setlinecap} bind def +/slj {setlinejoin} bind def +/slw {setlinewidth} bind def +/srgb {setrgbcolor} bind def +/rot {rotate} bind def +/sc {scale} bind def +/sd {setdash} bind def +/ff {findfont} bind def +/sf {setfont} bind def +/scf {scalefont} bind def +/sw {stringwidth} bind def +/tr {translate} bind def +/tnt {dup dup currentrgbcolor + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} + bind def +/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul + 4 -2 roll mul srgb} bind def +/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def +/$F2psEnd {$F2psEnteredState restore end} def + +$F2psBegin +%%Page: 1 1 +10 setmiterlimit + 0.03000 0.03000 sc +% Polyline +7.500 slw +n 3000 4200 m 6600 4200 l 6600 6600 l 3000 6600 l + cp gs col0 s gr +% Polyline +n 3000 4200 m + 4800 3000 l gs col0 s gr +% Polyline +n 6600 4200 m + 8400 3000 l gs col0 s gr +% Polyline +n 6600 6600 m + 8400 5400 l gs col0 s gr +% Polyline +n 4800 3000 m + 8400 3000 l gs col0 s gr +% Polyline +n 8400 3000 m + 8400 5400 l gs col0 s gr +% Polyline +15.000 slw + [15 68] 68 sd +n 4800 3000 m + 4800 5400 l gs col0 s gr [] 0 sd +% Polyline + [15 68] 68 sd +n 4800 5400 m + 8400 5400 l gs col0 s gr [] 0 sd +% Polyline +7.500 slw +gs clippath +2129 5716 m 2095 5666 l 1969 5750 l 2086 5709 l 2002 5800 l cp +eoclip +n 300 6900 m + 2100 5700 l gs col0 s gr gr + +% arrowhead +n 2002 5800 m 2086 5709 l 1969 5750 l col0 s +% Polyline +gs clippath +1230 5010 m 1170 5010 l 1170 5162 l 1200 5042 l 1230 5162 l cp +eoclip +n 1200 7200 m + 1200 5025 l gs col0 s gr gr + +% arrowhead +n 1230 5162 m 1200 5042 l 1170 5162 l col0 s +% Polyline +gs clippath +2415 6330 m 2415 6270 l 2263 6270 l 2383 6300 l 2263 6330 l cp +eoclip +n 225 6300 m + 2400 6300 l gs col0 s gr gr + +% arrowhead +n 2263 6330 m 2383 6300 l 2263 6270 l col0 s +/Times-Roman ff 450.00 scf sf +6900 4350 m +gs 1 -1 sc (6) col0 sh gr +/Times-Roman ff 450.00 scf sf +2700 6900 m +gs 1 -1 sc (0) col0 sh gr +/Times-Roman ff 450.00 scf sf +6900 6900 m +gs 1 -1 sc (1) col0 sh gr +/Times-Roman ff 450.00 scf sf +4950 5250 m +gs 1 -1 sc (3) col0 sh gr +/Times-Roman ff 450.00 scf sf +2700 4350 m +gs 1 -1 sc (4) col0 sh gr +/Times-Roman ff 450.00 scf sf +4500 3000 m +gs 1 -1 sc (5) col0 sh gr +/Times-Roman ff 450.00 scf sf +8550 3000 m +gs 1 -1 sc (7) col0 sh gr +/Times-Roman ff 450.00 scf sf +8550 5250 m +gs 1 -1 sc (2) col0 sh gr +/Times-Italic ff 360.00 scf sf +1800 5700 m +gs 1 -1 sc (y) col0 sh gr +/Times-Italic ff 360.00 scf sf +2175 6600 m +gs 1 -1 sc (x) col0 sh gr +/Times-Italic ff 360.00 scf sf +900 5175 m +gs 1 -1 sc (z) col0 sh gr +% Polyline +15.000 slw + [15 68] 68 sd +n 3000 6600 m + 4800 5400 l gs col0 s gr [] 0 sd +$F2psEnd +rs diff --git a/Old_Packages/Doc23/doc_tex/kernel/IsoCuboid.gif b/Old_Packages/Doc23/doc_tex/kernel/IsoCuboid.gif new file mode 100644 index 00000000000..9ef32143644 Binary files /dev/null and b/Old_Packages/Doc23/doc_tex/kernel/IsoCuboid.gif differ diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Aff_transformation_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Aff_transformation_2.tex new file mode 100644 index 00000000000..ffe32a08094 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Aff_transformation_2.tex @@ -0,0 +1,257 @@ +\begin{ccRefClass}{Aff_transformation_2} + +\ccInclude{CGAL/Aff_transformation_2.h} + +\ccDefinition +The class \ccRefName\ represents two-dimensioanl affine transformations. +The general form of an affine transformation is based on homogeneous +representation of points. Thereby all transformations can be realized by +matrix multiplication. + +Since the general form is based on the homogeneous representation, a +transformation matrix multiplication by a scalar does not change +the represented transformation. Therefore, any transformation represented +by a matrix with rational entries can be represented by a +transformation matrix with integer entries as well by multiplying +the matrix with the common denominator of the rational entries. +Hence it is sufficient to have number type \ccStyle{R::RT} for the entries +of an affine transformation. + +{\cgal} offers several specialized affine transformations. +Different constructors are provided to create them. +They are parameterized with a symbolic name to +denote the transformation type, followed by additional parameters. +The symbolic name tags solve ambiguities in the function +overloading and they make the code more readable, i.e.\ what type +of transformation is created. + +Since two-dimensional points have three +homogeneous coordinates we have a $3\times 3$ matrix ($m_{ij}$). +Following C-style, the indices start at zero. + +If the homogeneous representations are normalized such that the +homogenizing coordinate is 1, then the upper left $2\times 2$ matrix realizes +linear transformations and in the matrix form of a translation, the +translation vector $(v_0,$ $v_1,$ $1)$ appears in the last column of the +matrix. In the normalized case, entry $hw$ is always 1. +Entries $m_{20}$ and $m_{21}$ are always zero and therefore do not appear in +the constructors. + + +\ccCreation +\ccCreationVariable{t} + +\ccConstructor{Aff_transformation_2(const Identity_transformation& );} + {introduces an identity transformation.} + +\ccConstructor{Aff_transformation_2(const Translation, + const Vector_2 &v);} + {introduces a translation by a vector $v$.} + +\ccConstructor{Aff_transformation_2(const Rotation, + const Direction_2 &d, + const R::RT &num, + const R::RT &den = RT(1));} + {approximates the rotation over the angle indicated by direction + $d$, such that the differences between the sines and cosines + of the rotation given by d and the approximating rotation + are at most $num/den$ each. + \ccPrecond $num/den>0$. } + +\ccConstructor{Aff_transformation_2(const Rotation, + const R::RT &sine_rho, + const R::RT &cosine_rho, + const R::RT &hw = RT(1));} + {introduces a rotation by the angle \ccStyle{rho}. + \ccPrecond + \ccTexHtml{$\mbox{\it sine\_rho}^2 + \mbox{\it cosine\_rho}^2 == hw^2$}{sine_rho2 + cosine_rho2 == +hw2}.} + +\ccConstructor{Aff_transformation_2(const Scaling, + const R::RT &s, + const R::RT &hw = RT(1));} + {introduces a scaling by a scale factor $s/hw$.} + +\newsavebox{\arrtwo} +\newsavebox{\arrlintwo} +\newsavebox{\transvectwo} + +\savebox{\arrtwo}{\small $\left(\begin{array}{ccc} + m_{00} & m_{01} & m_{02}\\ + m_{10} & m_{11} & m_{12}\\ + 0 & 0 & hw + \end{array}\right)$} + +\savebox{\arrlintwo}{\small $\left(\begin{array}{cc} + m_{00} & m_{01}\\ + m_{10} & m_{11} + \end{array}\right)$} + +\savebox{\transvectwo}{\small $\left(\begin{array}{c} + m_{02}\\ + m_{12} + \end{array}\right)$} + +\ccConstructor{Aff_transformation_2( + const R::RT &m00, const R::RT &m01, const R::RT &m02, + const R::RT &m10, const R::RT &m11, const R::RT &m12, + const R::RT &hw = RT(1));} + {introduces a general affine transformation in the + \ccTexHtml{$3 \times 3$ matrix form \usebox{\arrtwo}.}% + {3x3 matrix .} + The sub-matrix \ccTexHtml{$1\over hw$\usebox{\arrlintwo}}% + {hw-1 } contains the scaling and rotation + information, the vector \ccTexHtml{$1\over hw$ + \usebox{\transvectwo}}{hw-1 + } + contains the translational part of the transformation.} + +\savebox{\arrtwo}{\small $\left(\begin{array}{ccc} + m_{00} & m_{01} & 0\\ + m_{10} & m_{11} & 0\\ + 0 & 0 & hw + \end{array}\right)$} + +\ccConstructor{Aff_transformation_2( + const R::RT &m00, const R::RT &m01, + const R::RT &m10, const R::RT &m11, + const R::RT &hw = RT(1));} + {introduces a general linear transformation + \ccTexHtml{\usebox{\arrtwo},}{ ,} + i.e.\ there is no translational part.} + + +\ccOperations + +The main thing to do with transformations is to apply them on +geometric objects. Each class \ccStyle{Class_2} representing +a geometric object has a member function: + +\ccStyle{Class_2 transform(Aff_transformation_2 t)}. + + +The transformation classes provide a member function \ccStyle{transform()} +for points, vectors, directions, and lines: + +\ccMethod{Point_2 transform(const Point_2 &p) const;} + {} +\ccGlue +\ccMethod{Vector_2 transform(const Vector_2 &p) const;} + {} +\ccGlue +\ccMethod{Direction_2 transform(const Direction_2 &p) const;} + {} +\ccGlue +\ccMethod{Line_2 transform(const Line_2 &p) const;} + {} + +\cgal\ provides function operators for these member functions: + +\ccMethod{Point_2 operator()(const Point_2 &p) const;} + {} +\ccGlue +\ccMethod{Vector_2 operator()(const Vector_2 &p) const;} + {} +\ccGlue +\ccMethod{Direction_2 operator()(const Direction_2 &p) const;} + {} +\ccGlue +\ccMethod{Line_2 operator()(const Line_2 &p) const;} + {} + +\ccHeading{Miscellaneous} + +\ccMethod{Aff_transformation_2 operator*(const Aff_transformation_2 &s) const;}{composes two affine transformations.} + +\ccMethod{Aff_transformation_2 inverse() const;} + {gives the inverse transformation.} + +%\ccMethod{Aff_transformation_2 transpose() const;} +% {returns the affine transformation defined by transposing +% the linear transformation in \ccVar\ and setting the +% translational part to zero.} + +\ccMethod{bool is_even() const;} + {returns \ccStyle{true}, if the transformation is not reflecting, + i.e.\ the determinant of the involved linear transformation is + non-negative.} + +\ccMethod{bool is_odd() const;} + {returns \ccStyle{true}, if the transformation is reflecting.} + + +%\ccMethod{Aff_transformation_2 general_form() const;} +% {returns the affine transformation in matrix form.} + +The matrix entries of a matrix representation of a +\ccStyle{Aff_transformation_2} +can be accessed trough the following member functions: + +\ccMethod{FT cartesian(int i, int j) const;} + {} +\ccGlue +\ccMethod{FT m(int i, int j) const;} + {returns entry $m_{ij}$ in a matrix representation in which $m_{22}$ is 1.} + +\ccMethod{RT homogeneous(int i, int j) const;} + {} +\ccGlue +\ccMethod{RT hm(int i, int j) const;} + {returns entry $m_{ij}$ in some fixed matrix representation.} + + +For affine transformations no I/O operators are defined. + +%\ccImplementation +%Depending on the constructor we have different internal representations. +%This approach uses less memory and the transformation can be applied +%faster. +% +%Affine transformations offer no \ccStyle{transform()} member function +%for complex objects because they are defined in terms of points vectors and +%directions. As the internal representation of a complex object +%is private the transformation code should go there. + +\ccSeeAlso +\ccc{Identity_transformation}, +\ccc{Rotation}, +\ccc{Scaling}, +\ccc{Translation} \\ +\ccc{rational_rotation_approximation} + +\ccExample + +\begin{cprog} + typedef Cartesian RepClass; + typedef Aff_transformation_2 Transformation; + typedef Point_2 Point; + typedef Vector_2 Vector; + typedef Direction_2 Direction; + + Transformation rotate(ROTATION, sin(pi), cos(pi)); + Transformation rational_rotate(ROTATION,Direction(1,1), 1, 100); + Transformation translate(TRANSLATION, Vector(-2, 0)); + Transformation scale(SCALING, 3); + + Point q(0, 1); + q = rational_rotate(q); + + Point p(1, 1); + + p = rotate(p); + + p = translate(p); + + p = scale(p); +\end{cprog} + +The same would have been achieved with + +\begin{cprog} + + Transformation transform = scale * (translate * rotate); + p = transform(Point(1.0, 1.0)); +\end{cprog} +\end{ccRefClass} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Aff_transformation_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Aff_transformation_3.tex new file mode 100644 index 00000000000..9e00f5dd9b7 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Aff_transformation_3.tex @@ -0,0 +1,188 @@ +\begin{ccRefClass}{Aff_transformation_3} +\ccInclude{CGAL/Aff_transformation_3.h} + +\ccDefinition +The class \ccRefName\ represents three-dimensioanl affine transformations. +The general form of an affine transformation is based on homogeneous +representation of points. Thereby all transformations can be realized by +matrix multiplication. + +Since the general form is based on the homogeneous representation, a +transformation matrix multiplication by a scalar does not change +the represented transformation. Therefore, any transformation represented +by a matrix with rational entries can be represented by a +transformation matrix with integer entries as well by multiplying +the matrix with the common denominator of the rational entries. +Hence it is sufficient to have number type \ccStyle{R::RT} for the entries +of an affine transformation. + +{\cgal} offers several specialized affine transformations. +Different constructors are provided to create them. +They are parameterized with a symbolic name to +denote the transformation type, followed by additional parameters. +The symbolic name tags solve ambiguities in the function +overloading and they make the code more readable, i.e.\ what type +of transformation is created. + +In three-dimensional space we have a $4\times 4$ matrix ($m_{ij}$). +Entries $m_{30}$, $m_{31}$, and $m_{32}$ are always zero and +therefore do not appear in the constructors. + +\ccCreation +\ccCreationVariable{t} + +\ccConstructor{Aff_transformation_3(const Identity_transformation& );} + {introduces an identity transformation.} + + +\ccConstructor{Aff_transformation_3(const Translation, + const Vector_3 &v);} + {introduces a translation by a vector $v$.} + +\ccConstructor{Aff_transformation_3(const Scaling, + const R::RT &s, + const R::RT &hw = RT(1));} + {introduces a scaling by a scale factor $s/hw$.} + +\newsavebox{\arrthree} +\newsavebox{\arrlinthree} +\newsavebox{\transvecthree} + +\savebox{\arrthree}{\small $\left(\begin{array}{cccc} + m_{00} & m_{01} & m_{02} & m_{03}\\ + m_{10} & m_{11} & m_{12} & m_{13}\\ + m_{20} & m_{21} & m_{22} & m_{23}\\ + 0 & 0 & 0 & hw + \end{array}\right)$} + +\savebox{\arrlinthree}{\small $\left(\begin{array}{ccc} + m_{00} & m_{01} & m_{02}\\ + m_{10} & m_{11} & m_{12}\\ + m_{20} & m_{21} & m_{22}\\ + \end{array}\right)$} + +\savebox{\transvecthree}{\small $\left(\begin{array}{c} + m_{03}\\ + m_{13}\\ + m_{23} + \end{array}\right)$} + +\ccConstructor{Aff_transformation_3( + const R::RT &m00, const R::RT &m01, const R::RT &m02, const R::RT &m03, + const R::RT &m10, const R::RT &m11, const R::RT &m12, const R::RT &m13, + const R::RT &m20, const R::RT &m21, const R::RT &m22, const R::RT &m23, + const R::RT &hw = RT(1));} + {introduces a general affine transformation of the matrix + form \ccTexHtml{\usebox{\arrthree}.}{ .} The part \ccTexHtml{$1\over hw$ + \usebox{\arrlinthree}}{hw-1 + } + defines the scaling and rotational part of the transformation, + while the vector \ccTexHtml{$1\over hw$\usebox{\transvecthree}}% + {hw-1 } contains the translational part.} + +\savebox{\arrthree}{\small $\left(\begin{array}{cccc} + m_{00} & m_{01} & m_{02} & 0\\ + m_{10} & m_{11} & m_{12} & 0\\ + m_{20} & m_{21} & m_{22} & 0\\ + 0 & 0 & 0 &hw + \end{array}\right)$} + +\ccConstructor{Aff_transformation_3( + const R::RT &m00, const R::RT &m01, const R::RT& m02, + const R::RT &m10, const R::RT &m11, const R::RT& m12, + const R::RT &m20, const R::RT &m21, const R::RT& m22, + const R::RT &hw = RT(1));} + {introduces a general linear transformation of the + matrix form \ccTexHtml{\usebox{\arrthree},}{ ,} i.e.\ an affine transformation without + translational part.} + + +\ccOperations + +Each class \ccStyle{Class_3} representing +a geometric object in 3D has a member function: + +\ccStyle{Class_3 transform(Aff_transformation_3 t)}. + + +The transformation classes provide a member function \ccStyle{transform()} +for points, vectors, directions, and planes: + +\ccMethod{Point_3 transform(const Point_3 &p) const;} + {} +\ccGlue +\ccMethod{Vector_3 transform(const Vector_3 &p) const;} + {} +\ccGlue +\ccMethod{Direction_3 transform(const Direction_3 &p) const;} + {} +\ccGlue +\ccMethod{Plane_3 transform(const Plane_3 &p) const;} + {} + +\cgal\ provides four function operators for these member functions: + +\ccMethod{Point_3 operator()(const Point_3 &p) const;} + {} +\ccGlue +\ccMethod{Vector_3 operator()(const Vector_3 &p) const;} + {} +\ccGlue +\ccMethod{Direction_3 operator()(const Direction_3 &p) const;} + {} +\ccGlue +\ccMethod{Plane_3 operator()(const Plane_3 &p) const;} + {} + + +\ccMethod{Aff_transformation_3 + operator*(const Aff_transformation_3 &s) const;} + {composes two affine transformations.} + +\ccMethod{Aff_transformation_3 inverse() const;} + {gives the inverse transformation.} + +%\ccMethod{Aff_transformation_3 transpose() const;} +% {returns the affine transformation defined by transposing +% the linear transformation in \ccVar\ and setting the +% translational part to zero.} + +\ccMethod{bool is_even() const;} + {returns \ccStyle{true}, if the transformation is not reflecting, + i.e.\ the determinant of the involved linear transformation is + non-negative.} + +\ccMethod{bool is_odd() const;} + {returns \ccStyle{true}, if the transformation is reflecting.} + + +%\ccMethod{Aff_transformation_3 general_form() const;} +% {returns the affine transformation in matrix form.} + +The matrix entries of a matrix representation of a \ccStyle{Aff_transformation_3} +can be accessed trough the following member functions: + +\ccMethod{FT cartesian(int i, int j) const;} + {} +\ccGlue +\ccMethod{FT m(int i, int j) const;} + {returns entry $m_{ij}$ in a matrix representation in which $m_{33}$ is 1.} + +\ccMethod{RT homogeneous(int i, int j) const;} + {} +\ccGlue +\ccMethod{RT hm(int i, int j) const;} + {returns entry $m_{ij}$ in some fixed matrix representation.} + +For affine transformations no I/O operators are defined. + +\ccSeeAlso +\ccc{Identity_transformation}, +\ccc{Scaling}, +\ccc{Translation} + + +\end{ccRefClass} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Bbox_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Bbox_2.tex new file mode 100644 index 00000000000..72ded213b06 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Bbox_2.tex @@ -0,0 +1,38 @@ +\begin{ccRefClass} {Bbox_2} +\ccInclude{CGAL/Bbox_2.h} + +\ccDefinition An object \ccStyle{b} of the class \ccRefName\ is a bounding +box in the two-dimensional Euclidean plane $\E^2$. This class is not templated. + +\ccCreation +\ccCreationVariable{b} + +\ccConstructor{Bbox_2(double x_min, double y_min, + double x_max, double y_max);} + {introduces a bounding box \ccVar\ with lower left corner at + \ccStyle{(xmin, ymin)} and with upper right corner at + \ccStyle{(xmax, ymax)}.} + + +\ccOperations + +\ccHidden\ccMethod{bool operator==(const Bbox_2 &c) const;} + {Test for equality.} + +\ccHidden\ccMethod{bool operator!=(const Bbox_2 &q) const;} + {Test for inequality.} + +\ccMethod{double xmin() const;}{} +\ccGlue +\ccMethod{double ymin() const;}{} +\ccGlue +\ccMethod{double xmax() const;}{} +\ccGlue +\ccMethod{double ymax() const;}{} + +\ccMethod{Bbox_2 operator+(const Bbox_2 &c) const;} + {returns a bounding box of \ccVar\ and \ccStyle{c}.} + +\ccSeeAlso +\ccc{do_overlap} +\end{ccRefClass} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Bbox_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Bbox_3.tex new file mode 100644 index 00000000000..c88738bf90a --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Bbox_3.tex @@ -0,0 +1,51 @@ +\begin{ccRefClass} {Bbox_3} +\ccInclude{CGAL/Bbox_3.h} + +\ccDefinition An object \ccStyle{b} of the class \ccRefName\ is a bounding +box in the three-dimensional Euclidean space $\E^3$. + +\ccCreation +\ccCreationVariable{b} + + +\ccConstructor{Bbox_3(double x_min, double y_min, double z_min, + double x_max, double y_max, double z_max);} + {introduces a bounding box \ccVar\ with lexicographically + smallest corner point at \ccStyle{(xmin, ymin, zmin)} + lexicographically largest corner point at + \ccStyle{(xmax, ymax, zmax)}.} + + +\ccOperations + +\ccHidden\ccMethod{bool operator==(const Bbox_3 &c) const;} + {Test for equality.} + +\ccHidden\ccMethod{bool operator!=(const Bbox_3 &q) const;} + {Test for inequality.} + +\ccMethod{double xmin() const;} + {} +\ccGlue +\ccMethod{double ymin() const;} + {} +\ccGlue +\ccMethod{double zmin() const;} + {} +\ccGlue +\ccMethod{double xmax() const;} + {} +\ccGlue +\ccMethod{double ymax() const;} + {} +\ccGlue +\ccMethod{double zmax() const;} + {} + + +\ccMethod{Bbox_3 operator+(const Bbox_3 &c) const;} + {returns a bounding box of \ccVar\ and \ccStyle{c}.} + +\ccSeeAlso +\ccc{do_overlap} +\end{ccRefClass} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Bounded_side.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Bounded_side.tex new file mode 100644 index 00000000000..d87c2b816da --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Bounded_side.tex @@ -0,0 +1,20 @@ +\begin{ccRefEnum}{Bounded_side} +\ccInclude{CGAL/enum.h} + +\ccGlobalEnum{enum Bounded_side {ON_UNBOUNDED_SIDE, ON_BOUNDARY, ON_BOUNDED_SIDE}; +} + +\ccRefLabel{ON_UNBOUNDED_SIDE} %% add label for table-of-contents in intro.tex. +\ccRefLabel{ON_BOUNDED_SIDE} %% add label for table-of-contents in intro.tex. +\ccRefLabel{ON_BOUNDARY} %% add label for table-of-contents in intro.tex. +\ccHtmlCrossLink{ON_UNBOUNDED_SIDE} %% add further rules for cross referencing links +\ccHtmlCrossLink{ON_BOUNDED_SIDE} %% add further rules for cross referencing links +\ccHtmlCrossLink{ON_BOUNDARY} %% add further rules for cross referencing links +\ccHtmlIndexC[enum_tags]{ON_UNBOUNDED_SIDE} %% add further index entries +\ccHtmlIndexC[enum_tags]{ON_BOUNDED_SIDE} %% add further index entries +\ccHtmlIndexC[enum_tags]{ON_BOUNDARY} %% add further index entries + +\ccSeeAlso +\ccc{Kernel::Has_on_bounded_side_2}, +\ccc{Kernel::Has_on_bounded_side_3} +\end{ccRefEnum} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/CLOCKWISE.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/CLOCKWISE.tex new file mode 100644 index 00000000000..878359ffbc8 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/CLOCKWISE.tex @@ -0,0 +1,7 @@ +\begin{ccRefConstant}{CLOCKWISE} +\ccGlobalVariable{const Orientation CLOCKWISE = NEGATIVE;} + +\ccSeeAlso +\ccc{COUNTERCLOCKWISE}, +\ccc{COLLINEAR} +\end{ccRefConstant} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/COLLINEAR.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/COLLINEAR.tex new file mode 100644 index 00000000000..29bbeb7afd9 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/COLLINEAR.tex @@ -0,0 +1,7 @@ +\begin{ccRefConstant}{COLLINEAR} +\ccGlobalVariable{const Orientation COLLINEAR = ZERO;} + +\ccSeeAlso +\ccc{CLOCKWISE}, +\ccc{COUNTERCLOCKWISE} +\end{ccRefConstant} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/COPLANAR.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/COPLANAR.tex new file mode 100644 index 00000000000..47de0dd830b --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/COPLANAR.tex @@ -0,0 +1,7 @@ +\begin{ccRefConstant}{COPLANAR} +\ccGlobalVariable{const Orientation COPLANAR = ZERO;} + +\ccSeeAlso +\ccc{NEGATIVE}, +\ccc{POSITIVE} +\end{ccRefConstant} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/COUNTERCLOCKWISE.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/COUNTERCLOCKWISE.tex new file mode 100644 index 00000000000..dee79903212 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/COUNTERCLOCKWISE.tex @@ -0,0 +1,3 @@ +\begin{ccRefConstant}{COUNTERCLOCKWISE} +\ccGlobalVariable{const Orientation COUNTERCLOCKWISE = POSITIVE;} +\end{ccRefConstant} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Cartesian.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Cartesian.tex new file mode 100644 index 00000000000..32f734c0e0a --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Cartesian.tex @@ -0,0 +1,21 @@ +\begin{ccRefClass}{Cartesian} +\ccInclude{CGAL/Cartesian.h} + +\ccDefinition +A model for a \ccc{Kernel} using Cartesian coordinates to represent the +geometric objects. + +\ccRefines +\ccc{Kernel} + +\ccTypes +\ccTypedef{typedef FieldNumberType FT;}{} +\ccGlue +\ccTypedef{typedef FieldNumberType RT;}{} + +\ccImplementation +This model of a kernel uses reference counting. + +\ccSeeAlso +\ccc{Simple_cartesian}, \ccc{Homogeneous} +\end{ccRefClass} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Circle_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Circle_2.tex new file mode 100644 index 00000000000..90fc5de1bff --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Circle_2.tex @@ -0,0 +1,164 @@ +\begin{ccRefClass}{Circle_2} +\ccInclude{CGAL/Circle_2.h} + +\ccDefinition + +An object of type \ccRefName\ is a circle in the +two-dimensional Euclidean plane $\E^2$. The circle is oriented, i.e.\ +its boundary has clockwise or counterclockwise \ccHtmlNoLinksFrom{orientation}. The +boundary splits $\E^2$ into a positive and a negative side, where the +positive side is to the left of the boundary. The boundary further +splits $\E^2$ into a bounded and an unbounded side. Note that the +circle can be degenerated, i.e.\ the squared radius may be zero. + + +% ----------------------------------------------------------------------------- +\ccCreation +\ccCreationVariable{c} + +\ccHidden +\ccConstructor{ Circle_2( );}{ + introduces an uninitialized variable \ccVar\ of type + \ccClassTemplateName.} + +\ccConstructor{ Circle_2( Point_2 const& center, + R::FT const& squared_radius, + Orientation const& ori = COUNTERCLOCKWISE);}{ + introduces a variable \ccVar\ of type \ccClassTemplateName. + It is initialized to the circle with center \ccc{center}, + squared radius \ccc{squared_radius} and \ccHtmlNoLinksFrom{orientation} + \ccc{ori}. + \ccPrecond \ccc{ori} $\neq$ \ccc{COLLINEAR}, and further, + \ccc{squared_radius} $\geq$ 0.} + +\ccConstructor{ Circle_2( Point_2 const& p, + Point_2 const& q, + Point_2 const& r);}{ + introduces a variable \ccVar\ of type \ccClassTemplateName. + It is initialized to the unique circle which passes through + the points \ccc{p}, \ccc{q} and \ccc{r}. The \ccHtmlNoLinksFrom{orientation} of + the circle is the \ccHtmlNoLinksFrom{orientation} of the point triple \ccc{p}, + \ccc{q}, \ccc{r}. + \ccPrecond \ccc{p}, \ccc{q}, and \ccc{r} are not collinear.} + +\ccConstructor{ Circle_2( Point_2 const& p, + Point_2 const& q, + Orientation const& ori + = COUNTERCLOCKWISE);}{ + introduces a variable \ccVar\ of type \ccClassTemplateName. + It is initialized to the circle with diameter + $\ccTexHtml{\overline{pq}}{pq}$ + and \ccHtmlNoLinksFrom{orientation} \ccc{ori}. + \ccPrecond \ccc{ori} $\neq$ \ccc{COLLINEAR}.} + +\ccConstructor{ Circle_2( Point_2 const& center, + Orientation const& ori + = COUNTERCLOCKWISE);}{ + introduces a variable \ccVar\ of type \ccClassTemplateName. + It is initialized to the circle with center \ccc{center}, squared + radius zero and \ccHtmlNoLinksFrom{orientation} \ccc{ori}. + \ccPrecond \ccc{ori} $\neq$ \ccc{COLLINEAR}. + \ccPostcond \ccVar.\ccc{is_degenerate()} = \ccc{true}.} + +\ccHidden +\ccConstructor{ Circle_2( Circle_2 const&);}{ + copy constructor.} + +\ccHidden +\ccMemberFunction{ Circle_2& operator = ( Circle_2 const&);}{ + assignment.} + +% ----------------------------------------------------------------------------- +\ccAccessFunctions + +\ccMemberFunction{Point_2 const& center( ) const;}{ + returns the center of \ccVar.} +\ccGlue +\ccMemberFunction{ R::FT const& squared_radius( ) const;}{ + returns the squared radius of \ccVar.} +\ccGlue +\ccMemberFunction{ Orientation const& orientation( ) const;}{ + returns the \ccHtmlNoLinksFrom{orientation} of \ccVar.} + +% ----------------------------------------------------------------------------- + +\ccHidden\ccMemberFunction{ bool operator == ( Circle_2 const& circle2) const;}{ + returns \ccc{true}, iff \ccVar\ and \ccc{circle2} are equal, + i.e.\ if they have the same center, same squared radius and + same \ccHtmlNoLinksFrom{orientation}.} + +\ccHidden\ccMemberFunction{ bool operator != ( Circle_2 const& circle2) const;}{ + returns \ccc{true}, iff \ccVar\ and \ccc{circle2} are not equal.} + +% ----------------------------------------------------------------------------- +\ccPredicates + +\ccMemberFunction{ bool is_degenerate( ) const;}{ + returns \ccc{true}, iff \ccVar\ is degenerate, i.e.\ + if \ccVar\ has squared radius zero.} + +\ccMemberFunction{ Oriented_side + oriented_side( Point_2 const& p) const;}{ + returns either the constant \ccc{ON_ORIENTED_BOUNDARY}, + \ccc{ON_POSITIVE_SIDE}, or \ccc{ON_NEGATIVE_SIDE}, + iff \ccc{p} lies on the boundary, properly on the + positive side, or properly on the negative side + of \ccVar, resp.} + +\ccMemberFunction{ Bounded_side + bounded_side( Point_2 const& p) const;}{ + returns \ccc{ON_BOUNDED_SIDE}, + \ccc{ON_BOUNDARY}, or \ccc{ON_UNBOUNDED_SIDE} + iff \ccc{p} lies properly inside, on the boundary, or properly + outside of \ccVar, resp.} + +%\ccMemberFunction{ bool has_on_positive_side( Point const& p) const;}{ +% returns \ccc{true}, iff \ccc{p} lies properly on the +% positive side of \ccVar.} +% +%\ccMemberFunction{ bool has_on_negative_side( Point const& p) const;}{ +% returns \ccc{true}, iff \ccc{p} lies properly on the +% negative side of \ccVar.} +% +%\ccMemberFunction{ bool has_on_boundary( Point const& p) const;}{ +% returns \ccc{true}, iff \ccc{p} lies on the boundary +% of \ccVar.} +% +%\ccMemberFunction{ bool has_on_bounded_side( Point const& p) const;}{ +% returns \ccc{true}, iff \ccc{p} lies properly inside \ccVar.} +% +%\ccMemberFunction{ bool +% has_on_unbounded_side( Point const& p) const;}{ +% returns \ccc{true}, iff \ccc{p} lies properly outside of \ccVar.} +\ccMethod{bool has_on_positive_side(const Point_2 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_negative_side(const Point_2 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_boundary(const Point_2 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_bounded_side(const Point_2 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_unbounded_side(const Point_2 &p) const;} + {} + +% ----------------------------------------------------------------------------- +\ccHeading{Miscellaneous} + +\ccMemberFunction{ Circle_2 opposite() const;}{ + returns the circle with the same center and squared radius as + \ccVar\, but with \ccHtmlNoLinksFrom{opposite} \ccHtmlNoLinksFrom{orientation}.} + + +\ccMemberFunction{ Circle_2 orthogonal_transform( + Aff_transformation_2 const& at) const;}{ + returns the circle obtained by applying $at$ on \ccVar. + \ccPrecond \ccc{at} is an orthogonal transformation.} + +\ccMemberFunction{ Bbox_2 bbox() const;}{ + returns a bounding box containing \ccVar.} + +\end{ccRefClass} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Comparison_result.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Comparison_result.tex new file mode 100644 index 00000000000..319226f9de2 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Comparison_result.tex @@ -0,0 +1,17 @@ +\begin{ccRefEnum}{Comparison_result} +\ccInclude{CGAL/enum.h} + +\ccGlobalEnum{enum Comparison_result { SMALLER, EQUAL, LARGER };} + +\ccRefLabel{SMALLER} +\ccRefLabel{EQUAL} +\ccRefLabel{LARGER} +\ccHtmlCrossLink{SMALLER} +\ccHtmlCrossLink{EQUAL} +\ccHtmlCrossLink{LARGER} +\ccHtmlIndexC[enum_tags]{SMALLER} +\ccHtmlIndexC[enum_tags]{EQUAL} +\ccHtmlIndexC[enum_tags]{LARGER} + +\end{ccRefEnum} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/DEGENERATE.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/DEGENERATE.tex new file mode 100644 index 00000000000..f368b7d6125 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/DEGENERATE.tex @@ -0,0 +1,3 @@ +\begin{ccRefConstant}{DEGENERATE} +\ccGlobalVariable{const Orientation DEGENERATE = ZERO;} +\end{ccRefConstant} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Direction_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Direction_2.tex new file mode 100644 index 00000000000..7987b4c1a37 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Direction_2.tex @@ -0,0 +1,99 @@ +\begin{ccRefClass} {Direction_2} +\ccInclude{CGAL/Direction_2.h} + +\ccDefinition +An object of the class \ccRefName\ is a vector in the two-dimensional +vector space $\R^2$ where we forget about its length. They can be +viewed as unit vectors, although there is no normalization internally, +since this is error prone. Directions are used whenever the length of +a vector does not matter. +They also characterize a set of parallel oriented lines that have the same +orientations. +For example, you can ask for the direction +orthogonal to an oriented plane, or the direction of an oriented line. +Further, they can be used to indicate angles. The slope of a direction +is \ccStyle{dy()/dx()}. + + +\ccCreation +\ccCreationVariable{d} + + +\ccHidden \ccConstructor{Direction_2();} + {introduces an uninitialized direction \ccVar.} + +\ccHidden \ccConstructor{Direction_2(const Direction_2 &d);} + {copy constructor.} + +\ccConstructor{Direction_2(const Vector_2 &v);} + {introduces the direction \ccVar\ of vector $v$.} + +\ccConstructor{Direction_2(const R::RT &x, const R::RT &y);} + {introduces a direction \ccVar\ passing through the origin + and the point with Cartesian coordinates $(x, y)$.} + + +\ccOperations +%\ccSetTwoOfThreeColumns{5cm}{4cm} +\ccSetThreeColumns{Direction_2 & }{}{\hspace*{7.8cm}} + +\ccHidden \ccMethod{Direction_2 & operator=(const Direction_2 &e);} + {Assignment.} + +\ccMethod{R::RT delta(int i) const;} + {returns values, such that \ccVar \ccc{== Direction_2(delta(0),delta(1))}. + \ccPrecond: $0 \leq i \leq 1$.} + +\ccMethod{R::RT dx() const;} + {returns \ccc{delta(0)}.} + +\ccMethod{R::RT dy() const;} + {returns \ccc{delta(1)}.} + +There is a total order on directions. We compare the angles between the +positive $x$-axis and the directions in counterclockwise order. + +\ccMethod{bool operator==(const Direction_2 &e) const;} + {} +\ccGlue +\ccMethod{bool operator!=(const Direction_2 &e) const;} + {} +\ccGlue +\ccMethod{bool operator<(const Direction_2 &e) const;} + {} +\ccGlue +\ccMethod{bool operator>(const Direction_2 &e) const;} + {} +\ccGlue +\ccMethod{bool operator<=(const Direction_2 &e) const;} + {} +\ccGlue +\ccMethod{bool operator>=(const Direction_2 &e) const;} + {} + +Furthermore, we have + +\ccMethod{bool counterclockwise_in_between(const Direction_2 &d1, + const Direction_2 &d2) const;} + {returns true, iff \ccVar\ is not equal to \ccc{d1}, and + while rotating counterclockwise starting at \ccc{d1}, + \ccVar\ is reached strictly before \ccc{d2} is reached. + Note that true is returned if \ccc{d1} == \ccc{d2}, unless + also \ccVar\ == \ccc{d1}. + } + + +\ccMethod{Direction_2 operator-() const;} + {The direction opposite to \ccVar.} + +\ccHeading{Miscellaneous} + +\ccMethod{Vector_2 vector() const;} + {returns a vector that has the same direction as \ccVar.} + +\ccMethod{Direction_2 transform(const Aff_transformation_2 &t) const;} + {returns the direction obtained by applying $t$ on \ccVar.} + + +\end{ccRefClass} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Direction_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Direction_3.tex new file mode 100644 index 00000000000..5f276c474de --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Direction_3.tex @@ -0,0 +1,75 @@ +\begin{ccRefClass}{Direction_3} +\ccInclude{CGAL/Direction_3.h} + +\ccDefinition +An object of the class \ccRefName\ is a vector in the three-dimensional +vector space $\R^3$ where we forget about their length. They can be +viewed as unit vectors, although there is no normalization internally, +since this is error prone. Directions are used whenever the length of +a vector does not matter. +They also characterize a set of parallel lines that have the same orientation +or the direction normal to parallel planes that have the same orientation. +For example, you can ask for the direction +orthogonal to an oriented plane, or the direction of an oriented line. + + +\ccCreation +\ccCreationVariable{d} + + +\ccHidden \ccConstructor{Direction_3();} + {introduces an uninitialized direction \ccVar.} + +\ccHidden \ccConstructor{Direction_3(const Direction_3 &d);} + {copy constructor.} + +\ccConstructor{Direction_3(const Vector_3 &v);} + {introduces a direction \ccVar\ initialised with the + direction of vector $v$.} + +\ccConstructor{Direction_3(const R::RT &x, const R::RT &y, const R::RT &z);} + {introduces a direction \ccVar\ initialised with the direction + from the origin to the point with Cartesian coordinates $(x, y, z)$.} + + +\ccOperations +%\ccSetTwoOfThreeColumns{5cm}{4cm} +\ccSetThreeColumns{Direction_3 & }{}{\hspace*{7.8cm}} + +\ccHidden \ccMethod{Direction_3 & operator=(const Direction_3 &e);} + {Assignment.} + +\ccMethod{R::RT delta(int i) const;} + {returns values, such that \ccVar \ccc{== Direction_2(delta(0),delta(1),delta(2))}. + \ccPrecond: $0 \leq i \leq 2$.} + +\ccMethod{R::RT dx() const;} + {returns \ccc{delta(0)}.} +\ccGlue +\ccMethod{R::RT dy() const;} + {returns \ccc{delta(1)}.} +\ccGlue +\ccMethod{R::RT dz() const;} + {returns \ccc{delta(2)}.} + + +\ccMethod{bool operator==(const Direction_3 &e) const;} + {Test for equality.} +\ccGlue +\ccMethod{bool operator!=(const Direction_3 &e) const;} + {Test for inequality.} + + +\ccMethod{Direction_3 operator-() const;} + {The direction opposite to \ccVar.} + +\ccMethod{Vector_3 vector() const;} + {returns a vector that has the same direction as \ccVar.} + +\ccMethod{Direction_3 transform(const Aff_transformation_3 &t) const;} + {returns the direction obtained by applying $t$ on \ccVar.} + + + +\end{ccRefClass} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/FieldNumberType.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/FieldNumberType.tex new file mode 100644 index 00000000000..dd29074b8d7 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/FieldNumberType.tex @@ -0,0 +1,11 @@ +\begin{ccRefConcept}{FieldNumberType} + +A number type representing field elements, i.e., must be closed under +operations $+$, $-$, $*$ and also under division operation $/$. + +\ccRefines +\ccc{CopyConstructable}, \ccc{Assignable}, \ccc{RingNumberType} + +\ccSeeAlso +\ccc{Kernel}, \ccc{R} +\end{ccRefConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Homogeneous.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Homogeneous.tex new file mode 100644 index 00000000000..d4d746df198 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Homogeneous.tex @@ -0,0 +1,22 @@ +\begin{ccRefClass}{Homogeneous} +\ccInclude{CGAL/Homogeneous.h} + +\ccDefinition +A model for a \ccc{Kernel} using homogeneous coordinates to represent the +geometric objects. + +\ccRefines +\ccc{Kernel} + +\ccTexHtml{\ccSetThreeColumns{typedef Quotient}{}{\hspace*{8.5cm}}}{} +\ccTypes +\ccTypedef{typedef Quotient FT;}{} +\ccGlue +\ccTypedef{typedef RingNumberType RT;}{} + +\ccImplementation +This model of a kernel uses reference counting. + +\ccSeeAlso +\ccc{Cartesian}, \ccc{Simple_cartesian} +\end{ccRefClass} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Identity_transformation.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Identity_transformation.tex new file mode 100644 index 00000000000..370ebf6d6b3 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Identity_transformation.tex @@ -0,0 +1,10 @@ +\begin{ccRefClass}{Identity_transformation} +\ccInclude{CGAL/aff_transformation_tags.h} + +\ccDefinition +Tag class for affine transformations. + +\ccSeeAlso +\ccc{Aff_transformation_2}, +\ccc{Aff_transformation_3} +\end{ccRefClass} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Iso_cuboid_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Iso_cuboid_3.tex new file mode 100644 index 00000000000..596b5ad07b5 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Iso_cuboid_3.tex @@ -0,0 +1,119 @@ +\begin{ccRefClass} {Iso_cuboid_3} +\ccInclude{CGAL/Iso_cuboid_3.h} + +\ccDefinition An object $s$ of the data type \ccRefName\ is a +cuboid in the Euclidean plane $\E^3$ with sides parallel to the $x$ and +$y$ axis of the coordinate system. + +Although they are represented in a canonical form by only two +vertices, namely the lexicographically smallest and largest vertex +with respect to Cartesian $xyz$ coordinates, we provide +functions for ``accessing'' the other vertices as well. + +Iso-oriented cuboids and bounding boxes are quite similar. The +difference however is that bounding boxes have always double coordinates, +whereas the coordinate type of an iso-oriented cuboid is chosen by +the user. + + +\ccCreation +\ccCreationVariable{c} + + +\ccHidden \ccConstructor{Iso_cuboid_3();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Iso_cuboid_3(const Iso_cuboid_3 &u);} + {copy constructor.} + +\ccConstructor{Iso_cuboid_3(const Point_3 &p, + const Point_3 &q);} + {introduces an iso-oriented cuboid \ccVar\ with diagonal + opposite vertices $p$ and $q$. Note that the object is + brought in the canonical form.} + + +\ccOperations +\ccHidden \ccMethod{Iso_cuboid_3 & operator=(const Iso_cuboid_3 &q);} + {Assignment.} + +\ccMethod{bool operator==(const Iso_cuboid_3 &c2) const;} + {Test for equality: two iso-oriented cuboid are equal, iff their + lower left and their upper right vertices are equal.} + +\ccMethod{bool operator!=(const Iso_cuboid_3 &c2) const;} + {Test for inequality.} + +\ccMethod{Point_3 vertex(int i) const;} + {returns the i'th vertex modulo 8 of \ccVar. + starting with the lower left vertex.} + +\ccMethod{Point_3 operator[](int i) const;} + {returns \ccStyle{vertex(i)}, as indicated in the figure below: + \lcTex{\epsfxsize=6cm\epsffile{IsoCuboid.eps}}} + +\begin{ccHtmlOnly} +
+vertex order of an iso-cuboid +
+\end{ccHtmlOnly} + + +\ccMethod{Point_3 min() const;} + {returns the smallest vertex of \ccVar\ (= \ccStyle{vertex(0)}).} + + +\ccMethod{Point_3 max() const;} + {returns the largest vertex of \ccVar\ (= \ccStyle{vertex(7)}).} +\ccMethod{ FT xmin() const;}{returns smallest Cartesian $x$-coordinate in \ccVar.} +\ccGlue +\ccMethod{ FT ymin() const;}{returns smallest Cartesian $y$-coordinate in \ccVar.} +\ccGlue +\ccMethod{ FT zmin() const;}{returns smallest Cartesian $z$-coordinate in \ccVar.} +\ccGlue +\ccMethod{ FT xmax() const;}{returns largest Cartesian $x$-coordinate in \ccVar.} +\ccGlue +\ccMethod{ FT ymax() const;}{returns largest Cartesian $y$-coordinate in \ccVar.} +\ccGlue +\ccMethod{ FT zmax() const;}{returns largest Cartesian $z$-coordinate in \ccVar.} + +\ccPredicates + +\ccMethod{bool is_degenerate() const;} + {%the iso-oriented cuboid + \ccVar\ is degenerate, if all vertices + are collinear.} + +\ccMethod{Bounded_side bounded_side(const Point_3 &p) const;} + {returns either \ccStyle{ON_UNBOUNDED_SIDE}, + \ccStyle{ON_BOUNDED_SIDE}, or the constant + \ccStyle{ON_BOUNDARY}, + depending on where point $p$ is.} + +\ccMethod{bool has_on_boundary(const Point_3 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_bounded_side(const Point_3 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_unbounded_side(const Point_3 &p) const;} + {} + +\ccHeading{Miscellaneous} + +\ccMethod{Bbox bbox() const;} + {returns a bounding box containing \ccVar. } + +\ccMethod{Iso_cuboid_3 transform(const Aff_transformation_3 &t) const;} + {returns the iso-oriented cuboid obtained by applying $t$ on + the smallest and the largest of \ccVar. + \ccPrecond The angle at a rotation must be a multiple of $\pi/2$, + otherwise the resulting cuboid does not have the same size. + Note that rotating about an arbitrary angle can even result in + a degenerate iso-oriented cuboid.} + + + + + +\end{ccRefClass} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Iso_rectangle_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Iso_rectangle_2.tex new file mode 100644 index 00000000000..8b063efa16c --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Iso_rectangle_2.tex @@ -0,0 +1,99 @@ +\begin{ccRefClass} {Iso_rectangle_2} +\ccInclude{CGAL/Iso_rectangle_2.h} + +\ccDefinition An object $s$ of the data type \ccRefName\ is a +rectangle in the Euclidean plane $\E^2$ with sides parallel to the $x$ and +$y$ axis of the coordinate system. + +Although they are represented in a canonical form by only two +vertices, namely the lower left and the upper right vertex, we provide +functions for ``accessing'' the other vertices as well. The vertices +are returned in counterclockwise order. + +Iso-oriented rectangles and bounding boxes are quite similar. The +difference however is that bounding boxes have always double coordinates, +whereas the coordinate type of an iso-oriented rectangle is chosen by +the user. + +\ccCreation +\ccCreationVariable{r} + + +\ccHidden \ccConstructor{Iso_rectangle_2();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Iso_rectangle_2(const Iso_rectangle_2 &u);} + {copy constructor.} + +\ccConstructor{Iso_rectangle_2(const Point_2 &p, + const Point_2 &q);} + {introduces an iso-oriented rectangle \ccVar\ with diagonal + opposite vertices $p$ and $q$. Note that the object is + brought in the canonical form.} + + +\ccOperations +\ccHidden \ccMethod{Iso_rectangle_2 & operator=(const Iso_rectangle_2 &q);} + {Assignment.} + +\ccMethod{bool operator==(const Iso_rectangle_2 &r2) const;} + {Test for equality: two iso-oriented rectangles are equal, iff their + lower left and their upper right vertices are equal.} + +\ccMethod{bool operator!=(const Iso_rectangle_2 &r2) const;} + {Test for inequality.} + +\ccMethod{Point_2 vertex(int i) const;} + {returns the i'th vertex modulo 4 of \ccVar\ in counterclockwise order, + starting with the lower left vertex.} + +\ccMethod{Point_2 operator[](int i) const;} + {returns \ccStyle{vertex(i)}.} + +\ccMethod{Point_2 min() const;} + {returns the lower left vertex of \ccVar\ (= \ccStyle{vertex(0)}).} + + +\ccMethod{Point_2 max() const;} + {returns the upper right vertex of \ccVar\ (= \ccStyle{vertex(2)}).} + +\ccPredicates + +\ccMethod{bool is_degenerate() const;} + {%the iso-oriented rectangle + \ccVar\ is degenerate, if all vertices + are collinear.} + +\ccMethod{Bounded_side bounded_side(const Point_2 &p) const;} + {returns either \ccStyle{ON_UNBOUNDED_SIDE}, + \ccStyle{ON_BOUNDED_SIDE}, or the constant + \ccStyle{ON_BOUNDARY}, + depending on where point $p$ is.} + +\ccMethod{bool has_on_boundary(const Point_2 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_bounded_side(const Point_2 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_unbounded_side(const Point_2 &p) const;} + {} + +\ccHeading{Miscellaneous} + +\ccMethod{Bbox bbox() const;} + {returns a bounding box containing \ccVar. } + +\ccMethod{Iso_rectangle_2 transform(const Aff_transformation_2 &t) const;} + {returns the iso-oriented rectangle obtained by applying $t$ on + the lower left and the upper right corner of \ccVar. + \ccPrecond The angle at a rotation must be a multiple of $\pi/2$, + otherwise the resulting rectangle does not have the same side length. + Note that rotating about an arbitrary angle can even result in + a degenerate iso-oriented rectangle.} + + + + + +\end{ccRefClass} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel.tex new file mode 100644 index 00000000000..ff6c580f8e7 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel.tex @@ -0,0 +1,661 @@ +\begin{ccRefConcept}{Kernel} +The concept of a {\em kernel} is defined by a set of requirements on +the provision of certain types and access member functions to create +objects of these types. The types are function object classes to be used +within the algorithms and data structures in the basic library of \cgal. +This allows you to use any model of a kernel as a traits class in +the \cgal\ algorithms and data structures, unless they require types +beyond those provided by a kernel. + +A kernel subsumes the concepts of {\em two-dimensional kernel}, +{\em three-dimensional kernel}, and {\em $d$-dimensional kernel}. + +A kernel provides types, construction objects, and generalized predicates. +The former replace constructors of the kernel classes and constructive procedures +in the kernel. There are also function objects replacing operators, especially +for equality testing. + +\ccCreationVariable{kernel} + +\ccTypes + +\ccNestedType{FT}{a number type that is a model for \ccc{FieldNumberType}} +\ccGlue +\ccNestedType{RT}{a number type that is a model for \ccc{RingNumberType}} + +\ccHeading{Two-dimensional Kernel} + +\ccHeading{Geometric Objects} + +\ccNestedType{Point_2}{} +\ccGlue +\ccNestedType{Vector_2}{} +\ccGlue +\ccNestedType{Direction_2}{} +\ccGlue +\ccNestedType{Line_2}{} +\ccGlue +\ccNestedType{Ray_2}{} +\ccGlue +\ccNestedType{Segment_2}{} +\ccGlue +\ccNestedType{Triangle_2}{} +\ccGlue +\ccNestedType{Iso_rectangle_2}{} +\ccGlue +\ccNestedType{Aff_transformation_2}{} +\ccGlue +\ccNestedType{Circle_2}{} + +\ccHeading{Constructors} + +\ccNestedType{Construct_point_2}{} +\ccGlue +\ccNestedType{Construct_vector_2}{} +\ccGlue +\ccNestedType{Construct_direction_2}{} +\ccGlue +\ccNestedType{Construct_segment_2}{} +\ccGlue +\ccNestedType{Construct_line_2}{} +\ccGlue +\ccNestedType{Construct_ray_2}{} +\ccGlue +\ccNestedType{Construct_circle_2}{} +\ccGlue +\ccNestedType{Construct_triangle_2}{} +\ccGlue +\ccNestedType{Construct_aff_transformation_2}{} +\ccGlue +\ccNestedType{Construct_point_on_2}{} +\ccGlue +\ccNestedType{Construct_second_point_on_2}{} +\ccGlue +\ccNestedType{Construct_source_point_2}{} +\ccGlue +\ccNestedType{Construct_target_point_2}{} +\ccGlue +\ccNestedType{Construct_min_point_2}{} +\ccGlue +\ccNestedType{Construct_max_point_2}{} +\ccGlue +\ccNestedType{Construct_direction_of_line_2}{} +\ccGlue +\ccNestedType{Construct_direction_of_ray_2}{} +\ccGlue +\ccNestedType{Construct_supporting_line_2}{} +\ccGlue +\ccNestedType{Construct_perpendicular_vector_2}{} +\ccGlue +\ccNestedType{Construct_perpendicular_direction_2}{} +\ccGlue +\ccNestedType{Construct_perpendicular_line_2}{} +\ccGlue +\ccNestedType{Construct_midpoint_2}{} +\ccGlue +\ccNestedType{Construct_circumcenter_2}{} +\ccGlue +\ccNestedType{Construct_bisector_2}{} +\ccGlue +\ccNestedType{Construct_opposite_segment_2}{} +\ccGlue +\ccNestedType{Construct_opposite_ray_2}{} +\ccGlue +\ccNestedType{Construct_opposite_line_2}{} +\ccGlue +\ccNestedType{Construct_opposite_triangle_2}{} +\ccGlue +\ccNestedType{Construct_opposite_circle_2}{} + +If the result type is not determined, there is no \ccc{Construct_} prefix: + +\ccNestedType{Transform_2}{} +\ccGlue +\ccNestedType{Intersect_2}{} +\ccGlue +\ccNestedType{Assign_2}{} + +If the result type is a number type, the prefix is \ccc{Compute_}: + +\ccNestedType{Compute_y_at_x_2}{} +\ccGlue +\ccNestedType{Compute_squared_length_2}{} + +\ccHeading{Generalized Predicates} + +\ccNestedType{Equal_2}{} +\ccGlue +\ccNestedType{Equal_x_2}{} +\ccGlue +\ccNestedType{Equal_y_2}{} +\ccGlue +\ccNestedType{Equal_xy_2}{} +\ccGlue +\ccNestedType{Less_x_2}{} +\ccGlue +\ccNestedType{Less_y_2}{} +\ccGlue +\ccNestedType{Less_xy_2}{} +\ccGlue +\ccNestedType{Compare_x_2}{} +\ccGlue +\ccNestedType{Compare_x_at_y_2}{} +\ccGlue +\ccNestedType{Compare_y_2}{} +\ccGlue +\ccNestedType{Compare_xy_2}{} +\ccGlue +\ccNestedType{Compare_y_at_x_2}{} +\ccGlue +\ccNestedType{Less_distance_to_point_2}{} +\ccGlue +\ccNestedType{Less_signed_distance_to_line_2}{} +\ccGlue +\ccNestedType{Less_rotate_ccw_2}{} +\ccGlue +\ccNestedType{Leftturn_2}{} +\ccGlue +\ccNestedType{Left_of_line_2}{} +\ccGlue +\ccNestedType{Collinear_2}{} +\ccGlue +\ccNestedType{Orientation_2}{} +\ccGlue +\ccNestedType{Side_of_oriented_circle_2}{} +\ccGlue +\ccNestedType{Side_of_bounded_circle_2}{} +\ccGlue +\ccNestedType{Is_horizontal_2}{} +\ccGlue +\ccNestedType{Is_vertical_2}{} +\ccGlue +\ccNestedType{Has_on_2}{} +\ccGlue +\ccNestedType{Collinear_has_on_2}{} +\ccGlue +\ccNestedType{Has_on_bounded_side_2}{} +\ccGlue +\ccNestedType{Has_on_unbounded_side_2}{} +\ccGlue +\ccNestedType{Has_on_boundary_2}{} +\ccGlue +\ccNestedType{Has_on_positive_side_2}{} +\ccGlue +\ccNestedType{Has_on_negative_side_2}{} +\ccGlue +\ccNestedType{Oriented_side_2}{} +\ccGlue +\ccNestedType{Are_ordered_along_line_2 }{} +\ccGlue +\ccNestedType{Are_strictly_ordered_along_line_2}{} +\ccGlue +\ccNestedType{Collinear_are_ordered_along_line_2}{} +\ccGlue +\ccNestedType{Collinear_are_strictly_ordered_along_line_2}{} +\ccGlue +\ccNestedType{Counterclockwise_in_between_2}{} + +\ccHeading{Three-dimensional Kernel} + +\ccHeading{Geometric Objects} + +\ccNestedType{Point_3}{} +\ccGlue +\ccNestedType{Vector_3}{} +\ccGlue +\ccNestedType{Direction_3}{} +\ccGlue +\ccNestedType{Iso_cuboid_3}{} +\ccGlue +\ccNestedType{Line_3}{} +\ccGlue +\ccNestedType{Ray_3}{} +\ccGlue +\ccNestedType{Sphere_3}{} +\ccGlue +\ccNestedType{Segment_3}{} +\ccGlue +\ccNestedType{Plane_3}{} +\ccGlue +\ccNestedType{Triangle_3}{} +\ccGlue +\ccNestedType{Tetrahedron_3}{} +\ccGlue +\ccNestedType{Aff_transformation_3}{} + +\ccHeading{Constructors} + +\ccNestedType{Construct_point_3}{} +\ccGlue +\ccNestedType{Construct_vector_3}{} +\ccGlue +\ccNestedType{Construct_direction_3}{} +\ccGlue +\ccNestedType{Construct_plane_3}{} +\ccGlue +\ccNestedType{Construct_iso_cuboid_3}{} +\ccGlue +\ccNestedType{Construct_line_3}{} +\ccGlue +\ccNestedType{Construct_ray_3}{} +\ccGlue +\ccNestedType{Construct_sphere_3}{} +\ccGlue +\ccNestedType{Construct_segment_3}{} +\ccGlue +\ccNestedType{Construct_triangle_3}{} +\ccGlue +\ccNestedType{Construct_tetrahedron_3}{} +\ccGlue +\ccNestedType{Construct_aff_transformation_3}{} +\ccGlue +\ccNestedType{Construct_point_on_3}{} +\ccGlue +\ccNestedType{Construct_second_point_on_3}{} +\ccGlue +\ccNestedType{Construct_source_point_3}{} +\ccGlue +\ccNestedType{Construct_target_point_3}{} +\ccGlue +\ccNestedType{Construct_min_point_3}{} +\ccGlue +\ccNestedType{Construct_max_point_3}{} +\ccGlue +\ccNestedType{Construct_direction_of_line_3}{} +\ccGlue +\ccNestedType{Construct_direction_of_ray_3}{} +\ccGlue +\ccNestedType{Construct_supporting_plane_3}{} +\ccGlue +\ccNestedType{Construct_perpendicular_plane_3}{} +\ccGlue +\ccNestedType{Construct_perpendicular_line_3}{} +\ccGlue +\ccNestedType{Construct_midpoint_3}{} +\ccGlue +\ccNestedType{Construct_opposite_segment_3}{} +\ccGlue +\ccNestedType{Construct_opposite_ray_3}{} +\ccGlue +\ccNestedType{Construct_opposite_line_3}{} +\ccGlue +\ccNestedType{Construct_opposite_plane_3}{} + +If the result type is not determined, there is no \ccc{Construct_} prefix: + +\ccNestedType{Transform_3}{} +\ccGlue +\ccNestedType{Intersect_3}{} +\ccGlue +\ccNestedType{Assign_3}{} + +If the result type is a number type, the prefix is \ccc{Compute_}: + +\ccNestedType{Compute_squared_length_3}{} + +\ccHeading{Generalized Predicates} + +\ccNestedType{Equal_3}{} +\ccGlue +\ccNestedType{Equal_x_3}{} +\ccGlue +\ccNestedType{Equal_y_3}{} +\ccGlue +\ccNestedType{Equal_z_3}{} +\ccGlue +\ccNestedType{Equal_xy_3}{} +\ccGlue +\ccNestedType{Equal_xyz_3}{} +\ccGlue +\ccNestedType{Less_x_3}{} +\ccGlue +\ccNestedType{Less_y_3}{} +\ccGlue +\ccNestedType{Less_z_3}{} +\ccGlue +\ccNestedType{Less_xy_3}{} +\ccGlue +\ccNestedType{Less_xyz_3}{} +\ccGlue +\ccNestedType{Compare_x_3}{} +\ccGlue +\ccNestedType{Compare_y_3}{} +\ccGlue +\ccNestedType{Compare_z_3}{} +\ccGlue +\ccNestedType{Compare_xy_3}{} +\ccGlue +\ccNestedType{Compare_xyz_3}{} +\ccGlue +\ccNestedType{Less_distance_to_point_3}{} +\ccGlue +\ccNestedType{Collinear_3}{} +\ccGlue +\ccNestedType{Coplanar_3}{} +\ccGlue +\ccNestedType{Orientation_3}{} +\ccGlue +\ccNestedType{Side_of_oriented_sphere_3}{} +\ccGlue +\ccNestedType{Side_of_bounded_sphere_3}{} +\ccGlue +\ccNestedType{Is_degenerate_3}{} +\ccGlue +\ccNestedType{Has_on_3}{} +\ccGlue +\ccNestedType{Has_on_bounded_side_3}{} +\ccGlue +\ccNestedType{Has_on_unbounded_side_3}{} +\ccGlue +\ccNestedType{Has_on_boundary_3}{} +\ccGlue +\ccNestedType{Has_on_positive_side_3}{} +\ccGlue +\ccNestedType{Has_on_negative_side_3}{} +\ccGlue +\ccNestedType{Oriented_side_3}{} +\ccGlue +\ccNestedType{Are_ordered_along_line_3 }{} +\ccGlue +\ccNestedType{Are_strictly_ordered_along_line_3}{} +\ccGlue +\ccNestedType{Collinear_are_ordered_along_line_3}{} +\ccGlue +\ccNestedType{Collinear_are_strictly_ordered_along_line_3}{} + + +\ccHeading{d-dimensional Kernel} + +\ccHeading{Geometric Objects} + +\ccNestedType{Point_d}{} + +\ccOperations + +The following member functions return function objects of the types listed above. +The name of the access function is the name of the type returned with an +\ccc{_object} suffix. + +\ccTexHtml{\ccSetThreeColumns{Kernel::Are_strictly_ordered_along_line}{}{\hspace*{4.5cm}}}{} + +\setlength{\ccAdditionalReturnSkip}{-\parskip} + +\def\ccTagRmEigenClassName{\ccFalse} +\ccMemberFunction{Kernel::Construct_point_2 construct_point_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_vector_2 construct_vector_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_direction_2 construct_direction_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_segment_2 construct_segment_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_line_2 construct_line_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_ray_2 construct_ray_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_circle_2 construct_circle_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_triangle_2 construct_triangle_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_iso_rectangle_2 construct_iso_rectangle_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_aff_transformation_2 construct_aff_transformation_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_point_on_2 construct_point_on_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_second_point_on_2 construct_second_point_on_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_source_point_2 construct_source_point_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_target_point_2 construct_target_point_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_min_point_2 construct_min_point_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_max_point_2 construct_max_point_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_direction_of_line_2 construct_direction_of_line_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_direction_of_ray_2 construct_direction_of_ray_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_supporting_line_2 construct_supporting_line_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_perpendicular_vector_2 construct_perpendicular_vector_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_perpendicular_direction_2 construct_perpendicular_direction_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_perpendicular_line_2 construct_perpendicular_line_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_midpoint_2 construct_midpoint_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_circumcenter_2 construct_circumcenter_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_bisector_2 construct_bisector_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_opposite_segment_2 construct_opposite_segment_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_opposite_ray_2 construct_opposite_ray_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_opposite_line_2 construct_opposite_line_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_opposite_triangle_2 construct_opposite_triangle_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_opposite_circle_2 construct_opposite_circle_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Transform_2 transform_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Assign_2 assign_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Intersect_2 intersect_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Compute_y_at_x_2 compute_y_at_x_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Compute_squared_length_2 compute_squared_length_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Equal_2 equal_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Equal_x_2 equal_x_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Equal_y_2 equal_y_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Equal_xy_2 equal_xy_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Less_x_2 less_x_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Less_y_2 less_y_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Less_xy_2 less_xy_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Less_yx_2 less_yx_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Compare_x_2 compare_x_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Compare_y_2 compare_y_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Compare_xy_2 compare_xy_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Compare_y_at_x_2 compare_y_at_x_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Compare_x_at_y_2 compare_x_at_y_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Less_distance_to_point_2 less_distance_to_point_2_object(const Kernel::Point_2& p) const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Less_signed_distance_to_line_2 less_signed_distance_to_line_2_object(const Kernel::Point_2& p, const Kernel::Point_2& q) const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Less_rotate_ccw_2 less_rotate_ccw_2_object(const Kernel::Point_2& p) const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Counterclockwise_in_between_2 counterclockwise_in_between_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Leftturn_2 leftturn_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Left_of_line_2 left_of_line_2_object(const Kernel::Point_2& p, const Kernel::Point_2& q) const ;}{} +\ccGlue +%\ccMemberFunction{Kernel::Right_of_line_2 right_of_line_2_object(const Kernel::Point_2& p, const Kernel::Point_2& q) const ;}{} +%\ccGlue +%\ccMemberFunction{Kernel::Left_of_line_2 left_of_vertical_2_object(const Kernel::Point_2& p) const ;}{} +%\ccGlue +\ccMemberFunction{Kernel::Collinear_2 collinear_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Orientation_2 orientation_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Side_of_oriented_circle_2 side_of_oriented_circle_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Side_of_bounded_circle_2 side_of_bounded_circle_2_object() const;}{} +\ccGlue +\ccMemberFunction{Kernel::Is_horizontal_2 is_horizontal_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Is_vertical_2 is_vertical_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Is_degenerate_2 is_degenerate_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Has_on_2 has_on_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Collinear_has_on_2 collinear_has_on_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Has_on_bounded_side_2 has_on_bounded_side_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Has_on_unbounded_side_2 has_on_unbounded_side_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Has_on_boundary_2 has_on_boundary_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Has_on_positive_side_2 has_on_positive_side_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Has_on_negative_side_2 has_on_negative_side_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Oriented_side_2 oriented_side_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Are_ordered_along_line_2 are_ordered_along_line_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Are_strictly_ordered_along_line_2 are_strictly_ordered_along_line_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Collinear_are_ordered_along_line_2 collinear_are_ordered_along_line_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Collinear_are_strictly_ordered_along_line_2 collinear_are_strictly_ordered_along_line_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_point_3 construct_point_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_vector_3 construct_vector_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_direction_3 construct_direction_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_iso_cuboid_3 construct_iso_cuboid_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_segment_3 construct_segment_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_sphere_3 construct_sphere_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_plane_3 construct_plane_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_line_3 construct_line_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_ray_3 construct_ray_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_triangle_3 construct_triangle_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_tetrahedron_3 construct_tetrahedron_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_iso_cuboid_3 construct_iso_cuboid_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_aff_transformation_3 construct_aff_transformation_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_point_on_3 construct_point_on_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_second_point_on_3 construct_second_point_on_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_midpoint_3 construct_midpoint_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_circumcenter_3 construct_circumcenter_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_opposite_segment_3 construct_opposite_segment_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_opposite_ray_3 construct_opposite_ray_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_opposite_line_3 construct_opposite_line_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_supporting_plane_3 construct_supporting_plane_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Transform_3 transform_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Assign_3 assign_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Intersect_3 intersect_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Compute_squared_length_3 compute_squared_length_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Equal_3 equal_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Equal_x_3 equal_x_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Equal_y_3 equal_y_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Equal_z_3 equal_z_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Equal_xy_3 equal_xy_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Equal_xyz_3 equal_xyz_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Less_x_3 less_x_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Less_y_3 less_y_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Less_z_3 less_z_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Less_xy_3 less_xy_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Less_xyz_3 less_xyz_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Compare_x_3 compare_x_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Compare_y_3 compare_y_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Compare_z_3 compare_z_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Compare_xy_3 compare_xy_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Compare_xyz_3 compare_xyz_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Less_distance_to_point_3 less_distance_to_point_3_object(const Kernel::Point_3& p) const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Collinear_3 collinear_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Coplanar_3 coplanar_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Orientation_3 orientation_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Is_degenerate_3 is_degenerate_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Has_on_3 has_on_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Has_on_bounded_side_3 has_on_bounded_side_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Has_on_unbounded_side_3 has_on_unbounded_side_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Has_on_boundary_3 has_on_boundary_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Has_on_positive_side_3 has_on_positive_side_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Has_on_negative_side_3 has_on_negative_side_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Oriented_side_3 oriented_side_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Are_ordered_along_line_3 are_ordered_along_line_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Are_strictly_ordered_along_line_3 are_strictly_ordered_along_line_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Collinear_are_ordered_along_line_3 collinear_are_ordered_along_line_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Collinear_are_strictly_ordered_along_line_3 collinear_are_strictly_ordered_along_line_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Side_of_oriented_sphere_3 side_of_oriented_sphere_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Side_of_bounded_sphere_3 side_of_bounded_sphere_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_point_d construct_point_d_object() const ;}{} + +\def\ccTagRmEigenClassName{\ccTrue} +\setlength{\ccAdditionalReturnSkip}{0pt} + +\ccHasModels + +\ccc{Cartesian}, \ccc{Homogeneous}, +\ccc{Simple_cartesian} +\end{ccRefConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Aff_transformation_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Aff_transformation_2.tex new file mode 100644 index 00000000000..b3413c9a0c9 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Aff_transformation_2.tex @@ -0,0 +1,11 @@ +\begin{ccRefConcept}{Kernel::Aff_transformation_2} +\ccDefinition +A type representing affine transformations in two dimensions. + +\ccRefines +\ccc{CopyConstructable}, +\ccc{Assignable} + +\ccSeeAlso +\ccc{Kernel::Construct_aff_transformation_2} +\end{ccRefConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Aff_transformation_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Aff_transformation_3.tex new file mode 100644 index 00000000000..b4119651485 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Aff_transformation_3.tex @@ -0,0 +1,13 @@ +\begin{ccRefConcept}{Kernel::Aff_transformation_3} +\ccDefinition +A type representing affine transformations in three dimensions. + +\ccRefines +\ccc{CopyConstructable}, +\ccc{Assignable} + +\ccSeeAlso +\ccc{Kernel::Construct_aff_transformation_3} + +\end{ccRefConcept} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Are_ordered_along_line_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Are_ordered_along_line_2.tex new file mode 100644 index 00000000000..a7a7070d4a8 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Are_ordered_along_line_2.tex @@ -0,0 +1,13 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Are_ordered_along_line_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_2&p, + const Kernel::Point_2&q, + const Kernel::Point_2&r);} + {returns \ccStyle{true}, iff the three points are collinear and + \ccStyle{q} lies between \ccStyle{p} and \ccStyle{r}. + Note that \ccStyle{true} is returned, if \ccStyle{q==p} or + \ccStyle{q==r}.} +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Are_ordered_along_line_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Are_ordered_along_line_3.tex new file mode 100644 index 00000000000..afa060fe8df --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Are_ordered_along_line_3.tex @@ -0,0 +1,14 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Are_ordered_along_line_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_3&p, + const Kernel::Point_3&q, + const Kernel::Point_3&r);} + {returns \ccStyle{true}, iff the three points are collinear and + \ccStyle{q} lies between \ccStyle{p} and \ccStyle{r}. + Note that \ccStyle{true} is returned, if \ccStyle{q==p} or + \ccStyle{q==r}.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Are_strictly_ordered_along_line_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Are_strictly_ordered_along_line_2.tex new file mode 100644 index 00000000000..3a4853c8e16 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Are_strictly_ordered_along_line_2.tex @@ -0,0 +1,14 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Are_strictly_ordered_along_line_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_2&p, + const Kernel::Point_2&q, + const Kernel::Point_2&r);} + {returns \ccStyle{true}, iff the three points are collinear and + \ccStyle{q} lies strictly between \ccStyle{p} and \ccStyle{r}. + Note that \ccStyle{false} is returned, if \ccStyle{q==p} or + \ccStyle{q==r}.} +\end{ccRefFunctionObjectConcept} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Are_strictly_ordered_along_line_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Are_strictly_ordered_along_line_3.tex new file mode 100644 index 00000000000..970b7077536 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Are_strictly_ordered_along_line_3.tex @@ -0,0 +1,14 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Are_strictly_ordered_along_line_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_3&p, + const Kernel::Point_3&q, + const Kernel::Point_3&r);} + {returns \ccStyle{true}, iff the three points are collinear and + \ccStyle{q} lies strictly between \ccStyle{p} and \ccStyle{r}. + Note that \ccStyle{false} is returned, if \ccStyle{q==p} or + \ccStyle{q==r}.} +\end{ccRefFunctionObjectConcept} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Assign_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Assign_2.tex new file mode 100644 index 00000000000..5aa17252f99 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Assign_2.tex @@ -0,0 +1,16 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Assign_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{ +template +bool operator()(T& t, const Kernel::Object_2&o);} +{assigns \ccStyle{o} to \ccStyle{c} if \ccStyle{o} +was constructed from an object of type \ccStyle{T}. +Returns \ccc{true}, if the assignment was possible.} + +\ccSeeAlso +\ccc{Kernel::Object_2} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Assign_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Assign_3.tex new file mode 100644 index 00000000000..90258ff5c0a --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Assign_3.tex @@ -0,0 +1,16 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Assign_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{ +template +bool operator()(T& t, const Kernel::Object_3&o);} +{assigns \ccStyle{o} to \ccStyle{c} if \ccStyle{o} +was constructed from an object of type \ccStyle{T}. +Returns \ccc{true}, if the assignment was possible.} + +\ccSeeAlso +\ccc{Kernel::Object_3} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Circle_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Circle_2.tex new file mode 100644 index 00000000000..66ed2a39567 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Circle_2.tex @@ -0,0 +1,11 @@ +\begin{ccRefConcept}{Kernel::Circle_2} +A type representing circles in two dimensions. + +\ccRefines +\ccc{CopyConstructable}, +\ccc{Assignable} + +\ccSeeAlso +\ccc{Kernel::Construct_circle_2} +\end{ccRefConcept} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Collinear_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Collinear_2.tex new file mode 100644 index 00000000000..f04fd603969 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Collinear_2.tex @@ -0,0 +1,11 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Collinear_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_2&p, + const Kernel::Point_2&q, + const Kernel::Point_2&r);} +{returns \ccStyle{true}, if $p$, $q$, and $r$ are collinear.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Collinear_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Collinear_3.tex new file mode 100644 index 00000000000..c5ada40a2fe --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Collinear_3.tex @@ -0,0 +1,11 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Collinear_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_3&p, + const Kernel::Point_3&q, + const Kernel::Point_3&r);} +{returns \ccStyle{true}, if $p$, $q$, and $r$ are collinear.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Collinear_are_ordered_along_line_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Collinear_are_ordered_along_line_2.tex new file mode 100644 index 00000000000..9febd55cca9 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Collinear_are_ordered_along_line_2.tex @@ -0,0 +1,13 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Collinear_are_ordered_along_line_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_2&p, + const Kernel::Point_2&q, + const Kernel::Point_2&r);} + {returns \ccStyle{true}, iff \ccStyle{q} lies between \ccStyle{p} + and \ccStyle{r}. \ccPrecond \ccStyle{p, q} and \ccStyle{r} are + collinear.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Collinear_are_ordered_along_line_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Collinear_are_ordered_along_line_3.tex new file mode 100644 index 00000000000..76ee743d5e3 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Collinear_are_ordered_along_line_3.tex @@ -0,0 +1,13 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Collinear_are_ordered_along_line_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_3&p, + const Kernel::Point_3&q, + const Kernel::Point_3&r);} + {returns \ccStyle{true}, iff \ccStyle{q} lies between \ccStyle{p} + and \ccStyle{r}. \ccPrecond \ccStyle{p, q} and \ccStyle{r} are + collinear.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Collinear_are_strictly_ordered_along_line_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Collinear_are_strictly_ordered_along_line_2.tex new file mode 100644 index 00000000000..1f00b2652c4 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Collinear_are_strictly_ordered_along_line_2.tex @@ -0,0 +1,13 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Collinear_are_strictly_ordered_along_line_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_2&p, + const Kernel::Point_2&q, + const Kernel::Point_2&r);} + {returns \ccStyle{true}, iff \ccStyle{q} lies strictly between + \ccStyle{p} and \ccStyle{r}. \ccPrecond \ccStyle{p, q} and + \ccStyle{r} are collinear.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Collinear_are_strictly_ordered_along_line_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Collinear_are_strictly_ordered_along_line_3.tex new file mode 100644 index 00000000000..a6d1841a50d --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Collinear_are_strictly_ordered_along_line_3.tex @@ -0,0 +1,13 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Collinear_are_strictly_ordered_along_line_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_3&p, + const Kernel::Point_3&q, + const Kernel::Point_3&r);} + {returns \ccStyle{true}, iff \ccStyle{q} lies strictly between + \ccStyle{p} and \ccStyle{r}. \ccPrecond \ccStyle{p, q} and + \ccStyle{r} are collinear.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Collinear_has_on_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Collinear_has_on_2.tex new file mode 100644 index 00000000000..708a57b06db --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Collinear_has_on_2.tex @@ -0,0 +1,16 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Collinear_has_on_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Ray_2& r, + const Kernel::Point_2&p);} + {checks if point $p$ is on $r$. + \ccPrecond{$p$ is on the supporting line of $r$.}} + +\ccMemberFunction{bool operator()(const Kernel::Segment_2& s, + const Kernel::Point_2&p);} + {checks if point $p$ is on $s$. + \ccPrecond{$p$ is on the supporting line of $s$.}} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Collinear_has_on_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Collinear_has_on_3.tex new file mode 100644 index 00000000000..b57488a70ac --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Collinear_has_on_3.tex @@ -0,0 +1,16 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Collinear_has_on_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Ray_3& r, + const Kernel::Point_3&p);} + {checks if point $p$ is on $r$. + \ccPrecond{$p$ is on the supporting line of $r$.}} + +\ccMemberFunction{bool operator()(const Kernel::Segment_3& s, + const Kernel::Point_3&p);} + {checks if point $p$ is on $s$. + \ccPrecond{$p$ is on the supporting line of $s$.}} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compare_x_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compare_x_2.tex new file mode 100644 index 00000000000..c70846e0f40 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compare_x_2.tex @@ -0,0 +1,50 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Compare_x_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Comparison_result operator()(const Kernel::Point_2&p, + const Kernel::Point_2&q);} + {compares the Cartesian $x$-coordinates of points \ccStyle{p} and + \ccStyle{q}} + +\begin{ccTexOnly} +\begin{figure}[h] +\centerline{\Ipe{compare1.ipe}} +\caption{Comparison of the $x$ or $y$-coordinates of the (implicitly +given) points in the boxes.\label{fig-compare12}} +\end{figure} +\end{ccTexOnly} + +\ccMemberFunction{Comparison_result operator()(const Kernel::Point_2 &p, + const Kernel::Line_2 &l1, + const Kernel::Line_2 &l2);} + {compares the $x$-coordinates of $p$ and the \ccHtmlNoLinksFrom{intersection} + of lines $l1$ and $l2$% + \ccTexHtml{ (Figure~\ref{fig-compare12} (a))}{, see (a) in the figure + below}.} + + +\ccMemberFunction{Comparison_result operator()(const Kernel::Line_2 &l, + const Kernel::Line_2 &h1, + const Kernel::Line_2 &h2);} + {compares the $x$-coordinates of the \ccHtmlNoLinksFrom{intersection} of line $l$ + with line $h1$ and with line $h2$% + \ccTexHtml{ (Figure~\ref{fig-compare12} (b))}{, see (b) in the figure + below}.} + + +\ccMemberFunction{Comparison_result operator()(const Kernel::Line_2 &l1, + const Kernel::Line_2 &l2, + const Kernel::Line_2 &h1, + const Kernel::Line_2 &h2);} + {compares the $x$-coordinates of the \ccHtmlNoLinksFrom{intersection} of lines $l1$ + and $l2$ and the \ccHtmlNoLinksFrom{intersection} of lines $h1$ and $h2$% + \ccTexHtml{ (Figure~\ref{fig-compare12} (c))}{, see (c) in the figure + below}.} + +\begin{ccHtmlOnly} +Comparison of the x 
+or y coordinates of the (implicitly given) points in the boxes +\end{ccHtmlOnly} +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compare_x_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compare_x_3.tex new file mode 100644 index 00000000000..43c7ed8dde6 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compare_x_3.tex @@ -0,0 +1,11 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Compare_x_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Comparison_result operator()(const Kernel::Point_3&p, + const Kernel::Point_3&q);} + {Compares the Cartesian $x$-coordinates of points \ccStyle{p} and + \ccStyle{q}} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compare_x_at_y_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compare_x_at_y_2.tex new file mode 100644 index 00000000000..e7945853055 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compare_x_at_y_2.tex @@ -0,0 +1,40 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Compare_x_at_y_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Comparison_result operator()(const Point_2 &p, + const Line_2 &h);} + {compares the $x$-coordinates of $p$ and the horizontal projection + of \ccStyle{p} on \ccStyle{h}.} + +\ccMemberFunction{Comparison_result operator()(const Kernel::Point_2 &p, + const Kernel::Line_2 &h);} + {compares the $x$-coordinates of $p$ and the horizontal projection + of \ccStyle{p} on \ccStyle{h}.} + + +\ccMemberFunction{Comparison_result operator()(const Kernel::Point_2 &p, + const Kernel::Line_2 &h1, + const Kernel::Line_2 &h2);} +{This function compares the $x$-coordinates of the horizontal projection + of \ccStyle{p} on \ccStyle{h1} and on \ccStyle{h2}.} + +\ccMemberFunction{Comparison_result operator()(const Kernel::Line_2 &l1, + const Kernel::Line_2 &l2, + const Kernel::Line_2 &h);} + {Let $p$ be the \ccHtmlNoLinksFrom{intersection} of lines $l1$ and $l2$. + This function compares the $x$-coordinates of $p$ and + the horizontal projection of \ccStyle{p} on \ccStyle{h}.} + + + +\ccMemberFunction{Comparison_result operator()(const Kernel::Line_2 &l1, + const Kernel::Line_2 &l2, + const Kernel::Line_2 &h1, + const Kernel::Line_2 &h2);} +{Let $p$ be the \ccHtmlNoLinksFrom{intersection} of lines $l1$ and $l2$. This function + compares the $x$-coordinates of the horizontal projection of \ccStyle{p} on + \ccStyle{h1} and on \ccStyle{h2}.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compare_xy_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compare_xy_2.tex new file mode 100644 index 00000000000..3663f42abdb --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compare_xy_2.tex @@ -0,0 +1,13 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Compare_xy_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Comparison_result operator()(const Kernel::Point_2&p, + const Kernel::Point_2&q);} + {Compares the Cartesian coordinates of points \ccStyle{p} and + \ccStyle{q} lexicographically in $xy$ order: first + $x$-coordinates are compared, if they are equal, $y$-coordinates + are compared.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compare_xy_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compare_xy_3.tex new file mode 100644 index 00000000000..6abffe5a93b --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compare_xy_3.tex @@ -0,0 +1,13 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Compare_xy_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Comparison_result operator()(const Kernel::Point_3&p, + const Kernel::Point_3&q);} + {Compares the Cartesian coordinates of points \ccStyle{p} and + \ccStyle{q} lexicographically in $xy$ order: first + $x$-coordinates are compared, if they are equal, $y$-coordinates + are compared.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compare_xyz_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compare_xyz_3.tex new file mode 100644 index 00000000000..191107ff244 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compare_xyz_3.tex @@ -0,0 +1,13 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Compare_xyz_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Comparison_result operator()(const Kernel::Point_3&p, + const Kernel::Point_3&q);} + {Compares the Cartesian coordinates of points \ccStyle{p} and + \ccStyle{q} lexicographically in $xy$ order: first + $x$-coordinates are compared, if they are equal, $y$-coordinates + are compared. If they are equal, $z$-coordinates are compared.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compare_y_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compare_y_2.tex new file mode 100644 index 00000000000..3b3b720546d --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compare_y_2.tex @@ -0,0 +1,54 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Compare_y_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Comparison_result operator()(const Kernel::Point_2&p, + const Kernel::Point_2&q);} + {Compares the Cartesian $y$-coordinates of points \ccStyle{p} and + \ccStyle{q}} + +\begin{ccHtmlOnly} +Comparison of the x 
+or y coordinates of the (implicitly given) points in the boxes +\end{ccHtmlOnly} + +\begin{ccTexOnly} +\begin{figure}[h] +\centerline{\Ipe{compare1.ipe}} +\caption{Comparison of the $x$ or $y$-coordinates of the (implicitly +given) points in the boxes.\label{fig-compare14}} +\end{figure} +\end{ccTexOnly} + + +\ccMemberFunction{Comparison_result operator()(const Kernel::Point_2 &p, + const Kernel::Line_2 &l1, + const Kernel::Line_2 &l2);} + {compares the $y$-coordinates of $p$ and the + \ccHtmlNoLinksFrom{intersection} of lines + $l1$ and $l2$% + \ccTexHtml{ (Figure~\ref{fig-compare14} (a))}{, see (a) in the figure + above}.} + + +\ccMemberFunction{Comparison_result operator()(const Kernel::Line_2 &l, + const Kernel::Line_2 &h1, + const Kernel::Line_2 &h2);} + {compares the $y$-coordinates of the \ccHtmlNoLinksFrom{intersection} of line $l$ + with line $h1$ and with line $h2$% + \ccTexHtml{ (Figure~\ref{fig-compare14} (b))}{, see (b) in the figure + above}.} + + +\ccMemberFunction{Comparison_result operator()(const Kernel::Line_2 &l1, + const Kernel::Line_2 &l2, + const Kernel::Line_2 &h1, + const Kernel::Line_2 &h2);} + {compares the $y$-coordinates of the \ccHtmlNoLinksFrom{intersection} of lines $l1$ + and $l2$ and the \ccHtmlNoLinksFrom{intersection} of lines $h1$ and $h2$ + \ccTexHtml{ (Figure~\ref{fig-compare14} (c))}{, see (c) in the figure + above}.} + + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compare_y_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compare_y_3.tex new file mode 100644 index 00000000000..3964c2ca17f --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compare_y_3.tex @@ -0,0 +1,11 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Compare_y_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Comparison_result operator()(const Kernel::Point_3&p, + const Kernel::Point_3&q);} + {Compares the Cartesian $y$-coordinates of points \ccStyle{p} and + \ccStyle{q}} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compare_y_at_x_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compare_y_at_x_2.tex new file mode 100644 index 00000000000..eec54476aa1 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compare_y_at_x_2.tex @@ -0,0 +1,64 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Compare_y_at_x_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Comparison_result operator()(const Kernel::Point_2 &p, + const Kernel::Line_2 &h);} + {compares the $y$-coordinates of $p$ and the vertical projection + of \ccStyle{p} on \ccStyle{h}% + \ccTexHtml{ (Figure~\ref{fig-compare22} (d))}{, see (d) in the figure + below}.} + +\begin{ccTexOnly} +\begin{figure}[h] +\centerline{\Ipe{compare2.ipe}} +\caption{Comparison of the $y$-coordinates of the (implicitly given) + points in the boxes, at an $x$-coordinate. The $x$-coordinate + is either given explicitly (disc) or implicitly (circle). + \label{fig-compare22}} +\end{figure} +\end{ccTexOnly} + +\ccMemberFunction{Comparison_result operator()(const Kernel::Point_2 &p, + const Kernel::Line_2 &h);} + {compares the $y$-coordinates of $p$ and the vertical projection + of \ccStyle{p} on \ccStyle{h}% + \ccTexHtml{ (Figure~\ref{fig-compare2} (d))}{, see (d) in the figure + below}.} + + +\ccMemberFunction{Comparison_result operator()(const Kernel::Point_2 &p, + const Kernel::Line_2 &h1, + const Kernel::Line_2 &h2);} +{This function compares the $y$-coordinates of the vertical projection + of \ccStyle{p} on \ccStyle{h1} and on \ccStyle{h2}% + \ccTexHtml{ (Figure~\ref{fig-compare2} (e))}{, see (e) in the figure + below}.} + +\ccMemberFunction{Comparison_result operator()(const Kernel::Line_2 &l1, + const Kernel::Line_2 &l2, + const Kernel::Line_2 &h);} + {Let $p$ be the \ccHtmlNoLinksFrom{intersection} of lines $l1$ and $l2$. + This function compares the $y$-coordinates of $p$ and + the vertical projection of \ccStyle{p} on \ccStyle{h}% + \ccTexHtml{ (Figure~\ref{fig-compare2} (f))}{, see (f) in the figure + below}.} + + + +\ccMemberFunction{Comparison_result operator()(const Kernel::Line_2 &l1, + const Kernel::Line_2 &l2, + const Kernel::Line_2 &h1, + const Kernel::Line_2 &h2);} +{Let $p$ be the \ccHtmlNoLinksFrom{intersection} of lines $l1$ and $l2$. This function + compares the $y$-coordinates of the vertical projection of \ccStyle{p} on + \ccStyle{h1} and on \ccStyle{h2}% + \ccTexHtml{ (Figure~\ref{fig-compare2} (g))}{, see (g) in the figure + below}.} + +\begin{ccHtmlOnly} +Comparison of y at x +\end{ccHtmlOnly} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compare_z_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compare_z_3.tex new file mode 100644 index 00000000000..75f134a2e8d --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compare_z_3.tex @@ -0,0 +1,11 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Compare_z_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Comparison_result operator()(const Kernel::Point_3&p, + const Kernel::Point_3&q);} + {Compares the Cartesian $z$-coordinates of points \ccStyle{p} and + \ccStyle{q}} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compute_squared_length_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compute_squared_length_2.tex new file mode 100644 index 00000000000..f94eae4d5f7 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compute_squared_length_2.tex @@ -0,0 +1,9 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Compute_squared_length_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::FT operator()(const Kernel::Segment_2& s);} + {returns the squared length of $s$. } + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compute_squared_length_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compute_squared_length_3.tex new file mode 100644 index 00000000000..104fa9227a7 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compute_squared_length_3.tex @@ -0,0 +1,9 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Compute_squared_length_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::FT operator()(const Kernel::Segment_3& s);} + {returns the squared length of $s$. } + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compute_x_at_y_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compute_x_at_y_2.tex new file mode 100644 index 00000000000..701102d42c1 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compute_x_at_y_2.tex @@ -0,0 +1,12 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Compute_x_at_y_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::FT operator()(const Kernel::Line_2& l, + const Kernel::FT &y) const;} + {returns the $x$-coordinate of the point at $l$ with + given $y$-coordinate. + \ccPrecond $l$ is not vertical.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compute_y_at_x_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compute_y_at_x_2.tex new file mode 100644 index 00000000000..9025f002a8a --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Compute_y_at_x_2.tex @@ -0,0 +1,12 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Compute_y_at_x_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::FT operator()(const Kernel::Line_2& l, + const Kernel::FT &x) const;} + {returns the $y$-coordinate of the point at $l$ with + given $x$-coordinate. + \ccPrecond $l$ is not vertical.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_aff_transformation_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_aff_transformation_2.tex new file mode 100644 index 00000000000..1bea7e41e6b --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_aff_transformation_2.tex @@ -0,0 +1,68 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_aff_transformation_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Aff_transformation_2 operator()( + const Translation, + const Kernel::Vector_2&v);} + {introduces a translation by a vector $v$.} + +\ccMemberFunction{Kernel::Aff_transformation_2 operator()( + const Rotation, + const Kernel::Direction_2&d, + const Kernel::RT &num, + const Kernel::RT &den = Kernel::RT(1));} + {approximates the rotation over the angle indicated by direction + $d$, such that the differences between the sines and cosines + of the rotation given by d and the approximating rotation + are at most $num/den$ each. + \ccPrecond $num/den>0$. } + +\ccMemberFunction{Kernel::Aff_transformation_2 operator()( + const Rotation, + const Kernel::RT &sine_rho, + const Kernel::RT &cosine_rho, + const Kernel::RT &hw = Kernel::RT(1));} + {introduces a rotation by the angle \ccStyle{rho}. + \ccPrecond + \ccTexHtml{$\mbox{\it sine\_rho}^2 + \mbox{\it cosine\_rho}^2 == +hw^2$}{sine_rho2 + cosine_rho2 == +hw2}.} + +\ccMemberFunction{Kernel::Aff_transformation_2 operator()( + const Scaling, + const Kernel::RT &s, + const Kernel::RT &hw = Kernel::RT(1));} + {introduces a scaling by a scale factor $s/hw$.} + +\ccMemberFunction{Kernel::Aff_transformation_2 operator()( + const Kernel::RT &m00, const Kernel::RT &m01, const Kernel::RT &m02, + const Kernel::RT &m10, const Kernel::RT &m11, const Kernel::RT &m12, + const Kernel::RT &hw = Kernel::RT(1));} + {introduces a general affine transformation in the + \ccTexHtml{$3 \times 3$ matrix form \usebox{\arrtwo}.}% + {3x3 matrix .} + The sub-matrix \ccTexHtml{$1\over hw$\usebox{\arrlintwo}}% + {hw-1 } contains the scaling and rotation + information, the vector \ccTexHtml{$1\over hw$ + \usebox{\transvectwo}}{hw-1 + } + contains the translational part of the transformation.} + +\savebox{\arrtwo}{\small $\left(\begin{array}{ccc} + m_{00} & m_{01} & 0\\ + m_{10} & m_{11} & 0\\ + 0 & 0 & hw + \end{array}\right)$} + +\ccMemberFunction{Kernel::Aff_transformation_2 operator()( + const Kernel::RT &m00, const Kernel::RT &m01, + const Kernel::RT &m10, const Kernel::RT &m11, + const Kernel::RT &hw = Kernel::RT(1));} + {introduces a general linear transformation + \ccTexHtml{\usebox{\arrtwo},}{ ,} + i.e.\ there is no translational part.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_aff_transformation_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_aff_transformation_3.tex new file mode 100644 index 00000000000..eb68c27c9b2 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_aff_transformation_3.tex @@ -0,0 +1,48 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_aff_transformation_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Aff_transformation_3 operator()(const Translation, + const Kernel::Vector_3 &v);} + {introduces a translation by a vector $v$.} + +\ccMemberFunction{Kernel::Aff_transformation_3 operator()(const Scaling, + const Kernel::RT &s, + const Kernel::RT &hw = Kernel::RT(1));} + {introduces a scaling by a scale factor $s/hw$.} + +\ccMemberFunction{Kernel::Aff_transformation_3 operator()( + const Kernel::RT &m00, const Kernel::RT &m01, const Kernel::RT &m02, const Kernel::RT &m03, + const Kernel::RT &m10, const Kernel::RT &m11, const Kernel::RT &m12, const Kernel::RT &m13, + const Kernel::RT &m20, const Kernel::RT &m21, const Kernel::RT &m22, const Kernel::RT &m23, + const Kernel::RT &hw = Kernel::RT(1));} + {introduces a general affine transformation of the matrix + form \ccTexHtml{\usebox{\arrthree}.}{ .} The part \ccTexHtml{$1\over hw$ + \usebox{\arrlinthree}}{hw-1 + } + defines the scaling and rotational part of the transformation, + while the vector \ccTexHtml{$1\over hw$\usebox{\transvecthree}}% + {hw-1 } contains the translational part.} + + +\savebox{\arrthree}{\small $\left(\begin{array}{cccc} + m_{00} & m_{01} & m_{02} & 0\\ + m_{10} & m_{11} & m_{12} & 0\\ + m_{20} & m_{21} & m_{22} & 0\\ + 0 & 0 & 0 &hw + \end{array}\right)$} + +\ccMemberFunction{Kernel::Aff_transformation_3 operator()( + const Kernel::RT &m00, const Kernel::RT &m01, const Kernel::RT& m02, + const Kernel::RT &m10, const Kernel::RT &m11, const Kernel::RT& m12, + const Kernel::RT &m20, const Kernel::RT &m21, const Kernel::RT& m22, + const Kernel::RT &hw = Kernel::RT(1));} + {introduces a general linear transformation of the + matrix form \ccTexHtml{\usebox{\arrthree},}{ ,} i.e.\ an affine transformation without + translational part.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_bisector_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_bisector_2.tex new file mode 100644 index 00000000000..c13f9a58adb --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_bisector_2.tex @@ -0,0 +1,10 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_bisector_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Line_2 operator()(const Kernel::Point_2&p, + const Kernel::Point_2&q );} +{constructs the bisector of $p$ and $q$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_circle_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_circle_2.tex new file mode 100644 index 00000000000..26658d5e117 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_circle_2.tex @@ -0,0 +1,55 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_circle_2} +A model for this must provide: + +\ccCreationVariable{fo} + + +\ccHidden +\ccMemberFunction{Kernel::Circle_2 operator()( );}{ + introduces an uninitialized variable of type + \ccClassTemplateName.} + +\ccMemberFunction{Kernel::Circle_2 operator()( Kernel::Point_2 const& center, + Kernel::FT const& squared_radius, + Orientation const& orientation + = COUNTERCLOCKWISE);}{ + introduces a variable of type \ccc{Kernel::Circle_2}. + It is initialized to the circle with center \ccc{center}, + squared radius \ccc{squared_radius} and orientation + \ccc{orientation}. + \ccPrecond \ccc{orientation} $\neq$ \ccc{COLLINEAR}, and further, + \ccc{squared_radius} $\geq$ 0.} + +\ccMemberFunction{Kernel::Circle_2 operator()( Kernel::Point_2 const& p, + Kernel::Point_2 const& q, + Kernel::Point_2 const& r);}{ + introduces a variable of type \ccc{Kernel::Circle_2}. + It is initialized to the unique circle which passes through + the points \ccc{p}, \ccc{q} and \ccc{r}. The orientation of + the circle is the orientation of the point triple \ccc{p}, + \ccc{q}, \ccc{r}. + \ccPrecond \ccc{p}, \ccc{q}, and \ccc{r} are not collinear.} + +\ccMemberFunction{Kernel::Circle_2 operator()( Kernel::Point_2 const& p, + Kernel::Point_2 const& q, + Orientation const& orientation + = COUNTERCLOCKWISE);}{ + introduces a variable of type \ccc{Kernel::Circle_2}. + It is initialized to the circle with diameter + $\ccTexHtml{\overline{pq}}{pq}$ + and orientation \ccc{orientation}. + \ccPrecond \ccc{orientation} $\neq$ \ccc{COLLINEAR}.} + +\ccMemberFunction{Kernel::Circle_2 operator()( Kernel::Point_2 const& center, + Orientation const& orientation + = COUNTERCLOCKWISE);}{ + introduces a variable of type \ccc{Kernel::Circle_2}. + It is initialized to the circle with center \ccc{center}, squared + radius zero and orientation \ccc{orientation}. + \ccPrecond \ccc{orientation} $\neq$ \ccc{COLLINEAR}. + \ccPostcond .\ccc{is_degenerate()} = \ccc{true}.} + +\ccHidden +\ccMemberFunction{Kernel::Circle_2 operator()( Kernel::Circle_2 const&);}{copy constructor.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_circumcenter_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_circumcenter_2.tex new file mode 100644 index 00000000000..5e70dab7c4e --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_circumcenter_2.tex @@ -0,0 +1,12 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_circumcenter_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_2&p, + const Kernel::Point_2&q, + const Kernel::Point_2&r);} + {compute the center of the circle passing through the points $p$, $q$, and $r$. + \ccPrecond $p$, $q$, and $r$ are not collinear.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_circumcenter_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_circumcenter_3.tex new file mode 100644 index 00000000000..1faa83d3bc0 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_circumcenter_3.tex @@ -0,0 +1,13 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_circumcenter_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_3&p, + const Kernel::Point_3&q, + const Kernel::Point_3&r, + const Kernel::Point_3&s);} + {compute the center of the circle passing through the points $p$, $q$, $r$, and $s$. + \ccPrecond $p$, $q$, $r$, and $s$ are not coplanar.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_direction_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_direction_2.tex new file mode 100644 index 00000000000..a4105c49bae --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_direction_2.tex @@ -0,0 +1,20 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_direction_2} +A model for this must provide: + +\ccCreationVariable{fo} + + +\ccHidden \ccMemberFunction{Kernel::Direction_2 operator()();} + {introduces an uninitialized direction .} + +\ccHidden \ccMemberFunction{Kernel::Direction_2 operator()(const Kernel::Direction_2 &d);} + {copy constructor.} + +\ccMemberFunction{Kernel::Direction_2 operator()(const Kernel::Vector_2 &v);} + {introduces the direction of vector $v$.} + +\ccMemberFunction{Kernel::Direction_2 operator()(const Kernel::RT &x, const Kernel::RT &y);} + {introduces a direction passing through the origin + and the point with Cartesian coordinates $(x, y)$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_direction_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_direction_3.tex new file mode 100644 index 00000000000..ea13b66f0bc --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_direction_3.tex @@ -0,0 +1,22 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_direction_3} +A model for this must provide: + +\ccCreationVariable{fo} + + +\ccHidden \ccMemberFunction{Kernel::Direction_3 operator()();} + {introduces an uninitialized direction .} + +\ccHidden \ccMemberFunction{Kernel::Direction_3 operator()(const Kernel::Direction_3 &d);} + {copy constructor.} + +\ccMemberFunction{Kernel::Direction_3 operator()(const Kernel::Vector_3 &v);} + {introduces a direction initialised with the + direction of vector $v$.} + +\ccMemberFunction{Kernel::Direction_3 operator()(const Kernel::RT &x, const Kernel::RT &y, const Kernel::RT &z);} + {introduces a direction initialised with the direction + from the origin to the point with Cartesian coordinates $(x, y, z)$.} + + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_direction_of_line_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_direction_of_line_2.tex new file mode 100644 index 00000000000..8651ae85883 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_direction_of_line_2.tex @@ -0,0 +1,10 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_direction_of_line_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Direction_2 operator()(const Kernel::Line_2&l);} + {returns the direction of $l$.} + + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_direction_of_line_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_direction_of_line_3.tex new file mode 100644 index 00000000000..9a3da1e3c7d --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_direction_of_line_3.tex @@ -0,0 +1,10 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_direction_of_line_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Direction_3 operator()(const Kernel::Line_3&l);} + {returns the direction of $l$.} + + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_direction_of_ray_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_direction_of_ray_2.tex new file mode 100644 index 00000000000..0716de8a1c3 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_direction_of_ray_2.tex @@ -0,0 +1,10 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_direction_of_ray_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Direction_2 operator()(const Kernel::Ray_2&r);} + {returns the direction of $r$.} + + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_direction_of_ray_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_direction_of_ray_3.tex new file mode 100644 index 00000000000..96dc0a2407b --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_direction_of_ray_3.tex @@ -0,0 +1,10 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_direction_of_ray_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Direction_3 operator()(const Kernel::Ray_3&r);} + {returns the direction of $r$.} + + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_iso_cuboid_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_iso_cuboid_3.tex new file mode 100644 index 00000000000..0dbdefefba5 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_iso_cuboid_3.tex @@ -0,0 +1,19 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_iso_cuboid_3} +A model for this must provide: + +\ccCreationVariable{fo} + + +\ccHidden \ccMemberFunction{Kernel::Iso_cuboid_3 operator()();} + {introduces an uninitialized variable .} + +\ccHidden \ccMemberFunction{Kernel::Iso_cuboid_3 operator()(const Iso_cuboid_3 &u);} + {copy constructor.} + +\ccMemberFunction{Kernel::Iso_cuboid_3 operator()(const Point_3 &p, + const Point_3 &q);} + {introduces an iso-oriented cuboid with diagonal + opposite vertices $p$ and $q$ such that $p$ is the + lexicographically smallest point in the cuboid.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_iso_rectangle_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_iso_rectangle_2.tex new file mode 100644 index 00000000000..40980a963fa --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_iso_rectangle_2.tex @@ -0,0 +1,19 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_iso_rectangle_2} +A model for this must provide: + +\ccCreationVariable{fo} + + +\ccHidden \ccMemberFunction{Kernel::Iso_rectangle_2 operator()();} + {introduces an uninitialized variable .} + +\ccHidden \ccMemberFunction{Kernel::Iso_rectangle_2 operator()(const Iso_rectangle_2 &u);} + {copy constructor.} + +\ccMemberFunction{Kernel::Iso_rectangle_2 operator()(const Point_2 &p, + const Point_2 &q);} + {introduces an iso-oriented rectangle with diagonal + opposite vertices $p$ and $q$ such that $p$ is the + lexicographically smallest point in the rectangle.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_line_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_line_2.tex new file mode 100644 index 00000000000..239efd18dd2 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_line_2.tex @@ -0,0 +1,32 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_line_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccHidden \ccMemberFunction{Kernel::Line_2 operator()();} + {introduces an uninitialized variable .} + +\ccHidden \ccMemberFunction{Kernel::Line_2 operator()(const Kernel::Line_2 &h);} + {copy constructor.} + +\ccMemberFunction{Kernel::Line_2 operator()(const Kernel::RT &a, const Kernel::RT &b, const Kernel::RT &c);} + {introduces a line with the line equation in Cartesian + coordinates $ax +by +c = 0$.} + +\ccMemberFunction{Kernel::Line_2 operator()(const Kernel::Point_2 &p, const Kernel::Point_2 &q);} + {introduces a line passing through the points $p$ and $q$. + Line is directed from $p$ to $q$.} + +\ccMemberFunction{Kernel::Line_2 operator()(const Kernel::Point_2 &p, const Kernel::Direction_2&d);} + {introduces a line passing through point $p$ with + direction $d$.} + +\ccMemberFunction{Kernel::Line_2 operator()(const Kernel::Segment_2 &s);} + {introduces a line supporting the segment $s$, + oriented from source to target.} + +\ccMemberFunction{Kernel::Line_2 operator()(const Kernel::Ray_2 &r);} + {introduces a line supporting the ray $r$, + with same orientation.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_line_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_line_3.tex new file mode 100644 index 00000000000..940618d8a2c --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_line_3.tex @@ -0,0 +1,29 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_line_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccHidden \ccMemberFunction{Kernel::Line_3 operator()();} + {introduces an uninitialized variable .} + +\ccHidden \ccMemberFunction{Kernel::Line_3 operator()(const Kernel::Line_3 &h);} + {copy constructor.} + +\ccMemberFunction{Kernel::Line_3 operator()(const Kernel::Point_3 &p, const Kernel::Point_3 &q);} + {introduces a line passing through the points $p$ and $q$. + Line is directed from $p$ to $q$.} + + +\ccMemberFunction{Kernel::Line_3 operator()(const Kernel::Point_3 &p, const Kernel::Direction_3&d);} + {introduces a line passing through point $p$ with + direction $d$.} + +\ccMemberFunction{Kernel::Line_3 operator()(const Kernel::Segment_3 &s);} + {returns the line supporting the segment $s$, + oriented from source to target.} + +\ccMemberFunction{Kernel::Line_3 operator()(const Kernel::Ray_3 &r);} + {returns the line supporting the ray $r$, with the + same orientation.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_max_point_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_max_point_2.tex new file mode 100644 index 00000000000..f1ed91ea632 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_max_point_2.tex @@ -0,0 +1,12 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_max_point_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Point_2 operator()(const Kernel::Iso_rectangle_2& i);} + {returns the upper right vertex of $i$).} + +\ccMemberFunction{Kernel::Point_2 operator()(const Kernel::Segment_2& );} + {returns the point of $s$ with lexicographically largest coordinates.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_max_point_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_max_point_3.tex new file mode 100644 index 00000000000..0f44bdb4bf1 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_max_point_3.tex @@ -0,0 +1,9 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_max_point_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Point_3 operator()(const Kernel::Segment_3& s);} + {returns the point of $s$ with lexicographically largest coordinates.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_midpoint_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_midpoint_2.tex new file mode 100644 index 00000000000..47a277ffaee --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_midpoint_2.tex @@ -0,0 +1,10 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_midpoint_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Point_2 operator()(const Kernel::Point_2& p, + const Kernel::Point_2& q );} + {computes the midpoint of the segment $pq$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_midpoint_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_midpoint_3.tex new file mode 100644 index 00000000000..6a27199d6d7 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_midpoint_3.tex @@ -0,0 +1,10 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_midpoint_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Point_3 operator()(const Kernel::Point_3& p, + const Kernel::Point_3& q );} + {computes the midpoint of the segment $pq$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_min_point_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_min_point_2.tex new file mode 100644 index 00000000000..37e3d004cff --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_min_point_2.tex @@ -0,0 +1,12 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_min_point_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Point_2 operator()(const Kernel::Iso_rectangle_2& i);} + {returns the lower left vertex of $i$.} + +\ccMemberFunction{Kernel::Point_2 operator()(const Kernel::Segment_2& s);} + {returns the point of $s$ with lexicographically smallest coordinates.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_min_point_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_min_point_3.tex new file mode 100644 index 00000000000..719340e8598 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_min_point_3.tex @@ -0,0 +1,9 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_min_point_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Point_3 operator()(const Kernel::Segment_3& s);} + {returns the point of $s$ with lexicographically smallest coordinates.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_opposite_circle_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_opposite_circle_2.tex new file mode 100644 index 00000000000..b95fd575055 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_opposite_circle_2.tex @@ -0,0 +1,10 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_opposite_circle_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Circle_2 operator()(const Kernel::Circle_2& c);} +{ returns the circle with the same center and squared radius as + $c$, but with opposite orientation.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_opposite_line_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_opposite_line_2.tex new file mode 100644 index 00000000000..1681a4eb76a --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_opposite_line_2.tex @@ -0,0 +1,10 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_opposite_line_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Line_2 operator()(const Kernel::Line_2& l);} +{returns the line representing the same set of points as $l$, +but with opposite direction.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_opposite_line_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_opposite_line_3.tex new file mode 100644 index 00000000000..cccff695937 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_opposite_line_3.tex @@ -0,0 +1,10 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_opposite_line_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Line_3 operator()(const Kernel::Line_3& l);} +{returns the line representing the same set of points as $l$, +but with opposite direction.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_opposite_plane_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_opposite_plane_3.tex new file mode 100644 index 00000000000..2d2cdc5e11e --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_opposite_plane_3.tex @@ -0,0 +1,10 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_opposite_plane_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Plane_3 operator()(const Kernel::Plane_3& p);} +{returns the plane representing the same set of points as $p$, +but with opposite orientation.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_opposite_ray_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_opposite_ray_2.tex new file mode 100644 index 00000000000..b9447506b42 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_opposite_ray_2.tex @@ -0,0 +1,9 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_opposite_ray_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Ray_2 operator()(const Kernel::Ray_2& r);} +{returns the ray with the same source as $r$, but in opposite direction.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_opposite_ray_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_opposite_ray_3.tex new file mode 100644 index 00000000000..c33d0a76c00 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_opposite_ray_3.tex @@ -0,0 +1,9 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_opposite_ray_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Ray_3 operator()(const Kernel::Ray_3& r);} +{returns the ray with the same source as $r$, but in opposite direction.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_opposite_segment_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_opposite_segment_2.tex new file mode 100644 index 00000000000..b84ddc37e80 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_opposite_segment_2.tex @@ -0,0 +1,10 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_opposite_segment_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Segment_2 operator()(const Kernel::Segment_2& s);} +{returns the segment representing the same set of points as $s$, +but with opposite orientation.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_opposite_segment_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_opposite_segment_3.tex new file mode 100644 index 00000000000..3458e2330b1 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_opposite_segment_3.tex @@ -0,0 +1,10 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_opposite_segment_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Segment_3 operator()(const Kernel::Segment_3& s);} +{returns the segment representing the same set of points as $s$, +but with opposite orientation.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_opposite_triangle_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_opposite_triangle_2.tex new file mode 100644 index 00000000000..9787751ba89 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_opposite_triangle_2.tex @@ -0,0 +1,11 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_opposite_triangle_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Triangle_2 operator()(const Kernel::Triangle_2& t);} + {returns the triangle with opposite orientation to $t$ + (this flips the positive and the negative side, but + not bounded and unbounded side).} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_perpendicular_direction_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_perpendicular_direction_2.tex new file mode 100644 index 00000000000..5a474cbac54 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_perpendicular_direction_2.tex @@ -0,0 +1,13 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_perpendicular_direction_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Direction_3 operator()(const Kernel::Direction_2& d, + cpnst Orientation& o);} + {introduces a direction orthogonal to \ccc{d}. If \ccc{o} is + \ccc{CLOCKWISE}, \ccc{d} is rotated clockwise; if \ccc{o} is + \ccc{COUNTERCLOCKWISE}, \ccc{d} is rotated counterclockwise. + \ccPrecond \ccc{o} is not \ccc{COLLINEAR}.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_perpendicular_direction_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_perpendicular_direction_3.tex new file mode 100644 index 00000000000..48fc3a7de3c --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_perpendicular_direction_3.tex @@ -0,0 +1,4 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_perpendicular_direction_3} + +\ccCreationVariable{fo} +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_perpendicular_line_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_perpendicular_line_2.tex new file mode 100644 index 00000000000..aa647499001 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_perpendicular_line_2.tex @@ -0,0 +1,12 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_perpendicular_line_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Line_2 operator()(const Kernel::Line_2& l, + const Kernel::Point_2& p);} + {returns the line perpendicular to $l$ and passing through $p$, + where the direction is the direction of $l$ rotated + counterclockwise by 90 degrees.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_perpendicular_line_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_perpendicular_line_3.tex new file mode 100644 index 00000000000..e88a0fd0694 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_perpendicular_line_3.tex @@ -0,0 +1,12 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_perpendicular_line_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Line_3 operator()(const Kernel::Plane_3& pl, + const Kernel::Point_3& p);} + {returns the line that is perpendicular to \ccc{pl} and that + passes through point \ccStyle{p}. The line is oriented from + the negative to the positive side of \ccc{pl}} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_perpendicular_plane_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_perpendicular_plane_3.tex new file mode 100644 index 00000000000..9bc0b7fca4d --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_perpendicular_plane_3.tex @@ -0,0 +1,12 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_perpendicular_plane_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Plane_3 operator()(const Kernel::Line_3& l, + const Kernel::Point_3& p);} +{returns the plane perpendicular to $l$ passing through $p$, +such that the normal direction of the plane coincides with the direction of +the line.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_perpendicular_vector_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_perpendicular_vector_2.tex new file mode 100644 index 00000000000..0a06ea944a5 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_perpendicular_vector_2.tex @@ -0,0 +1,13 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_perpendicular_vector_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Vector_2 operator()(const Kernel::Vector_2& v, + Orientation o);} +{returns \ccc{v} rotated clockwise by 90 degrees, if $o$ is +\ccc{CLOCKWISE}, and rotated counterclockwise otherwise. +\ccPrecond $o$ is not \ccc{COLLINEAR}. +} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_plane_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_plane_3.tex new file mode 100644 index 00000000000..dfc6f75b57c --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_plane_3.tex @@ -0,0 +1,50 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_plane_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccHidden \ccMemberFunction{Kernel::Plane_3 operator()();} + {introduces an uninitialized variable .} + +\ccHidden \ccMemberFunction{Kernel::Plane_3 operator()(const Kernel::Plane_3 &h);} + {copy constructor.} + +\ccMemberFunction{Kernel::Plane_3 operator()(const Kernel::RT &a, + const Kernel::RT &b, + const Kernel::RT &c, + const Kernel::RT &d);} +{creates a plane defined by the equation + \ccTexHtml{$a\, px +b\, py +c\, pz + d = 0$}{a px + b py + c pz + d = 0}. +Notice that is degenerate if \ccTexHtml{$a = b = c$}{a = b = c}.} + +\ccMemberFunction{Kernel::Plane_3 operator()(const Kernel::Point_3 &p, + const Kernel::Point_3 &q, + const Kernel::Point_3 &r);} +{creates a plane passing through the points \ccStyle{p}, + \ccStyle{q} and \ccStyle{r}. The plane is oriented such that \ccStyle{p}, + \ccStyle{q} and \ccStyle{r} are oriented in a positive sense + (that is counterclockwise) when seen from the positive side of . +Notice that is degenerate if the points are collinear.} + + +\ccMemberFunction{Kernel::Plane_3 operator()(const Kernel::Point_3 &p, + const Kernel::Direction_3&d);} +{introduces a plane that passes through point \ccStyle{p} and + that has as an orthogonal direction equal to \ccStyle{d}.} + +\ccMemberFunction{Kernel::Plane_3 operator()(const Kernel::Line_3 &l, + const Kernel::Point_3 &p);} +{introduces a plane that is defined through the three points + \ccStyle{l.point(0)}, \ccStyle{l.point(1)} and \ccStyle{p}.} + +\ccMemberFunction{Kernel::Plane_3 operator()(const Kernel::Ray_3 &r, + const Kernel::Point_3 &p);} +{introduces a plane that is defined through the three points + \ccStyle{r.point(0)}, \ccStyle{r.point(1)} and \ccStyle{p}.} + +\ccMemberFunction{Kernel::Plane_3 operator()(const Kernel::Segment_3 &s, + const Kernel::Point_3 &p);} +{introduces a plane that is defined through the three points + \ccStyle{s.source()}, \ccStyle{s.target()} and \ccStyle{p}.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_point_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_point_2.tex new file mode 100644 index 00000000000..4f74f2a438f --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_point_2.tex @@ -0,0 +1,24 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_point_2} +A model for this must provide: + +\ccCreationVariable{fo} + + +\ccHidden \ccMemberFunction{Kernel::Point_2 operator()();} + {introduces an uninitialized variable .} + +\ccHidden \ccMemberFunction{Kernel::Point_2 operator()(const Kernel::Point_2 &q);} + {copy constructor.} + +\ccMemberFunction{Kernel::Point_2 operator()(const Origin &ORIGIN);} + {introduces a variable with Cartesian coordinates + $(0,0)$.} + +\ccMemberFunction{Kernel::Point_2 operator()(const Kernel::RT &hx, const Kernel::RT &hy, const Kernel::RT &hw = Kernel::RT(1));} + {introduces a point initialized to $(hx/hw,hy/hw)$. + If the third argument is not explicitly given, it defaults + to \ccStyle{Kernel::RT(1)}. + \ccPrecond \ccc{hw} $\neq$ \ccc{Kernel::RT(0)}. } + + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_point_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_point_3.tex new file mode 100644 index 00000000000..4c0d5c1f159 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_point_3.tex @@ -0,0 +1,21 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_point_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccHidden \ccMemberFunction{Kernel::Point_3 operator()();} + {introduces an uninitialized variable .} + +\ccHidden \ccMemberFunction{Kernel::Point_3 operator()(const Kernel::Point_3 &q);} + {copy constructor.} + +\ccMemberFunction{Kernel::Point_3 operator()(const Origin &ORIGIN);} + {introduces a point with Cartesian coordinates$(0,0,0)$.} + +\ccMemberFunction{Kernel::Point_3 operator()(const Kernel::RT &hx, const Kernel::RT &hy, const Kernel::RT &hz, const Kernel::RT &hw = Kernel::RT(1));} + {introduces a point initialized to $(hx/hw,hy/hw, hz/hw)$. + If the third argument is not explicitly given it defaults + to \ccStyle{Kernel::RT(1)}. + \ccPrecond \ccc{hw} $\neq$ \ccc{Kernel::RT(0)}. } + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_point_d.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_point_d.tex new file mode 100644 index 00000000000..665b80dbc38 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_point_d.tex @@ -0,0 +1,17 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_point_d} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{template +Kernel::Construct_point_d operator()(int dim, InputIterator first, + InputIterator last);} + {if the range \ccc{[first,last)} contains \ccc{dim} elements, + this creates a point with Cartesian coordinates as specified by + the range. If \ccc{[first,last)} contains \ccc{dim+1} elements, + the range specifies the homogeneous coordinates of the point. + \ccPrecond \ccc{dim} is nonnegative, \ccc{[first,last)} has + \ccc{dim} or \ccc{dim+1} elements, and the value types of first + and last are \ccc{Kernel::RT}.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_point_on_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_point_on_2.tex new file mode 100644 index 00000000000..29a3ef08645 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_point_on_2.tex @@ -0,0 +1,26 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_point_on_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Point_2 operator()(const Kernel::Line_2& l, + int i);} + {returns an arbitrary point on \ccc{l}. It holds + \ccStyle{point(i) == point(j)}, iff \ccStyle{i==j}. + Furthermore, is directed from \ccStyle{point(i)} + to \ccStyle{point(j)}, for all \ccStyle{i} $<$ \ccStyle{j}.} + +\ccMemberFunction{Kernel::Point_2 operator()(const Kernel::Ray_2& r, + int i);} + {returns a point on \ccc{r}. \ccStyle{point(0)} is the source, + \ccStyle{point(i)}, with $i>0$, is different from the + source. \ccPrecond $i \geq 0$.} + +\ccMemberFunction{Kernel::Point_2 operator()(const Kernel::Segment_2& s, + int i);} + {returns source or target of \ccc{s}: \ccStyle{point(0)} returns + the source of \ccc{s}, \ccStyle{point(1)} returns the target of \ccc{s}. + The parameter \ccStyle{i} is taken modulo 2, which gives + easy access to the other end point. } + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_point_on_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_point_on_3.tex new file mode 100644 index 00000000000..b7defe6aa46 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_point_on_3.tex @@ -0,0 +1,29 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_point_on_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Point_3 operator()(const Kernel::Line_3& l, + int i);} + {returns an arbitrary point on \ccc{l}. It holds + \ccStyle{point(i) == point(j)}, iff \ccStyle{i==j}. + Furthermore, is directed from \ccStyle{point(i)} + to \ccStyle{point(j)}, for all \ccStyle{i} $<$ \ccStyle{j}.} + +\ccMemberFunction{Kernel::Point_3 operator()(const Kernel::Plane_3& h);} + {returns an arbitrary point on \ccc{h}.} + +\ccMemberFunction{Kernel::Point_3 operator()(const Kernel::Ray_3& r, + int i);} + {returns a point on \ccc{r}. \ccStyle{point(0)} is the source, + \ccStyle{point(i)}, with $i>0$, is different from the + source. \ccPrecond $i \geq 0$.} + +\ccMemberFunction{Kernel::Point_3 operator()(const Kernel::Segment_3& s, + int i);} + {returns source or target of \ccc{s}: \ccStyle{point(0)} returns + the source of \ccc{s}, \ccStyle{point(1)} returns the target of \ccc{s}. + The parameter \ccStyle{i} is taken modulo 2, which gives + easy access to the other end point. } + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_ray_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_ray_2.tex new file mode 100644 index 00000000000..96bc369d221 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_ray_2.tex @@ -0,0 +1,21 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_ray_2} +A model for this must provide: + +\ccCreationVariable{fo} + + +\ccHidden \ccMemberFunction{Kernel::Ray_2 operator()();} + {introduces an uninitialized variable .} + +\ccHidden \ccMemberFunction{Kernel::Ray_2 operator()(const Kernel::Ray_2 &s);} + {copy constructor.} + +\ccMemberFunction{Kernel::Ray_2 operator()(const Kernel::Point_2 &p, const Kernel::Point_2&q);} + {introduces a ray + with source $p$ and passing through point $q$.} + +\ccMemberFunction{Kernel::Ray_2 operator()(const Kernel::Point_2 &p, const Kernel::Direction_2 &d);} + {introduces a ray starting at source $p$ with + direction $d$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_ray_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_ray_3.tex new file mode 100644 index 00000000000..717af127a55 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_ray_3.tex @@ -0,0 +1,21 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_ray_3} +A model for this must provide: + +\ccCreationVariable{fo} + + +\ccHidden \ccMemberFunction{Kernel::Ray_3 operator()();} + {introduces an uninitialized variable .} + +\ccHidden \ccMemberFunction{Kernel::Ray_3 operator()(const Kernel::Ray_3 &s);} + {copy constructor.} + +\ccMemberFunction{Kernel::Ray_3 operator()(const Kernel::Point_3 &p, const Kernel::Point_3 &q);} + {introduces a ray + with source $p$ and passing through point $q$.} + +\ccMemberFunction{Kernel::Ray_3 operator()(const Kernel::Point_3 &p, const Kernel::Direction_3 &d);} + {introduces a ray with source $p$ and with + direction $d$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_second_point_on_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_second_point_on_2.tex new file mode 100644 index 00000000000..75b57172ea1 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_second_point_on_2.tex @@ -0,0 +1,9 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_second_point_on_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Point_2 operator()(const Kernel::Ray_2& r);} +{returns a point on $r$ different from the source of $r$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_second_point_on_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_second_point_on_3.tex new file mode 100644 index 00000000000..c14ed935863 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_second_point_on_3.tex @@ -0,0 +1,9 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_second_point_on_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Point_3 operator()(const Kernel::Ray_3& r);} +{returns a point on $r$ different from the source of $r$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_segment_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_segment_2.tex new file mode 100644 index 00000000000..e64984968b4 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_segment_2.tex @@ -0,0 +1,19 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_segment_2} +A model for this must provide: + +\ccCreationVariable{fo} + + + +\ccHidden \ccMemberFunction{Kernel::Segment_2 operator()();} + {introduces an uninitialized variable .} + +\ccHidden \ccMemberFunction{Kernel::Segment_2 operator()(const Kernel::Segment_2 &q);} + {copy constructor.} + +\ccMemberFunction{Kernel::Segment_2 operator()(const Kernel::Point_2 &p, const Kernel::Point_2 &q);} + {introduces a segment with source $p$ + and target $q$. The segment is directed from the source towards + the target.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_segment_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_segment_3.tex new file mode 100644 index 00000000000..87282a04d34 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_segment_3.tex @@ -0,0 +1,19 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_segment_3} +A model for this must provide: + +\ccCreationVariable{fo} + + +\ccHidden \ccMemberFunction{Kernel::Segment_3 operator()();} + {introduces an uninitialized variable .} + +\ccHidden \ccMemberFunction{Kernel::Segment_3 operator()(const Kernel::Segment_3 &q);} + {copy constructor.} + +\ccMemberFunction{Kernel::Segment_3 operator()(const Kernel::Point_3 &p, const Kernel::Point_3 &q);} + {introduces a segment with source $p$ + and target $q$. It is directed from the source towards + the target.} + + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_source_point_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_source_point_2.tex new file mode 100644 index 00000000000..ccf88c428f8 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_source_point_2.tex @@ -0,0 +1,12 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_source_point_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Point_2 operator()(const Kernel::Ray_2& r);} +{returns the source of $r$.} + +\ccMemberFunction{Kernel::Point_2 operator()(const Kernel::Segment_2& s);} +{returns the source of $s$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_source_point_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_source_point_3.tex new file mode 100644 index 00000000000..b27f027ad5f --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_source_point_3.tex @@ -0,0 +1,12 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_source_point_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Point_3 operator()(const Kernel::Ray_3& r);} +{returns the source of $r$.} + +\ccMemberFunction{Kernel::Point_3 operator()(const Kernel::Segment_3& s);} +{returns the source of $s$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_sphere_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_sphere_3.tex new file mode 100644 index 00000000000..ddc37148434 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_sphere_3.tex @@ -0,0 +1,60 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_sphere_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccHidden +\ccMemberFunction{ Kernel::Sphere_3( );}{ + introduces an uninitialized variable of type + \ccRefName.} + +\ccMemberFunction{ Kernel::Sphere_3( Kernel::Point_3 const& center, + Kernel::FT const& squared_radius, + Orientation const& orientation = COUNTERCLOCKWISE);}{ + introduces a sphere initialized to the sphere with center \ccc{center}, + squared radius \ccc{squared_radius} and orientation + \ccc{orientation}. + \ccPrecond \ccc{orientation} $\neq$ \ccc{COPLANAR}, and furthermore, + \ccc{squared_radius} $\geq$ 0.} + +\ccMemberFunction{ Kernel::Sphere_3( Kernel::Point_3 const& p, + Kernel::Point_3 const& q, + Kernel::Point_3 const& r, + Kernel::Point_3 const& s);}{ + introduces a sphere initialized to the unique sphere which passes through + the points \ccc{p}, \ccc{q}, \ccc{r} and \ccc{s}. The orientation of + the sphere is the orientation of the point quadruple \ccc{p}, + \ccc{q}, \ccc{r}, \ccc{s}. + \ccPrecond \ccc{p}, \ccc{q}, \ccc{r}, and \ccc{s} are not collinear.} + + +\ccMemberFunction{ Kernel::Sphere_3( Point_3 const& p, + Kernel::Point_3 const& q, + Kernel::Point_3 const& r, + const Orientation& o = COUNTERCLOCKWISE);}{ + introduces a sphere initialized to the smallest sphere which passes through + the points \ccc{p}, \ccc{q}, and \ccc{r}. The orientation of + the sphere is \ccc{o}. \ccPrecond \ccc{o} is not + \ccc{COPLANAR}.} + +\ccMemberFunction{ Kernel::Sphere_3( Kernel::Point_3 const& p, + Kernel::Point_3 const& q, + const Orientation& o = COUNTERCLOCKWISE);}{ + introduces a sphere initialized to the smallest sphere which passes through + the points \ccc{p} and \ccc{q}. The orientation of + the sphere is \ccc{o}. \ccPrecond \ccc{o} is not + \ccc{COPLANAR}.} + + +\ccMemberFunction{ Kernel::Sphere_3( Kernel::Point_3 const& center, + Orientation const& orientation = COUNTERCLOCKWISE);}{ + introduces a sphere $s$ initialized to the sphere with center + \ccc{center}, squared radius zero and orientation \ccc{orientation}. + \ccPrecond \ccc{orientation} $\neq$ \ccc{COPLANAR}. + \ccPostcond \ccc{s.is_degenerate()} = \ccc{true}.} + +\ccHidden +\ccMemberFunction{ Kernel::Sphere_3( Kernel::Sphere_3 const&);}{ + copy constructor.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_supporting_line_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_supporting_line_2.tex new file mode 100644 index 00000000000..6ac8d586c7f --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_supporting_line_2.tex @@ -0,0 +1,13 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_supporting_line_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Line_2 operator()(const Kernel::Ray_2& r);} + {returns the line supporting $r$ which has the same direction.} + +\ccMemberFunction{Kernel::Line_2 operator()(const Kernel::Segment_2& s);} + {returns the line $l$ passing through $s$. Line $l$ has the + same orientation as segment $s$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_supporting_line_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_supporting_line_3.tex new file mode 100644 index 00000000000..bb3836529e4 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_supporting_line_3.tex @@ -0,0 +1,13 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_supporting_line_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Line_3 operator()(const Kernel::Ray_3& r);} + {returns the line supporting $r$ which has the same direction.} + +\ccMemberFunction{Kernel::Line_3 operator()(const Kernel::Segment_3& s);} + {returns the line $l$ passing through $s$. Line $l$ has the + same orientation as segment $s$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_supporting_plane_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_supporting_plane_3.tex new file mode 100644 index 00000000000..81d0f924b7a --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_supporting_plane_3.tex @@ -0,0 +1,9 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_supporting_plane_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Plane_3 operator()(const Kernel::Triangle_3& t);} + {returns the supporting plane of $t$, with same orientation.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_target_point_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_target_point_2.tex new file mode 100644 index 00000000000..cbcbbc98f57 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_target_point_2.tex @@ -0,0 +1,9 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_target_point_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Point_2 operator()(const Kernel::Segment_2& s);} +{returns the target of $s$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_target_point_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_target_point_3.tex new file mode 100644 index 00000000000..fc40ef82c66 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_target_point_3.tex @@ -0,0 +1,9 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_target_point_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Point_3 operator()(const Kernel::Segment_3& s);} +{returns the target of $s$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_tetrahedron_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_tetrahedron_3.tex new file mode 100644 index 00000000000..e09d2c7ded1 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_tetrahedron_3.tex @@ -0,0 +1,20 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_tetrahedron_3} +A model for this must provide: + +\ccCreationVariable{fo} + + +\ccHidden \ccMemberFunction{Kernel::Tetrahedron_3 operator()();} + {introduces an uninitialized variable .} + +\ccHidden \ccMemberFunction{Kernel::Tetrahedron_3 operator()(const Kernel::Tetrahedron_3 &u);} + {copy constructor.} + + +\ccMemberFunction{Kernel::Tetrahedron_3 operator()(const Kernel::Point_3 &p0, + const Kernel::Point_3 &p1, + const Kernel::Point_3 &p2, + const Kernel::Point_3 &p3);} + {introduces a tetrahedron with vertices $p_0$, $p_1$, $p_2$ and $p_3$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_triangle_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_triangle_2.tex new file mode 100644 index 00000000000..9564c5c673a --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_triangle_2.tex @@ -0,0 +1,18 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_triangle_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccHidden \ccMemberFunction{Kernel::Triangle_2 operator()();} + {introduces an uninitialized variable .} + +\ccHidden \ccMemberFunction{Kernel::Triangle_2 operator()(const Kernel::Triangle_2 &u);} + {copy constructor.} + + +\ccMemberFunction{Kernel::Triangle_2 operator()(const Kernel::Point_2 &p, + const Kernel::Point_2 &q, + const Kernel::Point_2 &r);} + {introduces a triangle with vertices $p$, $q$ and $r$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_triangle_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_triangle_3.tex new file mode 100644 index 00000000000..668bc979c93 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_triangle_3.tex @@ -0,0 +1,18 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_triangle_3} +A model for this must provide: + +\ccCreationVariable{fo} + + +\ccHidden \ccMemberFunction{Kernel::Triangle_3 operator()();} + {introduces an uninitialized variable .} + +\ccHidden \ccMemberFunction{Kernel::Triangle_3 operator()(const Kernel::Triangle_3 &u);} + {copy constructor.} + +\ccMemberFunction{Kernel::Triangle_3 operator()(const Kernel::Point_3 &p, + const Kernel::Point_3 &q, + const Kernel::Point_3 &r);} + {introduces a triangle with vertices $p$, $q$ and $r$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_vector_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_vector_2.tex new file mode 100644 index 00000000000..afa98ebdaca --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_vector_2.tex @@ -0,0 +1,22 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_vector_2} +A model for this must provide: + +\ccCreationVariable{fo} + + +\ccHidden\ccMemberFunction{Kernel::Vector_2 operator()();} + {introduces an uninitialized variable .} + +\ccHidden \ccMemberFunction{Kernel::Vector_2 operator()(const Kernel::Vector_2 &w);} + {copy constructor.} + +\ccMemberFunction{Kernel::Vector_2 operator()(const Null_vector &NULL_VECTOR);} + {introduces a null vector .} + +\ccMemberFunction{Kernel::Vector_2 operator()(const Kernel::RT &hx, const Kernel::RT &hy, const Kernel::RT &hw = Kernel::RT(1));} + {introduces a vector initialized to $(hx/hw,hy/hw)$. + If the third argument is not explicitly given, it defaults + to \ccStyle{Kernel::RT(1)}. + \ccPrecond \ccTexHtml{$hw\neq 0$}{hw not equal to 0} } + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_vector_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_vector_3.tex new file mode 100644 index 00000000000..beed8f43d82 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Construct_vector_3.tex @@ -0,0 +1,21 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Construct_vector_3} +A model for this must provide: + +\ccCreationVariable{fo} + + +\ccHidden\ccMemberFunction{Kernel::Vector_3 operator()();} + {introduces an uninitialized variable .} + +\ccHidden \ccMemberFunction{Kernel::Vector_3 operator()(const Kernel::Vector_3 &w);} + {copy constructor.} + +\ccMemberFunction{Kernel::Vector_3 operator()(const Null_vector &NULL_VECTOR);} + {introduces a null vector .} + +\ccMemberFunction{Kernel::Vector_3 operator()(const Kernel::RT &hx, const Kernel::RT &hy, const Kernel::FT &hz, const Kernel::RT &hw = Kernel::RT(1));} + {introduces a vector initialized to $(hx/hw, hy/hw, hz/hw)$. + If the third argument is not explicitly given it defaults + to \ccStyle{Kernel::RT(1)}.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Coplanar_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Coplanar_3.tex new file mode 100644 index 00000000000..5f4ea685c50 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Coplanar_3.tex @@ -0,0 +1,12 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Coplanar_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_2&p, + const Kernel::Point_2&q, + const Kernel::Point_2&r, + const Kernel::Point_2&s);} +{returns \ccStyle{true}, if $p$, $q$, $r$, and $s$ are coplanar.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Coplanar_orientation_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Coplanar_orientation_3.tex new file mode 100644 index 00000000000..26e2d3e52a4 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Coplanar_orientation_3.tex @@ -0,0 +1,21 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Coplanar_orientation_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Orientation operator()(const Kernel::Point_2&p, + const Kernel::Point_2&q, + const Kernel::Point_2&r, + const Kernel::Point_2&s);} + {Let $P$ be the plane defined by the points \ccc{p}, \ccc{q}, + and \ccc{r}. Note that the order defines the orientation of + $P$. The function computes the orientation of points \ccc{p}, + \ccc{q}, and \ccc{s} in $P$: Iff \ccc{p}, \ccc{q}, \ccc{s} are + collinear, \ccc{COLLINEAR} is returned. Iff $P$ and the plane + defined by \ccc{p}, \ccc{q}, and \ccc{s} have the same orientation, + \ccc{POSITIVE} is returned; otherwise \ccc{NEGATIVE} is returned. + \ccPrecond \ccc{p}, \ccc{q}, \ccc{r}, and \ccc{s} are coplanar and + \ccc{p}, \ccc{q}, and \ccc{r} are not collinear.} + +\end{ccRefFunctionObjectConcept} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Counterclockwise_in_between_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Counterclockwise_in_between_2.tex new file mode 100644 index 00000000000..05d21b29dd8 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Counterclockwise_in_between_2.tex @@ -0,0 +1,16 @@ + +\begin{ccRefFunctionObjectConcept}{Kernel::Counterclockwise_in_between_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Direction_2&d, + const Kernel::Direction_2&d1, + const Kernel::Direction_2&d2);} +{returns \ccc{true} iff \ccc{d} is not equal to \ccc{d1}, and + while rotating counterclockwise starting at \ccc{d1}, + \ccc{d} is reached strictly before \ccc{d2} is reached. + Note that true is returned if \ccc{d1} == \ccc{d2}, unless + also \ccc{d} == \ccc{d1}.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Direction_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Direction_2.tex new file mode 100644 index 00000000000..ffe7852792a --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Direction_2.tex @@ -0,0 +1,11 @@ +\begin{ccRefConcept}{Kernel::Direction_2} +A type representing directions in two dimensions. + +\ccRefines +\ccc{CopyConstructable}, +\ccc{Assignable} + +\ccSeeAlso +\ccc{Kernel::Construct_direction_2} + +\end{ccRefConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Direction_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Direction_3.tex new file mode 100644 index 00000000000..fbc93c1fdd9 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Direction_3.tex @@ -0,0 +1,11 @@ +\begin{ccRefConcept}{Kernel::Direction_3} +A type representing directions in three dimensions. + +\ccRefines +\ccc{CopyConstructable}, +\ccc{Assignable} + +\ccSeeAlso +\ccc{Kernel::Construct_direction_3} + +\end{ccRefConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Equal_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Equal_2.tex new file mode 100644 index 00000000000..2a7dc4fed6a --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Equal_2.tex @@ -0,0 +1,10 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Equal_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_2&p, + const Kernel::Point_2&q);} +{returns true iff $p$ and $q$ are equal (as two-dimensional points);} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Equal_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Equal_3.tex new file mode 100644 index 00000000000..cdef653b80b --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Equal_3.tex @@ -0,0 +1,10 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Equal_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_3&p, + const Kernel::Point_3&q);} +{returns true iff $p$ and $q$ are equal (as three-dimensional points);} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Equal_x_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Equal_x_2.tex new file mode 100644 index 00000000000..3df724cbfd1 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Equal_x_2.tex @@ -0,0 +1,10 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Equal_x_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_2&p, + const Kernel::Point_2&q);} +{returns true iff $p$ and $q$ have the same Cartesian $x$-coordinate.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Equal_x_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Equal_x_3.tex new file mode 100644 index 00000000000..9a70534d0d5 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Equal_x_3.tex @@ -0,0 +1,10 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Equal_x_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_3&p, + const Kernel::Point_3&q);} +{returns true iff $p$ and $q$ have the same Cartesian $x$-coordinate.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Equal_xy_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Equal_xy_2.tex new file mode 100644 index 00000000000..0862353141c --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Equal_xy_2.tex @@ -0,0 +1,11 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Equal_xy_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_2&p, + const Kernel::Point_2&q);} +{returns true iff $p$ and $q$ have the same Cartesian $x$-coordinate +and the same Cartesian $y$-coordinate.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Equal_xy_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Equal_xy_3.tex new file mode 100644 index 00000000000..43d320dc39d --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Equal_xy_3.tex @@ -0,0 +1,11 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Equal_xy_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_3&p, + const Kernel::Point_3&q);} +{returns true iff $p$ and $q$ have the same Cartesian $x$-coordinate +and the same Cartesian $y$-coordinate.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Equal_xyz_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Equal_xyz_3.tex new file mode 100644 index 00000000000..1f94914f9fc --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Equal_xyz_3.tex @@ -0,0 +1,11 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Equal_xyz_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_3&p, + const Kernel::Point_3&q);} +{returns true iff $p$ and $q$ have the same Cartesian $x$-coordinate, +the same Cartesian $y$-coordinate, and the same Cartesian $z$-coordinate.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Equal_y_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Equal_y_2.tex new file mode 100644 index 00000000000..2e78f5c3f5d --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Equal_y_2.tex @@ -0,0 +1,10 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Equal_y_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_2&p, + const Kernel::Point_2&q);} +{returns true iff $p$ and $q$ have the same Cartesian $y$-coordinate.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Equal_y_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Equal_y_3.tex new file mode 100644 index 00000000000..257b8aa2dfd --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Equal_y_3.tex @@ -0,0 +1,10 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Equal_y_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_3&p, + const Kernel::Point_3&q);} +{returns true iff $p$ and $q$ have the same Cartesian $y$-coordinate.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Equal_z_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Equal_z_3.tex new file mode 100644 index 00000000000..8718edf7b58 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Equal_z_3.tex @@ -0,0 +1,10 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Equal_z_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_3&p, + const Kernel::Point_3&q);} +{returns true iff $p$ and $q$ have the same Cartesian $z$-coordinate.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::FT.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::FT.tex new file mode 100644 index 00000000000..ee1d6614c6e --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::FT.tex @@ -0,0 +1,9 @@ +\begin{ccRefConcept}{Kernel::FT} + +A number type representing field elements, i.e., must be closed under +operations $+$, $-$, $*$ and also under division operation $/$. + +\ccRefines +\ccc{CopyConstructable}, \ccc{Assignable}\\ +\ccc{NumberType}, \ccc{Kernel::RT} +\end{ccRefConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_2.tex new file mode 100644 index 00000000000..9317d085157 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_2.tex @@ -0,0 +1,18 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Has_on_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Line_2&l, + const Kernel::Point_2&p);} +{returns true iff $p$ lies on $l$.} + +\ccMemberFunction{bool operator()(const Kernel::Ray_2&r, + const Kernel::Point_2&p);} +{returns true iff $p$ lies on $r$.} + +\ccMemberFunction{bool operator()(const Kernel::Segment_2&s, + const Kernel::Point_2&p);} +{returns true iff $p$ lies on $s$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_3.tex new file mode 100644 index 00000000000..ac44284bf95 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_3.tex @@ -0,0 +1,22 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Has_on_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Line_3&l, + const Kernel::Point_3&p);} +{returns true iff $p$ lies on $l$.} + +\ccMemberFunction{bool operator()(const Kernel::Ray_3&r, + const Kernel::Point_3&p);} +{returns true iff $p$ lies on $r$.} + +\ccMemberFunction{bool operator()(const Kernel::Segment_3&s, + const Kernel::Point_3&p);} +{returns true iff $p$ lies on $s$.} + +\ccMemberFunction{bool operator()(const Kernel::Triangle_3&t, + const Kernel::Point_3&p);} +{returns true iff $p$ lies on $t$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_boundary_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_boundary_2.tex new file mode 100644 index 00000000000..ce623313790 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_boundary_2.tex @@ -0,0 +1,22 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Has_on_boundary_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Circle_2&c, + const Kernel::Point_2&p);} +{returns true iff $p$ lies on the boundary of $c$.} + +\ccMemberFunction{bool operator()(const Kernel::Iso_rectangle_2&i, + const Kernel::Point_2&p);} +{returns true iff $p$ lies on the boundary of $i$.} + +\ccMemberFunction{bool operator()(const Kernel::Line_2&l, + const Kernel::Point_2&p);} +{returns true iff $p$ lies on $l$ ($l$ is considered a halfspace).} + +\ccMemberFunction{bool operator()(const Kernel::Triangle_2&t, + const Kernel::Point_2&p);} +{returns true iff $p$ lies on the boundary of $t$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_boundary_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_boundary_3.tex new file mode 100644 index 00000000000..aa03aee7854 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_boundary_3.tex @@ -0,0 +1,14 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Has_on_boundary_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Plane_3&h, + const Kernel::Point_3&p);} +{returns true iff $p$ lies on $h$ ($h$ is considered a halfspace).} + +\ccMemberFunction{bool operator()(const Kernel::Tetrahedron_3&t, + const Kernel::Point_3&p);} +{returns true iff $p$ lies on the boundary of $t$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_bounded_side_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_bounded_side_2.tex new file mode 100644 index 00000000000..4e2c786ca57 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_bounded_side_2.tex @@ -0,0 +1,18 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Has_on_bounded_side_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Circle_2&c, + const Kernel::Point_2&p);} +{returns true iff $p$ lies on the bounded side of $c$.} + +\ccMemberFunction{bool operator()(const Kernel::Iso_rectangle_2&i, + const Kernel::Point_2&p);} +{returns true iff $p$ lies on the bounded side of $i$.} + +\ccMemberFunction{bool operator()(const Kernel::Triangle_2&t, + const Kernel::Point_2&p);} +{returns true iff $p$ lies on the bounded side of $t$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_bounded_side_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_bounded_side_3.tex new file mode 100644 index 00000000000..8d3053647ab --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_bounded_side_3.tex @@ -0,0 +1,14 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Has_on_bounded_side_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Iso_cuboid_3&i, + const Kernel::Point_3&p);} +{returns true iff $p$ lies on the bounded side of $i$.} + +\ccMemberFunction{bool operator()(const Kernel::Tetrahedron_3&t, + const Kernel::Point_3&p);} +{returns true iff $p$ lies on the bounded side of $t$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_negative_side_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_negative_side_2.tex new file mode 100644 index 00000000000..c399b32c5eb --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_negative_side_2.tex @@ -0,0 +1,19 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Has_on_negative_side_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Circle_2&c, + const Kernel::Point_2&p);} +{returns true iff $p$ lies on the negative side of $c$.} + +\ccMemberFunction{bool operator()(const Kernel::Line_2&l, + const Kernel::Point_2&p);} +{returns true iff $p$ lies on the negative side of $l$ +($l$ is considered a halfspace).} + +\ccMemberFunction{bool operator()(const Kernel::Triangle_2&t, + const Kernel::Point_2&p);} +{returns true iff $p$ lies on the negative side of $t$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_negative_side_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_negative_side_3.tex new file mode 100644 index 00000000000..d698cd10e39 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_negative_side_3.tex @@ -0,0 +1,15 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Has_on_negative_side_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Plane_3&h, + const Kernel::Point_3&p);} +{returns true iff $p$ lies on the negative side of $h$ +($h$ is considered a halfspace).} + +\ccMemberFunction{bool operator()(const Kernel::Tetrahedron_3&t, + const Kernel::Point_3&p);} +{returns true iff $p$ lies on the negative side of $t$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_positive_side_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_positive_side_2.tex new file mode 100644 index 00000000000..ae135ea55bc --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_positive_side_2.tex @@ -0,0 +1,19 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Has_on_positive_side_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Circle_2&c, + const Kernel::Point_2&p);} +{returns true iff $p$ lies on the positive side of $c$.} + +\ccMemberFunction{bool operator()(const Kernel::Line_2&l, + const Kernel::Point_2&p);} +{returns true iff $p$ lies on the positive side of $l$ +($l$ is considered a halfspace).} + +\ccMemberFunction{bool operator()(const Kernel::Triangle_2&t, + const Kernel::Point_2&p);} +{returns true iff $p$ lies on the positive side of $t$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_positive_side_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_positive_side_3.tex new file mode 100644 index 00000000000..1d9c495c02f --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_positive_side_3.tex @@ -0,0 +1,15 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Has_on_positive_side_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Plane_3&h, + const Kernel::Point_3&p);} +{returns true iff $p$ lies on the positive side of $h$ +($h$ is considered a halfspace).} + +\ccMemberFunction{bool operator()(const Kernel::Tetrahedron_3&t, + const Kernel::Point_3&p);} +{returns true iff $p$ lies on the positive side of $t$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_unbounded_side_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_unbounded_side_2.tex new file mode 100644 index 00000000000..7ec664e38d2 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_unbounded_side_2.tex @@ -0,0 +1,18 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Has_on_unbounded_side_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Circle_2&c, + const Kernel::Point_2&p);} +{returns true iff $p$ lies on the unbounded side of $c$.} + +\ccMemberFunction{bool operator()(const Kernel::Iso_rectangle_2&i, + const Kernel::Point_2&p);} +{returns true iff $p$ lies on the unbounded side of $i$.} + +\ccMemberFunction{bool operator()(const Kernel::Triangle_2&t, + const Kernel::Point_2&p);} +{returns true iff $p$ lies on the unbounded side of $t$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_unbounded_side_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_unbounded_side_3.tex new file mode 100644 index 00000000000..1bbff6c84f3 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Has_on_unbounded_side_3.tex @@ -0,0 +1,14 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Has_on_unbounded_side_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Iso_cuboid_3&i, + const Kernel::Point_3&p);} +{returns true iff $p$ lies on the unbounded side of $i$.} + +\ccMemberFunction{bool operator()(const Kernel::Tetrahedron&t, + const Kernel::Point_3&p);} +{returns true iff $p$ lies on the unbounded side of $t$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Intersect_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Intersect_2.tex new file mode 100644 index 00000000000..82b6a727f4b --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Intersect_2.tex @@ -0,0 +1,21 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Intersect_2} +A model for this must provide + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Object_2 operator()(Type1 obj1, Type2 obj2);} +{computes the \ccHtmlNoLinksFrom{intersection} region of two geometrical objects of type +\ccStyle{Type1} and \ccStyle{Type2}} + +for all pairs \ccStyle{Type1} and \ccStyle{Type2}, where +the types \ccStyle{Type1} and \ccStyle{Type2} can be any of the +following: +\begin{itemize}\ccTexHtml{\itemsep0pt\topsep0pt\partopsep0pt\parskip0pt\parsep0pt}{} +\item \ccStyle{Kernel::Line_2} +\item \ccStyle{Kernel::Ray_2} +\item \ccStyle{Kernel::Segment_2} +\item \ccStyle{Kernel::Triangle_2} +\item \ccStyle{Kernel::Iso_rectangle_2} +\end{itemize} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Intersect_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Intersect_3.tex new file mode 100644 index 00000000000..a41fdcb6c6d --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Intersect_3.tex @@ -0,0 +1,20 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Intersect_3} +A model for this must provide + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Object_3 operator()(Type1 obj1, Type2 obj2);} +{computes the \ccHtmlNoLinksFrom{intersection} region of two geometrical objects of type +\ccStyle{Type1} and \ccStyle{Type2}} + +for all pairs \ccStyle{Type1} and \ccStyle{Type2}, where +the type \ccStyle{Type1} is \ccStyle{Kernel::Plane_3} and +\ccStyle{Type2} can be any of the following: +\begin{itemize}\ccTexHtml{\itemsep0pt\topsep0pt\partopsep0pt\parskip0pt\parsep0pt}{} +\item \ccStyle{Kernel::Plane_3} +\item \ccStyle{Kernel::Line_3} +\item \ccStyle{Kernel::Ray_3} +\item \ccStyle{Kernel::Segment_3} +\end{itemize} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Is_degenerate_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Is_degenerate_2.tex new file mode 100644 index 00000000000..f1f128ca294 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Is_degenerate_2.tex @@ -0,0 +1,24 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Is_degenerate_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Circle_2&o);} +{returns true iff $o$ is degenerate.} + +\ccMemberFunction{bool operator()(const Kernel::Iso_rectangle_2&o);} +{returns true iff $o$ is degenerate.} + +\ccMemberFunction{bool operator()(const Kernel::Line_2&o);} +{returns true iff $o$ is degenerate.} + +\ccMemberFunction{bool operator()(const Kernel::Ray_2&o);} +{returns true iff $o$ is degenerate.} + +\ccMemberFunction{bool operator()(const Kernel::Segment_2&o);} +{returns true iff $o$ is degenerate.} + +\ccMemberFunction{bool operator()(const Kernel::Triangle_2&o);} +{returns true iff $o$ is degenerate.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Is_degenerate_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Is_degenerate_3.tex new file mode 100644 index 00000000000..007e96c8890 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Is_degenerate_3.tex @@ -0,0 +1,30 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Is_degenerate_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Line_3&o);} +{returns true iff $o$ is degenerate.} + +\ccMemberFunction{bool operator()(const Kernel::Iso_cuboid_3&o);} +{returns true iff $o$ is degenerate.} + +\ccMemberFunction{bool operator()(const Kernel::Plane_3&o);} +{returns true iff $o$ is degenerate.} + +\ccMemberFunction{bool operator()(const Kernel::Ray_3&o);} +{returns true iff $o$ is degenerate.} + +\ccMemberFunction{bool operator()(const Kernel::Segment_3&o);} +{returns true iff $o$ is degenerate.} + +\ccMemberFunction{bool operator()(const Kernel::Sphere_3&o);} +{returns true iff $o$ is degenerate.} + +\ccMemberFunction{bool operator()(const Kernel::Triangle_3&o);} +{returns true iff $o$ is degenerate.} + +\ccMemberFunction{bool operator()(const Kernel::Tetrahedron_3&o);} +{returns true iff $o$ is degenerate.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Is_horizontal_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Is_horizontal_2.tex new file mode 100644 index 00000000000..1899c91ef2a --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Is_horizontal_2.tex @@ -0,0 +1,15 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Is_horizontal_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Line_2&o);} +{returns true iff $o$ is horizontal.} + +\ccMemberFunction{bool operator()(const Kernel::Ray_2&o);} +{returns true iff $o$ is horizontal.} + +\ccMemberFunction{bool operator()(const Kernel::Segment_2&o);} +{returns true iff $o$ is horizontal.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Is_vertical_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Is_vertical_2.tex new file mode 100644 index 00000000000..45407f3e5c9 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Is_vertical_2.tex @@ -0,0 +1,15 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Is_vertical_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Line_2&o);} +{returns true iff $o$ is vertical.} + +\ccMemberFunction{bool operator()(const Kernel::Ray_2&o);} +{returns true iff $o$ is vertical.} + +\ccMemberFunction{bool operator()(const Kernel::Segment_2&o);} +{returns true iff $o$ is vertical.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Iso_cuboid_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Iso_cuboid_3.tex new file mode 100644 index 00000000000..ef1bdcbd6ec --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Iso_cuboid_3.tex @@ -0,0 +1,11 @@ +\begin{ccRefConcept}{Kernel::Iso_cuboid_3} +A type representing isocuboids in three dimensions. + +\ccRefines +\ccc{CopyConstructable}, +\ccc{Assignable} + +\ccSeeAlso +\ccc{Kernel::Construct_iso_cuboid_3} + +\end{ccRefConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Iso_rectangle_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Iso_rectangle_2.tex new file mode 100644 index 00000000000..9a5e5a10d5c --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Iso_rectangle_2.tex @@ -0,0 +1,11 @@ +\begin{ccRefConcept}{Kernel::Iso_rectangle_2} +A type representing isorectangles in two dimensions. + +\ccRefines +\ccc{CopyConstructable}, +\ccc{Assignable} + +\ccSeeAlso +\ccc{Kernel::Construct_iso_rectangle_2} + +\end{ccRefConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Left_of_line_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Left_of_line_2.tex new file mode 100644 index 00000000000..24e07ab7191 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Left_of_line_2.tex @@ -0,0 +1,15 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Left_of_line_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccConstructor{Kernel::Left_of_line_2(const Kernel::Point_2&p, + const Kernel::Point_2&q);} +{} + +\ccMemberFunction{bool operator()(const Kernel::Point_2&r);} +{returns true iff $r$ lies to the left of the oriented line +through $p$ and $q$, where $p$ and $q$ are the points passed +to the object at construction.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Leftturn_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Leftturn_2.tex new file mode 100644 index 00000000000..59e9c252d23 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Leftturn_2.tex @@ -0,0 +1,12 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Leftturn_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_2&p, + const Kernel::Point_2&q, + const Kernel::Point_2&r);} +{returns \ccStyle{true}, iff the three points \ccStyle{p}, \ccStyle{q} +and \ccStyle{r} form a left turn.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_distance_to_point_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_distance_to_point_2.tex new file mode 100644 index 00000000000..91acc602229 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_distance_to_point_2.tex @@ -0,0 +1,15 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Less_distance_to_point_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccConstructor{Kernel::Less_distance_to_point_2(const Kernel::Point_2&p);} +{} + +\ccMemberFunction{bool operator()(const Kernel::Point_2&q, + const Kernel::Point_2&r);} +{returns true iff the distance of $q$ to $p$ is +smaller than the distance of $r$ to $p$, where $p$ is the point +passed to the object at construction.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_distance_to_point_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_distance_to_point_3.tex new file mode 100644 index 00000000000..808ba82e4b9 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_distance_to_point_3.tex @@ -0,0 +1,15 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Less_distance_to_point_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccConstructor{Kernel::Less_distance_to_point_3(const Kernel::Point_3&p);} +{} + +\ccMemberFunction{bool operator()(const Kernel::Point_3&q, + const Kernel::Point_3&r);} +{returns true iff the distance of $q$ to $p$ is +smaller than the distance of $r$ to $p$, where $p$ is the point +passed to the object at construction.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_rotate_ccw_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_rotate_ccw_2.tex new file mode 100644 index 00000000000..9ac8c19ff03 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_rotate_ccw_2.tex @@ -0,0 +1,19 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Less_rotate_ccw_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccConstructor{Kernel::Less_rotate_ccw_2(const Kernel::Point_2&p);} +{} + +\ccMemberFunction{bool operator()(const Kernel::Point_2&q, + const Kernel::Point_2&r);} +{returns true iff the three points \ccStyle{p}, \ccStyle{q} +and \ccStyle{r} form a left turn or if they are collinear and +the distance of $q$ to $p$ is +larger than the distance of $r$ to $p$, where $p$ is the point +passed to the object at construction. +\ccPrecond $p$ does not lie in the interior of the segment $rq$, +i.e.~$p$ is an extreme point with respect to $\{p,q,r\}$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_signed_distance_to_line_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_signed_distance_to_line_2.tex new file mode 100644 index 00000000000..b7a20e05865 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_signed_distance_to_line_2.tex @@ -0,0 +1,20 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Less_signed_distance_to_line_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccConstructor{Kernel::Less_signed_distance_to_line_2(const Kernel::Point_2&p, + const Kernel::Point_2&q);} +{} + +\ccMemberFunction{bool operator()(const Kernel::Point_2&r, + const Kernel::Point_2&s);} +{returns true iff the distance of $r$ to the oriented line +through $p$ and $q$, where $p$ and $q$ are the points passed +to the object at construction, is smaller than the distance of +$s$ to this line. If both have the same distance, true is +returned iff the distance of $q$ to $p$ is +smaller than the distance of $r$ to $p$, where $p$ is the point +passed to the object at construction.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_x_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_x_2.tex new file mode 100644 index 00000000000..fe24043ea4c --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_x_2.tex @@ -0,0 +1,11 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Less_x_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_2&p, + const Kernel::Point_2&q);} +{returns true iff the $x$-coordinate of $p$ is smaller than the +$x$-coordinate of $q$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_x_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_x_3.tex new file mode 100644 index 00000000000..b821c6540fe --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_x_3.tex @@ -0,0 +1,11 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Less_x_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_3&p, + const Kernel::Point_3&q);} +{returns true iff the $x$-coordinate of $p$ is smaller than the +$x$-coordinate of $q$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_xy_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_xy_2.tex new file mode 100644 index 00000000000..870d638b6bf --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_xy_2.tex @@ -0,0 +1,12 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Less_xy_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_2&p, + const Kernel::Point_2&q);} +{returns true iff the $x$-coordinate of $p$ is smaller than the +$x$-coordinate of $q$ or if the are the same and +the $y$-coordinate of $p$ is smaller than the $y$-coordinate of $q$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_xy_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_xy_3.tex new file mode 100644 index 00000000000..cfd3d80e12a --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_xy_3.tex @@ -0,0 +1,12 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Less_xy_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_3&p, + const Kernel::Point_3&q);} +{returns true iff the $x$-coordinate of $p$ is smaller than the +$x$-coordinate of $q$ or if the are the same and +the $y$-coordinate of $p$ is smaller than the $y$-coordinate of $q$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_xyz_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_xyz_3.tex new file mode 100644 index 00000000000..47c4d843462 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_xyz_3.tex @@ -0,0 +1,14 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Less_xyz_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_3&p, + const Kernel::Point_3&q);} +{returns true iff the $x$-coordinate of $p$ is smaller than the +$x$-coordinate of $q$ or if the are the same and +the $y$-coordinate of $p$ is smaller than the $y$-coordinate of $q$, or, +if both $x$- and $y$- coordinate are identical and +the $z$-coordinate of $p$ is smaller than the $z$-coordinate of $q$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_y_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_y_2.tex new file mode 100644 index 00000000000..dd3feb1f05c --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_y_2.tex @@ -0,0 +1,11 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Less_y_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_2&p, + const Kernel::Point_2&q);} +{returns true iff the $y$-coordinate of $p$ is smaller than the +$y$-coordinate of $q$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_y_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_y_3.tex new file mode 100644 index 00000000000..c2b3d79a6f2 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_y_3.tex @@ -0,0 +1,11 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Less_y_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_3&p, + const Kernel::Point_3&q);} +{returns true iff the $y$-coordinate of $p$ is smaller than the +$y$-coordinate of $q$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_yx_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_yx_2.tex new file mode 100644 index 00000000000..951d95cdd1b --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_yx_2.tex @@ -0,0 +1,12 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Less_yx_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_2&p, + const Kernel::Point_2&q);} +{returns true iff the $y$-coordinate of $p$ is smaller than the +$y$-coordinate of $q$ or if the are the same and +the $x$-coordinate of $p$ is smaller than the $x$-coordinate of $q$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_z_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_z_3.tex new file mode 100644 index 00000000000..6825e50231d --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Less_z_3.tex @@ -0,0 +1,11 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Less_z_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_3&p, + const Kernel::Point_3&q);} +{returns true iff the $z$-coordinate of $p$ is smaller than the +$z$-coordinate of $q$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Line_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Line_2.tex new file mode 100644 index 00000000000..cd576683f62 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Line_2.tex @@ -0,0 +1,11 @@ +\begin{ccRefConcept}{Kernel::Line_2} +A type representing straight lines (and halfspaces) in two dimensions. + +\ccRefines +\ccc{CopyConstructable}, +\ccc{Assignable} + +\ccSeeAlso +\ccc{Kernel::Construct_line_2} + +\end{ccRefConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Line_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Line_3.tex new file mode 100644 index 00000000000..d789eff9007 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Line_3.tex @@ -0,0 +1,11 @@ +\begin{ccRefConcept}{Kernel::Line_3} +A type representing straight lines in three dimensions. + +\ccRefines +\ccc{CopyConstructable}, +\ccc{Assignable} + +\ccSeeAlso +\ccc{Kernel::Construct_line_3} + +\end{ccRefConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Object_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Object_2.tex new file mode 100644 index 00000000000..aba0325915e --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Object_2.tex @@ -0,0 +1,11 @@ +\begin{ccRefConcept}{Kernel::Object_2} +A type representing different types of objects in two dimensions. + +\ccRefines +\ccc{CopyConstructable}, +\ccc{Assignable} + +\ccSeeAlso +\ccc{Kernel::Assign_2}, \ccc{Kernel::Intersect_2} + +\end{ccRefConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Object_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Object_3.tex new file mode 100644 index 00000000000..72d121b7c0c --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Object_3.tex @@ -0,0 +1,11 @@ +\begin{ccRefConcept}{Kernel::Object_3} +A type representing different types of objects in two dimensions. + +\ccRefines +\ccc{CopyConstructable}, +\ccc{Assignable} + +\ccSeeAlso +\ccc{Kernel::Assign_3}, \ccc{Kernel::Intersect_3} + +\end{ccRefConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Orientation_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Orientation_2.tex new file mode 100644 index 00000000000..c0c8ed7deb7 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Orientation_2.tex @@ -0,0 +1,14 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Orientation_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_2&p, + const Kernel::Point_2&q, + const Kernel::Point_2&r);} +{returns \ccStyle{LEFTTURN}, if $r$ lies to the left of the oriented +line $l$ defined by $p$ and $q$, returns \ccStyle{RIGHTTURN} if $r$ +lies to the right of $l$, and returns \ccStyle{COLLINEAR} if $r$ lies +on $l$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Orientation_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Orientation_3.tex new file mode 100644 index 00000000000..830cfddf61a --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Orientation_3.tex @@ -0,0 +1,15 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Orientation_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{bool operator()(const Kernel::Point_3&p, + const Kernel::Point_3&q, + const Kernel::Point_3&r, + const Kernel::Point_3&s);} +{returns \ccStyle{POSITIVE}, if $s$ lies on the positive side of the oriented +plane $h$ defined by $p$, $q$, and $r$, returns \ccStyle{NEGATIVE} if $s$ +lies on the negative side of $h$, and returns \ccStyle{COPLANAR} if $s$ lies +on $h$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Oriented_side_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Oriented_side_2.tex new file mode 100644 index 00000000000..6f0adc0898f --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Oriented_side_2.tex @@ -0,0 +1,24 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Oriented_side_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Oriented_side operator()(const Kernel::Cricle_2&c, + const Kernel::Point_2&p);} +{returns \ccStyle{ON_ORIENTED_BOUNDARY}, +\ccStyle{ON_NEGATIVE_SIDE}, or the constant \ccStyle{ON_POSITIVE_SIDE}, +depending on the position of $p$ relative to the oriented circle $c$.} + +\ccMemberFunction{Oriented_side operator()(const Kernel::Line_2&l, + const Kernel::Point_2&p);} +{returns \ccStyle{ON_ORIENTED_BOUNDARY}, +\ccStyle{ON_NEGATIVE_SIDE}, or the constant \ccStyle{ON_POSITIVE_SIDE}, +depending on the position of $p$ relative to the oriented line $l$.} + +\ccMemberFunction{Oriented_side operator()(const Kernel::Triangle_2&t, + const Kernel::Point_2&p);} +{returns \ccStyle{ON_ORIENTED_BOUNDARY}, +\ccStyle{ON_NEGATIVE_SIDE}, or the constant \ccStyle{ON_POSITIVE_SIDE}, +depending on the position of $p$ relative to the oriented triangle $t$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Oriented_side_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Oriented_side_3.tex new file mode 100644 index 00000000000..97beeed620b --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Oriented_side_3.tex @@ -0,0 +1,18 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Oriented_side_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Oriented_side operator()(const Kernel::Plane_3&h, + const Kernel::Point_3&p);} +{returns \ccStyle{ON_ORIENTED_BOUNDARY}, +\ccStyle{ON_NEGATIVE_SIDE}, or the constant \ccStyle{ON_POSITIVE_SIDE}, +depending on the position of $p$ relative to the oriented plane $h$.} + +\ccMemberFunction{Oriented_side operator()(const Kernel::Tetrahedron_3&t, + const Kernel::Point_3&p);} +{returns \ccStyle{ON_ORIENTED_BOUNDARY}, +\ccStyle{ON_NEGATIVE_SIDE}, or the constant \ccStyle{ON_POSITIVE_SIDE}, +depending on the position of $p$ relative to the oriented tetrahedron $t$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Plane_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Plane_3.tex new file mode 100644 index 00000000000..06f6965972d --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Plane_3.tex @@ -0,0 +1,11 @@ +\begin{ccRefConcept}{Kernel::Plane_3} +A type representing planes (and halfspaces) in three dimensions. + +\ccRefines +\ccc{CopyConstructable}, +\ccc{Assignable} + +\ccSeeAlso +\ccc{Kernel::Construct_plane_3} + +\end{ccRefConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Point_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Point_2.tex new file mode 100644 index 00000000000..fcea7454ace --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Point_2.tex @@ -0,0 +1,11 @@ +\begin{ccRefConcept}{Kernel::Point_2} +A type representing points in two dimensions. + +\ccRefines +\ccc{CopyConstructable}, +\ccc{Assignable} + +\ccSeeAlso +\ccc{Kernel::Construct_point_2} + +\end{ccRefConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Point_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Point_3.tex new file mode 100644 index 00000000000..6c5e454bc8b --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Point_3.tex @@ -0,0 +1,11 @@ +\begin{ccRefConcept}{Kernel::Point_3} +A type representing points in three dimensions. + +\ccRefines +\ccc{CopyConstructable}, +\ccc{Assignable} + +\ccSeeAlso +\ccc{Kernel::Construct_point_3} + +\end{ccRefConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Point_d.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Point_d.tex new file mode 100644 index 00000000000..6ad7af3cba6 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Point_d.tex @@ -0,0 +1,11 @@ +\begin{ccRefConcept}{Kernel::Point_d} +A type representing points in $d$ dimensions. + +\ccRefines +\ccc{CopyConstructable}, +\ccc{Assignable} + +\ccSeeAlso +\ccc{Kernel::Construct_point_d} + +\end{ccRefConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::RT.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::RT.tex new file mode 100644 index 00000000000..c4d3cd35fac --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::RT.tex @@ -0,0 +1,10 @@ +\begin{ccRefConcept}{Kernel::RT} + +A number type representing ring elements, i.e., must be closed under +operations $+$, $-$, and $*$. A division operation is required only +for those cases where the remainder is zero. + +\ccRefines +\ccc{CopyConstructable}, \ccc{Assignable}\\ +\ccc{NumberType} +\end{ccRefConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Ray_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Ray_2.tex new file mode 100644 index 00000000000..f7e5f4d52dc --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Ray_2.tex @@ -0,0 +1,11 @@ +\begin{ccRefConcept}{Kernel::Ray_2} +A type representing rays in two dimensions. + +\ccRefines +\ccc{CopyConstructable}, +\ccc{Assignable} + +\ccSeeAlso +\ccc{Kernel::Construct_ray_2} + +\end{ccRefConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Ray_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Ray_3.tex new file mode 100644 index 00000000000..ca4d251e937 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Ray_3.tex @@ -0,0 +1,11 @@ +\begin{ccRefConcept}{Kernel::Ray_3} +A type representing rays in three dimensions. + +\ccRefines +\ccc{CopyConstructable}, +\ccc{Assignable} + +\ccSeeAlso +\ccc{Kernel::Construct_ray_3} + +\end{ccRefConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Segment_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Segment_2.tex new file mode 100644 index 00000000000..5d8d22dcd11 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Segment_2.tex @@ -0,0 +1,11 @@ +\begin{ccRefConcept}{Kernel::Segment_2} +A type representing segments in two dimensions. + +\ccRefines +\ccc{CopyConstructable}, +\ccc{Assignable} + +\ccSeeAlso +\ccc{Kernel::Construct_segment_2} + +\end{ccRefConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Segment_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Segment_3.tex new file mode 100644 index 00000000000..f91ee22891a --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Segment_3.tex @@ -0,0 +1,11 @@ +\begin{ccRefConcept}{Kernel::Segment_3} +A type representing segments in three dimensions. + +\ccRefines +\ccc{CopyConstructable}, +\ccc{Assignable} + +\ccSeeAlso +\ccc{Kernel::Construct_segment_3} + +\end{ccRefConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Side_of_bounded_circle_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Side_of_bounded_circle_2.tex new file mode 100644 index 00000000000..e96306deae8 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Side_of_bounded_circle_2.tex @@ -0,0 +1,15 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Side_of_bounded_circle_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Bounded_side operator()(const Kernel::Point_2&p, + const Kernel::Point_2&q, + const Kernel::Point_2&r, + const Kernel::Point_2&t);} + {returns the relative position of point \ccStyle{t} + to the circle defined by $p$, $q$ and $r$. The order + of the points $p$, $q$ and $r$ does not matter. + \ccPrecond \ccStyle{p, q} and \ccStyle{r} are not collinear.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Side_of_bounded_sphere_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Side_of_bounded_sphere_3.tex new file mode 100644 index 00000000000..22c7fbd8e5d --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Side_of_bounded_sphere_3.tex @@ -0,0 +1,16 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Side_of_bounded_sphere_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Bounded_side operator()(const Kernel::Point_3&p, + const Kernel::Point_3&q, + const Kernel::Point_3&r, + const Kernel::Point_3&s, + const Kernel::Point_3&t);} + {returns the relative position of point \ccStyle{t} + to the sphere defined by $p$, $q$, $r$, and $s$. The order + of the points $p$, $q$, $r$, and $s$ does not matter. + \ccPrecond \ccStyle{p, q, r} and \ccStyle{s} are not coplanar.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Side_of_oriented_circle_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Side_of_oriented_circle_2.tex new file mode 100644 index 00000000000..5f018df5ee2 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Side_of_oriented_circle_2.tex @@ -0,0 +1,17 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Side_of_oriented_circle_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Oriented_side operator()(const Kernel::Point_2&p, + const Kernel::Point_2&q, + const Kernel::Point_2&r, + const Kernel::Point_2&t);} + {returns the relative position of point \ccStyle{t} + to the oriented circle defined by $p$, $q$ and $r$. + The order of the points $p$, $q$ and $r$ is important, + since it determines the orientation of the implicitly + constructed circle. + \ccPrecond \ccStyle{p, q} and \ccStyle{r} are not collinear.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Side_of_oriented_sphere_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Side_of_oriented_sphere_3.tex new file mode 100644 index 00000000000..be14dbfbc8c --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Side_of_oriented_sphere_3.tex @@ -0,0 +1,20 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Side_of_oriented_sphere_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Bounded_side operator()(const Kernel::Point_3&p, + const Kernel::Point_3&q, + const Kernel::Point_3&r, + const Kernel::Point_3&s, + const Kernel::Point_3&t);} + {returns the relative position of point \ccStyle{t} + to the oriented sphere defined by $p$, $q$, $r$ and $s$. + The order of the points $p$, $q$, $r$, and $s$ is important, + since it determines the orientation of the implicitly + constructed sphere. If the points $p$, $q$, $r$ and $s$ + are positive oriented, positive side is the bounded interior + of the sphere. + \ccPrecond \ccStyle{p, q, r} and \ccStyle{s} are not coplanar.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Sphere_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Sphere_3.tex new file mode 100644 index 00000000000..080ad80a809 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Sphere_3.tex @@ -0,0 +1,11 @@ +\begin{ccRefConcept}{Kernel::Sphere_3} +A type representing spheres in three dimensions. + +\ccRefines +\ccc{CopyConstructable}, +\ccc{Assignable} + +\ccSeeAlso +\ccc{Kernel::Construct_sphere_3} +\end{ccRefConcept} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Tetrahedron_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Tetrahedron_3.tex new file mode 100644 index 00000000000..9ef03bd8575 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Tetrahedron_3.tex @@ -0,0 +1,11 @@ +\begin{ccRefConcept}{Kernel::Tetrahedron_3} +A type representing tetrahedra in three dimensions. + +\ccRefines +\ccc{CopyConstructable}, +\ccc{Assignable} + +\ccSeeAlso +\ccc{Kernel::Construct_tetrahedron_3} + +\end{ccRefConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Transform_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Transform_2.tex new file mode 100644 index 00000000000..8242cfebdc1 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Transform_2.tex @@ -0,0 +1,42 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Transform_2} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Circle_2 operator()(const Kernel::Circle_2&p, + const Kernel::Aff_transformation_2& T);} + {returns the circle obtained by applying $T$ on $p$.} + +\ccMemberFunction{Kernel::Direction_2 operator()(const Kernel::Direction_2&d, + const Kernel::Aff_transformation_2& T);} + {returns the direction obtained by applying $T$ on $d$.} + +\ccMemberFunction{Kernel::Iso_rectangle_2 operator()(const Kernel::Iso_rectangle_2&i, + const Kernel::Aff_transformation_2& T);} + {returns the isorectangle obtained by applying $T$ on $i$.} + +\ccMemberFunction{Kernel::Line_2 operator()(const Kernel::Line_2&l, + const Kernel::Aff_transformation_2& T);} + {returns the line obtained by applying $T$ on $l$.} + +\ccMemberFunction{Kernel::Point_2 operator()(const Kernel::Point_2&p, + const Kernel::Aff_transformation_2& T);} + {returns the point obtained by applying $T$ on $p$.} + +\ccMemberFunction{Kernel::Ray_2 operator()(const Kernel::Ray_2&r, + const Kernel::Aff_transformation_2& T);} + {returns the ray obtained by applying $T$ on $r$.} + +\ccMemberFunction{Kernel::Segment_2 operator()(const Kernel::Segment_2&s, + const Kernel::Aff_transformation_2& T);} + {returns the segment obtained by applying $T$ on $s$.} + +\ccMemberFunction{Kernel::Triangle_2 operator()(const Kernel::Triangle_2&t, + const Kernel::Aff_transformation_2& T);} + {returns the triangle obtained by applying $T$ on $t$.} + +\ccMemberFunction{Kernel::Vector_2 operator()(const Kernel::Vector_2&p, + const Kernel::Aff_transformation_2& T);} + {returns the vector obtained by applying $T$ on $p$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Transform_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Transform_3.tex new file mode 100644 index 00000000000..b124d1bde3b --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Transform_3.tex @@ -0,0 +1,50 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Transform_3} +A model for this must provide: + +\ccCreationVariable{fo} + +\ccMemberFunction{Kernel::Direction_3 operator()(const Kernel::Direction_3&d, + const Kernel::Aff_transformation_3& T);} + {returns the direction obtained by applying $T$ on $d$.} + +\ccMemberFunction{Kernel::Iso_cuboid_3 operator()(const Kernel::Iso_cuboid_3&i, + const Kernel::Aff_transformation_3& T);} + {returns the isocuboid obtained by applying $T$ on $i$.} + +\ccMemberFunction{Kernel::Line_3 operator()(const Kernel::Line_3&l, + const Kernel::Aff_transformation_3& T);} + {returns the line obtained by applying $T$ on $l$.} + +\ccMemberFunction{Kernel::Plane_3 operator()(const Kernel::Plane_3&h, + const Kernel::Aff_transformation_3& T);} + {returns the plane obtained by applying $T$ on $h$.} + +\ccMemberFunction{Kernel::Point_3 operator()(const Kernel::Point_3&p, + const Kernel::Aff_transformation_3& T);} + {returns the point obtained by applying $T$ on $p$.} + +\ccMemberFunction{Kernel::Ray_3 operator()(const Kernel::Ray_3&r, + const Kernel::Aff_transformation_3& T);} + {returns the ray obtained by applying $T$ on $r$.} + +\ccMemberFunction{Kernel::Segment_3 operator()(const Kernel::Segment_3&s, + const Kernel::Aff_transformation_3& T);} + {returns the segment obtained by applying $T$ on $s$.} + +\ccMemberFunction{Kernel::Sphere_3 operator()(const Kernel::Sphere_3&s, + const Kernel::Aff_transformation_3& T);} + {returns the circle obtained by applying $T$ on $s$.} + +\ccMemberFunction{Kernel::Tetrahedron_3 operator()(const Kernel::Tetrahedron_3&t, + const Kernel::Aff_transformation_3& T);} + {returns the tetrahedron obtained by applying $T$ on $t$.} + +\ccMemberFunction{Kernel::Triangle_3 operator()(const Kernel::Triangle_3&t, + const Kernel::Aff_transformation_3& T);} + {returns the triangle obtained by applying $T$ on $t$.} + +\ccMemberFunction{Kernel::Vector_3 operator()(const Kernel::Vector_3&p, + const Kernel::Aff_transformation_3& T);} + {returns the vector obtained by applying $T$ on $p$.} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Triangle_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Triangle_2.tex new file mode 100644 index 00000000000..600f4147ccb --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Triangle_2.tex @@ -0,0 +1,11 @@ +\begin{ccRefConcept}{Kernel::Triangle_2} +A type representing triangles in two dimensions. + +\ccRefines +\ccc{CopyConstructable}, +\ccc{Assignable} + +\ccSeeAlso +\ccc{Kernel::Construct_triangle_2} + +\end{ccRefConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Triangle_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Triangle_3.tex new file mode 100644 index 00000000000..c2a6069bc00 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Triangle_3.tex @@ -0,0 +1,11 @@ +\begin{ccRefConcept}{Kernel::Triangle_3} +A type representing triangles in three dimensions. + +\ccRefines +\ccc{CopyConstructable}, +\ccc{Assignable} + +\ccSeeAlso +\ccc{Kernel::Construct_triangle_3} + +\end{ccRefConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Vector_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Vector_2.tex new file mode 100644 index 00000000000..22ebf35d9e8 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Vector_2.tex @@ -0,0 +1,12 @@ +\begin{ccRefConcept}{Kernel::Vector_2} +\ccDefinition +A type representing vectors in two dimensions. + +\ccRefines +\ccc{CopyConstructable}, +\ccc{Assignable} + +\ccSeeAlso +\ccc{Kernel::Construct_vector_2} + +\end{ccRefConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Vector_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Vector_3.tex new file mode 100644 index 00000000000..270e4fadb76 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Kernel::Vector_3.tex @@ -0,0 +1,12 @@ +\begin{ccRefFunctionObjectConcept}{Kernel::Vector_3} +\ccDefinition +A type representing vectors in three dimensions. + +\ccRefines +\ccc{CopyConstructable}, +\ccc{Assignable} + +\ccSeeAlso +\ccc{Kernel::Construct_vector_3} + +\end{ccRefFunctionObjectConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/LEFTTURN.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/LEFTTURN.tex new file mode 100644 index 00000000000..8e9531bd7e9 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/LEFTTURN.tex @@ -0,0 +1,3 @@ +\begin{ccRefConstant}{LEFTTURN} +\ccGlobalVariable{const Orientation LEFTTURN = POSITIVE;} +\end{ccRefConstant} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Line_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Line_2.tex new file mode 100644 index 00000000000..92c6bfa3d01 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Line_2.tex @@ -0,0 +1,172 @@ +\begin{ccRefClass} {Line_2} +\ccInclude{CGAL/Line_2.h} + +\ccDefinition +An object \ccStyle{l} of the data type \ccRefName\ is a directed +straight line in the two-dimensional Euclidean plane $\E^2$. It is +defined by the set of points with Cartesian coordinates $(x,y)$ +that satisfy the equation +\begin{ccTexOnly} +\[ l:\; a\, x +b\, y +c = 0. \] +\end{ccTexOnly} +\begin{ccHtmlOnly} + l : ax + by + c = 0 +\end{ccHtmlOnly} + +The line splits $\E^2$ in a {\em positive} and a {\em negative} +side. A point $p$ with Cartesian coordinates +$(px, py)$ is on the positive side of \ccStyle{l}, iff +\ccTexHtml{$a\, px + b\, py +c > 0$}{a px + b py + c > 0}, it is +on the negative side of \ccStyle{l}, iff +\ccTexHtml{$a\, px + b\, py +c < 0$}{a px + b py + c < 0}. +The positive side is to the left of \ccc{l}. + +\ccCreation +\ccCreationVariable{l} + +\ccHidden \ccConstructor{Line_2();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Line_2(const Line_2 &h);} + {copy constructor.} + +\ccConstructor{Line_2(const R::RT &a, const R::RT &b, const R::RT &c)} + {introduces a line \ccVar\ with the line equation in Cartesian + coordinates $ax +by +c = 0$.} + +\ccConstructor{Line_2(const Point_2 &p, const Point_2 &q);} + {introduces a line \ccVar\ passing through the points $p$ and $q$. + Line \ccVar\ is directed from $p$ to $q$.} + +\ccConstructor{Line_2(const Point_2 &p, const Direction_2&d)} + {introduces a line \ccVar\ passing through point $p$ with + direction $d$.} + +\ccConstructor{Line_2(const Segment_2 &s);} + {introduces a line \ccVar\ supporting the segment $s$, + oriented from source to target.} + +\ccConstructor{Line_2(const Ray_2 &r)} + {introduces a line \ccVar\ supporting the ray $r$, + with same orientation.} + +\ccOperations + +\ccSetThreeColumns{Direction_2 & }{}{\hspace*{7.4cm}} + +\ccHidden \ccMethod{Line_2 & operator=(const Line_2 &h);} + {Assignment.} + +\ccMethod{bool operator==(const Line_2 &h) const;} + {Test for equality: two lines are equal, iff they have a non + empty \ccHtmlNoLinksFrom{intersection} and the same direction.} + +\ccMethod{bool operator!=(const Line_2 &h) const;} + {Test for inequality.} + + +\ccMethod{R::RT a() const;} + {returns the first coefficient of $l$.} +\ccGlue +\ccMethod{R::RT b() const;} + {returns the second coefficient of $l$.} +\ccGlue +\ccMethod{R::RT c() const;} + {returns the third coefficient of $l$.} + +\ccMethod{Point_2 point(int i) const;} + {returns an arbitrary point on \ccVar. It holds + \ccStyle{point(i) == point(j)}, iff \ccStyle{i==j}. + Furthermore, \ccVar\ is directed from \ccStyle{point(i)} + to \ccStyle{point(j)}, for all \ccStyle{i} $<$ \ccStyle{j}.} + +\ccMethod{Point_2 projection(const Point_2 &p) const;} + {returns the orthogonal projection of $p$ onto \ccVar.} + +\ccMethod{R::FT x_at_y(const R::FT &y) const;} + {returns the $x$-coordinate of the point at \ccVar\ with + given $y$-coordinate. + \ccPrecond \ccVar\ is not horizontal.} + +\ccMethod{R::FT y_at_x(const R::FT &x) const;} + {returns the $y$-coordinate of the point at \ccVar\ with + given $x$-coordinate. + \ccPrecond \ccVar\ is not vertical.} + +\ccHeading{Predicates} + +\ccMethod{bool is_degenerate() const;} + {line \ccVar\ is degenerate, if the coefficients \ccStyle{a} and + \ccStyle{b} of the line equation are zero.} + +\ccMethod{bool is_horizontal() const;} + {} +\ccGlue +\ccMethod{bool is_vertical() const;} + {} + +\ccMethod{Oriented_side oriented_side(const Point_2 &p) const;} + {returns \ccStyle{ON_ORIENTED_BOUNDARY}, + \ccStyle{ON_NEGATIVE_SIDE}, or the constant + \ccStyle{ON_POSITIVE_SIDE}, + depending on the position of $p$ relative to the oriented line \ccVar. + } + + +For convenience we provide the following boolean functions: + +\ccMethod{bool has_on(const Point_2 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_boundary(const Point_2 &p) const;} + {returns \ccStyle{has_on()}.} +\ccGlue +\ccMethod{bool has_on_positive_side(const Point_2 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_negative_side(const Point_2 &p) const;} + {} + +\ccHeading{Miscellaneous} + +\ccMethod{Direction_2 direction() const;} + {returns the direction of \ccVar.} + +\ccMethod{Line_2 opposite() const;} + {returns the line with opposite direction.} + +\ccMethod{Line_2 perpendicular(const Point_2 &p) const;} + {returns the line perpendicular to \ccVar\ and passing through $p$, + where the direction is the direction of \ccVar\ rotated + counterclockwise by 90 degrees.} + +\ccMethod{Line_2 transform(const Aff_transformation_2 &t) const;} + {returns the line obtained by applying $t$ on a point on \ccVar\ + and the direction of \ccVar.} + + +%\ccImplementation +%Lines are implemented as a line equation. +%Construction from points or a point and a direction, might lead to +%loss of precision if the number type is not exact. + +\ccExample +Let us first define two Cartesian two-dimensional points in the Euclidean +plane $\E^2$. Their +dimension and the fact that they are Cartesian is expressed by +the suffix \ccStyle{_2} and the representation type \ccStyle{Cartesian}. + +\begin{cprog} + + Point_2< Cartesian > p(1.0,1.0), q(4.0,7.0); +\end{cprog} + +To define a line $l$ we write: + +\begin{cprog} + + Line_2< Cartesian > l(p,q); +\end{cprog} + + +\end{ccRefClass} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Line_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Line_3.tex new file mode 100644 index 00000000000..b95ee47b793 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Line_3.tex @@ -0,0 +1,77 @@ +\begin{ccRefClass} {Line_3} +\ccInclude{CGAL/Line_3.h} + +\ccDefinition +An object \ccStyle{l} of the data type \ccRefName\ is a directed +straight line in the three-dimensional Euclidean space $\E^3$. + +\ccCreation +\ccCreationVariable{l} + +\ccHidden \ccConstructor{Line_3();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Line_3(const Line_3 &h);} + {copy constructor.} + +\ccConstructor{Line_3(const Point_3 &p, const Point_3 &q);} + {introduces a line \ccVar\ passing through the points $p$ and $q$. + Line \ccVar\ is directed from $p$ to $q$.} + + +\ccConstructor{Line_3(const Point_3 &p, const Direction_3&d)} + {introduces a line \ccVar\ passing through point $p$ with + direction $d$.} + +\ccConstructor{Line_3(const Segment_3 &s);} + {returns the line supporting the segment $s$, + oriented from source to target.} + +\ccConstructor{Line_3(const Ray_3 &r);} + {returns the line supporting the ray $r$, with the + same orientation.} + +\ccOperations +\ccSetThreeColumns{Direction_3 }{}{\hspace*{8.5cm}} + +\ccHidden \ccMethod{Line_3 & operator=(const Line_3 &h);} + {Assignment.} + +\ccMethod{bool operator==(const Line_3 &h) const;} + {Test for equality: two lines are equal, iff they have a non + empty \ccHtmlNoLinksFrom{intersection} and the same direction.} + +\ccMethod{bool operator!=(const Line_3 &h) const;} + {Test for inequality.} + +\ccMethod{Point_3 projection(const Point_3 &p) const;} + {returns the orthogonal \ccHtmlNoLinksFrom{projection} of $p$ on \ccVar.} + +\ccMethod{Point_3 point(int i) const;} + {returns an arbitrary point on \ccVar. It holds + \ccStyle{point(i) = point(j)}, iff \ccStyle{i=j}.} + +\ccPredicates + +\ccMethod{bool is_degenerate() const;} + {returns \ccc{true} iff line \ccVar\ is degenerated to a point.} + +\ccMethod{bool has_on(const Point_3 &p) const;} + {returns \ccc{true} iff \ccc{p} lies on \ccVar.} + +\ccHeading{Miscellaneous} + +\ccMethod{Plane_3 perpendicular_plane(const Point_3 &p) const;} + {returns the plane perpendicular to \ccVar\ passing through $p$.} + +\ccMethod{Line_3 opposite() const;} + {returns the line with opposite direction.} + +\ccMethod{Direction_3 direction() const;} + {returns the direction of \ccVar.} + +\ccMethod{Line_3 transform(const Aff_transformation_3 &t) const;} + {returns the line obtained by applying $t$ on a point on \ccVar\ + and the direction of \ccVar.} + +\end{ccRefClass} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/NULL_VECTOR.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/NULL_VECTOR.tex new file mode 100644 index 00000000000..1fc35d67583 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/NULL_VECTOR.tex @@ -0,0 +1,12 @@ +\begin{ccRefConstant}{NULL_VECTOR} + +\ccGlobalVariable{const Null_vector NULL_VECTOR;} + +\ccDefinition +A symbolic constant used to construct zero length vectors. + +\ccSeeAlso +\ccc{Vector_2}, \ccc{Vector_3}, \ccc{Kernel::Construct_vector_2}, +\ccc{Kernel::Construct_vector_3} + +\end{ccRefConstant} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Null_vector.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Null_vector.tex new file mode 100644 index 00000000000..76d83e368a3 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Null_vector.tex @@ -0,0 +1,13 @@ +\begin{ccRefClass}{Null_vector} +\ccInclude{Origin.h} + +\ccDefinition +\cgal\ defines a symbolic constant +\ccStyle{NULL_VECTOR} to construct zero length vectors. +\ccRefName\ is the type of this constant. + +\ccSeeAlso +\ccc{Vector_2}, \ccc{Vector_3}, \ccc{Kernel::Construct_vector_2}, +\ccc{Kernel::Construct_vector_3} + +\end{ccRefClass} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/ORIGIN.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/ORIGIN.tex new file mode 100644 index 00000000000..ed3458d3f6f --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/ORIGIN.tex @@ -0,0 +1,19 @@ +\begin{ccRefConstant}{ORIGIN} + +\ccGlobalVariable{const Origin ORIGIN;} + +\ccDefinition +A symbolic constant which denotes the point at the origin. +This constant is used in the conversion between points and vectors. + +\ccExample + +\begin{cprog} + Point_2< Cartesian > > p(1.0, 1.0), q; + Vector2< Cartesian > > v; + v = p - ORIGIN; + q = ORIGIN + v; + assert( p == q ); +\end{cprog} + +\end{ccRefConstant} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Object.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Object.tex new file mode 100644 index 00000000000..77a0609ced2 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Object.tex @@ -0,0 +1,106 @@ + +\begin{ccRefClass}{Object} + +\ccInclude{CGAL/Object.h} +%\ccInclude{CGAL/basic.h} + + +\ccDefinition +Some functions can return different types of objects. A typical +\CC\ solution to this problem is to derive all possible return +types from a common base class, to return a pointer to this +class and to perform a dynamic cast on this pointer. The class +\ccRefName\ provides an abstraction. +An object \ccStyle{obj} of the class \ccRefName\ can +represent an arbitrary class. The only operations it provides is +to make copies and assignments, so that you can put them in lists +or arrays. Note that \ccRefName\ is NOT a common base class for the +elementary classes. Therefore, there is no +automatic conversion from these classes to \ccRefName. Rather +this is done with the global function \ccc{make_object}. This +encapsulation mechanism requires the use of \ccc{assign} to use +the functionality of the encapsulated class. + +\ccCreation +\ccCreationVariable{obj} + +\ccConstructor{Object();} + {introduces an uninitialized variable.} + +\ccConstructor{Object(const Object &o);} + {Copy constructor.} + +Objects of type \ccRefName\ are normally created via the global function +\ccc{make_object}. + +\ccOperations + +\ccMethod{Object &operator=(const Object &o);} + {Assignment.} + +Assignment of an object of type \ccRefName\ to an object of type \ccc{T} +is done using \ccc{assign}. + +There is also a member function to check whether an object of type \ccRefName\ +contains an object. + +\ccMethod{bool is_empty();}{returns true, if \ccc{object} does not + contain an object.} + +\ccExample +In the following example, the object class is used as return value for the +\ccHtmlNoLinksFrom{intersection} computation, as there are possibly different return values. + +\begin{cprog} +{ + Point_2< Cartesian > point; + Segment_2< Cartesian > segment, segment_1, segment_2; + + std::cin >> segment_1 >> segment_2; + + Object obj = intersection(segment_1, segment_2); + + if (assign(point, obj)) { + /* do something with point */ + } else if ((assign(segment, obj)) { + /* do something with segment*/ + } +\end{cprog} +\ccHtmlLinksOff% +\begin{cprog} + /* there was no intersection */ +} +\end{cprog} +\ccHtmlLinksOn% + +\medskip +The \ccHtmlNoLinksFrom{intersection} routine itself looks roughly as follows: + +\begin{cprog} + +template < class R > +Object intersection(Segment_2 s1, Segment_2 s2) +{ +\end{cprog} +\ccHtmlLinksOff% +\begin{cprog} + if (/* intersection in a point */ ) { +\end{cprog} +\ccHtmlLinksOn% +\begin{cprog} + Point_2 p = ... ; + return make_object(p); +\end{cprog} +\ccHtmlLinksOff% +\begin{cprog} + } else if (/* intersection in a segment */ ) { +\end{cprog} +\ccHtmlLinksOn% +\begin{cprog} + Segment_2 s = ... ; + return make_object(s); + } + return Object(); +} +\end{cprog} +\end{ccRefClass} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Orientation.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Orientation.tex new file mode 100644 index 00000000000..752ff10ce1f --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Orientation.tex @@ -0,0 +1,11 @@ +\begin{ccRefEnum}{Orientation} +\ccInclude{CGAL/enum.h} + +\ccGlobalTypedef{typedef Sign Orientation;}{} + +\ccSeeAlso +\ccc{LEFTTURN}, \ccc{RIGHTTURN}, \ccc{COLLINEAR}\\ +\ccc{CLOCKWISE}, \ccc{COUNTERCLOCKWISE}\\ +\ccc{POSITIVE}, \ccc{NEGATIVE}, \ccc{COPLANAR} +\end{ccRefEnum} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Oriented_side.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Oriented_side.tex new file mode 100644 index 00000000000..a1c21ca6d93 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Oriented_side.tex @@ -0,0 +1,17 @@ +\begin{ccRefEnum}{Oriented_side} +\ccInclude{CGAL/enum.h} + +\ccGlobalEnum{enum Oriented_side {ON_NEGATIVE_SIDE, ON_ORIENTED_BOUNDARY, ON_POSITIVE_SIDE };} +\ccRefLabel{ON_NEGATIVE_SIDE} +\ccRefLabel{ON_POSITIVE_SIDE} +\ccRefLabel{ON_ORIENTED_BOUNDARY} +\ccHtmlCrossLink{ON_NEGATIVE_SIDE} +\ccHtmlCrossLink{ON_POSITIVE_SIDE} +\ccHtmlCrossLink{ON_ORIENTED_BOUNDARY} +\ccHtmlIndexC[enum_tags]{ON_NEGATIVE_SIDE} +\ccHtmlIndexC[enum_tags]{ON_POSITIVE_SIDE} +\ccHtmlIndexC[enum_tags]{ON_ORIENTED_BOUNDARY} + +\ccSeeAlso +\ccc{Kernel::Oriented_side_2}, \ccc{Kernel::Oriented_side_3} +\end{ccRefEnum} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Origin.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Origin.tex new file mode 100644 index 00000000000..b79fd054467 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Origin.tex @@ -0,0 +1,14 @@ +\begin{ccRefClass}{Origin} +\ccInclude{Origin.h} + +\ccDefinition +\cgal\ defines a symbolic constant +\ccStyle{ORIGIN} which denotes the point at the origin. +\ccRefName\ is the type of this constant. +It is used in the conversion between points and vectors. + +\ccSeeAlso +\ccc{Point_2}, \ccc{Point_3}, +\ccc{Vector_2}, \ccc{Vector_3}, +\ccc{operator+}, \ccc{operator-} +\end{ccRefClass} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Plane_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Plane_3.tex new file mode 100644 index 00000000000..25027c43356 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Plane_3.tex @@ -0,0 +1,184 @@ +\begin{ccRefClass} {Plane_3} +\ccInclude{CGAL/Plane_3.h} + +\ccDefinition +An object \ccStyle{h} of the data type \ccRefName\ is an oriented +plane in the three-dimensional Euclidean space $\E^3$. It is defined +by the set of points with coordinates Cartesian $(x,y,z)$ that satisfy +the plane equation + +\begin{ccTexOnly} +\[h :\; a\, x +b\, y +c\, z + d = 0.\] +\end{ccTexOnly} +\begin{ccHtmlOnly} +h : a x + b y + c z + d = 0 +\end{ccHtmlOnly} + +The plane splits $\E^3$ in a {\em positive} and a {\em negative +side}. +A point $p$ with Cartesian coordinates $(px, py, pz)$ is on the positive side of +\ccStyle{h}, iff \ccTexHtml{$a\, px +b\, py +c\, pz + d > 0$}{a px + b py +c pz + d > 0}, it is on the +negative side, iff \ccTexHtml{$a\, px +b\, py\, +c\, pz + d < 0$}{a px + b py +c pz + d < 0}. + + + +\ccCreation +\ccCreationVariable{h} + + +\ccHidden \ccConstructor{Plane_3();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Plane_3(const Plane_3 &h);} + {copy constructor.} + +\ccConstructor{Plane_3(const R::RT &a, + const R::RT &b, + const R::RT &c, + const R::RT &d)} +{creates a plane \ccVar\ defined by the equation + \ccTexHtml{$a\, px +b\, py +c\, pz + d = 0$}{a px + b py + c pz + d = 0}. +Notice that \ccVar\ is degenerate if \ccTexHtml{$a = b = c$}{a = b = c}.} + +\ccConstructor{Plane_3(const Point_3 &p, + const Point_3 &q, + const Point_3 &r);} +{creates a plane \ccVar\ passing through the points \ccStyle{p}, + \ccStyle{q} and \ccStyle{r}. The plane is oriented such that \ccStyle{p}, + \ccStyle{q} and \ccStyle{r} are oriented in a positive sense + (that is counterclockwise) when seen from the positive side of \ccVar. +Notice that \ccVar\ is degenerate if the points are collinear.} + + +\ccConstructor{Plane_3(const Point_3 &p, + const Direction_3&d)} +{introduces a plane \ccVar\ that passes through point \ccStyle{p} and + that has as an orthogonal direction equal to \ccStyle{d}.} + +\ccConstructor{Plane_3(const Line_3 &l, + const Point_3 &p)} +{introduces a plane \ccVar\ that is defined through the three points + \ccStyle{l.point(0)}, \ccStyle{l.point(1)} and \ccStyle{p}.} + +\ccConstructor{Plane_3(const Ray_3 &r, + const Point_3 &p)} +{introduces a plane \ccVar\ that is defined through the three points + \ccStyle{r.point(0)}, \ccStyle{r.point(1)} and \ccStyle{p}.} + +\ccConstructor{Plane_3(const Segment_3 &s, + const Point_3 &p)} +{introduces a plane \ccVar\ that is defined through the three points + \ccStyle{s.source()}, \ccStyle{s.target()} and \ccStyle{p}.} + +\ccOperations +\ccHidden \ccMethod{Plane_3 & operator=(const Plane_3 &h);} + {Assignment.} + +\ccMethod{bool operator==(const Plane_3 &h2) const;} + {Test for equality: two planes are equal, iff they have a non + empty intersection and the same orientation.} + +\ccMethod{bool operator!=(const Plane_3 &h2) const;} + {Test for inequality.} + +\ccMethod{R::RT a() const;} + {returns the first coefficient of \ccVar.} +\ccGlue +\ccMethod{R::RT b() const;} + {returns the second coefficient of \ccVar.} +\ccGlue +\ccMethod{R::RT c() const;} + {returns the third coefficient of \ccVar.} +\ccGlue +\ccMethod{R::RT d() const;} + {returns the fourth coefficient of \ccVar.} + +\ccMethod{Line_3 perpendicular_line(const Point_3 &p) const;} + {returns the line that is perpendicular to \ccVar\ and that + passes through point \ccStyle{p}. The line is oriented from + the negative to the positive side of \ccVar.} + +\ccMethod{Point_3 projection(const Point_3 &p) const;} + {returns the orthogonal projection of $p$ on \ccVar.} + +\ccMethod{Plane_3 opposite() const;} + {returns the plane with opposite orientation.} + +\ccMethod{Point_3 point() const;} + {returns an arbitrary point on \ccVar.} + +\ccMethod{Vector_3 orthogonal_vector() const;} + {returns a vector that is orthogonal to \ccVar\ and that + is directed to the positive side of \ccVar.} + +\ccMethod{Direction_3 orthogonal_direction() const;} + {returns the direction that is orthogonal to \ccVar\ and that + is directed to the positive side of \ccVar.} + +\ccMethod{Vector_3 base1() const;} + {returns a vector orthogonal to + \ccStyle{orthogonal_vector()}.} + +\ccMethod{Vector_3 base2() const;} + {returns a vector that is both orthogonal to \ccStyle{base1()}, + and to \ccStyle{orthogonal_vector()}, and such that the result of + \ccStyle{orientation( point(), point() + base1(), + point()+base2(), point() + orthogonal_vector() )} is positive.} + +\ccHeading{2D Conversion} + +The following functions provide conversion between a plane and +\cgal's two-dimensional space. The transformation is affine, but +not necessarily an isometry. This means, the transformation preserves +combinatorics, but not distances. + +\ccMethod{Point_2 to_2d(const Point_3 &p) const;} + {returns the image point of the projection of \ccStyle{p} + under an affine transformation, which maps \ccVar\ onto the + $xy$-plane, with the $z$-coordinate removed.} + +\ccMethod{Point_3 to_3d(const Point_2 &p) const;} + {returns a point $q$, such that \ccStyle{to_2d( to_3d( p ))} + is equal to \ccStyle{p}.} + + +\ccMethod{Oriented_side oriented_side(const Point_3 &p) const;} + {returns either \ccStyle{ON_ORIENTED_BOUNDARY}, or + the constant \ccStyle{ON_POSITIVE_SIDE}, or the con\-stant + \ccStyle{ON_NEGATIVE_SIDE}, + determined by the position of $p$ relative to the oriented plane \ccVar. + } + +\ccPredicates + +For convenience we provide the following boolean functions: + +\ccMethod{bool has_on(const Point_3 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_boundary(const Point_3 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_positive_side(const Point_3 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_negative_side(const Point_3 &p) const;} + {} + +\ccMethod{bool has_on(const Line_3 &l) const;} + {} +\ccGlue +\ccMethod{bool has_on_boundary(const Line_3 &l) const;} + {} + +\ccMethod{bool is_degenerate() const;} + {Plane \ccVar\ is degenerate, if the coefficients \ccStyle{a}, + \ccStyle{b}, and \ccc{c} of the plane equation are zero.} + +\ccHeading{Miscellaneous} + +\ccMethod{Plane_3 transform(const Aff_transformation_3 &t) const;} + {returns the plane obtained by applying $t$ on a point of \ccVar\ + and the orthogonal direction of \ccVar.} + +\end{ccRefClass} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Point_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Point_2.tex new file mode 100644 index 00000000000..07257140872 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Point_2.tex @@ -0,0 +1,143 @@ +\begin{ccRefClass} {Point_2} +\ccInclude{CGAL/Point_2.h} + +\ccDefinition +An object of the class \ccRefName\ is a point in the two-dimensional +Euclidean plane $\E^2$. + +Remember that \ccStyle{R::RT} and \ccStyle{R::FT} denote a ring type +and a field type. For the representation class +\ccStyle{Cartesian} the two types are the same. For the +representation class \ccStyle{Homogeneous} the ring type +\ccStyle{R::RT} is equal to \ccStyle{T}, and the field type \ccStyle{R::FT} is +equal to \ccStyle{Quotient}. + +\ccCreation +\ccCreationVariable{p} + + +\ccHidden \ccConstructor{Point_2();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Point_2(const Point_2 &q);} + {copy constructor.} + +\ccConstructor{Point_2(const Origin &ORIGIN);} + {introduces a variable \ccVar\ with \ccHtmlNoLinksFrom{Cartesian} coordinates + $(0,0)$.} + +\ccConstructor{Point_2(const R::RT &hx, const R::RT &hy, const R::RT &hw = R::RT(1));} + {introduces a point \ccVar\ initialized to $(hx/hw,hy/hw)$. + If the third argument is not explicitly given, it defaults + to \ccStyle{R::RT(1)}. + \ccPrecond \ccc{hw} $\neq$ \ccc{R::RT(0)} } + + +\ccOperations +%\ccSetTwoOfThreeColumns{5cm}{4cm} + +\ccHidden \ccMethod{Point_2 & operator=(const Point_2 &q);} + {Assignment.} + +\ccMethod{bool operator==(const Point_2 &q) const;} + {Test for equality. Two points are equal, iff their $x$ and $y$ + coordinates are equal. The point can be compared with + \ccc{ORIGIN}.} + +\ccMethod{bool operator!=(const Point_2 &q) const;} + {Test for inequality. The point can be compared with \ccc{ORIGIN}.} + +There are two sets of coordinate access functions, namely to the +homogeneous and to the \ccHtmlNoLinksFrom{Cartesian} coordinates. They can be used +independently from the chosen representation type \ccStyle{R}. + +\ccMethod{R::RT hx() const;} + {returns the homogeneous $x$ coordinate.} +\ccGlue +\ccMethod{R::RT hy() const;} + {returns the homogeneous $y$ coordinate.} +\ccGlue +\ccMethod{R::RT hw() const;} + {returns the homogenizing coordinate.} + +Here come the \ccHtmlNoLinksFrom{Cartesian} access functions. Note that you do not loose +information with the homogeneous representation, because then the field +type is a quotient. + +\ccMethod{R::FT x() const;} + {returns the \ccHtmlNoLinksFrom{Cartesian} $x$ coordinate, that is $hx/hw$.} +\ccGlue +\ccMethod{R::FT y() const;} + {returns the \ccHtmlNoLinksFrom{Cartesian} $y$ coordinate, that is $hy/hw$.} + + +The following operations are for convenience and for making this +point class compatible with code for higher dimensional points. +Again they come in a \ccHtmlNoLinksFrom{Cartesian} and homogeneous flavor. + +\ccMethod{R::RT homogeneous(int i) const;} + {returns the i'th homogeneous coordinate of \ccVar, starting with 0. + \ccPrecond $0\leq i \leq 2$.} + +\ccMethod{R::FT cartesian(int i) const;} + {returns the i'th \ccHtmlNoLinksFrom{Cartesian} coordinate of \ccVar, starting with 0. + \ccPrecond $0\leq i \leq 1$.} + +\ccMethod{R::FT operator[](int i) const;} + {returns \ccStyle{cartesian(i)}. + \ccPrecond $0\leq i \leq 1$.} + +\ccMethod{int dimension() const;} + {returns the dimension (the constant 2).} + +\ccMethod{Bbox_2 bbox() const;} + {returns a bounding box containing \ccVar. Note that bounding boxes + are not parameterized with whatsoever. } + +\ccMethod{Point_2 transform(const Aff_transformation_2 &t) const;} + {returns the point obtained by applying $t$ on \ccVar.} + + +\ccHeading{Operators} + +The following operations can be applied on points: + +\ccFunction{Vector_2 operator-(const Point_2 &p, + const Point_2 &q);} + {returns the difference vector between \ccStyle{q} and \ccStyle{p}. + You can substitute \ccc{ORIGIN} for either \ccc{p} or \ccc{q}, + but not for both.} + +\ccFunction{Point_2 operator+(const Point_2 &p, + const Vector_2 &v);} + {returns the point obtained by translating \ccStyle{p} by the + vector \ccStyle{v}.} + +\ccFunction{Point_2 operator-(const Point_2 &p, + const Vector_2 &v);} + {returns the point obtained by translating \ccStyle{p} by the + vector -\ccStyle{v}.} + +\ccExample + +The following declaration creates two points with \ccHtmlNoLinksFrom{Cartesian} double coordinates. + +\begin{cprog} + + Point_2< Cartesian > p, q(1.0, 2.0); +\end{cprog} + +The variable {\tt p} is uninitialized and should first be used on +the left hand side of an assignment. +\begin{cprog} + + p = q; + + std::cout << p.x() << " " << p.y() << std::endl; +\end{cprog} + +\ccSeeAlso + +\ccc{Point_3}, \ccc{Point_d}, \ccc{Vector_2}, \ccc{ORIGIN}, \ccc{operator+}, \ccc{operator-} + +\end{ccRefClass} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Point_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Point_3.tex new file mode 100644 index 00000000000..f4560b0655e --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Point_3.tex @@ -0,0 +1,139 @@ +\begin{ccRefClass} {Point_3} +\ccInclude{CGAL/Point_3.h} + +\ccDefinition +An object of the class \ccRefName\ is a point in the three-dimensional +Euclidean space $\E^3$. +%% +%% \cgal\ defines a symbolic constant +%% \ccStyle{ORIGIN} which denotes the point at the origin. It can be used +%% wherever a point can be used, with the only exception that you can not +%% access its dimension as it is dimensionless. +%% + +Remember that \ccStyle{R::RT} and \ccStyle{R::FT} denote a ring type +and a field type. +For the representation class \ccStyle{Cartesian}, the two types are +equivalent. +However, for the representation class \ccStyle{Homogeneous} the ring +type is \ccStyle{R::RT} is equal to \ccStyle{T} and the field type is +\ccStyle{R::FT} is equal to \ccStyle{Quotient}. + + +\ccCreation +\ccCreationVariable{p} + + +\ccHidden \ccConstructor{Point_3();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Point_3(const Point_3 &q);} + {copy constructor.} + +\ccConstructor{Point_3(const Origin &ORIGIN);} + {introduces a point with \ccHtmlNoLinks{Cartesian} coordinates$(0,0,0)$.} + +\ccConstructor{Point_3(const R::RT &hx, const R::RT &hy, const R::RT &hz, const R::RT &hw = R::RT(1));} + {introduces a point \ccVar\ initialized to $(hx/hw,hy/hw, hz/hw)$. + If the third argument is not explicitly given it defaults + to \ccStyle{R::RT(1)}. + \ccPrecond \ccc{hw} $\neq$ \ccc{Kernel::RT(0)}.} + + +\ccOperations +%\ccSetTwoOfThreeColumns{5cm}{4cm} + +\ccHidden \ccMethod{Point_3 & operator=(const Point_3 &q);} + {Assignment.} + +\ccMethod{bool operator==(const Point_3 &q) const;} + {Test for equality: Two points are equal, iff their $x$, $y$ and $z$ + coordinates are equal.} + +\ccMethod{bool operator!=(const Point_3 &q) const;} + {Test for inequality.} + + + +There are two sets of coordinate access functions, namely to the +homogeneous and to the \ccHtmlNoLinks{Cartesian} coordinates. They can be used +independently from the chosen representation type \ccStyle{R}. + +\ccMethod{R::RT hx() const;} + {returns the homogeneous $x$ coordinate.} +\ccGlue +\ccMethod{R::RT hy() const;} + {returns the homogeneous $y$ coordinate.} +\ccGlue +\ccMethod{R::RT hz() const;} + {returns the homogeneous $z$ coordinate.} +\ccGlue +\ccMethod{R::RT hw() const;} + {returns the homogenizing coordinate.} + +Here come the \ccHtmlNoLinks{Cartesian} access functions. Note that you do not loose +information with the homogeneous representation, because then the field +type is a quotient. + +\ccMethod{R::FT x() const;} + {returns the \ccHtmlNoLinks{Cartesian} $x$ coordinate, that is $hx/hw$.} +\ccGlue +\ccMethod{R::FT y() const;} + {returns the \ccHtmlNoLinks{Cartesian} $y$ coordinate, that is $hy/hw$.} +\ccGlue +\ccMethod{R::FT z() const;} + {returns the \ccHtmlNoLinks{Cartesian} $z$ coordinate, that is $hz/hw$.} + + +The following operations are for convenience and for making this +point class compatible with code for higher dimensional points. +Again they come in a \ccHtmlNoLinks{Cartesian} and homogeneous flavor. + +\ccMethod{R::RT homogeneous(int i) const;} + {returns the i'th homogeneous coordinate of \ccVar, starting with 0. + \ccPrecond $0\leq i \leq 3$.} + +\ccMethod{R::FT cartesian(int i) const;} + {returns the i'th \ccHtmlNoLinks{Cartesian} coordinate of \ccVar, starting with 0. + \ccPrecond $0\leq i \leq 2$.} + +\ccMethod{R::FT operator[](int i) const;} + {returns \ccStyle{cartesian(i)}. + \ccPrecond $0\leq i \leq 2$.} + +\ccMethod{int dimension() const;} + {returns the dimension (the constant 3).} + +\ccMethod{Bbox_3 bbox() const;} + {returns a bounding box containing \ccVar.} + +\ccMethod{Point_3 transform(const Aff_transformation_3 &t) const;} + {returns the point obtained by applying $t$ on \ccVar.} + +\ccHeading{Operators} + +The following operations can be applied on points: + +\ccFunction{Vector_3 operator-(const Point_3 &p, + const Point_3 &q);} + {returns the difference vector between \ccStyle{q} and \ccStyle{p}. + You can substitute \ccc{ORIGIN} for either \ccc{p} or \ccc{q} + ,but not for both.} + +\ccFunction{Point_3 operator+(const Point_3 &p, + const Vector_3 &v);} + {returns the point obtained by translating \ccStyle{p} by the + vector \ccStyle{v}.} + +\ccFunction{Point_3 operator-(const Point_3 &p, + const Vector_3 &v);} + {returns the point obtained by translating \ccStyle{p} by the + vector -\ccStyle{v}.} + +\ccSeeAlso + +\ccc{Point_2}, \ccc{Point_d}, \ccc{Vector_3}, \ccc{ORIGIN}, \ccc{operator+}, \ccc{operator-} + + +\end{ccRefClass} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Point_d.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Point_d.tex new file mode 100644 index 00000000000..c18707cca6b --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Point_d.tex @@ -0,0 +1,60 @@ +\begin{ccRefClass}{Point_d} +\ccInclude{CGAL/Point_d.h} + +\ccDefinition + +An object of the class \ccClassTemplateName\ is a point in $d$-dimensional +Euclidean space $E_d$, where $d$ is arbitrary. + + +% ----------------------------------------------------------------------------- +\ccCreation +\ccCreationVariable{p} + +A \ccClassTemplateName\ object can be created from an iterator range. + +\ccConstructor{ template + Point_d (int dim, + InputIterator first, + InputIterator last);} + {if the range \ccc{[first,last)} contains \ccc{dim} elements, + this creates a point with Cartesian coordinates as specified by + the range. If \ccc{[first,last)} contains \ccc{dim+1} elements, + the range specifies the homogeneous coordinates of \ccVar. + \ccPrecond \ccc{dim} is nonnegative, \ccc{[first,last)} has + \ccc{dim} or \ccc{dim+1} elements, and the value types of first + and last are \ccc{R::RT}.} + +\emph{Note}: in case your compiler does not support member templates, \cgal\ +provides the following specialized constructor. + +\ccConstructor {Point_d (int dim, const R::RT* first, + const R::RT* last);}{} + +% ----------------------------------------------------------------------------- +\ccOperations + +\ccMemberFunction{ bool operator == (const Point_d& q) const;} + {Equality test. Two points are equal if they have the same + dimension and agree in all coordinates.} + +\ccMemberFunction{ bool operator != (const Point_d& q) const;} + {Test for inequality.} + +\ccMemberFunction{ R::RT homogeneous( int i) const;} + {returns the i'th homogeneous coordinate of \ccVar, starting + with 0. \ccPrecond $0\leq i\leq \ccc{d}$.} + +\ccMemberFunction{ R::FT cartesian( int i) const;} + {returns the i'th Cartesian coordinate of \ccVar, starting + with 0. \ccPrecond $0\leq i < \ccc{d}$.} + +\ccMemberFunction{ R::FT operator [] (int i) const;} + {returns the i'th Cartesian coordinate of \ccVar, starting + with 0. \ccPrecond $0\leq i < \ccc{d}$.} + +\ccMemberFunction{ int dimension () const;} + {returns the dimension \ccc{d} of \ccVar.} + +% ----------------------------------------------------------------------------- +\end{ccRefClass}% diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/R.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/R.tex new file mode 100644 index 00000000000..5797df761d7 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/R.tex @@ -0,0 +1,47 @@ +\begin{ccRefConcept}{R} + +The representation class parameter of the kernel types is denoted by \ccc{R}. +In terms of concepts, whenever \ccc{R} is used with a class \ccc{Kernel_object_d}, +a model for \ccc{R} must provide a nested type \ccc{R::Kernel_object_d} that conicides +with \ccc{Kernel_object_d}. The \cgal\ classes \ccc{Cartesian}, \ccc{Homogeneous}, +and \ccc{Simple_cartesian} fulfill this requirement. The requirement is slightly +stronger than the requirements for \ccc{Kernel}, since a type identity between +\ccc{Kernel::Kernel_object_d} and \ccc{Kernel_object_d} is not required for +a \ccc{Kernel}. The class \ccc{Kernel_object_d} need not even be instantiable. + +\ccTypes + +\ccNestedType{FT}{a number type that is a model for \ccc{FieldNumberType}} +\ccGlue +\ccNestedType{RT}{a number type that is a model for \ccc{RingNumberType}} + +\ccHasModels +\ccc{Cartesian}, \ccc{Homogeneous}, +\ccc{Simple_cartesian} + +\ccSeeAlso +\ccc{Point_2} \\ +\ccc{Vector_2} \\ +\ccc{Direction_2} \\ +\ccc{Line_2} \\ +\ccc{Ray_2} \\ +\ccc{Segment_2} \\ +\ccc{Triangle_2} \\ +\ccc{Iso_rectangle_2} \\ +\ccc{Aff_transformation_2} \\ +\ccc{Circle_2} \\ +\ccc{Point_3} \\ +\ccc{Vector_3} \\ +\ccc{Direction_3} \\ +\ccc{Iso_cuboid_3} \\ +\ccc{Line_3} \\ +\ccc{Ray_3} \\ +\ccc{Sphere_3} \\ +\ccc{Segment_3} \\ +\ccc{Plane_3} \\ +\ccc{Triangle_3} \\ +\ccc{Tetrahedron_3} \\ +\ccc{Aff_transformation_3} \\ +\ccc{Point_d} +\end{ccRefConcept} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/RIGHTTURN.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/RIGHTTURN.tex new file mode 100644 index 00000000000..667591ff3e3 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/RIGHTTURN.tex @@ -0,0 +1,3 @@ +\begin{ccRefConstant}{RIGHTTURN} +\ccGlobalVariable{const Orientation RIGHTTURN = NEGATIVE;} +\end{ccRefConstant} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Ray_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Ray_2.tex new file mode 100644 index 00000000000..2cc1c412f01 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Ray_2.tex @@ -0,0 +1,84 @@ +\begin{ccRefClass}{Ray_2} +\ccInclude{CGAL/Ray_2.h} + +\ccDefinition +An object \ccStyle{r} of the data type \ccRefName\ is a directed +straight ray in the two-dimensional Euclidean plane $\E^2$. It starts +in a point called the {\em source} of \ccStyle{r} and goes to infinity. + +\ccCreation +\ccCreationVariable{r} + + +\ccHidden \ccConstructor{Ray_2();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Ray_2(const Ray_2 &s);} + {copy constructor.} + +\ccConstructor{Ray_2(const Point_2 &p, const Point_2&q);} + {introduces a ray \ccVar\ + with source $p$ and passing through point $q$.} + +\ccConstructor{Ray_2(const Point_2 &p, const Direction_2 &d)} + {introduces a ray \ccVar\ starting at source $p$ with + direction $d$.} + +\ccOperations + +\ccHidden \ccMethod{Ray_2 &operator=(const Ray_2 &s);} + {Assignment.} + +\ccMethod{bool operator==(const Ray_2 &h) const;} + {Test for equality: two rays are equal, iff they have the same + source and the same direction.} + +\ccMethod{bool operator!=(const Ray_2 &h) const;} + {Test for inequality.} + +\ccMethod{Point_2 source() const;} + {returns the source of \ccVar.} + +\ccMethod{Point_2 point(int i) const;} + {returns a point on \ccVar. \ccStyle{point(0)} is the source, + \ccStyle{point(i)}, with $i>0$, is different from the + source. \ccPrecond $i \geq 0$.} + +\ccMethod{Direction_2 direction() const;} + {returns the direction of \ccVar.} + +\ccMethod{Line_2 supporting_line() const;} + {returns the line supporting \ccVar\ which has the same direction.} + +\ccMethod{Ray_2 opposite() const;} + {returns the ray with the same source and the opposite direction.} + +\ccPredicates + +\ccMethod{bool is_degenerate() const;} + {ray \ccVar\ is degenerate, if the source and the second defining + point fall together (that is if the direction is degenerate).} + +\ccMethod{bool is_horizontal() const;} + {} +\ccGlue +\ccMethod{bool is_vertical() const;} + {} + +\ccMethod{bool has_on(const Point_2 &p) const;} + {A point is on \ccVar, iff it is equal to the source + of \ccVar, or if it is in the interior of \ccVar.} + +\ccMethod{bool collinear_has_on(const Point_2 &p) const;} + {checks if point $p$ is on \ccVar. This function is faster + than function \ccStyle{has_on()} if the precondition + checking is disabled. + \ccPrecond{$p$ is on the supporting line of \ccVar.}} + +\ccHeading{Miscellaneous} + +\ccMethod{Ray_2 transform(const Aff_transformation_2 &t) const;} + {returns the ray obtained by applying $t$ on the source + and on the direction of \ccVar.} + +\end{ccRefClass} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Ray_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Ray_3.tex new file mode 100644 index 00000000000..8b83021e904 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Ray_3.tex @@ -0,0 +1,77 @@ +\begin{ccRefClass} {Ray_3} +\ccInclude{CGAL/Ray_3.h} + +\ccDefinition +An object \ccStyle{r} of the data type \ccRefName\ is a directed +straight ray in the three-dimensional Euclidean space $\E^3$. It starts +in a point called the {\em source} of \ccStyle{r} and it goes to infinity. + + +\ccCreation +\ccCreationVariable{r} + + +\ccHidden \ccConstructor{Ray_3();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Ray_3(const Ray_3 &s);} + {copy constructor.} + +\ccConstructor{Ray_3(const Point_3 &p, const Point_3 &q);} + {introduces a ray \ccVar\ + with source $p$ and passing through point $q$.} + +\ccConstructor{Ray_3(const Point_3 &p, const Direction_3 &d)} + {introduces a ray \ccVar\ with source $p$ and with + direction $d$.} + +\ccOperations + +\ccHidden \ccMethod{Ray_3 &operator=(const Ray_3 &s);} + {Assignment.} + +\ccMethod{bool operator==(const Ray_3 &h) const;} + {Test for equality: two rays are equal, iff they have the same + source and the same direction.} + +\ccMethod{bool operator!=(const Ray_3 &h) const;} + {Test for inequality.} + + + +\ccMethod{Point_3 source() const;} + {returns the source of \ccVar} + +\ccMethod{Point_3 point(int i) const;} + {returns a point on \ccVar. \ccStyle{point(0)} is the source. + \ccStyle{point(i)}, with $i>0$, is different from the + source. \ccPrecond $i \geq 0$.} + +\ccMethod{Direction_3 direction() const;} + {returns the direction of \ccVar.} + +\ccMethod{Line_3 supporting_line() const;} + {returns the line supporting \ccVar\ which has the same direction.} + +\ccMethod{Ray_3 opposite() const;} + {returns the ray with the same source and the opposite direction.} + +\ccMethod{bool is_degenerate() const;} + {ray \ccVar\ is degenerate, if the source and the second defining + point fall together (that is if the direction is degenerate).} + + +\ccMethod{bool has_on(const Point_3 &p) const;} + {A point is on \ccVar, iff it is equal to the source + of \ccVar, or if it is in the interior of \ccVar.} +% +% \ccMethod{bool collinear_has_on(const Point_3 &p) const;} +% {checks if point $p$ is on ray \ccVar. This function is faster +% than function \ccStyle{has_on()}. +% \ccPrecond{$p$ is collinear to \ccVar.}} +% +\ccMethod{Ray_3 transform(const Aff_transformation_3 &t) const;} + {returns the ray obtained by applying $t$ on the source + and on the direction of \ccVar.} + +\end{ccRefClass} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Reflection.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Reflection.tex new file mode 100644 index 00000000000..dcebce6c242 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Reflection.tex @@ -0,0 +1,10 @@ +\begin{ccRefClass}{Reflection} +\ccInclude{CGAL/aff_transformation_tags.h} + +\ccDefinition +Tag class for affine transformations. + +\ccSeeAlso +\ccc{Aff_transformation_2}, +\ccc{Aff_transformation_3} +\end{ccRefClass} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/RingNumberType.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/RingNumberType.tex new file mode 100644 index 00000000000..2f5e447725e --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/RingNumberType.tex @@ -0,0 +1,12 @@ +\begin{ccRefConcept}{RingNumberType} + +A number type representing ring elements, i.e., must be closed under +operations $+$, $-$, and $*$. A division operation is required only +for those cases where the remainder is zero. + +\ccRefines +\ccc{CopyConstructable}, \ccc{Assignable} + +\ccSeeAlso +\ccc{Kernel}, \ccc{R} +\end{ccRefConcept} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Rotation.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Rotation.tex new file mode 100644 index 00000000000..c1671c30c19 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Rotation.tex @@ -0,0 +1,10 @@ +\begin{ccRefClass}{Rotation} +\ccInclude{CGAL/aff_transformation_tags.h} + +\ccDefinition +Tag class for affine transformations. + +\ccSeeAlso +\ccc{Aff_transformation_2}, +\ccc{Aff_transformation_3} +\end{ccRefClass} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Scaling.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Scaling.tex new file mode 100644 index 00000000000..d5d3f485523 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Scaling.tex @@ -0,0 +1,10 @@ +\begin{ccRefClass}{Scaling} +\ccInclude{CGAL/aff_transformation_tags.h} + +\ccDefinition +Tag class for affine transformations. + +\ccSeeAlso +\ccc{Aff_transformation_2}, +\ccc{Aff_transformation_3} +\end{ccRefClass} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Segment_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Segment_2.tex new file mode 100644 index 00000000000..7a544791ea6 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Segment_2.tex @@ -0,0 +1,116 @@ +\begin{ccRefClass} {Segment_2} +\ccInclude{CGAL/Segment_2.h} + + +\ccDefinition An object $s$ of the data type \ccRefName\ is a directed +straight line segment in the two-dimensional Euclidean plane $\E^2$, i.e.\ a +straight line segment $[p,q]$ connecting two points $p,q$ +\ccTexHtml{$\in$}{in} +$\R^2$. The segment is topologically closed, i.e.\ the end +points belong to it. Point $p$ is called the {\em source} and $q$ +is called the {\em target} of $s$. The length of $s$ is the +Euclidean distance between $p$ and $q$. Note that there is only a function +to compute the square of the length, because otherwise we had to +perform a square root operation which is not defined for all +number types, is expensive, and may be inexact. + +\ccCreation +\ccCreationVariable{s} + + +\ccHidden \ccConstructor{Segment_2();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Segment_2(const Segment_2 &q);} + {copy constructor.} + +\ccConstructor{Segment_2(const Point_2 &p, const Point_2 &q);} + {introduces a segment \ccVar\ with source $p$ + and target $q$. The segment is directed from the source towards + the target.} + + +\ccOperations +%\ccSetTwoOfThreeColumns{5cm}{4cm} +\ccSetThreeColumns{Direction_2 & }{}{\hspace*{7.5cm}} + +\ccHidden \ccMethod{Segment_2 & operator=(const Segment_2 &q);} + {Assignment.} + +\ccMethod{bool operator==(const Segment_2 &q) const;} + {Test for equality: Two segments are equal, iff their sources and + targets are equal.} + +\ccMethod{bool operator!=(const Segment_2 &q) const;} + {Test for inequality.} + + +\ccMethod{Point_2 source() const;} + {returns the source of \ccVar.} + +\ccMethod{Point_2 target() const;} + {returns the target of \ccVar.} +\ccGlue +\ccMethod{Point_2 min() const;} + {returns the point of \ccVar\ with lexicographically smallest coordinate.} + +\ccMethod{Point_2 max() const;} + {returns the point of \ccVar\ with lexicographically largest coordinate.} + + +\ccMethod{Point_2 vertex(int i) const;} + {returns source or target of \ccVar: \ccStyle{vertex(0)} returns + the source of \ccVar, \ccStyle{vertex(1)} returns the target of \ccVar. + The parameter \ccStyle{i} is taken modulo 2, which gives + easy access to the other vertex. } + +\ccMethod{Point_2 point(int i) const;} + {returns \ccStyle{vertex(i)}.} + +\ccMethod{Point_2 operator[](int i) const;} + {returns \ccStyle{vertex(i)}.} + +\ccMethod{R::FT squared_length() const;} + {returns the squared length of \ccVar. } + +\ccMethod{Direction_2 direction() const;} + {returns the direction from source to target of \ccVar.} + + +\ccMethod{Segment_2 opposite() const; } + {returns a segment with source and target point interchanged.} + +\ccMethod{Line_2 supporting_line() const;} + {returns the line $l$ passing through \ccVar. Line $l$ has the + same orientation as segment \ccVar.} + +\ccPredicates + +\ccMethod{bool is_degenerate() const;} + {segment \ccVar\ is degenerate, if source and target are equal.} + +\ccMethod{bool is_horizontal() const;} + {} +\ccGlue +\ccMethod{bool is_vertical() const;} + {} + +\ccMethod{bool has_on(const Point_2 &p) const;} + {A point is on \ccVar, iff it is equal to the source or target + of \ccVar, or if it is in the interior of \ccVar.} + +\ccMethod{bool collinear_has_on(const Point_2 &p) const;} + {checks if point $p$ is on segment~\ccVar. This function is faster + than function \ccStyle{has_on()}. + \ccPrecond $p$ is on the supporting line of \ccVar.} + +\ccHeading{Miscellaneous} + +\ccMethod{Bbox_2 bbox() const;} + {returns a bounding box containing~\ccVar.} + +\ccMethod{Segment_2 transform(const Aff_transformation_2 &t) const;} + {returns the segment obtained by applying $t$ on the source + and the target of \ccVar.} + +\end{ccRefClass} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Segment_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Segment_3.tex new file mode 100644 index 00000000000..81ac22f02c3 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Segment_3.tex @@ -0,0 +1,104 @@ +\begin{ccRefClass} {Segment_3} +\ccInclude{CGAL/Segment_3.h} + + +\ccDefinition An object $s$ of the data type \ccRefName\ is a directed +straight line segment in the three-dimensional Euclidean space $\E^3$, i.e.\ a +straight line segment $[p,q]$ connecting two points $p,q \in +\R^3$. The segment is topologically closed, i.e.\ the end +points belong to it. Point $p$ is called the {\em source} and $q$ +is called the {\em target} of $s$. The length of $s$ is the +Euclidean distance between $p$ and $q$. Note that there is only a function +to compute the square of the length, because otherwise we had to +perform a square root operation which is not defined for all +number types, is expensive, and may not be exact. + +\ccCreation +\ccCreationVariable{s} + + +\ccHidden \ccConstructor{Segment_3();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Segment_3(const Segment_3 &q);} + {copy constructor.} + +\ccConstructor{Segment_3(const Point_3 &p, const Point_3 &q);} + {introduces a segment \ccVar\ with source $p$ + and target $q$. It is directed from the source towards + the target.} + + +\ccOperations +%\ccSetTwoOfThreeColumns{5cm}{4cm} + +\ccHidden \ccMethod{Segment_3 & operator=(const Segment_3 &q);} + {Assignment.} + +\ccMethod{bool operator==(const Segment_3 &q) const;} + {Test for equality: Two segments are equal, iff their sources and + targets are equal.} + +\ccMethod{bool operator!=(const Segment_3 &q) const;} + {Test for inequality.} + +\ccMethod{Point_3 source() const;} + {returns the source of \ccVar.} +\ccGlue +\ccMethod{Point_3 target() const;} + {returns the target of \ccVar.} + +\ccMethod{Point_3 min() const;} + {returns the point of \ccVar\ with smallest coordinate (lexicographically).} + +\ccMethod{Point_3 max() const;} + {returns the point of \ccVar\ with largest coordinate (lexicographically).} + +\ccMethod{Point_3 vertex(int i) const;} + {returns source or target of \ccVar: \ccStyle{vertex(0)} returns + the source, \ccStyle{vertex(1)} returns the target. + The parameter \ccStyle{i} is taken modulo 2, which gives + easy access to the other vertex.} + +\ccMethod{Point_3 point(int i) const;} + {returns \ccStyle{vertex(i)}.} +\ccGlue +\ccMethod{Point_3 operator[](int i) const;} + {returns \ccStyle{vertex(i)}.} + +\ccMethod{R::FT squared_length() const;} + {returns the squared length of \ccVar. } + +\ccMethod{Direction_3 direction() const;} + {returns the direction from source to target.} + + +\ccMethod{Segment_3 opposite() const; } + {returns a segment with source and target interchanged.} + +\ccMethod{Line_3 supporting_line() const;} + {returns the line $l$ passing through \ccVar. Line $l$ has the + same orientation as segment \ccVar, that is + from the source to the target of \ccVar.} + +\ccMethod{bool is_degenerate() const;} + {segment \ccVar\ is degenerate, if source and target fall together.} + + +\ccMethod{bool has_on(const Point_3 &p) const;} + {A point is on \ccVar, iff it is equal to the source or target + of \ccVar, or if it is in the interior of \ccVar.} +% +% \ccMethod{bool collinear_has_on(const Point_3 &p) const;} +% {checks if point $p$ is on segment~\ccVar. This function is faster +% than function \ccStyle{has_on()}. +% \ccPrecond $p$ is collinear to \ccVar.} +% +\ccMethod{Bbox_3 bbox() const;} + {returns a bounding box containing~\ccVar.} + +\ccMethod{Segment_3 transform(const Aff_transformation_3 &t) const;} + {returns the segment obtained by applying $t$ on the source + and the target of \ccVar.} + +\end{ccRefClass} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Sign.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Sign.tex new file mode 100644 index 00000000000..ff7bb72b49a --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Sign.tex @@ -0,0 +1,17 @@ +\begin{ccRefEnum}{Sign} +\ccInclude{CGAL/enum.h} + +\ccGlobalEnum{enum Sign { NEGATIVE, ZERO, POSITIVE }; } +\ccRefLabel{NEGATIVE} +\ccRefLabel{POSITIVE} +\ccRefLabel{ZERO} +\ccHtmlCrossLink{NEGATIVE} +\ccHtmlCrossLink{POSITIVE} +\ccHtmlCrossLink{ZERO} +\ccHtmlIndexC[enum_tags]{NEGATIVE} +\ccHtmlIndexC[enum_tags]{POSITIVE} +\ccHtmlIndexC[enum_tags]{ZERO} + +\ccSeeAlso +\ccc{Orientation} +\end{ccRefEnum} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Simple_cartesian.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Simple_cartesian.tex new file mode 100644 index 00000000000..026b6109217 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Simple_cartesian.tex @@ -0,0 +1,22 @@ +\begin{ccRefClass}{Simple_cartesian} +\ccInclude{CGAL/Simple_cartesian.h} + +\ccDefinition +A model for a \ccc{Kernel} using Cartesian coordinates to represent the +geometric objects. + +\ccRefines +\ccc{Kernel} + +\ccTypes +\ccTypedef{typedef FieldNumberType FT;}{} +\ccGlue +\ccTypedef{typedef FieldNumberType RT;}{} + +\ccImplementation In contrast to \ccc{Cartesian}, no reference counting +is used internally. This eases debugging, but may slow down algorithms +that copy objects intensively. + +\ccSeeAlso +\ccc{Cartesian}, \ccc{Homogeneous} +\end{ccRefClass} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Sphere_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Sphere_3.tex new file mode 100644 index 00000000000..52837701208 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Sphere_3.tex @@ -0,0 +1,175 @@ +\begin{ccRefClass}{Sphere_3} +\ccInclude{CGAL/Sphere_3.h} + +\ccDefinition + +An object of type \ccRefName\ is a sphere in the +three-dimensional Euclidean space $\E^3$. The sphere is oriented, i.e.\ +its boundary has clockwise or counterclockwise orientation. The +boundary splits $\E^3$ into a positive and a negative side, where the +positive side is to the left of the boundary. The boundary further +splits $\E^3$ into a bounded and an unbounded side. Note that the +sphere can be degenerated, i.e.\ the squared radius may be zero. + + +% ----------------------------------------------------------------------------- +\ccCreation +\ccCreationVariable{c} + +\ccHidden +\ccConstructor{ Sphere_3( );}{ + introduces an uninitialized variable \ccVar\ of type + \ccRefName.} + +\ccConstructor{ Sphere_3( Point_3 const& center, + R::FT const& squared_radius, + Orientation const& orientation = COUNTERCLOCKWISE);}{ + introduces a variable \ccVar\ of type \ccRefName. + It is initialized to the sphere with center \ccc{center}, + squared radius \ccc{squared_radius} and orientation + \ccc{orientation}. + \ccPrecond \ccc{orientation} $\neq$ \ccc{COPLANAR}, and furthermore, + \ccc{squared_radius} $\geq$ 0.} + +\ccConstructor{ Sphere_3( Point_3 const& p, + Point_3 const& q, + Point_3 const& r, + Point_3 const& s);}{ + introduces a variable \ccVar\ of type \ccRefName. + It is initialized to the unique sphere which passes through + the points \ccc{p}, \ccc{q}, \ccc{r} and \ccc{s}. The orientation of + the sphere is the orientation of the point quadruple \ccc{p}, + \ccc{q}, \ccc{r}, \ccc{s}. + \ccPrecond \ccc{p}, \ccc{q}, \ccc{r}, and \ccc{s} are not collinear.} + + +\ccConstructor{ Sphere_3( Point_3 const& p, + Point_3 const& q, + Point_3 const& r, + const Orientation& o = COUNTERCLOCKWISE);}{ + introduces a variable \ccVar\ of type \ccRefName. + It is initialized to the smallest sphere which passes through + the points \ccc{p}, \ccc{q}, and \ccc{r}. The orientation of + the sphere is \ccc{o}. \ccPrecond \ccc{o} is not + \ccc{COPLANAR}.} + +\ccConstructor{ Sphere_3( Point_3 const& p, + Point_3 const& q, + const Orientation& o = COUNTERCLOCKWISE);}{ + introduces a variable \ccVar\ of type \ccRefName. + It is initialized to the smallest sphere which passes through + the points \ccc{p} and \ccc{q}. The orientation of + the sphere is \ccc{o}. \ccPrecond \ccc{o} is not + \ccc{COPLANAR}.} + + +\ccConstructor{ Sphere_3( Point_3 const& center, + Orientation const& orientation = COUNTERCLOCKWISE);}{ + introduces a variable \ccVar\ of type \ccRefName. + It is initialized to the sphere with center \ccc{center}, squared + radius zero and orientation \ccc{orientation}. + \ccPrecond \ccc{orientation} $\neq$ \ccc{COPLANAR}. + \ccPostcond \ccVar.\ccc{is_degenerate()} = \ccc{true}.} + +\ccHidden +\ccConstructor{ Sphere_3( Sphere_3 const&);}{ + copy constructor.} + +\ccHidden +\ccMemberFunction{ Sphere_3& operator = ( Sphere_3 const&);}{ + assignment.} + +% ----------------------------------------------------------------------------- +\ccAccessFunctions + +\ccMemberFunction{Point_3 const& center( ) const;}{ + returns the center of \ccVar.} +\ccGlue +\ccMemberFunction{ R::FT const& squared_radius( ) const;}{ + returns the squared radius of \ccVar.} +\ccGlue +\ccMemberFunction{ orientation const& orientation( ) const;}{ + returns the orientation of \ccVar.} + +% ----------------------------------------------------------------------------- + +\ccHidden\ccMemberFunction{ bool operator == ( Sphere_3 const& sphere) const;}{ + returns \ccc{true}, iff \ccVar\ and \ccc{sphere} are equal, + i.e.\ if they have the same center, same squared radius and + same orientation.} + +\ccHidden\ccMemberFunction{ bool operator != ( Sphere_3 const& sphere) const;}{ + returns \ccc{true}, iff \ccVar\ and \ccc{sphere} are not equal.} + +% ----------------------------------------------------------------------------- +\ccPredicates + +\ccMemberFunction{ bool is_degenerate( ) const;}{ + returns \ccc{true}, iff \ccVar\ is degenerate, i.e.\ + if \ccVar\ has squared radius zero.} + +\ccMemberFunction{ Oriented_side + oriented_side( Point_3 const& p) const;}{ + returns either the constant \ccc{ON_ORIENTED_BOUNDARY}, + \ccc{ON_POSITIVE_SIDE}, or \ccc{ON_NEGATIVE_SIDE}, + iff \ccc{p} lies on the boundary, properly on the + positive side, or properly on the negative side + of \ccVar, resp.} + +\ccMemberFunction{ Bounded_side + bounded_side( Point_3 const& p) const;}{ + returns \ccc{ON_BOUNDED_SIDE}, + \ccc{ON_BOUNDARY}, or \ccc{ON_UNBOUNDED_SIDE} + iff \ccc{p} lies properly inside, on the boundary, or properly + outside of \ccVar, resp.} + +%\ccMemberFunction{ bool has_on_positive_side( Point const& p) const;}{ +% returns \ccc{true}, iff \ccc{p} lies properly on the +% positive side of \ccVar.} +% +%\ccMemberFunction{ bool has_on_negative_side( Point const& p) const;}{ +% returns \ccc{true}, iff \ccc{p} lies properly on the +% negative side of \ccVar.} +% +%\ccMemberFunction{ bool has_on_boundary( Point const& p) const;}{ +% returns \ccc{true}, iff \ccc{p} lies on the boundary +% of \ccVar.} +% +%\ccMemberFunction{ bool has_on_bounded_side( Point const& p) const;}{ +% returns \ccc{true}, iff \ccc{p} lies properly inside \ccVar.} +% +%\ccMemberFunction{ bool +% has_on_unbounded_side( Point const& p) const;}{ +% returns \ccc{true}, iff \ccc{p} lies properly outside of \ccVar.} +\ccMethod{bool has_on_positive_side(const Point_3 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_negative_side(const Point_3 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_boundary(const Point_3 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_bounded_side(const Point_3 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_unbounded_side(const Point_3 &p) const;} + {} + +% ----------------------------------------------------------------------------- +\ccHeading{Miscellaneous} + +\ccMemberFunction{ Sphere_3 opposite() const;}{ + returns the sphere with the same center and squared radius as + \ccVar\, but with opposite orientation.} + + +\ccMemberFunction{ Sphere_3 orthogonal_transform( + Aff_transformation_3 const& at) const;}{ + returns the sphere obtained by applying $at$ on \ccVar. + \ccPrecond \ccc{at} is an orthogonal transformation.} + +\ccMemberFunction{ Bbox_3 bbox() const;}{ + returns a bounding box containing \ccVar.} + +\end{ccRefClass} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Tetrahedron_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Tetrahedron_3.tex new file mode 100644 index 00000000000..a022ff5a336 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Tetrahedron_3.tex @@ -0,0 +1,102 @@ +\begin{ccRefClass} {Tetrahedron_3} +\ccInclude{CGAL/Tetrahedron_3.h} + + +\ccDefinition An object $t$ of the class \ccRefName\ is an oriented +tetrahedron in the three-dimensional Euclidean space $\E^3$. + +It is defined by four vertices $p_0$, $p_1$, $p_2$ and $p_3$. +The orientation of a tetrahedron is the orientation of its four +vertices. That means it is positive when $p_3$ is on the positive +side of the plane defined by $p_0$, $p_1$ and $p_2$. + +The tetrahedron itself splits the space $\E_3$ in a {\em positive} and +a {\em negative} side. + +The boundary of a tetrahedron splits the space in two open regions, a +bounded one and an unbounded one. + +\ccCreation +\ccCreationVariable{t} + + +\ccHidden \ccConstructor{Tetrahedron_3();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Tetrahedron_3(const Tetrahedron_3 &u);} + {copy constructor.} + + +\ccConstructor{Tetrahedron_3(const Point_3 &p0, + const Point_3 &p1, + const Point_3 &p2, + const Point_3 &p3);} + {introduces a tetrahedron \ccVar\ with vertices $p_0$, $p_1$, $p_2$ and $p_3$.} + + +\ccOperations + +\ccHidden \ccMethod{Tetrahedron_3 & operator=(const Tetrahedron_3 &t2);} + {Assignment.} + +\ccMethod{bool operator==(const Tetrahedron_3 &t2) const;} +% {Test for equality: two tetrahedra are equal, iff there exists a +% cyclic permutation of the vertices of $t2$, such that they are +% equal to the vertices of~\ccVar.} + {Test for equality: two tetrahedra \ccVar\ and \ccc{t2} are equal, + iff \ccVar\ and \ccc{t2} have the same orientation and + their sets (not sequences) of vertices are equal.} + +\ccMethod{bool operator!=(const Tetrahedron_3 &t2) const;} + {Test for inequality.} + +\ccMethod{Point_3 vertex(int i) const;} + {returns the i'th vertex modulo 4 of~\ccVar.} + +\ccMethod{Point_3 operator[](int i) const;} + {returns \ccStyle{vertex(int i)}.} + +\ccPredicates + +\ccMethod{bool is_degenerate() const;} + {Tetrahedron \ccVar\ is degenerate, if the vertices are coplanar.} + + +\ccMethod{Orientation orientation() const;} + { } + +\ccMethod{Oriented_side oriented_side(const Point_3 &p) const;} + {\ccPrecond: \ccVar\ is not degenerate.} + +\ccMethod{Bounded_side bounded_side(const Point_3 &p) const;} + {\ccPrecond: \ccVar\ is not degenerate.} + +For convenience we provide the following boolean functions: + +\ccMethod{bool has_on_positive_side(const Point_3 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_negative_side(const Point_3 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_boundary(const Point_3 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_bounded_side(const Point_3 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_unbounded_side(const Point_3 &p) const;} + {} + +\ccHeading{Miscellaneous} + +\ccMethod{Bbox_3 bbox() const;} + {returns a bounding box containing \ccVar.} + +\ccMethod{Tetrahedron_3 transform(const Aff_transformation_3 &at) const;} + {returns the tetrahedron obtained by applying $at$ on the three + vertices of~\ccVar.} + + + +\end{ccRefClass} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Traits.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Traits.tex new file mode 100644 index 00000000000..e86f28ff5bf --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Traits.tex @@ -0,0 +1,253 @@ +\input{Aff_transformation_2.tex} +\input{Aff_transformation_3.tex} +\input{are_ordered_along_line.tex} +\input{are_strictly_ordered_along_line.tex} +\input{assign.tex} +\input{Bbox_2.tex} +\input{Bbox_3.tex} +\input{Bounded_side.tex} +\input{Cartesian.tex} +\input{cartesian_to_homogeneous.tex} +\input{Circle_2.tex} +\input{circumcenter.tex} +\input{CLOCKWISE.tex} +\input{cmp_dist_to_point.tex} +\input{cmp_signed_dist_to_line.tex} +\input{cmp_signed_dist_to_plane.tex} +\input{COLLINEAR.tex} +\input{collinear.tex} +\input{collinear_are_ordered_along_line.tex} +\input{collinear_are_strictly_ordered_along_line.tex} +\input{compare_lexicographically_xy.tex} +\input{compare_lexicographically_xyz.tex} +\input{compare_x.tex} +\input{compare_y.tex} +\input{compare_y_at_x.tex} +\input{compare_z.tex} +\input{Comparison_result.tex} +\input{COPLANAR.tex} +\input{coplanar.tex} +\input{coplanar_orientation.tex} +\input{COUNTERCLOCKWISE.tex} +\input{cross_product.tex} +\input{DEGENERATE.tex} +\input{Direction_2.tex} +\input{Direction_3.tex} +\input{do_overlap.tex} +\input{has_larger_dist_to_point.tex} +\input{has_larger_signed_dist_to_line.tex} +\input{has_larger_signed_dist_to_plane.tex} +\input{has_smaller_dist_to_point.tex} +\input{has_smaller_signed_dist_to_line.tex} +\input{has_smaller_signed_dist_to_plane.tex} +\input{Homogeneous.tex} +\input{homogeneous_to_cartesian.tex} +\input{homogeneous_to_quotient_cartesian.tex} +\input{Identity_transformation.tex} +\input{Iso_rectangle_2.tex} +\input{Kernel.tex} +\input{Kernel::Aff_transformation_2.tex} +\input{Kernel::Aff_transformation_3.tex} +\input{Kernel::Are_ordered_along_line_2.tex} +\input{Kernel::Are_ordered_along_line_3.tex} +\input{Kernel::Are_strictly_ordered_along_line_2.tex} +\input{Kernel::Are_strictly_ordered_along_line_3.tex} +\input{Kernel::Circle_2.tex} +\input{Kernel::Collinear_2.tex} +\input{Kernel::Collinear_3.tex} +\input{Kernel::Collinear_are_ordered_along_line_2.tex} +\input{Kernel::Collinear_are_ordered_along_line_3.tex} +\input{Kernel::Collinear_are_strictly_ordered_along_line_2.tex} +\input{Kernel::Collinear_are_strictly_ordered_along_line_3.tex} +\input{Kernel::Collinear_has_on_2.tex} +\input{Kernel::Collinear_has_on_3.tex} +\input{Kernel::Compare_x_2.tex} +\input{Kernel::Compare_x_3.tex} +\input{Kernel::Compare_xy_2.tex} +\input{Kernel::Compare_xy_3.tex} +\input{Kernel::Compare_xyz_3.tex} +\input{Kernel::Compare_y_2.tex} +\input{Kernel::Compare_y_3.tex} +\input{Kernel::Compare_y_at_x_2.tex} +\input{Kernel::Compare_z_3.tex} +\input{Kernel::Compute_squared_length_2.tex} +\input{Kernel::Compute_squared_length_3.tex} +\input{Kernel::Compute_x_at_y_2.tex} +\input{Kernel::Compute_y_at_x_2.tex} +\input{Kernel::Construct_aff_transformation_2.tex} +\input{Kernel::Construct_aff_transformation_3.tex} +\input{Kernel::Construct_bisector_2.tex} +\input{Kernel::Construct_circle_2.tex} +\input{Kernel::Construct_circumcenter_2.tex} +\input{Kernel::Construct_direction_2.tex} +\input{Kernel::Construct_direction_3.tex} +\input{Kernel::Construct_direction_of_line_2.tex} +\input{Kernel::Construct_direction_of_line_3.tex} +\input{Kernel::Construct_direction_of_ray_2.tex} +\input{Kernel::Construct_direction_of_ray_3.tex} +\input{Kernel::Construct_line_2.tex} +\input{Kernel::Construct_line_3.tex} +\input{Kernel::Construct_max_point_2.tex} +\input{Kernel::Construct_max_point_3.tex} +\input{Kernel::Construct_midpoint_2.tex} +\input{Kernel::Construct_midpoint_3.tex} +\input{Kernel::Construct_min_point_2.tex} +\input{Kernel::Construct_min_point_3.tex} +\input{Kernel::Construct_opposite_circle_2.tex} +\input{Kernel::Construct_opposite_line_2.tex} +\input{Kernel::Construct_opposite_line_3.tex} +\input{Kernel::Construct_opposite_plane_3.tex} +\input{Kernel::Construct_opposite_ray_2.tex} +\input{Kernel::Construct_opposite_ray_3.tex} +\input{Kernel::Construct_opposite_segment_2.tex} +\input{Kernel::Construct_opposite_segment_3.tex} +\input{Kernel::Construct_opposite_triangle_2.tex} +%\input{Kernel::Construct_perpendicular_direction_2.tex} +\input{Kernel::Construct_perpendicular_line_2.tex} +\input{Kernel::Construct_perpendicular_line_3.tex} +\input{Kernel::Construct_perpendicular_plane_3.tex} +\input{Kernel::Construct_perpendicular_vector_2.tex} +\input{Kernel::Construct_plane_3.tex} +\input{Kernel::Construct_point_2.tex} +\input{Kernel::Construct_point_3.tex} +\input{Kernel::Construct_point_d.tex} +\input{Kernel::Construct_point_on_2.tex} +\input{Kernel::Construct_point_on_3.tex} +\input{Kernel::Construct_ray_2.tex} +\input{Kernel::Construct_ray_3.tex} +\input{Kernel::Construct_second_point_on_2.tex} +\input{Kernel::Construct_second_point_on_3.tex} +\input{Kernel::Construct_segment_2.tex} +\input{Kernel::Construct_segment_3.tex} +\input{Kernel::Construct_source_point_2.tex} +\input{Kernel::Construct_source_point_3.tex} +\input{Kernel::Construct_supporting_line_2.tex} +\input{Kernel::Construct_supporting_line_3.tex} +\input{Kernel::Construct_supporting_plane_3.tex} +\input{Kernel::Construct_target_point_2.tex} +\input{Kernel::Construct_target_point_3.tex} +\input{Kernel::Construct_tetrahedron_3.tex} +\input{Kernel::Construct_triangle_2.tex} +\input{Kernel::Construct_triangle_3.tex} +\input{Kernel::Construct_vector_2.tex} +\input{Kernel::Construct_vector_3.tex} +\input{Kernel::Coplanar_3.tex} +\input{Kernel::Coplanar_orientation_3.tex} +\input{Kernel::Direction_2.tex} +\input{Kernel::Direction_3.tex} +\input{Kernel::Equal_2.tex} +\input{Kernel::Equal_3.tex} +\input{Kernel::Equal_x_2.tex} +\input{Kernel::Equal_x_3.tex} +\input{Kernel::Equal_xy_2.tex} +\input{Kernel::Equal_xy_3.tex} +\input{Kernel::Equal_xyz_3.tex} +\input{Kernel::Equal_y_2.tex} +\input{Kernel::Equal_y_3.tex} +\input{Kernel::Equal_z_3.tex} +\input{Kernel::Has_on_2.tex} +\input{Kernel::Has_on_3.tex} +\input{Kernel::Has_on_boundary_2.tex} +\input{Kernel::Has_on_boundary_3.tex} +\input{Kernel::Has_on_bounded_side_2.tex} +\input{Kernel::Has_on_bounded_side_3.tex} +\input{Kernel::Has_on_negative_side_2.tex} +\input{Kernel::Has_on_negative_side_3.tex} +\input{Kernel::Has_on_positive_side_2.tex} +\input{Kernel::Has_on_positive_side_3.tex} +\input{Kernel::Has_on_unbounded_side_2.tex} +\input{Kernel::Has_on_unbounded_side_3.tex} +\input{Kernel::Intersect_2.tex} +\input{Kernel::Intersect_3.tex} +\input{Kernel::Is_degenerate_2.tex} +\input{Kernel::Is_degenerate_3.tex} +\input{Kernel::Is_horizontal_2.tex} +\input{Kernel::Is_vertical_2.tex} +\input{Kernel::Iso_rectangle_2.tex} +\input{Kernel::Left_of_line_2.tex} +\input{Kernel::Leftturn_2.tex} +\input{Kernel::Less_distance_to_point_2.tex} +\input{Kernel::Less_distance_to_point_3.tex} +\input{Kernel::Less_rotate_ccw_2.tex} +\input{Kernel::Less_signed_distance_to_line_2.tex} +\input{Kernel::Less_x_2.tex} +\input{Kernel::Less_x_3.tex} +\input{Kernel::Less_xy_2.tex} +\input{Kernel::Less_xy_3.tex} +\input{Kernel::Less_xyz_3.tex} +\input{Kernel::Less_y_2.tex} +\input{Kernel::Less_y_3.tex} +\input{Kernel::Less_z_3.tex} +\input{Kernel::Line_2.tex} +\input{Kernel::Line_3.tex} +\input{Kernel::Orientation_2.tex} +\input{Kernel::Orientation_3.tex} +\input{Kernel::Oriented_side_2.tex} +\input{Kernel::Oriented_side_3.tex} +\input{Kernel::Plane_3.tex} +\input{Kernel::Point_2.tex} +\input{Kernel::Point_3.tex} +\input{Kernel::Point_d.tex} +\input{Kernel::Ray_2.tex} +\input{Kernel::Ray_3.tex} +\input{Kernel::Segment_2.tex} +\input{Kernel::Segment_3.tex} +\input{Kernel::Side_of_bounded_circle_2.tex} +\input{Kernel::Side_of_bounded_sphere_3.tex} +\input{Kernel::Side_of_oriented_circle_2.tex} +\input{Kernel::Side_of_oriented_sphere_3.tex} +\input{Kernel::Tetrahedron_3.tex} +\input{Kernel::Transform_2.tex} +\input{Kernel::Transform_3.tex} +\input{Kernel::Triangle_2.tex} +\input{Kernel::Triangle_3.tex} +\input{Kernel::Vector_2.tex} +\input{Kernel::Vector_3.tex} +\input{LEFTTURN.tex} +\input{leftturn.tex} +\input{lexicographically_xy_larger.tex} +\input{lexicographically_xy_larger_or_equal.tex} +\input{lexicographically_xy_smaller.tex} +\input{lexicographically_xy_smaller_or_equal.tex} +\input{lexicographically_xyz_smaller.tex} +\input{lexicographically_xyz_smaller_or_equal.tex} +\input{Line_2.tex} +\input{Line_3.tex} +\input{make_object.tex} +\input{midpoint.tex} +\input{Object.tex} +\input{operator*.tex} +\input{operator+.tex} +\input{operator-.tex} +\input{opposite.tex} +\input{Orientation.tex} +\input{orientation.tex} +\input{Oriented_side.tex} +\input{Point_2.tex} +\input{Point_3.tex} +\input{Point_d.tex} +\input{quotient_cartesian_to_homogeneous.tex} +\input{Ray_2.tex} +\input{Ray_3.tex} +\input{Reflection.tex} +\input{RIGHTTURN.tex} +\input{rightturn.tex} +\input{Rotation.tex} +\input{Scaling.tex} +\input{Segment_2.tex} +\input{Segment_3.tex} +\input{side_of_bounded_circle.tex} +\input{side_of_bounded_sphere.tex} +\input{side_of_oriented_circle.tex} +\input{side_of_oriented_sphere.tex} +\input{Sign.tex} +\input{Simple_cartesian.tex} +\input{Tetrahedron_3.tex} +\input{Translation.tex} +\input{Triangle_2.tex} +\input{Triangle_3.tex} +\input{Vector_2.tex} +\input{Vector_3.tex} +\input{x_equal.tex} +\input{y_equal.tex} +\input{z_equal.tex} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Translation.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Translation.tex new file mode 100644 index 00000000000..023f9db280c --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Translation.tex @@ -0,0 +1,10 @@ +\begin{ccRefClass}{Translation} +\ccInclude{CGAL/aff_transformation_tags.h} + +\ccDefinition +Tag class for affine transformations. + +\ccSeeAlso +\ccc{Aff_transformation_2}, +\ccc{Aff_transformation_3} +\end{ccRefClass} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Triangle_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Triangle_2.tex new file mode 100644 index 00000000000..5b585cfb612 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Triangle_2.tex @@ -0,0 +1,106 @@ +\begin{ccRefClass} {Triangle_2} +\ccInclude{CGAL/Triangle_2.h} + +\ccDefinition An object $t$ of the class \ccRefName\ is a triangle +in the two-dimensional Euclidean plane~$\E^2$. +Triangle $t$ is oriented, i.e., its boundary has +clockwise or counterclockwise orientation. We call the side to the left +of the boundary the positive side and the side to the right of the +boundary the negative side. + +As any Jordan curve the boundary of a triangle splits the plane in +two open regions, a bounded one and an unbounded one. + +\ccCreation +\ccCreationVariable{t} + + +\ccHidden \ccConstructor{Triangle_2();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Triangle_2(const Triangle_2 &u);} + {copy constructor.} + + +\ccConstructor{Triangle_2(const Point_2 &p, + const Point_2 &q, + const Point_2 &r);} + {introduces a triangle \ccVar\ with vertices $p$, $q$ and $r$.} + + +\ccOperations + +\ccHidden \ccMethod{Triangle_2 & operator=(const Triangle_2 &t2);} + {Assignment.} + +\ccMethod{bool operator==(const Triangle_2 &t2) const;} + {Test for equality: two triangles are equal, iff there exists a + cyclic permutation of the vertices of $t2$, such that they are + equal to the vertices of \ccVar.} + +\ccMethod{bool operator!=(const Triangle_2 &t2) const;} + {Test for inequality.} + +\ccMethod{Point_2 vertex(int i) const;} + {returns the i'th vertex modulo 3 of~\ccVar.} + +\ccMethod{Point_2 operator[](int i) const;} + {returns \ccStyle{vertex(i)}.} + +\ccPredicates + +\ccMethod{bool is_degenerate() const;} + {triangle \ccVar\ is degenerate, if the vertices are collinear.} + +\ccMethod{Orientation orientation() const;} + {returns the orientation of~\ccVar.} + +\ccMethod{Oriented_side oriented_side(const Point_2 &p) const;} + {returns + \ccStyle{ON_ORIENTED_BOUNDARY}, or + \ccStyle{POSITIVE_SIDE}, + or the constant + \ccStyle{ON_NEGATIVE_SIDE}, + determined by the position of point $p$. + \ccPrecond \ccVar\ is not degenerate.} + +\ccMethod{Bounded_side bounded_side(const Point_2 &p) const;} + {returns the constant \ccStyle{ON_BOUNDARY}, + \ccStyle{ON_BOUNDED_SIDE}, or else + \ccStyle{ON_UNBOUNDED_SIDE}, + depending on where point $p$ is. + \ccPrecond \ccVar\ is not degenerate.} + +For convenience we provide the following boolean functions: + +\ccMethod{bool has_on_positive_side(const Point_2 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_negative_side(const Point_2 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_boundary(const Point_2 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_bounded_side(const Point_2 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_unbounded_side(const Point_2 &p) const;} + {\ccPrecond \ccVar\ is not degenerate.} + +\ccHeading{Miscellaneous} + +\ccMethod{Triangle_2 opposite();} + {returns a triangle where the boundary is oriented the other + way round (this flips the positive and the negative side, but + not the bounded and unbounded side).} + +\ccMethod{Bbox_2 bbox() const;} + {returns a bounding box containing \ccVar.} + +\ccMethod{Triangle_2 transform(const Aff_transformation_2 &at) const;} + {returns the triangle obtained by applying $at$ on the three + vertices of \ccVar.} + + +\end{ccRefClass} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Triangle_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Triangle_3.tex new file mode 100644 index 00000000000..c1a677395c0 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Triangle_3.tex @@ -0,0 +1,63 @@ +\begin{ccRefClass} {Triangle_3} +\ccInclude{CGAL/Triangle_3.h} + +\ccDefinition An object $t$ of the class \ccRefName\ is a triangle in +the three-dimensional Euclidean space $\E^3$. As the triangle is not +a full-dimensional object there is only a test whether a point lies on +the triangle or not. + +\ccCreation +\ccCreationVariable{t} + +\ccHidden \ccConstructor{Triangle_3();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Triangle_3(const Triangle_3 &u);} + {copy constructor.} + +\ccConstructor{Triangle_3(const Point_3 &p, + const Point_3 &q, + const Point_3 &r);} + {introduces a triangle \ccVar\ with vertices $p$, $q$ and $r$.} + +\ccOperations + +\ccHidden \ccMethod{Triangle_3 & operator=(const Triangle_3 &t2);} + {Assignment.} + +\ccMethod{bool operator==(const Triangle_3 &t2) const;} + {Test for equality: two triangles t and $t_2$ are equal, iff there + exists a cyclic permutation of the vertices of $t2$, such that + they are equal to the vertices of~\ccVar.} + +\ccMethod{bool operator!=(const Triangle_3 &t2) const;} + {Test for inequality.} + +\ccMethod{Point_3 vertex(int i) const;} + {returns the i'th vertex modulo 3 of~\ccVar.} + +\ccMethod{Point_3 operator[](int i) const;} + {returns \ccStyle{vertex(int i)}.} + +\ccMethod{Plane_3 supporting_plane();} + {returns the supporting plane of \ccVar, with same + orientation.} + +\ccPredicates + +\ccMethod{bool is_degenerate() const;} + {{\ccVar} is degenerate if its vertices are collinear.} + +\ccMethod{bool has_on(const Point_3 &p) const;} + {A point is on \ccVar, if it is on a vertex, an edge or the + face of \ccVar.} + +\ccHeading{Miscellaneous} + +\ccMethod{Bbox_3 bbox() const;} + {returns a bounding box containing \ccVar.} + +\ccMethod{Triangle_3 transform(const Aff_transformation_3 &at) const;} + {returns the triangle obtained by applying $at$ on the three + vertices of~\ccVar.} +\end{ccRefClass} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Vector_2.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Vector_2.tex new file mode 100644 index 00000000000..a4cc35f1940 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Vector_2.tex @@ -0,0 +1,136 @@ +\begin{ccRefClass} {Vector_2} +\ccInclude{CGAL/Vector_2.h} + +\ccDefinition + +An object of the class \ccRefName\ is a vector in the two-dimensional +vector space $\R^2$. Geometrically spoken, a vector is the difference +of two points $p_2$, $p_1$ and denotes the direction and the distance +from $p_1$ to $p_2$. + +\cgal\ defines a symbolic constant \ccStyle{NULL_VECTOR}. We +will explicitly state where you can pass this constant as an argument +instead of a vector initialized with zeros. + + +\ccCreation +\ccCreationVariable{v} + + +\ccHidden\ccConstructor{Vector_2();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Vector_2(const Vector_2 &w);} + {copy constructor.} + +\ccConstructor{Vector_2(const Null_vector &NULL_VECTOR);} + {introduces a null vector \ccVar.} + +\ccConstructor{Vector_2(const R::RT &hx, const R::RT &hy, const R::RT &hw = R::RT(1));} + {introduces a vector \ccVar\ initialized to $(hx/hw,hy/hw)$. + If the third argument is not explicitly given, it defaults + to \ccStyle{R::RT(1)}. + \ccPrecond \ccTexHtml{$hw\neq 0$}{hw not equal to 0} } + + +\ccOperations + +\ccHidden \ccMethod{Vector_2 & operator=(const Vector_2 &w);} + {Assignment.} + +\ccMethod{bool operator==(const Vector_2 &w) const;} + {Test for equality: two vectors are equal, iff their $x$ and $y$ + coordinates are equal. You can compare a vector with the + \ccStyle{NULL_VECTOR}.} + +\ccMethod{bool operator!=(const Vector_2 &w) const;} + {Test for inequality. You can compare a vector with the + \ccStyle{NULL_VECTOR}.} + + +There are two sets of coordinate access functions, namely to the +homogeneous and to the \ccHtmlNoLinksFrom{Cartesian} coordinates. They can be used +independently from the chosen representation type \ccStyle{R}. + +\ccMethod{R::RT hx() const;} + {returns the homogeneous $x$ coordinate.} +\ccGlue +\ccMethod{R::RT hy() const;} + {returns the homogeneous $y$ coordinate.} +\ccGlue +\ccMethod{R::RT hw() const;} + {returns the homogenizing coordinate.} + +Here come the \ccHtmlNoLinksFrom{Cartesian} access functions. Note that you do not loose +information with the homogeneous representation, because then the field +type is a quotient. + +\ccMethod{R::FT x() const;} + {returns the \ccStyle{x}-coordinate of \ccVar, that is $hx/hw$.} +\ccGlue +\ccMethod{R::FT y() const;} + {returns the \ccStyle{y}-coordinate of \ccVar, that is $hy/hw$.} + +The following operations are for convenience and for making the +class \ccRefName\ compatible with code for higher dimensional vectors. +Again they come in a \ccHtmlNoLinksFrom{Cartesian} and homogeneous flavor. + +\ccMethod{R::RT homogeneous(int i) const;} + {returns the i'th homogeneous coordinate of \ccVar, starting with 0. + \ccPrecond $0\leq i \leq 2$.} +\ccGlue +\ccMethod{R::FT cartesian(int i) const;} + {returns the i'th \ccHtmlNoLinksFrom{Cartesian} coordinate of \ccVar, starting at 0. + \ccPrecond $0\leq i \leq 1$.} +\ccGlue +\ccMethod{R::FT operator[](int i) const;} + {returns \ccStyle{cartesian(i)}. + \ccPrecond $0\leq i \leq 1$.} + +\ccMethod{int dimension() const;} + {returns the dimension (the constant 2).} + +\ccMethod{Direction_2 direction() const;} + {returns the direction which passes through \ccVar.} + +\ccMethod{Vector_2 transform(const Aff_transformation_2 &t) const;} + {returns the vector obtained by applying $t$ on \ccVar.} + +\ccMethod{Vector_2 perpendicular(const Orientation &o) const;} + {returns the vector perpendicular to \ccVar\ in clockwise or + counterclockwise orientation.} + +\ccHeading{Operators} + +The following operations can be applied on vectors: + +\ccMethod{Vector_2 operator+(const Vector_2 &w) const;} + {Addition.} + +\ccMethod{Vector_2 operator-(const Vector_2 &w) const;} + {Subtraction.} + +\ccMethod{Vector_2 operator-() const;} + {returns the opposite vector.} + +\ccMethod{R::FT operator*(const Vector_2 &w) const;} + {returns the scalar product (= inner product) of the two vectors.} + + +\ccMethod{Vector_2 operator*(const R::RT &s) const;} + {Multiplication with a scalar from the right. Although it would + be more natural, \cgal\ does not offer a multiplication with a + scalar from the left. (This is due to problems of some compilers.)} + +\ccMethod{Vector_2 operator*(const Quotient &s) const;} + {Multiplication with a scalar from the right.} + + +%\ccFunction{Vector_2 operator*(const R::RT &s, +% const Vector_2 &w);} +% {Multiplication with a scalar from the left.} + +\ccMethod{Vector_2 operator/(const R::RT &s) const;} + {Division by a scalar.} + +\end{ccRefClass} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/Vector_3.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/Vector_3.tex new file mode 100644 index 00000000000..92c861f0aa1 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/Vector_3.tex @@ -0,0 +1,144 @@ +\begin{ccRefClass} {Vector_3} +\ccInclude{CGAL/Vector_3.h} + +\ccDefinition + +An object of the class \ccRefName\ is a vector in the three-dimensional +vector space $\R^3$. Geometrically spoken a vector is the difference +of two points $p_2$, $p_1$ and denotes the direction and the distance +from $p_1$ to $p_2$. + +\cgal\ defines a symbolic constant \ccStyle{NULL_VECTOR}. We +will explicitly state where you can pass this constant as an argument +instead of a vector initialized with zeros. + + +\ccCreation +\ccCreationVariable{v} + + +\ccHidden\ccConstructor{Vector_3();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Vector_3(const Vector_3 &w);} + {copy constructor.} + +\ccConstructor{Vector_3(const Null_vector &NULL_VECTOR);} + {introduces a null vector \ccVar.} + +\ccConstructor{Vector_3(const R::RT &hx, const R::RT &hy, const R::FT &hz, const R::RT &hw = R::RT(1));} + {introduces a vector \ccVar\ initialized to $(hx/hw, hy/hw, hz/hw)$. + If the third argument is not explicitly given it defaults + to \ccStyle{R::RT(1)}.} + + +\ccOperations + +\ccHidden \ccMethod{Vector_3 & operator=(const Vector_3 &w);} + {Assignment.} + +\ccMethod{bool operator==(const Vector_3 &w) const;} + {Test for equality: two vectors are equal, iff their $x$, $y$ + and $z$ coordinates are equal. You can compare a vector with the + \ccStyle{NULL_VECTOR}.} + +\ccMethod{bool operator!=(const Vector_3 &w) const;} + {Test for inequality. You can compare a vector with the + \ccStyle{NULL_VECTOR}.} + + +There are two sets of coordinate access functions, namely to the +homogeneous and to the \ccHtmlNoLinksFrom{Cartesian} coordinates. They can be used +independently from the chosen representation type \ccStyle{R}. + +\ccMethod{R::RT hx() const;} + {returns the homogeneous $x$ coordinate.} +\ccGlue +\ccMethod{R::RT hy() const;} + {returns the homogeneous $y$ coordinate.} +\ccGlue +\ccMethod{R::RT hz() const;} + {returns the homogeneous $z$ coordinate.} +\ccGlue +\ccMethod{R::RT hw() const;} + {returns the homogenizing coordinate.} + +Here come the \ccHtmlNoLinksFrom{Cartesian} access functions. Note that you do not loose +information with the homogeneous representation, because then the field +type is a quotient. + + +\ccMethod{R::FT x() const;} + {returns the \ccStyle{x}-coordinate of \ccVar, that is $hx/hw$.} +\ccGlue +\ccMethod{R::FT y() const;} + {returns the \ccStyle{y}-coordinate of \ccVar, that is $hy/hw$.} +\ccGlue +\ccMethod{R::FT z() const;} + {returns the \ccStyle{z} coordinate of \ccVar, that is $hz/hw$.} + +The following operations are for convenience and for making the +class \ccRefName\ compatible with code for higher dimensional vectors. +Again they come in a \ccHtmlNoLinksFrom{Cartesian} and homogeneous flavor. + +\ccMethod{R::RT homogeneous(int i) const;} + {returns the i'th homogeneous coordinate of \ccVar, starting with 0. + \ccPrecond $0\leq i \leq 3$.} + +\ccMethod{R::FT cartesian(int i) const;} + {returns the i'th \ccHtmlNoLinksFrom{Cartesian} coordinate of \ccVar, starting at 0. + \ccPrecond $0\leq i \leq 2$.} + +\ccMethod{R::FT operator[](int i) const;} + {returns \ccStyle{cartesian(i)}. + \ccPrecond $0\leq i \leq 2$.} + +\ccMethod{int dimension() const;} + {returns the dimension (the constant 3).} + +\ccMethod{Vector_3 transform(const Aff_transformation_3 &t) const;} + {returns the vector obtained by applying $t$ on \ccVar.} + +\ccMethod{Direction_3 direction() const;} + {returns the direction of \ccVar.} + +\ccHeading{Operators} + +The following operations can be applied on vectors: + +\ccMethod{Vector_3 operator+(const Vector_3 &w) const;} + {Addition.} + +\ccMethod{Vector_3 operator-(const Vector_3 &w) const;} + {Subtraction.} + +\ccMethod{Vector_3 operator-() const;} + {Negation.} + +\ccMethod{R::FT operator*(const Vector_3 &w) const;} + {returns the scalar product (= inner product) of the two vectors.} + + +\ccMethod{Vector_3 operator*(const R::RT &s) const;} + {Multiplication with a scalar from the right. Although it would + be more natural, \cgal\ does not offer a multiplication with a + scalar from the left. (This is due to problems of some compilers.)} + + +\ccMethod{Vector_3 operator*(const Quotient &s) const;} + {Multiplication with a scalar from the right.} + + +%\ccFunction{Vector_3 operator*(const R::RT &s, +% const Vector_3 &w);} +% {Multiplication with a scalar from the left.} + +\ccMethod{Vector_3 operator/(const R::RT &s) const;} + {Division by a scalar.} + + +\ccSeeAlso + +\ccc{Vector_2}, \ccc{NULL_VECTOR}, \ccc{Point_3}, \ccc{Direction_3}, +\ccc{ORIGIN}, \ccc{operator+}, \ccc{operator-} +\end{ccRefClass} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/are_ordered_along_line.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/are_ordered_along_line.tex new file mode 100644 index 00000000000..f141c28f036 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/are_ordered_along_line.tex @@ -0,0 +1,22 @@ +\begin{ccRefFunction}{are_ordered_along_line} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{bool are_ordered_along_line(const Point_2 &p, + const Point_2 &q, + const Point_2 &r);} + {returns \ccStyle{true}, iff the three points are collinear and + \ccStyle{q} lies between \ccStyle{p} and \ccStyle{r}. + Note that \ccStyle{true} is returned, if \ccStyle{q==p} or + \ccStyle{q==r}.} + +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{bool are_ordered_along_line(const Point_3 &p, + const Point_3 &q, + const Point_3 &r);} + {returns \ccStyle{true}, iff the three points are collinear and + \ccStyle{q} lies between \ccStyle{p} and \ccStyle{r}. + Note that \ccStyle{true} is returned, if \ccStyle{q==p} or + \ccStyle{q==r}.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/are_strictly_ordered_along_line.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/are_strictly_ordered_along_line.tex new file mode 100644 index 00000000000..7289b5b8b57 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/are_strictly_ordered_along_line.tex @@ -0,0 +1,22 @@ +\begin{ccRefFunction}{are_strictly_ordered_along_line} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{bool are_strictly_ordered_along_line(const Point_2 &p, + const Point_2 &q, + const Point_2 &r);} + {returns \ccStyle{true}, iff the three points are collinear and + \ccStyle{q} lies strictly between \ccStyle{p} and \ccStyle{r}. + Note that \ccStyle{false} is returned, if \ccStyle{q==p} or + \ccStyle{q==r}.} + +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{bool are_strictly_ordered_along_line(const Point_3 &p, + const Point_3 &q, + const Point_3 &r);} + {returns \ccStyle{true}, iff the three points are collinear and + \ccStyle{q} lies strictly between \ccStyle{p} and \ccStyle{r}. + Note that \ccStyle{false} is returned, if \ccStyle{q==p} or + \ccStyle{q==r}.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/assign.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/assign.tex new file mode 100644 index 00000000000..67611f27a5d --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/assign.tex @@ -0,0 +1,11 @@ +\begin{ccRefFunction}{assign} +\ccTexHtml{\ccSetThreeColumns{Orientation}{}{\hspace*{8.5cm}}}{} + +\ccInclude{CGAL/Object.h} + +\ccFunctionTemplate{T}{template bool assign(T& c, const Object& o);} + {assigns \ccStyle{o} to \ccStyle{c} if \ccStyle{o} + was constructed from an object of type \ccStyle{T}. + Returns \ccc{true}, if the assignment was possible.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/cartesian_to_homogeneous.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/cartesian_to_homogeneous.tex new file mode 100644 index 00000000000..f4861082ec6 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/cartesian_to_homogeneous.tex @@ -0,0 +1,20 @@ +\begin{ccRefFunction}{cartesian_to_homogeneous} +\ccTexHtml{\ccSetThreeColumns{Point_2< Homogeneous > }{}{\hspace*{8.5cm}}}{} + +\ccInclude{CGAL/cartesian_homogeneous_conversion.h} + +\ccFunction{Point_2< Homogeneous > +cartesian_to_homogeneous(const Point_2< Cartesian >& cp);} + {converts 2d point \ccStyle{cp} with Cartesian representation + into a 2d point with homogeneous representation with the same + number type.} + +\ccFunction{Point_3< Homogeneous > +cartesian_to_homogeneous(const Point_3< Cartesian >& cp);} + {converts 3d point \ccStyle{cp} with Cartesian representation + into a 3d point with homogeneous representation with the same + number type.} + +\ccTexHtml{\KernelRefLayout}{} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/circumcenter.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/circumcenter.tex new file mode 100644 index 00000000000..fd2ed521f5a --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/circumcenter.tex @@ -0,0 +1,28 @@ +\begin{ccRefFunction}{circumcenter} +\ccInclude{CGAL/basic_constructions_2.h} + +\ccFunction{Point_2 +circumcenter( const Point_2& p, + const Point_2& q, + const Point_2& r);} + {compute the center of the circle passing through the points $p$, $q$, and $r$. + \ccPrecond $p$, $q$, and $r$ are not collinear.} + +\ccInclude{CGAL/basic_constructions_3.h} + +\ccFunction{Point_3 +circumcenter( const Point_3& p, + const Point_3& q, + const Point_3& r);} + {compute the center of the circle passing through the points $p$, $q$, and $r$. + \ccPrecond $p$, $q$, and $r$ are not collinear.} + +\ccFunction{Point_3 +circumcenter( const Point_3& p, + const Point_3& q, + const Point_3& r, + const Point_3& s);} + {compute the center of the sphere passing through the points $p$, $q$, $r$, and $s$. + \ccPrecond $p$, $q$, $r$, and $s$ are not coplanar.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/cmp_dist_to_point.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/cmp_dist_to_point.tex new file mode 100644 index 00000000000..05851e41075 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/cmp_dist_to_point.tex @@ -0,0 +1,28 @@ +\begin{ccRefFunction}{cmp_dist_to_point} +\ccInclude{CGAL/distance_predicates_2.h} + +\ccFunction{Comparison_result +cmp_dist_to_point(const Point_2& p, + const Point_2& q, + const Point_2& r);} + {compares the distances of points \ccStyle{q} and + \ccStyle{r} to point \ccStyle{p}. + returns \ccStyle{SMALLER}, iff \ccStyle{q} is closer + to \ccStyle{p} than \ccStyle{r}, \ccStyle{LARGER}, iff + \ccStyle{r} is closer to \ccStyle{p} than \ccStyle{q}, and + \ccStyle{EQUAL} otherwise.} + +\ccInclude{CGAL/distance_predicates_3.h} + +\ccFunction{Comparison_result +cmp_dist_to_point(const Point_3& p, + const Point_3& q, + const Point_3& r);} + {compares the distances of points \ccStyle{q} and + \ccStyle{r} to point \ccStyle{p}. + returns \ccStyle{SMALLER}, iff \ccStyle{q} is closer + to \ccStyle{p} than \ccStyle{r}, \ccStyle{LARGER}, iff + \ccStyle{r} is closer to \ccStyle{p} than \ccStyle{q}, and + \ccStyle{EQUAL} otherwise.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/cmp_signed_dist_to_line.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/cmp_signed_dist_to_line.tex new file mode 100644 index 00000000000..692cb9e92bb --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/cmp_signed_dist_to_line.tex @@ -0,0 +1,26 @@ +\begin{ccRefFunction}{cmp_signed_dist_to_line} +\ccInclude{CGAL/distance_predicates_2.h} + +\ccFunction{Comparison_result +cmp_signed_dist_to_line(const Line_2& l, + const Point_2& p, + const Point_2& q);} + {returns \ccStyle{LARGER} + iff the signed distance of \ccStyle{p} and + \ccStyle{l} is larger than the signed distance of \ccStyle{q} + and \ccStyle{l}, \ccStyle{SMALLER}, iff it is smaller, + and \ccStyle{EQUAL} iff both are equal.} + +\ccFunction{Comparison_result +cmp_signed_dist_to_line(const Point_2& p, + const Point_2& q, + const Point_2& r, + const Point_2& s);} + {returns \ccStyle{LARGER} + iff the signed distance of \ccStyle{r} and + \ccStyle{l} is larger than the signed distance of \ccStyle{s} + and \ccStyle{l}, \ccStyle{SMALLER}, iff it is smaller, + and \ccStyle{EQUAL} iff both are equal, where + \ccc{l} is the directed line through \ccc{p} and \ccc{q}.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/cmp_signed_dist_to_plane.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/cmp_signed_dist_to_plane.tex new file mode 100644 index 00000000000..47150adef75 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/cmp_signed_dist_to_plane.tex @@ -0,0 +1,29 @@ +\begin{ccRefFunction}{cmp_signed_dist_to_plane} +\ccInclude{CGAL/distance_predicates_3.h} + +\ccFunction{Comparison_result +cmp_signed_dist_to_plane(const Plane_3& h, + const Point_3& p, + const Point_3& q);} + {returns \ccStyle{LARGER} + iff the signed distance of \ccStyle{p} and + \ccStyle{h} is larger than the signed distance of \ccStyle{q} + and \ccStyle{h}, \ccStyle{SMALLER}, iff it is smaller, + and \ccStyle{EQUAL} iff both are equal.} + +\ccFunction{Comparison_result +cmp_signed_dist_to_plane(const Point_3& p, + const Point_3& q, + const Point_3& r, + const Point_3& s, + const Point_3& t);} + {returns \ccStyle{LARGER} + iff the signed distance of \ccStyle{s} and + \ccStyle{h} is larger than the signed distance of \ccStyle{t} + and \ccStyle{h}, \ccStyle{SMALLER}, iff it is smaller, + and \ccStyle{EQUAL} iff both are equal, where + \ccc{h} is the oriented plane through \ccc{p}, \ccc{q} and + \ccc{r}.} + {} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/collinear.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/collinear.tex new file mode 100644 index 00000000000..925d8eec9e4 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/collinear.tex @@ -0,0 +1,16 @@ +\begin{ccRefFunction}{collinear} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{bool collinear(const Point_2 &p, + const Point_2 &q, + const Point_2 &r);} +{returns \ccStyle{true}, iff $p$, $q$, and $r$ are collinear.} + +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{bool collinear(const Point_3 &p, + const Point_3&q, + const Point_3&r);} +{returns \ccStyle{true}, iff $p$, $q$, and $r$ are collinear.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/collinear_are_ordered_along_line.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/collinear_are_ordered_along_line.tex new file mode 100644 index 00000000000..e20dade39c5 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/collinear_are_ordered_along_line.tex @@ -0,0 +1,20 @@ +\begin{ccRefFunction}{collinear_are_ordered_along_line} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{bool collinear_are_ordered_along_line(const Point_2 &p, + const Point_2 &q, + const Point_2 &r);} + {returns \ccStyle{true}, iff \ccStyle{q} lies between \ccStyle{p} + and \ccStyle{r}. \ccPrecond \ccStyle{p, q} and \ccStyle{r} are + collinear.} + +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{bool collinear_are_ordered_along_line(const Point_3 &p, + const Point_3 &q, + const Point_3 &r);} + {returns \ccStyle{true}, iff \ccStyle{q} lies between \ccStyle{p} + and \ccStyle{r}. \ccPrecond \ccStyle{p, q} and \ccStyle{r} are + collinear.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/collinear_are_strictly_ordered_along_line.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/collinear_are_strictly_ordered_along_line.tex new file mode 100644 index 00000000000..cd59fa3a203 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/collinear_are_strictly_ordered_along_line.tex @@ -0,0 +1,21 @@ +\begin{ccRefFunction}{collinear_are_strictly_ordered_along_line} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{bool collinear_are_strictly_ordered_along_line(const Point_2 &p, + const Point_2 &q, + const Point_2 &r);} + {returns \ccStyle{true}, iff \ccStyle{q} lies strictly between + \ccStyle{p} and \ccStyle{r}. \ccPrecond \ccStyle{p, q} and \ccStyle{r} are + collinear.} + +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{bool collinear_are_strictly_ordered_along_line( + const Point_3 &p, + const Point_3 &q, + const Point_3 &r);} + {returns \ccStyle{true}, iff \ccStyle{q} lies strictly between \ccStyle{p} + and \ccStyle{r}. \ccPrecond \ccStyle{p, q} and \ccStyle{r} are + collinear.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/compare_lexicographically_xy.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/compare_lexicographically_xy.tex new file mode 100644 index 00000000000..d3074b09a90 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/compare_lexicographically_xy.tex @@ -0,0 +1,12 @@ +\begin{ccRefFunction}{compare_lexicographically_xy} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{Comparison_result +compare_lexicographically_xy(const Point_2& p, + const Point_2& q);} + {Compares the Cartesian coordinates of points \ccStyle{p} and + \ccStyle{q} lexicographically in $xy$ order: first + $x$-coordinates are compared, if they are equal, $y$-coordinates + are compared.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/compare_lexicographically_xyz.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/compare_lexicographically_xyz.tex new file mode 100644 index 00000000000..7e676d57a62 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/compare_lexicographically_xyz.tex @@ -0,0 +1,13 @@ +\begin{ccRefFunction}{compare_lexicographically_xyz} +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{Comparison_result +compare_lexicographically_xyz(const Point_3& p, + const Point_3& q);} + {Compares the Cartesian coordinates of points \ccStyle{p} and + \ccStyle{q} lexicographically in $xyz$ order: first + $x$-coordinates are compared, if they are equal, $y$-coordinates + are compared, and if both $x$- and $y$- coordinate are equal, + $z$-coordinates are compared.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/compare_x.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/compare_x.tex new file mode 100644 index 00000000000..b0d5b6a998d --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/compare_x.tex @@ -0,0 +1,57 @@ +\begin{ccRefFunction}{compare_x} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{Comparison_result compare_x(const Point_2 &p, + const Point_2 &q);} + {compares the $x$-coordinates of $p$ and $q$.} + +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{Comparison_result compare_x(const Point_3 &p, + const Point_3 &q);} + {compares the $x$-coordinates of $p$ and $q$.} + +\begin{ccTexOnly} +\begin{figure}[hb] +\centerline{\Ipe{compare1.ipe}} +\caption{Comparison of the $x$ or $y$-coordinates of the (implicitly +given) points in the boxes.\label{fig-compare}} +\end{figure} +\end{ccTexOnly} + +\ccInclude{CGAL/predicates_on_lines_2.h} + +\ccFunction{Comparison_result compare_x(const Point_2 &p, + const Line_2 &l1, + const Line_2 &l2);} + {compares the $x$-coordinates of $p$ and the \ccHtmlNoLinksFrom{intersection} + of lines $l1$ and $l2$% + \ccTexHtml{ (Figure~\ref{fig-compare} (a))}{, see (a) in the figure + below}.} + + +\ccFunction{Comparison_result compare_x(const Line_2 &l, + const Line_2 &h1, + const Line_2 &h2);} + {compares the $x$-coordinates of the \ccHtmlNoLinksFrom{intersection} of line $l$ + with line $h1$ and with line $h2$% + \ccTexHtml{ (Figure~\ref{fig-compare} (b))}{, see (b) in the figure + below}.} + + +\ccFunction{Comparison_result compare_x(const Line_2 &l1, + const Line_2 &l2, + const Line_2 &h1, + const Line_2 &h2);} + {compares the $x$-coordinates of the \ccHtmlNoLinksFrom{intersection} of lines $l1$ + and $l2$ and the \ccHtmlNoLinksFrom{intersection} of lines $h1$ and $h2$% + \ccTexHtml{ (Figure~\ref{fig-compare} (c))}{, see (c) in the figure + below}.} + +\begin{ccHtmlOnly} +Comparison of the x 
+or y coordinates of the (implicitly given) points in the boxes +\end{ccHtmlOnly} + +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/compare_y.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/compare_y.tex new file mode 100644 index 00000000000..39e567fc4cf --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/compare_y.tex @@ -0,0 +1,57 @@ +\begin{ccRefFunction}{compare_y} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{Comparison_result compare_y(const Point_2 &p, + const Point_2 &q);} + {compares Cartesian $y$-coordinates of $p$ and $q$.} + +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{Comparison_result compare_y(const Point_3 &p, + const Point_3 &q);} + {compares Cartesian $y$-coordinates of $p$ and $q$.} + +\ccInclude{CGAL/predicates_on_lines_2.h} + +\begin{ccHtmlOnly} +Comparison of the x 
+or y coordinates of the (implicitly given) points in the boxes +\end{ccHtmlOnly} + +\begin{ccTexOnly} +\begin{figure}[hb] +\centerline{\Ipe{compare1.ipe}} +\caption{Comparison of the $x$ or $y$-coordinates of the (implicitly +given) points in the boxes.\label{fig-compare13}} +\end{figure} +\end{ccTexOnly} + +\ccFunction{Comparison_result compare_y(const Point_2 &p, + const Line_2 &l1, + const Line_2 &l2);} + {compares the $y$-coordinates of $p$ and the \ccHtmlNoLinksFrom{intersection} of lines + $l1$ and $l2$% + \ccTexHtml{ (Figure~\ref{fig-compare13} (a))}{, see (a) in the figure + above}.} + + +\ccFunction{Comparison_result compare_y(const Line_2 &l, + const Line_2 &h1, + const Line_2 &h2);} + {compares the $y$-coordinates of the \ccHtmlNoLinksFrom{intersection} of line $l$ + with line $h1$ and with line $h2$% + \ccTexHtml{ (Figure~\ref{fig-compare13} (b))}{, see (b) in the figure + above}.} + + +\ccFunction{Comparison_result compare_y(const Line_2 &l1, + const Line_2 &l2, + const Line_2 &h1, + const Line_2 &h2);} + {compares the $y$-coordinates of the \ccHtmlNoLinksFrom{intersection} of lines $l1$ + and $l2$ and the \ccHtmlNoLinksFrom{intersection} of lines $h1$ and $h2$ + \ccTexHtml{ (Figure~\ref{fig-compare13} (c))}{, see (c) in the figure + above}.} + +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/compare_y_at_x.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/compare_y_at_x.tex new file mode 100644 index 00000000000..10d57c65105 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/compare_y_at_x.tex @@ -0,0 +1,53 @@ +\begin{ccRefFunction}{compare_y_at_x} + +\ccInclude{CGAL/predicates_on_lines_2.h} + +\ccFunction{Comparison_result compare_y_at_x(const Point_2 &p, + const Line_2 &h);} + {compares the $y$-coordinates of $p$ and the vertical projection + of \ccStyle{p} on \ccStyle{h}% + \ccTexHtml{ (Figure~\ref{fig-compare2} (d))}{, see (d) in the figure + below}.} + + \begin{ccTexOnly} +\begin{figure}[h] +\centerline{\Ipe{compare2.ipe}} +\caption{Comparison of the $y$-coordinates of the (implicitly given) + points in the boxes, at an $x$-coordinate. The $x$-coordinate + is either given explicitly (disc) or implicitly (circle). + \label{fig-compare2}} +\end{figure} +\end{ccTexOnly} + +\ccFunction{Comparison_result compare_y_at_x(const Point_2 &p, + const Line_2 &h1, + const Line_2 &h2);} +{This function compares the $y$-coordinates of the vertical projection + of \ccStyle{p} on \ccStyle{h1} and on \ccStyle{h2}% + \ccTexHtml{ (Figure~\ref{fig-compare2} (e))}{, see (e) in the figure + below}.} +\ccFunction{Comparison_result compare_y_at_x(const Line_2 &l1, + const Line_2 &l2, + const Line_2 &h);} + {Let $p$ be the \ccHtmlNoLinksFrom{intersection} of lines $l1$ and $l2$. + This function compares the $y$-coordinates of $p$ and + the vertical projection of \ccStyle{p} on \ccStyle{h}% + \ccTexHtml{ (Figure~\ref{fig-compare2} (f))}{, see (f) in the figure + below}.} + + +\ccFunction{Comparison_result compare_y_at_x(const Line_2 &l1, + const Line_2 &l2, + const Line_2 &h1, + const Line_2 &h2);} +{Let $p$ be the \ccHtmlNoLinksFrom{intersection} of lines $l1$ and $l2$. This function + compares the $y$-coordinates of the vertical projection of \ccStyle{p} on + \ccStyle{h1} and on \ccStyle{h2}% + \ccTexHtml{ (Figure~\ref{fig-compare2} (g))}{, see (g) in the figure + below}.} + +\begin{ccHtmlOnly} +Comparison of y at x +\end{ccHtmlOnly} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/compare_z.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/compare_z.tex new file mode 100644 index 00000000000..5ea5b3c0a57 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/compare_z.tex @@ -0,0 +1,9 @@ +\begin{ccRefFunction}{compare_z} +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{Comparison_result compare_z(const Point_3 &p, + const Point_3 &q);} + {compares the $z$-coordinates of $p$ and $q$.} + +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/coplanar.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/coplanar.tex new file mode 100644 index 00000000000..b73be2e02bd --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/coplanar.tex @@ -0,0 +1,10 @@ +\begin{ccRefFunction}{coplanar} +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{bool coplanar(const Point_3 &p, + const Point_3&q, + const Point_3&r, + const Point_3&s);} +{returns \ccStyle{true}, if $p$, $q$, $r$, and $s$ are coplanar.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/coplanar_orientation.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/coplanar_orientation.tex new file mode 100644 index 00000000000..868b44d8709 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/coplanar_orientation.tex @@ -0,0 +1,18 @@ +\begin{ccRefFunction}{coplanar_orientation} +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{Orientation coplanar_orientation(const Point_3& p, + const Point_3& q, + const Point_3& r, + const Point_3& s);} + {Let $P$ be the plane defined by the points \ccc{p}, \ccc{q}, + and \ccc{r}. Note that the order defines the orientation of + $P$. The function computes the orientation of points \ccc{p}, + \ccc{q}, and \ccc{s} in $P$: Iff \ccc{p}, \ccc{q}, \ccc{s} are + collinear, \ccc{COLLINEAR} is returned. Iff $P$ and the plane + defined by \ccc{p}, \ccc{q}, and \ccc{s} have the same orientation, + \ccc{POSITIVE} is returned; otherwise \ccc{NEGATIVE} is returned. + \ccPrecond \ccc{p}, \ccc{q}, \ccc{r}, and \ccc{s} are coplanar and + \ccc{p}, \ccc{q}, and \ccc{r} are not collinear.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/cross_product.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/cross_product.tex new file mode 100644 index 00000000000..edde0b4dd58 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/cross_product.tex @@ -0,0 +1,8 @@ +\begin{ccRefFunction}{cross_product} +\ccInclude{CGAL/Vector_3.h} + +\ccFunction{Vector_3 cross_product( const Vector_3& u, + const Vector_3& v);} + {returns the cross product of $u$ and $v$.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/do_intersect.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/do_intersect.tex new file mode 100644 index 00000000000..0b34d3f04a8 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/do_intersect.tex @@ -0,0 +1,49 @@ +\begin{ccRefFunction}{do_intersect} +\ccInclude{CGAL/intersections.h}\footnote{% +The drawback of \ccc{} is that a lot is included, +which results in long compilation times. +It is also possible to include only the intersections that are of interest. +The naming scheme of the header files is as follows. +Intersections of types \ccStyle{Type1} and \ccStyle{Type2} +are declared in header file \ccc{CGAL/Type1_Type2_intersection.h}. +So, \ccHtmlNoLinksFrom{intersection} routines of segments and lines in 2D are declared in +\ccc{}. The order of the type names does not +matter. It is also possible to include \ccc{}. +For intersections of two objects of the same type, the type name should be +mentioned twice: \ccc{} +} + +\ccUnchecked{ +\ccFunction{bool do_intersect(Type1 obj1, Type2 obj2);} +{checks whether \ccc{obj1} and \ccc{obj2} intersect. +Two objects \ccStyle{obj1} and \ccStyle{obj2} intersect if there is a point +\ccStyle{p} that is part of both \ccStyle{obj1} and \ccStyle{obj2}. +The \ccHtmlNoLinksFrom{intersection} region of those two objects is defined as the set of all +points \ccStyle{p} that are part of both \ccStyle{obj1} and \ccStyle{obj2}. +Note that for objects like triangles and polygons that enclose a +bounded region, this region is part of the object. +}} + +The types \ccStyle{Type1} and \ccStyle{Type2} can be any of the following: +\begin{itemize}\ccTexHtml{\itemsep0pt\topsep0pt\partopsep0pt\parskip0pt\parsep0pt}{} +\item \ccStyle{Point_2} +\item \ccStyle{Line_2} +\item \ccStyle{Ray_2} +\item \ccStyle{Segment_2} +\item \ccStyle{Triangle_2} +\item \ccStyle{Iso_rectangle_2} +\end{itemize} + +Also, in three-dimensional space \ccc{Type1} can be \ccc{Plane_3} and +\ccc{Type2} any of +\begin{itemize}\ccTexHtml{\itemsep0pt\topsep0pt\partopsep0pt\parskip0pt\parsep0pt}{} +\item \ccStyle{Plane_3} +\item \ccStyle{Line_3} +\item \ccStyle{Ray_3} +\item \ccStyle{Segment_3} +\end{itemize} + +\ccSeeAlso +\ccc{intersection} + +\end{ccRefFunction} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/do_overlap.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/do_overlap.tex new file mode 100644 index 00000000000..42b272e42d6 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/do_overlap.tex @@ -0,0 +1,14 @@ +\begin{ccRefFunction}{do_overlap} +\ccInclude{CGAL/Bbox_2.h} + +\ccFunction{bool do_overlap(const Bbox_2 &bb1, const Bbox_2 &bb2);} + {returns \ccc{true} iff \ccc{bb1} and \ccc{bb2} overlap, i.e., + iff their \ccHtmlNoLinksFrom{intersection} is non-empty.} + +\ccInclude{CGAL/Bbox_3.h} + +\ccFunction{bool do_overlap(const Bbox_3 &bb1, const Bbox_3 &bb2);} + {returns \ccc{true} iff \ccc{bb1} and \ccc{bb2} overlap, i.e., + iff their \ccHtmlNoLinksFrom{intersection} is non-empty.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/has_larger_dist_to_point.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/has_larger_dist_to_point.tex new file mode 100644 index 00000000000..844c2e29242 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/has_larger_dist_to_point.tex @@ -0,0 +1,22 @@ +\begin{ccRefFunction}{has_larger_dist_to_point} +\ccInclude{CGAL/distance_predicates_2.h} + +\ccFunction{bool +has_larger_dist_to_point(const Point_2& p, + const Point_2& q, + const Point_2& r);} + {returns \ccStyle{true} iff the distance between \ccStyle{q} + and \ccStyle{p} is larger than the distance between \ccStyle{r} + and \ccStyle{p}.} + +\ccInclude{CGAL/distance_predicates_3.h} + +\ccFunction{bool +has_larger_dist_to_point(const Point_3& p, + const Point_3& q, + const Point_3& r);} + {returns \ccStyle{true} iff the distance between \ccStyle{q} + and \ccStyle{p} is larger than the distance between \ccStyle{r} + and \ccStyle{p}.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/has_larger_signed_dist_to_line.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/has_larger_signed_dist_to_line.tex new file mode 100644 index 00000000000..0319c5e7a83 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/has_larger_signed_dist_to_line.tex @@ -0,0 +1,24 @@ +\begin{ccRefFunction}{has_larger_signed_dist_to_line} +\ccInclude{CGAL/distance_predicates_2.h} + +\ccFunction{bool +has_larger_signed_dist_to_line(const Line_2& l, + const Point_2& p, + const Point_2& q);} + {returns \ccStyle{true} iff the signed distance of \ccStyle{p} + and \ccStyle{l} is larger than the signed distance of + \ccStyle{q} and \ccStyle{l}.} + +\ccFunction{bool +has_larger_signed_dist_to_line(const Point_2& p, + const Point_2& q, + const Point_2& r, + const Point_2& s);} + {returns \ccStyle{true} iff the signed distance of \ccStyle{r} + and \ccStyle{l} is larger than the signed distance of + \ccStyle{s} and \ccStyle{l}, where \ccc{l} is the directed line + through points \ccc{p} and \ccc{q}.} + + +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/has_larger_signed_dist_to_plane.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/has_larger_signed_dist_to_plane.tex new file mode 100644 index 00000000000..75c170f58cd --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/has_larger_signed_dist_to_plane.tex @@ -0,0 +1,23 @@ +\begin{ccRefFunction}{has_larger_signed_dist_to_plane} +\ccInclude{CGAL/distance_predicates_3.h} + +\ccFunction{bool +has_larger_signed_dist_to_plane(const Plane_3& h, + const Point_3& p, + const Point_3& q);} + {returns \ccStyle{true} iff the signed distance of \ccStyle{p} + and \ccStyle{h} is larger than the signed distance of + \ccStyle{q} and \ccStyle{h}.} + +\ccFunction{bool +has_larger_signed_dist_to_plane(const Point_3& p, + const Point_3& q, + const Point_3& r, + const Point_3& s, + const Point_3& t);} + {returns \ccStyle{true} iff the signed distance of \ccStyle{s} + and \ccStyle{h} is larger than the signed distance of + \ccStyle{t} and \ccStyle{h}, where \ccc{h} is the oriented + plane through \ccc{p}, \ccc{q} and \ccc{r}.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/has_smaller_dist_to_point.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/has_smaller_dist_to_point.tex new file mode 100644 index 00000000000..eef9c744ef3 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/has_smaller_dist_to_point.tex @@ -0,0 +1,22 @@ +\begin{ccRefFunction}{has_smaller_dist_to_point} +\ccInclude{CGAL/distance_predicates_2.h} + +\ccFunction{bool +has_smaller_dist_to_point(const Point_2& p, + const Point_2& q, + const Point_2& r);} + {returns \ccStyle{true} iff the distance between \ccStyle{q} + and \ccStyle{p} is smaller than the distance between \ccStyle{r} + and \ccStyle{p}.} + +\ccInclude{CGAL/distance_predicates_3.h} + +\ccFunction{bool +has_smaller_dist_to_point(const Point_3& p, + const Point_3& q, + const Point_3& r);} + {returns \ccStyle{true} iff the distance between \ccStyle{q} + and \ccStyle{p} is smaller than the distance between \ccStyle{r} + and \ccStyle{p}.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/has_smaller_signed_dist_to_line.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/has_smaller_signed_dist_to_line.tex new file mode 100644 index 00000000000..1f11bee3c38 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/has_smaller_signed_dist_to_line.tex @@ -0,0 +1,22 @@ +\begin{ccRefFunction}{has_smaller_signed_dist_to_line} +\ccInclude{CGAL/distance_predicates_2.h} + +\ccFunction{bool +has_smaller_signed_dist_to_line(const Line_2& l, + const Point_2& p, + const Point_2& q);} + {returns \ccStyle{true} iff the signed distance of \ccStyle{p} + and \ccStyle{l} is smaller than the signed distance of + \ccStyle{q} and \ccStyle{l}.} + +\ccFunction{bool +has_smaller_signed_dist_to_line(const Point_2& p, + const Point_2& q, + const Point_2& r, + const Point_2& s);} + {returns \ccStyle{true} iff the signed distance of \ccStyle{r} + and \ccStyle{l} is smaller than the signed distance of + \ccStyle{s} and \ccStyle{l}, where \ccc{l} is the + oriented line through \ccc{p} and \ccc{q}.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/has_smaller_signed_dist_to_plane.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/has_smaller_signed_dist_to_plane.tex new file mode 100644 index 00000000000..3fe6aa09fbf --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/has_smaller_signed_dist_to_plane.tex @@ -0,0 +1,23 @@ +\begin{ccRefFunction}{has_smaller_signed_dist_to_plane} +\ccInclude{CGAL/distance_predicates_3.h} + +\ccFunction{bool +has_smaller_signed_dist_to_plane(const Plane_3& h, + const Point_3& p, + const Point_3& q);} + {returns \ccStyle{true} iff the signed distance of \ccStyle{p} + and \ccStyle{h} is smaller than the signed distance of + \ccStyle{q} and \ccStyle{h}.} + +\ccFunction{bool +has_smaller_signed_dist_to_plane(const Point_3& p, + const Point_3& q, + const Point_3& r, + const Point_3& s, + const Point_3& t);} + {returns \ccStyle{true} iff the signed distance of \ccStyle{p} + and \ccStyle{h} is smaller than the signed distance of + \ccStyle{q} and \ccStyle{h}, where \ccc{h} is the oriented + plane through \ccc{p}, \ccc{q} and \ccc{r}.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/homogeneous_to_cartesian.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/homogeneous_to_cartesian.tex new file mode 100644 index 00000000000..c03e8e1d872 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/homogeneous_to_cartesian.tex @@ -0,0 +1,18 @@ +\begin{ccRefFunction}{homogeneous_to_cartesian} +\ccTexHtml{\ccSetThreeColumns{Point_2< Homogeneous > }{}{\hspace*{8.5cm}}}{} + +\ccInclude{CGAL/cartesian_homogeneous_conversion.h} + +\ccFunction{Point_2< Cartesian > +homogeneous_to_cartesian(const Point_2< Homogeneous >& hp);} + {converts 2d point \ccStyle{hp} with homogeneous representation + into a 2d point with Cartesian representation with the same + number type.} + +\ccFunction{Point_3< Cartesian > +homogeneous_to_cartesian(const Point_3< Homogeneous >& hp);} + {converts 3d point \ccStyle{hp} with homogeneous representation + into a 3d point with Cartesian representation with the same + number type.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/homogeneous_to_quotient_cartesian.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/homogeneous_to_quotient_cartesian.tex new file mode 100644 index 00000000000..c495c70e0c8 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/homogeneous_to_quotient_cartesian.tex @@ -0,0 +1,19 @@ +\begin{ccRefFunction}{homogeneous_to_quotient_cartesian} + +\ccInclude{CGAL/cartesian_homogeneous_conversion.h} + +\ccFunction{Point_2< Cartesian > > +homogeneous_to_quotient_cartesian( + const Point_2 >& hp);} + {converts the 2d point \ccStyle{hp} with homogeneous representation + with number type \ccStyle{RT} into a 2d point with Cartesian + representation with number type \ccStyle{Quotient}.} + +\ccFunction{Point_3< Cartesian > > +homogeneous_to_quotient_cartesian( + const Point_3 >& hp);} + {converts the 3d point \ccStyle{hp} with homogeneous representation + with number type \ccStyle{RT} into a 3d point with Cartesian + representation with number type \ccStyle{Quotient}.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/intersection.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/intersection.tex new file mode 100644 index 00000000000..cd957c92d33 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/intersection.tex @@ -0,0 +1,343 @@ +\begin{ccRefFunction}{intersection} +\ccInclude{CGAL/intersections.h}\footnote{% +The drawback of \ccc{} is that a lot is included, +which results in long compilation times. +It is also possible to include only the intersections that are of interest. +The naming scheme of the header files is as follows. +Intersections of types \ccStyle{Type1} and \ccStyle{Type2} +are declared in header file \ccc{CGAL/Type1_Type2_intersection.h}. +So, intersection routines of segments and lines in 2D are declared in +\ccc{}. The order of the type names does not +matter. It is also possible to include \ccc{}. +For intersections of two objects of the same type, the type name should be +mentioned twice: \ccc{} +} + +\ccUnchecked{ +\ccFunction{Object intersection(Type1 obj1, Type2 obj2);} +{Two objects \ccStyle{obj1} and \ccStyle{obj2} intersect if there is a point +\ccStyle{p} that is part of both \ccStyle{obj1} and \ccStyle{obj2}. +The \ccHtmlNoLinksFrom{intersection} region of those two objects is defined as the set of all +points \ccStyle{p} that are part of both \ccStyle{obj1} and \ccStyle{obj2}. +Note that for objects like triangles and polygons that enclose a +bounded region, this region is considered part of the object. +If a segment lies completely inside a triangle, then those two objects +intersect and the \ccHtmlNoLinksFrom{intersection} region is the complete segment. +}} + +The possible value for types \ccStyle{Type1} and \ccStyle{Type2} and the +possible return values wrapped in \ccc{Object} are the +following: + + +\begin{ccTexOnly} +\begin{longtable}[c]{|l|l|l|} +%\caption{All available intersection computations}\\ +\multicolumn{3}{l}{\sl \ \ } +\endfirsthead +\multicolumn{3}{l}{\sl continued} +\endhead +\hline +type A & type B & \parbox{4 cm}{\vspace{1 mm}{return type}} \\ +\hline +\ccStyle{Line_2} & \ccStyle{Line_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Line_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Segment_2} & \ccStyle{Line_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Segment_2} & \ccStyle{Segment_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Ray_2} & \ccStyle{Line_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Ray_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Ray_2} & \ccStyle{Segment_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Ray_2} & \ccStyle{Ray_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \\ \ccStyle{Ray_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Triangle_2} & \ccStyle{Line_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Triangle_2} & \ccStyle{Segment_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Triangle_2} & \ccStyle{Ray_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Triangle_2} & \ccStyle{Triangle_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \\ \ccStyle{Triangle_2} + \\ \ccStyle{std::vector} + \vspace{1 mm}} \\ +\hline +\ccStyle{Iso_rectangle_2} & \ccStyle{Line_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Iso_rectangle_2} & \ccStyle{Segment_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Iso_rectangle_2} & \ccStyle{Ray_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Iso_rectangle_2} & \ccStyle{Iso_rectangle_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Iso_rectangle_2} + \vspace{1 mm}} \\ +\hline +{\ccStyle{Plane_3}} & {\ccStyle{Line_3}} & \parbox{4 cm}{\vspace{1 mm} +\ccStyle{Point_3} \\ + \ccStyle{Line_3} +\vspace{1 mm}} \\ +\hline +{\ccStyle{Plane_3}} & {\ccStyle{Ray_3}} & \parbox{4 cm}{\vspace{1 mm} +\ccStyle{Point_3} \\ + \ccStyle{Ray_3} +\vspace{1 mm}} \\ +\hline +{\ccStyle{Plane_3}} & {\ccStyle{Segment_3}} & \parbox{4 cm}{\vspace{1 mm} +\ccStyle{Point_3} \\ + \ccStyle{Segment_3} +\vspace{1 mm}} \\ +\hline +{\ccStyle{Plane_3}} & {\ccStyle{Plane_3}} & \parbox{4 cm}{\vspace{1 mm} +\ccStyle{Line_3} \\ + \ccStyle{Plane_3} +\vspace{1 mm}} \\ +\hline +\end{longtable} +\end{ccTexOnly} + +\begin{ccHtmlOnly} +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
type A type B return type
Line_2 Line_2 + + +
Point_2
Line_2
Segment_2 Line_2 + + +
Point_2
Segment_2
Segment_2 Segment_2 + + +
Point_2
Segment_2
Ray_2 Line_2 + + +
Point_2
Ray_2
Ray_2 Segment_2 + + +
Point_2
Segment_2
Ray_2 Ray_2 + + + +
Point_2
Segment_2
Ray_2
Triangle_2 Line_2 + + +
Point_2
Segment_2
Triangle_2 Segment_2 + + +
Point_2
Segment_2
Triangle_2 Ray_2 + + +
Point_2
Segment_2
Triangle_2 Triangle_2 + + + + +
Point_2
Segment_2
Triangle_2
std::vector<Point_2>
Iso_rectangle_2 Line_2 + + +
Point_2
Segment_2
Iso_rectangle_2 Segment_2 + + +
Point_2
Segment_2
Iso_rectangle_2 Ray_2 + + +
Point_2
Segment_2
Iso_rectangle_2 Iso_rectangle_2 + +
Iso_rectangle_2
Plane_3 Line_3 + + +
Point_3
Line_3
Plane_3 Ray_3 + + +
Point_3
Ray_3
Plane_3 Segment_3 + + +
Point_3
Segment_3
Plane_3 Plane_3 + + +
Line_3
Plane_3
+
+\end{ccHtmlOnly} + +\ccExample + +The following example demonstrates the most common use of +\ccc{intersection} routines. +\begin{verbatim} +#include +/* or #include */ + +template +void foo(Segment_2 seg, Line_2 line) +{ + Object result; + Point_2 ipoint; + Segment_2 iseg; + + result = intersection(seg, line); + if (assign(ipoint, result)) { +\end{verbatim}% +\ccHtmlLinksOff% +\begin{verbatim} + // handle the point intersection case. +\end{verbatim}% +\ccHtmlLinksOn% +\begin{verbatim} + } else + if (assign(iseg, result)) { +\end{verbatim}% +\ccHtmlLinksOff% +\begin{verbatim} + // handle the segment intersection case. +\end{verbatim}% +\ccHtmlLinksOn% +\begin{verbatim} + } else { +\end{verbatim}% +\ccHtmlLinksOff% +\begin{verbatim} + // handle the no intersection case. + } +} +\end{verbatim}% +\ccHtmlLinksOn% + +\ccSeeAlso +\ccc{do_intersect}, \ccc{Kernel::Intersect_2}, \ccc{Kernel::Intersect_3} +\end{ccRefFunction} + + + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/leftturn.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/leftturn.tex new file mode 100644 index 00000000000..4eb3a5c21cc --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/leftturn.tex @@ -0,0 +1,9 @@ +\begin{ccRefFunction}{leftturn} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{bool leftturn(const Point_2 &p, + const Point_2 &q, + const Point_2 &r);} +{returns \ccc{true} iff \ccc{p}, \ccc{q}, and \ccc{r} form a left turn.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/lexicographically_xy_larger.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/lexicographically_xy_larger.tex new file mode 100644 index 00000000000..d66a805e4e6 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/lexicographically_xy_larger.tex @@ -0,0 +1,10 @@ +\begin{ccRefFunction}{lexicographically_xy_larger} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{bool +lexicographically_xy_larger(const Point_2& p, + const Point_2& q);} +{returns \ccc{true} iff \ccc{p} is lexicographically larger +than \ccc{q} with respect to $xy$ order.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/lexicographically_xy_larger_or_equal.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/lexicographically_xy_larger_or_equal.tex new file mode 100644 index 00000000000..248f971b2ae --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/lexicographically_xy_larger_or_equal.tex @@ -0,0 +1,10 @@ +\begin{ccRefFunction}{lexicographically_xy_larger_or_equal} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{bool +lexicographically_xy_larger_or_equal(const Point_2& p, + const Point_2& q);} +{returns \ccc{true} iff \ccc{p} is lexicographically not smaller +than \ccc{q} with respect to $xy$ order.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/lexicographically_xy_smaller.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/lexicographically_xy_smaller.tex new file mode 100644 index 00000000000..9be08c54c5c --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/lexicographically_xy_smaller.tex @@ -0,0 +1,11 @@ +\begin{ccRefFunction}{lexicographically_xy_smaller} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{bool +lexicographically_xy_smaller(const Point_2& p, + const Point_2& q);} +{returns \ccc{true} iff \ccc{p} is lexicographically smaller +than \ccc{q} with respect to $xy$ order.} + +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/lexicographically_xy_smaller_or_equal.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/lexicographically_xy_smaller_or_equal.tex new file mode 100644 index 00000000000..14af4884cc9 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/lexicographically_xy_smaller_or_equal.tex @@ -0,0 +1,11 @@ +\begin{ccRefFunction}{lexicographically_xy_smaller_or_equal} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{bool +lexicographically_xy_smaller_or_equal(const Point_2& p, + const Point_2& q);} +{returns \ccc{true} iff \ccc{p} is lexicographically not larger +than \ccc{q} with respect to $xy$ order.} + +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/lexicographically_xyz_smaller.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/lexicographically_xyz_smaller.tex new file mode 100644 index 00000000000..3acf901a53d --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/lexicographically_xyz_smaller.tex @@ -0,0 +1,10 @@ +\begin{ccRefFunction}{lexicographically_xyz_smaller} +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{bool +lexicographically_xyz_smaller(const Point_3& p, + const Point_3& q);} +{returns \ccc{true} iff \ccc{p} is lexicographically smaller +than \ccc{q} with respect to $xyz$ order.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/lexicographically_xyz_smaller_or_equal.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/lexicographically_xyz_smaller_or_equal.tex new file mode 100644 index 00000000000..cdae91e9715 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/lexicographically_xyz_smaller_or_equal.tex @@ -0,0 +1,10 @@ +\begin{ccRefFunction}{lexicographically_xyz_smaller_or_equal} +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{bool +lexicographically_xyz_smaller_or_equal(const Point_3& p, + const Point_3& q);} +{returns \ccc{true} iff \ccc{p} is lexicographically not larger +than \ccc{q} with respect to $xyz$ order.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/make_object.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/make_object.tex new file mode 100644 index 00000000000..af18c00a87c --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/make_object.tex @@ -0,0 +1,7 @@ +\begin{ccRefFunction}{make_object} +\ccInclude{CGAL/Object.h} + +\ccFunctionTemplate{T}{template Object make_object(const T &t);} +{Creates an object that contains \ccStyle{t}.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/midpoint.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/midpoint.tex new file mode 100644 index 00000000000..034d10978d0 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/midpoint.tex @@ -0,0 +1,13 @@ +\begin{ccRefFunction}{midpoint} +\ccInclude{CGAL/basic_constructions_2.h} + +\ccFunction{Point_2 midpoint( const Point_2& p, + const Point_2& q );} + {computes the midpoint of the segment $pq$.} + +\ccInclude{CGAL/basic_constructions_3.h} + +\ccFunction{Point_3 midpoint( const Point_3& p, const Point_3& q );} + {computes the midpoint of the segment $pq$.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/operator*.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/operator*.tex new file mode 100644 index 00000000000..e09ca0c29e6 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/operator*.tex @@ -0,0 +1,14 @@ +\begin{ccRefFunction}{operator*} +\ccTexHtml{\ccSetThreeColumns{Vector_2X }{}{\hspace*{8.0cm}}}{} + +\ccInclude{CGAL/Vector_2.h} + +\ccFunction{Vector_2 operator*(const R::RT &s, const Vector_2 &w);} + {Multiplication with a scalar from the left.} + +\ccInclude{CGAL/Vector_3.h} + +\ccFunction{Vector_3 operator*(const R::RT &s, const Vector_3 &w);} + {Multiplication with a scalar from the left.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/operator+.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/operator+.tex new file mode 100644 index 00000000000..651c213b52d --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/operator+.tex @@ -0,0 +1,20 @@ +\ccTexHtml{\ccSetThreeColumns{Vector_2X }{}{\hspace*{8.0cm}}}{} + +\begin{ccRefFunction}{operator+} +\ccInclude{CGAL/Point_2.h} +\ccInclude{CGAL/Vector_2.h} + +\ccFunction{Point_2 operator+(const Point_2 &p, + const Vector_2 &v);} + {returns the point obtained by translating \ccStyle{p} by + vector \ccStyle{v}.} + +\ccInclude{CGAL/Point_3.h} +\ccInclude{CGAL/Vector_3.h} + +\ccFunction{Point_3 operator+(const Point_3 &p, + const Vector_3 &v);} + {returns a point obtained by translating \ccStyle{p} by + vector \ccStyle{v}.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/operator-.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/operator-.tex new file mode 100644 index 00000000000..fefeaca4ca5 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/operator-.tex @@ -0,0 +1,37 @@ +\begin{ccRefFunction}{operator-} +\ccTexHtml{\ccSetThreeColumns{Vector_2X }{}{\hspace*{8.0cm}}}{} + +\ccInclude{CGAL/Point_2.h} +\ccInclude{CGAL/Vector_2.h} + +\ccFunction{Vector_2 operator-(const Point_2 &p, + const Point_2 &q);} + {returns the difference vector between \ccStyle{q} and \ccStyle{p}. + You can substitute \ccc{ORIGIN} for either \ccc{p} or \ccc{q} + ,but not for both.} + +\ccFunction{Point_2 operator-(const Point_2 &p, + const Vector_2 &v);} + {returns the point obtained by translating \ccStyle{p} by the + vector -\ccStyle{v}.} + +\ccInclude{CGAL/Point_3.h} +\ccInclude{CGAL/Vector_3.h} + +\ccFunction{Vector_3 operator-(const Point_3 &p, + const Point_3 &q);} + {returns the difference vector between \ccStyle{q} and \ccStyle{p}. + You can substitute \ccc{ORIGIN} for either $p$ + or $q$, but not both.} + +\ccFunction{Point_3 operator-(const Point_3 &p, + const Vector_3 &v);} + {returns a point obtained by translating \ccStyle{p} by the + vector $-$\ccStyle{v}.} + +\ccSeeAlso + +\ccc{Point_2}, \ccc{Point_3}, \ccc{Vector_2}, \ccc{Vector_3} + +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/operatorStar.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/operatorStar.tex new file mode 100644 index 00000000000..e09ca0c29e6 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/operatorStar.tex @@ -0,0 +1,14 @@ +\begin{ccRefFunction}{operator*} +\ccTexHtml{\ccSetThreeColumns{Vector_2X }{}{\hspace*{8.0cm}}}{} + +\ccInclude{CGAL/Vector_2.h} + +\ccFunction{Vector_2 operator*(const R::RT &s, const Vector_2 &w);} + {Multiplication with a scalar from the left.} + +\ccInclude{CGAL/Vector_3.h} + +\ccFunction{Vector_3 operator*(const R::RT &s, const Vector_3 &w);} + {Multiplication with a scalar from the left.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/opposite.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/opposite.tex new file mode 100644 index 00000000000..b8d1e8f261d --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/opposite.tex @@ -0,0 +1,17 @@ +\ccHtmlNoRefLinks +\begin{ccRefFunction}{opposite} +\ccInclude{CGAL/functions_on_enums.h} + +\ccHtmlNoLinks +\ccFunction{Oriented_side opposite(const Oriented_side &o);} +{returns the opposite side (for example \ccc{ON_POSITIVE_SIDE} if + \ccc{o==ON_NEGATIVE_SIDE}), or \ccc{ON_ORIENTED_BOUNDARY} if + \ccc{o==ON_ORIENTED_BOUNDARY}.} + +\ccHtmlNoLinks +\ccFunction{Bounded_side opposite(const Bounded_side &o);} +{returns the opposite side (for example \ccc{BOUNDED_SIDE} if + \ccc{o==UNBOUNDED_SIDE}), or returns \ccc{ON_BOUNDARY} if + \ccc{o==ON_BOUNDARY}.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/orientation.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/orientation.tex new file mode 100644 index 00000000000..0460bca6474 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/orientation.tex @@ -0,0 +1,26 @@ +\ccHtmlNoRefLinks +\begin{ccRefFunction}{orientation} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccHtmlNoLinks +\ccFunction{Orientation orientation(const Point_2& p, + const Point_2& q, + const Point_2& r);} +{returns \ccStyle{LEFTTURN}, if $r$ lies to the left of the oriented +line $l$ defined by $p$ and $q$, returns \ccStyle{RIGHTTURN} if $r$ +lies to the right of $l$, and returns \ccStyle{COLLINEAR} if $r$ lies +on $l$.} + +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccHtmlNoLinks +\ccFunction{Orientation orientation(const Point_3 &p, + const Point_3&q, + const Point_3&r, + const Point_3&s);} +{returns \ccStyle{POSITIVE}, if $s$ lies on the positive side of the oriented +plane $h$ defined by $p$, $q$, and $r$, returns \ccStyle{NEGATIVE} if $s$ +lies on the negative side of $h$, and returns \ccStyle{COPLANAR} if $s$ lies +on $h$.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/quotient_cartesian_to_homogeneous.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/quotient_cartesian_to_homogeneous.tex new file mode 100644 index 00000000000..0869c298ed5 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/quotient_cartesian_to_homogeneous.tex @@ -0,0 +1,18 @@ +\begin{ccRefFunction}{quotient_cartesian_to_homogeneous} +\ccInclude{CGAL/cartesian_to_homogeneous_conversion.h} + +\ccFunction{Point_2< Homogeneous > +quotient_cartesian_to_homogeneous( + const Point_2< Cartesian< Quotient > >& cp);} + {converts 2d point \ccStyle{cp} with Cartesian representation + with number type \ccStyle{Quotient} into a 2d point + with homogeneous representation with number type \ccStyle{RT}.} + +\ccFunction{Point_3< Homogeneous > +quotient_cartesian_to_homogeneous( + const Point_3< Cartesian< Quotient > >& cp);} + {converts 3d point \ccStyle{cp} with Cartesian representation + with number type \ccStyle{Quotient} into a 3d point + with homogeneous representation with number type \ccStyle{RT}.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/rational_rotation_approximation.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/rational_rotation_approximation.tex new file mode 100644 index 00000000000..d8e9a2fecd5 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/rational_rotation_approximation.tex @@ -0,0 +1,30 @@ +\begin{ccRefFunction}{rational_rotation_approximation} +\ccInclude{CGAL/rational_rotation.h} + +\ccFunction{ +template +void +rational_rotation_approximation( const RingNumberType & dirx, + const RingNumberType & diry, + RingNumberType & sin_num, + RingNumberType & cos_num, + RingNumberType & denom, + const RingNumberType & eps_num, + const RingNumberType & eps_den );} +{computes integers \ccc{sin_num}, \ccc{cos_num} and \ccc{denom}, such +that \ccc{sin_num}/\ccc{denom} approximates the sine of direction +$($\ccc{dirx},\ccc{diry}$)$. The difference between the sine and +the approximating rational is bounded by \ccc{eps_num}/\ccc{eps_den}. +\ccPrecond \ccc{eps_num} $\neq 0$.} + +\ccImplementation +The approximation is based on Farey sequences as described in +the rational rotation method presented by Canny and Ressler at the +8th SoCG 1992. We use a slower version which needs no division operation +in the approximation. + +\ccSeeAlso +\ccc{Aff_transformation_2} + +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/rightturn.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/rightturn.tex new file mode 100644 index 00000000000..a679e6e4bd4 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/rightturn.tex @@ -0,0 +1,13 @@ +\begin{ccRefFunction}{rightturn} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{bool rightturn(const Point_2 &p, + const Point_2 &q, + const Point_2 &r);} +{returns \ccc{true} iff \ccc{p}, \ccc{q}, and \ccc{r} form a right turn.} + +\ccSeeAlso +\ccc{orientation}, \ccc{leftturn} + +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/side_of_bounded_circle.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/side_of_bounded_circle.tex new file mode 100644 index 00000000000..9ec22d3f1e1 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/side_of_bounded_circle.tex @@ -0,0 +1,14 @@ +\begin{ccRefFunction}{side_of_bounded_circle} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{Bounded_side side_of_bounded_circle( + const Point_2 &p, + const Point_2 &q, + const Point_2 &r, + const Point_2 &test);} + {returns the relative position of point \ccStyle{test} + to the circle defined by $p$, $q$ and $r$. The order + of the points $p$, $q$ and $r$ does not matter. + \ccPrecond \ccStyle{p, q} and \ccStyle{r} are not collinear.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/side_of_bounded_sphere.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/side_of_bounded_sphere.tex new file mode 100644 index 00000000000..4d8f2533479 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/side_of_bounded_sphere.tex @@ -0,0 +1,15 @@ +\begin{ccRefFunction}{side_of_bounded_sphere} +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{Bounded_side side_of_bounded_sphere( + const Point_3 &p, + const Point_3 &q, + const Point_3 &r, + const Point_3 &s, + const Point_3 &test);} + {returns the relative position of point \ccStyle{test} + to the sphere defined by $p$, $q$, $r$, and $s$. The order + of the points $p$, $q$, $r$, and $s$ does not matter. + \ccPrecond \ccStyle{p, q, r} and \ccStyle{s} are not coplanar.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/side_of_oriented_circle.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/side_of_oriented_circle.tex new file mode 100644 index 00000000000..4a55abe5fca --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/side_of_oriented_circle.tex @@ -0,0 +1,16 @@ +\begin{ccRefFunction}{side_of_oriented_circle} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{Oriented_side side_of_oriented_circle( + const Point_2 &p, + const Point_2 &q, + const Point_2 &r, + const Point_2 &test);} + {returns the relative position of point \ccStyle{test} + to the oriented circle defined by $p$, $q$ and $r$. + The order of the points $p$, $q$ and $r$ is important, + since it determines the orientation of the implicitly + constructed circle. + \ccPrecond \ccStyle{p, q} and \ccStyle{r} are not collinear.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/side_of_oriented_sphere.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/side_of_oriented_sphere.tex new file mode 100644 index 00000000000..4784304be07 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/side_of_oriented_sphere.tex @@ -0,0 +1,19 @@ +\begin{ccRefFunction}{side_of_oriented_sphere} +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{Oriented_side side_of_oriented_sphere( + const Point_3 &p, + const Point_3 &q, + const Point_3 &r, + const Point_3 &s, + const Point_3 &test);} + {returns the relative position of point \ccStyle{test} + to the oriented sphere defined by $p$, $q$, $r$ and $s$. + The order of the points $p$, $q$, $r$, and $s$ is important, + since it determines the orientation of the implicitly + constructed sphere. If the points $p$, $q$, $r$ and $s$ + are positive oriented, positive side is the bounded interior + of the sphere. + \ccPrecond \ccStyle{p, q, r} and \ccStyle{s} are not coplanar.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/squared_distance.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/squared_distance.tex new file mode 100644 index 00000000000..bdfb35371e1 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/squared_distance.tex @@ -0,0 +1,40 @@ +\begin{ccRefFunction}{squared_distance} +\ccInclude{CGAL/squared_distance_2.h}\\ +\ccInclude{CGAL/squared_distance_3.h} + +\ccFunctionTemplate{R} +{R::FT squared_distance(Type1 obj1, Type2 obj2);} +{computes the square of the Euclidean distance between two geometric objects. +For arbitrary geometric objects \ccStyle{obj1} and +\ccStyle{obj2} the squared distance is defined as the minimal +\ccStyle{squared_distance(p1, p2)}, where \ccStyle{p1} is a point of +\ccStyle{obj1} and \ccStyle{p2} is a point of \ccStyle{obj2}. +Note that for objects that have an inside (a bounded region), this inside +is part of the object. So, the squared distance from a point inside is +zero, not the squared distance to the closest point on the boundary.} + +In 2D, the types \ccStyle{Type1} and \ccStyle{Type2} can be any of the +following: +\begin{itemize}\ccTexHtml{\itemsep0pt\topsep0pt\partopsep0pt\parskip0pt\parsep0pt}{} +\item \ccStyle{Point_2} +\item \ccStyle{Line_2} +\item \ccStyle{Ray_2} +\item \ccStyle{Segment_2} +\item \ccStyle{Triangle_2} +\end{itemize} + +In 3D, the types \ccStyle{Type1} and \ccStyle{Type2} can be any of the +following: +\begin{itemize}\ccTexHtml{\itemsep0pt\topsep0pt\partopsep0pt\parskip0pt\parsep0pt}{} +\item \ccStyle{Point_3} +\item \ccStyle{Line_3} +\item \ccStyle{Ray_3} +\item \ccStyle{Segment_3} +\item \ccStyle{Plane_3} +\end{itemize} + +\ccSeeAlso +\ccc{has_smaller_dist_to_point}, \ccc{has_smaller_signed_dist_to_line}\\ +%\ccc{Kernel::Compute_squared_distance_2}, \ccc{Kernel::Compute_squared_distance_3} + +\end{ccRefFunction} diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/wrapper.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/wrapper.tex new file mode 100644 index 00000000000..646f579a8ce --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/wrapper.tex @@ -0,0 +1,55 @@ +\documentclass{book} + +\usepackage{cprog} +\usepackage{cc_manual} +\usepackage{cc_manual_index} +\usepackage{latex_converter} +\usepackage{makeidx} +\usepackage{amssymb} +\usepackage{graphicx} +\usepackage{path} +\usepackage{ipe} +\usepackage{longtable} + +% page dimensions +% --------------- +\textwidth 15.6cm +\textheight 23 cm +\topmargin -14mm +\evensidemargin 3mm +\oddsidemargin 3mm + +% default column layout +% --------------------- +% This is the recommended layout. It may be changed inside main.tex. + +\newcommand{\cgalColumnLayout}{\ccTexHtml{% + \ccSetThreeColumns{Oriented_side}{}{\hspace*{10cm}} + \ccPropagateThreeToTwoColumns}{}} + +\marginparsep12mm +\marginparwidth13mm +\newcommand{\cgalrelease}{2.2} +\gdef\ccNewRefManualStyle{\ccTrue} +\gdef\ccTagOperatorLayout{\ccFalse} + + +\makeindex + +\sloppy + +\begin{document} + +\include{title} +\pagestyle{plain} + +\cgalColumnLayout + +\include{Traits} + +\bibliographystyle{alpha} +\bibliography{../cgal-manual,geom} + +\lcTex{\printindex} +\end{document} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/x_equal.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/x_equal.tex new file mode 100644 index 00000000000..529c9962902 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/x_equal.tex @@ -0,0 +1,16 @@ +\begin{ccRefFunction}{x_equal} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{bool x_equal(const Point_2 &p, + const Point_2 &q);} + {returns \ccStyle{true}, iff \ccStyle{p} and \ccStyle{q} + have the same \ccStyle{x}-coordinate.} + +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{bool x_equal(const Point_3 &p, + const Point_3 &q);} + {returns \ccStyle{true}, iff \ccStyle{p} and \ccStyle{q} + have the same \ccStyle{x}-coordinate.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/y_equal.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/y_equal.tex new file mode 100644 index 00000000000..1f66aae9aba --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/y_equal.tex @@ -0,0 +1,16 @@ +\begin{ccRefFunction}{y_equal} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{bool y_equal(const Point_2 &p, + const Point_2 &q);} + {returns \ccStyle{true}, iff \ccStyle{p} and \ccStyle{q} + have the same \ccStyle{y}-coordinate.} + +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{bool y_equal(const Point_3 &p, + const Point_3 &q);} + {returns \ccStyle{true}, iff \ccStyle{p} and \ccStyle{q} + have the same \ccStyle{y}-coordinate.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/Ref/z_equal.tex b/Old_Packages/Doc23/doc_tex/kernel/Ref/z_equal.tex new file mode 100644 index 00000000000..db0baefdf5f --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/Ref/z_equal.tex @@ -0,0 +1,9 @@ +\begin{ccRefFunction}{z_equal} +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{bool z_equal(const Point_3 &p, + const Point_3 &q);} + {returns \ccStyle{true}, iff \ccStyle{p} and \ccStyle{q} + have the same \ccStyle{z}-coordinate.} +\end{ccRefFunction} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/arrlinthree.gif b/Old_Packages/Doc23/doc_tex/kernel/arrlinthree.gif new file mode 100644 index 00000000000..2de6958638c Binary files /dev/null and b/Old_Packages/Doc23/doc_tex/kernel/arrlinthree.gif differ diff --git a/Old_Packages/Doc23/doc_tex/kernel/arrlintwo.gif b/Old_Packages/Doc23/doc_tex/kernel/arrlintwo.gif new file mode 100644 index 00000000000..a3a3c62d5bb Binary files /dev/null and b/Old_Packages/Doc23/doc_tex/kernel/arrlintwo.gif differ diff --git a/Old_Packages/Doc23/doc_tex/kernel/arrthree.gif b/Old_Packages/Doc23/doc_tex/kernel/arrthree.gif new file mode 100644 index 00000000000..cd9cde54e23 Binary files /dev/null and b/Old_Packages/Doc23/doc_tex/kernel/arrthree.gif differ diff --git a/Old_Packages/Doc23/doc_tex/kernel/arrthree2.gif b/Old_Packages/Doc23/doc_tex/kernel/arrthree2.gif new file mode 100644 index 00000000000..bfc4499d182 Binary files /dev/null and b/Old_Packages/Doc23/doc_tex/kernel/arrthree2.gif differ diff --git a/Old_Packages/Doc23/doc_tex/kernel/arrtwo.gif b/Old_Packages/Doc23/doc_tex/kernel/arrtwo.gif new file mode 100644 index 00000000000..3e4e26dd5eb Binary files /dev/null and b/Old_Packages/Doc23/doc_tex/kernel/arrtwo.gif differ diff --git a/Old_Packages/Doc23/doc_tex/kernel/arrtwo2.gif b/Old_Packages/Doc23/doc_tex/kernel/arrtwo2.gif new file mode 100644 index 00000000000..df1219a3629 Binary files /dev/null and b/Old_Packages/Doc23/doc_tex/kernel/arrtwo2.gif differ diff --git a/Old_Packages/Doc23/doc_tex/kernel/common_intro.tex b/Old_Packages/Doc23/doc_tex/kernel/common_intro.tex new file mode 100644 index 00000000000..901fbdd6d51 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/common_intro.tex @@ -0,0 +1,12 @@ +\cgal, the {\em Computational Geometry Algorithms Library}, is written in +\CC\ and consists of three major parts. +The first part is the kernel, which consists of constant-size non-modifiable +geometric primitive objects and operations on these objects. +The objects are parameterized by a representation class, which specifies +the underlying number types used for calculations. +The second part is a collection of basic geometric data structures and +algorithms, which are parameterized by traits classes that define the +interface between the data structure or algorithm and the primitives they use. +The third part consists of non-geometric support facilities, such as +`circulators', random sources, I/O support for debugging and for interfacing +\cgal\ to various visualization tools. diff --git a/Old_Packages/Doc23/doc_tex/kernel/compare1.gif b/Old_Packages/Doc23/doc_tex/kernel/compare1.gif new file mode 100644 index 00000000000..d32ecc63fc3 Binary files /dev/null and b/Old_Packages/Doc23/doc_tex/kernel/compare1.gif differ diff --git a/Old_Packages/Doc23/doc_tex/kernel/compare1.ipe b/Old_Packages/Doc23/doc_tex/kernel/compare1.ipe new file mode 100644 index 00000000000..46c8281f23b --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/compare1.ipe @@ -0,0 +1,405 @@ +%!PS-Adobe-2.0 EPSF-1.2 +%%Creator: Ipe 5.0 +%%BoundingBox: 124 352 475 447 +%%EndComments +{\catcode37=9\def\IPEdummy{({{)}} pop +%%}\makeatletter\let\@notdefinable\relax +%%\def\IPEc#1[#2]#3{\newcommand{#1}[#2]{#3}\ignorespaces}\@ifundefined +%%{selectfont}{\let\selectfont\relax\def\fontsize#1#2{}}{}\makeatother +%%\IPEc\IPEput[4]{\put(0,0){\special{psfile=\IPEfile}}} +%%\IPEc\IPEmp[2]{\minipage[t]{#1bp}#2\special{color pop}\endminipage} +%%\IPEc\IPEtext[1]{\makebox(0,0)[lb]{#1\special{color pop}}} +%%\IPEc\IPEfs[1]{\IPEcolfs{0 0 0}{#1}} +%%\IPEc\IPEcolfs[2]{\dimen0=#2pt\fontsize{#2}{1.2\dimen0}\selectfont +%%\special{color push rgb #1}} +%%\IPEc\IPEsize[2]{\unitlength1bp\ignorespaces} +%%\IPEsize{349.032}{92.6338} +%%\begin{picture}(349.032,92.6338)(125.484,353.683) +%%\IPEput{124}{352}{475}{447} +%%\put(127.922,419.494){\IPEtext{\IPEfs{10}\rm $l_1$}} +%%\put(125.484,401.613){\IPEtext{\IPEfs{10}\rm $l_2$}} +%%\put(143.359,379.667){\IPEtext{\IPEfs{10}\rm $p$}} +%%\put(265.234,435.75){\IPEtext{\IPEfs{10}\rm $l$}} +%%\put(321.296,402.426){\IPEtext{\IPEfs{10}\rm $h_1$}} +%%\put(262.111,403.924){\IPEtext{\IPEfs{10}\rm $h_2$}} +%%\put(374.109,404.051){\IPEtext{\IPEfs{10}\rm $l_1$}} +%%\put(378.171,385.357){\IPEtext{\IPEfs{10}\rm $l_2$}} +%%\put(393.609,435.75){\IPEtext{\IPEfs{10}\rm $h_1$}} +%%\put(464.296,424.371){\IPEtext{\IPEfs{10}\rm $h_2$}} +%%\put(161.621,355.588){\IPEtext{\IPEfs{12}\rm (a)}} +%%\put(275.879,353.683){\IPEtext{\IPEfs{12}\rm (b)}} +%%\put(423.779,353.683){\IPEtext{\IPEfs{12}\rm (c)}} +%%\end{picture}\endinput} +%% Ipe postscript prologue + +/IpeDict 60 dict def +IpeDict begin +/origmatrix matrix currentmatrix def + +/sg {setgray} bind def +/sc {setrgbcolor} bind def +/ss {0 setdash setlinewidth} bind def +/sk {stroke} bind def +/fi {fill} bind def +/sfi {gsave fill grestore} bind def +/mt {moveto} bind def +/lt {lineto} bind def +/np {newpath} bind def +/cl {closepath} bind def +/N {moveto} bind def +/L {lineto} bind def +/E {lineto} bind def +/C {lineto closepath} bind def +%%%% +%% x y size dx dy -> ar -> x y [ draws arrowhead, computes new vertex ] +/smallarrow {gsave exch atan 4 2 roll translate rotate dup scale +newpath 0 0 moveto -1 0.3 lineto -1 -0.3 lineto closepath fill +-1 0 moveto currentpoint transform grestore itransform} bind def +/ar {gsave exch atan 4 2 roll translate rotate dup scale +newpath 0 0 moveto -1 0.3 lineto -1 -0.3 lineto closepath +gsave origmatrix setmatrix [] 0 setdash stroke grestore fill +0 0 moveto currentpoint transform grestore itransform} bind def +%%%% +/af {ar moveto} bind def +/at {ar lineto} bind def +%% x y size dx dy -> arw -> [ draws arrowhead ] +/arw {ar pop pop} bind def +%%%% +/ci {0 360 arc} bind def +/el {gsave concat 0 exch 0 exch 0 360 newpath arc origmatrix +setmatrix} bind def +/gs {gsave} bind def +/gr {grestore} bind def +/gsts {gsave translate scale } bind def +%% +/marker {gsave translate 0 setlinewidth [] 0 setdash newpath} bind def +/m1 {marker 0 exch 0 exch 0 360 arc stroke grestore} bind def +/m2 {marker 0 exch 0 exch 0 360 arc fill grestore} bind def +/m3 {marker dup dup moveto dup dup neg lineto dup neg dup lineto dup +neg exch lineto closepath stroke grestore} bind def +/m4 {marker dup dup moveto dup dup neg lineto dup neg dup lineto dup +neg exch lineto closepath fill grestore} bind def +/m5 {marker dup dup moveto dup neg dup lineto dup dup neg moveto dup +neg exch lineto closepath stroke grestore} bind def + +%% splines +systemdict /setpacking known {/savepacking currentpacking def false + setpacking} if +/q0 {0 0} def +/q1 {0 0} def +/q2 {0 0} def +/q3 {0 0} def +/p0 {0 0} def +/p1 {0 0} def +/p2 {0 0} def +/p3 {0 0} def +systemdict /setpacking known {savepacking setpacking} if + +%% x y /qi -> defp -> [/qi [x y] def] +/defp {dup 4 1 roll load astore def} bind def + +/midpoint { exch 4 3 roll add 2 div 3 1 roll add 2 div } bind def +/thirdpoint { exch 4 3 roll 2 mul add 3 div 3 1 roll exch 2 mul add 3 +div } bind def + +/prespl {/p3 defp /p2 defp /p1 defp /p0 defp +p1 p2 thirdpoint /q1 defp +p2 p1 thirdpoint /q2 defp +p1 p0 thirdpoint q1 midpoint /q0 defp +p2 p3 thirdpoint q2 midpoint /q3 defp } bind def +/postspl { q1 q2 q3 curveto p1 p2 p3 } bind def +/fspl { prespl q0 moveto postspl } bind def +/spl { prespl postspl } bind def +/xspl { pop pop pop pop pop pop } bind def + +/qspl { /p2 defp /p1 defp /p0 defp +p1 p0 midpoint /q0 defp +p1 p2 midpoint /q3 defp +p1 q0 thirdpoint /q1 defp +p1 q3 thirdpoint /q2 defp q0 moveto q1 q2 q3 curveto } bind def + +/cqspl { /p2 defp /p1 defp /p0 defp +p1 p0 midpoint /q0 defp +p1 p2 midpoint /q3 defp +p1 q0 thirdpoint /q1 defp +p1 q3 thirdpoint /q2 defp q0 moveto q1 q2 q3 curveto +p2 p1 midpoint /q0 defp +p2 p0 midpoint /q3 defp +p2 q0 thirdpoint /q1 defp +p2 q3 thirdpoint /q2 defp q1 q2 q3 curveto +p0 p2 midpoint /q0 defp +p0 p1 midpoint /q3 defp +p0 q0 thirdpoint /q1 defp +p0 q3 thirdpoint /q2 defp q1 q2 q3 curveto } bind def + +%% bitmaps +/pix { /picstr exch string def } def +%% wd ht -> preimg -> ..stuff for image.. +/preimg { 8 [ 3 index 0 0 5 index neg 0 7 index ] + {currentfile picstr readhexstring pop} } def +/img { preimg image } bind def +/kimg { preimg false 3 colorimage } bind def +%% +end +%% Ipe prologue end + +IpeDict begin 300.984 363.411 translate + +% Preamble 1 +%%\documentclass[a4paper]{article} +% Group + +% Line +% ss 0 +0.4 [] ss +np % # 2 +-161.214 58.2883 mt +-91.3385 46.0963 lt +% sk +0 sg sk +% End + +% Line +% ss 0 +0.4 [] ss +np % # 2 +-165.276 41.2195 mt +-97.026 63.1651 lt +% sk +0 sg sk +% End + +% Mark +% sk +0 sg +% ty 3 +% sz +2.8 +% xy +-129.436 52.7437 m3 +% End + +% Mark +% sk +0 sg +% ty 2 +% sz +2.8 +% xy +-145.438 18.6944 m2 +% End + +% Text +% xy -173.062 56.0832 +% sk 0 +% f 0 10 +% s $l_1$ +% End + +% Text +% xy -175.5 38.2016 +% sk 0 +% f 0 10 +% s $l_2$ +% End + +% Text +% xy -157.625 16.256 +% sk 0 +% f 0 10 +% s $p$ +% End + +% Line +% ss 0 +0.4 [] ss +np % # 2 +-24.375 70.7136 mt +17.0625 24.384 lt +% sk +0 sg sk +% End + +% Line +% ss 0 +0.4 [] ss +np % # 2 +-41.4375 17.8816 mt +-11.375 69.088 lt +% sk +0 sg sk +% End + +% Line +% ss 0 +0.4 [] ss +np % # 2 +-45.5 27.6352 mt +22.75 37.3888 lt +% sk +0 sg sk +% End + +% Text +% xy -35.75 72.3392 +% sk 0 +% f 0 10 +% s $l$ +% End + +% Text +% xy 20.3125 39.0144 +% sk 0 +% f 0 10 +% s $h_1$ +% End + +% Text +% xy -38.873 40.513 +% sk 0 +% f 0 10 +% s $h_2$ +% End + +% Mark +% sk +0 sg +% ty 3 +% sz +2.8 +% xy +-15.9505 61.2945 m3 +% End + +% Mark +% sk +0 sg +% ty 3 +% sz +2.8 +% xy +7.39375 35.1942 m3 +% End + +% Line +% ss 0 +0.4 [] ss +np % # 2 +82.875 43.8912 mt +154.375 24.384 lt +% sk +0 sg sk +% End + +% Line +% ss 0 +0.4 [] ss +np % # 2 +99.125 49.5808 mt +87.75 23.5712 lt +% sk +0 sg sk +% End + +% Line +% ss 0 +0.4 [] ss +np % # 2 +105.625 75.5904 mt +169 75.5904 lt +% sk +0 sg sk +% End + +% Line +% ss 0 +0.4 [] ss +np % # 2 +134.875 82.9056 mt +165.75 56.0832 lt +% sk +0 sg sk +% End + +% Mark +% sk +0 sg +% ty 3 +% sz +2.8 +% xy +95.1697 40.5369 m3 +% End + +% Mark +% sk +0 sg +% ty 3 +% sz +2.8 +% xy +143.295 75.5904 m3 +% End + +% Text +% xy 73.125 40.64 +% sk 0 +% f 0 10 +% s $l_1$ +% End + +% Text +% xy 77.1875 21.9456 +% sk 0 +% f 0 10 +% s $l_2$ +% End + +% Text +% xy 92.625 72.3392 +% sk 0 +% f 0 10 +% s $h_1$ +% End + +% Text +% xy 163.312 60.96 +% sk 0 +% f 0 10 +% s $h_2$ +% End + +% Text +% xy -139.363 -7.8232 +% sk 0 +% f 0 12 +% s (a) +% End + +% Text +% xy -25.1051 -9.7282 +% sk 0 +% f 0 12 +% s (b) +% End + +% Text +% xy 122.795 -9.7282 +% sk 0 +% f 0 12 +% s (c) +% End + +% Mark +% sk +0 sg +% ty 3 +% sz +2.8 +% xy +-145.438 18.6944 m3 +% End + +% End + +end %% of Ipe figure diff --git a/Old_Packages/Doc23/doc_tex/kernel/compare2.gif b/Old_Packages/Doc23/doc_tex/kernel/compare2.gif new file mode 100644 index 00000000000..e2d0e751fd9 Binary files /dev/null and b/Old_Packages/Doc23/doc_tex/kernel/compare2.gif differ diff --git a/Old_Packages/Doc23/doc_tex/kernel/compare2.ipe b/Old_Packages/Doc23/doc_tex/kernel/compare2.ipe new file mode 100644 index 00000000000..6e7bb6dfe2d --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/compare2.ipe @@ -0,0 +1,557 @@ +%!PS-Adobe-2.0 EPSF-1.2 +%%Creator: Ipe 5.0 +%%BoundingBox: 106 335 493 464 +%%EndComments +{\catcode37=9\def\IPEdummy{({{)}} pop +%%}\makeatletter\let\@notdefinable\relax +%%\def\IPEc#1[#2]#3{\newcommand{#1}[#2]{#3}\ignorespaces}\@ifundefined +%%{selectfont}{\let\selectfont\relax\def\fontsize#1#2{}}{}\makeatother +%%\IPEc\IPEput[4]{\put(0,0){\special{psfile=\IPEfile}}} +%%\IPEc\IPEmp[2]{\minipage[t]{#1bp}#2\special{color pop}\endminipage} +%%\IPEc\IPEtext[1]{\makebox(0,0)[lb]{#1\special{color pop}}} +%%\IPEc\IPEfs[1]{\IPEcolfs{0 0 0}{#1}} +%%\IPEc\IPEcolfs[2]{\dimen0=#2pt\fontsize{#2}{1.2\dimen0}\selectfont +%%\special{color push rgb #1}} +%%\IPEc\IPEsize[2]{\unitlength1bp\ignorespaces} +%%\IPEsize{385.853}{127.414} +%%\begin{picture}(385.853,127.414)(107.074,336.293) +%%\IPEput{106}{335}{493}{464} +%%\put(388.107,386.588){\IPEtext{\IPEfs{10}\rm $l_1$}} +%%\put(389.142,355.539){\IPEtext{\IPEfs{10}\rm $l_2$}} +%%\put(477.534,455.297){\IPEtext{\IPEfs{10}\rm $h_1$}} +%%\put(482.707,406.653){\IPEtext{\IPEfs{10}\rm $h_2$}} +%%\put(112.996,428.207){\IPEtext{\IPEfs{10}\rm $h$}} +%%\put(108.646,382.961){\IPEtext{\IPEfs{10}\rm $p$}} +%%\put(217.642,370.256){\IPEtext{\IPEfs{10}\rm $p$}} +%%\put(233.877,443.668){\IPEtext{\IPEfs{10}\rm $h_1$}} +%%\put(243.925,399.088){\IPEtext{\IPEfs{10}\rm $h_2$}} +%%\put(299.797,405.067){\IPEtext{\IPEfs{10}\rm $l_1$}} +%%\put(302.206,380.141){\IPEtext{\IPEfs{10}\rm $l_2$}} +%%\put(343.77,428.817){\IPEtext{\IPEfs{10}\rm $h$}} +%%\put(115.24,336.293){\IPEtext{\IPEfs{12}\rm (d)}} +%%\put(221.677,336.293){\IPEtext{\IPEfs{12}\rm (e)}} +%%\put(313.49,336.293){\IPEtext{\IPEfs{12}\rm (f)}} +%%\put(434.552,336.293){\IPEtext{\IPEfs{12}\rm (g)}} +%%\end{picture}\endinput} +%% Ipe postscript prologue + +/IpeDict 60 dict def +IpeDict begin +/origmatrix matrix currentmatrix def + +/sg {setgray} bind def +/sc {setrgbcolor} bind def +/ss {0 setdash setlinewidth} bind def +/sk {stroke} bind def +/fi {fill} bind def +/sfi {gsave fill grestore} bind def +/mt {moveto} bind def +/lt {lineto} bind def +/np {newpath} bind def +/cl {closepath} bind def +/N {moveto} bind def +/L {lineto} bind def +/E {lineto} bind def +/C {lineto closepath} bind def +%%%% +%% x y size dx dy -> ar -> x y [ draws arrowhead, computes new vertex ] +/smallarrow {gsave exch atan 4 2 roll translate rotate dup scale +newpath 0 0 moveto -1 0.3 lineto -1 -0.3 lineto closepath fill +-1 0 moveto currentpoint transform grestore itransform} bind def +/ar {gsave exch atan 4 2 roll translate rotate dup scale +newpath 0 0 moveto -1 0.3 lineto -1 -0.3 lineto closepath +gsave origmatrix setmatrix [] 0 setdash stroke grestore fill +0 0 moveto currentpoint transform grestore itransform} bind def +%%%% +/af {ar moveto} bind def +/at {ar lineto} bind def +%% x y size dx dy -> arw -> [ draws arrowhead ] +/arw {ar pop pop} bind def +%%%% +/ci {0 360 arc} bind def +/el {gsave concat 0 exch 0 exch 0 360 newpath arc origmatrix +setmatrix} bind def +/gs {gsave} bind def +/gr {grestore} bind def +/gsts {gsave translate scale } bind def +%% +/marker {gsave translate 0 setlinewidth [] 0 setdash newpath} bind def +/m1 {marker 0 exch 0 exch 0 360 arc stroke grestore} bind def +/m2 {marker 0 exch 0 exch 0 360 arc fill grestore} bind def +/m3 {marker dup dup moveto dup dup neg lineto dup neg dup lineto dup +neg exch lineto closepath stroke grestore} bind def +/m4 {marker dup dup moveto dup dup neg lineto dup neg dup lineto dup +neg exch lineto closepath fill grestore} bind def +/m5 {marker dup dup moveto dup neg dup lineto dup dup neg moveto dup +neg exch lineto closepath stroke grestore} bind def + +%% splines +systemdict /setpacking known {/savepacking currentpacking def false + setpacking} if +/q0 {0 0} def +/q1 {0 0} def +/q2 {0 0} def +/q3 {0 0} def +/p0 {0 0} def +/p1 {0 0} def +/p2 {0 0} def +/p3 {0 0} def +systemdict /setpacking known {savepacking setpacking} if + +%% x y /qi -> defp -> [/qi [x y] def] +/defp {dup 4 1 roll load astore def} bind def + +/midpoint { exch 4 3 roll add 2 div 3 1 roll add 2 div } bind def +/thirdpoint { exch 4 3 roll 2 mul add 3 div 3 1 roll exch 2 mul add 3 +div } bind def + +/prespl {/p3 defp /p2 defp /p1 defp /p0 defp +p1 p2 thirdpoint /q1 defp +p2 p1 thirdpoint /q2 defp +p1 p0 thirdpoint q1 midpoint /q0 defp +p2 p3 thirdpoint q2 midpoint /q3 defp } bind def +/postspl { q1 q2 q3 curveto p1 p2 p3 } bind def +/fspl { prespl q0 moveto postspl } bind def +/spl { prespl postspl } bind def +/xspl { pop pop pop pop pop pop } bind def + +/qspl { /p2 defp /p1 defp /p0 defp +p1 p0 midpoint /q0 defp +p1 p2 midpoint /q3 defp +p1 q0 thirdpoint /q1 defp +p1 q3 thirdpoint /q2 defp q0 moveto q1 q2 q3 curveto } bind def + +/cqspl { /p2 defp /p1 defp /p0 defp +p1 p0 midpoint /q0 defp +p1 p2 midpoint /q3 defp +p1 q0 thirdpoint /q1 defp +p1 q3 thirdpoint /q2 defp q0 moveto q1 q2 q3 curveto +p2 p1 midpoint /q0 defp +p2 p0 midpoint /q3 defp +p2 q0 thirdpoint /q1 defp +p2 q3 thirdpoint /q2 defp q1 q2 q3 curveto +p0 p2 midpoint /q0 defp +p0 p1 midpoint /q3 defp +p0 q0 thirdpoint /q1 defp +p0 q3 thirdpoint /q2 defp q1 q2 q3 curveto } bind def + +%% bitmaps +/pix { /picstr exch string def } def +%% wd ht -> preimg -> ..stuff for image.. +/preimg { 8 [ 3 index 0 0 5 index neg 0 7 index ] + {currentfile picstr readhexstring pop} } def +/img { preimg image } bind def +/kimg { preimg false 3 colorimage } bind def +%% +end +%% Ipe prologue end + +IpeDict begin 303.74 368.805 translate + +% Preamble 1 +%%\documentclass[a4paper]{article} +% Group + +% Group + +% Line +% ss 0 +0.4 [] ss +np % # 2 +96.7828 21.923 mt +187.826 -2.91621 lt +% sk +0 sg sk +% End + +% Text +% xy 84.3678 17.7831 +% sk 0 +% f 0 10 +% s $l_1$ +% End + +% Text +% xy 85.4024 -13.2659 +% sk 0 +% f 0 10 +% s $l_2$ +% End + +% Line +% ss 0 +0.4 [] ss +np % # 2 +98.852 -6.02111 mt +187.826 9.50338 lt +% sk +0 sg sk +% End + +% Line +% ss 0 +0.4 [] ss +np % # 2 +86.9339 58.0229 mt +175.908 42.4984 lt +% sk +0 sg sk +% End + +% Line +% ss 0 +0.4 [] ss +np % # 2 +89.4341 44.8654 mt +170.132 94.5438 lt +% sk +0 sg sk +% End + +% Text +% xy 173.794 86.4917 +% sk 0 +% f 0 10 +% s $h_1$ +% End + +% Text +% xy 178.967 37.8483 +% sk 0 +% f 0 10 +% s $h_2$ +% End + +% Line +% ss 4369 +0.4 [ 1 3 ] ss +np % # 2 +160.061 4.65886 mt +160.061 88.3443 lt +% sk +0 sg sk +% End + +% Mark +% sk +0 sg +% ty 3 +% sz +2.8 +% xy +160.061 88.3443 m3 +% End + +% Mark +% sk +0 sg +% ty 3 +% sz +2.8 +% xy +160.061 45.2634 m3 +% End + +% End + +% Group + +% Group + +% Line +% ss 0 +0.4 [] ss +np % # 2 +-196.666 56.6605 mt +-156.654 49.679 lt +% sk +0 sg sk +% End + +% Text +% xy -190.744 59.4022 +% sk 0 +% f 0 10 +% s $h$ +% End + +% Group + +% Mark +% sk +0 sg +% ty 2 +% sz +2.8 +% xy +-179.575 17.2612 m2 +% End + +% Text +% xy -195.094 14.1563 +% sk 0 +% f 0 10 +% s $p$ +% End + +% End + +% Line +% ss 4369 +0.4 [ 1 3 ] ss +np % # 2 +-179.575 17.2612 mt +-179.575 53.6784 lt +% sk +0 sg sk +% End + +% End + +% Mark +% sk +0 sg +% ty 3 +% sz +2.8 +% xy +-179.575 53.6784 m3 +% End + +% End + +% Group + +% Group + +% Mark +% sk +0 sg +% ty 2 +% sz +2.8 +% xy +-70.5784 4.55542 m2 +% End + +% Text +% xy -86.0972 1.45053 +% sk 0 +% f 0 10 +% s $p$ +% End + +% End + +% Line +% ss 4369 +0.4 [ 1 3 ] ss +np % # 2 +-70.5784 4.55542 mt +-70.5784 67.8476 lt +% sk +0 sg sk +% End + +% Line +% ss 0 +0.4 [] ss +np % # 2 +-138.035 41.5171 mt +-49.0611 25.9926 lt +% sk +0 sg sk +% End + +% Line +% ss 0 +0.4 [] ss +np % # 2 +-135.535 28.3596 mt +-54.8375 78.038 lt +% sk +0 sg sk +% End + +% Mark +% sk +0 sg +% ty 3 +% sz +2.8 +% xy +-71.3909 29.8888 m3 +% End + +% Mark +% sk +0 sg +% ty 3 +% sz +2.8 +% xy +-71.3909 67.8476 m3 +% End + +% Text +% xy -69.863 74.8627 +% sk 0 +% f 0 10 +% s $h_1$ +% End + +% Text +% xy -59.815 30.2833 +% sk 0 +% f 0 10 +% s $h_2$ +% End + +% End + +% Group + +% Line +% ss 0 +0.4 [] ss +np % # 2 +-3.593 71.7398 mt +36.9719 64.662 lt +% sk +0 sg sk +% End + +% Line +% ss 0 +0.4 [] ss +np % # 2 +-1.72568 33.0567 mt +48.89 19.2473 lt +% sk +0 sg sk +% End + +% Line +% ss 0 +0.4 [] ss +np % # 2 +-0.789862 22.9986 mt +48.89 31.6669 lt +% sk +0 sg sk +% End + +% Text +% xy -3.94271 36.2618 +% sk 0 +% f 0 10 +% s $l_1$ +% End + +% Text +% xy -1.53382 11.3361 +% sk 0 +% f 0 10 +% s $l_2$ +% End + +% Text +% xy 40.0305 60.0118 +% sk 0 +% f 0 10 +% s $h$ +% End + +% Line +% ss 4369 +0.4 [ 1 3 ] ss +np % # 2 +21.125 26.8224 mt +21.125 67.427 lt +% sk +0 sg sk +% End + +% Mark +% sk +0 sg +% ty 3 +% sz +2.8 +% xy +21.125 67.427 m3 +% End + +% Mark +% sk +0 sg +% ty 3 +% sz +2.8 +% xy +21.125 26.8224 m3 +% End + +% End + +% Text +% xy -188.5 -32.512 +% sk 0 +% f 0 12 +% s (d) +% End + +% Text +% xy -82.0625 -32.512 +% sk 0 +% f 0 12 +% s (e) +% End + +% Text +% xy 9.75 -32.512 +% sk 0 +% f 0 12 +% s (f) +% End + +% Text +% xy 130.812 -32.512 +% sk 0 +% f 0 12 +% s (g) +% End + +% Mark +% sk +0 sg +% ty 3 +% sz +2.8 +% xy +-179.575 17.2612 m3 +% End + +% Mark +% sk +0 sg +% ty 1 +% sz +2.8 +% xy +160.061 4.65886 m1 +% End + +% Mark +% sk +0 sg +% ty 1 +% sz +2.8 +% xy +21.125 26.8224 m1 +% End + +% End + +end %% of Ipe figure diff --git a/Old_Packages/Doc23/doc_tex/kernel/htmlfiles b/Old_Packages/Doc23/doc_tex/kernel/htmlfiles new file mode 100644 index 00000000000..f895a7af86b --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/htmlfiles @@ -0,0 +1,12 @@ +compare1.gif +compare2.gif +IsoCuboid.gif +arrlinthree.gif +arrlintwo.gif +arrthree.gif +arrthree2.gif +arrtwo.gif +arrtwo2.gif +transvecthree.gif +transvectwo.gif + diff --git a/Old_Packages/Doc23/doc_tex/kernel/introduction.tex b/Old_Packages/Doc23/doc_tex/kernel/introduction.tex new file mode 100644 index 00000000000..15341ae3ecf --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/introduction.tex @@ -0,0 +1,62 @@ +\chapter{Introduction} +\input{common_intro.tex} + +{This} part of the reference manual covers the kernel. +The kernel contains objects of constant size, such as point, vector, +direction, line, ray, segment, triangle, iso-oriented rectangle and +tetrahedron. +With each type comes a set of functions which can be applied to an object +of this type. +You will typically find access functions (e.g.\ to the coordinates of a point), +tests of the position of a point relative to the object, a function returning +the bounding box, the length, or the area of an object, and so on. +The \cgal\ kernel further contains basic operations such as affine +transformations, detection and computation of intersections, and distance +computations. + +\section{Robustness} +The correctness proof of nearly all geometric algorithms presented +in theory papers assumes exact computation with real numbers. +This leads to a fundamental problem with the implementation of geometric +algorithms. +Naively, often the exact real arithmetic is replaced by inexact floating-point +arithmetic in the implementation. +This often leads to acceptable results for many input data. +However, even for the implementation of the simplest geometric +algorithms this simplification occasionally does not work. +Rounding errors introduced by an inaccurate arithmetic may lead to +inconsistent decisions, causing unexpected failures for some correct +input data. +There are many approaches to this problem, one of them is to compute +exactly (compute so accurate that all decisions made by the algorithm +are exact) which is possible in many cases but more expensive +than standard floating-point arithmetic. +C.~M.~Hoffmann~\cite{h-gsm-89,h-pargc-89} illustrates some +of the problems arising in the implementation of geometric algorithms +and discusses some approaches to solve them. +A more recent overview is given in \cite{s-rpgc-99}. +The exact computation paradigm is discussed by Yap and Dub\'e +\cite{yd-ecp-95} and Yap \cite{y-tegc-97}. + +In \cgal\ you can choose the underlying number types and arithmetic. +You can use different types of arithmetic simultaneously and the choice can +be easily changed, e.g.\ for testing. +So you can choose between implementations with fast but occasionally inexact +arithmetic and implementations guaranteeing exact computation and exact +results. +Of course you have to pay for the exactness in terms of execution time +and storage space. +See the section on number types in the +\ccAnchor{./support/contents.html}{Support Library} +for more details on number types and their capabilities and performance. + +\section{CGAL and LEDA} + +\ccAnchor{http://www.mpi-sb.mpg.de/LEDA/leda.html}{\leda} +\ccTexHtml{\footnote{\tt http://www.mpi-sb.mpg.de/LEDA/leda.html}}{} +is a {\em Library of Efficient Data types and Algorithms} under development +at the {\em Max-Planck Institut f\"ur Informatik}, Saarbr\"ucken, Germany. +\cgal\ is partially based on \leda. +It makes a strong combination with the combinatorial part of it, +and can be used independently\footnote{There are very few exceptions, +e.g.~3D convex hull} as well. diff --git a/Old_Packages/Doc23/doc_tex/kernel/kernel_geometry.tex b/Old_Packages/Doc23/doc_tex/kernel/kernel_geometry.tex new file mode 100644 index 00000000000..22241fb05f8 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/kernel_geometry.tex @@ -0,0 +1,105 @@ +\chapter{Kernel Geometry} + +\section{Points and Vectors} +In \cgal, we strictly distinguish between points, vectors and directions. +A {\em point} is a point in the Euclidean space +$\E^d$, a {\em vector} is the difference of two points $p_2$, $p_1$ +and denotes the direction and the distance from $p_1$ to $p_2$ in the +vector space $\R^d$, and a {\em direction} is a vector where we forget +about its length. +They are different mathematical concepts. For example, they behave +different under affine transformations and an addition of two +points is meaningless in affine geometry. By putting them in different +classes we not only get cleaner code, but also type checking by the +compiler which avoids ambiguous expressions. Hence, it pays twice to +make this distinction. + +\cgal\ defines a symbolic constant \ccStyle{ORIGIN} of type \ccc{Origin} +which denotes the point at the origin. This constant is used in the conversion +between points and vectors. Subtracting it from a point $p$ results in the +locus vector of $p$. + +\begin{cprog} + Point_2< Cartesian > p(1.0, 1.0), q; + Vector_2< Cartesian > v; + v = p - ORIGIN; + q = ORIGIN + v; + assert( p == q ); +\end{cprog} + +In order to obtain the point corresponding to a vector $v$ you simply +have to add $v$ to \ccStyle{ORIGIN}. If you want to determine +the point $q$ in the middle between two points $p_1$ and $p_2$, you can write% +\footnote{you might call \ccc{midpoint(p_1,p_2)} instead} + +\begin{cprog} + q = p_1 + (p_2 - p_1) / 2.0; +\end{cprog} + +Note that these constructions do not involve any performance overhead for +the conversion with the currently available representation classes. + +\section{Kernel Objects} +Besides points (\ccc{Point_2}, \ccc{Point_3}, \ccc{Point_d}), +vectors (\ccc{Vector_2}, \ccc{Vector_3}), and +directions (\ccc{Direction_2}, \ccc{Direction_3}), +\cgal\ provides lines, rays, segments, planes, +triangles, tetrahedra, iso-rectangles, iso-cuboids, circles and spheres. + +Lines (\ccc{Line_2}, \ccc{Line_3}) in {\cgal} are oriented. In +two-dimensional space, they induce a partition of the plane +into a positive side and a negative side. +Any two points on a line induce an \ccHtmlNoLinksFrom{orientation} +of this line. +A ray (\ccc{Ray_2}, \ccc{Ray_3}) is semi-infinite interval on a line, +and this line is oriented from the finite endpoint of this interval towards +any other point in this interval. A segment (\ccc{Segment_2}, +\ccc{Segment_3}) is a bounded interval on a directed line, +and the endpoints are ordered so that they induce the same direction +as that of the line. + +Planes are affine subspaces of dimension two in $\E^3$, passing through +three points, or a point and a line, ray, or segment. +{\cgal} provides a correspondence between any plane in the ambient +space $\E^3$ and the embedding of $\E^2$ in that space. +Just like lines, planes are oriented and partition space into a positive side +and a negative side. +In \cgal, there are no special classes for halfspaces. Halfspaces in 2D and +3D are supposed to be represented by oriented lines and planes, respectively. + +Concerning polygons and polyhedra, the kernel provides triangles, +iso-oriented rectangles, iso-oriented cuboids and tetrahedra. +More complex polygons\footnote{Any sequence of points can be seen as +a (not necessary simple) polygon or polyline. This view is used +frequently in the basic library as well.} +and polyhedra or polyhedral surfaces can be obtained +from the basic library (\ccc{Polygon_2}, \ccc{Polyhedron_3}), +so they are not part of the kernel. +As with any Jordan curves, triangles, iso-oriented rectangles and circles +separate the plane into two regions, one bounded and one unbounded. + +\section{Orientation and Relative Position} +Geometric objects in \cgal\ have member functions that test the +position of a point relative to the object. Full dimensional objects +and their boundaries are represented by the same type, +e.g.\ halfspaces and hyperplanes are not distinguished, neither are balls and +spheres and discs and circles. Such objects split the ambient space into two +full-dimensional parts, a bounded part and an unbounded part +(e.g.\ circles), or two unbounded parts (e.g.\ hyperplanes). By default these +objects are oriented, i.e., one of the resulting parts is called the +positive side, the other one is called the negative side. Both of +these may be unbounded. + +For these objects there is a function \ccStyle{oriented_side()} that +determines whether a test point is on the positive side, the negative +side, or on the oriented boundary. These function returns a value of type +\ccc{Oriented_side}. + +Those objects that split the space in a bounded and an unbounded part, have +a member function \ccStyle{bounded_side()} with return type +\ccc{Bounded_side}. + +If an object is lower dimensional, e.g.\ a triangle in three-dimensional +space or a segment in two-dimensional space, there is only a test whether a +point belongs to the object or not. This member function, which takes a +point as an argument and returns a boolean value, is called \ccStyle{has_on()} diff --git a/Old_Packages/Doc23/doc_tex/kernel/kernel_representation.tex b/Old_Packages/Doc23/doc_tex/kernel/kernel_representation.tex new file mode 100644 index 00000000000..b089bbfb6a1 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/kernel_representation.tex @@ -0,0 +1,229 @@ +\chapter{Kernel Representations} +Our object of study is the $d$-dimensional affine Euclidean space. +Here we are mainly concerned with cases $d=2$ and $d=3$. +Objects in that space are sets of points. A common way to represent +the points is the use of \ccHtmlNoLinksFrom{Cartesian} coordinates, +which assumes a reference frame (an origin and $d$ orthogonal axes). +In that framework, a point is represented by a $d$-tuple +\ccTexHtml{$(c_0,c_1,\ldots,c_{d-1})$}{(c0,c1,...,cd-1)}, +and so are vectors in the underlying linear space. Each point is +represented uniquely by such \ccHtmlNoLinksFrom{Cartesian} coordinates. +%An object can then be represented by an equation, that is, it is the +%set of +%points whose coordinates satisfy the equation. For example, the +%equation of a +%line is usually given as $ax + by +c = 0$. +%The line can then be represented by three numbers $a$, $b$, $c$. +Another way to represent points is by homogeneous coordinates. In that +framework, a point is represented by a $(d+1)$-tuple +\ccTexHtml{$(h_0,h_1,\ldots,h_d)$}{(h0,h1,...,hd)}. +Via the formulae +\ccTexHtml{$c_i = h_i/h_d$}{ci=hi/hd}, +the corresponding point with \ccHtmlNoLinksFrom{Cartesian} coordinates +\ccTexHtml{$(c_0,c_1,\ldots,c_{d-1})$}{(c0,c1,...,cd-1)} +can be computed. Note that homogeneous coordinates are not unique. +For \ccTexHtml{$\lambda\ne 0$}{lambda != 0}, +the tuples +\ccTexHtml{$(h_0,h_1,\ldots,h_d)$}{(h0,h1 +,...,hd)} + and +\ccTexHtml{$(\lambda\cdot h_0,\lambda\cdot h_1,\ldots,\lambda\cdot +h_d)$}{(lambda h0,lambda h1,...,lambda +hd)} represent the +same point. +For a point with \ccHtmlNoLinksFrom{Cartesian} coordinates \ccTexHtml{$(c_0,c_1,\ldots,c_{ +d-1})$}{(c0,c1,...,cd-1)} a +possible homogeneous representation is +\ccTexHtml{$(c_0,c_1,\ldots,c_{d-1},1)$}{(c0,c1,...,cd-1,1)}. +\ccHtmlNoLinksFrom{Homogeneous} coordinates in fact allow to represent +objects in a more general space, the projective space +\ccTexHtml{$\P_d$}{Pd}. +In \cgal, we do not compute in projective geometry. Rather, we use +homogeneous coordinates to avoid division operations, +since the additional coordinate can serve as a common denominator. + +\section{Genericity through Parameterization} +Almost all the kernel objects (and the corresponding functions) are +templates with a parameter that allows the user to choose the +representation of the kernel objects. A type that is used as an +argument for this parameter must fulfill certain requirements on +syntax and semantics. The list of requirements defines an abstract +kernel concept. In \cgal\ such a kernel concept is often also called +a \emph{representation class} and denoted by \ccc{R}. A representation +class provides the actual implementations of the kernel objects. +For all kernel objects \ccc{Kernel_object}, the types +\ccc{CGAL::Kernel_object} and \ccc{R::Kernel_object} are identical. + +CGAL offers three families of concrete models for the concept +representation class, two based on the \ccHtmlNoLinksFrom{Cartesian} representation of points +and one based on the homogeneous representation of points. +The interface of the kernel objects is designed such that it works well +with both \ccHtmlNoLinksFrom{Cartesian} and homogeneous representation, for example, points +in 2D have a constructor with three arguments as well +(the three homogeneous coordinates of the point). +The common interfaces parameterized with a representation class allow +one to develop code independent of the chosen representation. +We said ``families'' of models, because both families are parameterized too. +A user can choose the number type used to represent the coordinates. + +For reasons that will become evident later, +a representation class provides two typenames for number types, +namely \ccc{R::FT} and \ccc{R::RT}.% +\ccTexHtml{\footnote{The double colon :: is the \CC\ scope operator.}}{} +The type \ccStyle{R::FT} must fulfill the requirements on what is +called a {\em field type} in \cgal. This roughly means that \ccStyle{R::FT} +is a type for which operations $+$, $-$, $*$ and $/$ are defined +with semantics (approximately) corresponding to those of a field in +a mathematical sense. Note that, strictly speaking, the built-in type +\ccc{int} does not fullfil the requirements on a field type, since \ccc{int}s +correspond to elements of a ring rather than a field, especially +operation $/$ is not the inverse of $*$. +The requirements on the type \ccStyle{R::RT} are weaker. +This type must fulfill the requirements on what is called a {\em ring type} +in \cgal. This roughly means that \ccStyle{R::RT} +is a type for which operations $+$, $-$, $*$ are defined with semantics +(approximately) corresponding to those of a ring in a mathematical sense. +A very limited division operation $/$ must be available as well. +It must work for exact (i.e., no remainder) integer divisions only. +Furthermore, both number types should fulfill \cgal's requirements on a +number type. %see +Note that a ring type is always a field type but not the other way +round. + +\section{Cartesian Kernels} +With \ccc{Cartesian} you can choose \ccHtmlNoLinksFrom{Cartesian} representation +of coordinates. When you choose \ccHtmlNoLinksFrom{Cartesian} representation you +have to declare at the same time the type of the coordinates. +A number type used with the \ccc{Cartesian} representation class +should be a {\em field type} as described above. +As mentioned above, the built-in type \ccc{int} is not a field type. +However, for some computations with \ccHtmlNoLinksFrom{Cartesian} representation, no +division operation is needed, i.e., +a {\em ring type} is sufficient in this case. +With \ccc{Cartesian}, both \ccc{Cartesian::FT} +and \ccc{Cartesian::RT} are mapped to number type \ccc{FieldNumberType}. + +\ccc{Cartesian} uses reference counting internally to save copying +costs. CGAL also provides \ccc{Simple_cartesian}, a kernel +that uses \ccHtmlNoLinksFrom{Cartesian} representation but no reference counting. +Debugging is easier with \ccc{Simple_cartesian}, since the coordinates +are stored within the class and hence direct access to the coordinates is +possible. +With \ccc{Simple_cartesian}, both \ccc{Simple_cartesian::FT} +and \ccc{Simple_cartesian::RT} are mapped to number type \ccc{FieldNumberType}, too. + +\section{Homogeneous Kernel} +As we mentioned before, homogeneous coordinates permit to avoid +division operations in numerical computations, since the additional +coordinate can serve as a common denominator. +Avoiding divisions can be useful for exact geometric computation. +With \ccc{Homogeneous} you can choose homogeneous representation +of coordinates with the kernel objects. As for \ccHtmlNoLinksFrom{Cartesian} representation you +have to declare at the same time the type used to store the homogeneous +coordinates. Since the homogeneous representation allows one to avoid the +divisions, the number type associated with a homogeneous representation class +must be a model for the weaker concept ring type only. However, +some operations provided by this kernel involve division operations, for +example computing squared distances or returning a \ccHtmlNoLinksFrom{Cartesian} coordinate. +To keep the requirements on the number type parameter of \ccc{Homogeneous} +low, the number type \ccStyle{Quotient} is used instead. +This number type turns a ring type into a field type. It maintains +numbers as quotients, i.e. a numerator and a denominator. +Thereby, divisions are circumvented. +With \ccc{Homogeneous}, \ccc{Homogeneous::FT} is +equal to \ccStyle{Quotient} while +\ccc{Homogeneous::RT} is equal to \ccc{RingNumberType}. + +\section{Naming conventions} + +The use of representation classes not only avoids problems, it +also makes all \cgal\ classes very uniform. They {\bf always} consist of: +\begin{enumerate} +\begin{ccTexOnly} +\itemsep0pt\topsep0pt\partopsep0pt\parskip0pt\parsep0pt +\end{ccTexOnly} + +%\item The {\em name space prefix} \ccStyle{}. This avoids name +% clashes. It will be dropped as soon as \CC\ compilers support the +% concept of name spaces as a feature of the programming language. + +\item The {\em capitalized base name} of the geometric object, such as + \ccStyle{Point}, \ccStyle{Segment}, \ccStyle{Triangle}. + +\item An {\em underscore} followed by the {\em dimension} of the object, + for example $\_2$, $\_3$ or $\_d$. + +\item A {\em representation class} as parameter, which itself is + parameterized with a number type, such as \ccStyle{Cartesian} + or \ccStyle{Homogeneous}. +\end{enumerate} + +\section{Kernel as a Traits Class} +Algorithms and data structures in the basic library of CGAL are parameterized +by a traits class that subsumes the objects on which the algorithm or data +structure operates as well as the operations to do so. For most of the +algorithms and data structures in the basic library you can use a kernel +as a traits class. For some algorithms you even do not have to specify +the kernel; it is detected automatically using the types of the geometric +objects passed to the algorithm. In some other cases, the algorithms +or data structures needs more than is provided by a kernel. In these +cases, a kernel can not be used as a traits class. + +\section{Choosing a Kernel} +If you start with integral \ccHtmlNoLinksFrom{Cartesian} coordinates, many geometric computations +will involve integral numerical values only. Especially, this is true for +geometric computations that evaluate only predicates, which are tantamount to +determinant computations. Examples are triangulation of point sets and +convex hull computation. +In this case, the \ccHtmlNoLinksFrom{Cartesian} representation is probably the first choice, even +with a ring type. You might use limited precision integer types like +\ccc{int} or \ccc{long}, use \ccc{double} to present your integers (they +have more bits in their mantissa than an \ccc{int} and overflow nicely), or an +arbitrary precision integer type like the wrapper \ccc{Gmpz} for the +GMP integers or \ccc{leda_integer}. Note, that unless you use an +arbitrary precision integer type, incorrect results might arise due to +overflow. + +If new points are to be constructed, for example +the \ccHtmlNoLinksFrom{intersection} point of two lines, computation of +\ccHtmlNoLinksFrom{Cartesian} coordinates usually involves divisions, so +you need to use a field type with \ccHtmlNoLinksFrom{Cartesian} representation +or have to switch to homogeneous representation. +\ccc{double} is a possible, but imprecise field type. +You can also put any ring type into \ccc{Quotient} to get a +field type and put it into \ccc{Cartesian}, but you better put +the ring type into \ccc{Homogeneous}. +\ccc{leda_rational} and \ccc{leda_real} are valid field types, too. + +If it is crucial for you that the computation is reliable, +the right choice are probably number types that guarantee +exact computation. The number type \ccc{leda_real} guarantees +that all decisions and hence all branchings in a computation +are correct. They also allow you to compute approximations to whatever +precision you need. Furthermore computation with +\ccc{leda_real} is faster than computation with arbitrary precision +arithmetic. So if you would like to avoid surprises caused by imprecise +computation, this is a good choice. In fact, it is a good choice with +both representations, since divisions slow down the computation of +the reals and hence it might pay-off to avoid them. + +Still other people will prefer the built-in +type {\tt double}, because they need speed and can live with +approximate results, or even algorithms that, from time to time, +crash or compute incorrect results due to accumulated rounding errors. + +\section{Inclusion Order} +You need to include a representation class first before you include any of +the geometric objects of the kernel that you would like to use with +the representation class, i.e., one or several of +\ccc{CGAL/Cartesian.h}, \ccc{CGAL/Homogeneous.h}, and \ccc{CGAL/Simple_cartesian.h}, +before \ccc{CGAL/..._2.h} and \ccc{CGAL/..._3.h}. + +\ccExample +\begin{cprog} +#include +#include +#include +/* ... */ +\end{cprog} + diff --git a/Old_Packages/Doc23/doc_tex/kernel/longtable.sty b/Old_Packages/Doc23/doc_tex/kernel/longtable.sty new file mode 100644 index 00000000000..5b9f65a1432 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/longtable.sty @@ -0,0 +1,431 @@ +%% +%% This is file `longtable.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% longtable.dtx (with options: `package') +%% +%% IMPORTANT NOTICE: +%% +%% This file is a generated file from the sources of the `tools' bundle +%% in the LaTeX2e distribution. +%% +%% For the copyright notice see the source file(s). +%% +%% You are not allowed to modify this file. +%% +%% You are allowed to distribute this file if and only if +%% it is distributed with the corresponding source files in +%% the `tools' bundle. +%% +%% For the copying and distribution conditions of the source files, +%% see the file readme.txt distributed with the tools bundle. +%% +%% File: longtable.dtx Copyright (C) 1990-1997 David Carlisle +\NeedsTeXFormat{LaTeX2e}[1995/06/01] +\ProvidesPackage{longtable} + [1997/10/16 v4.07 Multi-page Table package (DPC)] +\def\LT@err{\PackageError{longtable}} +\def\LT@warn{\PackageWarning{longtable}} +\def\LT@final@warn{% + \AtEndDocument{% + \LT@warn{Table \@width s have changed. Rerun LaTeX.\@gobbletwo}}% + \global\let\LT@final@warn\relax} +\DeclareOption{errorshow}{% + \def\LT@warn{\PackageInfo{longtable}}} +\DeclareOption{pausing}{% + \def\LT@warn#1{% + \LT@err{#1}{This is not really an error}}} +\DeclareOption{set}{} +\DeclareOption{final}{} +\ProcessOptions +\newskip\LTleft \LTleft=\fill +\newskip\LTright \LTright=\fill +\newskip\LTpre \LTpre=\bigskipamount +\newskip\LTpost \LTpost=\bigskipamount +\newcount\LTchunksize \LTchunksize=20 +\let\c@LTchunksize\LTchunksize +\newdimen\LTcapwidth \LTcapwidth=4in +\newbox\LT@head +\newbox\LT@firsthead +\newbox\LT@foot +\newbox\LT@lastfoot +\newcount\LT@cols +\newcount\LT@rows +\newcounter{LT@tables} +\newcounter{LT@chunks}[LT@tables] +\ifx\c@table\undefined + \newcounter{table} + \def\fnum@table{\tablename~\thetable} +\fi +\ifx\tablename\undefined + \def\tablename{Table} +\fi +\newtoks\LT@p@ftn +\mathchardef\LT@end@pen=30000 +\def\longtable{% + \par + \ifx\multicols\@undefined + \else + \ifnum\col@number>\@ne + \@twocolumntrue + \fi + \fi + \if@twocolumn + \LT@err{longtable not in 1-column mode}\@ehc + \fi + \begingroup + \@ifnextchar[\LT@array{\LT@array[x]}} +\def\LT@array[#1]#2{% + \refstepcounter{table}\stepcounter{LT@tables}% + \if l#1% + \LTleft\z@ \LTright\fill + \else\if r#1% + \LTleft\fill \LTright\z@ + \else\if c#1% + \LTleft\fill \LTright\fill + \fi\fi\fi + \let\LT@mcol\multicolumn + \let\LT@@tabarray\@tabarray + \let\LT@@hl\hline + \def\@tabarray{% + \let\hline\LT@@hl + \LT@@tabarray}% + \let\\\LT@tabularcr\let\tabularnewline\\% + \def\newpage{\noalign{\break}}% + \def\pagebreak{\noalign{\ifnum`}=0\fi\@testopt{\LT@no@pgbk-}4}% + \def\nopagebreak{\noalign{\ifnum`}=0\fi\@testopt\LT@no@pgbk4}% + \let\hline\LT@hline \let\kill\LT@kill\let\caption\LT@caption + \@tempdima\ht\strutbox + \ifx\extrarowheight\@undefined + \let\@acol\@tabacol + \let\@classz\@tabclassz \let\@classiv\@tabclassiv + \def\@startpbox{\vtop\LT@startpbox}\let\LT@LL@FM@cr\@tabularcr + \else + \advance\@tempdima\extrarowheight + \col@sep\tabcolsep + \let\@startpbox\LT@startpbox\let\LT@LL@FM@cr\@arraycr + \fi + \setbox\@arstrutbox\hbox{\vrule + \@height \arraystretch \@tempdima + \@depth \arraystretch \dp \strutbox + \@width \z@}% + \let\@sharp##\let\protect\relax + \begingroup + \@mkpream{#2}% + \xdef\LT@bchunk{% + \global\advance\c@LT@chunks\@ne + \global\LT@rows\z@\setbox\z@\vbox\bgroup + \LT@setprevdepth + \tabskip\LTleft\halign to\hsize\bgroup + \tabskip\z@ \@arstrut \@preamble \tabskip\LTright \cr}% + \endgroup + \expandafter\LT@nofcols\LT@bchunk&\LT@nofcols + \LT@make@row + \let\@endpbox\LT@endpbox + \m@th\let\par\@empty + \everycr{}\lineskip\z@\baselineskip\z@ + \LT@bchunk} +\def\LT@no@pgbk#1[#2]{\penalty #1\@getpen{#2}\ifnum`{=0\fi}} +\def\LT@start{% + \let\LT@start\endgraf + \endgraf\penalty\z@\vskip\LTpre + \dimen@\pagetotal + \advance\dimen@ \ht\ifvoid\LT@firsthead\LT@head\else\LT@firsthead\fi + \advance\dimen@ \dp\ifvoid\LT@firsthead\LT@head\else\LT@firsthead\fi + \advance\dimen@ \ht\LT@foot + \dimen@ii\vfuzz + \vfuzz\maxdimen + \setbox\tw@\copy\z@ + \setbox\tw@\vsplit\tw@ to \ht\@arstrutbox + \setbox\tw@\vbox{\unvbox\tw@}% + \vfuzz\dimen@ii + \advance\dimen@ \ht + \ifdim\ht\@arstrutbox>\ht\tw@\@arstrutbox\else\tw@\fi + \advance\dimen@\dp + \ifdim\dp\@arstrutbox>\dp\tw@\@arstrutbox\else\tw@\fi + \advance\dimen@ -\pagegoal + \ifdim \dimen@>\z@\vfil\break\fi + \global\@colroom\@colht + \ifvoid\LT@foot\else + \advance\vsize-\ht\LT@foot + \global\advance\@colroom-\ht\LT@foot + \dimen@\pagegoal\advance\dimen@-\ht\LT@foot\pagegoal\dimen@ + \maxdepth\z@ + \fi + \ifvoid\LT@firsthead\copy\LT@head\else\box\LT@firsthead\fi + \output{\LT@output}} +\def\endlongtable{% + \crcr + \noalign{% + \let\LT@entry\LT@entry@chop + \xdef\LT@save@row{\LT@save@row}}% + \LT@echunk + \LT@start + \unvbox\z@ + \LT@get@widths + \if@filesw + {\let\LT@entry\LT@entry@write\immediate\write\@auxout{% + \gdef\expandafter\noexpand + \csname LT@\romannumeral\c@LT@tables\endcsname + {\LT@save@row}}}% + \fi + \ifx\LT@save@row\LT@@save@row + \else + \LT@warn{Column \@width s have changed\MessageBreak + in table \thetable}% + \LT@final@warn + \fi + \endgraf\penalty -\LT@end@pen + \endgroup + \global\@mparbottom\z@ + \pagegoal\vsize + \endgraf\penalty\z@\addvspace\LTpost + \ifvoid\footins\else\insert\footins{}\fi} +\def\LT@nofcols#1&{% + \futurelet\@let@token\LT@n@fcols} +\def\LT@n@fcols{% + \advance\LT@cols\@ne + \ifx\@let@token\LT@nofcols + \expandafter\@gobble + \else + \expandafter\LT@nofcols + \fi} +\def\LT@tabularcr{% + \relax\iffalse{\fi\ifnum0=`}\fi + \@ifstar + {\def\crcr{\LT@crcr\noalign{\nobreak}}\let\cr\crcr + \LT@t@bularcr}% + {\LT@t@bularcr}} +\let\LT@crcr\crcr +\let\LT@setprevdepth\relax +\def\LT@t@bularcr{% + \global\advance\LT@rows\@ne + \ifnum\LT@rows=\LTchunksize + \gdef\LT@setprevdepth{% + \prevdepth\z@\global + \global\let\LT@setprevdepth\relax}% + \expandafter\LT@xtabularcr + \else + \ifnum0=`{}\fi + \expandafter\LT@LL@FM@cr + \fi} +\def\LT@xtabularcr{% + \@ifnextchar[\LT@argtabularcr\LT@ntabularcr} +\def\LT@ntabularcr{% + \ifnum0=`{}\fi + \LT@echunk + \LT@start + \unvbox\z@ + \LT@get@widths + \LT@bchunk} +\def\LT@argtabularcr[#1]{% + \ifnum0=`{}\fi + \ifdim #1>\z@ + \unskip\@xargarraycr{#1}% + \else + \@yargarraycr{#1}% + \fi + \LT@echunk + \LT@start + \unvbox\z@ + \LT@get@widths + \LT@bchunk} +\def\LT@echunk{% + \crcr\LT@save@row\cr\egroup + \global\setbox\@ne\lastbox + \unskip + \egroup} +\def\LT@entry#1#2{% + \ifhmode\@firstofone{&}\fi\omit + \ifnum#1=\c@LT@chunks + \else + \kern#2\relax + \fi} +\def\LT@entry@chop#1#2{% + \noexpand\LT@entry + {\ifnum#1>\c@LT@chunks + 1}{0pt% + \else + #1}{#2% + \fi}} +\def\LT@entry@write{% + \noexpand\LT@entry^^J% + \@spaces} +\def\LT@kill{% + \LT@echunk + \LT@get@widths + \expandafter\LT@rebox\LT@bchunk} +\def\LT@rebox#1\bgroup{% + #1\bgroup + \unvbox\z@ + \unskip + \setbox\z@\lastbox} +\def\LT@blank@row{% + \xdef\LT@save@row{\expandafter\LT@build@blank + \romannumeral\number\LT@cols 001 }} +\def\LT@build@blank#1{% + \if#1m% + \noexpand\LT@entry{1}{0pt}% + \expandafter\LT@build@blank + \fi} +\def\LT@make@row{% + \global\expandafter\let\expandafter\LT@save@row + \csname LT@\romannumeral\c@LT@tables\endcsname + \ifx\LT@save@row\relax + \LT@blank@row + \else + {\let\LT@entry\or + \if!% + \ifcase\expandafter\expandafter\expandafter\LT@cols + \expandafter\@gobble\LT@save@row + \or + \else + \relax + \fi + !% + \else + \aftergroup\LT@blank@row + \fi}% + \fi} +\let\setlongtables\relax +\def\LT@get@widths{% + \setbox\tw@\hbox{% + \unhbox\@ne + \let\LT@old@row\LT@save@row + \global\let\LT@save@row\@empty + \count@\LT@cols + \loop + \unskip + \setbox\tw@\lastbox + \ifhbox\tw@ + \LT@def@row + \advance\count@\m@ne + \repeat}% + \ifx\LT@@save@row\@undefined + \let\LT@@save@row\LT@save@row + \fi} +\def\LT@def@row{% + \let\LT@entry\or + \edef\@tempa{% + \ifcase\expandafter\count@\LT@old@row + \else + {1}{0pt}% + \fi}% + \let\LT@entry\relax + \xdef\LT@save@row{% + \LT@entry + \expandafter\LT@max@sel\@tempa + \LT@save@row}} +\def\LT@max@sel#1#2{% + {\ifdim#2=\wd\tw@ + #1% + \else + \number\c@LT@chunks + \fi}% + {\the\wd\tw@}} +\def\LT@hline{% + \noalign{\ifnum0=`}\fi + \penalty\@M + \futurelet\@let@token\LT@@hline} +\def\LT@@hline{% + \ifx\@let@token\hline + \global\let\@gtempa\@gobble + \gdef\LT@sep{\penalty-\@medpenalty\vskip\doublerulesep}% + \else + \global\let\@gtempa\@empty + \gdef\LT@sep{\penalty-\@lowpenalty\vskip-\arrayrulewidth}% + \fi + \ifnum0=`{\fi}% + \multispan\LT@cols + \unskip\leaders\hrule\@height\arrayrulewidth\hfill\cr + \noalign{\LT@sep}% + \multispan\LT@cols + \unskip\leaders\hrule\@height\arrayrulewidth\hfill\cr + \noalign{\penalty\@M}% + \@gtempa} +\def\LT@caption{% + \noalign\bgroup + \@ifnextchar[{\egroup\LT@c@ption\@firstofone}\LT@capti@n} +\def\LT@c@ption#1[#2]#3{% + \LT@makecaption#1\fnum@table{#3}% + \def\@tempa{#2}% + \ifx\@tempa\@empty\else + {\let\\\space + \addcontentsline{lot}{table}{\protect\numberline{\thetable}{#2}}}% + \fi} +\def\LT@capti@n{% + \@ifstar + {\egroup\LT@c@ption\@gobble[]}% + {\egroup\@xdblarg{\LT@c@ption\@firstofone}}} +\def\LT@makecaption#1#2#3{% + \LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\LTcapwidth{% + \sbox\@tempboxa{#1{#2: }#3}% + \ifdim\wd\@tempboxa>\hsize + #1{#2: }#3% + \else + \hbox to\hsize{\hfil\box\@tempboxa\hfil}% + \fi + \endgraf\vskip\baselineskip}% + \hss}}} +\def\LT@output{% + \ifnum\outputpenalty <-\@Mi + \ifnum\outputpenalty > -\LT@end@pen + \LT@err{floats and marginpars not allowed in a longtable}\@ehc + \else + \setbox\z@\vbox{\unvbox\@cclv}% + \ifdim \ht\LT@lastfoot>\ht\LT@foot + \dimen@\pagegoal + \advance\dimen@-\ht\LT@lastfoot + \ifdim\dimen@<\ht\z@ + \setbox\@cclv\vbox{\unvbox\z@\copy\LT@foot\vss}% + \@makecol + \@outputpage + \setbox\z@\vbox{\box\LT@head}% + \fi + \fi + \global\@colroom\@colht + \global\vsize\@colht + \vbox + {\unvbox\z@\box\ifvoid\LT@lastfoot\LT@foot\else\LT@lastfoot\fi}% + \fi + \else + \setbox\@cclv\vbox{\unvbox\@cclv\copy\LT@foot\vss}% + \@makecol + \@outputpage + \global\vsize\@colroom + \copy\LT@head + \fi} +\def\LT@end@hd@ft#1{% + \LT@echunk + \ifx\LT@start\endgraf + \LT@err + {Longtable head or foot not at start of table}% + {Increase LTchunksize}% + \fi + \setbox#1\box\z@ + \LT@get@widths + \LT@bchunk} +\def\endfirsthead{\LT@end@hd@ft\LT@firsthead} +\def\endhead{\LT@end@hd@ft\LT@head} +\def\endfoot{\LT@end@hd@ft\LT@foot} +\def\endlastfoot{\LT@end@hd@ft\LT@lastfoot} +\def\LT@startpbox#1{% + \bgroup + \let\@footnotetext\LT@p@ftntext + \hsize#1% + \@arrayparboxrestore + \vrule \@height \ht\@arstrutbox \@width \z@} +\def\LT@endpbox{% + \@finalstrut\@arstrutbox + \egroup + \the\LT@p@ftn + \global\LT@p@ftn{}% + \hfil} +\def\LT@p@ftntext#1{% + \edef\@tempa{\the\LT@p@ftn\noexpand\footnotetext[\the\c@footnote]}% + \global\LT@p@ftn\expandafter{\@tempa{#1}}}% +\endinput +%% +%% End of file `longtable.sty'. diff --git a/Old_Packages/Doc23/doc_tex/kernel/main.tex b/Old_Packages/Doc23/doc_tex/kernel/main.tex new file mode 100644 index 00000000000..3d1c12669e5 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/main.tex @@ -0,0 +1,572 @@ +\cleardoublepage + +\pagenumbering{arabic} + +\input{user_manual} + +\gdef\ccNewRefManualStyle{\ccTrue} +\marginparsep10mm +\marginparwidth15mm +\newcommand{\KernelRefLayout}{\ccTexHtml{% + \ccSetThreeColumns{const Comparison_result}{}{\hspace*{8cm}} + \ccPropagateThreeToTwoColumns}{}} + +\input{reference_manual} +\KernelRefLayout +\input{Ref/Aff_transformation_2.tex} +\KernelRefLayout +\input{Ref/Aff_transformation_3.tex} +\KernelRefLayout +\input{Ref/are_ordered_along_line.tex} +\KernelRefLayout +\input{Ref/are_strictly_ordered_along_line.tex} +\KernelRefLayout +\input{Ref/assign.tex} +\KernelRefLayout +\input{Ref/Bbox_2.tex} +\KernelRefLayout +\input{Ref/Bbox_3.tex} +\KernelRefLayout +\input{Ref/Bounded_side.tex} +\KernelRefLayout +\input{Ref/Cartesian.tex} +\KernelRefLayout +\input{Ref/cartesian_to_homogeneous.tex} +\KernelRefLayout +\input{Ref/Circle_2.tex} +\KernelRefLayout +\input{Ref/circumcenter.tex} +\KernelRefLayout +\input{Ref/CLOCKWISE.tex} +\KernelRefLayout +\input{Ref/cmp_dist_to_point.tex} +\KernelRefLayout +\input{Ref/cmp_signed_dist_to_line.tex} +\KernelRefLayout +\input{Ref/cmp_signed_dist_to_plane.tex} +\KernelRefLayout +\input{Ref/COLLINEAR.tex} +\KernelRefLayout +\input{Ref/collinear.tex} +\KernelRefLayout +\input{Ref/collinear_are_ordered_along_line.tex} +\KernelRefLayout +\input{Ref/collinear_are_strictly_ordered_along_line.tex} +\KernelRefLayout +\input{Ref/compare_lexicographically_xy.tex} +\KernelRefLayout +\input{Ref/compare_lexicographically_xyz.tex} +\KernelRefLayout +\input{Ref/compare_x.tex} +\KernelRefLayout +\input{Ref/compare_y.tex} +\KernelRefLayout +\input{Ref/compare_y_at_x.tex} +\KernelRefLayout +\input{Ref/compare_z.tex} +\KernelRefLayout +\input{Ref/Comparison_result.tex} +\KernelRefLayout +\input{Ref/COPLANAR.tex} +\KernelRefLayout +\input{Ref/coplanar.tex} +\KernelRefLayout +\input{Ref/coplanar_orientation.tex} +\KernelRefLayout +\input{Ref/COUNTERCLOCKWISE.tex} +\KernelRefLayout +\input{Ref/cross_product.tex} +\KernelRefLayout +\input{Ref/DEGENERATE.tex} +\KernelRefLayout +\input{Ref/Direction_2.tex} +\KernelRefLayout +\input{Ref/Direction_3.tex} +\KernelRefLayout +\input{Ref/do_intersect.tex} +\KernelRefLayout +\input{Ref/do_overlap.tex} +\KernelRefLayout +\input{Ref/FieldNumberType.tex} +\KernelRefLayout +\input{Ref/has_larger_dist_to_point.tex} +\KernelRefLayout +\input{Ref/has_larger_signed_dist_to_line.tex} +\KernelRefLayout +\input{Ref/has_larger_signed_dist_to_plane.tex} +\KernelRefLayout +\input{Ref/has_smaller_dist_to_point.tex} +\KernelRefLayout +\input{Ref/has_smaller_signed_dist_to_line.tex} +\KernelRefLayout +\input{Ref/has_smaller_signed_dist_to_plane.tex} +\KernelRefLayout +\input{Ref/Homogeneous.tex} +\KernelRefLayout +\input{Ref/homogeneous_to_cartesian.tex} +\KernelRefLayout +\input{Ref/homogeneous_to_quotient_cartesian.tex} +\KernelRefLayout +\input{Ref/Identity_transformation.tex} +\KernelRefLayout +\input{Ref/intersection.tex} +\KernelRefLayout +\input{Ref/Iso_cuboid_3.tex} +\KernelRefLayout +\input{Ref/Iso_rectangle_2.tex} +\KernelRefLayout +\input{Ref/Kernel.tex} +\KernelRefLayout +\input{Ref/Kernel::Aff_transformation_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Aff_transformation_3.tex} +\KernelRefLayout\gdef\ccTagOperatorLayout{\ccFalse} +\input{Ref/Kernel::Are_ordered_along_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Are_ordered_along_line_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Are_strictly_ordered_along_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Are_strictly_ordered_along_line_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Assign_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Assign_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Circle_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Collinear_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Collinear_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Collinear_are_ordered_along_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Collinear_are_ordered_along_line_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Collinear_are_strictly_ordered_along_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Collinear_are_strictly_ordered_along_line_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Collinear_has_on_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Collinear_has_on_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Compare_x_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Compare_x_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Compare_x_at_y_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Compare_xy_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Compare_xy_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Compare_xyz_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Compare_y_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Compare_y_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Compare_y_at_x_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Compare_z_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Compute_squared_length_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Compute_squared_length_3.tex} +\KernelRefLayout +%\input{Ref/Kernel::Compute_x_at_y_2.tex} +%\KernelRefLayout +\input{Ref/Kernel::Compute_y_at_x_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_aff_transformation_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_aff_transformation_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_bisector_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_circle_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_circumcenter_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_direction_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_direction_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_direction_of_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_direction_of_line_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_direction_of_ray_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_direction_of_ray_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_iso_cuboid_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_iso_rectangle_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_line_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_max_point_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_max_point_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_midpoint_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_midpoint_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_min_point_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_min_point_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_opposite_circle_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_opposite_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_opposite_line_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_opposite_plane_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_opposite_ray_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_opposite_ray_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_opposite_segment_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_opposite_segment_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_opposite_triangle_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_perpendicular_direction_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_perpendicular_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_perpendicular_line_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_perpendicular_plane_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_perpendicular_vector_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_plane_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_point_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_point_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_point_d.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_point_on_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_point_on_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_ray_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_ray_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_second_point_on_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_second_point_on_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_segment_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_segment_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_source_point_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_source_point_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_sphere_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_supporting_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_supporting_line_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_supporting_plane_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_target_point_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_target_point_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_tetrahedron_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_triangle_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_triangle_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_vector_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_vector_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Coplanar_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Coplanar_orientation_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Counterclockwise_in_between_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Direction_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Direction_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Equal_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Equal_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Equal_x_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Equal_x_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Equal_xy_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Equal_xy_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Equal_xyz_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Equal_y_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Equal_y_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Equal_z_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_boundary_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_boundary_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_bounded_side_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_bounded_side_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_negative_side_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_negative_side_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_positive_side_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_positive_side_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_unbounded_side_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_unbounded_side_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Intersect_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Intersect_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Is_degenerate_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Is_degenerate_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Is_horizontal_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Is_vertical_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Iso_cuboid_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Iso_rectangle_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Left_of_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Leftturn_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_distance_to_point_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_distance_to_point_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_rotate_ccw_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_signed_distance_to_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_x_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_x_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_xy_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_xy_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_xyz_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_y_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_y_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_yx_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_z_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Line_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Object_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Object_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Orientation_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Orientation_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Oriented_side_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Oriented_side_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Plane_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Point_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Point_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Point_d.tex} +\KernelRefLayout +\input{Ref/Kernel::Ray_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Ray_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Segment_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Segment_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Side_of_bounded_circle_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Side_of_bounded_sphere_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Side_of_oriented_circle_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Side_of_oriented_sphere_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Sphere_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Tetrahedron_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Transform_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Transform_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Triangle_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Triangle_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Vector_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Vector_3.tex} +\KernelRefLayout +\input{Ref/LEFTTURN.tex} +\KernelRefLayout +\input{Ref/leftturn.tex} +\KernelRefLayout +\input{Ref/lexicographically_xy_larger.tex} +\KernelRefLayout +\input{Ref/lexicographically_xy_larger_or_equal.tex} +\KernelRefLayout +\input{Ref/lexicographically_xy_smaller.tex} +\KernelRefLayout +\input{Ref/lexicographically_xy_smaller_or_equal.tex} +\KernelRefLayout +\input{Ref/lexicographically_xyz_smaller.tex} +\KernelRefLayout +\input{Ref/lexicographically_xyz_smaller_or_equal.tex} +\KernelRefLayout +\input{Ref/Line_2.tex} +\KernelRefLayout +\input{Ref/Line_3.tex} +\KernelRefLayout +\input{Ref/make_object.tex} +\KernelRefLayout +\input{Ref/midpoint.tex} +\KernelRefLayout +\input{Ref/NULL_VECTOR.tex} +\KernelRefLayout +\input{Ref/Null_vector.tex} +\KernelRefLayout +\input{Ref/Object.tex} +\KernelRefLayout\gdef\ccTagOperatorLayout{\ccTrue} +\input{Ref/operatorStar.tex} +\KernelRefLayout +\input{Ref/operator+.tex} +\KernelRefLayout +\input{Ref/operator-.tex} +\KernelRefLayout\gdef\ccTagOperatorLayout{\ccTrue} +\input{Ref/opposite.tex} +\KernelRefLayout +\input{Ref/Orientation.tex} +\KernelRefLayout +\input{Ref/orientation.tex} +\KernelRefLayout +\input{Ref/Oriented_side.tex} +\KernelRefLayout +\input{Ref/ORIGIN.tex} +\KernelRefLayout +\input{Ref/Origin.tex} +\KernelRefLayout +\input{Ref/Plane_3.tex} +\KernelRefLayout +\input{Ref/Point_2.tex} +\KernelRefLayout +\input{Ref/Point_3.tex} +\KernelRefLayout +\input{Ref/Point_d.tex} +\KernelRefLayout +\input{Ref/quotient_cartesian_to_homogeneous.tex} +\KernelRefLayout +\input{Ref/R.tex} +\KernelRefLayout +\input{Ref/rational_rotation_approximation.tex} +\KernelRefLayout +\input{Ref/Ray_2.tex} +\KernelRefLayout +\input{Ref/Ray_3.tex} +\KernelRefLayout +\input{Ref/Reflection.tex} +\KernelRefLayout +\input{Ref/RIGHTTURN.tex} +\KernelRefLayout +\input{Ref/rightturn.tex} +\KernelRefLayout +\input{Ref/RingNumberType.tex} +\KernelRefLayout +\input{Ref/Rotation.tex} +\KernelRefLayout +\input{Ref/Scaling.tex} +\KernelRefLayout +\input{Ref/Segment_2.tex} +\KernelRefLayout +\input{Ref/Segment_3.tex} +\KernelRefLayout +\input{Ref/side_of_bounded_circle.tex} +\KernelRefLayout +\input{Ref/side_of_bounded_sphere.tex} +\KernelRefLayout +\input{Ref/side_of_oriented_circle.tex} +\KernelRefLayout +\input{Ref/side_of_oriented_sphere.tex} +\KernelRefLayout +\input{Ref/Sign.tex} +\KernelRefLayout +\input{Ref/Simple_cartesian.tex} +\KernelRefLayout +\input{Ref/Sphere_3.tex} +\KernelRefLayout +\input{Ref/squared_distance.tex} +\KernelRefLayout +\input{Ref/Tetrahedron_3.tex} +\KernelRefLayout +\input{Ref/Translation.tex} +\KernelRefLayout +\input{Ref/Triangle_2.tex} +\KernelRefLayout +\input{Ref/Triangle_3.tex} +\KernelRefLayout +\input{Ref/Vector_2.tex} +\KernelRefLayout +\input{Ref/Vector_3.tex} +\KernelRefLayout +\input{Ref/x_equal.tex} +\KernelRefLayout +\input{Ref/y_equal.tex} +\KernelRefLayout +\input{Ref/z_equal.tex} diff --git a/Old_Packages/Doc23/doc_tex/kernel/predicates_constructions.tex b/Old_Packages/Doc23/doc_tex/kernel/predicates_constructions.tex new file mode 100644 index 00000000000..68bd04c54a6 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/predicates_constructions.tex @@ -0,0 +1,156 @@ +\chapter{Predicates and Constructions} + +\section{Predicates} +Predicates are at the heart of a geometry kernel. They are basic units +for the composition of geometric algorithms and encapsulate decisisons. +Hence their correctness is crucial for the control flow and hence for +the correctness of an implementation of a geometric algorithm. \cgal\ uses +the term predicate in a generalized sense. Not only components returning a +Boolean value are called predicates but also components returning an +enumeration type like a \ccc{Comparison_result} or an \ccc{Orientation}. +We say components, because predicates are implemented both as functions and +function objects (provided by a kernel class). + +\cgal\ provides predicates for the \ccHtmlNoLinksFrom{orientation} of point +sets (\ccc{orientation}, \ccc{leftturn}, \ccc{rightturn}, \ccc{collinear}, +\ccc{coplanar}), for comparing points according to some given order, +especially for comparing Cartesian coordinates +(e.g.~\ccc{lexicographically_xy_smaller}), in-circle and in-sphere tests, +and predicates to compare distances. + +\section{Constructions} +Functions and function objects that generate objects that are neither +of type \ccc{bool} nor enum types are called constructions. +Constructions involve computation of new numerical values and may be +imprecise due to rounding errors unless a kernel with an exact number type is +used. + +Affine transformations (\ccc{Aff_transformation_2}, +\ccc{Aff_transformation_3}) allow to generate new object instances under +arbitrary affine transformations. These transformations include translations, +rotations (in 2D only) and scaling. Most of the geometric objects in a +kernel have a member function \ccc{transform(Aff_transformation t)} +which applies the transformation to the object instance. + +{\cgal} also provides a set of functions that detect or compute the +\ccHtmlNoLinksFrom{intersection}\index{intersection} +between objects of the 2D kernel, and many objects in the 3D kernel, +and functions to calculate their +squared distance\index{distance}\index{distance!squared}. +Moreover, some member functions of kernel objects are constructions. + +So there are routines that compute the square of the Euclidean distance, but no +routines that compute the distance itself. Why? +First of all, the two values can be derived from each other quite easily (by +taking the square root or taking the square). So, supplying only the one and +not the other is only a minor inconvenience for the user. +Second, often either value can be used. This is for example the case when +(squared) distances are compared. +Third, the library wants to stimulate the use of the squared distance instead +of the distance. The squared distance can be computed in more cases and the +computation is cheaper. +We do this by not providing the perhaps more natural routine, +The problem of a distance routine is that it needs the \ccStyle{sqrt} +operation. +This has two drawbacks: +\begin{itemize} +\item +The \ccStyle{sqrt} operation can be costly. Even if it is not very costly for +a specific number type and platform, avoiding it is always cheaper. +\item +There are number types on which no \ccStyle{sqrt} operation is defined, +especially integer types and rationals. +\end{itemize} + +\section{Polymorphic Return Values} +Some functions can return different types of objects. A typical +\CC\ solution to this problem is to derive all possible return +types from a common base class, to return a pointer to this +class and to perform a dynamic cast on this pointer. The class +\ccc{Object} provides an abstraction. +An object \ccStyle{obj} of the class \ccc{Object} can +represent an arbitrary class. The only operations it provides is +to make copies and assignments, so that you can put them in lists +or arrays. Note that \ccc{Object} is NOT a common base class for the +elementary classes. Therefore, there is no +automatic conversion from these classes to \ccc{Object} Rather +this is done with the global function \ccc{make_object()}. This +encapsulation mechanism requires the use of \ccc{assign} to use +the functionality of the encapsulated class. + +\ccExample +In the following example, the object class is used as return value for the +\ccHtmlNoLinksFrom{intersection} computation, as there are possibly different return values. + +\begin{cprog} +{ + Point_2< Cartesian > point; + Segment_2< Cartesian > segment, segment_1, segment_2; + + std::cin >> segment_1 >> segment_2; + + Object obj = intersection(segment_1, segment_2); + + if (assign(point, obj)) { + /* do something with point */ + } else if ((assign(segment, obj)) { + /* do something with segment*/ + } +\end{cprog} +\ccHtmlLinksOff% +\begin{cprog} + /* there was no intersection */ +} +\end{cprog} +\ccHtmlLinksOn% + +\medskip +The \ccHtmlNoLinksFrom{intersection} routine itself looks roughly as follows: + +\begin{cprog} + +template < class R > +Object intersection(Segment_2 s1, Segment_2 s2) +{ +\end{cprog} +\ccHtmlLinksOff% +\begin{cprog} + if (/* intersection in a point */ ) { +\end{cprog} +\ccHtmlLinksOn% +\begin{cprog} + Point_2 p = ... ; + return make_object(p); +\end{cprog} +\ccHtmlLinksOff% +\begin{cprog} + } else if (/* intersection in a segment */ ) { +\end{cprog} +\ccHtmlLinksOn% +\begin{cprog} + Segment_2 s = ... ; + return make_object(s); + } + return Object(); +} +\end{cprog} + +\section{Constructive Predicates} +For testing where a point $p$ lies with respect to a plane defined by three +points $q$, $r$ and $s$, one may be tempted to construct the plane +\ccc{Plane_3(q,r,s)} and use the method \ccc{oriented_side(p)}. +This may pay off if many tests with respect to the plane are made. +Nevertheless, unless the number type is exact, the constructed plane +is only approximated, and round-off errors may lead +\ccc{oriented_side(p)} to return an \ccHtmlNoLinksFrom{orientation} +which is different from the \ccHtmlNoLinksFrom{orientation} of $p$, $q$, $r$, +and $s$. + +In {\cgal}, we provide predicates in which such +geometric decisions are made directly with a reference to the input points +$p$, $q$, $r$, $s$, without an intermediary object like a plane. +For the above test, the recommended way to get the result is to use +\ccc{orientation(p,q,r,s)}. For exact number types like \ccc{leda_real}, +the situation is different. If several tests are to be made with the same +plane, it pays off to construct the plane and to use \ccc{oriented_side(p)}. + diff --git a/Old_Packages/Doc23/doc_tex/kernel/preface.tex b/Old_Packages/Doc23/doc_tex/kernel/preface.tex new file mode 100644 index 00000000000..be846044e62 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/preface.tex @@ -0,0 +1,97 @@ +\lcTex{\chapter*{Preface}} +\lcHtml{\chapter{Preface}} + +\cgal\ is a {\em Computational Geometry Algorithms Library} written in \CC, +developed by a consortium consisting of +\ccAnchor{http://www.inf.ethz.ch/}{ETH Z\"urich} (Switzerland), +\ccAnchor{http://www.inf.fu-berlin.de/}{Freie Universit{\"a}t Berlin} (Germany), +\ccAnchor{http://www.inria.fr/Equipes/PRISME-eng.html}{{\sc Inria} +Sophia-Antipolis} (France), +\ccAnchor{http://www.informatik.uni-halle.de/}{Martin-Luther-Universit{\"a}t +Halle-Wittenberg} (Germany), +\ccAnchor{http://www.mpi-sb.mpg.de/}{Max-Planck Institut f{\"u}r Informatik}, +Saarbr\"ucken (Germany), +\ccAnchor{http://info.risc.uni-linz.ac.at/}{{\sc Risc}} Linz (Austria) +\ccAnchor{http://www.math.tau.ac.il/}{Tel-Aviv University} (Israel), and +\ccAnchor{http://www.cs.uu.nl/}{Utrecht University} (The Netherlands). +You can find more information on the project on the +\ccAnchor{http://www.cs.uu.nl/CGAL/}{\cgal\ home page} +\ccTexHtml{at URL {\tt http://www.cgal.org}}{}. + +Should you have any questions, comments, remarks or criticism concerning +\cgal, please send a message to +\ccTexHtml{{\tt contact@cgal.org}}{<contact@cgal.org>}. + + +\section*{Editors} + +Stefan Schirra (Max-Planck Institut f\"ur Informatik). \\ +Remco Veltkamp (Utrecht University). \\ +Mariette Yvinec ({\sc Inria} Sophia-Antipolis). + +\section*{Authors} + +Herv\'e Br\"onnimann ({\sc Inria} Sophia-Antipolis). \\ +Andreas Fabri ({\sc Inria} Sophia-Antipolis).\\ +Geert-Jan Giezeman (Utrecht University).\\ +Lutz Kettner (ETH Z\"urich).\\ +Stefan Schirra (Max-Planck Institut f\"ur Informatik).\\ +Sven Sch\"onherr (Freie Universit{\"a}t Berlin). + +\section*{Design and Implementation History} + +At a meeting at Utrecht University in January 1995, +Olivier Devillers, Andreas Fabri, Wolfgang Freiseisen, +Geert-Jan Giezeman, Mark Overmars, Stefan Schirra, Otfried Schwarzkopf +(now Otfried Cheong), and Sven Sch\"onherr +discussed the foundations of the \cgal\ kernel. +Many design and software engineering issues were addressed, +e.g.\ naming conventions, coupling of classes +(flat versus deep class hierarchy), +memory allocation, programming conventions, modifiability of +atomic objects, points and vectors, storing additional information, +orthogonality of operations on the kernel objects, +viewing non-constant-size objects like polygons as +dynamic data structures (and hence not as part of the (innermost) kernel). + +The people attending the meeting delegated the compilation of +a draft specification to Stefan Schirra. +The resulting draft specification was intentionally modeled on \cgal's +precursors \protocgal\ and \plageo\ as well as on the geometric part of \leda. +The specification already featured coexistence of +\ccHtmlNoLinksFrom{Cartesian} and +homogeneous representation of point/vector data and parameterization +by number type(s). +During the discussion of the draft a kernel design group was formed. +The members of this group were Andreas Fabri, Geert-Jan Giezeman, +Lutz Kettner, Stefan Schirra, and Sven Sch\"onherr. +The work of the kernel design group led to significant changes and +improvements of the original design, e.g.\ the strong separation between +points and vectors. Probably the most important enhancement was the design +of a common superstructure for the previously uncoupled +\ccHtmlNoLinksFrom{Cartesian} and +homogeneous representations. One can say, that the kernel was designed +by this group. +The kernel was later revised based on suggestions by Herv\'e Br\"onnimann, +Bernd G\"artner, Michael Hoffmann, and Lutz Kettner. + +A first version of the kernel was internally made available at the beginning +of the \cgal-project ({\sc esprit ltr iv} project number 21957). +Since then many more people contributed to the evolution of the kernel +through discussions on the \cgal\ mailing lists. +The implementation based on +\ccHtmlNoLinksFrom{Cartesian} representation was (mostly) provided +by Andreas Fabri, the homogeneous representation (mostly) by Stefan Schirra. +Intersection and distance computations were implemented by Geert-Jan Giezeman. +The kernel is now maintained by Mariette Yvinec, Geert-Jan Giezeman, +and Stefan Schirra. + +\section*{Acknowledgement} + +This work was supported +by the Graduiertenkolleg `Algorithmische Diskrete Mathematik', +under grant DFG We 1265/2-1, +and by ESPRIT IV Long Term Research Projects No.~21957 (CGAL) +and No.~28155 (GALIA). + + diff --git a/Old_Packages/Doc23/doc_tex/kernel/reference_manual.tex b/Old_Packages/Doc23/doc_tex/kernel/reference_manual.tex new file mode 100644 index 00000000000..8a5144c5f90 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/reference_manual.tex @@ -0,0 +1,5 @@ +\chapter{Reference Pages} +The following pages give a complete overview on the functionality provided +in the kernel. \cgal\ componenents and concepts are listed in alphabetical +order. + diff --git a/Old_Packages/Doc23/doc_tex/kernel/s_main.tex b/Old_Packages/Doc23/doc_tex/kernel/s_main.tex new file mode 100644 index 00000000000..3d1c12669e5 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/s_main.tex @@ -0,0 +1,572 @@ +\cleardoublepage + +\pagenumbering{arabic} + +\input{user_manual} + +\gdef\ccNewRefManualStyle{\ccTrue} +\marginparsep10mm +\marginparwidth15mm +\newcommand{\KernelRefLayout}{\ccTexHtml{% + \ccSetThreeColumns{const Comparison_result}{}{\hspace*{8cm}} + \ccPropagateThreeToTwoColumns}{}} + +\input{reference_manual} +\KernelRefLayout +\input{Ref/Aff_transformation_2.tex} +\KernelRefLayout +\input{Ref/Aff_transformation_3.tex} +\KernelRefLayout +\input{Ref/are_ordered_along_line.tex} +\KernelRefLayout +\input{Ref/are_strictly_ordered_along_line.tex} +\KernelRefLayout +\input{Ref/assign.tex} +\KernelRefLayout +\input{Ref/Bbox_2.tex} +\KernelRefLayout +\input{Ref/Bbox_3.tex} +\KernelRefLayout +\input{Ref/Bounded_side.tex} +\KernelRefLayout +\input{Ref/Cartesian.tex} +\KernelRefLayout +\input{Ref/cartesian_to_homogeneous.tex} +\KernelRefLayout +\input{Ref/Circle_2.tex} +\KernelRefLayout +\input{Ref/circumcenter.tex} +\KernelRefLayout +\input{Ref/CLOCKWISE.tex} +\KernelRefLayout +\input{Ref/cmp_dist_to_point.tex} +\KernelRefLayout +\input{Ref/cmp_signed_dist_to_line.tex} +\KernelRefLayout +\input{Ref/cmp_signed_dist_to_plane.tex} +\KernelRefLayout +\input{Ref/COLLINEAR.tex} +\KernelRefLayout +\input{Ref/collinear.tex} +\KernelRefLayout +\input{Ref/collinear_are_ordered_along_line.tex} +\KernelRefLayout +\input{Ref/collinear_are_strictly_ordered_along_line.tex} +\KernelRefLayout +\input{Ref/compare_lexicographically_xy.tex} +\KernelRefLayout +\input{Ref/compare_lexicographically_xyz.tex} +\KernelRefLayout +\input{Ref/compare_x.tex} +\KernelRefLayout +\input{Ref/compare_y.tex} +\KernelRefLayout +\input{Ref/compare_y_at_x.tex} +\KernelRefLayout +\input{Ref/compare_z.tex} +\KernelRefLayout +\input{Ref/Comparison_result.tex} +\KernelRefLayout +\input{Ref/COPLANAR.tex} +\KernelRefLayout +\input{Ref/coplanar.tex} +\KernelRefLayout +\input{Ref/coplanar_orientation.tex} +\KernelRefLayout +\input{Ref/COUNTERCLOCKWISE.tex} +\KernelRefLayout +\input{Ref/cross_product.tex} +\KernelRefLayout +\input{Ref/DEGENERATE.tex} +\KernelRefLayout +\input{Ref/Direction_2.tex} +\KernelRefLayout +\input{Ref/Direction_3.tex} +\KernelRefLayout +\input{Ref/do_intersect.tex} +\KernelRefLayout +\input{Ref/do_overlap.tex} +\KernelRefLayout +\input{Ref/FieldNumberType.tex} +\KernelRefLayout +\input{Ref/has_larger_dist_to_point.tex} +\KernelRefLayout +\input{Ref/has_larger_signed_dist_to_line.tex} +\KernelRefLayout +\input{Ref/has_larger_signed_dist_to_plane.tex} +\KernelRefLayout +\input{Ref/has_smaller_dist_to_point.tex} +\KernelRefLayout +\input{Ref/has_smaller_signed_dist_to_line.tex} +\KernelRefLayout +\input{Ref/has_smaller_signed_dist_to_plane.tex} +\KernelRefLayout +\input{Ref/Homogeneous.tex} +\KernelRefLayout +\input{Ref/homogeneous_to_cartesian.tex} +\KernelRefLayout +\input{Ref/homogeneous_to_quotient_cartesian.tex} +\KernelRefLayout +\input{Ref/Identity_transformation.tex} +\KernelRefLayout +\input{Ref/intersection.tex} +\KernelRefLayout +\input{Ref/Iso_cuboid_3.tex} +\KernelRefLayout +\input{Ref/Iso_rectangle_2.tex} +\KernelRefLayout +\input{Ref/Kernel.tex} +\KernelRefLayout +\input{Ref/Kernel::Aff_transformation_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Aff_transformation_3.tex} +\KernelRefLayout\gdef\ccTagOperatorLayout{\ccFalse} +\input{Ref/Kernel::Are_ordered_along_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Are_ordered_along_line_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Are_strictly_ordered_along_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Are_strictly_ordered_along_line_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Assign_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Assign_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Circle_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Collinear_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Collinear_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Collinear_are_ordered_along_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Collinear_are_ordered_along_line_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Collinear_are_strictly_ordered_along_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Collinear_are_strictly_ordered_along_line_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Collinear_has_on_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Collinear_has_on_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Compare_x_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Compare_x_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Compare_x_at_y_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Compare_xy_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Compare_xy_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Compare_xyz_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Compare_y_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Compare_y_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Compare_y_at_x_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Compare_z_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Compute_squared_length_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Compute_squared_length_3.tex} +\KernelRefLayout +%\input{Ref/Kernel::Compute_x_at_y_2.tex} +%\KernelRefLayout +\input{Ref/Kernel::Compute_y_at_x_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_aff_transformation_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_aff_transformation_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_bisector_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_circle_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_circumcenter_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_direction_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_direction_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_direction_of_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_direction_of_line_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_direction_of_ray_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_direction_of_ray_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_iso_cuboid_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_iso_rectangle_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_line_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_max_point_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_max_point_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_midpoint_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_midpoint_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_min_point_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_min_point_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_opposite_circle_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_opposite_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_opposite_line_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_opposite_plane_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_opposite_ray_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_opposite_ray_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_opposite_segment_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_opposite_segment_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_opposite_triangle_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_perpendicular_direction_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_perpendicular_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_perpendicular_line_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_perpendicular_plane_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_perpendicular_vector_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_plane_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_point_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_point_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_point_d.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_point_on_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_point_on_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_ray_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_ray_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_second_point_on_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_second_point_on_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_segment_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_segment_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_source_point_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_source_point_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_sphere_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_supporting_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_supporting_line_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_supporting_plane_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_target_point_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_target_point_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_tetrahedron_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_triangle_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_triangle_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_vector_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_vector_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Coplanar_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Coplanar_orientation_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Counterclockwise_in_between_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Direction_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Direction_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Equal_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Equal_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Equal_x_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Equal_x_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Equal_xy_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Equal_xy_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Equal_xyz_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Equal_y_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Equal_y_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Equal_z_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_boundary_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_boundary_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_bounded_side_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_bounded_side_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_negative_side_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_negative_side_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_positive_side_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_positive_side_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_unbounded_side_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_unbounded_side_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Intersect_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Intersect_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Is_degenerate_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Is_degenerate_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Is_horizontal_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Is_vertical_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Iso_cuboid_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Iso_rectangle_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Left_of_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Leftturn_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_distance_to_point_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_distance_to_point_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_rotate_ccw_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_signed_distance_to_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_x_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_x_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_xy_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_xy_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_xyz_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_y_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_y_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_yx_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_z_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Line_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Object_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Object_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Orientation_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Orientation_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Oriented_side_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Oriented_side_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Plane_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Point_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Point_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Point_d.tex} +\KernelRefLayout +\input{Ref/Kernel::Ray_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Ray_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Segment_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Segment_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Side_of_bounded_circle_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Side_of_bounded_sphere_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Side_of_oriented_circle_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Side_of_oriented_sphere_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Sphere_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Tetrahedron_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Transform_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Transform_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Triangle_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Triangle_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Vector_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Vector_3.tex} +\KernelRefLayout +\input{Ref/LEFTTURN.tex} +\KernelRefLayout +\input{Ref/leftturn.tex} +\KernelRefLayout +\input{Ref/lexicographically_xy_larger.tex} +\KernelRefLayout +\input{Ref/lexicographically_xy_larger_or_equal.tex} +\KernelRefLayout +\input{Ref/lexicographically_xy_smaller.tex} +\KernelRefLayout +\input{Ref/lexicographically_xy_smaller_or_equal.tex} +\KernelRefLayout +\input{Ref/lexicographically_xyz_smaller.tex} +\KernelRefLayout +\input{Ref/lexicographically_xyz_smaller_or_equal.tex} +\KernelRefLayout +\input{Ref/Line_2.tex} +\KernelRefLayout +\input{Ref/Line_3.tex} +\KernelRefLayout +\input{Ref/make_object.tex} +\KernelRefLayout +\input{Ref/midpoint.tex} +\KernelRefLayout +\input{Ref/NULL_VECTOR.tex} +\KernelRefLayout +\input{Ref/Null_vector.tex} +\KernelRefLayout +\input{Ref/Object.tex} +\KernelRefLayout\gdef\ccTagOperatorLayout{\ccTrue} +\input{Ref/operatorStar.tex} +\KernelRefLayout +\input{Ref/operator+.tex} +\KernelRefLayout +\input{Ref/operator-.tex} +\KernelRefLayout\gdef\ccTagOperatorLayout{\ccTrue} +\input{Ref/opposite.tex} +\KernelRefLayout +\input{Ref/Orientation.tex} +\KernelRefLayout +\input{Ref/orientation.tex} +\KernelRefLayout +\input{Ref/Oriented_side.tex} +\KernelRefLayout +\input{Ref/ORIGIN.tex} +\KernelRefLayout +\input{Ref/Origin.tex} +\KernelRefLayout +\input{Ref/Plane_3.tex} +\KernelRefLayout +\input{Ref/Point_2.tex} +\KernelRefLayout +\input{Ref/Point_3.tex} +\KernelRefLayout +\input{Ref/Point_d.tex} +\KernelRefLayout +\input{Ref/quotient_cartesian_to_homogeneous.tex} +\KernelRefLayout +\input{Ref/R.tex} +\KernelRefLayout +\input{Ref/rational_rotation_approximation.tex} +\KernelRefLayout +\input{Ref/Ray_2.tex} +\KernelRefLayout +\input{Ref/Ray_3.tex} +\KernelRefLayout +\input{Ref/Reflection.tex} +\KernelRefLayout +\input{Ref/RIGHTTURN.tex} +\KernelRefLayout +\input{Ref/rightturn.tex} +\KernelRefLayout +\input{Ref/RingNumberType.tex} +\KernelRefLayout +\input{Ref/Rotation.tex} +\KernelRefLayout +\input{Ref/Scaling.tex} +\KernelRefLayout +\input{Ref/Segment_2.tex} +\KernelRefLayout +\input{Ref/Segment_3.tex} +\KernelRefLayout +\input{Ref/side_of_bounded_circle.tex} +\KernelRefLayout +\input{Ref/side_of_bounded_sphere.tex} +\KernelRefLayout +\input{Ref/side_of_oriented_circle.tex} +\KernelRefLayout +\input{Ref/side_of_oriented_sphere.tex} +\KernelRefLayout +\input{Ref/Sign.tex} +\KernelRefLayout +\input{Ref/Simple_cartesian.tex} +\KernelRefLayout +\input{Ref/Sphere_3.tex} +\KernelRefLayout +\input{Ref/squared_distance.tex} +\KernelRefLayout +\input{Ref/Tetrahedron_3.tex} +\KernelRefLayout +\input{Ref/Translation.tex} +\KernelRefLayout +\input{Ref/Triangle_2.tex} +\KernelRefLayout +\input{Ref/Triangle_3.tex} +\KernelRefLayout +\input{Ref/Vector_2.tex} +\KernelRefLayout +\input{Ref/Vector_3.tex} +\KernelRefLayout +\input{Ref/x_equal.tex} +\KernelRefLayout +\input{Ref/y_equal.tex} +\KernelRefLayout +\input{Ref/z_equal.tex} diff --git a/Old_Packages/Doc23/doc_tex/kernel/title.tex b/Old_Packages/Doc23/doc_tex/kernel/title.tex new file mode 100644 index 00000000000..dbf3f6bec51 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/title.tex @@ -0,0 +1,38 @@ + +\pagestyle{empty} + +\begin{titlepage} +\mbox{} +\vskip3cm + +\ccTexHtml +{\centerline{\IpeScale{25}\Ipe{../Fig/c-simp.ipe} + \Ipe{../Fig/g-simp.ipe} \Ipe{../Fig/a-simp.ipe} \Ipe{../Fig/l-simp.ipe}}} + {

+ Logo C + Logo G + Logo A + Logo L +
+ [Computational Geometry Algorithms Library] +


} + +\vskip2cm +\centerline{ {\Huge\bf CGAL} {\huge\bf Reference Manual } } +\vskip1cm +\centerline{ {\huge Part 1: Kernel Library } } + +\vskip2cm +\newcommand{\mydate}{July 1998} +\ccTexHtml +{\renewcommand{\mydate}{\ifcase\the\month \or January\or + February\or March\or April\or May\or June\or July\or August\or + September\or October\or November\or December\fi~\the\year}}{} + \centerline{ {\large Release \cgalrelease, \mydate} } + +\end{titlepage} + + + + diff --git a/Old_Packages/Doc23/doc_tex/kernel/transvecthree.gif b/Old_Packages/Doc23/doc_tex/kernel/transvecthree.gif new file mode 100644 index 00000000000..1834e432c0e Binary files /dev/null and b/Old_Packages/Doc23/doc_tex/kernel/transvecthree.gif differ diff --git a/Old_Packages/Doc23/doc_tex/kernel/transvectwo.gif b/Old_Packages/Doc23/doc_tex/kernel/transvectwo.gif new file mode 100644 index 00000000000..5c4cddcda40 Binary files /dev/null and b/Old_Packages/Doc23/doc_tex/kernel/transvectwo.gif differ diff --git a/Old_Packages/Doc23/doc_tex/kernel/user_manual.tex b/Old_Packages/Doc23/doc_tex/kernel/user_manual.tex new file mode 100644 index 00000000000..17134065e04 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/user_manual.tex @@ -0,0 +1,5 @@ +\cleardoublepage +\input{introduction} +\input{kernel_representation} +\input{kernel_geometry} +\input{predicates_constructions} diff --git a/Old_Packages/Doc23/doc_tex/kernel/wrapper.tex b/Old_Packages/Doc23/doc_tex/kernel/wrapper.tex new file mode 100644 index 00000000000..8858a515b19 --- /dev/null +++ b/Old_Packages/Doc23/doc_tex/kernel/wrapper.tex @@ -0,0 +1,57 @@ +\documentclass{book} + +\usepackage{cprog} +\usepackage{cc_manual} +\usepackage{pslatex} +\usepackage{epsfig} +\usepackage{cc_manual_index} +\usepackage{latex_converter} +\usepackage{makeidx} +\usepackage{amssymb} +\usepackage{graphicx} +\usepackage{path} +\usepackage{ipe} +\usepackage{longtable} + +% page dimensions +% --------------- +\textwidth 15.6cm +\textheight 23 cm +\topmargin -14mm +\evensidemargin 3mm +\oddsidemargin 3mm + +% default column layout +% --------------------- +% This is the recommended layout. It may be changed inside main.tex. + +\newcommand{\cgalColumnLayout}{\ccTexHtml{% + \ccSetThreeColumns{Oriented_side}{}{\hspace*{10cm}} + \ccPropagateThreeToTwoColumns}{}} + +\newcommand{\cgalrelease}{2.2-I-..} + +\makeindex + +\sloppy + +\begin{document} + +\include{title} +\pagestyle{plain} +\pagenumbering{roman} +\setcounter{page}{0} +\include{preface} +\cleardoublepage +\tableofcontents + +\cgalColumnLayout + +\include{main} + +\bibliographystyle{alpha} +\bibliography{../cgal-manual,geom} + +\lcTex{\printindex} +\end{document} + diff --git a/Old_Packages/Doc23/version b/Old_Packages/Doc23/version new file mode 100644 index 00000000000..12bdcebdc28 --- /dev/null +++ b/Old_Packages/Doc23/version @@ -0,0 +1,2 @@ +2.7 (26 Sep 2000) +maintainer: Stefan Schirra diff --git a/Old_Packages/Kernel_basic/changes.txt b/Old_Packages/Kernel_basic/changes.txt new file mode 100644 index 00000000000..94794eb5412 --- /dev/null +++ b/Old_Packages/Kernel_basic/changes.txt @@ -0,0 +1,393 @@ +3.17 (10 Dec 2000) + +- Homogeneous<>::Coplanar_orientation_3 added +- Homogeneous<>::Compare_distance_to_point_2 added +- Homogeneous<>::Compare_distance_to_point_3 added +- function_objects.h: Coplanar_orientation added +- function_objects.h: Compare_distance_to_point added + +3.16 (12 Nov 2000) + +- in Handle_for: typedef RefCounted element_type; added + +3.15 (15 Oct 2000) + +- const typename Allocator::pointer Ptr() const { return ptr; } + added in Handle_for.h as requested by Sylvain + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 2 . 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +3.14 (15 Sep 2000) + +- CGAL::min/max with + CGAL_CFG_USING_USING_BUG) || defined(CGAL_CFG_BROKEN_USING) + now returns NT instead of const NT& + +3.13 (10 Aug 2000) + +- Homogeneous<>::Compute_y_at_x_2 fixed (_2 added) + +3.12 (07 Aug 2000) + +- to_double(leda_integer) qualified by :: in kernel_to_kernel.h + +3.11 (02 Aug 2000) + +- Handle_for<>::id is const now + +3.10 (02 Aug 2000) + +- include added to kernel_to_kernel.h + +3.9 (26 Jul 2000) + +- added Handle_for<>::identical(const Handle_for& h) to check + for sharing RefCounted +- added Handle_for<>::id(); returns long int + +3.8 (14 Jul 2000) + +- result_type added to function objects in Kernel/function_objects.h + not for Call_transform (return type depends on template parameter) +- added (with preliminary limited functionality) + +3.7 (27 Jun 2000) + +- CGAL_NTS sign used insteda of CGAL::sign in sign_of_determinant.h +- Construct_circumcenter_3 added to homogeneous kernel traits +- CGALi::p_Circumcenter extended to handle 3d case as well + +3.6.1 (08 Jun 2000) + +- flag test for using std::max and std::min refined +- CGAL_NTS defined in basic.h + +3.6 (05 Jun 2000) + +- Handle_for<..., Allocator>::ptr has now type Allocator::pointer +- Handle_for::Handle_for(const RefCounted&) + constructor added to Handle_for. + Handle_for::initialize_with(const RefCounted&) added. +- CGAL_CFG_BROKEN_USING used now to check for broken using + with using std::max and std::min in + +3.5.1 (31 May 2000) + +- __MSC_VER (temporarily) used instead of CGAL_CFG_USING...BUG + with using std::max and std::min added to + +3.5 (30 May 2000) + +- Reflection added as transformation tag +- added +- Compare_x_at_y_2 added to homogeneous traits +- count in Handle_for is now of type 'unsigned int' +- using std::max and std::min added to + +3.4.2 (19 Apr 2000) + +- Tuples modified +- _Assert_tag_class -> Assert_tag_class + +3.4.1 (13 Apr 2000) + +- homogeneous traits makeFT_ is now make_FT again + bug was caused by s/_FT/FT_/ ;) + +3.4 (07 Apr 2000) + +- included before for + #if ((__GNUC__ == 2) && (__GNUC_MINOR__ == 95)) +- Old_style_tag added to representation_tags.h + +3.3.1 (31 Mar 2000) + +- added Counterclockwise_in_between_2 to homogeneous traits +- added CGALi::Counterclockwise_in_between + +3.3 (29 Mar 2000) + +- nested types Object_2, Object_3, Assign_2, and Assign_3 added + to homogeneous traits +- CGALi::Assign added +- compare_lexicographically_xy used instead of compare_xy in + CGALi::Compare_xy + +3.2 (28 Feb 2000) + +- since friendship is not inherited, making Handle_for a friend of + Ref_counted does not suffice to access count member in the derived + class. The referenece counted object now must provide functions + add_reference() + remove_reference() + bool is_referenced() + bool is_shared() + The Handle_for does not know anymore, where and how the counting takes + places. However, it assumes that count is initialized to 1 in default + and copy constructor. +- added to package + +3.1.1 (22 Feb 2000) + +- added + o defines Rightturn_by_Leftturn adapter + +3.1 (16 Feb 2000) + +- new Tuples derived from Ref_counted added to the <...tuple.h> files + +3.0 (14 Feb 2000) + +- CGAL/Handle_for.h added; provides classes Handle_for + and Ref_counted; see Developers' manual +- CGAL/memory.h added; defines the default allocator used by Handle_for<> +- CGAL::Object revised and simplified as suggested by Michael Seel + One level of indirection has been removed. + The code now assumes that dynamic_cast<> is supported. + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 2 . 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +2.8.4 -> 2.9 (04 Dec 99) +- long long removed from + definitions are now in new + +2.8.3 -> 2.8.4 (15 Nov 99) +- test for NULL added again and precondition check removed + Leda_like_handle in Handle.h + +2.8.2 -> 2.8.3 (29 Oct 99) +- test for NULL removed and precondition check added in class + Leda_like_handle in Handle.h +- further missing file added + +2.8.1 -> 2.8.2 (28 Oct 99) +- further missing files added + +2.8 -> 2.8.1 (28 Oct 99) +- missing file added (Object.h) + +2.7.2 -> 2.8 (28 Oct 99) +- Handle.h revised. CGAL defines handle-rep scheme analogously + to the LEDA types even if LEDA Handles are used. Names of the + classes are Leda_like_handle and Leda_like_rep. + NULL used. + +2.7.1 -> 2.7.2 (11 Oct 99) +- ENDIAN definition moved to front in CGAL/basic.h + +2.7 -> 2.7.1 (06 Oct 99) +- definitions for long added to iterator_traits_pointer_specs +- macro for old style PointCd added (new style in comment) + +2.6.2 -> 2.7 (05 Oct 99) +- iterator_traits_pointer_specs_for_cartesian_kernel.h + iterator_traits_pointer_specs_for_cartesian_quotient.h + iterator_traits_pointer_specs_for_homogeneous_kernel.h added +- include iterator_traits_pointer_specs_for_homogeneous_kernel.h + added at the end of Homogeneous.h + +2.6.1 -> 2.6.2 (14 Sep 99) +- Object was missing in package + +2.6 -> 2.6.1 (11 Sep 99) +- #include added to + + +2.5.2 -> 2.6 (10 Sep 99) +- s/Base/Object_base/g + s/_Object/Object_rep/g + in + +2.5.1 -> 2.5.2 (07 Sep 99) +- added Homogenous_tag to class Homogeneous + +2.5 -> 2.5.1 (05 Sep 99) +- renamed class Identity to Identity_transformation + +2.4.3 -> 2.5 (02 Sep 99) +- homogeneous_rep.h not generated from old source but NewKernel + +2.4.2 -> 2.4.3 (02 Sep 99) +- added id() if CGAL_USE_LEDA +- added Accessor to Homogeneous +- added Point_d to Homogeneous + +2.4.1 -> 2.4.2 (01 Sep 99) +- intermediate test version with 'kernel as traits' + + + +2.4 -> 2.4.1 (31 Aug 99) +- added Identity to Aff_transformation_tags + +2.3 -> 2.4 (19 Aug 99) +- Homogeneous revised to reflect + template CGAL::Point_2 : public R::Point_2_base + We have how in CGAL::Homogeneous, e.g., + typedef Homogeneous R; + typedef PointH2 Point_2_base; + typedef CGAL::Point_2< R > Point_2; + +2.2 -> 2.3 (04 Aug 99) +- CGAL_FRIEND_INLINE and CGAL_KERNEL_FRIEND_INLINE defined + in - still needs update for mips + +2.2 -> 2.2.1 (26 Jul 99) +- predicates/sign_of_determinant.h now includes determinant.h, if not + included yet + +2.1 -> 2.2 (26 Jul 99) +- CGAL-2.0/include/CGAL/known_bit_size_integers.h extended + for Borland and M$ Visual C++ as suggested by Dima +- determinant.h split in determinant.h and predicates/sign_of_determinant.h + essentially as suggested by Sylvain +- Circle_2 added to user_classe.h (as requested by Herve) +- _Vector_?_rft_wrapper removed from user_classe.h +- homgeneous.h: parameterization of class Homogeneous changed (in the spirit + of the implementation classes *H2 ) + #ifndef CGAL_CFG_NO_DEFAULT_TEMPLATE_ARGUMENTS + template > + #else + template + #endif + class Homogeneous + The flag is most likely redundant for the compilers supported by CGAL. + +2.0.11-> 2.1 (26 Jun 99) +- CGAL-2.0/include/CGAL/known_bit_size_integers.h extended: + (defined(__powerpc__) || defined(__powerpc) || defined(powerpc)) + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 2 . 0 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +2.0.10-> 2.0.11 (06 May 99) +- compare qualified in determinant.h + +2.0.9 -> 2.0.10 (28 Apr 99) +- flags in perfixed by CGAL_ again + +2.0.8 -> 2.0.9 (30 Mar 99) +- to_double() prefixed by CGAL:: + +2.0.7 -> 2.0.8 (30 Mar 99) +- inclusion order changed in : config first! + +2.0.6 -> 2.0.7 (29 Mar 99) +- inclusion order changed in ; and included + before (if CGAL_USE_LEDA defined). + +2.0.5 -> 2.0.6 (24 Mar 99) +- dirty hack for making g++-2.8.1 happy with function template for + identical() + +2.0.4 -> 2.0.5 (20 Mar 99) +- re-generated by new script +- flag CGAL_NO_NAMESPACE corrected in +- Orientation replaced by Sign in +- call of sign() in 'prefixed' by CGAL:: + +2.0.3 -> 2.0.4 (15 Mar 99) +- bug in Handle.h (use without LEDA) fixed (missing prefix in macro call) +- cerr and endl prefixed by std:: in + +2.0.2 -> 2.0.3 (15 Mar 99) +- static_cast(compare(..)) replaced by + static_cast(static_cast(compare(..))) in + +2.0.1 -> 2.0.2 (14 Mar 99) +- #include added to +- #include added to +- revised +- swap definition removed from ( is now included) +- sign(compare(...)) replaced by static_cast(compare(..)) in + + +2.0 -> 2.0.1 (24 Feb 99) +- CGAL_[BEGIN|END]_NAMESPACE used + +1.2.12-> 2.0 +- namespace CGAL { } introduced +- CGAL_Bounded_side reversed +- EXIT_WITH_SUCCESS added +- convert_to modified as suggested by Sylvain to ease specialisation +- convert_from_to added to +- sign_of_determinant added to + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 1 . 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +1.2.11-> 1.2.12 +- #include added to functions_on_enum.h + +1.2.10-> 1.2.11 +- new improved determinant code by Sylvain's generator +- code for det6x6 added (not tested yet) + +1.2.9 -> 1.2.10 +- authors for determinant.h updated + +1.2.8 -> 1.2.9 +- det4x4_by_formula improved as suggested by Sylvain and Olivier + +1.2.7 -> 1.2.8 +- #define CGAL_KERNEL_INLINE inline added again + +1.2.6 -> 1.2.7 +- SunPro CC does not like + #define CGAL_KERNEL_INLINE inline + undone! + +1.2.5 -> 1.2.6 +- #ifndef CGAL_CFG_NO_EXPLICIT_TEMPLATE_FUNCTION_ARGUMENT_SPECIFICATION + now encapsulates definition of CGAL_convert_to() + +1.2.4 -> 1.2.5 +- generic CGAL_convert_to() added to +- inline-policy changed in : #define CGAL_KERNEL_INLINE inline + +1.2.3 -> 1.2.4 +- added include-statements for usage without LEDA as proposed + by Sven on cgal-develop + +1.2.2 -> 1.2.3 +- definition of CGAL_opposite() in changed + +1.2.1 -> 1.2.2 +- headers in , , and + corrected + +1.2 -> 1.2.1 +- inclusion order of and + reversed in + +1.1.4 -> 1.2 +- basic_lk.h mostly integrated into basic.h; + Known size integers are now in known_bit_size_integers.h +- classes CGAL_PointCd and CGAL_PointHd declared in + homogeneous_classes.h and cartesian_classes.h . + Corresponding typedefs added to the rep classes. +- Compile-time-tags for representation classes added in new file + representation_tags.h (included in ..._rep.h files) +- Rep_tags added to CGAL_Homogeneous and CGAL_Cartesian +- Cartesian part separated into Cartesian_basic.tar.gz + (for ease of maintenance) + +1.1.3 -> 1.1.4 +- bug in Cartesian - homogeneous conversion for points fixed + +1.1.2 -> 1.1.3 +- workaround for dynamic cast bug added to Object.h + +1.1.1 -> 1.1.2 +- old assertions.h used + +1.1 -> 1.1.1 +- missing file and assertion stuff included + +1.0 -> 1.1 +- kernel_assertions.h included earlier + +0.9 -> 1.0 +- new version of Object.h +- new workaround names +- new inlining policy +- some stuff for optimization package +- Cartesian - homogeneous conversion for points diff --git a/Old_Packages/Kernel_basic/description.txt b/Old_Packages/Kernel_basic/description.txt new file mode 100644 index 00000000000..eb57be1649e --- /dev/null +++ b/Old_Packages/Kernel_basic/description.txt @@ -0,0 +1 @@ +basic kernel stuff (config and relatives excluded) diff --git a/Old_Packages/Kernel_basic/include/CGAL/Fourtuple.h b/Old_Packages/Kernel_basic/include/CGAL/Fourtuple.h new file mode 100644 index 00000000000..632d01ad4b7 --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/Fourtuple.h @@ -0,0 +1,70 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : Tuples.fw +// file : Fourtuple.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL__FOURTUPLE_H +#define CGAL__FOURTUPLE_H + +CGAL_BEGIN_NAMESPACE + +template < class T > +class _Fourtuple : public Rep +{ +public: + T e0; + T e1; + T e2; + T e3; + + _Fourtuple() + {} + _Fourtuple(const T & a0, const T & a1, const T & a2, const T & a3) + : e0(a0), e1(a1), e2(a2), e3(a3) + {} + + ~_Fourtuple() + {} +}; + +template < class T > +class Fourtuple : public Ref_counted +{ +public: + T e0; + T e1; + T e2; + T e3; + + Fourtuple() + {} + + Fourtuple(const T & a0, const T & a1, const T & a2, const T & a3) + : e0(a0), e1(a1), e2(a2), e3(a3) + {} + +}; + +CGAL_END_NAMESPACE + +#endif // CGAL__FOURTUPLE_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/Handle.h b/Old_Packages/Kernel_basic/include/CGAL/Handle.h new file mode 100644 index 00000000000..117db545748 --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/Handle.h @@ -0,0 +1,119 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : Handle.fw +// file : Handle.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_HANDLE_H +#define CGAL_HANDLE_H +#include + +CGAL_BEGIN_NAMESPACE + +class Leda_like_rep +{ + friend class Leda_like_handle; + protected: + Leda_like_rep() { count = 1; } + virtual ~Leda_like_rep() {} + + int count; +}; + +class Leda_like_handle +{ + public: + Leda_like_handle() + { PTR = (Leda_like_rep*)NULL; } + // { PTR = (Leda_like_rep*)0xefefefef; } + + Leda_like_handle(const Leda_like_handle& x) + { + CGAL_kernel_precondition( x.PTR != (Leda_like_rep*)NULL ); + PTR = x.PTR; + PTR->count++; + } + + + ~Leda_like_handle() + { if ( PTR && (--PTR->count == 0)) { delete PTR; } } + + Leda_like_handle& + operator=(const Leda_like_handle& x) + { + CGAL_kernel_precondition( x.PTR != (Leda_like_rep*)NULL ); + x.PTR->count++; + if ( PTR && (--PTR->count == 0)) { delete PTR; } + PTR = x.PTR; + return *this; + } + + + int + refs() const { return PTR->count; } + + friend unsigned long id(const Leda_like_handle& x); + + protected: + Leda_like_rep* PTR; +}; + +inline +unsigned long +id(const Leda_like_handle& x) +{ return (unsigned long)x.PTR; } + +template < class T > +inline +bool +identical(const T &t1, const T &t2) +{ return id(t1) == id(t2); } +CGAL_END_NAMESPACE + + +#if defined(CGAL_USE_LEDA) && !defined(CGAL_NO_LEDA_HANDLE) +# include + +CGAL_BEGIN_NAMESPACE + +typedef handle_base Handle; +typedef handle_rep Rep; + +inline +unsigned long +id(const Handle& x) +{ return ID_Number(x); } +CGAL_END_NAMESPACE + + +# else + +CGAL_BEGIN_NAMESPACE + +typedef Leda_like_handle Handle; +typedef Leda_like_rep Rep; +CGAL_END_NAMESPACE + + +#endif // defined(CGAL_USE_LEDA) && !defined(CGAL_NO_LEDA_HANDLE) +#endif // CGAL_HANDLE_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/Handle_for.h b/Old_Packages/Kernel_basic/include/CGAL/Handle_for.h new file mode 100644 index 00000000000..65c499b78f5 --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/Handle_for.h @@ -0,0 +1,151 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : Handle_for.fw +// file : Handle_for.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_HANDLE_FOR_H +#define CGAL_HANDLE_FOR_H +#include + +namespace CGAL { + + +template class Handle_for; +class Object; + + +class Ref_counted +{ + public: + Ref_counted() : count(1) {} + Ref_counted(const Ref_counted&) : count(1) {} + + void add_reference() { ++count; } + void remove_reference() { --count; } + bool is_referenced() { return (count != 0); } + bool is_shared() { return (count > 1); } + + friend class Object; + + protected: + unsigned int count; +}; + + +template +// RefCounted must provide +// add_reference() +// remove_reference() +// bool is_referenced() +// bool is_shared() +// and initialize count to 1 in default and copy constructor +class Handle_for +{ + public: + + typedef RefCounted element_type; + + Handle_for(const RefCounted& rc) + { + ptr = allocator.allocate(1); + allocator.construct(ptr, rc); + } + + Handle_for() + { + ptr = allocator.allocate(1); + } + + Handle_for( const Handle_for& h) + { + ptr = h.ptr; + ptr->add_reference(); + } + + ~Handle_for() + { + ptr->remove_reference(); + if ( !ptr->is_referenced() ) + { + allocator.destroy( ptr); + allocator.deallocate( ptr, 1); + } + } + + Handle_for& + operator=( const Handle_for& h) + { + h.ptr->add_reference(); + ptr->remove_reference(); + if ( !ptr->is_referenced() ) + { + allocator.destroy( ptr); + allocator.deallocate( ptr, 1); + } + ptr = h.ptr; + return *this; + } + + void + initialize_with( const RefCounted& rc) + { + allocator.construct(ptr, rc); + } + + void + copy_on_write() + { + if ( ptr->is_shared() ) + { + RefCounted* tmp_ptr = allocator.allocate(1); + allocator.construct( tmp_ptr, *ptr); + ptr->remove_reference(); + ptr = tmp_ptr; + } + } + + bool + identical( const Handle_for& h) const + { return ptr == h.ptr; } + + long int + id() const + { return reinterpret_cast( &(*ptr)); } + + const typename Allocator::pointer + Ptr() const + { return ptr; } + + protected: + static Allocator allocator; + typename Allocator::pointer ptr; +}; + + +template +Allocator Handle_for::allocator; + +} // namespace CGAL +#endif // CGAL_HANDLE_FOR_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/Homogeneous.h b/Old_Packages/Kernel_basic/include/CGAL/Homogeneous.h new file mode 100644 index 00000000000..ce613690730 --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/Homogeneous.h @@ -0,0 +1,51 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : Homogeneous.fw +// file : Homogeneous.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_HOMOGENEOUS_H +#define CGAL_HOMOGENEOUS_H + +#ifndef CGAL_BASIC_H +#include +#endif // CGAL_BASIC_H +#ifndef CGAL_QUOTIENT_H +#include +#endif // CGAL_QUOTIENT_H +#ifndef CGAL_USER_CLASSES_H +#include +#endif // CGAL_USER_CLASSES_H +#ifndef CGAL_HOMOGENEOUS_CLASSES_H +#include +#endif // CGAL_HOMOGENEOUS_CLASSES_H +#ifndef CGAL_HOMOGENEOUS_REP_H +#include +#endif // CGAL_HOMOGENEOUS_REP_H +#ifndef CGAL_BASIC_CLASSES_H +#include +#endif // CGAL_BASIC_CLASSES_H + +#include + +#endif // CGAL_HOMOGENEOUS_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/Kernel/function_objects.h b/Old_Packages/Kernel_basic/include/CGAL/Kernel/function_objects.h new file mode 100644 index 00000000000..b90cae3e9df --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/Kernel/function_objects.h @@ -0,0 +1,885 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// release : +// release_date : 2000, December 10 +// +// source : for_function_objects.lw +// file : include/CGAL/Kernel/function_objects.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Stefan Schirra +// +// coordinator : MPI, Saarbruecken +// ====================================================================== + +#ifndef CGAL_KERNEL_FUNCTION_OBJECTS_H +#define CGAL_KERNEL_FUNCTION_OBJECTS_H + +CGAL_BEGIN_NAMESPACE +namespace CGALi { + +template +class Construct +{ + public: + typedef ToBeConstructed result_type; + + ToBeConstructed + operator()() const + { return ToBeConstructed(); } + + template + ToBeConstructed + operator()( const A1& a1) const + { return ToBeConstructed(a1); } + + template + ToBeConstructed + operator()( const A1& a1, const A2& a2) const + { return ToBeConstructed(a1,a2); } + + template + ToBeConstructed + operator()( const A1& a1, const A2& a2, const A3& a3) const + { return ToBeConstructed(a1,a2,a3); } + + template + ToBeConstructed + operator()( const A1& a1, const A2& a2, const A3& a3, const A4& a4) const + { return ToBeConstructed(a1,a2,a3,a4); } + + template + ToBeConstructed + operator()( const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5) const + { return ToBeConstructed(a1,a2,a3,a4,a5); } + + template + ToBeConstructed + operator()( const A& a1, const A& a2, const A& a3, + const A& a4, const A& a5, const A& a6 ) + { return ToBeConstructed(a1,a2,a3,a4,a5,a6); } + + template + ToBeConstructed + operator()( const A& a1, const A& a2, const A& a3, + const A& a4, const A& a5, const A& a6, + const A& a7 ) + { return ToBeConstructed(a1,a2,a3,a4,a5,a6,a7); } + + template + ToBeConstructed + operator()( const A& a1, const A& a2, const A& a3, + const A& a4, const A& a5, const A& a6, + const A& a7, const A& a8, const A& a9) + { return ToBeConstructed(a1,a2,a3,a4,a5,a6,a7,a8,a9); } + + template + ToBeConstructed + operator()( const A& a1, const A& a2, const A& a3, + const A& a4, const A& a5, const A& a6, + const A& a7, const A& a8, const A& a9, + const A& a10) + { return ToBeConstructed(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10); } + + template + ToBeConstructed + operator()( const A& a1, const A& a2, const A& a3, + const A& a4, const A& a5, const A& a6, + const A& a7, const A& a8, const A& a9, + const A& a10,const A& a11,const A& a12) + { return ToBeConstructed(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12); } + + template + ToBeConstructed + operator()( const A& a1, const A& a2, const A& a3, + const A& a4, const A& a5, const A& a6, + const A& a7, const A& a8, const A& a9, + const A& a10,const A& a11,const A& a12, + const A& a13) + { return ToBeConstructed(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13); } + +}; + + +template +class Call_point_to_get +{ + public: + typedef ReturnType result_type; + + template + ReturnType + operator()( const Cls& c) const + { return c.point(); } + + template + ReturnType + operator()( const Cls& c, int i) const + { return c.point(i); } +}; +template +class Call_second_point_to_get +{ + public: + typedef ReturnType result_type; + + template + ReturnType + operator()( const Cls& c) const + { return c.second_point(); } +}; +template +class Call_perpendicular_to_get +{ + public: + typedef ReturnType result_type; + + template + ReturnType + operator()( const Cls& c) const + { return c.perpendicular(); } + + template + ReturnType + operator()( const Cls& c, const A1& a1) const + { return c.perpendicular(a1); } +}; + +template +class Call_perpendicular_plane_to_get +{ + public: + typedef ReturnType result_type; + + template + ReturnType + operator()( const Cls& c, const A1& a1) const + { return c.perpendicular_plane(a1); } +}; + +template +class p_Midpoint +{ + public: + typedef Point result_type; + + Point + operator()(const Point& p, const Point& q) const { return midpoint(p,q); } +}; +template +class p_Circumcenter +{ + public: + typedef Point result_type; + + Point + operator()(const Point& p, const Point& q, const Point& r) const + { return circumcenter(p,q,r); } + + Point + operator()(const Point& p, const Point& q, + const Point& r, const Point& s) const + { return circumcenter(p,q,r,s); } +}; +template +class pl_Bisector +{ + public: + typedef Line result_type; + + Line + operator()(const Point& p, const Point& q) const { return bisector(p,q); } +}; +class Intersect +{ + public: + typedef CGAL::Object result_type; + + template + CGAL::Object + operator()(const T1& t1, const T2& t2) const + { return intersection( t1, t2); } +}; +class Assign +{ + public: + typedef bool result_type; + + template + bool + operator()(T1& t1, const CGAL::Object& o) const + { return assign( t1, o); } +}; +template +class Call_y_at_x_to_get +{ + public: + typedef ReturnType result_type; + + template + ReturnType + operator()( const Cls& c, const ReturnType& x) const + { return c.y_at_x(x); } +}; +template +class Call_x_at_y_to_get +{ + public: + typedef ReturnType result_type; + + template + ReturnType + operator()( const Cls& c, const ReturnType& x) const + { return c.x_at_y(x); } +}; +template +class Call_squared_length_to_get +{ + public: + typedef ReturnType result_type; + + template + ReturnType + operator()( const Cls& c) const + { return c.squared_length(); } +}; +class Counterclockwise_in_between +{ + public: + typedef bool result_type; + + template + bool + operator()(const T& p, const T& q, const T& r) const + { return p.counterclockwise_in_between(q,r); } +}; + + +class Collinear +{ + public: + typedef bool result_type; + + template + bool + operator()(const T& p, const T& q, const T& r) const + { return collinear(p,q,r); } +}; + +class Coplanar +{ + public: + typedef bool result_type; + + template + bool + operator()(const T& p, const T& q, const T& r, const T& s) const + { return coplanar(p,q,r,s); } +}; + +class Coplanar_orientation +{ + public: + typedef Orientation result_type; + + template + Orientation + operator()(const P& p, const P& q, const P& r, const P& s) const + { return coplanar_orientation(p,q,r,s); } + + template + Orientation + operator()(const P& p, const P& q, const P& r, const V& v) const + { return coplanar_orientation(p,q,r,v); } +}; + + +class Side_of_oriented_circle +{ + public: + typedef Oriented_side result_type; + + template + Oriented_side + operator()(const T& p, const T& q, const T& r, const T& t) const + { return side_of_oriented_circle(p,q,r,t); } +}; + +class Side_of_bounded_circle +{ + public: + typedef Bounded_side result_type; + + template + Bounded_side + operator()(const T& p, const T& q, const T& r, const T& t) const + { return side_of_bounded_circle(p,q,r,t); } +}; +class Side_of_oriented_sphere +{ + public: + typedef Oriented_side result_type; + + template + Oriented_side + operator()(const T& p, const T& q, const T& r, const T& s, const T& t) const + { return side_of_oriented_sphere(p,q,r,s,t); } +}; + +class Side_of_bounded_sphere +{ + public: + typedef Bounded_side result_type; + + template + Bounded_side + operator()(const T& p, const T& q, const T& r, const T& s, const T& t) const + { return side_of_bounded_sphere(p,q,r,s,t); } +}; +class Call_is_horizontal +{ + public: + typedef bool result_type; + + template + bool + operator()( const Cls& c) const + { return c.is_horizontal(); } +}; + +class Call_is_vertical +{ + public: + typedef bool result_type; + + template + bool + operator()( const Cls& c) const + { return c.is_vertical(); } +}; +class Call_is_degenerate +{ + public: + typedef bool result_type; + + template + bool + operator()( const Cls& c) const + { return c.is_degenerate(); } +}; +class Call_has_on_bounded_side +{ + public: + typedef bool result_type; + + template + bool + operator()( const Cls& c, const Arg& a) const + { return c.has_on_bounded_side(a); } +}; + +class Call_has_on_unbounded_side +{ + public: + typedef bool result_type; + + template + bool + operator()( const Cls& c, const Arg& a) const + { return c.has_on_unbounded_side(a); } +}; + +class Call_has_on_boundary +{ + public: + typedef bool result_type; + + template + bool + operator()( const Cls& c, const Arg& a) const + { return c.has_on_boundary(a); } +}; + +class Call_has_on_positive_side +{ + public: + typedef bool result_type; + + template + bool + operator()( const Cls& c, const Arg& a) const + { return c.has_on_positive_side(a); } +}; + +class Call_has_on_negative_side +{ + public: + typedef bool result_type; + + template + bool + operator()( const Cls& c, const Arg& a) const + { return c.has_on_negative_side(a); } +}; + +class Call_oriented_side +{ + public: + typedef bool result_type; + + template + Oriented_side + operator()( const Cls& c, const Arg& a) const + { return c.oriented_side(a); } +}; +class Less_x +{ + public: + typedef bool result_type; + + template + bool + operator()( const T1& a1, const T2& a2) const + { return less_x(a1,a2); } +}; + +class Less_y +{ + public: + typedef bool result_type; + + template + bool + operator()( const T1& a1, const T2& a2) const + { return less_y(a1,a2); } +}; + +class Less_z +{ + public: + typedef bool result_type; + + template + bool + operator()( const T1& a1, const T2& a2) const + { return less_y(a1,a2); } +}; + +class Less_xy +{ + public: + typedef bool result_type; + + template + bool + operator()( const T1& a1, const T2& a2) const + { return lexicographically_xy_smaller(a1,a2); } +}; + +class Less_yx +{ + public: + typedef bool result_type; + + template + bool + operator()( const T1& a1, const T2& a2) const + { return lexicographically_yx_smaller(a1,a2); } +}; + +class Less_xyz +{ + public: + typedef bool result_type; + + template + bool + operator()( const T1& a1, const T2& a2) const + { return lexicographically_xyz_smaller(a1,a2); } +}; + +class Equal +{ + public: + typedef bool result_type; + + template + bool + operator()(const T1& p, const T2& q) const + { return p == q; } +}; + +class Equal_x +{ + public: + typedef bool result_type; + + template + bool + operator()( const T1& a1, const T2& a2) const + { return x_equal(a1,a2); } +}; + +class Equal_y +{ + public: + typedef bool result_type; + + template + bool + operator()( const T1& a1, const T2& a2) const + { return y_equal(a1,a2); } +}; + +class Equal_z +{ + public: + typedef bool result_type; + + template + bool + operator()( const T1& a1, const T2& a2) const + { return z_equal(a1,a2); } +}; + +class Equal_xy +{ + public: + typedef bool result_type; + + template + bool + operator()( const T1& a1, const T2& a2) const + { return equal_xy(a1,a2); } +}; + +class Equal_xyz +{ + public: + typedef bool result_type; + + template + bool + operator()( const T1& a1, const T2& a2) const + { return equal_xyz(a1,a2); } +}; +class Compare_x +{ + public: + typedef Comparison_result result_type; + + template + Comparison_result + operator()( const T1& a1, const T2& a2) const + { return compare_x(a1,a2); } + + template + Comparison_result + operator()( const T1& a1, const T2& a2, const T3& a3) const + { return compare_x(a1,a2,a3); } + + template + Comparison_result + operator()( const T1& a1, const T2& a2, const T3& a3, const T4& a4) const + { return compare_x(a1,a2,a3,a4); } + +}; + +class Compare_y +{ + public: + typedef Comparison_result result_type; + + template + Comparison_result + operator()( const T1& a1, const T2& a2) const + { return compare_y(a1,a2); } + + template + Comparison_result + operator()( const T1& a1, const T2& a2, const T3& a3) const + { return compare_y(a1,a2,a3); } + + template + Comparison_result + operator()( const T1& a1, const T2& a2, const T3& a3, const T4& a4) const + { return compare_y(a1,a2,a3,a4); } + + +}; + +class Compare_z +{ + public: + typedef Comparison_result result_type; + + template + Comparison_result + operator()( const T1& a1, const T2& a2) const + { return compare_z(a1,a2); } +}; + +class Compare_xy +{ + public: + typedef Comparison_result result_type; + + template + Comparison_result + operator()( const T1& a1, const T2& a2) const + { return compare_lexicographically_xy(a1,a2); } +}; + +class Compare_xyz +{ + public: + typedef Comparison_result result_type; + + template + Comparison_result + operator()( const T1& a1, const T2& a2) const + { return compare_lexicographically_xyz(a1,a2); } +}; + +class Compare_y_at_x +{ + public: + typedef Comparison_result result_type; + + template + Comparison_result + operator()( const T1& a1, const T2& a2) const + { return compare_y_at_x(a1,a2); } + + template + Comparison_result + operator()( const T1& a1, const T2& a2, const T3& a3) const + { return compare_y_at_x(a1,a2,a3); } + + template + Comparison_result + operator()( const T1& a1, const T2& a2, const T3& a3, const T4& a4) const + { return compare_y_at_x(a1,a2,a3,a4); } +}; + +class Compare_x_at_y +{ + public: + typedef Comparison_result result_type; + + template + Comparison_result + operator()( const T1& a1, const T2& a2) const + { return compare_x_at_y(a1,a2); } + + template + Comparison_result + operator()( const T1& a1, const T2& a2, const T3& a3) const + { return compare_x_at_y(a1,a2,a3); } + + template + Comparison_result + operator()( const T1& a1, const T2& a2, const T3& a3, const T4& a4) const + { return compare_x_at_y(a1,a2,a3,a4); } +}; + +template +class Compare_distance_to_point +{ + public: + typedef Comparison_result result_type; + + Compare_distance_to_point(const T& cp) : p(cp) {} + + Comparison_result + operator()(const T& q, const T& r) const + { return cmp_dist_to_point(p,q,r); } + + T p; +}; + + +class Are_ordered_along_line +{ + public: + typedef bool result_type; + + template + bool + operator()(const T& p, const T& q, const T& r) const + { return are_ordered_along_line(p,q,r); } +}; + +class Are_strictly_ordered_along_line +{ + public: + typedef bool result_type; + + template + bool + operator()(const T& p, const T& q, const T& r) const + { return are_strictly_ordered_along_line(p,q,r); } +}; + +class Collinear_are_ordered_along_line +{ + public: + typedef bool result_type; + + template + bool + operator()(const T& p, const T& q, const T& r) const + { return collinear_are_ordered_along_line(p,q,r); } +}; + +class Collinear_are_strictly_ordered_along_line +{ + public: + typedef bool result_type; + + template + bool + operator()(const T& p, const T& q, const T& r) const + { return collinear_are_strictly_ordered_along_line(p,q,r); } +}; +class Call_transform +{ + public: + template + ArgumentType + operator()( const ArgumentType& a, const Transformation& t) + { return a.transform(t); } +}; +template +class Call_source_to_get +{ + public: + typedef ReturnType result_type; + + template + ReturnType + operator()( const Cls& c) const + { return c.source(); } +}; + +template +class Call_target_to_get +{ + public: + typedef ReturnType result_type; + + template + ReturnType + operator()( const Cls& c) const + { return c.target(); } +}; + +template +class Call_min_to_get +{ + public: + typedef ReturnType result_type; + + template + ReturnType + operator()( const Cls& c) const + { return c.min(); } +}; + +template +class Call_max_to_get +{ + public: + typedef ReturnType result_type; + + template + ReturnType + operator()( const Cls& c) const + { return c.max(); } +}; + +template +class Call_direction_to_get +{ + public: + typedef ReturnType result_type; + + template + ReturnType + operator()( const Cls& c) const + { return c.direction(); } +}; + +template +class Call_supporting_line_to_get +{ + public: + typedef ReturnType result_type; + + template + ReturnType + operator()( const Cls& c) const + { return c.supporting_line(); } +}; + +template +class Call_supporting_plane_to_get +{ + public: + typedef ReturnType result_type; + + template + ReturnType + operator()( const Cls& c) const + { return c.supporting_plane(); } +}; + +template +class Call_opposite_to_get +{ + public: + typedef ReturnType result_type; + + template + ReturnType + operator()( const Cls& c) const + { return c.opposite(); } +}; + +class Call_has_on +{ + public: + typedef bool result_type; + + template + bool + operator()( const Cls& c, const A1& a1) const + { return c.has_on(a1); } +}; + +class Call_collinear_has_on +{ + public: + typedef bool result_type; + + template + bool + operator()( const Cls& c, const A1& a1) const + { return c.collinear_has_on(a1); } +}; + + + +} // end namespace CGALi +CGAL_END_NAMESPACE + +#endif // CGAL_KERNEL_FUNCTION_OBJECTS_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/Kernel/traits_aids.h b/Old_Packages/Kernel_basic/include/CGAL/Kernel/traits_aids.h new file mode 100644 index 00000000000..32949668b20 --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/Kernel/traits_aids.h @@ -0,0 +1,60 @@ +// ====================================================================== +// +// Copyright (c) 2000 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// release : +// release_date : 2000, December 10 +// +// source : Traits_helpers.lw +// file : include/CGAL/Kernel/traits_aids.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 0.95 +// revision_date : 22 Feb 2000 +// author(s) : Stefan Schirra +// +// coordinator : MPI, Saarbruecken +// ====================================================================== + +#ifndef CGAL_KERNEL_TRAITS_AIDS_H +#define CGAL_KERNEL_TRAITS_AIDS_H + +namespace CGAL { + +template +class Rightturn_by_leftturn +{ + public: + Rightturn_by_leftturn(const Leftturn& l) : leftturn(l) {} + + template + bool + operator()(const Point& p, const Point& q, const Point& r) const + { return leftturn( q, p, r); } + + private: + Leftturn leftturn; +}; +template +class Invert_binary +{ + public: + Invert_binary(const BinaryPredicate& p) : pred(p) {} + + template + bool + operator()(const Arg1& a1, const Arg2& a2) + { return !pred(a1,a2); } + + protected: + BinaryPredicate pred; +}; + +} // namespace CGAL + +#endif // CGAL_KERNEL_TRAITS_AIDS_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/No_op_allocator.h b/Old_Packages/Kernel_basic/include/CGAL/No_op_allocator.h new file mode 100644 index 00000000000..aa2a29516a3 --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/No_op_allocator.h @@ -0,0 +1,80 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : No_op_allocator.fw +// file : No_op_allocator.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Lutz Kettner +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_NO_OP_ALLOCATOR_H +#define CGAL_NO_OP_ALLOCATOR_H + +template +class No_op_allocator +{ + public: + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef T value_type; + typedef T* pointer; + typedef const T* const_pointer; + typedef T& reference; + typedef const T& const_reference; + + + No_op_allocator() : Don_t_call(true) {} + + pointer + allocate(size_type n, const_pointer = 0) { return static_cast(0); } + + void + deallocate(pointer p, size_type n) {} + + pointer + address(reference r) + { CGAL_precondition ( !Don_t_call ); return static_cast(0); } + + const_pointer + address(const_reference r) + { CGAL_precondition ( !Don_t_call ); return static_cast(0); } + + void + construct(pointer p, const_reference r) + { CGAL_precondition ( !Don_t_call ); } + // It is the user responsibility to construct + // the element, e.g. using new + + void + destroy(pointer p) + { delete p; } + // p should have an appropriate type + // That's why we need the parameterization + // T should have a virtual destructor + + size_type + max_size() const + { return 0; } + + private: + bool Don_t_call; +}; + +#endif // CGAL_NO_OP_ALLOCATOR_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/Object.h b/Old_Packages/Kernel_basic/include/CGAL/Object.h new file mode 100644 index 00000000000..129f2df8f53 --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/Object.h @@ -0,0 +1,128 @@ +// ====================================================================== +// +// Copyright (c) 2000 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// file : include/CGAL/Object.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// source : Object.lw +// revision : 3.0 +// revision_date : 02 Feb 2000 +// author(s) : Stefan.Schirra +// Andreas Fabri +// Geert-Jan Giezeman +// Michael Seel +// +// coordinator : MPI Saarbruecken, Germany +// +// ====================================================================== + +#ifndef CGAL_OBJECT_H +#define CGAL_OBJECT_H + +#ifdef CGAL_CFG_NO_DYNAMIC_CAST +#error fatal error: dynamic cast not supported +#endif // CGAL_CFG_NO_DYNAMIC_CAST + +#include + +namespace CGAL { + +class Object; +class Object_base; +template class Wrapper; + + +class Object_base : public Ref_counted +{ + public: + virtual ~Object_base() {} +}; + + +template +class Wrapper : public Object_base +{ + public: + Wrapper(const T& object) : _object(object) {} + + Wrapper() {} + + operator T() { return _object; } + + virtual ~Wrapper() {} + + private: + T _object; +}; + + +class Object +{ + public: + Object() : ptr( static_cast(0) ) {} + + Object(Object_base *base) + { + ptr = base; + CGAL_kernel_assertion( !ptr || (ptr->count == 1)); + } + + Object(const Object& o) : ptr(o.ptr) + { if (ptr) ptr->count++; } + + ~Object() + { if (ptr && (--ptr->count == 0)) { delete ptr; } } + + Object& + operator=(const Object& o) + { + if (o.ptr) o.ptr->count++; + if (ptr && (--ptr->count == 0)) { delete ptr; } + ptr = o.ptr; + return *this; + } + + bool + is_empty() const { return ptr == static_cast(0); } + + template + friend bool assign(T& t, const Object& o); + + protected: + Object_base* ptr; +}; + + +template +Object +make_object(const T& t) +{ return Object(new Wrapper< T >(t)); } + + +template +bool +assign(T& t, const Object& o) +{ +# ifdef CGAL_CFG_DYNAMIC_CAST_BUG + Wrapper instantiate_it; +# endif // CGAL_CFG_DYNAMIC_CAST_BUG + Wrapper* wp = dynamic_cast*>(o.ptr); + if ( wp == static_cast*>(0) ) { return false; } + t = *(wp); + return true; +} + +} // namespace CGAL + +#endif // CGAL_OBJECT_H + diff --git a/Old_Packages/Kernel_basic/include/CGAL/Origin.h b/Old_Packages/Kernel_basic/include/CGAL/Origin.h new file mode 100644 index 00000000000..a27194c203b --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/Origin.h @@ -0,0 +1,47 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : Origin.fw +// file : Origin.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_ORIGIN_H +#define CGAL_ORIGIN_H + +#ifndef CGAL_CONFIG_H +#include +#endif // CGAL_CONFIG_H + +CGAL_BEGIN_NAMESPACE + +class Origin +{}; + +extern Origin ORIGIN; + +class Null_vector +{}; + +extern Null_vector NULL_VECTOR; +CGAL_END_NAMESPACE + +#endif // CGAL_ORIGIN_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/Sixtuple.h b/Old_Packages/Kernel_basic/include/CGAL/Sixtuple.h new file mode 100644 index 00000000000..642e42ba8d8 --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/Sixtuple.h @@ -0,0 +1,78 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : Tuples.fw +// file : Sixtuple.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL__SIXTUPLE_H +#define CGAL__SIXTUPLE_H + +CGAL_BEGIN_NAMESPACE + +template < class T > +class _Sixtuple : public Rep +{ +public: + + T e0; + T e1; + T e2; + T e3; + T e4; + T e5; + + _Sixtuple() + { + } + _Sixtuple(const T & a0, const T & a1, const T & a2, + const T & a3, const T & a4, const T & a5) + : e0(a0), e1(a1), e2(a2), e3(a3), e4(a4), e5(a5) + {} + + ~_Sixtuple() + {} +}; + +template < class T > +class Sixtuple : public Ref_counted +{ +public: + + T e0; + T e1; + T e2; + T e3; + T e4; + T e5; + + Sixtuple() + {} + + Sixtuple(const T & a0, const T & a1, const T & a2, + const T & a3, const T & a4, const T & a5) + : e0(a0), e1(a1), e2(a2), e3(a3), e4(a4), e5(a5) + {} +}; + +CGAL_END_NAMESPACE + +#endif // CGAL__SIXTUPLE_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/Threetuple.h b/Old_Packages/Kernel_basic/include/CGAL/Threetuple.h new file mode 100644 index 00000000000..dad793568a1 --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/Threetuple.h @@ -0,0 +1,68 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : Tuple.fw +// file : Threetuple.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL__THREETUPLE_H +#define CGAL__THREETUPLE_H + +CGAL_BEGIN_NAMESPACE + +template < class T > +class _Threetuple : public Rep +{ +public: + + T e0; + T e1; + T e2; + + _Threetuple() + {} + + _Threetuple(const T & a0, const T & a1, const T & a2) + : e0(a0), e1(a1), e2(a2) + {} + + ~_Threetuple() + {} +}; + +template < class T > +struct Threetuple : public Ref_counted +{ + T e0; + T e1; + T e2; + + Threetuple() + {} + + Threetuple(const T & a0, const T & a1, const T & a2) + : e0(a0), e1(a1), e2(a2) + {} +}; + +CGAL_END_NAMESPACE + +#endif // CGAL__THREETUPLE_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/Twotuple.h b/Old_Packages/Kernel_basic/include/CGAL/Twotuple.h new file mode 100644 index 00000000000..a06ba5e4d16 --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/Twotuple.h @@ -0,0 +1,65 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : Tuple.fw +// file : Twotuple.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL__TWOTUPLE_H +#define CGAL__TWOTUPLE_H + +CGAL_BEGIN_NAMESPACE + +template < class T > +class _Twotuple : public Rep +{ +public: + T e0; + T e1; + + _Twotuple() + {} + + _Twotuple(const T & a0, const T &a1) + : e0(a0), e1(a1) + {} + + ~_Twotuple() + {} +}; + +template < class T > +class Twotuple : public Ref_counted +{ +public: + T e0; + T e1; + + Twotuple() + {} + + Twotuple(const T & a0, const T &a1) : e0(a0), e1(a1) + {} +}; + +CGAL_END_NAMESPACE + +#endif // CGAL__TWOTUPLE_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/aff_transformation_tags.h b/Old_Packages/Kernel_basic/include/CGAL/aff_transformation_tags.h new file mode 100644 index 00000000000..30b73582b05 --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/aff_transformation_tags.h @@ -0,0 +1,49 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : aff_transformation_tags.fw +// file : aff_transformation_tags.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_AFF_TRANSFORMATION_TAGS_H +#define CGAL_AFF_TRANSFORMATION_TAGS_H + +#ifndef CGAL_CONFIG_H +#include +#endif // CGAL_CONFIG_H + +CGAL_BEGIN_NAMESPACE + +class Translation {}; +class Rotation {}; +class Scaling {}; +class Reflection {}; +class Identity_transformation {}; + +extern Translation TRANSLATION; +extern Rotation ROTATION; +extern Scaling SCALING; +extern Reflection REFLECTION; +extern Identity_transformation IDENTITY; + +CGAL_END_NAMESPACE + +#endif // CGAL_AFF_TRANSFORMATION_TAGS_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/assertions.h b/Old_Packages/Kernel_basic/include/CGAL/assertions.h new file mode 100644 index 00000000000..9b498e81a13 --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/assertions.h @@ -0,0 +1,320 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// file : CGAL/assertions.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// source : +// author(s) : Geert-Jan Giezeman and Sven Schönherr +// +// coordinator : MPI, Saarbruecken +// +// ====================================================================== + +#ifndef CGAL_CONFIG_H +#include +#endif // CGAL_CONFIG_H + +#ifndef CGAL_ASSERTIONS_H +#define CGAL_ASSERTIONS_H + +CGAL_BEGIN_NAMESPACE + +// types +// ===== + +enum Failure_behaviour { ABORT, EXIT, EXIT_WITH_SUCCESS, CONTINUE }; + +// function declarations +// ===================== +// failure functions +// ----------------- +void assertion_fail ( const char*, const char*, int, const char*); +void precondition_fail ( const char*, const char*, int, const char*); +void postcondition_fail ( const char*, const char*, int, const char*); + +// warning function +// ---------------- +void warning_fail( const char*, const char*, int, const char*); + + +// macro definitions +// ================= +// assertions +// ---------- + + +#if defined(CGAL_KERNEL_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ + || defined(NDEBUG) +# define CGAL_assertion(EX) ((void)0) +# define CGAL_assertion_msg(EX,MSG) ((void)0) +# define CGAL_assertion_code(CODE) +#else +# define CGAL_assertion(EX) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_assertion_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_assertion_code(CODE) CODE +#endif // CGAL_KERNEL_NO_ASSERTIONS + +#if defined(CGAL_KERNEL_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || defined(NDEBUG) +# define CGAL_exactness_assertion(EX) ((void)0) +# define CGAL_exactness_assertion_msg(EX,MSG) ((void)0) +# define CGAL_exactness_assertion_code(CODE) +#else +# define CGAL_exactness_assertion(EX) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_exactness_assertion_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_exactness_assertion_code(CODE) CODE +#endif // CGAL_KERNEL_NO_ASSERTIONS + +#if defined(CGAL_KERNEL_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\ + || defined(NDEBUG) +# define CGAL_expensive_assertion(EX) ((void)0) +# define CGAL_expensive_assertion_msg(EX,MSG) ((void)0) +# define CGAL_expensive_assertion_code(CODE) +#else +# define CGAL_expensive_assertion(EX) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_expensive_assertion_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_expensive_assertion_code(CODE) CODE +#endif // CGAL_KERNEL_NO_ASSERTIONS + +#if defined(CGAL_KERNEL_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\ + || defined(NDEBUG) +# define CGAL_expensive_exactness_assertion(EX) ((void)0) +# define CGAL_expensive_exactness_assertion_msg(EX,MSG) ((void)0) +# define CGAL_expensive_exactness_assertion_code(CODE) +#else +# define CGAL_expensive_exactness_assertion(EX) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_expensive_exactness_assertion_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_expensive_exactness_assertion_code(CODE) CODE +#endif // CGAL_KERNEL_NO_ASSERTIONS + + +// preconditions +// ------------- + +#if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ + || defined(NDEBUG) +# define CGAL_precondition(EX) ((void)0) +# define CGAL_precondition_msg(EX,MSG) ((void)0) +# define CGAL_precondition_code(CODE) +#else +# define CGAL_precondition(EX) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_precondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_precondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_PRECONDITIONS + +#if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || defined(NDEBUG) +# define CGAL_exactness_precondition(EX) ((void)0) +# define CGAL_exactness_precondition_msg(EX,MSG) ((void)0) +# define CGAL_exactness_precondition_code(CODE) +#else +# define CGAL_exactness_precondition(EX) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_exactness_precondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_exactness_precondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_PRECONDITIONS + +#if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\ + || defined(NDEBUG) +# define CGAL_expensive_precondition(EX) ((void)0) +# define CGAL_expensive_precondition_msg(EX,MSG) ((void)0) +# define CGAL_expensive_precondition_code(CODE) +#else +# define CGAL_expensive_precondition(EX) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_expensive_precondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_expensive_precondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_PRECONDITIONS + +#if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\ + || defined(NDEBUG) +# define CGAL_expensive_exactness_precondition(EX) ((void)0) +# define CGAL_expensive_exactness_precondition_msg(EX,MSG) ((void)0) +# define CGAL_expensive_exactness_precondition_code(CODE) +#else +# define CGAL_expensive_exactness_precondition(EX) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_expensive_exactness_precondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_expensive_exactness_precondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_PRECONDITIONS + + +// postconditions +// -------------- + +#if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ + || defined(NDEBUG) +# define CGAL_postcondition(EX) ((void)0) +# define CGAL_postcondition_msg(EX,MSG) ((void)0) +# define CGAL_postcondition_code(CODE) +#else +# define CGAL_postcondition(EX) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_postcondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_postcondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_POSTCONDITIONS + +#if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || defined(NDEBUG) +# define CGAL_exactness_postcondition(EX) ((void)0) +# define CGAL_exactness_postcondition_msg(EX,MSG) ((void)0) +# define CGAL_exactness_postcondition_code(CODE) +#else +# define CGAL_exactness_postcondition(EX) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_exactness_postcondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_exactness_postcondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_POSTCONDITIONS + +#if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\ + || defined(NDEBUG) +# define CGAL_expensive_postcondition(EX) ((void)0) +# define CGAL_expensive_postcondition_msg(EX,MSG) ((void)0) +# define CGAL_expensive_postcondition_code(CODE) +#else +# define CGAL_expensive_postcondition(EX) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_expensive_postcondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_expensive_postcondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_POSTCONDITIONS + +#if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\ + || defined(NDEBUG) +# define CGAL_expensive_exactness_postcondition(EX) ((void)0) +# define CGAL_expensive_exactness_postcondition_msg(EX,MSG) ((void)0) +# define CGAL_expensive_exactness_postcondition_code(CODE) +#else +# define CGAL_expensive_exactness_postcondition(EX) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_expensive_exactness_postcondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_expensive_exactness_postcondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_POSTCONDITIONS + + +// warnings +// -------- + +#if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ + || defined(NDEBUG) +# define CGAL_warning(EX) ((void)0) +# define CGAL_warning_msg(EX,MSG) ((void)0) +# define CGAL_warning_code(CODE) +#else +# define CGAL_warning(EX) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_warning_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_warning_code(CODE) CODE +#endif // CGAL_KERNEL_NO_WARNINGS + +#if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || defined(NDEBUG) +# define CGAL_exactness_warning(EX) ((void)0) +# define CGAL_exactness_warning_msg(EX,MSG) ((void)0) +# define CGAL_exactness_warning_code(CODE) +#else +# define CGAL_exactness_warning(EX) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_exactness_warning_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_exactness_warning_code(CODE) CODE +#endif // CGAL_KERNEL_NO_WARNINGS + +#if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\ + || defined(NDEBUG) +# define CGAL_expensive_warning(EX) ((void)0) +# define CGAL_expensive_warning_msg(EX,MSG) ((void)0) +# define CGAL_expensive_warning_code(CODE) +#else +# define CGAL_expensive_warning(EX) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_expensive_warning_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_expensive_warning_code(CODE) CODE +#endif // CGAL_KERNEL_NO_WARNINGS + +#if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\ + || defined(NDEBUG) +# define CGAL_expensive_exactness_warning(EX) ((void)0) +# define CGAL_expensive_exactness_warning_msg(EX,MSG) ((void)0) +# define CGAL_expensive_exactness_warning_code(CODE) +#else +# define CGAL_expensive_exactness_warning(EX) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_expensive_exactness_warning_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_expensive_exactness_warning_code(CODE) CODE +#endif // CGAL_KERNEL_NO_WARNINGS + + +// failure handler declarations +// ========================== +// failure handler +// --------------- +typedef + void + (*Failure_function)( + const char*, const char*, const char*, int, const char*); + +Failure_function +set_error_handler( Failure_function handler); + +Failure_function +set_warning_handler( Failure_function handler); + +// failure behaviour handler +// ------------------------- +Failure_behaviour +set_error_behaviour(Failure_behaviour eb); + +Failure_behaviour +set_warning_behaviour(Failure_behaviour eb); + +CGAL_END_NAMESPACE + +#endif // CGAL_ASSERTIONS_H + diff --git a/Old_Packages/Kernel_basic/include/CGAL/basic.h b/Old_Packages/Kernel_basic/include/CGAL/basic.h new file mode 100644 index 00000000000..96b32f7679b --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/basic.h @@ -0,0 +1,191 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : basic.fw +// file : basic.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Lutz Kettner +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_BASIC_H +#define CGAL_BASIC_H + +#ifndef CGAL_CONFIG_H +# include +#endif // CGAL_CONFIG_H + +#define CGAL_NTS CGAL::NTS:: + +#if ((__GNUC__ == 2) && (__GNUC_MINOR__ == 95)) +#include +#endif // gcc 2.95 + +#include +#include + + +// Big endian or little endian machine. +// ==================================== +#ifdef CGAL_CFG_NO_BIG_ENDIAN +#define CGAL_LITTLE_ENDIAN 1 +#else +#define CGAL_BIG_ENDIAN 1 +#endif + + +#ifdef CGAL_USE_LEDA +# ifndef CGAL_PROTECT_LEDA_BASIC_H +# if ( __LEDA__ < 380 ) +# define Max leda_Max +# define Min leda_Min +# endif // __LEDA__ < 380 +# include +# if ( __LEDA__ < 380 ) +# undef Max +# undef Min +# endif // __LEDA__ < 380 +# define CGAL_PROTECT_LEDA_BASIC_H +# endif // CGAL_PROTECT_LEDA_BASIC_H +#endif // CGAL_USE_LEDA + +// CGAL uses std::min and std::max +// (see ISO C++ 25.3.7, page 562), +// if feasible +#include + +namespace CGAL { + +#if !defined(CGAL_CFG_USING_USING_BUG) && !defined(CGAL_CFG_BROKEN_USING) + + using std::min; + using std::max; + +#else + + template + inline + NT + // const NT& + min(const NT& x, const NT& y) + { return (y < x) ? y : x; } + + template + inline + NT + // const NT& + max(const NT& x, const NT& y) + { return (x < y) ? y : x; } + +#endif // CGAL_CFG_BROKEN_USING +} // namespace CGAL + + +#ifndef CGAL_ASSERTIONS_H +#include +#endif // CGAL_ASSERTIONS_H +#ifndef CGAL_KERNEL_ASSERTIONS_H +#include +#endif // CGAL_KERNEL_ASSERTIONS_H +#ifndef CGAL_HANDLE_H +#include +#endif // CGAL_HANDLE_H +#ifndef CGAL_OBJECT_H +#include +#endif // CGAL_OBJECT_H +#ifndef CGAL_ENUM_H +#include +#endif // CGAL_ENUM_H +#ifndef CGAL_TAGS_H +#include +#endif // CGAL_TAGS_H +#ifndef CGAL_MISC_H +#include +#endif // CGAL_MISC_H +#ifndef CGAL_NUMBER_TYPE_BASIC_H +#include +#endif // CGAL_NUMBER_TYPE_BASIC_H +#ifndef CGAL_IO_IO_H +#include +#endif // CGAL_IO_IO_H +#ifndef CGAL_KERNEL_BASIC_H +#include +#endif // CGAL_KERNEL_BASIC_H + +#ifndef CGAL_KNOWN_BIT_SIZE_INTEGERS_H +#include +#endif // CGAL_KNOWN_BIT_SIZE_INTEGERS_H + +CGAL_BEGIN_NAMESPACE + + +// Two struct's to denote boolean compile time decisions. +// ====================================================== +struct Tag_true {}; +struct Tag_false {}; + +inline bool check_tag( Tag_true) {return true;} +inline bool check_tag( Tag_false) {return false;} + +// A function that asserts a specific compile time tag +// forcing its two arguments to have equal type. +// It is encapsulated with #ifdef since it will be defined also elsewhere. +// ====================================================== +#ifndef CGAL_ASSERT_COMPILE_TIME_TAG +#define CGAL_ASSERT_COMPILE_TIME_TAG 1 +template +struct Assert_tag_class +{ + void match_compile_time_tag( const Base&) const {} +}; + +template +inline +void +Assert_compile_time_tag( const Tag&, const Derived& b) +{ + Assert_tag_class x; + x.match_compile_time_tag(b); +} +#endif // CGAL_ASSERT_COMPILE_TIME_TAG + +template < class T> +inline +void +assert_equal_types( const T&, const T&) {} + + + +// Symbolic constants to tailor inlining. Inlining Policy. +// ======================================================= +#ifndef CGAL_MEDIUM_INLINE +#define CGAL_MEDIUM_INLINE inline +#endif +#ifndef CGAL_LARGE_INLINE +#define CGAL_LARGE_INLINE +#endif +#ifndef CGAL_HUGE_INLINE +#define CGAL_HUGE_INLINE +#endif + +CGAL_END_NAMESPACE + + + +#endif // CGAL_BASIC_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/basic_classes.h b/Old_Packages/Kernel_basic/include/CGAL/basic_classes.h new file mode 100644 index 00000000000..43e44df1366 --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/basic_classes.h @@ -0,0 +1,36 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : user_classes.fw +// file : basic_classes.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_BASIC_CLASSES_H +#define CGAL_BASIC_CLASSES_H + +#include +#include +#include +#include +#include + +#endif // CGAL_BASIC_CLASSES_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/cartesian_homogeneous_conversion.h b/Old_Packages/Kernel_basic/include/CGAL/cartesian_homogeneous_conversion.h new file mode 100644 index 00000000000..5da7f8d1745 --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/cartesian_homogeneous_conversion.h @@ -0,0 +1,132 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : Point_conversion.fw +// file : cartesian_homogeneous_conversion.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_CARTESIAN_HOMOGENEOUS_CONVERSION_H +#define CGAL_CARTESIAN_HOMOGENEOUS_CONVERSION_H + +CGAL_BEGIN_NAMESPACE + +template +Point_2< Cartesian > +homogeneous_to_cartesian(const Point_2< Homogeneous >& hp) +{ + return + Point_2< Cartesian >(hp.hx(), hp.hy(), hp.hw() ); +} + +template +Point_2< Homogeneous > +cartesian_to_homogeneous(const Point_2< Cartesian >& cp) +{ + return + Point_2< Homogeneous >(cp.hx(), cp.hy()); +} + +template +Point_3< Cartesian > +homogeneous_to_cartesian(const Point_3< Homogeneous >& hp) +{ + return + Point_3< Cartesian >(hp.hx(), hp.hy(), hp.hz(), hp.hw() ); +} + +template +Point_3< Homogeneous > +cartesian_to_homogeneous(const Point_3< Cartesian >& cp) +{ + return + Point_3< Homogeneous >(cp.hx(), cp.hy(), cp.hz() ); +} + +template +Point_2< Cartesian > > +homogeneous_to_quotient_cartesian( + const Point_2 >& hp) +{ + typedef Quotient QT; + return Point_2< Cartesian >( QT( hp.hx(), hp.hw() ), + QT( hp.hy(), hp.hw() ) ); +} + +template +Point_2< Homogeneous > +quotient_cartesian_to_homogeneous( + const Point_2< Cartesian< Quotient > >& cp) +{ + typedef Point_2 > HPoint; + if ( cp.x().denominator() != cp.y().denominator() ) + { + return HPoint( cp.x().numerator() * cp.y().denominator(), + cp.y().numerator() * cp.x().denominator(), + cp.x().denominator()* cp.y().denominator()); + } + else + { + return HPoint( cp.x().numerator(), + cp.y().numerator(), + cp.x().denominator()); + } +} + +template +Point_3< Cartesian > > +homogeneous_to_quotient_cartesian( + const Point_3 >& hp) +{ + typedef Quotient QT; + return Point_3< Cartesian >( QT( hp.hx(), hp.hw() ), + QT( hp.hy(), hp.hw() ), + QT( hp.hz(), hp.hw() ) ); +} + +template +Point_3< Homogeneous > +quotient_cartesian_to_homogeneous( + const Point_3< Cartesian< Quotient > >& cp) +{ + typedef Point_3 > HPoint; + if ( (cp.x().denominator() != cp.y().denominator() ) + ||(cp.x().denominator() != cp.z().denominator() ) ) + { + return + HPoint(cp.x().numerator() *cp.y().denominator()*cp.z().denominator(), + cp.y().numerator() *cp.x().denominator()*cp.z().denominator(), + cp.z().numerator() *cp.x().denominator()*cp.y().denominator(), + cp.x().denominator()*cp.y().denominator()*cp.z().denominator()); + } + else + { + return HPoint( cp.x().numerator(), + cp.y().numerator(), + cp.z().numerator(), + cp.x().denominator()); + } +} + +CGAL_END_NAMESPACE + + +#endif // CGAL_CARTESIAN_HOMOGENEOUS_CONVERSION_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/determinant.h b/Old_Packages/Kernel_basic/include/CGAL/determinant.h new file mode 100644 index 00000000000..84d354fde8f --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/determinant.h @@ -0,0 +1,213 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : determinant.fw +// file : determinant.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Sylvain Pion +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_DETERMINANT_H +#define CGAL_DETERMINANT_H + +CGAL_BEGIN_NAMESPACE + +template +inline +FT +det2x2_by_formula( + const FT& a00, const FT& a01, + const FT& a10, const FT& a11) +{ +// First compute the det2x2 + const FT m01 = a00*a11 - a10*a01; + return m01; +} + +template +CGAL_KERNEL_MEDIUM_INLINE +FT +det3x3_by_formula( + const FT& a00, const FT& a01, const FT& a02, + const FT& a10, const FT& a11, const FT& a12, + const FT& a20, const FT& a21, const FT& a22) +{ +// First compute the det2x2 + const FT m01 = a00*a11 - a10*a01; + const FT m02 = a00*a21 - a20*a01; + const FT m12 = a10*a21 - a20*a11; +// Now compute the minors of rank 3 + const FT m012 = m01*a22 - m02*a12 + m12*a02; + return m012; +} + +template +CGAL_KERNEL_LARGE_INLINE +FT +det4x4_by_formula( + const FT& a00, const FT& a01, const FT& a02, const FT& a03, + const FT& a10, const FT& a11, const FT& a12, const FT& a13, + const FT& a20, const FT& a21, const FT& a22, const FT& a23, + const FT& a30, const FT& a31, const FT& a32, const FT& a33) +{ +// First compute the det2x2 + const FT m01 = a10*a01 - a00*a11; + const FT m02 = a20*a01 - a00*a21; + const FT m03 = a30*a01 - a00*a31; + const FT m12 = a20*a11 - a10*a21; + const FT m13 = a30*a11 - a10*a31; + const FT m23 = a30*a21 - a20*a31; +// Now compute the minors of rank 3 + const FT m012 = m12*a02 - m02*a12 + m01*a22; + const FT m013 = m13*a02 - m03*a12 + m01*a32; + const FT m023 = m23*a02 - m03*a22 + m02*a32; + const FT m123 = m23*a12 - m13*a22 + m12*a32; +// Now compute the minors of rank 4 + const FT m0123 = m123*a03 - m023*a13 + m013*a23 - m012*a33; + return m0123; +} + +template +CGAL_KERNEL_LARGE_INLINE +FT +det5x5_by_formula( + const FT& a00, const FT& a01, const FT& a02, const FT& a03, const FT& a04, + const FT& a10, const FT& a11, const FT& a12, const FT& a13, const FT& a14, + const FT& a20, const FT& a21, const FT& a22, const FT& a23, const FT& a24, + const FT& a30, const FT& a31, const FT& a32, const FT& a33, const FT& a34, + const FT& a40, const FT& a41, const FT& a42, const FT& a43, const FT& a44) +{ +// First compute the det2x2 + const FT m01 = a10*a01 - a00*a11; + const FT m02 = a20*a01 - a00*a21; + const FT m03 = a30*a01 - a00*a31; + const FT m04 = a40*a01 - a00*a41; + const FT m12 = a20*a11 - a10*a21; + const FT m13 = a30*a11 - a10*a31; + const FT m14 = a40*a11 - a10*a41; + const FT m23 = a30*a21 - a20*a31; + const FT m24 = a40*a21 - a20*a41; + const FT m34 = a40*a31 - a30*a41; +// Now compute the minors of rank 3 + const FT m012 = m12*a02 - m02*a12 + m01*a22; + const FT m013 = m13*a02 - m03*a12 + m01*a32; + const FT m014 = m14*a02 - m04*a12 + m01*a42; + const FT m023 = m23*a02 - m03*a22 + m02*a32; + const FT m024 = m24*a02 - m04*a22 + m02*a42; + const FT m034 = m34*a02 - m04*a32 + m03*a42; + const FT m123 = m23*a12 - m13*a22 + m12*a32; + const FT m124 = m24*a12 - m14*a22 + m12*a42; + const FT m134 = m34*a12 - m14*a32 + m13*a42; + const FT m234 = m34*a22 - m24*a32 + m23*a42; +// Now compute the minors of rank 4 + const FT m0123 = m123*a03 - m023*a13 + m013*a23 - m012*a33; + const FT m0124 = m124*a03 - m024*a13 + m014*a23 - m012*a43; + const FT m0134 = m134*a03 - m034*a13 + m014*a33 - m013*a43; + const FT m0234 = m234*a03 - m034*a23 + m024*a33 - m023*a43; + const FT m1234 = m234*a13 - m134*a23 + m124*a33 - m123*a43; +// Now compute the minors of rank 5 + const FT m01234 = m1234*a04 - m0234*a14 + m0134*a24 - m0124*a34 + m0123*a44; + return m01234; +} + +template +FT +det6x6_by_formula( + const FT& a00, const FT& a01, const FT& a02, const FT& a03, const FT& a04, const FT& a05, + const FT& a10, const FT& a11, const FT& a12, const FT& a13, const FT& a14, const FT& a15, + const FT& a20, const FT& a21, const FT& a22, const FT& a23, const FT& a24, const FT& a25, + const FT& a30, const FT& a31, const FT& a32, const FT& a33, const FT& a34, const FT& a35, + const FT& a40, const FT& a41, const FT& a42, const FT& a43, const FT& a44, const FT& a45, + const FT& a50, const FT& a51, const FT& a52, const FT& a53, const FT& a54, const FT& a55) +{ +// First compute the det2x2 + const FT m01 = a00*a11 - a10*a01; + const FT m02 = a00*a21 - a20*a01; + const FT m03 = a00*a31 - a30*a01; + const FT m04 = a00*a41 - a40*a01; + const FT m05 = a00*a51 - a50*a01; + const FT m12 = a10*a21 - a20*a11; + const FT m13 = a10*a31 - a30*a11; + const FT m14 = a10*a41 - a40*a11; + const FT m15 = a10*a51 - a50*a11; + const FT m23 = a20*a31 - a30*a21; + const FT m24 = a20*a41 - a40*a21; + const FT m25 = a20*a51 - a50*a21; + const FT m34 = a30*a41 - a40*a31; + const FT m35 = a30*a51 - a50*a31; + const FT m45 = a40*a51 - a50*a41; +// Now compute the minors of rank 3 + const FT m012 = m01*a22 - m02*a12 + m12*a02; + const FT m013 = m01*a32 - m03*a12 + m13*a02; + const FT m014 = m01*a42 - m04*a12 + m14*a02; + const FT m015 = m01*a52 - m05*a12 + m15*a02; + const FT m023 = m02*a32 - m03*a22 + m23*a02; + const FT m024 = m02*a42 - m04*a22 + m24*a02; + const FT m025 = m02*a52 - m05*a22 + m25*a02; + const FT m034 = m03*a42 - m04*a32 + m34*a02; + const FT m035 = m03*a52 - m05*a32 + m35*a02; + const FT m045 = m04*a52 - m05*a42 + m45*a02; + const FT m123 = m12*a32 - m13*a22 + m23*a12; + const FT m124 = m12*a42 - m14*a22 + m24*a12; + const FT m125 = m12*a52 - m15*a22 + m25*a12; + const FT m134 = m13*a42 - m14*a32 + m34*a12; + const FT m135 = m13*a52 - m15*a32 + m35*a12; + const FT m145 = m14*a52 - m15*a42 + m45*a12; + const FT m234 = m23*a42 - m24*a32 + m34*a22; + const FT m235 = m23*a52 - m25*a32 + m35*a22; + const FT m245 = m24*a52 - m25*a42 + m45*a22; + const FT m345 = m34*a52 - m35*a42 + m45*a32; +// Now compute the minors of rank 4 + const FT m0123 = m012*a33 - m013*a23 + m023*a13 - m123*a03; + const FT m0124 = m012*a43 - m014*a23 + m024*a13 - m124*a03; + const FT m0125 = m012*a53 - m015*a23 + m025*a13 - m125*a03; + const FT m0134 = m013*a43 - m014*a33 + m034*a13 - m134*a03; + const FT m0135 = m013*a53 - m015*a33 + m035*a13 - m135*a03; + const FT m0145 = m014*a53 - m015*a43 + m045*a13 - m145*a03; + const FT m0234 = m023*a43 - m024*a33 + m034*a23 - m234*a03; + const FT m0235 = m023*a53 - m025*a33 + m035*a23 - m235*a03; + const FT m0245 = m024*a53 - m025*a43 + m045*a23 - m245*a03; + const FT m0345 = m034*a53 - m035*a43 + m045*a33 - m345*a03; + const FT m1234 = m123*a43 - m124*a33 + m134*a23 - m234*a13; + const FT m1235 = m123*a53 - m125*a33 + m135*a23 - m235*a13; + const FT m1245 = m124*a53 - m125*a43 + m145*a23 - m245*a13; + const FT m1345 = m134*a53 - m135*a43 + m145*a33 - m345*a13; + const FT m2345 = m234*a53 - m235*a43 + m245*a33 - m345*a23; +// Now compute the minors of rank 5 + const FT m01234 = m0123*a44 - m0124*a34 + m0134*a24 - m0234*a14 + m1234*a04; + const FT m01235 = m0123*a54 - m0125*a34 + m0135*a24 - m0235*a14 + m1235*a04; + const FT m01245 = m0124*a54 - m0125*a44 + m0145*a24 - m0245*a14 + m1245*a04; + const FT m01345 = m0134*a54 - m0135*a44 + m0145*a34 - m0345*a14 + m1345*a04; + const FT m02345 = m0234*a54 - m0235*a44 + m0245*a34 - m0345*a24 + m2345*a04; + const FT m12345 = m1234*a54 - m1235*a44 + m1245*a34 - m1345*a24 + m2345*a14; +// Now compute the minors of rank 6 + const FT m012345 = m01234*a55 - m01235*a45 + m01245*a35 - m01345*a25 + m02345*a15 - m12345*a05; + return m012345; +} + + +CGAL_END_NAMESPACE + + +#ifndef CGAL_PREDICATES_SIGN_OF_DETERMINANT_H +#include +#endif // CGAL_PREDICATES_SIGN_OF_DETERMINANT_H + +#endif // CGAL_DETERMINANT_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/enum.h b/Old_Packages/Kernel_basic/include/CGAL/enum.h new file mode 100644 index 00000000000..d65cd4fe85f --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/enum.h @@ -0,0 +1,84 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : enum.fw +// file : enum.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_ENUM_H +#define CGAL_ENUM_H + +CGAL_BEGIN_NAMESPACE + + +enum Sign + { + NEGATIVE = -1, + ZERO, + POSITIVE + }; + +typedef Sign Orientation; + +const Orientation LEFTTURN = POSITIVE; +const Orientation RIGHTTURN = NEGATIVE; + +const Orientation CLOCKWISE = NEGATIVE; +const Orientation COUNTERCLOCKWISE = POSITIVE; + +const Orientation COLLINEAR = ZERO; +const Orientation COPLANAR = ZERO; +const Orientation DEGENERATE = ZERO; + + + +enum Oriented_side + { + ON_NEGATIVE_SIDE = -1, + ON_ORIENTED_BOUNDARY, + ON_POSITIVE_SIDE + }; + + +enum Bounded_side + { + ON_UNBOUNDED_SIDE = -1, + ON_BOUNDARY, + ON_BOUNDED_SIDE + }; + + +enum Comparison_result + { + SMALLER = -1, + EQUAL, + LARGER + }; + +CGAL_END_NAMESPACE + + +#ifndef CGAL_FUNCTIONS_ON_ENUMS_H +#include +#endif // CGAL_FUNCTIONS_ON_ENUMS_H + +#endif // CGAL_ENUM_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/functions_on_enums.h b/Old_Packages/Kernel_basic/include/CGAL/functions_on_enums.h new file mode 100644 index 00000000000..efd0648474d --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/functions_on_enums.h @@ -0,0 +1,67 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : functions_on_enums.fw +// file : functions_on_enums.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_FUNCTIONS_ON_ENUMS_H +#define CGAL_FUNCTIONS_ON_ENUMS_H + +#ifndef CGAL_CONFIG_H +#include +#endif // CGAL_CONFIG_H + +#ifndef CGAL_ENUM_H +#include +#endif // CGAL_ENUM_H + +CGAL_BEGIN_NAMESPACE + +template +inline +T +opposite(const T& t) +{ return -t; } + +CGAL_TEMPLATE_NULL +inline +Sign +opposite(const Sign& o) +{ return (Sign)(-(int)o); } + +CGAL_TEMPLATE_NULL +inline +Oriented_side +opposite(const Oriented_side& os) +{ return (Oriented_side)(-(int)os); } + +CGAL_TEMPLATE_NULL +inline +Bounded_side +opposite(const Bounded_side &bs) +{ return (Bounded_side)(-(int)bs); } + +CGAL_END_NAMESPACE + + +#endif // CGAL_FUNCTIONS_ON_ENUMS_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/homogeneous_classes.h b/Old_Packages/Kernel_basic/include/CGAL/homogeneous_classes.h new file mode 100644 index 00000000000..3d18b52876d --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/homogeneous_classes.h @@ -0,0 +1,110 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : Homogeneous.fw +// file : homogeneous_classes.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_HOMOGENEOUS_CLASSES_H +#define CGAL_HOMOGENEOUS_CLASSES_H + +CGAL_BEGIN_NAMESPACE + +template < class FT, class RT > +class PointH2; + +template < class FT, class RT > +class VectorH2; + +template < class FT, class RT > +class DirectionH2; + +template < class FT, class RT > +class LineH2; + +template < class FT, class RT > +class RayH2; + +template < class FT, class RT > +class SegmentH2; + +template < class FT, class RT > +class TriangleH2; + +template < class FT, class RT > +class CircleH2; + +template < class FT, class RT > +class Iso_rectangleH2; + +template < class FT, class RT > +class Aff_transformationH2; + +template < class FT, class RT > +class PointH3; + +template < class FT, class RT > +class VectorH3; + +template < class FT, class RT > +class DirectionH3; + +template < class FT, class RT > +class PlaneH3; + +template < class FT, class RT > +class LineH3; + +template < class FT, class RT > +class RayH3; + +template < class FT, class RT > +class SegmentH3; + +template < class FT, class RT > +class TriangleH3; + +template < class FT, class RT > +class Iso_rectangleH3; + +template < class FT, class RT > +class TetrahedronH3; + +template < class FT, class RT > +class Iso_cuboidH3; + +template < class FT, class RT > +class SphereH3; + +template < class FT, class RT > +class Aff_transformationH3; + +template < class PT, class DA > +class ConicHPA2; + +template +class PointHd; + +CGAL_END_NAMESPACE + + +#endif // CGAL_HOMOGENEOUS_CLASSES_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/homogeneous_rep.h b/Old_Packages/Kernel_basic/include/CGAL/homogeneous_rep.h new file mode 100644 index 00000000000..14268a7d409 --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/homogeneous_rep.h @@ -0,0 +1,872 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// release : +// release_date : 2000, December 10 +// +// source : Homogeneous_traits.lw +// file : include/CGAL/homogeneous_rep.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Stefan Schirra +// +// coordinator : MPI, Saarbruecken +// ====================================================================== + +#ifndef CGAL_HOMOGENEOUS_REP_H +#define CGAL_HOMOGENEOUS_REP_H + +#define CGAL_REP_CLASS_DEFINED + +#ifndef CGAL_QUOTIENT_H +#include +#endif // CGAL_QUOTIENT_H + +#include +#include +#include +#include + +namespace CGAL { +template < class FT_, class RT_ > +class Data_accessorH2 +{ +public: + typedef FT_ FT; + typedef RT_ RT; + typedef PointH2 Point; + + RT get_hx( Point const& p) const { return( p.hx()); } + RT get_hy( Point const& p) const { return( p.hy()); } + RT get_hw( Point const& p) const { return( p.hw()); } + + void + get( Point const& p, RT& hx, RT& hy, RT& hw) const + { + hx = get_hx( p); + hy = get_hy( p); + hw = get_hw( p); + } + + void + set( Point& p, RT const& hx, RT const& hy, RT const& hw) const + { + p = Point( hx, hy, hw); + } +}; +template +class Homogeneous_base +{ + public: + typedef RT_ RT; + typedef FT_ FT; + typedef CGAL::Object Object_2; + // we have: template CGAL::Point_2 : public R::Point_2_base + typedef CGAL::Point_2< R_ > Point_2; + typedef CGAL::Vector_2< R_ > Vector_2; + typedef CGAL::Direction_2< R_ > Direction_2; + typedef CGAL::Segment_2< R_ > Segment_2; + typedef CGAL::Line_2< R_ > Line_2; + typedef CGAL::Ray_2< R_ > Ray_2; + typedef CGAL::Circle_2< R_ > Circle_2; + typedef CGAL::Triangle_2< R_ > Triangle_2; + typedef CGAL::Iso_rectangle_2< R_ > Iso_rectangle_2; + typedef CGAL::Aff_transformation_2< R_ > Aff_transformation_2; + typedef CGAL::Object Object_3; + typedef CGAL::Point_3< R_ > Point_3; + typedef CGAL::Vector_3< R_ > Vector_3; + typedef CGAL::Direction_3< R_ > Direction_3; + typedef CGAL::Segment_3< R_ > Segment_3; + typedef CGAL::Plane_3< R_ > Plane_3; + typedef CGAL::Line_3< R_ > Line_3; + typedef CGAL::Ray_3< R_ > Ray_3; + typedef CGAL::Triangle_3< R_ > Triangle_3; + typedef CGAL::Tetrahedron_3< R_ > Tetrahedron_3; + typedef CGAL::Iso_cuboid_3< R_ > Iso_cuboid_3; + typedef CGAL::Sphere_3< R_ > Sphere_3; + typedef CGAL::Aff_transformation_3< R_ > Aff_transformation_3; + // we have: template CGAL::Point_d : public R::Point_d_base + typedef CGAL::Point_d< R_ > Point_d; + +}; +template > +class Homogeneous : public Homogeneous_base< Homogeneous, RT_, FT_ > +{ + public: + typedef RT_ RT; + typedef FT_ FT; + typedef Homogeneous_tag Rep_tag; + typedef PointH2< FT, RT> Point_2_base; + typedef VectorH2< FT, RT> Vector_2_base; + typedef DirectionH2< FT, RT> Direction_2_base; + typedef SegmentH2< FT, RT> Segment_2_base; + typedef LineH2< FT, RT> Line_2_base; + typedef RayH2< FT, RT> Ray_2_base; + typedef CircleH2< FT, RT> Circle_2_base; + typedef TriangleH2< FT, RT> Triangle_2_base; + typedef Iso_rectangleH2< FT, RT> Iso_rectangle_2_base; + typedef Aff_transformationH2< FT, RT> Aff_transformation_2_base; + typedef Homogeneous_base< Homogeneous, RT_, FT_ > KernelBase; + + typedef typename KernelBase::Point_2 Point_2; + typedef typename KernelBase::Vector_2 Vector_2; + typedef typename KernelBase::Direction_2 Direction_2; + typedef typename KernelBase::Line_2 Line_2; + typedef typename KernelBase::Segment_2 Segment_2; + typedef typename KernelBase::Ray_2 Ray_2; + typedef typename KernelBase::Circle_2 Circle_2; + typedef typename KernelBase::Triangle_2 Triangle_2; + typedef typename KernelBase::Iso_rectangle_2 Iso_rectangle_2; + typedef typename KernelBase::Aff_transformation_2 Aff_transformation_2; + typedef CGALi::Construct Construct_point_2; + typedef CGALi::Construct Construct_vector_2; + typedef CGALi::Construct Construct_direction_2; + typedef CGALi::Construct Construct_segment_2; + typedef CGALi::Construct Construct_line_2; + typedef CGALi::Construct Construct_ray_2; + typedef CGALi::Construct Construct_circle_2; + typedef CGALi::Construct Construct_triangle_2; + typedef CGALi::Construct Construct_iso_rectangle_2; + typedef CGALi::Construct Construct_aff_transformation_2; + + Construct_point_2 + construct_point_2_object() const + { return Construct_point_2(); } + + Construct_vector_2 + construct_vector_2_object() const + { return Construct_vector_2(); } + + Construct_direction_2 + construct_direction_2_object() const + { return Construct_direction_2(); } + + Construct_segment_2 + construct_segment_2_object() const + { return Construct_segment_2(); } + + Construct_line_2 + construct_line_2_object() const + { return Construct_line_2(); } + + Construct_ray_2 + construct_ray_2_object() const + { return Construct_ray_2(); } + + Construct_circle_2 + construct_circle_2_object() const + { return Construct_circle_2(); } + + Construct_triangle_2 + construct_triangle_2_object() const + { return Construct_triangle_2(); } + + Construct_iso_rectangle_2 + construct_iso_rectangle_2_object() const + { return Construct_iso_rectangle_2(); } + + Construct_aff_transformation_2 + construct_aff_transformation_2_object() const + { return Construct_aff_transformation_2(); } + + + typedef CGALi::Call_point_to_get Construct_point_on_2; + Construct_point_on_2 + construct_point_on_2_object() const + { return Construct_point_on_2(); } + + typedef CGALi::Call_second_point_to_get Construct_second_point_on_2; + Construct_second_point_on_2 + construct_second_point_on_2_object() const + { return Construct_second_point_on_2(); } + + typedef CGALi::Call_source_to_get Construct_source_point_2; + Construct_source_point_2 + construct_source_point_2_object() const + { return Construct_source_point_2(); } + + typedef CGALi::Call_target_to_get Construct_target_point_2; + Construct_target_point_2 + construct_target_point_2_object() const + { return Construct_target_point_2(); } + + typedef CGALi::Call_min_to_get Construct_min_point_2; + Construct_min_point_2 + construct_min_point_2_object() const + { return Construct_min_point_2(); } + + typedef CGALi::Call_max_to_get Construct_max_point_2; + Construct_max_point_2 + construct_max_point_2_object() const + { return Construct_max_point_2(); } + + typedef CGALi::Call_direction_to_get Construct_direction_of_line_2; + Construct_direction_of_line_2 + construct_direction_of_line_2_object() const + { return Construct_direction_of_line_2(); } + + typedef CGALi::Call_direction_to_get Construct_direction_of_ray_2; + Construct_direction_of_ray_2 + construct_direction_of_ray_2_object() const + { return Construct_direction_of_ray_2(); } + + typedef CGALi::Call_supporting_line_to_get Construct_supporting_line_2; + Construct_supporting_line_2 + construct_supporting_line_2_object() const + { return Construct_supporting_line_2(); } + + typedef CGALi::Call_perpendicular_to_get Construct_perpendicular_vector_2; + Construct_perpendicular_vector_2 + construct_perpendicular_vector_2_object() const + { return Construct_perpendicular_vector_2(); } + + typedef CGALi::Call_perpendicular_to_get Construct_perpendicular_direction_2; + Construct_perpendicular_direction_2 + construct_perpendicular_direction_2_object() const + { return Construct_perpendicular_direction_2(); } + + typedef CGALi::Call_perpendicular_to_get Construct_perpendicular_line_2; + Construct_perpendicular_line_2 + construct_perpendicular_line_2_object() const + { return Construct_perpendicular_line_2(); } + + typedef CGALi::p_Midpoint Construct_midpoint; + Construct_midpoint + construct_midpoint_object() const + { return Construct_midpoint(); } + + typedef CGALi::p_Circumcenter Construct_circumcenter_2; + Construct_circumcenter_2 + construct_circumcenter_2_object() const + { return Construct_circumcenter_2(); } + + typedef CGALi::pl_Bisector Construct_bisector_2; + Construct_bisector_2 + construct_bisector_2_object() const + { return Construct_bisector_2(); } + + typedef CGALi::Call_opposite_to_get Construct_opposite_segment_2; + Construct_opposite_segment_2 + construct_opposite_segment_2_object() const + { return Construct_opposite_segment_2(); } + + typedef CGALi::Call_opposite_to_get Construct_opposite_ray_2; + Construct_opposite_ray_2 + construct_opposite_ray_2_object() const + { return Construct_opposite_ray_2(); } + + typedef CGALi::Call_opposite_to_get Construct_opposite_line_2; + Construct_opposite_line_2 + construct_opposite_line_2_object() const + { return Construct_opposite_line_2(); } + + typedef CGALi::Call_opposite_to_get Construct_opposite_triangle_2; + Construct_opposite_triangle_2 + construct_opposite_triangle_2_object() const + { return Construct_opposite_triangle_2(); } + + typedef CGALi::Call_opposite_to_get Construct_opposite_circle_2; + Construct_opposite_circle_2 + construct_opposite_circle_2_object() const + { return Construct_opposite_circle_2(); } + + typedef CGALi::Call_transform Transform_2; + Transform_2 + transform_2_object() const + { return Transform_2(); } + + + typedef CGALi::Assign Assign_2; + Assign_2 + assign_2_object() const + { return Assign_2(); } + + typedef CGALi::Intersect Intersect_2; + Intersect_2 + intersect_2_object() const + { return Intersect_2(); } + + typedef CGALi::Call_y_at_x_to_get Compute_y_at_x_2; + Compute_y_at_x_2 + compute_y_at_x_2_object() const + { return Compute_y_at_x_2(); } + + typedef CGALi::Call_squared_length_to_get Compute_squared_length_2; + Compute_squared_length_2 + Compute_squared_length_2_object() const + { return Compute_squared_length_2(); } + typedef CGALi::Equal Equal_2; + Equal_2 + equal_2_object() const + { return Equal_2(); } + + typedef CGALi::Equal_x Equal_x_2; + Equal_x_2 + equal_x_2_object() const + { return Equal_x_2(); } + + typedef CGALi::Equal_y Equal_y_2; + Equal_y_2 + equal_y_2_object() const + { return Equal_y_2(); } + + typedef CGALi::Equal_xy Equal_xy_2; + Equal_xy_2 + equal_xy_2_object() const + { return Equal_xy_2(); } + + typedef CGALi::Less_x Less_x_2; + Less_x_2 + less_x_2_object() const + { return Less_x_2(); } + + typedef CGALi::Less_y Less_y_2; + Less_y_2 + less_y_2_object() const + { return Less_y_2(); } + + typedef CGAL::p_Less_xy Less_xy_2; + Less_xy_2 + less_xy_2_object() const + { return Less_xy_2(); } + + typedef CGAL::p_Less_yx Less_yx_2; + Less_yx_2 + less_yx_2_object() const + { return Less_yx_2(); } + + typedef CGALi::Compare_x Compare_x_2; + Compare_x_2 + compare_x_2_object() const + { return Compare_x_2(); } + + typedef CGALi::Compare_y Compare_y_2; + Compare_y_2 + compare_y_2_object() const + { return Compare_y_2(); } + + typedef CGALi::Compare_xy Compare_xy_2; + Compare_xy_2 + compare_xy_2_object() const + { return Compare_xy_2(); } + + typedef CGALi::Compare_y_at_x Compare_y_at_x_2; + Compare_y_at_x_2 + compare_y_at_x_2_object() const + { return Compare_y_at_x_2(); } + + typedef CGALi::Compare_x_at_y Compare_x_at_y_2; + Compare_x_at_y_2 + compare_x_at_y_2_object() const + { return Compare_x_at_y_2(); } + + typedef CGAL ::p_Less_dist_to_point Less_distance_to_point_2; + Less_distance_to_point_2 + less_distance_to_point_2_object(const Point_2& p) const + { return Less_distance_to_point_2(p); } + + typedef CGALi::Compare_distance_to_point Compare_distance_to_point_2; + Compare_distance_to_point_2 + compare_distance_to_point_2_object(const Point_2& p) const + { return Compare_distance_to_point_2(p); } + + typedef CGAL ::p_Less_dist_to_line_2p Less_signed_distance_to_line_2; + Less_signed_distance_to_line_2 + less_signed_distance_to_line_2_object(const Point_2& p, const Point_2& q) const + { return Less_signed_distance_to_line_2(p,q); } + + typedef CGAL ::p_Less_rotate_ccw Less_rotate_ccw_2; + Less_rotate_ccw_2 + less_rotate_ccw_2_object(const Point_2& p) const + { return Less_rotate_ccw_2(p); } + + typedef CGALi::Counterclockwise_in_between Counterclockwise_in_between_2; + Counterclockwise_in_between_2 + counterclockwise_in_between_2_object() const + { return Counterclockwise_in_between_2(); } + + typedef CGAL ::p_Leftturn Leftturn_2; + Leftturn_2 + leftturn_2_object() const + { return Leftturn_2(); } + + typedef CGAL ::p_Left_of_line_2p Left_of_line_2; + Left_of_line_2 + left_of_line_2_object(const Point_2& p, const Point_2& q) const + { return Left_of_line_2(p,q); } + + // this is a hack + typedef CGAL ::p_Left_of_line_2p Right_of_line_2; + Right_of_line_2 + right_of_line_2_object(const Point_2& p, const Point_2& q) const + { return Left_of_line_2(q,p); } // !!! + + Left_of_line_2 + left_of_vertical_2_object(const Point_2& p) const + { return Left_of_line_2(p,p + construct_vector_2_object()(RT(0),RT(1),RT(1))); } + + typedef CGALi::Collinear Collinear_2; + Collinear_2 + collinear_2_object() const + { return Collinear_2(); } + + typedef CGAL ::p_Orientation Orientation_2; + Orientation_2 + orientation_2_object() const + { return Orientation_2(); } + + typedef CGALi::Side_of_oriented_circle Side_of_oriented_circle_2; + Side_of_oriented_circle_2 + side_of_oriented_circle_2_object() const + { return Side_of_oriented_circle_2(); } + + typedef CGALi::Side_of_bounded_circle Side_of_bounded_circle_2; + Side_of_bounded_circle_2 + side_of_bounded_circle_2_object() const + { return Side_of_bounded_circle_2(); } + + typedef CGALi::Call_is_horizontal Is_horizontal_2; + Is_horizontal_2 + is_horizontal_2_object() const + { return Is_horizontal_2(); } + + typedef CGALi::Call_is_vertical Is_vertical_2; + Is_vertical_2 + is_vertical_2_object() const + { return Is_vertical_2(); } + + typedef CGALi::Call_is_degenerate Is_degenerate_2; + Is_degenerate_2 + is_degenerate_2_object() const + { return Is_degenerate_2(); } + + typedef CGALi::Call_has_on Has_on_2; + Has_on_2 + has_on_2_object() const + { return Has_on_2(); } + + typedef CGALi::Call_collinear_has_on Collinear_has_on_2; + Collinear_has_on_2 + collinear_has_on_2_object() const + { return Collinear_has_on_2(); } + + typedef CGALi::Call_has_on_bounded_side Has_on_bounded_side_2; + Has_on_bounded_side_2 + has_on_bounded_side_2_object() const + { return Has_on_bounded_side_2(); } + + typedef CGALi::Call_has_on_unbounded_side Has_on_unbounded_side_2; + Has_on_unbounded_side_2 + has_on_unbounded_side_2_object() const + { return Has_on_unbounded_side_2(); } + + typedef CGALi::Call_has_on_boundary Has_on_boundary_2; + Has_on_boundary_2 + has_on_boundary_2_object() const + { return Has_on_boundary_2(); } + + typedef CGALi::Call_has_on_positive_side Has_on_positive_side_2; + Has_on_positive_side_2 + has_on_positive_side_2_object() const + { return Has_on_positive_side_2(); } + + typedef CGALi::Call_has_on_negative_side Has_on_negative_side_2; + Has_on_negative_side_2 + has_on_negative_side_2_object() const + { return Has_on_negative_side_2(); } + + typedef CGALi::Call_oriented_side Oriented_side_2; + Oriented_side_2 + oriented_side_2_object() const + { return Oriented_side_2(); } + + typedef CGALi::Are_ordered_along_line Are_ordered_along_line_2 ; + Are_ordered_along_line_2 + are_ordered_along_line_2_object() const + { return Are_ordered_along_line_2(); } + + typedef CGALi::Are_strictly_ordered_along_line Are_strictly_ordered_along_line_2; + Are_strictly_ordered_along_line_2 + are_strictly_ordered_along_line_2_object() const + { return Are_strictly_ordered_along_line_2(); } + + typedef CGALi::Collinear_are_ordered_along_line Collinear_are_ordered_along_line_2; + Collinear_are_ordered_along_line_2 + collinear_are_ordered_along_line_2_object() const + { return Collinear_are_ordered_along_line_2(); } + + typedef CGALi::Collinear_are_strictly_ordered_along_line Collinear_are_strictly_ordered_along_line_2; + Collinear_are_strictly_ordered_along_line_2 + collinear_are_strictly_ordered_along_line_2_object() const + { return Collinear_are_strictly_ordered_along_line_2(); } + + typedef PointH3< FT, RT> Point_3_base; + typedef VectorH3< FT, RT> Vector_3_base; + typedef DirectionH3< FT, RT> Direction_3_base; + typedef SegmentH3< FT, RT> Segment_3_base; + typedef PlaneH3< FT, RT> Plane_3_base; + typedef LineH3< FT, RT> Line_3_base; + typedef RayH3< FT, RT> Ray_3_base; + typedef TriangleH3< FT, RT> Triangle_3_base; + typedef TetrahedronH3< FT, RT> Tetrahedron_3_base; + typedef Iso_cuboidH3< FT, RT> Iso_cuboid_3_base; + typedef SphereH3< FT, RT> Sphere_3_base; + typedef Aff_transformationH3< FT, RT> Aff_transformation_3_base; + typedef typename KernelBase::Point_3 Point_3; + typedef typename KernelBase::Vector_3 Vector_3; + typedef typename KernelBase::Direction_3 Direction_3; + typedef typename KernelBase::Plane_3 Plane_3; + typedef typename KernelBase::Line_3 Line_3; + typedef typename KernelBase::Segment_3 Segment_3; + typedef typename KernelBase::Ray_3 Ray_3; + typedef typename KernelBase::Triangle_3 Triangle_3; + typedef typename KernelBase::Tetrahedron_3 Tetrahedron_3; + typedef typename KernelBase::Iso_cuboid_3 Iso_cuboid_3; + typedef typename KernelBase::Aff_transformation_3 Aff_transformation_3; + + typedef CGALi::Construct Construct_point_3; + typedef CGALi::Construct Construct_vector_3; + typedef CGALi::Construct Construct_direction_3; + typedef CGALi::Construct Construct_segment_3; + typedef CGALi::Construct Construct_plane_3; + typedef CGALi::Construct Construct_line_3; + typedef CGALi::Construct Construct_ray_3; + typedef CGALi::Construct Construct_triangle_3; + typedef CGALi::Construct Construct_tetrahedron_3; + typedef CGALi::Construct Construct_iso_cuboid_3; + typedef CGALi::Construct Construct_aff_transformation_3; + + Construct_point_3 + construct_point_3_object() const + { return Construct_point_3(); } + + Construct_vector_3 + construct_vector_3_object() const + { return Construct_vector_3(); } + + Construct_direction_3 + construct_direction_3_object() const + { return Construct_direction_3(); } + + Construct_segment_3 + construct_segment_3_object() const + { return Construct_segment_3(); } + + Construct_plane_3 + construct_plane_3_object() const + { return Construct_plane_3(); } + + Construct_line_3 + construct_line_3_object() const + { return Construct_line_3(); } + + Construct_ray_3 + construct_ray_3_object() const + { return Construct_ray_3(); } + + Construct_triangle_3 + construct_triangle_3_object() const + { return Construct_triangle_3(); } + + Construct_tetrahedron_3 + construct_tetrahedron_object() const + { return Construct_tetrahedron_3(); } + + Construct_iso_cuboid_3 + construct_iso_cuboid_object() const + { return Construct_iso_cuboid_3(); } + + Construct_aff_transformation_3 + construct_aff_transformation_3_object() const + { return Construct_aff_transformation_3(); } + + typedef CGALi::Call_point_to_get Construct_point_on_3; + Construct_point_on_3 + construct_point_on_3_object() const + { return Construct_point_on_3(); } + + typedef CGALi::Call_second_point_to_get Construct_second_point_on_3; + Construct_second_point_on_3 + construct_second_point_on_3_object() const + { return Construct_second_point_on_3(); } + + typedef CGALi::Call_perpendicular_plane_to_get Construct_perpendicular_plane_3; + Construct_perpendicular_plane_3 + construct_perpendicular_plane_3() const + { return Construct_perpendicular_plane_3(); } + + typedef CGALi::p_Midpoint Construct_midpoint_3; + Construct_midpoint_3 + construct_midpoint_3_object() const + { return Construct_midpoint_3(); } + + typedef CGALi::p_Circumcenter Construct_circumcenter_3; + Construct_circumcenter_3 + construct_circumcenter_3_object() const + { return Construct_circumcenter_3(); } + + typedef CGALi::Call_opposite_to_get Construct_opposite_segment_3; + Construct_opposite_segment_3 + construct_opposite_segment_3_object() const + { return Construct_opposite_segment_3(); } + + typedef CGALi::Call_opposite_to_get Construct_opposite_ray_3; + Construct_opposite_ray_3 + construct_opposite_ray_3_object() const + { return Construct_opposite_ray_3(); } + + typedef CGALi::Call_opposite_to_get Construct_opposite_line_3; + Construct_opposite_line_3 + construct_opposite_line_3_object() const + { return Construct_opposite_line_3(); } + + typedef CGALi::Call_supporting_plane_to_get Construct_supporting_plane_3; + Construct_supporting_plane_3 + construct_supporting_plane_3_object() const + { return Construct_supporting_plane_3(); } + + typedef CGALi::Call_transform Transform_3; + Transform_3 + transform_3_object() const + { return Transform_2(); } + + + typedef CGALi::Assign Assign_3; + Assign_3 + assign_3_object() const + { return Assign_3(); } + + typedef CGALi::Intersect Intersect_3; + Intersect_3 + intersect_3_object() const + { return Intersect_3(); } + + typedef CGALi::Call_squared_length_to_get Compute_squared_length_3; + Compute_squared_length_3 + compute_squared_length_3_object() const + { return Compute_squared_length_3(); } + + typedef CGALi::Equal Equal_3; + Equal_3 + equal_3_object() const + { return Equal_3(); } + + typedef CGALi::Equal_x Equal_x_3; + Equal_x_3 + equal_x_3_object() const + { return Equal_x_3(); } + + typedef CGALi::Equal_y Equal_y_3; + Equal_y_3 + equal_y_3_object() const + { return Equal_y_3(); } + + typedef CGALi::Equal_z Equal_z_3; + Equal_z_3 + equal_z_3_object() const + { return Equal_z_3(); } + + typedef CGALi::Equal_xy Equal_xy_3; + Equal_xy_3 + equal_xy_3_object() const + { return Equal_xy_3(); } + + typedef CGALi::Equal_xyz Equal_xyz_3; + Equal_xyz_3 + equal_xyz_3_object() const + { return Equal_xyz_3(); } + + typedef CGALi::Less_x Less_x_3; + Less_x_3 + less_x_3_object() const + { return Less_x_3(); } + + typedef CGALi::Less_y Less_y_3; + Less_y_3 + less_y_3_object() const + { return Less_y_3(); } + + typedef CGALi::Less_z Less_z_3; + Less_z_3 + less_z_3_object() const + { return Less_z_3(); } + + typedef CGAL::p_Less_xy Less_xy_3; + Less_xy_3 + less_xy_3_object() const + { return Less_xy_3(); } + + typedef CGALi::Less_xyz Less_xyz_3; + Less_xyz_3 + less_xyz_3_object() const + { return Less_xyz_3(); } + + typedef CGALi::Compare_x Compare_x_3; + Compare_x_3 + compare_x_3_object() const + { return Compare_x_3(); } + + typedef CGALi::Compare_y Compare_y_3; + Compare_y_3 + compare_y_3_object() const + { return Compare_y_3(); } + + typedef CGALi::Compare_z Compare_z_3; + Compare_z_3 + compare_z_3_object() const + { return Compare_z_3(); } + + typedef CGALi::Compare_xy Compare_xy_3; + Compare_xy_3 + compare_xy_3_object() const + { return Compare_xy_3(); } + + typedef CGALi::Compare_xyz Compare_xyz_3; + Compare_xyz_3 + compare_xyz_3_object() const + { return Compare_xyz_3(); } + + typedef CGAL ::p_Less_dist_to_point Less_distance_to_point_3; + Less_distance_to_point_3 + less_distance_to_point_3_object(const Point_3& p) const + { return Less_distance_to_point_3(p); } + + typedef CGALi::Compare_distance_to_point Compare_distance_to_point_3; + Compare_distance_to_point_3 + compare_distance_to_point_3_object(const Point_3& p) const + { return Compare_distance_to_point_3(p); } + + typedef CGALi::Collinear Collinear_3; + Collinear_3 + collinear_3_object() const + { return Collinear_3(); } + + typedef CGALi::Coplanar Coplanar_3 ; + Coplanar_3 + coplanar_3_object() const + { return Coplanar_3(); } + + typedef CGALi::Coplanar_orientation Coplanar_orientation_3 ; + Coplanar_orientation_3 + coplanar_orientation_3_object() const + { return Coplanar_orientation_3(); } + + typedef CGAL ::p_Orientation Orientation_3; + Orientation_3 + orientation_3_object() const + { return Orientation_3(); } + + typedef CGALi::Call_is_degenerate Is_degenerate_3; + Is_degenerate_3 + is_degenerate_3_object() const + { return Is_degenerate_3(); } + + typedef CGALi::Call_has_on Has_on_3; + Has_on_3 + has_on_3_object() const + { return Has_on_3(); } + + typedef CGALi::Call_has_on_bounded_side Has_on_bounded_side_3; + Has_on_bounded_side_3 + has_on_bounded_side_3_object() const + { return Has_on_bounded_side_3(); } + + typedef CGALi::Call_has_on_unbounded_side Has_on_unbounded_side_3; + Has_on_unbounded_side_3 + has_on_unbounded_side_3_object() const + { return Has_on_unbounded_side_3(); } + + typedef CGALi::Call_has_on_boundary Has_on_boundary_3; + Has_on_boundary_3 + has_on_boundary_3_object() const + { return Has_on_boundary_3(); } + + typedef CGALi::Call_has_on_positive_side Has_on_positive_side_3; + Has_on_positive_side_3 + has_on_positive_side_3_object() const + { return Has_on_positive_side_3(); } + + typedef CGALi::Call_has_on_negative_side Has_on_negative_side_3; + Has_on_negative_side_3 + has_on_negative_side_3_object() const + { return Has_on_negative_side_3(); } + + typedef CGALi::Call_oriented_side Oriented_side_3; + Oriented_side_3 + oriented_side_3_object() const + { return Oriented_side_3(); } + + typedef CGALi::Are_ordered_along_line Are_ordered_along_line_3 ; + Are_ordered_along_line_3 + are_ordered_along_line_3_object() const + { return Are_ordered_along_line_3(); } + + typedef CGALi::Are_strictly_ordered_along_line Are_strictly_ordered_along_line_3; + Are_strictly_ordered_along_line_3 + are_strictly_ordered_along_line_3_object() const + { return Are_strictly_ordered_along_line_3(); } + + typedef CGALi::Collinear_are_ordered_along_line Collinear_are_ordered_along_line_3; + Collinear_are_ordered_along_line_3 + collinear_are_ordered_along_line_3_object() const + { return Collinear_are_ordered_along_line_3(); } + + typedef CGALi::Collinear_are_strictly_ordered_along_line Collinear_are_strictly_ordered_along_line_3; + Collinear_are_strictly_ordered_along_line_3 + collinear_are_strictly_ordered_along_line_3_object() const + { return Collinear_are_strictly_ordered_along_line_3(); } + + typedef CGALi::Side_of_oriented_sphere Side_of_oriented_sphere_3; + Side_of_oriented_sphere_3 + side_of_oriented_sphere_3_object() const + { return Side_of_oriented_sphere_3(); } + + typedef CGALi::Side_of_bounded_sphere Side_of_bounded_sphere_3; + Side_of_bounded_sphere_3 + side_of_bounded_sphere_3_object() const + { return Side_of_bounded_sphere_3(); } + + typedef PointHd< FT, RT> Point_d_base; + + typedef typename KernelBase::Point_d Point_d; + + typedef CGALi::Construct Construct_point_d; + + Construct_point_d + construct_point_d_object() const + { return Construct_point_d(); } + + typedef Data_accessorH2 Data_accessor_2; + typedef ConicHPA2 Conic_2; + static + FT + make_FT(const RT & num, const RT& denom) + { return FT(num, denom); } + + static + FT + make_FT(const RT & num) + { return FT(num); } + + static + RT + FT_numerator(const FT &r) + { return r.numerator(); } + + static + RT + FT_denominator(const FT &r) + { return r.denominator(); } + +}; +} // namespace CGAL + +#endif // CGAL_HOMOGENEOUS_REP_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/iterator_traits_pointer_specs_for_cartesian_kernel.h b/Old_Packages/Kernel_basic/include/CGAL/iterator_traits_pointer_specs_for_cartesian_kernel.h new file mode 100644 index 00000000000..a070d41b0d9 --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/iterator_traits_pointer_specs_for_cartesian_kernel.h @@ -0,0 +1,941 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// release : +// release_date : 2000, December 10 +// +// file : iterator_traits_pointer_specs_for_cartesian_kernel.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// source : bangbang.lw +// revision : 2.7.1 +// revision_date : 06 Oct 1999 +// author(s) : Stefan Schirra +// +// coordinator : MPI, Saarbruecken +// ====================================================================== + + +#ifndef CGAL_ITERATOR_TRAITS_POINTER_SPECS_FOR_CARTESIAN_KERNEL_H +#define CGAL_ITERATOR_TRAITS_POINTER_SPECS_FOR_CARTESIAN_KERNEL_H + +// to be included in Cartesian.h + +#ifdef CGAL_LIMITED_ITERATOR_TRAITS_SUPPORT +#include +#include + +#define CGAL_ITERATOR_TRAITS_POINTER_SPEC_2C(NT) \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Point_2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Point_2< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::Point_2< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Point_2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Point_2< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::Point_2< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Vector_2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Vector_2< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::Vector_2< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Vector_2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Vector_2< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::Vector_2< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Direction_2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Direction_2< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::Direction_2< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Direction_2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Direction_2< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::Direction_2< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Line_2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Line_2< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::Line_2< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Line_2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Line_2< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::Line_2< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Segment_2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Segment_2< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::Segment_2< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Segment_2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Segment_2< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::Segment_2< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Ray_2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Ray_2< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::Ray_2< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Ray_2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Ray_2< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::Ray_2< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Iso_rectangle_2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Iso_rectangle_2< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::Iso_rectangle_2< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Iso_rectangle_2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Iso_rectangle_2< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::Iso_rectangle_2< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Triangle_2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Triangle_2< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::Triangle_2< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Triangle_2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Triangle_2< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::Triangle_2< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Circle_2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Circle_2< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::Circle_2< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Circle_2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Circle_2< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::Circle_2< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Aff_transformation_2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Aff_transformation_2< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::Aff_transformation_2< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Aff_transformation_2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Aff_transformation_2< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::Aff_transformation_2< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ + +#define CGAL_ITERATOR_TRAITS_POINTER_SPEC_3C(NT) \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Point_3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Point_3< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::Point_3< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Point_3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Point_3< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::Point_3< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Vector_3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Vector_3< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::Vector_3< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Vector_3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Vector_3< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::Vector_3< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Direction_3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Direction_3< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::Direction_3< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Direction_3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Direction_3< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::Direction_3< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Plane_3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Plane_3< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::Plane_3< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Plane_3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Plane_3< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::Plane_3< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Line_3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Line_3< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::Line_3< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Line_3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Line_3< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::Line_3< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Segment_3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Segment_3< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::Segment_3< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Segment_3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Segment_3< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::Segment_3< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Ray_3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Ray_3< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::Ray_3< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Ray_3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Ray_3< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::Ray_3< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Triangle_3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Triangle_3< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::Triangle_3< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Triangle_3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Triangle_3< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::Triangle_3< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Tetrahedron_3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Tetrahedron_3< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::Tetrahedron_3< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Tetrahedron_3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Tetrahedron_3< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::Tetrahedron_3< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Aff_transformation_3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Aff_transformation_3< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::Aff_transformation_3< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Aff_transformation_3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Aff_transformation_3< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::Aff_transformation_3< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ + +#define CGAL_ITERATOR_TRAITS_POINTER_SPEC_DC(NT) \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Point_d< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Point_d< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::Point_d< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Point_d< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Point_d< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::Point_d< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ + +#define CGAL_ITERATOR_TRAITS_POINTER_SPECC2(NT) \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::PointC2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::PointC2< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::PointC2< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::PointC2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::PointC2< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::PointC2< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::VectorC2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::VectorC2< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::VectorC2< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::VectorC2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::VectorC2< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::VectorC2< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::DirectionC2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::DirectionC2< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::DirectionC2< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::DirectionC2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::DirectionC2< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::DirectionC2< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::LineC2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::LineC2< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::LineC2< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::LineC2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::LineC2< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::LineC2< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::SegmentC2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::SegmentC2< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::SegmentC2< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::SegmentC2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::SegmentC2< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::SegmentC2< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::RayC2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::RayC2< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::RayC2< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::RayC2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::RayC2< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::RayC2< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Iso_rectangleC2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Iso_rectangleC2< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::Iso_rectangleC2< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Iso_rectangleC2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Iso_rectangleC2< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::Iso_rectangleC2< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::TriangleC2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::TriangleC2< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::TriangleC2< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::TriangleC2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::TriangleC2< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::TriangleC2< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::CircleC2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::CircleC2< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::CircleC2< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::CircleC2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::CircleC2< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::CircleC2< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Aff_transformationC2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Aff_transformationC2< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::Aff_transformationC2< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Aff_transformationC2< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Aff_transformationC2< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::Aff_transformationC2< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ + +#define CGAL_ITERATOR_TRAITS_POINTER_SPECC3(NT) \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::PointC3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::PointC3< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::PointC3< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::PointC3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::PointC3< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::PointC3< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::VectorC3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::VectorC3< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::VectorC3< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::VectorC3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::VectorC3< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::VectorC3< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::DirectionC3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::DirectionC3< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::DirectionC3< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::DirectionC3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::DirectionC3< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::DirectionC3< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::PlaneC3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::PlaneC3< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::PlaneC3< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::PlaneC3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::PlaneC3< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::PlaneC3< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::LineC3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::LineC3< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::LineC3< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::LineC3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::LineC3< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::LineC3< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::SegmentC3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::SegmentC3< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::SegmentC3< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::SegmentC3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::SegmentC3< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::SegmentC3< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::RayC3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::RayC3< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::RayC3< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::RayC3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::RayC3< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::RayC3< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::TriangleC3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::TriangleC3< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::TriangleC3< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::TriangleC3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::TriangleC3< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::TriangleC3< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::TetrahedronC3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::TetrahedronC3< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::TetrahedronC3< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::TetrahedronC3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::TetrahedronC3< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::TetrahedronC3< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Aff_transformationC3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Aff_transformationC3< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::Aff_transformationC3< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Aff_transformationC3< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Aff_transformationC3< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::Aff_transformationC3< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ + +#define CGAL_ITERATOR_TRAITS_POINTER_SPECCD(NT) \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::PointCd< NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::PointCd< NT >* pointer; \ + typedef const CGAL::PointCd< NT >& reference; \ + }; \ + template <> \ + struct iterator_traits*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::PointCd< NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::PointCd< NT >* pointer; \ + typedef CGAL::PointCd< NT >& reference; \ + }; \ +__STL_END_NAMESPACE \ + +/* +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::PointCd< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::PointCd< CGAL::Cartesian< NT > >* pointer; \ + typedef const CGAL::PointCd< CGAL::Cartesian< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::PointCd< CGAL::Cartesian< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::PointCd< CGAL::Cartesian< NT > >* pointer; \ + typedef CGAL::PointCd< CGAL::Cartesian< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +*/ + + + +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2C( int ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3C( int ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DC( int ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2C( long ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3C( long ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DC( long ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2C( float ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3C( float ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DC( float ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2C( double ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3C( double ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DC( double ) + +CGAL_ITERATOR_TRAITS_POINTER_SPECC2( int ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC3( int ) +CGAL_ITERATOR_TRAITS_POINTER_SPECCD( int ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC2( long ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC3( long ) +CGAL_ITERATOR_TRAITS_POINTER_SPECCD( long ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC2( float ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC3( float ) +CGAL_ITERATOR_TRAITS_POINTER_SPECCD( float ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC2( double ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC3( double ) +CGAL_ITERATOR_TRAITS_POINTER_SPECCD( double ) + +class leda_real; +class leda_integer; +class leda_rational; +class leda_bigfloat; + +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2C( leda_real ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3C( leda_real ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DC( leda_real ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2C( leda_integer ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3C( leda_integer ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DC( leda_integer ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2C( leda_rational ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3C( leda_rational ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DC( leda_rational ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2C( leda_bigfloat ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3C( leda_bigfloat ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DC( leda_bigfloat ) + +CGAL_ITERATOR_TRAITS_POINTER_SPECC2( leda_real ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC3( leda_real ) +CGAL_ITERATOR_TRAITS_POINTER_SPECCD( leda_real ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC2( leda_integer ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC3( leda_integer ) +CGAL_ITERATOR_TRAITS_POINTER_SPECCD( leda_integer ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC2( leda_rational ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC3( leda_rational ) +CGAL_ITERATOR_TRAITS_POINTER_SPECCD( leda_rational ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC2( leda_bigfloat ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC3( leda_bigfloat ) +CGAL_ITERATOR_TRAITS_POINTER_SPECCD( leda_bigfloat ) + +namespace CGAL { class Gmpz; } + +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2C( CGAL::Gmpz ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3C( CGAL::Gmpz ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DC( CGAL::Gmpz ) + +CGAL_ITERATOR_TRAITS_POINTER_SPECC2( CGAL::Gmpz ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC3( CGAL::Gmpz ) +CGAL_ITERATOR_TRAITS_POINTER_SPECCD( CGAL::Gmpz ) + + +#ifdef CGAL_QUOTIENT_H +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2C( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3C( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DC( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2C( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3C( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DC( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2C( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3C( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DC( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2C( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3C( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DC( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2C( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3C( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DC( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2C( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3C( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DC( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2C( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3C( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DC( CGAL::Quotient ) + +CGAL_ITERATOR_TRAITS_POINTER_SPECC2( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC3( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECCD( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC2( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC3( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECCD( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC2( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC3( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECCD( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC2( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC3( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECCD( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC2( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC3( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECCD( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC2( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC3( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECCD( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC2( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC3( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECCD( CGAL::Quotient ) + +#endif // CGAL_QUOTIENT_H + +#endif // CGAL_LIMITED_ITERATOR_TRAITS_SUPPORT +#endif // CGAL_ITERATOR_TRAITS_POINTER_SPECS_FOR_CARTESIAN_KERNEL_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/iterator_traits_pointer_specs_for_cartesian_quotient.h b/Old_Packages/Kernel_basic/include/CGAL/iterator_traits_pointer_specs_for_cartesian_quotient.h new file mode 100644 index 00000000000..32706724219 --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/iterator_traits_pointer_specs_for_cartesian_quotient.h @@ -0,0 +1,79 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// release : +// release_date : 2000, December 10 +// +// file : iterator_traits_pointer_specs_for_cartesian_quotient.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// source : bangbang.lw +// revision : 2.7.1 +// revision_date : 06 Oct 1999 +// author(s) : Stefan Schirra +// +// coordinator : MPI, Saarbruecken +// ====================================================================== + + +#ifndef CGAL_ITERATOR_TRAITS_POINTER_SPECS_FOR_CARTESIAN_QUOTIENT_H +#define CGAL_ITERATOR_TRAITS_POINTER_SPECS_FOR_CARTESIAN_QUOTIENT_H + +// to be included in Quotient.h + +#ifdef CGAL_LIMITED_ITERATOR_TRAITS_SUPPORT +#ifdef CGAL_CARTESIAN_H +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2C( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3C( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DC( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2C( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3C( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DC( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2C( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3C( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DC( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2C( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3C( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DC( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2C( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3C( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DC( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2C( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3C( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DC( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2C( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3C( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DC( CGAL::Quotient ) + +CGAL_ITERATOR_TRAITS_POINTER_SPECC2( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC3( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECCD( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC2( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC3( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECCD( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC2( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC3( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECCD( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC2( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC3( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECCD( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC2( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC3( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECCD( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC2( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC3( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECCD( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC2( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECC3( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECCD( CGAL::Quotient ) + +#endif // CGAL_CARTESIAN_H +#endif // CGAL_LIMITED_ITERATOR_TRAITS_SUPPORT + +#endif // CGAL_ITERATOR_TRAITS_POINTER_SPECS_FOR_CARTESIAN_QUOTIENT_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/iterator_traits_pointer_specs_for_homogeneous_kernel.h b/Old_Packages/Kernel_basic/include/CGAL/iterator_traits_pointer_specs_for_homogeneous_kernel.h new file mode 100644 index 00000000000..94dc95b0d00 --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/iterator_traits_pointer_specs_for_homogeneous_kernel.h @@ -0,0 +1,922 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// release : +// release_date : 2000, December 10 +// +// file : iterator_traits_pointer_specs_for_homogeneous_kernel.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// source : bangbang.lw +// revision : 2.7.1 +// revision_date : 06 Oct 1999 +// author(s) : Stefan Schirra +// +// coordinator : MPI, Saarbruecken +// ====================================================================== + + +#ifndef CGAL_ITERATOR_TRAITS_POINTER_SPECS_FOR_HOMOGENEOUS_KERNEL_H +#define CGAL_ITERATOR_TRAITS_POINTER_SPECS_FOR_HOMOGENEOUS_KERNEL_H + +// to be included in Homogeneous.h + +#ifdef CGAL_LIMITED_ITERATOR_TRAITS_SUPPORT +#include +#include + +#define CGAL_ITERATOR_TRAITS_POINTER_SPEC_2H(NT) \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Point_2< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Point_2< CGAL::Homogeneous< NT > >* pointer; \ + typedef const CGAL::Point_2< CGAL::Homogeneous< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Point_2< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Point_2< CGAL::Homogeneous< NT > >* pointer; \ + typedef CGAL::Point_2< CGAL::Homogeneous< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Vector_2< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Vector_2< CGAL::Homogeneous< NT > >* pointer; \ + typedef const CGAL::Vector_2< CGAL::Homogeneous< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Vector_2< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Vector_2< CGAL::Homogeneous< NT > >* pointer; \ + typedef CGAL::Vector_2< CGAL::Homogeneous< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Direction_2< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Direction_2< CGAL::Homogeneous< NT > >* pointer; \ + typedef const CGAL::Direction_2< CGAL::Homogeneous< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Direction_2< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Direction_2< CGAL::Homogeneous< NT > >* pointer; \ + typedef CGAL::Direction_2< CGAL::Homogeneous< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Line_2< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Line_2< CGAL::Homogeneous< NT > >* pointer; \ + typedef const CGAL::Line_2< CGAL::Homogeneous< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Line_2< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Line_2< CGAL::Homogeneous< NT > >* pointer; \ + typedef CGAL::Line_2< CGAL::Homogeneous< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Segment_2< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Segment_2< CGAL::Homogeneous< NT > >* pointer; \ + typedef const CGAL::Segment_2< CGAL::Homogeneous< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Segment_2< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Segment_2< CGAL::Homogeneous< NT > >* pointer; \ + typedef CGAL::Segment_2< CGAL::Homogeneous< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Ray_2< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Ray_2< CGAL::Homogeneous< NT > >* pointer; \ + typedef const CGAL::Ray_2< CGAL::Homogeneous< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Ray_2< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Ray_2< CGAL::Homogeneous< NT > >* pointer; \ + typedef CGAL::Ray_2< CGAL::Homogeneous< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Iso_rectangle_2< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Iso_rectangle_2< CGAL::Homogeneous< NT > >* pointer; \ + typedef const CGAL::Iso_rectangle_2< CGAL::Homogeneous< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Iso_rectangle_2< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Iso_rectangle_2< CGAL::Homogeneous< NT > >* pointer; \ + typedef CGAL::Iso_rectangle_2< CGAL::Homogeneous< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Triangle_2< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Triangle_2< CGAL::Homogeneous< NT > >* pointer; \ + typedef const CGAL::Triangle_2< CGAL::Homogeneous< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Triangle_2< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Triangle_2< CGAL::Homogeneous< NT > >* pointer; \ + typedef CGAL::Triangle_2< CGAL::Homogeneous< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Circle_2< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Circle_2< CGAL::Homogeneous< NT > >* pointer; \ + typedef const CGAL::Circle_2< CGAL::Homogeneous< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Circle_2< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Circle_2< CGAL::Homogeneous< NT > >* pointer; \ + typedef CGAL::Circle_2< CGAL::Homogeneous< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Aff_transformation_2< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Aff_transformation_2< CGAL::Homogeneous< NT > >* pointer; \ + typedef const CGAL::Aff_transformation_2< CGAL::Homogeneous< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Aff_transformation_2< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Aff_transformation_2< CGAL::Homogeneous< NT > >* pointer; \ + typedef CGAL::Aff_transformation_2< CGAL::Homogeneous< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ + +#define CGAL_ITERATOR_TRAITS_POINTER_SPEC_3H(NT) \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Point_3< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Point_3< CGAL::Homogeneous< NT > >* pointer; \ + typedef const CGAL::Point_3< CGAL::Homogeneous< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Point_3< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Point_3< CGAL::Homogeneous< NT > >* pointer; \ + typedef CGAL::Point_3< CGAL::Homogeneous< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Vector_3< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Vector_3< CGAL::Homogeneous< NT > >* pointer; \ + typedef const CGAL::Vector_3< CGAL::Homogeneous< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Vector_3< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Vector_3< CGAL::Homogeneous< NT > >* pointer; \ + typedef CGAL::Vector_3< CGAL::Homogeneous< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Direction_3< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Direction_3< CGAL::Homogeneous< NT > >* pointer; \ + typedef const CGAL::Direction_3< CGAL::Homogeneous< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Direction_3< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Direction_3< CGAL::Homogeneous< NT > >* pointer; \ + typedef CGAL::Direction_3< CGAL::Homogeneous< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Plane_3< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Plane_3< CGAL::Homogeneous< NT > >* pointer; \ + typedef const CGAL::Plane_3< CGAL::Homogeneous< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Plane_3< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Plane_3< CGAL::Homogeneous< NT > >* pointer; \ + typedef CGAL::Plane_3< CGAL::Homogeneous< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Line_3< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Line_3< CGAL::Homogeneous< NT > >* pointer; \ + typedef const CGAL::Line_3< CGAL::Homogeneous< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Line_3< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Line_3< CGAL::Homogeneous< NT > >* pointer; \ + typedef CGAL::Line_3< CGAL::Homogeneous< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Segment_3< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Segment_3< CGAL::Homogeneous< NT > >* pointer; \ + typedef const CGAL::Segment_3< CGAL::Homogeneous< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Segment_3< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Segment_3< CGAL::Homogeneous< NT > >* pointer; \ + typedef CGAL::Segment_3< CGAL::Homogeneous< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Ray_3< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Ray_3< CGAL::Homogeneous< NT > >* pointer; \ + typedef const CGAL::Ray_3< CGAL::Homogeneous< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Ray_3< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Ray_3< CGAL::Homogeneous< NT > >* pointer; \ + typedef CGAL::Ray_3< CGAL::Homogeneous< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Triangle_3< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Triangle_3< CGAL::Homogeneous< NT > >* pointer; \ + typedef const CGAL::Triangle_3< CGAL::Homogeneous< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Triangle_3< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Triangle_3< CGAL::Homogeneous< NT > >* pointer; \ + typedef CGAL::Triangle_3< CGAL::Homogeneous< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Tetrahedron_3< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Tetrahedron_3< CGAL::Homogeneous< NT > >* pointer; \ + typedef const CGAL::Tetrahedron_3< CGAL::Homogeneous< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Tetrahedron_3< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Tetrahedron_3< CGAL::Homogeneous< NT > >* pointer; \ + typedef CGAL::Tetrahedron_3< CGAL::Homogeneous< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Aff_transformation_3< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Aff_transformation_3< CGAL::Homogeneous< NT > >* pointer; \ + typedef const CGAL::Aff_transformation_3< CGAL::Homogeneous< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Aff_transformation_3< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Aff_transformation_3< CGAL::Homogeneous< NT > >* pointer; \ + typedef CGAL::Aff_transformation_3< CGAL::Homogeneous< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ + +#define CGAL_ITERATOR_TRAITS_POINTER_SPEC_DH(NT) \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Point_d< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Point_d< CGAL::Homogeneous< NT > >* pointer; \ + typedef const CGAL::Point_d< CGAL::Homogeneous< NT > >& reference; \ + }; \ + template <> \ + struct iterator_traits >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Point_d< CGAL::Homogeneous< NT > > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Point_d< CGAL::Homogeneous< NT > >* pointer; \ + typedef CGAL::Point_d< CGAL::Homogeneous< NT > >& reference; \ + }; \ +__STL_END_NAMESPACE \ + +#define CGAL_ITERATOR_TRAITS_POINTER_SPECH2(NT) \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::PointH2< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::PointH2< CGAL::Quotient< NT >, NT >* pointer; \ + typedef const CGAL::PointH2< CGAL::Quotient< NT >, NT >& reference; \ + }; \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::PointH2< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::PointH2< CGAL::Quotient< NT >, NT >* pointer; \ + typedef CGAL::PointH2< CGAL::Quotient< NT >, NT >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::VectorH2< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::VectorH2< CGAL::Quotient< NT >, NT >* pointer; \ + typedef const CGAL::VectorH2< CGAL::Quotient< NT >, NT >& reference; \ + }; \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::VectorH2< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::VectorH2< CGAL::Quotient< NT >, NT >* pointer; \ + typedef CGAL::VectorH2< CGAL::Quotient< NT >, NT >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::DirectionH2< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::DirectionH2< CGAL::Quotient< NT >, NT >* pointer; \ + typedef const CGAL::DirectionH2< CGAL::Quotient< NT >, NT >& reference; \ + }; \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::DirectionH2< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::DirectionH2< CGAL::Quotient< NT >, NT >* pointer; \ + typedef CGAL::DirectionH2< CGAL::Quotient< NT >, NT >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::LineH2< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::LineH2< CGAL::Quotient< NT >, NT >* pointer; \ + typedef const CGAL::LineH2< CGAL::Quotient< NT >, NT >& reference; \ + }; \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::LineH2< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::LineH2< CGAL::Quotient< NT >, NT >* pointer; \ + typedef CGAL::LineH2< CGAL::Quotient< NT >, NT >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::SegmentH2< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::SegmentH2< CGAL::Quotient< NT >, NT >* pointer; \ + typedef const CGAL::SegmentH2< CGAL::Quotient< NT >, NT >& reference; \ + }; \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::SegmentH2< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::SegmentH2< CGAL::Quotient< NT >, NT >* pointer; \ + typedef CGAL::SegmentH2< CGAL::Quotient< NT >, NT >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::RayH2< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::RayH2< CGAL::Quotient< NT >, NT >* pointer; \ + typedef const CGAL::RayH2< CGAL::Quotient< NT >, NT >& reference; \ + }; \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::RayH2< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::RayH2< CGAL::Quotient< NT >, NT >* pointer; \ + typedef CGAL::RayH2< CGAL::Quotient< NT >, NT >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Iso_rectangleH2< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Iso_rectangleH2< CGAL::Quotient< NT >, NT >* pointer; \ + typedef const CGAL::Iso_rectangleH2< CGAL::Quotient< NT >, NT >& reference; \ + }; \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Iso_rectangleH2< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Iso_rectangleH2< CGAL::Quotient< NT >, NT >* pointer; \ + typedef CGAL::Iso_rectangleH2< CGAL::Quotient< NT >, NT >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::TriangleH2< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::TriangleH2< CGAL::Quotient< NT >, NT >* pointer; \ + typedef const CGAL::TriangleH2< CGAL::Quotient< NT >, NT >& reference; \ + }; \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::TriangleH2< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::TriangleH2< CGAL::Quotient< NT >, NT >* pointer; \ + typedef CGAL::TriangleH2< CGAL::Quotient< NT >, NT >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::CircleH2< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::CircleH2< CGAL::Quotient< NT >, NT >* pointer; \ + typedef const CGAL::CircleH2< CGAL::Quotient< NT >, NT >& reference; \ + }; \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::CircleH2< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::CircleH2< CGAL::Quotient< NT >, NT >* pointer; \ + typedef CGAL::CircleH2< CGAL::Quotient< NT >, NT >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Aff_transformationH2< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Aff_transformationH2< CGAL::Quotient< NT >, NT >* pointer; \ + typedef const CGAL::Aff_transformationH2< CGAL::Quotient< NT >, NT >& reference; \ + }; \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Aff_transformationH2< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Aff_transformationH2< CGAL::Quotient< NT >, NT >* pointer; \ + typedef CGAL::Aff_transformationH2< CGAL::Quotient< NT >, NT >& reference; \ + }; \ +__STL_END_NAMESPACE \ + +#define CGAL_ITERATOR_TRAITS_POINTER_SPECH3(NT) \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::PointH3< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::PointH3< CGAL::Quotient< NT >, NT >* pointer; \ + typedef const CGAL::PointH3< CGAL::Quotient< NT >, NT >& reference; \ + }; \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::PointH3< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::PointH3< CGAL::Quotient< NT >, NT >* pointer; \ + typedef CGAL::PointH3< CGAL::Quotient< NT >, NT >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::VectorH3< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::VectorH3< CGAL::Quotient< NT >, NT >* pointer; \ + typedef const CGAL::VectorH3< CGAL::Quotient< NT >, NT >& reference; \ + }; \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::VectorH3< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::VectorH3< CGAL::Quotient< NT >, NT >* pointer; \ + typedef CGAL::VectorH3< CGAL::Quotient< NT >, NT >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::DirectionH3< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::DirectionH3< CGAL::Quotient< NT >, NT >* pointer; \ + typedef const CGAL::DirectionH3< CGAL::Quotient< NT >, NT >& reference; \ + }; \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::DirectionH3< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::DirectionH3< CGAL::Quotient< NT >, NT >* pointer; \ + typedef CGAL::DirectionH3< CGAL::Quotient< NT >, NT >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::PlaneH3< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::PlaneH3< CGAL::Quotient< NT >, NT >* pointer; \ + typedef const CGAL::PlaneH3< CGAL::Quotient< NT >, NT >& reference; \ + }; \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::PlaneH3< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::PlaneH3< CGAL::Quotient< NT >, NT >* pointer; \ + typedef CGAL::PlaneH3< CGAL::Quotient< NT >, NT >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::LineH3< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::LineH3< CGAL::Quotient< NT >, NT >* pointer; \ + typedef const CGAL::LineH3< CGAL::Quotient< NT >, NT >& reference; \ + }; \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::LineH3< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::LineH3< CGAL::Quotient< NT >, NT >* pointer; \ + typedef CGAL::LineH3< CGAL::Quotient< NT >, NT >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::SegmentH3< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::SegmentH3< CGAL::Quotient< NT >, NT >* pointer; \ + typedef const CGAL::SegmentH3< CGAL::Quotient< NT >, NT >& reference; \ + }; \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::SegmentH3< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::SegmentH3< CGAL::Quotient< NT >, NT >* pointer; \ + typedef CGAL::SegmentH3< CGAL::Quotient< NT >, NT >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::RayH3< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::RayH3< CGAL::Quotient< NT >, NT >* pointer; \ + typedef const CGAL::RayH3< CGAL::Quotient< NT >, NT >& reference; \ + }; \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::RayH3< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::RayH3< CGAL::Quotient< NT >, NT >* pointer; \ + typedef CGAL::RayH3< CGAL::Quotient< NT >, NT >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::TriangleH3< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::TriangleH3< CGAL::Quotient< NT >, NT >* pointer; \ + typedef const CGAL::TriangleH3< CGAL::Quotient< NT >, NT >& reference; \ + }; \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::TriangleH3< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::TriangleH3< CGAL::Quotient< NT >, NT >* pointer; \ + typedef CGAL::TriangleH3< CGAL::Quotient< NT >, NT >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::TetrahedronH3< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::TetrahedronH3< CGAL::Quotient< NT >, NT >* pointer; \ + typedef const CGAL::TetrahedronH3< CGAL::Quotient< NT >, NT >& reference; \ + }; \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::TetrahedronH3< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::TetrahedronH3< CGAL::Quotient< NT >, NT >* pointer; \ + typedef CGAL::TetrahedronH3< CGAL::Quotient< NT >, NT >& reference; \ + }; \ +__STL_END_NAMESPACE \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Aff_transformationH3< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::Aff_transformationH3< CGAL::Quotient< NT >, NT >* pointer; \ + typedef const CGAL::Aff_transformationH3< CGAL::Quotient< NT >, NT >& reference; \ + }; \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::Aff_transformationH3< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::Aff_transformationH3< CGAL::Quotient< NT >, NT >* pointer; \ + typedef CGAL::Aff_transformationH3< CGAL::Quotient< NT >, NT >& reference; \ + }; \ +__STL_END_NAMESPACE \ + +#define CGAL_ITERATOR_TRAITS_POINTER_SPECHD(NT) \ +__STL_BEGIN_NAMESPACE \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::PointHd< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef const CGAL::PointHd< CGAL::Quotient< NT >, NT >* pointer; \ + typedef const CGAL::PointHd< CGAL::Quotient< NT >, NT >& reference; \ + }; \ + template <> \ + struct iterator_traits, NT >*> { \ + typedef random_access_iterator_tag iterator_category; \ + typedef CGAL::PointHd< CGAL::Quotient< NT >, NT > value_type; \ + typedef ptrdiff_t difference_type; \ + typedef CGAL::PointHd< CGAL::Quotient< NT >, NT >* pointer; \ + typedef CGAL::PointHd< CGAL::Quotient< NT >, NT >& reference; \ + }; \ +__STL_END_NAMESPACE \ + + + +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2H( int ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3H( int ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DH( int ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2H( long ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3H( long ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DH( long ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2H( float ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3H( float ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DH( float ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2H( double ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3H( double ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DH( double ) + +CGAL_ITERATOR_TRAITS_POINTER_SPECH2( int ) +CGAL_ITERATOR_TRAITS_POINTER_SPECH3( int ) +CGAL_ITERATOR_TRAITS_POINTER_SPECHD( int ) +CGAL_ITERATOR_TRAITS_POINTER_SPECH2( long ) +CGAL_ITERATOR_TRAITS_POINTER_SPECH3( long ) +CGAL_ITERATOR_TRAITS_POINTER_SPECHD( long ) +CGAL_ITERATOR_TRAITS_POINTER_SPECH2( float ) +CGAL_ITERATOR_TRAITS_POINTER_SPECH3( float ) +CGAL_ITERATOR_TRAITS_POINTER_SPECHD( float ) +CGAL_ITERATOR_TRAITS_POINTER_SPECH2( double ) +CGAL_ITERATOR_TRAITS_POINTER_SPECH3( double ) +CGAL_ITERATOR_TRAITS_POINTER_SPECHD( double ) + +class leda_real; +class leda_integer; +class leda_rational; +class leda_bigfloat; + +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2H( leda_real ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3H( leda_real ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DH( leda_real ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2H( leda_integer ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3H( leda_integer ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DH( leda_integer ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2H( leda_rational ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3H( leda_rational ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DH( leda_rational ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2H( leda_bigfloat ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3H( leda_bigfloat ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DH( leda_bigfloat ) + +CGAL_ITERATOR_TRAITS_POINTER_SPECH2( leda_real ) +CGAL_ITERATOR_TRAITS_POINTER_SPECH3( leda_real ) +CGAL_ITERATOR_TRAITS_POINTER_SPECHD( leda_real ) +CGAL_ITERATOR_TRAITS_POINTER_SPECH2( leda_integer ) +CGAL_ITERATOR_TRAITS_POINTER_SPECH3( leda_integer ) +CGAL_ITERATOR_TRAITS_POINTER_SPECHD( leda_integer ) +CGAL_ITERATOR_TRAITS_POINTER_SPECH2( leda_rational ) +CGAL_ITERATOR_TRAITS_POINTER_SPECH3( leda_rational ) +CGAL_ITERATOR_TRAITS_POINTER_SPECHD( leda_rational ) +CGAL_ITERATOR_TRAITS_POINTER_SPECH2( leda_bigfloat ) +CGAL_ITERATOR_TRAITS_POINTER_SPECH3( leda_bigfloat ) +CGAL_ITERATOR_TRAITS_POINTER_SPECHD( leda_bigfloat ) + + +namespace CGAL { class Gmpz; } + +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2H( CGAL::Gmpz ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3H( CGAL::Gmpz ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DH( CGAL::Gmpz ) + +CGAL_ITERATOR_TRAITS_POINTER_SPECH2( CGAL::Gmpz ) +CGAL_ITERATOR_TRAITS_POINTER_SPECH3( CGAL::Gmpz ) +CGAL_ITERATOR_TRAITS_POINTER_SPECHD( CGAL::Gmpz ) + +// Quotient.h must be have been included +#ifndef CGAL_QUOTIENT_H +#error +#endif // CGAL_QUOTIENT_H + +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2H( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3H( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DH( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2H( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3H( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DH( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2H( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3H( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DH( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2H( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3H( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DH( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2H( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3H( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DH( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2H( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3H( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DH( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_2H( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_3H( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPEC_DH( CGAL::Quotient ) + +CGAL_ITERATOR_TRAITS_POINTER_SPECH2( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECH3( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECHD( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECH2( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECH3( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECHD( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECH2( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECH3( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECHD( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECH2( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECH3( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECHD( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECH2( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECH3( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECHD( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECH2( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECH3( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECHD( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECH2( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECH3( CGAL::Quotient ) +CGAL_ITERATOR_TRAITS_POINTER_SPECHD( CGAL::Quotient ) + +#endif // CGAL_LIMITED_ITERATOR_TRAITS_SUPPORT +#endif // CGAL_ITERATOR_TRAITS_POINTER_SPECS_FOR_HOMOGENEOUS_KERNEL_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/kernel_assertions.h b/Old_Packages/Kernel_basic/include/CGAL/kernel_assertions.h new file mode 100644 index 00000000000..026c38c8645 --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/kernel_assertions.h @@ -0,0 +1,271 @@ +// ====================================================================== +// +// Copyright (c) 1997 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : Generated from script create_assertions.sh +// file : include/CGAL/kernel_assertions.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : +// revision_date : 15 Mar 1999 +// author(s) : script by Geert-Jan Giezeman and Sven Schönherr +// +// coordinator : MPI, Saarbruecken +// +// ====================================================================== + + + +// macro definitions +// ================= +// assertions +// ---------- + + +#if defined(CGAL_KERNEL_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ + || defined(NDEBUG) +# define CGAL_kernel_assertion(EX) ((void)0) +# define CGAL_kernel_assertion_msg(EX,MSG) ((void)0) +# define CGAL_kernel_assertion_code(CODE) +#else +# define CGAL_kernel_assertion(EX) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_assertion_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_assertion_code(CODE) CODE +#endif // CGAL_KERNEL_NO_ASSERTIONS + +#if defined(CGAL_KERNEL_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || defined(NDEBUG) +# define CGAL_kernel_exactness_assertion(EX) ((void)0) +# define CGAL_kernel_exactness_assertion_msg(EX,MSG) ((void)0) +# define CGAL_kernel_exactness_assertion_code(CODE) +#else +# define CGAL_kernel_exactness_assertion(EX) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_exactness_assertion_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_exactness_assertion_code(CODE) CODE +#endif // CGAL_KERNEL_NO_ASSERTIONS + +#if defined(CGAL_KERNEL_NO_ASSERTIONS) \ + || defined(CGAL_NO_ASSERTIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) \ + || defined(NDEBUG) +# define CGAL_kernel_expensive_assertion(EX) ((void)0) +# define CGAL_kernel_expensive_assertion_msg(EX,MSG) ((void)0) +# define CGAL_kernel_expensive_assertion_code(CODE) +#else +# define CGAL_kernel_expensive_assertion(EX) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_expensive_assertion_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_expensive_assertion_code(CODE) CODE +#endif // CGAL_KERNEL_NO_ASSERTIONS + +#if defined(CGAL_KERNEL_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) \ + || defined(NDEBUG) +# define CGAL_kernel_expensive_exactness_assertion(EX) ((void)0) +# define CGAL_kernel_expensive_exactness_assertion_msg(EX,MSG) ((void)0) +# define CGAL_kernel_expensive_exactness_assertion_code(CODE) +#else +# define CGAL_kernel_expensive_exactness_assertion(EX) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_expensive_exactness_assertion_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_expensive_exactness_assertion_code(CODE) CODE +#endif // CGAL_KERNEL_NO_ASSERTIONS + + +// preconditions +// ------------- + +#if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ + || defined(NDEBUG) +# define CGAL_kernel_precondition(EX) ((void)0) +# define CGAL_kernel_precondition_msg(EX,MSG) ((void)0) +# define CGAL_kernel_precondition_code(CODE) +#else +# define CGAL_kernel_precondition(EX) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_precondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_precondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_PRECONDITIONS + +#if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || defined(NDEBUG) +# define CGAL_kernel_exactness_precondition(EX) ((void)0) +# define CGAL_kernel_exactness_precondition_msg(EX,MSG) ((void)0) +# define CGAL_kernel_exactness_precondition_code(CODE) +#else +# define CGAL_kernel_exactness_precondition(EX) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_exactness_precondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_exactness_precondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_PRECONDITIONS + +#if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) \ + || defined(NDEBUG) +# define CGAL_kernel_expensive_precondition(EX) ((void)0) +# define CGAL_kernel_expensive_precondition_msg(EX,MSG) ((void)0) +# define CGAL_kernel_expensive_precondition_code(CODE) +#else +# define CGAL_kernel_expensive_precondition(EX) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_expensive_precondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_expensive_precondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_PRECONDITIONS + +#if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) \ + || defined(NDEBUG) +# define CGAL_kernel_expensive_exactness_precondition(EX) ((void)0) +# define CGAL_kernel_expensive_exactness_precondition_msg(EX,MSG) ((void)0) +# define CGAL_kernel_expensive_exactness_precondition_code(CODE) +#else +# define CGAL_kernel_expensive_exactness_precondition(EX) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_expensive_exactness_precondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_expensive_exactness_precondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_PRECONDITIONS + + +// postconditions +// -------------- + +#if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ + || defined(NDEBUG) +# define CGAL_kernel_postcondition(EX) ((void)0) +# define CGAL_kernel_postcondition_msg(EX,MSG) ((void)0) +# define CGAL_kernel_postcondition_code(CODE) +#else +# define CGAL_kernel_postcondition(EX) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_postcondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_postcondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_POSTCONDITIONS + +#if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || defined(NDEBUG) +# define CGAL_kernel_exactness_postcondition(EX) ((void)0) +# define CGAL_kernel_exactness_postcondition_msg(EX,MSG) ((void)0) +# define CGAL_kernel_exactness_postcondition_code(CODE) +#else +# define CGAL_kernel_exactness_postcondition(EX) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_exactness_postcondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_exactness_postcondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_POSTCONDITIONS + +#if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) \ + || defined(NDEBUG) +# define CGAL_kernel_expensive_postcondition(EX) ((void)0) +# define CGAL_kernel_expensive_postcondition_msg(EX,MSG) ((void)0) +# define CGAL_kernel_expensive_postcondition_code(CODE) +#else +# define CGAL_kernel_expensive_postcondition(EX) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_expensive_postcondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_expensive_postcondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_POSTCONDITIONS + +#if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) \ + || defined(NDEBUG) +# define CGAL_kernel_expensive_exactness_postcondition(EX) ((void)0) +# define CGAL_kernel_expensive_exactness_postcondition_msg(EX,MSG) ((void)0) +# define CGAL_kernel_expensive_exactness_postcondition_code(CODE) +#else +# define CGAL_kernel_expensive_exactness_postcondition(EX) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_expensive_exactness_postcondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_expensive_exactness_postcondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_POSTCONDITIONS + + +// warnings +// -------- + +#if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ + || defined(NDEBUG) +# define CGAL_kernel_warning(EX) ((void)0) +# define CGAL_kernel_warning_msg(EX,MSG) ((void)0) +# define CGAL_kernel_warning_code(CODE) +#else +# define CGAL_kernel_warning(EX) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_warning_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_warning_code(CODE) CODE +#endif // CGAL_KERNEL_NO_WARNINGS + +#if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || defined(NDEBUG) +# define CGAL_kernel_exactness_warning(EX) ((void)0) +# define CGAL_kernel_exactness_warning_msg(EX,MSG) ((void)0) +# define CGAL_kernel_exactness_warning_code(CODE) +#else +# define CGAL_kernel_exactness_warning(EX) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_exactness_warning_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_exactness_warning_code(CODE) CODE +#endif // CGAL_KERNEL_NO_WARNINGS + +#if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) \ + || defined(NDEBUG) +# define CGAL_kernel_expensive_warning(EX) ((void)0) +# define CGAL_kernel_expensive_warning_msg(EX,MSG) ((void)0) +# define CGAL_kernel_expensive_warning_code(CODE) +#else +# define CGAL_kernel_expensive_warning(EX) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_expensive_warning_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_expensive_warning_code(CODE) CODE +#endif // CGAL_KERNEL_NO_WARNINGS + +#if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) \ + || defined(NDEBUG) +# define CGAL_kernel_expensive_exactness_warning(EX) ((void)0) +# define CGAL_kernel_expensive_exactness_warning_msg(EX,MSG) ((void)0) +# define CGAL_kernel_expensive_exactness_warning_code(CODE) +#else +# define CGAL_kernel_expensive_exactness_warning(EX) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_expensive_exactness_warning_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_expensive_exactness_warning_code(CODE) CODE +#endif // CGAL_KERNEL_NO_WARNINGS + + diff --git a/Old_Packages/Kernel_basic/include/CGAL/kernel_basic.h b/Old_Packages/Kernel_basic/include/CGAL/kernel_basic.h new file mode 100644 index 00000000000..6971112a22a --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/kernel_basic.h @@ -0,0 +1,40 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : kernel_basic.fw +// file : kernel_basic.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_KERNEL_BASIC_H +#define CGAL_KERNEL_BASIC_H + +#define CGAL_KERNEL_INLINE inline +#define CGAL_KERNEL_MEDIUM_INLINE +#define CGAL_KERNEL_LARGE_INLINE +#define CGAL_KERNEL_CTOR_INLINE +#define CGAL_KERNEL_CTOR_MEDIUM_INLINE +#define CGAL_KERNEL_CTOR_LARGE_INLINE + +#define CGAL_FRIEND_INLINE +#define CGAL_KERNEL_FRIEND_INLINE + +#endif // CGAL_KERNEL_BASIC_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/kernel_to_kernel.h b/Old_Packages/Kernel_basic/include/CGAL/kernel_to_kernel.h new file mode 100644 index 00000000000..777e800d53c --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/kernel_to_kernel.h @@ -0,0 +1,142 @@ + +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : webmisc/kernel_to_kernel.fw +// file : include/CGAL/kernel_to_kernel.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifdef CGAL_USE_LEDA +#include +#include +#endif // CGAL_USE_LEDA + +namespace CGAL { + +template +struct Cartesian_double_to_Homogeneous +{ + typedef Point_2< Homogeneous< NumberType> > Point2; + typedef Segment_2< Homogeneous< NumberType> > Segment; + + Point2 + operator()( const Point_2 >& p) + { return Point2( NumberType(p.x()), NumberType(p.y()) ); } + + Segment + operator()( const Segment_2 >& s) + { + return Segment( Point2( NumberType(s.source().x()), + NumberType(s.source().y()) ), + Point2( NumberType(s.target().x()), + NumberType(s.target().y()) ) ); + } +}; + + +template +struct Cartesian_double_to_Cartesian +{ + typedef Point_2< Cartesian< NumberType> > Point2; + typedef Point_3< Cartesian< NumberType> > Point3; + typedef Segment_2< Cartesian< NumberType> > Segment; + + Point2 + operator()( const Point_2 >& p) + { return Point2( NumberType(p.x()), NumberType(p.y()) ); } + + Point3 + operator()( const Point_3 >& p) + { return Point3( NumberType(p.x()), + NumberType(p.y()), + NumberType(p.z()) ); } + + Segment + operator()( const Segment_2 >& s) + { + return Segment( Point2( NumberType(s.source().x()), + NumberType(s.source().y()) ), + Point2( NumberType(s.target().x()), + NumberType(s.target().y()) ) ); + } +}; + +template +struct Cartesian_float_to_Cartesian +{ + typedef Point_2< Cartesian< NumberType> > Point2; + typedef Segment_2< Cartesian< NumberType> > Segment; + + Point2 + operator()( const Point_2 >& p) + { return Point2( NumberType(p.x()), NumberType(p.y()) ); } + + Segment + operator()( const Segment_2 >& s) + { + return Segment( Point2( NumberType(s.source().x()), + NumberType(s.source().y()) ), + Point2( NumberType(s.target().x()), + NumberType(s.target().y()) ) ); + } +}; + + +#ifdef CGAL_USE_LEDA +struct Cartesian_double_to_H_double_int +{ + typedef Point_2< Homogeneous< double> > Point2; + typedef Segment_2< Homogeneous< double> > Segment; + + Segment + operator()( const Segment_2< Cartesian< double> >& s) + { + leda_rat_point rs = leda_point(s.source().x(), s.source().y()); + leda_rat_point rt = leda_point(s.target().x(), s.target().y()); + + return + Segment( + Point2(::to_double(rs.X()),::to_double(rs.Y()),::to_double(rs.W())), + Point2(::to_double(rt.X()),::to_double(rt.Y()),::to_double(rt.W())) ); + } +}; + +struct Cartesian_float_to_H_double_int +{ + typedef Point_2< Homogeneous< double> > Point2; + typedef Segment_2< Homogeneous< double> > Segment; + + Segment + operator()( const Segment_2< Cartesian< float> >& s) + { + leda_rat_point rs = leda_point(s.source().x(), s.source().y()); + leda_rat_point rt = leda_point(s.target().x(), s.target().y()); + + return + Segment( + Point2(::to_double(rs.X()),::to_double(rs.Y()),::to_double(rs.W())), + Point2(::to_double(rt.X()),::to_double(rt.Y()),::to_double(rt.W())) ); + } +}; +#endif // CGAL_USE_LEDA + +} // namespace CGAL diff --git a/Old_Packages/Kernel_basic/include/CGAL/known_bit_size_integers.h b/Old_Packages/Kernel_basic/include/CGAL/known_bit_size_integers.h new file mode 100644 index 00000000000..44744f9c9fe --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/known_bit_size_integers.h @@ -0,0 +1,74 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : basic.fw +// file : known_bit_size_integers.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Lutz Kettner +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_KNOWN_BIT_SIZE_INTEGERS_H +#define CGAL_KNOWN_BIT_SIZE_INTEGERS_H +CGAL_BEGIN_NAMESPACE + + +#if (defined(__sparc__) || defined(__sparc) || defined(sparc)) || \ + (defined(__sgi__) || defined(__sgi) || defined(sgi)) || \ + (defined(__i386__) || defined(__i386) || defined(i386)) || \ + (defined(__powerpc__) || defined(__powerpc) || defined(powerpc)) + typedef signed char Integer8; + typedef short Integer16; + typedef int Integer32; + typedef unsigned char UInteger8; + typedef unsigned short UInteger16; + typedef unsigned int UInteger32; +// ANSI C++ does not support `long long' +// typedef long long int Integer64; +// typedef unsigned long long int UInteger64; +// the above definitions for long long are now in file +// include/CGAL/long_long.h and not included automatically anymore +#else +# if defined(__BORLANDC__) + typedef __int8 Integer8; + typedef __int16 Integer16; + typedef __int32 Integer32; + typedef __int64 Integer64; + typedef unsigned __int8 UInteger8; + typedef unsigned __int16 UInteger16; + typedef unsigned __int32 UInteger32; + typedef unsigned __int64 UInteger64; +# else +# if defined(_MSC_VER) + typedef signed char Integer8; + typedef short Integer16; + typedef int Integer32; + typedef __int64 Integer64; + typedef unsigned char UInteger8; + typedef unsigned short UInteger16; + typedef unsigned int UInteger32; + typedef unsigned __int64 UInteger64; +# else +# error "patch this" +# endif +# endif +#endif + +CGAL_END_NAMESPACE + +#endif // CGAL_KNOWN_BIT_SIZE_INTEGERS_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/memory.h b/Old_Packages/Kernel_basic/include/CGAL/memory.h new file mode 100644 index 00000000000..a3e510dc167 --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/memory.h @@ -0,0 +1,39 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : Memory.fw +// file : memory.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Michael Seel +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_MEMORY_H +#define CGAL_MEMORY_H +#include + +#ifdef CGAL_USE_LEDA +#include +#define CGAL_ALLOCATOR(t) leda_allocator< t > +#define CGAL_ALLOC leda_allocator +#else +#define CGAL_ALLOCATOR(t) std::allocator< t > +#define CGAL_ALLOC std::allocator +#endif + +#endif // CGAL_MEMORY_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/misc.h b/Old_Packages/Kernel_basic/include/CGAL/misc.h new file mode 100644 index 00000000000..ba3dc726f33 --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/misc.h @@ -0,0 +1,81 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : misc.fw +// file : misc.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_MISC_H +#define CGAL_MISC_H + +#include + +CGAL_BEGIN_NAMESPACE + + +/* +template < class T > +inline +void +swap(T& a, T& b) +{ + T c; + c = a; + a = b; + b = c; +} +*/ + +#ifndef CGAL_CFG_NO_EXPLICIT_TEMPLATE_FUNCTION_ARGUMENT_SPECIFICATION +// A helper class: +// --------------------- +template +struct converter +{ + static inline Target do_it(const Source& s) + { return static_cast(s); } +}; + +template +inline +Target +convert_to (const Source& s) +{ return converter::do_it(s); } + +/* +template +inline +Target +convert_to( const Source& s) +{ return Target(s); } +*/ +#endif // CGAL_CFG_NO_EXPLICIT_TEMPLATE_FUNCTION_ARGUMENT_SPECIFICATION + +template +inline +Target +convert_from_to( const Target& t, const Source& s) +{ return Target(s); } + +CGAL_END_NAMESPACE + +#endif // CGAL_MISC_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/predicates/sign_of_determinant.h b/Old_Packages/Kernel_basic/include/CGAL/predicates/sign_of_determinant.h new file mode 100644 index 00000000000..1f530900518 --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/predicates/sign_of_determinant.h @@ -0,0 +1,116 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : determinant.fw +// file : predicates/sign_of_determinant.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Sylvain Pion +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_PREDICATES_SIGN_OF_DETERMINANT_H +#define CGAL_PREDICATES_SIGN_OF_DETERMINANT_H + +#ifndef CGAL_DETERMINANT_H +#include +#endif // CGAL_DETERMINANT_H + +CGAL_BEGIN_NAMESPACE + +template +inline +Sign +sign_of_determinant2x2( const FT& a00, const FT& a01, + const FT& a10, const FT& a11) +{ + return + static_cast(static_cast(CGAL_NTS compare( a00*a11, a10*a01))); +} + +template +inline +Sign +sign_of_determinant3x3( const FT& a00, const FT& a01, const FT& a02, + const FT& a10, const FT& a11, const FT& a12, + const FT& a20, const FT& a21, const FT& a22) +{ + return CGAL_NTS sign(det3x3_by_formula(a00, a01, a02, + a10, a11, a12, + a20, a21, a22)); +} + +template +inline +Sign +sign_of_determinant4x4( + const FT& a00, const FT& a01, const FT& a02, const FT& a03, + const FT& a10, const FT& a11, const FT& a12, const FT& a13, + const FT& a20, const FT& a21, const FT& a22, const FT& a23, + const FT& a30, const FT& a31, const FT& a32, const FT& a33) +{ + return CGAL_NTS sign(det4x4_by_formula(a00, a01, a02, a03, + a10, a11, a12, a13, + a20, a21, a22, a23, + a30, a31, a32, a33)); +} + +template +CGAL_KERNEL_LARGE_INLINE +Sign +sign_of_determinant5x5( + const FT& a00, const FT& a01, const FT& a02, const FT& a03, const FT& a04, + const FT& a10, const FT& a11, const FT& a12, const FT& a13, const FT& a14, + const FT& a20, const FT& a21, const FT& a22, const FT& a23, const FT& a24, + const FT& a30, const FT& a31, const FT& a32, const FT& a33, const FT& a34, + const FT& a40, const FT& a41, const FT& a42, const FT& a43, const FT& a44) +{ + return CGAL_NTS sign(det5x5_by_formula(a00, a01, a02, a03, a04, + a10, a11, a12, a13, a14, + a20, a21, a22, a23, a24, + a30, a31, a32, a33, a34, + a40, a41, a42, a43, a44)); +} + +template +CGAL_KERNEL_LARGE_INLINE +Sign +sign_of_determinant6x6( + const FT& a00, const FT& a01, const FT& a02, const FT& a03, const FT& a04, const FT& a05, + const FT& a10, const FT& a11, const FT& a12, const FT& a13, const FT& a14, const FT& a15, + const FT& a20, const FT& a21, const FT& a22, const FT& a23, const FT& a24, const FT& a25, + const FT& a30, const FT& a31, const FT& a32, const FT& a33, const FT& a34, const FT& a35, + const FT& a40, const FT& a41, const FT& a42, const FT& a43, const FT& a44, const FT& a45, + const FT& a50, const FT& a51, const FT& a52, const FT& a53, const FT& a54, const FT& a55) +{ + return CGAL_NTS sign(det6x6_by_formula(a00, a01, a02, a03, a04, a05, + a10, a11, a12, a13, a14, a15, + a20, a21, a22, a23, a24, a25, + a30, a31, a32, a33, a34, a35, + a40, a41, a42, a43, a44, a45, + a50, a51, a52, a53, a54, a55)); +} + +CGAL_END_NAMESPACE + + +#ifdef CGAL_ARITHMETIC_FILTER_H +#include +#endif // CGAL_ARITHMETIC_FILTER_H + +#endif // CGAL_PREDICATES_SIGN_OF_DETERMINANT_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/rational_rotation.h b/Old_Packages/Kernel_basic/include/CGAL/rational_rotation.h new file mode 100644 index 00000000000..6e4b22d4b48 --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/rational_rotation.h @@ -0,0 +1,279 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : rational_rotation.fw +// file : rational_rotation.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_RATIONAL_ROTATION_H +#define CGAL_RATIONAL_ROTATION_H + +#include + +CGAL_BEGIN_NAMESPACE + +template < class NT > +void +rational_rotation_approximation( const NT & dirx, // dir.x() + const NT & diry, // dir.y() + NT & sin_num, // return + NT & cos_num, // return + NT & denom, // return + const NT & eps_num, // quality_bound + const NT & eps_den ) +{ +#ifndef CGAL_CFG_NO_NAMESPACE + using std::swap; +#endif // CGAL_CFG_NO_NAMESPACE + + const NT& n = eps_num; + const NT& d = eps_den; + const NT NT0 = NT(0) ; + const NT NT1 = NT(1) ; + CGAL_kernel_precondition( n > NT0 ); + CGAL_kernel_precondition( d > NT0 ); + NT & sin = sin_num; + NT & cos = cos_num; + NT & den = denom; + NT dx = CGAL_NTS abs(dirx); + NT dy = CGAL_NTS abs(diry); + NT sq_hypotenuse = dx*dx + dy*dy; + NT common_part; + NT diff_part; + NT rhs; + bool lower_ok; + bool upper_ok; + + if (dy > dx) + { + swap (dx,dy); + } + // approximate sin = dy / sqrt(sq_hypotenuse) + // if ( dy / sqrt(sq_hypotenuse) < n/d ) + if (dy * dy * d * d < sq_hypotenuse * n * n) + { + cos = NT1; + sin = NT0; + den = NT1; + } + else + { + NT p; + NT q; + NT p0 = NT0; + NT q0 = NT1; + NT p1 = NT1; + NT q1 = NT1; + + for(;;) + { + p = p0 + p1; + q = q0 + q1; + sin = NT(2)*p*q; + den = p*p + q*q; + + // sanity check for approximation + // sin/den < dy/sqrt(hypotenuse) + n/d + // && sin/den > dy/sqrt(hypotenuse) - n/d + // === sin/den - n/d < dy/sqrt(sq_hypotenuse) + // && sin/den + n/d > dy/sqrt(sq_hypotenuse) + // === (sin^2 d^2 + n^2 den^2)sq_hypotenuse - 2... < dy^2 d^2 den^2 + // && (sin^2 d^2 + n^2 den^2)sq_hypotenuse + 2... > dy^2 d^2 den^2 + + common_part = (sin*sin*d*d + n*n*den*den)*sq_hypotenuse; + diff_part = NT(2)*n*sin*d*den*sq_hypotenuse; + rhs = dy*dy*d*d*den*den; + + upper_ok = (common_part - diff_part < rhs); + lower_ok = (common_part + diff_part > rhs); + + if ( lower_ok && upper_ok ) + { + // if ( (p*p)%2 + (q*q)%2 > NT1) + // { + // sin = p*q; + // cos = (q*q - p*p)/2; // exact division + // den = (p*p + q*q)/2; // exact division + // } + // else + // { + cos = q*q - p*p; + // } + + break; + } + else + { + // if ( dy/sqrt(sq_hypotenuse) < sin/den ) + if ( dy*dy*den*den < sin*sin*sq_hypotenuse ) + { + p1 = p; + q1 = q; + } + else + { + p0 = p; + q0 = q; + } + } + } // for(;;) + } + dx = dirx; + dy = diry; + + + if (dy > dx ) { swap (sin,cos); } + + if (dx < NT0) { cos = - cos; } + + if (dy < NT0) { sin = - sin; } + + sin_num = sin; + cos_num = cos; + denom = den; +} + + +template < class NT > +void +rational_rotation_approximation( const double& angle, + NT & sin_num, // return + NT & cos_num, // return + NT & denom, // return + const NT & eps_num, // quality_bound + const NT & eps_den ) +{ +#ifndef CGAL_CFG_NO_NAMESPACE + using std::swap; +#endif // CGAL_CFG_NO_NAMESPACE + + const NT& n = eps_num; + const NT& d = eps_den; + const NT NT0 = NT(0) ; + const NT NT1 = NT(1) ; + CGAL_kernel_precondition( n > NT0 ); + CGAL_kernel_precondition( d > NT0 ); + NT& isin = sin_num; + NT& icos = cos_num; + NT& iden = denom; + double dsin = sin(angle); + double dcos = cos(angle); + double dn = CGAL::to_double(n); + double dd = CGAL::to_double(d); + double eps = dn / dd; + dsin = CGAL_NTS abs( dsin); + dcos = CGAL_NTS abs( dcos); + NT common_part; + NT diff_part; + NT os; + bool lower_ok; + bool upper_ok; + bool swapped = false; + + if (dsin > dcos) + { + swapped = true; + swap (dsin,dcos); + } + if ( dsin < eps ) + { + icos = NT1; + isin = NT0; + iden = NT1; + } + else + { + NT p; + NT q; + NT p0 = NT0; + NT q0 = NT1; + NT p1 = NT1; + NT q1 = NT1; + + for(;;) + { + p = p0 + p1; + q = q0 + q1; + isin = NT(2)*p*q; + iden = p*p + q*q; + + // XXX sanity check for approximation + // sin/den < dsin + n/d + // && sin/den > dsin - n/d + // sin < dsin * den + n/d * den + // && sin > dsin * den - n/d * den + os = CGAL::to_double(isin); + diff_part = eps * CGAL::to_double(iden); + common_part = dsin * CGAL::to_double(iden); + + upper_ok = (common_part - diff_part < os); + lower_ok = (os < common_part + diff_part); + + if ( lower_ok && upper_ok ) + { + // if ( (p*p)%2 + (q*q)%2 > NT1) + // { + // isin = p*q; + // icos = (q*q - p*p)/2; // exact division + // iden = (p*p + q*q)/2; // exact division + // } + // else + // { + icos = q*q - p*p; + // } + + break; + } + else + { + // XXX if ( dsin < sin/den ) + if ( dsin * CGAL::to_double(iden) < CGAL::to_double(isin) ) + { + p1 = p; + q1 = q; + } + else + { + p0 = p; + q0 = q; + } + } + } // for(;;) + } + + if ( swapped ) { swap (isin,icos); } + + dsin = sin( angle); + dcos = cos( angle); + if (dcos < 0.0) { icos = - icos; } + if (dsin < 0.0) { isin = - isin; } + + sin_num = isin; + cos_num = icos; + denom = iden; +} + + +CGAL_END_NAMESPACE + + +#endif // CGAL_RATIONAL_ROTATION_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/representation_tags.h b/Old_Packages/Kernel_basic/include/CGAL/representation_tags.h new file mode 100644 index 00000000000..7ac404c1e7f --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/representation_tags.h @@ -0,0 +1,37 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : representation_tags.fw +// file : representation_tags.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_REPRESENTATION_TAGS_H +#define CGAL_REPRESENTATION_TAGS_H +CGAL_BEGIN_NAMESPACE + +class Cartesian_tag {}; +class Homogeneous_tag {}; +class Old_style_tag {}; + +CGAL_END_NAMESPACE + +#endif // CGAL_REPRESENTATION_TAGS_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/solve.h b/Old_Packages/Kernel_basic/include/CGAL/solve.h new file mode 100644 index 00000000000..7f59b9123f7 --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/solve.h @@ -0,0 +1,68 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : solve.fw +// file : solve.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_SOLVE_H +#define CGAL_SOLVE_H + +CGAL_BEGIN_NAMESPACE + + +template +void solve (const FT &a1, const FT &a2, const FT &a3, + const FT &b1, const FT &b2, const FT &b3, + const FT &c1, const FT &c2, const FT &c3, + const FT &d1, const FT &d2, const FT &d3, + FT &x, FT &y, FT &z) +{ + FT denom = b2*c1*a3-b1*c2*a3+c3*b1*a2+b3*c2*a1-c1*b3*a2-b2*c3*a1; + + x = - (b2*c3*d1-b2*c1*d3+c1*b3*d2+b1*c2*d3-c3*b1*d2-b3*c2*d1)/denom; + + z = (b2*d1*a3-b2*a1*d3+b1*a2*d3-b1*d2*a3-d1*b3*a2+a1*b3*d2)/denom; + + y = (a2*c3*d1-a2*c1*d3-c2*d1*a3+c2*a1*d3+d2*c1*a3-d2*c3*a1)/denom; +} + + +// this is for a parabola c1, c2, c3 are equal to 1 +template +void solve_quadratic (const FT &a1, const FT &a2, const FT &a3, + const FT &b1, const FT &b2, const FT &b3, + const FT &d1, const FT &d2, const FT &d3, + FT &x, FT &y, FT &z) +{ + FT denom = b2*a3-b1*a3+b1*a2+b3*a1-b3*a2-b2*a1; + + x = - (b2*d1-b2*d3+b3*d2+b1*d3-b1*d2-b3*d1)/denom; + + z = (b2*d1*a3-b2*a1*d3+b1*a2*d3-b1*d2*a3-d1*b3*a2+a1*b3*d2)/denom; + + y = (a2*d1-a2*d3-d1*a3+a1*d3+d2*a3-d2*a1)/denom; +} + + +CGAL_END_NAMESPACE + +#endif // CGAL_SOLVE_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/tags.h b/Old_Packages/Kernel_basic/include/CGAL/tags.h new file mode 100644 index 00000000000..dac718184d6 --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/tags.h @@ -0,0 +1,42 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : tags.fw +// file : tags.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_TAGS_H +#define CGAL_TAGS_H + +#ifndef CGAL_AFF_TRANSFORMATION_TAGS_H +#include +#endif // CGAL_AFF_TRANSFORMATION_TAGS_H +#ifndef CGAL_NUMBER_TYPE_TAGS_H +#include +#endif // CGAL_NUMBER_TYPE_TAGS_H +#ifndef CGAL_IO_IO_TAGS_H +#include +#endif // CGAL_IO_IO_TAGS_H + +// compile time assertion tags are in + +#endif // CGAL_TAGS_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/user_classes.h b/Old_Packages/Kernel_basic/include/CGAL/user_classes.h new file mode 100644 index 00000000000..654c8e45228 --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/user_classes.h @@ -0,0 +1,111 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : user_classes.fw +// file : user_classes.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_USER_CLASSES_H +#define CGAL_USER_CLASSES_H + +CGAL_BEGIN_NAMESPACE + +template < class R > +class Point_2; + +template < class R > +class Vector_2; + +template < class R > +class Direction_2; + +template < class R > +class Line_2; + +template < class R > +class Ray_2; + +template < class R > +class Segment_2; + +template < class R > +class Triangle_2; + +template < class R > +class Iso_rectangle_2; + +template < class R > +class Circle_2; + +template < class R > +class Aff_transformation_base_2; + +template < class R > +class Aff_transformation_2; + +template < class R > +class Aff_transformation_3; + +template < class R > +class Plane_3; + +template < class FT > +class Point_3; + +template < class FT > +class Vector_3; + +template < class FT > +class Direction_3; + +template < class R > +class Line_3; + +template < class FT > +class Ray_3; + +template < class FT > +class Segment_3; + +template < class FT > +class Triangle_3; + +template < class FT > +class Tetrahedron_3; + +template < class R > +class Iso_cuboid_3; + +template < class R > +class Sphere_3; + +// template < class R > +// class Vector_2_rft_wrapper; +// +// template < class R > +// class Vector_3_rft_wrapper; + +template < class R> +class Point_d; +CGAL_END_NAMESPACE + +#endif // CGAL_USER_CLASSES_H diff --git a/Old_Packages/Kernel_basic/include/CGAL/utils.h b/Old_Packages/Kernel_basic/include/CGAL/utils.h new file mode 100644 index 00000000000..5b481cbfcbd --- /dev/null +++ b/Old_Packages/Kernel_basic/include/CGAL/utils.h @@ -0,0 +1,36 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : utils.fw +// file : utils.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Geert-Jan Giezeman +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_UTILS_H +#define CGAL_UTILS_H + +#ifndef CGAL_ASSERTIONS_H +#include +#endif // CGAL_ASSERTIONS_H +#ifndef CGAL_KERNEL_ASSERTIONS_H +#include +#endif // CGAL_KERNEL_ASSERTIONS_H + +#endif diff --git a/Old_Packages/Kernel_basic/include/LEDA/allocator.h b/Old_Packages/Kernel_basic/include/LEDA/allocator.h new file mode 100644 index 00000000000..d0b6ea5df5b --- /dev/null +++ b/Old_Packages/Kernel_basic/include/LEDA/allocator.h @@ -0,0 +1,132 @@ +// ====================================================================== +// +// Copyright (c) 2000 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// file : ?/include/LEDA/allocator.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// author(s) : ? +// coordinator : ? +// +// ====================================================================== +#ifndef LEDA_ALLOCATOR_H +#define LEDA_ALLOCATOR_H + +#if !defined(LEDA_ROOT_INCL_ID) +#define LEDA_ROOT_INCL_ID 390009 +#include +#endif + + +#include + +// the following piece of code is programmed according to +// the C++ standard clause 20.4.1 + +template class leda_allocator; + +// specialize for void: +template <> class leda_allocator { +public: + typedef void* pointer; + typedef const void* const_pointer; + // reference-to-void members are impossible. + typedef void value_type; + template struct rebind { typedef leda_allocator other; }; +}; + +/*{\Manpage {leda_allocator} {T} {Memory Allocator} {A}}*/ + +template +class leda_allocator { + +/*{\Mdefinition An instance |\Mvar| of the data type |\Mname| is +a memory allocator according to the \CC standard. |\Mname| is the +standard compliant interface to the LEDA memory management.}*/ + +public: +/*{\Mtypes 5}*/ +/*{\Mtext Local types are |size_type|, |difference_type|, |value_type|, +|pointer|, |reference|, |const_pointer|, and |const_reference|.}*/ + + typedef size_t size_type; + typedef ptrdiff_t difference_type; + typedef T value_type; + typedef T* pointer; + typedef const T* const_pointer; + typedef T& reference; + typedef const T& const_reference; + + template class rebind { public: + /*{\Mtypemember allows the construction of a derived allocator:\\ + |\Mname::template rebind::other|\\ is the type + |leda_allocator|. }*/ + typedef leda_allocator other; + }; + + +/*{\Mcreation 4.5}*/ + + leda_allocator() {} + /*{\Mcreate introduces a variable |\Mvar| of type |\Mname|. }*/ + + template + leda_allocator(const leda_allocator&) {} + ~leda_allocator() {} + +/*{\Moperations 3 3 }*/ + +pointer allocate(size_type n, const_pointer = 0) +/*{\Mop returns a pointer to a newly allocated memory range of size + |n * sizeof(T)|.}*/ +{ return 0 == n ? 0 : + (T*) std_memory_mgr.allocate_bytes( n * sizeof(T) ); } + +void deallocate(pointer p, size_type n) +/*{\Mop deallocates a memory range of |n * sizeof(T)| starting + at |p|. \precond the memory range was obtained via |allocate(n)|.}*/ +{ std_memory_mgr.deallocate_bytes(p , n * sizeof(T)); } + +pointer address(reference r) +/*{\Mop returns |&r|.}*/ +{ return &r; } + +const_pointer address(const_reference r) +/*{\Mop returns |&r|.}*/ +{ return &r; } + +void construct(pointer p, const_reference r) +/*{\Mop makes an inplace new |new( (void*)p ) T(r)|.}*/ +{ new(p) value_type(r); } + +void destroy(pointer p) +/*{\Mop destroys the object referenced via |p| by calling |p->~T()|.}*/ +{ p->~T(); } + +size_type max_size() const { return std_memory_mgr.max_size(); } +/*{\Mop the largest value |n| for which the call |allocate(n,0)| + might succeed.}*/ + +}; + +/*{\Mimplementation Note that the above class template uses all kinds +of modern compiler technology like member templates, partial specialization +etc. It runs only on a subset of LEDA's general supported platforms like +|g++ > 2.95|, |SGI CC > 7.3|.}*/ + +#if LEDA_ROOT_INCL_ID == 390009 +#undef LEDA_ROOT_INCL_ID +#include +#endif + +#endif // LEDA_ALLOCATOR_H + diff --git a/Old_Packages/Kernel_basic/src/Origin.C b/Old_Packages/Kernel_basic/src/Origin.C new file mode 100644 index 00000000000..ece71d32835 --- /dev/null +++ b/Old_Packages/Kernel_basic/src/Origin.C @@ -0,0 +1,40 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : Origin.fw +// file : Origin.C +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_CONFIG_H +#include +#endif // CGAL_CONFIG_H + +#ifndef CGAL_ORIGIN_H +#include +#endif // CGAL_ORIGIN_H + +CGAL_BEGIN_NAMESPACE + +Origin ORIGIN ; +Null_vector NULL_VECTOR ; +CGAL_END_NAMESPACE + diff --git a/Old_Packages/Kernel_basic/src/aff_transformation_tags.C b/Old_Packages/Kernel_basic/src/aff_transformation_tags.C new file mode 100644 index 00000000000..ea39e6d1259 --- /dev/null +++ b/Old_Packages/Kernel_basic/src/aff_transformation_tags.C @@ -0,0 +1,40 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : aff_transformation_tags.fw +// file : aff_transformation_tags.C +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_AFF_TRANSFORMATION_TAGS_H +#include +#endif // CGAL_AFF_TRANSFORMATION_TAGS_H + +CGAL_BEGIN_NAMESPACE + + +Translation TRANSLATION; +Rotation ROTATION; +Scaling SCALING; +Reflection REFLECTION; +Identity_transformation IDENTITY; + +CGAL_END_NAMESPACE + diff --git a/Old_Packages/Kernel_basic/src/assertions.C b/Old_Packages/Kernel_basic/src/assertions.C new file mode 100644 index 00000000000..28c4871c5a5 --- /dev/null +++ b/Old_Packages/Kernel_basic/src/assertions.C @@ -0,0 +1,212 @@ +// ====================================================================== +// +// Copyright (c) 1997 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// file : assertions.C +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// source : assertions.fw +// author(s) : Geert-Jan Giezeman and Sven Schönherr +// +// coordinator : MPI, Saarbruecken () +// +// ====================================================================== + + +#include +#include +#include +#include + +#include + +CGAL_BEGIN_NAMESPACE +// not_implemented function +// ------------------------ +void +not_implemented() +{ + assert( false); +} + +// static behaviour variables +// -------------------------- + +static Failure_behaviour _error_behaviour = ABORT; +static Failure_behaviour _warning_behaviour = CONTINUE; + +// standard error handlers +// ----------------------- +static +void +_standard_error_handler( + const char* what, + const char* expr, + const char* file, + int line, + const char* msg ) +{ + std::cerr << "CGAL error: " << what << " violation!" << std::endl + << "Expr: " << expr << std::endl + << "File: " << file << std::endl + << "Line: " << line << std::endl; + if ( msg != 0) + std::cerr << "Explanation:" << msg << std::endl; +} + + +// standard warning handler +// ------------------------ +static +void +_standard_warning_handler( const char *, + const char* expr, + const char* file, + int line, + const char* msg ) +{ + std::cerr << "CGAL warning: check violation!" << std::endl + << "Expr: " << expr << std::endl + << "File: " << file << std::endl + << "Line: " << line << std::endl; + if ( msg != 0) + std::cerr << "Explanation:" << msg << std::endl; + +} + +// default handler settings +// ------------------------ +static Failure_function +_error_handler = _standard_error_handler; + +static Failure_function +_warning_handler = _standard_warning_handler; + +// failure functions +// ----------------- +void +assertion_fail( const char* expr, + const char* file, + int line, + const char* msg ) +{ + (*_error_handler)("assertion", expr, file, line, msg); + switch (_error_behaviour) { + case ABORT: + abort(); + case EXIT: + exit(1); // EXIT_FAILURE + case EXIT_WITH_SUCCESS: + exit(0); // EXIT_SUCCESS + case CONTINUE: + ; + } +} + +void +precondition_fail( const char* expr, + const char* file, + int line, + const char* msg ) +{ + (*_error_handler)("precondition", expr, file, line, msg); + switch (_error_behaviour) { + case ABORT: + abort(); + case EXIT: + exit(1); // EXIT_FAILURE + case EXIT_WITH_SUCCESS: + exit(0); // EXIT_SUCCESS + case CONTINUE: + ; + } +} + +void +postcondition_fail(const char* expr, + const char* file, + int line, + const char* msg ) +{ + (*_error_handler)("postcondition", expr, file, line, msg); + switch (_error_behaviour) { + case ABORT: + abort(); + case EXIT: + exit(1); // EXIT_FAILURE + case EXIT_WITH_SUCCESS: + exit(0); // EXIT_SUCCESS + case CONTINUE: + ; + } +} + + +// warning function +// ---------------- +void +warning_fail( const char* expr, + const char* file, + int line, + const char* msg ) +{ + (*_warning_handler)("warning", expr, file, line, msg); + switch (_warning_behaviour) { + case ABORT: + abort(); + case EXIT: + exit(1); // EXIT_FAILURE + case EXIT_WITH_SUCCESS: + exit(0); // EXIT_SUCCESS + case CONTINUE: + ; + } +} + + +// error handler set functions +// --------------------------- +Failure_function +set_error_handler( Failure_function handler) +{ + Failure_function result = _error_handler; + _error_handler = handler; + return( result); +} + +Failure_function +set_warning_handler( Failure_function handler) +{ + Failure_function result = _warning_handler; + _warning_handler = handler; + return( result); +} + +Failure_behaviour +set_error_behaviour(Failure_behaviour eb) +{ + Failure_behaviour result = _error_behaviour; + _error_behaviour = eb; + return result; +} + +Failure_behaviour +set_warning_behaviour(Failure_behaviour eb) +{ + Failure_behaviour result = _warning_behaviour; + _warning_behaviour = eb; + return result; +} + +CGAL_END_NAMESPACE + + diff --git a/Old_Packages/Kernel_basic/version b/Old_Packages/Kernel_basic/version new file mode 100644 index 00000000000..820a0b4a916 --- /dev/null +++ b/Old_Packages/Kernel_basic/version @@ -0,0 +1,2 @@ +3.17 (10 Dec 2000) +maintainer: Stefan Schirra diff --git a/Old_Packages/Kernel_test/changes.txt b/Old_Packages/Kernel_test/changes.txt new file mode 100644 index 00000000000..d12da58e251 --- /dev/null +++ b/Old_Packages/Kernel_test/changes.txt @@ -0,0 +1,230 @@ + 3.8 (08 Oct 2000) + +- #ifdef TEST_SPHERE removed in _test_3(.) + i.e., sphere test activated by default + + 3.7 (20 Sep 2000) + +- test/LedaKernel/include/CGAL/predicates_on_points_rat_leda_2.h + modified to please Borland bcc 5.5 + + 3.6 (07 Sep 2000) + +- test for Line_2::projection() added :) + + 3.5 (11 Aug 2000) + +- bug in test/Kernel/include/CGAL/_test_new_2.h fixed + missing _2 with Compute_y_at_x + + 3.4 (27 Jun 2000) + +- test for determinant functions added +- check for flag NEW_KERNEL_TRAITS removed +- flag TEST_SPHERE added + + 3.3 (19 Jun 2000) + +- test for Sphere_3 added + + 3.2 (07 Apr 2000) + +- tests for new additional kernel traits added: + * * * * * * * * * * * * + Object_2 + Assign_2 + Construct_perpendicular_direction_2 + Construct_bisector_2 + Compare_xy_2 + Equal_xy_2 + Less_x_2 + Less_y_2 + Counterclockwise_in_between_2 + * * * * * * * * * * * * + Object_3 + Assign_3 + Equal_xyz_3 + Compare_xy_3 + Equal_xy_3 + Less_x_3 + Less_y_3 + Less_z_3 + Less_xy_3 + Less_distance_to_point_3 + * * * * * * * * * * * * + currently active only if flag NEW_KERNEL_TRAITS is defined + + 3.1 (17 Feb 2000) + +- test for Direction_2::counterclockwise_in_between added + + 3.0 (02 Feb 2000) + +- directory structure reorganized + Kernel : basic tests and include/CGAL/_test* + KernelCartesian : tests for Cartesian Kernel + KernelHomogeneous : tests for homogeneous Kernel + KernelSimpleCartesian : tests for simple Cartesian + The tests include tests for NewKernel, i.e. NewKernel is obsolete now + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 2 . 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +2.3.3 -> 2.3.4 (18 Nov 99) +- missing CFG added in flag for Koenig lookup in + +- forward declarations added in + +2.3.2 -> 2.3.3 (12 Nov 99) +- workaround for M$VC++ and LedaKernel (no Koenig lookup) added to + +- test for Iso_cuboid_3 added, flagged with CGAL_STRICT21 +- gnuR template parameter renamed to R (Borland problem) + (was a workaround for problems with obsolete g++-2.7.2) + +2.3.1 -> 2.3.2 (07 Nov 99) +- IDENTITY transformation used for transformation ident in + test_cls_aff_transformation_2() +- IDENTITY transformation used for transformation ident in + test_cls_aff_transformation_3() + +2.3 -> 2.3.1 (04 Nov 99) +- test for LEDA kernel fixed: specialisation for orientation() function + template defined + +2.2.2 -> 2.3 (14 Oct 99) +- typedef Precise_integer introduced + set to CGAL::Gmpz, if CGAL_USE_GMP is defined + else to leda_integer, if CGAL_USE_LEDA is defined +- #if (__GNUG__ == 2) && (__GNUC_MINOR__==91) + CGAL::Vector_3 vv = d2.to_vector(); + #else ... ^^^ + used in _test_cls_direction_3.C instead of call of vector(), which causes + i.c.e., idem in _test_cls_plane_3.C + +2.2.1 -> 2.2.2 (28 Sep 99) +- updated use_rat_leda class in test/LedaKernel + +2.2 -> 2.2.1 (17 Sep 99) +- added tiny (=needs extension) test for 3D distance predicates + +2.1.2 -> 2.2 (14 Sep 99) +- revised test for _d part: + split into homogeneous and Cartesian test +- made sure that Homogeneous is included first :) + +2.1.1 -> 2.1.2 (05 Sep 99) +- /bin/rm replaced by rm in cgal_test in test/Kernel +- new makefile in test/Kernel + +2.1 -> 2.1.1 (09 Aug 99) +- test for coplanar_orientation() added + +2.0.6 -> 2.1 (05 Aug 99) +- cout and endl qualified by std:: (for mips 7.3) +- $(OBJ_EXT) used in makefile (for M$ VC++ ) + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 2 . 0 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +2.0.5 -> 2.0.6 (20 May 99) +- test for equality of Tetrahedra extended + +2.0.4 -> 2.0.5 (24 Mar 99) +- packaging script updated + +2.0.3 -> 2.0.4 (24 Mar 99) +- test dir split into Kernel and LedaKernel (test_with_leda_kernel_2.C) + +2.0.2 -> 2.0.3 (24 Mar 99) +- _test-functions moved from namespace CGAL into global scope + +2.0.1 -> 2.0.2 (25 Feb 99) +- CGAL_[BEGIN|END]_NAMESPACE used + +2.0 -> 2.0.1 (11 Feb 99) +- test/Kernel/cgal_test corrected +- various bugs in testfiles fixed (especially missing includes of + added) + +1.4.2 -> 2.0 +- namespace CGAL { } introduced + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 1 . 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +1.4.1 -> 1.4.2 +- fixed bug in CGAL_Point_2 in rat_leda.h + +1.4 -> 1.4.1 +- make clean in updated + +1.3 -> 1.4 +- test for using 2D leda_rat-kernel added +- test for 2D predicate objects added + +1.2.4 -> 1.3 +- test cases (p==r) for CGAL_collinear_are_ordered_along_line(p,q,r) added +- tests ORIGIN [!=]= Point_[23] encapsulated in #ifdef ENHANCED , + since the current kernel doesn't pass this test +- Plane_3::to_2d more thoroughly tested +- Point_[23] [!=]= ORIGIN tests added + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 1 . 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +1.2.3 -> 1.2.4 +- copy-and-past mess in point_d_test.C cleaned up + +1.2.2 -> 1.2.3 +- in point_d_test.C: `int 100' replaced by `const int 100'. + +1.2.1 -> 1.2.2 +- point_d_test.C replaced; buffer allocation now static. + +1.2 -> 1.2.1 +- point_d_test.C made part of this package + +1.1.3 -> 1.2 +- test for basic_constructions_3 added +- test for basic_constructions_2 added +- tests test_new_partsC_.C / test_new_partsH_.C added + and test_basic_constructionsH3 removed +- test for order along line 3D revised + test for strict order along line 3D added +- tests for in_sphere tests (side_of...sphere) added +- tests for consistency between definition of orientation and + bounded side of implicitly defined sphere added +- test for cross_product checked + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 1 . 0 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +1.1.2 -> 1.1.3 +- test for basic_constructionsH3 added +- test for Plane_3::projection(Point_3) added + +1.1.1 -> 1.1.2 +- test for point conversion functions added + called in test_kernel__.C +- test for Vector/Quotient added + +1.1 -> 1.1.1 +- cgal_test corrected + +1.0.1 -> 1.1 +- Fixed some enum problems (CGAL_ON_BOUNDARY where + CGAL_ON_ORIENTED_BOUNDARY was expected) +- flagged test for further new features with CGAL_STRICT09 +- added small `test' for CGAL_Object and CGAL_Quotient. + Called in test_kernel__.C + +1.0 -> 1.0.1 +- Fixed another scope-reolution problem of g++ + in testing Line_2 with Cartesian representation +- added tests for CGAL_are_strictly_ordered_along_line(p,q,r) + +0.9 -> 1.0 +Revised version of kernel test +- typename keyword has been added +- additional access mfcts of aff_transformation are checked: + define CGAL_STRICT_09 to test release 0.9 or versions + without new additional functionality +- `bug' caused by g++-bug removed +- Cartesian and homogeneous version are tested by separate + programs now diff --git a/Old_Packages/Kernel_test/description.txt b/Old_Packages/Kernel_test/description.txt new file mode 100644 index 00000000000..7ff7ea456b7 --- /dev/null +++ b/Old_Packages/Kernel_test/description.txt @@ -0,0 +1,2 @@ +Kernel test files (define CGAL_STRICT09 if you want to use the tests +with release 0.9) diff --git a/Old_Packages/Kernel_test/test/Kernel/cgal_test b/Old_Packages/Kernel_test/test/Kernel/cgal_test new file mode 100755 index 00000000000..acf451fd507 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/cgal_test @@ -0,0 +1,66 @@ +#! /bin/sh +# This is a script for the CGAL test suite. Such a script must obey +# the following rules: +# +# - the name of the script is cgal_test +# - for every target two one line messages are written to the file 'error.txt' +# the first one indicates if the compilation was successful +# the second one indicates if the execution was successful +# if one of the two was not successful, the line should start with 'ERROR:' +# - running the script should not require any user interaction +# - the script should clean up object files and executables + +ERRORFILE=error.txt + +#---------------------------------------------------------------------# +# compile_and_run +#---------------------------------------------------------------------# + +compile_and_run() +{ + echo "Compiling $1 ... " + if eval 'make CGAL_MAKEFILE=$CGAL_MAKEFILE \ + TESTSUITE_CXXFLAGS="$TESTSUITE_CXXFLAGS" \ + TESTSUITE_LDFLAGS="$TESTSUITE_LDFLAGS" $1' ; then + echo " compilation of $1 succeeded" >> $ERRORFILE + else + echo " ERROR: compilation of $1 failed" >> $ERRORFILE + fi + + if [ -f $1 ] ; then + OUTPUTFILE=ProgramOutput.$1.$PLATFORM + rm -f $OUTPUTFILE + COMMAND="./$1" + if [ -f $1.cmd ] ; then + COMMAND="$COMMAND '`cat $1.cmd`'" + fi + if [ -f $1.cin ] ; then + COMMAND="echo '`cat $1.cin`' | $COMMAND" + fi + echo "Executing $1 ... " + echo + if eval 2>&1 $COMMAND > $OUTPUTFILE ; then + echo " execution of $1 succeeded" >> $ERRORFILE + else + echo " ERROR: execution of $1 failed" >> $ERRORFILE + fi + else + echo " ERROR: could not execute $1" >> $ERRORFILE + fi + + eval "2>&1 make CGAL_MAKEFILE=$CGAL_MAKEFILE clean > /dev/null " +} + +#---------------------------------------------------------------------# +# remove the previous error file +#---------------------------------------------------------------------# + +rm -f $ERRORFILE +touch $ERRORFILE + +#---------------------------------------------------------------------# +# compile and run the tests +#---------------------------------------------------------------------# + + +compile_and_run test_kernel__ diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_2.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_2.C new file mode 100644 index 00000000000..30e82facba1 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_2.C @@ -0,0 +1,74 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_2.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_2_C +#define CGAL__TEST_2_C + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +template bool _test_2(const R& r); + + +template +bool +_test_2(const R& r) +{ + return + _test_cls_vector_2(r) + && _test_fct_vector_2(r) + && _test_cls_point_2(r) + && _test_fct_point_vector_2(r) + && _test_fct_point_2(r) + && _test_further_fct_point_2(r) + && _test_fct_direction_2(r) + && _test_fct_point_line_2( r ) + && _test_further_fct_point_line_2( r ) + && _test_cls_line_2( r ) + && _test_cls_segment_2( r ) + && _test_cls_ray_2( r ) + && _test_cls_triangle_2( r ) + && _test_cls_circle_2( r ) + && _test_cls_iso_rectangle_2( r ) + && _test_cls_aff_transformation_2( r ) + ; +} +#endif // CGAL__TEST_2_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_3.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_3.C new file mode 100644 index 00000000000..e449e1ad3a0 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_3.C @@ -0,0 +1,70 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_3.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_3_C +#define CGAL__TEST_3_C + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +template bool _test_3(const R& r); + + +template +bool +_test_3(const R& r) +{ + return + _test_cls_vector_3(r) + && _test_fct_vector_3(r) + && _test_cls_point_3(r) + && _test_fct_point_vector_3(r) + && _test_fct_point_3(r) + && _test_cls_direction_3(r) + && _test_cls_plane_3( r ) + && _test_cls_line_3( r ) + && _test_cls_segment_3( r ) + && _test_cls_sphere_3(r) + && _test_cls_ray_3( r ) + && _test_cls_triangle_3( r ) + && _test_cls_tetrahedron_3( r ) + && _test_cls_aff_transformation_3( r ) + ; +} + +#endif // CGAL__TEST_3_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_aff_transformation_2.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_aff_transformation_2.C new file mode 100644 index 00000000000..dc337c0e73b --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_aff_transformation_2.C @@ -0,0 +1,588 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_cls_aff_transformation_2.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_AFF_TRANSFORMATION_2_C +#define CGAL__TEST_CLS_AFF_TRANSFORMATION_2_C +#include + +template +bool +_test_cls_aff_transformation_2(const R& ) +{ + std::cout << "Testing class Aff_transformation_2" ; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + typename R::Aff_transformation_2 ia; + CGAL::Aff_transformation_2 a1(ia); + + RT n0 = 0; + RT n1 =-15; + RT n2 = 44; + RT n3 = 4; + RT n4 = 5; + RT n5 = 25; + RT n6 = -2; + RT n7 = 8; + RT n8 = 18; + RT n9 = 9; + RT n10= 3; + RT n11=-12; + RT n12= 20; + RT n13= 1; + RT n14= 35; + RT n100 = 100; + + CGAL::Vector_2 vec( n3, n8, n6 ); // (-2,-9) + CGAL::Vector_2 tvec; + CGAL::Point_2 pnt( n8, n1, n10 ); // ( 6,-5) + CGAL::Point_2 tpnt; + CGAL::Point_2 pvec = CGAL::ORIGIN + vec; + CGAL::Vector_2 vpnt = pnt - CGAL::ORIGIN; + + CGAL::Point_2 p1(-n3, n7, n3 ); // (-1, 2) + CGAL::Point_2 p2( n5, n4, n4 ); // ( 5, 1) + CGAL::Point_2 p3( n1, n0, n4 ); // (-3, 0) + CGAL::Point_2 p4( n7, n2,-n6 ); // ( 4,11) + + CGAL::Direction_2 d0(n13, n0); + CGAL::Direction_2 d1(n0, n13); + CGAL::Direction_2 dir = (p2 - p4).direction(); + CGAL::Direction_2 tdir; + + CGAL::Point_2 tp1; + CGAL::Point_2 tp2; + CGAL::Point_2 tp3; + CGAL::Point_2 tp4; + CGAL::Segment_2 seg(p1,p2); + CGAL::Segment_2 tseg; + CGAL::Ray_2 ray(p3,p2); + CGAL::Ray_2 tray; + CGAL::Line_2 lin(p2,p4); + CGAL::Line_2 tlin; + CGAL::Triangle_2 tri( p2,p3,p4); + CGAL::Triangle_2 ttri; + + CGAL::Circle_2 circ(p2, p3, p4); + CGAL::Circle_2 tcirc; + CGAL::Iso_rectangle_2 isor(p3, p4); + CGAL::Iso_rectangle_2 tisor; + + CGAL::Aff_transformation_2 ident( CGAL::IDENTITY ); + + CGAL::Aff_transformation_2 gat1( n7, n9, n2, + n5, n11, n4, + n3 ); + + CGAL::Aff_transformation_2 gat2( n7, n9, n2, + n5, n11, n4, + n13 ); + + CGAL::Aff_transformation_2 gat3( n4, n6, n0, + n12, n8, n0, + n13 ); + + CGAL::Aff_transformation_2 scale11( CGAL::SCALING, n2, n3 ); + + CGAL::Aff_transformation_2 gscale(n2, n0, n0, + n0, n2, n0, + n3 ); + + CGAL::Aff_transformation_2 gtrans(n10, n0, n8, + n0, n10, n1, + n10 ); + + CGAL::Aff_transformation_2 translate( CGAL::TRANSLATION, vpnt ); + + CGAL::Aff_transformation_2 xrefl(-n4, n0, n0, + n0, n4, n0, + n4 ); + + CGAL::Aff_transformation_2 gat4( gat3); + + CGAL::Aff_transformation_2 gat5( n7, n9, + n5, n11, + n13 ); + + CGAL::Aff_transformation_2 gat6( n4, n6, + n12, n8, + n13 ); + + CGAL::Aff_transformation_2 rot90( CGAL::ROTATION, d1, n13, n100 ); + + CGAL::Aff_transformation_2 rot2( CGAL::ROTATION, dir, n13, n100 ); + + CGAL::Aff_transformation_2 rot3( CGAL::ROTATION, RT(3),RT(4),RT(5)); + + + + CGAL::Aff_transformation_2 a[14]; + + + a[0] = ident; + a[1] = gat1; + a[2] = gat2; + a[3] = gat3; + a[4] = scale11; + a[5] = gscale; + a[6] = gtrans; + a[7] = translate; + a[8] = xrefl; + a[9] = gat5; + a[10]= gat6; + a[11]= rot90; + a[12]= rot2; + a[13]= rot3; + + CGAL::Aff_transformation_2 inv; + + for (int i = 0; i< 14; i++) + { + tp1 = p1.transform( a[i] ); + tp2 = p2.transform( a[i] ); + tp3 = p3.transform( a[i] ); + tp4 = p4.transform( a[i] ); + tseg = seg.transform( a[i] ); + tray = ray.transform( a[i] ); + tlin = lin.transform( a[i] ); + ttri = tri.transform( a[i] ); + tisor= isor.transform( a[i]); + assert( tseg == CGAL::Segment_2(tp1, tp2) ); + assert( tray == CGAL::Ray_2(tp3, tp2) ); + assert( tlin == CGAL::Line_2(tp2, tp4) ); + assert( ttri == CGAL::Triangle_2(tp2, tp3, tp4) ); + assert( tisor== CGAL::Iso_rectangle_2( tp3, tp4 ) ); + + inv = a[i].inverse(); + tp4 = tp4.transform( inv ); + tseg = tseg.transform( inv ); + tray = tray.transform( inv ); + tlin = tlin.transform( inv ); + ttri = ttri.transform( inv ); + assert( tp4 == p4 ); + assert( tseg == seg ); + assert( tray == ray ); + assert( tlin == lin ); + assert( ttri == tri ); + }; + + std::cout << '.'; + + // ident + assert( vec.transform(ident) == vec ); + assert( dir.transform(ident) == dir ); + assert( pnt.transform(ident) == pnt ); + assert( lin.transform(ident) == lin ); + + // scale11 and gscale + tpnt = pnt.transform(scale11); + tvec = vec.transform(scale11); + tdir = dir.transform(scale11); + tseg = seg.transform(scale11); + assert( tseg.squared_length() == FT(11)* FT(11)* seg.squared_length() ); + assert( FT(11)* FT(11)* FT( vec*vec ) == FT( tvec*tvec ) ); + assert( vec.direction() == tvec.direction() ); + assert( dir == tdir ); + tdir = d0.transform(scale11); + assert( d0 == tdir); + tpnt = pnt.transform(gscale); + tvec = vec.transform(gscale); + tdir = dir.transform(gscale); + tseg = seg.transform(gscale); + assert( tseg.squared_length() == FT(11)* FT(11)* seg.squared_length() ); + assert( FT(11)* FT(11)* FT( vec*vec ) == FT( tvec*tvec ) ); + assert( seg.transform(scale11) == seg.transform(gscale) ); + assert( vec.transform(scale11) == vec.transform(gscale) ); + assert( dir.transform(scale11) == dir.transform(gscale) ); + assert( pnt.transform(scale11) == pnt.transform(gscale) ); + assert( lin.transform(scale11) == lin.transform(gscale) ); + + // translate and gtrans + tvec = vec.transform(translate); + tdir = dir.transform(translate); + tp2 = p2.transform(translate); + tp3 = p3.transform(translate); + assert( vec == tvec ); + assert( dir == tdir ); + assert( tp2 == p2 + vpnt ); + assert( tp3 == p3 + vpnt ); + tvec = vec.transform(gtrans); + tdir = dir.transform(gtrans); + tp2 = p2.transform(gtrans); + tp3 = p3.transform(gtrans); + assert( vec == tvec ); + assert( dir == tdir ); + assert( tp2 == p2 + vpnt ); + assert( tp3 == p3 + vpnt ); + assert( vec.transform(translate) == vec.transform(gtrans) ); + assert( dir.transform(translate) == dir.transform(gtrans) ); + assert( pnt.transform(translate) == pnt.transform(gtrans) ); + assert( lin.transform(translate) == lin.transform(gtrans) ); + + // xrefl + tdir = d0.transform(xrefl); + assert( tdir == -d0 ); + tdir = d1.transform(xrefl); + assert( tdir == d1 ); + + std::cout << '.'; + + // composition + assert( pnt.transform(xrefl).transform(xrefl) == pnt ); + assert( dir.transform(xrefl).transform(xrefl) == dir ); + assert( vec.transform(xrefl).transform(xrefl) == vec ); + assert( lin.transform(xrefl).transform(xrefl) == lin ); + CGAL::Aff_transformation_2 co1 = xrefl * xrefl; + assert( pnt.transform(xrefl).transform(xrefl) == pnt.transform(co1) ); + assert( dir.transform(xrefl).transform(xrefl) == dir.transform(co1) ); + assert( vec.transform(xrefl).transform(xrefl) == vec.transform(co1) ); + assert( lin.transform(xrefl).transform(xrefl) == lin.transform(co1) ); + co1 = gat2 * gat3; + assert( pnt.transform(gat3).transform(gat2) == pnt.transform(co1) ); + assert( dir.transform(gat3).transform(gat2) == dir.transform(co1) ); + assert( vec.transform(gat3).transform(gat2) == vec.transform(co1) ); + assert( lin.transform(gat3).transform(gat2) == lin.transform(co1) ); + co1 = ident * gat1; + assert( vec.transform(gat1) == vec.transform(co1) ); + assert( dir.transform(gat1) == dir.transform(co1) ); + assert( pnt.transform(gat1) == pnt.transform(co1) ); + assert( lin.transform(gat1) == lin.transform(co1) ); + co1 = gat1 * ident; + assert( vec.transform(gat1) == vec.transform(co1) ); + assert( dir.transform(gat1) == dir.transform(co1) ); + assert( pnt.transform(gat1) == pnt.transform(co1) ); + assert( lin.transform(gat1) == lin.transform(co1) ); + co1 = gat1 * gat1.inverse() ; + assert( vec == vec.transform(co1) ); + assert( pnt == pnt.transform(co1) ); + assert( dir == dir.transform(co1) ); + assert( lin == lin.transform(co1) ); + + // even + assert( translate.is_even() ); + assert( gtrans.is_even() ); + assert( gscale.is_even() ); + assert( scale11.is_even() ); + assert( ident.is_even() ); + assert( rot90.is_even() ); + assert( rot2.is_even() ); + assert( rot3.is_even() ); + assert( xrefl.is_odd() ); + + // rotation + assert( d0.transform( rot90 ) == d1 ); + assert( d1.transform( rot90.inverse() ) == d0 ); + assert( d0.transform( rot3 ) == CGAL::Direction_2( RT(4), RT(3)) ); + co1 = rot3 * rot90; + assert( d1.transform( rot3) == d0.transform( co1 ) ); + co1 = rot2 * rot90; + assert( d1.transform( rot2) == d0.transform( co1 ) ); + co1 = rot90 * rot2; + assert( d1.transform( rot2) == d0.transform( co1 ) ); + co1 = rot90 * rot90 * rot90 * rot90; + assert( vec == vec.transform(co1) ); + assert( dir == dir.transform(co1) ); + assert( pnt == pnt.transform(co1) ); + assert( lin == lin.transform(co1) ); + co1 = rot3 * rot3 * rot3.inverse(); + assert( vec.transform(rot3) == vec.transform(co1) ); + assert( dir.transform(rot3) == dir.transform(co1) ); + assert( pnt.transform(rot3) == pnt.transform(co1) ); + assert( lin.transform(rot3) == lin.transform(co1) ); + + //circle + tp2 = p2.transform( translate ); + tp3 = p3.transform( translate ); + tp4 = p4.transform( translate ); + tcirc = circ.orthogonal_transform( translate ); + assert( tcirc == CGAL::Circle_2( tp2, tp3, tp4 ) ); + tp2 = p2.transform( xrefl ); + tp3 = p3.transform( xrefl ); + tp4 = p4.transform( xrefl ); + tcirc = circ.orthogonal_transform( xrefl ); + assert( tcirc == CGAL::Circle_2( tp2, tp3, tp4 ) ); + tp2 = p2.transform( rot3 ); + tp3 = p3.transform( rot3 ); + tp4 = p4.transform( rot3 ); + tcirc = circ.orthogonal_transform( rot3 ); + assert( tcirc == CGAL::Circle_2( tp2, tp3, tp4 ) ); + + + // copy + assert( vec.transform( gat5 ) == vec.transform( gat2 ) ); + assert( dir.transform( gat5 ) == dir.transform( gat2 ) ); + + assert( pnt.transform( gat6 ) == pnt.transform( gat3 ) ); + assert( vec.transform( gat6 ) == vec.transform( gat3 ) ); + assert( dir.transform( gat6 ) == dir.transform( gat3 ) ); + assert( lin.transform( gat6 ) == lin.transform( gat3 ) ); + + // access + // general form + FT FTone(RT(1)); + FT FTzero(RT(0)); + assert( gat2.cartesian(0,0) == FT(n7) / FT(n13) ); + assert( gat2.cartesian(0,1) == FT(n9) / FT(n13) ); + assert( gat2.cartesian(0,2) == FT(n2) / FT(n13) ); + assert( gat2.cartesian(1,0) == FT(n5) / FT(n13) ); + assert( gat2.cartesian(1,1) == FT(n11) / FT(n13) ); + assert( gat2.cartesian(1,2) == FT(n4) / FT(n13) ); + assert( gat2.cartesian(2,0) == FTzero ); + assert( gat2.cartesian(2,1) == FTzero ); + assert( gat2.cartesian(2,2) == FTone ); + + assert( gat6.cartesian(0,0) == FT(n4) / FT(n13) ); + assert( gat6.cartesian(0,1) == FT(n6) / FT(n13) ); + assert( gat6.cartesian(0,2) == FTzero ); + assert( gat6.cartesian(1,0) == FT(n12) / FT(n13) ); + assert( gat6.cartesian(1,1) == FT(n8) / FT(n13) ); + assert( gat6.cartesian(1,2) == FTzero ); + assert( gat6.cartesian(2,0) == FTzero ); + assert( gat6.cartesian(2,1) == FTzero ); + assert( gat6.cartesian(2,2) == FTone ); + + // translation + assert( translate.cartesian(0,0) == FTone ); + assert( translate.cartesian(0,1) == FTzero ); + assert( translate.cartesian(0,2) == FT(n8) / FT(n10) ); + assert( translate.cartesian(1,0) == FTzero ); + assert( translate.cartesian(1,1) == FTone ); + assert( translate.cartesian(1,2) == FT(n1) / FT(n10) ); + assert( translate.cartesian(2,0) == FTzero ); + assert( translate.cartesian(2,1) == FTzero ); + assert( translate.cartesian(2,2) == FTone ); + + // rotation + FT f3o5 = FT(RT(3)) / FT(RT(5)); + FT f4o5 = FT(RT(4)) / FT(RT(5)); + assert( rot3.cartesian(0,0) == f4o5 ); + assert( rot3.cartesian(0,1) == -f3o5 ); + assert( rot3.cartesian(0,2) == FTzero ); + assert( rot3.cartesian(1,0) == f3o5 ); + assert( rot3.cartesian(1,1) == f4o5 ); + assert( rot3.cartesian(1,2) == FTzero ); + assert( rot3.cartesian(2,0) == FTzero ); + assert( rot3.cartesian(2,1) == FTzero ); + assert( rot3.cartesian(2,2) == FTone ); + + // scaling + FT fscale = FT(n2) / FT(n3); + assert( scale11.cartesian(0,0) == fscale ); + assert( scale11.cartesian(0,1) == FTzero ); + assert( scale11.cartesian(0,2) == FTzero ); + assert( scale11.cartesian(1,0) == FTzero ); + assert( scale11.cartesian(1,1) == fscale ); + assert( scale11.cartesian(1,2) == FTzero ); + assert( scale11.cartesian(2,0) == FTzero ); + assert( scale11.cartesian(2,1) == FTzero ); + assert( scale11.cartesian(2,2) == FTone ); + + // ident + assert( ident.cartesian(0,0) == FTone ); + assert( ident.cartesian(0,1) == FTzero ); + assert( ident.cartesian(0,2) == FTzero ); + assert( ident.cartesian(1,0) == FTzero ); + assert( ident.cartesian(1,1) == FTone ); + assert( ident.cartesian(1,2) == FTzero ); + assert( ident.cartesian(2,0) == FTzero ); + assert( ident.cartesian(2,1) == FTzero ); + assert( ident.cartesian(2,2) == FTone ); + + // same with m + // general form + assert( gat2.m(0,0) == FT(n7) / FT(n13) ); + assert( gat2.m(0,1) == FT(n9) / FT(n13) ); + assert( gat2.m(0,2) == FT(n2) / FT(n13) ); + assert( gat2.m(1,0) == FT(n5) / FT(n13) ); + assert( gat2.m(1,1) == FT(n11) / FT(n13) ); + assert( gat2.m(1,2) == FT(n4) / FT(n13) ); + assert( gat2.m(2,0) == FTzero ); + assert( gat2.m(2,1) == FTzero ); + assert( gat2.m(2,2) == FTone ); + + assert( gat6.m(0,0) == FT(n4) / FT(n13) ); + assert( gat6.m(0,1) == FT(n6) / FT(n13) ); + assert( gat6.m(0,2) == FTzero ); + assert( gat6.m(1,0) == FT(n12) / FT(n13) ); + assert( gat6.m(1,1) == FT(n8) / FT(n13) ); + assert( gat6.m(1,2) == FTzero ); + assert( gat6.m(2,0) == FTzero ); + assert( gat6.m(2,1) == FTzero ); + assert( gat6.m(2,2) == FTone ); + + // translation + assert( translate.m(0,0) == FTone ); + assert( translate.m(0,1) == FTzero ); + assert( translate.m(0,2) == FT(n8) / FT(n10) ); + assert( translate.m(1,0) == FTzero ); + assert( translate.m(1,1) == FTone ); + assert( translate.m(1,2) == FT(n1) / FT(n10) ); + assert( translate.m(2,0) == FTzero ); + assert( translate.m(2,1) == FTzero ); + assert( translate.m(2,2) == FTone ); + + // rotation + assert( rot3.m(0,0) == f4o5 ); + assert( rot3.m(0,1) == -f3o5 ); + assert( rot3.m(0,2) == FTzero ); + assert( rot3.m(1,0) == f3o5 ); + assert( rot3.m(1,1) == f4o5 ); + assert( rot3.m(1,2) == FTzero ); + assert( rot3.m(2,0) == FTzero ); + assert( rot3.m(2,1) == FTzero ); + assert( rot3.m(2,2) == FTone ); + + // scaling + assert( scale11.m(0,0) == fscale ); + assert( scale11.m(0,1) == FTzero ); + assert( scale11.m(0,2) == FTzero ); + assert( scale11.m(1,0) == FTzero ); + assert( scale11.m(1,1) == fscale ); + assert( scale11.m(1,2) == FTzero ); + assert( scale11.m(2,0) == FTzero ); + assert( scale11.m(2,1) == FTzero ); + assert( scale11.m(2,2) == FTone ); + + // ident + assert( ident.m(0,0) == FTone ); + assert( ident.m(0,1) == FTzero ); + assert( ident.m(0,2) == FTzero ); + assert( ident.m(1,0) == FTzero ); + assert( ident.m(1,1) == FTone ); + assert( ident.m(1,2) == FTzero ); + assert( ident.m(2,0) == FTzero ); + assert( ident.m(2,1) == FTzero ); + assert( ident.m(2,2) == FTone ); + + // homogeneous and hm are not like Quebec (== unique) + // general form + assert( FT( gat2.hm(0,0) ) / FT( gat2.hm(2,2) ) \ + == FT(n7) / FT(n13) ); + assert( FT( gat2.hm(0,1) ) / FT( gat2.hm(2,2) ) \ + == FT(n9) / FT(n13) ); + assert( FT( gat2.hm(0,2) ) / FT( gat2.hm(2,2) ) \ + == FT(n2) / FT(n13) ); + assert( FT( gat2.hm(1,0) ) / FT( gat2.hm(2,2) ) \ + == FT(n5) / FT(n13) ); + assert( FT( gat2.hm(1,1) ) / FT( gat2.hm(2,2) ) \ + == FT(n11) / FT(n13) ); + assert( FT( gat2.hm(1,2) ) / FT( gat2.hm(2,2) ) \ + == FT(n4) / FT(n13) ); + assert( FT( gat2.hm(2,0) ) / FT( gat2.hm(2,2) ) == FTzero ); + assert( FT( gat2.hm(2,1) ) / FT( gat2.hm(2,2) ) == FTzero ); + assert( FT( gat2.hm(2,2) ) / FT( gat2.hm(2,2) ) == FTone ); + + assert( FT( gat6.hm(0,0) ) / FT( gat6.hm(2,2) ) \ + == FT(n4) / FT(n13) ); + assert( FT( gat6.hm(0,1) ) / FT( gat6.hm(2,2) ) \ + == FT(n6) / FT(n13) ); + assert( FT( gat6.hm(0,2) ) / FT( gat6.hm(2,2) ) == FTzero ); + assert( FT( gat6.hm(1,0) ) / FT( gat6.hm(2,2) ) \ + == FT(n12) / FT(n13) ); + assert( FT( gat6.hm(1,1) ) / FT( gat6.hm(2,2) ) \ + == FT(n8) / FT(n13) ); + assert( FT( gat6.hm(1,2) ) / FT( gat6.hm(2,2) ) == FTzero ); + assert( FT( gat6.hm(2,0) ) / FT( gat6.hm(2,2) ) == FTzero ); + assert( FT( gat6.hm(2,1) ) / FT( gat6.hm(2,2) ) == FTzero ); + assert( FT( gat6.hm(2,2) ) / FT( gat6.hm(2,2) ) == FTone ); + + // translation + assert( FT( translate.hm(0,0) ) / FT( translate.hm(2,2) ) == FTone ); + assert( FT( translate.hm(0,1) ) / FT( translate.hm(2,2) ) == FTzero ); + assert( FT( translate.hm(0,2) ) / FT( translate.hm(2,2) ) \ + == FT(n8) / FT(n10) ); + assert( FT( translate.hm(1,0) ) / FT( translate.hm(2,2) ) == FTzero ); + assert( FT( translate.hm(1,1) ) / FT( translate.hm(2,2) ) == FTone ); + assert( FT( translate.hm(1,2) ) / FT( translate.hm(2,2) ) \ + == FT(n1) / FT(n10) ); + assert( FT( translate.hm(2,0) ) / FT( translate.hm(2,2) ) == FTzero ); + assert( FT( translate.hm(2,1) ) / FT( translate.hm(2,2) ) == FTzero ); + assert( FT( translate.hm(2,2) ) / FT( translate.hm(2,2) ) == FTone ); + + // rotation + assert( FT( rot3.hm(0,0) ) / FT( rot3.hm(2,2) ) == f4o5 ); + assert( FT( rot3.hm(0,1) ) / FT( rot3.hm(2,2) ) == -f3o5 ); + assert( FT( rot3.hm(0,2) ) / FT( rot3.hm(2,2) ) == FTzero ); + assert( FT( rot3.hm(1,0) ) / FT( rot3.hm(2,2) ) == f3o5 ); + assert( FT( rot3.hm(1,1) ) / FT( rot3.hm(2,2) ) == f4o5 ); + assert( FT( rot3.hm(1,2) ) / FT( rot3.hm(2,2) ) == FTzero ); + assert( FT( rot3.hm(2,0) ) / FT( rot3.hm(2,2) ) == FTzero ); + assert( FT( rot3.hm(2,1) ) / FT( rot3.hm(2,2) ) == FTzero ); + assert( FT( rot3.hm(2,2) ) / FT( rot3.hm(2,2) ) == FTone ); + + // scaling + assert( FT( scale11.hm(0,0) ) / FT( scale11.hm(2,2) ) == fscale ); + assert( FT( scale11.hm(0,1) ) / FT( scale11.hm(2,2) ) == FTzero ); + assert( FT( scale11.hm(0,2) ) / FT( scale11.hm(2,2) ) == FTzero ); + assert( FT( scale11.hm(1,0) ) / FT( scale11.hm(2,2) ) == FTzero ); + assert( FT( scale11.hm(1,1) ) / FT( scale11.hm(2,2) ) == fscale ); + assert( FT( scale11.hm(1,2) ) / FT( scale11.hm(2,2) ) == FTzero ); + assert( FT( scale11.hm(2,0) ) / FT( scale11.hm(2,2) ) == FTzero ); + assert( FT( scale11.hm(2,1) ) / FT( scale11.hm(2,2) ) == FTzero ); + assert( FT( scale11.hm(2,2) ) / FT( scale11.hm(2,2) ) == FTone ); + + // ident + assert( FT( ident.hm(0,0) ) / FT( ident.hm(2,2) ) == FTone ); + assert( FT( ident.hm(0,1) ) / FT( ident.hm(2,2) ) == FTzero ); + assert( FT( ident.hm(0,2) ) / FT( ident.hm(2,2) ) == FTzero ); + assert( FT( ident.hm(1,0) ) / FT( ident.hm(2,2) ) == FTzero ); + assert( FT( ident.hm(1,1) ) / FT( ident.hm(2,2) ) == FTone ); + assert( FT( ident.hm(1,2) ) / FT( ident.hm(2,2) ) == FTzero ); + assert( FT( ident.hm(2,0) ) / FT( ident.hm(2,2) ) == FTzero ); + assert( FT( ident.hm(2,1) ) / FT( ident.hm(2,2) ) == FTzero ); + assert( FT( ident.hm(2,2) ) / FT( ident.hm(2,2) ) == FTone ); + + // samples + // cartesian == m + assert( gat1.cartesian(1,2) == gat1.m(1,2) ); + assert( scale11.cartesian(0,0) == scale11.m(0,0) ); + assert( translate.cartesian(1,2) == translate.m(1,2) ); + assert( rot3.cartesian(1,0) == rot3.m(1,0) ); + assert( ident.cartesian(1,2) == ident.m(1,2) ); + assert( gscale.cartesian(1,1) == gscale.m(1,1) ); + + // m == hm/hm(2,2) + assert( gat3.m(1,2) == FT( gat3.hm(1,2)) / FT( gat3.hm(2,2) )); + assert( gat4.m(1,0) == FT( gat4.hm(1,0)) / FT( gat4.hm(2,2) )); + assert( gat5.m(2,0) == FT( gat5.hm(2,0)) / FT( gat5.hm(2,2) )); + assert( translate.m(1,2) \ + == FT( translate.hm(1,2)) / FT( translate.hm(2,2) )); + assert( scale11.m(1,1) == FT( scale11.hm(1,1)) / FT( scale11.hm(2,2) )); + assert( rot2.m(2,0) == FT( rot2.hm(2,0)) / FT( rot2.hm(2,2) )); + + // homogeneous == hm + assert( gat1.homogeneous(1,2) == gat1.hm(1,2) ); + assert( scale11.homogeneous(0,0) == scale11.hm(0,0) ); + assert( translate.homogeneous(1,2) == translate.hm(1,2) ); + assert( rot3.homogeneous(1,0) == rot3.hm(1,0) ); + assert( ident.homogeneous(1,2) == ident.hm(1,2) ); + assert( gscale.homogeneous(1,1) == gscale.hm(1,1) ); + + std::cout << "done" << std::endl; + return true; +} + +#endif // CGAL__TEST_CLS_AFF_TRANSFORMATION_2_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_aff_transformation_2.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_aff_transformation_2.h new file mode 100644 index 00000000000..b65c59d8306 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_aff_transformation_2.h @@ -0,0 +1,42 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_cls_aff_transformation_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_AFF_TRANSFORMATION_2_H +#define CGAL__TEST_CLS_AFF_TRANSFORMATION_2_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +template bool _test_cls_aff_transformation_2(const R& ); + +#endif // CGAL__TEST_CLS_AFF_TRANSFORMATION_2_H diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_aff_transformation_3.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_aff_transformation_3.C new file mode 100644 index 00000000000..e0b4f2cb62a --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_aff_transformation_3.C @@ -0,0 +1,551 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_aff_transformation_3.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_AFF_TRANSFORMATION_3_C +#define CGAL__TEST_CLS_AFF_TRANSFORMATION_3_C +#include + +template +bool +_test_cls_aff_transformation_3(const R& ) +{ + std::cout << "Testing class Aff_transformation_3" ; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + typename R::Aff_transformation_3 ia; + CGAL::Aff_transformation_3 a1(ia); + + RT n0 = 0; + RT n1 =-15; + RT n2 = 44; + RT n3 = 4; + RT n4 = 5; + RT n5 = 25; + RT n6 = -2; + RT n7 = 8; + RT n8 = 18; + RT n9 = 9; + RT n10= 3; + RT n11=-12; + RT n12= 20; + RT n13= 1; + RT n14= 35; + + CGAL::Vector_3 vec( n3, n8, n7, n6 ); // (-2,-9,-4) + CGAL::Vector_3 tvec; + CGAL::Point_3 pnt( n8, n1, n9, n10 ); // ( 6,-5, 3) + CGAL::Point_3 tpnt; + CGAL::Point_3 pvec = CGAL::ORIGIN + vec; + CGAL::Vector_3 vpnt = pnt - CGAL::ORIGIN; + + CGAL::Point_3 p1(-n3, n7, n11, n3 ); // (-1, 2,-3) + CGAL::Point_3 p2( n5, n4,-n12, n4 ); // ( 5, 1,-4) + CGAL::Point_3 p3( n1, n0, n14, n4 ); // (-3, 0, 7) + CGAL::Point_3 p4( n7, n2, n8, -n6 ); // ( 4,11, 9) + + CGAL::Direction_3 d0(n13, n0, n0); + CGAL::Direction_3 d1(n0, n13, n0); + CGAL::Direction_3 d2(n0, n0, n13); + CGAL::Direction_3 dir = (p2 - p4).direction(); + CGAL::Direction_3 tdir; + + CGAL::Plane_3 pla(p1,p2,p3); + CGAL::Plane_3 tpla; + + CGAL::Point_3 tp1; + CGAL::Point_3 tp2; + CGAL::Point_3 tp3; + CGAL::Point_3 tp4; + CGAL::Segment_3 seg(p1,p2); + CGAL::Segment_3 tseg; + CGAL::Ray_3 ray(p3,p2); + CGAL::Ray_3 tray; + CGAL::Line_3 lin(p2,p4); + CGAL::Line_3 tlin; + CGAL::Triangle_3 tri( p2,p3,p4); + CGAL::Triangle_3 ttri; + CGAL::Tetrahedron_3 tet(p1, p2, p3, p4); + CGAL::Tetrahedron_3 ttet; + + + CGAL::Aff_transformation_3 ident( CGAL::IDENTITY ); + assert( p1 == p1.transform( ident) ); + assert( p1 == p1.transform( ident.inverse() ) ); + + CGAL::Aff_transformation_3 gat1( n7, n9, n8, n2, + n5, n11, n10, n4, + n3, n6, n12, n2, + n3 ); + assert( p1 == (p1.transform(gat1)).transform(gat1.inverse() ) ); + + CGAL::Aff_transformation_3 gat2( n7, n9, n8, n2, + n5, n11, n10, n4, + n3, n6, n12, n2, + n13 ); + + CGAL::Aff_transformation_3 gat3( n4, n6, n7, n0, + n12, n8, n8, n0, + n11, n3, n9, n0, + n13 ); + + CGAL::Aff_transformation_3 scale11( CGAL::SCALING, n2, n3 ); + + CGAL::Aff_transformation_3 gscale(n2, n0, n0, n0, // n2 = 44 + n0, n2, n0, n0, // n3 = 4 + n0, n0, n2, n0, + n3 ); + + + CGAL::Aff_transformation_3 gtrans(n10, n0, n0, n8, + n0, n10, n0, n1, + n0, n0, n10, n9, + n10 ); + + CGAL::Aff_transformation_3 translate( CGAL::TRANSLATION, vpnt ); + + CGAL::Aff_transformation_3 xrefl(-n4, n0, n0, n0, + n0, n4, n0, n0, + n0, n0, n4, n0, + n4 ); + + CGAL::Aff_transformation_3 gat4( gat3); + + CGAL::Aff_transformation_3 gat5( n7, n9, n8, + n5, n11, n10, + n3, n6, n12, + n13 ); + + CGAL::Aff_transformation_3 gat6( n4, n6, n7, + n12, n8, n8, + n11, n3, n9, + n13 ); + + + // even + assert( translate.is_even() ); + assert( gtrans.is_even() ); + assert( scale11.is_even() ); + assert( gscale.is_even() ); + assert( ident.is_even() ); + assert( xrefl.is_odd() ); + + CGAL::Aff_transformation_3 a[11]; + + std::cout << '.'; + + a[0] = ident; + a[1] = gat1; + a[2] = gat2; + a[3] = gat3; + a[4] = scale11; + a[5] = gscale; + a[6] = gtrans; + a[7] = translate; + a[8] = xrefl; + a[9] = gat5; + a[10]= gat6; + + CGAL::Aff_transformation_3 inv; + + for (int i = 0; i< 10; i++) + { + // std::cout << " . " << i ; + tp1 = p1.transform( a[i] ); + tp2 = p2.transform( a[i] ); + tp3 = p3.transform( a[i] ); + tp4 = p4.transform( a[i] ); + tpla = pla.transform( a[i] ); + tseg = seg.transform( a[i] ); + tray = ray.transform( a[i] ); + tlin = lin.transform( a[i] ); + ttri = tri.transform( a[i] ); + ttet = tet.transform( a[i] ); + assert( tpla == CGAL::Plane_3( tp1, tp2, tp3) ); + assert( tseg == CGAL::Segment_3(tp1, tp2) ); + assert( tray == CGAL::Ray_3(tp3, tp2) ); + assert( tlin == CGAL::Line_3(tp2, tp4) ); + assert( ttri == CGAL::Triangle_3(tp2, tp3, tp4) ); + assert( ttet == CGAL::Tetrahedron_3(tp1, tp2, tp3, tp4) ); + inv = a[i].inverse(); + tp4 = tp4.transform( inv ); + tpla = tpla.transform( inv ); + tseg = tseg.transform( inv ); + tray = tray.transform( inv ); + tlin = tlin.transform( inv ); + ttri = ttri.transform( inv ); + ttet = ttet.transform( inv ); + assert( tp4 == p4 ); + assert( tpla == pla ); + assert( tseg == seg ); + assert( tray == ray ); + assert( tlin == lin ); + assert( ttri == tri ); + assert( ttet == tet ); + }; + + std::cout << '.'; + + // ident + assert( vec.transform(ident) == vec ); + assert( dir.transform(ident) == dir ); + assert( pnt.transform(ident) == pnt ); + assert( pla.transform(ident) == pla ); + + // scale11 and gscale + tpnt = pnt.transform(scale11); + tvec = vec.transform(scale11); + tdir = dir.transform(scale11); + tseg = seg.transform(scale11); + assert( tseg.squared_length() == FT(11)* FT(11)* seg.squared_length() ); + assert( FT(11)* FT(11)* FT( vec*vec ) == FT( tvec*tvec ) ); + assert( vec.direction() == tvec.direction() ); + assert( dir == tdir ); + tdir = d0.transform(scale11); + assert( d0 == tdir); + tpnt = pnt.transform(gscale); + tvec = vec.transform(gscale); + tdir = dir.transform(gscale); + tseg = seg.transform(gscale); + assert( tseg.squared_length() == FT(11)* FT(11)* seg.squared_length() ); + assert( FT(11)* FT(11)* FT( vec*vec ) == FT( tvec*tvec ) ); + assert( seg.transform(scale11) == seg.transform(gscale) ); + assert( vec.transform(scale11) == vec.transform(gscale) ); + assert( dir.transform(scale11) == dir.transform(gscale) ); + assert( pnt.transform(scale11) == pnt.transform(gscale) ); + assert( pla.transform(scale11) == pla.transform(gscale) ); + + // translate and gtrans + tvec = vec.transform(translate); + tdir = dir.transform(translate); + tp2 = p2.transform(translate); + tp3 = p3.transform(translate); + assert( vec == tvec ); + assert( dir == tdir ); + assert( tp2 == p2 + vpnt ); + assert( tp3 == p3 + vpnt ); + tvec = vec.transform(gtrans); + tdir = dir.transform(gtrans); + tp2 = p2.transform(gtrans); + tp3 = p3.transform(gtrans); + assert( vec == tvec ); + assert( dir == tdir ); + assert( tp2 == p2 + vpnt ); + assert( tp3 == p3 + vpnt ); + assert( vec.transform(translate) == vec.transform(gtrans) ); + assert( dir.transform(translate) == dir.transform(gtrans) ); + assert( pnt.transform(translate) == pnt.transform(gtrans) ); + assert( pla.transform(translate) == pla.transform(gtrans) ); + + // xrefl + tdir = d0.transform(xrefl); + assert( tdir == -d0 ); + tdir = d1.transform(xrefl); + assert( tdir == d1 ); + tdir = d2.transform(xrefl); + assert( tdir == d2 ); + + std::cout << '.'; + + // composition + assert( pnt.transform(xrefl).transform(xrefl) == pnt ); + assert( dir.transform(xrefl).transform(xrefl) == dir ); + assert( vec.transform(xrefl).transform(xrefl) == vec ); + assert( pla.transform(xrefl).transform(xrefl) == pla ); + CGAL::Aff_transformation_3 co1 = xrefl * xrefl; + assert( pnt.transform(xrefl).transform(xrefl) == pnt.transform(co1) ); + assert( dir.transform(xrefl).transform(xrefl) == dir.transform(co1) ); + assert( vec.transform(xrefl).transform(xrefl) == vec.transform(co1) ); + assert( pla.transform(xrefl).transform(xrefl) == pla.transform(co1) ); + co1 = gat2 * gat3; + assert( pnt.transform(gat3).transform(gat2) == pnt.transform(co1) ); + assert( dir.transform(gat3).transform(gat2) == dir.transform(co1) ); + assert( vec.transform(gat3).transform(gat2) == vec.transform(co1) ); + assert( pla.transform(gat3).transform(gat2) == pla.transform(co1) ); + co1 = ident * gat1; + assert( vec.transform(gat1) == vec.transform(co1) ); + assert( dir.transform(gat1) == dir.transform(co1) ); + assert( pnt.transform(gat1) == pnt.transform(co1) ); + assert( pla.transform(gat1) == pla.transform(co1) ); + co1 = gat1 * ident; + assert( vec.transform(gat1) == vec.transform(co1) ); + assert( dir.transform(gat1) == dir.transform(co1) ); + assert( pnt.transform(gat1) == pnt.transform(co1) ); + assert( pla.transform(gat1) == pla.transform(co1) ); + co1 = gat1 * gat1.inverse() ; + assert( vec == vec.transform(co1) ); + assert( dir == dir.transform(co1) ); + assert( pnt == pnt.transform(co1) ); + assert( pla == pla.transform(co1) ); + + assert( vec.transform( gat5 ) == vec.transform( gat2 ) ); + assert( dir.transform( gat5 ) == dir.transform( gat2 ) ); + + assert( pnt.transform( gat6 ) == pnt.transform( gat3 ) ); + assert( vec.transform( gat6 ) == vec.transform( gat3 ) ); + assert( dir.transform( gat6 ) == dir.transform( gat3 ) ); + assert( pla.transform( gat6 ) == pla.transform( gat3 ) ); + +#ifndef CGAL_STRICT_09 + // access + FT FTone(RT(1)); + FT FTzero(RT(0)); + assert( gat2.cartesian(0,0) == FT(n7) / FT(n13) ); + assert( gat2.cartesian(0,1) == FT(n9) / FT(n13) ); + assert( gat2.cartesian(0,2) == FT(n8) / FT(n13) ); + assert( gat2.cartesian(0,3) == FT(n2) / FT(n13) ); + assert( gat2.cartesian(1,0) == FT(n5) / FT(n13) ); + assert( gat2.cartesian(1,1) == FT(n11) / FT(n13) ); + assert( gat2.cartesian(1,2) == FT(n10) / FT(n13) ); + assert( gat2.cartesian(1,3) == FT(n4) / FT(n13) ); + assert( gat2.cartesian(2,0) == FT(n3) / FT(n13) ); + assert( gat2.cartesian(2,1) == FT(n6) / FT(n13) ); + assert( gat2.cartesian(2,2) == FT(n12) / FT(n13) ); + assert( gat2.cartesian(2,3) == FT(n2) / FT(n13) ); + assert( gat2.cartesian(3,0) == FTzero ); + assert( gat2.cartesian(3,1) == FTzero ); + assert( gat2.cartesian(3,2) == FTzero ); + assert( gat2.cartesian(3,3) == FTone ); + + assert( translate.cartesian(0,0) == FTone ); + assert( translate.cartesian(0,1) == FTzero ); + assert( translate.cartesian(0,2) == FTzero ); + assert( translate.cartesian(0,3) == FT(n8) / FT(n10) ); + assert( translate.cartesian(1,0) == FTzero ); + assert( translate.cartesian(1,1) == FTone ); + assert( translate.cartesian(1,2) == FTzero ); + assert( translate.cartesian(1,3) == FT(n1) / FT(n10) ); + assert( translate.cartesian(2,0) == FTzero ); + assert( translate.cartesian(2,1) == FTzero ); + assert( translate.cartesian(2,2) == FTone ); + assert( translate.cartesian(2,3) == FT(n9) / FT(n10) ); + assert( translate.cartesian(3,0) == FTzero ); + assert( translate.cartesian(3,1) == FTzero ); + assert( translate.cartesian(3,2) == FTzero ); + assert( translate.cartesian(3,3) == FTone ); + + FT fscale = FT(n2) / FT(n3); + assert( scale11.cartesian(0,0) == fscale ); + assert( scale11.cartesian(0,1) == FTzero ); + assert( scale11.cartesian(0,2) == FTzero ); + assert( scale11.cartesian(0,3) == FTzero ); + assert( scale11.cartesian(1,0) == FTzero ); + assert( scale11.cartesian(1,1) == fscale ); + assert( scale11.cartesian(1,2) == FTzero ); + assert( scale11.cartesian(1,3) == FTzero ); + assert( scale11.cartesian(2,0) == FTzero ); + assert( scale11.cartesian(2,1) == FTzero ); + assert( scale11.cartesian(2,2) == fscale ); + assert( scale11.cartesian(2,3) == FTzero ); + assert( scale11.cartesian(3,0) == FTzero ); + assert( scale11.cartesian(3,1) == FTzero ); + assert( scale11.cartesian(3,2) == FTzero ); + assert( scale11.cartesian(3,3) == FTone ); + + assert( ident.cartesian(0,0) == FTone ); + assert( ident.cartesian(0,1) == FTzero ); + assert( ident.cartesian(0,2) == FTzero ); + assert( ident.cartesian(0,3) == FTzero ); + assert( ident.cartesian(1,0) == FTzero ); + assert( ident.cartesian(1,1) == FTone ); + assert( ident.cartesian(1,2) == FTzero ); + assert( ident.cartesian(1,3) == FTzero ); + assert( ident.cartesian(2,0) == FTzero ); + assert( ident.cartesian(2,1) == FTzero ); + assert( ident.cartesian(2,2) == FTone ); + assert( ident.cartesian(2,3) == FTzero ); + assert( ident.cartesian(3,0) == FTzero ); + assert( ident.cartesian(3,1) == FTzero ); + assert( ident.cartesian(3,2) == FTzero ); + assert( ident.cartesian(3,3) == FTone ); + + // m + assert( gat2.m(0,0) == FT(n7) / FT(n13) ); + assert( gat2.m(0,1) == FT(n9) / FT(n13) ); + assert( gat2.m(0,2) == FT(n8) / FT(n13) ); + assert( gat2.m(0,3) == FT(n2) / FT(n13) ); + assert( gat2.m(1,0) == FT(n5) / FT(n13) ); + assert( gat2.m(1,1) == FT(n11) / FT(n13) ); + assert( gat2.m(1,2) == FT(n10) / FT(n13) ); + assert( gat2.m(1,3) == FT(n4) / FT(n13) ); + assert( gat2.m(2,0) == FT(n3) / FT(n13) ); + assert( gat2.m(2,1) == FT(n6) / FT(n13) ); + assert( gat2.m(2,2) == FT(n12) / FT(n13) ); + assert( gat2.m(2,3) == FT(n2) / FT(n13) ); + assert( gat2.m(3,0) == FTzero ); + assert( gat2.m(3,1) == FTzero ); + assert( gat2.m(3,2) == FTzero ); + assert( gat2.m(3,3) == FTone ); + + assert( translate.m(0,0) == FTone ); + assert( translate.m(0,1) == FTzero ); + assert( translate.m(0,2) == FTzero ); + assert( translate.m(0,3) == FT(n8) / FT(n10) ); + assert( translate.m(1,0) == FTzero ); + assert( translate.m(1,1) == FTone ); + assert( translate.m(1,2) == FTzero ); + assert( translate.m(1,3) == FT(n1) / FT(n10) ); + assert( translate.m(2,0) == FTzero ); + assert( translate.m(2,1) == FTzero ); + assert( translate.m(2,2) == FTone ); + assert( translate.m(2,3) == FT(n9) / FT(n10) ); + assert( translate.m(3,0) == FTzero ); + assert( translate.m(3,1) == FTzero ); + assert( translate.m(3,2) == FTzero ); + assert( translate.m(3,3) == FTone ); + + assert( scale11.m(0,0) == fscale ); + assert( scale11.m(0,1) == FTzero ); + assert( scale11.m(0,2) == FTzero ); + assert( scale11.m(0,3) == FTzero ); + assert( scale11.m(1,0) == FTzero ); + assert( scale11.m(1,1) == fscale ); + assert( scale11.m(1,2) == FTzero ); + assert( scale11.m(1,3) == FTzero ); + assert( scale11.m(2,0) == FTzero ); + assert( scale11.m(2,1) == FTzero ); + assert( scale11.m(2,2) == fscale ); + assert( scale11.m(2,3) == FTzero ); + assert( scale11.m(3,0) == FTzero ); + assert( scale11.m(3,1) == FTzero ); + assert( scale11.m(3,2) == FTzero ); + assert( scale11.m(3,3) == FTone ); + + assert( ident.m(0,0) == FTone ); + assert( ident.m(0,1) == FTzero ); + assert( ident.m(0,2) == FTzero ); + assert( ident.m(0,3) == FTzero ); + assert( ident.m(1,0) == FTzero ); + assert( ident.m(1,1) == FTone ); + assert( ident.m(1,2) == FTzero ); + assert( ident.m(1,3) == FTzero ); + assert( ident.m(2,0) == FTzero ); + assert( ident.m(2,1) == FTzero ); + assert( ident.m(2,2) == FTone ); + assert( ident.m(2,3) == FTzero ); + assert( ident.m(3,0) == FTzero ); + assert( ident.m(3,1) == FTzero ); + assert( ident.m(3,2) == FTzero ); + assert( ident.m(3,3) == FTone ); + + // homogeneous + assert( FT( gat2.hm(0,0) ) / FT( gat2.hm(3,3) ) \ + == FT(n7) / FT(n13) ); + assert( FT( gat2.hm(0,1) ) / FT( gat2.hm(3,3) ) \ + == FT(n9) / FT(n13) ); + assert( FT( gat2.hm(0,2) ) / FT( gat2.hm(3,3) ) \ + == FT(n8) / FT(n13) ); + assert( FT( gat2.hm(0,3) ) / FT( gat2.hm(3,3) ) \ + == FT(n2) / FT(n13) ); + assert( FT( gat2.hm(1,0) ) / FT( gat2.hm(3,3) ) \ + == FT(n5) / FT(n13) ); + assert( FT( gat2.hm(1,1) ) / FT( gat2.hm(3,3) ) \ + == FT(n11) / FT(n13) ); + assert( FT( gat2.hm(1,2) ) / FT( gat2.hm(3,3) ) \ + == FT(n10) / FT(n13) ); + assert( FT( gat2.hm(1,3) ) / FT( gat2.hm(3,3) ) \ + == FT(n4) / FT(n13) ); + assert( FT( gat2.hm(2,0) ) / FT( gat2.hm(3,3) ) \ + == FT(n3) / FT(n13) ); + assert( FT( gat2.hm(2,1) ) / FT( gat2.hm(3,3) ) \ + == FT(n6) / FT(n13) ); + assert( FT( gat2.hm(2,2) ) / FT( gat2.hm(3,3) ) \ + == FT(n12) / FT(n13) ); + assert( FT( gat2.hm(2,3) ) / FT( gat2.hm(3,3) ) \ + == FT(n2) / FT(n13) ); + assert( FT( gat2.hm(3,0) ) / FT( gat2.hm(3,3) ) == FTzero ); + assert( FT( gat2.hm(3,1) ) / FT( gat2.hm(3,3) ) == FTzero ); + assert( FT( gat2.hm(3,2) ) / FT( gat2.hm(3,3) ) == FTzero ); + assert( FT( gat2.hm(3,3) ) / FT( gat2.hm(3,3) ) == FTone ); + + assert( FT( translate.hm(0,0) ) / FT( translate.hm(3,3) ) == FTone ); + assert( FT( translate.hm(0,1) ) / FT( translate.hm(3,3) ) == FTzero ); + assert( FT( translate.hm(0,1) ) / FT( translate.hm(3,3) ) == FTzero ); + assert( FT( translate.hm(0,3) ) / FT( translate.hm(3,3) ) \ + == FT(n8) / FT(n10) ); + assert( FT( translate.hm(1,0) ) / FT( translate.hm(3,3) ) == FTzero ); + assert( FT( translate.hm(1,1) ) / FT( translate.hm(3,3) ) == FTone ); + assert( FT( translate.hm(1,2) ) / FT( translate.hm(3,3) ) == FTzero ); + assert( FT( translate.hm(1,3) ) / FT( translate.hm(3,3) ) \ + == FT(n1) / FT(n10) ); + assert( FT( translate.hm(2,0) ) / FT( translate.hm(3,3) ) == FTzero ); + assert( FT( translate.hm(2,1) ) / FT( translate.hm(3,3) ) == FTzero ); + assert( FT( translate.hm(2,2) ) / FT( translate.hm(3,3) ) == FTone ); + assert( FT( translate.hm(2,3) ) / FT( translate.hm(3,3) ) \ + == FT(n9) / FT(n10) ); + assert( FT( translate.hm(3,0) ) / FT( translate.hm(3,3) ) == FTzero ); + assert( FT( translate.hm(3,0) ) / FT( translate.hm(3,3) ) == FTzero ); + assert( FT( translate.hm(3,1) ) / FT( translate.hm(3,3) ) == FTzero ); + assert( FT( translate.hm(3,3) ) / FT( translate.hm(3,3) ) == FTone ); + + assert( FT( scale11.hm(0,0) ) / FT( scale11.hm(3,3) ) == fscale ); + assert( FT( scale11.hm(0,1) ) / FT( scale11.hm(3,3) ) == FTzero ); + assert( FT( scale11.hm(0,2) ) / FT( scale11.hm(3,3) ) == FTzero ); + assert( FT( scale11.hm(0,3) ) / FT( scale11.hm(3,3) ) == FTzero ); + assert( FT( scale11.hm(1,0) ) / FT( scale11.hm(3,3) ) == FTzero ); + assert( FT( scale11.hm(1,1) ) / FT( scale11.hm(3,3) ) == fscale ); + assert( FT( scale11.hm(1,2) ) / FT( scale11.hm(3,3) ) == FTzero ); + assert( FT( scale11.hm(1,3) ) / FT( scale11.hm(3,3) ) == FTzero ); + assert( FT( scale11.hm(2,0) ) / FT( scale11.hm(3,3) ) == FTzero ); + assert( FT( scale11.hm(2,1) ) / FT( scale11.hm(3,3) ) == FTzero ); + assert( FT( scale11.hm(2,2) ) / FT( scale11.hm(3,3) ) == fscale ); + assert( FT( scale11.hm(2,3) ) / FT( scale11.hm(3,3) ) == FTzero ); + assert( FT( scale11.hm(3,0) ) / FT( scale11.hm(3,3) ) == FTzero ); + assert( FT( scale11.hm(3,1) ) / FT( scale11.hm(3,3) ) == FTzero ); + assert( FT( scale11.hm(3,2) ) / FT( scale11.hm(3,3) ) == FTzero ); + assert( FT( scale11.hm(3,3) ) / FT( scale11.hm(3,3) ) == FTone ); + + // samples + // cartesian == m + assert( gat1.cartesian(1,2) == gat1.m(1,2) ); + assert( scale11.cartesian(0,0) == scale11.m(0,0) ); + assert( translate.cartesian(1,3) == translate.m(1,3) ); + assert( ident.cartesian(1,2) == ident.m(1,2) ); + assert( gscale.cartesian(1,1) == gscale.m(1,1) ); + assert( gat3.cartesian(2,1) == gat3.m(2,1) ); + + // m == hm/hm(3,3) + assert( gat3.m(1,2) == FT( gat3.hm(1,2)) / FT( gat3.hm(3,3) )); + assert( gat4.m(1,0) == FT( gat4.hm(1,0)) / FT( gat4.hm(3,3) )); + assert( gat5.m(2,0) == FT( gat5.hm(2,0)) / FT( gat5.hm(3,3) )); + assert( translate.m(1,3) \ + == FT( translate.hm(1,3)) / FT( translate.hm(3,3) )); + assert( scale11.m(1,1) == FT( scale11.hm(1,1)) / FT( scale11.hm(3,3) )); + + // homogeneous == hm + assert( gat1.homogeneous(1,2) == gat1.hm(1,2) ); + assert( gat3.homogeneous(2,3) == gat3.hm(2,3) ); + assert( gat4.homogeneous(2,3) == gat4.hm(2,3) ); + assert( scale11.homogeneous(0,0) == scale11.hm(0,0) ); + assert( translate.homogeneous(1,2) == translate.hm(1,2) ); + +#endif // CGAL_STRICT_09 + + std::cout << "done" << std::endl; + return true; +} + +#endif // CGAL__TEST_CLS_AFF_TRANSFORMATION_3_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_aff_transformation_3.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_aff_transformation_3.h new file mode 100644 index 00000000000..5972f5fe77b --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_aff_transformation_3.h @@ -0,0 +1,39 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_aff_transformation_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +template bool _test_cls_aff_transformation_3(const R& ); + diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_circle_2.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_circle_2.C new file mode 100644 index 00000000000..3a7fc1d922f --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_circle_2.C @@ -0,0 +1,186 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_cls_circle_2.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_CIRCLE_2_C +#define CGAL__TEST_CLS_CIRCLE_2_C +#ifndef CGAL__TEST_CLS_CIRCLE_2_H +#include +#endif // CGAL__TEST_CLS_CIRCLE_2_H + +template +bool +_test_cls_circle_2(const R& ) +{ + std::cout << "Testing class Circle_2"; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + typename R::Circle_2 ic; + CGAL::Circle_2 c0; + + RT n0 = 0; + RT n1 = 16; + RT n2 = -4; + RT n3 = 2; + RT n4 = 5; + RT n5 = 10; + RT n6 = 6; + RT n8 = 9; + RT n9 = 36; + RT n10= 3; + RT n11=-11; + RT n12=200; + RT n13= 13; + + CGAL::Point_2 p0( n1, n2, -n2); // ( 4, -1) + CGAL::Point_2 p1( n6, n8, n10); // ( 2, 3) + CGAL::Point_2 p2( n2, n0, n2); // ( 1, 0) + CGAL::Point_2 p3( n5, n5, n4); // ( 2, 2) + CGAL::Point_2 p4( n0, n2, n2); // ( 0, 1) + + CGAL::Vector_2 vx = p2 - CGAL::ORIGIN; + CGAL::Vector_2 vy = p4 - CGAL::ORIGIN; + CGAL::Vector_2 v1 = p1 - CGAL::ORIGIN; + + CGAL::Circle_2 c1( p0, p1, p2); + CGAL::Circle_2 c2( p0, p1, p3); + CGAL::Circle_2 c3( p1, p0, p2); + CGAL::Circle_2 c4( p3, FT( n9 )); // n9 = (n6)^2 + CGAL::Vector_2 vx6 = vx * n6; + CGAL::Vector_2 vy6 = vy * n6; + CGAL::Circle_2 c5( p3 - vx6, p3 + vx6, p3 + vy6); + CGAL::Circle_2 c6( c3 ); + CGAL::Circle_2 c7( p3, n9, CGAL::POSITIVE); + CGAL::Circle_2 c8( p3, n9, CGAL::NEGATIVE); + CGAL::Circle_2 cc( p3 - vx6, p3 + vx6); + CGAL::Circle_2 cp( p3 - vx6, p3 + vx6, CGAL::POSITIVE); + CGAL::Circle_2 cn( p3 - vx6, p3 + vx6, CGAL::NEGATIVE); + c0 = c3; + + assert( c1 == c1 ); + assert( c1 != c2 ); + assert( c3 == c0 ); + assert( c0 == c3 ); + assert( c3 == c6 ); + assert( c7 != c8 ); + assert( c4 == c7 ); + assert( cc == cp ); + assert( cn != cp ); + assert( cc != c8 ); + assert( cc == c7 ); + + assert( c5.center() == p3 ); + assert( cc.center() == p3 ); + assert( c5.squared_radius() == FT( n9 ) ); + assert( c4.squared_radius() == cc.squared_radius() ); + assert( c4 == c5 ); + assert( c4 == c7 ); + assert( c4 != c8 ); + assert( cn == cp.opposite() ); + assert( c7.opposite() == c8 ); + assert( c8.opposite() == c7 ); + assert( c1.opposite() == c3 ); + assert( c3.opposite() == c1 ); + assert( c7.orientation() == CGAL::POSITIVE ); + assert( c8.orientation() == CGAL::NEGATIVE ); + assert( c5.orientation() == CGAL::POSITIVE ); + assert( cc.orientation() == CGAL::POSITIVE ); + assert( cp.orientation() == CGAL::POSITIVE ); + assert( cn.orientation() == CGAL::NEGATIVE ); + + std::cout << '.'; + + assert( c4.center() == p3 ); + assert( c5.center() == p3 ); + assert( c4.squared_radius() == FT( n9 ) ); + assert( c5.squared_radius() == FT( n9 ) ); + assert( c8.squared_radius() == FT( n9 ) ); + + assert( c7.bounded_side( p3 + vx*n2 ) == CGAL::ON_BOUNDED_SIDE ); + assert( c7.bounded_side( p3 + vy*n11 ) == CGAL::ON_UNBOUNDED_SIDE ); + assert( c7.bounded_side( p3 - vy6 ) == CGAL::ON_BOUNDARY ); + assert( c8.bounded_side( p3 + vx*n2 ) == CGAL::ON_BOUNDED_SIDE ); + assert( c8.bounded_side( p3 + vy*n11 ) == CGAL::ON_UNBOUNDED_SIDE ); + assert( c8.bounded_side( p3 - vy6 ) == CGAL::ON_BOUNDARY ); + assert( cc.has_on_boundary( p3 + vy6) ); + assert( cc.has_on_boundary( p3 - vx6) ); + + std::cout << '.'; + + CGAL::Aff_transformation_2 + rotate1(CGAL::ROTATION,CGAL::Direction_2(n11,n13),-n2,n12), + rotate2(CGAL::ROTATION,CGAL::Direction_2(-n8, n9),-n2,n12), + rotate3(CGAL::ROTATION,CGAL::Direction_2( n5,-n1),-n2,n12), + rotate4(CGAL::ROTATION,CGAL::Direction_2(-n5,-n11),-n2,n12); + CGAL::Point_2 p6 = p2.transform( rotate1 ); + CGAL::Point_2 p7 = p2.transform( rotate2 ); + CGAL::Point_2 p8 = p2.transform( rotate3 ); + CGAL::Point_2 p9 = p2.transform( rotate4 ); + p6 = p6 + v1; // v1 = ( 2, 3 ) + p7 = p7 + v1; + p8 = p8 + v1; + p9 = p9 + v1; + CGAL::Circle_2 c10 (p6, p8, p7); + assert( c10.orientation() == CGAL::POSITIVE ); + assert( c10.opposite().orientation() == CGAL::NEGATIVE ); + + assert( c10.oriented_side(c10.center() ) == CGAL::ON_POSITIVE_SIDE ); + assert( c10.oriented_side(CGAL::ORIGIN + v1 + vx/n2 ) \ + == CGAL::ON_POSITIVE_SIDE ); + assert( c10.oriented_side(CGAL::ORIGIN + v1 + vx*n2 ) \ + == CGAL::ON_NEGATIVE_SIDE ); + assert( c10.oriented_side(p9 ) == CGAL::ON_ORIENTED_BOUNDARY ); + assert( c10.has_on_boundary(p9) ); + assert( c10.has_on_boundary(p4 + v1) ); + CGAL::Point_2 p11( n4, n4, n3) ; // (2.5, 2.5) + CGAL::Point_2 p12( n5, n5, n3) ; // ( 5 , 5 ) + assert( c10.has_on_bounded_side( p11 ) ); + assert( ! c10.has_on_bounded_side( p12 ) ); + assert( c10.has_on_unbounded_side( p12 ) ); + assert( c10.has_on_positive_side( p11 ) ); + assert( c10.has_on_negative_side( p12 ) ); + assert( c10.opposite().has_on_negative_side( p11 ) ); + assert( c10.opposite().has_on_positive_side( p12 ) ); + assert( c10.has_on_boundary( p6 ) ); + assert( c10.has_on_boundary( p8 ) ); + + std::cout << '.'; + + CGAL::Circle_2 c11( p0 ); + CGAL::Circle_2 c12( p0, CGAL::POSITIVE ); + CGAL::Circle_2 c13( p0, CGAL::NEGATIVE ); + assert( c11.orientation() == CGAL::POSITIVE ); + assert( c12.orientation() == CGAL::POSITIVE ); + assert( c13.orientation() == CGAL::NEGATIVE ); + assert( c11.is_degenerate() ); + assert( c12.is_degenerate() ); + assert( c13.is_degenerate() ); + + std::cout << "done" << std::endl; + return true; +} + +#endif // CGAL__TEST_CLS_CIRCLE_2_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_circle_2.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_circle_2.h new file mode 100644 index 00000000000..10f94f5c4c4 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_circle_2.h @@ -0,0 +1,40 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_cls_circle_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_CIRCLE_2_H +#define CGAL__TEST_CLS_CIRCLE_2_H + +#ifndef CGAL_CIRCLE_2_H +#include +#endif // CGAL_CIRCLE_2_H +#ifndef CGAL_AFF_TRANSFORMATION_2_H +#include +#endif // CGAL_AFF_TRANSFORMATION_2_H + + +template bool _test_cls_circle_2(const R& ); + + +#endif // CGAL__TEST_CLS_CIRCLE_2_H diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_direction_2.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_direction_2.C new file mode 100644 index 00000000000..d5ebaf83e30 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_direction_2.C @@ -0,0 +1,82 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_cls_direction_2.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_DIRECTION_2_C +#define CGAL__TEST_CLS_DIRECTION_2_C +#ifndef CGAL__TEST_CLS_DIRECTION_2_H +#include +#endif // CGAL__TEST_CLS_DIRECTION_2_H + +template +bool +_test_cls_direction_2(const R& ) +{ + std::cout << "Testing class Direction_2" ; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + typename R::Direction_2 id; + CGAL::Direction_2 d0; + CGAL::Direction_2 d1(id); + + std::cout << '.'; + RT n0 = 10; + RT n1 = 8; + RT n2 = 4; + RT n3 = 2; + + CGAL::Vector_2 v( n1, n2); // (8,4) + CGAL::Direction_2 d2(v); + CGAL::Direction_2 d3( n0, n1); // (10,8) + CGAL::Direction_2 d4( d3 ); + CGAL::Direction_2 d5 = d3; + + assert( d3 == d3 ); + assert( d3 == d4 ); + assert( d5 == d3 ); + assert( d2 != d3 ); + assert( d3 != d2 ); + + std::cout << '.'; + CGAL::Vector_2 vv = d2.vector(); + assert( v == vv ); + + d0 = -d3; + + assert( d0 != d3 ); + assert( d3 == -d0); + + std::cout << '.'; + assert( d3.delta(0) == n0 ); + assert( d3.delta(1) == n1 ); + assert( d3.delta(0) == d3.dx() ); + assert( d3.delta(1) == d3.dy() ); + + std::cout << "done" << std::endl; + return true; +} + +#endif // CGAL__TEST_CLS_DIRECTION_2_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_direction_2.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_direction_2.h new file mode 100644 index 00000000000..208264cbb92 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_direction_2.h @@ -0,0 +1,40 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_cls_direction_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_DIRECTION_2_H +#define CGAL__TEST_CLS_DIRECTION_2_H + +#ifndef CGAL_VECTOR_2_H +#include +#endif // CGAL_VECTOR_2_H +#ifndef CGAL_DIRECTION_2_H +#include +#endif // CGAL_DIRECTION_2_H + + +template bool _test_cls_direction_2(const R& ); + + +#endif // CGAL__TEST_CLS_DIRECTION_2_H diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_direction_3.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_direction_3.C new file mode 100644 index 00000000000..09da08e43e3 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_direction_3.C @@ -0,0 +1,89 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_direction_3.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_DIRECTION_3_C +#define CGAL__TEST_CLS_DIRECTION_3_C +#ifndef CGAL__TEST_CLS_DIRECTION_3_H +#include +#endif // CGAL__TEST_CLS_DIRECTION_3_H + +template +bool +_test_cls_direction_3(const R& ) +{ + std::cout << "Testing class Direction_3" ; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + typename R::Direction_3 id; + + CGAL::Direction_3 d0; + CGAL::Direction_3 d1(id); + + std::cout << '.'; + RT n0 = 10; + RT n1 = 8; + RT n2 = 4; + RT n3 = 2; + + CGAL::Vector_3 v( n1, n2, n3); + CGAL::Direction_3 d2(v); + CGAL::Direction_3 d3( n0, n1, n2); + CGAL::Direction_3 d4( d3 ); + CGAL::Direction_3 d5 = d3; + + assert( d3 == d3 ); + assert( d3 == d4 ); + assert( d5 == d3 ); + assert( d2 != d3 ); + assert( d3 != d2 ); + + std::cout << '.'; +#if (__GNUG__ == 2) && (__GNUC_MINOR__==91) + CGAL::Vector_3 vv = d2.to_vector(); +#else + CGAL::Vector_3 vv = d2.vector(); +#endif // egcs 2.91.66 + assert( v == vv ); + + d0 = -d3; + + assert( d0 != d3 ); + assert( d3 == -d0); + + std::cout << '.'; + assert( d3.delta(0) == n0 ); + assert( d3.delta(1) == n1 ); + assert( d3.delta(2) == n2 ); + assert( d3.delta(0) == d3.dx() ); + assert( d3.delta(1) == d3.dy() ); + assert( d3.delta(2) == d3.dz() ); + + std::cout << "done" << std::endl; + return true; +} + +#endif // CGAL__TEST_CLS_DIRECTION_3_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_direction_3.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_direction_3.h new file mode 100644 index 00000000000..d8e4d0cd373 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_direction_3.h @@ -0,0 +1,36 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_direction_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_VECTOR_3_H +#include +#endif // CGAL_VECTOR_3_H +#ifndef CGAL_DIRECTION_3_H +#include +#endif // CGAL_DIRECTION_3_H + + +template bool _test_cls_direction_3(const R& ); + + diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_iso_cuboid_3.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_iso_cuboid_3.C new file mode 100644 index 00000000000..dd68ed99e72 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_iso_cuboid_3.C @@ -0,0 +1,147 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_iso_cuboid_3.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_ISO_CUBOID_3_C +#define CGAL__TEST_CLS_ISO_CUBOID_3_C +#include + +template +bool +_test_cls_iso_cuboid_3(const R& ) +{ + std::cout << "Testing class Iso_cuboid_3"; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + typename R::Iso_cuboid_3 ir; + CGAL::Iso_cuboid_3 r0(ir); + + RT n0 = 0; + RT n1 = 1; + RT n2 = 2; + RT n3 = 3; + RT n4 = 4; + RT n5 = 5; + RT n6 = 6; + RT n7 = 7; + RT n8 = 8; + RT n9 = 9; + RT n10= 10; + RT n12= 12; + + CGAL::Point_3 p1( n5, n5, n5, n5); // ( 1, 1, 1) + CGAL::Point_3 p2( n2, n8, n6, n2); // ( 1, 4, 3) + CGAL::Point_3 p3( n12, n12, n9, n3); // ( 4, 4, 3) + CGAL::Point_3 p4( n5, n4, n3, n1); // ( 5, 4, 3) + CGAL::Point_3 p5( n4, n1, n1); // ( 4, 1, 1) + CGAL::Point_3 p6( n8, n4, n4, n2); // ( 4, 2, 2) + CGAL::Point_3 p7( n6, n3, n4, n2); // ( 3, 1.5, 2) + CGAL::Point_3 p8( n4, n6, n4, n2); // ( 2, 3, 2) + CGAL::Point_3 p9(-n3, n7,n10); // (-3, 7, 10) + CGAL::Point_3 p10(n8, n8, n2, n2); // ( 4, 4, 1) + CGAL::Point_3 p11(n2, n8, n2, n2); // ( 1, 4, 1) + CGAL::Point_3 p12(n1, n1, n3 ); // ( 1, 1, 3) + CGAL::Point_3 p13(n4, n1, n3 ); // ( 4, 1, 3) + + CGAL::Iso_cuboid_3 r1( p1, p3); + CGAL::Iso_cuboid_3 r2( p3, p1); + CGAL::Iso_cuboid_3 r3( p2, p5); + CGAL::Iso_cuboid_3 r4( p5, p2); + CGAL::Iso_cuboid_3 r5( p9, p2); + CGAL::Iso_cuboid_3 r6( r2 ); + r0 = r1; + + assert( r1 == r1 ); + assert( r0 == r1 ); + assert( r1 == r2 ); + assert( r1 == r3 ); + assert( r1 == r4 ); + assert( r2 == r6 ); + assert( r2 != r5 ); + + std::cout << '.'; + + std::cout << std::endl; + std::cout << r1.min() << std::endl; + std::cout << r1.max() << std::endl; + + assert( r1.min() == p1 ); + assert( r1.max() == p3 ); + assert( r4.min() == p1 ); + assert( r5.min() != p9 ); + assert( r2.max() == p3 ); + + assert( r1.vertex(0) == p1 ); + assert( r1.vertex(1) == p5 ); + assert( r1.vertex(2) == p10); + assert( r1.vertex(3) == p11); + assert( r1.vertex(4) == p2 ); + assert( r1.vertex(5) == p12); + assert( r1.vertex(6) == p13); + assert( r1.vertex(7) == p3 ); + + assert( r3.vertex(0) == p1 ); + assert( r3.vertex(1) == p5 ); + assert( r3.vertex(2) == p10); + assert( r3.vertex(3) == p11); + assert( r3.vertex(4) == p2 ); + assert( r3.vertex(5) == p12); + assert( r3.vertex(6) == p13); + assert( r3.vertex(7) == p3 ); + + assert( r2[0] == r2.vertex(0) ); + assert( r2[1] == r2.vertex(1) ); + assert( r2[3] == r2.vertex(3) ); + assert( r2[4] == r2.vertex(4) ); + assert( r2[5] == r2.vertex(5) ); + assert( r2[6] == r2.vertex(6) ); + assert( r2[7] == r2.vertex(7) ); + assert( r2[8] == r2.vertex(0) ); + + std::cout << '.'; + + assert( r1.bounded_side( p8 ) == CGAL::ON_BOUNDED_SIDE ); + assert( r2.bounded_side( p7 ) == CGAL::ON_BOUNDED_SIDE ); + assert( r3.bounded_side( p9 ) == CGAL::ON_UNBOUNDED_SIDE ); + assert( r1.bounded_side( p4 ) == CGAL::ON_UNBOUNDED_SIDE ); + assert( r4.bounded_side( p6 ) == CGAL::ON_BOUNDARY ); + assert( r4.bounded_side( p1 ) == CGAL::ON_BOUNDARY ); + + assert( r5.has_on_boundary( p2 ) ); + assert( r4.has_on_boundary( p2 ) ); + assert( r2.has_on_bounded_side( p7 ) ); + assert( r4.has_on_unbounded_side( p9 ) ); + + std::cout << '.'; + + assert( CGAL::Iso_cuboid_3( p1, p1 ).is_degenerate() ); + assert( CGAL::Iso_cuboid_3( p1, p2 ).is_degenerate() ); + assert( CGAL::Iso_cuboid_3( p3, p4 ).is_degenerate() ); + + std::cout << "done" << std::endl; + return true; +} +#endif // CGAL__TEST_CLS_ISO_RECTANGLE_2_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_iso_cuboid_3.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_iso_cuboid_3.h new file mode 100644 index 00000000000..9081c4a5f5d --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_iso_cuboid_3.h @@ -0,0 +1,32 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_iso_cuboid_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_ISO_CUBOID_3_H +#define CGAL__TEST_CLS_ISO_CUBOID_3_H +#include + +template bool _test_cls_iso_cuboid_3(const R& ); + +#endif // CGAL__TEST_CLS_ISO_CUBOID_3_H diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_iso_rectangle_2.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_iso_rectangle_2.C new file mode 100644 index 00000000000..a9cc8021838 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_iso_rectangle_2.C @@ -0,0 +1,128 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_cls_iso_rectangle_2.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_ISO_RECTANGLE_2_C +#define CGAL__TEST_CLS_ISO_RECTANGLE_2_C +#ifndef CGAL__TEST_CLS_ISO_RECTANGLE_2_H +#include +#endif // CGAL__TEST_CLS_ISO_RECTANGLE_2_H + +template +bool +_test_cls_iso_rectangle_2(const R& ) +{ + std::cout << "Testing class Iso_rectangle_2"; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + typename R::Iso_rectangle_2 ir; + CGAL::Iso_rectangle_2 r0(ir); + + RT n0 = 0; + RT n1 = 1; + RT n2 = 2; + RT n3 = 3; + RT n4 = 4; + RT n5 = 5; + RT n6 = 6; + RT n7 = 7; + RT n8 = 8; + RT n9 = 9; + RT n10= 10; + RT n12= 12; + + CGAL::Point_2 p1( n5, n5, n5); // ( 1, 1) + CGAL::Point_2 p2( n2, n8, n2); // ( 1, 4) + CGAL::Point_2 p3( n12, n12, n3); // ( 4, 4) + CGAL::Point_2 p4( n5, n4, n1); // ( 5, 4) + CGAL::Point_2 p5( n4, n1); // ( 4, 1) + CGAL::Point_2 p6( n8, n4, n2); // ( 4, 2) + CGAL::Point_2 p7( n6, n3, n2); // ( 3, 1.5) + CGAL::Point_2 p8( n4, n6, n2); // ( 2, 3) + CGAL::Point_2 p9(-n3, n7); // (-3, 7) + + CGAL::Iso_rectangle_2 r1( p1, p3); + CGAL::Iso_rectangle_2 r2( p3, p1); + CGAL::Iso_rectangle_2 r3( p2, p5); + CGAL::Iso_rectangle_2 r4( p5, p2); + CGAL::Iso_rectangle_2 r5( p9, p2); + CGAL::Iso_rectangle_2 r6( r2 ); + r0 = r1; + + assert( r1 == r1 ); + assert( r0 == r1 ); + assert( r1 == r2 ); + assert( r1 == r3 ); + assert( r1 == r4 ); + assert( r2 == r6 ); + assert( r2 != r5 ); + + std::cout << '.'; + + assert( r1.vertex(0) == p1 ); + assert( r1.vertex(1) == p5 ); + assert( r1.vertex(2) == p3 ); + assert( r1.vertex(3) == p2 ); + assert( r1.vertex(4) == p1 ); + assert( r3.vertex(0) == p1 ); + assert( r3.vertex(1) == p5 ); + assert( r3.vertex(2) == p3 ); + assert( r3.vertex(3) == p2 ); + assert( r3.vertex(4) == p1 ); + assert( r2[0] == r2.vertex(0) ); + assert( r2[1] == r2.vertex(1) ); + assert( r2[3] == r2.vertex(3) ); + assert( r2[4] == r2.vertex(0) ); + + std::cout << '.'; + + assert( r4.min() == p1 ); + assert( r1.min() == p1 ); + assert( r5.min() != p9 ); + assert( r2.max() == p3 ); + + assert( r1.bounded_side( p8 ) == CGAL::ON_BOUNDED_SIDE ); + assert( r2.bounded_side( p7 ) == CGAL::ON_BOUNDED_SIDE ); + assert( r3.bounded_side( p9 ) == CGAL::ON_UNBOUNDED_SIDE ); + assert( r1.bounded_side( p4 ) == CGAL::ON_UNBOUNDED_SIDE ); + assert( r4.bounded_side( p6 ) == CGAL::ON_BOUNDARY ); + assert( r4.bounded_side( p1 ) == CGAL::ON_BOUNDARY ); + + assert( r5.has_on_boundary( p2 ) ); + assert( r4.has_on_boundary( p2 ) ); + assert( r2.has_on_bounded_side( p7 ) ); + assert( r4.has_on_unbounded_side( p9 ) ); + + std::cout << '.'; + + assert( CGAL::Iso_rectangle_2( p1, p1 ).is_degenerate() ); + assert( CGAL::Iso_rectangle_2( p1, p2 ).is_degenerate() ); + assert( CGAL::Iso_rectangle_2( p3, p4 ).is_degenerate() ); + + std::cout << "done" << std::endl; + return true; +} +#endif // CGAL__TEST_CLS_ISO_RECTANGLE_2_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_iso_rectangle_2.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_iso_rectangle_2.h new file mode 100644 index 00000000000..09071e1c2c4 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_iso_rectangle_2.h @@ -0,0 +1,37 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_cls_iso_rectangle_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_ISO_RECTANGLE_2_H +#define CGAL__TEST_CLS_ISO_RECTANGLE_2_H + +#ifndef CGAL_ISO_RECTANGLE_2_H +#include +#endif // CGAL_ISO_RECTANGLE_2_H + + +template bool _test_cls_iso_rectangle_2(const R& ); + + +#endif // CGAL__TEST_CLS_ISO_RECTANGLE_2_H diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_line_2.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_line_2.C new file mode 100644 index 00000000000..460f4dc8da7 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_line_2.C @@ -0,0 +1,177 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_cls_line_2.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_LINE_2_C +#define CGAL__TEST_CLS_LINE_2_C +#ifndef CGAL__TEST_CLS_LINE_2_H +#include +#endif // CGAL__TEST_CLS_LINE_2_H + +template +bool +_test_cls_line_2(const R& ) +{ + std::cout << "Testing class Line_2"; + + typedef typename R::RT RT; + typedef typename R::FT gnuFT; + + RT n0 = 0; + RT n1 = 1; + RT n2 = 2; + RT n3 = 3; + RT n4 = 4; + RT n5 = 5; + RT n6 = 6; + RT n8 = 8; + + CGAL::Point_2 p1( n2, n4, n2 ); // ( 1, 2 ) + CGAL::Point_2 p2( n6, n8, n2 ); // ( 3, 4 ) + CGAL::Point_2 p3(-n6, n6, n3 ); // (-2, 2 ) + CGAL::Point_2 p4( n8, n4, n2 ); // ( 4, 2 ) + + typename R::Line_2 il; + CGAL::Line_2 l0(il); + CGAL::Line_2 l12( p1, p2 ); + CGAL::Line_2 l21( p2, p1 ); + CGAL::Line_2 l34( p3, p4 ); + CGAL::Line_2 l43( p4, p3 ); + CGAL::Line_2 lc ( l12 ); + l0 = l12 ; + + CGAL::Segment_2 s12( p1, p2); + CGAL::Line_2 ls12( s12 ); + CGAL::Ray_2 r21( p2, p1 ); + CGAL::Line_2 lr21( r21 ); + CGAL::Direction_2 d12 (p2 - p1); + CGAL::Direction_2 d21 (p1 - p2); + CGAL::Line_2 ld12(p1, d12); + CGAL::Line_2 ld21(p2, d21); + + std::cout << '.'; + + assert( l12 == l12 ); + assert( l0 == l12 ); + assert( l12 == lc ); + assert( l21 == lr21 ); + assert( l12 == ls12 ); + assert( l12 == ld12 ); + assert( l12 != l21 ); + assert( l12 != ld21 ); + assert( lr21 != ls12 ); + assert( l34 != l43 ); + assert( l12 != l43 ); + + assert( l34.opposite() == l43); + assert( l43.opposite() == l34); + assert( l43.opposite().opposite() == l43); + assert( ld12 == ld21.opposite() ); + + CGAL::Line_2 labc( n2, n1, n4); + assert( labc.a() == n2 ); + assert( labc.b() == n1 ); + assert( labc.c() == n4 ); + + assert( l12.direction() == d12 ); + assert( l21.direction() == d21 ); + assert( ld21.direction() == d21 ); + assert( ld21.direction() == - ld12.direction() ); + assert( labc.direction() == CGAL::Direction_2(labc.b(), - labc.a() ) ); + + std::cout << '.'; + + assert( l43.has_on( l43.point(0) ) ); + assert( lr21.has_on( lr21.point(1) ) ); + assert( ld21.has_on( ld21.point(-2) ) ); + assert( lr21.has_on( r21.source() ) ); + assert( labc.has_on( labc.point(0) ) ); + + assert( l43.is_horizontal() ); + assert( ! l34.is_vertical() ); + assert( CGAL::Line_2( n1, n0, n3 ).is_vertical() ); + assert( CGAL::Line_2( n0, n2, n3 ).is_horizontal() ); + assert( ! lr21.is_horizontal() ); + + assert( ld12.y_at_x( gnuFT(3) ) == gnuFT( 4) ); + assert( lr21.y_at_x( gnuFT(3) ) == gnuFT( 4) ); + assert( ld12.y_at_x( gnuFT(1) ) == gnuFT( 2) ); + assert( l12.y_at_x( gnuFT(5) ) == gnuFT( 6) ); + assert( l34.y_at_x( gnuFT(8) ) == gnuFT( 2) ); + + assert( l12.x_at_y( gnuFT(0) ) == gnuFT( -1 ) ); + assert( ls12.x_at_y( gnuFT(4) ) == gnuFT( 3 ) ); + assert( l21.x_at_y( gnuFT(6) ) == gnuFT( 5 ) ); + assert( ld21.x_at_y( gnuFT(2) ) == gnuFT( 1 ) ); + + CGAL::Direction_2 up( n0, n1 ); + CGAL::Aff_transformation_2 rot90(CGAL::ROTATION, up, n1, RT(100) ); + CGAL::Line_2 l12perp1( l12.perpendicular( p1 ) ); + CGAL::Line_2 l21perp1( l21.perpendicular( p1 ) ); + CGAL::Line_2 labcperp( labc.perpendicular( labc.point(1) ) ); + assert( l12perp1.opposite() == l21perp1 ); + assert( labcperp.direction() == CGAL::Direction_2( labc.a(), labc.b()) ); + assert( l12perp1.has_on( p1 ) ); + assert( l21perp1.has_on( p1 ) ); + CGAL::Line_2 l12perp4( l12.perpendicular( p4 ) ); + assert( l12perp4.has_on( p4 ) ); + assert( l12.direction().transform( rot90 ) == l12perp4.direction() ); + + assert( CGAL::Line_2( n0, n0, n6 ).is_degenerate() ); + assert( CGAL::Line_2( p1, p1 ).is_degenerate() ); + assert( ! CGAL::Line_2( p1, p3 ).is_degenerate() ); + assert( ! l34.is_degenerate() ); + + std::cout << '.'; + + CGAL::Point_2 p5( n5, n6 ); + assert( l12.oriented_side(p3) == CGAL::ON_POSITIVE_SIDE ); + assert( l12.oriented_side(p4) == CGAL::ON_NEGATIVE_SIDE ); + assert( l12.oriented_side(p2) == CGAL::ON_ORIENTED_BOUNDARY ); + assert( l12.oriented_side(p5) == CGAL::ON_ORIENTED_BOUNDARY ); + assert( l21.oriented_side(p3) == CGAL::ON_NEGATIVE_SIDE ); + assert( l21.oriented_side(p5) == CGAL::ON_ORIENTED_BOUNDARY ); + + assert( l21.has_on_negative_side( p3 ) ); + assert( l12.has_on_positive_side( p3 ) ); + assert( l34.has_on_positive_side( p2 ) ); + assert( l43.has_on( CGAL::Point_2( n8, n2 )) ); + assert( l43.has_on_boundary( CGAL::Point_2( n8, n2 )) ); + assert( lr21.has_on( CGAL::Point_2( -n1, n0 )) ); + + std::cout << '!'; + + assert( l21.has_on( l21.projection( p3 )) ); + assert( l21.has_on( l21.projection( p4 )) ); + assert( l21.has_on( l21.projection( p5 )) ); + assert( l34.has_on( l34.projection( p3 )) ); + assert( l34.has_on( l34.projection( p4 )) ); + assert( l34.has_on( l34.projection( p5 )) ); + + + std::cout << "done" << std::endl; + return true; + +} +#endif // CGAL__TEST_CLS_LINE_2_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_line_2.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_line_2.h new file mode 100644 index 00000000000..66fd892c922 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_line_2.h @@ -0,0 +1,40 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_cls_line_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_LINE_2_H +#define CGAL__TEST_CLS_LINE_2_H + +#ifndef CGAL_LINE_2_H +#include +#endif // CGAL_LINE_2_H +#ifndef CGAL_AFF_TRANSFORMATION_2_H +#include +#endif // CGAL_AFF_TRANSFORMATION_2_H + + +template bool _test_cls_line_2(const R& ); + + +#endif // CGAL__TEST_CLS_LINE_2_H diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_line_3.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_line_3.C new file mode 100644 index 00000000000..9e1b3cd126b --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_line_3.C @@ -0,0 +1,122 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_line_3.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_LINE_3_C +#define CGAL__TEST_CLS_LINE_3_C +#ifndef CGAL__TEST_CLS_LINE_3_H +#include +#endif // CGAL__TEST_CLS_LINE_3_H + +template +bool +_test_cls_line_3(const R& ) +{ + std::cout << "Testing class Line_3" ; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + typename R::Line_3 il; + CGAL::Line_3 l0( il ); + CGAL::Line_3 l1; + + RT n1 = 3; + RT n2 = 53; + RT n3 =-14; + RT n4 = 28; + RT n5 = 16; + RT n6 = -6; + RT n7 = 11; + RT n8 =-17; + RT n9 = 30; + + CGAL::Point_3 p1( n1, n2, n3); + CGAL::Point_3 p2( n4, n5, n6); + CGAL::Point_3 p3( n7, n8, n9); + + CGAL::Line_3 l2(p1,p2); + CGAL::Line_3 l3(l2); + + assert( l2 == l2); + assert( l2 == l3); + + CGAL::Direction_3 dir( n9, n3, n1); + CGAL::Line_3 l4(p3, dir); + assert( l2 != l4); + + CGAL::Segment_3 seg(p1,p2); + CGAL::Ray_3 ray(p2,p1); + CGAL::Line_3 l5(seg); + CGAL::Line_3 l6(ray); + assert( l2 == l5); + + std::cout <<'.'; + + assert( l2 == l5 ); + assert( l2.direction() == l5.direction() ); + assert( l5.direction() == - l6.direction() ); + assert( l5.has_on( p1 ) ); + assert( l5.has_on( p2 ) ); + assert( l5.has_on( l5.point() )); + assert( l6.has_on( p1 ) ); + assert( l6.has_on( p2 ) ); + assert( l6.has_on( l5.point() )); + assert( l5.opposite() == l6 ); + assert( l2.opposite() == l6 ); + assert( l5 != l6 ); + + CGAL::Plane_3 pl = l6.perpendicular_plane( l6.point() ); + CGAL::Plane_3 plstrich(l6.point(), l6.direction() ); + assert( pl == plstrich ); + assert( pl.orthogonal_direction() == l6.direction() ); + CGAL::Plane_3 plzweistrich(l6.point(), l5.direction() ); + assert( plzweistrich.opposite() == pl ); + + std::cout << '.'; + + assert( l4.point(2) - l4.point(1) == l4.point(1) - l4.point(0) ); + CGAL::Point_3 p1l4proj = l4.projection(p1); + assert( l4.has_on( p1l4proj ) ); + assert( l4.perpendicular_plane( p1l4proj ).has_on( p1l4proj ) ); + assert( l4.perpendicular_plane( p1l4proj ).has_on( p1 ) ); + CGAL::Point_3 p4 = l4.projection(p2); + CGAL::Point_3 p5 = l4.projection(p3); + assert( ( l4.direction() == ( p5 - p4 ).direction() )\ + ||( l4.direction() == ( p4 - p5 ).direction() ) ); + assert( l5.direction() == - l6.direction() ); + + std::cout <<'.'; + + assert( l2.has_on(p1) ); + assert( l2.has_on(p2) ); + assert( l4.has_on(p4) ); + assert( l4.has_on(p5) ); + assert( CGAL::Line_3(p1,p1).is_degenerate() ); + + std::cout << "done" << std::endl; + return true; +} + +#endif // CGAL__TEST_CLS_LINE_3_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_line_3.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_line_3.h new file mode 100644 index 00000000000..8037b7dde76 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_line_3.h @@ -0,0 +1,33 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_line_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_LINE_3_H +#include +#endif // CGAL_LINE_3_H + + +template bool _test_cls_line_3(const R& ); + + diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_object.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_object.C new file mode 100644 index 00000000000..b788f528637 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_object.C @@ -0,0 +1,88 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_misc.fw +// file : _test_cls_object.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_OBJECT_C +#define CGAL__TEST_CLS_OBJECT_C + +#include + +template +bool +_test_cls_object(const R&) +{ + typedef typename R::RT RT; + std::cout << "testing class object" ; + + CGAL::Object o1; + assert( o1.is_empty() ); + CGAL::Object o2; + assert( o2.is_empty() ); + CGAL::Object o3; + assert( o3.is_empty() ); + CGAL::Point_2 p21( RT(1), RT(1) ); + CGAL::Point_2 p22; + CGAL::Point_2 p23; + CGAL::Point_2 p24( RT(4), RT(4) ); + CGAL::Point_3 p31; + CGAL::Point_3 p32; + CGAL::Line_2 l21( p21, p24); + CGAL::Line_2 l22; + CGAL::Line_3 l31; + CGAL::Line_3 l32; + + std::cout << '.'; + + o1 = o2; + o2 = CGAL::make_object(p21); + assert( o1.is_empty() ); + o1 = CGAL::make_object(p31); + assert( CGAL::assign( p22, o2 ) ); + assert( p22 == p21 ); + assert( ! CGAL::assign( p32, o2 ) ); + assert( ! CGAL::assign( l22, o2 ) ); + o3 = o2; + assert( CGAL::assign( p23, o3 ) ); + assert( p23 == p21 ); + assert( ! CGAL::assign( p32, o2 ) ); + assert( ! CGAL::assign( l32, o2 ) ); + assert( CGAL::assign( p32, o1 ) ); + assert( ! CGAL::assign( p21, o1 ) ); + assert( p21 == p23 ); + + std::cout << '.'; + + o2 = CGAL::make_object(l21); + assert( CGAL::assign( l22, o2 ) ); + assert( l22 == l21 ); + assert( ! CGAL::assign( l32, o2 ) ); + assert( ! CGAL::assign( p22, o2 ) ); + o3 = CGAL::make_object(l31); + assert( CGAL::assign( l32, o3 ) ); + assert( ! CGAL::assign( p32, o3 ) ); + + std::cout << "done" << std::endl; + return true; +} +#endif // CGAL__TEST_CLS_OBJECT_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_object.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_object.h new file mode 100644 index 00000000000..4922af37567 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_object.h @@ -0,0 +1,40 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_misc.fw +// file : _test_cls_object.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_OBJECT_H +#define CGAL__TEST_CLS_OBJECT_H + +#include +#include +#include +#include +#include +#include + + +template bool _test_cls_object(const R& ); + + +#endif // CGAL__TEST_CLS_OBJECT_H diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_plane_3.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_plane_3.C new file mode 100644 index 00000000000..21059fa568e --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_plane_3.C @@ -0,0 +1,159 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_plane_3.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_PLANE_3_C +#define CGAL__TEST_CLS_PLANE_3_C +#ifndef CGAL__TEST_CLS_PLANE_3_H +#include +#endif // CGAL__TEST_CLS_PLANE_3_H + +template +bool +_test_cls_plane_3(const R& ) +{ + std::cout << "Testing class Plane_3" ; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + typename R::Plane_3 ip; + CGAL::Plane_3 pl0(ip); + + RT x1 = -1; + RT x2 = 4; + + CGAL::Point_3 p1(x1,x1,x1), + p2(x2,x2,x2), + px(RT(1),RT(0),RT(0)), + py(RT(0),RT(1),RT(0)), + pz(RT(0),RT(0),RT(1)); + + CGAL::Point_3 p3(p1); + CGAL::Direction_3 d1( RT(5), RT(-5), RT(10) ); +#if (__GNUG__ == 2) && (__GNUC_MINOR__==91) + CGAL::Vector_3 v1 = d1.to_vector(); +#else + CGAL::Vector_3 v1 = d1.vector(); +#endif // egcs 2.91.66 + + CGAL::Plane_3 pld( p1, d1); + CGAL::Plane_3 plv( p1, v1); + + CGAL::Line_3 l, + lp(p1,p2), + lxy(px,py); + + CGAL::Segment_3 s12(p1,p2); + CGAL::Ray_3 r12(p1,p2); + + CGAL::Plane_3 xy_pl(CGAL::ORIGIN,px,py); + CGAL::Plane_3 plc(xy_pl); + CGAL::Plane_3 pl1(p1,pz,p2); + CGAL::Plane_3 pls(s12,pz); + CGAL::Plane_3 plr(r12,pz); + CGAL::Plane_3 pla; + CGAL::Plane_3 xy_pl_eq( RT(0), RT(0), + RT(1), RT(0) ); + CGAL::Plane_3 neg_xy_pl_eq( RT(0), RT(0), + RT(-1), RT(0) ); + + std::cout << '.'; + + pla = xy_pl; + assert( pla == pla ); + assert( plc == xy_pl ); + assert( pla == xy_pl ); + assert( plc == pla ); + assert( xy_pl == xy_pl_eq ); + assert( xy_pl != neg_xy_pl_eq); + assert( pld == plv ); + assert( pls == plr ); + + CGAL::Point_3 origo( CGAL::ORIGIN ); + CGAL::Vector_3 v_zdir( RT(0), RT(0), RT(12) ); + CGAL::Plane_3 xy_pl_v( origo, v_zdir); + + assert( xy_pl == xy_pl_v ); + + assert( xy_pl_eq.a() == RT(0) ); + assert( xy_pl_eq.b() == RT(0) ); + assert( xy_pl_eq.c() == RT(1) ); + assert( xy_pl_eq.d() == RT(0) ); + assert( CGAL::Plane_3(pl1.a(), pl1.b(), pl1.c(), pl1.d() ) == pl1 ); + + std::cout <<'.'; + + assert( xy_pl_eq.perpendicular_line(px) == xy_pl.perpendicular_line(px) ); + assert( xy_pl.perpendicular_line(px) == \ + neg_xy_pl_eq.perpendicular_line(px).opposite() ); + assert( neg_xy_pl_eq.opposite() == xy_pl ); + assert( plr != plr.opposite() ); + +#ifndef CGAL_STRICT_09 + CGAL::Point_3 pp0( RT(4), RT(6), RT( 0), RT(2) ); + CGAL::Point_3 pp1( RT(4), RT(6), RT(-8), RT(2) ); + assert( xy_pl_eq.projection( pp0 ) == pp0 ); + assert( xy_pl_eq.has_on( xy_pl_eq.projection( pp0 ) ) ); + assert( xy_pl_eq.has_on( xy_pl_eq.projection( pp1 ) ) ); + assert( pl1.has_on( pl1.projection( pp0 ) ) ); + assert( pl1.has_on( pl1.projection( pp1 ) ) ); +#endif // CGAL_STRICT_09 + + assert( plc.has_on_boundary(plc.point()) ); + assert( plc.orthogonal_direction() == pla.orthogonal_direction() ); + assert( plc.perpendicular_line( plc.point() ) == \ + CGAL::Line_3( plc.point(), plc.orthogonal_direction()) ); + assert( CGAL::Line_3( pl1.point(), pl1.point()+pl1.orthogonal_vector() )\ + == CGAL::Line_3( pl1.point(), pl1.orthogonal_direction()) ); + CGAL::Point_3 gnup(RT(345),RT(23),RT(0)); + assert( xy_pl.has_on_boundary( gnup ) ); + + CGAL::Vector_3 nov = pl1.orthogonal_vector(); + CGAL::Vector_3 vb1 = pl1.base1(); + CGAL::Vector_3 vb2 = pl1.base2(); + assert( (nov*pl1.base1()) == FT(0)&&(nov*pl1.base2()) == FT(0) ); + assert( (pl1.base2()*pl1.base1()) == FT(0) ); + assert( pl1.has_on_boundary(pl1.point() + pl1.base1()) ); + assert( pl1.has_on_boundary(pl1.point() + pl1.base2()) ); + + std::cout << '.'; + + assert( pl1.has_on_boundary( pl1.to_3d( pl1.to_2d( pl1.point() ))) ); + assert( pl1.has_on_boundary( pl1.to_3d( pl1.to_2d( pz ))) ); + + assert( neg_xy_pl_eq.oriented_side( p1 ) == CGAL::ON_POSITIVE_SIDE ); + assert( xy_pl.oriented_side( p1 ) == CGAL::ON_NEGATIVE_SIDE ); + assert( pl1.oriented_side( p1 ) == CGAL::ON_ORIENTED_BOUNDARY ); + assert( xy_pl.has_on_positive_side( p2 ) ); + assert( xy_pl.has_on_negative_side( p1 ) ); + + CGAL::Plane_3 pldeg(p1, p1, p2); + assert( pldeg.is_degenerate() ); + + std::cout << "done" << std::endl; + return true; +} + +#endif // CGAL__TEST_CLS_PLANE_3_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_plane_3.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_plane_3.h new file mode 100644 index 00000000000..dfcacf8bc2a --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_plane_3.h @@ -0,0 +1,33 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_plane_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_PLANE_3_H +#include +#endif // CGAL_PLANE_3_H + + +template bool _test_cls_plane_3(const R& ); + + diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_point_2.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_point_2.C new file mode 100644 index 00000000000..fe11e825b5d --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_point_2.C @@ -0,0 +1,100 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_cls_point_2.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_POINT_2_C +#define CGAL__TEST_CLS_POINT_2_C +#ifndef CGAL__TEST_CLS_POINT_2_H +#include +#endif // CGAL__TEST_CLS_POINT_2_H + +template +bool +_test_cls_point_2(const R& ) +{ + std::cout << "Testing class Point_2" ; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + typename R::Point_2 ip; + CGAL::Point_2 p1; + CGAL::Point_2 p2(ip); + CGAL::Point_2 p0(CGAL::ORIGIN); + + RT n1(-35 ); + RT n2( 50 ); + RT n3(-20 ); + RT n4( 5 ); + + CGAL::Point_2 p3(n1, n2); + CGAL::Point_2 p4(n1, n2, n4); + CGAL::Point_2 p5(n1, n2, n4); + CGAL::Point_2 p6( p5 ); + p1 = p4; + + std::cout << '.'; + + assert( p4 == p5 ); + assert( p5 == p6 ); + assert( p4 == p6 ); + assert( p1 == p6 ); + + assert( p3 != p4 ); + assert( p0 != p1 ); + + assert( p0 == CGAL::ORIGIN); + assert( p1 != CGAL::ORIGIN ); + // Doesn't work; Point_2::operator== can't be used :( +#ifdef ENHANCED + assert( CGAL::ORIGIN == p0 ); + assert( CGAL::ORIGIN != p1 ); +#endif + + assert( p3.hx() == n1 ); // don't replace p3 + assert( p3.hy() == n2 ); + + assert( FT(p5.hx()) / FT(p5.hw()) == FT( n1) / FT( n4) ); + assert( FT(p5.hy()) / FT(p5.hw()) == FT( n2) / FT( n4) ); + + assert( p5.x() == FT( n1) / FT( n4 ) ); + assert( p5.y() == FT( n2) / FT( n4 ) ); + + std::cout << '.'; + + assert( p3.homogeneous(0) == p3.hx() ); // don't replace p3 + assert( p3.homogeneous(1) == p3.hy() ); + assert( p3.homogeneous(2) == p3.hw() ); + assert( p6.cartesian(0) == p6.x() ); + assert( p6.cartesian(1) == p6.y() ); + + std::cout << '.'; + + assert( p0.dimension() == 2 ); + assert( p4.homogeneous( p4.dimension() ) == p4.hw() ); + + std::cout << "done" << std::endl; + return true; +} +#endif // CGAL__TEST_CLS_POINT_2_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_point_2.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_point_2.h new file mode 100644 index 00000000000..80ead721588 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_point_2.h @@ -0,0 +1,37 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_cls_point_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_POINT_2_H +#define CGAL__TEST_CLS_POINT_2_H + +#ifndef CGAL_POINT_2_H +#include +#endif // CGAL_POINT_2_H + + +template bool _test_cls_point_2(const R& ); + + +#endif // CGAL__TEST_CLS_POINT_2_H diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_point_3.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_point_3.C new file mode 100644 index 00000000000..26c1575b8a1 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_point_3.C @@ -0,0 +1,105 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_point_3.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_POINT_3_C +#define CGAL__TEST_CLS_POINT_3_C +#ifndef CGAL__TEST_CLS_POINT_3_H +#include +#endif // CGAL__TEST_CLS_POINT_3_H + +template +bool +_test_cls_point_3(const R& ) +{ + std::cout << "Testing class Point_3" ; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + typename R::Point_3 ip; + + CGAL::Point_3 p1; + CGAL::Point_3 p2(ip); + CGAL::Point_3 p0(CGAL::ORIGIN); + + RT n1(-35 ); + RT n2( 50 ); + RT n3(-20 ); + RT n4( 5 ); + + CGAL::Point_3 p3(n1, n2, n3); + CGAL::Point_3 p4(n1, n2, n3, n4); + CGAL::Point_3 p5(n1, n2, n3, n4); + CGAL::Point_3 p6( p5 ); + p1 = p4; + + std::cout << '.'; + + assert( p4 == p5 ); + assert( p5 == p6 ); + assert( p4 == p6 ); + assert( p1 == p6 ); + + assert( p3 != p4 ); + assert( p0 != p1 ); + + assert( p0 == CGAL::ORIGIN); + assert( p1 != CGAL::ORIGIN); + // Doesn't work; Point_2::operator== can't be used :( +#ifdef ENHANCED + assert( CGAL::ORIGIN == p0 ); + assert( CGAL::ORIGIN != p1 ); +#endif // ENHANCED + + assert( p3.hx() == n1 ); // don't replace p3 + assert( p3.hy() == n2 ); + assert( p3.hz() == n3 ); + + assert( FT(p5.hx()) / FT(p5.hw()) == FT( n1) / FT( n4) ); + assert( FT(p5.hy()) / FT(p5.hw()) == FT( n2) / FT( n4) ); + assert( FT(p5.hz()) / FT(p5.hw()) == FT( n3) / FT( n4) ); + + assert( p5.x() == FT( n1) / FT( n4 ) ); + assert( p5.y() == FT( n2) / FT( n4 ) ); + assert( p5.z() == FT( n3) / FT( n4 ) ); + + std::cout << '.'; + + assert( p3.homogeneous(0) == p3.hx() ); // don't replace p3 + assert( p3.homogeneous(1) == p3.hy() ); + assert( p3.homogeneous(2) == p3.hz() ); + assert( p3.homogeneous(3) == p3.hw() ); + assert( p6.cartesian(0) == p6.x() ); + assert( p6.cartesian(1) == p6.y() ); + assert( p6.cartesian(2) == p6.z() ); + + std::cout << '.'; + + assert( p0.dimension() == 3 ); + + std::cout << "done" << std::endl; + return true; +} +#endif // CGAL__TEST_CLS_POINT_3_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_point_3.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_point_3.h new file mode 100644 index 00000000000..9b6ac6c2505 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_point_3.h @@ -0,0 +1,33 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_point_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_POINT_3_H +#include +#endif // CGAL_POINT_3_H + + +template bool _test_cls_point_3(const R& ); + + diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_point_d.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_point_d.h new file mode 100644 index 00000000000..4631cd1e420 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_point_d.h @@ -0,0 +1,74 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_d.fw +// file : _test_cls_point_d.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_POINT_D_H +#define CGAL__TEST_CLS_POINT_D_H + + +template +bool +_test_cls_point_d( const R& ) +{ + double coord1[6] = {0.0, 1.0, 2.0, 3.0, 4.0, 1.0}; + double coord2[6] = {0.0, 2.0, 4.0, 6.0, 8.0, 2.0}; + CGAL::Point_d p (5, coord1, coord1+6); + CGAL::Point_d pp (5, coord1, coord1+5); + CGAL::Point_d q (5, coord2, coord2+6); + CGAL::Point_d s (p); // constructors + CGAL::Point_d t; + t = s; // assignment + + assert ( p == pp); + assert ( p == q); + assert ( p == s); // equality test + assert ( p == t); + + for (int i=0; i<5; ++i) + { + assert (q.cartesian(i) == (double)i); // cartesian method + assert (q[i] == (double)i); // operator[] + assert (p.homogeneous(i) == (double)i); + } + assert (s.dimension() == 5); // dimension + + // I/O + + const int size = 100; // suffices to store a point + char buffer[size]; + std::ostrstream ost (buffer, size); + CGAL::set_ascii_mode (ost); + ost << p; // write p + + std::istrstream ist (buffer, size); + CGAL::Point_d u; + CGAL::set_ascii_mode (ist); + ist >> u; // read p back in as u + + assert (p == u); + + return true; +} + +#endif // CGAL__TEST_CLS_POINT_D_H diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_quotient.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_quotient.C new file mode 100644 index 00000000000..0a6c8fc513d --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_quotient.C @@ -0,0 +1,88 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_misc.fw +// file : _test_cls_quotient.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + + +template bool _test_cls_quotient(const NT& ); + + +template +bool +_test_cls_quotient(const NT& ) +{ + std::cout << "testing class quotient" ; + + typedef CGAL::Quotient QT; + + NT n0(0); + NT n1(1); + NT n2(2); + NT n3(3); + NT n4(4); + NT n5(5); + NT n6(6); + QT q0(0); + QT q1(1); + QT q2(2); + QT q1_2(n1,n2); + QT q1_3(n1,n3); + QT q3_4(n3,n4); + QT q3_6(n3,n6); + QT q1_4(n1,n4); + + std::cout << '.'; + + assert( q0 + q0 == q0 ); + assert( q1 + q0 == q1 ); + assert( q0 + q1 == q1 ); + assert( q1 + n0 == q1 ); + assert( n0 + q1 == q1 ); + assert( n1 + q0 == q1 ); + assert( q0 + n1 == q1 ); + assert( q1 + q1 == q2 ); + assert( q2 - q1 == q1 ); + assert( q2 - n1 == q1 ); + assert( q0 + q0 != q1 ); + + assert( q1_2 + q1_2 == n1 ); + assert( q1_2 - q1_4 == q1_4 ); + assert( q1_2 * q1_2 == q1_4 ); + assert( q1_2 == q1 / q2 ); + assert( q1_2 == n1 / q2 ); + assert( q1_3 == q1 / n3 ); + assert( q1_2 + q1_3 == QT(n5,n6) ); + assert( q1_2 == q3_6 ); + assert( q1_2 * n5 == n2 + q1_4 + q1_4 ); + + std::cout << '.'; + + assert( q1_2 < q3_4 ); + assert( q1_3 < q3_4 ); + assert( n1 < QT(n6,n4) ); + assert( q3_6 < n2 ); + + std::cout << q1_2 << "done"; + return true; +} + diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_ray_2.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_ray_2.C new file mode 100644 index 00000000000..ec3c3408293 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_ray_2.C @@ -0,0 +1,119 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_cls_ray_2.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_RAY_2_C +#define CGAL__TEST_CLS_RAY_2_C +#ifndef CGAL__TEST_CLS_RAY_2_H +#include +#endif // CGAL__TEST_CLS_RAY_2_H + +template +bool +_test_cls_ray_2(const R& ) +{ + std::cout << "Testing class Ray_2"; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + typename R::Ray_2 ir; + CGAL::Ray_2 r0; + + RT n0 = 0; + RT n2 = 2; + RT n3 = 3; + RT n4 = 4; + RT n5 = 5; + RT n8 = 8; + RT n9 = 9; + RT n10 =10; + + CGAL::Point_2 p1( n2, n8, n2); + CGAL::Point_2 p2( n10, n4, n2); + CGAL::Point_2 p3( n9, n9, n3); + CGAL::Point_2 p4( n10, n8, n2); + CGAL::Direction_2 d12( p2 - p1); + CGAL::Direction_2 d24( p4 - p2); + + CGAL::Ray_2 r1( p1, p2); + CGAL::Ray_2 r2( p1, d12); + CGAL::Ray_2 r3( p3, p2); + CGAL::Ray_2 r4( p2, d24); + CGAL::Ray_2 r5( p2, p4); + CGAL::Ray_2 r6( p1, p4); + r0 = r3; + + std::cout << '.'; + + assert( r1 == r1 ); + assert( r2 == r1 ); + assert( r4 == r5 ); + assert( r0 == r3 ); + assert( r6 != r1 ); + assert( r1 != r3 ); + assert( r1 != r5 ); + + assert( r2.source() == p1 ); + assert( r0.source() == p3 ); + assert( r4.source() == r4.point(0) ); + + assert( r1.direction() == d12 ); + assert( r2.direction() == d12 ); + assert( r3.direction() == r1.direction() ); + + std::cout << '.'; + + assert( r3.supporting_line() == r1.supporting_line() ); + assert( r5.supporting_line() == CGAL::Line_2( p2, p4 ) ); + + assert( r4.opposite() == CGAL::Ray_2( p2, -d24 ) ); + assert( r1.opposite() == CGAL::Ray_2( p1, -d12 ) ); + assert( r2.opposite().opposite() == r2 ); + + assert( r6.is_horizontal() ); + assert( ! r0.is_horizontal() ); + assert( r5.is_vertical() ); + assert( ! r5.is_horizontal() ); + + assert( r1.has_on( p1 ) ); + assert( r1.has_on( p2 ) ); + assert( r1.has_on( p3 ) ); + assert( r3.opposite().has_on( p1 ) ); + assert( ! r1.has_on( p4 ) ); + assert( ! r0.has_on( CGAL::Point_2( n8, n5, n8 )) ); + assert( r4.has_on( r4.point(7)) ); + assert( r3.collinear_has_on( r3.point(7)) ); + assert( r1.collinear_has_on( p3) ); + assert( ! r3.collinear_has_on( p1 ) ); + + std::cout << '.'; + + assert( CGAL::Ray_2( p1, p1).is_degenerate() ); + assert( ! r0.is_degenerate() ); + + std::cout << "done" << std::endl; + return true; +} +#endif // CGAL__TEST_CLS_RAY_2_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_ray_2.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_ray_2.h new file mode 100644 index 00000000000..7bcbbcfe53e --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_ray_2.h @@ -0,0 +1,37 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_cls_ray_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_RAY_2_H +#define CGAL__TEST_CLS_RAY_2_H + +#ifndef CGAL_RAY_2_H +#include +#endif // CGAL_RAY_2_H + + +template bool _test_cls_ray_2(const R& ); + + +#endif // CGAL__TEST_CLS_RAY_2_H diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_ray_3.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_ray_3.C new file mode 100644 index 00000000000..5285a32f646 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_ray_3.C @@ -0,0 +1,107 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_ray_3.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_RAY_3_C +#define CGAL__TEST_CLS_RAY_3_C +#ifndef CGAL__TEST_CLS_RAY_3_H +#include +#endif // CGAL__TEST_CLS_RAY_3_H + +template +bool +_test_cls_ray_3(const R& ) +{ + std::cout << "Testing class Ray_3" ; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + typename R::Ray_3 ir; + CGAL::Ray_3 r1(ir); + + RT n1 = 8; + RT n2 = 20; + RT n3 = 4; + RT n4 = 10; + RT n5 = 5; + RT n6 = 20; + RT n7 = -2; + RT n8 = 3; + + CGAL::Point_3 p1( n1, n2, n3, n3); + CGAL::Point_3 p2( n4, n5, n6, n5); + CGAL::Point_3 p3( n7, n2, n4, n7); + + CGAL::Ray_3 r2( p1, p2 ); + CGAL::Ray_3 r3( p2, p1 ); + CGAL::Ray_3 r4( r2 ); + r1 = r4; + CGAL::Direction_3 dir( p2 - p1 ); + CGAL::Ray_3 r7(p1, dir); + + assert( r1 == r1 ); + assert( r4 == r2 ); + assert( r1 == r4 ); + assert( r1 == r2 ); + assert( r7 == r2 ); + assert( r2 != r3 ); + + std::cout <<'.'; + + CGAL::Ray_3 r5 (p3, p3 + (p1 - p3) ); + assert( r5.has_on( p1 ) ); + assert( r5.has_on( p3 ) ); + assert( r5.has_on( p3 + (p1 - p3) ) ); + assert( r3.has_on( p2 + (p1 - p2) + (p1 - p2) ) ); + assert( r2.has_on( r2.second_point() )); + assert( r5.has_on( r5.second_point() )); + assert( r4.has_on( r4.point(1) )); + assert( r4.has_on( r4.point(3) )); + + std::cout <<'.'; + + assert( r5.source() == p3 ); + assert( r2.source() != r3.source() ); + assert( r7.direction() == dir ); + assert( r2.direction() == CGAL::Direction_3(r2.point(2) - r2.point(1) )); + assert( r2.direction() == r3.opposite().direction() ); + assert( r1.supporting_line() == r2.supporting_line() ); + CGAL::Line_3 lin(p1,p2); + assert( r2.supporting_line() == lin ); + + std::cout << '.'; + + CGAL::Ray_3 r8( p3, dir ); + CGAL::Ray_3 r9( p3, -dir ); + assert( r8.opposite() == r9 ); + assert( r9.opposite() == r8 ); + CGAL::Ray_3 sdeg(p3,p3); + assert( sdeg.is_degenerate() ); + + std::cout << "done" << std::endl; + return true; +} + +#endif // CGAL__TEST_CLS_RAY_3_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_ray_3.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_ray_3.h new file mode 100644 index 00000000000..0c32ad3f1be --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_ray_3.h @@ -0,0 +1,33 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_ray_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_RAY_3_H +#include +#endif // CGAL_RAY_3_H + + +template bool _test_cls_ray_3(const R& ); + + diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_segment_2.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_segment_2.C new file mode 100644 index 00000000000..43fcb0f4697 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_segment_2.C @@ -0,0 +1,127 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_cls_segment_2.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_SEGMENT_2_C +#define CGAL__TEST_CLS_SEGMENT_2_C +#ifndef CGAL__TEST_CLS_SEGMENT_2_H +#include +#endif // CGAL__TEST_CLS_SEGMENT_2_H + +template +bool +_test_cls_segment_2(const R& ) +{ + std::cout << "Testing class Segment_2"; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + typename R::Segment_2 is; + CGAL::Segment_2 s0; + + RT n0 = 0; + RT n2 = 2; + RT n3 = 3; + RT n4 = 4; + RT n5 = 5; + RT n8 = 8; + RT n9 = 9; + RT n10 =10; + + CGAL::Point_2 p1( n2, n8, n2); + CGAL::Point_2 p2( n10, n4, n2); + CGAL::Point_2 p3( n9, n9, n3); + CGAL::Point_2 p4( n10, n8, n2); + + CGAL::Segment_2 s1 ( p1, p2 ); + CGAL::Segment_2 s2 ( p2, p1 ); + CGAL::Segment_2 s3 ( p2, p3 ); + CGAL::Segment_2 s4 ( p2, p4 ); + CGAL::Segment_2 s5 ( p4, p1 ); + CGAL::Segment_2 s6 ( s3 ); + s0 = s2; + + assert( s5 == s5 ); + assert( s6 == s3 ); + assert( s2 == s0 ); + assert( s0 == s2 ); + assert( s1 != s5 ); + assert( s1 != s2 ); + assert( s3 != s2 ); + + std::cout << '.'; + + assert( s1.source() == p1 ); + assert( s2.source() == p2 ); + assert( s6.source() == p2 ); + assert( s4.target() == p4 ); + assert( s5.target() == p1 ); + + assert( s1.min() == p1 ); + assert( s3.min() == p3 ); + assert( s4.min() == p2 ); + assert( s4.max() == p4 ); + assert( s5.max() == p4 ); + + assert( s3.vertex(0) == p2 ); + assert( s3.vertex(1) == p3 ); + assert( s3.vertex(2) == p2 ); + assert( s4.point(8) == s4.vertex(8) ); + assert( s1.point(3) == s1.vertex(3) ); + assert( s5[0] == s5.vertex(0) ); + assert( s6[1] == s6.vertex(1) ); + + std::cout << '.'; + + assert( s1.squared_length() == FT( 20 ) ); + assert( s5.squared_length() == FT( 16 ) ); + assert( s4.direction() == CGAL::Direction_2( p4 - p2 ) ); + assert( s2.opposite() == s1 ); + assert( s1.opposite() == s2 ); + assert( s1.supporting_line() == CGAL::Line_2( p1, p2 ) ); + assert( s3.supporting_line() == CGAL::Line_2( p2, p3 ) ); + assert( ! s1.is_horizontal() ); + assert( ! s1.is_vertical() ); + assert( s5.is_horizontal() ); + assert( s4.is_vertical() ); + + std::cout << '.'; + + assert( s1.has_on( p1 ) ); + assert( s1.has_on( p2 ) ); + assert( s1.has_on( p3 ) ); + assert( s2.has_on( p3 ) ); + assert( ! s4.has_on( p3 ) ); + assert( s1.collinear_has_on( p3 ) ); + assert( s2.collinear_has_on( p1 ) ); + assert( ! s3.collinear_has_on( p1 ) ); + assert( s3.collinear_has_on( CGAL::Point_2( n8, n5, n2)) ); + + assert( CGAL::Segment_2( p3, p3).is_degenerate() ); + + std::cout << "done" << std::endl; + return true; +} +#endif // CGAL__TEST_CLS_SEGMENT_2_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_segment_2.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_segment_2.h new file mode 100644 index 00000000000..843749c9693 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_segment_2.h @@ -0,0 +1,37 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_cls_segment_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_SEGMENT_2_H +#define CGAL__TEST_CLS_SEGMENT_2_H + +#ifndef CGAL_SEGMENT_2_H +#include +#endif // CGAL_SEGMENT_2_H + + +template bool _test_cls_segment_2(const R& ); + + +#endif // CGAL__TEST_CLS_SEGMENT_2_H diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_segment_3.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_segment_3.C new file mode 100644 index 00000000000..13b7fc60b5e --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_segment_3.C @@ -0,0 +1,110 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_segment_3.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_SEGMENT_3_C +#define CGAL__TEST_CLS_SEGMENT_3_C +#ifndef CGAL__TEST_CLS_SEGMENT_3_H +#include +#endif // CGAL__TEST_CLS_SEGMENT_3_H + +template +bool +_test_cls_segment_3(const R& ) +{ + std::cout << "Testing class Segment_3" ; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + typename R::Segment_3 is; + CGAL::Segment_3 s1(is); + + RT n1 = 7; + RT n2 = 21; + RT n3 = 14; + RT n4 =-10; + RT n5 = 5; + RT n6 = 20; + RT n7 = -1; + RT n8 = 3; + + CGAL::Point_3 p1( n1, n2, n3, n1); + CGAL::Point_3 p2( n4, n5, n6, n5); + CGAL::Point_3 p3( n2, n8, n2, n8); + + CGAL::Segment_3 s2( p1, p2 ); + CGAL::Segment_3 s3( p2, p1 ); + CGAL::Segment_3 s4( s2 ); + s1 = s4; + + assert( s1 == s1 ); + assert( s4 == s2 ); + assert( s1 == s4 ); + assert( s1 == s2 ); + assert( s2 != s3 ); + + CGAL::Segment_3 s5 (p3, p3 + (p1 - p3) + (p1 - p3) ); + assert( s5.has_on( p1 ) ); + assert( s5.has_on( p3 ) ); + assert( s2.has_on( p2 ) ); + + std::cout <<'.'; + + assert( s5.source() == p3 ); + assert( s5.target() == p1 + (p1 - p3) ); + assert( s2.source() != s3.source() ); + assert( s2.target() != s3.target() ); + + std::cout <<'.'; + + assert( s2.min() == p2 ); + assert( s2.max() == p1 ); + assert( s2.min() == s3.min() ); + assert( s2.max() == s3.max() ); + assert( s5.max() != s5.min() ); + assert( s5.max() == s5.opposite().max() ); + assert( s5.vertex(0) == s5.source() ); + assert( s2.vertex(1) == s2.target() ); + assert( s2.vertex(1) == s2.min() ); + assert( s2[1] == s1[1] ); + assert( s2[1] == s3[0] ); + + std::cout << '.'; + + assert( s2.squared_length() == FT( RT(17) ) ); + assert( s2.direction() == CGAL::Direction_3(s2.target() - s2.source() )); + assert( s2.direction() == s3.opposite().direction() ); + + assert( s1.supporting_line() == s2.supporting_line() ); + CGAL::Line_3 lin(p1,p2); + assert( s2.supporting_line() == lin ); + + CGAL::Segment_3 sdeg(p3,p3); + assert( sdeg.is_degenerate() ); + + std::cout << "done" << std::endl; + return true; +} +#endif // CGAL__TEST_CLS_SEGMENT_3_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_segment_3.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_segment_3.h new file mode 100644 index 00000000000..0b1f5928a76 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_segment_3.h @@ -0,0 +1,33 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_segment_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_SEGMENT_3_H +#include +#endif // CGAL_SEGMENT_3_H + + +template bool _test_cls_segment_3(const R& ); + + diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_sphere_3.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_sphere_3.C new file mode 100644 index 00000000000..4795c3d7dc0 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_sphere_3.C @@ -0,0 +1,240 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_sphere_3.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_SPHERE_3_C +#define CGAL__TEST_CLS_SPHERE_3_C +#include + +template +bool +_test_cls_sphere_3(const R& ) +{ + std::cout << "Testing class Sphere_3" ; + + typedef typename R::RT RT; + typedef typename R::FT FT; + typename R::Sphere_3 ic; + CGAL::Sphere_3 c0; + + RT n0 = 0; + RT n1 = 16; + RT n2 = -4; + RT n3 = 2; + RT n4 = 5; + RT n5 = 10; + RT n6 = 6; + RT n8 = 9; + RT n9 = 36; + RT n10= 3; + RT n11=-11; + RT n12=200; + RT n13= 13; + + CGAL::Point_3 p0( n1, n2, n1, -n2); // ( 4, -1, 4) + CGAL::Point_3 p1( n6, n8, n8, n10); // ( 2, 3, 3) + CGAL::Point_3 p2( n2, n0, n0, n2); // ( 1, 0, 0) + CGAL::Point_3 p3( n5, n5, n5, n4); // ( 2, 2, 2) + CGAL::Point_3 p4( n0, n0, n2, n2); // ( 0, 0, 1) + CGAL::Point_3 p5( n8, n6, n10, n10); // ( 3, 2, 1) + + CGAL::Vector_3 vx = p2 - CGAL::ORIGIN; + CGAL::Vector_3 vy = p4 - CGAL::ORIGIN; + CGAL::Vector_3 v1 = p1 - CGAL::ORIGIN; + + CGAL::Sphere_3 c1( p0, p1, p2, p4); + CGAL::Sphere_3 c2( p0, p1, p3, p5); + CGAL::Sphere_3 c3( p1, p0, p2, p4); + CGAL::Sphere_3 c4( p3, FT( n9 )); // n9 = (n6)^2 + CGAL::Vector_3 vx6 = vx * n6; + CGAL::Vector_3 vy6 = vy * n6; + CGAL::Sphere_3 c5( p3 - vx6, p3 + vx6, p3 + vy6); + CGAL::Sphere_3 c6( c3 ); + CGAL::Sphere_3 c7( p3, n9, CGAL::POSITIVE); + CGAL::Sphere_3 c8( p3, n9, CGAL::NEGATIVE); + CGAL::Sphere_3 cc( p3 - vx6, p3 + vx6); + CGAL::Sphere_3 cp( p3 - vx6, p3 + vx6, CGAL::POSITIVE); + CGAL::Sphere_3 cn( p3 - vx6, p3 + vx6, CGAL::NEGATIVE); + CGAL::Sphere_3 cc3( p3 - vx6, p3 + vx6, p3 + vy6); + CGAL::Sphere_3 cp3( p3 - vx6, p3 + vx6, p3 + vy6, CGAL::POSITIVE); + CGAL::Sphere_3 cn3( p3 - vx6, p3 + vx6, p3 + vy6, CGAL::NEGATIVE); + c0 = c3; + + assert( c1 == c1 ); + assert( c1 != c2 ); + assert( c3 == c0 ); + assert( c0 == c3 ); + assert( c3 == c6 ); + assert( c7 != c8 ); + assert( c4 == c7 ); + assert( cc == cp ); + assert( cn != cp ); + assert( cc != c8 ); + assert( cc == c7 ); + + assert( c5.center() == p3 ); + assert( cc.center() == p3 ); + assert( c5.squared_radius() == FT( n9 ) ); + assert( c4.squared_radius() == cc.squared_radius() ); + assert( c4 == c5 ); + assert( c4 == c7 ); + assert( c4 != c8 ); + assert( cn == cp.opposite() ); + assert( cn3 == cp3.opposite() ); + assert( c7.opposite() == c8 ); + assert( c8.opposite() == c7 ); + assert( c1.opposite() == c3 ); + assert( c3.opposite() == c1 ); + assert( c7.orientation() == CGAL::POSITIVE ); + assert( c8.orientation() == CGAL::NEGATIVE ); + assert( c5.orientation() == CGAL::POSITIVE ); + assert( cc.orientation() == CGAL::POSITIVE ); + assert( cp.orientation() == CGAL::POSITIVE ); + assert( cn.orientation() == CGAL::NEGATIVE ); + assert( cc3.orientation() == CGAL::POSITIVE ); + assert( cp3.orientation() == CGAL::POSITIVE ); + assert( cn3.orientation() == CGAL::NEGATIVE ); + + std::cout << '.'; + + assert( c4.center() == p3 ); + assert( c5.center() == p3 ); + assert( c4.squared_radius() == FT( n9 ) ); + assert( c5.squared_radius() == FT( n9 ) ); + assert( c8.squared_radius() == FT( n9 ) ); + + assert( c7.bounded_side( p3 + vx*n2 ) == CGAL::ON_BOUNDED_SIDE ); + assert( c7.bounded_side( p3 + vy*n11 ) == CGAL::ON_UNBOUNDED_SIDE ); + assert( c7.bounded_side( p3 - vy6 ) == CGAL::ON_BOUNDARY ); + assert( c8.bounded_side( p3 + vx*n2 ) == CGAL::ON_BOUNDED_SIDE ); + assert( c8.bounded_side( p3 + vy*n11 ) == CGAL::ON_UNBOUNDED_SIDE ); + assert( c8.bounded_side( p3 - vy6 ) == CGAL::ON_BOUNDARY ); + assert( cc.has_on_boundary( p3 + vy6) ); + assert( cc.has_on_boundary( p3 - vx6) ); + + std::cout << '.'; + + RT sin1; + RT cos1; + RT den1; + RT sin2; + RT cos2; + RT den2; + RT sin3; + RT cos3; + RT den3; + RT sin4; + RT cos4; + RT den4; + RT sin5; + RT cos5; + RT den5; + RT RT0 = RT(0); + CGAL::rational_rotation_approximation(n11,n13, sin1, cos1, den1, -n2,n12); + CGAL::rational_rotation_approximation(-n8, n9, sin2, cos2, den2, -n2,n12); + CGAL::rational_rotation_approximation( n5,-n1, sin3, cos3, den3, -n2,n12); + CGAL::rational_rotation_approximation(-n5,-n11,sin4, cos4, den4, -n2,n12); + CGAL::rational_rotation_approximation(-n2, n2, sin5, cos5, den5, -n2,n12); + + CGAL::Aff_transformation_3 rotate1( sin1, cos1, RT0, RT0, + -cos1, sin1, RT0, RT0, + RT0, RT0, den1, RT0, + den1 ); + + CGAL::Aff_transformation_3 rotate2( sin2, cos2, RT0, RT0, + -cos2, sin2, RT0, RT0, + RT0, RT0, den2, RT0, + den2 ); + + CGAL::Aff_transformation_3 rotate3( sin3, RT0, cos3, RT0, + RT0, den3, RT0, RT0, + -cos3, RT0, sin3, RT0, + den3 ); + + CGAL::Aff_transformation_3 rotate4( den4, RT0, RT0, RT0, + RT0, sin4, cos4, RT0, + RT0,-cos4, sin4, RT0, + den4 ); + + CGAL::Aff_transformation_3 rotate5 = rotate1 * rotate4; + + CGAL::Point_3 ori = CGAL::Point_3( RT(0), RT(0), RT(0)); + CGAL::Point_3 p6 = p2.transform( rotate1 ); + assert( CGAL::cmp_dist_to_point( ori, p2, p6) == CGAL::EQUAL ); + CGAL::Point_3 p7 = p2.transform( rotate2 ); + assert( CGAL::cmp_dist_to_point( ori, p2, p7) == CGAL::EQUAL ); + CGAL::Point_3 p8 = p2.transform( rotate3 ); + assert( CGAL::cmp_dist_to_point( ori, p2, p8) == CGAL::EQUAL ); + CGAL::Point_3 p9 = p2.transform( rotate4 ); + assert( CGAL::cmp_dist_to_point( ori, p2, p9) == CGAL::EQUAL ); + CGAL::Point_3 p10 = p2.transform( rotate5 ); + assert( CGAL::cmp_dist_to_point( ori, p2, p10) == CGAL::EQUAL ); + p6 = p6 + v1; + p7 = p7 + v1; + p8 = p8 + v1; + p9 = p9 + v1; + p10 = p10 + v1; + CGAL::Sphere_3 c10 (p6, p8, p7, p9); + assert( c10.center() == ori + v1 ); + assert( c10.orientation() == CGAL::POSITIVE ); + assert( c10.opposite().orientation() == CGAL::NEGATIVE ); + + assert( c10.oriented_side(c10.center() ) == CGAL::ON_POSITIVE_SIDE ); + assert( c10.oriented_side(CGAL::ORIGIN + v1 + vx/n2 ) \ + == CGAL::ON_POSITIVE_SIDE ); + assert( c10.oriented_side(CGAL::ORIGIN + v1 + vx*n2 ) \ + == CGAL::ON_NEGATIVE_SIDE ); + assert( c10.oriented_side(p9 ) == CGAL::ON_ORIENTED_BOUNDARY ); + assert( c10.has_on_boundary(p9) ); + assert( c10.has_on_boundary(p4 + v1) ); + CGAL::Point_3 p11( n4, n4, n4, n3) ; // (2.5, 2.5, 2.5) + CGAL::Point_3 p12( n5, n5, n5, n3) ; // ( 5 , 5, 5 ) + assert( c10.has_on_bounded_side( p11 ) ); + assert( ! c10.has_on_bounded_side( p12 ) ); + assert( c10.has_on_unbounded_side( p12 ) ); + assert( c10.has_on_positive_side( p11 ) ); + assert( c10.has_on_negative_side( p12 ) ); + assert( c10.opposite().has_on_negative_side( p11 ) ); + assert( c10.opposite().has_on_positive_side( p12 ) ); + assert( c10.has_on_boundary( p6 ) ); + assert( c10.has_on_boundary( p8 ) ); + + + std::cout << '.'; + + CGAL::Sphere_3 c11( p0 ); + CGAL::Sphere_3 c12( p0, CGAL::POSITIVE ); + CGAL::Sphere_3 c13( p0, CGAL::NEGATIVE ); + assert( c11.orientation() == CGAL::POSITIVE ); + assert( c12.orientation() == CGAL::POSITIVE ); + assert( c13.orientation() == CGAL::NEGATIVE ); + assert( c11.is_degenerate() ); + assert( c12.is_degenerate() ); + assert( c13.is_degenerate() ); + + std::cout << "done" << std::endl; + return true; +} + +#endif // CGAL__TEST_CLS_SPHERE_3_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_sphere_3.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_sphere_3.h new file mode 100644 index 00000000000..ff8a4c30841 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_sphere_3.h @@ -0,0 +1,31 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_sphere_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_SPHERE_3_H +#include +#endif // CGAL_SPHERE_3_H + +template bool _test_cls_sphere_3(const R& ); + diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_tetrahedron_3.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_tetrahedron_3.C new file mode 100644 index 00000000000..c0bf5006322 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_tetrahedron_3.C @@ -0,0 +1,151 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_tetrahedron_3.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_TETRAHEDRON_3_C +#define CGAL__TEST_CLS_TETRAHEDRON_3_C +#ifndef CGAL__TEST_CLS_TETRAHEDRON_3_H +#include +#endif // CGAL__TEST_CLS_TETRAHEDRON_3_H + +template +bool +_test_cls_tetrahedron_3(const R& ) +{ + std::cout << "Testing class Tetrahedron_3" ; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + typename R::Tetrahedron_3 it; + CGAL::Tetrahedron_3 t0(it); + + RT n0 = 0; + RT n1 = 12; + RT n2 = 16; + RT n3 = -4; + RT n4 = 2; + RT n5 = 3; + RT n6 = 30; + RT n7 = 9; + RT n8 = 24; + RT n9 = 8; + + CGAL::Point_3 p1( n1, n2, n3, n4); + CGAL::Point_3 p2( n2, n9, n3,-n3); + CGAL::Point_3 p3( n5, n6, n1, n5); + CGAL::Point_3 p4( n7, n7, n8, n5); + + CGAL::Point_3 ps3( n0, n0, n7, n5); + CGAL::Point_3 ps2( n0, n7, n0, n5); + CGAL::Point_3 ps1( n7, n0, n0, n5); + CGAL::Point_3 ps0( CGAL::ORIGIN ); + + CGAL::Tetrahedron_3 t1(p1,p2,p3,p4); + CGAL::Tetrahedron_3 t2(p2,p1,p3,p4); + CGAL::Tetrahedron_3 t3(ps0,ps1,ps2,ps3); // positive oriented + CGAL::Tetrahedron_3 t4(ps0,ps1,ps3,ps2); // negative oriented + CGAL::Tetrahedron_3 t5(ps0,p1,p3,ps2); + CGAL::Tetrahedron_3 t6(t3); + CGAL::Tetrahedron_3 the(p2,p3,p1,p4); + CGAL::Tetrahedron_3 td1(p2,p3,p3,p4); + CGAL::Tetrahedron_3 td2(p2,p2,p3,p4); + t0 = t4; + + assert( t4 == t4 ); + assert( t4 == t0 ); + assert( t6 == t3 ); + assert( t4 != t2 ); + assert( t4 != t3 ); + assert( t1 == the ); + assert( td1 == td2 ); + + + std::cout << '.'; + + assert( t5.vertex(0) == ps0 ); + assert( t5.vertex(1) == p1 ); + assert( t5.vertex(2) == p3 ); + assert( t5.vertex(3) == ps2 ); + assert( t5.vertex(4) == ps0 ); + assert( t5.vertex(5) == p1 ); + assert( t1[0] == p1 ); + assert( t1[1] == p2 ); + assert( t1[2] == p3 ); + assert( t1[3] == p4 ); + assert( t1[4] == p1 ); + assert( t1[9] == p2 ); + + CGAL::Tetrahedron_3 t7( p1,p1,p2,p3); + CGAL::Tetrahedron_3 t8( p2,p2,p2,p2); + assert( t7.is_degenerate() ); + assert( t8.is_degenerate() ); + + std::cout << '.'; + + CGAL::Point_3 p5(n6,n6,n6,n4); + CGAL::Point_3 p6(n4,n4,n4,n9); + CGAL::Point_3 p7(n7,n7,n7,n7); + assert( t3.has_on_unbounded_side( p5 )); + assert( t3.has_on_bounded_side( p6 )); + assert( t3.has_on_boundary( p7 )); + assert( t4.has_on_unbounded_side( p5 )); + assert( t4.has_on_bounded_side( p6 )); + assert( t4.has_on_boundary( p7 )); + assert( t2.has_on_unbounded_side( p5 )); + assert( t4.bounded_side( p5 ) == CGAL::ON_UNBOUNDED_SIDE ); + assert( t4.bounded_side( p6 ) == CGAL::ON_BOUNDED_SIDE ); + assert( t4.bounded_side( p7 ) == CGAL::ON_BOUNDARY ); + + std::cout << '.'; + + assert( t3.oriented_side( p3 ) != t4.oriented_side( p3 ) ); + assert( t4.has_on_positive_side( p5 )); + assert( t4.has_on_negative_side( p6 )); + assert( t3.has_on_positive_side( p6 )); + assert( t3.has_on_negative_side( p5 )); + assert( t4.oriented_side( p5 ) == CGAL::ON_POSITIVE_SIDE ); + assert( t4.oriented_side( p6 ) == CGAL::ON_NEGATIVE_SIDE ); + assert( t4.oriented_side( p7 ) == CGAL::ON_ORIENTED_BOUNDARY ); + assert( t3.oriented_side( p7 ) == CGAL::ON_ORIENTED_BOUNDARY ); + assert( t3.oriented_side( p6 ) == CGAL::ON_POSITIVE_SIDE ); + assert( t3.oriented_side( p5 ) == CGAL::ON_NEGATIVE_SIDE ); + assert( t2.has_on_boundary(p2) ); + assert( t2.bounded_side(p3) == CGAL::ON_BOUNDARY ); + assert( t2.oriented_side(p4) == CGAL::ON_ORIENTED_BOUNDARY ); + CGAL::Point_3 p8(n3, n0, n0, n3); + CGAL::Point_3 p9(n0, n3, n0, n3); + assert( t3.has_on_boundary( p8 ) ); + assert( t3.has_on_boundary( p9 ) ); + assert( t4.has_on_boundary( p8 ) ); + assert( t4.has_on_boundary( p9 ) ); + assert( t3.bounded_side(p8) == CGAL::ON_BOUNDARY ); + assert( t3.oriented_side(p8) == CGAL::ON_ORIENTED_BOUNDARY ); + assert( t4.bounded_side(p9) == CGAL::ON_BOUNDARY ); + assert( t4.oriented_side(p9) == CGAL::ON_ORIENTED_BOUNDARY ); + + std::cout << "done" << std::endl; + return true; +} +#endif // CGAL__TEST_CLS_TETRAHEDRON_3_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_tetrahedron_3.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_tetrahedron_3.h new file mode 100644 index 00000000000..7d05059e48a --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_tetrahedron_3.h @@ -0,0 +1,33 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_tetrahedron_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_TETRAHEDRON_3_H +#include +#endif // CGAL_TETRAHEDRON_3_H + + +template bool _test_cls_tetrahedron_3(const R& ); + + diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_triangle_2.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_triangle_2.C new file mode 100644 index 00000000000..d7d4198accc --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_triangle_2.C @@ -0,0 +1,144 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_cls_triangle_2.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_TRIANGLE_2_C +#define CGAL__TEST_CLS_TRIANGLE_2_C +#ifndef CGAL__TEST_CLS_TRIANGLE_2_H +#include +#endif // CGAL__TEST_CLS_TRIANGLE_2_H + +template +bool +_test_cls_triangle_2(const R& ) +{ + std::cout << "Testing class Triangle_2"; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + typename R::Triangle_2 it; + CGAL::Triangle_2 t0(it); + + RT n0 = 0; + RT n1 = 1; + RT n2 = 2; + RT n3 = 3; + RT n4 = 4; + RT n5 = 5; + RT n6 = 6; + RT n7 = 7; + RT n8 = 8; + RT n9 = 9; + RT n10= 10; + RT n12= 12; + RT n21= 21; + + CGAL::Point_2 p1( n6, n6, n6); // ( 1, 1) + CGAL::Point_2 p2( n6, n9, n3); // ( 2, 3) + CGAL::Point_2 p3( n6, n10, n2); // ( 3, 5) + CGAL::Point_2 p4( n5, n4, n1); // ( 5, 4) + CGAL::Point_2 p5( n21, n9, n3); // ( 7, 3) + CGAL::Point_2 p6( n8, n4, n2); // ( 4, 2) + CGAL::Point_2 p7( n4, n0); // ( 4, 0) + CGAL::Point_2 p8(-n12,-n8,-n2); // ( 6, 4) + CGAL::Point_2 p9( n9, n9, n3); // ( 3, 3) + + CGAL::Triangle_2 t1( p1, p3, p5); + CGAL::Triangle_2 t2( p3, p1, p5); + CGAL::Triangle_2 t3( p7, p8, p9); + CGAL::Triangle_2 t4( p3, p5, p1); + CGAL::Triangle_2 t5( p5, p1, p3); + t0 = t3; + + std::cout << '.'; + + assert( t1 == t1 ); + assert( t4 == t1 ); + assert( t1 == t5 ); + assert( t0 == t3 ); + assert( t1 != t2 ); + assert( t3 != t2 ); + + assert( t3.vertex(0) == p7 ); + assert( t3.vertex(1) == p8 ); + assert( t3.vertex(2) == p9 ); + assert( t3.vertex(3) == p7 ); + assert( t3.vertex(4) == p8 ); + assert( t3.vertex(5) == p9 ); + assert( t2[5] == t2.vertex(5) ); + assert( t2[6] == t2.vertex(6) ); + + assert( t1.orientation() == CGAL::NEGATIVE ); + assert( t2.orientation() == CGAL::POSITIVE ); + assert( t0.orientation() == CGAL::POSITIVE ); + + std::cout << '.'; + + assert( t1.oriented_side( p9 ) == CGAL::ON_NEGATIVE_SIDE ); + assert( t1.oriented_side( p7 ) == CGAL::ON_POSITIVE_SIDE ); + assert( t1.oriented_side( p8 ) == CGAL::ON_POSITIVE_SIDE ); + assert( t1.oriented_side( p6 ) == CGAL::ON_ORIENTED_BOUNDARY ); + assert( t2.oriented_side( p8 ) == CGAL::ON_NEGATIVE_SIDE ); + assert( t2.oriented_side( p9 ) == CGAL::ON_POSITIVE_SIDE ); + assert( t2.oriented_side( p6 ) == CGAL::ON_ORIENTED_BOUNDARY ); + assert( t2.oriented_side( p3 ) == CGAL::ON_ORIENTED_BOUNDARY ); + + assert( t1.bounded_side( p9 ) == CGAL::ON_BOUNDED_SIDE ); + assert( t1.bounded_side( p7 ) == CGAL::ON_UNBOUNDED_SIDE ); + assert( t1.bounded_side( p2 ) == CGAL::ON_BOUNDARY ); + assert( t2.bounded_side( p9 ) == CGAL::ON_BOUNDED_SIDE ); + assert( t2.bounded_side( p7 ) == CGAL::ON_UNBOUNDED_SIDE ); + assert( t2.bounded_side( p2 ) == CGAL::ON_BOUNDARY ); + assert( t2.bounded_side( p1 ) == CGAL::ON_BOUNDARY ); + assert( t2.bounded_side( p5 ) == CGAL::ON_BOUNDARY ); + + assert( t1.opposite().has_on_positive_side( p9 ) ); + assert( t1.has_on_positive_side( p8 ) ); + assert( t3.has_on_negative_side( p2 ) ); + assert( t2.has_on_boundary( p1 ) ); + assert( t2.has_on_boundary( p2 ) ); + assert( t2.has_on_boundary( p3 ) ); + assert( t2.has_on_boundary( p4 ) ); + assert( t2.has_on_boundary( p5 ) ); + assert( t2.has_on_boundary( p6 ) ); + assert( t1.has_on_bounded_side( CGAL::Point_2( n6, n8, n2)) ); + assert( t1.has_on_unbounded_side( CGAL::Point_2( -n4, n8, n6)) ); + + std::cout << '.'; + + assert( t1.opposite() == t2 ); + assert( t3 == t3.opposite().opposite() ); + + CGAL::Triangle_2 tdeg1( p1, p7, p7); + CGAL::Triangle_2 tdeg2( p6, p6, p6); + assert( tdeg1.orientation() == CGAL::ZERO ); + assert( tdeg2.orientation() == CGAL::ZERO ); + assert( tdeg1.is_degenerate() ); + assert( tdeg2.is_degenerate() ); + + std::cout << "done" << std::endl; + return true; +} +#endif // CGAL__TEST_CLS_TRIANGLE_2_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_triangle_2.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_triangle_2.h new file mode 100644 index 00000000000..cfbb392431e --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_triangle_2.h @@ -0,0 +1,37 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_cls_triangle_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_TRIANGLE_2_H +#define CGAL__TEST_CLS_TRIANGLE_2_H + +#ifndef CGAL_TRIANGLE_2_H +#include +#endif // CGAL_TRIANGLE_2_H + + +template bool _test_cls_triangle_2(const R& ); + + +#endif // CGAL__TEST_CLS_TRIANGLE_2_H diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_triangle_3.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_triangle_3.C new file mode 100644 index 00000000000..a262eca732b --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_triangle_3.C @@ -0,0 +1,113 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_triangle_3.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_TRIANGLE_3_C +#define CGAL__TEST_CLS_TRIANGLE_3_C +#ifndef CGAL__TEST_CLS_TRIANGLE_3_H +#include +#endif // CGAL__TEST_CLS_TRIANGLE_3_H + +template +bool +_test_cls_triangle_3(const R& ) +{ + std::cout << "Testing class Triangle_3" ; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + typename R::Triangle_3 it; + CGAL::Triangle_3 t0(it); + + RT n0 = 0; + RT n1 = 12; + RT n2 = 16; + RT n3 = -4; + RT n4 = 2; + RT n5 = 3; + RT n6 = 30; + RT n7 = 9; + RT n8 = 24; + RT n9 = 8; + + CGAL::Point_3 p1( n1, n2, n3, n4); + CGAL::Point_3 p2( n2, n9, n3,-n3); + CGAL::Point_3 p3( n5, n6, n1, n5); + CGAL::Point_3 p4( n7, n7, n8, n5); + + CGAL::Point_3 ps3( n0, n0, n7, n5); + CGAL::Point_3 ps2( n0, n7, n0, n5); + CGAL::Point_3 ps1( n7, n0, n0, n5); + + CGAL::Triangle_3 t1(p1,p2,p3); + CGAL::Triangle_3 t2(p4,p2,p3); + CGAL::Triangle_3 t3(ps1,ps2,ps3); + CGAL::Triangle_3 t4(ps2,ps1,ps3); + CGAL::Triangle_3 t5( t1 ); + t0 = t1; + + assert( t0 == t0 ); + assert( t0 == t1 ); + assert( t5 == t1 ); + assert( t2 != t4 ); + assert( t3 != t4 ); + + std::cout <<'.'; + + CGAL::Plane_3 pl1( p1,p2,p3); + CGAL::Plane_3 pl2( p4,p2,p3); + assert( t1.supporting_plane() == pl1 ); + assert( t2.supporting_plane() == pl2 ); + assert( t3.supporting_plane() == t4.supporting_plane().opposite() ); + + std::cout <<'.'; + + assert( t1.has_on(p3) ); + assert( t1.has_on(p2) ); + assert( t2.has_on(p4) ); + assert( ! t1.has_on(p4) ); + CGAL::Point_3 pt( n7, n7, n7, n7); + assert( t3.has_on( pt ) ); + assert( t4.has_on( pt ) ); + + assert( t1.vertex(0) == p1 ); + assert( t1.vertex(1) == p2 ); + assert( t1.vertex(2) == p3 ); + assert( t4[0] == ps2 ); + assert( t4[1] == ps1 ); + assert( t4[2] == ps3 ); + + std::cout <<'.'; + + CGAL::Triangle_3 tdeg1( p3,p3,p1); + CGAL::Triangle_3 tdeg2( p3,p3,p3); + assert( tdeg1.is_degenerate() ); + assert( tdeg2.is_degenerate() ); + + std::cout << "done" << std::endl; + return true; +} + +#endif // CGAL__TEST_CLS_TRIANGLE_3_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_triangle_3.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_triangle_3.h new file mode 100644 index 00000000000..44c9dc5298f --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_triangle_3.h @@ -0,0 +1,33 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_triangle_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_TRIANGLE_3_H +#include +#endif // CGAL_TRIANGLE_3_H + + +template bool _test_cls_triangle_3(const R& ); + + diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_vector_2.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_vector_2.C new file mode 100644 index 00000000000..b7be0f2f906 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_vector_2.C @@ -0,0 +1,97 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_cls_vector_2.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_VECTOR_2_C +#define CGAL__TEST_CLS_VECTOR_2_C + +#ifndef CGAL__TEST_CLS_VECTOR_2_H +#include +#endif // CGAL__TEST_CLS_VECTOR_2_H + +template +bool +_test_cls_vector_2(const R& ) +{ + std::cout << "Testing class Vector_2" ; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + typename R::Vector_2 iv; + CGAL::Vector_2 v1; + CGAL::Vector_2 v2(iv); + CGAL::Vector_2 v0(CGAL::NULL_VECTOR); + + RT n1( 12 ); + RT n2( -4 ); + RT n3( 6 ); + RT n4( 2 ); + + CGAL::Vector_2 v3(n1, n2 ); // ( 12, -4) + CGAL::Vector_2 v4(n1, n2, n4); // ( 6, -2) + CGAL::Vector_2 v5(n1, n2, n4); // ( 6, -2) + CGAL::Vector_2 v6( v5 ); + v1 = v4; + CGAL::Vector_2 v7(-n1, -n2, -n4); // ( 6, -2) + + std::cout << '.'; + + assert( v5 == v7 ); + assert( v4 == v5 ); + assert( v5 == v6 ); + assert( v4 == v6 ); + assert( v1 == v6 ); + assert( v0 == CGAL::NULL_VECTOR); + + assert( v3 != v4 ); + assert( v0 != v1 ); + assert( v1 != CGAL::NULL_VECTOR); + + assert( v3.hx() == n1 ); // don't replace v3 + assert( v3.hy() == n2 ); + + assert( FT( v5.hx()) / FT(v5.hw()) == FT( n1) / FT( n4) ); + assert( FT( v5.hy()) / FT(v5.hw()) == FT( n2) / FT( n4) ); + + assert( v5.x() == FT( n1) / FT( n4) ); + assert( v5.y() == FT( n2) / FT( n4) ); + + std::cout << '.'; + + assert( v3.homogeneous(0) == v3.hx() ); // don't replace v3 + assert( v3.homogeneous(1) == v3.hy() ); + assert( v3.homogeneous(2) == v3.hw() ); + assert( v6.cartesian(0) == v6.x() ); + assert( v6.cartesian(1) == v6.y() ); + + std::cout << '.'; + + assert( v0.dimension() == 2 ); + assert( v4.homogeneous( v4.dimension() ) == v4.hw() ); + + std::cout << "done" << std::endl; + return true; +} +#endif // CGAL__TEST_CLS_VECTOR_2_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_vector_2.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_vector_2.h new file mode 100644 index 00000000000..7b1e34b5609 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_vector_2.h @@ -0,0 +1,40 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_cls_vector_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_VECTOR_2_H +#define CGAL__TEST_CLS_VECTOR_2_H + +#ifndef CGAL_USER_CLASSES_H +#include +#endif // CGAL_USER_CLASSES_H +#ifndef CGAL_VECTOR_2_H +#include +#endif // CGAL_VECTOR_2_H + + +template bool _test_cls_vector_2(const R& ); + + +#endif // CGAL__TEST_CLS_VECTOR_2_H diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_vector_3.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_vector_3.C new file mode 100644 index 00000000000..3d33b21913c --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_vector_3.C @@ -0,0 +1,101 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_vector_3.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_VECTOR_3_C +#define CGAL__TEST_CLS_VECTOR_3_C +#ifndef CGAL__TEST_CLS_VECTOR_3_H +#include +#endif // CGAL__TEST_CLS_VECTOR_3_H + +template +bool +_test_cls_vector_3(const R& ) +{ + std::cout << "Testing class Vector_3" ; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + typename R::Vector_3 iv; + + CGAL::Vector_3 v1; + CGAL::Vector_3 v2(iv); + CGAL::Vector_3 v0(CGAL::NULL_VECTOR); + + RT n1( 12 ); + RT n2( -4 ); + RT n3( 6 ); + RT n4( 2 ); + + CGAL::Vector_3 v3(n1, n2, n3); + CGAL::Vector_3 v4(n1, n2, n3, n4); + CGAL::Vector_3 v5(n1, n2, n3, n4); + CGAL::Vector_3 v6( v5 ); + v1 = v4; + CGAL::Vector_3 v7(-n1, -n2, -n3, -n4); + + std::cout << '.'; + + assert( v4 == v5 ); + assert( v5 == v6 ); + assert( v4 == v6 ); + assert( v1 == v6 ); + assert( v0 == CGAL::NULL_VECTOR); + assert( v5 == v7 ); + + assert( v3 != v4 ); + assert( v0 != v1 ); + assert( v1 != CGAL::NULL_VECTOR); + + assert( v3.hx() == n1 ); // don't replace v3 + assert( v3.hy() == n2 ); + assert( v3.hz() == n3 ); + + assert( FT( v5.hx()) / FT(v5.hw()) == FT( n1) / FT( n4) ); + assert( FT( v5.hy()) / FT(v5.hw()) == FT( n2) / FT( n4) ); + assert( FT( v5.hz()) / FT(v5.hw()) == FT( n3) / FT( n4) ); + + assert( v5.x() == FT( n1) / FT( n4) ); + assert( v5.y() == FT( n2) / FT( n4) ); + assert( v5.z() == FT( n3) / FT( n4) ); + + std::cout << '.'; + + assert( v3.homogeneous(0) == v3.hx() ); // don't replace v3 + assert( v3.homogeneous(1) == v3.hy() ); + assert( v3.homogeneous(2) == v3.hz() ); + assert( v3.homogeneous(3) == v3.hw() ); + assert( v6.cartesian(0) == v6.x() ); + assert( v6.cartesian(1) == v6.y() ); + assert( v6.cartesian(2) == v6.z() ); + + std::cout << '.'; + + assert( v0.dimension() == 3 ); + + std::cout << "done" << std::endl; + return true; +} +#endif // CGAL__TEST_CLS_VECTOR_3_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_vector_3.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_vector_3.h new file mode 100644 index 00000000000..45aaf4a1760 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_cls_vector_3.h @@ -0,0 +1,36 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_vector_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_USER_CLASSES_H +#include +#endif // CGAL_USER_CLASSES_H +#ifndef CGAL_VECTOR_3_H +#include +#endif // CGAL_VECTOR_3_H + + +template bool _test_cls_vector_3(const R& ); + + diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_constructions_2.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_constructions_2.C new file mode 100644 index 00000000000..a6638ba854f --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_constructions_2.C @@ -0,0 +1,68 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : +// file : _test_fct_constructions_2.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_CONSTRUCTIONS_2_C +#define CGAL__TEST_FCT_CONSTRUCTIONS_2_C + +#ifndef CGAL__TEST_FCT_CONSTRUCTIONS_2_H +#include +#endif // CGAL__TEST_FCT_CONSTRUCTIONS_2_H + +template +bool +_test_fct_constructions_2(const R&) +{ + typedef typename R::RT RT; + typedef CGAL::Point_2 Point; + typedef CGAL::Vector_2 Vector; + + RT RT0(0); + RT RT1(1); + RT RT2(2); + RT RT3(3); + RT RT4(4); + RT RT8(8); + + Point p( RT4, RT8, RT2); // ( 2, 4) + Point pne = p + Vector( RT1, RT1 ); + Point pnw = p + Vector(-RT1, RT1 ); + Point pse = p + Vector( RT1,-RT1 ); + Point psw = p + Vector(-RT1,-RT1 ); + + // midpoint + assert( CGAL::midpoint( pne, psw) == p); + assert( CGAL::midpoint( pnw, pse) == p); + + // circumcenter + assert( CGAL::circumcenter( pne, pse, pnw) == p); + assert( CGAL::circumcenter( psw, pse, pnw) == p); + + // general position intersection point + + return true; +} + + +#endif // CGAL__TEST_FCT_CONSTRUCTIONS_2_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_constructions_2.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_constructions_2.h new file mode 100644 index 00000000000..3eb523d9170 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_constructions_2.h @@ -0,0 +1,42 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : +// file : _test_fct_constructions_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_CONSTRUCTIONS_2_H +#define CGAL__TEST_FCT_CONSTRUCTIONS_2_H + +#include +#include + + +template +bool +_test_fct_constructions_2(const R&); + + +#ifdef CGAL_CFG_NO_AUTOMATIC_TEMPLATE_INCLUSION +#include +#endif // CGAL_CFG_NO_AUTOMATIC_TEMPLATE_INCLUSION + +#endif // CGAL__TEST_FCT_CONSTRUCTIONS_2_H diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_constructions_3.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_constructions_3.C new file mode 100644 index 00000000000..c80480a5dd9 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_constructions_3.C @@ -0,0 +1,75 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : +// file : _test_fct_constructions_3.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_CONSTRUCTIONS_3_C +#define CGAL__TEST_FCT_CONSTRUCTIONS_3_C + +#ifndef CGAL__TEST_FCT_CONSTRUCTIONS_3_H +#include +#endif // CGAL__TEST_FCT_CONSTRUCTIONS_3_H + +template +bool +_test_fct_constructions_3(const R&) +{ + typedef typename R::RT RT; + typedef CGAL::Point_3 Point; + typedef CGAL::Vector_3 Vector; + + RT RT0(0); + RT RT1(1); + RT RT2(2); + RT RT3(3); + RT RT4(4); + RT RT8(8); + + Point p( RT4, RT8, -RT2, RT2); // ( 2, 4, -1) + Point p111 = p + Vector( RT1, RT1, RT1 ); + Point p011 = p + Vector(-RT1, RT1, RT1 ); + Point p101 = p + Vector( RT1,-RT1, RT1 ); + Point p001 = p + Vector(-RT1,-RT1, RT1 ); + Point p000 = p + Vector(-RT1,-RT1,-RT1 ); + Point p100 = p + Vector( RT1,-RT1,-RT1 ); + Point p110 = p + Vector( RT1, RT1,-RT1 ); + Point p010 = p + Vector(-RT1, RT1,-RT1 ); + + // midpoint + assert( CGAL::midpoint( p111, p000) == p); + assert( CGAL::midpoint( p110, p001) == p); + assert( CGAL::midpoint( p010, p101) == p); + assert( CGAL::midpoint( p100, p011) == p); + + // circumcenter + assert( CGAL::circumcenter( p111, p001, p010, p000) == p); + assert( CGAL::circumcenter( p101, p001, p010, p100) == p); + assert( CGAL::circumcenter( p001, p000, p110, p100) == p); + + // projection onto a plane + + return true; +} + + +#endif // CGAL__TEST_FCT_CONSTRUCTIONS_3_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_constructions_3.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_constructions_3.h new file mode 100644 index 00000000000..905f15a5159 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_constructions_3.h @@ -0,0 +1,40 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : +// file : _test_fct_constructions_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_CONSTRUCTIONS_3_H +#define CGAL__TEST_FCT_CONSTRUCTIONS_3_H + +#include +#include + + +template bool _test_fct_constructions_3(const R&); + + +#ifdef CGAL_CFG_NO_AUTOMATIC_TEMPLATE_INCLUSION +#include +#endif // CGAL_CFG_NO_AUTOMATIC_TEMPLATE_INCLUSION + +#endif // CGAL__TEST_FCT_CONSTRUCTIONS_3_H diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_coplanar_3.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_coplanar_3.C new file mode 100644 index 00000000000..06ea8de3c92 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_coplanar_3.C @@ -0,0 +1,86 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : +// file : _test_fct_coplanar_3.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_COPLANAR_3_C +#define CGAL__TEST_FCT_COPLANAR_3_C + +#ifndef CGAL__TEST_FCT_COPLANAR_3_H +#include +#endif // CGAL__TEST_FCT_COPLANAR_3_H + +template +bool +_test_fct_coplanar_3(const R& ) +{ + typedef typename R::RT RT; + typedef CGAL::Point_3 Point; + typedef CGAL::Vector_3 Vector; + RT RT0(0); + RT RT1(1); + RT RT2(2); + RT RT3(3); + RT RT4(4); + RT RT6(6); + RT RT8(8); + + Point p = Point( RT1, RT0, RT1, RT2); + Point q = Point( RT4, RT1, RT2, RT8); + Point r = Point( RT3, RT1, RT3, RT6); + Point s = p + (q - r); + assert( CGAL::coplanar( p,q,r,s)); + assert( CGAL::coplanar_orientation( p,q,r,s) == CGAL::NEGATIVE); + assert( CGAL::coplanar_orientation( p,q,s,r) == CGAL::NEGATIVE ); + assert( CGAL::coplanar_orientation( p,q,r,r) == CGAL::POSITIVE ); + s = p + RT2*( q - p); + assert( CGAL::coplanar_orientation( p,q,r,s) == CGAL::COLLINEAR ); + s = p - (q - r); + assert( CGAL::coplanar_orientation( p,q,r,s) == CGAL::POSITIVE ); + p = Point( RT0, RT1, RT1, RT2); + q = Point( RT1, RT4, RT2, RT8); + r = Point( RT1, RT3, RT3, RT6); + s = p + (q - r); + assert( CGAL::coplanar_orientation( p,q,r,s) == CGAL::NEGATIVE ); + assert( CGAL::coplanar_orientation( p,q,s,r) == CGAL::NEGATIVE ); + assert( CGAL::coplanar_orientation( p,q,r,r) == CGAL::POSITIVE ); + s = p + RT2*( q - p); + assert( CGAL::coplanar_orientation( p,q,r,s) == CGAL::COLLINEAR ); + s = p - (q - r); + assert( CGAL::coplanar_orientation( p,q,r,s) == CGAL::POSITIVE ); + p = Point( RT0, RT1, RT1, RT2); + q = Point( RT1, RT2, RT4, RT8); + r = Point( RT1, RT3, RT3, RT6); + s = p + (q - r); + assert( CGAL::coplanar_orientation( p,q,r,s) == CGAL::NEGATIVE ); + assert( CGAL::coplanar_orientation( p,q,s,r) == CGAL::NEGATIVE ); + assert( CGAL::coplanar_orientation( p,q,r,r) == CGAL::POSITIVE ); + s = p + RT2*( q - p); + assert( CGAL::coplanar_orientation( p,q,r,s) == CGAL::COLLINEAR ); + s = p - (q - r); + assert( CGAL::coplanar_orientation( p,q,r,s) == CGAL::POSITIVE ); + return true; +} + + +#endif // CGAL__TEST_FCT_COPLANAR_3_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_coplanar_3.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_coplanar_3.h new file mode 100644 index 00000000000..3c34def3aa5 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_coplanar_3.h @@ -0,0 +1,38 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : +// file : _test_fct_coplanar_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_COPLANAR_3_H +#define CGAL__TEST_FCT_COPLANAR_3_H + +#include +#include + +template bool _test_fct_coplanar_3(const R&); + +#ifdef CGAL_CFG_NO_AUTOMATIC_TEMPLATE_INCLUSION +#include +#endif // CGAL_CFG_NO_AUTOMATIC_TEMPLATE_INCLUSION + +#endif // CGAL__TEST_FCT_COPLANAR_3_H diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_determinant.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_determinant.C new file mode 100644 index 00000000000..d3e29bd1227 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_determinant.C @@ -0,0 +1,131 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : +// file : _test_fct_determinant.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_DETERMINANT_C +#define CGAL__TEST_DETERMINANT_C + +#include +#include + +template +bool +_test_fct_determinant(const NT&) +{ + NT zero= NT(0); + NT one = NT(1); + NT two = NT(2); + + // detDxD_by_formula + + assert( CGAL::det2x2_by_formula( zero, one, \ + one, zero) == - one ); + + assert( CGAL::det2x2_by_formula( one, one, \ + zero, -one) == - one ); + + assert( CGAL::det3x3_by_formula( one, zero, one, \ + zero, one, one, \ + -one, -one, zero ) == \ + one * CGAL::det2x2_by_formula( one, one, \ + -one, zero ) \ + - one * CGAL::det2x2_by_formula( zero, one, \ + one, one ) ); + + assert( CGAL::det4x4_by_formula( one, zero, one, -one, \ + zero, one, one, -one, \ + one, two, zero, one, \ + -one, -one, zero, zero ) == \ + one * CGAL::det3x3_by_formula( zero, one, -one, \ + one, one, -one, \ + two, zero, one ) \ + - one * CGAL::det3x3_by_formula( one, one, -one, \ + zero, one, -one, \ + one, zero, one ) ); + + assert( CGAL::det5x5_by_formula( one, zero, one, -one, zero, \ + zero, one, one, -one, zero, \ + one, two, zero, one, two, \ + one, one, zero, -one, zero, \ + -one, -one, zero, zero, one ) == \ + two * CGAL::det4x4_by_formula( one, zero, one, -one, \ + zero, one, one, -one, \ + one, one, zero, -one, \ + -one, -one, zero, zero) \ + + one * CGAL::det4x4_by_formula( one, zero, one, -one, \ + zero, one, one, -one, \ + one, two, zero, one, \ + one, one, zero, -one) ); + + assert( CGAL::det6x6_by_formula( one, zero, zero, zero, zero, zero, \ + zero, one, zero, one, -one, zero, \ + zero, zero, one, one, -one, zero, \ + zero, one, two, zero, one, two, \ + zero, one, one, zero, -one, zero, \ + zero, -one, -one, zero, zero, one ) == \ + CGAL::det5x5_by_formula( one, zero, one, -one, zero, \ + zero, one, one, -one, zero, \ + one, two, zero, one, two, \ + one, one, zero, -one, zero, \ + -one, -one, zero, zero, one ) ); + + // sign_of_determinantDxD + + assert( CGAL::sign_of_determinant2x2( zero, one, \ + one, zero) == CGAL::NEGATIVE ); + + assert( CGAL::sign_of_determinant2x2( one, one, \ + zero, -one) == CGAL::NEGATIVE ); + + assert( CGAL::sign_of_determinant2x2( one, one, \ + zero, one) == CGAL::POSITIVE ); + + assert( CGAL::sign_of_determinant2x2( zero, -one, \ + zero, one) == CGAL::ZERO ); + + + assert( CGAL::sign_of_determinant4x4( one, zero, one, -one, \ + zero, one, one, -one, \ + zero, two, zero, one, \ + zero, -one, zero, zero ) == \ + CGAL::sign_of_determinant3x3( one, one, -one, \ + two, zero, one, \ + -one, zero, zero ) ); + + assert( CGAL::sign_of_determinant6x6( one, zero, zero, zero, zero, zero, \ + zero, one, zero, one, -one, zero, \ + zero, zero, one, one, -one, zero, \ + zero, one, two, zero, one, two, \ + zero, one, one, zero, -one, zero, \ + zero, -one, -one, zero, zero, one )==\ + CGAL::sign_of_determinant5x5( one, zero, one, -one, zero, \ + zero, one, one, -one, zero, \ + one, two, zero, one, two, \ + one, one, zero, -one, zero, \ + -one, -one, zero, zero, one ) ); + + + return true; +} +#endif // CGAL__TEST_DETERMINANT_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_direction_2.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_direction_2.C new file mode 100644 index 00000000000..65ea9697bd5 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_direction_2.C @@ -0,0 +1,114 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_fct_direction_2.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_DIRECTION_2_C +#define CGAL__TEST_FCT_DIRECTION_2_C +#ifndef CGAL__TEST_FCT_DIRECTION_2_H +#include +#endif // CGAL__TEST_FCT_DIRECTION_2_H + +bool +ccw(int i, int j, int k) +// i between j and k +{ + return ((j < i)&&(i < k)) // j < i < k + ||((k < j)&&(j < i)) // k < j < i + ||((i < k)&&(k < j)); // i < k < j +} + +template +bool +_test_fct_direction_2(const R& ) +{ + std::cout << "Testing functions Direction_2" ; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + RT n0 = 0; + RT n1 = 1; + RT n2 = 2; + RT n3 = 3; + RT n4 = 4; + RT n5 = 5; + RT n6 = 6; + RT n8 = 8; + + CGAL::Direction_2 d[8]; + d[0] = CGAL::Direction_2( n5, n0 ); // ( 5, 0) + d[1] = CGAL::Direction_2( n8, n3 ); // ( 8, 3) + d[2] = CGAL::Direction_2( n0, n4 ); // ( 0, 4) + d[3] = CGAL::Direction_2(-n4, n3 ); // (-4, 3) + d[4] = CGAL::Direction_2(-n2, n0 ); // (-2, 0) + d[5] = CGAL::Direction_2(-n4,-n6 ); // (-4,-6) + d[6] = CGAL::Direction_2( n0,-n1 ); // ( 0,-1) + d[7] = CGAL::Direction_2( n4,-n5 ); // ( 4,-5) + + std::cout << '.'; + + assert( d[0] >= d[0] ); + assert( d[0] <= d[0] ); + + std::cout << '.'; + + int i; + int j; + int k; + + for ( i = 1; i < 8; i++ ) + { + for ( j = 0; j+i < 8; j++) + { + assert( d[j] <= d[j+i] ); + assert( d[j] < d[j+i] ); + } + for ( ; j < 8; j++) + { + assert( d[j] >= d[(j+i)%8] ); + assert( d[j] > d[(j+i)%8] ); + } + assert( d[i] >= d[i] ); + assert( d[i] <= d[i] ); + } + + std::cout << '.'; + + for (i = 0; i < 8; ++i ) + for (j = 0 ; j < 8; ++j ) + for ( k = 0; k < 8; ++k) + { + std::cout << i << ' ' << j << ' ' << k << std::endl; + if ( ccw(i,j,k) || ((j == k)&&( i != j)) ) + assert( d[i].counterclockwise_in_between(d[j],d[k])); + else + assert(!d[i].counterclockwise_in_between(d[j],d[k])); + // true if j --- i --- k along CCW rotation + // false if i -=- j -=- k + } + + std::cout << "done" << std::endl; + return true; +} +#endif // CGAL__TEST_FCT_DIRECTION_2_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_direction_2.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_direction_2.h new file mode 100644 index 00000000000..de81541bfc3 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_direction_2.h @@ -0,0 +1,37 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_fct_direction_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_DIRECTION_2_H +#define CGAL__TEST_FCT_DIRECTION_2_H + +#ifndef CGAL_DIRECTION_2_H +#include +#endif // CGAL_DIRECTION_2_H + + +template bool _test_fct_direction_2(const R& ); + + +#endif // CGAL__TEST_FCT_DIRECTION_2_H diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_2.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_2.C new file mode 100644 index 00000000000..0dc7ebbff60 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_2.C @@ -0,0 +1,243 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_fct_point_2.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_POINT_2_C +#define CGAL__TEST_FCT_POINT_2_C +#ifndef CGAL__TEST_FCT_POINT_2_H +#include +#endif // CGAL__TEST_FCT_POINT_2_H + +template +bool +_test_fct_point_2(const R& ) +{ + std::cout << "Testing functions Point_2" ; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + CGAL::Point_2 p1( RT(18), RT(12), RT(3) ); // ( 6, 4) + CGAL::Point_2 p2( RT(18), RT(15), RT(3) ); // ( 6, 5) + CGAL::Point_2 p3( RT(18), RT( 9), RT(3) ); // ( 6, 3) + CGAL::Point_2 p4( RT(28), RT(40), RT(4) ); // ( 7,10) + CGAL::Point_2 p5( RT(12), RT(-4), RT(4) ); // ( 3,-1) + CGAL::Point_2 p6( RT(28), RT(12), RT(4) ); // ( 7, 3) + CGAL::Point_2 p7( RT(18), RT( 6), RT(3) ); // ( 6, 2) + CGAL::Point_2 p8( RT(24), RT( 9), RT(3) ); // ( 8, 3) + CGAL::Point_2 p9( RT( 6), RT(10), RT(1) ); // ( 6,10) + + + + assert( CGAL::compare_lexicographically_xy(p1,p2) == CGAL::SMALLER ); + assert( CGAL::compare_lexicographically_xy(p3,p2) == CGAL::SMALLER ); + assert( CGAL::compare_lexicographically_xy(p3,p1) == CGAL::SMALLER ); + assert( CGAL::compare_lexicographically_xy(p3,p2) == CGAL::SMALLER ); + assert( CGAL::compare_lexicographically_xy(p2,p1) == CGAL::LARGER ); + assert( CGAL::compare_lexicographically_xy(p2,p3) == CGAL::LARGER ); + assert( CGAL::compare_lexicographically_xy(p4,p3) == CGAL::LARGER ); + assert( CGAL::compare_lexicographically_xy(p4,p4) == CGAL::EQUAL ); + + assert( CGAL::lexicographically_xy_smaller_or_equal(p1,p1) ); + assert( CGAL::lexicographically_xy_smaller_or_equal(p3,p1) ); + assert( CGAL::lexicographically_xy_smaller_or_equal(p3,p2) ); + assert( CGAL::lexicographically_xy_smaller_or_equal(p3,p4) ); + + assert( !CGAL::lexicographically_xy_smaller(p3,p3) ); + assert( CGAL::lexicographically_xy_smaller(p3,p2) ); + assert( !CGAL::lexicographically_xy_smaller(p4,p3) ); + + assert( CGAL::lexicographically_xy_larger(p2,p1) ); + assert( CGAL::lexicographically_xy_larger(p1,p3) ); + assert( CGAL::lexicographically_xy_larger(p2,p3) ); + assert( CGAL::lexicographically_xy_larger(p4,p3) ); + + assert( CGAL::lexicographically_xy_larger_or_equal(p3,p3) ); + assert( CGAL::lexicographically_xy_larger_or_equal(p2,p3) ); + assert( CGAL::lexicographically_xy_larger_or_equal(p4,p3) ); + + std::cout <<'.'; + + CGAL::Point_2 pe0( RT(1), RT(0) ); + CGAL::Point_2 pe1( RT(0), RT(1) ); + + assert( CGAL::orientation( CGAL::Point_2(CGAL::ORIGIN), pe0, pe1 ) \ + == CGAL::POSITIVE); + + assert( CGAL::orientation( p1, p2, p3) == CGAL::COLLINEAR ); + assert( CGAL::orientation( p1, p2, p4) == CGAL::RIGHTTURN ); + assert( CGAL::orientation( p2, p1, p4) == CGAL::LEFTTURN ); + assert( CGAL::orientation( p5, p4, p3) == CGAL::RIGHTTURN ); + assert( CGAL::orientation( p2, p4, p6) == CGAL::RIGHTTURN ); + assert( CGAL::orientation( p6, p4, p2) == CGAL::LEFTTURN ); + assert( CGAL::orientation( p4, p6, p2) == CGAL::RIGHTTURN ); + assert( CGAL::orientation( p5, p6, p7) == CGAL::COLLINEAR ); + assert( CGAL::orientation( p6, p5, p7) == CGAL::COLLINEAR ); + + assert( CGAL::collinear( p1, p2, p3 ) ); + assert( CGAL::collinear( p1, p2, p7 ) ); + assert( CGAL::collinear( p6, p5, p7 ) ); + assert( CGAL::collinear( p1, p2, p3 ) ); + assert( !CGAL::collinear( p1, p2, p4 ) ); + assert( CGAL::collinear( p6, p6, p3 ) ); + + assert( CGAL::leftturn( p1, p4, p2 ) ); + assert( CGAL::leftturn( p6, p4, p2 ) ); + + assert( CGAL::rightturn( p4, p6, p2 ) ); + assert( CGAL::rightturn( p1, p2, p4 ) ); + + std::cout << '.'; + + assert( CGAL::are_ordered_along_line( p5, p7, p6 ) ); // p7 between p6 and p5 + assert( CGAL::are_ordered_along_line( p6, p7, p5 ) ); + assert( CGAL::are_ordered_along_line( p2, p1, p3 ) ); + assert( !CGAL::are_ordered_along_line( p7, p6, p5 ) ); + assert( !CGAL::are_ordered_along_line( p7, p5, p6 ) ); + assert( !CGAL::are_ordered_along_line( p7, p4, p6 ) ); + assert( !CGAL::are_ordered_along_line( p2, p4, p6 ) ); + assert( CGAL::collinear_are_ordered_along_line( p5, p7, p6 ) ); + assert( CGAL::collinear_are_ordered_along_line( p6, p7, p5 ) ); + assert( CGAL::collinear_are_ordered_along_line( p2, p1, p3 ) ); + assert( !CGAL::collinear_are_ordered_along_line( p7, p6, p5 ) ); + + assert( CGAL::collinear_are_ordered_along_line( p7, p7, p7 ) ); + assert( !CGAL::collinear_are_ordered_along_line( p5, p6, p5 ) ); + assert( !CGAL::collinear_are_ordered_along_line( p1, p3, p1 ) ); + assert( !CGAL::collinear_are_ordered_along_line( p3, p6, p3 ) ); + + assert( CGAL::are_strictly_ordered_along_line( p5, p7, p6 ) ); + assert( CGAL::are_strictly_ordered_along_line( p6, p7, p5 ) ); + assert( CGAL::are_strictly_ordered_along_line( p2, p1, p3 ) ); + assert( !CGAL::are_strictly_ordered_along_line( p7, p6, p5 ) ); + assert( !CGAL::are_strictly_ordered_along_line( p7, p5, p6 ) ); + assert( !CGAL::are_strictly_ordered_along_line( p7, p4, p6 ) ); + assert( !CGAL::are_strictly_ordered_along_line( p2, p4, p6 ) ); + assert( CGAL::collinear_are_strictly_ordered_along_line( p5, p7, p6 ) ); + assert( CGAL::collinear_are_strictly_ordered_along_line( p6, p7, p5 ) ); + assert( CGAL::collinear_are_strictly_ordered_along_line( p2, p1, p3 ) ); + assert( !CGAL::collinear_are_strictly_ordered_along_line( p7, p6, p5 ) ); + + assert( !CGAL::are_strictly_ordered_along_line( p7, p7, p6 ) ); + assert( !CGAL::collinear_are_strictly_ordered_along_line( p5, p6, p6 ) ); + assert( CGAL::are_ordered_along_line( p7, p7, p6 ) ); + assert( CGAL::collinear_are_ordered_along_line( p5, p6, p6 ) ); + assert( CGAL::are_ordered_along_line( p6, p6, p6 ) ); + assert( CGAL::collinear_are_ordered_along_line( p5, p5, p5 ) ); + assert( !CGAL::are_strictly_ordered_along_line( p6, p6, p6 ) ); + assert( !CGAL::collinear_are_strictly_ordered_along_line( p5, p5, p5 ) ); + + std::cout << '.'; + + assert( CGAL::compare_lexicographically_yx(p1,p2) == CGAL::SMALLER ); + assert( CGAL::compare_lexicographically_yx(p2,p1) == CGAL::LARGER ); + assert( CGAL::compare_lexicographically_yx(p2,p2) == CGAL::EQUAL ); + assert( CGAL::compare_lexicographically_yx(p2,p4) == CGAL::SMALLER ); + assert( CGAL::compare_lexicographically_yx(p3,p6) == CGAL::SMALLER ); + assert( CGAL::compare_lexicographically_yx(p6,p3) == CGAL::LARGER ); + assert( CGAL::compare_lexicographically_yx(p4,p9) == CGAL::LARGER ); + + assert( CGAL::lexicographically_yx_smaller(p1,p2) ); + assert( CGAL::lexicographically_yx_smaller(p2,p4) ); + assert( CGAL::lexicographically_yx_smaller(p3,p6) ); + assert( CGAL::lexicographically_yx_smaller(p2,p4) ); + assert( CGAL::lexicographically_yx_smaller(p8,p1) ); + assert(!CGAL::lexicographically_yx_smaller(p1,p8) ); + + assert( CGAL::lexicographically_yx_larger(p2,p1) ); + assert( CGAL::lexicographically_yx_larger(p6,p3) ); + assert( CGAL::lexicographically_yx_larger(p4,p9) ); + assert( CGAL::lexicographically_yx_larger(p6,p7) ); + assert(!CGAL::lexicographically_yx_larger(p6,p8) ); + + assert( CGAL::lexicographically_yx_smaller_or_equal(p1,p2) ); + assert( CGAL::lexicographically_yx_smaller_or_equal(p3,p6) ); + assert( CGAL::lexicographically_yx_smaller_or_equal(p4,p4) ); + assert( CGAL::lexicographically_yx_smaller_or_equal(p5,p3) ); + + assert(!CGAL::lexicographically_yx_larger_or_equal(p5,p3) ); + assert( CGAL::lexicographically_yx_larger_or_equal(p3,p5) ); + assert( CGAL::lexicographically_yx_larger_or_equal(p2,p7) ); + assert( CGAL::lexicographically_yx_larger_or_equal(p7,p7) ); + assert( CGAL::lexicographically_yx_larger_or_equal(p8,p3) ); + + std::cout << '.'; + + assert( CGAL::cmp_dist_to_point(p3,p2,p1) == CGAL::LARGER ); + assert( CGAL::cmp_dist_to_point(p1,p5,p1) == CGAL::LARGER ); + assert( CGAL::cmp_dist_to_point(p4,p6,p5) == CGAL::SMALLER ); + assert( CGAL::cmp_dist_to_point(p4,p9,p1) == CGAL::SMALLER ); + assert( CGAL::cmp_dist_to_point(p8,p3,p3) == CGAL::EQUAL ); + assert( CGAL::cmp_dist_to_point(p2,p3,p3) == CGAL::EQUAL ); + assert( CGAL::cmp_dist_to_point(p2,p4,p9) == CGAL::LARGER ); + + assert( CGAL::has_larger_dist_to_point(p3,p2,p1) ); + assert( CGAL::has_larger_dist_to_point(p1,p5,p2) ); + assert( CGAL::has_larger_dist_to_point(p1,p5,p1) ); + assert(!CGAL::has_larger_dist_to_point(p1,p5,p5) ); + + assert( CGAL::has_smaller_dist_to_point(p4,p9,p1) ); + assert( CGAL::has_smaller_dist_to_point(p4,p6,p5) ); + assert( CGAL::has_smaller_dist_to_point(p9,p9,p6) ); + assert(!CGAL::has_smaller_dist_to_point(p8,p3,p3) ); + + std::cout << '.'; + + assert( CGAL::cmp_signed_dist_to_line(p1,p2, p3,p9) == CGAL::EQUAL ); + assert( CGAL::cmp_signed_dist_to_line(p1,p2, p3,p8) == CGAL::LARGER ); + assert( CGAL::cmp_signed_dist_to_line(p2,p1, p3,p8) == CGAL::SMALLER ); + assert( CGAL::cmp_signed_dist_to_line(p1,p8, p9,p8) == CGAL::LARGER ); + assert( CGAL::cmp_signed_dist_to_line(p1,p8, p9,p9) == CGAL::EQUAL ); + assert( CGAL::cmp_signed_dist_to_line(p1,p8, p5,p4) == CGAL::SMALLER ); + assert( CGAL::cmp_signed_dist_to_line(p1,p8, p4,p5) == CGAL::LARGER ); + assert( CGAL::cmp_signed_dist_to_line(p8,p1, p4,p5) == CGAL::SMALLER ); + assert( CGAL::cmp_signed_dist_to_line(p6,p4, p1,p2) == CGAL::EQUAL ); + assert( CGAL::cmp_signed_dist_to_line(p6,p4, p1,p9) == CGAL::EQUAL ); + assert( CGAL::cmp_signed_dist_to_line(p6,p8, p7,p9) == CGAL::SMALLER ); + assert( CGAL::cmp_signed_dist_to_line(p6,p8, p2,p9) == CGAL::SMALLER ); + assert( CGAL::cmp_signed_dist_to_line(p6,p8, p2,p3) == CGAL::LARGER ); + assert( CGAL::cmp_signed_dist_to_line(p6,p1, p1,p6) == CGAL::EQUAL ); + assert( CGAL::cmp_signed_dist_to_line(p6,p1, p6,p1) == CGAL::EQUAL ); + assert( CGAL::cmp_signed_dist_to_line(p6,p1, p4,p1) == CGAL::SMALLER ); + assert( CGAL::cmp_signed_dist_to_line(p6,p1, p5,p6) == CGAL::LARGER ); + assert( CGAL::cmp_signed_dist_to_line(p4,p6, p8,p6) == CGAL::LARGER ); + assert( CGAL::cmp_signed_dist_to_line(p6,p4, p8,p6) == CGAL::SMALLER ); + + assert( CGAL::has_larger_signed_dist_to_line(p1,p2, p3,p8) ); + assert( CGAL::has_larger_signed_dist_to_line(p1,p8, p9,p8) ); + assert( CGAL::has_larger_signed_dist_to_line(p6,p1, p1,p4) ); + assert( CGAL::has_larger_signed_dist_to_line(p6,p4, p6,p8) ); + + assert( CGAL::has_smaller_signed_dist_to_line(p1,p8, p5,p4) ); + assert( CGAL::has_smaller_signed_dist_to_line(p2,p1, p3,p8) ); + assert( CGAL::has_smaller_signed_dist_to_line(p6,p1, p6,p5) ); + assert( CGAL::has_smaller_signed_dist_to_line(p6,p8, p2,p9) ); + assert( CGAL::has_smaller_signed_dist_to_line(p6,p4, p8,p6) ); + + std::cout << '.'; + + std::cout << "done" << std::endl; + return true; +} +#endif // CGAL__TEST_FCT_POINT_2_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_2.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_2.h new file mode 100644 index 00000000000..957bf8ebef0 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_2.h @@ -0,0 +1,40 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_fct_point_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_POINT_2_H +#define CGAL__TEST_FCT_POINT_2_H + +#ifndef CGAL_POINT_2_H +#include +#endif // CGAL_POINT_2_H +#ifndef CGAL_PREDICATES_ON_POINTS_2_H +#include +#endif // CGAL_PREDICATES_ON_POINTS_2_H + + +template bool _test_fct_point_2(const R& ); + + +#endif // CGAL__TEST_FCT_POINT_2_H diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_3.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_3.C new file mode 100644 index 00000000000..a5a7764429f --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_3.C @@ -0,0 +1,178 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_fct_point_3.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_POINT_3_C +#define CGAL__TEST_FCT_POINT_3_C +#ifndef CGAL__TEST_FCT_POINT_3_H +#include +#endif // CGAL__TEST_FCT_POINT_3_H + +template +bool +_test_fct_point_3(const R& ) +{ + std::cout << "Testing functions Point_3" ; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + CGAL::Point_3 p1(RT(18), RT(15), RT(-21), RT(3) ); // 6,5,-7 + CGAL::Point_3 p2(RT(18), RT(15), RT( 12), RT(3) ); // 6,5,4 + CGAL::Point_3 p3(RT(18), RT(12), RT(-21), RT(3) ); // 6,4,-7 + CGAL::Point_3 p4(RT(28), RT(40), RT( 20), RT(4) ); // 7,10,5 + CGAL::Point_3 p5(RT(12), RT(-4), RT(-20), RT(4) ); // 3,-1,-5 + + assert( CGAL::compare_lexicographically_xyz(p1,p2) == CGAL::SMALLER ); + assert( CGAL::compare_lexicographically_xyz(p3,p2) == CGAL::SMALLER ); + assert( CGAL::compare_lexicographically_xyz(p3,p1) == CGAL::SMALLER ); + assert( CGAL::compare_lexicographically_xyz(p3,p2) == CGAL::SMALLER ); + assert( CGAL::compare_lexicographically_xyz(p2,p1) == CGAL::LARGER ); + assert( CGAL::compare_lexicographically_xyz(p2,p3) == CGAL::LARGER ); + assert( CGAL::compare_lexicographically_xyz(p4,p3) == CGAL::LARGER ); + assert( CGAL::compare_lexicographically_xyz(p4,p4) == CGAL::EQUAL ); + + assert( CGAL::lexicographically_xyz_smaller_or_equal(p1,p1) ); + assert( CGAL::lexicographically_xyz_smaller_or_equal(p3,p1) ); + assert( CGAL::lexicographically_xyz_smaller_or_equal(p3,p2) ); + assert( CGAL::lexicographically_xyz_smaller_or_equal(p3,p4) ); + + assert( !CGAL::lexicographically_xyz_smaller(p3,p3) ); + assert( CGAL::lexicographically_xyz_smaller(p3,p2) ); + assert( !CGAL::lexicographically_xyz_smaller(p4,p3) ); + + assert( CGAL::compare_x(p2,p3) == CGAL::EQUAL ); + assert( CGAL::compare_x(p2,p4) == CGAL::SMALLER ); + assert( CGAL::compare_x(p4,p5) == CGAL::LARGER ); + assert( CGAL::compare_y(p2,p1) == CGAL::EQUAL ); + assert( CGAL::compare_y(p3,p2) == CGAL::SMALLER ); + assert( CGAL::compare_y(p4,p5) == CGAL::LARGER ); + assert( CGAL::compare_x(p1,p3) == CGAL::EQUAL ); + assert( CGAL::compare_x(p2,p4) == CGAL::SMALLER ); + assert( CGAL::compare_x(p4,p5) == CGAL::LARGER ); + + assert( CGAL::x_equal(p1,p1) ); + assert( CGAL::x_equal(p2,p3) ); + assert( !CGAL::x_equal(p2,p4) ); + + assert( CGAL::y_equal(p1,p2) ); + assert( !CGAL::y_equal(p1,p3) ); + + assert( CGAL::z_equal(p1,p3) ); + assert( !CGAL::z_equal(p4,p5) ); + + std::cout <<'.'; + + CGAL::Point_3 p6 ( RT(6), RT(4), RT(7) ); + assert( CGAL::coplanar( p1, p2, p3, p6) ); + assert( CGAL::coplanar( p1, p1, p3, p4) ); + assert( CGAL::coplanar( p4, p1, p5, p5 + (p4-p1) ) ); + assert( !CGAL::coplanar( p4, p1, p2, p3 ) ); + + assert( !CGAL::collinear( p1, p2, p3 ) ); + assert( CGAL::collinear( p1, p2, p2 + (p2-p1) ) ); + + // ordered: arg1 - arg2 - arg3 + assert( CGAL::are_ordered_along_line( p1, p2, p2 + (p2-p1)) ); + assert( CGAL::are_ordered_along_line( p1, p2, p2) ); + assert( !CGAL::are_ordered_along_line( p1, p2 + (p2-p1), p2) ); + assert( !CGAL::are_ordered_along_line( p1, p5, p2 ) ); + assert( CGAL::are_ordered_along_line( p2, p2, p2) ); + + assert( CGAL::collinear_are_ordered_along_line( p1, p2, p2 + (p2-p1)) ); + assert( !CGAL::collinear_are_ordered_along_line( p1, p2 + (p2-p1), p2) ); + + assert( CGAL::collinear_are_ordered_along_line( p1, p1, p1)); + assert( !CGAL::collinear_are_ordered_along_line( p1, p4, p1)); + assert( !CGAL::collinear_are_ordered_along_line( p1, p3, p1)); + + // strictly ordered: ordered && args pairwise distinct + assert( CGAL::are_strictly_ordered_along_line( p1, p2, p2 + (p2-p1)) ); + assert( !CGAL::are_strictly_ordered_along_line( p1, p2, p2) ); + assert( !CGAL::are_strictly_ordered_along_line( p1, p2 + (p2-p1), p2) ); + assert( !CGAL::are_strictly_ordered_along_line( p1, p5, p2 ) ); + assert( !CGAL::are_strictly_ordered_along_line( p2, p2, p2) ); + + assert( CGAL::collinear_are_strictly_ordered_along_line(p1, p2, p2 + (p2-p1))); + assert( !CGAL::collinear_are_strictly_ordered_along_line(p1, p2, p2)); + assert( !CGAL::collinear_are_strictly_ordered_along_line(p1, p2 + (p2-p1), p2)); + assert( !CGAL::collinear_are_strictly_ordered_along_line(p1, p1, p1)); + assert( !CGAL::collinear_are_strictly_ordered_along_line(p1, p4, p1)); + + assert( CGAL::collinear( p3, p2, p3 ) ); + assert( CGAL::collinear( p2, p2, p3 ) ); + assert( CGAL::collinear( p2, p3, p3 ) ); + + std::cout << '.'; + + CGAL::Point_3 pe0( RT(1), RT(0), RT(0) ); + CGAL::Point_3 pe1( RT(0), RT(1), RT(0) ); + CGAL::Point_3 pe2( RT(0), RT(0), RT(1) ); + + assert( CGAL::orientation( CGAL::Point_3(CGAL::ORIGIN), pe0, pe1, pe2 ) \ + == CGAL::POSITIVE); + + assert( CGAL::orientation( p1, p2, p3, p6 ) == CGAL::ZERO ); + + CGAL::Point_3 p7( RT(-8), RT(0), RT(0), RT(-2) ); + CGAL::Point_3 p8( RT(8), RT(4), RT(0), RT(2) ); + CGAL::Point_3 p9( RT(0), RT(12), RT(0), RT(4) ); + + assert( CGAL::orientation( p7, p8, p9, p4) == CGAL::POSITIVE ); + assert( CGAL::orientation( p7, p9, p8, p5) == CGAL::POSITIVE ); + assert( CGAL::orientation( p7, p8, p9, p5) == CGAL::NEGATIVE ); + assert( CGAL::orientation( p8, p7, p9, p4) == CGAL::NEGATIVE ); + + std::cout <<'.'; + + CGAL::Point_3 p10( RT(0), RT(0), RT(16), RT(8) ); + +// CGAL::side_of_bounded_sphere() + assert( CGAL::side_of_bounded_sphere(p7,p8,p9,p10,p1) ==CGAL::ON_UNBOUNDED_SIDE); + assert( CGAL::side_of_bounded_sphere(p7,p9,p8,p10,p1) ==CGAL::ON_UNBOUNDED_SIDE); + CGAL::Point_3 p0(CGAL::ORIGIN); + assert( CGAL::side_of_bounded_sphere(p7,p8,p9,p10,p0) ==CGAL::ON_BOUNDED_SIDE); + CGAL::Vector_3 v001( RT(0), RT(0), RT(1) ); + CGAL::Vector_3 v010( RT(0), RT(1), RT(0) ); + CGAL::Vector_3 v100( RT(1), RT(0), RT(0) ); + assert( CGAL::side_of_bounded_sphere(p3 + v001, p3-v001, p3+v010, p3-v100, \ + p3 - v010) == CGAL::ON_BOUNDARY ); +// CGAL::side_of_bounded_sphere() is further tested in +// _test_fct_points_implicit_sphere(const R& ) + + std::cout <<'&'; + + assert( CGAL::cmp_dist_to_point(p3, p3 + v001, p3+v010) == CGAL::EQUAL ); + assert( CGAL::cmp_dist_to_point(p0, p1, p2) == CGAL::LARGER ); + assert( CGAL::cmp_dist_to_point(p0, p3, p1) == CGAL::SMALLER ); + assert( CGAL::cmp_dist_to_point(p1, p3, p5) == CGAL::SMALLER ); + assert( CGAL::has_larger_dist_to_point(p0, p1, p2) ); + assert( CGAL::has_larger_dist_to_point(p3, p5, p1) ); + assert( CGAL::has_smaller_dist_to_point(p0, p2, p1) ); + assert( CGAL::has_smaller_dist_to_point(p3, p1, p5) ); + + std::cout << "done" << std::endl; + return true; +} +#endif // CGAL__TEST_FCT_POINT_3_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_3.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_3.h new file mode 100644 index 00000000000..45d158dab4b --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_3.h @@ -0,0 +1,40 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_fct_point_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_POINT_3_H +#include +#endif // CGAL_POINT_3_H +#ifndef CGAL_VECTOR_3_H +#include +#endif // CGAL_VECTOR_3_H +#ifndef CGAL_PREDICATES_ON_POINTS_3_H +#include +#endif // CGAL_PREDICATES_ON_POINTS_3_H +#include + + +template bool _test_fct_point_3(const R& ); + + diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_conversion.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_conversion.C new file mode 100644 index 00000000000..aea77ecd0cb --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_conversion.C @@ -0,0 +1,85 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_misc.fw +// file : _test_fct_point_conversion.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_POINT_CONVERSION_C +#define CGAL__TEST_FCT_POINT_CONVERSION_C + +#ifndef CGAL__TEST_FCT_POINT_CONVERSION_H +#include +#endif // CGAL__TEST_FCT_POINT_CONVERSION_H + +template +bool +_test_fct_point_conversion(const NT& ) +{ + std::cout << "Testing Point Conversion Functions" ; + + typedef CGAL::Homogeneous H; + typedef CGAL::Cartesian C; + typedef CGAL::Cartesian > QC; + + typedef CGAL::Point_2< H > PtH2; + typedef CGAL::Point_2< C > PtC2; + typedef CGAL::Point_2< QC> PtQC2; + typedef CGAL::Point_3< H > PtH3; + typedef CGAL::Point_3< C > PtC3; + typedef CGAL::Point_3< QC> PtQC3; + + // NT n0 = NT(0); + // NT n1 = NT(1); + NT n3 = NT(3); + NT n5 = NT(5); + NT n10 = NT(10); + NT n15 = NT(15); + NT n25 = NT(25); + NT n50 = NT(50); + CGAL::Quotient q3(n3); + CGAL::Quotient q5(n5); + CGAL::Quotient q10(n10); + + PtH2 ph2(n25, n15, n5); + PtC2 pc2(n25, n15, n5); + PtQC2 pq2(q5, q3); + PtH3 ph3(n50, n25, n15, n5); + PtC3 pc3(n50, n25, n15, n5); + PtQC3 pq3(q10, q5, q3); + + std::cout << '.'; + + assert( CGAL::homogeneous_to_cartesian(ph2) == pc2 ); + assert( CGAL::cartesian_to_homogeneous(pc2) == ph2 ); + assert( CGAL::homogeneous_to_quotient_cartesian(ph2) == pq2); + assert( CGAL::quotient_cartesian_to_homogeneous(pq2) == ph2); + std::cout << '.'; + + assert( CGAL::homogeneous_to_cartesian(ph3) == pc3 ); + assert( CGAL::cartesian_to_homogeneous(pc3) == ph3 ); + assert( CGAL::homogeneous_to_quotient_cartesian(ph3) == pq3); + assert( CGAL::quotient_cartesian_to_homogeneous(pq3) == ph3); + + std::cout << "done" << std::endl; + return true; +} +#endif // CGAL__TEST_FCT_POINT_CONVERSION_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_conversion.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_conversion.h new file mode 100644 index 00000000000..321c8cdebb5 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_conversion.h @@ -0,0 +1,39 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_misc.fw +// file : _test_fct_point_conversion.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_POINT_CONVERSION_H +#define CGAL__TEST_FCT_POINT_CONVERSION_H +#include +#include +#include +#include +#include +#include + + +template bool _test_fct_point_conversion(const NT& ); + + +#endif // CGAL__TEST_FCT_POINT_CONVERSION_H diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_line_2.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_line_2.C new file mode 100644 index 00000000000..1bea0e1c5a0 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_line_2.C @@ -0,0 +1,147 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_fct_point_line_2.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_POINT_2_LINE_2_C +#define CGAL__TEST_FCT_POINT_2_LINE_2_C +#ifndef CGAL__TEST_FCT_POINT_LINE_2_H +#include +#endif // CGAL__TEST_FCT_POINT_LINE_2_H + +template +bool +_test_fct_point_line_2(const R& ) +{ + std::cout << "Testing functions Point_2 Line_2" ; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + RT n0 = 0; + RT n1 = 1; + RT n2 = 2; + RT n3 = 3; + RT n4 = 4; + RT n5 = 5; + RT n6 = 6; + RT n7 = 7; + RT n8 = 8; + RT n9 = 9; + RT n10= 10; + RT n12= 12; + RT n20= 20; + + CGAL::Point_2 p1( n2, n8, n2); // ( 1, 4) + CGAL::Point_2 p2( n4, n4, n2); // ( 2, 2) + CGAL::Point_2 p3(n12,n10, n2); // ( 6, 5) + CGAL::Point_2 p4( n7, n3); // ( 7, 3) + CGAL::Point_2 p5( n9, n0, n3); // ( 3, 0) + CGAL::Point_2 p6(n12,n20, n4); // ( 3, 5) + CGAL::Point_2 p7(n12, n3, n3); // ( 4, 1) + CGAL::Point_2 p8( n8, n4); // ( 8, 4) + CGAL::Point_2 p9(-n4, n8, n4); // (-1, 2) + CGAL::Point_2 p10(n10, n4, n2); // ( 5, 2) + + CGAL::Point_2 p11( n1, -n5,-n1); // (-1, 5) + CGAL::Point_2 p0( CGAL::ORIGIN ); // ( 0, 0) + CGAL::Point_2 p13( n8, n8, n4); // ( 4, 4) + CGAL::Point_2 p14( n5,-n1); // ( 5,-1) + CGAL::Point_2 p16(n12, n9, n3); // ( 4, 3) + CGAL::Point_2 p17( n0,n1); // ( 0, 1) + + CGAL::Line_2 l14( p1, p4 ); + CGAL::Line_2 l23( p2, p3 ); + CGAL::Line_2 l67( p6, p7 ); + CGAL::Line_2 l58( p5, p8 ); + CGAL::Line_2 l1617( p16, p17); + CGAL::Line_2 l1114( p11, p14); + CGAL::Line_2 l1716( p17, p16); + CGAL::Line_2 l1411( p14, p11); + CGAL::Line_2 l013( p0, p13 ); + CGAL::Line_2 l910( p9, p10 ); + + std::cout << '.'; + + assert( CGAL::compare_x( p16, p14 ) == CGAL::SMALLER ); + + assert( CGAL::compare_x( p9, l14, l23) == CGAL::SMALLER ); + assert( CGAL::compare_x( p8, l14, l23) == CGAL::LARGER ); + assert( CGAL::compare_x( p2, l1617, l910) == CGAL::EQUAL ); + assert( CGAL::compare_x( p2, l1716, l910) == CGAL::EQUAL ); + assert( CGAL::compare_x( p2, l1114, l013) == CGAL::EQUAL ); + + assert( CGAL::compare_y( p6, l14, l23 ) == CGAL::LARGER ); + assert( CGAL::compare_y( p9, l14, l23 ) == CGAL::SMALLER ); + assert( CGAL::compare_x( p2, l1411, l013) == CGAL::EQUAL ); + assert( CGAL::compare_x( p2, l1716, l013) == CGAL::EQUAL ); + + std::cout << '.'; + + assert( CGAL::compare_x( l14, l23, l58 ) == CGAL::SMALLER); + assert( CGAL::compare_x( l14, l58, l23 ) == CGAL::LARGER); + assert( CGAL::compare_x( l14, l58, l58 ) == CGAL::EQUAL); + assert( CGAL::compare_x( l1114, l013, l910 ) == CGAL::EQUAL); + assert( CGAL::compare_x( l1617, l910, l013 ) == CGAL::EQUAL); + + assert( CGAL::compare_y( l14, l58, l23 ) == CGAL::SMALLER); + assert( CGAL::compare_y( l14, l23, l58 ) == CGAL::LARGER); + assert( CGAL::compare_y( l14, l58, l58 ) == CGAL::EQUAL); + assert( CGAL::compare_y( l1114, l013, l910 ) == CGAL::EQUAL); + assert( CGAL::compare_y( l1617, l910, l013 ) == CGAL::EQUAL); + + assert( CGAL::compare_x( l14, l23, l67, l58 ) == CGAL::SMALLER); + assert( CGAL::compare_x( l67, l58, l23, l14 ) == CGAL::LARGER); + assert( CGAL::compare_x( l1114, l1617, l910, l013 ) == CGAL::EQUAL); + + assert( CGAL::compare_y( l14, l23, l67, l58 ) == CGAL::LARGER); + assert( CGAL::compare_y( l67, l58, l23, l14 ) == CGAL::SMALLER); + assert( CGAL::compare_y( l1114, l1617, l910, l013 ) == CGAL::EQUAL); + + std::cout << '.'; + + assert( CGAL::compare_y_at_x( p6, l23 ) == CGAL::LARGER ); + assert( CGAL::compare_y_at_x( p6, l23.opposite() ) == CGAL::LARGER ); + assert( CGAL::compare_y_at_x( p10, l23 ) == CGAL::SMALLER ); + assert( CGAL::compare_y_at_x( p9, l23 ) == CGAL::LARGER ); + assert( CGAL::compare_y_at_x( p17, l910 ) == CGAL::SMALLER ); + assert( CGAL::compare_y_at_x( p0, l23 ) == CGAL::SMALLER ); + assert( CGAL::compare_y_at_x( p8, l58 ) == CGAL::EQUAL ); + assert( CGAL::compare_y_at_x( p2, l1617 ) == CGAL::EQUAL ); + + assert( CGAL::compare_y_at_x( l14, l23, l58 ) == CGAL::LARGER ); + assert( CGAL::compare_y_at_x( l67, l58, l23 ) == CGAL::SMALLER ); + assert( CGAL::compare_y_at_x( l910, l1716, l1114) == CGAL::EQUAL); + + assert( CGAL::compare_y_at_x( l14, l23, l58, l67 ) == CGAL::SMALLER ); + assert( CGAL::compare_y_at_x( l14, l23, l67, l58 ) == CGAL::LARGER ); + assert( CGAL::compare_y_at_x( l14, l23, l1411, l1114 ) == CGAL::EQUAL ); + assert( CGAL::compare_y_at_x( l1617, l013, l910, l67 ) == CGAL::SMALLER); + assert( CGAL::compare_y_at_x( l1617, l013, l67, l910 ) == CGAL::LARGER); + assert( CGAL::compare_y_at_x( l1617, l013, l1114, l910 ) == CGAL::EQUAL); + assert( CGAL::compare_y_at_x( l1617, l013, l910, l1114 ) == CGAL::EQUAL); + + std::cout << "done" << std::endl; + return true; +} +#endif // CGAL__TEST_FCT_POINT_2_LINE_2_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_line_2.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_line_2.h new file mode 100644 index 00000000000..e3819a68a0f --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_line_2.h @@ -0,0 +1,44 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_fct_point_line_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_POINT_2_LINE_2_H +#define CGAL__TEST_FCT_POINT_2_LINE_2_H + +#ifndef CGAL_POINT_2_H +#include +#endif // CGAL_POINT_2_H +#ifndef CGAL_LINE_2_H +#include +#endif // CGAL_LINE_2_H +#ifndef CGAL_PREDICATES_ON_LINES_2_H +#include +#endif // CGAL_PREDICATES_ON_LINES_2_H + + +template bool _test_fct_point_line_2(const R& ); + + + +#endif // CGAL__TEST_FCT_POINT_2_LINE_2_H diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_vector_2.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_vector_2.C new file mode 100644 index 00000000000..3075c91c388 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_vector_2.C @@ -0,0 +1,78 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_fct_point_vector_2.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_POINT_VECTOR_2_C +#define CGAL__TEST_FCT_POINT_VECTOR_2_C +#ifndef CGAL__TEST_FCT_POINT_VECTOR_2_H +#include +#endif // CGAL__TEST_FCT_POINT_VECTOR_2_H + +template +bool +_test_fct_point_vector_2(const R& ) +{ + std::cout << "Testing functions Point_2 Vector_2" ; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + RT n1( 12 ); + RT n2( -4 ); + RT n3( 6 ); + RT n4( 2 ); + RT n5( 9 ); + RT n6(-18 ); + RT n7( 36 ); + RT n8( 3 ); + RT n9( 15 ); + RT n10( -8 ); + + CGAL::Vector_2 v0(CGAL::NULL_VECTOR); + CGAL::Vector_2 v1(n1, n2, n4); + CGAL::Vector_2 v2(n5, n6, n8); + CGAL::Vector_2 v3(n5, n10); + CGAL::Vector_2 v4(n8, -n2); + + std::cout << '.'; + + CGAL::Point_2 p0(CGAL::ORIGIN); + CGAL::Point_2 p1 = CGAL::ORIGIN + v1; + CGAL::Point_2 p2 = CGAL::ORIGIN + v2; + CGAL::Point_2 p3 = CGAL::ORIGIN + v3; + + assert( CGAL::ORIGIN + v2 == CGAL::Point_2( n5, n6, n8) ); + assert( CGAL::ORIGIN - v2 == CGAL::Point_2( -n5, -n6, n8) ); + assert( p1 - p1 == v0 ); + assert( p1 - p0 == p1 - CGAL::ORIGIN); + assert( p1 - p2 == v4 ); + assert( p2 + v4 == p1 ); + assert( p3 - v1 == p2 ); + assert( p3 - p1 == v2 ); + + std::cout << ".."; + std::cout << "done" << std::endl; + return true; +} +#endif // CGAL__TEST_FCT_POINT_VECTOR_2_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_vector_2.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_vector_2.h new file mode 100644 index 00000000000..e0cf032ff7f --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_vector_2.h @@ -0,0 +1,40 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_fct_point_vector_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_POINT_VECTOR_2_H +#define CGAL__TEST_FCT_POINT_VECTOR_2_H + +#ifndef CGAL_POINT_2_H +#include +#endif // CGAL_POINT_2_H +#ifndef CGAL_VECTOR_2_H +#include +#endif // CGAL_VECTOR_2_H + + +template bool _test_fct_point_vector_2(const R& ); + + +#endif // CGAL__TEST_FCT_POINT_VECTOR_2_H diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_vector_3.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_vector_3.C new file mode 100644 index 00000000000..11b4bd27f35 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_vector_3.C @@ -0,0 +1,78 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_fct_point_vector_3.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_POINT_VECTOR_3_C +#define CGAL__TEST_FCT_POINT_VECTOR_3_C +#ifndef CGAL__TEST_FCT_POINT_VECTOR_3_H +#include +#endif // CGAL__TEST_FCT_POINT_VECTOR_3_H + +template +bool +_test_fct_point_vector_3(const R& ) +{ + std::cout << "Testing functions Point_3 Vector_3" ; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + RT n1( 12 ); + RT n2( -4 ); + RT n3( 6 ); + RT n4( 2 ); + RT n5( 9 ); + RT n6(-18 ); + RT n7( 36 ); + RT n8( 3 ); + RT n9( 15 ); + RT n10( -8 ); + + CGAL::Vector_3 v0(CGAL::NULL_VECTOR); + CGAL::Vector_3 v1(n1, n2, n3, n4); + CGAL::Vector_3 v2(n5, n6, n7, n8); + CGAL::Vector_3 v3(n5, n10, n9); + CGAL::Vector_3 v4(n8, -n2, -n5); + + std::cout << '.'; + + CGAL::Point_3 p0(CGAL::ORIGIN); + CGAL::Point_3 p1 = CGAL::ORIGIN + v1; + CGAL::Point_3 p2 = CGAL::ORIGIN + v2; + CGAL::Point_3 p3 = CGAL::ORIGIN + v3; + + assert( CGAL::ORIGIN + v2 == CGAL::Point_3( n5, n6, n7, n8) ); + assert( CGAL::ORIGIN - v2 == CGAL::Point_3( -n5, -n6, -n7, n8) ); + assert( p1 - p1 == v0 ); + assert( p1 - p0 == p1 - CGAL::ORIGIN); + assert( p1 - p2 == v4 ); + assert( p2 + v4 == p1 ); + assert( p3 - v1 == p2 ); + assert( p3 - p1 == v2 ); + + std::cout << ".."; + std::cout << "done" << std::endl; + return true; +} +#endif // CGAL__TEST_FCT_POINT_VECTOR_3_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_vector_3.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_vector_3.h new file mode 100644 index 00000000000..2c136e8e661 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_point_vector_3.h @@ -0,0 +1,36 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_fct_point_vector_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_POINT_3_H +#include +#endif // CGAL_POINT_3_H +#ifndef CGAL_VECTOR_3_H +#include +#endif // CGAL_VECTOR_3_H + + +template bool _test_fct_point_vector_3(const R& ); + + diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_points_implicit_sphere.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_points_implicit_sphere.C new file mode 100644 index 00000000000..e9a79c5c885 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_points_implicit_sphere.C @@ -0,0 +1,182 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : +// file : _test_fct_points_implicit_sphere.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_POINTS_IMPLICIT_SPHERE_C +#define CGAL__TEST_FCT_POINTS_IMPLICIT_SPHERE_C + +#ifndef CGAL__TEST_FCT_POINTS_IMPLICIT_SPHERE_H +#include +#endif // CGAL__TEST_FCT_POINTS_IMPLICIT_SPHERE_H + + +template +bool +_test_fct_points_implicit_sphere(const R&) +{ + typedef typename R::RT RT; + typedef typename R::FT FT; + const RT RT0(0); + const RT RT4(4); + const FT FT1(1); + const RT RT1(1); + CGAL::Point_3 org( RT0, RT0, RT0); + CGAL::Point_3 p( RT0, RT1, RT0); + CGAL::Point_3 q( RT0, RT0, RT1); + CGAL::Point_3 r( RT1, RT0, RT0); + CGAL::Point_3 s( RT0, RT1, RT0); + CGAL::Point_3 out( RT4, RT4, RT1); + + + RT sin; + RT cos; + RT den; + RT num = RT1; + RT eps = RT(100); + + CGAL::rational_rotation_approximation( RT(12), RT(23), + sin, cos, den, + num, eps ); + CGAL::Aff_transformation_3 rot_z( cos, sin, RT0, RT0, + -sin, cos, RT0, RT0, + RT0, RT0, den, RT0, + den ); + + CGAL::rational_rotation_approximation( RT(17), RT(4), + sin, cos, den, + num, eps ); + CGAL::Aff_transformation_3 rot_y( cos, RT0, sin, RT0, + RT0, den, RT0, RT0, + -sin, RT0, cos, RT0, + den ); + + CGAL_kernel_assertion( CGAL::squared_distance( p, org ) == FT1 ); + CGAL::Point_3 tpt = p.transform(rot_z); + CGAL_kernel_assertion( CGAL::squared_distance( tpt, org ) == FT1 ); + p = tpt.transform(rot_z); + CGAL_kernel_assertion( CGAL::squared_distance( p, org ) == FT1 ); + + CGAL::rational_rotation_approximation( RT(35), RT(-8), + sin, cos, den, + num, eps ); + CGAL::Aff_transformation_3 rot_x( den, RT0, RT0, RT0, + RT0, cos, sin, RT0, + RT0,-sin, cos, RT0, + den ); + + CGAL_kernel_assertion( CGAL::squared_distance( q, org ) == FT1 ); + tpt = q.transform(rot_x); + CGAL_kernel_assertion( CGAL::squared_distance( tpt, org ) == FT1 ); + q = tpt.transform(rot_y); + CGAL_kernel_assertion( CGAL::squared_distance( q, org ) == FT1 ); + + CGAL::rational_rotation_approximation( RT(9), RT(-8), + sin, cos, den, + num, eps ); + rot_y = CGAL::Aff_transformation_3( cos, RT0, sin, RT0, + RT0, den, RT0, RT0, + -sin, RT0, cos, RT0, + den ); + + CGAL_kernel_assertion( CGAL::squared_distance( r, org ) == FT1 ); + tpt = r.transform(rot_z); + CGAL_kernel_assertion( CGAL::squared_distance( tpt, org ) == FT1 ); + r = tpt.transform(rot_y); + CGAL_kernel_assertion( CGAL::squared_distance( r, org ) == FT1 ); + + CGAL::rational_rotation_approximation( RT(-19), RT(-1), + sin, cos, den, + num, eps ); + rot_z = CGAL::Aff_transformation_3( cos, sin, RT0, RT0, + -sin, cos, RT0, RT0, + RT0, RT0, den, RT0, + den ); + CGAL_kernel_assertion( CGAL::squared_distance( s, org ) == FT1 ); + tpt = s.transform(rot_z); + CGAL_kernel_assertion( CGAL::squared_distance( tpt, org ) == FT1 ); + s = tpt.transform(rot_x); + CGAL_kernel_assertion( CGAL::squared_distance( s, org ) == FT1 ); + + + assert( CGAL::side_of_oriented_sphere(p,q,r,s,p) \ + == CGAL::ON_ORIENTED_BOUNDARY); + assert( CGAL::orientation(p,r,q,s) == CGAL::POSITIVE ); + assert( CGAL::side_of_oriented_sphere(p,r,q,s,org) \ + == CGAL::ON_POSITIVE_SIDE); + assert( CGAL::side_of_oriented_sphere(p,q,r,s,org) \ + == CGAL::ON_NEGATIVE_SIDE); + assert( CGAL::side_of_bounded_sphere(p,q,r,s,org) \ + == CGAL::ON_BOUNDED_SIDE); + assert( CGAL::side_of_bounded_sphere(p,r,q,s,org) \ + == CGAL::ON_BOUNDED_SIDE); + assert( CGAL::side_of_bounded_sphere(p,q,r,s,q) \ + == CGAL::ON_BOUNDARY); + assert( CGAL::side_of_bounded_sphere(p,q,r,s,out) \ + == CGAL::ON_UNBOUNDED_SIDE); + assert( CGAL::side_of_bounded_sphere(p,r,q,s,out) \ + == CGAL::ON_UNBOUNDED_SIDE); + + CGAL::Point_3 ex( RT1, RT0, RT0); + CGAL::Point_3 ey( RT0, RT1, RT0); + CGAL::Point_3 ez( RT0, RT0, RT1); + CGAL::Point_3 oz( RT0, RT0, -RT1); + assert( CGAL::circumcenter(ex, ey, ez, oz) == org ); + assert( CGAL::circumcenter(p,q,r,s) == org ); + assert( CGAL::circumcenter(p,r,q,s) == org ); + + CGAL::Vector_3 v( RT(12), RT(4), RT(-4), RT(2) ); + CGAL::Point_3 pt = p + v; + CGAL::Point_3 qt = q + v; + CGAL::Point_3 rt = r + v; + CGAL::Point_3 st = s + v; + CGAL::Point_3 c = org + v; + CGAL::Point_3 ot= out + v; + + assert( CGAL::side_of_oriented_sphere(pt,qt,rt,st,pt) \ + == CGAL::ON_ORIENTED_BOUNDARY); + assert( CGAL::orientation(pt,rt,qt,st) == CGAL::POSITIVE ); + assert( CGAL::side_of_oriented_sphere(pt,rt,qt,st,c) \ + == CGAL::ON_POSITIVE_SIDE); + assert( CGAL::side_of_oriented_sphere(pt,qt,rt,st,c) \ + == CGAL::ON_NEGATIVE_SIDE); + assert( CGAL::side_of_bounded_sphere(pt,qt,rt,st,c) \ + == CGAL::ON_BOUNDED_SIDE); + assert( CGAL::side_of_bounded_sphere(pt,rt,qt,st,c) \ + == CGAL::ON_BOUNDED_SIDE); + assert( CGAL::side_of_bounded_sphere(pt,qt,rt,st,qt) \ + == CGAL::ON_BOUNDARY); + assert( CGAL::side_of_bounded_sphere(pt,qt,rt,st,ot) \ + == CGAL::ON_UNBOUNDED_SIDE); + assert( CGAL::side_of_bounded_sphere(pt,rt,qt,st,ot) \ + == CGAL::ON_UNBOUNDED_SIDE); + + assert( CGAL::circumcenter(pt,qt,rt,st) == c ); + assert( CGAL::circumcenter(pt,rt,qt,st) == c ); + + + return true; +} + + +#endif // CGAL__TEST_FCT_POINTS_IMPLICIT_SPHERE_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_points_implicit_sphere.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_points_implicit_sphere.h new file mode 100644 index 00000000000..b641c71e7ac --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_points_implicit_sphere.h @@ -0,0 +1,43 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : +// file : _test_fct_points_implicit_sphere.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_POINTS_IMPLICIT_SPHERE_H +#define CGAL__TEST_FCT_POINTS_IMPLICIT_SPHERE_H + +#include +#include +#include +#include +#include + + +template bool _test_fct_points_implicit_sphere(const R&); + + +#ifdef CGAL_CFG_NO_AUTOMATIC_TEMPLATE_INCLUSION +#include +#endif // CGAL_CFG_NO_AUTOMATIC_TEMPLATE_INCLUSION + +#endif // CGAL__TEST_FCT_POINTS_IMPLICIT_SPHERE_H diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_vector_2.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_vector_2.C new file mode 100644 index 00000000000..2c5996be044 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_vector_2.C @@ -0,0 +1,130 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_fct_vector_2.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_VECTOR_2_C +#define CGAL__TEST_FCT_VECTOR_2_C +#ifndef CGAL__TEST_FCT_VECTOR_2_H +#include +#endif // CGAL__TEST_FCT_VECTOR_2_H + +template +bool +_test_fct_vector_2(const R& ) +{ + std::cout << "Testing functions Vector_2" ; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + RT n1( 12 ); + RT n2( -4 ); + RT n3( 6 ); + RT n4( 2 ); + RT n5( 9 ); + RT n6(-18 ); + RT n7( 36 ); + RT n8( 3 ); + RT n9( 15 ); + RT n10( -8 ); + RT n11( 24 ); + + CGAL::Vector_2 v0(CGAL::NULL_VECTOR); // ( 0, 0) + CGAL::Vector_2 v1(n1, n2, n4); // ( 6,-2) + CGAL::Vector_2 v2(n5, n6, n8); // ( 3,-6) + CGAL::Vector_2 v3(n5, n10); // ( 9,-8) + CGAL::Vector_2 v4(n8, -n2 ); // ( 3, 4) + CGAL::Vector_2 mv4(-n8, n2 ); // (-3,-4) + + RT n15( -5 ); + CGAL::Vector_2 v8( n1, n3, -n4); // (-6,-3) + CGAL::Vector_2 v9( RT(0), n15); // ( 0,-5) + CGAL::Vector_2 v10( n8,-n2, n4); // (1.5,2) + CGAL::Vector_2 v11(-n6, n11, n8); // ( 6, 8) + + + assert( v1 + v2 == v3 ); + assert( v1 - v2 == v4 ); + assert( v3 - v1 == v2 ); + assert( v3 - v2 == v1 ); + assert( v4 + v2 == v1 ); + assert( v4 + v2 == v3 - v2); + assert( v9 == v1 + v8 ); + + std::cout << '.'; + + assert( (-(- v1)) == v1 ); + assert( -v4 == mv4); + assert( mv4 == v2 - v1); + assert( -( v1 - v2) == mv4); + assert( v1 + v0 == v1 ); + assert( v0 - v4 == mv4 ); + assert( v0 + v4 == v4 ); + assert( v2 - v0 == v2 ); + + std::cout << '.'; + +// no multiplication scalar * vector ( only from the right side ) + assert( v1 * v2 == FT(30) ); + assert( v1 * v0 == FT(0) ); + assert( CGAL::Vector_2( n1, n2) == v1 * RT(2)); + assert( CGAL::Vector_2( n5, n6) == v2 * RT(3)); + assert( v2 / RT(3) == CGAL::Vector_2( RT(1), -n4) ); + assert( (v2 * RT(3)) / RT(3) == v2 ); + assert( (v2 / RT(3)) * RT(3) == v2 ); + +#ifdef CGAL_VECTOR_MULTIPLICATION_FROM_LEFT + assert( CGAL::Vector_2( n1, n2) == RT(2) * v1 ); + assert( (CGAL::Vector_2&)(RT(2) * v1) == CGAL::Vector_2( n1, n2) ); + assert( CGAL::Vector_2( n5, n6) == RT(3) * v2 ); +#endif // CGAL_VECTOR_MULTIPLICATION_FROM_LEFT + + assert( (v4 / (FT(n1)/FT(n3))) == v10 ); + assert( (v4 * (FT(n1)/FT(n3))) == v11 ); + assert( (v4 / (FT(n3)/FT(n1))) == v11 ); + assert( (v4 * (FT(n3)/FT(n1))) == v10 ); + + std::cout << '.'; + + assert( v2.cartesian(0) == v2[0] ); + assert( v2.cartesian(1) == v2[1] ); + + CGAL::Point_2 p0(CGAL::ORIGIN); + CGAL::Point_2 p1 = CGAL::ORIGIN + v1; + CGAL::Point_2 p2 = CGAL::ORIGIN + v2; + CGAL::Point_2 p3 = CGAL::ORIGIN + v3; + + assert( CGAL::ORIGIN + v2 == CGAL::Point_2( n5, n6, n8) ); + assert( CGAL::ORIGIN - v2 == CGAL::Point_2( -n5, -n6, n8) ); + assert( p1 - p1 == v0 ); + assert( p1 - p0 == p1 - CGAL::ORIGIN); + assert( p1 - p2 == v4 ); + assert( p2 + v4 == p1 ); + assert( p3 - v1 == p2 ); + assert( p3 - p1 == v2 ); + + std::cout << "done" << std::endl; + return true; +} +#endif // CGAL__TEST_FCT_VECTOR_2_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_vector_2.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_vector_2.h new file mode 100644 index 00000000000..35afdeff830 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_vector_2.h @@ -0,0 +1,37 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_fct_vector_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_VECTOR_2_H +#define CGAL__TEST_FCT_VECTOR_2_H + +#ifndef CGAL_VECTOR_2_H +#include +#endif // CGAL_VECTOR_2_H + + +template bool _test_fct_vector_2(const R& ); + + +#endif // CGAL__TEST_FCT_VECTOR_2_H diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_vector_3.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_vector_3.C new file mode 100644 index 00000000000..1629831a674 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_vector_3.C @@ -0,0 +1,150 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_fct_vector_3.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_VECTOR_3_C +#define CGAL__TEST_FCT_VECTOR_3_C +#ifndef CGAL__TEST_FCT_VECTOR_3_H +#include +#endif // CGAL__TEST_FCT_VECTOR_3_H + +template +bool +_test_fct_vector_3(const R& ) +{ + std::cout << "Testing functions Vector_3" ; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + RT n0( 0 ); + RT n1( 12 ); + RT n2( -4 ); + RT n3( 6 ); + RT n4( 2 ); + RT n5( 9 ); + RT n6(-18 ); + RT n7( 36 ); + RT n8( 3 ); + RT n9( 15 ); + RT n10( -8 ); + RT n11( 24 ); + RT n12( 54 ); + + + CGAL::Vector_3 v0(CGAL::NULL_VECTOR); // ( 0, 0, 0) + CGAL::Vector_3 v1(n1, n2, n3, n4); // ( 6,-2, 3) + CGAL::Vector_3 v2(n5, n6, n7, n8); // ( 3,-6,12) + CGAL::Vector_3 v3(n5, n10, n9); // ( 9,-8,15) + CGAL::Vector_3 v4(n8, -n2, -n5); // ( 3, 4,-9) + CGAL::Vector_3 mv4(-n8, n2, n5); // (-3,-4, 9) + + CGAL::Vector_3 v10( n8,-n2,-n5, n4); // (1.5,2,-4.5) + CGAL::Vector_3 v11(-n6, n11,-n12, n8);// ( 6, 8, -18) + + assert( v1 + v2 == v3 ); + assert( v1 - v2 == v4 ); + assert( v3 - v1 == v2 ); + assert( v3 - v2 == v1 ); + assert( v4 + v2 == v1 ); + assert( v4 + v2 == v3 - v2); + + std::cout << '.'; + + assert( (-(- v1)) == v1 ); + assert( -v4 == mv4); + assert( mv4 == v2 - v1); + assert( -( v1 - v2) == mv4); + assert( v1 + v0 == v1 ); + assert( v0 - v4 == mv4 ); + assert( v0 + v4 == v4 ); + assert( v2 - v0 == v2 ); + + std::cout << '.'; + +#ifdef CGAL_VECTOR_WRAPPER + assert( FT(v1 * v2) == FT(66) ); + assert( FT(v1 * v0) == FT(0) ); + assert( CGAL::Vector_3( n1, n2, n3) == RT(2) * v1 ); + assert( CGAL::Vector_3( n5, n6, n7) == RT(3) * v2 ); + assert( v2 / RT(3) == CGAL::Vector_3( RT(1), -n4, -n2) ); + assert( (CGAL::Vector_3&)(RT(3) * (v2 / RT(3))) == v2 ); + assert( (v2 * RT(3)) / RT(3) == v2 ); +#else // no multiplication scalar * vector ( only from the right side ) + assert( v1 * v2 == FT(66) ); + assert( v1 * v0 == FT(0) ); + assert( CGAL::Vector_3( n1, n2, n3) == v1 * RT(2)); + assert( CGAL::Vector_3( n5, n6, n7) == v2 * RT(3)); + assert( v2 / RT(3) == CGAL::Vector_3( RT(1), -n4, -n2) ); + assert( (v2 * RT(3)) / RT(3) == v2 ); + assert( (v2 / RT(3)) * RT(3) == v2 ); +#endif // CGAL_VECTOR_WRAPPER + + assert( (v4 / (FT(n1)/FT(n3))) == v10 ); + assert( (v4 * (FT(n1)/FT(n3))) == v11 ); + assert( (v4 / (FT(n3)/FT(n1))) == v11 ); + assert( (v4 * (FT(n3)/FT(n1))) == v10 ); + + std::cout << '.'; + + assert( v2.cartesian(0) == v2[0] ); + assert( v2.cartesian(1) == v2[1] ); + assert( v2.cartesian(2) == v2[2] ); + + + CGAL::Point_3 p0(CGAL::ORIGIN); + CGAL::Point_3 p1 = CGAL::ORIGIN + v1; + CGAL::Point_3 p2 = CGAL::ORIGIN + v2; + CGAL::Point_3 p3 = CGAL::ORIGIN + v3; + + assert( CGAL::ORIGIN + v2 == CGAL::Point_3( n5, n6, n7, n8) ); + assert( CGAL::ORIGIN - v2 == CGAL::Point_3( -n5, -n6, -n7, n8) ); + assert( p1 - p1 == v0 ); + assert( p1 - p0 == p1 - CGAL::ORIGIN); + assert( p1 - p2 == v4 ); + assert( p2 + v4 == p1 ); + assert( p3 - v1 == p2 ); + assert( p3 - p1 == v2 ); + + std::cout << '.'; + + CGAL::Vector_3 evx( n5, n0, n0, n5); + CGAL::Vector_3 evy( n0, n5, n0, n5); + CGAL::Vector_3 evz( n0, n0, n5, n5); + assert( CGAL::cross_product(evx,evy) == evz ); + assert( CGAL::cross_product(evy,evx) == - evz ); + RT ns1(90); + RT ns2(189); + RT ns3(60); + RT ns4(126); + CGAL::Vector_3 vs1(-n6,ns2,ns1,-n8); // (-6,-63,-30) + assert( CGAL::cross_product(v1,v2) == vs1 ); + CGAL::Vector_3 vs2(n1,ns4,ns3,n4); // (6,63,30) + assert( CGAL::cross_product(v1,v4) == vs2 ); + assert( CGAL::cross_product(v1,mv4) == - vs2 ); + + std::cout << "done" << std::endl; + return true; +} +#endif // CGAL__TEST_FCT_VECTOR_3_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_vector_3.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_vector_3.h new file mode 100644 index 00000000000..acdd52a6a66 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fct_vector_3.h @@ -0,0 +1,33 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_fct_vector_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_VECTOR_3_H +#include +#endif // CGAL_VECTOR_3_H + + +template bool _test_fct_vector_3(const R& ); + + diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fctobj_point_line_2.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fctobj_point_line_2.C new file mode 100644 index 00000000000..033c3ce7923 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_fctobj_point_line_2.C @@ -0,0 +1,396 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : news.fw +// file : _test_fctobj_point_line_2.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCTOBJ_POINT_LINE_2_C +#define CGAL__TEST_FCTOBJ_POINT_LINE_2_C + +#include + + +template +bool +_test_fctobj_point_line_2(const Point&, const Line& ); + + +template +bool +_test_fctobj_point_line_2(const Point&, const Line& ) +{ + std::cout << "Testing function objects Point_2 and Line_2"; + + typedef typename Point::R::RT RT; + + Point p1( RT(18), RT(12), RT(3) ); // ( 6, 4) + Point p2( RT(18), RT(15), RT(3) ); // ( 6, 5) + Point p3( RT(18), RT( 9), RT(3) ); // ( 6, 3) + Point p4( RT(28), RT(40), RT(4) ); // ( 7,10) + Point p5( RT(12), RT(-4), RT(4) ); // ( 3,-1) + Point p6( RT(28), RT(12), RT(4) ); // ( 7, 3) + Point p7( RT(18), RT( 6), RT(3) ); // ( 6, 2) + Point p8( RT(24), RT( 9), RT(3) ); // ( 8, 3) + Point p9( RT( 6), RT(10), RT(1) ); // ( 6,10) + + CGAL::Compare_xy_2< Point> compare_lexicographically_xy; + CGAL::Less_xy_2< Point> lexicographically_xy_smaller; + + assert( compare_lexicographically_xy(p1,p2) == CGAL::SMALLER ); + assert( compare_lexicographically_xy(p3,p2) == CGAL::SMALLER ); + assert( compare_lexicographically_xy(p3,p1) == CGAL::SMALLER ); + assert( compare_lexicographically_xy(p3,p2) == CGAL::SMALLER ); + assert( compare_lexicographically_xy(p2,p1) == CGAL::LARGER ); + assert( compare_lexicographically_xy(p2,p3) == CGAL::LARGER ); + assert( compare_lexicographically_xy(p4,p3) == CGAL::LARGER ); + assert( compare_lexicographically_xy(p4,p4) == CGAL::EQUAL ); + + assert( !lexicographically_xy_smaller(p3,p3) ); + assert( lexicographically_xy_smaller(p3,p2) ); + assert( !lexicographically_xy_smaller(p4,p3) ); + + std::cout <<'.'; + CGAL::Compare_yx_2< Point> compare_lexicographically_yx; + CGAL::Less_yx_2< Point> lexicographically_yx_smaller; + + assert( compare_lexicographically_yx(p1,p2) == CGAL::SMALLER ); + assert( compare_lexicographically_yx(p2,p1) == CGAL::LARGER ); + assert( compare_lexicographically_yx(p2,p2) == CGAL::EQUAL ); + assert( compare_lexicographically_yx(p2,p4) == CGAL::SMALLER ); + assert( compare_lexicographically_yx(p3,p6) == CGAL::SMALLER ); + assert( compare_lexicographically_yx(p6,p3) == CGAL::LARGER ); + assert( compare_lexicographically_yx(p4,p9) == CGAL::LARGER ); + + assert( lexicographically_yx_smaller(p1,p2) ); + assert( lexicographically_yx_smaller(p2,p4) ); + assert( lexicographically_yx_smaller(p3,p6) ); + assert( lexicographically_yx_smaller(p2,p4) ); + assert( lexicographically_yx_smaller(p8,p1) ); + assert(!lexicographically_yx_smaller(p1,p8) ); + + std::cout << '.'; + + CGAL::Orientation_2< Point> orientation; + CGAL::Collinear_2< Point> collinear; + CGAL::Leftturn_2< Point> leftturn; + CGAL::Rightturn_2< Point> rightturn; + + Point pe0( RT(1), RT(0) ); + Point pe1( RT(0), RT(1) ); + + assert( orientation( Point(CGAL::ORIGIN), pe0, pe1)== CGAL::POSITIVE); + + assert( orientation( p1, p2, p3) == CGAL::COLLINEAR ); + assert( orientation( p1, p2, p4) == CGAL::RIGHTTURN ); + assert( orientation( p2, p1, p4) == CGAL::LEFTTURN ); + assert( orientation( p5, p4, p3) == CGAL::RIGHTTURN ); + assert( orientation( p2, p4, p6) == CGAL::RIGHTTURN ); + assert( orientation( p6, p4, p2) == CGAL::LEFTTURN ); + assert( orientation( p4, p6, p2) == CGAL::RIGHTTURN ); + assert( orientation( p5, p6, p7) == CGAL::COLLINEAR ); + assert( orientation( p6, p5, p7) == CGAL::COLLINEAR ); + + assert( collinear( p1, p2, p3 ) ); + assert( collinear( p1, p2, p7 ) ); + assert( collinear( p6, p5, p7 ) ); + assert( collinear( p1, p2, p3 ) ); + assert( !collinear( p1, p2, p4 ) ); + assert( collinear( p6, p6, p3 ) ); + + assert( leftturn( p1, p4, p2 ) ); + assert( leftturn( p6, p4, p2 ) ); + + assert( rightturn( p4, p6, p2 ) ); + assert( rightturn( p1, p2, p4 ) ); + + std::cout << '.'; + + CGAL::Are_ordered_along_line_2< Point> + are_ordered_along_line; + + CGAL::Collinear_are_ordered_along_line_2< Point> + collinear_are_ordered_along_line; + + CGAL::Are_strictly_ordered_along_line_2< Point> + are_strictly_ordered_along_line; + + CGAL::Collinear_are_strictly_ordered_along_line_2< Point> + collinear_are_strictly_ordered_along_line; + + assert( are_ordered_along_line( p5, p7, p6 ) ); // p7 between p6 and p5 + assert( are_ordered_along_line( p6, p7, p5 ) ); + assert( are_ordered_along_line( p2, p1, p3 ) ); + assert( !are_ordered_along_line( p7, p6, p5 ) ); + assert( !are_ordered_along_line( p7, p5, p6 ) ); + assert( !are_ordered_along_line( p7, p4, p6 ) ); + assert( !are_ordered_along_line( p2, p4, p6 ) ); + assert( collinear_are_ordered_along_line( p5, p7, p6 ) ); + assert( collinear_are_ordered_along_line( p6, p7, p5 ) ); + assert( collinear_are_ordered_along_line( p2, p1, p3 ) ); + assert( !collinear_are_ordered_along_line( p7, p6, p5 ) ); + + assert( collinear_are_ordered_along_line( p7, p7, p7 ) ); + assert( !collinear_are_ordered_along_line( p5, p6, p5 ) ); + assert( !collinear_are_ordered_along_line( p1, p3, p1 ) ); + assert( !collinear_are_ordered_along_line( p3, p6, p3 ) ); + + assert( are_strictly_ordered_along_line( p5, p7, p6 ) ); + assert( are_strictly_ordered_along_line( p6, p7, p5 ) ); + assert( are_strictly_ordered_along_line( p2, p1, p3 ) ); + assert( !are_strictly_ordered_along_line( p7, p6, p5 ) ); + assert( !are_strictly_ordered_along_line( p7, p5, p6 ) ); + assert( !are_strictly_ordered_along_line( p7, p4, p6 ) ); + assert( !are_strictly_ordered_along_line( p2, p4, p6 ) ); + assert( collinear_are_strictly_ordered_along_line( p5, p7, p6 ) ); + assert( collinear_are_strictly_ordered_along_line( p6, p7, p5 ) ); + assert( collinear_are_strictly_ordered_along_line( p2, p1, p3 ) ); + assert( !collinear_are_strictly_ordered_along_line( p7, p6, p5 ) ); + + assert( !are_strictly_ordered_along_line( p7, p7, p6 ) ); + assert( !collinear_are_strictly_ordered_along_line( p5, p6, p6 ) ); + assert( are_ordered_along_line( p7, p7, p6 ) ); + assert( collinear_are_ordered_along_line( p5, p6, p6 ) ); + assert( are_ordered_along_line( p6, p6, p6 ) ); + assert( collinear_are_ordered_along_line( p5, p5, p5 ) ); + assert( !are_strictly_ordered_along_line( p6, p6, p6 ) ); + assert( !collinear_are_strictly_ordered_along_line( p5, p5, p5 ) ); + + std::cout << '.'; + + CGAL::Compare_distance_to_point_2< Point> cmp_dist_to_point_p3(p3); + assert( cmp_dist_to_point_p3(p2,p1) == CGAL::LARGER ); + + CGAL::Compare_distance_to_point_2< Point> cmp_dist_to_point_p1(p1); + assert( cmp_dist_to_point_p1(p5,p1) == CGAL::LARGER ); + + CGAL::Compare_distance_to_point_2< Point> cmp_dist_to_point_p4(p4); + assert( cmp_dist_to_point_p4(p6,p5) == CGAL::SMALLER ); + assert( cmp_dist_to_point_p4(p9,p1) == CGAL::SMALLER ); + + CGAL::Compare_distance_to_point_2< Point> cmp_dist_to_point_p8(p8); + assert( cmp_dist_to_point_p8(p3,p3) == CGAL::EQUAL ); + + CGAL::Compare_distance_to_point_2< Point> cmp_dist_to_point_p2(p2); + assert( cmp_dist_to_point_p2(p3,p3) == CGAL::EQUAL ); + assert( cmp_dist_to_point_p2(p4,p9) == CGAL::LARGER ); + + CGAL::Less_distance_to_point_2< Point> has_smaller_dist_to_point_p4(p4); + assert( has_smaller_dist_to_point_p4(p9,p1) ); + assert( has_smaller_dist_to_point_p4(p6,p5) ); + + CGAL::Less_distance_to_point_2< Point> has_smaller_dist_to_point_p9(p9); + assert( has_smaller_dist_to_point_p9(p9,p6) ); + + CGAL::Less_distance_to_point_2< Point> has_smaller_dist_to_point_p8(p8); + assert(!has_smaller_dist_to_point_p8(p3,p3) ); + + std::cout << '.'; + + + CGAL::Compare_signed_distance_to_implicit_line_2< Point> + cmp_signed_dist_to_line_p1_p2(p1,p2); + assert( cmp_signed_dist_to_line_p1_p2( p3,p9) == CGAL::EQUAL ); + assert( cmp_signed_dist_to_line_p1_p2( p3,p8) == CGAL::LARGER ); + + CGAL::Compare_signed_distance_to_implicit_line_2< Point> + cmp_signed_dist_to_line_p2_p1(p2,p1); + assert( cmp_signed_dist_to_line_p2_p1( p3,p8) == CGAL::SMALLER ); + + CGAL::Compare_signed_distance_to_implicit_line_2< Point> + cmp_signed_dist_to_line_p1_p8(p1,p8); + assert( cmp_signed_dist_to_line_p1_p8( p9,p8) == CGAL::LARGER ); + assert( cmp_signed_dist_to_line_p1_p8( p9,p9) == CGAL::EQUAL ); + assert( cmp_signed_dist_to_line_p1_p8( p5,p4) == CGAL::SMALLER ); + assert( cmp_signed_dist_to_line_p1_p8( p4,p5) == CGAL::LARGER ); + + CGAL::Compare_signed_distance_to_implicit_line_2< Point> + cmp_signed_dist_to_line_p8_p1(p8,p1); + assert( cmp_signed_dist_to_line_p8_p1( p4,p5) == CGAL::SMALLER ); + + CGAL::Compare_signed_distance_to_implicit_line_2< Point> + cmp_signed_dist_to_line_p6_p4(p6,p4); + assert( cmp_signed_dist_to_line_p6_p4( p1,p2) == CGAL::EQUAL ); + assert( cmp_signed_dist_to_line_p6_p4( p1,p9) == CGAL::EQUAL ); + assert( cmp_signed_dist_to_line_p6_p4( p8,p6) == CGAL::SMALLER ); + + CGAL::Compare_signed_distance_to_implicit_line_2< Point> + cmp_signed_dist_to_line_p6_p8(p6,p8); + assert( cmp_signed_dist_to_line_p6_p8( p7,p9) == CGAL::SMALLER ); + assert( cmp_signed_dist_to_line_p6_p8( p2,p9) == CGAL::SMALLER ); + assert( cmp_signed_dist_to_line_p6_p8( p2,p3) == CGAL::LARGER ); + + CGAL::Compare_signed_distance_to_implicit_line_2< Point> + cmp_signed_dist_to_line_p6_p1(p6,p1); + assert( cmp_signed_dist_to_line_p6_p1( p1,p6) == CGAL::EQUAL ); + assert( cmp_signed_dist_to_line_p6_p1( p6,p1) == CGAL::EQUAL ); + assert( cmp_signed_dist_to_line_p6_p1( p4,p1) == CGAL::SMALLER ); + assert( cmp_signed_dist_to_line_p6_p1( p5,p6) == CGAL::LARGER ); + + CGAL::Compare_signed_distance_to_implicit_line_2< Point> + cmp_signed_dist_to_line_p4_p6(p4,p6); + assert( cmp_signed_dist_to_line_p4_p6( p8,p6) == CGAL::LARGER ); + + + CGAL::Less_signed_distance_to_implicit_line_2< Point> + has_smaller_signed_dist_to_line_p1_p8(p1,p8); + assert( has_smaller_signed_dist_to_line_p1_p8( p5,p4) ); + + CGAL::Less_signed_distance_to_implicit_line_2< Point> + has_smaller_signed_dist_to_line_p2_p1(p2,p1); + assert( has_smaller_signed_dist_to_line_p2_p1( p3,p8) ); + + CGAL::Less_signed_distance_to_implicit_line_2< Point> + has_smaller_signed_dist_to_line_p6_p1(p6,p1); + assert( has_smaller_signed_dist_to_line_p6_p1( p6,p5) ); + + CGAL::Less_signed_distance_to_implicit_line_2< Point> + has_smaller_signed_dist_to_line_p6_p8(p6,p8); + assert( has_smaller_signed_dist_to_line_p6_p8( p2,p9) ); + + CGAL::Less_signed_distance_to_implicit_line_2< Point> + has_smaller_signed_dist_to_line_p6_p4(p6,p4); + assert( has_smaller_signed_dist_to_line_p6_p4( p8,p6) ); + + std::cout << '.'; + + RT n0 = 0; + RT n1 = 1; + RT n2 = 2; + RT n3 = 3; + RT n4 = 4; + RT n5 = 5; + RT n6 = 6; + RT n7 = 7; + RT n8 = 8; + RT n9 = 9; + RT n10= 10; + RT n12= 12; + RT n20= 20; + + Point q1( n2, n8, n2); // ( 1, 4) + Point q2( n4, n4, n2); // ( 2, 2) + Point q3(n12,n10, n2); // ( 6, 5) + Point q4( n7, n3); // ( 7, 3) + Point q5( n9, n0, n3); // ( 3, 0) + Point q6(n12,n20, n4); // ( 3, 5) + Point q7(n12, n3, n3); // ( 4, 1) + Point q8( n8, n4); // ( 8, 4) + Point q9(-n4, n8, n4); // (-1, 2) + Point q10(n10, n4, n2); // ( 5, 2) + + Point q11( n1, -n5,-n1); // (-1, 5) + Point q0( CGAL::ORIGIN ); // ( 0, 0) + Point q13( n8, n8, n4); // ( 4, 4) + Point q14( n5,-n1); // ( 5,-1) + Point q16(n12, n9, n3); // ( 4, 3) + Point q17( n0,n1); // ( 0, 1) + + Line l14( q1, q4 ); + Line l23( q2, q3 ); + Line l67( q6, q7 ); + Line l58( q5, q8 ); + Line l1617( q16, q17); + Line l1114( q11, q14); + Line l1716( q17, q16); + Line l1411( q14, q11); + Line l013( q0, q13 ); + Line l910( q9, q10 ); + + std::cout << '.'; + + CGAL::Compare_x_2< Point> compare_x; + assert( compare_x( q16, q14 ) == CGAL::SMALLER ); + + CGAL::Compare_x_implicit_point_2< Point, Line> compare_xip; + assert( compare_xip( q9, l14, l23) == CGAL::SMALLER ); + assert( compare_xip( q8, l14, l23) == CGAL::LARGER ); + assert( compare_xip( q2, l1617, l910) == CGAL::EQUAL ); + assert( compare_xip( q2, l1716, l910) == CGAL::EQUAL ); + assert( compare_xip( q2, l1114, l013) == CGAL::EQUAL ); + assert( compare_xip( q2, l1411, l013) == CGAL::EQUAL ); + assert( compare_xip( q2, l1716, l013) == CGAL::EQUAL ); + + CGAL::Compare_y_implicit_point_2< Point, Line> compare_yip; + assert( compare_yip( q6, l14, l23 ) == CGAL::LARGER ); + assert( compare_yip( q9, l14, l23 ) == CGAL::SMALLER ); + + std::cout << '.'; + + CGAL::Compare_x_implicit_points_same_line_2< Line> + compare_xip_sl; + assert( compare_xip_sl( l14, l23, l58 ) == CGAL::SMALLER); + assert( compare_xip_sl( l14, l58, l23 ) == CGAL::LARGER); + assert( compare_xip_sl( l14, l58, l58 ) == CGAL::EQUAL); + assert( compare_xip_sl( l1114, l013, l910 ) == CGAL::EQUAL); + assert( compare_xip_sl( l1617, l910, l013 ) == CGAL::EQUAL); + + CGAL::Compare_y_implicit_points_same_line_2< Line> + compare_yip_sl; + assert( compare_yip_sl( l14, l58, l23 ) == CGAL::SMALLER); + assert( compare_yip_sl( l14, l23, l58 ) == CGAL::LARGER); + assert( compare_yip_sl( l14, l58, l58 ) == CGAL::EQUAL); + assert( compare_yip_sl( l1114, l013, l910 ) == CGAL::EQUAL); + assert( compare_yip_sl( l1617, l910, l013 ) == CGAL::EQUAL); + + CGAL::Compare_x_implicit_points_2< Line> compare_xips; + assert( compare_xips( l14, l23, l67, l58 ) == CGAL::SMALLER); + assert( compare_xips( l67, l58, l23, l14 ) == CGAL::LARGER); + assert( compare_xips( l1114, l1617, l910, l013 ) == CGAL::EQUAL); + + CGAL::Compare_y_implicit_points_2< Line> compare_yips; + assert( compare_yips( l14, l23, l67, l58 ) == CGAL::LARGER); + assert( compare_yips( l67, l58, l23, l14 ) == CGAL::SMALLER); + assert( compare_yips( l1114, l1617, l910, l013 ) == CGAL::EQUAL); + + std::cout << '.'; + + CGAL::Compare_y_at_point_2< Point, Line> compare_y_at_x; + assert( compare_y_at_x( q6, l23 ) == CGAL::LARGER ); + assert( compare_y_at_x( q6, l23.opposite() ) == CGAL::LARGER ); + assert( compare_y_at_x( q10, l23 ) == CGAL::SMALLER ); + assert( compare_y_at_x( q9, l23 ) == CGAL::LARGER ); + assert( compare_y_at_x( q17, l910 ) == CGAL::SMALLER ); + assert( compare_y_at_x( q0, l23 ) == CGAL::SMALLER ); + assert( compare_y_at_x( q8, l58 ) == CGAL::EQUAL ); + assert( compare_y_at_x( q2, l1617 ) == CGAL::EQUAL ); + + CGAL::Compare_y_at_implicit_point_2< Line> compare_y_at_ip; + assert( compare_y_at_ip( l14, l23, l58 ) == CGAL::LARGER ); + assert( compare_y_at_ip( l67, l58, l23 ) == CGAL::SMALLER ); + assert( compare_y_at_ip( l910, l1716, l1114) == CGAL::EQUAL); + + CGAL::Compare_y_of_lines_at_implicit_point_2< Line> + compare_y_of_l_ip; + assert( compare_y_of_l_ip( l14, l23, l58, l67 ) == CGAL::SMALLER ); + assert( compare_y_of_l_ip( l14, l23, l67, l58 ) == CGAL::LARGER ); + assert( compare_y_of_l_ip( l14, l23, l1411, l1114 ) == CGAL::EQUAL ); + assert( compare_y_of_l_ip( l1617, l013, l910, l67 ) == CGAL::SMALLER); + assert( compare_y_of_l_ip( l1617, l013, l67, l910 ) == CGAL::LARGER); + assert( compare_y_of_l_ip( l1617, l013, l1114, l910 ) == CGAL::EQUAL); + assert( compare_y_of_l_ip( l1617, l013, l910, l1114 ) == CGAL::EQUAL); + + + + std::cout << "done" << std::endl; + return true; +} +#endif // _TEST_FCTOBJ_POINT_LINE_2_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_further_fct_point_2.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_further_fct_point_2.C new file mode 100644 index 00000000000..bc5e6f1810a --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_further_fct_point_2.C @@ -0,0 +1,142 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_further_fct_point_2.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FURTHER_FCT_POINT_2_C +#define CGAL__TEST_FURTHER_FCT_POINT_2_C +#ifndef CGAL__TEST_FURTHER_FCT_POINT_2_H +#include +#endif // CGAL__TEST_FURTHER_FCT_POINT_2_H + +template +bool +_test_further_fct_point_2(const R& ) +{ + std::cout << "Testing further functions Point_2" ; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + CGAL::Point_2 p1( RT(18), RT(12), RT(3) ); // ( 6, 4) + CGAL::Point_2 p2( RT(18), RT(15), RT(3) ); // ( 6, 5) + CGAL::Point_2 p3( RT(18), RT( 9), RT(3) ); // ( 6, 3) + CGAL::Point_2 p4( RT(28), RT(40), RT(4) ); // ( 7,10) + CGAL::Point_2 p5( RT(12), RT(-4), RT(4) ); // ( 3,-1) + CGAL::Point_2 p6( RT(28), RT(12), RT(4) ); // ( 7, 3) + CGAL::Point_2 p7( RT(18), RT( 6), RT(3) ); // ( 6, 2) + CGAL::Point_2 p8( RT(24), RT( 9), RT(3) ); // ( 8, 3) + CGAL::Point_2 p9( RT( 6), RT(10), RT(1) ); // ( 6,10) + + assert( CGAL::compare_deltax_deltay( p1, p4, p5, p6) == CGAL::SMALLER); + assert( CGAL::compare_deltax_deltay( p5, p6, p2, p1) == CGAL::LARGER); + assert( CGAL::compare_deltax_deltay( p6, p5, p2, p1) == CGAL::LARGER); + assert( CGAL::compare_deltax_deltay( p1, p2, p5, p6) == CGAL::SMALLER); + assert( CGAL::compare_deltax_deltay( p4, p3, p3, p7) == CGAL::EQUAL); + assert( CGAL::compare_deltax_deltay( p2, p3, p3, p6) == CGAL::EQUAL); + + std::cout << '.'; + + assert( CGAL::x_equal(p1,p1) ); + assert( CGAL::x_equal(p2,p3) ); + assert( !CGAL::x_equal(p2,p4) ); + + assert( CGAL::y_equal(p3,p6) ); + assert( !CGAL::y_equal(p1,p3) ); + + assert( CGAL::compare_x( p1, p2 ) == CGAL::EQUAL ); + assert( CGAL::compare_x( p1, p4 ) == CGAL::SMALLER ); + assert( CGAL::compare_x( p4, p1 ) == CGAL::LARGER ); + assert( CGAL::compare_x( p6, p5 ) == CGAL::LARGER ); + + assert( CGAL::compare_y( p3, p6 ) == CGAL::EQUAL ); + assert( CGAL::compare_y( p5, p7 ) == CGAL::SMALLER ); + assert( CGAL::compare_y( p3, p4 ) == CGAL::SMALLER ); + assert( CGAL::compare_y( p2, p1 ) == CGAL::LARGER ); + + std::cout <<'.'; + + CGAL::Vector_2 v( RT(10), RT(20), RT(-5) ); + CGAL::Direction_2 dir1(RT(-11),RT( 13)), + dir2(RT( 14),RT(-22)), + dir3(RT(-12),RT( 47)), + dir4(RT(- 7),RT(- 8)), + dir5(RT( -3), RT( 4)); + + CGAL::Aff_transformation_2 rotate1(CGAL::ROTATION,dir1, RT(1), RT(100)), + rotate2(CGAL::ROTATION,dir2, RT(1), RT(100)), + rotate3(CGAL::ROTATION,dir3, RT(1), RT(100)), + rotate4(CGAL::ROTATION,dir4, RT(1), RT(100)), + rotate5(CGAL::ROTATION,dir5, RT(1), RT(100)); + + CGAL::Point_2 p0( RT(1), RT(0) ); + + p1 = p0.transform(rotate1); + p2 = p0.transform(rotate2); + p3 = p0.transform(rotate3); + p4 = p0.transform(rotate4); + p5 = p0.transform(rotate5); + + + assert( (p5 - CGAL::ORIGIN).direction() == dir5 ); + + assert( CGAL::side_of_bounded_circle(p1, p2, p3, CGAL::Point_2(CGAL::ORIGIN))\ + == CGAL::ON_BOUNDED_SIDE ); + assert( CGAL::side_of_bounded_circle(p1+v, p2+v, p3+v, CGAL::ORIGIN + v) \ + == CGAL::ON_BOUNDED_SIDE ); + assert( CGAL::side_of_bounded_circle(p1+v, p2+v, p3+v, CGAL::ORIGIN - v) \ + == CGAL::ON_UNBOUNDED_SIDE ); + assert( CGAL::side_of_bounded_circle(p1, p2, p3, p4) \ + == CGAL::ON_BOUNDARY ); + assert( CGAL::side_of_bounded_circle(p1+v, p2+v, p3+v, p4+v) \ + == CGAL::ON_BOUNDARY ); + assert( CGAL::side_of_bounded_circle(p1+v, p3+v, p4+v, p2+v) \ + == CGAL::ON_BOUNDARY ); + assert( CGAL::side_of_bounded_circle(p2+v, p4+v, p1+v, p3+v) \ + == CGAL::ON_BOUNDARY ); + + assert( CGAL::orientation( p1, p2, p3 ) == CGAL::POSITIVE ); + + assert( CGAL::side_of_oriented_circle(p1,p2,p3,CGAL::Point_2(CGAL::ORIGIN))\ + == CGAL::ON_POSITIVE_SIDE ); + assert( CGAL::side_of_oriented_circle(p1+v, p2+v, p3+v, CGAL::ORIGIN + v) \ + == CGAL::ON_POSITIVE_SIDE ); + assert( CGAL::side_of_oriented_circle(p1+v, p3+v, p2+v, CGAL::ORIGIN + v) \ + == CGAL::ON_NEGATIVE_SIDE ); + assert( CGAL::side_of_oriented_circle(p1+v, p2+v, p3+v, CGAL::ORIGIN - v) \ + == CGAL::ON_NEGATIVE_SIDE ); + assert( CGAL::side_of_oriented_circle(p2+v, p1+v, p3+v, CGAL::ORIGIN - v) \ + == CGAL::ON_POSITIVE_SIDE ); + assert( CGAL::side_of_oriented_circle(p1, p2, p3, p4) \ + == CGAL::ON_ORIENTED_BOUNDARY ); + assert( CGAL::side_of_oriented_circle(p1+v, p2+v, p3+v, p4+v) \ + == CGAL::ON_ORIENTED_BOUNDARY ); + assert( CGAL::side_of_oriented_circle(p1+v, p3+v, p4+v, p2+v) \ + == CGAL::ON_ORIENTED_BOUNDARY ); + + std::cout << '.'; + + std::cout << "done" << std::endl; + return true; +} +#endif // CGAL__TEST_FURTHER_FCT_POINT_2_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_further_fct_point_2.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_further_fct_point_2.h new file mode 100644 index 00000000000..f257465bdd1 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_further_fct_point_2.h @@ -0,0 +1,46 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_further_fct_point_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FURTHER_FCT_POINT_2_H +#define CGAL__TEST_FURTHER_FCT_POINT_2_H + +#ifndef CGAL_POINT_2_H +#include +#endif // CGAL_POINT_2_H +#ifndef CGAL_VECTOR_2_H +#include +#endif // CGAL_VECTOR_2_H +#ifndef CGAL_PREDICATES_ON_POINTS_2_H +#include +#endif // CGAL_PREDICATES_ON_POINTS_2_H +#ifndef CGAL_DISTANCE_PREDICATES_2_H +#include +#endif // CGAL_DISTANCE_PREDICATES_2_H + + +template bool _test_further_fct_point_2(const R& ); + + +#endif // CGAL__TEST_FURTHER_FCT_POINT_2_H diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_further_fct_point_line_2.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_further_fct_point_line_2.C new file mode 100644 index 00000000000..0a0d1baa169 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_further_fct_point_line_2.C @@ -0,0 +1,99 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_further_fct_point_line_2.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FURTHER_FCT_POINT_2_LINE_2_C +#define CGAL__TEST_FURTHER_FCT_POINT_2_LINE_2_C +#ifndef CGAL__TEST_FURTHER_FCT_POINT_LINE_2_H +#include +#endif // CGAL__TEST_FURTHER_FCT_POINT_LINE_2_H + +template +bool +_test_further_fct_point_line_2(const R& ) +{ + std::cout << "Testing further functions Point_2 Line_2" ; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + CGAL::Point_2 p1( RT(18), RT(12), RT(3) ); // ( 6, 4) + CGAL::Point_2 p2( RT(18), RT(15), RT(3) ); // ( 6, 5) + CGAL::Point_2 p3( RT(18), RT( 9), RT(3) ); // ( 6, 3) + CGAL::Point_2 p4( RT(28), RT(40), RT(4) ); // ( 7,10) + CGAL::Point_2 p5( RT(12), RT(-4), RT(4) ); // ( 3,-1) + CGAL::Point_2 p6( RT(28), RT(12), RT(4) ); // ( 7, 3) + CGAL::Point_2 p7( RT(18), RT( 6), RT(3) ); // ( 6, 2) + CGAL::Point_2 p8( RT(24), RT( 9), RT(3) ); // ( 8, 3) + CGAL::Point_2 p9( RT( 6), RT(10), RT(1) ); // ( 6,10) + + CGAL::Line_2 l12(p1,p2); + CGAL::Line_2 l21(p2,p1); + CGAL::Line_2 l18(p1,p8); + CGAL::Line_2 l64(p6,p4); + CGAL::Line_2 l68(p6,p8); + CGAL::Line_2 l61(p6,p1); + CGAL::Line_2 l46(p4,p6); + + std::cout << '.'; + + assert( CGAL::cmp_signed_dist_to_line(l12, p3,p9) == CGAL::EQUAL ); + assert( CGAL::cmp_signed_dist_to_line(l12, p3,p8) == CGAL::LARGER ); + assert( CGAL::cmp_signed_dist_to_line(l21, p3,p8) == CGAL::SMALLER ); + assert( CGAL::cmp_signed_dist_to_line(l18, p9,p8) == CGAL::LARGER ); + assert( CGAL::cmp_signed_dist_to_line(l18, p9,p9) == CGAL::EQUAL ); + assert( CGAL::cmp_signed_dist_to_line(l18, p5,p4) == CGAL::SMALLER ); + assert( CGAL::cmp_signed_dist_to_line(l18, p4,p5) == CGAL::LARGER ); + assert( CGAL::cmp_signed_dist_to_line(l18.opposite(),p4,p5) == CGAL::SMALLER ); + assert( CGAL::cmp_signed_dist_to_line(l64, p1,p2) == CGAL::EQUAL ); + assert( CGAL::cmp_signed_dist_to_line(l64, p1,p9) == CGAL::EQUAL ); + assert( CGAL::cmp_signed_dist_to_line(l68, p7,p9) == CGAL::SMALLER ); + assert( CGAL::cmp_signed_dist_to_line(l68, p2,p9) == CGAL::SMALLER ); + assert( CGAL::cmp_signed_dist_to_line(l68, p2,p3) == CGAL::LARGER ); + assert( CGAL::cmp_signed_dist_to_line(l61, p1,p6) == CGAL::EQUAL ); + assert( CGAL::cmp_signed_dist_to_line(l61, p6,p1) == CGAL::EQUAL ); + assert( CGAL::cmp_signed_dist_to_line(l61, p4,p1) == CGAL::SMALLER ); + assert( CGAL::cmp_signed_dist_to_line(l61, p5,p6) == CGAL::LARGER ); + assert( CGAL::cmp_signed_dist_to_line(l46, p8,p6) == CGAL::LARGER ); + assert( CGAL::cmp_signed_dist_to_line(l64, p8,p6) == CGAL::SMALLER ); + + std::cout << '.'; + + assert( CGAL::has_larger_signed_dist_to_line(l12, p3,p8) ); + assert( CGAL::has_larger_signed_dist_to_line(l18, p9,p8) ); + assert( CGAL::has_larger_signed_dist_to_line(l61, p1,p4) ); + assert( CGAL::has_larger_signed_dist_to_line(l64, p6,p8) ); + + std::cout << '.'; + + assert( CGAL::has_smaller_signed_dist_to_line(l18, p5,p4) ); + assert( CGAL::has_smaller_signed_dist_to_line(l21, p3,p8) ); + assert( CGAL::has_smaller_signed_dist_to_line(l61, p6,p5) ); + assert( CGAL::has_smaller_signed_dist_to_line(l68, p2,p9) ); + assert( CGAL::has_smaller_signed_dist_to_line(l64, p8,p6) ); + + std::cout << "done" << std::endl; + return true; +} +#endif // CGAL__TEST_FURTHER_FCT_POINT_2_LINE_2_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_further_fct_point_line_2.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_further_fct_point_line_2.h new file mode 100644 index 00000000000..c4d175010c3 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_further_fct_point_line_2.h @@ -0,0 +1,43 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_further_fct_point_line_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FURTHER_FCT_POINT_2_LINE_2_H +#define CGAL__TEST_FURTHER_FCT_POINT_2_LINE_2_H + +#ifndef CGAL_POINT_2_H +#include +#endif // CGAL_POINT_2_H +#ifndef CGAL_LINE_2_H +#include +#endif // CGAL_LINE_2_H +#ifndef CGAL_DISTANCE_PREDICATES_2_H +#include +#endif // CGAL_DISTANCE_PREDICATES_2_H + + +template bool _test_further_fct_point_line_2(const R& ); + + +#endif // CGAL__TEST_FURTHER_FCT_POINT_2_LINE_2_H diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_mf_plane_3_to_2d.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_mf_plane_3_to_2d.C new file mode 100644 index 00000000000..ef7ba3b9d17 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_mf_plane_3_to_2d.C @@ -0,0 +1,117 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_mf_plane_3_to_2d.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_MF_PLANE_3_TO_2D_C +#define CGAL__TEST_MF_PLANE_3_TO_2D_C +#include + +template +bool +_test_mf_plane_3_to_2d(const R& ) +{ + std::cout << "Testing member function Plane_3::to_2d" ; + + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef CGAL::Plane_3< R> Plane_3; + typedef CGAL::Point_3< R> Point_3; + typedef CGAL::Point_2< R> Point_2; + + RT n0 = 0; + RT n1 = 7; + RT n2 = 21; + RT n3 = 14; + RT n4 =-10; + RT n5 = 5; + RT n6 = 20; + RT n7 = -1; + RT n8 = 3; + + Point_3 p1( n1, n2, n3, n1); + Point_3 p2( n4, n5, n6, n5); + Point_3 p3( n2, n8, n2, n8); + Point_3 p4 = p3 + (p2 - p1); + + Plane_3 pl1( p1, p2, p3); + assert( pl1.has_on_boundary( pl1.to_3d( pl1.to_2d( pl1.point() ))) ); + assert( pl1.has_on_boundary( pl1.to_3d( pl1.to_2d( p4 ))) ); + assert( p1 == pl1.to_3d( pl1.to_2d( p1)) ); + assert( p2 == pl1.to_3d( pl1.to_2d( p2)) ); + assert( p3 == pl1.to_3d( pl1.to_2d( p3)) ); + assert( p4 == pl1.to_3d( pl1.to_2d( p4)) ); + + std::cout << '.'; + + Plane_3 pl2( p2, p1, p3); + assert( pl2.has_on_boundary( pl2.to_3d( pl2.to_2d( pl2.point() ))) ); + assert( pl2.has_on_boundary( pl2.to_3d( pl2.to_2d( p4 ))) ); + assert( p1 == pl2.to_3d( pl2.to_2d( p1)) ); + assert( p2 == pl2.to_3d( pl2.to_2d( p2)) ); + assert( p3 == pl2.to_3d( pl2.to_2d( p3)) ); + assert( p4 == pl2.to_3d( pl2.to_2d( p4)) ); + + Point_3 p5( n2, n8, n0, n7); + Point_3 p6( n4, n5, n0, n8); + Plane_3 pl3( p4, p5, p6); + assert( p4 == pl3.to_3d( pl3.to_2d( p4)) ); + assert( p5 == pl3.to_3d( pl3.to_2d( p5)) ); + assert( p6 == pl3.to_3d( pl3.to_2d( p6)) ); + Plane_3 pl4( p4, p6, p5); + assert( p4 == pl4.to_3d( pl4.to_2d( p4)) ); + assert( p5 == pl4.to_3d( pl4.to_2d( p5)) ); + assert( p6 == pl4.to_3d( pl4.to_2d( p6)) ); + + Point_3 p7 = CGAL::midpoint( p1, p2); + Point_3 p8 = CGAL::midpoint( p3, p3 + (p2-p1) ); + Point_3 p9 = CGAL::midpoint( p1, p3); + Point_3 p10= CGAL::midpoint( p2, p2 + (p3-p1) ); + assert( pl1.has_on_boundary( p7 )); + assert( pl1.has_on_boundary( p8 )); + assert( pl1.has_on_boundary( p9 )); + assert( pl1.has_on_boundary( p10)); + + std::cout << '.'; + + Point_2 pp7 = pl1.to_2d( p7 ); + Point_2 pp8 = pl1.to_2d( p8 ); + Point_2 pp9 = pl1.to_2d( p9 ); + Point_2 pp10= pl1.to_2d( p10); + CGAL::Segment_2 sp1( pp7, pp8); + CGAL::Segment_2 sp2( pp9, pp10); + Point_2 pp; + assert( CGAL::assign( pp, CGAL::intersection( sp1, sp2)) ); + assert( sp1.has_on( pp) ); + assert( sp2.has_on( pp) ); + Point_3 p = pl1.to_3d( pp); + assert( pl1.has_on_boundary( p )); + CGAL::Segment_3 s1( p7, p8); + CGAL::Segment_3 s2( p9, p10); + assert( s1.has_on( p) ); + assert( s2.has_on( p) ); + + std::cout << '.' << std::endl; + return true; +} +#endif // CGAL__TEST_MF_PLANE_3_TO_2D_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_mf_plane_3_to_2d.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_mf_plane_3_to_2d.h new file mode 100644 index 00000000000..c41aca616ea --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_mf_plane_3_to_2d.h @@ -0,0 +1,34 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_mf_plane_3_to_2d.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include +#include +#include + + +template bool _test_mf_plane_3_to_2d( const R&); + + diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_misc.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_misc.C new file mode 100644 index 00000000000..127240eae6a --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_misc.C @@ -0,0 +1,44 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_misc.fw +// file : _test_misc.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_MISC_C +#define CGAL__TEST_MISC_C + +#include + + +template bool _test_misc(const R& r); + + +template +bool +_test_misc(const R& r) +{ + return + _test_cls_object(r); +} + + +#endif // CGAL__TEST_MISC_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_new_2.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_new_2.h new file mode 100644 index 00000000000..6a8dd610e7a --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_new_2.h @@ -0,0 +1,474 @@ + +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_new_kernel.fw +// file : test/Kernel/include/CGAL/_test_new_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Michael Seel +// Stefan Schirra +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_NEW_2_H +#define CGAL__TEST_NEW_2_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +void use(bool) {}; +void use(CGAL::Sign) {} +void use(CGAL::Bounded_side) {} +void use(CGAL::Oriented_side) {} +void use(CGAL::Comparison_result) {} + + +template +bool +test_new_2(const R& rep) +{ + std::cout << "Testing 2 dimensional functionality" << std::endl; + + using namespace CGAL; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + typedef typename R::Point_2 Point_2; + typedef typename R::Vector_2 Vector_2; + typedef typename R::Direction_2 Direction_2; + typedef typename R::Segment_2 Segment_2; + typedef typename R::Line_2 Line_2; + typedef typename R::Ray_2 Ray_2; + typedef typename R::Circle_2 Circle_2; + typedef typename R::Triangle_2 Triangle_2; + typedef typename R::Iso_rectangle_2 Iso_rectangle_2; + typedef typename R::Aff_transformation_2 Aff_transformation_2; + typedef typename R::Object_2 Object2; + + typename R::Construct_point_2 construct_point = + rep.construct_point_2_object(); + Point_2 p1 = construct_point(); + Point_2 p2 = construct_point(ORIGIN); + Point_2 p3 = construct_point(1,1); + Point_2 p4 = construct_point(1,2,2); + Point_2 p5 = construct_point(3,4,5); + Point_2 p6 = construct_point(3,4,6); + + typename R::Construct_vector_2 construct_vector = + rep.construct_vector_2_object(); + Vector_2 v1 = construct_vector(); + Vector_2 v2 = construct_vector(NULL_VECTOR); + Vector_2 v3 = construct_vector(1,3); + Vector_2 v4 = construct_vector(1,2,3); + + typename R::Construct_direction_2 construct_direction + = rep.construct_direction_2_object(); + Direction_2 d1 = construct_direction(); + Direction_2 d2 = construct_direction(v3); + Direction_2 d3 = construct_direction(1,4); + + typename R::Construct_segment_2 construct_segment + = rep.construct_segment_2_object(); + Segment_2 s1 = construct_segment(); + Segment_2 s2 = construct_segment(p2,p3); + + typename R::Construct_ray_2 construct_ray = + rep.construct_ray_2_object(); + Ray_2 r1 = construct_ray(); + Ray_2 r2 = construct_ray(p2,p5); + Ray_2 r3 = construct_ray(p2,d3); + + typename R::Construct_line_2 construct_line + = rep.construct_line_2_object(); + Line_2 l1 = construct_line(); + Line_2 l2 = construct_line(1,1,1); + Line_2 l3 = construct_line(p2,p6); + Line_2 l4 = construct_line(p2,d3); + Line_2 l5 = construct_line(s2); + Line_2 l6 = construct_line(r2); + + typename R::Construct_circle_2 construct_circle + = rep.construct_circle_2_object(); + Circle_2 c1 = construct_circle(p2,1); + Circle_2 c11 = construct_circle(p2,1,COUNTERCLOCKWISE); + Circle_2 c2 = construct_circle(p2,p3,p4); + Circle_2 c31 = construct_circle(p2,p3,COUNTERCLOCKWISE); + Circle_2 c4 = construct_circle(p2); + Circle_2 c41 = construct_circle(p2,COUNTERCLOCKWISE); + + typename R::Construct_triangle_2 construct_triangle + = rep.construct_triangle_2_object(); + Triangle_2 t1 = construct_triangle(); + Triangle_2 t2 = construct_triangle(p2,p3,p4); + + typename R::Construct_aff_transformation_2 construct_aff_transformation + = rep.construct_aff_transformation_2_object(); + Aff_transformation_2 a1 = construct_aff_transformation(Translation(),v2); + Aff_transformation_2 a2 = construct_aff_transformation(Rotation(),d2,1); + Aff_transformation_2 a21 = construct_aff_transformation(Rotation(),d2,1,2); + Aff_transformation_2 a3 = construct_aff_transformation(Rotation(),1,1); + Aff_transformation_2 a31 = construct_aff_transformation(Rotation(),3,4,5); + Aff_transformation_2 a4 = construct_aff_transformation(Scaling(),5); + Aff_transformation_2 a41 = construct_aff_transformation(Scaling(),5,2); + Aff_transformation_2 a5 = construct_aff_transformation(1,2,3,4,5,6); + Aff_transformation_2 a51 = construct_aff_transformation(1,2,3,4,5,6,1); + Aff_transformation_2 a6 = construct_aff_transformation(1,2,3,4); + Aff_transformation_2 a61 = construct_aff_transformation(1,2,3,4,1); + + + typename R::Construct_point_on_2 construct_point_on + = rep.construct_point_on_2_object(); + Point_2 tmp1 = construct_point_on(l2); + + + typename R::Construct_second_point_on_2 construct_second_point_on + = rep.construct_second_point_on_2_object(); + Point_2 tmp2 = construct_second_point_on(r2); + + + typename R::Construct_source_point_2 construct_source_point + = rep.construct_source_point_2_object(); + Point_2 tmp3 = construct_source_point(s2); + + + typename R::Construct_target_point_2 construct_target_point + = rep.construct_target_point_2_object(); + Point_2 tmp4 = construct_target_point(s2); + + + typename R::Construct_min_point_2 construct_min_point + = rep.construct_min_point_2_object(); + Point_2 tmp5a = construct_min_point(s2); + // Point_2 tmp5b = construct_min_point(t2); + + typename R::Construct_max_point_2 construct_max_point + = rep.construct_max_point_2_object(); + Point_2 tmp6a = construct_max_point(s2); + // Point_2 tmp6b = construct_max_point(t2); + + + typename R::Construct_direction_of_line_2 construct_direction_from + = rep.construct_direction_of_line_2_object(); + Direction_2 tmp7a = construct_direction_from(l2); + + typename R::Construct_direction_of_ray_2 construct_direction_from_ray + = rep.construct_direction_of_ray_2_object(); + Direction_2 tmp7b = construct_direction_from_ray(r2); + + + typename R::Construct_supporting_line_2 construct_supporting_line + = rep.construct_supporting_line_2_object(); + Line_2 tmp8a = construct_supporting_line(r2); + Line_2 tmp8b = construct_supporting_line(s2); + + typename R::Construct_perpendicular_vector_2 construct_perpendicular_vector + = rep.construct_perpendicular_vector_2_object(); + Vector_2 tmp9 = construct_perpendicular_vector(v2,CLOCKWISE); + + typename R::Construct_perpendicular_direction_2 construct_perpendicular_direction + = rep.construct_perpendicular_direction_2_object(); + Direction_2 tmp10 = construct_perpendicular_direction(d2,COUNTERCLOCKWISE); + + typename R::Construct_perpendicular_line_2 construct_perpendicular_line + = rep.construct_perpendicular_line_2_object(); + Line_2 tmp11 = construct_perpendicular_line(l2,p2); + + + typename R::Construct_midpoint construct_midpoint + = rep.construct_midpoint_object(); + Point_2 tmp12 = construct_midpoint(p2,p3); + + + typename R::Construct_circumcenter_2 construct_circumcenter + = rep.construct_circumcenter_2_object(); + Point_2 tmp13 = construct_circumcenter(p2,p3,p4); + + + typename R::Construct_bisector_2 construct_bisector + = rep.construct_bisector_2_object(); + Line_2 tmp14 = construct_bisector(p2,p3); + + + typename R::Construct_opposite_segment_2 construct_opposite_segment + = rep.construct_opposite_segment_2_object(); + Segment_2 tmp15 = construct_opposite_segment(s2); + + + typename R::Construct_opposite_ray_2 construct_opposite_ray + = rep.construct_opposite_ray_2_object(); + Ray_2 tmp16 = construct_opposite_ray(r2); + + + typename R::Construct_opposite_line_2 construct_opposite_line + = rep.construct_opposite_line_2_object(); + Line_2 tmp17 = construct_opposite_line(l2); + + + typename R::Construct_opposite_triangle_2 construct_opposite_triangle + = rep.construct_opposite_triangle_2_object(); + Triangle_2 tmp18 = construct_opposite_triangle(t2); + + + typename R::Construct_opposite_circle_2 construct_opposite_circle + = rep.construct_opposite_circle_2_object(); + Circle_2 tmp19 = construct_opposite_circle(c2); + + typename R::Transform_2 transform + = rep.transform_2_object(); + Point_2 tmp20a = transform(p2,a3); + Line_2 tmp20b = transform(l2,a3); + + + typename R::Intersect_2 intersect + = rep.intersect_2_object(); + Object2 tmp21a = intersect(l2,l3); + Object2 tmp21b = intersect(l2,r2); + + bool tmp_bool; + + typename R::Assign_2 assign + = rep.assign_2_object(); + tmp_bool = assign(p1,tmp21a); + tmp_bool = assign(p1,tmp21b); + + + typename R::Compute_y_at_x_2 compute_y_at_x + = rep.compute_y_at_x_2_object(); + FT tmp22 = compute_y_at_x(l2, FT(11)); + + + typename R::Compute_squared_length_2 Compute_squared_length + = rep.Compute_squared_length_2_object(); + FT tmp23 = Compute_squared_length(s2); + + + typename R::Equal_2 equal + = rep.equal_2_object(); + bool tmp24 = equal(p2,p3); + + + typename R::Equal_x_2 equal_x + = rep.equal_x_2_object(); + bool tmp25 = equal_x(p2,p3); + + + typename R::Equal_y_2 equal_y + = rep.equal_y_2_object(); + bool tmp26 = equal_y(p2,p3); + + + typename R::Equal_xy_2 equal_xy + = rep.equal_xy_2_object(); + bool tmp27 = equal_xy(p2,p3); + + typename R::Less_x_2 less_x + = rep.less_x_2_object(); + bool tmp28 = less_x(p2,p3); + + + typename R::Less_y_2 less_y + = rep.less_y_2_object(); + bool tmp29 = less_y(p2,p3); + + + typename R::Less_xy_2 less_xy + = rep.less_xy_2_object(); + bool tmp30 = less_xy(p2,p3); + + + typename R::Compare_x_2 compare_x + = rep.compare_x_2_object(); + Comparison_result tmp31a = compare_x(p2,p3); + Comparison_result tmp31b = compare_x(p2,l2,l3); + Comparison_result tmp31c = compare_x(l2,l3,l4); + Comparison_result tmp31d = compare_x(l2,l3,l4,l5); + + + typename R::Compare_y_2 compare_y + = rep.compare_y_2_object(); + Comparison_result tmp32a = compare_y(p2,p3); + Comparison_result tmp32b = compare_y(p2,l2,l3); + Comparison_result tmp32c = compare_y(l2,l3,l4); + Comparison_result tmp32d = compare_y(l2,l3,l4,l5); + + + typename R::Compare_xy_2 compare_xy + = rep.compare_xy_2_object(); + Comparison_result tmp33a = compare_xy(p2,p3); + + + typename R::Compare_y_at_x_2 compare_y_at_x + = rep.compare_y_at_x_2_object(); + Comparison_result tmp34a = compare_y_at_x(p2,l2); + Comparison_result tmp34b = compare_y_at_x(p2,l2,l3); + Comparison_result tmp34c = compare_y_at_x(l2,l3,l4); + Comparison_result tmp34d = compare_y_at_x(l2,l3,l4,l5); + + + typename R::Less_distance_to_point_2 less_distance_to_point + = rep.less_distance_to_point_2_object(p2); + bool tmp35 = less_distance_to_point(p3,p4); + + + typename R::Less_signed_distance_to_line_2 less_signed_distance_to_line + = rep.less_signed_distance_to_line_2_object(p4,p5); + bool tmp36 = less_signed_distance_to_line(p2,p3); + + typename R::Leftturn_2 leftturn + = rep.leftturn_2_object(); + bool tmp37 = leftturn(p2,p3,p4); + + + typename R::Left_of_line_2 left_of_line + = rep.left_of_line_2_object(p2,p3); + bool tmp38 = left_of_line(p4); + + + bool tmp39; + + typename R::Counterclockwise_in_between_2 ccwib + = rep.counterclockwise_in_between_2_object(); + tmp39 = ccwib(d1,d2,d3); + + typename R::Collinear_2 collinear + = rep.collinear_2_object(); + tmp39 = collinear(p2,p3,p4); + + + typename R::Orientation_2 orientation + = rep.orientation_2_object(); + Orientation tmp40 = orientation(p2,p3,p4); + + + typename R::Side_of_oriented_circle_2 side_of_oriented_circle + = rep.side_of_oriented_circle_2_object(); + Oriented_side tmp41 = side_of_oriented_circle(p2,p3,p4,p5); + + + typename R::Side_of_bounded_circle_2 side_of_bounded_circle + = rep.side_of_bounded_circle_2_object(); + Bounded_side tmp42 = side_of_bounded_circle(p2,p3,p4,p5); + + + typename R::Is_horizontal_2 is_horizontal + = rep.is_horizontal_2_object(); + bool tmp43 = is_horizontal(l2); + + + typename R::Is_vertical_2 is_vertical + = rep.is_vertical_2_object(); + bool tmp44 = is_vertical(l2); + + + typename R::Is_degenerate_2 is_degenerate + = rep.is_degenerate_2_object(); + bool tmp45 = is_degenerate(l2); + + + typename R::Has_on_2 has_on + = rep.has_on_2_object(); + bool tmp46 = has_on(l2,p2); + + + typename R::Collinear_has_on_2 collinear_has_on + = rep.collinear_has_on_2_object(); + bool tmp47 = collinear_has_on(s2,p2); + + + typename R::Has_on_bounded_side_2 has_on_bounded_side + = rep.has_on_bounded_side_2_object(); + bool tmp48a = has_on_bounded_side(c2,p2); + bool tmp48b = has_on_bounded_side(t2,p2); + + + typename R::Has_on_unbounded_side_2 has_on_unbounded_side + = rep.has_on_unbounded_side_2_object(); + bool tmp49a = has_on_unbounded_side(c2,p2); + bool tmp49b = has_on_unbounded_side(t2,p2); + + + typename R::Has_on_boundary_2 has_on_boundary + = rep.has_on_boundary_2_object(); + bool tmp50a = has_on_boundary(c2,p2); + bool tmp50b = has_on_boundary(t2,p2); + + + typename R::Has_on_positive_side_2 has_on_positive_side + = rep.has_on_positive_side_2_object(); + bool tmp51a = has_on_positive_side(l2,p2); + bool tmp51b = has_on_positive_side(c2,p2); + + + typename R::Has_on_negative_side_2 has_on_negative_side + = rep.has_on_negative_side_2_object(); + bool tmp52a = has_on_negative_side(l2,p2); + bool tmp52b = has_on_negative_side(c2,p2); + + + typename R::Oriented_side_2 oriented_side + = rep.oriented_side_2_object(); + Oriented_side tmp53a = oriented_side(l2,p2); + Oriented_side tmp53b = oriented_side(c2,p2); + + + typename R::Are_ordered_along_line_2 are_ordered_along_line + = rep.are_ordered_along_line_2_object(); + bool tmp54 = are_ordered_along_line(p2,p2,p3); + + + typename R::Are_strictly_ordered_along_line_2 are_strictly_ordered_along_line + = rep.are_strictly_ordered_along_line_2_object(); + bool tmp55 = are_strictly_ordered_along_line(p2,p2,p3); + + + typename R::Collinear_are_ordered_along_line_2 collinear_are_ordered_along_line + = rep.collinear_are_ordered_along_line_2_object(); + bool tmp56 = collinear_are_ordered_along_line(p2,p2,p3); + + + typename R::Collinear_are_strictly_ordered_along_line_2 collinear_are_strictly_ordered_along_line + = rep.collinear_are_strictly_ordered_along_line_2_object(); + bool tmp57 = collinear_are_strictly_ordered_along_line(p2,p2,p3); + + use(tmp57); use(tmp56); use(tmp55); use(tmp54); use(tmp53b); use(tmp53a); + use(tmp52b); use(tmp52a); use(tmp51b); use(tmp51a); use(tmp50b); use(tmp50a); + use(tmp49b); use(tmp49a); use(tmp48b); use(tmp48a); use(tmp47); use(tmp46); + use(tmp45); use(tmp44); use(tmp43); use(tmp42); use(tmp41); use(tmp40); + use(tmp39); use(tmp38); use(tmp37); use(tmp36); use(tmp35); use(tmp34d); + use(tmp34c); use(tmp34b); use(tmp34a); use(tmp32d); use(tmp32c); use(tmp32b); + use(tmp32a); use(tmp31d); use(tmp31c); use(tmp31b); use(tmp31a); use(tmp30); + use(tmp26); use(tmp25); use(tmp24); + use(tmp29); use(tmp28); use(tmp27); use(tmp33a); + use(tmp_bool); + + + return true; +} + +#endif // CGAL__TEST_NEW_2_H diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_new_3.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_new_3.h new file mode 100644 index 00000000000..ded0e97c3b4 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_new_3.h @@ -0,0 +1,406 @@ + +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_new_kernel.fw +// file : test/Kernel/include/CGAL/_test_new_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Michael Seel +// Stefan Schirra +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_TEST_NEW_3_H +#define CGAL_TEST_NEW_3_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +void use(bool) {}; +void use(CGAL::Sign) {} +void use(CGAL::Bounded_side) {} +void use(CGAL::Oriented_side) {} +void use(CGAL::Comparison_result) {} + + +template +bool +test_new_3(const R& rep) +{ + std::cout << "Testing 3 dimensional functionality" << std::endl; + + using namespace CGAL; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + typedef typename R::Point_3 Point_3; + typedef typename R::Vector_3 Vector_3; + typedef typename R::Direction_3 Direction_3; + typedef typename R::Segment_3 Segment_3; + typedef typename R::Line_3 Line_3; + typedef typename R::Ray_3 Ray_3; + typedef typename R::Plane_3 Plane_3; + typedef typename R::Triangle_3 Triangle_3; + typedef typename R::Tetrahedron_3 Tetrahedron_3; + typedef typename R::Aff_transformation_3 Aff_transformation_3; + typedef typename R::Object_3 Object3; + + typename R::Construct_point_3 construct_point + = rep.construct_point_3_object(); + Point_3 p1 = construct_point(); + Point_3 p2 = construct_point(ORIGIN); + Point_3 p3 = construct_point(1,1,1); + Point_3 p4 = construct_point(1,1,2,2); + Point_3 p5 = construct_point(1,2,3,4); + Point_3 p6 = construct_point(4,2,1,2); + + typename R::Construct_vector_3 construct_vector + = rep.construct_vector_3_object(); + Vector_3 v1 = construct_vector(); + Vector_3 v2 = construct_vector(NULL_VECTOR); + Vector_3 v3 = construct_vector(1,1,1); + Vector_3 v4 = construct_vector(1,1,2,2); + + typename R::Construct_direction_3 construct_direction + = rep.construct_direction_3_object(); + Direction_3 d1 = construct_direction(); + Direction_3 d2 = construct_direction(v3); + Direction_3 d3 = construct_direction(1,1,5); + Direction_3 d4 = construct_direction(1,5,5); + + typename R::Construct_segment_3 construct_segment + = rep.construct_segment_3_object(); + Segment_3 s1 = construct_segment(); + Segment_3 s2 = construct_segment(p2,p3); + + typename R::Construct_ray_3 construct_ray = + rep.construct_ray_3_object(); + Ray_3 r1 = construct_ray(); + Ray_3 r2 = construct_ray(p2,p4); + Ray_3 r3 = construct_ray(p2,d3); + + typename R::Construct_line_3 construct_line + = rep.construct_line_3_object(); + Line_3 l1 = construct_line(); + Line_3 l2 = construct_line(p5,p6); + Line_3 l3 = construct_line(p2,p3); + Line_3 l4 = construct_line(p2,d4); + Line_3 l5 = construct_line(s2); + Line_3 l6 = construct_line(r2); + + typename R::Construct_plane_3 construct_plane + = rep.construct_plane_3_object(); + Plane_3 h1 = construct_plane(); + Plane_3 h2 = construct_plane(1,1,1,1); + Plane_3 h3 = construct_plane(p2,p3,p4); + Plane_3 h4 = construct_plane(p2,d4); + Plane_3 h5 = construct_plane(l2,p4); + Plane_3 h6 = construct_plane(r2,p4); + Plane_3 h7 = construct_plane(s2,p4); + + typename R::Construct_triangle_3 construct_triangle + = rep.construct_triangle_3_object(); + Triangle_3 t1 = construct_triangle(); + Triangle_3 t2 = construct_triangle(p2,p3,p4); + + typename R::Construct_tetrahedron_3 construct_tetrahedron + = rep.construct_tetrahedron_object(); + Tetrahedron_3 th1 = construct_tetrahedron(); + Tetrahedron_3 th2 = construct_tetrahedron(p2,p3,p4,p5); + + typename R::Construct_aff_transformation_3 construct_aff_transformation + = rep.construct_aff_transformation_3_object(); + Aff_transformation_3 a1 = construct_aff_transformation(); + Aff_transformation_3 a2 = construct_aff_transformation(Translation(),v2); + Aff_transformation_3 a4 = construct_aff_transformation(Scaling(),5); + Aff_transformation_3 a41 = construct_aff_transformation(Scaling(),5,2); + Aff_transformation_3 a5 = + construct_aff_transformation(1,2,3,4,5,6,7,8,9,10,11,12); + Aff_transformation_3 a51 = + construct_aff_transformation(1,2,3,4,5,6,7,8,9,10,11,12,1); + Aff_transformation_3 a6 = + construct_aff_transformation(1,2,3,4,5,6,7,8,9); + Aff_transformation_3 a61 = + construct_aff_transformation(1,2,3,4,5,6,7,8,9,10); + + + typename R::Construct_point_on_3 construct_point_on + = rep.construct_point_on_3_object(); + Point_3 tmp1 = construct_point_on(l2); + + + typename R::Construct_second_point_on_3 construct_second_point_on + = rep.construct_second_point_on_3_object(); + Point_3 tmp2 = construct_second_point_on(r2); + + + typename R::Construct_perpendicular_plane_3 construct_perpendicular_plane + = rep.construct_perpendicular_plane_3(); + Plane_3 tmp3 = construct_perpendicular_plane(l2,p2); + + + typename R::Construct_midpoint_3 construct_midpoint + = rep.construct_midpoint_3_object(); + Point_3 tmp4 = construct_midpoint(p2,p3); + + + typename R::Construct_circumcenter_3 construct_circumcenter + = rep.construct_circumcenter_3_object(); + tmp4 = construct_circumcenter(p2,p3,p4,p5); + + + typename R::Construct_opposite_segment_3 construct_opposite_segment + = rep.construct_opposite_segment_3_object(); + Segment_3 tmp5 = construct_opposite_segment(s2); + + + typename R::Construct_opposite_ray_3 construct_opposite_ray + = rep.construct_opposite_ray_3_object(); + Ray_3 tmp6 = construct_opposite_ray(r2); + + + typename R::Construct_opposite_line_3 construct_opposite_line + = rep.construct_opposite_line_3_object(); + Line_3 tmp7 = construct_opposite_line(l2); + + + typename R::Construct_supporting_plane_3 construct_supporting_plane + = rep.construct_supporting_plane_3_object(); + Plane_3 tmp8 = construct_supporting_plane(t2); + + + typename R::Transform_3 transform + = rep.transform_3_object(); + Point_3 tmp9a = transform(p2,a2); + Triangle_3 tmp9b = transform(t2,a2); + + + typename R::Intersect_3 intersect + = rep.intersect_3_object(); + Object3 tmp10a = intersect(l2,h2); + Object3 tmp10b = intersect(r2,h2); + + bool tmp12a; + bool tmp12b; + + typename R::Assign_3 assign + = rep.assign_3_object(); + tmp12a = assign(p1,tmp10a); + tmp12b = assign(p1,tmp10b); + + + typename R::Compute_squared_length_3 compute_squared_length + = rep.compute_squared_length_3_object(); + FT tmp11 = compute_squared_length(s2); + + + typename R::Equal_3 equal + = rep.equal_3_object(); + tmp12a = equal(p2,p3); + tmp12b = equal(l2,l3); + + + typename R::Equal_x_3 equal_x + = rep.equal_x_3_object(); + bool tmp13 = equal_x(p2,p3); + + + typename R::Equal_y_3 equal_y + = rep.equal_y_3_object(); + bool tmp14 = equal_y(p2,p3); + + + typename R::Equal_z_3 equal_z + = rep.equal_z_3_object(); + bool tmp15 = equal_z(p2,p3); + + + typename R::Equal_xy_3 equal_xy + = rep.equal_xy_3_object(); + bool tmp16 = equal_xy(p2,p3); + + + typename R::Equal_xyz_3 equal_xyz + = rep.equal_xyz_3_object(); + bool tmp17 = equal_xyz(p2,p3); + + + typename R::Less_x_3 less_x + = rep.less_x_3_object(); + bool tmp18 = less_x(p2,p3); + + + typename R::Less_y_3 less_y + = rep.less_y_3_object(); + bool tmp19 = less_y(p2,p3); + + + typename R::Less_z_3 less_z + = rep.less_z_3_object(); + bool tmp20 = less_z(p2,p3); + + + typename R::Less_xy_3 less_xy + = rep.less_xy_3_object(); + bool tmp21 = less_xy(p2,p3); + + + typename R::Less_xyz_3 less_xyz + = rep.less_xyz_3_object(); + bool tmp22 = less_xyz(p2,p3); + + + typename R::Compare_x_3 compare_x + = rep.compare_x_3_object(); + Comparison_result tmp23 = compare_x(p2,p3); + + + typename R::Compare_y_3 compare_y + = rep.compare_y_3_object(); + Comparison_result tmp24 = compare_y(p2,p3); + + + typename R::Compare_z_3 compare_z + = rep.compare_z_3_object(); + Comparison_result tmp25 = compare_z(p2,p3); + + + typename R::Compare_xy_3 compare_xy + = rep.compare_xy_3_object(); + Comparison_result tmp26 = compare_xy(p2,p3); + + + typename R::Compare_xyz_3 compare_xyz + = rep.compare_xyz_3_object(); + Comparison_result tmp27 = compare_xyz(p2,p3); + + typename R::Less_distance_to_point_3 less_distance_to_point + = rep.less_distance_to_point_3_object(p4); + bool tmp28 = less_distance_to_point(p2,p3); + + + typename R::Collinear_3 collinear + = rep.collinear_3_object(); + bool tmp29 = collinear(p2,p3,p4); + + + typename R::Coplanar_3 coplanar + = rep.coplanar_3_object(); + bool tmp30 = coplanar(p2,p3,p4,p5); + + + typename R::Orientation_3 orientation + = rep.orientation_3_object(); + Orientation tmp31 = orientation(p2,p3,p4,p5); + + + typename R::Is_degenerate_3 is_degenerate + = rep.is_degenerate_3_object(); + bool tmp32 = is_degenerate(l2); + + + typename R::Has_on_3 has_on + = rep.has_on_3_object(); + bool tmp33a = has_on(l2,p2); + bool tmp33b = has_on(t2,p2); + + + typename R::Has_on_bounded_side_3 has_on_bounded_side + = rep.has_on_bounded_side_3_object(); + bool tmp34 = has_on_bounded_side(th2,p2); + + + typename R::Has_on_unbounded_side_3 has_on_unbounded_side + = rep.has_on_unbounded_side_3_object(); + bool tmp35 = has_on_unbounded_side(th2,p2); + + + typename R::Has_on_boundary_3 has_on_boundary + = rep.has_on_boundary_3_object(); + bool tmp36a = has_on_boundary(h2,p2); + bool tmp36b = has_on_boundary(th2,p2); + + + typename R::Has_on_positive_side_3 has_on_positive_side + = rep.has_on_positive_side_3_object(); + bool tmp37 = has_on_positive_side(h2,p2); + + + typename R::Has_on_negative_side_3 has_on_negative_side + = rep.has_on_negative_side_3_object(); + bool tmp38 = has_on_negative_side(h2,p2); + + + typename R::Oriented_side_3 oriented_side + = rep.oriented_side_3_object(); + Oriented_side tmp39 = oriented_side(h2,p2); + + + typename R::Are_ordered_along_line_3 are_ordered_along_line + = rep.are_ordered_along_line_3_object(); + bool tmp40 = are_ordered_along_line(p2,p3,p4); + + + typename R::Are_strictly_ordered_along_line_3 are_strictly_ordered_along_line + = rep.are_strictly_ordered_along_line_3_object(); + bool tmp41 = are_strictly_ordered_along_line(p2,p3,p4); + + + typename R::Collinear_are_ordered_along_line_3 collinear_are_ordered_along_line + = rep.collinear_are_ordered_along_line_3_object(); + bool tmp42 = collinear_are_ordered_along_line(p2,p2,p3); + + + typename R::Collinear_are_strictly_ordered_along_line_3 collinear_are_strictly_ordered_along_line + = rep.collinear_are_strictly_ordered_along_line_3_object(); + bool tmp43 = collinear_are_strictly_ordered_along_line(p2,p2,p3); + + + typename R::Side_of_oriented_sphere_3 side_of_oriented_sphere + = rep.side_of_oriented_sphere_3_object(); + Oriented_side tmp44 = side_of_oriented_sphere(p2,p3,p4,p5,p6); + + + typename R::Side_of_bounded_sphere_3 side_of_bounded_sphere + = rep.side_of_bounded_sphere_3_object(); + Bounded_side tmp45 = side_of_bounded_sphere(p2,p3,p4,p5,p6); + + use(tmp45); use(tmp44); use(tmp43); use(tmp42); use(tmp41); use(tmp40); + use(tmp39); use(tmp38); use(tmp37); use(tmp36b); use(tmp36a); use(tmp35); + use(tmp34); use(tmp33b); use(tmp33a); use(tmp32); use(tmp31); use(tmp30); + use(tmp29); use(tmp27); use(tmp25); use(tmp24); use(tmp23); use(tmp22); + use(tmp15); use(tmp14); use(tmp13); use(tmp12b); use(tmp12a); + use(tmp16); use(tmp17); use(tmp18); use(tmp19); use(tmp20); use(tmp21); + use(tmp26); use(tmp28); + + + return true; +} + +#endif // CGAL_TEST_NEW_3_H diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_orientation_and_bounded_side.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_orientation_and_bounded_side.C new file mode 100644 index 00000000000..c31e1488bd8 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_orientation_and_bounded_side.C @@ -0,0 +1,68 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : +// file : _test_orientation_and_bounded_side.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_ORIENTATION_AND_BOUNDED_SIDE_C +#define CGAL__TEST_ORIENTATION_AND_BOUNDED_SIDE_C + +#ifndef CGAL__TEST_ORIENTATION_AND_BOUNDED_SIDE_H +#include +#endif // CGAL__TEST_ORIENTATION_AND_BOUNDED_SIDE_H + + +template +bool +_test_orientation_and_bounded_side(const R&) +{ + typedef typename R::RT RT; + typedef typename R::FT FT; + const RT RT0(0); + const RT RT1(1); + typedef CGAL::Point_2 Point_2; + typedef CGAL::Point_3 Point_3; + + Point_2 e0( RT1, RT0); + Point_2 e1( RT0, RT1); + Point_2 e(-RT1, RT0); + Point_2 org( RT0, RT0); + assert( CGAL::orientation( org, e0, e1) == CGAL::POSITIVE ); + assert( CGAL::orientation( e0, e1, e) == CGAL::POSITIVE ); + assert( CGAL::side_of_oriented_circle( e0, e1, e, org) == \ + CGAL::ON_POSITIVE_SIDE ); + + Point_3 s0( RT1, RT0, RT0); + Point_3 s1( RT0, RT1, RT0); + Point_3 s2( RT0, RT0, RT1); + Point_3 s(-RT1, RT0, RT0); + Point_3 org3( RT0, RT0, RT0); + assert( CGAL::orientation( org3, s0, s1, s2) == CGAL::POSITIVE ); + assert( CGAL::orientation( s, s0, s1, s2) == CGAL::POSITIVE ); + assert( CGAL::side_of_oriented_sphere( s, s0, s1, s2, org3) == \ + CGAL::ON_POSITIVE_SIDE ); + + return true; +} + + +#endif // CGAL__TEST_ORIENTATION_AND_BOUNDED_SIDE_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_orientation_and_bounded_side.h b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_orientation_and_bounded_side.h new file mode 100644 index 00000000000..5632c7a1a49 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_orientation_and_bounded_side.h @@ -0,0 +1,42 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : +// file : _test_orientation_and_bounded_side.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_ORIENTATION_AND_BOUNDED_SIDE_H +#define CGAL__TEST_ORIENTATION_AND_BOUNDED_SIDE_H + +#include +#include + + +template +bool +_test_orientation_and_bounded_side(const R&); + + +#ifdef CGAL_CFG_NO_AUTOMATIC_TEMPLATE_INCLUSION +#include +#endif // CGAL_CFG_NO_AUTOMATIC_TEMPLATE_INCLUSION + +#endif // CGAL__TEST_ORIENTATION_AND_BOUNDED_SIDE_H diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_pvd_2.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_pvd_2.C new file mode 100644 index 00000000000..29e0870abc3 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_pvd_2.C @@ -0,0 +1,57 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_pvd_2.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_PVD_2_C +#define CGAL__TEST_PVD_2_C + +#include +#include +#include +#include +#include +#include +#include +#include + + +template bool _test_pvd_2(const R& r); + + +template +bool +_test_pvd_2(const R& r) +{ + return + _test_cls_vector_2(r) + && _test_fct_vector_2(r) + && _test_cls_point_2(r) + && _test_fct_point_vector_2(r) + && _test_fct_point_2(r) + && _test_further_fct_point_2(r) + && _test_cls_direction_2(r) + && _test_fct_direction_2(r) + ; +} +#endif // CGAL__TEST_PVD_2_C diff --git a/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_pvd_3.C b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_pvd_3.C new file mode 100644 index 00000000000..636d3a2d1d4 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/include/CGAL/_test_pvd_3.C @@ -0,0 +1,52 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_pvd_3.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_PVD_3_C +#define CGAL__TEST_PVD_3_C + +#include +#include +#include +#include +#include +#include + + +template bool _test_pvd_3(const R& r); + + +template +bool +_test_pvd_3(const R& r) +{ + return + _test_cls_vector_3(r) + && _test_fct_vector_3(r) + && _test_cls_point_3(r) + && _test_fct_point_vector_3(r) + && _test_fct_point_3(r) + && _test_cls_direction_3(r) ; +} +#endif // CGAL__TEST_PVD_3_C diff --git a/Old_Packages/Kernel_test/test/Kernel/makefile b/Old_Packages/Kernel_test/test/Kernel/makefile new file mode 100644 index 00000000000..d42547ba387 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/makefile @@ -0,0 +1,56 @@ +# Created by the script create_makefile +# This is the makefile for compiling a CGAL application. + +#---------------------------------------------------------------------# +# include platform specific settings +#---------------------------------------------------------------------# +# Choose the right include file from the /make directory. +include $(CGAL_MAKEFILE) +#include /KM/projects/CGAL/Work_in_Progress/CGAL-2.1-I-32/make/makefile_sparc_SunOS-5.6_g++-2.95.2_LEDA++ +#include /KM/projects/CGAL/Work_in_Progress/CGAL-2.1-I-39/make/makefile_sparc_SunOS-5.6_g++-2.95.2_LEDA++ + +#---------------------------------------------------------------------# +# compiler flags +#---------------------------------------------------------------------# + +CXXFLAGS = \ + $(TESTSUITE_CXXFLAGS) \ + $(EXTRA_FLAGS) \ + -Iinclude \ + $(CGAL_CXXFLAGS) \ + $(DEBUG_OPT) + +# -DCGAL_NO_LEDA_HANDLE \ + +#---------------------------------------------------------------------# +# linker flags +#---------------------------------------------------------------------# + +LIBPATH = \ + $(TESTSUITE_LIBPATH) \ + $(CGAL_LIBPATH) + +LDFLAGS = \ + $(TESTSUITE_LDFLAGS) \ + $(CGAL_LDFLAGS) + +#---------------------------------------------------------------------# +# target entries +#---------------------------------------------------------------------# + +all: \ + test_kernel__ + +test_kernel__$(EXE_EXT): test_kernel__$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_kernel__ test_kernel__$(OBJ_EXT) $(LDFLAGS) + +clean: \ + test_kernel__.clean + +#---------------------------------------------------------------------# +# suffix rules +#---------------------------------------------------------------------# + +.C$(OBJ_EXT): + $(CGAL_CXX) $(CXXFLAGS) $(OBJ_OPT) $< + diff --git a/Old_Packages/Kernel_test/test/Kernel/test_kernel__.C b/Old_Packages/Kernel_test/test/Kernel/test_kernel__.C new file mode 100644 index 00000000000..6c896504b95 --- /dev/null +++ b/Old_Packages/Kernel_test/test/Kernel/test_kernel__.C @@ -0,0 +1,75 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_programs.fw +// file : test_kernel__.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include +#ifdef CGAL_USE_GMP +#include +#endif // CGAL_USE_GMP +#include +#include +#include +#include +#include +#include +#include +#ifdef CGAL_USE_LEDA +#include +#endif // CGAL_USE_LEDA + +int +main() +{ + std::cout << "Testing miscellanous" << std::endl; +#ifdef CGAL_USE_GMP + typedef CGAL::Gmpz Precise_integer; +#else +# ifdef CGAL_USE_LEDA + typedef leda_integer Precise_integer; +# endif // CGAL_USE_LEDA +#endif // CGAL_USE_GMP + typedef CGAL::Homogeneous H_Cls; + typedef CGAL::Cartesian > C_Cls; + typedef CGAL::Simple_cartesian > S_Cls; + _test_cls_object( C_Cls() ); + _test_cls_object( H_Cls() ); + _test_cls_object( S_Cls() ); + _test_cls_quotient( int(1) ); + _test_cls_quotient( double(1.0) ); + _test_cls_quotient( long(1) ); + _test_cls_quotient( short(1) ); + _test_fct_determinant( Precise_integer(1) ); + _test_fct_point_conversion( int(1) ); + _test_fct_point_conversion( double(1.0) ); +#ifdef CGAL_USE_GMP + _test_cls_quotient( CGAL::Gmpz(1) ); + _test_fct_point_conversion( CGAL::Gmpz(1) ); +#endif // CGAL_USE_GMP +#ifdef CGAL_USE_LEDA + _test_cls_quotient( leda_integer(1) ); + _test_fct_point_conversion( leda_integer(1) ); +#endif // CGAL_USE_LEDA + return 0; +} diff --git a/Old_Packages/Kernel_test/test/KernelCartesian/cgal_test b/Old_Packages/Kernel_test/test/KernelCartesian/cgal_test new file mode 100755 index 00000000000..f3e2f36f1d1 --- /dev/null +++ b/Old_Packages/Kernel_test/test/KernelCartesian/cgal_test @@ -0,0 +1,73 @@ +#! /bin/sh +# This is a script for the CGAL test suite. Such a script must obey +# the following rules: +# +# - the name of the script is cgal_test +# - for every target two one line messages are written to the file 'error.txt' +# the first one indicates if the compilation was successful +# the second one indicates if the execution was successful +# if one of the two was not successful, the line should start with 'ERROR:' +# - running the script should not require any user interaction +# - the script should clean up object files and executables + +ERRORFILE=error.txt + +#---------------------------------------------------------------------# +# compile_and_run +#---------------------------------------------------------------------# + +compile_and_run() +{ + echo "Compiling $1 ... " + if eval 'make CGAL_MAKEFILE=$CGAL_MAKEFILE \ + TESTSUITE_CXXFLAGS="$TESTSUITE_CXXFLAGS" \ + TESTSUITE_LDFLAGS="$TESTSUITE_LDFLAGS" $1' ; then + echo " compilation of $1 succeeded" >> $ERRORFILE + else + echo " ERROR: compilation of $1 failed" >> $ERRORFILE + fi + + if [ -f $1 ] ; then + OUTPUTFILE=ProgramOutput.$1.$PLATFORM + rm -f $OUTPUTFILE + COMMAND="./$1" + if [ -f $1.cmd ] ; then + COMMAND="$COMMAND '`cat $1.cmd`'" + fi + if [ -f $1.cin ] ; then + COMMAND="echo '`cat $1.cin`' | $COMMAND" + fi + echo "Executing $1 ... " + echo + if eval 2>&1 $COMMAND > $OUTPUTFILE ; then + echo " execution of $1 succeeded" >> $ERRORFILE + else + echo " ERROR: execution of $1 failed" >> $ERRORFILE + fi + else + echo " ERROR: could not execute $1" >> $ERRORFILE + fi + + eval "2>&1 make CGAL_MAKEFILE=$CGAL_MAKEFILE clean > /dev/null " +} + +#---------------------------------------------------------------------# +# remove the previous error file +#---------------------------------------------------------------------# + +rm -f $ERRORFILE +touch $ERRORFILE + +#---------------------------------------------------------------------# +# compile and run the tests +#---------------------------------------------------------------------# + + +compile_and_run test_kernelC2 +compile_and_run test_predicate_classes_2C +compile_and_run test_kernelC3 +compile_and_run test_new_partsC_ +compile_and_run test_planeC3_to_2d +compile_and_run test_kernelCd +compile_and_run test_new_kernelC2 +compile_and_run test_new_kernelC3 diff --git a/Old_Packages/Kernel_test/test/KernelCartesian/makefile b/Old_Packages/Kernel_test/test/KernelCartesian/makefile new file mode 100644 index 00000000000..e529ac6c983 --- /dev/null +++ b/Old_Packages/Kernel_test/test/KernelCartesian/makefile @@ -0,0 +1,89 @@ +# Created by the script create_makefile +# This is the makefile for compiling a CGAL application. + +#---------------------------------------------------------------------# +# include platform specific settings +#---------------------------------------------------------------------# +# Choose the right include file from the /make directory. +include $(CGAL_MAKEFILE) + +#---------------------------------------------------------------------# +# compiler flags +#---------------------------------------------------------------------# + +CXXFLAGS = \ + $(TESTSUITE_CXXFLAGS) \ + $(EXTRA_FLAGS) \ + -I../Kernel/include \ + $(CGAL_CXXFLAGS) \ + $(DEBUG_OPT) + +#---------------------------------------------------------------------# +# linker flags +#---------------------------------------------------------------------# + +LIBPATH = \ + $(TESTSUITE_LIBPATH) \ + $(CGAL_LIBPATH) + +LDFLAGS = \ + $(TESTSUITE_LDFLAGS) \ + $(CGAL_LDFLAGS) + +#---------------------------------------------------------------------# +# target entries +#---------------------------------------------------------------------# + +all: \ + test_kernelC2 \ + test_kernelC3 \ + test_kernelCd \ + test_planeC3_to_2d \ + test_new_partsC_ \ + test_predicate_classes_2C \ + test_new_kernelC2 \ + test_new_kernelC3 + + +test_kernelC2$(EXE_EXT): test_kernelC2$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_kernelC2 test_kernelC2$(OBJ_EXT) $(LDFLAGS) + +test_kernelC3$(EXE_EXT): test_kernelC3$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_kernelC3 test_kernelC3$(OBJ_EXT) $(LDFLAGS) + +test_kernelCd$(EXE_EXT): test_kernelCd$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_kernelCd test_kernelCd$(OBJ_EXT) $(LDFLAGS) + +test_planeC3_to_2d$(EXE_EXT): test_planeC3_to_2d$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_planeC3_to_2d test_planeC3_to_2d$(OBJ_EXT) $(LDFLAGS) + +test_new_partsC_$(EXE_EXT): test_new_partsC_$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_new_partsC_ test_new_partsC_$(OBJ_EXT) $(LDFLAGS) + +test_predicate_classes_2C$(EXE_EXT): test_predicate_classes_2C$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_predicate_classes_2C test_predicate_classes_2C$(OBJ_EXT) $(LDFLAGS) + +test_new_kernelC2$(EXE_EXT): test_new_kernelC2$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_new_kernelC2 test_new_kernelC2$(OBJ_EXT) $(LDFLAGS) + +test_new_kernelC3$(EXE_EXT): test_new_kernelC3$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_new_kernelC3 test_new_kernelC3$(OBJ_EXT) $(LDFLAGS) + + +clean: \ + test_kernelC2.clean \ + test_kernelC3.clean \ + test_kernelCd.clean \ + test_planeC3_to_2d.clean \ + test_new_partsC_.clean \ + test_predicate_classes_2C.clean \ + test_new_kernelC2.clean \ + test_new_kernelC3.clean + +#---------------------------------------------------------------------# +# suffix rules +#---------------------------------------------------------------------# + +.C$(OBJ_EXT): + $(CGAL_CXX) $(CXXFLAGS) $(OBJ_OPT) $< + diff --git a/Old_Packages/Kernel_test/test/KernelCartesian/test_kernelC2.C b/Old_Packages/Kernel_test/test/KernelCartesian/test_kernelC2.C new file mode 100644 index 00000000000..c52be0e160d --- /dev/null +++ b/Old_Packages/Kernel_test/test/KernelCartesian/test_kernelC2.C @@ -0,0 +1,51 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_programs.fw +// file : test_kernelC2.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include + +#ifdef CGAL_USE_GMP +# include +typedef CGAL::Gmpz Precise_integer; +#else +# ifdef CGAL_USE_LEDA +# include +typedef leda_integer Precise_integer; +# endif // CGAL_USE_LEDA +#endif // CGAL_USE_GMP + +#include +#include +#include + +int +main() +{ + typedef CGAL::Cartesian > Cls; + std::cout << "Testing 2d with Cartesian> :"; + std::cout << std::endl; + _test_2( Cls() ); + return 0; +} diff --git a/Old_Packages/Kernel_test/test/KernelCartesian/test_kernelC3.C b/Old_Packages/Kernel_test/test/KernelCartesian/test_kernelC3.C new file mode 100644 index 00000000000..a7fea8b40d3 --- /dev/null +++ b/Old_Packages/Kernel_test/test/KernelCartesian/test_kernelC3.C @@ -0,0 +1,51 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_programs.fw +// file : test_kernelC3.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include + +#ifdef CGAL_USE_GMP +# include +typedef CGAL::Gmpz Precise_integer; +#else +# ifdef CGAL_USE_LEDA +# include +typedef leda_integer Precise_integer; +# endif // CGAL_USE_LEDA +#endif // CGAL_USE_GMP + +#include +#include +#include + +int +main() +{ + typedef CGAL::Cartesian > Cls; + std::cout << "Testing 3d with Cartesian> :"; + std::cout << std::endl; + _test_3( Cls() ); + return 0; +} diff --git a/Old_Packages/Kernel_test/test/KernelCartesian/test_kernelCd.C b/Old_Packages/Kernel_test/test/KernelCartesian/test_kernelCd.C new file mode 100644 index 00000000000..4b9d4fd680e --- /dev/null +++ b/Old_Packages/Kernel_test/test/KernelCartesian/test_kernelCd.C @@ -0,0 +1,40 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_programs.fw +// file : test_kernelCd.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include +#include +#include +#include +#include + +typedef CGAL::Cartesian RC; + +int +main() +{ + _test_cls_point_d( RC() ); + return 0; +} diff --git a/Old_Packages/Kernel_test/test/KernelCartesian/test_new_kernelC2.C b/Old_Packages/Kernel_test/test/KernelCartesian/test_new_kernelC2.C new file mode 100644 index 00000000000..697752485ed --- /dev/null +++ b/Old_Packages/Kernel_test/test/KernelCartesian/test_new_kernelC2.C @@ -0,0 +1,55 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : NewKernel/test_programs.fw +// file : test/KernelCartesian/test_new_kernelC2.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include +#ifdef CGAL_USE_LEDA +#include +#include +typedef leda_integer Precise_integer; +typedef leda_rational Precise_rational; +#else +# ifdef CGAL_USE_GMP +#include +#include +typedef CGAL::Gmpz Precise_integer; +typedef CGAL::Quotient Precise_rational; +# endif // CGAL_USE_GMP +#endif // CGAL_USE_LEDA + + + +#include + + +typedef CGAL::Cartesian Kernel; + + +int main() +{ + test_new_2( Kernel() ); + return 0; +} + diff --git a/Old_Packages/Kernel_test/test/KernelCartesian/test_new_kernelC3.C b/Old_Packages/Kernel_test/test/KernelCartesian/test_new_kernelC3.C new file mode 100644 index 00000000000..e4cf2332b94 --- /dev/null +++ b/Old_Packages/Kernel_test/test/KernelCartesian/test_new_kernelC3.C @@ -0,0 +1,54 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : NewKernel/test_programs.fw +// file : test/KernelCartesian/test_new_kernelC3.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include +#ifdef CGAL_USE_LEDA +#include +#include +typedef leda_integer Precise_integer; +typedef leda_rational Precise_rational; +#else +# ifdef CGAL_USE_GMP +#include +#include +typedef CGAL::Gmpz Precise_integer; +typedef CGAL::Quotient Precise_rational; +# endif // CGAL_USE_GMP +#endif // CGAL_USE_LEDA + + + +#include + + +typedef CGAL::Cartesian Kernel; + +int main() +{ + test_new_3( Kernel() ); + return 0; +} + diff --git a/Old_Packages/Kernel_test/test/KernelCartesian/test_new_partsC_.C b/Old_Packages/Kernel_test/test/KernelCartesian/test_new_partsC_.C new file mode 100644 index 00000000000..1b2ef365640 --- /dev/null +++ b/Old_Packages/Kernel_test/test/KernelCartesian/test_new_partsC_.C @@ -0,0 +1,69 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : news.fw +// file : test_new_partsC_.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include +#ifdef CGAL_USE_GMP +# include +typedef CGAL::Gmpz Precise_integer; +#else +# ifdef CGAL_USE_LEDA +# include +typedef leda_integer Precise_integer; +# endif // CGAL_USE_LEDA +#endif // CGAL_USE_GMP + + +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef CGAL_STRICT21 +#include +#endif // CGAL_STRICT21 + + +int +main() +{ + typedef CGAL::Cartesian > Cls; + std::cout << "Testing new parts with Cartesian> :"; + std::cout << std::endl; + _test_orientation_and_bounded_side( Cls() ); + _test_fct_points_implicit_sphere( Cls() ); + _test_fct_constructions_2( Cls() ); + _test_fct_constructions_3( Cls() ); + _test_fct_point_3( Cls() ); + _test_fct_coplanar_3( Cls() ); + #ifndef CGAL_STRICT21 + _test_cls_iso_cuboid_3( Cls() ); + #endif // CGAL_STRICT21 + + return 0; +} diff --git a/Old_Packages/Kernel_test/test/KernelCartesian/test_planeC3_to_2d.C b/Old_Packages/Kernel_test/test/KernelCartesian/test_planeC3_to_2d.C new file mode 100644 index 00000000000..0de1ab79efd --- /dev/null +++ b/Old_Packages/Kernel_test/test/KernelCartesian/test_planeC3_to_2d.C @@ -0,0 +1,52 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_programs.fw +// file : test_planeC3_to_2d.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include + +#ifdef CGAL_USE_GMP +# include +typedef CGAL::Gmpz Precise_integer; +#else +# ifdef CGAL_USE_LEDA +# include +typedef leda_integer Precise_integer; +# endif // CGAL_USE_LEDA +#endif // CGAL_USE_GMP + +#include +#include +#include + +int +main() +{ + typedef CGAL::Cartesian > C_Cls; + std::cout << "Testing with Cartesian > :"; + std::cout << std::endl; + _test_mf_plane_3_to_2d( C_Cls() ); + + return 0; +} diff --git a/Old_Packages/Kernel_test/test/KernelCartesian/test_predicate_classes_2C.C b/Old_Packages/Kernel_test/test/KernelCartesian/test_predicate_classes_2C.C new file mode 100644 index 00000000000..ecc3340a86c --- /dev/null +++ b/Old_Packages/Kernel_test/test/KernelCartesian/test_predicate_classes_2C.C @@ -0,0 +1,56 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : +// file : test_predicate_classes_2C.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include +#ifdef CGAL_USE_GMP +# include +typedef CGAL::Gmpz Precise_integer; +#else +# ifdef CGAL_USE_LEDA +# include +typedef leda_integer Precise_integer; +# endif // CGAL_USE_LEDA +#endif // CGAL_USE_GMP + + +#include +#include +#include +#include +#include + +int +main() +{ + typedef CGAL::Cartesian > C_Cls; + typedef CGAL::Point_2 C_Point; + typedef CGAL::Line_2 C_Line; + std::cout << "Testing 2d with Cartesian > :"; + std::cout << std::endl; + _test_fctobj_point_line_2( C_Point(), C_Line()); + + return 0; +} diff --git a/Old_Packages/Kernel_test/test/KernelHomogeneous/cgal_test b/Old_Packages/Kernel_test/test/KernelHomogeneous/cgal_test new file mode 100755 index 00000000000..73ba5dc2c89 --- /dev/null +++ b/Old_Packages/Kernel_test/test/KernelHomogeneous/cgal_test @@ -0,0 +1,72 @@ +#! /bin/sh +# This is a script for the CGAL test suite. Such a script must obey +# the following rules: +# +# - the name of the script is cgal_test +# - for every target two one line messages are written to the file 'error.txt' +# the first one indicates if the compilation was successful +# the second one indicates if the execution was successful +# if one of the two was not successful, the line should start with 'ERROR:' +# - running the script should not require any user interaction +# - the script should clean up object files and executables + +ERRORFILE=error.txt + +#---------------------------------------------------------------------# +# compile_and_run +#---------------------------------------------------------------------# + +compile_and_run() +{ + echo "Compiling $1 ... " + if eval 'make CGAL_MAKEFILE=$CGAL_MAKEFILE \ + TESTSUITE_CXXFLAGS="$TESTSUITE_CXXFLAGS" \ + TESTSUITE_LDFLAGS="$TESTSUITE_LDFLAGS" $1' ; then + echo " compilation of $1 succeeded" >> $ERRORFILE + else + echo " ERROR: compilation of $1 failed" >> $ERRORFILE + fi + + if [ -f $1 ] ; then + OUTPUTFILE=ProgramOutput.$1.$PLATFORM + rm -f $OUTPUTFILE + COMMAND="./$1" + if [ -f $1.cmd ] ; then + COMMAND="$COMMAND '`cat $1.cmd`'" + fi + if [ -f $1.cin ] ; then + COMMAND="echo '`cat $1.cin`' | $COMMAND" + fi + echo "Executing $1 ... " + echo + if eval 2>&1 $COMMAND > $OUTPUTFILE ; then + echo " execution of $1 succeeded" >> $ERRORFILE + else + echo " ERROR: execution of $1 failed" >> $ERRORFILE + fi + else + echo " ERROR: could not execute $1" >> $ERRORFILE + fi + + eval "2>&1 make CGAL_MAKEFILE=$CGAL_MAKEFILE clean > /dev/null " +} + +#---------------------------------------------------------------------# +# remove the previous error file +#---------------------------------------------------------------------# + +rm -f $ERRORFILE +touch $ERRORFILE + +#---------------------------------------------------------------------# +# compile and run the tests +#---------------------------------------------------------------------# + +compile_and_run test_kernelH2 +compile_and_run test_predicate_classes_2H +compile_and_run test_kernelH3 +compile_and_run test_new_partsH_ +compile_and_run test_planeH3_to_2d +compile_and_run test_kernelHd +compile_and_run test_new_kernelH2 +compile_and_run test_new_kernelH3 diff --git a/Old_Packages/Kernel_test/test/KernelHomogeneous/makefile b/Old_Packages/Kernel_test/test/KernelHomogeneous/makefile new file mode 100644 index 00000000000..ef90f45ec9c --- /dev/null +++ b/Old_Packages/Kernel_test/test/KernelHomogeneous/makefile @@ -0,0 +1,88 @@ +# Created by the script create_makefile +# This is the makefile for compiling a CGAL application. + +#---------------------------------------------------------------------# +# include platform specific settings +#---------------------------------------------------------------------# +# Choose the right include file from the /make directory. +include $(CGAL_MAKEFILE) + +#---------------------------------------------------------------------# +# compiler flags +#---------------------------------------------------------------------# + +CXXFLAGS = \ + $(TESTSUITE_CXXFLAGS) \ + $(EXTRA_FLAGS) \ + -I../Kernel/include \ + $(CGAL_CXXFLAGS) \ + $(DEBUG_OPT) + +#---------------------------------------------------------------------# +# linker flags +#---------------------------------------------------------------------# + +LIBPATH = \ + $(TESTSUITE_LIBPATH) \ + $(CGAL_LIBPATH) + +LDFLAGS = \ + $(TESTSUITE_LDFLAGS) \ + $(CGAL_LDFLAGS) + +#---------------------------------------------------------------------# +# target entries +#---------------------------------------------------------------------# + +all: \ + test_kernelH2 \ + test_kernelH3 \ + test_kernelHd \ + test_planeH3_to_2d \ + test_new_partsH_ \ + test_predicate_classes_2H \ + test_new_kernelH2 \ + test_new_kernelH3 + +test_kernelH2$(EXE_EXT): test_kernelH2$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_kernelH2 test_kernelH2$(OBJ_EXT) $(LDFLAGS) + +test_kernelH3$(EXE_EXT): test_kernelH3$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_kernelH3 test_kernelH3$(OBJ_EXT) $(LDFLAGS) + +test_kernelHd$(EXE_EXT): test_kernelHd$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_kernelHd test_kernelHd$(OBJ_EXT) $(LDFLAGS) + +test_planeH3_to_2d$(EXE_EXT): test_planeH3_to_2d$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_planeH3_to_2d test_planeH3_to_2d$(OBJ_EXT) $(LDFLAGS) + +test_new_partsH_$(EXE_EXT): test_new_partsH_$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_new_partsH_ test_new_partsH_$(OBJ_EXT) $(LDFLAGS) + +test_predicate_classes_2H$(EXE_EXT): test_predicate_classes_2H$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_predicate_classes_2H test_predicate_classes_2H$(OBJ_EXT) $(LDFLAGS) + +test_new_kernelH2$(EXE_EXT): test_new_kernelH2$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_new_kernelH2 test_new_kernelH2$(OBJ_EXT) $(LDFLAGS) + +test_new_kernelH3$(EXE_EXT): test_new_kernelH3$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_new_kernelH3 test_new_kernelH3$(OBJ_EXT) $(LDFLAGS) + + +clean: \ + test_kernelH2.clean \ + test_kernelH3.clean \ + test_kernelHd.clean \ + test_planeH3_to_2d.clean \ + test_new_partsH_.clean \ + test_predicate_classes_2H.clean \ + test_new_kernelH2.clean \ + test_new_kernelH3.clean + +#---------------------------------------------------------------------# +# suffix rules +#---------------------------------------------------------------------# + +.C$(OBJ_EXT): + $(CGAL_CXX) $(CXXFLAGS) $(OBJ_OPT) $< + diff --git a/Old_Packages/Kernel_test/test/KernelHomogeneous/test_basic_constructionsH3.C b/Old_Packages/Kernel_test/test/KernelHomogeneous/test_basic_constructionsH3.C new file mode 100644 index 00000000000..27b97dcdf16 --- /dev/null +++ b/Old_Packages/Kernel_test/test/KernelHomogeneous/test_basic_constructionsH3.C @@ -0,0 +1,69 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_programs.fw +// file : test_basic_constructionsH3.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include + +#ifdef CGAL_USE_GMP +# include +typedef CGAL::Gmpz Precise_integer; +#else +# ifdef CGAL_USE_LEDA +# include +typedef leda_integer Precise_integer; +# endif // CGAL_USE_LEDA +#endif // CGAL_USE_GMP + +#include +#include +#include +#include +#include +#include + +int +main() +{ + typedef CGAL::Homogeneous H_Cls; + typedef CGAL::Point_3< H_Cls > Point; + typedef CGAL::Line_3< H_Cls > Line; + typedef CGAL::Plane_3< H_Cls > Plane; + + Point ep1( 8, 2, 4, 1); + Point ep2( 9, 3,18, 3); + Point ep3(12,24,-6, 2); + Point p( 17, 12, 4, 1); + + Plane pl( ep1, ep2, ep3); + CGAL::Object o = CGAL::intersection( pl, Line( p, pl.orthogonal_direction())); + Point ip; + assert( CGAL::assign(ip,o) ); + assert( pl.has_on(ip) ); + Point pp = CGAL::_projection(p, pl); + assert( pl.has_on(pp) ); + assert( pp == ip ); + + return 0; +} diff --git a/Old_Packages/Kernel_test/test/KernelHomogeneous/test_kernelH2.C b/Old_Packages/Kernel_test/test/KernelHomogeneous/test_kernelH2.C new file mode 100644 index 00000000000..151a27170c1 --- /dev/null +++ b/Old_Packages/Kernel_test/test/KernelHomogeneous/test_kernelH2.C @@ -0,0 +1,49 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_programs.fw +// file : test_kernelH2.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include + +#ifdef CGAL_USE_GMP +# include +typedef CGAL::Gmpz Precise_integer; +#else +# ifdef CGAL_USE_LEDA +# include +typedef leda_integer Precise_integer; +# endif // CGAL_USE_LEDA +#endif // CGAL_USE_GMP + +#include +#include + +int +main() +{ + typedef CGAL::Homogeneous Cls; + std::cout << "Testing 2d with Homogeneous :" << std::endl; + _test_2( Cls() ); + return 0; +} diff --git a/Old_Packages/Kernel_test/test/KernelHomogeneous/test_kernelH3.C b/Old_Packages/Kernel_test/test/KernelHomogeneous/test_kernelH3.C new file mode 100644 index 00000000000..68503859670 --- /dev/null +++ b/Old_Packages/Kernel_test/test/KernelHomogeneous/test_kernelH3.C @@ -0,0 +1,49 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_programs.fw +// file : test_kernelH3.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include + +#ifdef CGAL_USE_GMP +# include +typedef CGAL::Gmpz Precise_integer; +#else +# ifdef CGAL_USE_LEDA +# include +typedef leda_integer Precise_integer; +# endif // CGAL_USE_LEDA +#endif // CGAL_USE_GMP + +#include +#include + +int +main() +{ + typedef CGAL::Homogeneous Cls; + std::cout << "Testing 3d with Homogeneous :" << std::endl; + _test_3( Cls() ); + return 0; +} diff --git a/Old_Packages/Kernel_test/test/KernelHomogeneous/test_kernelHd.C b/Old_Packages/Kernel_test/test/KernelHomogeneous/test_kernelHd.C new file mode 100644 index 00000000000..a4ab1787fe3 --- /dev/null +++ b/Old_Packages/Kernel_test/test/KernelHomogeneous/test_kernelHd.C @@ -0,0 +1,40 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_programs.fw +// file : test_kernelHd.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include +#include +#include +#include +#include + +typedef CGAL::Homogeneous RH; + +int +main() +{ + _test_cls_point_d( RH() ); + return 0; +} diff --git a/Old_Packages/Kernel_test/test/KernelHomogeneous/test_new_kernelH2.C b/Old_Packages/Kernel_test/test/KernelHomogeneous/test_new_kernelH2.C new file mode 100644 index 00000000000..fe8d0224b48 --- /dev/null +++ b/Old_Packages/Kernel_test/test/KernelHomogeneous/test_new_kernelH2.C @@ -0,0 +1,55 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : NewKernel/test_programs.fw +// file : test/KernelHomogeneous/test_new_kernelH2.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include +#ifdef CGAL_USE_LEDA +#include +#include +typedef leda_integer Precise_integer; +typedef leda_rational Precise_rational; +#else +# ifdef CGAL_USE_GMP +#include +#include +typedef CGAL::Gmpz Precise_integer; +typedef CGAL::Quotient Precise_rational; +# endif // CGAL_USE_GMP +#endif // CGAL_USE_LEDA + + + +#include + + +typedef CGAL::Homogeneous Kernel; + + +int main() +{ + test_new_2( Kernel() ); + return 0; +} + diff --git a/Old_Packages/Kernel_test/test/KernelHomogeneous/test_new_kernelH3.C b/Old_Packages/Kernel_test/test/KernelHomogeneous/test_new_kernelH3.C new file mode 100644 index 00000000000..a855fe25a66 --- /dev/null +++ b/Old_Packages/Kernel_test/test/KernelHomogeneous/test_new_kernelH3.C @@ -0,0 +1,54 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : NewKernel/test_programs.fw +// file : test/KernelHomogeneous/test_new_kernelH3.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include +#ifdef CGAL_USE_LEDA +#include +#include +typedef leda_integer Precise_integer; +typedef leda_rational Precise_rational; +#else +# ifdef CGAL_USE_GMP +#include +#include +typedef CGAL::Gmpz Precise_integer; +typedef CGAL::Quotient Precise_rational; +# endif // CGAL_USE_GMP +#endif // CGAL_USE_LEDA + + + +#include + + +typedef CGAL::Homogeneous Kernel; + +int main() +{ + test_new_3( Kernel() ); + return 0; +} + diff --git a/Old_Packages/Kernel_test/test/KernelHomogeneous/test_new_partsH_.C b/Old_Packages/Kernel_test/test/KernelHomogeneous/test_new_partsH_.C new file mode 100644 index 00000000000..62c72d090fc --- /dev/null +++ b/Old_Packages/Kernel_test/test/KernelHomogeneous/test_new_partsH_.C @@ -0,0 +1,68 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : news.fw +// file : test_new_partsH_.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include +#ifdef CGAL_USE_GMP +# include +typedef CGAL::Gmpz Precise_integer; +#else +# ifdef CGAL_USE_LEDA +# include +typedef leda_integer Precise_integer; +# endif // CGAL_USE_LEDA +#endif // CGAL_USE_GMP + + +#include +#include +#include +#include +#include +#include +#include +#ifndef CGAL_STRICT21 +#include +#endif // CGAL_STRICT21 + + +int +main() +{ + typedef CGAL::Homogeneous Cls; + std::cout << "Testing new parts with Homogeneous :"; + std::cout << std::endl; + _test_orientation_and_bounded_side( Cls() ); + _test_fct_points_implicit_sphere( Cls() ); + _test_fct_constructions_2( Cls() ); + _test_fct_constructions_3( Cls() ); + _test_fct_point_3( Cls() ); + _test_fct_coplanar_3( Cls() ); + #ifndef CGAL_STRICT21 + _test_cls_iso_cuboid_3( Cls() ); + #endif // CGAL_STRICT21 + + return 0; +} diff --git a/Old_Packages/Kernel_test/test/KernelHomogeneous/test_planeH3_to_2d.C b/Old_Packages/Kernel_test/test/KernelHomogeneous/test_planeH3_to_2d.C new file mode 100644 index 00000000000..81685803fe2 --- /dev/null +++ b/Old_Packages/Kernel_test/test/KernelHomogeneous/test_planeH3_to_2d.C @@ -0,0 +1,50 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_programs.fw +// file : test_planeH3_to_2d.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include + +#ifdef CGAL_USE_GMP +# include +typedef CGAL::Gmpz Precise_integer; +#else +# ifdef CGAL_USE_LEDA +# include +typedef leda_integer Precise_integer; +# endif // CGAL_USE_LEDA +#endif // CGAL_USE_GMP + +#include +#include + +int +main() +{ + typedef CGAL::Homogeneous< Precise_integer > H_Cls; + std::cout << "Testing with Homogeneous :"; + std::cout << std::endl; + _test_mf_plane_3_to_2d( H_Cls() ); + return 0; +} diff --git a/Old_Packages/Kernel_test/test/KernelHomogeneous/test_predicate_classes_2H.C b/Old_Packages/Kernel_test/test/KernelHomogeneous/test_predicate_classes_2H.C new file mode 100644 index 00000000000..dfaf9dd2dbb --- /dev/null +++ b/Old_Packages/Kernel_test/test/KernelHomogeneous/test_predicate_classes_2H.C @@ -0,0 +1,55 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : +// file : test_predicate_classes_2H.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include +#ifdef CGAL_USE_GMP +# include +typedef CGAL::Gmpz Precise_integer; +#else +# ifdef CGAL_USE_LEDA +# include +typedef leda_integer Precise_integer; +# endif // CGAL_USE_LEDA +#endif // CGAL_USE_GMP + + +#include +#include +#include +#include + +int +main() +{ + typedef CGAL::Homogeneous H_Cls; + typedef CGAL::Point_2 H_Point; + typedef CGAL::Line_2 H_Line; + std::cout << "Testing 2d with Homogeneous : "; + std::cout << std::endl; + _test_fctobj_point_line_2( H_Point(), H_Line()); + + return 0; +} diff --git a/Old_Packages/Kernel_test/test/KernelSimpleCartesian/cgal_test b/Old_Packages/Kernel_test/test/KernelSimpleCartesian/cgal_test new file mode 100755 index 00000000000..1e04e3d0078 --- /dev/null +++ b/Old_Packages/Kernel_test/test/KernelSimpleCartesian/cgal_test @@ -0,0 +1,75 @@ +#! /bin/sh +# This is a script for the CGAL test suite. Such a script must obey +# the following rules: +# +# - the name of the script is cgal_test +# - for every target two one line messages are written to the file 'error.txt' +# the first one indicates if the compilation was successful +# the second one indicates if the execution was successful +# if one of the two was not successful, the line should start with 'ERROR:' +# - running the script should not require any user interaction +# - the script should clean up object files and executables + +ERRORFILE=error.txt + +#---------------------------------------------------------------------# +# compile_and_run +#---------------------------------------------------------------------# + +compile_and_run() +{ + echo "Compiling $1 ... " + if eval 'make CGAL_MAKEFILE=$CGAL_MAKEFILE \ + TESTSUITE_CXXFLAGS="$TESTSUITE_CXXFLAGS" \ + TESTSUITE_LDFLAGS="$TESTSUITE_LDFLAGS" $1' ; then + echo " compilation of $1 succeeded" >> $ERRORFILE + else + echo " ERROR: compilation of $1 failed" >> $ERRORFILE + fi + + if [ -f $1 ] ; then + OUTPUTFILE=ProgramOutput.$1.$PLATFORM + rm -f $OUTPUTFILE + COMMAND="./$1" + if [ -f $1.cmd ] ; then + COMMAND="$COMMAND '`cat $1.cmd`'" + fi + if [ -f $1.cin ] ; then + COMMAND="echo '`cat $1.cin`' | $COMMAND" + fi + echo "Executing $1 ... " + echo + if eval 2>&1 $COMMAND > $OUTPUTFILE ; then + echo " execution of $1 succeeded" >> $ERRORFILE + else + echo " ERROR: execution of $1 failed" >> $ERRORFILE + fi + else + echo " ERROR: could not execute $1" >> $ERRORFILE + fi + + eval "2>&1 make CGAL_MAKEFILE=$CGAL_MAKEFILE clean > /dev/null " +} + +#---------------------------------------------------------------------# +# remove the previous error file +#---------------------------------------------------------------------# + +rm -f $ERRORFILE +touch $ERRORFILE + +#---------------------------------------------------------------------# +# compile and run the tests +#---------------------------------------------------------------------# + +compile_and_run test_new_kernelS2 +compile_and_run test_new_kernelS3 + +compile_and_run test_kernelS2 +compile_and_run test_predicate_classes_2S +compile_and_run test_kernelS3 +compile_and_run test_new_partsS_ +compile_and_run test_planeS3_to_2d +compile_and_run test_kernelSd +compile_and_run test_new_kernelS2 +compile_and_run test_new_kernelS3 diff --git a/Old_Packages/Kernel_test/test/KernelSimpleCartesian/makefile b/Old_Packages/Kernel_test/test/KernelSimpleCartesian/makefile new file mode 100644 index 00000000000..51aa199ecb2 --- /dev/null +++ b/Old_Packages/Kernel_test/test/KernelSimpleCartesian/makefile @@ -0,0 +1,88 @@ +# Created by the script create_makefile +# This is the makefile for compiling a CGAL application. + +#---------------------------------------------------------------------# +# include platform specific settings +#---------------------------------------------------------------------# +# Choose the right include file from the /make directory. +include $(CGAL_MAKEFILE) + +#---------------------------------------------------------------------# +# compiler flags +#---------------------------------------------------------------------# + +CXXFLAGS = \ + $(TESTSUITE_CXXFLAGS) \ + $(EXTRA_FLAGS) \ + -I../Kernel/include \ + $(CGAL_CXXFLAGS) \ + $(DEBUG_OPT) + +#---------------------------------------------------------------------# +# linker flags +#---------------------------------------------------------------------# + +LIBPATH = \ + $(TESTSUITE_LIBPATH) \ + $(CGAL_LIBPATH) + +LDFLAGS = \ + $(TESTSUITE_LDFLAGS) \ + $(CGAL_LDFLAGS) + +#---------------------------------------------------------------------# +# target entries +#---------------------------------------------------------------------# + +all: \ + test_kernelS2 \ + test_kernelS3 \ + test_kernelSd \ + test_planeS3_to_2d \ + test_new_partsS_ \ + test_predicate_classes_2S \ + test_new_kernelS2 \ + test_new_kernelS3 + + +test_kernelS2$(EXE_EXT): test_kernelS2$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_kernelS2 test_kernelS2$(OBJ_EXT) $(LDFLAGS) + +test_kernelS3$(EXE_EXT): test_kernelS3$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_kernelS3 test_kernelS3$(OBJ_EXT) $(LDFLAGS) + +test_kernelSd$(EXE_EXT): test_kernelSd$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_kernelSd test_kernelSd$(OBJ_EXT) $(LDFLAGS) + +test_planeS3_to_2d$(EXE_EXT): test_planeS3_to_2d$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_planeS3_to_2d test_planeS3_to_2d$(OBJ_EXT) $(LDFLAGS) + +test_new_partsS_$(EXE_EXT): test_new_partsS_$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_new_partsS_ test_new_partsS_$(OBJ_EXT) $(LDFLAGS) + +test_predicate_classes_2S$(EXE_EXT): test_predicate_classes_2S$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_predicate_classes_2S test_predicate_classes_2S$(OBJ_EXT) $(LDFLAGS) + +test_new_kernelS2$(EXE_EXT): test_new_kernelS2$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_new_kernelS2 test_new_kernelS2$(OBJ_EXT) $(LDFLAGS) + +test_new_kernelS3$(EXE_EXT): test_new_kernelS3$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_new_kernelS3 test_new_kernelS3$(OBJ_EXT) $(LDFLAGS) + +clean: \ + test_kernelS2.clean \ + test_kernelS3.clean \ + test_kernelSd.clean \ + test_planeS3_to_2d.clean \ + test_new_partsS_.clean \ + test_predicate_classes_2S.clean \ + test_new_kernelS2.clean \ + test_new_kernelS3.clean + +#---------------------------------------------------------------------# +# suffix rules +#---------------------------------------------------------------------# + +.C$(OBJ_EXT): + $(CGAL_CXX) $(CXXFLAGS) $(OBJ_OPT) $< + diff --git a/Old_Packages/Kernel_test/test/KernelSimpleCartesian/test_kernelS2.C b/Old_Packages/Kernel_test/test/KernelSimpleCartesian/test_kernelS2.C new file mode 100644 index 00000000000..85f8e585379 --- /dev/null +++ b/Old_Packages/Kernel_test/test/KernelSimpleCartesian/test_kernelS2.C @@ -0,0 +1,51 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_programs.fw +// file : test_kernelS2.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include + +#ifdef CGAL_USE_GMP +# include +typedef CGAL::Gmpz Precise_integer; +#else +# ifdef CGAL_USE_LEDA +# include +typedef leda_integer Precise_integer; +# endif // CGAL_USE_LEDA +#endif // CGAL_USE_GMP + +#include +#include +#include + +int +main() +{ + typedef CGAL::Simple_cartesian > Cls; + std::cout << "Testing 2d with Simple_cartesian> :"; + std::cout << std::endl; + _test_2( Cls() ); + return 0; +} diff --git a/Old_Packages/Kernel_test/test/KernelSimpleCartesian/test_kernelS3.C b/Old_Packages/Kernel_test/test/KernelSimpleCartesian/test_kernelS3.C new file mode 100644 index 00000000000..6543d397b99 --- /dev/null +++ b/Old_Packages/Kernel_test/test/KernelSimpleCartesian/test_kernelS3.C @@ -0,0 +1,51 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_programs.fw +// file : test_kernelS3.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include + +#ifdef CGAL_USE_GMP +# include +typedef CGAL::Gmpz Precise_integer; +#else +# ifdef CGAL_USE_LEDA +# include +typedef leda_integer Precise_integer; +# endif // CGAL_USE_LEDA +#endif // CGAL_USE_GMP + +#include +#include +#include + +int +main() +{ + typedef CGAL::Simple_cartesian > Cls; + std::cout << "Testing 3d with Simple_cartesian> :"; + std::cout << std::endl; + _test_3( Cls() ); + return 0; +} diff --git a/Old_Packages/Kernel_test/test/KernelSimpleCartesian/test_kernelSd.C b/Old_Packages/Kernel_test/test/KernelSimpleCartesian/test_kernelSd.C new file mode 100644 index 00000000000..791d9b3ee11 --- /dev/null +++ b/Old_Packages/Kernel_test/test/KernelSimpleCartesian/test_kernelSd.C @@ -0,0 +1,40 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_programs.fw +// file : test_kernelSd.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include +#include +#include +#include +#include + +typedef CGAL::Simple_cartesian RC; + +int +main() +{ + _test_cls_point_d( RC() ); + return 0; +} diff --git a/Old_Packages/Kernel_test/test/KernelSimpleCartesian/test_new_kernelS2.C b/Old_Packages/Kernel_test/test/KernelSimpleCartesian/test_new_kernelS2.C new file mode 100644 index 00000000000..0c1e39c1f35 --- /dev/null +++ b/Old_Packages/Kernel_test/test/KernelSimpleCartesian/test_new_kernelS2.C @@ -0,0 +1,55 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : NewKernel/test_programs.fw +// file : test/KernelSimpleCartesian/test_new_kernelS2.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include +#ifdef CGAL_USE_LEDA +#include +#include +typedef leda_integer Precise_integer; +typedef leda_rational Precise_rational; +#else +# ifdef CGAL_USE_GMP +#include +#include +typedef CGAL::Gmpz Precise_integer; +typedef CGAL::Quotient Precise_rational; +# endif // CGAL_USE_GMP +#endif // CGAL_USE_LEDA + + + +#include + + +typedef CGAL::Simple_cartesian Kernel; + + +int main() +{ + test_new_2( Kernel() ); + return 0; +} + diff --git a/Old_Packages/Kernel_test/test/KernelSimpleCartesian/test_new_kernelS3.C b/Old_Packages/Kernel_test/test/KernelSimpleCartesian/test_new_kernelS3.C new file mode 100644 index 00000000000..cea476d5b5d --- /dev/null +++ b/Old_Packages/Kernel_test/test/KernelSimpleCartesian/test_new_kernelS3.C @@ -0,0 +1,54 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : NewKernel/test_programs.fw +// file : test/KernelSimpleCartesian/test_new_kernelS3.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include +#ifdef CGAL_USE_LEDA +#include +#include +typedef leda_integer Precise_integer; +typedef leda_rational Precise_rational; +#else +# ifdef CGAL_USE_GMP +#include +#include +typedef CGAL::Gmpz Precise_integer; +typedef CGAL::Quotient Precise_rational; +# endif // CGAL_USE_GMP +#endif // CGAL_USE_LEDA + + + +#include + + +typedef CGAL::Simple_cartesian Kernel; + +int main() +{ + test_new_3( Kernel() ); + return 0; +} + diff --git a/Old_Packages/Kernel_test/test/KernelSimpleCartesian/test_new_partsS_.C b/Old_Packages/Kernel_test/test/KernelSimpleCartesian/test_new_partsS_.C new file mode 100644 index 00000000000..f66e62eb920 --- /dev/null +++ b/Old_Packages/Kernel_test/test/KernelSimpleCartesian/test_new_partsS_.C @@ -0,0 +1,69 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : news.fw +// file : test_new_partsS_.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include +#ifdef CGAL_USE_GMP +# include +typedef CGAL::Gmpz Precise_integer; +#else +# ifdef CGAL_USE_LEDA +# include +typedef leda_integer Precise_integer; +# endif // CGAL_USE_LEDA +#endif // CGAL_USE_GMP + + +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef CGAL_STRICT21 +#include +#endif // CGAL_STRICT21 + + +int +main() +{ + typedef CGAL::Simple_cartesian > Cls; + std::cout << "Testing new parts with Simple_cartesian> :"; + std::cout << std::endl; + _test_orientation_and_bounded_side( Cls() ); + _test_fct_points_implicit_sphere( Cls() ); + _test_fct_constructions_2( Cls() ); + _test_fct_constructions_3( Cls() ); + _test_fct_point_3( Cls() ); + _test_fct_coplanar_3( Cls() ); + #ifndef CGAL_STRICT21 + _test_cls_iso_cuboid_3( Cls() ); + #endif // CGAL_STRICT21 + + return 0; +} diff --git a/Old_Packages/Kernel_test/test/KernelSimpleCartesian/test_planeS3_to_2d.C b/Old_Packages/Kernel_test/test/KernelSimpleCartesian/test_planeS3_to_2d.C new file mode 100644 index 00000000000..1888d970399 --- /dev/null +++ b/Old_Packages/Kernel_test/test/KernelSimpleCartesian/test_planeS3_to_2d.C @@ -0,0 +1,52 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_programs.fw +// file : test_planeS3_to_2d.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include + +#ifdef CGAL_USE_GMP +# include +typedef CGAL::Gmpz Precise_integer; +#else +# ifdef CGAL_USE_LEDA +# include +typedef leda_integer Precise_integer; +# endif // CGAL_USE_LEDA +#endif // CGAL_USE_GMP + +#include +#include +#include + +int +main() +{ + typedef CGAL::Simple_cartesian > C_Cls; + std::cout << "Testing with Cartesian > :"; + std::cout << std::endl; + _test_mf_plane_3_to_2d( C_Cls() ); + + return 0; +} diff --git a/Old_Packages/Kernel_test/test/KernelSimpleCartesian/test_predicate_classes_2S.C b/Old_Packages/Kernel_test/test/KernelSimpleCartesian/test_predicate_classes_2S.C new file mode 100644 index 00000000000..58d75d8b368 --- /dev/null +++ b/Old_Packages/Kernel_test/test/KernelSimpleCartesian/test_predicate_classes_2S.C @@ -0,0 +1,56 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : +// file : test_predicate_classes_2S.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include +#ifdef CGAL_USE_GMP +# include +typedef CGAL::Gmpz Precise_integer; +#else +# ifdef CGAL_USE_LEDA +# include +typedef leda_integer Precise_integer; +# endif // CGAL_USE_LEDA +#endif // CGAL_USE_GMP + + +#include +#include +#include +#include +#include + +int +main() +{ + typedef CGAL::Simple_cartesian > C_Cls; + typedef CGAL::Point_2 C_Point; + typedef CGAL::Line_2 C_Line; + std::cout << "Testing 2d with Simple_cartesian > :"; + std::cout << std::endl; + _test_fctobj_point_line_2( C_Point(), C_Line()); + + return 0; +} diff --git a/Old_Packages/Kernel_test/test/LedaKernel/cgal_test b/Old_Packages/Kernel_test/test/LedaKernel/cgal_test new file mode 100755 index 00000000000..79036c62278 --- /dev/null +++ b/Old_Packages/Kernel_test/test/LedaKernel/cgal_test @@ -0,0 +1,65 @@ +#! /bin/sh +# This is a script for the CGAL test suite. Such a script must obey +# the following rules: +# +# - the name of the script is cgal_test +# - for every target two one line messages are written to the file 'error.txt' +# the first one indicates if the compilation was successful +# the second one indicates if the execution was successful +# if one of the two was not successful, the line should start with 'ERROR:' +# - running the script should not require any user interaction +# - the script should clean up object files and executables + +ERRORFILE=error.txt + +#---------------------------------------------------------------------# +# compile_and_run +#---------------------------------------------------------------------# + +compile_and_run() +{ + echo "Compiling $1 ... " + if eval 'make CGAL_MAKEFILE=$CGAL_MAKEFILE \ + TESTSUITE_CXXFLAGS="$TESTSUITE_CXXFLAGS" \ + TESTSUITE_LDFLAGS="$TESTSUITE_LDFLAGS" $1' ; then + echo " compilation of $1 succeeded" >> $ERRORFILE + else + echo " ERROR: compilation of $1 failed" >> $ERRORFILE + fi + + if [ -f $1 ] ; then + OUTPUTFILE=ProgramOutput.$1.$PLATFORM + /bin/rm -f $OUTPUTFILE + COMMAND="./$1" + if [ -f $1.cmd ] ; then + COMMAND="$COMMAND '`cat $1.cmd`'" + fi + if [ -f $1.cin ] ; then + COMMAND="echo '`cat $1.cin`' | $COMMAND" + fi + echo "Executing $1 ... " + echo + if eval 2>&1 $COMMAND > $OUTPUTFILE ; then + echo " execution of $1 succeeded" >> $ERRORFILE + else + echo " ERROR: execution of $1 failed" >> $ERRORFILE + fi + else + echo " ERROR: could not execute $1" >> $ERRORFILE + fi + + eval "2>&1 make CGAL_MAKEFILE=$CGAL_MAKEFILE clean > /dev/null " +} + +#---------------------------------------------------------------------# +# remove the previous error file +#---------------------------------------------------------------------# + +/bin/rm -f $ERRORFILE +touch $ERRORFILE + +#---------------------------------------------------------------------# +# compile and run the tests +#---------------------------------------------------------------------# + +compile_and_run test_with_leda_kernel_2 diff --git a/Old_Packages/Kernel_test/test/LedaKernel/include/CGAL/predicates_on_points_rat_leda_2.h b/Old_Packages/Kernel_test/test/LedaKernel/include/CGAL/predicates_on_points_rat_leda_2.h new file mode 100644 index 00000000000..7a41a2b5961 --- /dev/null +++ b/Old_Packages/Kernel_test/test/LedaKernel/include/CGAL/predicates_on_points_rat_leda_2.h @@ -0,0 +1,77 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_programs.fw +// file : predicates_on_points_rat_leda_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_PREDICATES_ON_POINTS_RAT_LEDA_2_H +#define CGAL_PREDICATES_ON_POINTS_RAT_LEDA_2_H + +#include +#include + +CGAL_BEGIN_NAMESPACE + + +template <> +inline +Orientation +orientation(const Point_2& p, + const Point_2& q, + const Point_2& r) +{ +/* + typedef use_rat_leda_kernel::Point_2_base RPoint_2; + return static_cast( ::orientation((const RPoint_2&)p, + (const RPoint_2&)q, + (const RPoint_2&)r) ); +*/ + return static_cast( + ::orientation((const use_rat_leda_kernel::Point_2_base&)p, + (const use_rat_leda_kernel::Point_2_base&)q, + (const use_rat_leda_kernel::Point_2_base&)r) ); +} + +// #ifdef CGAL_CFG_NO_KOENIG_LOOKUP +template <> +inline +bool +collinear(const Point_2& p, + const Point_2& q, + const Point_2& r) +{ +/* + typedef use_rat_leda_kernel::Point_2_base RPoint_2; + return ::collinear((const RPoint_2&)p, + (const RPoint_2&)q, + (const RPoint_2&)r ); +*/ + return + ::collinear((const use_rat_leda_kernel::Point_2_base&)p, + (const use_rat_leda_kernel::Point_2_base&)q, + (const use_rat_leda_kernel::Point_2_base&)r); +} +// #endif // CGAL_CFG_NO_KOENIG_LOOKUP + +CGAL_END_NAMESPACE + +#endif // CGAL_PREDICATES_ON_POINTS_RAT_LEDA_2_H diff --git a/Old_Packages/Kernel_test/test/LedaKernel/include/CGAL/rat_leda.h b/Old_Packages/Kernel_test/test/LedaKernel/include/CGAL/rat_leda.h new file mode 100644 index 00000000000..af2ad19b722 --- /dev/null +++ b/Old_Packages/Kernel_test/test/LedaKernel/include/CGAL/rat_leda.h @@ -0,0 +1,114 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_programs.fw +// file : include/CGAL/rat_leda.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_RAT_LEDA_H +#define CGAL_RAT_LEDA_H + +#include +#include +#include + +#define CGAL_REP_CLASS_DEFINED + +CGAL_BEGIN_NAMESPACE + + +class use_rat_leda_kernel; +CGAL_TEMPLATE_NULL class Point_2; + +class use_rat_leda_kernel +{ + public: + typedef use_rat_leda_kernel R; + + typedef leda_integer RT; + typedef leda_rational FT; + + typedef leda_rat_point Point_2_base; + typedef leda_rat_vector Vector_2_base; + + typedef CGAL::Point_2 Point_2; + typedef CGAL::Vector_2 Vector_2; +}; + + +CGAL_TEMPLATE_NULL +class Point_2 : public leda_rat_point +{ + public: + + typedef use_rat_leda_kernel R; + typedef use_rat_leda_kernel::RT RT; + typedef use_rat_leda_kernel::FT FT; + + Point_2() + {} + + Point_2(const Origin &o) + {} + + Point_2(const leda_rat_point& p) + : leda_rat_point(p) + {} + + Point_2(const RT &hx, const RT &hy) + : leda_rat_point(hx, hy) + {} + + Point_2(const RT &hx, const RT &hy, const RT &hw) + : leda_rat_point(hx, hy, hw) + {} +}; + +inline +Comparison_result +cmp_dist_to_point( const leda_rat_point& p, + const leda_rat_point& q, + const leda_rat_point& r) +{ + if ( q == r) return EQUAL; + return ( p.sqr_dist(q) > p.sqr_dist(r) ) ? LARGER : SMALLER; +} + +inline +bool +has_larger_dist_to_point( const leda_rat_point& p, + const leda_rat_point& q, + const leda_rat_point& r) +{ return (cmp_dist_to_point(p,q,r) == LARGER); } + +inline +bool +has_smaller_dist_to_point( const leda_rat_point& p, + const leda_rat_point& q, + const leda_rat_point& r) +{ return (cmp_dist_to_point(p,q,r) == SMALLER); } + + +CGAL_END_NAMESPACE + + +#endif // CGAL_RAT_LEDA_H + diff --git a/Old_Packages/Kernel_test/test/LedaKernel/makefile b/Old_Packages/Kernel_test/test/LedaKernel/makefile new file mode 100644 index 00000000000..cb22bdafe51 --- /dev/null +++ b/Old_Packages/Kernel_test/test/LedaKernel/makefile @@ -0,0 +1,55 @@ +# Created by the script create_makefile +# This is the makefile for compiling a CGAL application. + +#---------------------------------------------------------------------# +# include platform specific settings +#---------------------------------------------------------------------# +# Choose the right include file from the /make directory. + +# CGAL_MAKEFILE = ENTER_YOUR_INCLUDE_MAKEFILE_HERE +include $(CGAL_MAKEFILE) + +#---------------------------------------------------------------------# +# compiler flags +#---------------------------------------------------------------------# + +CXXFLAGS = \ + $(TESTSUITE_CXXFLAGS) \ + $(EXTRA_FLAGS) \ + -Iinclude \ + -I../Kernel/include \ + $(CGAL_CXXFLAGS) \ + $(DEBUG_OPT) + +#---------------------------------------------------------------------# +# linker flags +#---------------------------------------------------------------------# + +LIBPATH = \ + $(TESTSUITE_LIBPATH) \ + $(CGAL_LIBPATH) + +LDFLAGS = \ + $(TESTSUITE_LDFLAGS) \ + $(CGAL_LDFLAGS) + +#---------------------------------------------------------------------# +# target entries +#---------------------------------------------------------------------# + +all: \ + test_with_leda_kernel_2 + +test_with_leda_kernel_2$(EXE_EXT): test_with_leda_kernel_2$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_with_leda_kernel_2 test_with_leda_kernel_2$(OBJ_EXT) $(LDFLAGS) + +clean: \ + test_with_leda_kernel_2.clean + +#---------------------------------------------------------------------# +# suffix rules +#---------------------------------------------------------------------# + +.C$(OBJ_EXT): + $(CGAL_CXX) $(CXXFLAGS) $(OBJ_OPT) $< + diff --git a/Old_Packages/Kernel_test/test/LedaKernel/test_with_leda_kernel_2.C b/Old_Packages/Kernel_test/test/LedaKernel/test_with_leda_kernel_2.C new file mode 100644 index 00000000000..91f7efc8581 --- /dev/null +++ b/Old_Packages/Kernel_test/test/LedaKernel/test_with_leda_kernel_2.C @@ -0,0 +1,42 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_programs.fw +// file : test_with_leda_kernel_2.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifdef CGAL_USE_LEDA +#include +#include +#include +#include +#include +#include + +int +main() +{ + _test_fct_point_2( CGAL::use_rat_leda_kernel() ); + return 0; +} +#else +int main() { return 0; } +#endif // CGAL_USE_LEDA diff --git a/Old_Packages/Kernel_test/version b/Old_Packages/Kernel_test/version new file mode 100644 index 00000000000..d566b91a2c2 --- /dev/null +++ b/Old_Packages/Kernel_test/version @@ -0,0 +1,2 @@ +3.8 (08 Oct 2000) +maintainer: Stefan Schirra diff --git a/Old_Packages/New_kernel/changes.txt b/Old_Packages/New_kernel/changes.txt new file mode 100644 index 00000000000..1b89764bb84 --- /dev/null +++ b/Old_Packages/New_kernel/changes.txt @@ -0,0 +1,33 @@ + 3.2 (07 Apr 2000) + +- version numbering coupled to kernel test package +- test/NewKernel prepared for testing advanced kernel stuff + using include_advanced include directory + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 2 . 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +- Construct_iso_rectangle_2 added +- Construct_iso_cuboid_3 added + +1.0.1 -> 1.0.2 (16 Nov 99) +- use(CGAL::Sign) added +- header added to function_objects.h and homogeneous_rep.h + +1.0 -> 1.0.1 (12 Nov 99) +- warning in testsuite removed by calling unused variables + with a use()-function :) + +0.99 -> 1.0 (14 Oct 99) +- bisector test deactivated (not impl. in C2 yet) +- test suite revised: Gmpz used, if LEDA not available. + +0.99 (19 Sep 99) +- testsuite update + +0.98 (01 Sep 99) +- Chateau Dagstuhl modifications + +0.95 (19 Aug 99) +- files for Homogeneous in _2 and just one simple test + + diff --git a/Old_Packages/New_kernel/description.txt b/Old_Packages/New_kernel/description.txt new file mode 100644 index 00000000000..04bcc5f3238 --- /dev/null +++ b/Old_Packages/New_kernel/description.txt @@ -0,0 +1,3 @@ +First steps towards the new kernel +make sure to include include_advanced files first + diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Aff_transformation_2.h b/Old_Packages/New_kernel/include_advanced/CGAL/Aff_transformation_2.h new file mode 100644 index 00000000000..e774e34284b --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Aff_transformation_2.h @@ -0,0 +1,32 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : perl script +// file : include/CGAL/Old_style_kernel/Aff_transformation_2.h +// revision : +// revision_date : 07 04 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + +#ifndef CGAL_AFF_TRANSFORMATION_2_H +#define CGAL_AFF_TRANSFORMATION_2_H + +#include +#include +#include + +#endif // CGAL_AFF_TRANSFORMATION_2_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Aff_transformation_3.h b/Old_Packages/New_kernel/include_advanced/CGAL/Aff_transformation_3.h new file mode 100644 index 00000000000..bc339792d6a --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Aff_transformation_3.h @@ -0,0 +1,32 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : perl script +// file : include/CGAL/Old_style_kernel/Aff_transformation_3.h +// revision : +// revision_date : 07 04 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + +#ifndef CGAL_AFF_TRANSFORMATION_3_H +#define CGAL_AFF_TRANSFORMATION_3_H + +#include +#include +#include + +#endif // CGAL_AFF_TRANSFORMATION_3_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Circle_2.h b/Old_Packages/New_kernel/include_advanced/CGAL/Circle_2.h new file mode 100644 index 00000000000..9fcf6e1c025 --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Circle_2.h @@ -0,0 +1,32 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : perl script +// file : include/CGAL/Old_style_kernel/Circle_2.h +// revision : +// revision_date : 07 04 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + +#ifndef CGAL_CIRCLE_2_H +#define CGAL_CIRCLE_2_H + +#include +#include +#include + +#endif // CGAL_CIRCLE_2_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Direction_2.h b/Old_Packages/New_kernel/include_advanced/CGAL/Direction_2.h new file mode 100644 index 00000000000..60b51e3f389 --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Direction_2.h @@ -0,0 +1,32 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : perl script +// file : include/CGAL/Old_style_kernel/Direction_2.h +// revision : +// revision_date : 07 04 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + +#ifndef CGAL_DIRECTION_2_H +#define CGAL_DIRECTION_2_H + +#include +#include +#include + +#endif // CGAL_DIRECTION_2_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Direction_3.h b/Old_Packages/New_kernel/include_advanced/CGAL/Direction_3.h new file mode 100644 index 00000000000..1e14122f594 --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Direction_3.h @@ -0,0 +1,32 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : perl script +// file : include/CGAL/Old_style_kernel/Direction_3.h +// revision : +// revision_date : 07 04 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + +#ifndef CGAL_DIRECTION_3_H +#define CGAL_DIRECTION_3_H + +#include +#include +#include + +#endif // CGAL_DIRECTION_3_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Iso_cuboid_3.h b/Old_Packages/New_kernel/include_advanced/CGAL/Iso_cuboid_3.h new file mode 100644 index 00000000000..7d3fb1e04b3 --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Iso_cuboid_3.h @@ -0,0 +1,32 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : perl script +// file : include/CGAL/Old_style_kernel/Iso_cuboid_3.h +// revision : +// revision_date : 07 04 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + +#ifndef CGAL_ISO_CUBOID_3_H +#define CGAL_ISO_CUBOID_3_H + +#include +#include +#include + +#endif // CGAL_ISO_CUBOID_3_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Iso_rectangle_2.h b/Old_Packages/New_kernel/include_advanced/CGAL/Iso_rectangle_2.h new file mode 100644 index 00000000000..409028268de --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Iso_rectangle_2.h @@ -0,0 +1,32 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : perl script +// file : include/CGAL/Old_style_kernel/Iso_rectangle_2.h +// revision : +// revision_date : 07 04 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + +#ifndef CGAL_ISO_RECTANGLE_2_H +#define CGAL_ISO_RECTANGLE_2_H + +#include +#include +#include + +#endif // CGAL_ISO_RECTANGLE_2_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Line_2.h b/Old_Packages/New_kernel/include_advanced/CGAL/Line_2.h new file mode 100644 index 00000000000..5c3f3dff0c9 --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Line_2.h @@ -0,0 +1,32 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : perl script +// file : include/CGAL/Old_style_kernel/Line_2.h +// revision : +// revision_date : 07 04 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + +#ifndef CGAL_LINE_2_H +#define CGAL_LINE_2_H + +#include +#include +#include + +#endif // CGAL_LINE_2_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Line_3.h b/Old_Packages/New_kernel/include_advanced/CGAL/Line_3.h new file mode 100644 index 00000000000..370bda9f72e --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Line_3.h @@ -0,0 +1,32 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : perl script +// file : include/CGAL/Old_style_kernel/Line_3.h +// revision : +// revision_date : 07 04 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + +#ifndef CGAL_LINE_3_H +#define CGAL_LINE_3_H + +#include +#include +#include + +#endif // CGAL_LINE_3_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Aff_transformation_2.h b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Aff_transformation_2.h new file mode 100644 index 00000000000..b894873a00b --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Aff_transformation_2.h @@ -0,0 +1,80 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : web_2/advanced_2.fw +// file : include/CGAL/Old_style_kernel/Aff_transformation_2.h +// revision : 3.2 +// revision_date : 06 Apr 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_OLD_STYLE_KERNEL_AFF_TRANSFORMATION_2_H +#define CGAL_OLD_STYLE_KERNEL_AFF_TRANSFORMATION_2_H + +namespace CGAL { + +template +class Aff_transformation_2< R_, Old_style_tag> + : public R_::Aff_transformation_2_base +{ + public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::Vector_2_base RVector_2; + typedef typename R::Direction_2_base RDirection_2; + typedef typename R::Aff_transformation_2_base RAff_transformation_2; + + Aff_transformation_2() + : RAff_transformation_2() {} + Aff_transformation_2(const RAff_transformation_2& t) + : RAff_transformation_2(t) {} + Aff_transformation_2(const Identity_transformation tag) + : RAff_transformation_2(tag) {} + Aff_transformation_2(const Translation tag, + const RVector_2& v) + : RAff_transformation_2(tag, v) {} + Aff_transformation_2(const Rotation tag, + const RDirection_2& d, + const RT &num, + const RT &den = RT(1)) + : RAff_transformation_2(tag, d, num, den) {} + Aff_transformation_2(const Rotation tag, + const RT &sin, + const RT &cos, + const RT &den = RT(1)) + : RAff_transformation_2(tag, sin, cos, den) {} + Aff_transformation_2(const Scaling tag, + const RT &s, + const RT &w= RT(1)) + : RAff_transformation_2(tag, s, w) {} + Aff_transformation_2(const RT & m11, const RT & m12, const RT & m13, + const RT & m21, const RT & m22, const RT & m23, + const RT &w= RT(1)) + : RAff_transformation_2(m11, m12, m13, + m21, m22, m23, + w) {} + Aff_transformation_2(const RT & m11, const RT & m12, + const RT & m21, const RT & m22, + const RT &w = RT(1)) + : RAff_transformation_2(m11, m12, + m21, m22, + w) {} +}; + +} // namespace CGAL +#endif // CGAL_OLD_STYLE_KERNEL_AFF_TRANSFORMATION_2_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Aff_transformation_3.h b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Aff_transformation_3.h new file mode 100644 index 00000000000..9385e085d68 --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Aff_transformation_3.h @@ -0,0 +1,77 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : web_3/advanced_3.fw +// file : include/CGAL/Old_style_kernel/Aff_transformation_3.h +// revision : 3.1 +// revision_date : 06 Apr 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_OLD_STYLE_KERNEL_AFF_TRANSFORMATION_3_H +#define CGAL_OLD_STYLE_KERNEL_AFF_TRANSFORMATION_3_H + +namespace CGAL { + +template +class Aff_transformation_3< R_, Old_style_tag> + : public R_::Aff_transformation_3_base +{ + public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::Vector_3_base RVector_3; + typedef typename R::Direction_3_base RDirection_3; + typedef typename R::Aff_transformation_3_base RAff_transformation_3; + + Aff_transformation_3() + : RAff_transformation_3() {} + Aff_transformation_3(const RAff_transformation_3& t) + : RAff_transformation_3(t) {} + Aff_transformation_3(const Identity_transformation tag) + : RAff_transformation_3(tag) {} + Aff_transformation_3(const Translation tag, + const RVector_3& v) + : RAff_transformation_3(tag, v) {} + Aff_transformation_3(const Scaling tag, + const RT &s, + const RT &w= RT(1)) + : RAff_transformation_3(tag, s, w) {} + Aff_transformation_3( + const RT& m11, const RT& m12, const RT& m13, const RT& m14, + const RT& m21, const RT& m22, const RT& m23, const RT& m24, + const RT& m31, const RT& m32, const RT& m33, const RT& m34, + const RT& w= RT(1) ) + : RAff_transformation_3(m11, m12, m13, m14, + m21, m22, m23, m24, + m31, m32, m33, m34, + w) {} + Aff_transformation_3( + const RT& m11, const RT& m12, const RT& m13, + const RT& m21, const RT& m22, const RT& m23, + const RT& m31, const RT& m32, const RT& m33, + const RT& w = RT(1) ) + : RAff_transformation_3(m11, m12, m13, + m21, m22, m23, + m31, m32, m33, + w) {} + +}; + +} // namespace CGAL +#endif // CGAL_OLD_STYLE_KERNEL_AFF_TRANSFORMATION_3_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Circle_2.h b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Circle_2.h new file mode 100644 index 00000000000..777afab6e41 --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Circle_2.h @@ -0,0 +1,69 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : web_2/advanced_2.fw +// file : include/CGAL/Old_style_kernel/Circle_2.h +// revision : 3.2 +// revision_date : 06 Apr 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_OLD_STYLE_KERNEL_CIRCLE_2_H +#define CGAL_OLD_STYLE_KERNEL_CIRCLE_2_H + +namespace CGAL { + +template +class Circle_2< R_, Old_style_tag> : public R_::Circle_2_base +{ + public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Point_2_base RPoint_2; + typedef typename R::Circle_2_base RCircle_2; + + Circle_2() : RCircle_2() {} + Circle_2(const RCircle_2& t) : RCircle_2(t) {} + Circle_2(const RPoint_2& center, + const FT &squared_radius, + const Orientation &orientation) + : RCircle_2(center, squared_radius, orientation) {} + Circle_2(const RPoint_2 ¢er, + const FT &squared_radius) + : RCircle_2(center, squared_radius, COUNTERCLOCKWISE) {} + Circle_2(const RPoint_2& p, + const RPoint_2& q, + const RPoint_2& r) + : RCircle_2(p,q,r) {} + Circle_2(const RPoint_2& p, + const RPoint_2& q, + const Orientation &orientation) + : RCircle_2(p,q,orientation) {} + Circle_2(const RPoint_2& p, + const RPoint_2& q) + : RCircle_2(p,q,COUNTERCLOCKWISE) {} + Circle_2(const RPoint_2& center, + const Orientation& orientation) + : RCircle_2(center,FT(0),orientation) {} + Circle_2(const RPoint_2& center) + : RCircle_2(center,FT(0),COUNTERCLOCKWISE) {} +}; + +} // namespace CGAL +#endif // CGAL_OLD_STYLE_KERNEL_CIRCLE_2_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Direction_2.h b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Direction_2.h new file mode 100644 index 00000000000..89903d5cdf1 --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Direction_2.h @@ -0,0 +1,47 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : web_2/advanced_2.fw +// file : include/CGAL/Old_style_kernel/Direction_2.h +// revision : 3.2 +// revision_date : 06 Apr 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_OLD_STYLE_KERNEL_DIRECTION_2_H +#define CGAL_OLD_STYLE_KERNEL_DIRECTION_2_H + +namespace CGAL { + +template +class Direction_2< R_, Old_style_tag> : public R_::Direction_2_base +{ + public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::Vector_2_base RVector_2; + typedef typename R::Direction_2_base RDirection_2; + + Direction_2() {} + Direction_2(const RDirection_2& d) : RDirection_2(d) {} + Direction_2(const RVector_2& v) : RDirection_2(v) {} + Direction_2(const RT &x, const RT &y) : RDirection_2(x,y) {} +}; + +} // namespace CGAL +#endif // CGAL_OLD_STYLE_KERNEL_DIRECTION_2_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Direction_3.h b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Direction_3.h new file mode 100644 index 00000000000..76856740c58 --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Direction_3.h @@ -0,0 +1,48 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : web_3/advanced_3.fw +// file : include/CGAL/Old_style_kernel/Direction_3.h +// revision : 3.1 +// revision_date : 06 Apr 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_OLD_STYLE_KERNEL_DIRECTION_3_H +#define CGAL_OLD_STYLE_KERNEL_DIRECTION_3_H + +namespace CGAL { + +template +class Direction_3< R_, Old_style_tag> : public R_::Direction_3_base +{ + public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::Vector_3_base RVector_3; + typedef typename R::Direction_3_base RDirection_3; + + Direction_3() {} + Direction_3(const RDirection_3& d) : RDirection_3(d) {} + Direction_3(const RVector_3& v) : RDirection_3(v) {} + Direction_3(const RT& x, const RT& y, const RT& z) + : RDirection_3(x,y,z) {} +}; + +} // namespace CGAL +#endif // CGAL_OLD_STYLE_KERNEL_DIRECTION_3_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Iso_cuboid_3.h b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Iso_cuboid_3.h new file mode 100644 index 00000000000..3e942049388 --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Iso_cuboid_3.h @@ -0,0 +1,48 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : web_3/advanced_3.fw +// file : include/CGAL/Old_style_kernel/Iso_cuboid_3.h +// revision : 3.1 +// revision_date : 06 Apr 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_OLD_STYLE_KERNEL_ISO_CUBOID_3_H +#define CGAL_OLD_STYLE_KERNEL_ISO_CUBOID_3_H + +namespace CGAL { + +template +class Iso_cuboid_3< R_, Old_style_tag> : public R_::Iso_cuboid_3_base +{ + public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Point_3_base RPoint_3; + typedef typename R::Iso_cuboid_3_base RIso_cuboid_3; + + Iso_cuboid_3() : RIso_cuboid_3() {} + Iso_cuboid_3(const RIso_cuboid_3& r) : RIso_cuboid_3(r) {} + Iso_cuboid_3(const RPoint_3& p, const RPoint_3& q) + : RIso_cuboid_3(p,q) {} +}; + +} // namespace CGAL +#endif // CGAL_OLD_STYLE_KERNEL_ISO_CUBOID_3_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Iso_rectangle_2.h b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Iso_rectangle_2.h new file mode 100644 index 00000000000..de3b6416295 --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Iso_rectangle_2.h @@ -0,0 +1,50 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : web_2/advanced_2.fw +// file : include/CGAL/Old_style_kernel/Iso_rectangle_2.h +// revision : 3.2 +// revision_date : 06 Apr 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_OLD_STYLE_KERNEL_ISO_RECTANGLE_2_H +#define CGAL_OLD_STYLE_KERNEL_ISO_RECTANGLE_2_H + +namespace CGAL { + +template +class Iso_rectangle_2< R_, Old_style_tag> + : public R_::Iso_rectangle_2_base +{ + public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Point_2_base RPoint_2; + typedef typename R::Iso_rectangle_2_base RIso_rectangle_2; + + Iso_rectangle_2() : RIso_rectangle_2() {} + Iso_rectangle_2(const RIso_rectangle_2& r) : RIso_rectangle_2(r) {} + Iso_rectangle_2(const RPoint_2& p, + const RPoint_2& q) + : RIso_rectangle_2(p,q) {} +}; + +} // namespace CGAL +#endif // CGAL_OLD_STYLE_KERNEL_ISO_RECTANGLE_2_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Line_2.h b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Line_2.h new file mode 100644 index 00000000000..10a8dca6ede --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Line_2.h @@ -0,0 +1,54 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : web_2/advanced_2.fw +// file : include/CGAL/Old_style_kernel/Line_2.h +// revision : 3.2 +// revision_date : 06 Apr 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_OLD_STYLE_KERNEL_LINE_2_H +#define CGAL_OLD_STYLE_KERNEL_LINE_2_H + +namespace CGAL { + +template +class Line_2< R_, Old_style_tag> : public R_::Line_2_base +{ + public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Point_2_base RPoint_2; + typedef typename R::Direction_2_base RDirection_2; + typedef typename R::Line_2_base RLine_2; + typedef typename R::Segment_2_base RSegment_2; + typedef typename R::Ray_2_base RRay_2; + + Line_2() : RLine_2() {} + Line_2(const RLine_2& l) : RLine_2(l) {} + Line_2(const RPoint_2 &p, const RPoint_2 &q) : RLine_2(p,q) {} + Line_2(const RT& a, const RT& b, const RT& c) : RLine_2(a,b,c) {} + Line_2(const RSegment_2& s) : RLine_2(s) {} + Line_2(const RRay_2& r) : RLine_2(r) {} + Line_2(const RPoint_2& p, const RDirection_2& d) : RLine_2(p,d) {} +}; + +} // namespace CGAL +#endif // CGAL_OLD_STYLE_KERNEL_LINE_2_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Line_3.h b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Line_3.h new file mode 100644 index 00000000000..a7cc7f671cc --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Line_3.h @@ -0,0 +1,53 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : web_3/advanced_3.fw +// file : include/CGAL/Old_style_kernel/Line_3.h +// revision : 3.1 +// revision_date : 06 Apr 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_OLD_STYLE_KERNEL_LINE_3_H +#define CGAL_OLD_STYLE_KERNEL_LINE_3_H + +namespace CGAL { + +template +class Line_3< R_, Old_style_tag> : public R_::Line_3_base +{ + public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Point_3_base RPoint_3; + typedef typename R::Direction_3_base RDirection_3; + typedef typename R::Line_3_base RLine_3; + typedef typename R::Segment_3_base RSegment_3; + typedef typename R::Ray_3_base RRay_3; + + Line_3() : RLine_3() {} + Line_3(const RLine_3& l) : RLine_3(l) {} + Line_3(const RPoint_3 &p, const RPoint_3 &q) : RLine_3(p,q) {} + Line_3(const RSegment_3& s) : RLine_3(s) {} + Line_3(const RRay_3& r) : RLine_3(r) {} + Line_3(const RPoint_3& p, const RDirection_3& d) : RLine_3(p,d) {} +}; + +} // namespace CGAL +#endif // CGAL_OLD_STYLE_KERNEL_LINE_3_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Plane_3.h b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Plane_3.h new file mode 100644 index 00000000000..437b1492744 --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Plane_3.h @@ -0,0 +1,60 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : web_3/advanced_3.fw +// file : include/CGAL/Old_style_kernel/Plane_3.h +// revision : 3.1 +// revision_date : 06 Apr 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_OLD_STYLE_KERNEL_PLANE_3_H +#define CGAL_OLD_STYLE_KERNEL_PLANE_3_H + +namespace CGAL { + +template +class Plane_3< R_, Old_style_tag> : public R_::Plane_3_base +{ + public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Point_3_base RPoint_3; + typedef typename R::Vector_3_base RVector_3; + typedef typename R::Direction_3_base RDirection_3; + typedef typename R::Line_3_base RLine_3; + typedef typename R::Plane_3_base RPlane_3; + typedef typename R::Segment_3_base RSegment_3; + typedef typename R::Ray_3_base RRay_3; + + Plane_3() : RPlane_3() {} + Plane_3(const RPlane_3& p) : RPlane_3(p) {} + Plane_3(const RPoint_3& p, const RPoint_3& q, const RPoint_3& r) + : RPlane_3(p,q,r) {} + Plane_3(const RPoint_3& p, const RDirection_3& d) : RPlane_3(p,d) {} + Plane_3(const RPoint_3& p, const RVector_3& v) : RPlane_3(p,v) {} + Plane_3(const RT& a, const RT& b, const RT& c, const RT& d) + : RPlane_3(a,b,c,d) {} + Plane_3(const RLine_3& l, const RPoint_3& p) : RPlane_3(l,p) {} + Plane_3(const RSegment_3& s, const RPoint_3& p) : RPlane_3(s,p) {} + Plane_3(RRay_3& r, const RPoint_3& p) : RPlane_3(r,p) {} +}; + +} // namespace CGAL +#endif // CGAL_OLD_STYLE_KERNEL_PLANE_3_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Point_2.h b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Point_2.h new file mode 100644 index 00000000000..0195315f1e5 --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Point_2.h @@ -0,0 +1,51 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : web_2/advanced_2.fw +// file : include/CGAL/Old_style_kernel/Point_2.h +// revision : 3.2 +// revision_date : 06 Apr 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_OLD_STYLE_KERNEL_POINT_2_H +#define CGAL_OLD_STYLE_KERNEL_POINT_2_H + +namespace CGAL { + +template +class Point_2< R_, Old_style_tag> : public R_::Point_2_base +{ + public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::Point_2_base RPoint_2; + typedef typename R::Vector_2_base RVector_2; + + Point_2() {} + Point_2(const Origin& o) : RPoint_2(o) {} + Point_2(const RPoint_2& p) : RPoint_2(p) {} + Point_2(const RT& hx, const RT& hy) : RPoint_2(hx, hy) {} + Point_2(const RT& hx, const RT& hy, const RT& hw) : RPoint_2(hx, hy, hw) {} + + private: + Point_2(const RVector_2& v) : RPoint_2(v) {} +}; + +} // namespace CGAL +#endif // CGAL_OLD_STYLE_KERNEL_POINT_2_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Point_3.h b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Point_3.h new file mode 100644 index 00000000000..20c5c1687a7 --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Point_3.h @@ -0,0 +1,53 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : web_3/advanced_3.fw +// file : include/CGAL/Old_style_kernel/Point_3.h +// revision : 3.1 +// revision_date : 06 Apr 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_OLD_STYLE_KERNEL_POINT_3_H +#define CGAL_OLD_STYLE_KERNEL_POINT_3_H + +namespace CGAL { + +template +class Point_3< R_, Old_style_tag> : public R_::Point_3_base +{ + public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::Point_3_base RPoint_3; + typedef typename R::Vector_3_base RVector_3; + + Point_3() {} + Point_3(const Origin& o) : RPoint_3(o) {} + Point_3(const RPoint_3& p) : RPoint_3(p) {} + Point_3(const RT& hx, const RT& hy, const RT& hz) + : RPoint_3(hx, hy, hz) {} + Point_3(const RT& hx, const RT& hy, const RT& hz, const RT& hw ) + : RPoint_3(hx, hy, hz, hw) {} + + private: + Point_3(const RVector_3& v) : RPoint_3(v) {} +}; + +} // namespace CGAL +#endif // CGAL_OLD_STYLE_KERNEL_POINT_3_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Ray_2.h b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Ray_2.h new file mode 100644 index 00000000000..cfc4c1f83bf --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Ray_2.h @@ -0,0 +1,52 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : web_2/advanced_2.fw +// file : include/CGAL/Old_style_kernel/Ray_2.h +// revision : 3.2 +// revision_date : 06 Apr 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_OLD_STYLE_KERNEL_RAY_2_H +#define CGAL_OLD_STYLE_KERNEL_RAY_2_H + +namespace CGAL { + +template +class Ray_2< R_, Old_style_tag> : public R_::Ray_2_base +{ + public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Point_2_base RPoint_2; + typedef typename R::Ray_2_base RRay_2; + typedef typename R::Direction_2_base RDirection_2; + + Ray_2() : RRay_2() {} + Ray_2(const RRay_2& r) : RRay_2(r) {} + Ray_2(const RPoint_2& sp, + const RPoint_2& secondp) + : RRay_2(sp, secondp) {} + Ray_2(const RPoint_2& sp, const RDirection_2& d) + : RRay_2(sp, d) {} +}; + +} // namespace CGAL +#endif //CGAL_OLD_STYLE_KERNEL_RAY_2_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Ray_3.h b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Ray_3.h new file mode 100644 index 00000000000..86f1986339f --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Ray_3.h @@ -0,0 +1,56 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : web_3/advanced_3.fw +// file : include/CGAL/Old_style_kernel/Ray_3.h +// revision : 3.1 +// revision_date : 06 Apr 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_OLD_STYLE_KERNEL_RAY_3_H +#define CGAL_OLD_STYLE_KERNEL_RAY_3_H + +namespace CGAL { + +template +class Ray_3< R_, Old_style_tag> : public R_::Ray_3_base +{ + public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Point_3_base RPoint_3; + typedef typename R::Ray_3_base RRay_3; + typedef typename R::Direction_3_base RDirection_3; + + Ray_3() : RRay_3() {} + Ray_3(const RRay_3& r) : RRay_3(r) {} + Ray_3(const RPoint_3& sp, + const RPoint_3& secondp) + : RRay_3(sp, secondp) {} + Ray_3(const RPoint_3& sp, const RDirection_3& d) + : RRay_3(sp, d) {} + + Line_3< R_, Old_style_tag> + supporting_line() const + { return RRay_3::supporting_line(); } +}; + +} // namespace CGAL +#endif //CGAL_OLD_STYLE_KERNEL_RAY_3_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Segment_2.h b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Segment_2.h new file mode 100644 index 00000000000..56592a3f3c4 --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Segment_2.h @@ -0,0 +1,47 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : web_2/advanced_2.fw +// file : include/CGAL/Old_style_kernel/Segment_2.h +// revision : 3.2 +// revision_date : 06 Apr 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_OLD_STYLE_KERNEL_SEGMENT_2_H +#define CGAL_OLD_STYLE_KERNEL_SEGMENT_2_H + +namespace CGAL { + +template +class Segment_2< R_, Old_style_tag> : public R_::Segment_2_base +{ + public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Point_2_base RPoint_2; + typedef typename R::Segment_2_base RSegment_2; + + Segment_2() : RSegment_2() {} + Segment_2(const RSegment_2& s) : RSegment_2(s) {} + Segment_2(const RPoint_2& sp, const RPoint_2& ep) : RSegment_2(sp,ep) {} +}; + +} // namespace CGAL +#endif // CGAL_OLD_STYLE_KERNEL_SEGMENT_2_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Segment_3.h b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Segment_3.h new file mode 100644 index 00000000000..c40d65748fa --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Segment_3.h @@ -0,0 +1,51 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : web_3/advanced_3.fw +// file : include/CGAL/Old_style_kernel/Segment_3.h +// revision : 3.1 +// revision_date : 06 Apr 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_OLD_STYLE_KERNEL_SEGMENT_3_H +#define CGAL_OLD_STYLE_KERNEL_SEGMENT_3_H + +namespace CGAL { + +template +class Segment_3< R_, Old_style_tag> : public R_::Segment_3_base +{ + public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Point_3_base RPoint_3; + typedef typename R::Segment_3_base RSegment_3; + + Segment_3() : RSegment_3() {} + Segment_3(const RSegment_3& s) : RSegment_3(s) {} + Segment_3(const RPoint_3& sp, const RPoint_3& ep) : RSegment_3(sp,ep) {} + + Line_3< R_, Old_style_tag> + supporting_line() const + { return RSegment_3::supporting_line(); } +}; + +} // namespace CGAL +#endif // CGAL_OLD_STYLE_KERNEL_SEGMENT_3_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Tetrahedron_3.h b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Tetrahedron_3.h new file mode 100644 index 00000000000..487ab910bcd --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Tetrahedron_3.h @@ -0,0 +1,51 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : web_3/advanced_3.fw +// file : include/CGAL/Old_style_kernel/Tetrahedron_3.h +// revision : 3.1 +// revision_date : 06 Apr 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_OLD_STYLE_KERNEL_TETRAHEDRON_3_H +#define CGAL_OLD_STYLE_KERNEL_TETRAHEDRON_3_H + +namespace CGAL { + +template +class Tetrahedron_3< R_, Old_style_tag> : public R_::Tetrahedron_3_base +{ + public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Point_3_base RPoint_3; + typedef typename R::Tetrahedron_3_base RTetrahedron_3; + + Tetrahedron_3() : RTetrahedron_3() {} + Tetrahedron_3(const RTetrahedron_3& t) : RTetrahedron_3(t) {} + Tetrahedron_3(const RPoint_3& p, + const RPoint_3& q, + const RPoint_3& r, + const RPoint_3& s) + : RTetrahedron_3(p,q,r,s) {} +}; + +} // namespace CGAL +#endif // CGAL_OLD_STYLE_KERNEL_TETRAHEDRON_3_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Triangle_2.h b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Triangle_2.h new file mode 100644 index 00000000000..c5649c7b480 --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Triangle_2.h @@ -0,0 +1,50 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : web_2/advanced_2.fw +// file : include/CGAL/Old_style_kernel/Triangle_2.h +// revision : 3.2 +// revision_date : 06 Apr 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_OLD_STYLE_KERNEL_TRIANGLE_2_H +#define CGAL_OLD_STYLE_KERNEL_TRIANGLE_2_H + +namespace CGAL { + +template +class Triangle_2< R_, Old_style_tag> : public R_::Triangle_2_base +{ + public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Point_2_base RPoint_2; + typedef typename R::Triangle_2_base RTriangle_2; + + Triangle_2() : RTriangle_2() {} + Triangle_2(const RTriangle_2& t) : RTriangle_2(t) {} + Triangle_2(const RPoint_2& p, + const RPoint_2& q, + const RPoint_2& r) + : RTriangle_2(p,q,r) {} +}; + +} // namespace CGAL +#endif // CGAL_OLD_STYLE_KERNEL_TRIANGLE_2_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Triangle_3.h b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Triangle_3.h new file mode 100644 index 00000000000..8b6d731fd3e --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Triangle_3.h @@ -0,0 +1,50 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : web_3/advanced_3.fw +// file : include/CGAL/Old_style_kernel/Triangle_3.h +// revision : 3.1 +// revision_date : 06 Apr 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_OLD_STYLE_KERNEL_TRIANGLE_3_H +#define CGAL_OLD_STYLE_KERNEL_TRIANGLE_3_H + +namespace CGAL { + +template +class Triangle_3< R_, Old_style_tag> : public R_::Triangle_3_base +{ + public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Point_3_base RPoint_3; + typedef typename R::Triangle_3_base RTriangle_3; + + Triangle_3() : RTriangle_3() {} + Triangle_3(const RTriangle_3& t) : RTriangle_3(t) {} + Triangle_3(const RPoint_3& p, + const RPoint_3& q, + const RPoint_3& r) + : RTriangle_3(p,q,r) {} +}; + +} // namespace CGAL +#endif // CGAL_OLD_STYLE_KERNEL_TRIANGLE_3_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Vector_2.h b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Vector_2.h new file mode 100644 index 00000000000..4cd56292cef --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Vector_2.h @@ -0,0 +1,51 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : web_2/advanced_2.fw +// file : include/CGAL/Old_style_kernel/Vector_2.h +// revision : 3.2 +// revision_date : 06 Apr 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_OLD_STYLE_KERNEL_VECTOR_2_H +#define CGAL_OLD_STYLE_KERNEL_VECTOR_2_H + +namespace CGAL { + +template +class Vector_2< R_, Old_style_tag> : public R_::Vector_2_base +{ + public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::Point_2_base RPoint_2; + typedef typename R::Vector_2_base RVector_2; + + Vector_2() {} + Vector_2(const RVector_2& v) : RVector_2(v) {} + Vector_2(const Null_vector &v) : RVector_2(v) {} + Vector_2(const RT &x, const RT &y) : RVector_2(x,y) {} + Vector_2(const RT &x, const RT &y, const RT &w) : RVector_2(x,y,w) {} + + private: + Vector_2(const RPoint_2& p) : RVector_2(p) {} +}; + +} // namespace CGAL +#endif // CGAL_OLD_STYLE_KERNEL_VECTOR_2_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Vector_3.h b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Vector_3.h new file mode 100644 index 00000000000..a7a8a29acfa --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Old_style_kernel/Vector_3.h @@ -0,0 +1,53 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : web_3/advanced_3.fw +// file : include/CGAL/Old_style_kernel/Vector_3.h +// revision : 3.1 +// revision_date : 06 Apr 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_OLD_STYLE_KERNEL_VECTOR_3_H +#define CGAL_OLD_STYLE_KERNEL_VECTOR_3_H + +namespace CGAL { + +template +class Vector_3< R_, Old_style_tag> : public R_::Vector_3_base +{ + public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::Point_3_base RPoint_3; + typedef typename R::Vector_3_base RVector_3; + + Vector_3() {} + Vector_3(const RVector_3& v) : RVector_3(v) {} + Vector_3(const Null_vector &v) : RVector_3(v) {} + Vector_3(const RT& hx, const RT& hy, const RT& hz) + : RVector_3(hx, hy, hz) {} + Vector_3(const RT& hx, const RT& hy, const RT& hz, const RT& hw ) + : RVector_3(hx, hy, hz, hw) {} + + private: + Vector_3(const RPoint_3& p) : RVector_3(p) {} +}; + +} // namespace CGAL +#endif // CGAL_OLD_STYLE_KERNEL_VECTOR_3_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Plane_3.h b/Old_Packages/New_kernel/include_advanced/CGAL/Plane_3.h new file mode 100644 index 00000000000..6b894c9f354 --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Plane_3.h @@ -0,0 +1,32 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : perl script +// file : include/CGAL/Old_style_kernel/Plane_3.h +// revision : +// revision_date : 07 04 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + +#ifndef CGAL_PLANE_3_H +#define CGAL_PLANE_3_H + +#include +#include +#include + +#endif // CGAL_PLANE_3_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Point_2.h b/Old_Packages/New_kernel/include_advanced/CGAL/Point_2.h new file mode 100644 index 00000000000..1ca7d90d5cf --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Point_2.h @@ -0,0 +1,32 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : perl script +// file : include/CGAL/Old_style_kernel/Point_2.h +// revision : +// revision_date : 07 04 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + +#ifndef CGAL_POINT_2_H +#define CGAL_POINT_2_H + +#include +#include +#include + +#endif // CGAL_POINT_2_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Point_3.h b/Old_Packages/New_kernel/include_advanced/CGAL/Point_3.h new file mode 100644 index 00000000000..fab6cce5c4f --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Point_3.h @@ -0,0 +1,32 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : perl script +// file : include/CGAL/Old_style_kernel/Point_3.h +// revision : +// revision_date : 07 04 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + +#ifndef CGAL_POINT_3_H +#define CGAL_POINT_3_H + +#include +#include +#include + +#endif // CGAL_POINT_3_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Ray_2.h b/Old_Packages/New_kernel/include_advanced/CGAL/Ray_2.h new file mode 100644 index 00000000000..f10d1df5b78 --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Ray_2.h @@ -0,0 +1,32 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : perl script +// file : include/CGAL/Old_style_kernel/Ray_2.h +// revision : +// revision_date : 07 04 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + +#ifndef CGAL_RAY_2_H +#define CGAL_RAY_2_H + +#include +#include +#include + +#endif // CGAL_RAY_2_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Ray_3.h b/Old_Packages/New_kernel/include_advanced/CGAL/Ray_3.h new file mode 100644 index 00000000000..db3d4d2faf5 --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Ray_3.h @@ -0,0 +1,32 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : perl script +// file : include/CGAL/Old_style_kernel/Ray_3.h +// revision : +// revision_date : 07 04 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + +#ifndef CGAL_RAY_3_H +#define CGAL_RAY_3_H + +#include +#include +#include + +#endif // CGAL_RAY_3_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Segment_2.h b/Old_Packages/New_kernel/include_advanced/CGAL/Segment_2.h new file mode 100644 index 00000000000..161874ed3a7 --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Segment_2.h @@ -0,0 +1,32 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : perl script +// file : include/CGAL/Old_style_kernel/Segment_2.h +// revision : +// revision_date : 07 04 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + +#ifndef CGAL_SEGMENT_2_H +#define CGAL_SEGMENT_2_H + +#include +#include +#include + +#endif // CGAL_SEGMENT_2_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Segment_3.h b/Old_Packages/New_kernel/include_advanced/CGAL/Segment_3.h new file mode 100644 index 00000000000..3785c029ff5 --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Segment_3.h @@ -0,0 +1,32 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : perl script +// file : include/CGAL/Old_style_kernel/Segment_3.h +// revision : +// revision_date : 07 04 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + +#ifndef CGAL_SEGMENT_3_H +#define CGAL_SEGMENT_3_H + +#include +#include +#include + +#endif // CGAL_SEGMENT_3_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Tetrahedron_3.h b/Old_Packages/New_kernel/include_advanced/CGAL/Tetrahedron_3.h new file mode 100644 index 00000000000..da68c7535f7 --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Tetrahedron_3.h @@ -0,0 +1,32 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : perl script +// file : include/CGAL/Old_style_kernel/Tetrahedron_3.h +// revision : +// revision_date : 07 04 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + +#ifndef CGAL_TETRAHEDRON_3_H +#define CGAL_TETRAHEDRON_3_H + +#include +#include +#include + +#endif // CGAL_TETRAHEDRON_3_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Triangle_2.h b/Old_Packages/New_kernel/include_advanced/CGAL/Triangle_2.h new file mode 100644 index 00000000000..9bcd2b3b807 --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Triangle_2.h @@ -0,0 +1,32 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : perl script +// file : include/CGAL/Old_style_kernel/Triangle_2.h +// revision : +// revision_date : 07 04 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + +#ifndef CGAL_TRIANGLE_2_H +#define CGAL_TRIANGLE_2_H + +#include +#include +#include + +#endif // CGAL_TRIANGLE_2_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Triangle_3.h b/Old_Packages/New_kernel/include_advanced/CGAL/Triangle_3.h new file mode 100644 index 00000000000..e7258ba42eb --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Triangle_3.h @@ -0,0 +1,32 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : perl script +// file : include/CGAL/Old_style_kernel/Triangle_3.h +// revision : +// revision_date : 07 04 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + +#ifndef CGAL_TRIANGLE_3_H +#define CGAL_TRIANGLE_3_H + +#include +#include +#include + +#endif // CGAL_TRIANGLE_3_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Vector_2.h b/Old_Packages/New_kernel/include_advanced/CGAL/Vector_2.h new file mode 100644 index 00000000000..ff61375f539 --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Vector_2.h @@ -0,0 +1,32 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : perl script +// file : include/CGAL/Old_style_kernel/Vector_2.h +// revision : +// revision_date : 07 04 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + +#ifndef CGAL_VECTOR_2_H +#define CGAL_VECTOR_2_H + +#include +#include +#include + +#endif // CGAL_VECTOR_2_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/Vector_3.h b/Old_Packages/New_kernel/include_advanced/CGAL/Vector_3.h new file mode 100644 index 00000000000..e2f5718221e --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/Vector_3.h @@ -0,0 +1,32 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : perl script +// file : include/CGAL/Old_style_kernel/Vector_3.h +// revision : +// revision_date : 07 04 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + +#ifndef CGAL_VECTOR_3_H +#define CGAL_VECTOR_3_H + +#include +#include +#include + +#endif // CGAL_VECTOR_3_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/homogeneous_rep.h b/Old_Packages/New_kernel/include_advanced/CGAL/homogeneous_rep.h new file mode 100644 index 00000000000..810bc15e10e --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/homogeneous_rep.h @@ -0,0 +1,833 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// +// +// +// +// ---------------------------------------------------------------------------- +// release : +// release_date : +// +// source : Homogeneous_traits.lw +// file : include/CGAL/homogeneous_rep.h +// revision : 3.4 +// revision_date : 07 Apr 2000 +// author(s) : Stefan Schirra +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken +// ============================================================================ + +#ifndef CGAL_HOMOGENEOUS_REP_H +#define CGAL_HOMOGENEOUS_REP_H + +#define CGAL_REP_CLASS_DEFINED + +#ifndef CGAL_QUOTIENT_H +#include +#endif // CGAL_QUOTIENT_H + +#include +#include +#include +#include + +namespace CGAL { +template < class FT_, class RT_ > +class Data_accessorH2 +{ +public: + typedef FT_ FT; + typedef RT_ RT; + typedef PointH2 Point; + + RT get_hx( Point const& p) const { return( p.hx()); } + RT get_hy( Point const& p) const { return( p.hy()); } + RT get_hw( Point const& p) const { return( p.hw()); } + + void + get( Point const& p, RT& hx, RT& hy, RT& hw) const + { + hx = get_hx( p); + hy = get_hy( p); + hw = get_hw( p); + } + + void + set( Point& p, RT const& hx, RT const& hy, RT const& hw) const + { + p = Point( hx, hy, hw); + } +}; +template +class Homogeneous_base +{ + public: + typedef RT_ RT; + typedef FT_ FT; + typedef CGAL::Object Object_2; + typedef CGAL::Point_2< R_, Old_style_tag > Point_2; + typedef CGAL::Vector_2< R_, Old_style_tag > Vector_2; + typedef CGAL::Direction_2< R_, Old_style_tag > Direction_2; + typedef CGAL::Segment_2< R_, Old_style_tag > Segment_2; + typedef CGAL::Line_2< R_, Old_style_tag > Line_2; + typedef CGAL::Ray_2< R_, Old_style_tag > Ray_2; + typedef CGAL::Circle_2< R_, Old_style_tag > Circle_2; + typedef CGAL::Triangle_2< R_, Old_style_tag > Triangle_2; + typedef CGAL::Iso_rectangle_2< R_, Old_style_tag > Iso_rectangle_2; + typedef CGAL::Aff_transformation_2< R_, Old_style_tag > Aff_transformation_2; + typedef CGAL::Object Object_3; + typedef CGAL::Point_3< R_, Old_style_tag > Point_3; + typedef CGAL::Vector_3< R_, Old_style_tag > Vector_3; + typedef CGAL::Direction_3< R_, Old_style_tag > Direction_3; + typedef CGAL::Segment_3< R_, Old_style_tag > Segment_3; + typedef CGAL::Plane_3< R_, Old_style_tag> Plane_3; + typedef CGAL::Line_3< R_, Old_style_tag > Line_3; + typedef CGAL::Ray_3< R_, Old_style_tag > Ray_3; + typedef CGAL::Triangle_3< R_, Old_style_tag > Triangle_3; + typedef CGAL::Tetrahedron_3< R_, Old_style_tag > Tetrahedron_3; + typedef CGAL::Iso_cuboid_3< R_, Old_style_tag > Iso_cuboid_3; + typedef CGAL::Aff_transformation_3< R_, Old_style_tag > Aff_transformation_3; + // we have: template CGAL::Point_d : public R::Point_d_base + typedef CGAL::Point_d< R_ > Point_d; + +}; +template > +class Homogeneous : public Homogeneous_base< Homogeneous, RT_, FT_ > +{ + public: + typedef RT_ RT; + typedef FT_ FT; + typedef Old_style_tag Rep_tag; + typedef PointH2< FT, RT> Point_2_base; + typedef VectorH2< FT, RT> Vector_2_base; + typedef DirectionH2< FT, RT> Direction_2_base; + typedef SegmentH2< FT, RT> Segment_2_base; + typedef LineH2< FT, RT> Line_2_base; + typedef RayH2< FT, RT> Ray_2_base; + typedef CircleH2< FT, RT> Circle_2_base; + typedef TriangleH2< FT, RT> Triangle_2_base; + typedef Iso_rectangleH2< FT, RT> Iso_rectangle_2_base; + typedef Aff_transformationH2< FT, RT> Aff_transformation_2_base; + typedef Homogeneous_base< Homogeneous, RT_, FT_ > KernelBase; + + typedef typename KernelBase::Point_2 Point_2; + typedef typename KernelBase::Vector_2 Vector_2; + typedef typename KernelBase::Direction_2 Direction_2; + typedef typename KernelBase::Line_2 Line_2; + typedef typename KernelBase::Segment_2 Segment_2; + typedef typename KernelBase::Ray_2 Ray_2; + typedef typename KernelBase::Circle_2 Circle_2; + typedef typename KernelBase::Triangle_2 Triangle_2; + typedef typename KernelBase::Iso_rectangle_2 Iso_rectangle_2; + typedef typename KernelBase::Aff_transformation_2 Aff_transformation_2; + typedef CGALi::Construct Construct_point_2; + typedef CGALi::Construct Construct_vector_2; + typedef CGALi::Construct Construct_direction_2; + typedef CGALi::Construct Construct_segment_2; + typedef CGALi::Construct Construct_line_2; + typedef CGALi::Construct Construct_ray_2; + typedef CGALi::Construct Construct_circle_2; + typedef CGALi::Construct Construct_triangle_2; + typedef CGALi::Construct Construct_iso_rectangle_2; + typedef CGALi::Construct Construct_aff_transformation_2; + + Construct_point_2 + construct_point_2_object() const + { return Construct_point_2(); } + + Construct_vector_2 + construct_vector_2_object() const + { return Construct_vector_2(); } + + Construct_direction_2 + construct_direction_2_object() const + { return Construct_direction_2(); } + + Construct_segment_2 + construct_segment_2_object() const + { return Construct_segment_2(); } + + Construct_line_2 + construct_line_2_object() const + { return Construct_line_2(); } + + Construct_ray_2 + construct_ray_2_object() const + { return Construct_ray_2(); } + + Construct_circle_2 + construct_circle_2_object() const + { return Construct_circle_2(); } + + Construct_triangle_2 + construct_triangle_2_object() const + { return Construct_triangle_2(); } + + Construct_iso_rectangle_2 + construct_iso_rectangle_2_object() const + { return Construct_iso_rectangle_2(); } + + Construct_aff_transformation_2 + construct_aff_transformation_2_object() const + { return Construct_aff_transformation_2(); } + + + typedef CGALi::Call_point_to_get Construct_point_on_2; + Construct_point_on_2 + construct_point_on_2_object() const + { return Construct_point_on_2(); } + + typedef CGALi::Call_second_point_to_get Construct_second_point_on_2; + Construct_second_point_on_2 + construct_second_point_on_2_object() const + { return Construct_second_point_on_2(); } + + typedef CGALi::Call_source_to_get Construct_source_point_2; + Construct_source_point_2 + construct_source_point_2_object() const + { return Construct_source_point_2(); } + + typedef CGALi::Call_target_to_get Construct_target_point_2; + Construct_target_point_2 + construct_target_point_2_object() const + { return Construct_target_point_2(); } + + typedef CGALi::Call_min_to_get Construct_min_point_2; + Construct_min_point_2 + construct_min_point_2_object() const + { return Construct_min_point_2(); } + + typedef CGALi::Call_max_to_get Construct_max_point_2; + Construct_max_point_2 + construct_max_point_2_object() const + { return Construct_max_point_2(); } + + typedef CGALi::Call_direction_to_get Construct_direction_of_line_2; + Construct_direction_of_line_2 + construct_direction_of_line_2_object() const + { return Construct_direction_of_line_2(); } + + typedef CGALi::Call_direction_to_get Construct_direction_of_ray_2; + Construct_direction_of_ray_2 + construct_direction_of_ray_2_object() const + { return Construct_direction_of_ray_2(); } + + typedef CGALi::Call_supporting_line_to_get Construct_supporting_line_2; + Construct_supporting_line_2 + construct_supporting_line_2_object() const + { return Construct_supporting_line_2(); } + + typedef CGALi::Call_perpendicular_to_get Construct_perpendicular_vector_2; + Construct_perpendicular_vector_2 + construct_perpendicular_vector_2_object() const + { return Construct_perpendicular_vector_2(); } + + typedef CGALi::Call_perpendicular_to_get Construct_perpendicular_direction_2; + Construct_perpendicular_direction_2 + construct_perpendicular_direction_2_object() const + { return Construct_perpendicular_direction_2(); } + + typedef CGALi::Call_perpendicular_to_get Construct_perpendicular_line_2; + Construct_perpendicular_line_2 + construct_perpendicular_line_2_object() const + { return Construct_perpendicular_line_2(); } + + typedef CGALi::p_Midpoint Construct_midpoint; + Construct_midpoint + construct_midpoint_object() const + { return Construct_midpoint(); } + + typedef CGALi::p_Circumcenter Construct_circumcenter_2; + Construct_circumcenter_2 + construct_circumcenter_2_object() const + { return Construct_circumcenter_2(); } + + typedef CGALi::pl_Bisector Construct_bisector_2; + Construct_bisector_2 + construct_bisector_2_object() const + { return Construct_bisector_2(); } + + typedef CGALi::Call_opposite_to_get Construct_opposite_segment_2; + Construct_opposite_segment_2 + construct_opposite_segment_2_object() const + { return Construct_opposite_segment_2(); } + + typedef CGALi::Call_opposite_to_get Construct_opposite_ray_2; + Construct_opposite_ray_2 + construct_opposite_ray_2_object() const + { return Construct_opposite_ray_2(); } + + typedef CGALi::Call_opposite_to_get Construct_opposite_line_2; + Construct_opposite_line_2 + construct_opposite_line_2_object() const + { return Construct_opposite_line_2(); } + + typedef CGALi::Call_opposite_to_get Construct_opposite_triangle_2; + Construct_opposite_triangle_2 + construct_opposite_triangle_2_object() const + { return Construct_opposite_triangle_2(); } + + typedef CGALi::Call_opposite_to_get Construct_opposite_circle_2; + Construct_opposite_circle_2 + construct_opposite_circle_2_object() const + { return Construct_opposite_circle_2(); } + + typedef CGALi::Call_transform Transform_2; + Transform_2 + transform_2_object() const + { return Transform_2(); } + + + typedef CGALi::Assign Assign_2; + Assign_2 + assign_2_object() const + { return Assign_2(); } + + typedef CGALi::Intersect Intersect_2; + Intersect_2 + intersect_2_object() const + { return Intersect_2(); } + + typedef CGALi::Call_y_at_x_to_get Compute_y_at_x; + Compute_y_at_x + compute_y_at_x_object() const + { return Compute_y_at_x(); } + + typedef CGALi::Call_squared_length_to_get Compute_squared_length_2; + Compute_squared_length_2 + Compute_squared_length_2_object() const + { return Compute_squared_length_2(); } + typedef CGALi::Equal Equal_2; + Equal_2 + equal_2_object() const + { return Equal_2(); } + + typedef CGALi::Equal_x Equal_x_2; + Equal_x_2 + equal_x_2_object() const + { return Equal_x_2(); } + + typedef CGALi::Equal_y Equal_y_2; + Equal_y_2 + equal_y_2_object() const + { return Equal_y_2(); } + + typedef CGALi::Equal_xy Equal_xy_2; + Equal_xy_2 + equal_xy_2_object() const + { return Equal_xy_2(); } + + typedef CGALi::Less_x Less_x_2; + Less_x_2 + less_x_2_object() const + { return Less_x_2(); } + + typedef CGALi::Less_y Less_y_2; + Less_y_2 + less_y_2_object() const + { return Less_y_2(); } + + typedef CGAL::p_Less_xy Less_xy_2; + Less_xy_2 + less_xy_2_object() const + { return Less_xy_2(); } + + typedef CGAL::p_Less_yx Less_yx_2; + Less_yx_2 + less_yx_2_object() const + { return Less_yx_2(); } + + typedef CGALi::Compare_x Compare_x_2; + Compare_x_2 + compare_x_2_object() const + { return Compare_x_2(); } + + typedef CGALi::Compare_y Compare_y_2; + Compare_y_2 + compare_y_2_object() const + { return Compare_y_2(); } + + typedef CGALi::Compare_xy Compare_xy_2; + Compare_xy_2 + compare_xy_2_object() const + { return Compare_xy_2(); } + + typedef CGALi::Compare_y_at_x Compare_y_at_x_2; + Compare_y_at_x_2 + compare_y_at_x_2_object() const + { return Compare_y_at_x_2(); } + + typedef CGAL ::p_Less_dist_to_point Less_distance_to_point_2; + Less_distance_to_point_2 + less_distance_to_point_2_object(const Point_2& p) const + { return Less_distance_to_point_2(p); } + + typedef CGAL ::p_Less_dist_to_line_2p Less_signed_distance_to_line_2; + Less_signed_distance_to_line_2 + less_signed_distance_to_line_2_object(const Point_2& p, const Point_2& q) const + { return Less_signed_distance_to_line_2(p,q); } + + typedef CGAL ::p_Less_rotate_ccw Less_rotate_ccw_2; + Less_rotate_ccw_2 + less_rotate_ccw_2_object(const Point_2& p) const + { return Less_rotate_ccw_2(p); } + + typedef CGALi::Counterclockwise_in_between Counterclockwise_in_between_2; + Counterclockwise_in_between_2 + counterclockwise_in_between_2_object() const + { return Counterclockwise_in_between_2(); } + + typedef CGAL ::p_Leftturn Leftturn_2; + Leftturn_2 + leftturn_2_object() const + { return Leftturn_2(); } + + typedef CGAL ::p_Left_of_line_2p Left_of_line_2; + Left_of_line_2 + left_of_line_2_object(const Point_2& p, const Point_2& q) const + { return Left_of_line_2(p,q); } + + typedef CGALi::Collinear Collinear_2; + Collinear_2 + collinear_2_object() const + { return Collinear_2(); } + + typedef CGAL ::p_Orientation Orientation_2; + Orientation_2 + orientation_2_object() const + { return Orientation_2(); } + + typedef CGALi::Side_of_oriented_circle Side_of_oriented_circle_2; + Side_of_oriented_circle_2 + side_of_oriented_circle_2_object() const + { return Side_of_oriented_circle_2(); } + + typedef CGALi::Side_of_bounded_circle Side_of_bounded_circle_2; + Side_of_bounded_circle_2 + side_of_bounded_circle_2_object() const + { return Side_of_bounded_circle_2(); } + + typedef CGALi::Call_is_horizontal Is_horizontal_2; + Is_horizontal_2 + is_horizontal_2_object() const + { return Is_horizontal_2(); } + + typedef CGALi::Call_is_vertical Is_vertical_2; + Is_vertical_2 + is_vertical_2_object() const + { return Is_vertical_2(); } + + typedef CGALi::Call_is_degenerate Is_degenerate_2; + Is_degenerate_2 + is_degenerate_2_object() const + { return Is_degenerate_2(); } + + typedef CGALi::Call_has_on Has_on_2; + Has_on_2 + has_on_2_object() const + { return Has_on_2(); } + + typedef CGALi::Call_collinear_has_on Collinear_has_on_2; + Collinear_has_on_2 + collinear_has_on_2_object() const + { return Collinear_has_on_2(); } + + typedef CGALi::Call_has_on_bounded_side Has_on_bounded_side_2; + Has_on_bounded_side_2 + has_on_bounded_side_2_object() const + { return Has_on_bounded_side_2(); } + + typedef CGALi::Call_has_on_unbounded_side Has_on_unbounded_side_2; + Has_on_unbounded_side_2 + has_on_unbounded_side_2_object() const + { return Has_on_unbounded_side_2(); } + + typedef CGALi::Call_has_on_boundary Has_on_boundary_2; + Has_on_boundary_2 + has_on_boundary_2_object() const + { return Has_on_boundary_2(); } + + typedef CGALi::Call_has_on_positive_side Has_on_positive_side_2; + Has_on_positive_side_2 + has_on_positive_side_2_object() const + { return Has_on_positive_side_2(); } + + typedef CGALi::Call_has_on_negative_side Has_on_negative_side_2; + Has_on_negative_side_2 + has_on_negative_side_2_object() const + { return Has_on_negative_side_2(); } + + typedef CGALi::Call_oriented_side Oriented_side_2; + Oriented_side_2 + oriented_side_2_object() const + { return Oriented_side_2(); } + + typedef CGALi::Are_ordered_along_line Are_ordered_along_line_2 ; + Are_ordered_along_line_2 + are_ordered_along_line_2_object() const + { return Are_ordered_along_line_2(); } + + typedef CGALi::Are_strictly_ordered_along_line Are_strictly_ordered_along_line_2; + Are_strictly_ordered_along_line_2 + are_strictly_ordered_along_line_2_object() const + { return Are_strictly_ordered_along_line_2(); } + + typedef CGALi::Collinear_are_ordered_along_line Collinear_are_ordered_along_line_2; + Collinear_are_ordered_along_line_2 + collinear_are_ordered_along_line_2_object() const + { return Collinear_are_ordered_along_line_2(); } + + typedef CGALi::Collinear_are_strictly_ordered_along_line Collinear_are_strictly_ordered_along_line_2; + Collinear_are_strictly_ordered_along_line_2 + collinear_are_strictly_ordered_along_line_2_object() const + { return Collinear_are_strictly_ordered_along_line_2(); } + + typedef PointH3< FT, RT> Point_3_base; + typedef VectorH3< FT, RT> Vector_3_base; + typedef DirectionH3< FT, RT> Direction_3_base; + typedef SegmentH3< FT, RT> Segment_3_base; + typedef PlaneH3< FT, RT> Plane_3_base; + typedef LineH3< FT, RT> Line_3_base; + typedef RayH3< FT, RT> Ray_3_base; + typedef TriangleH3< FT, RT> Triangle_3_base; + typedef TetrahedronH3< FT, RT> Tetrahedron_3_base; + typedef Iso_cuboidH3< FT, RT> Iso_cuboid_3_base; + typedef Aff_transformationH3< FT, RT> Aff_transformation_3_base; + typedef typename KernelBase::Point_3 Point_3; + typedef typename KernelBase::Vector_3 Vector_3; + typedef typename KernelBase::Direction_3 Direction_3; + typedef typename KernelBase::Plane_3 Plane_3; + typedef typename KernelBase::Line_3 Line_3; + typedef typename KernelBase::Segment_3 Segment_3; + typedef typename KernelBase::Ray_3 Ray_3; + typedef typename KernelBase::Triangle_3 Triangle_3; + typedef typename KernelBase::Tetrahedron_3 Tetrahedron_3; + typedef typename KernelBase::Iso_cuboid_3 Iso_cuboid_3; + typedef typename KernelBase::Aff_transformation_3 Aff_transformation_3; + + typedef CGALi::Construct Construct_point_3; + typedef CGALi::Construct Construct_vector_3; + typedef CGALi::Construct Construct_direction_3; + typedef CGALi::Construct Construct_segment_3; + typedef CGALi::Construct Construct_plane_3; + typedef CGALi::Construct Construct_line_3; + typedef CGALi::Construct Construct_ray_3; + typedef CGALi::Construct Construct_triangle_3; + typedef CGALi::Construct Construct_tetrahedron_3; + typedef CGALi::Construct Construct_iso_cuboid_3; + typedef CGALi::Construct Construct_aff_transformation_3; + + Construct_point_3 + construct_point_3_object() const + { return Construct_point_3(); } + + Construct_vector_3 + construct_vector_3_object() const + { return Construct_vector_3(); } + + Construct_direction_3 + construct_direction_3_object() const + { return Construct_direction_3(); } + + Construct_segment_3 + construct_segment_3_object() const + { return Construct_segment_3(); } + + Construct_plane_3 + construct_plane_3_object() const + { return Construct_plane_3(); } + + Construct_line_3 + construct_line_3_object() const + { return Construct_line_3(); } + + Construct_ray_3 + construct_ray_3_object() const + { return Construct_ray_3(); } + + Construct_triangle_3 + construct_triangle_3_object() const + { return Construct_triangle_3(); } + + Construct_tetrahedron_3 + construct_tetrahedron_object() const + { return Construct_tetrahedron_3(); } + + Construct_iso_cuboid_3 + construct_iso_cuboid_object() const + { return Construct_iso_cuboid_3(); } + + Construct_aff_transformation_3 + construct_aff_transformation_3_object() const + { return Construct_aff_transformation_3(); } + + typedef CGALi::Call_point_to_get Construct_point_on_3; + Construct_point_on_3 + construct_point_on_3_object() const + { return Construct_point_on_3(); } + + typedef CGALi::Call_second_point_to_get Construct_second_point_on_3; + Construct_second_point_on_3 + construct_second_point_on_3_object() const + { return Construct_second_point_on_3(); } + + typedef CGALi::Call_perpendicular_plane_to_get Construct_perpendicular_plane_3; + Construct_perpendicular_plane_3 + construct_perpendicular_plane_3() const + { return Construct_perpendicular_plane_3(); } + + typedef CGALi::p_Midpoint Construct_midpoint_3; + Construct_midpoint_3 + construct_midpoint_3_object() const + { return Construct_midpoint_3(); } + + typedef CGALi::Call_opposite_to_get Construct_opposite_segment_3; + Construct_opposite_segment_3 + construct_opposite_segment_3_object() const + { return Construct_opposite_segment_3(); } + + typedef CGALi::Call_opposite_to_get Construct_opposite_ray_3; + Construct_opposite_ray_3 + construct_opposite_ray_3_object() const + { return Construct_opposite_ray_3(); } + + typedef CGALi::Call_opposite_to_get Construct_opposite_line_3; + Construct_opposite_line_3 + construct_opposite_line_3_object() const + { return Construct_opposite_line_3(); } + + typedef CGALi::Call_supporting_plane_to_get Construct_supporting_plane_3; + Construct_supporting_plane_3 + construct_supporting_plane_3_object() const + { return Construct_supporting_plane_3(); } + + typedef CGALi::Call_transform Transform_3; + Transform_3 + transform_3_object() const + { return Transform_2(); } + + + typedef CGALi::Assign Assign_3; + Assign_3 + assign_3_object() const + { return Assign_3(); } + + typedef CGALi::Intersect Intersect_3; + Intersect_3 + intersect_3_object() const + { return Intersect_3(); } + + typedef CGALi::Call_squared_length_to_get Compute_squared_length_3; + Compute_squared_length_3 + compute_squared_length_3_object() const + { return Compute_squared_length_3(); } + + typedef CGALi::Equal Equal_3; + Equal_3 + equal_3_object() const + { return Equal_3(); } + + typedef CGALi::Equal_x Equal_x_3; + Equal_x_3 + equal_x_3_object() const + { return Equal_x_3(); } + + typedef CGALi::Equal_y Equal_y_3; + Equal_y_3 + equal_y_3_object() const + { return Equal_y_3(); } + + typedef CGALi::Equal_z Equal_z_3; + Equal_z_3 + equal_z_3_object() const + { return Equal_z_3(); } + + typedef CGALi::Equal_xy Equal_xy_3; + Equal_xy_3 + equal_xy_3_object() const + { return Equal_xy_3(); } + + typedef CGALi::Equal_xyz Equal_xyz_3; + Equal_xyz_3 + equal_xyz_3_object() const + { return Equal_xyz_3(); } + + typedef CGALi::Less_x Less_x_3; + Less_x_3 + less_x_3_object() const + { return Less_x_3(); } + + typedef CGALi::Less_y Less_y_3; + Less_y_3 + less_y_3_object() const + { return Less_y_3(); } + + typedef CGALi::Less_z Less_z_3; + Less_z_3 + less_z_3_object() const + { return Less_z_3(); } + + typedef CGAL::p_Less_xy Less_xy_3; + Less_xy_3 + less_xy_3_object() const + { return Less_xy_3(); } + + typedef CGALi::Less_xyz Less_xyz_3; + Less_xyz_3 + less_xyz_3_object() const + { return Less_xyz_3(); } + + typedef CGALi::Compare_x Compare_x_3; + Compare_x_3 + compare_x_3_object() const + { return Compare_x_3(); } + + typedef CGALi::Compare_y Compare_y_3; + Compare_y_3 + compare_y_3_object() const + { return Compare_y_3(); } + + typedef CGALi::Compare_z Compare_z_3; + Compare_z_3 + compare_z_3_object() const + { return Compare_z_3(); } + + typedef CGALi::Compare_xy Compare_xy_3; + Compare_xy_3 + compare_xy_3_object() const + { return Compare_xy_3(); } + + typedef CGALi::Compare_xyz Compare_xyz_3; + Compare_xyz_3 + compare_xyz_3_object() const + { return Compare_xyz_3(); } + + typedef CGAL ::p_Less_dist_to_point Less_distance_to_point_3; + Less_distance_to_point_3 + less_distance_to_point_3_object(const Point_3& p) const + { return Less_distance_to_point_3(p); } + + typedef CGALi::Collinear Collinear_3; + Collinear_3 + collinear_3_object() const + { return Collinear_3(); } + + typedef CGALi::Coplanar Coplanar_3 ; + Coplanar_3 + coplanar_3_object() const + { return Coplanar_3(); } + + typedef CGAL ::p_Orientation Orientation_3; + Orientation_3 + orientation_3_object() const + { return Orientation_3(); } + + typedef CGALi::Call_is_degenerate Is_degenerate_3; + Is_degenerate_3 + is_degenerate_3_object() const + { return Is_degenerate_3(); } + + typedef CGALi::Call_has_on Has_on_3; + Has_on_3 + has_on_3_object() const + { return Has_on_3(); } + + typedef CGALi::Call_has_on_bounded_side Has_on_bounded_side_3; + Has_on_bounded_side_3 + has_on_bounded_side_3_object() const + { return Has_on_bounded_side_3(); } + + typedef CGALi::Call_has_on_unbounded_side Has_on_unbounded_side_3; + Has_on_unbounded_side_3 + has_on_unbounded_side_3_object() const + { return Has_on_unbounded_side_3(); } + + typedef CGALi::Call_has_on_boundary Has_on_boundary_3; + Has_on_boundary_3 + has_on_boundary_3_object() const + { return Has_on_boundary_3(); } + + typedef CGALi::Call_has_on_positive_side Has_on_positive_side_3; + Has_on_positive_side_3 + has_on_positive_side_3_object() const + { return Has_on_positive_side_3(); } + + typedef CGALi::Call_has_on_negative_side Has_on_negative_side_3; + Has_on_negative_side_3 + has_on_negative_side_3_object() const + { return Has_on_negative_side_3(); } + + typedef CGALi::Call_oriented_side Oriented_side_3; + Oriented_side_3 + oriented_side_3_object() const + { return Oriented_side_3(); } + + typedef CGALi::Are_ordered_along_line Are_ordered_along_line_3 ; + Are_ordered_along_line_3 + are_ordered_along_line_3_object() const + { return Are_ordered_along_line_3(); } + + typedef CGALi::Are_strictly_ordered_along_line Are_strictly_ordered_along_line_3; + Are_strictly_ordered_along_line_3 + are_strictly_ordered_along_line_3_object() const + { return Are_strictly_ordered_along_line_3(); } + + typedef CGALi::Collinear_are_ordered_along_line Collinear_are_ordered_along_line_3; + Collinear_are_ordered_along_line_3 + collinear_are_ordered_along_line_3_object() const + { return Collinear_are_ordered_along_line_3(); } + + typedef CGALi::Collinear_are_strictly_ordered_along_line Collinear_are_strictly_ordered_along_line_3; + Collinear_are_strictly_ordered_along_line_3 + collinear_are_strictly_ordered_along_line_3_object() const + { return Collinear_are_strictly_ordered_along_line_3(); } + + typedef CGALi::Side_of_oriented_sphere Side_of_oriented_sphere_3; + Side_of_oriented_sphere_3 + side_of_oriented_sphere_3_object() const + { return Side_of_oriented_sphere_3(); } + + typedef CGALi::Side_of_bounded_sphere Side_of_bounded_sphere_3; + Side_of_bounded_sphere_3 + side_of_bounded_sphere_3_object() const + { return Side_of_bounded_sphere_3(); } + + typedef PointHd< FT, RT> Point_d_base; + + typedef typename KernelBase::Point_d Point_d; + + typedef CGALi::Construct Construct_point_d; + + Construct_point_d + construct_point_d_object() const + { return Construct_point_d(); } + + typedef Data_accessorH2 Data_accessor_2; + typedef ConicHPA2 Conic_2; + static + FT + makeFT_(const RT & num, const RT& denom) + { return FT(num, denom); } + + static + FT + makeFT_(const RT & num) + { return FT(num); } + + static + RT + FT_numerator(const FT &r) + { return r.numerator(); } + + static + RT + FT_denominator(const FT &r) + { return r.denominator(); } + +}; +} // namespace CGAL + +#endif // CGAL_HOMOGENEOUS_REP_H diff --git a/Old_Packages/New_kernel/include_advanced/CGAL/user_classes.h b/Old_Packages/New_kernel/include_advanced/CGAL/user_classes.h new file mode 100644 index 00000000000..7425f322700 --- /dev/null +++ b/Old_Packages/New_kernel/include_advanced/CGAL/user_classes.h @@ -0,0 +1,71 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : advanced_user_classes.fw +// file : user_classes.h +// revision : 3.4 +// revision_date : 07 Apr 2000 +// author(s) : Herve Broennimann +// Stefan Schirra +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_USER_CLASSES_H +#define CGAL_USER_CLASSES_H + +namespace CGAL { +/* 2D */ +template < class R, class T = typename R::Rep_tag > class Point_2; +template < class R, class T = typename R::Rep_tag > class Vector_2; +template < class R, class T = typename R::Rep_tag > class Direction_2; +template < class R, class T = typename R::Rep_tag > class Line_2; +template < class R, class T = typename R::Rep_tag > class Ray_2; +template < class R, class T = typename R::Rep_tag > class Segment_2; +template < class R, class T = typename R::Rep_tag > class Triangle_2; +template < class R, class T = typename R::Rep_tag > class Circle_2; +template < class R, class T = typename R::Rep_tag > class Data_accessor_2; +template < class R, class T = typename R::Rep_tag > class Iso_rectangle_2; +template < class R, class T = typename R::Rep_tag > class Aff_transformation_2; + +/* 3D */ +template < class R, class T = typename R::Rep_tag > class Plane_3; +template < class R, class T = typename R::Rep_tag > class Point_3; +template < class R, class T = typename R::Rep_tag > class Vector_3; +template < class R, class T = typename R::Rep_tag > class Direction_3; +template < class R, class T = typename R::Rep_tag > class Line_3; +template < class R, class T = typename R::Rep_tag > class Ray_3; +template < class R, class T = typename R::Rep_tag > class Segment_3; +template < class R, class T = typename R::Rep_tag > class Triangle_3; +template < class R, class T = typename R::Rep_tag > class Tetrahedron_3; +template < class R, class T = typename R::Rep_tag > class Iso_cuboid_3; +template < class R, class T = typename R::Rep_tag > class Aff_transformation_3; + +/* dD */ +template < class R> class Point_d; + +inline +bool +advanced_kernel_enabled() +{ +#ifndef CGAL_CFG_NO_ADVANCED_KERNEL + return true; +#else + return false; +#endif // CGAL_CFG_NO_ADVANCED_KERNEL +} + +} // namespace CGAL +#endif // CGAL_USER_CLASSES_H diff --git a/Old_Packages/New_kernel/test/NewKernel/cgal_test b/Old_Packages/New_kernel/test/NewKernel/cgal_test new file mode 100755 index 00000000000..812ba5bd0a1 --- /dev/null +++ b/Old_Packages/New_kernel/test/NewKernel/cgal_test @@ -0,0 +1,69 @@ +#! /bin/sh +# This is a script for the CGAL test suite. Such a script must obey +# the following rules: +# +# - the name of the script is cgal_test +# - for every target two one line messages are written to the file 'error.txt' +# the first one indicates if the compilation was successful +# the second one indicates if the execution was successful +# if one of the two was not successful, the line should start with 'ERROR:' +# - running the script should not require any user interaction +# - the script should clean up object files and executables + +ERRORFILE=error.txt + +#---------------------------------------------------------------------# +# compile_and_run +#---------------------------------------------------------------------# + +compile_and_run() +{ + echo "Compiling $1 ... " + if eval 'make CGAL_MAKEFILE=$CGAL_MAKEFILE \ + TESTSUITE_CXXFLAGS="$TESTSUITE_CXXFLAGS" \ + TESTSUITE_LDFLAGS="$TESTSUITE_LDFLAGS" $1' ; then + echo " compilation of $1 succeeded" >> $ERRORFILE + else + echo " ERROR: compilation of $1 failed" >> $ERRORFILE + fi + + if [ -f $1 ] ; then + OUTPUTFILE=ProgramOutput.$1.$PLATFORM + /bin/rm -f $OUTPUTFILE + COMMAND="./$1" + if [ -f $1.cmd ] ; then + COMMAND="$COMMAND '`cat $1.cmd`'" + fi + if [ -f $1.cin ] ; then + COMMAND="echo '`cat $1.cin`' | $COMMAND" + fi + echo "Executing $1 ... " + echo + if eval 2>&1 $COMMAND > $OUTPUTFILE ; then + echo " execution of $1 succeeded" >> $ERRORFILE + else + echo " ERROR: execution of $1 failed" >> $ERRORFILE + fi + else + echo " ERROR: could not execute $1" >> $ERRORFILE + fi + + eval "2>&1 make CGAL_MAKEFILE=$CGAL_MAKEFILE clean > /dev/null " +} + +#---------------------------------------------------------------------# +# remove the previous error file +#---------------------------------------------------------------------# + +/bin/rm -f $ERRORFILE +touch $ERRORFILE + +#---------------------------------------------------------------------# +# compile and run the tests +#---------------------------------------------------------------------# + + +compile_and_run test_new_kernelH2 +compile_and_run test_new_kernelH3 +compile_and_run test_new_kernelC2 +compile_and_run test_new_kernelC3 diff --git a/Old_Packages/New_kernel/test/NewKernel/makefile b/Old_Packages/New_kernel/test/NewKernel/makefile new file mode 100644 index 00000000000..106c2f98b9a --- /dev/null +++ b/Old_Packages/New_kernel/test/NewKernel/makefile @@ -0,0 +1,72 @@ +# Created by the script create_makefile +# This is the makefile for compiling a CGAL application. + +#---------------------------------------------------------------------# +# include platform specific settings +#---------------------------------------------------------------------# +# Choose the right include file from the /make directory. + +CGAL_MAKEFILE = ENTER_YOUR_INCLUDE_MAKEFILE_HERE +include $(CGAL_MAKEFILE) + +#---------------------------------------------------------------------# +# compiler flags +#---------------------------------------------------------------------# + +CXXFLAGS = \ + -I../../include_advanced \ + $(TESTSUITE_CXXFLAGS) \ + $(EXTRA_FLAGS) \ + -I../Kernel/include \ + $(CGAL_CXXFLAGS) \ + $(LONG_NAME_PROBLEM_CXXFLAGS) \ + $(DEBUG_OPT) + +#---------------------------------------------------------------------# +# linker flags +#---------------------------------------------------------------------# + +LIBPATH = \ + $(TESTSUITE_LIBPATH) \ + $(CGAL_LIBPATH) + +LDFLAGS = \ + $(TESTSUITE_LDFLAGS) \ + $(LONG_NAME_PROBLEM_LDFLAGS) \ + $(CGAL_LDFLAGS) + +#---------------------------------------------------------------------# +# target entries +#---------------------------------------------------------------------# + +all: \ + test_new_kernelC2 \ + test_new_kernelC3 \ + test_new_kernelH2 \ + test_new_kernelH3 + +test_new_kernelC2$(EXE_EXT): test_new_kernelC2$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_new_kernelC2 test_new_kernelC2$(OBJ_EXT) $(LDFLAGS) + +test_new_kernelC3$(EXE_EXT): test_new_kernelC3$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_new_kernelC3 test_new_kernelC3$(OBJ_EXT) $(LDFLAGS) + +test_new_kernelH2$(EXE_EXT): test_new_kernelH2$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_new_kernelH2 test_new_kernelH2$(OBJ_EXT) $(LDFLAGS) + +test_new_kernelH3$(EXE_EXT): test_new_kernelH3$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_new_kernelH3 test_new_kernelH3$(OBJ_EXT) $(LDFLAGS) + +clean: \ + test_new_kernelC2.clean \ + test_new_kernelC3.clean \ + test_new_kernelH2.clean \ + test_new_kernelH3.clean + +#---------------------------------------------------------------------# +# suffix rules +#---------------------------------------------------------------------# + +.C$(OBJ_EXT): + $(CGAL_CXX) $(CXXFLAGS) $(OBJ_OPT) $< + diff --git a/Old_Packages/New_kernel/test/NewKernel/test_new_kernelC2.C b/Old_Packages/New_kernel/test/NewKernel/test_new_kernelC2.C new file mode 100644 index 00000000000..9fbd700a5d2 --- /dev/null +++ b/Old_Packages/New_kernel/test/NewKernel/test_new_kernelC2.C @@ -0,0 +1,57 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : NewKernel/test_programs.fw +// file : test/NewKernel/test_new_kernelC2.C +// revision : 3.2 +// revision_date : 04 Apr 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#undef CGAL_CFG_NO_ADVANCED_KERNEL +#include +#include +#ifdef CGAL_USE_LEDA +#include +#include +typedef leda_integer Precise_integer; +typedef leda_rational Precise_rational; +#else +# ifdef CGAL_USE_GMP +#include +#include +typedef CGAL::Gmpz Precise_integer; +typedef CGAL::Quotient Precise_rational; +# endif // CGAL_USE_GMP +#endif // CGAL_USE_LEDA + + + +#include + + +typedef CGAL::Cartesian Kernel; + + +int main() +{ + test_new_2( Kernel() ); + return 0; +} + diff --git a/Old_Packages/New_kernel/test/NewKernel/test_new_kernelC3.C b/Old_Packages/New_kernel/test/NewKernel/test_new_kernelC3.C new file mode 100644 index 00000000000..20003656383 --- /dev/null +++ b/Old_Packages/New_kernel/test/NewKernel/test_new_kernelC3.C @@ -0,0 +1,56 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : NewKernel/test_programs.fw +// file : test/NewKernel/test_new_kernelC3.C +// revision : 3.2 +// revision_date : 04 Apr 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#undef CGAL_CFG_NO_ADVANCED_KERNEL +#include +#include +#ifdef CGAL_USE_LEDA +#include +#include +typedef leda_integer Precise_integer; +typedef leda_rational Precise_rational; +#else +# ifdef CGAL_USE_GMP +#include +#include +typedef CGAL::Gmpz Precise_integer; +typedef CGAL::Quotient Precise_rational; +# endif // CGAL_USE_GMP +#endif // CGAL_USE_LEDA + + + +#include + + +typedef CGAL::Cartesian Kernel; + +int main() +{ + test_new_3( Kernel() ); + return 0; +} + diff --git a/Old_Packages/New_kernel/test/NewKernel/test_new_kernelH2.C b/Old_Packages/New_kernel/test/NewKernel/test_new_kernelH2.C new file mode 100644 index 00000000000..e799ad74df8 --- /dev/null +++ b/Old_Packages/New_kernel/test/NewKernel/test_new_kernelH2.C @@ -0,0 +1,55 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : NewKernel/test_programs.fw +// file : test/NewKernel/test_new_kernelH2.C +// revision : 3.2 +// revision_date : 04 Apr 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include +#ifdef CGAL_USE_LEDA +#include +#include +typedef leda_integer Precise_integer; +typedef leda_rational Precise_rational; +#else +# ifdef CGAL_USE_GMP +#include +#include +typedef CGAL::Gmpz Precise_integer; +typedef CGAL::Quotient Precise_rational; +# endif // CGAL_USE_GMP +#endif // CGAL_USE_LEDA + + + +#include + + +typedef CGAL::Homogeneous Kernel; + + +int main() +{ + test_new_2( Kernel() ); + return 0; +} + diff --git a/Old_Packages/New_kernel/test/NewKernel/test_new_kernelH3.C b/Old_Packages/New_kernel/test/NewKernel/test_new_kernelH3.C new file mode 100644 index 00000000000..3e297bd7411 --- /dev/null +++ b/Old_Packages/New_kernel/test/NewKernel/test_new_kernelH3.C @@ -0,0 +1,54 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : NewKernel/test_programs.fw +// file : test/NewKernel/test_new_kernelH3.C +// revision : 3.2 +// revision_date : 04 Apr 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include +#ifdef CGAL_USE_LEDA +#include +#include +typedef leda_integer Precise_integer; +typedef leda_rational Precise_rational; +#else +# ifdef CGAL_USE_GMP +#include +#include +typedef CGAL::Gmpz Precise_integer; +typedef CGAL::Quotient Precise_rational; +# endif // CGAL_USE_GMP +#endif // CGAL_USE_LEDA + + + +#include + + +typedef CGAL::Homogeneous Kernel; + +int main() +{ + test_new_3( Kernel() ); + return 0; +} + diff --git a/Old_Packages/New_kernel/version b/Old_Packages/New_kernel/version new file mode 100644 index 00000000000..443186cbe52 --- /dev/null +++ b/Old_Packages/New_kernel/version @@ -0,0 +1,2 @@ +3.2 (07 Apr 2000) +maintainer: Stefan Schirra diff --git a/Old_Packages/_2/changes.txt b/Old_Packages/_2/changes.txt new file mode 100644 index 00000000000..a679e65269a --- /dev/null +++ b/Old_Packages/_2/changes.txt @@ -0,0 +1,218 @@ +3.6 (30 Jul 2000) + +- id() removed +- copy assigment (operator=) removed (the compiler will do it the right way) + +3.5 (26 Jul 2000) + +- identical() removed + +3.4 (31 May 2000) + +- Reflection added to Aff_transformation_2 + +3.3 (18 Apr 2000) + +- _R -> R_ +- Bbox_2 uses Handle_for<> now + +3.2 (06 Apr 2000) + +- include_advanced/CGAL/Old_style_kernel/U_2.h files created + which define class U_2 : public R::U_2_base + +3.1 (30 Mar 2000) + +- Point_2::operator= removed + problems with Simple_cartesian, where no copy assignment is defined + base class function should match instead + +3.0 (02 Feb 2000) + +- automatic inclusion for Simple_cartesian added + +2.8.1 (01 Feb 2000) + +- CGAL_static_cast replaced by static_cast<> + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 2 . 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +2.8 -> 2.8.1 (07 Nov 99) +- constructor for Identity added to Aff_transformation_2 + +2.7.5 -> 2.8 (28 Oct 99) +- removed CGAL:: in non member functions in CGAL scope + +2.7.4 -> 2.7.5 (14 Oct 99) +- added to_vector() to Direction_2 + +2.7.3 -> 2.7.4 (08 Oct 99) +- Direction_2::vector() now calls to_vector() on implementation + classes + +2.7.2 -> 2.7.3 (07 Oct 99) +- used CGAL_SCOPE in Point_2.h and Vector_2.h to resolve + qualification competition between mips and M$ VC++ + +2.7.1 -> 2.7.2 (24 Sep 99) +- undo of qualification: problems with M$ VC++ + +2.7 -> 2.7.1 (21 Sep 99) +- qualified friends in Point_2 and Vector_2 by CGAL:: + (as requested by Matthias) + +2.6 -> 2.7 (02 Sep 99) +- qualified ..._2<_R> by CGAL:: + +2.5 -> 2.6 (02 Sep 99) +- qualified ..._2 by CGAL:: + +2.4 -> 2.5 (01 Sep 99) +- #include <..C2.h> replaced #include <../Cartesian/.._2.h> + +2.3 -> 2.4 (01 Sep 99) +- class p_Equal_xy added to predicate classes + +2.2 -> 2.3 (19 Aug 99) +- _2 is now derived from R::_2_base instead of R::_2 + typedef typename R::_2 R_2; replaced by + typedef typename R::_2_base R_2; + +2.1.2 -> 2.2 (04 Aug 99) +- updates/workarounds for gcc-2.95: + s/friend inline/friend CGAL_FRIEND_INLINE + s/friend CGAL_KERNEL_INLINE/friend CGAL_KERNEL_FRIEND_INLINE + made all operator-() friends non-friends + + reorganized Point_2 and Vector_2 + added files point_vector_declarations_2.h + point_vector_definitions_2.C +2.5 -> 2.6 (02 Sep 99) +- qualified ..._2 by CGAL:: + +2.4 -> 2.5 (01 Sep 99) +- #include <..C2.h> replaced #include <../Cartesian/.._2.h> + +2.3 -> 2.4 (01 Sep 99) +- class p_Equal_xy added to predicate classes + +2.2 -> 2.3 (19 Aug 99) +- _2 is now derived from R::_2_base instead of R::_2 + typedef typename R::_2 R_2; replaced by + typedef typename R::_2_base R_2; + +2.1.2 -> 2.2 (04 Aug 99) +- updates/workarounds for gcc-2.95: + s/friend inline/friend CGAL_FRIEND_INLINE + s/friend CGAL_KERNEL_INLINE/friend CGAL_KERNEL_FRIEND_INLINE + made all operator-() friends non-friends + + reorganized Point_2 and Vector_2 + added files point_vector_declarations_2.h + point_vector_definitions_2.C +2.5 -> 2.6 (02 Sep 99) +- qualified ..._2 by CGAL:: + +2.4 -> 2.5 (01 Sep 99) +- #include <..C2.h> replaced #include <../Cartesian/.._2.h> + +2.3 -> 2.4 (01 Sep 99) +- class p_Equal_xy added to predicate classes + +2.2 -> 2.3 (19 Aug 99) +- _2 is now derived from R::_2_base instead of R::_2 + typedef typename R::_2 R_2; replaced by + typedef typename R::_2_base R_2; + +2.1.2 -> 2.2 (04 Aug 99) +- updates/workarounds for gcc-2.95: + s/friend inline/friend CGAL_FRIEND_INLINE + s/friend CGAL_KERNEL_INLINE/friend CGAL_KERNEL_FRIEND_INLINE + made all operator-() friends non-friends + + reorganized Point_2 and Vector_2 + added files point_vector_declarations_2.h + point_vector_definitions_2.C + added conversion fucntions between points and vectors + those are friends and used by operator-() - functions that are no friends + any longer + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 2 . 0 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +2.1.1 -> 2.1.2 (09 May 99) +- corrected placement of 'inline' in Vector_2.h (caused a warning) + +2.1 -> 2.1.1 (06 May 99) +- call of orientation in predicates_on_points_2.h qualified by CGAL:: + +2.0.5 -> 2.1 (16 Apr 99) +- iostream parts prefixed by std:: + +2.0.4 -> 2.0.5 (19 Mar 99) +- binary function prefixed by CGAL_STD:: in derivations in + + +2.0.3 -> 2.0.4 (16 Mar 99) +- SunPro 5.0 doesn't like extra semicolons :) + "predicate_classes_2.h", + line 33: Error: Empty declaration (probably an extra semicolon). + extra semicolons removed in + +2.0.2 -> 2.0.3 (14 Mar 99) +- CGAL::min/max replaced by std::min/max in Bbox_2.h + +2.0.1 -> 2.0.2 +- CGAL_[BEGIN|END]_NAMESPACE used + +2.0 -> 2.0.1 +- Quotient declared in + +1.3 -> 2.0 (04 Feb 98) +- namespace CGAL { } introduced + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 1 . 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +1.2.5 -> 1.3 (15 Dec 98) +- file names in header corrected in Bbox_2.h, predicate_classes_2.h +- Use of CGAL...INLINE made consistent between declarations and + definitions (otherwise SunPro CC 4.2 does not like it). + +1.2.4 -> 1.2.5 (23 Nov 98) +- predicate_classes_2.h added (first version) + +1.2.3 -> 1.2.4 (03 Sep 98) +- ORIGIN [!=]= Point_2 added + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 1 . 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +1.2.3 +- Ray_2::collinear_has_on(.) added +- Segment_2::point( int i) added + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 1 . 0 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +1.2.1 -> 1.2.2 +- added typename keyword in basic_constructions_2.h + +1.2 -> 1.2.1 +- Vector_2 / Quotient added + +1.1.1 -> 1.2 +- made fit for egcs + +1.1 -> 1.1.1 +- missing file (basic_constructions_2.h) added + +1.0 -> 1.1 +- added typename keyword + +0.9 -> 1.0 +- Now CGAL_are_ordered_along_line(p,q,r) have strict + versions as well. The strict versions return false, + if the test point is equal to one of the end points + (the previous H-version behavior) while the fcts + without the strictly in the name allow for equality + (the old C-version behavior). +- Aff_transformations got access mfcts. +- CGAL_compare_delta... added +- added typedefs and typename keyword in _2 classes diff --git a/Old_Packages/_2/description.txt b/Old_Packages/_2/description.txt new file mode 100644 index 00000000000..daf3504ab88 --- /dev/null +++ b/Old_Packages/_2/description.txt @@ -0,0 +1 @@ +abstract 2d kernel parameterized by rep class R diff --git a/Old_Packages/_2/include/CGAL/Aff_transformation_2.h b/Old_Packages/_2/include/CGAL/Aff_transformation_2.h new file mode 100644 index 00000000000..cf55f4493cb --- /dev/null +++ b/Old_Packages/_2/include/CGAL/Aff_transformation_2.h @@ -0,0 +1,234 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : Aff_transformation_2.fw +// file : Aff_transformation_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_AFF_TRANSFORMATION_2_H +#define CGAL_AFF_TRANSFORMATION_2_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#if defined(CGAL_CFG_INCOMPLETE_TYPE_BUG_1) && \ + !defined(CGAL_NO_LINE_TRANSFORM_IN_AT) +#define CGAL_NO_LINE_TRANSFORM_IN_AT +#endif // CGAL_CFG_INCOMPLETE_TYPE_BUG_1 + +#ifndef CGAL_LINE_2_H +#include +#endif // CGAL_LINE_2_H + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_AFF_TRANSFORMATIONH2_H +#include +#endif // CGAL_AFF_TRANSFORMATIONH2_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_AFF_TRANSFORMATIONC2_H +#include +#endif // CGAL_AFF_TRANSFORMATIONC2_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +CGAL_BEGIN_NAMESPACE + +template +class Aff_transformation_2 : public R_::Aff_transformation_2_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Line_2_base RLine_2; + typedef typename R::Direction_2_base RDirection_2; + typedef typename R::Aff_transformation_2_base RAff_transformation_2; + + // default constructor + Aff_transformation_2() + : RAff_transformation_2() + {} + + // copy constructor + Aff_transformation_2(const CGAL::Aff_transformation_2 &t) + : RAff_transformation_2(t) + {} + + // up cast constructor + Aff_transformation_2(const RAff_transformation_2& t) + : RAff_transformation_2(t) + {} + + // Identity: + Aff_transformation_2(const Identity_transformation tag) + : RAff_transformation_2(tag) + {} + + // Translation: + Aff_transformation_2(const Translation tag, + const CGAL::Vector_2 &v) + : RAff_transformation_2(tag, v) + {} + + // Rational Rotation: + Aff_transformation_2(const Rotation tag, + const CGAL::Direction_2 &d, + const RT &num, + const RT &den = RT(1)) + : RAff_transformation_2(tag, RDirection_2(d), num, den) + {} + + Aff_transformation_2(const Rotation tag, + const RT &sin, + const RT &cos, + const RT &den = RT(1)) + : RAff_transformation_2(tag, sin, cos, den) + {} + + // Reflection: + Aff_transformation_2(const Reflection tag, + const CGAL::Line_2& l ) + : RAff_transformation_2(tag, l) + {} + + + // Scaling: + Aff_transformation_2(const Scaling tag, + const RT &s, + const RT &w= RT(1)) + : RAff_transformation_2(tag, s, w) + {} + + // The general case: + Aff_transformation_2(const RT & m11, + const RT & m12, + const RT & m13, + + const RT & m21, + const RT & m22, + const RT & m23, + + const RT &w= RT(1)) + : RAff_transformation_2(m11, m12, m13, + m21, m22, m23, + w) + {} + + Aff_transformation_2(const RT & m11, const RT & m12, + const RT & m21, const RT & m22, + const RT &w = RT(1)) + : RAff_transformation_2(m11, m12, + m21, m22, + w) + {} + + ~Aff_transformation_2() + {} + + CGAL::Point_2 transform(const CGAL::Point_2 &p) const + { return RAff_transformation_2::transform(p); } + + CGAL::Point_2 operator()(const CGAL::Point_2 &p) const + { return transform(p); } + + CGAL::Vector_2 transform(const CGAL::Vector_2 &v) const + { return RAff_transformation_2::transform(v); } + + CGAL::Vector_2 operator()(const CGAL::Vector_2 &v) const + { return transform(v); } + + CGAL::Direction_2 transform(const CGAL::Direction_2 &d) const + { return RAff_transformation_2::transform(d); } + + CGAL::Direction_2 operator()(const CGAL::Direction_2 &d) const + { return transform(d); } + + CGAL::Line_2 transform(const CGAL::Line_2 &l) const + { +#ifndef CGAL_NO_LINE_TRANSFORM_IN_AT + return RAff_transformation_2::transform(l); +#else + return + ((const RLine_2&)l).transform((const RAff_transformation_2&)(*this)); +#endif // CGAL_NO_LINE_TRANSFORM_IN_AT + } + + CGAL::Line_2 operator()(const CGAL::Line_2 &l) const + { return transform(l); } + + + CGAL::Aff_transformation_2 + inverse() const + { return RAff_transformation_2::inverse(); } + + bool is_even() const + { return RAff_transformation_2::is_even(); } + + bool is_odd() const + { return !is_even(); } + + CGAL::Aff_transformation_2 + operator*(const CGAL::Aff_transformation_2 &t) const + { return RAff_transformation_2::operator*(t); } + + FT cartesian(int i, int j) const + { return RAff_transformation_2::cartesian(i,j); } + RT homogeneous(int i, int j) const + { return RAff_transformation_2::homogeneous(i,j); } + FT m(int i, int j) const + { return RAff_transformation_2::m(i,j); } + RT hm(int i, int j) const + { return RAff_transformation_2::hm(i,j); } + +}; + +#ifndef NO_OSTREAM_INSERT_AFF_TRANSFORMATION_2 +template < class R > +std::ostream & +operator<<(std::ostream &os, const CGAL::Aff_transformation_2 &t) +{ + typedef typename R::Aff_transformation_2_base RAff_transformation_2; + return os << (const RAff_transformation_2&)t; +} +#endif // NO_OSTREAM_INSERT_AFF_TRANSFORMATION_2 + +#ifndef NO_ISTREAM_EXTRACT_AFF_TRANSFORMATION_2 +template < class R > +std::istream & +operator>>(std::istream &is, CGAL::Aff_transformation_2 &t) +{ + typedef typename R::Aff_transformation_2_base RAff_transformation_2; + return is >> (RAff_transformation_2&)t; +} +#endif // NO_ISTREAM_EXTRACT_AFF_TRANSFORMATION_2 + +CGAL_END_NAMESPACE + + +#endif // CGAL_AFF_TRANSFORMATION_2_H diff --git a/Old_Packages/_2/include/CGAL/Bbox_2.h b/Old_Packages/_2/include/CGAL/Bbox_2.h new file mode 100644 index 00000000000..0ad2965252b --- /dev/null +++ b/Old_Packages/_2/include/CGAL/Bbox_2.h @@ -0,0 +1,178 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : Bbox_2.fw +// file : Bbox_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_BBOX_2_H +#define CGAL_BBOX_2_H + +#ifndef CGAL_BASIC_H +#include +#endif // CGAL_BASIC_H +#ifndef CGAL_CARTESIAN_CLASSES_H +#include +#endif // CGAL_CARTESIAN_CLASSES_H +#ifndef FOURTUPLE_H +#include +#endif // FOURTUPLE_H + +CGAL_BEGIN_NAMESPACE + +class Bbox_2 : public Handle_for< Fourtuple > +{ +public: + Bbox_2(); + Bbox_2(double x_min, double y_min, + double x_max, double y_max); + + bool operator==(const Bbox_2 &b) const; + bool operator!=(const Bbox_2 &b) const; + + int dimension() const; + double xmin() const; + double ymin() const; + double xmax() const; + double ymax() const; + + double max(int i) const; + double min(int i) const; + + Bbox_2 operator+(const Bbox_2 &b) const; + +}; + + +inline +int +Bbox_2::dimension() const +{ return 2; } + +inline +double +Bbox_2::xmin() const +{ return ptr->e0; } + +inline +double +Bbox_2::ymin() const +{ return ptr->e1; } + +inline +double +Bbox_2::xmax() const +{ return ptr->e2; } + +inline +double +Bbox_2::ymax() const +{ return ptr->e3; } + +inline +double +Bbox_2::min(int i) const +{ + CGAL_kernel_precondition( (i == 0 ) || ( i == 1 ) ); + if(i == 0) { return xmin(); } + return ymin(); +} + +inline +double +Bbox_2::max(int i) const +{ + CGAL_kernel_precondition( (i == 0 ) || ( i == 1 ) ); + if(i == 0) { return xmax(); } + return ymax(); +} +inline Bbox_2 Bbox_2::operator+(const Bbox_2 &b) const +{ + return Bbox_2(std::min(xmin(), b.xmin()), + std::min(ymin(), b.ymin()), + std::max(xmax(), b.xmax()), + std::max(ymax(), b.ymax())); +} +inline bool do_overlap(const Bbox_2 &bb1, const Bbox_2 &bb2) +{ + // check for emptiness ?? + if (bb1.xmax() < bb2.xmin() || bb2.xmax() < bb1.xmin()) + return false; + if (bb1.ymax() < bb2.ymin() || bb2.ymax() < bb1.ymin()) + return false; + return true; +} + +#ifndef NO_OSTREAM_INSERT_BBOX_2 +inline +std::ostream& +operator<<(std::ostream &os, const Bbox_2 &b) +{ + switch(os.iword(IO::mode)) { + case IO::ASCII : + os << b.xmin() << ' ' << b.ymin() << ' ' + << b.xmax() << ' ' << b.ymax(); + break; + case IO::BINARY : + write(os, b.xmin()); + write(os, b.ymin()); + write(os, b.xmax()); + write(os, b.ymax()); + break; + default: + os << "Bbox_2(" << b.xmin() << ", " << b.ymin() << ", " + << b.xmax() << ", " << b.ymax() << ")"; + break; + } + return os; +} +#endif // NO_OSTREAM_INSERT_BBOX_2 + + + +#ifndef NO_ISTREAM_EXTRACT_BBOX_2 +inline +std::istream& +operator>>(std::istream &is, Bbox_2 &b) +{ + double xmin, ymin, xmax, ymax; + + switch(is.iword(IO::mode)) { + case IO::ASCII : + is >> xmin >> ymin >> xmax >> ymax; + break; + case IO::BINARY : + read(is, xmin); + read(is, ymin); + read(is, xmax); + read(is, ymax); + break; + } + b = Bbox_2(xmin, ymin, xmax, ymax); + return is; +} +#endif // NO_ISTREAM_EXTRACT_BBOX_2 + + +CGAL_END_NAMESPACE + + +#endif // CGAL_BBOX_2_H diff --git a/Old_Packages/_2/include/CGAL/Circle_2.h b/Old_Packages/_2/include/CGAL/Circle_2.h new file mode 100644 index 00000000000..44ae40e305a --- /dev/null +++ b/Old_Packages/_2/include/CGAL/Circle_2.h @@ -0,0 +1,219 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : Circle_2.fw +// file : Circle_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Andreas Fabri +// Sven Schoenherr +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_CIRCLE_2_H +#define CGAL_CIRCLE_2_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_CIRCLEH2_H +#include +#endif // CGAL_CIRCLEH2_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_CIRCLEC2_H +#include +#endif // CGAL_CIRCLEC2_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_POINT_2_H +#include +#endif // CGAL_POINT_2_H + +CGAL_BEGIN_NAMESPACE + +template + class Circle_2 : public R_::Circle_2_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Circle_2_base RCircle_2; + + Circle_2() + : RCircle_2() + {} + + Circle_2(const CGAL::Circle_2 &t) + : RCircle_2((RCircle_2&)t) + {} + + Circle_2(const RCircle_2& t) + : RCircle_2(t) + {} + + Circle_2(const CGAL::Point_2 ¢er, + const FT &squared_radius, + const Orientation &orientation) + : RCircle_2(center, squared_radius, orientation) + {} + + Circle_2(const CGAL::Point_2 ¢er, + const FT &squared_radius) + : RCircle_2(center, squared_radius, COUNTERCLOCKWISE) + {} + + Circle_2(const CGAL::Point_2 &p, + const CGAL::Point_2 &q, + const CGAL::Point_2 &r) + : RCircle_2(p,q,r) + {} + + Circle_2(const CGAL::Point_2 & p, + const CGAL::Point_2 & q, + const Orientation &orientation) + : RCircle_2(p,q,orientation) + {} + + Circle_2(const CGAL::Point_2 & p, + const CGAL::Point_2 & q) + : RCircle_2(p,q,COUNTERCLOCKWISE) + {} + + Circle_2(const CGAL::Point_2 & center, + const Orientation& orientation) + : RCircle_2(center,FT(0),orientation) + {} + + Circle_2(const CGAL::Point_2 & center) + : RCircle_2(center,FT(0),COUNTERCLOCKWISE) + {} + + + bool + operator==(const CGAL::Circle_2 &t) const + { return RCircle_2::operator==(t); } + + bool + operator!=(const CGAL::Circle_2 &t) const + { return !(*this == t); } + + + CGAL::Point_2 + center() const + { return RCircle_2::center(); } + + FT + squared_radius() const + { return RCircle_2::squared_radius(); } + + Orientation orientation() const + { return RCircle_2::orientation(); } + + + CGAL::Circle_2 + + orthogonal_transform(const CGAL::Aff_transformation_2 &t) const + { return RCircle_2::orthogonal_transform(t); } + +/* + CGAL::Circle_2 transform(const CGAL::Aff_transformation_2 &t) const + { + return Circle_2::transform(t); + } +*/ + + Oriented_side + oriented_side(const CGAL::Point_2 &p) const + { return RCircle_2::oriented_side(p); } + + Bounded_side + bounded_side(const CGAL::Point_2 &p) const + { return RCircle_2::bounded_side(p); } + + bool + has_on_boundary(const CGAL::Point_2 &p) const + { return RCircle_2::has_on_boundary(p); } + + bool + has_on_positive_side(const CGAL::Point_2 &p) const + { return RCircle_2::has_on_positive_side(p); } + + bool + has_on_negative_side(const CGAL::Point_2 &p) const + { return RCircle_2::has_on_negative_side(p); } + + bool + has_on_bounded_side(const CGAL::Point_2 &p) const + { return RCircle_2::has_on_bounded_side(p); } + + bool + has_on_unbounded_side(const CGAL::Point_2 &p) const + { return RCircle_2::has_on_unbounded_side(p); } + + bool + is_degenerate() const + { return RCircle_2::is_degenerate(); } + + CGAL::Circle_2 + opposite() const + { + return CGAL::Circle_2(center(), squared_radius(), + CGAL::opposite(orientation())); + } + + Bbox_2 + bbox() const + { return RCircle_2::bbox(); } + +}; + + +#ifndef NO_OSTREAM_INSERT_CIRCLE_2 +template < class R > +std::ostream & +operator<<(std::ostream &os, const Circle_2 &c) +{ + typedef typename R::Circle_2_base RCircle_2; + return os << (const RCircle_2&)c; +} + +#endif // NO_OSTREAM_INSERT_CIRCLE_2 + +#ifndef NO_ISTREAM_EXTRACT_CIRCLE_2 +template < class R > +std::istream & +operator>>(std::istream &is, Circle_2 &c) +{ + typedef typename R::Circle_2_base RCircle_2; + return is >> (RCircle_2&)c; +} +#endif // NO_ISTREAM_EXTRACT_CIRCLE_2 + +CGAL_END_NAMESPACE + + +#endif // CGAL_CIRCLE_2_H diff --git a/Old_Packages/_2/include/CGAL/Direction_2.h b/Old_Packages/_2/include/CGAL/Direction_2.h new file mode 100644 index 00000000000..212ffd94173 --- /dev/null +++ b/Old_Packages/_2/include/CGAL/Direction_2.h @@ -0,0 +1,173 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : Direction_2.fw +// file : Direction_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_DIRECTION_2_H +#define CGAL_DIRECTION_2_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_DIRECTIONH2_H +#include +#endif // CGAL_DIRECTIONH2_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_DIRECTIONC2_H +#include +#endif // CGAL_DIRECTIONC2_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_VECTOR_2_H +#include +#endif // CGAL_VECTOR_2_H + +CGAL_BEGIN_NAMESPACE + +template +class Direction_2 : public R_::Direction_2_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Vector_2_base RVector_2; + typedef typename R::Direction_2_base RDirection_2; + // typedef typename R::Aff_transformation_2 Aff_transformation_2; + + Direction_2() + {} + + Direction_2(const CGAL::Direction_2 &d) + : RDirection_2((const RDirection_2&)d) + {} + + + Direction_2(const RDirection_2& d) + : RDirection_2(d) + {} + + + Direction_2(const RVector_2& v) + : RDirection_2(v) + {} + + Direction_2(const RT &x, const RT &y) + : RDirection_2(x,y) + {} + + bool + operator==(const CGAL::Direction_2 &d) const + { return RDirection_2::operator==(d); } + + bool + operator!=(const CGAL::Direction_2 &d) const + { return !(*this == d); } + + bool + operator>=(const CGAL::Direction_2 &d) const + { return RDirection_2::operator>=(d); } + + bool + operator<=(const CGAL::Direction_2 &d) const + { return RDirection_2::operator<=(d); } + + bool + operator>(const CGAL::Direction_2 &d) const + { return RDirection_2::operator>(d); } + + bool + operator<(const CGAL::Direction_2 &d) const + { return RDirection_2::operator<(d); } + + bool + counterclockwise_in_between(const CGAL::Direction_2 &d1, + const CGAL::Direction_2 &d2) const + { return RDirection_2::counterclockwise_in_between(d1,d2); } + + CGAL::Vector_2 + vector() const + { return (CGAL::Vector_2)RDirection_2::to_vector(); } + + CGAL::Vector_2 + to_vector() const + { return (CGAL::Vector_2)RDirection_2::to_vector(); } + + CGAL::Direction_2 + transform(const CGAL::Aff_transformation_2 &t) const + { return RDirection_2::transform(t); } + + CGAL::Direction_2 + operator-() const + { return RDirection_2::operator-(); } + + RT + delta(int i) const + { return RDirection_2::delta(i); } + + RT + dx() const + { return RDirection_2::dx(); } + + RT + dy() const + { return RDirection_2::dy(); } +}; + + +#ifndef NO_OSTREAM_INSERT_DIRECTION_2 +template < class R > +std::ostream & +operator<<(std::ostream &os, const Direction_2 &d) +{ + typedef typename R::Direction_2_base RDirection_2; + return os << (const RDirection_2&)d; +} + +#endif // NO_OSTREAM_INSERT_DIRECTION_2 + +#ifndef NO_ISTREAM_EXTRACT_DIRECTION_2 +template < class R > +std::istream & +operator>>(std::istream &is, Direction_2 &p) +{ + typedef typename R::Direction_2_base RDirection_2; + return is >> (RDirection_2&)p; +} +#endif // NO_ISTREAM_EXTRACT_DIRECTION_2 + + +CGAL_END_NAMESPACE + + +#endif // CGAL_DIRECTION_2_H diff --git a/Old_Packages/_2/include/CGAL/Iso_rectangle_2.h b/Old_Packages/_2/include/CGAL/Iso_rectangle_2.h new file mode 100644 index 00000000000..75347365764 --- /dev/null +++ b/Old_Packages/_2/include/CGAL/Iso_rectangle_2.h @@ -0,0 +1,174 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : Iso_rectangle_2.fw +// file : Iso_rectangle_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_ISO_RECTANGLE_2_H +#define CGAL_ISO_RECTANGLE_2_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_ISO_RECTANGLEH2_H +#include +#endif // CGAL_ISO_RECTANGLEH2_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_ISO_RECTANGLEC2_H +#include +#endif // CGAL_ISO_RECTANGLEC2_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_POINT_2_H +#include +#endif // CGAL_POINT_2_H + +CGAL_BEGIN_NAMESPACE + +template +class Iso_rectangle_2 : public R_::Iso_rectangle_2_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Iso_rectangle_2_base RIso_rectangle_2; + + Iso_rectangle_2() + : RIso_rectangle_2() + {} + + Iso_rectangle_2(const CGAL::Iso_rectangle_2 &r) + : RIso_rectangle_2(r) + {} + + Iso_rectangle_2(const RIso_rectangle_2& r) + : RIso_rectangle_2(r) + {} + + Iso_rectangle_2(const CGAL::Point_2 &p, + const CGAL::Point_2 &q) + : RIso_rectangle_2(p,q) + {} + + + bool + operator==(const CGAL::Iso_rectangle_2 &r) const + { return vertex(0) == r.vertex(0) && vertex(2) == r.vertex(2); } + + bool + operator!=(const CGAL::Iso_rectangle_2 &r) const + { return !(*this == r); } + + + CGAL::Point_2 + min() const + { return RIso_rectangle_2::min(); } + + CGAL::Point_2 + max() const + { return RIso_rectangle_2::max(); } + + FT + xmin() const + { return RIso_rectangle_2::xmin(); } + + FT + ymin() const + { return RIso_rectangle_2::ymin(); } + + FT + xmax() const + { return RIso_rectangle_2::xmax(); } + + FT + ymax() const + { return RIso_rectangle_2::ymax(); } + + CGAL::Point_2 + vertex(int i) const + { return RIso_rectangle_2::vertex(i); } + + CGAL::Point_2 + operator[](int i) const + { return vertex(i); } + + Bounded_side + bounded_side(const CGAL::Point_2 &p) const + { return RIso_rectangle_2::bounded_side(p); } + + bool + has_on_boundary(const CGAL::Point_2 &p) const + { return RIso_rectangle_2::has_on_boundary(p); } + + bool + has_on_bounded_side(const CGAL::Point_2 &p) const + { return RIso_rectangle_2::has_on_bounded_side(p); } + + bool + has_on_unbounded_side(const CGAL::Point_2 &p) const + { return RIso_rectangle_2::has_on_unbounded_side(p); } + + bool + is_degenerate() const + { return RIso_rectangle_2::is_degenerate(); } + + CGAL::Iso_rectangle_2 + transform(const CGAL::Aff_transformation_2 &t) const + { return RIso_rectangle_2::transform(t); } + +}; + +#ifndef NO_OSTREAM_INSERT_ISO_RECTANGLE_2 +template < class R > +std::ostream & +operator<<(std::ostream &os, const Iso_rectangle_2 &r) +{ + typedef typename R::Iso_rectangle_2_base RIso_rectangle_2; + return os << (const RIso_rectangle_2&)r; +} +#endif // NO_OSTREAM_INSERT_ISO_RECTANGLE_2 + +#ifndef NO_ISTREAM_EXTRACT_ISO_RECTANGLE_2 +template < class R > +std::istream & +operator>>(std::istream &is, Iso_rectangle_2 &r) +{ + typedef typename R::Iso_rectangle_2_base RIso_rectangle_2; + is >> (RIso_rectangle_2&)r; + return is; +} +#endif // NO_ISTREAM_EXTRACT_ISO_RECTANGLE_2 + +CGAL_END_NAMESPACE + + +#endif // CGAL_ISO_RECTANGLE_2_H diff --git a/Old_Packages/_2/include/CGAL/Line_2.h b/Old_Packages/_2/include/CGAL/Line_2.h new file mode 100644 index 00000000000..7a5b1f1d627 --- /dev/null +++ b/Old_Packages/_2/include/CGAL/Line_2.h @@ -0,0 +1,256 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : Line_2.fw +// file : Line_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_LINE_2_H +#define CGAL_LINE_2_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_LINEH2_H +#include +#endif // CGAL_LINEH2_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_LINEC2_H +#include +#endif // CGAL_LINEC2_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_PREDICATES_ON_POINTS_2_H +#include +#endif // CGAL_PREDICATES_ON_POINTS_2_H +#ifndef CGAL_VECTOR_2_H +#include +#endif // CGAL_VECTOR_2_H + +CGAL_BEGIN_NAMESPACE + +template +class Line_2 : public R_::Line_2_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Line_2_base RLine_2; + + Line_2() + : RLine_2() + {} + + ~Line_2() + {} + + Line_2(const CGAL::Line_2 &l) + : RLine_2((RLine_2&)l) + {} + + Line_2(const CGAL::Point_2 &p, const CGAL::Point_2 &q) + : RLine_2(p,q) + {} + + Line_2(const RT &a, const RT &b, const RT &c) + : RLine_2(a,b,c) + {} + + + Line_2(const RLine_2& l) // conversion impl -> interface class + : RLine_2(l) + {} + + + Line_2(const CGAL::Segment_2& s) + : RLine_2(s) + {} + + Line_2(const CGAL::Ray_2& r) + : RLine_2(r) + {} + + Line_2(const CGAL::Point_2 &p, const CGAL::Direction_2 &d) + : RLine_2(p,d) + {} + + + bool operator==(const CGAL::Line_2 &l) const + { + return RLine_2::operator==(l); + } + + bool operator!=(const CGAL::Line_2 &l) const + { + return !(*this == l); + } + + RT a() const + { + return RLine_2::a(); + } + + RT b() const + { + return RLine_2::b(); + } + + RT c() const + { + return RLine_2::c(); + } + + + FT x_at_y(const FT &y) const + { + return RLine_2::x_at_y(y); + } + + FT y_at_x(const FT &x) const + { + return RLine_2::y_at_x(x); + } + + CGAL::Line_2 perpendicular(const CGAL::Point_2 &p) const + { + return RLine_2::perpendicular(p); + } + + CGAL::Line_2 opposite() const + { + return RLine_2::opposite(); + } + + CGAL::Point_2 point(int i) const + { + return RLine_2::point(i); + } + + CGAL::Point_2 projection(const CGAL::Point_2 &p) const + { + return RLine_2::projection(p); + } + + CGAL::Point_2 point() const + { + return RLine_2::point(); + } + + CGAL::Direction_2 direction() const + { + + return RLine_2::direction(); + } + + Oriented_side oriented_side(const CGAL::Point_2 &p) const + { + return RLine_2::oriented_side(p); + } + + bool has_on(const CGAL::Point_2 &p) const + { + return RLine_2::has_on_boundary(p); + } + + bool has_on_boundary(const CGAL::Point_2 &p) const + { + return RLine_2::has_on_boundary(p); + } + + bool has_on_positive_side(const CGAL::Point_2 &p) const + { + return RLine_2::has_on_positive_side(p); + } + + bool has_on_negative_side(const CGAL::Point_2 &p) const + { + return RLine_2::has_on_negative_side(p); + } + + bool is_horizontal() const + { + + return RLine_2::is_horizontal(); + } + + bool is_vertical() const + { + + return RLine_2::is_vertical(); + } + + bool is_degenerate() const + { + + return RLine_2::is_degenerate(); + } + + CGAL::Line_2 transform(const CGAL::Aff_transformation_2 &t) const + { + return RLine_2::transform(t); + } +}; + + + +#ifndef NO_OSTREAM_INSERT_LINE_2 +template < class R > +std::ostream & +operator<<(std::ostream &os, const Line_2 &l) +{ + typedef typename R::Line_2_base RLine_2; + return os << (const RLine_2&)l; +} +#endif // NO_OSTREAM_INSERT_LINE_2 + +#ifndef NO_ISTREAM_EXTRACT_LINE_2 +template < class R > +std::istream & +operator>>(std::istream &is, Line_2 &p) +{ + typedef typename R::Line_2_base RLine_2; + return is >> (RLine_2&)p; +} +#endif // NO_ISTREAM_EXTRACT_LINE_2 + + + +CGAL_END_NAMESPACE + + +#ifndef CGAL_SEGMENT_2_H +#include +#endif // CGAL_SEGMENT_2_H +#ifndef CGAL_RAY_2_H +#include +#endif // CGAL_RAY_2_H + +#endif // CGAL_LINE_2_H diff --git a/Old_Packages/_2/include/CGAL/Point_2.h b/Old_Packages/_2/include/CGAL/Point_2.h new file mode 100644 index 00000000000..37cc7482e20 --- /dev/null +++ b/Old_Packages/_2/include/CGAL/Point_2.h @@ -0,0 +1,227 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : Point_2.fw +// file : Point_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_POINT_2_H +#define CGAL_POINT_2_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#include +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#include +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#include + +CGAL_BEGIN_NAMESPACE + +template +class Point_2 : public R_::Point_2_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Point_2_base RPoint_2; + typedef typename R::Vector_2_base RVector_2; + + +friend CGAL_FRIEND_INLINE + CGAL::Point_2 + CGAL_SCOPE vector_to_point_conversion CGAL_NULL_TMPL_ARGS + (const CGAL::Vector_2& v); + + Point_2() + {} + + Point_2(const Origin& o) + : RPoint_2(o) + {} + + Point_2(const CGAL::Point_2& p) + : RPoint_2((RPoint_2&)p) + {} + + Point_2(const RPoint_2& p) + : RPoint_2(p) + {} + + Point_2(const RT& hx, const RT& hy) + : RPoint_2(hx, hy) + {} + + Point_2(const RT& hx, const RT& hy, const RT& hw) + : RPoint_2(hx, hy, hw) + {} + + + bool operator==(const CGAL::Point_2& p) const + { + return RPoint_2::operator==(p); + } + + bool operator!=(const CGAL::Point_2& p) const + { + return !(*this == p); + } + + RT hx() const + { + return RPoint_2::hx(); + } + + RT hy() const + { + return RPoint_2::hy(); + } + + RT hw() const + { + return RPoint_2::hw(); + } + FT x() const + { + return RPoint_2::x(); + } + + FT y() const + { + return RPoint_2::y(); + } + + RT homogeneous(int i) const + { + return RPoint_2::homogeneous(i); + } + + FT cartesian(int i) const + { + return RPoint_2::cartesian(i); + } + + FT operator[](int i) const + { + return cartesian(i); + } + + int dimension() const + { + return 2; + } + + Bbox_2 bbox() const + { + return RPoint_2::bbox(); + } + + CGAL::Point_2 transform(const CGAL::Aff_transformation_2& t) const + { + return RPoint_2::transform(t); + } + +private: + + Point_2(const RVector_2& v) + : RPoint_2(v) + {} +}; + +#ifndef NO_OSTREAM_INSERT_POINT_2 +template < class R > +std::ostream& +operator<<(std::ostream& os, const Point_2& p) +{ + typedef typename R::Point_2_base RPoint_2; + return os << (const RPoint_2&)p; +} +#endif // NO_OSTREAM_INSERT_POINT_2 + +#ifndef NO_ISTREAM_EXTRACT_POINT_2 +template < class R > +std::istream& +operator>>(std::istream& is, Point_2& p) +{ + typedef typename R::Point_2_base RPoint_2; + return is >> (RPoint_2&)p; +} +#endif // NO_ISTREAM_EXTRACT_POINT_2 + +template +inline +Point_2 +operator+(const Origin& o, const Vector_2& v); + +template +inline +Point_2 +operator-(const Origin& o, const Vector_2& v); + +template +inline +Vector_2 +operator-(const Point_2& p, const Origin& ); + +CGAL_END_NAMESPACE + + +#ifndef CGAL_VECTOR_2_H +#include +#endif // CGAL_VECTOR_2_H + +#include + +#ifndef CGAL_AFF_TRANSFORMATION_2_H +#include +#endif // CGAL_AFF_TRANSFORMATION_2_H + +CGAL_BEGIN_NAMESPACE + +template +inline +bool +operator==(const Origin& o, const Point_2& p) +{ return p == o; } + +template +inline +bool +operator!=(const Origin& o, const Point_2& p) +{ return p != o; } + +CGAL_END_NAMESPACE + + +#endif // CGAL_POINT_2_H diff --git a/Old_Packages/_2/include/CGAL/Ray_2.h b/Old_Packages/_2/include/CGAL/Ray_2.h new file mode 100644 index 00000000000..d7775a646a3 --- /dev/null +++ b/Old_Packages/_2/include/CGAL/Ray_2.h @@ -0,0 +1,165 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : Ray_2.fw +// file : Ray_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_RAY_2_H +#define CGAL_RAY_2_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifndef CGAL_SEGMENT_2_H +#include +#endif // CGAL_SEGMENT_2_H + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_RAYH2_H +#include +#endif // CGAL_RAYH2_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_RAYC2_H +#include +#endif // CGAL_RAYC2_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +CGAL_BEGIN_NAMESPACE + +template +class Ray_2 : public R_::Ray_2_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Ray_2_base RRay_2; + + Ray_2() + : RRay_2() + {} + + ~Ray_2() + {} + + Ray_2(const CGAL::Ray_2 &r) + : RRay_2((const RRay_2&)r) + { + + } + + Ray_2(const RRay_2& r) + : RRay_2(r) + { + + } + + Ray_2(const CGAL::Point_2 &sp, + const CGAL::Point_2 &secondp) + : RRay_2(sp, secondp) + {} + + Ray_2(const CGAL::Point_2 &sp, + const CGAL::Direction_2 &d) + : RRay_2(sp, d) + {} + + + bool operator==(const CGAL::Ray_2 &r) const + { return RRay_2::operator==(r); } + + bool operator!=(const CGAL::Ray_2 &r) const + { return !(*this == r); } + + CGAL::Point_2 start() const + { return RRay_2::start(); } + + CGAL::Point_2 source() const + { return RRay_2::source(); } + + CGAL::Point_2 second_point() const + { return RRay_2::second_point(); } + + CGAL::Point_2 point(int i) const + { return RRay_2::point(i); } + + CGAL::Direction_2 direction() const + { return RRay_2::direction(); } + + CGAL::Line_2 supporting_line() const + { return RRay_2::supporting_line(); } + + CGAL::Ray_2 opposite() const + { return RRay_2::opposite(); } + + CGAL::Ray_2 transform(const CGAL::Aff_transformation_2 &t) const + { return RRay_2::transform(t); } + + bool is_horizontal() const + { return RRay_2::is_horizontal(); } + + bool is_vertical() const + { return RRay_2::is_vertical(); } + + bool is_degenerate() const + { return RRay_2::is_degenerate(); } + + bool has_on(const CGAL::Point_2 &p) const + { return RRay_2::has_on(p); } + + bool collinear_has_on(const CGAL::Point_2 &p) const + { return RRay_2::collinear_has_on(p); } + +}; + +#ifndef NO_OSTREAM_INSERT_RAY_2 +template < class R > +std::ostream & +operator<<(std::ostream &os, const Ray_2 &r) +{ + typedef typename R::Ray_2_base RRay_2; + return os << (const RRay_2&)r; +} +#endif // NO_OSTREAM_INSERT_RAY_2 + +#ifndef NO_ISTREAM_EXTRACT_RAY_2 +template < class R > +std::istream & +operator>>(std::istream &is, Ray_2 &r) +{ + typedef typename R::Ray_2_base RRay_2; + return is >> (RRay_2&)r; +} +#endif // NO_ISTREAM_EXTRACT_RAY_2 + +CGAL_END_NAMESPACE + + +#endif // CGAL_RAY_2_H diff --git a/Old_Packages/_2/include/CGAL/Segment_2.h b/Old_Packages/_2/include/CGAL/Segment_2.h new file mode 100644 index 00000000000..ea67ac4f964 --- /dev/null +++ b/Old_Packages/_2/include/CGAL/Segment_2.h @@ -0,0 +1,183 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : Segment_2.fw +// file : Segment_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_SEGMENT_2_H +#define CGAL_SEGMENT_2_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_SEGMENTH2_H +#include +#endif // CGAL_SEGMENTH2_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_SEGMENTC2_H +#include +#endif // CGAL_SEGMENTC2_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_LINE_2_H +#include +#endif // CGAL_LINE_2_H + +CGAL_BEGIN_NAMESPACE + +template +class Segment_2 : public R_::Segment_2_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Segment_2_base RSegment_2; + + Segment_2() // doesn't the default constructor do the same ??? + : RSegment_2() // does the handle stuff + {} + + ~Segment_2() + {} + + Segment_2(const CGAL::Segment_2& s) + : RSegment_2((RSegment_2&)s) // does the handle stuff + {} + + Segment_2(const CGAL::Point_2 &sp, const CGAL::Point_2 &ep) + : RSegment_2(sp,ep) + {} + + + // conversion from implementation class object to interface class object + Segment_2(const RSegment_2& s) + : RSegment_2(s) // does the handle stuff + {} + + + bool is_horizontal() const + { return RSegment_2::is_horizontal(); } + + bool is_vertical() const + { return RSegment_2::is_vertical(); } + + bool has_on(const CGAL::Point_2 &p) const + { return RSegment_2::has_on(p); } + + bool collinear_has_on(const CGAL::Point_2 &p) const + { return RSegment_2::collinear_has_on(p); } + + + bool operator==(const CGAL::Segment_2 &s) const + { return RSegment_2::operator==(s); } + + bool operator!=(const CGAL::Segment_2 &s) const + { return !(*this == s); } + + CGAL::Point_2 start() const + { return RSegment_2::start(); } + + CGAL::Point_2 end() const + { return RSegment_2::end(); } + + CGAL::Point_2 source() const + { return RSegment_2::source(); } + + CGAL::Point_2 target() const + { return RSegment_2::target(); } + + CGAL::Point_2 min() const + { return RSegment_2::min(); } + + CGAL::Point_2 max() const + { return RSegment_2::max(); } + + CGAL::Point_2 vertex(int i) const + { return RSegment_2::vertex(i); } + + CGAL::Point_2 point(int i) const + { return RSegment_2::vertex(i); } + + CGAL::Point_2 operator[](int i) const + { return vertex(i); } + + FT squared_length() const + { return RSegment_2::squared_length(); } + + CGAL::Direction_2 direction() const + { return RSegment_2::direction(); } + + CGAL::Segment_2 opposite() const + { return CGAL::Segment_2(target(),source()); } + + // this makes use of the constructor of the interface class + // taking an object of the implemetation class as argument. + + CGAL::Segment_2 transform(const CGAL::Aff_transformation_2 &t) const + { return RSegment_2::transform(t); } + + + CGAL::Line_2 supporting_line() const + { return RSegment_2::supporting_line(); } + + bool is_degenerate() const + { return RSegment_2::is_degenerate(); } + + Bbox_2 bbox() const + { return source().bbox() + target().bbox(); } + +}; + +#ifndef NO_OSTREAM_INSERT_SEGMENT_2 +template < class R> +std::ostream & +operator<<(std::ostream &os, const Segment_2 &s) +{ + typedef typename R::Segment_2_base RSegment_2; + return os << (const RSegment_2&)s; +} +#endif // NO_OSTREAM_INSERT_SEGMENT_2 + +#ifndef NO_ISTREAM_EXTRACT_SEGMENT_2 +template < class R> +std::istream & +operator>>(std::istream &is, Segment_2 &s) +{ + typedef typename R::Segment_2_base RSegment_2; + return is >> (RSegment_2&)s; +} +#endif // NO_ISTREAM_EXTRACT_SEGMENT_2 + +CGAL_END_NAMESPACE + + +#endif // CGAL_SEGMENT_2_H diff --git a/Old_Packages/_2/include/CGAL/Triangle_2.h b/Old_Packages/_2/include/CGAL/Triangle_2.h new file mode 100644 index 00000000000..8f21b55c508 --- /dev/null +++ b/Old_Packages/_2/include/CGAL/Triangle_2.h @@ -0,0 +1,164 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : Triangle_2.fw +// file : Triangle_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_TRIANGLE_2_H +#define CGAL_TRIANGLE_2_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_TRIANGLEH2_H +#include +#endif // CGAL_TRIANGLEH2_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_TRIANGLEC2_H +#include +#endif // CGAL_TRIANGLEC2_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_POINT_2_H +#include +#endif // CGAL_POINT_2_H + +CGAL_BEGIN_NAMESPACE + +template + class Triangle_2 : public R_::Triangle_2_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Triangle_2_base RTriangle_2; + + Triangle_2() : RTriangle_2() {} + + Triangle_2(const CGAL::Triangle_2 &t) : RTriangle_2((RTriangle_2&)t) {} + + Triangle_2(const RTriangle_2& t) : RTriangle_2(t) {} + + Triangle_2(const CGAL::Point_2 &p, + const CGAL::Point_2 &q, + const CGAL::Point_2 &r) : RTriangle_2(p,q,r) {} + + + bool + operator==(const CGAL::Triangle_2 &t) const + { return RTriangle_2::operator==(t); } + + bool + operator!=(const CGAL::Triangle_2 &t) const + { return !(*this == t); } + + CGAL::Point_2 + vertex(int i) const + { return RTriangle_2::vertex(i); } + + CGAL::Point_2 + operator[](int i) const + { return vertex(i); } + + CGAL::Triangle_2 + transform(const CGAL::Aff_transformation_2 &t) const + { return RTriangle_2::transform(t); } + + CGAL::Triangle_2 opposite() const + { return CGAL::Triangle_2(vertex(0), vertex(2), vertex(1)); } + + Orientation + orientation() const + { return RTriangle_2::orientation(); } + + Oriented_side + oriented_side(const CGAL::Point_2 &p) const + { return RTriangle_2::oriented_side(p); } + + Bounded_side + bounded_side(const CGAL::Point_2 &p) const + { return RTriangle_2::bounded_side(p); } + + bool + has_on_boundary(const CGAL::Point_2 &p) const + { return RTriangle_2::has_on_boundary(p); } + + bool + has_on_positive_side(const CGAL::Point_2 &p) const + { return RTriangle_2::has_on_positive_side(p); } + + bool + has_on_negative_side(const CGAL::Point_2 &p) const + { return RTriangle_2::has_on_negative_side(p); } + + bool + has_on_unbounded_side(const CGAL::Point_2 &p) const + { return RTriangle_2::has_on_unbounded_side(p); } + + bool + has_on_bounded_side(const CGAL::Point_2 &p) const + { return RTriangle_2::has_on_bounded_side(p); } + + bool + is_degenerate() const + { return RTriangle_2::is_degenerate(); } + + Bbox_2 + bbox() const + { return vertex(0).bbox() + vertex(1).bbox() + vertex(2).bbox(); } +}; + +#ifndef NO_OSTREAM_INSERT_TRIANGLE_2 +template < class R > +std::ostream & +operator<<(std::ostream &os, const Triangle_2 &t) +{ + typedef typename R::Triangle_2_base RTriangle_2; + return os << (const RTriangle_2&)t; +} +#endif // NO_OSTREAM_INSERT_TRIANGLE_2 + +#ifndef NO_ISTREAM_EXTRACT_TRIANGLE_2 +template < class R > +std::istream & +operator>>(std::istream &is, Triangle_2 &t) +{ + typedef typename R::Triangle_2_base RTriangle_2; + return is >> (RTriangle_2&)t; +} +#endif // NO_ISTREAM_EXTRACT_TRIANGLE_2 + +CGAL_END_NAMESPACE + + +#endif // CGAL_TRIANGLE_2_H diff --git a/Old_Packages/_2/include/CGAL/Vector_2.h b/Old_Packages/_2/include/CGAL/Vector_2.h new file mode 100644 index 00000000000..39b997223c8 --- /dev/null +++ b/Old_Packages/_2/include/CGAL/Vector_2.h @@ -0,0 +1,209 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : Vector_2.fw +// file : Vector_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_VECTOR_2_H +#define CGAL_VECTOR_2_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifndef CGAL_POINT_2_H +#include +#endif // CGAL_POINT_2_H + + +#ifndef CGAL_DIRECTION_2_H +#include +#endif // CGAL_DIRECTION_2_H + + + +#ifdef VECTOR_WRAPPER +#ifndef VECTOR_2_RFT_WRAPPER_H +#include +#endif // VECTOR_2_RFT_WRAPPER_H +#endif // VECTOR_WRAPPER + +CGAL_BEGIN_NAMESPACE + +template class Quotient; +template +class Vector_2 : public R_::Vector_2_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Vector_2_base RVector_2; + +friend CGAL_FRIEND_INLINE + CGAL::Vector_2 + CGAL_SCOPE point_to_vector_conversion CGAL_NULL_TMPL_ARGS + (const CGAL::Point_2 &p); + + Vector_2() {} + + Vector_2(const CGAL::Vector_2 &v) : RVector_2((const RVector_2&)v) {} + + Vector_2(const RVector_2& v) : RVector_2(v) {} + + Vector_2(const Null_vector &v) : RVector_2(v) {} + + Vector_2(const RT &x, const RT &y) : RVector_2(x,y) {} + + Vector_2(const RT &x, const RT &y, const RT &w) : RVector_2(x,y,w) {} + + + bool + operator==(const CGAL::Vector_2 &v) const + { return RVector_2::operator==(v); } + + bool + operator!=(const CGAL::Vector_2 &v) const + { return !(*this == v); } + + bool + operator==(const Null_vector &v) const + { return RVector_2::operator==(v); } + + bool + operator!=(const Null_vector &v) const + { return !(*this == v); } + + RT + hx() const + { return RVector_2::hx(); } + + RT + hy() const + { return RVector_2::hy(); } + + RT + hw() const + { return RVector_2::hw(); } + + FT x() const + { return RVector_2::x(); } + + FT y() const + { return RVector_2::y(); } + + RT homogeneous(int i) const + { return RVector_2::homogeneous(i); } + + FT + cartesian(int i) const + { return RVector_2::cartesian(i); } + + FT + operator[](int i) const + { return cartesian(i); } + + int + dimension() const + { return 2; } + + CGAL::Vector_2 + operator+(const CGAL::Vector_2 &w) const + { return (const RVector_2&)(*this) + (const RVector_2&)(w); } + + CGAL::Vector_2 + operator-(const CGAL::Vector_2 &w) const + { return (const RVector_2&)(*this) - (const RVector_2&)(w); } + + CGAL::Vector_2 + operator-() const + { return RVector_2::operator-(); } + + FT + operator*(const CGAL::Vector_2 &w) const + { return (const RVector_2&)(*this) * (const RVector_2&)(w); } + +#ifndef VECTOR_WRAPPER + CGAL::Vector_2 + operator*(const RT &c) const + { return c * (const RVector_2&)(*this); } + + CGAL::Vector_2 + operator*(const Quotient &q) const + { return (q.numerator() * (const RVector_2&)(*this)) / q.denominator(); } + + CGAL::Vector_2 + operator/(const Quotient &q) const + { return (q.denominator() * (const RVector_2&)(*this)) / q.numerator(); } +#endif // VECTOR_WRAPPER + + CGAL::Vector_2 + operator/(const RT &c) const + { return (const RVector_2&)(*this) / c; } + + CGAL::Direction_2 + direction() const + { return RVector_2::direction(); } + + CGAL::Vector_2 + perpendicular(const Orientation &o) const + { return RVector_2::perpendicular(o); } + + CGAL::Vector_2 + transform(const CGAL::Aff_transformation_2 &t) const + { return RVector_2::transform(t); } + +private: + Vector_2(const CGAL::Point_2 &p) : RVector_2(p) {} + + Vector_2(const CGAL::Direction_2 &d) : RVector_2(d) {} +}; + +template < class R > +No_number_tag +number_type_tag(const Vector_2 &) +{ return No_number_tag(); } +#ifndef NO_OSTREAM_INSERT_VECTOR_2 +template < class R > +std::ostream & +operator<<(std::ostream &os, const Vector_2 &v) +{ + typedef typename R::Vector_2_base RVector_2; + return os << (const RVector_2&)v; +} +#endif // NO_OSTREAM_INSERT_VECTOR_2 + +#ifndef NO_ISTREAM_EXTRACT_VECTOR_2 +template < class R > +std::istream & +operator>>(std::istream &is, Vector_2 &p) +{ + typedef typename R::Vector_2_base RVector_2; + return is >> (RVector_2&)p; +} +#endif // NO_ISTREAM_EXTRACT_VECTOR_2 + +CGAL_END_NAMESPACE + + +#endif // CGAL_VECTOR_2_H diff --git a/Old_Packages/_2/include/CGAL/basic_constructions_2.h b/Old_Packages/_2/include/CGAL/basic_constructions_2.h new file mode 100644 index 00000000000..0fef93d3c49 --- /dev/null +++ b/Old_Packages/_2/include/CGAL/basic_constructions_2.h @@ -0,0 +1,73 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : basic_constructions_2.fw +// file : basic_constructions_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Sven Schoenherr +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_BASIC_CONSTRUCTIONS_2_H +#define CGAL_BASIC_CONSTRUCTIONS_2_H 1 + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_BASIC_CONSTRUCTIONSH2_H +#include +#endif // CGAL_BASIC_CONSTRUCTIONSH2_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_BASIC_CONSTRUCTIONSC2_H +#include +#endif // CGAL_BASIC_CONSTRUCTIONSC2_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +CGAL_BEGIN_NAMESPACE + +template < class R > +inline +Point_2 +midpoint( const Point_2& p, + const Point_2& q ) +{ + typedef typename R::Point_2_base RPoint_2; + return( midpoint( static_cast(p), + static_cast(q))); +} +template < class R > +inline +Point_2 +circumcenter( const Point_2& p, + const Point_2& q, + const Point_2& r) +{ + typedef typename R::Point_2_base RPoint_2; + return( circumcenter( static_cast(p), + static_cast(q), + static_cast(r))); +} +CGAL_END_NAMESPACE + + +#endif // CGAL_BASIC_CONSTRUCTIONS_2_H diff --git a/Old_Packages/_2/include/CGAL/distance_predicates_2.h b/Old_Packages/_2/include/CGAL/distance_predicates_2.h new file mode 100644 index 00000000000..431c6a694f9 --- /dev/null +++ b/Old_Packages/_2/include/CGAL/distance_predicates_2.h @@ -0,0 +1,190 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : distance_predicates_2.fw +// file : distance_predicates_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_DISTANCE_PREDICATES_2_H +#define CGAL_DISTANCE_PREDICATES_2_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_DISTANCE_PREDICATESH2_H +#include +#endif // CGAL_DISTANCE_PREDICATESH2_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_DISTANCE_PREDICATESC2_H +#include +#endif // CGAL_DISTANCE_PREDICATESC2_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_POINT_2_H +#include +#endif // CGAL_POINT_2_H +#ifndef CGAL_LINE_2_H +#include +#endif // CGAL_LINE_2_H + +CGAL_BEGIN_NAMESPACE + + +template < class R > +inline +Comparison_result +cmp_dist_to_point(const Point_2& p, + const Point_2& q, + const Point_2& r) +{ + typedef typename R::Point_2_base RPoint_2; + return cmp_dist_to_point((const RPoint_2& )p, + (const RPoint_2& )q, + (const RPoint_2& )r ); +} + +template < class R > +inline +bool +has_larger_dist_to_point(const Point_2& p, + const Point_2& q, + const Point_2& r) +{ + typedef typename R::Point_2_base RPoint_2; + return has_larger_dist_to_point((const RPoint_2& )p, + (const RPoint_2& )q, + (const RPoint_2& )r ); +} + +template < class R > +inline +bool +has_smaller_dist_to_point(const Point_2& p, + const Point_2& q, + const Point_2& r) +{ + typedef typename R::Point_2_base RPoint_2; + return has_smaller_dist_to_point((const RPoint_2& )p, + (const RPoint_2& )q, + (const RPoint_2& )r ); +} + +template < class R > +inline +Comparison_result +cmp_signed_dist_to_line(const Line_2& l, + const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + typedef typename R::Line_2_base RLine_2 ; + return cmp_signed_dist_to_line((const RLine_2& )l, + (const RPoint_2& )p, + (const RPoint_2& )q ); +} + +template < class R > +inline +bool +has_larger_signed_dist_to_line(const Line_2& l, + const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + typedef typename R::Line_2_base RLine_2 ; + return has_larger_signed_dist_to_line((const RLine_2& )l, + (const RPoint_2& )p, + (const RPoint_2& )q ); +} + +template < class R > +inline +bool +has_smaller_signed_dist_to_line(const Line_2& l, + const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + typedef typename R::Line_2_base RLine_2 ; + return has_smaller_signed_dist_to_line((const RLine_2& )l, + (const RPoint_2& )p, + (const RPoint_2& )q ); +} + +template < class R > +inline +Comparison_result +cmp_signed_dist_to_line(const Point_2& p, + const Point_2& q, + const Point_2& r, + const Point_2& s) +{ + typedef typename R::Point_2_base RPoint_2; + return cmp_signed_dist_to_line((const RPoint_2& )p, + (const RPoint_2& )q, + (const RPoint_2& )r, + (const RPoint_2& )s ); +} + +template < class R > +inline +bool +has_smaller_signed_dist_to_line(const Point_2& p, + const Point_2& q, + const Point_2& r, + const Point_2& s) +{ + typedef typename R::Point_2_base RPoint_2; + return has_smaller_signed_dist_to_line((const RPoint_2& )p, + (const RPoint_2& )q, + (const RPoint_2& )r, + (const RPoint_2& )s ); +} + +template < class R > +inline +bool +has_larger_signed_dist_to_line(const Point_2& p, + const Point_2& q, + const Point_2& r, + const Point_2& s) +{ + typedef typename R::Point_2_base RPoint_2; + return has_larger_signed_dist_to_line((const RPoint_2& )p, + (const RPoint_2& )q, + (const RPoint_2& )r, + (const RPoint_2& )s ); +} + +CGAL_END_NAMESPACE + + +#endif //CGAL_DISTANCE_PREDICATES_2_H diff --git a/Old_Packages/_2/include/CGAL/point_vector_declarations_2.h b/Old_Packages/_2/include/CGAL/point_vector_declarations_2.h new file mode 100644 index 00000000000..a5f18af5aaf --- /dev/null +++ b/Old_Packages/_2/include/CGAL/point_vector_declarations_2.h @@ -0,0 +1,83 @@ + +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : PV_decl_2.fw +// file : include/CGAL/point_vector_declarations_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_POINT_VECTOR_DECLARATIONS_2_H +#define CGAL_POINT_VECTOR_DECLARATIONS_2_H + +#include + +CGAL_BEGIN_NAMESPACE + + +template < class R > +inline +Vector_2 +point_to_vector_conversion(const Point_2& p); + +template < class R > +inline +Point_2 +vector_to_point_conversion(const Vector_2& v); + +template < class R > +inline +Point_2 +operator+(const Point_2& p, const Vector_2& v); + +template < class R > +inline +Point_2 +operator-(const Point_2& p, const Vector_2& v); + +template < class R > +inline +Point_2 +operator+(const Origin& , const Vector_2& v); + +template < class R > +inline +Point_2 +operator-(const Origin& , const Vector_2& v); + +template < class R > +inline +Vector_2 +operator-(const Point_2& p, const Point_2& q); + +template < class R > +inline +Vector_2 +operator-(const Point_2& p, const Origin& ); + +template < class R > +inline +Vector_2 +operator-(const Origin& , const Point_2& p); +CGAL_END_NAMESPACE + + +#endif // CGAL_POINT_VECTOR_DECLARATIONS_2_H diff --git a/Old_Packages/_2/include/CGAL/point_vector_definitions_2.C b/Old_Packages/_2/include/CGAL/point_vector_definitions_2.C new file mode 100644 index 00000000000..61ac301893e --- /dev/null +++ b/Old_Packages/_2/include/CGAL/point_vector_definitions_2.C @@ -0,0 +1,104 @@ + +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : PV_decl.fw +// file : include/CGAL/point_vector_definitions_2.C +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_POINT_VECTOR_DEFINITIONS_2_C +#define CGAL_POINT_VECTOR_DEFINITIONS_2_C + +CGAL_BEGIN_NAMESPACE + +template < class R > +inline +Vector_2 +point_to_vector_conversion(const Point_2& p) +{ return Vector_2(p); } + +template < class R > +inline +Point_2 +vector_to_point_conversion(const Vector_2& v) +{ return Point_2(v); } + +template < class R > +inline +Point_2 +operator+(const Point_2& p, const Vector_2& v) +{ + typedef typename R::Point_2_base RPoint_2; + typedef typename R::Vector_2_base RVector_2; + return Point_2((const RPoint_2& )p + (const RVector_2& )v) ; +} + +template < class R > +inline +Point_2 +operator-(const Point_2& p, const Vector_2& v) +{ + typedef typename R::Point_2_base RPoint_2; + typedef typename R::Vector_2_base RVector_2; + return Point_2((const RPoint_2& )p - (const RVector_2& )v) ; +} + +template < class R > +inline +Point_2 +operator+(const Origin& , const Vector_2& v) +{ return vector_to_point_conversion(v) ; } + +template < class R > +inline +Point_2 +operator-(const Origin& , const Vector_2& v) +{ return vector_to_point_conversion(-v) ; } + +template < class R > +inline +Vector_2 +operator-(const Point_2& p, const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + return Vector_2((const RPoint_2& )p - (const RPoint_2& )q) ; +} + +template < class R > +inline +Vector_2 +operator-(const Point_2& p, const Origin& ) +{ return point_to_vector_conversion(p) ; } + +template < class R > +inline +Vector_2 +operator-(const Origin& , const Point_2& p) +{ + typedef typename R::Point_2_base RPoint_2; + return Vector_2(ORIGIN - (const RPoint_2& )p) ; +} + +CGAL_END_NAMESPACE + + +#endif // CGAL_POINT_VECTOR_DEFINITIONS_2_C diff --git a/Old_Packages/_2/include/CGAL/predicate_classes_2.h b/Old_Packages/_2/include/CGAL/predicate_classes_2.h new file mode 100644 index 00000000000..8b2a677f9fc --- /dev/null +++ b/Old_Packages/_2/include/CGAL/predicate_classes_2.h @@ -0,0 +1,393 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : predicate_classes_2.fw +// file : predicate_classes_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_PREDICATES_CLASSES_2_H +#define CGAL_PREDICATES_CLASSES_2_H +#include +#include +#include + +CGAL_BEGIN_NAMESPACE + +template struct X_equal_2; +template struct Y_equal_2; +template struct Compare_x_2; +template struct Compare_y_2; +template struct Compare_deltax_deltay_2; +template struct Compare_xy_2; +template struct Less_xy_2; +template struct Compare_yx_2; +template struct Less_yx_2; +template struct Are_ordered_along_line_2 ; +template struct Collinear_are_ordered_along_line_2; +template struct Are_strictly_ordered_along_line_2; +template struct Collinear_are_strictly_ordered_along_line_2; +template struct Collinear_2; +template struct Leftturn_2; +template struct Rightturn_2; +template struct Orientation_2; +template struct Side_of_oriented_circle_2; +template struct Side_of_bounded_circle_2; +template class Compare_distance_to_point_2; +template class Less_distance_to_point_2; +template class Compare_signed_distance_to_line_2; +template class Less_signed_distance_to_line_2; +template class Compare_signed_distance_to_implicit_line_2; +template class Less_signed_distance_to_implicit_line_2; +template struct Compare_y_at_point_2; +template struct Compare_y_at_implicit_point_2; +template struct Compare_y_of_lines_at_point_2; +template struct Compare_y_of_lines_at_implicit_point_2; +template struct Compare_x_implicit_point_2; +template struct Compare_x_implicit_points_2; +template struct Compare_x_implicit_points_same_line_2; +template struct Compare_y_implicit_point_2; +template struct Compare_y_implicit_points_2; +template struct Compare_y_implicit_points_same_line_2; + + + +template +struct X_equal_2 + : public CGAL_STD::binary_function< Point, Point, bool> +{ + bool operator()( const Point& p, const Point& q) const + { return x_equal( p, q); } +}; + +template +struct Y_equal_2 + : public CGAL_STD::binary_function< Point, Point, bool> +{ + bool operator()( const Point& p, const Point& q) const + { return y_equal( p, q); } +}; + +template +struct Compare_x_2 + : public CGAL_STD::binary_function< Point, Point, Comparison_result> +{ + Comparison_result operator()( const Point& p, const Point& q) const + { return compare_x( p, q); } +}; + +template +struct Compare_y_2 + : public CGAL_STD::binary_function< Point, Point, Comparison_result> +{ + Comparison_result operator()( const Point& p, const Point& q) const + { return compare_y( p, q); } +}; + +template +struct Compare_deltax_deltay_2 +{ + Comparison_result operator()( const Point& p, const Point& q, + const Point& r, const Point& s ) + { return compare_deltax_deltay( p,q,r,s); } +}; + +template +struct Compare_xy_2 + : public CGAL_STD::binary_function< Point, Point, Comparison_result> +{ + Comparison_result operator()( const Point& p, const Point& q) const + { return compare_lexicographically_xy( p,q); } +}; + +template +struct p_Equal_xy + : public CGAL_STD::binary_function< Point, Point, bool> +{ + bool operator()( const Point& p, const Point& q) const + { return equal_xy( p,q); } +}; + +template +struct Less_xy_2 + : public CGAL_STD::binary_function< Point, Point, bool> +{ + bool operator()( const Point& p, const Point& q) const + { return lexicographically_xy_smaller( p,q); } +}; + +template +struct Compare_yx_2 + : public CGAL_STD::binary_function< Point, Point, Comparison_result> +{ + Comparison_result operator()( const Point& p, const Point& q) const + { return compare_lexicographically_yx( p,q); } +}; + +template +struct Less_yx_2 + : public CGAL_STD::binary_function< Point, Point, bool> +{ + bool operator()( const Point& p, const Point& q) const + { return lexicographically_yx_smaller( p,q); } +}; + + +template +struct Are_ordered_along_line_2 +{ + bool operator()( const Point& p, const Point& q, const Point& r) const + { return are_ordered_along_line( p,q,r); } +}; + +template +struct Collinear_are_ordered_along_line_2 +{ + bool operator()( const Point& p, const Point& q, const Point& r) const + { return collinear_are_ordered_along_line( p,q,r); } +}; + +template +struct Are_strictly_ordered_along_line_2 +{ + bool operator()( const Point& p, const Point& q, const Point& r) const + { return are_strictly_ordered_along_line( p,q,r); } +}; + +template +struct Collinear_are_strictly_ordered_along_line_2 +{ + bool operator()( const Point& p, const Point& q, const Point& r) const + { return collinear_are_strictly_ordered_along_line( p,q,r); } +}; + +template +struct Collinear_2 +{ + bool operator()( const Point& p, const Point& q, const Point& r) const + { return collinear( p,q,r); } +}; + +template +struct Leftturn_2 +{ + bool operator()( const Point& p, const Point& q, const Point& r) const + { return leftturn( p,q,r); } +}; + +template +struct Rightturn_2 +{ + bool operator()( const Point& p, const Point& q, const Point& r) const + { return rightturn( p,q,r); } +}; + +template +struct Orientation_2 +{ + Orientation operator()( const Point& p, const Point& q, const Point& r) const + { return orientation( p,q,r); } +}; + +template +struct Side_of_oriented_circle_2 +{ + Oriented_side operator()( const Point& p, const Point& q, + const Point& r, const Point& s) + { return side_of_oriented_circle( p,q,r,s); } +}; + +template +struct Side_of_bounded_circle_2 +{ + Oriented_side operator()( const Point& p, const Point& q, + const Point& r, const Point& s) + { return side_of_bounded_circle( p,q,r,s); } +}; + + + +template +class Compare_distance_to_point_2 + : public CGAL_STD::binary_function< Point, Point, Comparison_result> +{ + public: + Compare_distance_to_point_2( const Point& p) : _p(p) {} + Comparison_result + operator()( const Point& q, const Point& r) + { return cmp_dist_to_point( _p,q,r); } + private: + Point _p; +}; + +template +class Less_distance_to_point_2 + : public CGAL_STD::binary_function< Point, Point, bool> +{ + public: + Less_distance_to_point_2( const Point& p) : _p(p) {} + bool operator()( const Point& q, const Point& r) + { return has_smaller_dist_to_point( _p,q,r); } + private: + Point _p; +}; + +template +class Compare_signed_distance_to_line_2 + : public CGAL_STD::binary_function< Point, Point, Comparison_result> +{ + public: + Compare_signed_distance_to_line_2( const Line& l) : _l(l) {} + Comparison_result + operator()( const Point& p, const Point& q) + { return cmp_signed_dist_to_line( _l, p, q); } + private: + Line _l; +}; + +template +class Less_signed_distance_to_line_2 + : public CGAL_STD::binary_function< Point, Point, bool> +{ + public: + Less_signed_distance_to_line_2( const Line& l) : _l(l) {} + bool operator()( const Line& l, const Point& p, const Point& q) + { return has_smaller_signed_dist_to_line( l, p, q); } + private: + Line _l; +}; + +template +class Compare_signed_distance_to_implicit_line_2 + : public CGAL_STD::binary_function< Point, Point, Comparison_result> +{ + public: + Compare_signed_distance_to_implicit_line_2( const Point& p, const Point& q) + : _p(p), _q(q) + {} + Comparison_result + operator()( const Point& r, const Point& s) + { return cmp_signed_dist_to_line( _p, _q, r, s); } + private: + Point _p; + Point _q; +}; + +template +class Less_signed_distance_to_implicit_line_2 + : public CGAL_STD::binary_function< Point, Point, bool> +{ + public: + Less_signed_distance_to_implicit_line_2( const Point& p, const Point& q) + : _p(p), _q(q) + {} + bool operator()( const Point& r, const Point& s) + { return has_smaller_signed_dist_to_line( _p, _q, r, s); } + private: + Point _p; + Point _q; +}; + + + +template +struct Compare_y_at_point_2 + : public CGAL_STD::binary_function< Point, Line, Comparison_result> +{ + Comparison_result operator()( const Point& p, const Line& l) + { return compare_y_at_x( p, l); } +}; + +template +struct Compare_y_at_implicit_point_2 +{ + Comparison_result operator()( const Line& l1, const Line& l2, const Line& l) + { return compare_y_at_x( l1, l2, l); } +}; + +template +struct Compare_y_of_lines_at_point_2 +{ + Comparison_result operator()( const Point& p, const Line& l1, const Line& l2) + { return compare_y_at_x( p, l1, l2); } +}; + +template +struct Compare_y_of_lines_at_implicit_point_2 +{ + Comparison_result operator()( const Line& l1, const Line& l2, + const Line& h1, const Line& h2) + { return compare_y_at_x( l1, l2, h1, h2); } +}; + +template +struct Compare_x_implicit_point_2 +{ + Comparison_result operator()( const Point& p, + const Line& l1, const Line& l2) + { return compare_x( p, l1, l2); } +}; + +template +struct Compare_x_implicit_points_2 +{ + Comparison_result operator()( const Line& l1, const Line& l2, + const Line& h1, const Line& h2) + { return compare_x( l1, l2, h1, h2); } +}; + +template +struct Compare_x_implicit_points_same_line_2 +{ + Comparison_result + operator()( const Line& l, const Line& h1, const Line& h2) + { return compare_x( l, h1, h2); } +}; + +template +struct Compare_y_implicit_point_2 +{ + Comparison_result operator()( const Point& p, + const Line& l1, const Line& l2) + { return compare_y( p, l1, l2); } +}; + +template +struct Compare_y_implicit_points_2 +{ + Comparison_result operator()( const Line& l1, const Line& l2, + const Line& h1, const Line& h2) + { return compare_y( l1, l2, h1, h2); } +}; + +template +struct Compare_y_implicit_points_same_line_2 +{ + Comparison_result + operator()( const Line& l, const Line& h1, const Line& h2) + { return compare_y( l, h1, h2); } +}; + + +CGAL_END_NAMESPACE + + +#endif // CGAL_PREDICATES_CLASSES_2_H diff --git a/Old_Packages/_2/include/CGAL/predicates_on_lines_2.h b/Old_Packages/_2/include/CGAL/predicates_on_lines_2.h new file mode 100644 index 00000000000..aab26084126 --- /dev/null +++ b/Old_Packages/_2/include/CGAL/predicates_on_lines_2.h @@ -0,0 +1,202 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : predicates_on_lines_2.fw +// file : predicates_on_lines_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_PREDICATES_ON_LINES_2_H +#define CGAL_PREDICATES_ON_LINES_2_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_PREDICATES_ON_LINESH2_H +#include +#endif // CGAL_PREDICATES_ON_LINESH2_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_PREDICATES_ON_LINESC2_H +#include +#endif // CGAL_PREDICATES_ON_LINESC2_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_POINT_2_H +#include +#endif // CGAL_POINT_2_H +#ifndef CGAL_PREDICATES_ON_POINTS_2_H +#include +#endif // CGAL_PREDICATES_ON_POINTS_2_H +#ifndef CGAL_LINE_2_H +#include +#endif // CGAL_LINE_2_H + +CGAL_BEGIN_NAMESPACE + + +template < class R > +inline +Comparison_result +compare_x(const Point_2 &p, + const Line_2 &l1, + const Line_2 &l2) +{ + typedef typename R::Point_2_base RPoint_2; + typedef typename R::Line_2_base RLine_2 ; + return compare_x((const RPoint_2&)p, + (const RLine_2&)l1, + (const RLine_2&)l2); +} + +template < class R > +inline +Comparison_result +compare_x(const Line_2 &l1, + const Line_2 &l2, + const Line_2 &h1, + const Line_2 &h2) +{ + typedef typename R::Line_2_base RLine_2 ; + return compare_x((const RLine_2&)l1, (const RLine_2&)l2, + (const RLine_2&)h1, (const RLine_2&)h2); +} + + +template < class R > +inline +Comparison_result +compare_x(const Line_2 &l, + const Line_2 &h1, + const Line_2 &h2) +{ + typedef typename R::Line_2_base RLine_2 ; + return compare_x((const RLine_2&)l, (const RLine_2&)h1, + (const RLine_2&)l, (const RLine_2&)h2); +} + +template < class R > +inline +Comparison_result +compare_y(const Point_2 &p, + const Line_2 &l1, + const Line_2 &l2) +{ + typedef typename R::Point_2_base RPoint_2; + typedef typename R::Line_2_base RLine_2 ; + return compare_y((const RPoint_2&)p, + (const RLine_2&)l1, + (const RLine_2&)l2); +} + +template < class R > +inline +Comparison_result +compare_y(const Line_2 &l1, + const Line_2 &l2, + const Line_2 &h1, + const Line_2 &h2) +{ + typedef typename R::Line_2_base RLine_2 ; + return compare_y((const RLine_2&)l1, (const RLine_2&)l2, + (const RLine_2&)h1, (const RLine_2&)h2); +} + +template < class R > +inline +Comparison_result +compare_y(const Line_2 &l, + const Line_2 &h1, + const Line_2 &h2) +{ + typedef typename R::Line_2_base RLine_2 ; + return compare_y((const RLine_2&)l, (const RLine_2&)h1, + (const RLine_2&)l, (const RLine_2&)h2); +} + + +template < class R > +inline +Comparison_result +compare_y_at_x(const Point_2 &p, const Line_2 &h) +{ + typedef typename R::Point_2_base RPoint_2; + typedef typename R::Line_2_base RLine_2 ; + return compare_y_at_x((const RPoint_2&)p, + (const RLine_2&)h); +} + +template < class R > +inline +Comparison_result +compare_y_at_x(const Line_2 &l1, + const Line_2 &l2, + const Line_2 &h) +{ + typedef typename R::Line_2_base RLine_2 ; + return compare_y_at_x((const RLine_2&)l1, + (const RLine_2&)l2, + (const RLine_2&)h) ; +} + +template < class R > +inline +Comparison_result +compare_y_at_x(const Point_2 &p, + const Line_2 &h1, + const Line_2 &h2) +{ + CGAL_kernel_precondition( (! h1.is_vertical()) && (! h2.is_vertical()) ); + typedef typename R::Point_2_base RPoint_2; + typedef typename R::Line_2_base RLine_2 ; + return compare_y_at_x((const RPoint_2&)p, + (const RLine_2&)h1, + (const RLine_2&)h2); +} + +template < class R > +inline +Comparison_result +compare_y_at_x(const Line_2 &l1, + const Line_2 &l2, + const Line_2 &h1, + const Line_2 &h2) +{ + CGAL_kernel_precondition( (! h1.is_vertical()) && (! h2.is_vertical()) ); + typedef typename R::Line_2_base RLine_2 ; + return compare_y_at_x((const RLine_2&)l1, + (const RLine_2&)l2, + (const RLine_2&)h1, + (const RLine_2&)h2); +} + +CGAL_END_NAMESPACE + + +#endif // CGAL_PREDICATES_ON_LINES_2_H diff --git a/Old_Packages/_2/include/CGAL/predicates_on_points_2.h b/Old_Packages/_2/include/CGAL/predicates_on_points_2.h new file mode 100644 index 00000000000..ae7d82d5224 --- /dev/null +++ b/Old_Packages/_2/include/CGAL/predicates_on_points_2.h @@ -0,0 +1,367 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : predicates_on_points_2.fw +// file : predicates_on_points_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_PREDICATES_ON_POINTS_2_H +#define CGAL_PREDICATES_ON_POINTS_2_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_PREDICATES_ON_POINTSH2_H +#include +#endif // CGAL_PREDICATES_ON_POINTSH2_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_PREDICATES_ON_POINTSC2_H +#include +#endif // CGAL_PREDICATES_ON_POINTSC2_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_POINT_2_H +#include +#endif // CGAL_POINT_2_H + +CGAL_BEGIN_NAMESPACE + +template < class R > +inline +bool x_equal(const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + return x_equal((const RPoint_2&)p, (const RPoint_2&)q); +} + +template < class R > +inline +bool y_equal(const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + return y_equal((const RPoint_2&)p, (const RPoint_2&)q); +} + + +template < class R > +inline +Comparison_result compare_x(const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + return compare_x((const RPoint_2&)p, (const RPoint_2&)q); +} + +template < class R > +inline +Comparison_result compare_y(const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + return compare_y((const RPoint_2&)p, (const RPoint_2&)q); +} + +template < class R > +inline +Comparison_result +compare_deltax_deltay(const Point_2& p, + const Point_2& q, + const Point_2& r, + const Point_2& s) +{ + typedef typename R::Point_2_base RPoint_2; + return compare_deltax_deltay((const RPoint_2&)p, + (const RPoint_2&)q, + (const RPoint_2&)r, + (const RPoint_2&)s); +} + +template < class R > +inline +Comparison_result +compare_lexicographically_xy(const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + return compare_lexicographically_xy((const RPoint_2&)p, + (const RPoint_2&)q); +} + +template < class R > +inline +bool +lexicographically_xy_smaller_or_equal(const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + return lexicographically_xy_smaller_or_equal((const RPoint_2&)p, + (const RPoint_2&)q); +} + +template < class R > +inline +bool +lexicographically_xy_smaller(const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + return lexicographically_xy_smaller((const RPoint_2&)p, + (const RPoint_2&)q); +} + +template < class R > +inline +bool +lexicographically_xy_larger_or_equal(const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + return !lexicographically_xy_smaller((const RPoint_2&)p, + (const RPoint_2&)q); +} + +template < class R > +inline +bool +lexicographically_xy_larger(const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + return !lexicographically_xy_smaller_or_equal((const RPoint_2&)p, + (const RPoint_2&)q); +} + + +template < class R > +inline +Comparison_result +compare_lexicographically_yx(const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + return compare_lexicographically_yx((const RPoint_2&)p, + (const RPoint_2&)q); +} + +template < class R > +inline +bool +lexicographically_yx_smaller_or_equal(const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + return lexicographically_yx_smaller_or_equal((const RPoint_2&)p, + (const RPoint_2&)q); +} + +template < class R > +inline +bool +lexicographically_yx_smaller(const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + return lexicographically_yx_smaller((const RPoint_2&)p, + (const RPoint_2&)q); +} + +template < class R > +inline +bool +lexicographically_yx_larger_or_equal(const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + return !lexicographically_yx_smaller((const RPoint_2&)p, + (const RPoint_2&)q); +} + +template < class R > +inline +bool +lexicographically_yx_larger(const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + return !lexicographically_yx_smaller_or_equal((const RPoint_2&)p, + (const RPoint_2&)q); +} + +template < class R > +inline +bool +are_ordered_along_line(const Point_2& p, + const Point_2& q, + const Point_2& r) +{ + typedef typename R::Point_2_base RPoint_2; + return are_ordered_along_line((const RPoint_2&)p, + (const RPoint_2&)q, + (const RPoint_2&)r); +} + +template < class R > +inline +bool +collinear_are_ordered_along_line(const Point_2& p, + const Point_2& q, + const Point_2& r) +{ + typedef typename R::Point_2_base RPoint_2; + return collinear_are_ordered_along_line((const RPoint_2&)p, + (const RPoint_2&)q, + (const RPoint_2&)r); +} + +template < class R > +inline +bool +are_strictly_ordered_along_line(const Point_2& p, + const Point_2& q, + const Point_2& r) +{ + typedef typename R::Point_2_base RPoint_2; + return are_strictly_ordered_along_line((const RPoint_2&)p, + (const RPoint_2&)q, + (const RPoint_2&)r); +} +template < class R > +inline +bool +collinear_are_strictly_ordered_along_line(const Point_2& p, + const Point_2& q, + const Point_2& r) +{ + typedef typename R::Point_2_base RPoint_2; + return + collinear_are_strictly_ordered_along_line((const RPoint_2&)p, + (const RPoint_2&)q, + (const RPoint_2&)r); +} +template < class R > +inline +bool +collinear(const Point_2& p, + const Point_2& q, + const Point_2& r) +{ + typedef typename R::Point_2_base RPoint_2; + return (collinear((const RPoint_2&)p, + (const RPoint_2&)q, + (const RPoint_2&)r)); +} + +template < class R > +inline +bool +leftturn(const Point_2& p, + const Point_2& q, + const Point_2& r) +{ + typedef typename R::Point_2_base RPoint_2; + return leftturn((const RPoint_2&)p, + (const RPoint_2&)q, + (const RPoint_2&)r); +} + +template < class R > +inline +bool +rightturn(const Point_2& p, + const Point_2& q, + const Point_2& r) +{ + typedef typename R::Point_2_base RPoint_2; + return rightturn((const RPoint_2&)p, + (const RPoint_2&)q, + (const RPoint_2&)r); +} + +template < class R > +inline +bool +rightturn(const Origin& o, + const Point_2& q, + const Point_2& r) +{ + typedef typename R::Point_2_base RPoint_2; + return rightturn(o, (const RPoint_2&)q, (const RPoint_2&)r); +} + +template < class R > +inline +Orientation +orientation(const Point_2& p, + const Point_2&q, + const Point_2& r) +{ + typedef typename R::Point_2_base RPoint_2; + return orientation((const RPoint_2&)p, + (const RPoint_2&)q, + (const RPoint_2&)r); +} + +template +inline +Oriented_side +side_of_oriented_circle(const Point_2& p, + const Point_2& q, + const Point_2& r, + const Point_2& test) +{ + typedef typename R::Point_2_base RPoint_2; + return side_of_oriented_circle((const RPoint_2&)p, + (const RPoint_2&)q, + (const RPoint_2&)r, + (const RPoint_2&)test); +} + +template +inline +Bounded_side +side_of_bounded_circle(const Point_2& p, + const Point_2& q, + const Point_2& r, + const Point_2& test) +{ + typedef typename R::Point_2_base RPoint_2; + return side_of_bounded_circle((const RPoint_2&)p, + (const RPoint_2&)q, + (const RPoint_2&)r, + (const RPoint_2&)test); +} + +CGAL_END_NAMESPACE + + +#endif // CGAL_PREDICATES_ON_POINTS_2_H diff --git a/Old_Packages/_2/src/Bbox_2.C b/Old_Packages/_2/src/Bbox_2.C new file mode 100644 index 00000000000..01e2887f7cd --- /dev/null +++ b/Old_Packages/_2/src/Bbox_2.C @@ -0,0 +1,55 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : Bbox_2.fw +// file : Bbox_2.C +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_BBOX_2_H +#include +#endif // CGAL_BBOX_2_H + +CGAL_BEGIN_NAMESPACE + +Bbox_2::Bbox_2() +{ new ( static_cast< void*>(ptr)) Fourtuple(); } + +Bbox_2::Bbox_2(double x_min, double y_min, + double x_max, double y_max) +{ + new ( static_cast< void*>(ptr)) Fourtuple(x_min, y_min, + x_max, y_max); +} + +bool Bbox_2::operator==(const Bbox_2 &b) const +{ + return xmin() == b.xmin() && xmax() == b.xmax() + && ymin() == b.ymin() && ymax() == b.ymax(); +} + +bool Bbox_2::operator!=(const Bbox_2 &b) const +{ + return ! (b == *this); +} + +CGAL_END_NAMESPACE + + diff --git a/Old_Packages/_2/version b/Old_Packages/_2/version new file mode 100644 index 00000000000..b26f76657d1 --- /dev/null +++ b/Old_Packages/_2/version @@ -0,0 +1,2 @@ +3.6 (30 Jul 2000) +maintainer: Stefan Schirra diff --git a/Old_Packages/_3/changes.txt b/Old_Packages/_3/changes.txt new file mode 100644 index 00000000000..991b835b377 --- /dev/null +++ b/Old_Packages/_3/changes.txt @@ -0,0 +1,164 @@ +3.9 (15 Oct 2000) + +- Point_3 qualified by CGAL:: in Sphere_3.h + (Cartesian kernel needs this - homogeneous aparently does not) + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 2 . 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +3.8 (08 Oct 2000) + +- packaging script fixed + Sphere_3.h now added + +3.7 (16 Aug 2000) + +- cross_product added again (see 3.6); package H3 modified instead + +3.6 (11 Aug 2000) + +- cross_product removed (hoping that this will solve a Borland + problem with H3); The base class function should match instead. + +3.5 (30 Jul 2000) + +- copy assigment (operator=) removed + +3.4 (26 Jul 2000) + +- id() functions removed + +3.3.1 (27 Jun 2000) + +- Sphere_3 fixed ( left over) + +3.3 (19 Jun 2000) + +- Sphere_3 added + +3.2 (18 Apr 2000) + +- _R -> R_ +- Bbox_3 uses Handle_for<> now + +3.1 (06 Apr 2000) + +- include_advanced/CGAL/Old_style_kernel/U_3.h files created + which define class U_3 : public R::U_3_base + +3.0 (02 Feb 2000) + +- automatic inclusion for Simple_cartesian added + +2.9 (01 Feb 2000) + +- CGAL_static_cast replaced by static_cast<> + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 2 . 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +2.8 -> 2.8.1 (07 Nov 99) +- constructor for Identity added to Aff_transformation_3 + +2.7.3-> 2.8 (28 Oct 99) +- removed CGAL:: in non member functions in CGAL scope +- put friend CGAL::Vector_3 CGAL::Direction_3::vector() const; + in comment; is apparently not necessary anymore + +2.7.2-> 2.7.3 (14 Oct 99) +- added to_vector() to Direction_3 + +2.7.1-> 2.7.2 (08 Oct 99) +- Direction_3::vector() now calls to_vector() on implementation + classes + +2.7 -> 2.7.1 (17 Sep 99) +- distance_predicates_3.h added + +2.6 -> 2.7 (02 Sep 99) +- qualified ..._3<_R> by CGAL:: + +2.5 -> 2.6 (02 Sep 99) +- qualified ..._3 by CGAL:: + +2.4 -> 2.5 (01 Sep 99) +- #include <..C3.h> replaced #include <../Cartesian/.._3.h> +- Triangle_3.h fixed: R::Triangle_3 + +2.3 -> 2.4 (24 Aug 99) +- _3 is now derived from R::_3_base instead of R::_3 + typedef typename R::_3 R_3; replaced by + typedef typename R::_3_base R_3; + +2.2 -> 2.3 (04 Aug 99) +- updates/workarounds for gcc-2.95: + s/friend inline/friend CGAL_FRIEND_INLINE + s/friend CGAL_KERNEL_INLINE/friend CGAL_KERNEL_FRIEND_INLINE + made all operator-() friends non-friends + reorganized Point_3 and Vector_3 + added files point_vector_declarations_3.h + point_vector_definitions_3.C + added conversion fucntions between points and vectors + those are friends and used by operator-() - functions that are no friends + any longer + +2.1.2-> 2.2 (22 Jun 99) +- 'inline' placement fixed in Point_3.h and Vector_3.h + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 2 . 0 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +2.1.1-> 2.1.2 (21 May 99) +- packaging script extended ;) + +2.1 -> 2.1.1 (21 May 99) +- Less_xyz defined in a new file + used for fixing a bug in TetrahedraH3== + +2.0.3-> 2.1 (16 Apr 99) +- (user reported) bug in operator<<(ostream &os, const Bbox_3& b) fixed: + return os << b.xmin() << ' ' << b.ymin() << ' ' << b.zmin(); + --> ^^^^^^ +- iostream parts prefixed by std:: + +2.0.2-> 2.0.3 (14 Mar 99) +- std::min/max used in + +2.0.1-> 2.0.2 (24 Feb 99) +- CGAL_[BEGIN|END]_NAMESPACE used + +2.0 -> 2.0.1 (11 Feb 99) +- Quotient declared in + +1.4 -> 2.0 +- namespace CGAL { } introduced + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 1 . 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +1.3.1-> 1.4 +- Use of CGAL...INLINE made consistent between declarations and + definitions (otherwise SunPro CC 4.2 does not like it). + +1.3 -> 1.3.1 (03 Sep 98) +- ORIGIN [!=]= Point_3 added + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 1 . 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +1.2.2-> 1.3 +- basic_constructions_3.h added +- side_of...sphere revised + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 1 . 0 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +1.2.1-> 1.2.2 +- Plane_3::projection(Point_3) added + +1.2 -> 1.2.1 +- Vector_3 / Quotient added + +1.1 -> 1.2 +- made fit for egcs + +1.0 -> 1.1 +- added typename keyword + +0.9 -> 1.0 +- New access functions have been added to Aff_transformation. +- typename keyword has been added in most places diff --git a/Old_Packages/_3/description.txt b/Old_Packages/_3/description.txt new file mode 100644 index 00000000000..27e04839966 --- /dev/null +++ b/Old_Packages/_3/description.txt @@ -0,0 +1 @@ +abstract 3d kernel parameterized by rep class R diff --git a/Old_Packages/_3/include/CGAL/Aff_transformation_3.h b/Old_Packages/_3/include/CGAL/Aff_transformation_3.h new file mode 100644 index 00000000000..a327c73858d --- /dev/null +++ b/Old_Packages/_3/include/CGAL/Aff_transformation_3.h @@ -0,0 +1,202 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : Aff_transformation_3.fw +// file : Aff_transformation_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_AFF_TRANSFORMATION_3_H +#define CGAL_AFF_TRANSFORMATION_3_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#if defined(CGAL_CFG_INCOMPLETE_TYPE_BUG_1) && \ + !defined(CGAL_NO_PLANE_TRANSFORM_IN_AT) +#define CGAL_NO_PLANE_TRANSFORM_IN_AT +#endif // CGAL_CFG_INCOMPLETE_TYPE_BUG_1 + +#ifdef CGAL_HOMOGENEOUS_H +#include +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#include +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#include +#include +#include +#include + +CGAL_BEGIN_NAMESPACE + +template +class Aff_transformation_3 : public R_::Aff_transformation_3_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Plane_3_base RPlane_3; + typedef typename R::Aff_transformation_3_base RAff_transformation_3; + + // default constructor + Aff_transformation_3() : RAff_transformation_3() + {} + + // copy constructor + Aff_transformation_3(const CGAL::Aff_transformation_3& t) + : RAff_transformation_3(t) + {} + + // up cast constructor + Aff_transformation_3(const RAff_transformation_3& t) + : RAff_transformation_3(t) + {} + + // identity: + Aff_transformation_3(const Identity_transformation& tag) + : RAff_transformation_3(tag) + {} + + // translation: + Aff_transformation_3(const Translation tag, + const CGAL::Vector_3& v) + : RAff_transformation_3(tag, v) + {} + + // scaling: + Aff_transformation_3(const Scaling tag, + const RT& s, + const RT& w= RT(1) ) + : RAff_transformation_3(tag, s, w) + {} + + // the general case: + Aff_transformation_3( + const RT& m11, const RT& m12, const RT& m13, const RT& m14, + const RT& m21, const RT& m22, const RT& m23, const RT& m24, + const RT& m31, const RT& m32, const RT& m33, const RT& m34, + const RT& w= RT(1) ) + : RAff_transformation_3(m11, m12, m13, m14, + m21, m22, m23, m24, + m31, m32, m33, m34, + w) + {} + Aff_transformation_3( + const RT& m11, const RT& m12, const RT& m13, + const RT& m21, const RT& m22, const RT& m23, + const RT& m31, const RT& m32, const RT& m33, + const RT& w = RT(1) ) + : RAff_transformation_3(m11, m12, m13, + m21, m22, m23, + m31, m32, m33, + w) + {} + // dtor + ~Aff_transformation_3() + {} + // transformations + CGAL::Point_3 transform(const CGAL::Point_3& p) const + { return RAff_transformation_3::transform(p); } + CGAL::Point_3 operator()(const CGAL::Point_3& p) const + { return RAff_transformation_3::transform(p); } + CGAL::Vector_3 transform(const CGAL::Vector_3& v) const + { return RAff_transformation_3::transform(v); } + CGAL::Vector_3 operator()(const CGAL::Vector_3& v) const + { return RAff_transformation_3::transform(v); } + CGAL::Direction_3 transform(const CGAL::Direction_3& d) const + { return RAff_transformation_3::transform(d); } + CGAL::Direction_3 operator()(const CGAL::Direction_3& d) const + { return RAff_transformation_3::transform(d); } +#ifndef CGAL_NO_PLANE_TRANSFORM_IN_AT + CGAL::Plane_3 transform(const CGAL::Plane_3& pl) const + { return RAff_transformation_3::transform(pl); } +#else + CGAL::Plane_3 + transform(const CGAL::Plane_3& pl) const + { + return + (( const RPlane_3& )pl).transform( (const RAff_transformation_3& )(*this) ); + } +#endif // CGAL_NO_PLANE_TRANSFORM_IN_AT + CGAL::Plane_3 operator()(const CGAL::Plane_3& pl) const + { return transform(pl); } + // further members + CGAL::Aff_transformation_3 + inverse() const + { return RAff_transformation_3::inverse(); } + bool is_even() const + { return RAff_transformation_3::is_even(); } + bool is_odd() const + { return !is_even(); } + // access + FT cartesian(int i, int j) const + { return RAff_transformation_3::cartesian(i,j); } + RT homogeneous(int i, int j) const + { return RAff_transformation_3::homogeneous(i,j); } + FT m(int i, int j) const + { return RAff_transformation_3::m(i,j); } + RT hm(int i, int j) const + { return RAff_transformation_3::hm(i,j); } + // composition + CGAL::Aff_transformation_3 + operator*(const CGAL::Aff_transformation_3& t) const + { + return + static_cast(*this) * + static_cast(t) ; + } +}; + +// I/O operators +#ifndef NO_OSTREAM_INSERT_AFF_TRANSFORMATION_3 +template < class R > +std::ostream& +operator<<(std::ostream& os, const CGAL::Aff_transformation_3& t) +{ + typedef typename R::Aff_transformation_3_base RAff_transformation_3; + return os << static_cast(t); +} +#endif // NO_OSTREAM_INSERT_AFF_TRANSFORMATION_3 + +#ifndef NO_ISTREAM_EXTRACT_AFF_TRANSFORMATION_3 +template < class R > +std::istream& +operator>>(std::istream& is, CGAL::Aff_transformation_3& t) +{ + typedef typename R::Aff_transformation_3_base RAff_transformation_3; + return is >> static_cast(t); +} +#endif // NO_ISTREAM_EXTRACT_AFF_TRANSFORMATION_3 + +CGAL_END_NAMESPACE + + +#endif // CGAL_AFF_TRANSFORMATION_3_H diff --git a/Old_Packages/_3/include/CGAL/Bbox_3.h b/Old_Packages/_3/include/CGAL/Bbox_3.h new file mode 100644 index 00000000000..b378a7f24ab --- /dev/null +++ b/Old_Packages/_3/include/CGAL/Bbox_3.h @@ -0,0 +1,181 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : Bbox_3.fw +// file : Bbox_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_BBOX_3_H +#define CGAL_BBOX_3_H + +#ifndef CGAL_BASIC_H +#include +#endif // CGAL_BASIC_H +#ifndef CGAL_CARTESIAN_CLASSES_H +#include +#endif // CGAL_CARTESIAN_CLASSES_H +#ifndef SIXTUPLE_H +#include +#endif // SIXTUPLE_H + +CGAL_BEGIN_NAMESPACE + +class Bbox_3 : public Handle_for< Sixtuple > +{ +public: + Bbox_3(); + Bbox_3(double x_min, double y_min, double zmin, + double x_max, double y_max, double z_max); + + double xmin() const; + double ymin() const; + double zmin() const; + double xmax() const; + double ymax() const; + double zmax() const; + + Bbox_3 operator+(const Bbox_3& b) const; +}; + +inline +Bbox_3::Bbox_3() +{ new ( static_cast< void*>(ptr)) Sixtuple(); } + +inline +Bbox_3::Bbox_3(double x_min, double y_min, double z_min, + double x_max, double y_max, double z_max) +{ + new ( static_cast< void*>(ptr)) Sixtuple(x_min, y_min, z_min, + x_max, y_max, z_max); +} + +inline +double +Bbox_3::xmin() const +{ return ptr->e0; } + +inline +double +Bbox_3::ymin() const +{ return ptr->e1; } + +inline +double +Bbox_3::zmin() const +{ return ptr->e2; } + +inline +double +Bbox_3::xmax() const +{ return ptr->e3; } + +inline +double +Bbox_3::ymax() const +{ return ptr->e4; } + +inline +double +Bbox_3::zmax() const +{ return ptr->e5; } +inline Bbox_3 Bbox_3::operator+(const Bbox_3& b) const +{ + return Bbox_3(std::min(xmin(), b.xmin()), + std::min(ymin(), b.ymin()), + std::min(zmin(), b.zmin()), + std::max(xmax(), b.xmax()), + std::max(ymax(), b.ymax()), + std::max(zmax(), b.zmax())); +} +inline bool do_overlap(const Bbox_3& bb1, const Bbox_3& bb2) +{ + // check for emptiness ?? + if (bb1.xmax() < bb2.xmin() || bb2.xmax() < bb1.xmin()) + return false; + if (bb1.ymax() < bb2.ymin() || bb2.ymax() < bb1.ymin()) + return false; + if (bb1.zmax() < bb2.zmin() || bb2.zmax() < bb1.zmin()) + return false; + return true; +} +#ifndef NO_OSTREAM_INSERT_BBOX_3 +inline +std::ostream& +operator<<(std::ostream &os, const Bbox_3& b) +{ + switch(os.iword(IO::mode)) + { + case IO::ASCII : + return os << b.xmin() << ' ' << b.ymin() << ' ' << b.zmin(); + case IO::BINARY : + write(os, b.xmin()); + write(os, b.ymin()); + write(os, b.zmin()); + write(os, b.xmax()); + write(os, b.ymax()); + write(os, b.zmax()); + return os; + default: + os << "Bbox_3((" << b.xmin() + << ", " << b.ymin() + << ", " << b.zmin() << "), ("; + os << b.xmax() + << ", " << b.ymax() + << ", " << b.zmax() << "))"; + return os; + } +} +#endif // NO_OSTREAM_INSERT_BBOX_3 + + + +#ifndef NO_ISTREAM_EXTRACT_BBOX_3 +inline +std::istream& +operator>>(std::istream &is, Bbox_3& b) +{ + double xmin, ymin, zmin, xmax, ymax, zmax; + + switch(is.iword(IO::mode)) + { + case IO::ASCII : + is >> xmin >> ymin >> xmax >> ymax; + break; + case IO::BINARY : + read(is, xmin); + read(is, ymin); + read(is, zmin); + read(is, xmax); + read(is, ymax); + read(is, zmax); + break; + } + b = Bbox_3(xmin, ymin, zmin, xmax, ymax, zmax); + return is; +} + +#endif // NO_ISTREAM_EXTRACT_BBOX_3 + + +CGAL_END_NAMESPACE + + +#endif // CGAL_BBOX_3_H diff --git a/Old_Packages/_3/include/CGAL/Direction_3.h b/Old_Packages/_3/include/CGAL/Direction_3.h new file mode 100644 index 00000000000..d4c9a7fb3fb --- /dev/null +++ b/Old_Packages/_3/include/CGAL/Direction_3.h @@ -0,0 +1,134 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : Direction_3.fw +// file : Direction_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_DIRECTION_3_H +#define CGAL_DIRECTION_3_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_DIRECTIONH3_H +#include +#endif // CGAL_DIRECTIONH3_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_DIRECTIONC3_H +#include +#endif // CGAL_DIRECTIONC3_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_VECTOR_3_H +#include +#endif // CGAL_VECTOR_3_H + +CGAL_BEGIN_NAMESPACE + +template +class Direction_3 : public R_::Direction_3_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Direction_3_base RDirection_3; + typedef typename R::Vector_3_base RVector_3; + + Direction_3() + {} + Direction_3(const CGAL::Direction_3& d) + : RDirection_3( (const RDirection_3& )d ) + {} + Direction_3(const RDirection_3& d) + : RDirection_3(d) + {} + Direction_3(const RVector_3& v) + : RDirection_3(v) + {} + Direction_3(const RT& hx, const RT& hy, const RT& hz) + : RDirection_3(hx, hy, hz) + {} + + bool operator==(const CGAL::Direction_3 & d) const + { return RDirection_3::operator==(d); } + + bool operator!=(const CGAL::Direction_3 & d) const + { return !(*this == d); } + + CGAL::Vector_3 vector() const + { return (CGAL::Vector_3)RDirection_3::to_vector(); } + + CGAL::Vector_3 to_vector() const + { return (CGAL::Vector_3)RDirection_3::to_vector(); } + + CGAL::Direction_3 transform(const CGAL::Aff_transformation_3 & t) const + { return RDirection_3::transform(t); } + + CGAL::Direction_3 operator-() const + { return RDirection_3::operator-(); } + + RT delta(int i) const + { return RDirection_3::delta(i); } + + RT dx() const + { return RDirection_3::dx(); } + + RT dy() const + { return RDirection_3::dy(); } + + RT dz() const + { return RDirection_3::dz(); } +}; + + +#ifndef NO_OSTREAM_INSERT_DIRECTION_3 +template < class R > +std::ostream& operator<<(std::ostream& os, const Direction_3& d) +{ + typedef typename R::Direction_3_base RDirection_3; + return os << (const RDirection_3& )d; } +#endif // NO_OSTREAM_INSERT_DIRECTION_3 + + +#ifndef NO_ISTREAM_EXTRACT_DIRECTION_3 +template < class R > +std::istream& operator>>(std::istream& is, Direction_3& p) +{ + typedef typename R::Direction_3_base RDirection_3; + return is >> (RDirection_3& )p; } +#endif // NO_ISTREAM_EXTRACT_DIRECTION_3 + +CGAL_END_NAMESPACE + + +#endif // CGAL_DIRECTION_3_H diff --git a/Old_Packages/_3/include/CGAL/Iso_cuboid_3.h b/Old_Packages/_3/include/CGAL/Iso_cuboid_3.h new file mode 100644 index 00000000000..37780ce8ff6 --- /dev/null +++ b/Old_Packages/_3/include/CGAL/Iso_cuboid_3.h @@ -0,0 +1,142 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : Iso_cuboid_3.fw +// file : Iso_cuboid_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_ISO_CUBOID_3_H +#define CGAL_ISO_CUBOID_3_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#include +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#include +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#include + +CGAL_BEGIN_NAMESPACE + +template +class Iso_cuboid_3 : public R_::Iso_cuboid_3_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Iso_cuboid_3_base RIso_cuboid_3; + + Iso_cuboid_3() : RIso_cuboid_3() + {} + + Iso_cuboid_3(const CGAL::Iso_cuboid_3& r) : RIso_cuboid_3(r) + {} + + Iso_cuboid_3(const RIso_cuboid_3& r) : RIso_cuboid_3(r) + {} + + Iso_cuboid_3(const CGAL::Point_3& p, const CGAL::Point_3& q) + : RIso_cuboid_3(p,q) + {} + +/* + bool operator==(const CGAL::Iso_cuboid_3& r) const + { return (const RIso_cuboid_3& )*this == (const RIso_cuboid_3& )r ; } + bool operator!=(const CGAL::Iso_cuboid_3& r) const + { return !(*this == r); } + CGAL::Point_3 + min() const + { return RIso_cuboid_3::min(); } + CGAL::Point_3 + max() const + { return RIso_cuboid_3::max(); } + FT xmin() const + { return RIso_cuboid_3::xmin(); } + FT ymin() const + { return RIso_cuboid_3::ymin(); } + FT zmin() const + { return RIso_cuboid_3::zmin(); } + FT xmax() const + { return RIso_cuboid_3::xmax(); } + FT ymax() const + { return RIso_cuboid_3::ymax(); } + FT zmax() const + { return RIso_cuboid_3::zmax(); } + CGAL::Point_3 + vertex(int i) const + { return RIso_cuboid_3::vertex(i); } + CGAL::Point_3 + operator[](int i) const + { return vertex(i); } + Bounded_side + bounded_side(const CGAL::Point_3& p) const + { return RIso_cuboid_3::bounded_side(p); } + bool has_on_boundary(const CGAL::Point_3& p) const + { return RIso_cuboid_3::has_on_boundary(p); } + bool has_on_bounded_side(const CGAL::Point_3& p) const + { return RIso_cuboid_3::has_on_bounded_side(p); } + bool has_on_unbounded_side(const CGAL::Point_3& p) const + { return RIso_cuboid_3::has_on_unbounded_side(p); } + bool is_degenerate() const + { return RIso_cuboid_3::is_degenerate(); } + CGAL::Iso_cuboid_3 + transform(const CGAL::Aff_transformation_3& t) const + { return RIso_cuboid_3::transform(t); } +*/ +}; + +#ifndef NO_OSTREAM_INSERT_ISO_CUBOID_3 +template < class R > +std::ostream& +operator<<(std::ostream& os, const Iso_cuboid_3& r) +{ + typedef typename R::Iso_cuboid_3_base RIso_cuboid_3; + return os << (const RIso_cuboid_3& )r; } +#endif // NO_OSTREAM_INSERT_ISO_CUBOID_3 + +#ifndef NO_ISTREAM_EXTRACT_ISO_CUBOID_3 +template < class R > +std::istream& +operator>>(std::istream& is, Iso_cuboid_3& r) +{ + typedef typename R::Iso_cuboid_3_base RIso_cuboid_3; + is >> (RIso_cuboid_3& )r; + return is; +} +#endif // NO_ISTREAM_EXTRACT_ISO_CUBOID_3 + +CGAL_END_NAMESPACE + + +#endif // CGAL_ISO_CUBOID_3_H diff --git a/Old_Packages/_3/include/CGAL/Line_3.h b/Old_Packages/_3/include/CGAL/Line_3.h new file mode 100644 index 00000000000..4293df24b5a --- /dev/null +++ b/Old_Packages/_3/include/CGAL/Line_3.h @@ -0,0 +1,153 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : Line_3.fw +// file : Line_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + + +#ifndef CGAL_LINE_3_H +#define CGAL_LINE_3_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_LINEH3_H +#include +#endif // CGAL_LINEH3_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_LINEC3_H +#include +#endif // CGAL_LINEC3_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_SEGMENT_3_H +#include +#endif // CGAL_SEGMENT_3_H +#ifndef CGAL_POINT_3_H +#include +#endif // CGAL_POINT_3_H +#ifndef CGAL_RAY_3_H +#include +#endif // CGAL_RAY_3_H + +CGAL_BEGIN_NAMESPACE + +template +class Line_3 : public R_::Line_3_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Line_3_base RLine_3; + + Line_3() : RLine_3() + {} + Line_3(const CGAL::Line_3 & l) : RLine_3( ( const RLine_3& )l) + {} + Line_3(const CGAL::Point_3 & p, + const CGAL::Point_3 & q) : RLine_3(p,q) + {} + // conversion impl -> interface class + Line_3(const RLine_3& l) : RLine_3(l) + {} + Line_3(const CGAL::Segment_3 & s) : RLine_3( s ) + {} + Line_3(const CGAL::Ray_3 & r) : RLine_3( r ) + {} + Line_3(const CGAL::Point_3 & p, + const CGAL::Direction_3 & d) : RLine_3( p, d ) + {} + + bool operator==(const CGAL::Line_3 & l) const + { return RLine_3::operator==(l); } + + bool operator!=(const CGAL::Line_3 & l) const + { return !(*this == l); } + + CGAL::Plane_3 perpendicular_plane(const CGAL::Point_3 & p) const + { return RLine_3::perpendicular_plane(p); } + + CGAL::Line_3 opposite() const + { return RLine_3::opposite(); } + + CGAL::Point_3 point() const + { return RLine_3::point(); } + + CGAL::Point_3 point(int i) const + { return RLine_3::point(i); } + + CGAL::Point_3 projection(const CGAL::Point_3& p) const + { return RLine_3::projection(p); } + + CGAL::Direction_3 direction() const + { return RLine_3::direction(); } + + bool has_on(const CGAL::Point_3& p) const + { return RLine_3::has_on(p); } + + bool is_degenerate() const + { return RLine_3::is_degenerate(); } + + CGAL::Line_3 transform(const CGAL::Aff_transformation_3 & t) const + { return RLine_3::transform(t); } +}; + +#ifndef NO_OSTREAM_INSERT_LINE_3 +template < class R > +std::ostream& +operator<<(std::ostream& os, const Line_3& l) +{ + typedef typename R::Line_3_base RLine_3; + return os << (const RLine_3& )l; +} +#endif // NO_OSTREAM_INSERT_LINE_3 + +#ifndef NO_ISTREAM_EXTRACT_LINE_3 +template < class R > +std::istream& +operator>>(std::istream & is, Line_3 & p) +{ + typedef typename R::Line_3_base RLine_3; + is >> ( RLine_3& )p; + return is; +} +#endif // NO_ISTREAM_EXTRACT_LINE_3 + +CGAL_END_NAMESPACE + + +#ifndef CGAL_PLANE_3_H +#include +#endif // CGAL_PLANE_3_H + +#endif // CGAL_LINE_3_H diff --git a/Old_Packages/_3/include/CGAL/Plane_3.h b/Old_Packages/_3/include/CGAL/Plane_3.h new file mode 100644 index 00000000000..123e325b14f --- /dev/null +++ b/Old_Packages/_3/include/CGAL/Plane_3.h @@ -0,0 +1,205 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : Plane_3.fw +// file : Plane_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_PLANE_3_H +#define CGAL_PLANE_3_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#if defined(CGAL_CFG_INCOMPLETE_TYPE_BUG_1) && \ + !defined(CGAL_NO_PLANE_TRANSFORM_IN_AT) +#define CGAL_NO_PLANE_TRANSFORM_IN_AT +#endif // CGAL_CFG_INCOMPLETE_TYPE_BUG_1 + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_PLANEH3_H +#include +#endif // CGAL_PLANEH3_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_PLANEC3_H +#include +#endif // CGAL_PLANEC3_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_LINE_3_H +#include +#endif // CGAL_LINE_3_H +#ifndef CGAL_POINT_2_H +#include +#endif // CGAL_POINT_2_H + +CGAL_BEGIN_NAMESPACE + +template +class Plane_3 : public R_::Plane_3_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Plane_3_base RPlane_3; + + Plane_3() : RPlane_3() + {} + Plane_3(const CGAL::Plane_3& p) : RPlane_3(p) + {} + Plane_3(const RPlane_3& p) : RPlane_3(p) + {} + Plane_3(const CGAL::Point_3& p, + const CGAL::Point_3& q, + const CGAL::Point_3& r) + : RPlane_3(p,q,r) + {} + Plane_3(const CGAL::Point_3& p, const CGAL::Direction_3& d) + : RPlane_3(p,d) + {} + Plane_3(const CGAL::Point_3& p, const CGAL::Vector_3& v) + : RPlane_3(p,v) + {} + Plane_3(const RT& a, const RT& b, const RT& c, const RT& d) + : RPlane_3(a,b,c,d) + {} + Plane_3(const CGAL::Line_3& l, const CGAL::Point_3& p) + : RPlane_3(l,p) + {} + Plane_3(const CGAL::Segment_3& s, const CGAL::Point_3& p) + : RPlane_3(s,p) + {} + Plane_3(CGAL::Ray_3& r, const CGAL::Point_3& p) + : RPlane_3(r,p) + {} + + bool operator==(const CGAL::Plane_3& p) const + { return RPlane_3::operator==(p); } + + bool operator!=(const CGAL::Plane_3& p) const + { return !(*this == p); } + + + RT a() const + { return RPlane_3::a(); } + + RT b() const + { return RPlane_3::b(); } + + RT c() const + { return RPlane_3::c(); } + + RT d() const + { return RPlane_3::d(); } + + CGAL::Line_3 perpendicular_line(const CGAL::Point_3& p) const + { return RPlane_3::perpendicular_line(p); } + + CGAL::Plane_3 opposite() const + { return RPlane_3::opposite(); } + + CGAL::Point_3 projection(const CGAL::Point_3& p) const + { return RPlane_3::projection(p); } + + CGAL::Point_3 point() const + { return RPlane_3::point(); } + + CGAL::Vector_3 orthogonal_vector() const + { return RPlane_3::orthogonal_vector(); } + + CGAL::Direction_3 orthogonal_direction() const + { return RPlane_3::orthogonal_direction(); } + + CGAL::Vector_3 base1() const + { return RPlane_3::base1(); } + + CGAL::Vector_3 base2() const + { return RPlane_3::base2(); } + + CGAL::Point_2 to_2d(const CGAL::Point_3& p) const + { return RPlane_3::to_2d(p); } + + CGAL::Point_3 to_3d(const CGAL::Point_2& p) const + { return RPlane_3::to_3d(p); } + + CGAL::Plane_3 transform( CGAL::Aff_transformation_3& t) const + { return CGAL::Plane_3( RPlane_3::transform(t) ); } + + Oriented_side oriented_side(const CGAL::Point_3& p) const + { return RPlane_3::oriented_side(p); } + + bool has_on(const CGAL::Point_3& p) const + { return RPlane_3::has_on_boundary(p); } + + bool has_on(const CGAL::Line_3& l) const + { return RPlane_3::has_on_boundary(l); } + + bool has_on_boundary(const CGAL::Point_3& p) const + { return RPlane_3::has_on_boundary(p); } + + bool has_on_boundary(const CGAL::Line_3& l) const + { return RPlane_3::has_on_boundary(l); } + + bool has_on_positive_side(const CGAL::Point_3& p) const + { return RPlane_3::has_on_positive_side(p); } + + bool has_on_negative_side(const CGAL::Point_3& p) const + { return RPlane_3::has_on_negative_side(p); } + + bool is_degenerate() const + { return RPlane_3::is_degenerate(); } +}; + +#ifndef NO_OSTREAM_INSERT_PLANE_3 +template < class R > +std::ostream& +operator<<(std::ostream& os, const Plane_3& p) +{ + typedef typename R::Plane_3_base RPlane_3; + return os << (const RPlane_3& )p; +} +#endif // NO_OSTREAM_INSERT_PLANE_3 + +#ifndef NO_ISTREAM_EXTRACT_PLANE_3 +template < class R > +std::istream& +operator>>(std::istream& is, Plane_3& t) +{ + typedef typename R::Plane_3_base RPlane_3; + return is >> (RPlane_3& )t; +} +#endif // NO_ISTREAM_EXTRACT_PLANE_3 + + +CGAL_END_NAMESPACE + + +#endif // CGAL_PLANE_3_H diff --git a/Old_Packages/_3/include/CGAL/Point_3.h b/Old_Packages/_3/include/CGAL/Point_3.h new file mode 100644 index 00000000000..a1d43e96bf2 --- /dev/null +++ b/Old_Packages/_3/include/CGAL/Point_3.h @@ -0,0 +1,188 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : Point_3.fw +// file : Point_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_POINT_3_H +#define CGAL_POINT_3_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_POINTH3_H +#include +#endif // CGAL_POINTH3_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_POINTC3_H +#include +#endif // CGAL_POINTC3_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#include + +CGAL_BEGIN_NAMESPACE + +template +class Point_3 : public R_::Point_3_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Point_3_base RPoint_3; + typedef typename R::Vector_3_base RVector_3; + +friend CGAL_FRIEND_INLINE + CGAL::Point_3 + vector_to_point_conversion CGAL_NULL_TMPL_ARGS + (const CGAL::Vector_3& v); + +public: + Point_3() + {} + Point_3(const Origin& o) : RPoint_3(o) + {} + Point_3(const CGAL::Point_3& p) : RPoint_3( (const RPoint_3& )p ) + {} + Point_3(const RPoint_3& p) : RPoint_3(p) + {} + Point_3(const RT& hx, const RT& hy, const RT& hz) + : RPoint_3(hx, hy, hz) + {} + Point_3(const RT& hx, const RT& hy, const RT& hz, const RT& hw) + : RPoint_3(hx, hy, hz, hw) + {} + + bool operator==(const CGAL::Point_3& p) const + { return RPoint_3::operator==(p); } + + bool operator!=(const CGAL::Point_3& p) const + { return !(*this == p); } + + + RT hx() const + { return RPoint_3::hx(); } + + RT hy() const + { return RPoint_3::hy(); } + + RT hz() const + { return RPoint_3::hz(); } + + RT hw() const + { return RPoint_3::hw(); } + + FT x() const + { return RPoint_3::x(); } + + FT y() const + { return RPoint_3::y(); } + + FT z() const + { return RPoint_3::z(); } + + RT homogeneous(int i) const + { return RPoint_3::homogeneous(i); } + + FT cartesian(int i) const + { return RPoint_3::cartesian(i); } + + FT operator[](int i) const + { return cartesian(i); } + + int dimension() const + { return 3; } + + Bbox_3 bbox() const + { return RPoint_3::bbox(); } + + CGAL::Point_3 transform(const CGAL::Aff_transformation_3& t) const + { return RPoint_3::transform(t); } + +private: + Point_3(const RVector_3& v) : RPoint_3(v) + {} +}; + +CGAL_END_NAMESPACE + + +#ifndef CGAL_VECTOR_3_H +#include +#endif // CGAL_VECTOR_3_H + +#include + +#ifndef CGAL_AFF_TRANSFORMATION_3_H +#include +#endif // CGAL_AFF_TRANSFORMATION_3_H + +CGAL_BEGIN_NAMESPACE + +template +inline +bool +operator==(const Origin& o, const Point_3& p) +{ return p == o; } + +template +inline +bool +operator!=(const Origin& o, const Point_3& p) +{ return p != o; } + + +#ifndef NO_OSTREAM_INSERT_POINT_3 + +template < class R > +std::ostream& +operator<<(std::ostream& os, const Point_3& p) +{ + typedef typename R::Point_3_base RPoint_3; + return os << (const RPoint_3& )p; +} +#endif // NO_OSTREAM_INSERT_POINT_3 + +#ifndef NO_ISTREAM_EXTRACT_POINT_3 +template < class R > +std::istream& operator>>(std::istream& is, Point_3& p) +{ + typedef typename R::Point_3_base RPoint_3; + return is >> (RPoint_3& )p; +} +#endif // NO_ISTREAM_EXTRACT_POINT_3 + +CGAL_END_NAMESPACE + + +#endif // CGAL_POINT_3_H diff --git a/Old_Packages/_3/include/CGAL/Ray_3.h b/Old_Packages/_3/include/CGAL/Ray_3.h new file mode 100644 index 00000000000..42e485d7ccc --- /dev/null +++ b/Old_Packages/_3/include/CGAL/Ray_3.h @@ -0,0 +1,132 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : Ray_3.fw +// file : Ray_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_RAY_3_H +#define CGAL_RAY_3_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_RAYH3_H +#include +#endif // CGAL_RAYH3_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_RAYC3_H +#include +#endif // CGAL_RAYC3_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +CGAL_BEGIN_NAMESPACE + +template +class Ray_3 : public R_::Ray_3_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Ray_3_base RRay_3; + + Ray_3() : RRay_3() + {} + Ray_3(const CGAL::Ray_3& r) : RRay_3(r) + {} + Ray_3(const RRay_3& r) : RRay_3(r) + {} + Ray_3(const CGAL::Point_3& sp, + const CGAL::Point_3& secondp) + : RRay_3(sp, secondp) + {} + Ray_3(const CGAL::Point_3& sp, + const CGAL::Direction_3& d) + : RRay_3(sp, d) + {} + + bool operator==(const CGAL::Ray_3& r) const + { return RRay_3::operator==(r); } + bool operator!=(const CGAL::Ray_3& r) const + { return !(*this == r); } + + CGAL::Point_3 start() const + { return RRay_3::start(); } + CGAL::Point_3 source() const + { return RRay_3::source(); } + CGAL::Point_3 second_point() const + { return RRay_3::second_point(); } + CGAL::Point_3 point(int i) const + { return RRay_3::point(i); } + CGAL::Direction_3 direction() const + { return RRay_3::direction(); } + CGAL::Line_3 supporting_line() const + { return RRay_3::supporting_line(); } + CGAL::Ray_3 opposite() const + { return RRay_3::opposite(); } + CGAL::Ray_3 transform(const CGAL::Aff_transformation_3& t) const + { return RRay_3::transform(t); } + bool is_degenerate() const + { return RRay_3::is_degenerate(); } + bool has_on(const CGAL::Point_3& p) const + { return RRay_3::has_on(p); } +}; + +#ifndef NO_OSTREAM_INSERT_RAY_3 +template < class R > +std::ostream& +operator<<(std::ostream& os, const Ray_3& r) +{ + typedef typename R::Ray_3_base RRay_3; + return os << (const RRay_3& )r; +} +#endif // NO_OSTREAM_INSERT_RAY_3 + +#ifndef NO_ISTREAM_EXTRACT_RAY_3 +template < class R > +std::istream& +operator>>(std::istream& is, Ray_3& r) +{ + typedef typename R::Ray_3_base RRay_3; + return is >> (RRay_3& )r; +} +#endif // NO_ISTREAM_EXTRACT_RAY_3 + + +CGAL_END_NAMESPACE + + +#ifndef CGAL_LINE_3_H +#include +#endif // CGAL_LINE_3_H + +#endif // CGAL_RAY_3_H diff --git a/Old_Packages/_3/include/CGAL/Segment_3.h b/Old_Packages/_3/include/CGAL/Segment_3.h new file mode 100644 index 00000000000..4620a13a822 --- /dev/null +++ b/Old_Packages/_3/include/CGAL/Segment_3.h @@ -0,0 +1,139 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : Segment_3.fw +// file : Segment_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_SEGMENT_3_H +#define CGAL_SEGMENT_3_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_SEGMENTH3_H +#include +#endif // CGAL_SEGMENTH3_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_SEGMENTC3_H +#include +#endif // CGAL_SEGMENTC3_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_LINE_3_H +#include +#endif // CGAL_LINE_3_H + +CGAL_BEGIN_NAMESPACE + +template +class Segment_3 : public R_::Segment_3_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Segment_3_base RSegment_3; + + Segment_3() : RSegment_3() + {} + Segment_3(const CGAL::Segment_3& s) : RSegment_3(s) + {} + Segment_3(const CGAL::Point_3& sp, const CGAL::Point_3& ep) + : RSegment_3(sp,ep) + {} + Segment_3(const RSegment_3& s) : RSegment_3(s) + {} + + bool has_on(const CGAL::Point_3& p) const + { return RSegment_3::has_on(p); } + bool operator==(const CGAL::Segment_3& s) const + { return RSegment_3::operator==(s); } + bool operator!=(const CGAL::Segment_3& s) const + { return !(*this == s); } + CGAL::Point_3 start() const + { return RSegment_3::start(); } + CGAL::Point_3 end() const + { return RSegment_3::end(); } + CGAL::Point_3 source() const + { return RSegment_3::source(); } + CGAL::Point_3 target() const + { return RSegment_3::target(); } + CGAL::Point_3 min() const + { return RSegment_3::min(); } + CGAL::Point_3 max() const + { return RSegment_3::max(); } + CGAL::Point_3 vertex(int i) const + { return RSegment_3::vertex(i); } + CGAL::Point_3 operator[](int i) const + { return vertex(i); } + FT squared_length() const + { return RSegment_3::squared_length(); } + CGAL::Direction_3 direction() const + { return RSegment_3::direction(); } + CGAL::Segment_3 opposite() const + { return CGAL::Segment_3(target(),source()); } + CGAL::Segment_3 transform(const CGAL::Aff_transformation_3& t) const + { return RSegment_3::transform(t); } + CGAL::Line_3 supporting_line() const + { return RSegment_3::supporting_line(); } + bool is_degenerate() const + { return RSegment_3::is_degenerate(); } + Bbox_3 bbox() const + { return source().bbox() + target().bbox(); } +}; + + +#ifndef NO_OSTREAM_INSERT_SEGMENT_3 +template < class R> +std::ostream& +operator<<(std::ostream& os, const Segment_3& s) +{ + typedef typename R::Segment_3_base RSegment_3; + return os << (const RSegment_3& )s; +} +#endif // NO_OSTREAM_INSERT_SEGMENT_3 + +#ifndef NO_ISTREAM_EXTRACT_SEGMENT_3 +template < class R> +std::istream& +operator>>(std::istream& is, Segment_3& s) +{ + typedef typename R::Segment_3_base RSegment_3; + return is >> (RSegment_3& )s; +} +#endif // NO_ISTREAM_EXTRACT_SEGMENT_3 + + +CGAL_END_NAMESPACE + + +#endif // CGAL_SEGMENT_3_H diff --git a/Old_Packages/_3/include/CGAL/Sphere_3.h b/Old_Packages/_3/include/CGAL/Sphere_3.h new file mode 100644 index 00000000000..88441c125e9 --- /dev/null +++ b/Old_Packages/_3/include/CGAL/Sphere_3.h @@ -0,0 +1,98 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : Sphere_3.fw +// file : Sphere_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_SPHERE_3_H +#define CGAL_SPHERE_3_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#include +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#include +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +namespace CGAL { + + +template +class Sphere_3 : public R_::Sphere_3_base + +{ + public: + + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Sphere_3_base RSphere_3; + + Sphere_3() + {} + + Sphere_3(const RSphere_3& s) + : RSphere_3(s) + {} + + Sphere_3(const CGAL::Point_3& p, const FT& sq_rad, + const Orientation& o = COUNTERCLOCKWISE) + : RSphere_3(p, sq_rad, o) + {} + + Sphere_3(const CGAL::Point_3& p, const CGAL::Point_3& q, + const CGAL::Point_3& r, const CGAL::Point_3& u) + : RSphere_3(p, q, r, u) + {} + + Sphere_3(const CGAL::Point_3& p, const CGAL::Point_3& q, + const CGAL::Point_3& r, + const Orientation& o = COUNTERCLOCKWISE) + : RSphere_3(p, q, r, o) + {} + + Sphere_3(const CGAL::Point_3& p, const CGAL::Point_3& q, + const Orientation& o = COUNTERCLOCKWISE) + : RSphere_3(p, q, o) + {} + + Sphere_3(const CGAL::Point_3& p, + const Orientation& o = COUNTERCLOCKWISE) + : RSphere_3(p, o) + {} + +}; + +} // namespace CGAL + +#endif // CGAL_SPHERE_3_H diff --git a/Old_Packages/_3/include/CGAL/Tetrahedron_3.h b/Old_Packages/_3/include/CGAL/Tetrahedron_3.h new file mode 100644 index 00000000000..e2b43b8a2fb --- /dev/null +++ b/Old_Packages/_3/include/CGAL/Tetrahedron_3.h @@ -0,0 +1,142 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : Tetrahedron_3.fw +// file : Tetrahedron_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_TETRAHEDRON_3_H +#define CGAL_TETRAHEDRON_3_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_TETRAHEDRONH3_H +#include +#endif // CGAL_TETRAHEDRONH3_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_TETRAHEDRONC3_H +#include +#endif // CGAL_TETRAHEDRONC3_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_PLANE_3_H +#include +#endif // CGAL_PLANE_3_H + +CGAL_BEGIN_NAMESPACE + +template +class Tetrahedron_3 : public R_::Tetrahedron_3_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Tetrahedron_3_base RTetrahedron_3; + + Tetrahedron_3() : RTetrahedron_3() + {} + Tetrahedron_3(const CGAL::Tetrahedron_3& t) : RTetrahedron_3(t) + {} + Tetrahedron_3(const RTetrahedron_3& t) : RTetrahedron_3(t) + {} + Tetrahedron_3(const CGAL::Point_3& p, + const CGAL::Point_3& q, + const CGAL::Point_3& r, + const CGAL::Point_3& s) + : RTetrahedron_3(p,q,r,s) + {} + + CGAL::Point_3 vertex(int i) const + { return RTetrahedron_3::vertex(i); } + CGAL::Point_3 operator[](int i) const + { return vertex(i); } + bool operator==(const CGAL::Tetrahedron_3& t) const + { return RTetrahedron_3::operator==(t); } + bool operator!=(const CGAL::Tetrahedron_3& t) const + { return !(*this == t); } + Bbox_3 bbox() const + { + return vertex(0).bbox() + vertex(1).bbox() + + vertex(2).bbox() + vertex(3).bbox(); + } + CGAL::Tetrahedron_3 + transform(const CGAL::Aff_transformation_3& t) const + { + return + CGAL::Tetrahedron_3(RTetrahedron_3::transform(t)); + } + Orientation orientation() const + { return RTetrahedron_3::orientation(); } + Oriented_side oriented_side(const CGAL::Point_3& p) const + { return RTetrahedron_3::oriented_side(p); } + bool has_on_positive_side(const CGAL::Point_3& p) const + { return oriented_side(p) == ON_POSITIVE_SIDE; } + bool has_on_negative_side(const CGAL::Point_3& p) const + { return oriented_side(p) == ON_NEGATIVE_SIDE; } + Bounded_side bounded_side(const CGAL::Point_3& p) const + { return RTetrahedron_3::bounded_side(p); } + bool has_on_boundary(const CGAL::Point_3& p) const + { return bounded_side(p) == ON_BOUNDARY; } + bool has_on_bounded_side(const CGAL::Point_3& p) const + { return bounded_side(p) == ON_BOUNDED_SIDE; } + bool has_on_unbounded_side(const CGAL::Point_3& p) const + { return bounded_side(p) == ON_UNBOUNDED_SIDE; } + bool is_degenerate() const + { return RTetrahedron_3::is_degenerate(); } +}; + +#ifndef NO_OSTREAM_INSERT_TETRAHEDRON_3 +template < class R > +std::ostream& +operator<<(std::ostream& os, const Tetrahedron_3& t) +{ + typedef typename R::Tetrahedron_3_base RTetrahedron_3; + return os << (const RTetrahedron_3& )t; +} +#endif // NO_OSTREAM_INSERT_TETRAHEDRON_3 + +#ifndef NO_ISTREAM_EXTRACT_TETRAHEDRON_3 +template < class R > +std::istream& +operator>>(std::istream& is, Tetrahedron_3& t) +{ + typedef typename R::Tetrahedron_3_base RTetrahedron_3; + return is >> (RTetrahedron_3& )t; +} +#endif // NO_ISTREAM_EXTRACT_TETRAHEDRON_3 + + +CGAL_END_NAMESPACE + + +#endif // CGAL_TETRAHEDRON_3_H diff --git a/Old_Packages/_3/include/CGAL/Triangle_3.h b/Old_Packages/_3/include/CGAL/Triangle_3.h new file mode 100644 index 00000000000..eee5720cd50 --- /dev/null +++ b/Old_Packages/_3/include/CGAL/Triangle_3.h @@ -0,0 +1,135 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : Triangle_3.fw +// file : Triangle_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_TRIANGLE_3_H +#define CGAL_TRIANGLE_3_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_TRIANGLEH3_H +#include +#endif // CGAL_TRIANGLEH3_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_TRIANGLEC3_H +#include +#endif // CGAL_TRIANGLEC3_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_PLANE_3_H +#include +#endif // CGAL_PLANE_3_H + +CGAL_BEGIN_NAMESPACE + +template +class Triangle_3 : public R_::Triangle_3_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Triangle_3_base RTriangle_3; + + Triangle_3() : RTriangle_3() + {} + Triangle_3(const CGAL::Triangle_3& t) : RTriangle_3(t) + {} + Triangle_3(const RTriangle_3& t) : RTriangle_3(t) + {} + Triangle_3(const CGAL::Point_3& p, + const CGAL::Point_3& q, + const CGAL::Point_3& r) + : RTriangle_3(p,q,r) + {} + + bool operator==(const CGAL::Triangle_3& t) const + { return RTriangle_3::operator==(t); } + bool operator!=(const CGAL::Triangle_3& t) const + { return !(*this == t); } + CGAL::Plane_3 supporting_plane() const + { + return + CGAL::Plane_3( + RTriangle_3::supporting_plane()); + } + CGAL::Triangle_3 transform( + const CGAL::Aff_transformation_3& t) const + { + return + CGAL::Triangle_3(RTriangle_3::transform( t )); + } + bool has_on(const CGAL::Point_3& p) const + { return RTriangle_3::has_on(p); } + bool is_degenerate() const + { return RTriangle_3::is_degenerate(); } + CGAL::Point_3 vertex(int i) const + { return RTriangle_3::vertex(i); } + CGAL::Point_3 operator[](int i) const + { return vertex(i); } + Bbox_3 bbox() const + { + return vertex(0).bbox() + + vertex(1).bbox() + + vertex(2).bbox(); + } +}; + +#ifndef NO_OSTREAM_INSERT_TRIANGLE_3 +template < class R > +std::ostream& +operator<<(std::ostream& os, const Triangle_3& t) +{ + typedef typename R::Triangle_3_base RTriangle_3; + return os << (const RTriangle_3& )t; +} +#endif // NO_OSTREAM_INSERT_TRIANGLE_3 + +#ifndef NO_ISTREAM_EXTRACT_TRIANGLE_3 +template < class R > +std::istream& +operator>>(std::istream& is, Triangle_3& t) +{ + typedef typename R::Triangle_3_base RTriangle_3; + return is >> (RTriangle_3& )t; +} +#endif // NO_ISTREAM_EXTRACT_TRIANGLE_3 + + +CGAL_END_NAMESPACE + + +#endif // CGAL_TRIANGLE_3_H diff --git a/Old_Packages/_3/include/CGAL/Vector_3.h b/Old_Packages/_3/include/CGAL/Vector_3.h new file mode 100644 index 00000000000..142fccb79e2 --- /dev/null +++ b/Old_Packages/_3/include/CGAL/Vector_3.h @@ -0,0 +1,193 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : Vector_3.fw +// file : Vector_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_VECTOR_3_H +#define CGAL_VECTOR_3_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifndef CGAL_POINT_3_H +#include +#endif // CGAL_POINT_3_H + + +#ifndef CGAL_DIRECTION_3_H +#include +#endif // CGAL_DIRECTION_3_H + +#ifdef VECTOR_WRAPPER +#ifndef VECTOR_3_RFT_WRAPPER_H +#include +#endif // VECTOR_3_RFT_WRAPPER_H +#endif // VECTOR_WRAPPER + +CGAL_BEGIN_NAMESPACE + +template class Quotient; +template +class Vector_3 : public R_::Vector_3_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Vector_3_base RVector_3; + +friend CGAL_FRIEND_INLINE + CGAL::Vector_3 + point_to_vector_conversion CGAL_NULL_TMPL_ARGS + (const CGAL::Point_3& p); +/* +friend CGAL::Vector_3 + CGAL::Direction_3::vector() const; +*/ + + Vector_3() + {} + Vector_3(const CGAL::Vector_3& v) + : RVector_3( (const RVector_3& )v ) + {} + Vector_3(const RVector_3& v) : RVector_3(v) + {} + Vector_3(const Null_vector& v) : RVector_3(v) + {} + Vector_3(const RT& x, const RT& y, const RT& z) + : RVector_3(x, y, z) + {} + Vector_3(const RT& x, const RT& y, const RT& z, const RT& w) + : RVector_3(x, y, z, w) + {} + + bool operator==(const CGAL::Vector_3& v) const + { return RVector_3::operator==(v); } + bool operator!=(const CGAL::Vector_3& v) const + { return !(*this == v); } + bool operator==(const Null_vector& v) const + { return RVector_3::operator==(v); } + bool operator!=(const Null_vector& v) const + { return !(*this == v); } + RT hx() const + { return RVector_3::hx(); } + RT hy() const + { return RVector_3::hy(); } + RT hz() const + { return RVector_3::hz(); } + RT hw() const + { return RVector_3::hw(); } + FT x() const + { return RVector_3::x(); } + FT y() const + { return RVector_3::y(); } + FT z() const + { return RVector_3::z(); } + RT homogeneous(int i) const + { return RVector_3::homogeneous(i); } + FT cartesian(int i) const + { return RVector_3::cartesian(i); } + FT operator[](int i) const + { return cartesian(i); } + int dimension() const + { return 3; } + CGAL::Vector_3 operator+(const CGAL::Vector_3& w) const + { return (const RVector_3& )(*this) + (const RVector_3& )(w); } + CGAL::Vector_3 operator-(const CGAL::Vector_3& w) const + { return (const RVector_3& )(*this) - (const RVector_3& )(w); } + CGAL::Vector_3 operator-() const + { return RVector_3::operator-(); } + FT operator*(const CGAL::Vector_3& w) const + { return (const RVector_3& )(*this) * (const RVector_3& )(w); } + +#ifndef VECTOR_WRAPPER + CGAL::Vector_3 operator*(const RT& c) const + { return c * (const RVector_3& )(*this) ; } + CGAL::Vector_3 operator*(const Quotient& q) const + { + return (q.numerator() * (const RVector_3& )(*this)) / + q.denominator(); + } + CGAL::Vector_3 operator/(const Quotient& q) const + { + return (q.denominator() * (const RVector_3& )(*this)) / + q.numerator(); + } +#endif // VECTOR_WRAPPER + + CGAL::Vector_3 operator/(const RT& c) const + { return (const RVector_3& )(*this) / c; } + CGAL::Direction_3 direction() const + { return RVector_3::direction(); } + CGAL::Vector_3 transform(const CGAL::Aff_transformation_3& t) const + { return RVector_3::transform(t); } + +private: + Vector_3(const CGAL::Point_3& p) : RVector_3(p) + {} + Vector_3(const CGAL::Direction_3& d) : RVector_3(d) + {} +}; + +template < class R > +No_number_tag number_type_tag(const Vector_3& ) +{ + return No_number_tag(); +} + +#ifndef NO_OSTREAM_INSERT_VECTOR_3 +template < class R > +std::ostream& +operator<<(std::ostream& os, const Vector_3& v) +{ + typedef typename R::Vector_3_base RVector_3; + return os << (const RVector_3& )v; +} +#endif // NO_OSTREAM_INSERT_VECTOR_3 + +#ifndef NO_ISTREAM_EXTRACT_VECTOR_3 +template < class R > +std::istream& +operator>>(std::istream& is, Vector_3& p) +{ + typedef typename R::Vector_3_base RVector_3; + return is >> (RVector_3& )p; +} +#endif // NO_ISTREAM_EXTRACT_VECTOR_3 + + +template +inline +Vector_3 +cross_product(const Vector_3& v, const Vector_3& w) +{ + typedef typename R::Vector_3_base RVector_3; + return cross_product((const RVector_3& )v,(const RVector_3& )w); +} + +CGAL_END_NAMESPACE + + +#endif // CGAL_VECTOR_3_H diff --git a/Old_Packages/_3/include/CGAL/basic_constructions_3.h b/Old_Packages/_3/include/CGAL/basic_constructions_3.h new file mode 100644 index 00000000000..8d1c4fa0ce0 --- /dev/null +++ b/Old_Packages/_3/include/CGAL/basic_constructions_3.h @@ -0,0 +1,72 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : basic_constructions_3.fw +// file : basic_constructions_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_BASIC_CONSTRUCTIONS_3_H +#define CGAL_BASIC_CONSTRUCTIONS_3_H + +#ifdef CGAL_HOMOGENEOUS_H +#include +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#include +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +CGAL_BEGIN_NAMESPACE + +template < class R > +inline +Point_3 +midpoint( const Point_3& p, + const Point_3& q ) +{ + typedef typename R::Point_3_base RPoint_3; + return( midpoint( static_cast(p), + static_cast(q))); +} +template < class R > +inline +Point_3 +circumcenter( const Point_3& p, + const Point_3& q, + const Point_3& r, + const Point_3& s) +{ + typedef typename R::Point_3_base RPoint_3; + return( circumcenter( static_cast(p), + static_cast(q), + static_cast(r), + static_cast(s))); +} +CGAL_END_NAMESPACE + + +#endif // CGAL_BASIC_CONSTRUCTIONS_3_H diff --git a/Old_Packages/_3/include/CGAL/distance_predicates_3.h b/Old_Packages/_3/include/CGAL/distance_predicates_3.h new file mode 100644 index 00000000000..08c8b2e3980 --- /dev/null +++ b/Old_Packages/_3/include/CGAL/distance_predicates_3.h @@ -0,0 +1,58 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : distance_predicates_3.fw +// file : distance_predicates_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_DISTANCE_PREDICATES_3_H +#define CGAL_DISTANCE_PREDICATES_3_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_DISTANCE_PREDICATESH3_H +#include +#endif // CGAL_DISTANCE_PREDICATESH3_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_DISTANCE_PREDICATESC3_H +#include +#endif // CGAL_DISTANCE_PREDICATESC3_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_POINT_3_H +#include +#endif // CGAL_POINT_3_H +#ifndef CGAL_PLANE_3_H +#include +#endif // CGAL_PLANE_3_H + +#endif //CGAL_DISTANCE_PREDICATES_3_H diff --git a/Old_Packages/_3/include/CGAL/point_vector_declarations_3.h b/Old_Packages/_3/include/CGAL/point_vector_declarations_3.h new file mode 100644 index 00000000000..880a4e62062 --- /dev/null +++ b/Old_Packages/_3/include/CGAL/point_vector_declarations_3.h @@ -0,0 +1,83 @@ + +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : PV_decl.fw +// file : include/CGAL/point_vector_declarations_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_POINT_VECTOR_DECLARATIONS_3_H +#define CGAL_POINT_VECTOR_DECLARATIONS_3_H + +#include + +CGAL_BEGIN_NAMESPACE + + +template < class R > +inline +Vector_3 +point_to_vector_conversion(const Point_3& p); + +template < class R > +inline +Point_3 +vector_to_point_conversion(const Vector_3& v); + +template < class R > +inline +Point_3 +operator+(const Point_3& p, const Vector_3& v); + +template < class R > +inline +Point_3 +operator-(const Point_3& p, const Vector_3& v); + +template < class R > +inline +Point_3 +operator+(const Origin& , const Vector_3& v); + +template < class R > +inline +Point_3 +operator-(const Origin& , const Vector_3& v); + +template < class R > +inline +Vector_3 +operator-(const Point_3& p, const Point_3& q); + +template < class R > +inline +Vector_3 +operator-(const Point_3& p, const Origin& ); + +template < class R > +inline +Vector_3 +operator-(const Origin& , const Point_3& p); +CGAL_END_NAMESPACE + + +#endif // CGAL_POINT_VECTOR_DECLARATIONS_3_H diff --git a/Old_Packages/_3/include/CGAL/point_vector_definitions_3.C b/Old_Packages/_3/include/CGAL/point_vector_definitions_3.C new file mode 100644 index 00000000000..2ead8341cdc --- /dev/null +++ b/Old_Packages/_3/include/CGAL/point_vector_definitions_3.C @@ -0,0 +1,104 @@ + +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : PV_decl.fw +// file : include/CGAL/point_vector_definitions_3.C +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_POINT_VECTOR_DEFINITIONS_3_C +#define CGAL_POINT_VECTOR_DEFINITIONS_3_C + +CGAL_BEGIN_NAMESPACE + +template < class R > +inline +Vector_3 +point_to_vector_conversion(const Point_3& p) +{ return Vector_3(p); } + +template < class R > +inline +Point_3 +vector_to_point_conversion(const Vector_3& v) +{ return Point_3(v); } + +template < class R > +inline +Point_3 +operator+(const Point_3& p, const Vector_3& v) +{ + typedef typename R::Point_3_base RPoint_3; + typedef typename R::Vector_3_base RVector_3; + return Point_3((const RPoint_3& )p + (const RVector_3& )v) ; +} + +template < class R > +inline +Point_3 +operator-(const Point_3& p, const Vector_3& v) +{ + typedef typename R::Point_3_base RPoint_3; + typedef typename R::Vector_3_base RVector_3; + return Point_3((const RPoint_3& )p - (const RVector_3& )v) ; +} + +template < class R > +inline +Point_3 +operator+(const Origin& , const Vector_3& v) +{ return vector_to_point_conversion(v) ; } + +template < class R > +inline +Point_3 +operator-(const Origin& , const Vector_3& v) +{ return vector_to_point_conversion(-v) ; } + +template < class R > +inline +Vector_3 +operator-(const Point_3& p, const Point_3& q) +{ + typedef typename R::Point_3_base RPoint_3; + return Vector_3((const RPoint_3& )p - (const RPoint_3& )q) ; +} + +template < class R > +inline +Vector_3 +operator-(const Point_3& p, const Origin& ) +{ return point_to_vector_conversion(p) ; } + +template < class R > +inline +Vector_3 +operator-(const Origin& , const Point_3& p) +{ + typedef typename R::Point_3_base RPoint_3; + return Vector_3(ORIGIN - (const RPoint_3& )p) ; +} + +CGAL_END_NAMESPACE + + +#endif // CGAL_POINT_VECTOR_DEFINITIONS_3_C diff --git a/Old_Packages/_3/include/CGAL/predicate_classes_3.h b/Old_Packages/_3/include/CGAL/predicate_classes_3.h new file mode 100644 index 00000000000..184d5b488dc --- /dev/null +++ b/Old_Packages/_3/include/CGAL/predicate_classes_3.h @@ -0,0 +1,45 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : predicate_classes_3.fw +// file : predicate_classes_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_PREDICATES_CLASSES_3_H +#define CGAL_PREDICATES_CLASSES_3_H +#include + +CGAL_BEGIN_NAMESPACE + +template < class Point> +class Less_xyz +{ +public: + bool + operator()( const Point& p, const Point& q) + { return lexicographically_xyz_smaller(p,q); } +}; + +CGAL_END_NAMESPACE + + +#endif // CGAL_PREDICATES_CLASSES_3_H diff --git a/Old_Packages/_3/include/CGAL/predicates_on_points_3.h b/Old_Packages/_3/include/CGAL/predicates_on_points_3.h new file mode 100644 index 00000000000..bc1f25dbb98 --- /dev/null +++ b/Old_Packages/_3/include/CGAL/predicates_on_points_3.h @@ -0,0 +1,281 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : predicates_on_points_3.fw +// file : predicates_on_points_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_PREDICATES_ON_POINTS_3_H +#define CGAL_PREDICATES_ON_POINTS_3_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef PREDICATES_ON_POINTSH3_H +#include +#endif // PREDICATES_ON_POINTSH3_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_PREDICATES_ON_POINTSC3_H +#include +#endif // CGAL_PREDICATES_ON_POINTSC3_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_POINT_3_H +#include +#endif // CGAL_POINT_3_H + +CGAL_BEGIN_NAMESPACE + +template < class R > +inline +Comparison_result +compare_lexicographically_xyz( const Point_3 &p, + const Point_3 &q) +{ + typedef typename R::Point_3_base RPoint_3; + return compare_lexicographically_xyz((const RPoint_3& )p, + (const RPoint_3& )q); +} + +template < class R > +inline +bool +lexicographically_xyz_smaller_or_equal(const Point_3 &p, + const Point_3 &q) +{ + typedef typename R::Point_3_base RPoint_3; + return ( !( compare_lexicographically_xyz((const RPoint_3& )p, + (const RPoint_3& )q) + == LARGER ) ); +} + +template < class R > +inline +bool +lexicographically_xyz_smaller(const Point_3 &p, + const Point_3 &q) +{ + typedef typename R::Point_3_base RPoint_3; + return ( compare_lexicographically_xyz((const RPoint_3& )p, + (const RPoint_3& )q) + == SMALLER ); +} + +template < class R > +inline +Comparison_result +compare_x(const Point_3 &p, const Point_3 &q) +{ + typedef typename R::Point_3_base RPoint_3; + return compare_x((const RPoint_3& )p, (const RPoint_3& )q); +} + + +template < class R > +inline +Comparison_result +compare_y(const Point_3 &p, const Point_3 &q) +{ + typedef typename R::Point_3_base RPoint_3; + return compare_y((const RPoint_3& )p, (const RPoint_3& )q); +} + + +template < class R > +inline +Comparison_result +compare_z(const Point_3 &p, const Point_3 &q) +{ + typedef typename R::Point_3_base RPoint_3; + return compare_z((const RPoint_3& )p, (const RPoint_3& )q); +} + +template < class R > +inline +bool +x_equal(const Point_3 &p, + const Point_3 &q) +{ + typedef typename R::Point_3_base RPoint_3; + return x_equal((const RPoint_3& )p, (const RPoint_3& )q); +} + +template < class R > +inline +bool +y_equal(const Point_3 &p, + const Point_3 &q) +{ + typedef typename R::Point_3_base RPoint_3; + return y_equal((const RPoint_3& )p, (const RPoint_3& )q); +} + +template < class R > +inline +bool +z_equal(const Point_3 &p, + const Point_3 &q) +{ + typedef typename R::Point_3_base RPoint_3; + return z_equal((const RPoint_3& )p, (const RPoint_3& )q); +} + +template < class R > +inline +bool +coplanar(const Point_3 &p, + const Point_3 &q, + const Point_3 &r, + const Point_3 &s) +{ + typedef typename R::Point_3_base RPoint_3; + return ( coplanar((const RPoint_3& )p, (const RPoint_3& )q, + (const RPoint_3& )r, (const RPoint_3& )s) ); +} + +template < class R > +inline +bool +collinear(const Point_3 &p, + const Point_3 &q, + const Point_3 &r) +{ + typedef typename R::Point_3_base RPoint_3; + return (collinear((const RPoint_3& )p, + (const RPoint_3& )q, + (const RPoint_3& )r)); +} + +template < class R > +inline +bool +are_ordered_along_line(const Point_3 &p, + const Point_3 &q, + const Point_3 &r) +{ + typedef typename R::Point_3_base RPoint_3; + return (are_ordered_along_line((const RPoint_3& )p, + (const RPoint_3& )q, + (const RPoint_3& )r)); +} + +template < class R > +inline +bool +collinear_are_ordered_along_line(const Point_3 &p, + const Point_3 &q, + const Point_3 &r) +{ + typedef typename R::Point_3_base RPoint_3; + return collinear_are_ordered_along_line((const RPoint_3& )p, + (const RPoint_3& )q, + (const RPoint_3& )r + ); +} + +template < class R > +inline +bool +are_strictly_ordered_along_line(const Point_3 &p, + const Point_3 &q, + const Point_3 &r) +{ + typedef typename R::Point_3_base RPoint_3; + return (are_strictly_ordered_along_line((const RPoint_3& )p, + (const RPoint_3& )q, + (const RPoint_3& )r)); +} + +template < class R > +inline +bool +collinear_are_strictly_ordered_along_line(const Point_3 &p, + const Point_3 &q, + const Point_3 &r) +{ + typedef typename R::Point_3_base RPoint_3; + return collinear_are_strictly_ordered_along_line((const RPoint_3& )p, + (const RPoint_3& )q, + (const RPoint_3& )r + ); +} + +template < class R > +inline +Orientation +orientation(const Point_3 &p, + const Point_3 &q, + const Point_3 &r, + const Point_3 &s) +{ + typedef typename R::Point_3_base RPoint_3; + return orientation((const RPoint_3& )p, (const RPoint_3& )q, + (const RPoint_3& )r, (const RPoint_3& )s); +} + +template +inline +Bounded_side +side_of_bounded_sphere( const Point_3 &p, + const Point_3 &q, + const Point_3 &r, + const Point_3 &s, + const Point_3 &test) +{ + typedef typename R::Point_3_base RPoint_3; + return side_of_bounded_sphere((const RPoint_3& )p, + (const RPoint_3& )q, + (const RPoint_3& )r, + (const RPoint_3& )s, + (const RPoint_3& )test); +} + +template +inline +Oriented_side +side_of_oriented_sphere( const Point_3 &p, + const Point_3 &q, + const Point_3 &r, + const Point_3 &s, + const Point_3 &test) +{ + typedef typename R::Point_3_base RPoint_3; + return side_of_oriented_sphere((const RPoint_3& )p, + (const RPoint_3& )q, + (const RPoint_3& )r, + (const RPoint_3& )s, + (const RPoint_3& )test); +} + +CGAL_END_NAMESPACE + + +#endif // CGAL_PREDICATES_ON_POINTS_3_H diff --git a/Old_Packages/_3/version b/Old_Packages/_3/version new file mode 100644 index 00000000000..784284addbf --- /dev/null +++ b/Old_Packages/_3/version @@ -0,0 +1,2 @@ +3.9 (15 Oct 2000) +maintainer: Stefan Schirra diff --git a/Old_Packages/_d/changes.txt b/Old_Packages/_d/changes.txt new file mode 100644 index 00000000000..27a3460b149 --- /dev/null +++ b/Old_Packages/_d/changes.txt @@ -0,0 +1,53 @@ +2.4 (20 Jul 2000) + +- is_zero qualified by CGAL_NTS + +2.3.1 (19 Apr 2000) + +- _R -> R_ + +2.3 (02 Feb 2000) + +- automatic inclusion for Simple_cartesian added + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 2 . 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +2.2.6 -> 2.2.7 (08 Oct 99) +- Point_d.h updated (inclusion of PointCd.h) + +2.2.5 -> 2.2.6 (29 Sep 99) +- PointCd.h removed from package :) + +2.2.4 -> 2.2.5 (29 Sep 99) +- added write(os,d) to PointHd +- some cosmetic changes like FT *i, *j; FT* i; FT* j; + +2.2.3 -> 2.2.4 (28 Sep 99) +- for (int i = ...) fixed for Point_d and M$ + +2.2.2 -> 2.2.3 (14 Sep 99) +- Point_d_base fixed in stream operator + ^^^^^ + +2.2.1 -> 2.2.2 (14 Sep 99) +- some cosmetics :) e.g. maintainer added to header lines + +2.2 -> 2.2.1 (13 Sep 99) +- class Point_d : public _R::Point_d_base + (also in a typedef) ^^^^^ + +2.1 -> 2.2 (13 Sep 99) +- moved definition of constructor with iterator range to the class body + to please MS VC++, as requested by Dima +- removed 'ifndef CGAL_CFG_NO_MEMBER_TEMPLATES' + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 2 . 0 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +2.0 -> 2.1 +- undocumented begin() and end() iterators added to d-dim points + +1.0 -> 2.0 +- namespace CGAL { } introduced + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 1 . 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + diff --git a/Old_Packages/_d/description.txt b/Old_Packages/_d/description.txt new file mode 100644 index 00000000000..d29993c3273 --- /dev/null +++ b/Old_Packages/_d/description.txt @@ -0,0 +1 @@ +Ddim Points only diff --git a/Old_Packages/_d/include/CGAL/PointHd.h b/Old_Packages/_d/include/CGAL/PointHd.h new file mode 100644 index 00000000000..f058e677856 --- /dev/null +++ b/Old_Packages/_d/include/CGAL/PointHd.h @@ -0,0 +1,279 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 20 +// +// source : ddim_points.fw +// file : PointHd.h +// package : _d (2.4) +// maintainer : Stefan Schirra +// revision : 2.4 +// revision_date : 20 Jul 2000 +// author(s) : Sven Schoenherr +// Bernd Gaertner +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_POINTHD_H +#define CGAL_POINTHD_H + +#ifndef D_TUPLE_H +#include +#endif // D_TUPLE_H + +CGAL_BEGIN_NAMESPACE + +template < class FT, class RT> +class DAHd; + +template < class FT, class RT > +class PointHd : public Handle +{ + friend class DAHd; + + public: + PointHd (); + PointHd (int dim, const Origin&); + PointHd (const PointHd &p); + + template + PointHd (int dim, InputIterator first, InputIterator last) + { + CGAL_kernel_precondition( dim >= 0 ); + PTR = new _d_tuple( dim, false); + RT* o; + RT* e = ptr()->e; + InputIterator i; + for (i = first, o = e; ( i < last )&&( o < e+dim ); *(o++) = *(i++) ) {}; + CGAL_kernel_precondition ( o == e+dim ); + if (i < last) + { + RT h = *(i++); + CGAL_kernel_precondition( !CGAL_NTS is_zero (h) ); + CGAL_kernel_precondition( i == last ); + *o = h; + } + else + { *o = RT(1); } + } + + ~PointHd(); + + PointHd& operator=(const PointHd &p); + + bool operator==(const PointHd &p) const; + bool operator!=(const PointHd &p) const; + + int id() const; + + RT homogeneous (int i) const; + FT cartesian (int i) const; + FT operator[] (int i) const; + const RT* begin() const; + const RT* end() const; + + int dimension () const; + + private: + const _d_tuple* ptr() const; +}; + +template < class FT, class RT > +CGAL_KERNEL_INLINE +const _d_tuple* PointHd::ptr() const +{ + return (_d_tuple*)PTR; +} +CGAL_END_NAMESPACE + + +#ifndef CGAL_ORIGIN_H +#include +#endif // CGAL_ORIGIN_H +#ifndef CGAL_NUMBER_UTILS_H +#include +#endif // CGAL_NUMBER_UTILS_H + +CGAL_BEGIN_NAMESPACE + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +PointHd::PointHd() +{ PTR = new _d_tuple(); } + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +PointHd::PointHd(int dim, const Origin &) +{ + CGAL_kernel_precondition( dim >= 0); + PTR = new _d_tuple(dim,false); + RT* e = ptr()->e; + FT* i; + for (i=e; i +CGAL_KERNEL_CTOR_INLINE +PointHd::PointHd(const PointHd &p) + : Handle((Handle&)p) +{} + +template < class FT, class RT > +inline +PointHd::~PointHd() +{} + +template < class FT, class RT > +inline +PointHd& +PointHd::operator=(const PointHd &p) +{ + Handle::operator=(p); + return *this; +} + +template < class FT, class RT > +inline +bool +PointHd::operator==(const PointHd& p) const +{ + int d = dimension(); + if (d != p.dimension()) return false; + RT* e = ptr()->e; + RT* ep = p.ptr()->e; + RT h = e[d], hp = ep[d]; + RT* i; + RT* j; + for ( i=e, j=ep; i +inline +bool +PointHd::operator!=(const PointHd& p) const +{ return !(*this == p); } + +template < class FT, class RT > +inline +int +PointHd::id() const +{ return (int)PTR; } + +template < class FT, class RT > +inline +RT +PointHd::homogeneous(int i) const +{ + CGAL_kernel_precondition ( (i>=0) && (i<=dimension()) ); + return ptr()->e[i]; +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +FT +PointHd::cartesian(int i) const +{ + CGAL_kernel_precondition ( (i>=0) && (ie[i])/FT(ptr()->e[dimension()]); +} + +template < class FT, class RT > +inline +FT +PointHd::operator[](int i) const +{ return cartesian(i); } + +template < class FT, class RT > +inline +int +PointHd::dimension() const +{ return ptr()->d; } + +template < class FT, class RT > +inline +const RT* +PointHd::begin() const +{ return ptr()->e; } + +template < class FT, class RT > +inline +const RT* +PointHd::end() const +{ return ptr()->e + dimension() + 1; } + +#ifndef NO_OSTREAM_INSERT_POINTHD +template < class FT, class RT > +std::ostream& +operator<<(std::ostream& os, const PointHd& p) +{ + int d = p.dimension(); + int i; + switch(os.iword(IO::mode)) + { + case IO::ASCII : + os << d << ' '; + for (i=0; i +std::istream& +operator>>(std::istream& is, PointHd &p) +{ + int d=0, i; + RT* e=0; + switch(is.iword(IO::mode)) + { + case IO::ASCII : + is >> d; + e = new RT[d+1]; + for (i=0; i> e[i]; } + break; + case IO::BINARY : + read(is, d); + e = new RT[d+1]; + for (i=0; i( d, e, e+d+1); + delete[] e; + return is; +} + +#endif // NO_ISTREAM_EXTRACT_POINTHD +CGAL_END_NAMESPACE + + +#endif // POINTH_H diff --git a/Old_Packages/_d/include/CGAL/PointSd.h b/Old_Packages/_d/include/CGAL/PointSd.h new file mode 100644 index 00000000000..a784d1ce3d6 --- /dev/null +++ b/Old_Packages/_d/include/CGAL/PointSd.h @@ -0,0 +1,282 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 20 +// +// source : ddim_points.fw +// file : PointSd.h +// package : _d (2.4) +// maintainer : Stefan Schirra +// revision : 2.4 +// revision_date : 20 Jul 2000 +// author(s) : Sven Schoenherr +// Bernd Gaertner +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_POINTSD_H +#define CGAL_POINTSD_H + +#ifndef D_TUPLE_H +#include +#endif // D_TUPLE_H + +CGAL_BEGIN_NAMESPACE + +template < class FT > +class DASd; + +template < class FT > +class PointSd : public Handle +{ + friend class DASd; + + public: + PointSd (); + PointSd (int dim, const Origin&); + PointSd (const PointSd &p); + + template + PointSd (int dim, InputIterator first, InputIterator last) + { + CGAL_kernel_precondition( dim >= 0); + PTR = new _d_tuple(dim); + FT* o; + FT* e = ptr()->e; + InputIterator i; + for ( i=first, o=e; ( i < last)&&( o < e+dim ); *(o++) = *(i++) ) {}; + CGAL_kernel_precondition( o == e+dim ); + if ( i < last ) + { + FT h = *(i++); + CGAL_kernel_precondition( !CGAL_NTS is_zero (h) ); + CGAL_kernel_precondition( i == last ); + for ( o=e; o < e+dim; *(o++) /= h ) ; + // if ( h != FT(1) ) { for ( o=e; o < e+dim; *(o++) /= h ) {}; } + } + } + + + ~PointSd(); + + PointSd &operator=(const PointSd &p); + + bool operator==(const PointSd &p) const; + bool operator!=(const PointSd &p) const; + + int id() const; + + FT homogeneous (int i) const; + FT cartesian (int i) const; + FT operator[] (int i) const; + const FT* begin() const; + const FT* end() const; + + int dimension () const; + + private: + const _d_tuple* ptr() const; +}; + +template < class FT > +CGAL_KERNEL_INLINE +const _d_tuple* PointSd::ptr() const +{ + return (_d_tuple*)PTR; +} +CGAL_END_NAMESPACE + + +#ifndef CGAL_ORIGIN_H +#include +#endif // CGAL_ORIGIN_H +#ifndef CGAL_NUMBER_UTILS_H +#include +#endif // CGAL_NUMBER_UTILS_H + +CGAL_BEGIN_NAMESPACE + +template < class FT > +CGAL_KERNEL_CTOR_INLINE +PointSd::PointSd() +{ + PTR = new _d_tuple(); +} + +template < class FT > +CGAL_KERNEL_CTOR_INLINE +PointSd::PointSd(int dim, const Origin &) +{ + CGAL_kernel_precondition (dim>=0); + PTR = new _d_tuple(dim); + FT* e = ptr()->e; + FT* i; + for (i=e; i +CGAL_KERNEL_CTOR_INLINE +PointSd::PointSd(const PointSd &p) + : Handle((Handle&)p) +{} + + +template < class FT > +inline +PointSd::~PointSd() +{} + +template < class FT > +inline +PointSd &PointSd::operator=(const PointSd &p) +{ + Handle::operator=(p); + return *this; +} + +template < class FT > +inline +bool PointSd::operator==(const PointSd& p) const +{ + int d = dimension(); + if (d != p.dimension()) return false; + FT* e = ptr()->e; + FT* ep = p.ptr()->e; + FT* i = e; + FT* j = ep; + for ( ; i < e+d; ++i, ++j) + if (*i != *j) return false; + return true; +} + +template < class FT > +inline +bool +PointSd::operator!=(const PointSd& p) const +{ return !(*this == p); } + +template < class FT > +inline +int PointSd::id() const +{ return (int)PTR; } + +template < class FT > +inline +FT +PointSd::homogeneous(int i) const +{ + CGAL_kernel_precondition ( (i>=0) && (i<=dimension()) ); + if (ie[i]; + else + return FT(1); +} + +template < class FT > +CGAL_KERNEL_INLINE +FT +PointSd::cartesian(int i) const +{ + CGAL_kernel_precondition ( (i>=0) && (ie[i]; +} + +template < class FT > +inline +FT +PointSd::operator[](int i) const +{ return cartesian(i); } + + +template < class FT > +inline +int +PointSd::dimension() const +{ return ptr()->d; } + +template < class FT > +inline +const FT* +PointSd::begin() const +{ return ptr()->e; } + +template < class FT > +inline +const FT* PointSd::end() const +{ return ptr()->e + dimension(); } + +#ifndef NO_OSTREAM_INSERT_POINTSD +template < class FT > +std::ostream& +operator<<(std::ostream& os, const PointSd &p) +{ + int d = p.dimension(); + int i; + switch(os.iword(IO::mode)) + { + case IO::ASCII : + os << d << ' '; + for (i=0; i +std::istream& +operator>>(std::istream& is, PointSd &p) +{ + int d=0, i; + FT* e=0; + switch(is.iword(IO::mode)) + { + case IO::ASCII : + is >> d; + e = new FT[d]; + for (i=0; i < d; ++i) { is >> e[i]; } + break; + case IO::BINARY : + read(is, d); + e = new FT[d]; + for (i=0; i( d, e, e+d); + delete[] e; + return is; +} + +#endif // NO_ISTREAM_EXTRACT_POINTSD +CGAL_END_NAMESPACE + + +#endif // CGAL_POINTSD_H diff --git a/Old_Packages/_d/include/CGAL/Point_d.h b/Old_Packages/_d/include/CGAL/Point_d.h new file mode 100644 index 00000000000..c635853525a --- /dev/null +++ b/Old_Packages/_d/include/CGAL/Point_d.h @@ -0,0 +1,155 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 20 +// +// source : ddim_points.fw +// file : Point_d.h +// package : _d (2.4) +// maintainer : Stefan Schirra +// revision : 2.4 +// revision_date : 20 Jul 2000 +// author(s) : Sven Schoenherr +// Bernd Gaertner +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_POINT_D_H +#define CGAL_POINT_D_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#include +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#include +// #include +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + +CGAL_BEGIN_NAMESPACE + +template < class R_ > +class Point_d : public R_::Point_d_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Point_d_base Point; + + Point_d() + {} + + Point_d(int dim, const Origin &o) + : Point(dim, o) + {} + + Point_d(const Point_d &p) + : Point((Point&)p) + {} + + Point_d(const Point &p) + : Point(p) + {} + + template + Point_d (int dim, InputIterator first, InputIterator last) + : Point (dim, first, last) + {} + + Point_d& operator=(const Point_d& p) + { + Point::operator=(p); + return *this; + } + + bool operator==(const Point_d& p) const + { + return Point::operator==(p); + } + + bool operator!=(const Point_d& p) const + { + return !(*this == p); + } + + int id() const + { + return (int) PTR; + } + + RT homogeneous(int i) const + { + return Point::homogeneous(i); + } + + FT cartesian(int i) const + { + return Point::cartesian(i); + } + + FT operator[](int i) const + { + return Point::operator[](i); + } + + typedef const RT* const_iterator; + + const_iterator begin() const + { + return Point::begin(); + } + + const_iterator end() const + { + return Point::end(); + } + + int dimension() const + { + return Point::dimension(); + } +}; + +#ifndef NO_OSTREAM_INSERT_POINT_D +template < class R > +std::ostream& +operator<<(std::ostream& os, const Point_d& p) +{ + typedef typename R::Point_d_base Point; + return os << (const Point&)p; +} +#endif // NO_OSTREAM_INSERT_POINT_D + +#ifndef NO_ISTREAM_EXTRACT_POINT_D +template < class R > +std::istream& +operator>>(std::istream& is, Point_d &p) +{ + typedef typename R::Point_d_base Point; + return is >> (Point&)p; +} +#endif // NO_ISTREAM_EXTRACT_POINT_D +CGAL_END_NAMESPACE + + +#endif // CGAL_POINT_D_H + diff --git a/Old_Packages/_d/include/CGAL/d_tuple.h b/Old_Packages/_d/include/CGAL/d_tuple.h new file mode 100644 index 00000000000..bb77e667a52 --- /dev/null +++ b/Old_Packages/_d/include/CGAL/d_tuple.h @@ -0,0 +1,55 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 20 +// +// source : ddim_points.fw +// file : d_tuple.h +// package : _d (2.4) +// maintainer : Stefan Schirra +// revision : 2.4 +// revision_date : 20 Jul 2000 +// author(s) : Sven Schoenherr +// Bernd Gaertner +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL__D_TUPLE_H +#define CGAL__D_TUPLE_H + +CGAL_BEGIN_NAMESPACE + +template < class T > +class _d_tuple : public Rep +{ + public: + const int d; + T* e; + + _d_tuple(int dim = 0, bool cartesian = true) : d(dim) + { + if (cartesian) + e = new T[d]; + else + e = new T[d+1]; + } + + ~_d_tuple () + { + delete[] e; + } +}; +CGAL_END_NAMESPACE + + +#endif // CGAL__D_TUPLE_H diff --git a/Old_Packages/_d/version b/Old_Packages/_d/version new file mode 100644 index 00000000000..64ede137578 --- /dev/null +++ b/Old_Packages/_d/version @@ -0,0 +1,2 @@ +2.4 (20 Jul 2000) +maintainer: Stefan Schirra diff --git a/Packages/H2/description.txt b/Packages/H2/description.txt new file mode 100644 index 00000000000..3106bd9dca7 --- /dev/null +++ b/Packages/H2/description.txt @@ -0,0 +1,2 @@ +2-dimenionsal kernel with homogeneous representation + diff --git a/Packages/H2/include/CGAL/Aff_transformationH2.h b/Packages/H2/include/CGAL/Aff_transformationH2.h new file mode 100644 index 00000000000..1e8f77bb3a7 --- /dev/null +++ b/Packages/H2/include/CGAL/Aff_transformationH2.h @@ -0,0 +1,1047 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 11 +// +// source : Aff_transformationH2.fw +// file : Aff_transformationH2.h +// package : H2 (2.13) +// maintainer : Stefan Schirra +// revision : 2.13 +// revision_date : 11 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_AFF_TRANSFORMATIONH2_H +#define CGAL_AFF_TRANSFORMATIONH2_H + +#include +#include + +#if defined(CGAL_CFG_INCOMPLETE_TYPE_BUG_1) && \ + !defined(CGAL_NO_LINE_TRANSFORM_IN_AT) +#define CGAL_NO_LINE_TRANSFORM_IN_AT +#endif // CGAL_CFG_INCOMPLETE_TYPE_BUG_1 + + +CGAL_BEGIN_NAMESPACE + +template +class Aff_transformationH2; + +template +class Aff_transformation_repH2; + +template +Aff_transformationH2 +_general_transformation_composition( Aff_transformation_repH2 l, + Aff_transformation_repH2 r); + +template +class Aff_transformation_rep_baseH2 : public Ref_counted +{ + public: + + virtual ~Aff_transformation_rep_baseH2(){} + + virtual PointH2 + transform(const PointH2& p) const = 0; + virtual VectorH2 + transform(const VectorH2& v) const = 0; + virtual DirectionH2 + transform(const DirectionH2& d) const = 0; + virtual Aff_transformationH2 + inverse() const = 0; + virtual Aff_transformation_repH2 + general_form() const = 0; + virtual bool is_even() const = 0; + + virtual RT homogeneous(int i, int j) const = 0; + virtual FT cartesian(int i, int j) const = 0; + + +}; + +template < class FT, class RT > +class Aff_transformation_repH2 : public Aff_transformation_rep_baseH2 +{ + public: + Aff_transformation_repH2() + {} + + Aff_transformation_repH2(const RT& m00, const RT& m01, const RT& m02, + const RT& m10, const RT& m11, const RT& m12, + const RT& m22) + : a(m00), b(m01), c(m02), d(m10), e(m11), f(m12), g(m22) + {} + + virtual ~Aff_transformation_repH2() + {} + + + virtual PointH2 + transform(const PointH2& p) const + { + return PointH2( a * p.hx() + b * p.hy() + c * p.hw(), + d * p.hx() + e * p.hy() + f * p.hw(), + g * p.hw() ); + } + + virtual VectorH2 + transform(const VectorH2& v) const + { + return VectorH2( a * v.hx() + b * v.hy(), + d * v.hx() + e * v.hy(), + g * v.hw() ); + } + + virtual DirectionH2 + transform(const DirectionH2& dir) const + { + const RT RT0(0); + if ( g > RT0 ) + { + return DirectionH2( a * dir.x() + b * dir.y(), + d * dir.x() + e * dir.y() ); + } + else if ( g < RT0 ) + { + return - DirectionH2(a * dir.x() + b * dir.y(), + d * dir.x() + e * dir.y() ); + } + return DirectionH2( a * dir.x() + b * dir.y(), + d * dir.x() + e * dir.y(), + g ); + } + + virtual Aff_transformationH2 + inverse() const + { + RT ai = e*g; + RT bi = - b*g; + RT ci = b*f - e*c; + RT di = - d*g; + RT ei = a*g; + RT fi = d*c - a*f; + RT gi = a*e - b*d; + return Aff_transformationH2( ai, bi, ci, + di, ei, fi, + gi) ; + } + + + virtual Aff_transformation_repH2 + general_form() const + { return *this; } + + virtual bool + is_even() const + { return CGAL_NTS sign( (a*e - b*d)*g )== 1; } + + virtual RT homogeneous(int i, int j) const; + virtual FT cartesian(int i, int j) const; + + RT a; // | a b c | | x | | xn | + RT b; // | d e f | * | y | = | yn | + RT c; // | 0 0 g | | w | | wn | + RT d; + RT e; + RT f; + RT g; + + friend Aff_transformationH2 + _general_transformation_composition CGAL_NULL_TMPL_ARGS ( + Aff_transformation_repH2 l, + Aff_transformation_repH2 r + ); +}; + +template < class FT, class RT > +class Identity_repH2 : public Aff_transformation_rep_baseH2 +{ + public: + Identity_repH2() + {} + + virtual ~Identity_repH2() + {} + + + virtual PointH2 + transform(const PointH2 & p) const + { return p; } + + virtual VectorH2 + transform(const VectorH2 & v) const + { return v; } + + virtual DirectionH2 + transform(const DirectionH2 & d) const + { return d; } + + virtual Aff_transformationH2 + inverse() const + { return Aff_transformationH2(IDENTITY); } + + virtual bool + is_even() const + { return true; } + + virtual Aff_transformation_repH2 + general_form() const + { + const RT RT0(0); + const RT RT1(1); + return Aff_transformation_repH2( RT1, RT0, RT0, + RT0, RT1, RT0, + RT1 ); + } + + virtual RT + homogeneous(int i, int j) const + { return (i==j) ? RT(1) : RT(0); } + virtual FT + cartesian(int i, int j) const + { return (i==j) ? FT(1) : FT(0); } +}; + +template < class FT, class RT > +class Translation_repH2 : public Aff_transformation_rep_baseH2 +{ + public: + Translation_repH2() + {} + + Translation_repH2(const VectorH2 & tv) : _tv(tv) + {} + + virtual ~Translation_repH2() + {} + + virtual PointH2 + transform(const PointH2 & p) const + { return (p + _tv); } + + virtual VectorH2 + transform(const VectorH2 & v) const + { return (v); } + + virtual DirectionH2 + transform(const DirectionH2 & d) const + { return (d); } + + virtual Aff_transformationH2 + inverse() const + { return Aff_transformationH2(TRANSLATION, - _tv); } + + virtual bool + is_even() const + { return true; } + + virtual Aff_transformation_repH2 + general_form() const + { + return + Aff_transformation_repH2( _tv.hw(), RT(0) , _tv.hx(), + RT(0) , _tv.hw(), _tv.hy(), + _tv.hw() ); + } + + virtual RT homogeneous(int i, int j) const; + virtual FT cartesian(int i, int j) const; + + + private: + VectorH2 _tv; +}; +template < class FT, class RT > +class Rotation_repH2 : public Aff_transformation_rep_baseH2 +{ + public: + Rotation_repH2() + { + } + Rotation_repH2(const RT& sin, const RT& cos, const RT& den) : + _sin(sin), _cos(cos), _den(den) + { + if ( den < RT(0) ) + { + _sin = - _sin; + _cos = - _cos; + _den = - _den; + }; + } + ~Rotation_repH2() + { + } + + virtual PointH2 + transform(const PointH2 & p) const + { + return PointH2( p.hx()*_cos - p.hy()*_sin, + p.hx()*_sin + p.hy()*_cos, + p.hw()*_den ); + } + virtual VectorH2 + transform(const VectorH2 & v) const + { + return VectorH2( v.hx()*_cos - v.hy()*_sin, + v.hx()*_sin + v.hy()*_cos, + v.hw()*_den ); + } + virtual DirectionH2 + transform(const DirectionH2 & d) const + { + return DirectionH2( d.x()*_cos - d.y()*_sin, + d.x()*_sin + d.y()*_cos); + } + virtual Aff_transformationH2 + inverse() const + { + return Aff_transformationH2(ROTATION, + - _sin, _cos, _den); + } + virtual bool + is_even() const + { + return true; + } + virtual Aff_transformation_repH2 + general_form() const + { + return Aff_transformation_repH2( + _cos, - _sin, RT(0) , + _sin, _cos, RT(0) , + _den ); + } + + virtual RT homogeneous(int i, int j) const; + virtual FT cartesian(int i, int j) const; + + + private: + RT _sin; + RT _cos; + RT _den; +}; +template < class FT, class RT > +class Scaling_repH2 : public Aff_transformation_rep_baseH2 +{ + public: + Scaling_repH2() + {} + + Scaling_repH2(const RT& scaling_numerator, + const RT& scaling_denominator) : + _sf_num(scaling_numerator), _sf_den(scaling_denominator) + { + if ( scaling_denominator < RT(0) ) + { + _sf_num = - _sf_num; + _sf_den = - _sf_den; + }; + } + + virtual ~Scaling_repH2() + {} + + virtual PointH2 + transform(const PointH2 & p) const + { + return PointH2( p.hx() * _sf_num, + p.hy() * _sf_num, + p.hw() * _sf_den ); + } + virtual VectorH2 + transform(const VectorH2 & v) const + { + return VectorH2( v.hx() * _sf_num, + v.hy() * _sf_num, + v.hw() * _sf_den ); + } + virtual DirectionH2 + transform(const DirectionH2 & d) const + { return (d); } + + virtual Aff_transformationH2 + inverse() const + { return Aff_transformationH2(SCALING, _sf_den, _sf_num); } + + virtual bool + is_even() const + { return true; } + + virtual Aff_transformation_repH2 + general_form() const + { + return + Aff_transformation_repH2(_sf_num, RT(0) , RT(0) , + RT(0) , _sf_num, RT(0) , + _sf_den ); + } + + virtual RT homogeneous(int i, int j) const; + virtual FT cartesian(int i, int j) const; + + + private: + RT _sf_num; + RT _sf_den; +}; +template < class FT, class RT > +class Reflection_repH2 : public Aff_transformation_rep_baseH2 +{ + public: + Reflection_repH2(const LineH2& l_) : l(l_) {} + + virtual ~Reflection_repH2() + {} + + virtual PointH2 + transform(const PointH2 & p) const + { + PointH2 pp = l.projection(p); + return p + (pp - p)*RT(2); + } + + virtual VectorH2 + transform(const VectorH2 & v) const + { + LineH2 l0( l.a(), l.b(), RT(0)); + PointH2 p = ORIGIN + v; + PointH2 pp = l0.projection(p); + return (p + (pp - p)*RT(2)) - ORIGIN; + } + + virtual DirectionH2 + transform(const DirectionH2 & d) const + { return transform( VectorH2(d) ).direction(); } + + virtual Aff_transformationH2 + inverse() const + { + return Aff_transformationH2( + static_cast< Aff_transformation_rep_baseH2* > + ( const_cast< Reflection_repH2*> (this) ) ); + } + + virtual bool + is_even() const + { return false; } + + virtual Aff_transformation_repH2 + general_form() const + { + const RT mRT2 = - RT(2); + const RT& a = l.a_ref(); + const RT& b = l.b_ref(); + const RT& c = l.c_ref(); + RT de = a*a + b*b; + RT aa = b*b - a*a; + RT bb = a*a - b*b; + RT ab = a*b* mRT2; + RT ac = a*c* mRT2; + RT bc = b*c* mRT2; + return + Aff_transformation_repH2( aa, ab, ac, + ab, bb, bc, + de ); + } + + virtual RT homogeneous(int i, int j) const; + virtual FT cartesian(int i, int j) const; + + + private: + LineH2 l; +}; + + + + +template < class FT, class RT > +class Aff_transformationH2 + : public Handle_for< Aff_transformation_rep_baseH2, + No_op_allocator< Aff_transformation_rep_baseH2 > > +{ + public: + Aff_transformationH2(); + + // Identity: + + Aff_transformationH2(const Identity_transformation); + + // Translation: + + Aff_transformationH2(const Translation, const VectorH2& v); + + // Scaling: + + Aff_transformationH2(const Scaling, const RT& a, const RT& b = RT(1) ); + + Aff_transformationH2(const Scaling, const RT& xa, const RT& xb, + const RT& ya, const RT& yb); + + // Reflection: + Aff_transformationH2(const Reflection, const LineH2& l); + + // Rational Rotation: + + Aff_transformationH2(const Rotation, + const RT& sine, + const RT& cosine, + const RT& denominator); + + Aff_transformationH2(const Rotation, + const DirectionH2& dir, + const RT& n, + const RT& d = RT(1) ); + + // Orthogonal Transformation: + + Aff_transformationH2(const VectorH2& v, + const RT& sine, + const RT& cosine, + const RT& denominator, + const RT& scaling_numerator = RT(1) , + const RT& scaling_denominator = RT(1) ); + + // General affine transformation + // | a b c | |x| + // | d e f | * |y| + // | 0 0 g | |w| + + Aff_transformationH2(const RT& a, const RT& b, const RT& c, + const RT& d, const RT& e, const RT& f, + const RT& g = RT(1) ); + + Aff_transformationH2(const RT& a, const RT& b, + const RT& d, const RT& e, + const RT& g = RT(1) ); + + Aff_transformationH2( Aff_transformation_rep_baseH2* _ptr); + + + ~Aff_transformationH2(); + + + PointH2 transform(const PointH2& p) const; + VectorH2 transform(const VectorH2& v) const; + DirectionH2 transform(const DirectionH2& d) const; +#ifndef CGAL_NO_LINE_TRANSFORM_IN_AT + LineH2 transform(const LineH2& l) const; +#endif // CGAL_NO_LINE_TRANSFORM_IN_AT + + Aff_transformationH2 + inverse() const; + bool is_even() const; + bool is_odd() const; + + // Access functions for matrix form + FT cartesian(int i, int j) const; + RT homogeneous(int i, int j) const; + FT m(int i, int j) const + { return cartesian(i,j); } + RT hm(int i, int j) const + { return homogeneous(i,j); } + + Aff_transformation_repH2 + general_form() const; + +// friend Aff_transformationH2 +// operator* CGAL_NULL_TMPL_ARGS +// (const Aff_transformationH2& left_argument, +// const Aff_transformationH2& right_argument ); + + Aff_transformationH2 + operator*(const Aff_transformationH2& right_argument ) const; + +}; + +template < class FT, class RT > +Aff_transformationH2::Aff_transformationH2() +{ ptr = new Aff_transformation_repH2(); } + +template < class FT, class RT > +Aff_transformationH2:: +Aff_transformationH2(const Identity_transformation) +{ ptr = new Identity_repH2(); } + +template < class FT, class RT > +Aff_transformationH2:: +Aff_transformationH2(const Translation,const VectorH2& v) +{ ptr = new Translation_repH2( v ); } + +template < class FT, class RT > +Aff_transformationH2:: +Aff_transformationH2(const Scaling, const RT& a, const RT& b) +{ ptr = new Scaling_repH2( a, b); } + +template < class FT, class RT > +Aff_transformationH2:: +Aff_transformationH2( const Scaling, const RT& xa, const RT& xb, + const RT& ya, const RT& yb) +{ + ptr = new Aff_transformation_repH2(xa*yb, RT(0), RT(0) , + RT(0), ya*xb, RT(0) , + xb*yb ); +} + +template < class FT, class RT > +Aff_transformationH2:: +Aff_transformationH2(const Reflection, const LineH2& l) +{ ptr = new Reflection_repH2( l); } + +template < class FT, class RT > +Aff_transformationH2:: +Aff_transformationH2(const Rotation, + const RT& sine, + const RT& cosine, + const RT& denominator) +{ ptr = new Rotation_repH2(sine, cosine, + denominator); } +template < class FT, class RT > +Aff_transformationH2::Aff_transformationH2(const Rotation, + const DirectionH2& dir, + const RT& n, + const RT& d) +{ + const RT RTzero = RT(0) ; + CGAL_kernel_precondition( n > RTzero ); + CGAL_kernel_precondition( d > RTzero ); + RT sin; + RT cos; + RT den; + + rational_rotation_approximation(dir.x(), dir.y(), sin, cos, den, n, d); + ptr = new Rotation_repH2( sin, cos, den ); +} + +template < class FT, class RT > +Aff_transformationH2::Aff_transformationH2(const VectorH2& v, + const RT& sine, + const RT& cosine, + const RT& denominator, + const RT& scaling_numerator, + const RT& scaling_denominator ) +{ + Aff_transformationH2 scaling(SCALING,scaling_numerator,scaling_denominator); + Aff_transformationH2 combination = + Aff_transformationH2(TRANSLATION, scaling.inverse().transform(-v) ) + * scaling + * Aff_transformationH2(ROTATION, sine, cosine, denominator) + * Aff_transformationH2(TRANSLATION, v ) ; + + *this = combination; + +} + +template < class FT, class RT > +Aff_transformationH2:: +Aff_transformationH2( const RT& a, const RT& b, const RT& c, + const RT& d, const RT& e, const RT& f, + const RT& g) +{ + ptr = new Aff_transformation_repH2( a, b, c, + d, e, f, + g ); +} + +template < class FT, class RT > +Aff_transformationH2:: +Aff_transformationH2( const RT& a, const RT& b, + const RT& d, const RT& e, + const RT& g) +{ + ptr = new Aff_transformation_repH2( a, b, RT(0), + d, e, RT(0), + g ); +} + +template < class FT, class RT > +Aff_transformationH2:: +Aff_transformationH2( Aff_transformation_rep_baseH2* _ptr ) +{ + ptr = _ptr; + ptr->add_reference(); +} + +template < class FT, class RT > +Aff_transformationH2::~Aff_transformationH2() +{} + +template < class FT, class RT > +PointH2 +Aff_transformationH2::transform(const PointH2& p) const +{ return ptr->transform(p); } + + +template < class FT, class RT > +VectorH2 +Aff_transformationH2::transform( const VectorH2& v) const +{ return ptr->transform(v); } + +template < class FT, class RT > +DirectionH2 +Aff_transformationH2::transform( const DirectionH2& d) const +{ return ptr->transform(d); } + +#ifndef CGAL_NO_LINE_TRANSFORM_IN_AT +template < class FT, class RT > +LineH2 +Aff_transformationH2::transform(const LineH2& l) const +{ return LineH2( transform( l.point(0)), transform( l.point(1)) ); } +#endif // CGAL_NO_LINE_TRANSFORM_IN_AT + +template < class FT, class RT > +Aff_transformationH2 +Aff_transformationH2:: +inverse() const +{ return ptr->inverse(); } + +template < class FT, class RT > +bool +Aff_transformationH2:: +is_even() const +{ return ptr->is_even(); } + +template < class FT, class RT > +bool +Aff_transformationH2:: +is_odd() const +{ return !( ptr->is_even() ); } + +template < class FT, class RT > +inline +FT +Aff_transformationH2:: +cartesian(int i, int j) const +{ return ptr->cartesian(i,j); } + +template < class FT, class RT > +inline +RT +Aff_transformationH2:: +homogeneous(int i, int j) const +{ return ptr->homogeneous(i,j); } + +template < class FT, class RT > +Aff_transformation_repH2 +Aff_transformationH2:: +general_form() const +{ return ptr->general_form(); } +template +Aff_transformationH2 +//operator*(const Aff_transformationH2& left_argument, +// const Aff_transformationH2& right_argument ) +Aff_transformationH2:: +operator*(const Aff_transformationH2& right_argument) const +{ + return _general_transformation_composition( + ptr->general_form(), + right_argument.ptr->general_form() ); +} + +template +Aff_transformationH2 +_general_transformation_composition( Aff_transformation_repH2 l, + Aff_transformation_repH2 r ) +{ +return Aff_transformationH2( + l.a*r.a + l.b*r.d, l.a*r.b + l.b*r.e, l.a*r.c + l.b*r.f + l.c*r.g, + l.d*r.a + l.e*r.d, l.d*r.b + l.e*r.e, l.d*r.c + l.e*r.f + l.f*r.g, + l.g*r.g ); +} + +template < class FT, class RT > +RT +Aff_transformation_repH2::homogeneous(int i, int j) const +{ + CGAL_kernel_precondition( (i >= 0) && (i <= 2) && (j >= 0) && (j <= 2) ); + switch (i) + { + case 0: switch (j) + { + case 0: return a; + case 1: return b; + case 2: return c; + } + case 1: switch (j) + { + case 0: return d; + case 1: return e; + case 2: return f; + } + case 2: switch (j) + { + case 0: return RT(0); + case 1: return RT(0); + case 2: return g; + } + } + return RT(0); +} + +template < class FT, class RT > +FT +Aff_transformation_repH2::cartesian(int i, int j) const +{ + CGAL_kernel_precondition( (i >= 0) && (i <= 2) && (j >= 0) && (j <= 2) ); + if ( (i == 2) && (j == 2) ) return FT(1); + return FT(homogeneous(i,j)) / FT(g); +} +template < class FT, class RT > +RT +Translation_repH2::homogeneous(int i, int j) const +{ + CGAL_kernel_precondition( (i >= 0) && (i <= 2) && (j >= 0) && (j <= 2) ); + switch (i) + { + case 0: switch (j) + { + case 0: return _tv.hw(); + case 1: return RT(0); + case 2: return _tv.hx(); + } + case 1: switch (j) + { + case 0: return RT(0); + case 1: return _tv.hw(); + case 2: return _tv.hy(); + } + case 2: switch (j) + { + case 0: return RT(0); + case 1: return RT(0); + case 2: return _tv.hw(); + } + } + return RT(0); +} + +template < class FT, class RT > +FT +Translation_repH2::cartesian(int i, int j) const +{ + CGAL_kernel_precondition( (i >= 0) && (i <= 2) && (j >= 0) && (j <= 2) ); + switch (i) + { + case 0: switch (j) + { + case 0: return FT(1); + case 1: return FT(0); + case 2: return _tv.x(); + } + case 1: switch (j) + { + case 0: return FT(0); + case 1: return FT(1); + case 2: return _tv.y(); + } + case 2: switch (j) + { + case 0: return FT(0); + case 1: return FT(0); + case 2: return FT(1); + } + } + return FT(0); +} + +template < class FT, class RT > +RT +Rotation_repH2:: +homogeneous(int i, int j) const +{ + CGAL_kernel_precondition( (i >= 0) && (i <= 2) && (j >= 0) && (j <= 2) ); + switch (i) + { + case 0: switch (j) + { + case 0: return _cos; + case 1: return - _sin; + case 2: return RT(0); + } + case 1: switch (j) + { + case 0: return _sin; + case 1: return _cos; + case 2: return RT(0); + } + case 2: switch (j) + { + case 0: return RT(0); + case 1: return RT(0); + case 2: return _den; + } + } + return RT(0); +} + +template < class FT, class RT > +FT +Rotation_repH2:: +cartesian(int i, int j) const +{ + CGAL_kernel_precondition( (i >= 0) && (i <= 2) && (j >= 0) && (j <= 2) ); + switch (i) + { + case 0: switch (j) + { + case 0: return FT(_cos) / FT(_den); + case 1: return - FT(_sin) / FT(_den); + case 2: return RT(0); + } + case 1: switch (j) + { + case 0: return FT(_sin) / FT(_den); + case 1: return FT(_cos) / FT(_den); + case 2: return FT(0); + } + case 2: switch (j) + { + case 0: return FT(0); + case 1: return FT(0); + case 2: return FT(1); + } + } + return FT(0); +} + +template < class FT, class RT > +RT +Scaling_repH2:: +homogeneous(int i, int j) const +{ + CGAL_kernel_precondition( (i >= 0) && (i <= 2) && (j >= 0) && (j <= 2) ); + switch (i) + { + case 0: switch (j) + { + case 0: return _sf_num; + case 1: return RT(0); + case 2: return RT(0); + } + case 1: switch (j) + { + case 0: return RT(0); + case 1: return _sf_num; + case 2: return RT(0); + } + case 2: switch (j) + { + case 0: return RT(0); + case 1: return RT(0); + case 2: return _sf_den; + } + } + return RT(0); +} + +template +FT +Scaling_repH2:: +cartesian(int i, int j) const +{ + CGAL_kernel_precondition( (i >= 0) && (i <= 2) && (j >= 0) && (j <= 2) ); + switch (i) + { + case 0: switch (j) + { + case 0: return FT(_sf_num) / FT(_sf_den); + case 1: return FT(0); + case 2: return FT(0); + } + case 1: switch (j) + { + case 0: return FT(0); + case 1: return FT(_sf_num) / FT(_sf_den); + case 2: return FT(0); + } + case 2: switch (j) + { + case 0: return FT(0); + case 1: return FT(0); + case 2: return FT(1); + } + } + return FT(0); +} +template < class FT, class RT > +RT +Reflection_repH2:: +homogeneous(int i, int j) const +{ + CGAL_kernel_precondition( (i >= 0) && (i <= 2) && (j >= 0) && (j <= 2) ); + RT mRT2 = -RT(2); + switch (i) + { + case 0: switch (j) + { + case 0: return l.b()*l.b() - l.a()*l.a(); + case 1: return l.a()*l.b()*mRT2; + case 2: return l.a()*l.c()*mRT2; + } + case 1: switch (j) + { + case 0: return l.a()*l.b()*mRT2; + case 1: return l.a()*l.a() - l.b()*l.b(); + case 2: return l.b()*l.c()*mRT2; + } + case 2: switch (j) + { + case 0: return RT(0); + case 1: return RT(0); + case 2: return l.a()*l.a() + l.b()*l.b(); + } + } + return RT(0); +} + +template +FT +Reflection_repH2:: +cartesian(int i, int j) const +{ + CGAL_kernel_precondition( (i >= 0) && (i <= 2) && (j >= 0) && (j <= 2) ); + FT de = FT( l.a()*l.a() + l.b()*l.b() ); + switch (i) + { + case 0: switch (j) + { + case 0: return FT( l.b()-l.a() ) / FT( l.a()+l.b()); + case 1: return FT( homogeneous(0,1)) / de; + case 2: return FT( homogeneous(0,2)) / de; + } + case 1: switch (j) + { + case 0: return FT( homogeneous(1,0)) / de; + case 1: return FT( l.a()-l.b() ) / FT( l.a()+l.b()); + case 2: return FT( homogeneous(1,2)) / de; + } + case 2: switch (j) + { + case 0: return FT(0); + case 1: return FT(0); + case 2: return FT(1); + } + } + return FT(0); +} + +CGAL_END_NAMESPACE + + +#endif // CGAL_AFF_TRANSFORMATIONH2_H diff --git a/Packages/H2/include/CGAL/CircleH2.h b/Packages/H2/include/CGAL/CircleH2.h new file mode 100644 index 00000000000..262531a52d5 --- /dev/null +++ b/Packages/H2/include/CGAL/CircleH2.h @@ -0,0 +1,449 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 11 +// +// source : CircleH2.fw +// file : CircleH2.h +// package : H2 (2.13) +// maintainer : Stefan Schirra +// revision : 2.13 +// revision_date : 11 Oct 2000 +// author(s) : Sven Schoenherr +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_CIRCLEH2_H +#define CGAL_CIRCLEH2_H + +#ifndef CGAL_ENUM_H +#include +#endif // CGAL_ENUM_H +#ifndef CGAL_POINTH2_H +#include +#endif // CGAL_POINTH2_H +#ifndef CGAL_PREDICATES_ON_POINTSH2_H +#include +#endif // CGAL_PREDICATES_ON_POINTSH2_H +#ifndef CGAL_DISTANCE_PREDICATESH2_H +#include +#endif // CGAL_DISTANCE_PREDICATESH2_H +#ifndef CGAL_BASIC_CONSTRUCTIONSH2_H +#include +#endif // CGAL_BASIC_CONSTRUCTIONSH2_H + +CGAL_BEGIN_NAMESPACE + +template +class Circle_repH2 : public Ref_counted +{ +public: + +friend class CircleH2; + + Circle_repH2(); + Circle_repH2(const PointH2 p, + const FT sq_rad, + const Orientation& o); + ~Circle_repH2(); + +protected: + PointH2 center; + FT squared_radius; + Orientation orientation_; +}; + +template +CGAL_KERNEL_CTOR_INLINE +Circle_repH2::Circle_repH2() +{} + +template +CGAL_KERNEL_CTOR_INLINE +Circle_repH2::Circle_repH2( const PointH2 p, + const FT sq_rad, + const Orientation& o) + : center(p), squared_radius(sq_rad), orientation_(o) +{} + +template +inline +Circle_repH2::~Circle_repH2() +{} + +template +class CircleH2 : public Handle_for< Circle_repH2 > +{ +public: + CircleH2(); + CircleH2(const PointH2& p, + const PointH2& q, + const PointH2& r); + CircleH2(const PointH2& p, + const PointH2& q, + const Orientation& o); + CircleH2(const PointH2& cp, + const FT& squared_radius, + const Orientation& o); + + Bbox_2 + bbox() const; + + CircleH2 + orthogonal_transform(const Aff_transformationH2&) const; + + PointH2 + center() const; + + Orientation + orientation() const; + + FT + squared_radius() const; + + CircleH2 + opposite() const; + + Oriented_side + oriented_side(const PointH2& ) const; + + Bounded_side + bounded_side(const PointH2& ) const; + + bool operator==( const CircleH2& ) const; + bool operator!=( const CircleH2& ) const; + bool has_on_positive_side(const PointH2& ) const; + bool has_on_negative_side(const PointH2& ) const; + bool has_on_boundary( const PointH2& ) const; + bool has_on_bounded_side( const PointH2& ) const; + bool has_on_unbounded_side(const PointH2&) const; + bool is_degenerate() const; + + // bool oriented_equal( const CircleH2& ) const; + // bool unoriented_equal( const CircleH2& ) const; +}; + + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +CircleH2::CircleH2() + : Handle_for< Circle_repH2 >( Circle_repH2() ) +{} + + +template < class FT, class RT > +CGAL_KERNEL_CTOR_MEDIUM_INLINE +CircleH2::CircleH2(const PointH2& p, + const PointH2& q, + const PointH2& r) +{ + Orientation o = CGAL::orientation( p, q, r); + CGAL_precondition( o != COLLINEAR); + + PointH2 cp = circumcenter( p, q, r); + FT sq_r = squared_distance( p, cp); + + initialize_with( Circle_repH2( cp, sq_r, o)); +} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_MEDIUM_INLINE +CircleH2::CircleH2(const PointH2& p, + const PointH2& q, + const Orientation& o) +{ + CGAL_precondition( o!= COLLINEAR); + + if ( p != q) + { + PointH2 cp = midpoint( p, q); + FT sq_r = squared_distance( cp, p); + initialize_with( Circle_repH2( cp, sq_r, o)); + } + else + { + initialize_with( Circle_repH2( p, FT( 0), o)); + } +} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +CircleH2::CircleH2(const PointH2& cp, + const FT& squared_radius, + const Orientation& o) +{ + CGAL_precondition( ( ! CGAL_NTS is_negative( squared_radius)) && + ( o != COLLINEAR ) ); + initialize_with( Circle_repH2( cp, squared_radius, o )); +} +template +inline +PointH2 +CircleH2::center() const +{ return ptr->center; } + +template +inline +FT +CircleH2::squared_radius() const +{ return ptr->squared_radius; } + +template +CGAL_KERNEL_INLINE +CircleH2 +CircleH2::opposite() const +{ + return CircleH2( center(), + squared_radius(), + CGAL::opposite( orientation() ) ); +} + +template +inline +Orientation +CircleH2::orientation() const +{ return ptr->orientation_; } +template +CGAL_KERNEL_INLINE +Oriented_side +CircleH2::oriented_side( const PointH2& p) const +{ + FT sq_dist = squared_distance( p, center() ); + FT sq_rad = squared_radius(); + Comparison_result vgl = CGAL_NTS compare( sq_dist, sq_rad ); + Oriented_side rel_pos = (vgl == LARGER ) ? + ON_NEGATIVE_SIDE : + ( (vgl == SMALLER ) ? + ON_POSITIVE_SIDE : + ON_ORIENTED_BOUNDARY); + if (ptr->orientation_ == POSITIVE) + { return rel_pos; } + else // NEGATIVE + { return CGAL::opposite( rel_pos ); } +} + +template +CGAL_KERNEL_INLINE +bool +CircleH2::has_on_positive_side( const PointH2& p) const +{ + if ( orientation() == POSITIVE ) + { return (has_on_bounded_side(p) ); } + else + { return (has_on_unbounded_side(p) ); } +} + +template +CGAL_KERNEL_INLINE +bool +CircleH2::has_on_boundary(const PointH2& p) const +{ + FT sq_dist = squared_distance( p, center() ); + FT sq_rad = squared_radius(); + return ( sq_dist == sq_rad ); +} + +template +CGAL_KERNEL_INLINE +bool +CircleH2::has_on_negative_side( const PointH2& p) const +{ + if ( orientation() == NEGATIVE ) + { + return (has_on_bounded_side(p) ); + } + else + { + return (has_on_unbounded_side(p) ); + } +} + +template +CGAL_KERNEL_INLINE +Bounded_side +CircleH2::bounded_side(const PointH2& p) const +{ + FT sq_dist = squared_distance( p, center() ); + FT sq_rad = squared_radius(); + Comparison_result vgl = CGAL_NTS compare( sq_dist, sq_rad ); + return (vgl == LARGER ) ? ON_UNBOUNDED_SIDE : + ( (vgl == SMALLER ) ? + ON_BOUNDED_SIDE : + ON_BOUNDARY); +} + +template +CGAL_KERNEL_INLINE +bool +CircleH2::has_on_bounded_side(const PointH2& p) const +{ + FT sq_dist = squared_distance( p, center() ); + FT sq_rad = squared_radius(); + return ( sq_dist < sq_rad ); +} + +template +CGAL_KERNEL_INLINE +bool +CircleH2::has_on_unbounded_side(const PointH2& p) const +{ + FT sq_dist = squared_distance( p, center() ); + FT sq_rad = squared_radius(); + return ( sq_rad < sq_dist ); +} + +template +inline +bool +CircleH2::is_degenerate() const +{ return ( squared_radius() == FT(0) ); } +template +CGAL_KERNEL_MEDIUM_INLINE +Bbox_2 +CircleH2::bbox() const +{ +#ifndef CGAL_CFG_NO_NAMESPACE + using std::swap; +#endif // CGAL_CFG_NO_NAMESPACE + + double eps = double(1.0) /(double(1<<26) * double(1<<26)); + double hxd = CGAL::to_double( center().hx() ); + double hyd = CGAL::to_double( center().hy() ); + double hwd = CGAL::to_double( center().hw() ); + double xmin = ( hxd - eps*hxd ) / ( hwd + eps*hwd ); + double xmax = ( hxd + eps*hxd ) / ( hwd - eps*hwd ); + double ymin = ( hyd - eps*hyd ) / ( hwd + eps*hwd ); + double ymax = ( hyd + eps*hyd ) / ( hwd - eps*hwd ); + if ( center().hx() < RT(0) ) + { + swap(xmin, xmax); + } + if ( center().hy() < RT(0) ) + { + swap(ymin, ymax); + } + double sqradd = CGAL::to_double( squared_radius() ); + sqradd += sqradd*eps; + sqradd = sqrt(sqradd); + sqradd += sqradd*eps; + xmin -= sqradd; + xmax += sqradd; + xmin -= xmin*eps; + xmax += xmax*eps; + ymin -= sqradd; + ymax += sqradd; + ymin -= ymin*eps; + ymax += ymax*eps; + return Bbox_2(xmin, ymin, xmax, ymax); +} +template +CGAL_KERNEL_INLINE +CircleH2 +CircleH2:: +orthogonal_transform(const Aff_transformationH2& t) const +{ + VectorH2 vec( RT(1), RT(0) ); // unit vector + vec = vec.transform(t); // transformed + FT sq_scale = FT( vec*vec ); // squared scaling factor + + if ( t.is_even() ) + { + return CircleH2(t.transform(center() ), + sq_scale * squared_radius(), + orientation() ); + } + else + { + return CircleH2(t.transform(center() ), + sq_scale * squared_radius(), + CGAL::opposite( orientation()) ); + } +} +template +CGAL_KERNEL_INLINE +bool +CircleH2::operator==(const CircleH2& c) const +{ + return ( center() == c.center() ) + &&( squared_radius() == c.squared_radius() ) + &&( orientation() == c.orientation() ); +} + +template +inline +bool +CircleH2::operator!=(const CircleH2& c) const +{ return !(*this == c); } + +#ifndef NO_OSTREAM_INSERT_CIRCLEH2 +template < class FT, class RT > +std::ostream &operator<<(std::ostream &os, const CircleH2 &c) +{ + switch(os.iword(IO::mode)) + { + case IO::ASCII : + os << c.center() << ' ' << c.squared_radius() << ' ' + << (int)c.orientation(); + break; + case IO::BINARY : + os << c.center(); + write(os, c.squared_radius()); + write(os, (int)c.orientation()); + break; + default: + os << "CircleH2(" << c.center() << ", " << c.squared_radius() ; + if (c.orientation() == CLOCKWISE) { + os << ", clockwise)"; + } else if (c.orientation() == COUNTERCLOCKWISE) { + os << ", counterclockwise)"; + } else { + os << ", collinear)"; + } + break; + } + return os; +} +#endif // NO_OSTREAM_INSERT_CIRCLEH2 + +#ifndef NO_ISTREAM_EXTRACT_CIRCLEH2 +template < class FT, class RT > +std::istream& operator>>(std::istream &is, CircleH2 &c) +{ + PointH2 center; + FT squared_radius; + int o; + switch(is.iword(IO::mode)) + { + case IO::ASCII : + is >> center >> squared_radius >> o; + break; + case IO::BINARY : + is >> center; + read(is, squared_radius); + is >> o; + break; + default: + std::cerr << "" << std::endl; + std::cerr << "Stream must be in ascii or binary mode" << std::endl; + break; + } + c = CircleH2(center, squared_radius, (Orientation)o); + return is; +} +#endif // NO_ISTREAM_EXTRACT_CIRCLEH2 + +CGAL_END_NAMESPACE + + +#endif // CGAL_CIRCLEH2_H diff --git a/Packages/H2/include/CGAL/DirectionH2.h b/Packages/H2/include/CGAL/DirectionH2.h new file mode 100644 index 00000000000..c7075bb8411 --- /dev/null +++ b/Packages/H2/include/CGAL/DirectionH2.h @@ -0,0 +1,29 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 11 +// +// source : PointVectorDirectionH2.fw +// file : DirectionH2.h +// package : H2 (2.13) +// maintainer : Stefan Schirra +// revision : 2.13 +// revision_date : 11 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef PVDH2_H +#include +#endif // PVDH2_H diff --git a/Packages/H2/include/CGAL/Iso_rectangleH2.h b/Packages/H2/include/CGAL/Iso_rectangleH2.h new file mode 100644 index 00000000000..4f6ea7c0297 --- /dev/null +++ b/Packages/H2/include/CGAL/Iso_rectangleH2.h @@ -0,0 +1,300 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 11 +// +// source : Iso_rectangleH2.fw +// file : Iso_rectangleH2.h +// package : H2 (2.13) +// maintainer : Stefan Schirra +// revision : 2.13 +// revision_date : 11 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_ISO_RECTANGLEH2_H +#define CGAL_ISO_RECTANGLEH2_H + +#ifndef TWOTUPLE_H +#include +#endif // TWOTUPLE_H +#ifndef CGAL_POINTH2_H +#include +#endif // CGAL_POINTH2_H +#ifndef CGAL_PREDICATES_ON_POINTSH2_H +#include +#endif // CGAL_PREDICATES_ON_POINTSH2_H + +CGAL_BEGIN_NAMESPACE + +template +class Iso_rectangleH2 : public Handle_for< Twotuple< PointH2 > > +{ +public: + Iso_rectangleH2(); + Iso_rectangleH2(const PointH2& p, + const PointH2& q); + + bool operator==(const Iso_rectangleH2& s) const; + bool operator!=(const Iso_rectangleH2& s) const; + + PointH2 min() const; + PointH2 max() const; + PointH2 vertex(int i) const; + PointH2 operator[](int i) const; + + Iso_rectangleH2 + transform(const Aff_transformationH2& t) const; + + Bounded_side + bounded_side(const PointH2& p) const; + bool has_on(const PointH2& p) const; + bool has_on_boundary(const PointH2& p) const; + bool has_on_bounded_side(const PointH2& p) const; + bool has_on_unbounded_side(const PointH2& p) const; + bool is_degenerate() const; + + Bbox_2 + bbox() const; + + FT xmin() const; + FT ymin() const; + FT xmax() const; + FT ymax() const; + + +}; + + + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +Iso_rectangleH2::Iso_rectangleH2() + : Handle_for< Twotuple< PointH2 > >( Twotuple< PointH2 >() ) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_MEDIUM_INLINE +Iso_rectangleH2::Iso_rectangleH2(const PointH2& p, + const PointH2& q) +{ + bool px_g_qx = ( p.hx()*q.hw() > q.hx()*p.hw() ); + bool py_g_qy = ( p.hy()*q.hw() > q.hy()*p.hw() ); + if ( px_g_qx || py_g_qy) + { + if ( px_g_qx && py_g_qy ) + { + initialize_with( Twotuple >(q,p) ); + } + else + { + if ( px_g_qx ) + { + initialize_with( Twotuple >( + PointH2(q.hx()*p.hw(), p.hy()*q.hw(), q.hw()*p.hw() ), + PointH2(p.hx()*q.hw(), q.hy()*p.hw(), q.hw()*p.hw() )) ); + } + if ( py_g_qy ) + { + initialize_with( Twotuple >( + PointH2(p.hx()*q.hw(), q.hy()*p.hw(), q.hw()*p.hw() ), + PointH2(q.hx()*p.hw(), p.hy()*q.hw(), q.hw()*p.hw() )) ); + } + } + } + else + { + initialize_with( Twotuple< PointH2 >(p,q) ); + } +} + +template < class FT, class RT > +inline +bool +Iso_rectangleH2::operator==(const Iso_rectangleH2& r) const +{ return vertex(0) == r.vertex(0) && vertex(2) == r.vertex(2); } + +template < class FT, class RT > +inline +bool +Iso_rectangleH2::operator!=(const Iso_rectangleH2& r) const +{ return !(*this == r); } +template < class FT, class RT > +inline +PointH2 +Iso_rectangleH2::min() const +{ return ptr->e0; } + +template < class FT, class RT > +inline +PointH2 +Iso_rectangleH2::max() const +{ return ptr->e1; } + +template < class FT, class RT > +inline +FT +Iso_rectangleH2::xmin() const +{ return FT( min().hx() ) / FT( min().hw() ); } + +template < class FT, class RT > +inline +FT +Iso_rectangleH2::ymin() const +{ return FT( min().hy() ) / FT( min().hw() ); } + +template < class FT, class RT > +inline +FT +Iso_rectangleH2::xmax() const +{ return FT( max().hx() ) / FT( max().hw() ); } + +template < class FT, class RT > +inline +FT +Iso_rectangleH2::ymax() const +{ return FT( max().hy() ) / FT( max().hw() ); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +PointH2 +Iso_rectangleH2::vertex(int i) const +{ + switch (i%4) + { + case 0: + return min(); + case 1: + return PointH2( max().hx()*min().hw(), + min().hy()*max().hw(), + min().hw()*max().hw() ); + case 2: + return max(); + case 3: + return PointH2( min().hx()*max().hw(), + max().hy()*min().hw(), + min().hw()*max().hw() ); + } + return PointH2(); +} + +template < class FT, class RT > +inline +PointH2 +Iso_rectangleH2::operator[](int i) const +{ return vertex(i); } +template < class FT, class RT > +CGAL_KERNEL_INLINE +Bounded_side +Iso_rectangleH2::bounded_side(const PointH2& p) const +{ + Oriented_side wrt_min = _where_wrt_L_wedge(min(),p); + Oriented_side wrt_max = _where_wrt_L_wedge(p,max()); + if (( wrt_min == ON_NEGATIVE_SIDE )||( wrt_max == ON_NEGATIVE_SIDE)) + { + return ON_UNBOUNDED_SIDE; + } + if ( ( wrt_min == ON_ORIENTED_BOUNDARY ) + ||( wrt_max == ON_ORIENTED_BOUNDARY ) ) + { + return ON_BOUNDARY; + } + return ON_BOUNDED_SIDE; +} + +template < class FT, class RT > +inline +bool +Iso_rectangleH2::has_on_boundary(const PointH2& p) const +{ return ( bounded_side(p) == ON_BOUNDARY ); } + +template < class FT, class RT > +inline +bool +Iso_rectangleH2::has_on(const PointH2& p) const +{ return ( bounded_side(p) == ON_BOUNDARY ); } + +template < class FT, class RT > +inline +bool +Iso_rectangleH2:: +has_on_bounded_side(const PointH2& p) const +{ return ( bounded_side(p) == ON_BOUNDED_SIDE ); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +Iso_rectangleH2:: +has_on_unbounded_side(const PointH2& p) const +{ + return ( (_where_wrt_L_wedge(min(),p) == ON_NEGATIVE_SIDE) + ||(_where_wrt_L_wedge(p,max()) == ON_NEGATIVE_SIDE) ); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +Iso_rectangleH2::is_degenerate() const +{ + return ( ( min().hx()*max().hw() == max().hx()*min().hw() ) + || ( min().hy()*max().hw() == max().hy()*min().hw() ) ); +} +template < class FT, class RT > +inline +Bbox_2 +Iso_rectangleH2::bbox() const +{ return min().bbox() + max().bbox(); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +Iso_rectangleH2 +Iso_rectangleH2:: +transform(const Aff_transformationH2&t) const +{ + return Iso_rectangleH2(t.transform(min() ), + t.transform(max() ) ); +} + +#ifndef NO_OSTREAM_INSERT_ISO_RECTANGLEH2 +template < class FT, class RT > +std::ostream& operator<<(std::ostream& os, const Iso_rectangleH2& r) +{ + switch(os.iword(IO::mode)) + { + case IO::ASCII : + return os << r[0] << ' ' << r[2]; + case IO::BINARY : + return os << r[0] << r[2]; + default: + return os << "Iso_rectangleH2(" << r[0] << ", " << r[2] << ")"; + } +} +#endif // NO_OSTREAM_INSERT_ISO_RECTANGLEH2 + +#ifndef NO_ISTREAM_EXTRACT_ISO_RECTANGLEH2 +template < class FT, class RT > +std::istream& operator>>(std::istream& is, Iso_rectangleH2& r) +{ + PointH2 p, q; + is >> p >> q; + r = Iso_rectangleH2(p, q); + return is; +} +#endif // NO_ISTREAM_EXTRACT_ISO_RECTANGLEH2 + +CGAL_END_NAMESPACE + + +#endif // CGAL_ISO_RECTANGLEH2_H diff --git a/Packages/H2/include/CGAL/LineH2.h b/Packages/H2/include/CGAL/LineH2.h new file mode 100644 index 00000000000..982b95f9c2a --- /dev/null +++ b/Packages/H2/include/CGAL/LineH2.h @@ -0,0 +1,407 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 11 +// +// source : LineH2.fw +// file : LineH2.h +// package : H2 (2.13) +// maintainer : Stefan Schirra +// revision : 2.13 +// revision_date : 11 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_LINEH2_H +#define CGAL_LINEH2_H + +#ifndef CGAL_POINTH2_H +#include +#endif // CGAL_POINTH2_H + +CGAL_BEGIN_NAMESPACE + +template < class FT, class RT > +class LineH2 : public Handle_for< Threetuple< RT> > +{ +public: + LineH2(); + LineH2(const PointH2& p, const PointH2& q); + LineH2(const RT& a, const RT& b, const RT& c); + LineH2(const SegmentH2& s); + LineH2(const RayH2& r); + LineH2(const PointH2& p, + const DirectionH2& d); + + bool operator==(const LineH2& l) const ; + bool operator!=(const LineH2& l) const ; + + RT a() const; + RT b() const; + RT c() const; + const RT& a_ref() const { return ptr->e0; } + const RT& b_ref() const { return ptr->e1; } + const RT& c_ref() const { return ptr->e2; } + + FT x_at_y(FT y) const; + FT y_at_x(FT x) const; + + LineH2 perpendicular(const PointH2& p ) const; + LineH2 opposite() const; + PointH2 point() const; + PointH2 point(int i) const; + PointH2 projection(const PointH2& p) const; + DirectionH2 + direction() const; + Oriented_side oriented_side( const PointH2& p ) const; + bool has_on( const PointH2& p ) const; + bool has_on_boundary( const PointH2& p ) const; + bool has_on_positive_side( const PointH2& p ) const; + bool has_on_negative_side( const PointH2& p ) const; + bool is_horizontal() const; + bool is_vertical() const; + bool is_degenerate() const; + + LineH2 transform(const Aff_transformationH2&) const; + +}; + + + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +LineH2::LineH2() + : Handle_for< Threetuple >( Threetuple() ) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_MEDIUM_INLINE +LineH2::LineH2(const PointH2& p, + const PointH2& q) + : Handle_for< Threetuple >( Threetuple( + // a() * X + b() * Y + c() * W() == 0 + // | X Y W | + // | p.hx() p.hy() p.hw() | + // | q.hx() q.hy() q.hw() | + + p.hy()*q.hw() - p.hw()*q.hy(), + p.hw()*q.hx() - p.hx()*q.hw(), + p.hx()*q.hy() - p.hy()*q.hx() )) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +LineH2::LineH2(const RT& a, const RT& b, const RT& c) + : Handle_for< Threetuple >( Threetuple(a,b,c) ) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +LineH2::LineH2(const SegmentH2& s) +{ + PointH2 p = s.start(); + PointH2 q = s.end(); + initialize_with( Threetuple ( + p.hy()*q.hw() - p.hw()*q.hy(), + p.hw()*q.hx() - p.hx()*q.hw(), + p.hx()*q.hy() - p.hy()*q.hx() ) ); +} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +LineH2::LineH2(const RayH2& r) +{ + PointH2 p = r.start(); + PointH2 q = r.second_point(); + initialize_with( Threetuple ( + p.hy()*q.hw() - p.hw()*q.hy(), + p.hw()*q.hx() - p.hx()*q.hw(), + p.hx()*q.hy() - p.hy()*q.hx() ) ); +} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +LineH2::LineH2(const PointH2& p, + const DirectionH2& d) +{ + PointH2 q = p + VectorH2(d); + initialize_with( Threetuple ( + p.hy()*q.hw() - p.hw()*q.hy(), + p.hw()*q.hx() - p.hx()*q.hw(), + p.hx()*q.hy() - p.hy()*q.hx() ) ); +} + +template < class FT, class RT > +inline +RT +LineH2::a() const +{ return ptr->e0; } + +template < class FT, class RT > +inline +RT +LineH2::b() const +{ return ptr->e1; } + +template < class FT, class RT > +inline +RT +LineH2::c() const +{ return ptr->e2; } + + +template < class FT, class RT > +CGAL_KERNEL_INLINE +FT +LineH2::x_at_y(FT y) const +{ + CGAL_kernel_precondition( !is_degenerate() ); + return (FT(-b())*y - FT(c()) )/FT(a()); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +FT +LineH2::y_at_x(FT x) const +{ + CGAL_kernel_precondition( !is_degenerate() ); + return (FT(-a())*x - FT(c()) )/FT(b()); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +LineH2 +LineH2::perpendicular(const PointH2& p ) const +{ + CGAL_kernel_precondition( !is_degenerate() ); + return LineH2( -b()*p.hw(), a()*p.hw(), b()*p.hx() - a()*p.hy() ); +} + +template < class FT, class RT > +inline +LineH2 +LineH2::opposite() const +{ return LineH2( -a(), -b(), -c() ); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +PointH2 +LineH2::point() const +{ + CGAL_kernel_precondition( !is_degenerate() ); + if (is_vertical() ) + { + return PointH2(-c(), RT(0) , a() ); + } + else + { + return PointH2(RT(0) , -c(), b() ); + } +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +PointH2 +LineH2::point(int i) const +{ return point() + RT(i) * (direction().to_vector()); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +PointH2 +LineH2::projection(const PointH2& p) const +{ + CGAL_kernel_precondition( !is_degenerate() ); + LineH2 l( p, DirectionH2( a(), b() )); + return PointH2( b()*l.c() - l.b()*c(), + l.a()*c() - a()*l.c(), + a()*l.b() - l.a()*b() ); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +DirectionH2 +LineH2::direction() const +{ + CGAL_kernel_precondition( !is_degenerate() ); + return DirectionH2( b(), -a() ); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +LineH2 +LineH2::transform(const Aff_transformationH2& t) const +{ + CGAL_kernel_precondition( !is_degenerate() ); + PointH2 p = point() + direction().to_vector(); + return LineH2( t.transform(point() ), t.transform(p) ); +} + +#ifndef NO_OSTREAM_INSERT_LINEH2 +template < class FT, class RT > +std::ostream & +operator<<(std::ostream &os, const LineH2 &l) +{ + switch(os.iword(IO::mode)) + { + case IO::ASCII : + return os << l.a() << ' ' << l.b() << ' ' << l.c(); + case IO::BINARY : + write(os, l.a()); + write(os, l.b()); + write(os, l.c()); + return os; + default: + return os << "LineH2(" << l.a() << ", " << l.b() << ", " << l.c() <<')'; + } +} +#endif // NO_OSTREAM_INSERT_LINEH2 + +#ifndef NO_ISTREAM_EXTRACT_LINEH2 +template < class FT, class RT > +std::istream & +operator>>(std::istream &is, LineH2 &p) +{ + RT a, b, c; + switch(is.iword(IO::mode)) + { + case IO::ASCII : + is >> a >> b >> c; + break; + case IO::BINARY : + read(is, a); + read(is, b); + read(is, c); + break; + default: + std::cerr << "" << std::endl; + std::cerr << "Stream must be in ascii or binary mode" << std::endl; + break; + } + p = LineH2(a, b, c); + return is; +} +#endif // NO_ISTREAM_EXTRACT_LINEH2 +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +LineH2::has_on( const PointH2& p ) const +{ + CGAL_kernel_precondition( !is_degenerate() ); + return ( ( a()*p.hx() + b()*p.hy() + c()*p.hw() ) == RT(0) ); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +LineH2::has_on_boundary( const PointH2& p ) const +{ + CGAL_kernel_precondition( !is_degenerate() ); + return ( ( a()*p.hx() + b()*p.hy() + c()*p.hw() ) == RT(0) ); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +LineH2::has_on_positive_side( const PointH2& p ) const +{ + CGAL_kernel_precondition( !is_degenerate() ); + return ( ( a()*p.hx() + b()*p.hy() + c()*p.hw() ) > RT(0) ); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +LineH2::has_on_negative_side( const PointH2& p ) const +{ + CGAL_kernel_precondition( !is_degenerate() ); + return ( ( a()*p.hx() + b()*p.hy() + c()*p.hw() ) < RT(0) ); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +Oriented_side +LineH2::oriented_side( const PointH2& p ) const +{ + CGAL_kernel_precondition( !is_degenerate() ); + RT v = a()*p.hx() + b()*p.hy() + c()*p.hw(); + if (v > RT(0) ) + { + return ON_POSITIVE_SIDE; + } + else + { + return (v < RT(0) ) ? ON_NEGATIVE_SIDE : ON_ORIENTED_BOUNDARY; + } +} + +template < class FT, class RT > +inline +bool +LineH2::is_horizontal() const +{ return ( a() == RT(0) ); } + +template < class FT, class RT > +inline +bool +LineH2::is_vertical() const +{ return ( b() == RT(0) ); } + +template < class FT, class RT > +inline +bool +LineH2::is_degenerate() const +{ return (a() == RT(0) )&&(b() == RT(0) ) ; } +template < class FT, class RT > +CGAL_KERNEL_MEDIUM_INLINE +bool +LineH2::operator==(const LineH2& l) const +{ + if ( (a() * l.c() != l.a() * c() ) + ||(b() * l.c() != l.b() * c() ) ) + { + return false; + } + int sc = (int)CGAL_NTS sign(c() ); + int slc = (int)CGAL_NTS sign(l.c() ); + if ( sc == slc ) + { + if (sc == 0) + { + return ( (a()*l.b() == b()*l.a() ) + &&(CGAL_NTS sign(a() )== CGAL_NTS sign( l.a() )) + &&(CGAL_NTS sign(b() )== CGAL_NTS sign( l.b() )) ); + } + else + { + return true; + } + } + else + { + return false; + } +} + +template < class FT, class RT > +inline +bool +LineH2::operator!=(const LineH2& l) const +{ return !(*this == l); } + + +CGAL_END_NAMESPACE + + +#endif // CGAL_LINEH2_H diff --git a/Packages/H2/include/CGAL/PVDH2.h b/Packages/H2/include/CGAL/PVDH2.h new file mode 100644 index 00000000000..0ca994000bf --- /dev/null +++ b/Packages/H2/include/CGAL/PVDH2.h @@ -0,0 +1,1062 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 11 +// +// source : PointVectorDirectionH2.fw +// file : PVDH2.h +// package : H2 (2.13) +// maintainer : Stefan Schirra +// revision : 2.13 +// revision_date : 11 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_PVDH2 +#define CGAL_PVDH2 + +#define CGAL_POINTH2_H +#define CGAL_VECTORH2_H +#define CGAL_DIRECTIONH2_H + +#include +#include +#include + +#include + +CGAL_BEGIN_NAMESPACE + +template < class FT, class RT > +class PointH2 : public Handle_for< Threetuple > +{ + +public: + PointH2(); + PointH2(const Origin & o); + PointH2(const PointH2 & p); + PointH2(const RT& hx, const RT& hy ); + PointH2(const RT& hx, const RT& hy, const RT& hw ); + ~PointH2(); + + bool operator==( const PointH2& p) const; + bool operator!=( const PointH2& p) const; + + FT x() const; + FT y() const; + + RT hx() const; + RT hy() const; + RT hw() const; + + FT cartesian(int i) const; + FT operator[](int i) const; + RT homogeneous(int i) const; + + // and for efficiency in the predicates: + const RT& hx_ref() const; + const RT& hy_ref() const; + const RT& hw_ref() const; + + int dimension() const; + Bbox_2 bbox() const; + + PointH2 transform( const Aff_transformationH2 & t) const; + DirectionH2 + direction() const; + + PointH2(const VectorH2& v); + friend CGAL_FRIEND_INLINE + PointH2 + CGAL_SCOPE origin_plus_vector CGAL_NULL_TMPL_ARGS ( const VectorH2 & v); + friend CGAL_FRIEND_INLINE + PointH2 + CGAL_SCOPE origin_minus_vector CGAL_NULL_TMPL_ARGS (const VectorH2 & v); +}; + +template < class FT, class RT > +class VectorH2 : public Handle_for > +{ +public: + VectorH2(); + VectorH2(const VectorH2& v); + VectorH2(const Null_vector &); + VectorH2(const RT& x, const RT& y); + VectorH2(const RT& x, const RT& y, const RT& w ); + ~VectorH2(); + + bool operator==( const VectorH2& v) const; + bool operator!=( const VectorH2& v) const; + bool operator==( const Null_vector&) const; + bool operator!=( const Null_vector& v) const; + + FT x() const; + FT y() const; + RT hx() const; + RT hy() const; + RT hw() const; + FT cartesian(int i) const; + RT homogeneous(int i) const; + FT operator[](int i) const; + + int dimension() const; + DirectionH2 + direction() const; + VectorH2 + transform(const Aff_transformationH2& t ) const; + VectorH2 + perpendicular(const Orientation& o ) const; + + VectorH2 + operator-() const; + + VectorH2 + opposite() const; + +// undocumented: + VectorH2(const DirectionH2 & dir); +protected: + VectorH2(const PointH2 & p); +// friends: + +friend CGAL_FRIEND_INLINE + VectorH2 + CGAL_SCOPE point_minus_origin CGAL_NULL_TMPL_ARGS ( const PointH2& p); +friend CGAL_FRIEND_INLINE + VectorH2 + CGAL_SCOPE origin_minus_point CGAL_NULL_TMPL_ARGS ( const PointH2& p); +/* +friend CGAL_FRIEND_INLINE + PointH2 + origin_minus_vector CGAL_NULL_TMPL_ARGS ( const VectorH2& v); + +friend CGAL_FRIEND_INLINE + PointH2 + operator+ CGAL_NULL_TMPL_ARGS ( const Origin &, + const VectorH2& v ); +friend CGAL_KERNEL_FRIEND_INLINE + VectorH2 + operator- CGAL_NULL_TMPL_ARGS ( const VectorH2& v1, + const VectorH2& v2 ); +*/ + +friend CGAL_KERNEL_FRIEND_INLINE + VectorH2 + operator+ CGAL_NULL_TMPL_ARGS ( const VectorH2&, + const VectorH2& ); +friend CGAL_KERNEL_FRIEND_INLINE + FT + operator* CGAL_NULL_TMPL_ARGS ( const VectorH2&, + const VectorH2& ); +friend CGAL_KERNEL_FRIEND_INLINE + VectorH2 + operator* CGAL_NULL_TMPL_ARGS ( const VectorH2&, + const RT& ); +friend CGAL_KERNEL_FRIEND_INLINE + VectorH2 + operator* CGAL_NULL_TMPL_ARGS ( const RT&, + const VectorH2& ); +friend CGAL_KERNEL_FRIEND_INLINE + VectorH2 + operator/ CGAL_NULL_TMPL_ARGS ( const VectorH2&, + const RT& ); +}; + +template < class FT, class RT > +class DirectionH2 : public Handle_for > +{ +public: + DirectionH2(); + DirectionH2(const DirectionH2& d ); + DirectionH2(const PointH2 & p ); + DirectionH2(const VectorH2 & v ); + DirectionH2(const RT& x, const RT& y); + DirectionH2(const RT& x, const RT& y, const RT& w ); + ~DirectionH2(); + + bool operator==( const DirectionH2& d) const; + bool operator!=( const DirectionH2& d) const; + bool operator< ( const DirectionH2& d) const; + bool operator<=( const DirectionH2& d) const; + bool operator> ( const DirectionH2& d) const; + bool operator>=( const DirectionH2& d) const; + bool counterclockwise_in_between( const DirectionH2& d1, + const DirectionH2& d2 ) const; + + DirectionH2 + operator-() const; + + + VectorH2 to_vector() const; + // VectorH2 vector() const; + + RT x() const; + RT y() const; + + RT delta(int i) const; + RT dx() const; + RT dy() const; + + DirectionH2 + perpendicular(const Orientation &o) const; + DirectionH2 + transform(const Aff_transformationH2 &) const ; + +}; + + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +PointH2::PointH2() + : Handle_for< Threetuple >( Threetuple()) {} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +PointH2::PointH2(const Origin&) + : Handle_for< Threetuple >( Threetuple( RT(0), RT(0), RT(1))) {} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +PointH2::PointH2(const PointH2& p) + : Handle_for >(p) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +PointH2::PointH2(const RT& hx, const RT& hy) + : Handle_for< Threetuple >( Threetuple( hx, hy, RT(1) )) {} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +PointH2::PointH2(const RT& hx, const RT& hy, const RT& hw) +{ + if ( hw >= RT(0) ) + { initialize_with( Threetuple( hx, hy, hw)); } + else + { initialize_with( Threetuple(-hx,-hy,-hw)); } +} + +template < class FT, class RT > +inline +PointH2::~PointH2() +{} +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +PointH2::PointH2(const VectorH2& v) + : Handle_for >(v) +{} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +PointH2::operator==( const PointH2& p) const +{ + return ( (hx() * p.hw() == p.hx() * hw() ) + &&(hy() * p.hw() == p.hy() * hw() ) ); +} + +template < class FT, class RT > +inline +bool +PointH2::operator!=( const PointH2& p) const +{ return !(*this == p); } /* XXX */ + +template < class FT, class RT > +inline +FT +PointH2::x() const +{ return ( FT( hx() ) / FT( hw() )); } + +template < class FT, class RT > +inline +FT +PointH2::y() const +{ return ( FT( hy() ) / FT( hw() )); } + +template < class FT, class RT > +inline +RT +PointH2::hx() const +{ return ptr->e0 ; } + +template < class FT, class RT > +inline +RT +PointH2::hy() const +{ return ptr->e1 ; } + +template < class FT, class RT > +inline +RT +PointH2::hw() const +{ return ptr->e2; } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +FT +PointH2::cartesian(int i) const +{ + CGAL_kernel_precondition( (i==0 || i==1) ); + switch (i) + { + case 0: return x(); + case 1: return y(); + } + return FT(RT()); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +RT +PointH2::homogeneous(int i) const +{ + CGAL_kernel_precondition( (i>=0) && (i<=2) ); + switch (i) + { + case 0: return hx(); + case 1: return hy(); + case 2: return hw(); + } + return RT(); +} + +template < class FT, class RT > +inline +FT +PointH2::operator[](int i) const +{ return cartesian(i); } + +template < class FT, class RT > +inline +const RT& +PointH2::hx_ref() const +{ return ptr->e0 ; } + +template < class FT, class RT > +inline +const RT& +PointH2::hy_ref() const +{ return ptr->e1 ; } + +template < class FT, class RT > +inline +const RT& +PointH2::hw_ref() const +{ return ptr->e2; } + + +template < class FT, class RT > +inline +int +PointH2::dimension() const +{ return 2; } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +DirectionH2 +PointH2::direction() const +{ return DirectionH2(*this); } + + + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +VectorH2::VectorH2() + : Handle_for< Threetuple >( Threetuple()) {} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +VectorH2::VectorH2(const Null_vector &) + : Handle_for< Threetuple >( Threetuple(RT(0), RT(0), RT(1) )) {} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +VectorH2::VectorH2(const VectorH2& v) + : Handle_for >(v) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +VectorH2::VectorH2(const RT& x, const RT& y) + : Handle_for< Threetuple >( Threetuple( x, y, RT(1) )) {} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +VectorH2::VectorH2(const RT& x, const RT& y, const RT& w) +{ + if ( w >= RT(0) ) + { initialize_with( Threetuple( x, y, w)); } + else + { initialize_with( Threetuple(-x, -y, -w)); } +} + +template < class FT, class RT > +inline +VectorH2::~VectorH2() +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +VectorH2::VectorH2(const PointH2 & p) + : Handle_for >( p) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +VectorH2::VectorH2(const DirectionH2 & dir) + : Handle_for >( dir) +{} + +template < class FT, class RT > +inline +bool +VectorH2::operator==( const Null_vector&) const +{ return (hx() == RT(0)) && (hy() == RT(0)); } + +template < class FT, class RT > +inline +bool +VectorH2::operator!=( const Null_vector& v) const +{ return !(*this == v); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +VectorH2::operator==( const VectorH2& v) const +{ + return ( (hx() * v.hw() == v.hx() * hw() ) + &&(hy() * v.hw() == v.hy() * hw() ) ); +} + +template < class FT, class RT > +inline +bool +VectorH2::operator!=( const VectorH2& v) const +{ return !(*this == v); } /* XXX */ + +template < class FT, class RT > +inline +FT +VectorH2::x() const +{ return FT(ptr->e0 )/FT(ptr->e2 ) ; } + + +template < class FT, class RT > +inline +FT +VectorH2::y() const +{ return FT(ptr->e1 )/FT(ptr->e2 ) ; } + +template < class FT, class RT > +inline +RT +VectorH2::hx() const +{ return ptr->e0 ; } + +template < class FT, class RT > +inline +RT +VectorH2::hy() const +{ return ptr->e1 ; } + +template < class FT, class RT > +inline +RT +VectorH2::hw() const +{ return ptr->e2 ; } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +FT +VectorH2::cartesian(int i) const +{ + CGAL_kernel_precondition( (i==0 || i==1) ); + switch (i) + { + case 0: return x(); + case 1: return y(); + } + return FT(RT()); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +RT +VectorH2::homogeneous(int i) const +{ + CGAL_kernel_precondition( (i>=0) && (i<=2) ); + switch (i) + { + case 0: return hx(); + case 1: return hy(); + case 2: return hw(); + } + return RT(); +} + +template < class FT, class RT > +inline +FT +VectorH2::operator[](int i) const +{ return cartesian(i); } + +template < class FT, class RT > +inline +int +VectorH2::dimension() const +{ return 2; } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +DirectionH2 +VectorH2::direction() const +{ return DirectionH2(*this); } +template < class FT, class RT > +inline +VectorH2 +VectorH2::operator-() const +{ return VectorH2(- hx(), - hy(), hw() ); } + +template < class FT, class RT > +inline +VectorH2 +VectorH2::opposite() const +{ return VectorH2(- hx(), - hy(), hw() ); } + +template +CGAL_KERNEL_CTOR_INLINE +DirectionH2::DirectionH2() + : Handle_for< Threetuple >( Threetuple()) {} + +template +CGAL_KERNEL_CTOR_INLINE +DirectionH2::DirectionH2(const DirectionH2& d ) + : Handle_for >( d ) +{} + +template +CGAL_KERNEL_CTOR_INLINE +DirectionH2::DirectionH2(const PointH2 & p ) + : Handle_for >( p) +{} + +template +CGAL_KERNEL_CTOR_INLINE +DirectionH2::DirectionH2(const VectorH2 & v ) + : Handle_for >( v) +{} + +template +CGAL_KERNEL_CTOR_INLINE +DirectionH2::DirectionH2(const RT& x, const RT& y) + : Handle_for< Threetuple >( Threetuple( x, y, RT(1) )) {} + +template +CGAL_KERNEL_CTOR_INLINE +DirectionH2::DirectionH2(const RT& x, const RT& y, const RT& w ) +{ + if (w > RT(0) ) + { initialize_with( Threetuple( x, y, w)); } + else + { initialize_with( Threetuple(-x,-y,-w)); } +} + +template +inline +DirectionH2::~DirectionH2() +{} + + +template +CGAL_KERNEL_INLINE +bool +DirectionH2::operator==( const DirectionH2& d) const +{ + return ( ( x() * d.y() == y() * d.x() ) + &&( CGAL_NTS sign( x() ) == CGAL_NTS sign( d.x() ) ) + &&( CGAL_NTS sign( y() ) == CGAL_NTS sign( d.y() ) ) ); +} + +template +inline +bool +DirectionH2::operator!=( const DirectionH2& d) const +{ return !(*this == d); } + +template +inline +DirectionH2 +DirectionH2::operator-() const +{ return DirectionH2( - x(), - y() ); } +template +inline +RT +DirectionH2::dx() const +{ return ptr->e0; } + +template +inline +RT +DirectionH2::dy() const +{ return ptr->e1; } + +template +CGAL_KERNEL_INLINE +RT +DirectionH2::delta(int i) const +{ + CGAL_kernel_precondition( ( i == 0 ) || ( i == 1 ) ); + if (i == 0) + { + return dx(); + } + return dy(); +} + +template +inline +RT +DirectionH2::x() const +{ return ptr->e0; } + +template +inline +RT +DirectionH2::y() const +{ return ptr->e1; } + + +template +CGAL_KERNEL_INLINE +VectorH2 +operator+(const VectorH2& u, const VectorH2& v) +{ + return VectorH2( u.hx()*v.hw() + v.hx()*u.hw(), + u.hy()*v.hw() + v.hy()*u.hw(), + u.hw()*v.hw() ); +} + +template +CGAL_KERNEL_INLINE +VectorH2 +operator-(const VectorH2& u, const VectorH2& v) +{ + return VectorH2( u.hx()*v.hw() - v.hx()*u.hw(), + u.hy()*v.hw() - v.hy()*u.hw(), + u.hw()*v.hw() ); +} + +template +CGAL_KERNEL_INLINE +FT +operator*(const VectorH2& u, const VectorH2& v) +{ + return ( FT( RT(u.hx()*v.hx() + u.hy()*v.hy()) ) / + FT( RT(u.hw()*v.hw() ) ) ); +} + +template +CGAL_KERNEL_INLINE +VectorH2 +operator/(const VectorH2& v, const RT& f) +{ return VectorH2( v.hx(), v.hy(), v.hw()*f ); } + +template +CGAL_KERNEL_INLINE +VectorH2 +operator*(const VectorH2& v, const RT& f) +{ return VectorH2( v.hx()*f, v.hy()*f, v.hw() ); } + +template +CGAL_KERNEL_INLINE +VectorH2 +operator*(const RT& f, const VectorH2& v) +{ return VectorH2( v.hx()*f, v.hy()*f, v.hw() ); } + +template +inline +PointH2 +origin_plus_vector(const VectorH2& v) +{ return PointH2( v ); } + +template +inline +PointH2 +operator+(const Origin&, const VectorH2& v) +{ return origin_plus_vector( v ); } + +template +inline +PointH2 +origin_minus_vector(const VectorH2& v) +{ return PointH2( v.opposite() ); } + +template +inline +PointH2 +operator-(const Origin&, const VectorH2& v) +{ return origin_minus_vector( v ); } + +template +inline +VectorH2 +point_minus_origin(const PointH2& p) +{ return VectorH2( p ); } + +template +inline +VectorH2 +operator-(const PointH2& p, const Origin&) +{ return point_minus_origin( p ); } + +template +inline +VectorH2 +origin_minus_point(const PointH2& p) +{ return VectorH2( p ).opposite(); } + +template +inline +VectorH2 +operator-(const Origin&, const PointH2& p) +{ return origin_minus_point( p ); } + + +template +CGAL_KERNEL_INLINE +PointH2 +operator+(const PointH2& p, const VectorH2& v) +{ + return PointH2( p.hx()*v.hw() + v.hx()*p.hw(), + p.hy()*v.hw() + v.hy()*p.hw(), + p.hw()*v.hw() ); +} + +template +CGAL_KERNEL_INLINE +PointH2 +operator-(const PointH2& p, const VectorH2& v) +{ + return PointH2( p.hx()*v.hw() - v.hx()*p.hw(), + p.hy()*v.hw() - v.hy()*p.hw(), + p.hw()*v.hw() ); +} + +template +CGAL_KERNEL_INLINE +VectorH2 +operator-(const PointH2& p, const PointH2& q) +{ + return VectorH2( p.hx()*q.hw() - q.hx()*p.hw(), + p.hy()*q.hw() - q.hy()*p.hw(), + p.hw()*q.hw() ); +} + +CGAL_END_NAMESPACE + + +#ifndef CGAL_PREDICATES_ON_DIRECTIONSH2_H +#include +#endif // CGAL_PREDICATES_ON_DIRECTIONSH2_H + +CGAL_BEGIN_NAMESPACE + +template +inline +bool +DirectionH2::operator< (const DirectionH2& d) const +{ return (compare_angles_with_x_axis(*this,d) == SMALLER); } + +template +inline +bool +DirectionH2::operator> (const DirectionH2& d) const +{ return (compare_angles_with_x_axis(*this,d) == LARGER); } + +template +inline +bool +DirectionH2::operator>= (const DirectionH2& d) const +{ return !(compare_angles_with_x_axis(*this,d) == SMALLER); } + +template +inline +bool +DirectionH2::operator<= (const DirectionH2& d) const +{ return !(compare_angles_with_x_axis(*this,d) == LARGER); } + +template +CGAL_KERNEL_INLINE +bool +DirectionH2:: +counterclockwise_in_between( const DirectionH2& d1, + const DirectionH2& d2) const +{ + if ( d1 < *this) + { + return ( *this < d2 )||( d2 <= d1 ); + } + else + { + return ( *this < d2 )&&( d2 <= d1 ); + } +} + +CGAL_END_NAMESPACE + + +#ifndef CGAL_AFF_TRANSFORMATIONH2_H +#include +#endif // CGAL_AFF_TRANSFORMATIONH2_H +#ifndef CGAL_BBOX_2_H +#include +#endif // CGAL_BBOX_2_H +#ifndef CGAL_MISC_H +#include +#endif // CGAL_MISC_H + +CGAL_BEGIN_NAMESPACE + +template < class FT, class RT > +CGAL_KERNEL_MEDIUM_INLINE +Bbox_2 +PointH2::bbox() const +{ +#ifndef CGAL_CFG_NO_NAMESPACE + using std::swap; +#endif // CGAL_CFG_NO_NAMESPACE + + // double eps = exp2(-52); + // the following is faster as it can be evaluated at compile time + // and it is machine independent + double eps = double(1.0) /(double(1<<26) * double(1<<26)); + double hxd = CGAL::to_double( hx() ); + double hyd = CGAL::to_double( hy() ); + double hwd = CGAL::to_double( hw() ); + double xmin = ( hxd - eps*hxd ) / ( hwd + eps*hwd ); + double xmax = ( hxd + eps*hxd ) / ( hwd - eps*hwd ); + double ymin = ( hyd - eps*hyd ) / ( hwd + eps*hwd ); + double ymax = ( hyd + eps*hyd ) / ( hwd - eps*hwd ); + if ( hx() < RT(0) ) { swap(xmin, xmax); } + if ( hy() < RT(0) ) { swap(ymin, ymax); } + return Bbox_2(xmin, ymin, xmax, ymax); +} + +template < class FT, class RT > +inline +PointH2 +PointH2::transform(const Aff_transformationH2& t) const +{ return t.transform(*this); } + + +#ifndef NO_OSTREAM_INSERT_POINTH2 +template < class FT, class RT > +std::ostream & +operator<<(std::ostream &os, const PointH2 &p) +{ + switch(os.iword(IO::mode)) + { + case IO::ASCII : + return os << p.hx() << ' ' << p.hy() << ' ' << p.hw(); + case IO::BINARY : + write(os, p.hx()); + write(os, p.hy()); + write(os, p.hw()); + return os; + default: + return os << "PointH2(" << p.hx() << ", " + << p.hy() << ", " + << p.hw() << ')'; + } +} +#endif // NO_OSTREAM_INSERT_POINTH2 + +#ifndef NO_ISTREAM_EXTRACT_POINTH2 +template < class FT, class RT > +std::istream & +operator>>(std::istream &is, PointH2 &p) +{ + RT hx, hy, hw; + switch(is.iword(IO::mode)) + { + case IO::ASCII : + is >> hx >> hy >> hw; + break; + case IO::BINARY : + read(is, hx); + read(is, hy); + read(is, hw); + break; + default: + std::cerr << "" << std::endl; + std::cerr << "Stream must be in ascii or binary mode" << std::endl; + break; + } + p = PointH2(hx, hy, hw); + return is; +} +#endif // NO_ISTREAM_EXTRACT_POINTH2 + +template < class FT, class RT > +CGAL_KERNEL_INLINE +VectorH2 +VectorH2::perpendicular(const Orientation& o) const +{ + CGAL_kernel_precondition(o != COLLINEAR); + if (o == COUNTERCLOCKWISE) + { + return VectorH2(-hy(), hx(), hw()); + } + else + { + return VectorH2(hy(), -hx(), hw()); + } +} + +template < class FT, class RT > +inline +VectorH2 +VectorH2::transform(const Aff_transformationH2& t) const +{ return t.transform(*this); } + + +#ifndef NO_OSTREAM_INSERT_VECTORH2 +template < class FT, class RT > +std::ostream & +operator<<(std::ostream &os, const VectorH2 &p) +{ + switch(os.iword(IO::mode)) + { + case IO::ASCII : + return os << p.hx() << ' ' << p.hy() << ' ' << p.hw(); + case IO::BINARY : + write(os, p.hx()); + write(os, p.hy()); + write(os, p.hw()); + return os; + default: + return os << "VectorH2(" << p.hx() << ", " + << p.hy() << ", " + << p.hw() << ')'; + } +} +#endif // NO_OSTREAM_INSERT_VECTORH2 + +#ifndef NO_ISTREAM_EXTRACT_VECTORH2 +template < class FT, class RT > +std::istream & +operator>>(std::istream &is, VectorH2 &p) +{ + RT hx, hy, hw; + switch(is.iword(IO::mode)) + { + case IO::ASCII : + is >> hx >> hy >> hw; + break; + case IO::BINARY : + read(is, hx); + read(is, hy); + read(is, hw); + break; + default: + std::cerr << "" << std::endl; + std::cerr << "Stream must be in ascii or binary mode" << std::endl; + break; + } + p = VectorH2(hx, hy, hw); + return is; +} +#endif // NO_ISTREAM_EXTRACT_VECTORH2 + +template +CGAL_KERNEL_INLINE +DirectionH2 +DirectionH2::perpendicular(const Orientation& o) const +{ + CGAL_kernel_precondition(o != COLLINEAR); + if (o == COUNTERCLOCKWISE) + { + return DirectionH2(-dy(), dx()); + } + else + { + return DirectionH2(dy(), -dx()); + } +} + +template +inline +DirectionH2 +DirectionH2:: +transform(const Aff_transformationH2& t) const +{ return t.transform(*this); } + +template +CGAL_KERNEL_INLINE +VectorH2 +DirectionH2::to_vector() const +{ return VectorH2( x(), y() ); } + + +#ifndef NO_OSTREAM_INSERT_DIRECTIONH2 +template < class FT, class RT > +std::ostream & +operator<<(std::ostream &os, const DirectionH2 &p) +{ + switch(os.iword(IO::mode)) + { + case IO::ASCII : + return os << p.dx() << ' ' << p.dy(); + case IO::BINARY : + write(os, p.dx()); + write(os, p.dy()); + return os; + default: + return os << "DirectionH2(" << p.dx() << ", " + << p.dy() << ')'; + } +} +#endif // NO_OSTREAM_INSERT_DIRECTIONH2 + +#ifndef NO_ISTREAM_EXTRACT_DIRECTIONH2 +template < class FT, class RT > +std::istream & +operator>>(std::istream &is, DirectionH2 &p) +{ + RT x, y; + switch(is.iword(IO::mode)) + { + case IO::ASCII : + is >> x >> y; + break; + case IO::BINARY : + read(is, x); + read(is, y); + break; + default: + std::cerr << "" << std::endl; + std::cerr << "Stream must be in ascii or binary mode" << std::endl; + break; + } + p = DirectionH2(x, y); + return is; +} +#endif // NO_ISTREAM_EXTRACT_DIRECTIONH2 + +CGAL_END_NAMESPACE + + + +#endif // CGAL_PVDH2 diff --git a/Packages/H2/include/CGAL/PointH2.h b/Packages/H2/include/CGAL/PointH2.h new file mode 100644 index 00000000000..506ea2a6fbf --- /dev/null +++ b/Packages/H2/include/CGAL/PointH2.h @@ -0,0 +1,29 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 11 +// +// source : PointVectorDirectionH2.fw +// file : PointH2.h +// package : H2 (2.13) +// maintainer : Stefan Schirra +// revision : 2.13 +// revision_date : 11 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef PVDH2_H +#include +#endif // PVDH2_H diff --git a/Packages/H2/include/CGAL/RayH2.h b/Packages/H2/include/CGAL/RayH2.h new file mode 100644 index 00000000000..ff18f4e5ae0 --- /dev/null +++ b/Packages/H2/include/CGAL/RayH2.h @@ -0,0 +1,251 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 11 +// +// source : RayH2.fw +// file : RayH2.h +// package : H2 (2.13) +// maintainer : Stefan Schirra +// revision : 2.13 +// revision_date : 11 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_RAYH2_H +#define CGAL_RAYH2_H + +CGAL_BEGIN_NAMESPACE + +template < class FT, class RT > +class Ray_repH2 : public Ref_counted +{ +public: + Ray_repH2(); + Ray_repH2(const PointH2& fp, + const PointH2& sp); + + PointH2 start; + PointH2 second; +}; + +template < class FT, class RT > +class RayH2 : public Handle_for< Ray_repH2 > +{ +public: + RayH2(); + RayH2( const PointH2& sp, + const PointH2& secondp); + RayH2( const PointH2& sp, + const DirectionH2& d); + + bool operator==(const RayH2& r) const; + bool operator!=(const RayH2& r) const; + + PointH2 start() const; + PointH2 source() const; + PointH2 second_point() const; + PointH2 point(int i) const; + DirectionH2 direction() const; + LineH2 supporting_line() const; + RayH2 opposite() const; + + bool is_horizontal() const; + bool is_vertical() const; + bool has_on(const PointH2 p) const; + bool collinear_has_on(const PointH2 p) const; + bool is_degenerate() const; + + RayH2 + transform( const Aff_transformationH2 & t) const; + +}; + + + +template < class FT, class RT > +inline +Ray_repH2::Ray_repH2() +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +Ray_repH2::Ray_repH2(const PointH2& fp, + const PointH2& sp) + : start(fp), second(sp) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +RayH2::RayH2() + : Handle_for< Ray_repH2 >( Ray_repH2() ) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +RayH2::RayH2( const PointH2& sp, + const PointH2& secondp) + : Handle_for< Ray_repH2 >( Ray_repH2(sp,secondp) ) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +RayH2::RayH2( const PointH2& sp, + const DirectionH2& d) + : Handle_for< Ray_repH2 >( Ray_repH2(sp, sp + d.to_vector()) ) +{} + +template < class FT, class RT > +inline +PointH2 +RayH2::source() const +{ return ptr->start; } + +template < class FT, class RT > +inline +PointH2 +RayH2::start() const +{ return ptr->start; } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +DirectionH2 +RayH2::direction() const +{ + CGAL_kernel_precondition( !is_degenerate() ); + return DirectionH2( ptr->second - ptr->start ); +} +template < class FT, class RT > +inline +PointH2 +RayH2::second_point() const +{ + CGAL_kernel_precondition( !is_degenerate() ); + return ptr->second; +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +PointH2 +RayH2::point(int i) const +{ + CGAL_kernel_precondition( !is_degenerate() ); + CGAL_kernel_precondition( i>= 0 ); + VectorH2 v = direction().to_vector(); + return start() + RT(i) * v; +} + +template < class FT, class RT > +inline +LineH2 +RayH2::supporting_line() const +{ + CGAL_kernel_precondition( !is_degenerate() ); + return LineH2(*this); +} + +template < class FT, class RT > +inline +RayH2 +RayH2::opposite() const +{ return RayH2( ptr->start, - direction() ); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +RayH2 +RayH2:: +transform(const Aff_transformationH2 & t) const +{ + return RayH2(t.transform(ptr->start), + t.transform(ptr->second) ); +} + +#ifndef NO_OSTREAM_INSERT_RAYH2 +template < class FT, class RT > +std::ostream & +operator<<(std::ostream &os, const RayH2 &r) +{ + switch(os.iword(IO::mode)) + { + case IO::ASCII : + return os << r.source() << ' ' << r.second_point(); + case IO::BINARY : + return os << r.source() << r.second_point(); + default: + return os << "RayC2(" << r.source() << ", " << r.second_point() << ")"; + } +} +#endif // NO_OSTREAM_INSERT_RAYH2 + +#ifndef NO_ISTREAM_EXTRACT_RAYH2 +template < class FT, class RT > +std::istream & +operator>>(std::istream &is, RayH2 &r) +{ + PointH2 p, q; + is >> p >> q; + r = RayH2(p, q); + return is; +} +#endif // NO_ISTREAM_EXTRACT_RAYH2 +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +RayH2::is_horizontal() const +{ return start().hy()*second_point().hw() == second_point().hy()*start().hw(); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +RayH2::is_vertical() const +{ return start().hx()*second_point().hw() == second_point().hx()*start().hw(); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +RayH2::has_on(const PointH2 p) const +{ + return ( ( p == start() ) + ||(DirectionH2(p - ptr->start) == direction() ) ); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +RayH2::is_degenerate() const +{ return ( (ptr->start == ptr->second) ); } + +template < class FT, class RT > +inline +bool +RayH2::collinear_has_on(const PointH2 p) const +{ return has_on(p); } +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +RayH2::operator==(const RayH2& r) const +{ return ( (start() == r.start() )&&( direction() == r.direction() ) ); } + +template < class FT, class RT > +inline +bool +RayH2::operator!=( const RayH2& r) const +{ return !(*this == r); } + + +CGAL_END_NAMESPACE + + +#endif // CGAL_RAYH2_H diff --git a/Packages/H2/include/CGAL/SegmentH2.h b/Packages/H2/include/CGAL/SegmentH2.h new file mode 100644 index 00000000000..53299670dfa --- /dev/null +++ b/Packages/H2/include/CGAL/SegmentH2.h @@ -0,0 +1,344 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 11 +// +// source : SegmentH2.fw +// file : SegmentH2.h +// package : H2 (2.13) +// maintainer : Stefan Schirra +// revision : 2.13 +// revision_date : 11 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_SEGMENTH2_H +#define CGAL_SEGMENTH2_H + +#ifndef CGAL_POINTH2_H +#include +#endif // CGAL_POINTH2_H +#ifndef CGAL_LINEH2_H +#include +#endif // CGAL_LINEH2_H + +CGAL_BEGIN_NAMESPACE + + +template < class FT, class RT > +class Segment_repH2 : public Ref_counted +{ +public: + Segment_repH2(); + Segment_repH2(const PointH2& sp, + const PointH2& ep); + + PointH2 start; + PointH2 end; + +}; + +template < class FT, class RT > +class SegmentH2 : public Handle_for< Segment_repH2 > +{ +public: + SegmentH2(); + SegmentH2( const PointH2& sp, + const PointH2& ep); + SegmentH2( const RT& sw, const RT& sx, const RT& sy, + const RT& ew, const RT& ex, const RT& ey); + + bool operator==(const SegmentH2& s) const; + bool operator!=(const SegmentH2& s) const; + + PointH2 source() const; + PointH2 target() const; + PointH2 start() const; + PointH2 end() const; + PointH2 vertex(int i) const; + PointH2 point(int i) const; + PointH2 operator[](int i) const; + PointH2 min() const; + PointH2 max() const; + PointH2 other_vertex(const PointH2& p) const; + + bool is_horizontal() const; + bool is_vertical() const; + bool has_on(const PointH2& p) const; + bool collinear_has_on(const PointH2& p) const; + bool is_degenerate() const; + + FT squared_length() const; + + DirectionH2 direction() const; + LineH2 supporting_line() const; + SegmentH2 opposite() const; + Bbox_2 bbox() const; + + SegmentH2 + transform( const Aff_transformationH2 & t) const; + +}; + + + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +Segment_repH2::Segment_repH2() +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +Segment_repH2:: +Segment_repH2(const PointH2& sp, const PointH2& ep) + : start(sp), end(ep) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +SegmentH2::SegmentH2() + : Handle_for< Segment_repH2 >( Segment_repH2() ) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +SegmentH2::SegmentH2( const PointH2& sp, + const PointH2& ep) + : Handle_for< Segment_repH2 >( Segment_repH2(sp,ep) ) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +SegmentH2::SegmentH2(const RT& sx, const RT& sy, const RT& sw, + const RT& ex, const RT& ey, const RT& ew) + : Handle_for< Segment_repH2 >( Segment_repH2( + PointH2(sx,sy,sw), + PointH2(ex,ey,ew) ) ) +{} + +template < class FT, class RT > +inline +PointH2 +SegmentH2::source() const +{ return ptr->start; } + +template < class FT, class RT > +inline +PointH2 +SegmentH2::start() const +{ return ptr->start; } + +template < class FT, class RT > +inline +PointH2 +SegmentH2::target() const +{ return ptr->end; } + +template < class FT, class RT > +inline +PointH2 +SegmentH2::end() const +{ return ptr->end; } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +PointH2 +SegmentH2::min() const +{ + return + lexicographically_xy_smaller_or_equal(start(),end()) ? start() : end(); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +PointH2 +SegmentH2::max() const +{ + return + lexicographically_xy_smaller_or_equal(start(),end()) ? end() : start(); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +PointH2 +SegmentH2::other_vertex(const PointH2& p) const +{ + CGAL_kernel_precondition( (p == end()) || (p == start()) ); + return ( p == start() ) ? end() : start() ; +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +PointH2 +SegmentH2::vertex(int i) const +{ + switch (i%2) + { + case 0: return ptr->start; + case 1: return ptr->end; + }; + return PointH2(); // otherwise the SGI compiler complains +} + +template < class FT, class RT > +inline +PointH2 +SegmentH2::point(int i) const +{ return vertex(i); } + +template < class FT, class RT > +inline +PointH2 +SegmentH2::operator[](int i) const +{ return vertex(i); } +template < class FT, class RT > +CGAL_KERNEL_INLINE +FT +SegmentH2::squared_length() const +{ return (ptr->end - ptr->start) * (ptr->end - ptr->start); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +DirectionH2 +SegmentH2::direction() const +{ + CGAL_kernel_precondition( !is_degenerate() ); + return DirectionH2( ptr->end - ptr->start ); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +LineH2 +SegmentH2::supporting_line() const +{ + CGAL_kernel_precondition( !is_degenerate() ); + return LineH2(ptr->start, ptr->end); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +SegmentH2 +SegmentH2::opposite() const +{ return SegmentH2(ptr->end, ptr->start); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +SegmentH2 +SegmentH2:: +transform(const Aff_transformationH2& t) const +{ + return SegmentH2(t.transform(ptr->start), + t.transform(ptr->end) ); +} + +template < class FT, class RT > +inline +Bbox_2 +SegmentH2::bbox() const +{ return start().bbox() + end().bbox(); } + +#ifndef NO_OSTREAM_INSERT_SEGMENTH2 +template < class FT, class RT > +std::ostream & +operator<<(std::ostream &os, const SegmentH2 &s) +{ + switch(os.iword(IO::mode)) + { + case IO::ASCII : + return os << s.source() << ' ' << s.target(); + case IO::BINARY : + return os << s.source() << s.target(); + default: + return os << "SegmentH2(" << s.source() << ", " << s.target() << ")"; + } +} +#endif // NO_OSTREAM_INSERT_SEGMENTH2 + +#ifndef NO_ISTREAM_EXTRACT_SEGMENTH2 +template < class FT, class RT > +std::istream & +operator>>(std::istream &is, SegmentH2 &s) +{ + PointH2 p, q; + is >> p >> q; + s = SegmentH2(p, q); + return is; +} +#endif // NO_ISTREAM_EXTRACT_SEGMENTH2 +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +SegmentH2::is_horizontal() const +{ + return ( ptr->start.hy() * ptr->end.hw() + == ptr->end.hy() * ptr->start.hw() ); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +SegmentH2::is_vertical() const +{ + return ( ptr->start.hx() * ptr->end.hw() + == ptr->end.hx() * ptr->start.hw() ); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +SegmentH2::is_degenerate() const +{ return (start() == end()); } +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +SegmentH2::has_on(const PointH2& p) const +{ + if ( collinear(ptr->start, p, ptr->end ) ) + { + return collinear_has_on(p); + } + else + { + return false; + } +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +SegmentH2::collinear_has_on(const PointH2& p) const +{ + return ( lexicographically_xy_smaller_or_equal(p, max() ) + && lexicographically_xy_smaller_or_equal(min(),p) ); +} +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +SegmentH2::operator==(const SegmentH2& s) const +{ + return ( (start() == s.start() ) + &&(end() == s.end() ) ); +} + +template < class FT, class RT > +inline +bool +SegmentH2::operator!=(const SegmentH2& s) const +{ return ( !operator==(s) ); } + +CGAL_END_NAMESPACE + + +#endif // CGAL_SEGMENTH2_H diff --git a/Packages/H2/include/CGAL/TriangleH2.h b/Packages/H2/include/CGAL/TriangleH2.h new file mode 100644 index 00000000000..153da77cf7b --- /dev/null +++ b/Packages/H2/include/CGAL/TriangleH2.h @@ -0,0 +1,346 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 11 +// +// source : TriangleH2.fw +// file : TriangleH2.h +// package : H2 (2.13) +// maintainer : Stefan Schirra +// revision : 2.13 +// revision_date : 11 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_TRIANGLEH2_H +#define CGAL_TRIANGLEH2_H + +#ifndef CGAL_POINTH2_H +#include +#endif // CGAL_POINTH2_H +#ifndef CGAL_PREDICATES_ON_POINTSH2_H +#include +#endif // CGAL_PREDICATES_ON_POINTSH2_H + +CGAL_BEGIN_NAMESPACE + +template +class Triangle_repH2 : public Ref_counted +{ + public: + + Triangle_repH2() {} + + Triangle_repH2(const PointH2 v1, + const PointH2 v2, + const PointH2 v3) + { + A[0] = v1; + A[1] = v2; + A[2] = v3; + _orientation = CGAL::orientation(v1,v2,v3); + } + + Triangle_repH2(const Triangle_repH2& tbc) + { + A[0] = tbc.A[0]; + A[1] = tbc.A[1]; + A[2] = tbc.A[2]; + _orientation = tbc._orientation; + } + + friend class TriangleH2; + + private: + PointH2 A[3]; + Orientation _orientation; +}; + +template +class TriangleH2 : public Handle_for > +{ +public: + TriangleH2(); + TriangleH2(const PointH2& p, + const PointH2& q, + const PointH2& r); + + Bbox_2 bbox() const; + + TriangleH2 opposite() const; + TriangleH2 transform(const Aff_transformationH2&) const; + + Orientation orientation() const; + + Oriented_side oriented_side(const PointH2& ) const; + Bounded_side bounded_side(const PointH2& ) const; + bool has_on_positive_side( const PointH2& ) const; + bool has_on_negative_side( const PointH2& ) const; + bool has_on_boundary( const PointH2& ) const; + bool has_on_bounded_side( const PointH2& ) const; + bool has_on_unbounded_side(const PointH2& )const; + bool is_degenerate() const; + + bool operator==( const TriangleH2& ) const; + bool operator!=( const TriangleH2& ) const; + + // bool oriented_equal( const TriangleH2& ) const; + // bool unoriented_equal( const TriangleH2& ) const; + + PointH2 + vertex(int i) const; + PointH2 + operator[](int i) const; + +}; + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +TriangleH2::TriangleH2() + : Handle_for< Triangle_repH2 >( Triangle_repH2() ) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +TriangleH2::TriangleH2(const PointH2& p, + const PointH2& q, + const PointH2& r) + : Handle_for< Triangle_repH2 >( Triangle_repH2(p,q,r) ) +{} +template +CGAL_KERNEL_INLINE +PointH2 +TriangleH2::vertex(int i) const +{ return ptr->A[ i % 3 ]; } + +template +inline +PointH2 +TriangleH2::operator[](int i) const +{ return vertex(i); } + +template +inline +Orientation +TriangleH2::orientation() const +{ return ptr->_orientation; } +template +CGAL_KERNEL_MEDIUM_INLINE +Oriented_side +TriangleH2::oriented_side( const PointH2& p) const +{ + Orientation o12 = CGAL::orientation( vertex(1), vertex(2), p); + Orientation o23 = CGAL::orientation( vertex(2), vertex(3), p); + Orientation o31 = CGAL::orientation( vertex(3), vertex(1), p); + + if (ptr->_orientation == CLOCKWISE) + { + if ( (o12 == COUNTERCLOCKWISE) + ||(o23 == COUNTERCLOCKWISE) + ||(o31 == COUNTERCLOCKWISE) ) + { + return ON_POSITIVE_SIDE; + } + if ( (o12 == COLLINEAR) + ||(o23 == COLLINEAR) + ||(o31 == COLLINEAR) ) + { + return ON_ORIENTED_BOUNDARY; + } + else + { + return ON_NEGATIVE_SIDE; + } + } + else // COUNTERCLOCKWISE + { + if ( (o12 == CLOCKWISE) + ||(o23 == CLOCKWISE) + ||(o31 == CLOCKWISE) ) + { + return ON_NEGATIVE_SIDE; + } + if ( (o12 == COLLINEAR) + ||(o23 == COLLINEAR) + ||(o31 == COLLINEAR) ) + { + return ON_ORIENTED_BOUNDARY; + } + else + { + return ON_POSITIVE_SIDE; + } + } +} + +template +inline +bool +TriangleH2:: +has_on_positive_side( const PointH2& p) const +{ return ( oriented_side(p) == ON_POSITIVE_SIDE ); } + +template +inline +bool +TriangleH2::has_on_boundary(const PointH2& p) const +{ return oriented_side(p) == ON_ORIENTED_BOUNDARY; } + +template +inline +bool +TriangleH2:: +has_on_negative_side( const PointH2& p) const +{ return oriented_side(p) == ON_NEGATIVE_SIDE; } + +template +CGAL_KERNEL_MEDIUM_INLINE +Bounded_side +TriangleH2::bounded_side(const PointH2& p) const +{ + CGAL_kernel_precondition( ! is_degenerate() ); + + Orientation o12 = CGAL::orientation( vertex(1), vertex(2), p); + Orientation o23 = CGAL::orientation( vertex(2), vertex(3), p); + Orientation o31 = CGAL::orientation( vertex(3), vertex(1), p); + Orientation ori = orientation(); + Orientation opp = CGAL::opposite( ori); + + if ( (o12 == opp) || (o23 == opp) || (o31 == opp) ) + { + return ON_UNBOUNDED_SIDE; + } + if ( (o12 == ori) && (o23 == ori) && (o31 == ori) ) + { + return ON_BOUNDED_SIDE; + } + return ON_BOUNDARY; +} + +template +CGAL_KERNEL_MEDIUM_INLINE +bool +TriangleH2::has_on_bounded_side(const PointH2& p) const +{ + CGAL_kernel_precondition( ! is_degenerate() ); + + Orientation o12 = CGAL::orientation( vertex(1), vertex(2), p); + Orientation o23 = CGAL::orientation( vertex(2), vertex(3), p); + Orientation o31 = CGAL::orientation( vertex(3), vertex(1), p); + Orientation ori = ptr->_orientation; + + return ( (o12 == ori) && (o23 == ori) && (o31 == ori) ); +} + +template +CGAL_KERNEL_MEDIUM_INLINE +bool +TriangleH2::has_on_unbounded_side(const PointH2& p) + const +{ + CGAL_kernel_precondition( ! is_degenerate() ); + + Orientation o12 = CGAL::orientation( vertex(1), vertex(2), p); + Orientation o23 = CGAL::orientation( vertex(2), vertex(3), p); + Orientation o31 = CGAL::orientation( vertex(3), vertex(1), p); + Orientation opp = CGAL::opposite( ptr->_orientation ); + + return ( (o12 == opp) || (o23 == opp) || (o31 == opp) ); +} + +template +inline +bool +TriangleH2::is_degenerate() const +{ return (ptr->_orientation == COLLINEAR); } + +template +inline +Bbox_2 +TriangleH2::bbox() const +{ return vertex(0).bbox() + vertex(1).bbox() + vertex(2).bbox(); } +template +CGAL_KERNEL_INLINE +TriangleH2 +TriangleH2:: +transform( const Aff_transformationH2& t) const +{ + return TriangleH2(t.transform(ptr->A[0]), + t.transform(ptr->A[1]), + t.transform(ptr->A[2]) ); +} + +template +CGAL_KERNEL_INLINE +TriangleH2 +TriangleH2::opposite() const +{ return TriangleH2(ptr->A[0], ptr->A[2], ptr->A[1]); } +template +CGAL_KERNEL_MEDIUM_INLINE +bool +TriangleH2::operator==(const TriangleH2& t) const +{ + int j = 0; + while ( (t.vertex(0) != vertex(j)) && (j < 3) ) j++; + if ( j == 3) + { + return false; + } + if ( (t.vertex(1) == vertex(j+1)) && (t.vertex(2) == vertex(j+2)) ) + { + return true; + } + return false; +} + +template +inline +bool +TriangleH2::operator!=(const TriangleH2& t) const +{ return !(*this == t); } + +#ifndef NO_OSTREAM_INSERT_TRIANGLEH2 +template < class FT, class RT > +std::ostream & +operator<<(std::ostream &os, const TriangleH2 &t) +{ + switch(os.iword(IO::mode)) + { + case IO::ASCII : + return os << t[0] << ' ' << t[1] << ' ' << t[2]; + case IO::BINARY : + return os << t[0] << t[1] << t[2]; + default: + return os<< "TriangleH2(" << t[0] << ", " << t[1] << ", " << t[2] <<")"; + } +} +#endif // NO_OSTREAM_INSERT_TRIANGLEH2 + +#ifndef NO_ISTREAM_EXTRACT_TRIANGLEH2 +template < class FT, class RT > +std::istream & +operator>>(std::istream &is, TriangleH2 &t) +{ + PointH2 p, q, r; + is >> p >> q >> r; + t = TriangleH2(p, q, r); + return is; +} +#endif // NO_ISTREAM_EXTRACT_TRIANGLEH2 + +CGAL_END_NAMESPACE + + +#endif // CGAL_TRIANGLEH2_H diff --git a/Packages/H2/include/CGAL/VectorH2.h b/Packages/H2/include/CGAL/VectorH2.h new file mode 100644 index 00000000000..3ac7b4a1c30 --- /dev/null +++ b/Packages/H2/include/CGAL/VectorH2.h @@ -0,0 +1,29 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 11 +// +// source : PointVectorDirectionH2.fw +// file : VectorH2.h +// package : H2 (2.13) +// maintainer : Stefan Schirra +// revision : 2.13 +// revision_date : 11 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef PVDH2_H +#include +#endif // PVDH2_H diff --git a/Packages/H2/include/CGAL/basic_constructionsH2.h b/Packages/H2/include/CGAL/basic_constructionsH2.h new file mode 100644 index 00000000000..406cf81312b --- /dev/null +++ b/Packages/H2/include/CGAL/basic_constructionsH2.h @@ -0,0 +1,180 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 11 +// +// source : basic_constructionsH2.fw +// file : basic_constructionsH2.h +// package : H2 (2.13) +// maintainer : Stefan Schirra +// revision : 2.13 +// revision_date : 11 Oct 2000 +// author(s) : Sven Schoenherr +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_BASIC_CONSTRUCTIONSH2_H +#define CGAL_BASIC_CONSTRUCTIONSH2_H + +#include +#include +#include + +CGAL_BEGIN_NAMESPACE + +template +CGAL_KERNEL_MEDIUM_INLINE +PointH2 +gp_linear_intersection(const LineH2& l1, const LineH2& l2) +{ + return PointH2( l1.b()*l2.c() - l2.b()*l1.c(), + l2.a()*l1.c() - l1.a()*l2.c(), + l1.a()*l2.b() - l2.a()*l1.b() ); +} + +template +CGAL_KERNEL_MEDIUM_INLINE +LineH2 +bisector( const PointH2& p, const PointH2& q ) +{ + // Bisector equation is based on equation + // ( X - p.x())^2 + (Y - p.y())^2 == ( X - q.x())^2 + (Y - q.y()) + // and x() = hx()/hw() ... + + RT phx = p.hx(); + RT phy = p.hy(); + RT phw = p.hw(); + RT qhx = q.hx(); + RT qhy = q.hy(); + RT qhw = q.hw(); + + RT a = RT(2) * ( qhx*qhw*phw*phw - phx*phw*qhw*qhw ); + RT b = RT(2) * ( qhy*qhw*phw*phw - phy*phw*qhw*qhw ); + RT c = phx*phx*qhw*qhw + phy*phy*qhw*qhw - qhx*qhx*phw*phw - qhy*qhy*phw*phw; + + return LineH2( a, b, c ); +} + +template +CGAL_KERNEL_MEDIUM_INLINE +FT +squared_distance( const PointH2& p, const PointH2& q ) +{ + const RT phx = p.hx(); + const RT phy = p.hy(); + const RT phw = p.hw(); + const RT qhx = q.hx(); + const RT qhy = q.hy(); + const RT qhw = q.hw(); + + RT sq_dist_numerator = + phx * phx * qhw * qhw + - RT(2) * phx * qhx * phw * qhw + + qhx * qhx * phw * phw + + + phy * phy * qhw * qhw + - RT(2) * phy * qhy * phw * qhw + + qhy * qhy * phw * phw ; + + RT sq_dist_denominator = qhw * qhw * phw * phw ; + + return FT( sq_dist_numerator ) / FT( sq_dist_denominator ); +} + +template < class FT, class RT > +CGAL_KERNEL_MEDIUM_INLINE +PointH2 +midpoint( PointH2 const& p, PointH2 const& q ) +{ + const RT phw( p.hw()); + const RT qhw( q.hw()); + + RT hx( p.hx()*qhw + q.hx()*phw); + RT hy( p.hy()*qhw + q.hy()*phw); + RT hw( phw * qhw * RT( 2)); + + return( PointH2( hx, hy, hw)); +} + + +template +CGAL_KERNEL_LARGE_INLINE +PointH2 +circumcenter( const PointH2& p, + const PointH2& q, + const PointH2& r ) +{ + RT phx = p.hx(); + RT phy = p.hy(); + RT phw = p.hw(); + RT qhx = q.hx(); + RT qhy = q.hy(); + RT qhw = q.hw(); + RT rhx = r.hx(); + RT rhy = r.hy(); + RT rhw = r.hw(); + +#ifdef EXPANDED_CIRCUMCENTER_COMPUTATION /* strange flag -- XXX */ + RT vvx = + ( qhy*qhw*phw*phw - phy*phw*qhw*qhw ) + *( phx*phx*rhw*rhw + phy*phy*rhw*rhw - rhx*rhx*phw*phw - rhy*rhy*phw*phw ) + - ( rhy*rhw*phw*phw - phy*phw*rhw*rhw ) + *( phx*phx*qhw*qhw + phy*phy*qhw*qhw - qhx*qhx*phw*phw - qhy*qhy*phw*phw ); + + RT vvy = + - ( qhx*qhw*phw*phw - phx*phw*qhw*qhw ) + *( phx*phx*rhw*rhw + phy*phy*rhw*rhw - rhx*rhx*phw*phw - rhy*rhy*phw*phw ) + + ( rhx*rhw*phw*phw - phx*phw*rhw*rhw ) + *( phx*phx*qhw*qhw + phy*phy*qhw*qhw - qhx*qhx*phw*phw - qhy*qhy*phw*phw ); + + RT vvw = RT(2) * + ( ( qhx*qhw*phw*phw - phx*phw*qhw*qhw ) + *( rhy*rhw*phw*phw - phy*phw*rhw*rhw ) + - ( rhx*rhw*phw*phw - phx*phw*rhw*rhw ) + *( qhy*qhw*phw*phw - phy*phw*qhw*qhw ) ); +#endif // EXPANDED_CIRCUMCENTER_COMPUTATION + + RT qy_py = ( qhy*qhw*phw*phw - phy*phw*qhw*qhw ); + RT qx_px = ( qhx*qhw*phw*phw - phx*phw*qhw*qhw ); + RT rx_px = ( rhx*rhw*phw*phw - phx*phw*rhw*rhw ); + RT ry_py = ( rhy*rhw*phw*phw - phy*phw*rhw*rhw ); + + RT px2_py2_rx2_ry_2 = + phx*phx*rhw*rhw + phy*phy*rhw*rhw - rhx*rhx*phw*phw - rhy*rhy*phw*phw ; + RT px2_py2_qx2_qy_2 = + phx*phx*qhw*qhw + phy*phy*qhw*qhw - qhx*qhx*phw*phw - qhy*qhy*phw*phw ; + + RT vvx = qy_py * px2_py2_rx2_ry_2 - ry_py * px2_py2_qx2_qy_2; + RT vvy = rx_px * px2_py2_qx2_qy_2 - qx_px * px2_py2_rx2_ry_2; + RT vvw = RT(2) * ( qx_px * ry_py - rx_px * qy_py ); + + return PointH2( vvx, vvy, vvw ); +} + +template +FT +area(const TriangleH2& t) +{ + RT num = determinant_3x3_by_formula( + t.vertex(0).hx(), t.vertex(0).hy(), t.vertex(0).hw(), + t.vertex(1).hx(), t.vertex(1).hy(), t.vertex(1).hw(), + t.vertex(2).hx(), t.vertex(2).hy(), t.vertex(2).hw() ); + RT den = t.vertex(0).hw() * t.vertex(1).hw() * t.vertex(2).hw(); + return FT(num) / FT(den); +} + +CGAL_END_NAMESPACE + + +#endif // CGAL_BASIC_CONSTRUCTIONSH2_H diff --git a/Packages/H2/include/CGAL/distance_predicatesH2.h b/Packages/H2/include/CGAL/distance_predicatesH2.h new file mode 100644 index 00000000000..371d5ae9953 --- /dev/null +++ b/Packages/H2/include/CGAL/distance_predicatesH2.h @@ -0,0 +1,372 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 11 +// +// source : distance_predicatesH2.fw +// file : distance_predicatesH2.h +// package : H2 (2.13) +// maintainer : Stefan Schirra +// revision : 2.13 +// revision_date : 11 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_DISTANCE_PREDICATESH2_H +#define CGAL_DISTANCE_PREDICATESH2_H + +#ifndef CGAL_DETERMINANT_H +#include +#endif // CGAL_DETERMINANT_H + +CGAL_BEGIN_NAMESPACE + +template < class FT, class RT> +CGAL_KERNEL_MEDIUM_INLINE +Comparison_result +cmp_dist_to_point(const PointH2& p, + const PointH2& q, + const PointH2& r) +{ + const RT phx = p.hx(); + const RT phy = p.hy(); + const RT phw = p.hw(); + const RT qhx = q.hx(); + const RT qhy = q.hy(); + const RT qhw = q.hw(); + const RT rhx = r.hx(); + const RT rhy = r.hy(); + const RT rhw = r.hw(); + const RT RT0 = RT(0); + const RT RT2 = RT(2); + + RT dosd = // difference of squared distances + + // phx * phx * qhw * qhw * rhw * rhw + // -RT(2) * phx * qhx * phw * qhw * rhw * rhw + // + qhx * qhx * phw * phw * rhw * rhw + // + // + phy * phy * qhw * qhw * rhw * rhw + // -RT(2) * phy * qhy * phw * qhw * rhw * rhw + // + qhy * qhy * phw * phw * rhw * rhw + // + // - ( phx * phx * qhw * qhw * rhw * rhw + // -RT(2) * phx * rhx * phw * qhw * qhw * rhw + // + rhx * rhx * phw * phw * qhw * qhw + // + // + phy * phy * qhw * qhw * rhw * rhw + // -RT(2) * phy * rhy * phw * qhw * qhw * rhw + // + rhy * rhy * phw * phw * qhw * qhw + + rhw*rhw * ( phw * ( qhx*qhx + qhy*qhy ) + - RT2 * qhw * ( phx*qhx + phy*qhy ) + ) + - qhw*qhw * ( phw * ( rhx*rhx + rhy*rhy ) + - RT2 * rhw * ( phx*rhx + phy*rhy ) + ); + + + if ( RT0 < dosd ) + { + return LARGER; + } + else + { + return (dosd < RT0) ? SMALLER : EQUAL; + } +} + +template < class FT, class RT> +CGAL_KERNEL_MEDIUM_INLINE +bool +has_larger_dist_to_point(const PointH2& p, + const PointH2& q, + const PointH2& r) +{ + const RT phx = p.hx(); + const RT phy = p.hy(); + const RT phw = p.hw(); + const RT qhx = q.hx(); + const RT qhy = q.hy(); + const RT qhw = q.hw(); + const RT rhx = r.hx(); + const RT rhy = r.hy(); + const RT rhw = r.hw(); + const RT RT0 = RT(0); + const RT RT2 = RT(2); + + RT dosd = // difference of squared distances + + // phx * phx * qhw * qhw * rhw * rhw + // -RT(2) * phx * qhx * phw * qhw * rhw * rhw + // + qhx * qhx * phw * phw * rhw * rhw + // + // + phy * phy * qhw * qhw * rhw * rhw + // -RT(2) * phy * qhy * phw * qhw * rhw * rhw + // + qhy * qhy * phw * phw * rhw * rhw + // + // - ( phx * phx * qhw * qhw * rhw * rhw + // -RT(2) * phx * rhx * phw * qhw * qhw * rhw + // + rhx * rhx * phw * phw * qhw * qhw + // + // + phy * phy * qhw * qhw * rhw * rhw + // -RT(2) * phy * rhy * phw * qhw * qhw * rhw + // + rhy * rhy * phw * phw * qhw * qhw + + rhw*rhw * ( phw * ( qhx*qhx + qhy*qhy ) + - RT2 * qhw * ( phx*qhx + phy*qhy ) + ) + - qhw*qhw * ( phw * ( rhx*rhx + rhy*rhy ) + - RT2 * rhw * ( phx*rhx + phy*rhy ) + ); + + + return ( dosd > RT0 ); +} + +template < class FT, class RT> +CGAL_KERNEL_MEDIUM_INLINE +bool +has_smaller_dist_to_point(const PointH2& p, + const PointH2& q, + const PointH2& r) +{ + const RT phx = p.hx(); + const RT phy = p.hy(); + const RT phw = p.hw(); + const RT qhx = q.hx(); + const RT qhy = q.hy(); + const RT qhw = q.hw(); + const RT rhx = r.hx(); + const RT rhy = r.hy(); + const RT rhw = r.hw(); + const RT RT0 = RT(0); + const RT RT2 = RT(2); + + RT dosd = // difference of squared distances + + // phx * phx * qhw * qhw * rhw * rhw + // -RT(2) * phx * qhx * phw * qhw * rhw * rhw + // + qhx * qhx * phw * phw * rhw * rhw + // + // + phy * phy * qhw * qhw * rhw * rhw + // -RT(2) * phy * qhy * phw * qhw * rhw * rhw + // + qhy * qhy * phw * phw * rhw * rhw + // + // - ( phx * phx * qhw * qhw * rhw * rhw + // -RT(2) * phx * rhx * phw * qhw * qhw * rhw + // + rhx * rhx * phw * phw * qhw * qhw + // + // + phy * phy * qhw * qhw * rhw * rhw + // -RT(2) * phy * rhy * phw * qhw * qhw * rhw + // + rhy * rhy * phw * phw * qhw * qhw + + rhw*rhw * ( phw * ( qhx*qhx + qhy*qhy ) + - RT2 * qhw * ( phx*qhx + phy*qhy ) + ) + - qhw*qhw * ( phw * ( rhx*rhx + rhy*rhy ) + - RT2 * rhw * ( phx*rhx + phy*rhy ) + ); + + + return ( dosd < RT0 ); +} +template < class FT, class RT> +CGAL_KERNEL_INLINE +Comparison_result +cmp_signed_dist_to_line(const LineH2& l, + const PointH2& p, + const PointH2& q) +{ + const RT la = l.a(); + const RT lb = l.b(); + const RT phx= p.hx(); + const RT phy= p.hy(); + const RT phw= p.hw(); + const RT qhx= q.hx(); + const RT qhy= q.hy(); + const RT qhw= q.hw(); + const RT RT0 = RT(0); + + RT scaled_dist_p_minus_scaled_dist_q = + la*( phx*qhw - qhx*phw ) + + lb*( phy*qhw - qhy*phw ); + + + + if ( scaled_dist_p_minus_scaled_dist_q < RT0 ) + { + return SMALLER; + } + else + { + return ( RT0 < scaled_dist_p_minus_scaled_dist_q ) ? + LARGER : EQUAL; + } +} + +template < class FT, class RT> +CGAL_KERNEL_INLINE +bool +has_larger_signed_dist_to_line(const LineH2& l, + const PointH2& p, + const PointH2& q) +{ + const RT la = l.a(); + const RT lb = l.b(); + const RT phx= p.hx(); + const RT phy= p.hy(); + const RT phw= p.hw(); + const RT qhx= q.hx(); + const RT qhy= q.hy(); + const RT qhw= q.hw(); + const RT RT0 = RT(0); + + RT scaled_dist_p_minus_scaled_dist_q = + la*( phx*qhw - qhx*phw ) + + lb*( phy*qhw - qhy*phw ); + + + + return ( scaled_dist_p_minus_scaled_dist_q > RT0 ); +} + +template < class FT, class RT> +CGAL_KERNEL_INLINE +bool +has_smaller_signed_dist_to_line(const LineH2& l, + const PointH2& p, + const PointH2& q) +{ + const RT la = l.a(); + const RT lb = l.b(); + const RT phx= p.hx(); + const RT phy= p.hy(); + const RT phw= p.hw(); + const RT qhx= q.hx(); + const RT qhy= q.hy(); + const RT qhw= q.hw(); + const RT RT0 = RT(0); + + RT scaled_dist_p_minus_scaled_dist_q = + la*( phx*qhw - qhx*phw ) + + lb*( phy*qhw - qhy*phw ); + + + + return ( scaled_dist_p_minus_scaled_dist_q < RT0 ); +} +template < class FT, class RT> +CGAL_KERNEL_MEDIUM_INLINE +Comparison_result +cmp_signed_dist_to_line(const PointH2& p, + const PointH2& q, + const PointH2& r, + const PointH2& s) +{ + const RT phx= p.hx(); + const RT phy= p.hy(); + const RT phw= p.hw(); + const RT qhx= q.hx(); + const RT qhy= q.hy(); + const RT qhw= q.hw(); + const RT rhx= r.hx(); + const RT rhy= r.hy(); + const RT rhw= r.hw(); + const RT shx= s.hx(); + const RT shy= s.hy(); + const RT shw= s.hw(); + const RT RT0 = RT(0); + + RT scaled_dist_r_minus_scaled_dist_s = + ( rhx*shw - shx*rhw ) * (phy*qhw - qhy*phw) + - ( rhy*shw - shy*rhw ) * (phx*qhw - qhx*phw); + + + if ( scaled_dist_r_minus_scaled_dist_s < RT0 ) + { + return SMALLER; + } + else + { + return (scaled_dist_r_minus_scaled_dist_s > RT0 ) ? + LARGER : EQUAL; + } +} + +template < class FT, class RT> +CGAL_KERNEL_MEDIUM_INLINE +bool +has_smaller_signed_dist_to_line(const PointH2& p, + const PointH2& q, + const PointH2& r, + const PointH2& s) +{ + const RT phx= p.hx(); + const RT phy= p.hy(); + const RT phw= p.hw(); + const RT qhx= q.hx(); + const RT qhy= q.hy(); + const RT qhw= q.hw(); + const RT rhx= r.hx(); + const RT rhy= r.hy(); + const RT rhw= r.hw(); + const RT shx= s.hx(); + const RT shy= s.hy(); + const RT shw= s.hw(); + const RT RT0 = RT(0); + + RT scaled_dist_r_minus_scaled_dist_s = + ( rhx*shw - shx*rhw ) * (phy*qhw - qhy*phw) + - ( rhy*shw - shy*rhw ) * (phx*qhw - qhx*phw); + + + return ( scaled_dist_r_minus_scaled_dist_s < RT0 ); +} + +template < class FT, class RT> +CGAL_KERNEL_MEDIUM_INLINE +bool +has_larger_signed_dist_to_line(const PointH2& p, + const PointH2& q, + const PointH2& r, + const PointH2& s) +{ + const RT phx= p.hx(); + const RT phy= p.hy(); + const RT phw= p.hw(); + const RT qhx= q.hx(); + const RT qhy= q.hy(); + const RT qhw= q.hw(); + const RT rhx= r.hx(); + const RT rhy= r.hy(); + const RT rhw= r.hw(); + const RT shx= s.hx(); + const RT shy= s.hy(); + const RT shw= s.hw(); + const RT RT0 = RT(0); + + RT scaled_dist_r_minus_scaled_dist_s = + ( rhx*shw - shx*rhw ) * (phy*qhw - qhy*phw) + - ( rhy*shw - shy*rhw ) * (phx*qhw - qhx*phw); + + + return ( scaled_dist_r_minus_scaled_dist_s > RT0 ); +} + +CGAL_END_NAMESPACE + + +#endif //CGAL_DISTANCE_PREDICATESH2_H diff --git a/Packages/H2/include/CGAL/point_vector_declarationsH2.h b/Packages/H2/include/CGAL/point_vector_declarationsH2.h new file mode 100644 index 00000000000..4dc2e764c5b --- /dev/null +++ b/Packages/H2/include/CGAL/point_vector_declarationsH2.h @@ -0,0 +1,104 @@ + +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 11 +// +// source : PV_decl_2.fw +// file : include/CGAL/point_vector_declarationsH2.h +// package : H2 (2.13) +// maintainer : Stefan Schirra +// revision : 2.13 +// revision_date : 11 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_POINT_VECTOR_DECLARATIONSH2_H +#define CGAL_POINT_VECTOR_DECLARATIONSH2_H + +#ifndef CGAL_HOMOGENEOUS_CLASSES_H +#include +#endif // #ifndef CGAL_HOMOGENEOUS_CLASSES_H + + +CGAL_BEGIN_NAMESPACE + +template +inline +PointH2 +origin_plus_vector(const VectorH2& v); + +template +inline +PointH2 +origin_minus_vector(const VectorH2& v); + +template +inline +VectorH2 +point_minus_origin(const PointH2& p); + +template +inline +VectorH2 +origin_minus_point(const PointH2& p); + +template +CGAL_KERNEL_INLINE +PointH2 +operator-(const PointH2& p, const VectorH2& v); + +template +CGAL_KERNEL_INLINE +VectorH2 +operator-(const PointH2& p, const PointH2& q); + + +template +CGAL_KERNEL_INLINE +VectorH2 +operator+(const VectorH2& u, const VectorH2& v); + +template +CGAL_KERNEL_INLINE +VectorH2 +operator-(const VectorH2& u, const VectorH2& v); + +template +CGAL_KERNEL_INLINE +FT +operator*(const VectorH2& u, const VectorH2& v); + +template +CGAL_KERNEL_INLINE +VectorH2 +operator/(const VectorH2& v, const RT& f); + +template +CGAL_KERNEL_INLINE +VectorH2 +operator*(const VectorH2& v, const RT& f); + +template +CGAL_KERNEL_INLINE +VectorH2 +operator*(const RT& f, const VectorH2& v); + + + +CGAL_END_NAMESPACE + + +#endif // CGAL_POINT_VECTOR_DECLARATIONS_2_H diff --git a/Packages/H2/include/CGAL/predicates_on_directionsH2.h b/Packages/H2/include/CGAL/predicates_on_directionsH2.h new file mode 100644 index 00000000000..e464f1f652d --- /dev/null +++ b/Packages/H2/include/CGAL/predicates_on_directionsH2.h @@ -0,0 +1,106 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 11 +// +// source : geometric_predicates.fw +// file : predicates_on_directionsH2.h +// package : H2 (2.13) +// maintainer : Stefan Schirra +// revision : 2.13 +// revision_date : 11 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_PREDICATES_ON_DIRECTIONSH2_H +#define CGAL_PREDICATES_ON_DIRECTIONSH2_H + +#ifndef PVDH2_H +#include +#endif // PVDH2_H +#ifndef CGAL_PREDICATES_ON_POINTSH2_H +#include +#endif // CGAL_PREDICATES_ON_POINTSH2_H + +CGAL_BEGIN_NAMESPACE + +template +CGAL_KERNEL_LARGE_INLINE +Comparison_result +compare_angles_with_x_axis(const DirectionH2& d1, + const DirectionH2& d2) +{ + CGAL_kernel_precondition( ( + (Comparison_result)COUNTERCLOCKWISE == LARGER + &&(Comparison_result)COLLINEAR == EQUAL + &&(Comparison_result)CLOCKWISE == SMALLER ) ); + + const RT RT0(0); + + CGAL::VectorH2 dirvec1(d1.x(), d1.y()); // Added + CGAL::PointH2 p1 = CGAL::ORIGIN + dirvec1; // Added + CGAL::VectorH2 dirvec2(d2.x(), d2.y()); // Added + PointH2 p2 = ORIGIN + dirvec2; // Added +// PointH2 p1 = ORIGIN + d1.vector(); // Commented out +// PointH2 p2 = ORIGIN + d2.vector(); // Commented out + + CGAL_kernel_precondition( RT0 < p1.hw_ref() ); + CGAL_kernel_precondition( RT0 < p2.hw_ref() ); + + int x_sign1 = (int)CGAL_NTS sign( p1.hx_ref() ); + int x_sign2 = (int)CGAL_NTS sign( p2.hx_ref() ); + int y_sign1 = (int)CGAL_NTS sign( p1.hy_ref() ); + int y_sign2 = (int)CGAL_NTS sign( p2.hy_ref() ); + + if ( y_sign1 * y_sign2 < 0) + { + return (0 < y_sign1 ) ? SMALLER : LARGER; + } + + PointH2 origin( RT0 , RT0 ); + + if ( 0 < y_sign1 * y_sign2 ) + { + return ( (Comparison_result) orientation(origin, p2, p1) ); + + // Precondition on the enums: + // COUNTERCLOCKWISE == LARGER ( == 1 ) + // COLLINEAR == EQUAL ( == 0 ) + // CLOCKWISE == SMALLER ( == -1 ) + } + + // ( y_sign1 * y_sign2 == 0 ) + + bool b1 = (y_sign1 == 0) && (x_sign1 >= 0); + bool b2 = (y_sign2 == 0) && (x_sign2 >= 0); + + if ( b1 ) { return b2 ? EQUAL : SMALLER; } + if ( b2 ) { return b1 ? EQUAL : LARGER; } + if ( y_sign1 == y_sign2 ) // == 0 + { + return EQUAL; + } + else + { + return (orientation(origin, p1, p2) == COUNTERCLOCKWISE) ? + (Comparison_result) SMALLER : + (Comparison_result) LARGER; + } +} + +CGAL_END_NAMESPACE + + +#endif // CGAL_PREDICATES_ON_DIRECTIONSH2_H diff --git a/Packages/H2/include/CGAL/predicates_on_linesH2.h b/Packages/H2/include/CGAL/predicates_on_linesH2.h new file mode 100644 index 00000000000..60aa7766bad --- /dev/null +++ b/Packages/H2/include/CGAL/predicates_on_linesH2.h @@ -0,0 +1,189 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 11 +// +// source : predicates_on_linesH2.fw +// file : predicates_on_linesH2.h +// package : H2 (2.13) +// maintainer : Stefan Schirra +// revision : 2.13 +// revision_date : 11 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_PREDICATES_ON_LINESH2_H +#define CGAL_PREDICATES_ON_LINESH2_H + +#ifndef CGAL_POINTH2_H +#include +#endif // CGAL_POINTH2_H +#ifndef CGAL_LINEH2_H +#include +#endif // CGAL_LINEH2_H +#ifndef CGAL_PREDICATES_ON_POINTSH2_H +#include +#endif // CGAL_PREDICATES_ON_POINTSH2_H +#ifndef CGAL_BASIC_CONSTRUCTIONSH2_H +#include +#endif // CGAL_BASIC_CONSTRUCTIONSH2_H + +CGAL_BEGIN_NAMESPACE + + +template +CGAL_KERNEL_INLINE +Comparison_result +compare_x(const PointH2& p, + const LineH2& l1, + const LineH2& l2) +{ + PointH2 ip = gp_linear_intersection( l1, l2 ); + return compare_x( p, ip ); +} + + +template +CGAL_KERNEL_INLINE +Comparison_result +compare_x(const LineH2& l1, + const LineH2& l2, + const LineH2& h1, + const LineH2& h2) +{ + PointH2 lip = gp_linear_intersection( l1, l2 ); + PointH2 hip = gp_linear_intersection( h1, h2 ); + return compare_x( lip, hip ); +} +template +CGAL_KERNEL_INLINE +Comparison_result +compare_y(const PointH2& p, + const LineH2& l1, + const LineH2& l2) +{ + PointH2 ip = gp_linear_intersection( l1, l2 ); + return compare_y( p, ip ); +} + + +template +CGAL_KERNEL_INLINE +Comparison_result +compare_y(const LineH2& l1, + const LineH2& l2, + const LineH2& h1, + const LineH2& h2) +{ + PointH2 lip = gp_linear_intersection( l1, l2 ); + PointH2 hip = gp_linear_intersection( h1, h2 ); + return compare_y( lip, hip ); +} +template +CGAL_KERNEL_MEDIUM_INLINE +Comparison_result +compare_y_at_x(const PointH2& p, + const LineH2& h) +{ + CGAL_kernel_precondition( ! h.is_vertical() ); + Oriented_side ors = h.oriented_side( p ); + if ( h.b() < RT(0) ) + { + ors = opposite( ors ); + } + if ( ors == ON_POSITIVE_SIDE ) + { + return LARGER; + } + return ( ors == ON_NEGATIVE_SIDE ) ? SMALLER : EQUAL; +} + +template +CGAL_KERNEL_INLINE +Comparison_result +compare_y_at_x(const PointH2& p, + const LineH2& h1, + const LineH2& h2) +{ return CGAL_NTS compare(h1.y_at_x( p.x() ), h2.y_at_x( p.x() )); } + + +template +CGAL_KERNEL_INLINE +Comparison_result +compare_y_at_x(const LineH2& l1, + const LineH2& l2, + const LineH2& h) +{ return compare_y_at_x( gp_linear_intersection( l1, l2 ), h); } + + +template +CGAL_KERNEL_INLINE +Comparison_result +compare_y_at_x(const LineH2& l1, + const LineH2& l2, + const LineH2& h1, + const LineH2& h2) +{ return compare_y_at_x( gp_linear_intersection( l1, l2 ), h1, h2 ); } + +template +CGAL_KERNEL_MEDIUM_INLINE +Comparison_result +compare_x_at_y(const PointH2& p, + const LineH2& h) +{ + CGAL_kernel_precondition( ! h.is_horizontal() ); + Oriented_side ors = h.oriented_side( p ); + if ( h.b() < RT(0) ) + { + ors = opposite( ors ); + } + if ( ors == ON_POSITIVE_SIDE ) + { + return LARGER; + } + return ( ors == ON_NEGATIVE_SIDE ) ? SMALLER : EQUAL; +} + +template +CGAL_KERNEL_INLINE +Comparison_result +compare_x_at_y(const PointH2& p, + const LineH2& h1, + const LineH2& h2) +{ return CGAL_NTS compare(h1.x_at_y( p.y() ), h2.x_at_y( p.y() )); } + + +template +CGAL_KERNEL_INLINE +Comparison_result +compare_x_at_y(const LineH2& l1, + const LineH2& l2, + const LineH2& h) +{ return compare_x_at_y( gp_linear_intersection( l1, l2 ), h); } + + +template +CGAL_KERNEL_INLINE +Comparison_result +compare_x_at_y(const LineH2& l1, + const LineH2& l2, + const LineH2& h1, + const LineH2& h2) +{ return compare_x_at_y( gp_linear_intersection( l1, l2 ), h1, h2 ); } + +CGAL_END_NAMESPACE + + +#endif // CGAL_PREDICATES_ON_LINESH2_H diff --git a/Packages/H2/include/CGAL/predicates_on_pointsH2.h b/Packages/H2/include/CGAL/predicates_on_pointsH2.h new file mode 100644 index 00000000000..238481daadc --- /dev/null +++ b/Packages/H2/include/CGAL/predicates_on_pointsH2.h @@ -0,0 +1,838 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 11 +// +// source : geometric_predicatesH2.fw +// file : predicates_on_pointsH2.h +// package : H2 (2.13) +// maintainer : Stefan Schirra +// revision : 2.13 +// revision_date : 11 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_PREDICATES_ON_POINTSH2_H +#define CGAL_PREDICATES_ON_POINTSH2_H + +#ifndef PVDH2_H +#include +#endif // PVDH2_H +#ifndef CGAL_PREDICATES_ON_POINTSH2_H +#include +#endif // CGAL_PREDICATES_ON_POINTSH2_H + +CGAL_BEGIN_NAMESPACE + +template < class FT, class RT> +CGAL_KERNEL_INLINE +bool +less_x(const PointH2& p, + const PointH2& q) +{ return ( p.hx()*q.hw() == q.hx()*p.hw() ); } + +template < class FT, class RT> +CGAL_KERNEL_INLINE +bool +less_y(const PointH2& p, + const PointH2& q) +{ return ( p.hy()*q.hw() == q.hy()*p.hw() ); } + +template < class FT, class RT> +CGAL_KERNEL_INLINE +bool +equal_xy(const PointH2& p, + const PointH2& q) +{ + const RT& phx = p.hx_ref(); + const RT& phy = p.hy_ref(); + const RT& phw = p.hw_ref(); + const RT& qhx = q.hx_ref(); + const RT& qhy = q.hy_ref(); + const RT& qhw = q.hw_ref(); + + RT pV = phx*qhw; + RT qV = qhx*phw; + if ( pV == qV ) + { + pV = phy*qhw; + qV = qhy*phw; + } + return ( pV == qV ) ? true : false; +} + +template < class FT, class RT> +CGAL_KERNEL_INLINE +Comparison_result +compare_lexicographically_xy(const PointH2& p, + const PointH2& q) +{ + const RT& phx = p.hx_ref(); + const RT& phy = p.hy_ref(); + const RT& phw = p.hw_ref(); + const RT& qhx = q.hx_ref(); + const RT& qhy = q.hy_ref(); + const RT& qhw = q.hw_ref(); + + RT pV = phx*qhw; + RT qV = qhx*phw; + if ( pV == qV ) + { + pV = phy*qhw; + qV = qhy*phw; + } + if ( pV < qV ) + { + return SMALLER; + } + else + { + return (qV < pV) ? LARGER : EQUAL; + } +} + + +template < class FT, class RT> +CGAL_KERNEL_INLINE +bool +lexicographically_xy_smaller_or_equal(const PointH2& p, + const PointH2& q) +{ + const RT& phx = p.hx_ref(); + const RT& phy = p.hy_ref(); + const RT& phw = p.hw_ref(); + const RT& qhx = q.hx_ref(); + const RT& qhy = q.hy_ref(); + const RT& qhw = q.hw_ref(); + + RT pV = phx * qhw; + RT qV = qhx * phw; + if ( qV < pV ) + { + return false; + } + else if ( pV < qV ) + { + return true; + } + + pV = phy * qhw; + qV = qhy * phw; + return ( pV <= qV ); +} + +template < class FT, class RT> +CGAL_KERNEL_INLINE +bool +lexicographically_xy_smaller(const PointH2& p, + const PointH2& q) +{ + const RT& phx = p.hx_ref(); + const RT& phy = p.hy_ref(); + const RT& phw = p.hw_ref(); + const RT& qhx = q.hx_ref(); + const RT& qhy = q.hy_ref(); + const RT& qhw = q.hw_ref(); + + RT pV = phx * qhw; + RT qV = qhx * phw; + if ( qV < pV ) + { + return false; + } + else if ( pV < qV ) + { + return true; + } + pV = phy * qhw; + qV = qhy * phw; + return ( pV < qV ); +} + +template < class FT, class RT> +CGAL_KERNEL_INLINE +bool +lexicographically_xy_larger(const PointH2& p, + const PointH2& q) +{ + const RT& phx = p.hx_ref(); + const RT& phy = p.hy_ref(); + const RT& phw = p.hw_ref(); + const RT& qhx = q.hx_ref(); + const RT& qhy = q.hy_ref(); + const RT& qhw = q.hw_ref(); + + RT pV = phx * qhw; + RT qV = qhx * phw; + if ( pV < qV ) + { + return false; + } + else if ( qV < pV ) + { + return true; + } + pV = phy * qhw; + qV = qhy * phw; + return ( qV < pV ); +} +template < class FT, class RT> +CGAL_KERNEL_INLINE +Comparison_result +compare_lexicographically_yx(const PointH2& p, + const PointH2& q) +{ + const RT& phx = p.hx_ref(); + const RT& phy = p.hy_ref(); + const RT& phw = p.hw_ref(); + const RT& qhx = q.hx_ref(); + const RT& qhy = q.hy_ref(); + const RT& qhw = q.hw_ref(); + + RT pV = phy*qhw; + RT qV = qhy*phw; + if ( pV == qV ) + { + pV = phx*qhw; + qV = qhx*phw; + } + if ( pV < qV ) + { + return SMALLER; + } + else + { + return ( qV < pV ) ? LARGER : EQUAL; + } +} + +template < class FT, class RT> +CGAL_KERNEL_INLINE +bool +lexicographically_yx_smaller_or_equal(const PointH2& p, + const PointH2& q) +{ + const RT& phx = p.hx_ref(); + const RT& phy = p.hy_ref(); + const RT& phw = p.hw_ref(); + const RT& qhx = q.hx_ref(); + const RT& qhy = q.hy_ref(); + const RT& qhw = q.hw_ref(); + + RT pV = phy * qhw; + RT qV = qhy * phw; + if ( qV < pV ) + { + return false; + } + else if ( pV < qV ) + { + return true; + } + pV = phx * qhw; + qV = qhx * phw; + return ( pV <= qV ); +} + +template < class FT, class RT> +CGAL_KERNEL_INLINE +bool +lexicographically_yx_smaller(const PointH2& p, + const PointH2& q) +{ + const RT& phx = p.hx_ref(); + const RT& phy = p.hy_ref(); + const RT& phw = p.hw_ref(); + const RT& qhx = q.hx_ref(); + const RT& qhy = q.hy_ref(); + const RT& qhw = q.hw_ref(); + + RT pV = phy * qhw; + RT qV = qhy * phw; + if ( qV < pV ) + { + return false; + } + else if ( pV < qV ) + { + return true; + } + pV = phx * qhw; + qV = qhx * phw; + return ( pV < qV ); +} + +template < class FT, class RT> +CGAL_KERNEL_INLINE +bool +lexicographically_yx_larger(const PointH2& p, + const PointH2& q) +{ + const RT& phx = p.hx_ref(); + const RT& phy = p.hy_ref(); + const RT& phw = p.hw_ref(); + const RT& qhx = q.hx_ref(); + const RT& qhy = q.hy_ref(); + const RT& qhw = q.hw_ref(); + + RT pV = phy * qhw; + RT qV = qhy * phw; + if ( pV < qV ) + { + return false; + } + else if ( qV < pV ) + { + return true; + } + pV = phx * qhw; + qV = qhx * phw; + return ( qV < pV ); +} + + +template < class FT, class RT> +CGAL_KERNEL_INLINE +Comparison_result +compare_x(const PointH2& p, + const PointH2& q) +{ + const RT& phx = p.hx_ref(); + const RT& phw = p.hw_ref(); + const RT& qhx = q.hx_ref(); + const RT& qhw = q.hw_ref(); + const RT RT0 = RT(0); + RT com = phx * qhw - qhx * phw; + if ( com < RT0 ) + { + return SMALLER; + } + else if ( RT0 < com ) + { + return LARGER; + } + return EQUAL; +} + +template < class FT, class RT> +CGAL_KERNEL_INLINE +Comparison_result +compare_y(const PointH2& p, + const PointH2& q) +{ + const RT& phy = p.hy_ref(); + const RT& phw = p.hw_ref(); + const RT& qhy = q.hy_ref(); + const RT& qhw = q.hw_ref(); + const RT RT0 = RT(0); + RT com = phy * qhw - qhy * phw; + if ( com < RT0 ) + { + return SMALLER; + } + else if ( RT0 < com ) + { + return LARGER; + } + return EQUAL; +} + +template < class FT, class RT> +CGAL_KERNEL_MEDIUM_INLINE +Orientation +orientation( const PointH2& p, + const PointH2& q, + const PointH2& r) +{ + const RT& phx = p.hx_ref(); + const RT& phy = p.hy_ref(); + const RT& phw = p.hw_ref(); + const RT& qhx = q.hx_ref(); + const RT& qhy = q.hy_ref(); + const RT& qhw = q.hw_ref(); + const RT& rhx = r.hx_ref(); + const RT& rhy = r.hy_ref(); + const RT& rhw = r.hw_ref(); + const RT RT0 = RT(0); + + // | A B | + // | C D | + + RT A = phx*rhw - phw*rhx; + RT B = phy*rhw - phw*rhy; + RT C = qhx*rhw - qhw*rhx; + RT D = qhy*rhw - qhw*rhy; + + RT det = A*D - B*C; + +/* + RT det_old = p.hx_ref() * (q.hy_ref()*r.hw_ref() - q.hw_ref()*r.hy_ref() ) + + p.hy_ref() * (q.hw_ref()*r.hx_ref() - q.hx_ref()*r.hw_ref() ) + + p.hw_ref() * (q.hx_ref()*r.hy_ref() - q.hy_ref()*r.hx_ref() ); + + if ( !(CGAL_NTS sign(det) == CGAL_NTS sign(det_old)) ) + { + std::cerr << "det: " << det << " det_old: " << det_old << flush; + } +*/ + + + + if (det < RT0 ) + { + return CLOCKWISE; + } + else + { + return (RT0 < det) ? COUNTERCLOCKWISE : COLLINEAR; + } +} + +template < class FT, class RT> +CGAL_KERNEL_MEDIUM_INLINE +bool +leftturn( const PointH2& p, + const PointH2& q, + const PointH2& r) +{ + const RT& phx = p.hx_ref(); + const RT& phy = p.hy_ref(); + const RT& phw = p.hw_ref(); + const RT& qhx = q.hx_ref(); + const RT& qhy = q.hy_ref(); + const RT& qhw = q.hw_ref(); + const RT& rhx = r.hx_ref(); + const RT& rhy = r.hy_ref(); + const RT& rhw = r.hw_ref(); + const RT RT0 = RT(0); + + // | A B | + // | C D | + + RT A = phx*rhw - phw*rhx; + RT B = phy*rhw - phw*rhy; + RT C = qhx*rhw - qhw*rhx; + RT D = qhy*rhw - qhw*rhy; + + RT det = A*D - B*C; + +/* + RT det_old = p.hx_ref() * (q.hy_ref()*r.hw_ref() - q.hw_ref()*r.hy_ref() ) + + p.hy_ref() * (q.hw_ref()*r.hx_ref() - q.hx_ref()*r.hw_ref() ) + + p.hw_ref() * (q.hx_ref()*r.hy_ref() - q.hy_ref()*r.hx_ref() ); + + if ( !(CGAL_NTS sign(det) == CGAL_NTS sign(det_old)) ) + { + std::cerr << "det: " << det << " det_old: " << det_old << flush; + } +*/ + + + return ( RT0 < det ); +} + +template < class FT, class RT> +CGAL_KERNEL_MEDIUM_INLINE +bool +rightturn( const PointH2& p, + const PointH2& q, + const PointH2& r) +{ + const RT& phx = p.hx_ref(); + const RT& phy = p.hy_ref(); + const RT& phw = p.hw_ref(); + const RT& qhx = q.hx_ref(); + const RT& qhy = q.hy_ref(); + const RT& qhw = q.hw_ref(); + const RT& rhx = r.hx_ref(); + const RT& rhy = r.hy_ref(); + const RT& rhw = r.hw_ref(); + const RT RT0 = RT(0); + + // | A B | + // | C D | + + RT A = phx*rhw - phw*rhx; + RT B = phy*rhw - phw*rhy; + RT C = qhx*rhw - qhw*rhx; + RT D = qhy*rhw - qhw*rhy; + + RT det = A*D - B*C; + +/* + RT det_old = p.hx_ref() * (q.hy_ref()*r.hw_ref() - q.hw_ref()*r.hy_ref() ) + + p.hy_ref() * (q.hw_ref()*r.hx_ref() - q.hx_ref()*r.hw_ref() ) + + p.hw_ref() * (q.hx_ref()*r.hy_ref() - q.hy_ref()*r.hx_ref() ); + + if ( !(CGAL_NTS sign(det) == CGAL_NTS sign(det_old)) ) + { + std::cerr << "det: " << det << " det_old: " << det_old << flush; + } +*/ + + + return ( det < RT0 ); +} + +template < class FT, class RT> +CGAL_KERNEL_MEDIUM_INLINE +bool +collinear( const PointH2& p, + const PointH2& q, + const PointH2& r) +{ + const RT& phx = p.hx_ref(); + const RT& phy = p.hy_ref(); + const RT& phw = p.hw_ref(); + const RT& qhx = q.hx_ref(); + const RT& qhy = q.hy_ref(); + const RT& qhw = q.hw_ref(); + const RT& rhx = r.hx_ref(); + const RT& rhy = r.hy_ref(); + const RT& rhw = r.hw_ref(); + const RT RT0 = RT(0); + + // | A B | + // | C D | + + RT A = phx*rhw - phw*rhx; + RT B = phy*rhw - phw*rhy; + RT C = qhx*rhw - qhw*rhx; + RT D = qhy*rhw - qhw*rhy; + + RT det = A*D - B*C; + +/* + RT det_old = p.hx_ref() * (q.hy_ref()*r.hw_ref() - q.hw_ref()*r.hy_ref() ) + + p.hy_ref() * (q.hw_ref()*r.hx_ref() - q.hx_ref()*r.hw_ref() ) + + p.hw_ref() * (q.hx_ref()*r.hy_ref() - q.hy_ref()*r.hx_ref() ); + + if ( !(CGAL_NTS sign(det) == CGAL_NTS sign(det_old)) ) + { + std::cerr << "det: " << det << " det_old: " << det_old << flush; + } +*/ + + + return ( det == RT0 ); +} +template +CGAL_KERNEL_MEDIUM_INLINE +Bounded_side +side_of_bounded_circle( const PointH2& q, + const PointH2& r, + const PointH2& s, + const PointH2& t) +{ + + const RT& qhx = q.hx_ref(); + const RT& qhy = q.hy_ref(); + const RT& qhw = q.hw_ref(); + const RT& rhx = r.hx_ref(); + const RT& rhy = r.hy_ref(); + const RT& rhw = r.hw_ref(); + const RT& shx = s.hx_ref(); + const RT& shy = s.hy_ref(); + const RT& shw = s.hw_ref(); + const RT& thx = t.hx_ref(); + const RT& thy = t.hy_ref(); + const RT& thw = t.hw_ref(); + const RT RT0 = RT(0); + + CGAL_kernel_precondition( ! collinear(q,r,s) ); + + // compute sign of |qx qy qx^2+qy^2 1 | | a b c d | + // | -- r -- | = | e f g h | + // determinant | -- s -- | = | i j k l | + // | -- t -- | | m n o p | + // where + + RT a = qhx*qhw; + RT b = qhy*qhw; + RT c = qhx*qhx + qhy*qhy; + RT d = qhw*qhw; + + RT e = rhx*rhw; + RT f = rhy*rhw; + RT g = rhx*rhx + rhy*rhy; + RT h = rhw*rhw; + + RT i = shx*shw; + RT j = shy*shw; + RT k = shx*shx + shy*shy; + RT l = shw*shw; + + RT m = thx*thw; + RT n = thy*thw; + RT o = thx*thx + thy*thy; + RT p = thw*thw; + + RT det = a * ( f*(k*p - l*o) + j*(h*o - g*p) + n*(g*l - h*k) ) + - e * ( b*(k*p - l*o) + j*(d*o - c*p) + n*(c*l - d*k) ) + + i * ( b*(g*p - h*o) + f*(d*o - c*p) + n*(c*h - d*g) ) + - m * ( b*(g*l - h*k) + f*(d*k - c*l) + j*(c*h - d*g) ); + + + if ( det == RT0 ) + { + return ON_BOUNDARY; + } + else + { + if (orientation(q,r,s) == CLOCKWISE) + { + det = -det; + } + return (RT0 < det ) ? ON_BOUNDED_SIDE : ON_UNBOUNDED_SIDE; + } +} + +template +CGAL_KERNEL_MEDIUM_INLINE +Oriented_side +side_of_oriented_circle( const PointH2& q, + const PointH2& r, + const PointH2& s, + const PointH2& t) +{ + + const RT& qhx = q.hx_ref(); + const RT& qhy = q.hy_ref(); + const RT& qhw = q.hw_ref(); + const RT& rhx = r.hx_ref(); + const RT& rhy = r.hy_ref(); + const RT& rhw = r.hw_ref(); + const RT& shx = s.hx_ref(); + const RT& shy = s.hy_ref(); + const RT& shw = s.hw_ref(); + const RT& thx = t.hx_ref(); + const RT& thy = t.hy_ref(); + const RT& thw = t.hw_ref(); + const RT RT0 = RT(0); + + CGAL_kernel_precondition( ! collinear(q,r,s) ); + + // compute sign of |qx qy qx^2+qy^2 1 | | a b c d | + // | -- r -- | = | e f g h | + // determinant | -- s -- | = | i j k l | + // | -- t -- | | m n o p | + // where + + RT a = qhx*qhw; + RT b = qhy*qhw; + RT c = qhx*qhx + qhy*qhy; + RT d = qhw*qhw; + + RT e = rhx*rhw; + RT f = rhy*rhw; + RT g = rhx*rhx + rhy*rhy; + RT h = rhw*rhw; + + RT i = shx*shw; + RT j = shy*shw; + RT k = shx*shx + shy*shy; + RT l = shw*shw; + + RT m = thx*thw; + RT n = thy*thw; + RT o = thx*thx + thy*thy; + RT p = thw*thw; + + RT det = a * ( f*(k*p - l*o) + j*(h*o - g*p) + n*(g*l - h*k) ) + - e * ( b*(k*p - l*o) + j*(d*o - c*p) + n*(c*l - d*k) ) + + i * ( b*(g*p - h*o) + f*(d*o - c*p) + n*(c*h - d*g) ) + - m * ( b*(g*l - h*k) + f*(d*k - c*l) + j*(c*h - d*g) ); + + + if ( det < RT0 ) + { + return ON_NEGATIVE_SIDE; + } + else + { + return (RT0 < det ) ? ON_POSITIVE_SIDE : ON_ORIENTED_BOUNDARY; + } +} +template +CGAL_KERNEL_MEDIUM_INLINE +bool +collinear_are_ordered_along_line( const PointH2& p, + const PointH2& q, + const PointH2& r ) +{ + const RT& phx = p.hx_ref(); + const RT& phy = p.hy_ref(); + const RT& phw = p.hw_ref(); + const RT& qhx = q.hx_ref(); + const RT& qhy = q.hy_ref(); + const RT& qhw = q.hw_ref(); + const RT& rhx = r.hx_ref(); + const RT& rhy = r.hy_ref(); + const RT& rhw = r.hw_ref(); + + if ( !(phx * rhw == rhx * phw ) ) // non-vertical ? + { + return !( ( ( phx * qhw < qhx * phw) + &&( rhx * qhw < qhx * rhw)) + ||( ( qhx * phw < phx * qhw) + &&( qhx * rhw < rhx * qhw)) ); + } + else if ( !(phy * rhw == rhy * phw ) ) + { + return !( ( ( phy * qhw < qhy * phw) + &&( rhy * qhw < qhy * rhw)) + ||( ( qhy * phw < phy * qhw) + &&( qhy * rhw < rhy * qhw)) ); + } + else + return (( phx*qhw == qhx*phw) && ( phy*qhw == qhy*phw)); +} + + +template +CGAL_KERNEL_INLINE +bool +are_ordered_along_line( const PointH2& p, + const PointH2& q, + const PointH2& r ) +{ + if ( collinear(p,q,r) ) + { + return collinear_are_ordered_along_line(p,q,r); + } + else + { + return false; + } +} + +template +CGAL_KERNEL_MEDIUM_INLINE +bool +collinear_are_strictly_ordered_along_line( const PointH2& p, + const PointH2& q, + const PointH2& r ) +{ + const RT& phx = p.hx_ref(); + const RT& phy = p.hy_ref(); + const RT& phw = p.hw_ref(); + const RT& qhx = q.hx_ref(); + const RT& qhy = q.hy_ref(); + const RT& qhw = q.hw_ref(); + const RT& rhx = r.hx_ref(); + const RT& rhy = r.hy_ref(); + const RT& rhw = r.hw_ref(); + + if ( !(phx * rhw == rhx * phw ) ) + { + return ( ( phx * qhw < qhx * phw) + &&( qhx * rhw < rhx * qhw)) + ||( ( qhx * phw < phx * qhw) // ( phx * qhw > qhx * phw) + &&( rhx * qhw < qhx * rhw)); // ( qhx * rhw > rhx * qhw) + } + else + { + return ( ( phy * qhw < qhy * phw) + &&( qhy * rhw < rhy * qhw)) + ||( ( qhy * phw < phy * qhw) // ( phy * qhw > qhy * phw) + &&( rhy * qhw < qhy * rhw)); // ( qhy * rhw > rhy * qhw) + } +} + + +template +CGAL_KERNEL_INLINE +bool +are_strictly_ordered_along_line( const PointH2& p, + const PointH2& q, + const PointH2& r ) +{ + if ( collinear(p,q,r) ) + { + return collinear_are_strictly_ordered_along_line(p,q,r); + } + else + { + return false; + } +} +template +inline +bool +x_equal( const PointH2& p, + const PointH2& q ) +{ return ( p.hx_ref()*q.hw_ref() == q.hx_ref()*p.hw_ref() ); } + +template +inline +bool +y_equal( const PointH2& p, + const PointH2& q ) +{ return ( p.hy_ref()*q.hw_ref() == q.hy_ref()*p.hw_ref() ); } +template +CGAL_KERNEL_MEDIUM_INLINE +Oriented_side +_where_wrt_L_wedge( const PointH2& p, + const PointH2& q ) +{ + const RT& phx = p.hx_ref(); + const RT& phy = p.hy_ref(); + const RT& phw = p.hw_ref(); + const RT& qhx = q.hx_ref(); + const RT& qhy = q.hy_ref(); + const RT& qhw = q.hw_ref(); + + int xs = (int)CGAL_NTS sign( qhx*phw - phx*qhw ); // sign( qx - px ) + int ys = (int)CGAL_NTS sign( qhy*phw - phy*qhw ); // sign( qy - py ) + + if (( xs == -1 ) || ( ys == -1 )) + { + return ON_NEGATIVE_SIDE; + } + if (( xs == 1 ) && ( ys == 1 )) + { + return ON_POSITIVE_SIDE; + } + return ON_ORIENTED_BOUNDARY; +} + +template < class FT, class RT > +CGAL_KERNEL_MEDIUM_INLINE +Comparison_result +compare_deltax_deltay(const PointH2& p, + const PointH2& q, + const PointH2& r, + const PointH2& s) +{ + const RT& phx = p.hx_ref(); + const RT& phw = p.hw_ref(); + const RT& qhx = q.hx_ref(); + const RT& qhw = q.hw_ref(); + const RT& rhy = r.hy_ref(); + const RT& rhw = r.hw_ref(); + const RT& shy = s.hy_ref(); + const RT& shw = s.hw_ref(); + const RT tbc1 = CGAL_NTS abs(phx*qhw - qhx*phw) * rhw*shw; + const RT tbc2 = CGAL_NTS abs(rhy*shw - shy*rhw) * phw*qhw; + + return (tbc2 < tbc1) ? LARGER + : (tbc1 == tbc2) ? EQUAL : SMALLER; + +} + +CGAL_END_NAMESPACE + + +#endif // CGAL_PREDICATES_ON_POINTSH2_H diff --git a/Packages/H2/include/CGAL/predicates_on_rtH2.h b/Packages/H2/include/CGAL/predicates_on_rtH2.h new file mode 100644 index 00000000000..d9cb00caf16 --- /dev/null +++ b/Packages/H2/include/CGAL/predicates_on_rtH2.h @@ -0,0 +1,350 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 11 +// +// source : predicates_on_rtH2.fw +// file : predicates_on_rtH2.h +// package : H2 (2.13) +// maintainer : Stefan Schirra +// revision : 2.13 +// revision_date : 11 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_PREDICATES_ON_RTH2_H +#define CGAL_PREDICATES_ON_RTH2_H + +CGAL_BEGIN_NAMESPACE + +template +CGAL_KERNEL_INLINE +Orientation +orientationH2( const RT& phx, const RT& phy, const RT& phw, + const RT& qhx, const RT& qhy, const RT& qhw, + const RT& rhx, const RT& rhy, const RT& rhw ) +{ + const RT RT0 = RT(0); + + // | A B | + // | C D | + + RT A = phx*rhw - phw*rhx; + RT B = phy*rhw - phw*rhy; + RT C = qhx*rhw - qhw*rhx; + RT D = qhy*rhw - qhw*rhy; + + RT det = A*D - B*C; + + + if (det < RT0 ) + { + return CLOCKWISE; + } + else + { + return (RT0 < det) ? COUNTERCLOCKWISE : COLLINEAR; + } +} + +template +CGAL_KERNEL_INLINE +bool +leftturnH2( const RT& phx, const RT& phy, const RT& phw, + const RT& qhx, const RT& qhy, const RT& qhw, + const RT& rhx, const RT& rhy, const RT& rhw ) +{ + const RT RT0 = RT(0); + + // | A B | + // | C D | + + RT A = phx*rhw - phw*rhx; + RT B = phy*rhw - phw*rhy; + RT C = qhx*rhw - qhw*rhx; + RT D = qhy*rhw - qhw*rhy; + + RT det = A*D - B*C; + + + return ( RT0 < det ); +} + +template +CGAL_KERNEL_INLINE +bool +rightturnH2(const RT& phx, const RT& phy, const RT& phw, + const RT& qhx, const RT& qhy, const RT& qhw, + const RT& rhx, const RT& rhy, const RT& rhw ) +{ + const RT RT0 = RT(0); + + // | A B | + // | C D | + + RT A = phx*rhw - phw*rhx; + RT B = phy*rhw - phw*rhy; + RT C = qhx*rhw - qhw*rhx; + RT D = qhy*rhw - qhw*rhy; + + RT det = A*D - B*C; + + + return ( det < RT0 ); +} + +template +CGAL_KERNEL_INLINE +bool +collinearH2(const RT& phx, const RT& phy, const RT& phw, + const RT& qhx, const RT& qhy, const RT& qhw, + const RT& rhx, const RT& rhy, const RT& rhw ) +{ + const RT RT0 = RT(0); + + // | A B | + // | C D | + + RT A = phx*rhw - phw*rhx; + RT B = phy*rhw - phw*rhy; + RT C = qhx*rhw - qhw*rhx; + RT D = qhy*rhw - qhw*rhy; + + RT det = A*D - B*C; + + + return ( det == RT0 ); +} +template +CGAL_KERNEL_INLINE +Bounded_side +side_of_bounded_circleH2( const RT& qhx, const RT& qhy, const RT& qhw, + const RT& rhx, const RT& rhy, const RT& rhw, + const RT& shx, const RT& shy, const RT& shw, + const RT& thx, const RT& thy, const RT& thw ) +{ + CGAL_kernel_precondition( ! collinearH2(qhx, qhy, ghw, + rhx, rhy, rhw, + shx, shy, shw) ); + + // compute sign of |qx qy qx^2+qy^2 1 | | a b c d | + // | -- r -- | = | e f g h | + // determinant | -- s -- | = | i j k l | + // | -- t -- | | m n o p | + // where + + RT a = qhx*qhw; + RT b = qhy*qhw; + RT c = qhx*qhx + qhy*qhy; + RT d = qhw*qhw; + + RT e = rhx*rhw; + RT f = rhy*rhw; + RT g = rhx*rhx + rhy*rhy; + RT h = rhw*rhw; + + RT i = shx*shw; + RT j = shy*shw; + RT k = shx*shx + shy*shy; + RT l = shw*shw; + + RT m = thx*thw; + RT n = thy*thw; + RT o = thx*thx + thy*thy; + RT p = thw*thw; + RT det = a * ( f*(k*p - l*o) + j*(h*o - g*p) + n*(g*l - h*k) ) + - e * ( b*(k*p - l*o) + j*(d*o - c*p) + n*(c*l - d*k) ) + + i * ( b*(g*p - h*o) + f*(d*o - c*p) + n*(c*h - d*g) ) + - m * ( b*(g*l - h*k) + f*(d*k - c*l) + j*(c*h - d*g) ); + + if ( det == RT0 ) + { + return ON_BOUNDARY; + } + else + { + if (orientation(q,r,s) == CLOCKWISE) + { + det = -det; + } + return (RT0 < det ) ? ON_BOUNDED_SIDE : ON_UNBOUNDED_SIDE; + } +} + +template +CGAL_KERNEL_INLINE +Oriented_side +side_of_oriented_circleH2(const RT& qhx, const RT& qhy, const RT& qhw, + const RT& rhx, const RT& rhy, const RT& rhw, + const RT& shx, const RT& shy, const RT& shw, + const RT& thx, const RT& thy, const RT& thw ) +{ + CGAL_kernel_precondition( ! collinearH2(qhx, qhy, ghw, + rhx, rhy, rhw, + shx, shy, shw) ); + + // compute sign of |qx qy qx^2+qy^2 1 | | a b c d | + // | -- r -- | = | e f g h | + // determinant | -- s -- | = | i j k l | + // | -- t -- | | m n o p | + // where + + RT a = qhx*qhw; + RT b = qhy*qhw; + RT c = qhx*qhx + qhy*qhy; + RT d = qhw*qhw; + + RT e = rhx*rhw; + RT f = rhy*rhw; + RT g = rhx*rhx + rhy*rhy; + RT h = rhw*rhw; + + RT i = shx*shw; + RT j = shy*shw; + RT k = shx*shx + shy*shy; + RT l = shw*shw; + + RT m = thx*thw; + RT n = thy*thw; + RT o = thx*thx + thy*thy; + RT p = thw*thw; + RT det = a * ( f*(k*p - l*o) + j*(h*o - g*p) + n*(g*l - h*k) ) + - e * ( b*(k*p - l*o) + j*(d*o - c*p) + n*(c*l - d*k) ) + + i * ( b*(g*p - h*o) + f*(d*o - c*p) + n*(c*h - d*g) ) + - m * ( b*(g*l - h*k) + f*(d*k - c*l) + j*(c*h - d*g) ); + + if ( det < RT0 ) return ON_NEGATIVE_SIDE; + else return (RT0 < det ) ? ON_POSITIVE_SIDE : + ON_ORIENTED_BOUNDARY; +} +template +CGAL_KERNEL_INLINE +Comparison_result +compare_lexicographically_xyH2(const RT& phx, const RT& phy, const RT& phw, + const RT& qhx, const RT& qhy, const RT& qhw) +{ + RT pV = phx*qhw; + RT qV = qhx*phw; + if ( pV == qV ) + { + pV = phy*qhw; + qV = qhy*phw; + } + if ( pV < qV ) + { + return SMALLER; + } + else + { + return (qV < pV) ? LARGER : EQUAL; + } +} + +template +CGAL_KERNEL_INLINE +Comparison_result +compare_xH2( const RT& phx, const RT& phw, + const RT& qhx, const RT& qhw ) +{ + RT com = phx * qhw - qhx * phw; + if ( com < RT0 ) + { + return SMALLER; + } + else if ( RT0 < com ) + { + return LARGER; + } + return EQUAL; +} + +// No compare_yH2; use compare_xH2( py, pw, qy, qw) + +template < class RT > +CGAL_KERNEL_INLINE +Comparison_result +compare_deltax_deltayH2(const RT& phx, const RT& phw, + const RT& qhx, const RT& qhw, + const RT& rhy, const RT& rhw, + const RT& shy, const RT& shw ) +{ + const RT tbc1 = CGAL_NTS abs(phx*qhw - qhx*phw) * rhw*shw; + const RT tbc2 = CGAL_NTS abs(rhy*shw - shy*rhw) * phw*qhw; + return (tbc2 < tbc1) ? LARGER + : (tbc1 == tbc2) ? EQUAL : SMALLER; + +} + +template +CGAL_KERNEL_INLINE +bool +collinear_are_ordered_along_lineH2( + const RT& phx, const RT& phy, const RT& phw, + const RT& qhx, const RT& qhy, const RT& qhw, + const RT& rhx, const RT& rhy, const RT& rhw + ) +{ + if ( !(phx * rhw == rhx * phw ) ) // non-vertical ? + { + return !( ( ( phx * qhw < qhx * phw) + &&( rhx * qhw < qhx * rhw)) + ||( ( qhx * phw < phx * qhw) + &&( qhx * rhw < rhx * qhw)) ); + } + else if ( !(phy * rhw == rhy * phw ) ) + { + return !( ( ( phy * qhw < qhy * phw) + &&( rhy * qhw < qhy * rhw)) + ||( ( qhy * phw < phy * qhw) + &&( qhy * rhw < rhy * qhw)) ); + } + else + return (( phx*qhw == qhx*phw) && ( phy*qhw == qhy*phw)); +} + +template +CGAL_KERNEL_INLINE +bool +collinear_are_strictly_ordered_along_lineH2( + const RT& phx, const RT& phy, const RT& phw, + const RT& qhx, const RT& qhy, const RT& qhw, + const RT& rhx, const RT& rhy, const RT& rhw) +{ + if ( !(phx * rhw == rhx * phw ) ) + { + return ( ( phx * qhw < qhx * phw) + &&( qhx * rhw < rhx * qhw)) + ||( ( qhx * phw < phx * qhw) // ( phx * qhw > qhx * phw) + &&( rhx * qhw < qhx * rhw)); // ( qhx * rhw > rhx * qhw) + } + else + { + return ( ( phy * qhw < qhy * phw) + &&( qhy * rhw < rhy * qhw)) + ||( ( qhy * phw < phy * qhw) // ( phy * qhw > qhy * phw) + &&( rhy * qhw < qhy * rhw)); // ( qhy * rhw > rhy * qhw) + } +} + + + +CGAL_END_NAMESPACE + + +#ifdef CGAL_ARITHMETIC_FILTER_H +#include +#endif // CGAL_ARITHMETIC_FILTER_H + +#endif // CGAL_PREDICATES_ON_RTH2_H diff --git a/Packages/H2/long_description.txt b/Packages/H2/long_description.txt new file mode 100644 index 00000000000..3ba028695a0 --- /dev/null +++ b/Packages/H2/long_description.txt @@ -0,0 +1,162 @@ +2.13 (11 Oct 2000) + +- use of keyword 'or' removed in CircleH2 + +2.12 (03 Aug 2000) + +- bug in input operator of CircleH2 fixed (reported by Matthias) + +2.11 (26 Jul 2000) + +- in-place-new replaced by Handle_for( RefCounted ) constructor calls + and calls of Handle_for::initialize_with( RefCounted ) +- identical(.) and id() member functions removed (base class Handle_for<> + has a member function identical(.) since version 3.9) + +2.10 (08 Jun 2000) + +- CGAL_NTS used + +2.9 (05 Jun 2000) + +- Handle_for( RefCounted ) constructor used as well as + Handle_for::initialize_with( RefCounted ) for P,V,D. + +2.8 (30 May 2000) + +- Reflection (on a line) added to Aff_transformationH2 +- Aff_transformationH2 now use Handle_for<..., No_op_allocator<...>> +- compare_x_at_y() functions added +- a_ref(), ... added to LineH2 + +2.7 (18 Apr 2000) + +- -Rot... -> Rot... in Aff_transformationH2.h +- Iso_rectangleH2 now uses Handle_for<> +- LineH2 now uses Handle_for<> +- RayH2 now uses Handle_for<> +- SegmentH2 now uses Handle_for<> + +2.6 (07 Apr 2000) + +- Handle_for used for P,V,D, & TriangleH2 +- opposite() mf added to TriangleH2 +- calls of global opposite qualified by CGAL:: + +2.5 (18 Feb 2000) + +- DirectionH2::counterclockwise_in_between(d1,d2) fixed + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 2 . 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +2.4.7 -> 2.4.8 (10 Dec 99) +- CGAL_SCOPE added to friend declarations origin_plus|minus... and + ...plus|minus_origin for VectorH2 and PointH2 + +2.4.6 -> 2.4.7 (04 Dec 99) +- submission script revised + +2.4.5 -> 2.4.6 (29 Nov 99) +- revised forward declaration of origin_plus_vector and origin_minus_vector + +2.4.4 -> 2.4.5 (25 Nov 99) +- removed friend declaration of operator+(Origin, VectorH2) + +2.4.3 -> 2.4.4 (07 Nov 99) +- Identity + rep in Aff_transformationH2 + +2.4.2 -> 2.4.3 (05 Nov 99) +- 'initialisation of const RT& by temporary' fixed in + + +2.4.1 -> 2.4.2 (08 Oct 99) +- DirectionH2::vector() replaced by DirectionH2::to_vector() + +2.4 -> 2.4.1 (14 Sep 99) +- ? + +2.3 -> 2.4 (14 Sep 99) +- equal_xy defined for PointH2 + +2.2 -> 2.3 (04 Aug 99) +- updates/workarounds for gcc-2.95: + s/friend inline/friend CGAL_FRIEND_INLINE + s/friend CGAL_KERNEL_INLINE/friend CGAL_KERNEL_FRIEND_INLINE + made all operator-() friends non-friends + +2.1.3 -> 2.2 (22 Jun 99) +- 'inline' placement fixed in PVDH2.h + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 2 . 0 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +2.1.2 -> 2.1.3 (21 May 99) +- code chunk in rewritten + as suggested by G.-J. in order to get rid of problems in internal + compiler error in BooleanOperations + +2.1.1 -> 2.1.2 (28 Apr 99) +- sign() prefixed by CGAL:: + +2.1 -> 2.1.1 (28 Apr 99) +- added CGAL:: to calls of compare() + +2.0.5 -> 2.1 (16 Apr 99) +- iostream parts prefixed by std:: + +2.0.4 -> 2.0.5 (30 Mar 99) +- to_double() prefixed by CGAL:: + +2.0.3 -> 2.0.4 (24 Mar 99) +- flag CGAL_NO_NAMESPACE corrected :) + +2.0.2 -> 2.0.3 (20 Mar 99) +- flag CGAL_NO_NAMESPACE corrected + +2.0.1 -> 2.0.2 (14 Mar 99) +- std::swap used in CircleH2 and bbox() for points + +2.0 -> 2.0.1 (24 Feb 99) +- CGAL_[BEGIN|END]_NAMESPACE used + +1.3.1 -> 2.0 (04 Feb 99) +- namespace CGAL { } introduced + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 1 . 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +1.3 -> 1.3.1 +- minor correction in + +1.2.3 -> 1.3 (15 Dec 98) +- Use of CGAL...INLINE made consistent between declarations and + definitions (otherwise SunPro CC 4.2 does not like it). +- #include added in + predicates_on_rtH2.h + +1.2.2 -> 1.2.3 (23 Nov 98) +- modifications in predicates_on_pointsH2.h due to changing return + type of CGAL_sign() from int to CGAL_Sign +- predicates_on_rtH2.h with limited functionality added +- included in + +1.2.1 -> 1.2.2 (07 Sep 98) +- are_ordered_along_line( ) modified + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 1 . 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 1 . 0 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +1.2 -> 1.2.1 +- bug in IO for Iso_rectangleH2 fixed + +1.1 -> 1.2 +- made fit for egcs +- number type `bug' in LineH2::point() corrected + +1.0 -> 1.1 +- are_ordered_along_line and are_strictly_ordered_along_line + and the corresponding collinear version are fixed now + +0.9 -> 1.0 +- added functionality as described in _2 description +- new inline policy, cf. kernel_basic.h + diff --git a/Packages/H2/version b/Packages/H2/version new file mode 100644 index 00000000000..b4ded802e4b --- /dev/null +++ b/Packages/H2/version @@ -0,0 +1,2 @@ +2.13 (11 Oct 2000) +maintainer: Stefan Schirra diff --git a/Packages/H3/changes.txt b/Packages/H3/changes.txt new file mode 100644 index 00000000000..68d29da5903 --- /dev/null +++ b/Packages/H3/changes.txt @@ -0,0 +1,182 @@ +2.14 (15 Oct 2000) + +- SphereH3.h: Default argument value redeclaration fixed + +2.13 (11 Oct 2000) + +- use of keyword 'or' removed in SphereH3 + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 2 . 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +2.12 (16 Aug 2000) + +- cross_product is not a friend anymore, neither of VectorH3 nor + of DirectionH3 (is currently not necessary, since all functions + used are public) +- call of cross_product in PlaneH3 replaced by code from cross_product. + There have been strange problems with bcc5.5. Hope they are solved + by this fix. + +2.11 (26 Jul 2000) + +- in-place-new replaced by Handle_for( RefCounted ) constructor calls + and calls of Handle_for::initialize_with( RefCounted ) +- identical(.) and id() member functions removed (base class Handle_for<> + has a member functions identical(.) and id() since version 3.9) + +2.10 (20 Jul 2000) + +- CGAL_ prefix added in + o orientation_predicatesH3.h:#define ORIENTATION_PREDICATESH3_H + o predicates_on_pointsH3.h:#define PREDICATES_ON_POINTSH3_H + +2.9 (28 Jun 2000) + +- SphereH3 added +- some constructions added + plane bisector( point, point) + point gp_linear_intersection( plane, plane, plane) + point circumcenter( point, point, point) + +2.8 (08 Jun 2000) + +- CGAL_NTS used + +2.7 (19 Apr 2000) + +- LineH3 now uses Handle_for<> +- PlaneH3 now uses Handle_for<> +- RayH3 now uses Handle_for<> +- SegmentH3 now uses Handle_for<> +- TetrahedronH3 now uses Handle_for<> +- TriangleH3 now uses Handle_for<> +- leading _ with FT,RT removed in Aff_transformationH3 + +2.6 (03 Apr 2000) + +- h?_ref() access added to PointH3 + +2.5 (30 Mar 2000) + +- Handle_for> used for PointH3, VectorH3, and DirectionH3 + +2.4 (16 Feb 2000) + +- Iso_cuboidH3 revised + Handle_for<> used in Iso_cuboidH3 + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 2 . 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +2.3.6 -> 2.3.7 (03 Dec 99) +- typename added before std::vector< PointH3 >::iterator + (detected by -pedantic with gcc-2.95) + +2.3.5 -> 2.3.6 (07 Nov 99) +- Identity + rep in Aff_transformationH3 + +2.3.4 -> 2.3.5 (08 Oct 99) +- DirectionH3::vector() replaced by DirectionH3::to_vector() + +2.3.3 -> 2.3.4 (17 Sep 99) +- distance_predicatesH3.h added + +2.3.2 -> 2.3.3 (14 Sep 99) +- -- + +2.3.1 -> 2.3.2 (01 Sep 99) +- qualified sign by CGAL:: + +2.3 -> 2.3.1 (09 Aug 99) +- coplanar_orientation(p,q,r,s) added + +2.2.1 -> 2.3 (04 Aug 99) +- updates/workarounds for gcc-2.95: + s/friend inline/friend CGAL_FRIEND_INLINE + s/friend CGAL_KERNEL_INLINE/friend CGAL_KERNEL_FRIEND_INLINE + made all operator-() friends non-friends in + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 2 . 0 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +2.2 -> 2.2.1 (26 May 99) +- CGAL_KERNEL_INLINE added for declaration of cross_product on + DirectionH3 + +2.1.3 -> 2.2 (20 May 99) +- equality test for TetrahedronH3 fixed + +2.1.2 -> 2.1.3 (06 May 99) +- inline and CGAL_KERNEL_INLINE added to forward declarations in PVDH3.h + (external/internal linkage conflict warning by mips) + +2.1.1 -> 2.1.2 (28 Apr 99) +- sign() qualified by CGAL:: (PlaneH3) + +2.1 -> 2.1.1 (28 Apr 99) +- prefixed compare() by CGAL:: + +2.0.5 -> 2.1 (16 Apr 99) +- iostream parts prefixed by std:: + +2.0.4 -> 2.0.5 (30 Mar 99) +- to_double() prefixed by CGAL:: + +2.0.3 -> 2.0.4 (22 Mar 99) +- call of sign() DirectionH3::operator==( const DirectionH3& d) + 'prefixed' by CGAL:: + +2.0.2 -> 2.0.3 (20 Mar 99) +- flag CGAL_NO_NAMESPACE corrected + +2.0.1 -> 2.0.2 (14 Mar 99) +- std::swap used in code for bbox() + +2.0 -> 2.0.1 (24 Feb 99) +- CGAL_[BEGIN|END]_NAMESPACE used + +1.5 -> 2.0 +- namespace CGAL { } introduced + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 1 . 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +1.4 -> 1.5 +- Use of CGAL...INLINE made consistent between declarations and + definitions (otherwise SunPro CC 4.2 does not like it). + +1.3.1 -> 1.4 +- bug in CGAL_collinear_are_ordered_along_line(p,q,r) fixed; case p == r +- CGAL_PointH3< > operator-(const CGAL_Origin&, const CGAL_VectorH3< >&) + added +- warning in VectorH3::cartesian(int i) fixed + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 1 . 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +1.3 -> 1.3.1 +- bugs in PlaneH3::to_2d() and PlaneH3::to_3d() fixed + +1.2 -> 1.3 +- basic_constructionsH3.h extended (circumcenter) +- (strict_)order_along_line added/updated +- midpoint(p,q) added + +1.1.1 -> 1.2 +- side_of...sphere predicates added +- assert replaced by CGAL_kernel_assertion in TetrahedronH3.h + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 1 . 0 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +1.1. -> 1.1.1 +- basic_constructionsH3.h added +- PlaneH3::projection(...) added + +1.0.1 -> 1.1 +- made fit for egcs + +1.0 -> 1.0.1 +- predicates_on_pointsH3.h is now also included in LineH3.h + +0.9 -> 1.0 +- New access functions have been added to Aff_transformation. +- New inline policy is now used: There are several levels of + inlining to be defined in kernel_basic.h. +- typename keyword has been added +- warnings for `unreachable statements' should disappear diff --git a/Packages/H3/description.txt b/Packages/H3/description.txt new file mode 100644 index 00000000000..d9af580065e --- /dev/null +++ b/Packages/H3/description.txt @@ -0,0 +1 @@ +3d homogeneous kernel diff --git a/Packages/H3/include/CGAL/Aff_transformationH3.h b/Packages/H3/include/CGAL/Aff_transformationH3.h new file mode 100644 index 00000000000..7b1aab506bf --- /dev/null +++ b/Packages/H3/include/CGAL/Aff_transformationH3.h @@ -0,0 +1,930 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : Aff_transformationH3.fw +// file : Aff_transformationH3.h +// package : H3 (2.14) +// maintainer : Stefan Schirra +// revision : 2.14 +// revision_date : 15 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_AFF_TRANSFORMATIONH3_H +#define CGAL_AFF_TRANSFORMATIONH3_H + +#if defined(CGAL_CFG_INCOMPLETE_TYPE_BUG_1) && \ + !defined(CGAL_NO_PLANE_TRANSFORM_IN_AT) +#define CGAL_NO_PLANE_TRANSFORM_IN_AT +#endif // CGAL_CFG_INCOMPLETE_TYPE_BUG_1 + +#ifndef CGAL_DETERMINANT_H +#include +#endif // CGAL_DETERMINANT_H + + +CGAL_BEGIN_NAMESPACE + +// forward declaration +template < class FT, class RT > +class Aff_transformationH3; + +template < class FT, class RT > +class Aff_transformation_repH3; + +template < class FT, class RT > +Aff_transformationH3 +_general_transformation_composition ( + Aff_transformation_repH3 l, + Aff_transformation_repH3 r + ); + +template +class Aff_transformation_rep_baseH3 : public Rep +// abstract base class of aff transformation representations +{ +public: + typedef FT_ FT; + typedef RT_ RT; + + virtual ~Aff_transformation_rep_baseH3(){} + + virtual PointH3 + transform(const PointH3&) const = 0; + + virtual VectorH3 + transform(const VectorH3&) const = 0; + + virtual DirectionH3 + transform(const DirectionH3&) const = 0; + +#ifndef CGAL_NO_PLANE_TRANSFORM_IN_AT + virtual PlaneH3 + transform(const PlaneH3&) const = 0; +#endif // CGAL_NO_PLANE_TRANSFORM_IN_AT + + virtual Aff_transformationH3 + inverse() const = 0; + + virtual Aff_transformationH3 + transpose() const = 0; + + virtual Aff_transformation_repH3 + general_form() const = 0; + + virtual bool + is_even() const = 0; + + virtual RT + homogeneous(int i, int j) const = 0; + + virtual FT + cartesian(int i, int j) const = 0; +}; + +template < class FT_, class RT_ > +class Aff_transformation_repH3 : public Aff_transformation_rep_baseH3 +{ +public: + typedef FT_ FT; + typedef RT_ RT; + + Aff_transformation_repH3(); + Aff_transformation_repH3( + const RT& m00, const RT& m01, const RT& m02, const RT& m03, + const RT& m10, const RT& m11, const RT& m12, const RT& m13, + const RT& m20, const RT& m21, const RT& m22, const RT& m23, + const RT& m33); + virtual ~Aff_transformation_repH3() {} + + virtual PointH3 + transform(const PointH3& p) const; + + virtual VectorH3 + transform(const VectorH3& v) const; + + virtual DirectionH3 + transform(const DirectionH3& dir) const; + +#ifndef CGAL_NO_PLANE_TRANSFORM_IN_AT + virtual PlaneH3 + transform(const PlaneH3& pl) const; +#endif // CGAL_NO_PLANE_TRANSFORM_IN_AT + + virtual Aff_transformationH3 + inverse() const; + + virtual Aff_transformation_repH3 + general_form() const; + + virtual Aff_transformationH3 + transpose() const; + + virtual bool + is_even() const; + + virtual RT + homogeneous(int i, int j) const ; + + virtual FT + cartesian(int i, int j) const ; + +friend class Aff_transformationH3; + +friend +Aff_transformationH3 +_general_transformation_composition CGAL_NULL_TMPL_ARGS ( + Aff_transformation_repH3 l, + Aff_transformation_repH3 r + ); + +friend +std::ostream & +operator<< CGAL_NULL_TMPL_ARGS (std::ostream & out, + const Aff_transformationH3& t); + +private: + RT t00, t01, t02, t03; + RT t10, t11, t12, t13; + RT t20, t21, t22, t23; + RT t33; +}; + +template < class FT_, class RT_ > +class Identity_repH3 : public Aff_transformation_rep_baseH3 +{ +public: + typedef FT_ FT; + typedef RT_ RT; + + Identity_repH3() + {} + + virtual ~Identity_repH3() + {} + + virtual PointH3 + transform(const PointH3& p) const + { return p; } + + virtual VectorH3 + transform(const VectorH3& v) const + { return v; } + + virtual DirectionH3 + transform(const DirectionH3& dir) const + { return dir; } + +#ifndef CGAL_NO_PLANE_TRANSFORM_IN_AT + virtual PlaneH3 + transform(const PlaneH3& pl) const + { return pl; } +#endif // CGAL_NO_PLANE_TRANSFORM_IN_AT + + virtual Aff_transformationH3 + inverse() const + { return Aff_transformationH3( IDENTITY); } + + virtual Aff_transformation_repH3 + general_form() const; + + virtual Aff_transformationH3 + transpose() const + { return Aff_transformationH3( IDENTITY); } + + virtual bool + is_even() const + { return true; } + + virtual RT + homogeneous(int i, int j) const + { return (i==j) ? RT(1) : RT(0); } + + virtual FT + cartesian(int i, int j) const + { return (i==j) ? FT(1) : FT(0); } +}; + + +template < class FT_, class RT_ > +class Translation_repH3 : public Aff_transformation_rep_baseH3 +{ +public: + typedef FT_ FT; + typedef RT_ RT; + + Translation_repH3(); + + Translation_repH3( const VectorH3& v); + + virtual ~Translation_repH3() {} + + + virtual PointH3 + transform(const PointH3& p) const; + + virtual VectorH3 + transform(const VectorH3& v) const; + + virtual DirectionH3 + transform(const DirectionH3& dir) const; + +#ifndef CGAL_NO_PLANE_TRANSFORM_IN_AT + virtual PlaneH3 + transform(const PlaneH3& pl) const; +#endif // CGAL_NO_PLANE_TRANSFORM_IN_AT + + virtual Aff_transformationH3 + inverse() const; + + virtual Aff_transformation_repH3 + general_form() const; + + virtual Aff_transformationH3 + transpose() const; + + virtual bool + is_even() const; + + virtual RT + homogeneous(int i, int j) const ; + + virtual FT + cartesian(int i, int j) const ; + +friend class Aff_transformationH3; + +private: + VectorH3 tv; +}; + + +template < class FT_, class RT_ > +class Aff_transformationH3 : public Handle +{ +public: + typedef FT_ FT; + typedef RT_ RT; + + Aff_transformationH3(); + + Aff_transformationH3(const Aff_transformationH3& tbc); + + // Identity + Aff_transformationH3(const Identity_transformation&); + + // Translation + Aff_transformationH3(const Translation& , const VectorH3& v); + + // Scaling + Aff_transformationH3(const Scaling&, const RT& num, const RT& den); + + // General form + Aff_transformationH3( + const RT& m00, const RT& m01, const RT& m02, const RT& m03, + const RT& m10, const RT& m11, const RT& m12, const RT& m13, + const RT& m20, const RT& m21, const RT& m22, const RT& m23, + const RT& m33); + Aff_transformationH3( + const RT& m00, const RT& m01, const RT& m02, + const RT& m10, const RT& m11, const RT& m12, + const RT& m20, const RT& m21, const RT& m22, + const RT& m33); + +#ifdef CGAL_CFG_INCOMPLETE_TYPE_BUG_1 + Aff_transformationH3(Aff_transformation_repH3* ptr); +#endif // CGAL_CFG_INCOMPLETE_TYPE_BUG_1 + + ~Aff_transformationH3(); + + + PointH3 + transform(const PointH3& p) const; + + VectorH3 + transform(const VectorH3& v) const; + + DirectionH3 + transform(const DirectionH3& d) const; + +#ifndef CGAL_NO_PLANE_TRANSFORM_IN_AT + PlaneH3 + transform(const PlaneH3& pl) const; +#endif // CGAL_NO_PLANE_TRANSFORM_IN_AT + + Aff_transformationH3 + inverse() const; + + Aff_transformationH3 + transpose() const; + + bool + is_even() const; + + bool + is_odd() const; + + FT + cartesian(int i, int j) const + { return ptr()->cartesian(i,j); } + + RT + homogeneous(int i, int j) const + { return ptr()->homogeneous(i,j); } + + FT + m(int i, int j) const + { return ptr()->cartesian(i,j); } + + RT + hm(int i, int j) const + { return ptr()->homogeneous(i,j); } + +// protected: + Aff_transformation_rep_baseH3* ptr() const; +}; + + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +Aff_transformation_repH3::Aff_transformation_repH3() +#ifdef INITIALIZE_AFF_TRANSFORMATIONS + : t00(RT(1)), t01(RT(0)), t02(RT(0)), t03(RT(0)), + t10(RT(0)), t11(RT(1)), t12(RT(0)), t13(RT(0)), + t20(RT(0)), t21(RT(0)), t22(RT(1)), t23(RT(0)), + t33(RT(1)) +#endif // INITIALIZE_AFF_TRANSFORMATIONS +{} + + + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +Aff_transformation_repH3::Aff_transformation_repH3( + const RT& m00, const RT& m01, const RT& m02, const RT& m03, + const RT& m10, const RT& m11, const RT& m12, const RT& m13, + const RT& m20, const RT& m21, const RT& m22, const RT& m23, + const RT& m33) + : t00(m00), t01(m01), t02(m02), t03(m03), + t10(m10), t11(m11), t12(m12), t13(m13), + t20(m20), t21(m21), t22(m22), t23(m23), + t33(m33) +{} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +PointH3 +Aff_transformation_repH3::transform(const PointH3& p) const +{ + return + PointH3(t00 * p.hx() + t01 * p.hy() + t02 * p.hz() + t03 * p.hw(), + t10 * p.hx() + t11 * p.hy() + t12 * p.hz() + t13 * p.hw(), + t20 * p.hx() + t21 * p.hy() + t22 * p.hz() + t23 * p.hw(), + t33 * p.hw()); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +VectorH3 +Aff_transformation_repH3::transform(const VectorH3& v) const +{ + return + VectorH3(t00 * v.hx() + t01 * v.hy() + t02 * v.hz(), + t10 * v.hx() + t11 * v.hy() + t12 * v.hz(), + t20 * v.hx() + t21 * v.hy() + t22 * v.hz(), + t33 * v.hw() ); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +DirectionH3 +Aff_transformation_repH3::transform(const DirectionH3& d) const +{ + VectorH3 v( d.to_vector() ); + return DirectionH3(t00 * v.hx() + t01 * v.hy() + t02 * v.hz(), + t10 * v.hx() + t11 * v.hy() + t12 * v.hz(), + t20 * v.hx() + t21 * v.hy() + t22 * v.hz(), + t33 * v.hw() ); + +/* + return DirectionH3( t00 * d.hx() + t01 * d.hy() + t02 * d.hz(), + t10 * d.hx() + t11 * d.hy() + t12 * d.hz(), + t20 * d.hx() + t21 * d.hy() + t22 * d.hz() ); +*/ +} + +#ifndef CGAL_NO_PLANE_TRANSFORM_IN_AT +template < class FT, class RT > +CGAL_KERNEL_INLINE +PlaneH3 +Aff_transformation_repH3::transform(const PlaneH3& pl) const +{ + if ( is_even() ) + { + return + PlaneH3( + transform(pl.point() ), + transpose().inverse().transform(pl.orthogonal_direction() )); + } + else + { + return + PlaneH3( + transform(pl.point() ), + -(transpose().inverse().transform(pl.orthogonal_direction() ))); + } +} +#endif // CGAL_NO_PLANE_TRANSFORM_IN_AT + +template < class FT, class RT > +CGAL_KERNEL_INLINE +Aff_transformationH3 +Aff_transformation_repH3::inverse() const +{ + const RT RT0(0); + return Aff_transformationH3( + det3x3_by_formula( t11, t12, t13, + t21, t22, t23, // i 00 + RT0, RT0, t33 ), + + - det3x3_by_formula( t01, t02, t03, + t21, t22, t23, // i 01 + RT0, RT0, t33 ), + + det3x3_by_formula( t01, t02, t03, + t11, t12, t13, // i 02 + RT0, RT0, t33 ), + + - det3x3_by_formula( t01, t02, t03, + t11, t12, t13, // i 03 + t21, t22, t23 ), + + + - det3x3_by_formula( t10, t12, t13, + t20, t22, t23, // i 10 + RT0, RT0, t33 ), + + det3x3_by_formula( t00, t02, t03, + t20, t22, t23, // i 11 + RT0, RT0, t33 ), + + - det3x3_by_formula( t00, t02, t03, + t10, t12, t13, // i 12 + RT0, RT0, t33 ), + + det3x3_by_formula( t00, t02, t03, + t10, t12, t13, // i 13 + t20, t22, t23 ), + + + det3x3_by_formula( t10, t11, t13, + t20, t21, t23, // i 20 + RT0, RT0, t33 ), + + - det3x3_by_formula( t00, t01, t03, + t20, t21, t23, // i 21 + RT0, RT0, t33 ), + + det3x3_by_formula( t00, t01, t03, + t10, t11, t13, // i 22 + RT0, RT0, t33 ), + + - det3x3_by_formula( t00, t01, t03, + t10, t11, t13, // i 23 + t20, t21, t23 ), + + + det3x3_by_formula( t00, t01, t02, + t10, t11, t12, // i 33 + t20, t21, t22 ) + ) ; +} + +template < class FT, class RT > +inline +Aff_transformation_repH3 +Aff_transformation_repH3::general_form() const +{ return *this; } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +Aff_transformationH3 +Aff_transformation_repH3::transpose() const +{ + const RT RT0(0); + return Aff_transformationH3( t00, t10, t20, RT0, + t01, t11, t21, RT0, + t02, t12, t22, RT0, + t33); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +Aff_transformation_repH3::is_even() const +{ + return (CGAL_NTS sign( t33 * det3x3_by_formula(t00, t01, t02, + t10, t11, t12, + t20, t21, t22 ) ) == 1 ); +} + +template < class FT, class RT > +CGAL_KERNEL_LARGE_INLINE +RT +Aff_transformation_repH3:: +homogeneous(int i, int j) const +{ + CGAL_kernel_precondition( (i >= 0) && (i <= 3) && (j >= 0) && (j <= 3) ); + const RT RT0(0); + switch (i) + { + case 0: switch (j) + { + case 0: return t00; + case 1: return t01; + case 2: return t02; + case 3: return t03; + } + case 1: switch (j) + { + case 0: return t10; + case 1: return t11; + case 2: return t12; + case 3: return t13; + } + case 2: switch (j) + { + case 0: return t20; + case 1: return t21; + case 2: return t22; + case 3: return t23; + } + case 3: switch (j) + { + case 0: return RT0; + case 1: return RT0; + case 2: return RT0; + case 3: return t33; + } + } + return RT0; +} + +template < class FT, class RT > +inline +FT +Aff_transformation_repH3:: +cartesian(int i, int j) const +{ + return FT(homogeneous(i,j)) / FT(t33); +} + +template +Aff_transformation_repH3 +Identity_repH3::general_form() const +{ + const RT RT0(0); + const RT RT1(1); + return Aff_transformation_repH3(RT1, RT0, RT0, RT0, + RT0, RT1, RT0, RT0, + RT0, RT0, RT1, RT0, + RT1 ); +} +// not used (default ctor in Aff_transformationH3 +// calls default ctor of Aff_transformation_repH3 ) +template < class FT, class RT > +inline +Translation_repH3::Translation_repH3() +#ifdef INITIALIZE_AFF_TRANSFORMATIONS + : tv( VectorH3( RT(0), RT(0) )) +#endif // INITIALIZE_AFF_TRANSFORMATIONS +{} + +template < class FT, class RT > +inline +Translation_repH3::Translation_repH3( const VectorH3& v) + : tv(v) +{} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +PointH3 +Translation_repH3::transform(const PointH3& p) const +{ + return PointH3( tv.hw() * p.hx() + tv.hx() * p.hw(), + tv.hw() * p.hy() + tv.hy() * p.hw(), + tv.hw() * p.hz() + tv.hz() * p.hw(), + tv.hw() * p.hw() ); +} + +template < class FT, class RT > +inline +VectorH3 +Translation_repH3::transform(const VectorH3& v) const +{ return v; } + +template < class FT, class RT > +inline +DirectionH3 +Translation_repH3::transform(const DirectionH3& dir) const +{ return dir; } + +#ifndef CGAL_NO_PLANE_TRANSFORM_IN_AT +template < class FT, class RT > +inline +PlaneH3 +Translation_repH3::transform(const PlaneH3& pl) const +{ + return PlaneH3( transform( pl.point() ), pl.orthogonal_vector() ); +} +#endif // CGAL_NO_PLANE_TRANSFORM_IN_AT + +template < class FT, class RT > +inline +Aff_transformationH3 +Translation_repH3::inverse() const +{ return Aff_transformationH3(TRANSLATION, - tv ); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +Aff_transformation_repH3 +Translation_repH3::general_form() const +{ + const RT RT0(0); + return Aff_transformation_repH3(tv.hw(), RT0, RT0, tv.hx(), + RT0, tv.hw(), RT0, tv.hy(), + RT0, RT0, tv.hw(), tv.hz(), + tv.hw() ); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +Aff_transformationH3 +Translation_repH3::transpose() const +{ + const RT RT0(0); + const RT RT1(1); + return Aff_transformationH3( RT1, RT0, RT0, RT0, + RT0, RT1, RT0, RT0, + RT0, RT0, RT1, RT0, + RT1 ); +} + +template < class FT, class RT > +inline +bool +Translation_repH3::is_even() const +{ return true; } + +template < class FT, class RT > +CGAL_KERNEL_LARGE_INLINE +RT +Translation_repH3::homogeneous(int i, int j) const +{ + CGAL_kernel_precondition( (i >= 0) && (i <= 3) && (j >= 0) && (j <= 3) ); + const RT RT0(0); + switch (i) + { + case 0: switch (j) + { + case 0: return tv.hw(); + case 1: return RT0; + case 2: return RT0; + case 3: return tv.hx(); + } + case 1: switch (j) + { + case 0: return RT0; + case 1: return tv.hw(); + case 2: return RT0; + case 3: return tv.hy(); + } + case 2: switch (j) + { + case 0: return RT0; + case 1: return RT0; + case 2: return tv.hw(); + case 3: return tv.hz(); + } + case 3: switch (j) + { + case 0: return RT0; + case 1: return RT0; + case 2: return RT0; + case 3: return tv.hw(); + } + } + return RT0; +} + +template < class FT, class RT > +inline +FT +Translation_repH3:: +cartesian(int i, int j) const +{ + return FT(homogeneous(i,j)) / FT(tv.hw()); +} + + +template < class FT, class RT > +CGAL_KERNEL_INLINE +Aff_transformationH3 +_general_transformation_composition( + Aff_transformation_repH3 l, + Aff_transformation_repH3 r ) +{ + return Aff_transformationH3( + l.t00*r.t00 + l.t01*r.t10 + l.t02*r.t20, + l.t00*r.t01 + l.t01*r.t11 + l.t02*r.t21, + l.t00*r.t02 + l.t01*r.t12 + l.t02*r.t22, + l.t00*r.t03 + l.t01*r.t13 + l.t02*r.t23 + l.t03*r.t33, + + l.t10*r.t00 + l.t11*r.t10 + l.t12*r.t20, + l.t10*r.t01 + l.t11*r.t11 + l.t12*r.t21, + l.t10*r.t02 + l.t11*r.t12 + l.t12*r.t22, + l.t10*r.t03 + l.t11*r.t13 + l.t12*r.t23 + l.t13*r.t33, + + l.t20*r.t00 + l.t21*r.t10 + l.t22*r.t20, + l.t20*r.t01 + l.t21*r.t11 + l.t22*r.t21, + l.t20*r.t02 + l.t21*r.t12 + l.t22*r.t22, + l.t20*r.t03 + l.t21*r.t13 + l.t22*r.t23 + l.t23*r.t33, + + l.t33*r.t33 ); +} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +Aff_transformationH3::Aff_transformationH3() +{ PTR = new Aff_transformation_repH3(); } + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +Aff_transformationH3:: +Aff_transformationH3( const Aff_transformationH3& tbc) + : Handle(tbc) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +Aff_transformationH3:: +Aff_transformationH3(const Identity_transformation&) +{ PTR = new Identity_repH3(); } + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +Aff_transformationH3:: +Aff_transformationH3(const Translation&, const VectorH3& v) +{ PTR = new Translation_repH3( v ); } + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +Aff_transformationH3:: +Aff_transformationH3(const Scaling&, const RT& num, const RT& den) +{ + const RT RT0(0); + PTR = new Aff_transformation_repH3(num, RT0, RT0, RT0, + RT0, num, RT0, RT0, + RT0, RT0, num, RT0, + den ); +} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +Aff_transformationH3:: +Aff_transformationH3( + const RT& m00, const RT& m01, const RT& m02, const RT& m03, + const RT& m10, const RT& m11, const RT& m12, const RT& m13, + const RT& m20, const RT& m21, const RT& m22, const RT& m23, + const RT& m33) +{ + PTR = new Aff_transformation_repH3(m00, m01, m02, m03, + m10, m11, m12, m13, + m20, m21, m22, m23, + m33 ); +} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +Aff_transformationH3:: +Aff_transformationH3( + const RT& m00, const RT& m01, const RT& m02, + const RT& m10, const RT& m11, const RT& m12, + const RT& m20, const RT& m21, const RT& m22, + const RT& m33) +{ + const RT RT0 = RT(0); + PTR = new Aff_transformation_repH3(m00, m01, m02, RT0, + m10, m11, m12, RT0, + m20, m21, m22, RT0, + m33 ); +} + +template < class FT, class RT > +inline +Aff_transformation_rep_baseH3* +Aff_transformationH3::ptr() const +// static_cast +{ return (Aff_transformation_rep_baseH3*) PTR; } + +template < class FT, class RT > +inline +Aff_transformationH3::~Aff_transformationH3() +{} + +template < class FT, class RT > +inline +PointH3 +Aff_transformationH3::transform(const PointH3& p) const +{ return ptr()->transform(p); } + +template < class FT, class RT > +inline +VectorH3 +Aff_transformationH3::transform(const VectorH3& v) const +{ return ptr()->transform(v); } + +template < class FT, class RT > +inline +DirectionH3 +Aff_transformationH3:: +transform(const DirectionH3& d) const +{ return ptr()->transform(d); } + +#ifndef CGAL_NO_PLANE_TRANSFORM_IN_AT +template < class FT, class RT > +inline +PlaneH3 +Aff_transformationH3:: +transform(const PlaneH3& pl) const +{ return ptr()->transform(pl); } +#endif // CGAL_NO_PLANE_TRANSFORM_IN_AT + +template < class FT, class RT > +inline +Aff_transformationH3 +Aff_transformationH3::inverse() const +{ return ptr()->inverse(); } + +template < class FT, class RT > +inline +Aff_transformationH3 +Aff_transformationH3::transpose() const +{ return ptr()->transpose(); } + +template < class FT, class RT > +inline +bool +Aff_transformationH3::is_even() const +{ return ptr()->is_even(); } + +template < class FT, class RT > +inline +bool +Aff_transformationH3::is_odd() const +{ return ( ! (ptr()->is_even() )); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +Aff_transformationH3 +operator*(const Aff_transformationH3& left_argument, + const Aff_transformationH3& right_argument ) +{ + return _general_transformation_composition( + left_argument.ptr() ->general_form(), + right_argument.ptr()->general_form() ); +} + + +template < class FT, class RT > +std::ostream & +operator<< ( std::ostream & out, + const Aff_transformationH3& t) +{ + RT RT0(0); + Aff_transformation_repH3 r = t.ptr()->general_form(); + return out + << "| "<< r.t00 <<' '<< r.t01 <<' '<< r.t02 <<' '<< r.t03 << " |\n" + << "| "<< r.t10 <<' '<< r.t11 <<' '<< r.t12 <<' '<< r.t13 << " |\n" + << "| "<< r.t20 <<' '<< r.t21 <<' '<< r.t22 <<' '<< r.t23 << " |\n" + << "| "<< RT0 <<' '<< RT0 <<' '<< RT0 <<' '<< r.t33 << " |\n"; +} + +CGAL_END_NAMESPACE + + +#endif // CGAL_AFF_TRANSFORMATIONH3_H diff --git a/Packages/H3/include/CGAL/DirectionH3.h b/Packages/H3/include/CGAL/DirectionH3.h new file mode 100644 index 00000000000..dd5faea1c1a --- /dev/null +++ b/Packages/H3/include/CGAL/DirectionH3.h @@ -0,0 +1,31 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : PointVectorDirectionH3.fw +// file : DirectionH3.h +// package : H3 (2.14) +// maintainer : Stefan Schirra +// revision : 2.14 +// revision_date : 15 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + +#ifndef CGAL_PVDH3_H +#include +#endif // CGAL_PVDH3_H +#ifndef PREDICATES_ON_POINTSH3_H +#include +#endif // PREDICATES_ON_POINTSH3_H diff --git a/Packages/H3/include/CGAL/Iso_cuboidH3.h b/Packages/H3/include/CGAL/Iso_cuboidH3.h new file mode 100644 index 00000000000..b0d1d4c72da --- /dev/null +++ b/Packages/H3/include/CGAL/Iso_cuboidH3.h @@ -0,0 +1,330 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : Iso_cuboidH3.fw +// file : Iso_cuboidH3.h +// package : H3 (2.14) +// maintainer : Stefan Schirra +// revision : 2.14 +// revision_date : 15 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_ISO_CUBOIDH3_H +#define CGAL_ISO_CUBOIDH3_H + +#include +#include +#include + +CGAL_BEGIN_NAMESPACE + +template +class Iso_cuboidH3 : public Handle_for< Twotuple< PointH3 > > +{ +public: + Iso_cuboidH3(); + Iso_cuboidH3(const PointH3& p, const PointH3& q); + ~Iso_cuboidH3(); + + bool operator==(const Iso_cuboidH3& s) const; + bool operator!=(const Iso_cuboidH3& s) const; + + PointH3 min() const; + PointH3 max() const; + PointH3 vertex(int i) const; + PointH3 operator[](int i) const; + + Iso_cuboidH3 + transform(const Aff_transformationH3& t) const; + Bounded_side + bounded_side(const PointH3& p) const; + bool has_on(const PointH3& p) const; + bool has_on_boundary(const PointH3& p) const; + bool has_on_bounded_side(const PointH3& p) const; + bool has_on_unbounded_side(const PointH3& p) const; + bool is_degenerate() const; + Bbox_2 + bbox() const; + FT xmin() const; + FT ymin() const; + FT zmin() const; + FT xmax() const; + FT ymax() const; + FT zmax() const; + + +}; + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +Iso_cuboidH3::Iso_cuboidH3() + : Handle_for< Twotuple< PointH3 > >( Twotuple< PointH3 >()) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_LARGE_INLINE +Iso_cuboidH3:: +Iso_cuboidH3(const PointH3& p, const PointH3& q) +{ + bool px_k_qx = ( p.hx()*q.hw() < q.hx()*p.hw() ); + bool py_k_qy = ( p.hy()*q.hw() < q.hy()*p.hw() ); + bool pz_k_qz = ( p.hz()*q.hw() < q.hz()*p.hw() ); + + RT minx; + RT miny; + RT minz; + RT maxx; + RT maxy; + RT maxz; + RT minw = p.hw()*q.hw(); + RT maxw = p.hw()*q.hw(); + if ( px_k_qx ) + { + minx = p.hx()*q.hw(); + maxx = q.hx()*p.hw(); + } + else + { + minx = q.hx()*p.hw(); + maxx = p.hx()*q.hw(); + } + if ( py_k_qy ) + { + miny = p.hy()*q.hw(); + maxy = q.hy()*p.hw(); + } + else + { + miny = q.hy()*p.hw(); + maxy = p.hy()*q.hw(); + } + if ( pz_k_qz ) + { + minz = p.hz()*q.hw(); + maxz = q.hz()*p.hw(); + } + else + { + minz = q.hz()*p.hw(); + maxz = p.hz()*q.hw(); + } + initialize_with( + Twotuple >( PointH3(minx, miny, minz, minw), + PointH3(maxx, maxy, maxz, maxw) )); +} + +template < class FT, class RT > +inline +Iso_cuboidH3::~Iso_cuboidH3() +{} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +Iso_cuboidH3:: +operator==(const Iso_cuboidH3& r) const +{ return (min() == r.min()) && (max() == r.max()); } + +template < class FT, class RT > +inline +bool +Iso_cuboidH3:: +operator!=(const Iso_cuboidH3& r) const +{ return !(*this == r); } + +template < class FT, class RT > +inline +PointH3 +Iso_cuboidH3::min() const +{ return ptr->e0; } + +template < class FT, class RT > +inline +PointH3 +Iso_cuboidH3::max() const +{ return ptr->e1; } + +template < class FT, class RT > +inline +FT +Iso_cuboidH3::xmin() const +{ return FT( min().hx() ) / FT( min().hw() ); } + +template < class FT, class RT > +inline +FT +Iso_cuboidH3::ymin() const +{ return FT( min().hy() ) / FT( min().hw() ); } + +template < class FT, class RT > +inline +FT +Iso_cuboidH3::zmin() const +{ return FT( min().hz() ) / FT( min().hw() ); } + +template < class FT, class RT > +inline +FT +Iso_cuboidH3::xmax() const +{ return FT( max().hx() ) / FT( max().hw() ); } + +template < class FT, class RT > +inline +FT +Iso_cuboidH3::ymax() const +{ return FT( max().hy() ) / FT( max().hw() ); } + +template < class FT, class RT > +inline +FT +Iso_cuboidH3::zmax() const +{ return FT( max().hz() ) / FT( max().hw() ); } +template < class FT, class RT > +CGAL_KERNEL_LARGE_INLINE +PointH3 +Iso_cuboidH3::vertex(int i) const +{ + switch (i%8) + { + case 0: return min(); + case 1: return PointH3( max().hx(), min().hy(), min().hz(), min().hw() ); + case 2: return PointH3( max().hx(), max().hy(), min().hz(), min().hw() ); + case 3: return PointH3( min().hx(), max().hy(), min().hz(), min().hw() ); + case 4: return PointH3( min().hx(), max().hy(), max().hz(), min().hw() ); + case 5: return PointH3( min().hx(), min().hy(), max().hz(), min().hw() ); + case 6: return PointH3( max().hx(), min().hy(), max().hz(), min().hw() ); + case 7: return max(); + } + return PointH3(); +} + +template < class FT, class RT > +inline +PointH3 +Iso_cuboidH3::operator[](int i) const +{ return vertex(i); } + +template < class FT, class RT > +CGAL_KERNEL_MEDIUM_INLINE +Bounded_side +Iso_cuboidH3:: +bounded_side(const PointH3& p) const +{ + if ( (p.hx()*min().hw() < min().hx()*p.hw() ) + ||(p.hy()*min().hw() < min().hy()*p.hw() ) + ||(p.hz()*min().hw() < min().hz()*p.hw() ) + ||(p.hx()*max().hw() > max().hx()*p.hw() ) + ||(p.hy()*max().hw() > max().hy()*p.hw() ) + ||(p.hz()*max().hw() > max().hz()*p.hw() ) ) + { return ON_UNBOUNDED_SIDE; } + if ( (p.hx()*min().hw() == min().hx()*p.hw() ) + ||(p.hy()*min().hw() == min().hy()*p.hw() ) + ||(p.hz()*min().hw() == min().hz()*p.hw() ) + ||(p.hx()*max().hw() == max().hx()*p.hw() ) + ||(p.hy()*max().hw() == max().hy()*p.hw() ) + ||(p.hz()*max().hw() == max().hz()*p.hw() ) ) + { return ON_BOUNDARY; } + else + { return ON_BOUNDED_SIDE; } +} + +template < class FT, class RT > +inline +bool +Iso_cuboidH3::has_on_boundary(const PointH3& p) const +{ return ( bounded_side(p) == ON_BOUNDARY ); } + +template < class FT, class RT > +inline +bool +Iso_cuboidH3::has_on(const PointH3& p) const +{ return ( bounded_side(p) == ON_BOUNDARY ); } + +template < class FT, class RT > +inline +bool +Iso_cuboidH3:: +has_on_bounded_side(const PointH3& p) const +{ return ( bounded_side(p) == ON_BOUNDED_SIDE ); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +Iso_cuboidH3:: +has_on_unbounded_side(const PointH3& p) const +{ + return ( ( lexicographically_xyz_smaller(p,min() )) + ||( lexicographically_xyz_smaller(max(),p )) ); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +Iso_cuboidH3::is_degenerate() const +{ + return ( ( min().hx() == max().hx() ) + || ( min().hy() == max().hy() ) + || ( min().hz() == max().hz() ) ); +} +template < class FT, class RT > +inline +Bbox_2 +Iso_cuboidH3::bbox() const +{ return min().bbox() + max().bbox(); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +Iso_cuboidH3 +Iso_cuboidH3:: +transform(const Aff_transformationH3&t) const +{ + return Iso_cuboidH3(t.transform(min() ), + t.transform(max() ) ); +} + +#ifndef NO_OSTREAM_INSERT_ISO_CUBOIDH3 +template < class FT, class RT > +std::ostream& operator<<(std::ostream& os, const Iso_cuboidH3& r) +{ + switch(os.iword(IO::mode)) + { + case IO::ASCII : + return os << min() << ' ' << max(); + case IO::BINARY : + return os << min() << max(); + default: + return os << "Iso_cuboidH3(" << min() << ", " << max() << ")"; + } +} +#endif // NO_OSTREAM_INSERT_ISO_CUBOIDH3 + +#ifndef NO_ISTREAM_EXTRACT_ISO_CUBOIDH3 +template < class FT, class RT > +std::istream& operator>>(std::istream& is, Iso_cuboidH3& r) +{ + PointH3 p, q; + is >> p >> q; + r = Iso_cuboidH3(p, q); + return is; +} +#endif // NO_ISTREAM_EXTRACT_ISO_CUBOIDH3 + +CGAL_END_NAMESPACE + + +#endif // CGAL_ISO_CUBOIDH3_H diff --git a/Packages/H3/include/CGAL/LineH3.h b/Packages/H3/include/CGAL/LineH3.h new file mode 100644 index 00000000000..398414d7046 --- /dev/null +++ b/Packages/H3/include/CGAL/LineH3.h @@ -0,0 +1,253 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : LineH3.fw +// file : LineH3.h +// package : H3 (2.14) +// maintainer : Stefan Schirra +// revision : 2.14 +// revision_date : 15 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_LINEH3_H +#define CGAL_LINEH3_H + +#ifndef CGAL_PVDH3_H +#include +#endif // CGAL_PVDH3_H +#ifndef CGAL_SEGMENTH3_H +#include +#endif // CGAL_SEGMENTH3_H +#ifndef CGAL_RAYH3_H +#include +#endif // CGAL_RAYH3_H +#ifndef PREDICATES_ON_POINTSH3_H +#include +#endif // PREDICATES_ON_POINTSH3_H + +CGAL_BEGIN_NAMESPACE + +template < class FT, class RT > +class Line_repH3 : public Ref_counted +{ + public: + Line_repH3() {} + Line_repH3( const PointH3& p, const DirectionH3 d) + : basepoint(p), direction(d) + {} + + friend class LineH3; + + private: + PointH3 basepoint; + DirectionH3 direction; +}; + + +template < class FT, class RT > +class LineH3 : public Handle_for< Line_repH3 > +{ +public: + LineH3(); + LineH3(const PointH3& p, const PointH3& q); + LineH3(const SegmentH3& s); + LineH3(const RayH3& r); + LineH3(const PointH3& p, const DirectionH3& d); + + PlaneH3 perpendicular_plane(const PointH3& p) const; + LineH3 opposite() const; + PointH3 point() const; + PointH3 point(int i) const; + PointH3 projection(const PointH3& p) const; + + DirectionH3 + direction() const; + + bool has_on( const PointH3& p ) const; + bool is_degenerate() const; + + bool operator==(const LineH3& l) const ; + bool operator!=(const LineH3& l) const ; + + LineH3 transform(const Aff_transformationH3&) const; +}; + +template < class FT, class RT > +inline +bool +LineH3::operator!=(const LineH3& l) const +{ return !(*this == l); } + + +CGAL_END_NAMESPACE + + +#ifndef CGAL_PLANEH3_H +#include +#endif // CGAL_PLANEH3_H + +CGAL_BEGIN_NAMESPACE + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +LineH3::LineH3() + : Handle_for< Line_repH3 >( Line_repH3() ) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +LineH3::LineH3(const PointH3& p, + const PointH3& q) + : Handle_for< Line_repH3 >(Line_repH3(p, (q - p).direction())) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +LineH3::LineH3(const SegmentH3& s) + : Handle_for< Line_repH3 >(Line_repH3(s.start(), s.direction())) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +LineH3::LineH3(const RayH3& r) + : Handle_for< Line_repH3 >(Line_repH3(r.start(), r.direction())) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +LineH3::LineH3(const PointH3& p, + const DirectionH3& d) + : Handle_for< Line_repH3 >(Line_repH3( p, d ) ) +{} + +template < class FT, class RT > +inline +PointH3 +LineH3::point() const +{ return ptr->basepoint; } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +PointH3 +LineH3::point(int i) const +{ return point() + RT(i)*direction().to_vector() ; } + +template < class FT, class RT > +inline +DirectionH3 +LineH3::direction() const +{ return ptr->direction; } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +PlaneH3 +LineH3:: +perpendicular_plane(const PointH3& p ) const +{ return PlaneH3( p, direction() ); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +LineH3 +LineH3::opposite() const +{ return LineH3( ptr->basepoint, -(ptr->direction ) ); } + +template < class FT, class RT > +CGAL_KERNEL_LARGE_INLINE +PointH3 +LineH3::projection(const PointH3& p) const +{ + if ( has_on(p) ) + { + return p; + } + VectorH3 v = p - point(); + const RT vx = v.hx(); + const RT vy = v.hy(); + const RT vz = v.hz(); + const RT vw = v.hw(); + VectorH3 dir = direction().to_vector(); + const RT dx = dir.hx(); + const RT dy = dir.hy(); + const RT dz = dir.hz(); + const RT dw = dir.hw(); + + RT lambda_num = (vx*dx + vy*dy + vz*dz)*dw; // *dw + RT lambda_den = (dx*dx + dy*dy + dz*dz)*vw; // *dw + + return point() + ( (lambda_num * dir)/lambda_den ); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +LineH3 +LineH3::transform(const Aff_transformationH3& t) const +{ return LineH3(t.transform(point() ), t.transform(direction() )); } + + +#ifndef NO_OSTREAM_INSERT_LINEH3 +template < class FT, class RT > +std::ostream &operator<<(std::ostream &os, const LineH3 &l) +{ + switch(os.iword(IO::mode)) + { + case IO::ASCII : + return os << l.point() << ' ' << l.direction(); + case IO::BINARY : + return os << l.point() << l.direction(); + default: + return os << "LineH3(" << l.point() << ", " << l.direction() << ")"; + } +} +#endif // NO_OSTREAM_INSERT_LINEH3 + +#ifndef NO_ISTREAM_EXTRACT_LINEH3 +template < class FT, class RT > +std::istream &operator>>(std::istream &is, LineH3 &l) +{ + PointH3 p; + DirectionH3 d; + is >> p >> d; + l = LineH3(p, d); + return is; +} +#endif // NO_ISTREAM_EXTRACT_LINEH3 +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +LineH3::has_on( const PointH3& p ) const +{ return collinear(point(), point()+direction().to_vector(), p); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +LineH3::is_degenerate() const +{ return direction().is_degenerate(); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +LineH3::operator==(const LineH3& l) const +{ + return ( (l.direction() == ptr->direction ) + &&(l.has_on( ptr->basepoint ) ) ); +} + +CGAL_END_NAMESPACE + + +#endif // CGAL_LINEH3_H diff --git a/Packages/H3/include/CGAL/PVDH3.h b/Packages/H3/include/CGAL/PVDH3.h new file mode 100644 index 00000000000..411c29e4d3e --- /dev/null +++ b/Packages/H3/include/CGAL/PVDH3.h @@ -0,0 +1,1133 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : PointVectorDirectionH3.fw +// file : PVDH3.h +// package : H3 (2.14) +// maintainer : Stefan Schirra +// revision : 2.14 +// revision_date : 15 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_PVDH3_H +#define CGAL_PVDH3_H +#define CGAL_POINTH3_H +#define CGAL_VECTORH3_H +#define CGAL_DIRECTIONH3_H + +#ifndef CGAL_HOMOGENEOUS_CLASSES_H +#include +#endif // CGAL_HOMOGENEOUS_CLASSES_H +#ifndef CGAL_ORIGIN_H +#include +#endif // CGAL_ORIGIN_H + +#ifndef CGAL_REPH3_H +#include +#endif // CGAL_REPH3_H + +CGAL_BEGIN_NAMESPACE + +template +inline +PointH3 +operator+ (const Origin &, const VectorH3 & v); + +template +inline +PointH3 +operator- (const Origin &, const VectorH3 & v); + +template +inline +VectorH3 +operator- ( const PointH3 &, const Origin & ); + +template +inline +VectorH3 +operator- ( const Origin &, const PointH3 & ); + +template +inline +PointH3 +operator+ ( const Origin &, const VectorH3 & ); + +template +inline +PointH3 +operator- ( const Origin &, const VectorH3 & ); + +template +CGAL_KERNEL_INLINE +VectorH3 +operator+ ( const VectorH3 &, const VectorH3 & ); + +template +CGAL_KERNEL_INLINE +VectorH3 +operator- ( const VectorH3 &, const VectorH3 & ); + +template +CGAL_KERNEL_INLINE +FT +operator* ( const VectorH3 &, const VectorH3 & ); + +template +CGAL_KERNEL_INLINE +VectorH3 +operator* ( const VectorH3 &, const RT & ); + +template +CGAL_KERNEL_INLINE +VectorH3 +operator* ( const RT &, const VectorH3 & ); + +template +CGAL_KERNEL_INLINE +VectorH3 +operator/ ( const VectorH3 &, const RT & ); + +template +CGAL_KERNEL_INLINE +VectorH3 +cross_product( const VectorH3& a, const VectorH3& b); + +template +CGAL_KERNEL_INLINE +DirectionH3 +cross_product( const DirectionH3& a, const DirectionH3& b); + + + +template < class FT, class RT > +class PointH3 : public Handle_for< RepH3 > +{ + +public: + PointH3(); + PointH3(const PointH3 & tbc); + PointH3(const Origin &); + PointH3(const VectorH3& v); + PointH3(const RT& x, const RT& y, const RT& z); + PointH3(const RT& x, const RT& y, const RT& z, const RT& w); + + FT x() const; + FT y() const; + FT z() const; + RT hx() const; + RT hy() const; + RT hz() const; + RT hw() const; + FT cartesian(int i) const; + RT homogeneous(int i) const; + FT operator[](int i) const; + + int dimension() const; + + DirectionH3 + direction() const; + PointH3 + transform( const Aff_transformationH3 & t) const; + Bbox_3 + bbox() const; + + bool operator==( const PointH3& p) const; + bool operator!=( const PointH3& p) const; + + const RT& hx_ref() const; + const RT& hy_ref() const; + const RT& hz_ref() const; + const RT& hw_ref() const; + +friend CGAL_FRIEND_INLINE + PointH3 + operator+ CGAL_NULL_TMPL_ARGS (const Origin &, + const VectorH3 & v); +friend CGAL_FRIEND_INLINE + PointH3 + operator- CGAL_NULL_TMPL_ARGS (const Origin &, + const VectorH3 & v); +}; + + +template < class FT, class RT > +class VectorH3 : public Handle_for< RepH3 > +{ +public: + VectorH3(); + VectorH3(const VectorH3 & tbc); + VectorH3(const Null_vector&); + VectorH3(const RT& x, const RT& y, const RT& z); + VectorH3(const RT& w, const RT& x, const RT& y, const RT& z); + + FT x() const; + FT y() const; + FT z() const; + RT hx() const; + RT hy() const; + RT hz() const; + RT hw() const; + FT cartesian(int i) const; + RT homogeneous(int i) const; + FT operator[](int i) const; + + int dimension() const; + + DirectionH3 + direction() const; + VectorH3 + transform(const Aff_transformationH3& t ) const; + + VectorH3 + operator-() const; + + bool operator==( const VectorH3& v) const; + bool operator!=( const VectorH3& v) const; + +// undocumented: + + VectorH3(const PointH3 & p); + VectorH3(const DirectionH3 & dir); /* XXX */ + +// friends: + +/* +friend CGAL_FRIEND_INLINE + VectorH3 + operator- CGAL_NULL_TMPL_ARGS ( const PointH3 &, + const Origin & ); +friend CGAL_FRIEND_INLINE + VectorH3 + operator- CGAL_NULL_TMPL_ARGS ( const Origin &, + const PointH3 & ); +friend CGAL_FRIEND_INLINE + PointH3 + operator- CGAL_NULL_TMPL_ARGS ( const Origin &, + const VectorH3 & ); +friend CGAL_KERNEL_FRIEND_INLINE + VectorH3 + operator- CGAL_NULL_TMPL_ARGS ( const VectorH3 &, + const VectorH3 & ); +*/ +friend CGAL_FRIEND_INLINE + PointH3 + operator+ CGAL_NULL_TMPL_ARGS ( const Origin &, + const VectorH3 & ); +friend CGAL_KERNEL_FRIEND_INLINE + VectorH3 + operator+ CGAL_NULL_TMPL_ARGS ( const VectorH3 &, + const VectorH3 & ); +friend CGAL_KERNEL_FRIEND_INLINE + FT + operator* CGAL_NULL_TMPL_ARGS ( const VectorH3 &, + const VectorH3 & ); +friend CGAL_KERNEL_FRIEND_INLINE + VectorH3 + operator* CGAL_NULL_TMPL_ARGS ( const VectorH3 &, + const RT & ); +friend CGAL_KERNEL_FRIEND_INLINE + VectorH3 + operator* CGAL_NULL_TMPL_ARGS ( const RT &, + const VectorH3 & ); +friend CGAL_KERNEL_FRIEND_INLINE + VectorH3 + operator/ CGAL_NULL_TMPL_ARGS ( const VectorH3 &, + const RT & ); +}; + + +template < class FT, class RT > +class DirectionH3 : public Handle_for< RepH3 > +{ +public: + DirectionH3(); + DirectionH3(const DirectionH3& tbc ); + DirectionH3(const PointH3 & p ); + DirectionH3(const VectorH3 & v ); + DirectionH3(const RT& x, const RT& y, + const RT& z, const RT& w = RT(1) ); + + DirectionH3 + transform(const Aff_transformationH3 &) const ; + DirectionH3 + operator-() const; + + bool is_degenerate() const; + + bool operator==( const DirectionH3& d) const; + bool operator!=( const DirectionH3& d) const; + + VectorH3 to_vector() const; + // VectorH3 vector() const { return to_vector(); } + + RT dx() const; + RT dy() const; + RT dz() const; + RT x() const; + RT y() const; + RT z() const; + RT hx() const; + RT hy() const; + RT hz() const; + + RT delta(int i) const; + +/* +friend CGAL_KERNEL_FRIEND_INLINE +DirectionH3 +cross_product CGAL_NULL_TMPL_ARGS (const DirectionH3& d1, + const DirectionH3& d2); +*/ +}; + + + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +PointH3::PointH3() + : Handle_for< RepH3 >( RepH3()) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +PointH3::PointH3(const Origin&) +{ + const RT RT0(0); + const RT RT1(1); + initialize_with( RepH3( RT0, RT0, RT0, RT1 )); +} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +PointH3::PointH3(const PointH3& tbc) + : Handle_for< RepH3 >(tbc) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +PointH3::PointH3(const VectorH3& v) + : Handle_for< RepH3 >(v) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +PointH3::PointH3(const RT& x, const RT& y, const RT& z) + : Handle_for< RepH3 >( RepH3(x,y,z, RT(1)) ) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +PointH3::PointH3(const RT& x, const RT& y, const RT& z, + const RT& w) +{ + if ( w < RT(0) ) + { initialize_with( RepH3(-x,-y,-z,-w)); } + else + { initialize_with( RepH3(x,y,z,w)); } +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +FT +PointH3::x() const +{ return ( FT(ptr->hx() ) / FT(ptr->hw() )); } + + +template < class FT, class RT > +CGAL_KERNEL_INLINE +FT +PointH3::y() const +{ return ( FT(ptr->hy() ) / FT(ptr->hw() )); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +FT +PointH3::z() const +{ return ( FT(ptr->hz() ) / FT(ptr->hw() )); } + +template < class FT, class RT > +inline +RT +PointH3::hx() const +{ return ptr->hx() ; } + +template < class FT, class RT > +inline +RT +PointH3::hy() const +{ return ptr->hy() ; } + +template < class FT, class RT > +inline +RT +PointH3::hz() const +{ return ptr->hz() ; } + +template < class FT, class RT > +inline +RT +PointH3::hw() const +{ return ptr->hw(); } + +template < class FT, class RT > +inline +const RT& +PointH3::hx_ref() const +{ return ptr->e0 ; } + +template < class FT, class RT > +inline +const RT& +PointH3::hy_ref() const +{ return ptr->e1 ; } + +template < class FT, class RT > +inline +const RT& +PointH3::hz_ref() const +{ return ptr->e2 ; } + +template < class FT, class RT > +inline +const RT& +PointH3::hw_ref() const +{ return ptr->e3; } + +template < class FT, class RT > +inline +int +PointH3::dimension() const +{ return 3; } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +FT +PointH3::cartesian(int i) const +{ + switch (i) + { + case 0: return x(); + case 1: return y(); + case 2: return z(); + default: return cartesian( i%3 ); + } +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +RT +PointH3::homogeneous(int i) const +{ + CGAL_kernel_precondition(i == 0 || i == 1 || i == 2 || i == 3); + switch (i) + { + case 0: return hx(); + case 1: return hy(); + case 2: return hz(); + } + return hw(); +} + +template < class FT, class RT > +inline +FT +PointH3::operator[](int i) const +{ return cartesian(i); } + + +template < class FT, class RT > +inline +DirectionH3 +PointH3::direction() const +{ return DirectionH3(*this); } +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +PointH3::operator==( const PointH3 & p) const +{ + return ( (hx() * p.hw() == p.hx() * hw() ) + &&(hy() * p.hw() == p.hy() * hw() ) + &&(hz() * p.hw() == p.hz() * hw() ) ); +} + +template < class FT, class RT > +inline +bool +PointH3::operator!=( const PointH3 & p) const +{ return !(*this == p); } + + +#ifndef NO_OSTREAM_INSERT_POINTH3 +template < class FT, class RT > +std::ostream &operator<<(std::ostream &os, const PointH3 &p) +{ + switch(os.iword(IO::mode)) { + case IO::ASCII : + return os << p.hx() << ' ' << p.hy() << ' ' << p.hz() << ' ' << p.hw(); + case IO::BINARY : + write(os, p.hx()); + write(os, p.hy()); + write(os, p.hz()); + write(os, p.hw()); + return os; + default: + return os << "PointH3(" << p.hx() << ", " + << p.hy() << ", " + << p.hz() << ", " + << p.hw() << ')'; + } +} +#endif // NO_OSTREAM_INSERT_POINTH3 + +#ifndef NO_ISTREAM_EXTRACT_POINTH3 +template < class FT, class RT > +std::istream &operator>>(std::istream &is, PointH3 &p) +{ + RT hx, hy, hz, hw; + switch(is.iword(IO::mode)) { + case IO::ASCII : + is >> hx >> hy >> hz >> hw; + break; + case IO::BINARY : + read(is, hx); + read(is, hy); + read(is, hz); + read(is, hw); + break; + default: + std::cerr << "" << std::endl; + std::cerr << "Stream must be in ascii or binary mode" << std::endl; + break; + } + p = PointH3(hx, hy, hz, hw); + return is; +} +#endif // NO_ISTREAM_EXTRACT_POINTH3 + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +VectorH3::VectorH3() + : Handle_for< RepH3 >( RepH3() ) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +VectorH3::VectorH3(const VectorH3& tbc) + : Handle_for< RepH3 >(tbc) +{} + + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +VectorH3::VectorH3(const Null_vector&) + : Handle_for< RepH3 >( RepH3(RT(0), RT(0), RT(0), RT(1)) ) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +VectorH3::VectorH3(const PointH3 & p) + : Handle_for< RepH3 >(p) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +VectorH3::VectorH3(const DirectionH3 & d) + : Handle_for< RepH3 >(d) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +VectorH3::VectorH3(const RT& x, const RT& y, const RT& z, + const RT& w) +{ + if ( w >= RT(0) ) + { initialize_with( RepH3(x, y, z, w)); } + else + { initialize_with( RepH3(-x,-y,-z,-w)); } +} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +VectorH3::VectorH3(const RT& x, const RT& y, const RT& z) + : Handle_for< RepH3 >( RepH3(x, y, z, RT(1)) ) +{} +template < class FT, class RT > +CGAL_KERNEL_INLINE +FT +VectorH3::x() const +{ return FT(ptr->hx() )/FT(ptr->hw() ) ; } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +FT +VectorH3::y() const +{ return FT(ptr->hy() )/FT(ptr->hw() ) ; } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +FT +VectorH3::z() const +{ return FT(ptr->hz() )/FT(ptr->hw() ) ; } + +template < class FT, class RT > +inline +RT +VectorH3::hx() const +{ return ptr->hx() ; } + +template < class FT, class RT > +inline +RT +VectorH3::hy() const +{ return ptr->hy() ; } + +template < class FT, class RT > +inline +RT +VectorH3::hz() const +{ return ptr->hz() ; } + +template < class FT, class RT > +inline +RT +VectorH3::hw() const +{ return ptr->hw() ; } + +template < class FT, class RT > +inline +int +VectorH3::dimension() const +{ return 3; } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +FT +VectorH3::cartesian(int i) const +{ + switch (i) + { + case 0: return x(); + case 1: return y(); + case 2: return z(); + default: return cartesian( i%3 ); + } +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +RT +VectorH3::homogeneous(int i) const +{ + CGAL_kernel_precondition(i == 0 || i == 1 || i == 2 || i == 3); + switch (i) + { + case 0: return hx(); + case 1: return hy(); + case 2: return hz(); + } + return hw() ; +} +template < class FT, class RT > +inline +DirectionH3 +VectorH3::direction() const +{ return DirectionH3(*this); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +VectorH3::operator==( const VectorH3& v) const +{ + return ( (hx() * v.hw() == v.hx() * hw() ) + &&(hy() * v.hw() == v.hy() * hw() ) + &&(hz() * v.hw() == v.hz() * hw() ) ); +} + +template < class FT, class RT > +inline +bool +VectorH3::operator!=( const VectorH3& v) const +{ return !(*this == v); } + +template < class FT, class RT > +inline +FT +VectorH3::operator[](int i) const +{ return cartesian(i); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +VectorH3 +VectorH3::operator-() const +{ return VectorH3( - hx(), - hy(), -hz(), hw() ); } + + +template +CGAL_KERNEL_CTOR_INLINE +DirectionH3::DirectionH3() + : Handle_for< RepH3 >( RepH3() ) +{} + +template +CGAL_KERNEL_CTOR_INLINE +DirectionH3::DirectionH3(const DirectionH3& tbc ) + : Handle_for< RepH3 >(tbc) +{} + +template +CGAL_KERNEL_CTOR_INLINE +DirectionH3::DirectionH3(const PointH3 & p ) + : Handle_for< RepH3 >( p ) +{} + +template +CGAL_KERNEL_CTOR_INLINE +DirectionH3::DirectionH3(const VectorH3 & v ) + : Handle_for< RepH3 >( v ) +{} + +template +CGAL_KERNEL_CTOR_INLINE +DirectionH3::DirectionH3(const RT& x, const RT& y, const RT& z, + const RT& w) +{ + if ( w >= RT(0) ) + { initialize_with( RepH3(x,y,z,w)); } + else + { initialize_with( RepH3(-x,-y,-z,-w)); } +} + +template +CGAL_KERNEL_INLINE +RT +DirectionH3::delta(int i) const +{ + switch (i) + { + case 0: return x(); + case 1: return y(); + case 2: return z(); + default: return delta( i%3 ); + } +} + +template +inline +RT +DirectionH3::dx() const +{ return ptr->e0; } + +template +inline +RT +DirectionH3::x() const +{ return ptr->e0; } + +template +inline +RT +DirectionH3::hx() const +{ return ptr->e0; } + +template +inline +RT +DirectionH3::dy() const +{ return ptr->e1; } + +template +inline +RT +DirectionH3::y() const +{ return ptr->e1; } + +template +inline +RT +DirectionH3::hy() const +{ return ptr->e1; } + +template +inline +RT +DirectionH3::dz() const +{ return ptr->e2; } + +template +inline +RT +DirectionH3::z() const +{ return ptr->e2; } + +template +inline +RT +DirectionH3::hz() const +{ return ptr->e2; } +template +CGAL_KERNEL_INLINE +bool +DirectionH3::operator==( const DirectionH3& d) const +{ + return ( ( ptr->hx()*d.ptr->hy() == ptr->hy()*d.ptr->hx() ) + &&( ptr->hx()*d.ptr->hz() == ptr->hz()*d.ptr->hx() ) + &&( ptr->hy()*d.ptr->hz() == ptr->hz()*d.ptr->hy() ) + &&( CGAL_NTS sign( ptr->hx() ) == CGAL_NTS sign( d.ptr->hx() ) ) + &&( CGAL_NTS sign( ptr->hy() ) == CGAL_NTS sign( d.ptr->hy() ) ) + &&( CGAL_NTS sign( ptr->hz() ) == CGAL_NTS sign( d.ptr->hz() ) ) ); +} + +template +inline +bool +DirectionH3::operator!=( const DirectionH3& d) const +{ return !operator==(d); } + +template +CGAL_KERNEL_INLINE +bool +DirectionH3::is_degenerate() const +{ return ((hx() == RT(0)) && (hy() == RT(0)) && (hz() == RT(0))); } + +template +inline +DirectionH3 +DirectionH3::operator-() const +{ return DirectionH3(- ptr->hx(),- ptr->hy(),- ptr->hz() ); } + + +template +inline +VectorH3 +DirectionH3::to_vector() const +{ return VectorH3(*this); } + + +template +CGAL_KERNEL_INLINE +VectorH3 +operator+(const VectorH3& u, const VectorH3& v) +{ + return VectorH3(u.hx()*v.hw() + v.hx()*u.hw(), + u.hy()*v.hw() + v.hy()*u.hw(), + u.hz()*v.hw() + v.hz()*u.hw(), + u.hw()*v.hw() ); +} + +template +CGAL_KERNEL_INLINE +VectorH3 +operator-(const VectorH3& u, const VectorH3& v) +{ + return VectorH3(u.hx()*v.hw() - v.hx()*u.hw(), + u.hy()*v.hw() - v.hy()*u.hw(), + u.hz()*v.hw() - v.hz()*u.hw(), + u.hw()*v.hw() ); +} + +template +CGAL_KERNEL_INLINE +FT +operator*(const VectorH3& u, const VectorH3& v) +{ + CGAL_kernel_assertion( u.hw() != RT(0) ); + CGAL_kernel_assertion( v.hw() != RT(0) ); + return ( FT( u.hx()*v.hx() + u.hy()*v.hy() + u.hz()*v.hz() ) / + FT( u.hw()*v.hw() ) ); +} + +template +CGAL_KERNEL_INLINE +VectorH3 +operator/(const VectorH3& v, const RT& f) +{ return VectorH3( v.hx(), v.hy(), v.hz(), v.hw()*f ); } + +template +CGAL_KERNEL_INLINE +VectorH3 +operator*(const VectorH3& v, const RT& f) +{ return VectorH3( v.hx()*f, v.hy()*f, v.hz()*f, v.hw() ); } + +template +CGAL_KERNEL_INLINE +VectorH3 +operator*(const RT& f, const VectorH3& v) +{ return VectorH3( v.hx()*f, v.hy()*f, v.hz()*f, v.hw() ); } + +template +CGAL_KERNEL_INLINE +VectorH3 +cross_product(const VectorH3& a, const VectorH3& b) +{ + return VectorH3(a.hy()*b.hz() - a.hz()*b.hy(), + a.hz()*b.hx() - a.hx()*b.hz(), + a.hx()*b.hy() - a.hy()*b.hx(), + a.hw()*b.hw() ); +} + +template +inline +PointH3 +operator+(const Origin& , const VectorH3& v) +{ return PointH3( v ); } + +template +inline +PointH3 +operator-(const Origin& , const VectorH3& v) +{ return PointH3(-v ); } + +template +inline +VectorH3 +operator-(const PointH3& p, const Origin& ) +{ return VectorH3( p ); } + +template +inline +VectorH3 +operator-(const Origin& , const PointH3& p) +{ return - VectorH3( p ); } + + +template +CGAL_KERNEL_INLINE +PointH3 +operator+(const PointH3& p, const VectorH3& v) +{ + return PointH3(p.hx()*v.hw() + v.hx()*p.hw(), + p.hy()*v.hw() + v.hy()*p.hw(), + p.hz()*v.hw() + v.hz()*p.hw(), + p.hw()*v.hw() ); +} + +template +CGAL_KERNEL_INLINE +PointH3 +operator-(const PointH3& p, const VectorH3& v) +{ + return PointH3( p.hx()*v.hw() - v.hx()*p.hw(), + p.hy()*v.hw() - v.hy()*p.hw(), + p.hz()*v.hw() - v.hz()*p.hw(), + p.hw()*v.hw() ); +} + +template +CGAL_KERNEL_INLINE +VectorH3 +operator-(const PointH3& p, const PointH3& q) +{ + return PointH3( p.hx()*q.hw() - q.hx()*p.hw(), + p.hy()*q.hw() - q.hy()*p.hw(), + p.hz()*q.hw() - q.hz()*p.hw(), + p.hw()*q.hw() ); +} + + + +template +CGAL_KERNEL_INLINE +DirectionH3 +cross_product( const DirectionH3& d1, + const DirectionH3& d2) +{ return cross_product(d1.to_vector(),d2.to_vector()).direction(); } + +CGAL_END_NAMESPACE + + +#ifndef CGAL_AFF_TRANSFORMATIONH3_H +#include +#endif // CGAL_AFF_TRANSFORMATIONH3_H + +#ifndef CGAL_BBOX_3_H +#include +#endif // CGAL_BBOX_3_H +#ifndef CGAL_MISC_H +#include +#endif // CGAL_MISC_H + +CGAL_BEGIN_NAMESPACE + + +template < class FT, class RT > +inline +PointH3 +PointH3::transform(const Aff_transformationH3& t) const +{ return t.transform(*this); } + +template < class FT, class RT > +CGAL_KERNEL_LARGE_INLINE +Bbox_3 +PointH3::bbox() const +{ +#ifndef CGAL_CFG_NO_NAMESPACE + using std::swap; +#endif // CGAL_CFG_NO_NAMESPACE + + // double bx = to_double(x()); + // double by = to_double(y()); + // double bz = to_double(z()); + // return Bbox_3(bx, by, bz, bx, by, bz); + + double eps = double(1.0) /(double(1<<26) * double(1<<26)); + double hxd = CGAL::to_double( hx() ); + double hyd = CGAL::to_double( hy() ); + double hzd = CGAL::to_double( hz() ); + double hwd = CGAL::to_double( hw() ); + double xmin = ( hxd - eps*hxd ) / ( hwd + eps*hwd ); + double xmax = ( hxd + eps*hxd ) / ( hwd - eps*hwd ); + double ymin = ( hyd - eps*hyd ) / ( hwd + eps*hwd ); + double ymax = ( hyd + eps*hyd ) / ( hwd - eps*hwd ); + double zmin = ( hzd - eps*hzd ) / ( hwd + eps*hwd ); + double zmax = ( hzd + eps*hzd ) / ( hwd - eps*hwd ); + if ( hx() < RT(0) ) + { + swap(xmin, xmax); + } + if ( hy() < RT(0) ) + { + swap(ymin, ymax); + } + if ( hz() < RT(0) ) + { + swap(zmin, zmax); + } + return Bbox_3(xmin, ymin, zmin, xmax, ymax, zmax); +} + +template < class FT, class RT > +inline +VectorH3 +VectorH3::transform(const Aff_transformationH3&t ) const +{ return t.transform(*this); } + + +#ifndef NO_OSTREAM_INSERT_VECTORH3 +template < class FT, class RT > +std::ostream& operator<<(std::ostream& os, const VectorH3& v) +{ + switch(os.iword(IO::mode)) + { + case IO::ASCII : + return os << v.hx() << ' ' << v.hy() << ' ' << v.hz() << ' ' << v.hw(); + case IO::BINARY : + write(os, v.hx()); + write(os, v.hy()); + write(os, v.hz()); + write(os, v.hw()); + return os; + default: + return os << "VectorH3(" << v.hx() << ", " + << v.hy() << ", " + << v.hz() << ", " + << v.hw() << ')'; + } +} +#endif // NO_OSTREAM_INSERT_VECTORH3 + +#ifndef NO_ISTREAM_EXTRACT_VECTORH3 +template < class FT, class RT > +std::istream& operator>>(std::istream& is, VectorH3& v) +{ + RT hx, hy, hz, hw; + switch(is.iword(IO::mode)) + { + case IO::ASCII : + is >> hx >> hy >> hz >> hw; + break; + case IO::BINARY : + read(is, hx); + read(is, hy); + read(is, hz); + read(is, hw); + break; + default: + std::cerr << "" << std::endl; + std::cerr << "Stream must be in ascii or binary mode" << std::endl; + break; + } + v = VectorH3(hx, hy, hz, hw); + return is; +} +#endif // NO_ISTREAM_EXTRACT_VECTORH3 + +template +inline +DirectionH3 +DirectionH3:: +transform(const Aff_transformationH3& t) const +{ return t.transform(*this); } + + +#ifndef NO_OSTREAM_INSERT_DIRECTIONH3 +template < class FT, class RT > +std::ostream &operator<<(std::ostream &os, const DirectionH3 &p) +{ + switch(os.iword(IO::mode)) + { + case IO::ASCII : + return os << p.dx() << ' ' << p.dy() << ' ' << p.dz(); + case IO::BINARY : + write(os, p.dx()); + write(os, p.dy()); + write(os, p.dz()); + return os; + default: + return os << "DirectionH3(" << p.dx() << ", " + << p.dy() << ", " + << p.dz() << ')'; + } +} +#endif // NO_OSTREAM_INSERT_DIRECTIONH3 + +#ifndef NO_ISTREAM_EXTRACT_DIRECTIONH3 +template < class FT, class RT > +std::istream &operator>>(std::istream &is, DirectionH3 &p) +{ + RT x, y, z; + switch(is.iword(IO::mode)) + { + case IO::ASCII : + is >> x >> y >> z; + break; + case IO::BINARY : + read(is, x); + read(is, y); + read(is, z); + break; + default: + std::cerr << "" << std::endl; + std::cerr << "Stream must be in ascii or binary mode" << std::endl; + break; + } + p = DirectionH3(x, y, z); + return is; +} +#endif // NO_ISTREAM_EXTRACT_DIRECTIONH3 + + +/* +template +VectorH3 +operator/(const VectorH3& v, const RT& f); +*/ +CGAL_END_NAMESPACE + + +#endif // CGAL_PVDH3_H diff --git a/Packages/H3/include/CGAL/PlaneH3.h b/Packages/H3/include/CGAL/PlaneH3.h new file mode 100644 index 00000000000..d2ec9e92255 --- /dev/null +++ b/Packages/H3/include/CGAL/PlaneH3.h @@ -0,0 +1,678 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : PlaneH3.fw +// file : PlaneH3.h +// package : H3 (2.14) +// maintainer : Stefan Schirra +// revision : 2.14 +// revision_date : 15 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_PLANEH3_H +#define CGAL_PLANEH3_H + +#if defined(CGAL_CFG_INCOMPLETE_TYPE_BUG_1) && \ + !defined(CGAL_NO_PLANE_TRANSFORM_IN_AT) +#define CGAL_NO_PLANE_TRANSFORM_IN_AT +#endif // CGAL_CFG_INCOMPLETE_TYPE_BUG_1 + +#ifndef CGAL_POINTH2_H +#include +#endif // CGAL_POINTH2_H +#ifndef CGAL_POINTH3_H +#include +#endif // CGAL_POINTH3_H +#ifndef CGAL_LINEH3_H +#include +#endif // CGAL_LINEH3_H +#ifndef CGAL_RAYH3_H +#include +#endif // CGAL_RAYH3_H +#ifndef CGAL_SEGMENTH3_H +#include +#endif // CGAL_SEGMENTH3_H +#include + +CGAL_BEGIN_NAMESPACE + + +template < class FT, class RT > +class PlaneH3 : public Handle_for< Fourtuple > +{ + public: + PlaneH3(); + PlaneH3(const PointH3& , + const PointH3& , + const PointH3& ); + PlaneH3(const RT& a, const RT& b, + const RT& c, const RT& d ); + PlaneH3(const PointH3& , + const RayH3& ); + PlaneH3(const PointH3& , + const LineH3& ); + PlaneH3(const PointH3& , + const SegmentH3& ); + PlaneH3(const LineH3& , + const PointH3& ); + PlaneH3(const SegmentH3& , + const PointH3& ); + PlaneH3(const RayH3& , + const PointH3& ); + PlaneH3(const PointH3&, + const DirectionH3& ); + PlaneH3(const PointH3&, + const VectorH3& ); + PlaneH3(const PointH3&, + const DirectionH3&, + const DirectionH3& ); + + RT a() const; + RT b() const; + RT c() const; + RT d() const; + + bool operator==( const PlaneH3& ) const; + bool operator!=( const PlaneH3& ) const; + + LineH3 perpendicular_line(const PointH3& ) const; + PlaneH3 opposite() const; // plane with opposite orientation + PointH3 projection(const PointH3& ) const; + + PointH3 point() const; // same point on the plane + DirectionH3 + orthogonal_direction() const; + VectorH3 + orthogonal_vector() const; + + Oriented_side oriented_side(const PointH3 &p) const; + bool has_on(const PointH3 &p) const; + bool has_on(const LineH3 &p) const; + bool has_on_boundary(const PointH3 &p) const; + bool has_on_boundary(const LineH3 &p) const; + bool has_on_positive_side(const PointH3&l) const; + bool has_on_negative_side(const PointH3&l) const; + + bool is_degenerate() const; + + PlaneH3 transform(const Aff_transformationH3& ) const; + + + Aff_transformationH3 + transform_to_2d() const; + PointH2 to_2d(const PointH3& ) const; + PointH3 to_3d(const PointH2& ) const; + VectorH3 base1() const; + VectorH3 base2() const; + + +protected: + PointH3 point1() const; // same point different from point() + PointH3 point2() const; // same point different from point() + // and point1() + + void new_rep(const PointH3 &p, + const PointH3 &q, + const PointH3 &r); + + void new_rep(const RT &a, const RT &b, + const RT &c, const RT &d); +}; + +// +// a() * X + b() * Y + c() * Z() + d() * W() == 0 +// +// | X Y Z W | +// | p.hx() p.hy() p.hz() p.hw() | +// | q.hx() q.hy() q.hz() q.hw() | +// | r.hx() r.hy() r.hz() r.hw() | +// +// Fourtuple ( a(), b(), c(), d() ) + +template < class FT, class RT > +inline +void +PlaneH3::new_rep(const PointH3 &p, + const PointH3 &q, + const PointH3 &r) +{ + RT phx = p.hx(); + RT phy = p.hy(); + RT phz = p.hz(); + RT phw = p.hw(); + + RT qhx = q.hx(); + RT qhy = q.hy(); + RT qhz = q.hz(); + RT qhw = q.hw(); + + RT rhx = r.hx(); + RT rhy = r.hy(); + RT rhz = r.hz(); + RT rhw = r.hw(); + + initialize_with( Fourtuple ( + phy*( qhz*rhw - qhw*rhz ) + - qhy*( phz*rhw - phw*rhz ) // * X + + rhy*( phz*qhw - phw*qhz ), + + - phx*( qhz*rhw - qhw*rhz ) + + qhx*( phz*rhw - phw*rhz ) // * Y + - rhx*( phz*qhw - phw*qhz ), + + phx*( qhy*rhw - qhw*rhy ) + - qhx*( phy*rhw - phw*rhy ) // * Z + + rhx*( phy*qhw - phw*qhy ), + + - phx*( qhy*rhz - qhz*rhy ) + + qhx*( phy*rhz - phz*rhy ) // * W + - rhx*( phy*qhz - phz*qhy ) ) ); +} + +template < class FT, class RT > +inline +void +PlaneH3::new_rep(const RT &a, const RT &b, const RT &c, const RT &d) +{ initialize_with( Fourtuple(a, b, c, d) ); } + +template < class FT, class RT > +inline +bool +PlaneH3::operator!=(const PlaneH3& l) const +{ + return !(*this == l); +} + + + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +PlaneH3::PlaneH3() + : Handle_for< Fourtuple >(Fourtuple() ) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +PlaneH3::PlaneH3(const PointH3& p, + const PointH3& q, + const PointH3& r) +{ new_rep(p,q,r); } + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +PlaneH3::PlaneH3(const RT& a, const RT& b, + const RT& c, const RT& d) +{ new_rep(a,b,c,d); } + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +PlaneH3::PlaneH3(const PointH3& p , + const LineH3& l) +{ new_rep(p, l.point(0), l.point(1) ); } + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +PlaneH3::PlaneH3(const PointH3& p, + const SegmentH3& s) +{ new_rep(p, s.source(), s.target() ); } + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +PlaneH3::PlaneH3(const PointH3& p , + const RayH3& r) +{ new_rep(p, r.start(), r.start() + r.direction().to_vector() ); } + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +PlaneH3::PlaneH3(const LineH3& l , + const PointH3& p) +{ new_rep(l.point(0), p, l.point(1) ); } + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +PlaneH3::PlaneH3(const SegmentH3& s, + const PointH3& p) +{ new_rep(s.source(), p, s.target() ); } + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +PlaneH3::PlaneH3(const RayH3& r, + const PointH3& p) +{ new_rep(r.start(), p, r.start() + r.direction().to_vector() ); } + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +PlaneH3::PlaneH3(const PointH3& p, + const DirectionH3& d) +{ + VectorH3 ov = d.to_vector(); + new_rep( ov.hx()*p.hw(), + ov.hy()*p.hw(), + ov.hz()*p.hw(), + -(ov.hx()*p.hx() + ov.hy()*p.hy() + ov.hz()*p.hz() ) ); +} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +PlaneH3::PlaneH3(const PointH3& p, + const VectorH3& ov) +{ + new_rep( ov.hx()*p.hw(), + ov.hy()*p.hw(), + ov.hz()*p.hw(), + -(ov.hx()*p.hx() + ov.hy()*p.hy() + ov.hz()*p.hz() ) ); +} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +PlaneH3::PlaneH3(const PointH3& p, + const DirectionH3& d1, + const DirectionH3& d2) +{ new_rep( p, p + d1.to_vector(), p + d2.to_vector() ); } + +template < class FT, class RT > +inline +RT +PlaneH3::a() const +{ return ptr->e0; } + +template < class FT, class RT > +inline +RT +PlaneH3::b() const +{ return ptr->e1; } + +template < class FT, class RT > +inline +RT +PlaneH3::c() const +{ return ptr->e2; } + +template < class FT, class RT > +inline +RT +PlaneH3::d() const +{ return ptr->e3; } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +LineH3 +PlaneH3::perpendicular_line(const PointH3& p) const +{ return LineH3( p, orthogonal_direction() ); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +PlaneH3 +PlaneH3::opposite() const +{ return PlaneH3(-a(), -b(), -c(), -d() ); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +PointH3 +PlaneH3::projection(const PointH3& p) const +{ return _projection( p, *this ); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +PointH3 +PlaneH3::point() const +{ + const RT RT0(0); + if ( a() != RT0 ) + { + return PointH3( -d(), RT0, RT0, a() ); + } + if ( b() != RT0 ) + { + return PointH3( RT0, -d(), RT0, b() ); + } + CGAL_kernel_assertion ( c() != RT0); + return PointH3( RT0, RT0, -d(), c() ); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +VectorH3 +PlaneH3::base1() const +{ + // point(): + // a() != RT0 : PointH3( -d(), RT0, RT0, a() ); + // b() != RT0 : PointH3( RT0, -d(), RT0, b() ); + // : PointH3( RT0, RT0, -d(), c() ); + // point1(): + // a() != RT0 : PointH3( -b()-d(), a(), RT0, a() ); + // b() != RT0 : PointH3( RT0, -c()-d(), b(), b() ); + // : PointH3( c(), RT0, -a()-d(), c() ); + + const RT RT0(0); + if ( a() != RT0 ) + { + return VectorH3( -b(), a(), RT0, a() ); + } + if ( b() != RT0 ) + { + return VectorH3( RT0, -c(), b(), b() ); + } + CGAL_kernel_assertion ( c() != RT(0) ); + return VectorH3( c(), RT0, -a(), c() ); +} + +template < class FT, class RT > +inline +VectorH3 +PlaneH3::base2() const +{ + VectorH3 a = orthogonal_vector(); + VectorH3 b = base1(); + return VectorH3(a.hy()*b.hz() - a.hz()*b.hy(), + a.hz()*b.hx() - a.hx()*b.hz(), + a.hx()*b.hy() - a.hy()*b.hx(), + a.hw()*b.hw() ); +} +// Actually, the following should work, but bcc doesn't like it: +// { return cross_product( orthogonal_vector(), base1() ); } + + +template < class FT, class RT > +inline +PointH3 +PlaneH3::point1() const +{ return point() + base1(); } + +template < class FT, class RT > +inline +PointH3 +PlaneH3::point2() const +{ return point() + base2(); } + +template < class FT, class RT > +inline +DirectionH3 +PlaneH3::orthogonal_direction() const +{ return DirectionH3(a(), b(), c() ); } + +template < class FT, class RT > +inline +VectorH3 +PlaneH3::orthogonal_vector() const +{ return VectorH3(a(), b(), c() ); } + +template < class FT, class RT > +PlaneH3 +PlaneH3::transform(const Aff_transformationH3& t) const +{ +#ifndef CGAL_NO_PLANE_TRANSFORM_IN_AT + return t.transform(*this); +#else + if ( t.is_even() ) + { + return PlaneH3( + t.transform(point() ), + t.transpose().inverse().transform(orthogonal_direction() )); + } + else + { + return PlaneH3( + t.transform(point() ), + - t.transpose().inverse().transform(orthogonal_direction() )); + } +#endif // CGAL_NO_PLANE_TRANSFORM_IN_AT +} + + + +#ifndef NO_OSTREAM_INSERT_PLANE3 +template < class FT, class RT > +std::ostream &operator<<(std::ostream &os, const PlaneH3 &p) +{ + switch(os.iword(IO::mode)) { + case IO::ASCII : + return os << p.a() << ' ' << p.b() << ' ' << p.c() << ' ' << p.d(); + case IO::BINARY : + write(os, p.a()); + write(os, p.b()); + write(os, p.c()); + write(os, p.d()); + return os; + default: + os << "PlaneC3(" << p.a() << ", " << p.b() << ", "; + os << p.c() << ", " << p.d() <<")"; + return os; + } +} +#endif // NO_OSTREAM_INSERT_PLANE3 + +#ifndef NO_ISTREAM_EXTRACT_PLANE3 +template < class FT, class RT > +std::istream &operator>>(std::istream &is, PlaneH3 &p) +{ + RT a, b, c, d; + switch(is.iword(IO::mode)) { + case IO::ASCII : + is >> a >> b >> c >> d; + break; + case IO::BINARY : + read(is, a); + read(is, b); + read(is, c); + read(is, d); + break; + default: + std::cerr << "" << std::endl; + std::cerr << "Stream must be in ascii or binary mode" << std::endl; + break; + } + p = PlaneH3(a, b, c, d); + return is; +} +#endif // NO_ISTREAM_EXTRACT_PLANE3 +template < class FT, class RT > +bool +PlaneH3::is_degenerate() const +{ + const RT RT0(0); + return ( (a() == RT0 ) && (b() == RT0 ) && (c() == RT0 ) ); +} + +template < class FT, class RT > +bool +PlaneH3::has_on_positive_side( const PointH3& p) const +{ + return (a()*p.hx() + b()*p.hy() + c()*p.hz() + d()*p.hw() > RT(0) ); +} + +template < class FT, class RT > +bool +PlaneH3::has_on_negative_side( const PointH3& p) const +{ + return (a()*p.hx() + b()*p.hy() + c()*p.hz() + d()*p.hw() < RT(0) ); +} + +template < class FT, class RT > +bool +PlaneH3::has_on_boundary( const PointH3& p) const +{ + return (a()*p.hx() + b()*p.hy() + c()*p.hz() + d()*p.hw() == RT(0) ); +} + +template < class FT, class RT > +bool +PlaneH3::has_on( const PointH3& p) const +{ + return has_on_boundary(p); +} + +template < class FT, class RT > +bool +PlaneH3::has_on_boundary( const LineH3& l) const +{ + PointH3 p = l.point(); + VectorH3 ld = l.direction().to_vector(); + VectorH3 ov = orthogonal_vector(); + + return ( ( a()*p.hx() + b()*p.hy() + c()*p.hz() + d()*p.hw() == RT(0) ) + &&( ld.hx()*ov.hx() + ld.hy()*ov.hy() + ld.hz()*ov.hz() == RT(0) ) ); +} + +template < class FT, class RT > +bool +PlaneH3::has_on( const LineH3& l) const +{ + return has_on_boundary(l); +} + +template < class FT, class RT > +Oriented_side +PlaneH3::oriented_side( const PointH3& p) const +{ + RT value = a()*p.hx() + b()*p.hy() + c()*p.hz() + d()*p.hw() ; + if (value > RT(0) ) + { + return ON_POSITIVE_SIDE; + } + else + { + return + (value < RT(0) ) ? ON_NEGATIVE_SIDE : ON_ORIENTED_BOUNDARY; + } +} + + +template < class FT, class RT > +bool +PlaneH3::operator==(const PlaneH3& l) const +{ + if ( (a() * l.d() != l.a() * d() ) + ||(b() * l.d() != l.b() * d() ) + ||(c() * l.d() != l.c() * d() ) ) + { + return false; + } + int sd = (int)CGAL_NTS sign(d() ); + int sld = (int)CGAL_NTS sign(l.d() ); + if ( sd == sld ) + { + if (sd == 0) + { + return ( (a()*l.b() == b()*l.a() ) + &&(a()*l.c() == c()*l.a() ) + &&(b()*l.c() == c()*l.b() ) + &&(CGAL_NTS sign(a() )== CGAL_NTS sign( l.a() )) + &&(CGAL_NTS sign(b() )== CGAL_NTS sign( l.b() )) + &&(CGAL_NTS sign(c() )== CGAL_NTS sign( l.c() )) ); + } + else + { + return true; + } + } + else + { + return false; + } +} + + +CGAL_END_NAMESPACE + + +#ifndef CGAL_AFF_TRANSFORMATIONH3_H +#include +#endif // CGAL_AFF_TRANSFORMATIONH3_H + +CGAL_BEGIN_NAMESPACE + +template < class FT, class RT > +Aff_transformationH3 +PlaneH3::transform_to_2d() const +{ + const RT RT0(0); + const RT RT1(1); + VectorH3 nov = orthogonal_vector(); + VectorH3 e1v = point1()-point() ; + VectorH3 e2v = point2()-point() ; + RT orthohx = nov.hx(); + RT orthohy = nov.hy(); + RT orthohz = nov.hz(); + RT e1phx = e1v.hx(); + RT e1phy = e1v.hy(); + RT e1phz = e1v.hz(); + RT e2phx = e2v.hx(); + RT e2phy = e2v.hy(); + RT e2phz = e2v.hz(); + + RT t11 = -( orthohy*e2phz - orthohz*e2phy ); + RT t12 = ( orthohx*e2phz - orthohz*e2phx ); + RT t13 = -( orthohx*e2phy - orthohy*e2phx ); + + RT t21 = ( orthohy*e1phz - orthohz*e1phy ); + RT t22 = -( orthohx*e1phz - orthohz*e1phx ); + RT t23 = ( orthohx*e1phy - orthohy*e1phx ); + + RT t31 = ( e1phy*e2phz - e1phz*e2phy ); + RT t32 = -( e1phx*e2phz - e1phz*e2phx ); + RT t33 = ( e1phx*e2phy - e1phy*e2phx ); + + RT scale = det3x3_by_formula( orthohx, orthohy, orthohz, + e1phx, e1phy, e1phz, + e2phx, e2phy, e2phz ); + + Aff_transformationH3 + point_to_origin(TRANSLATION, - ( point() - ORIGIN ) ); + Aff_transformationH3 + rotate_and_more( t11, t12, t13, RT0, + t21, t22, t23, RT0, + t31, t32, t33, RT0, + scale); + + PointH3 ortho( orthohx, orthohy, orthohz ); + PointH3 e1p( e1phx, e1phy, e1phz ); + PointH3 e2p( e2phx, e2phy, e2phz ); + CGAL_kernel_assertion(( ortho.transform(rotate_and_more) + == PointH3( RT(0), RT(0), RT(1)) )); + CGAL_kernel_assertion(( e1p.transform(rotate_and_more) + == PointH3( RT(1), RT(0), RT(0)) )); + CGAL_kernel_assertion(( e2p.transform(rotate_and_more) + == PointH3( RT(0), RT(1), RT(0)) )); + + return rotate_and_more * point_to_origin; +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +PointH2 +PlaneH3::to_2d(const PointH3& p) const +{ + PointH3 tp = p.transform( transform_to_2d() ); + return PointH2( tp.hx(), tp.hy(), tp.hw()); +} + + +template < class FT, class RT > +CGAL_KERNEL_INLINE +PointH3 +PlaneH3::to_3d(const PointH2& p) const +{ + PointH3 hp( p.hx(), p.hy(), RT(0.0), p.hw()); + return hp.transform( transform_to_2d().inverse() ); +} + +CGAL_END_NAMESPACE + + +#endif // CGAL_PLANEH3_H diff --git a/Packages/H3/include/CGAL/PointH3.h b/Packages/H3/include/CGAL/PointH3.h new file mode 100644 index 00000000000..4b1b869fe18 --- /dev/null +++ b/Packages/H3/include/CGAL/PointH3.h @@ -0,0 +1,28 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : PointVectorDirectionH3.fw +// file : PointH3.h +// package : H3 (2.14) +// maintainer : Stefan Schirra +// revision : 2.14 +// revision_date : 15 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + +#ifndef CGAL_PVDH3_H +#include +#endif // CGAL_PVDH3_H diff --git a/Packages/H3/include/CGAL/RayH3.h b/Packages/H3/include/CGAL/RayH3.h new file mode 100644 index 00000000000..4e438ab6a07 --- /dev/null +++ b/Packages/H3/include/CGAL/RayH3.h @@ -0,0 +1,221 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : RayH3.fw +// file : RayH3.h +// package : H3 (2.14) +// maintainer : Stefan Schirra +// revision : 2.14 +// revision_date : 15 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_RAYH3_H +#define CGAL_RAYH3_H + +#ifndef CGAL_LINEH3_H +#include +#endif // CGAL_LINEH3_H + +CGAL_BEGIN_NAMESPACE + +template < class FT, class RT > +class Ray_repH3 : public Ref_counted +{ + public: + Ray_repH3() {} + Ray_repH3(const PointH3& p, const DirectionH3& d) + : startpoint(p), direction(d) + {} + + friend class RayH3; + + private: + PointH3 startpoint; + DirectionH3 direction; +}; + +template < class FT, class RT > +class RayH3 : public Handle_for< Ray_repH3 > +{ + public: + RayH3(); + RayH3( const PointH3& sp, const PointH3& secondp); + RayH3( const PointH3& sp, const DirectionH3& d); + + PointH3 start() const; + PointH3 source() const; + PointH3 second_point() const; + PointH3 point(int i) const; + DirectionH3 + direction() const; + LineH3 supporting_line() const; + RayH3 opposite() const; + RayH3 transform( const Aff_transformationH3 & t) const; + bool has_on(const PointH3 p) const; + bool collinear_has_on(const PointH3 p) const; + bool is_degenerate() const; + + bool operator==(const RayH3& r) const; + bool operator!=(const RayH3& r) const; +}; + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +RayH3::RayH3() + : Handle_for< Ray_repH3 >( Ray_repH3() ) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +RayH3::RayH3( const PointH3& sp, + const PointH3& secondp) + : Handle_for >(Ray_repH3(sp,(secondp-sp).direction())) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +RayH3::RayH3( const PointH3& sp, + const DirectionH3& d) + : Handle_for >( Ray_repH3(sp, d )) +{} + +template < class FT, class RT > +inline +PointH3 +RayH3::source() const +{ return ptr->startpoint; } + +template < class FT, class RT > +inline +PointH3 +RayH3::start() const +{ return ptr->startpoint; } + +template < class FT, class RT > +inline +DirectionH3 +RayH3::direction() const +{ + CGAL_kernel_precondition( !is_degenerate() ); + return DirectionH3( ptr->direction ); +} + + +template < class FT, class RT > +CGAL_KERNEL_INLINE +PointH3 +RayH3::second_point() const +{ return start() + direction().to_vector(); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +PointH3 +RayH3::point(int i) const +{ + CGAL_kernel_precondition( i >= 0 ); + return start() + RT(i)*(direction().to_vector() ) ; +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +LineH3 +RayH3::supporting_line() const +{ + CGAL_kernel_precondition( !is_degenerate() ); + return LineH3(start(), second_point() ); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +RayH3 +RayH3::opposite() const +{ return RayH3( start(), - direction() ); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +RayH3 +RayH3::transform( const Aff_transformationH3 & t) const +{ return RayH3(t.transform(start()), t.transform(direction()) ); } + + +#ifndef NO_OSTREAM_INSERT_RAYH3 +template < class FT, class RT > +std::ostream &operator<<(std::ostream &os, const RayH3 &r) +{ + switch(os.iword(IO::mode)) + { + case IO::ASCII : + return os << r.start() << ' ' << r.direction(); + case IO::BINARY : + return os<< r.start() << r.direction(); + default: + return os << "RayH3(" << r.start() << ", " << r.direction() << ")"; + } +} +#endif // NO_OSTREAM_INSERT_RAYH3 + +#ifndef NO_ISTREAM_EXTRACT_RAYH3 +template < class FT, class RT > +std::istream &operator>>(std::istream &is, RayH3 &r) +{ + PointH3 p; + DirectionH3 d; + is >> p >> d; + r = RayH3(p, d); + return is; +} +#endif // NO_ISTREAM_EXTRACT_RAYH3 +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +RayH3::has_on(const PointH3 p) const +{ + return ( ( p == start() ) + ||( DirectionH3(p - start()) == direction() ) ); +} + +template < class FT, class RT > +inline /* XXX */ +bool +RayH3::collinear_has_on(const PointH3 p) const +{ return has_on(p); } + +template < class FT, class RT > +inline +bool +RayH3::is_degenerate() const +{ return (ptr->direction).is_degenerate() ; } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +RayH3::operator==(const RayH3& r) const +{ return ( (start() == r.start() )&&( direction() == r.direction() ) ); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +RayH3::operator!=( const RayH3& r) const +{ return !operator==(r); } + + + +CGAL_END_NAMESPACE + + +#endif // CGAL_RAYH3_H diff --git a/Packages/H3/include/CGAL/RepH3.h b/Packages/H3/include/CGAL/RepH3.h new file mode 100644 index 00000000000..d6e29c784d7 --- /dev/null +++ b/Packages/H3/include/CGAL/RepH3.h @@ -0,0 +1,58 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : PointVectorDirectionH3.fw +// file : RepH3.h +// package : H3 (2.14) +// maintainer : Stefan Schirra +// revision : 2.14 +// revision_date : 15 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_REPH3_H +#define CGAL_REPH3_H + +CGAL_BEGIN_NAMESPACE + +template +class RepH3 : public Ref_counted +{ +public: + NT e0; + NT e1; + NT e2; + NT e3; + + RepH3() + // : e0(NT(42)), e1(NT(42)), e2(NT(42)), e3(NT(1)) + {} + RepH3(const NT& a0, const NT& a1, const NT& a2, const NT& a3) + : e0(a0), e1(a1), e2(a2), e3(a3) + {} + + NT hx() { return e0; } + NT hy() { return e1; } + NT hz() { return e2; } + NT hw() { return e3; } // homogenizing component +}; + + +CGAL_END_NAMESPACE + + +#endif // CGAL_REPH3_H diff --git a/Packages/H3/include/CGAL/SegmentH3.h b/Packages/H3/include/CGAL/SegmentH3.h new file mode 100644 index 00000000000..497a826b2f3 --- /dev/null +++ b/Packages/H3/include/CGAL/SegmentH3.h @@ -0,0 +1,299 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : SegmentH3.fw +// file : SegmentH3.h +// package : H3 (2.14) +// maintainer : Stefan Schirra +// revision : 2.14 +// revision_date : 15 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_SEGMENTH3_H +#define CGAL_SEGMENTH3_H + +#ifndef CGAL_LINEH3_H +#include +#endif // CGAL_LINEH3_H + +CGAL_BEGIN_NAMESPACE + + +template < class FT, class RT > +class Segment_repH3 : public Ref_counted +{ +public: + Segment_repH3() {} + Segment_repH3(const PointH3& sp, const PointH3& ep) + : startpoint(sp), endpoint(ep) + {} + + PointH3 start() const; + PointH3 end() const; + +private: + PointH3 startpoint; + PointH3 endpoint; +}; + +template < class FT, class RT > +class SegmentH3 : public Handle_for< Segment_repH3 > +{ +public: + SegmentH3(); + SegmentH3( const PointH3& sp, const PointH3& ep); + + PointH3 source() const; + PointH3 target() const; + + PointH3 start() const; + PointH3 end() const; + PointH3 min() const; + PointH3 max() const; + PointH3 vertex(int i) const; + PointH3 point(int i) const; + PointH3 operator[](int i) const; + + FT squared_length() const; + DirectionH3 + direction() const; + LineH3 supporting_line() const; + SegmentH3 opposite() const; + SegmentH3 transform( const Aff_transformationH3 & t) const; + Bbox_3 bbox() const; + bool has_on(const PointH3 p) const; + bool collinear_has_on(const PointH3 p) const; + bool is_degenerate() const; + + bool operator==(const SegmentH3& s) const; + bool operator!=(const SegmentH3& s) const; + +}; + +template < class FT, class RT > +inline +PointH3 +Segment_repH3::start() const +{ return startpoint; } + +template < class FT, class RT > +inline +PointH3 +Segment_repH3::end() const +{ return endpoint; } + + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +SegmentH3::SegmentH3() + : Handle_for< Segment_repH3 >( Segment_repH3() ) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +SegmentH3::SegmentH3( const PointH3& sp, + const PointH3& ep) + : Handle_for< Segment_repH3 >( Segment_repH3(sp,ep) ) +{} +template < class FT, class RT > +inline +PointH3 +SegmentH3::source() const +{ return ptr->start(); } + +template < class FT, class RT > +inline +PointH3 +SegmentH3::target() const +{ return ptr->end(); } + +template < class FT, class RT > +inline +PointH3 +SegmentH3::start() const +{ return ptr->start(); } + +template < class FT, class RT > +inline +PointH3 +SegmentH3::end() const +{ return ptr->end(); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +PointH3 +SegmentH3::min() const +{ + return + lexicographically_xyz_smaller(target(),source()) ? target() : source(); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +PointH3 +SegmentH3::max() const +{ + return + lexicographically_xyz_smaller_or_equal(source(),target()) ? + target() : source(); +} + +template < class FT, class RT > +inline +PointH3 +SegmentH3::vertex(int i) const +{ return ( i%2 == 0 ) ? start() : end() ; } + +template < class FT, class RT > +inline +PointH3 +SegmentH3::point(int i) const +{ return ( i%2 == 0 ) ? start() : end() ; } + +template < class FT, class RT > +inline +PointH3 +SegmentH3::operator[](int i) const +{ return ( i%2 == 0 ) ? start() : end() ; } + + +template < class FT, class RT > +CGAL_KERNEL_INLINE +FT +SegmentH3::squared_length() const +{ + return (ptr->end() - ptr->start()) * + (ptr->end() - ptr->start()) ; +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +DirectionH3 +SegmentH3::direction() const +{ return DirectionH3( ptr->end() - ptr->start() ); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +LineH3 +SegmentH3::supporting_line() const +{ return LineH3(ptr->start(), ptr->end()); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +SegmentH3 +SegmentH3::opposite() const +{ return SegmentH3(ptr->end(), ptr->start()); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +SegmentH3 +SegmentH3:: +transform( const Aff_transformationH3& t) const +{ + return SegmentH3(t.transform(ptr->start()), + t.transform(ptr->end()) ); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +Bbox_3 +SegmentH3::bbox() const +{ return source().bbox() + target().bbox(); } + + +#ifndef NO_OSTREAM_INSERT_SEGMENTH3 +template < class FT, class RT > +std::ostream &operator<<(std::ostream &os, const SegmentH3 &s) +{ + switch(os.iword(IO::mode)) + { + case IO::ASCII : + return os << s.source() << ' ' << s.target(); + case IO::BINARY : + return os << s.source() << s.target(); + default: + return os << "SegmentH3(" << s.source() << ", " << s.target() << ")"; + } +} +#endif // NO_OSTREAM_INSERT_SEGMENTH3 + +#ifndef NO_ISTREAM_EXTRACT_SEGMENTH3 +template < class FT, class RT > +std::istream &operator>>(std::istream &is, SegmentH3 &s) +{ + PointH3 p, q; + is >> p >> q; + s = SegmentH3(p, q); + return is; +} +#endif // NO_ISTREAM_EXTRACT_SEGMENTH3 +template < class FT, class RT > +inline +bool +SegmentH3::is_degenerate() const +{ return source()==target(); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +SegmentH3::has_on(const PointH3 p) const +{ + return( ( p == start() ) + || ( p == end() ) + || ( ( collinear(p,source(),target() ) + &&( DirectionH3( p - ptr->start()) + != + DirectionH3( p - ptr->end())) + ) + ) + ); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +SegmentH3::collinear_has_on(const PointH3 p) const +{ + return( ( p == start() ) + || ( p == end() ) + || ( DirectionH3( p - ptr->start()) + != + DirectionH3( p - ptr->end()) + ) + ); +} +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +SegmentH3::operator==(const SegmentH3& s) const +{ + return ( (start() == s.start() ) + &&(end() == s.end() ) ); +} +template < class FT, class RT > +inline +bool +SegmentH3::operator!=(const SegmentH3& s) const +{ return ( !operator==(s) ); } + + + +CGAL_END_NAMESPACE + + +#endif // CGAL_SEGMENTH3_H diff --git a/Packages/H3/include/CGAL/SphereH3.h b/Packages/H3/include/CGAL/SphereH3.h new file mode 100644 index 00000000000..ee6a11d960b --- /dev/null +++ b/Packages/H3/include/CGAL/SphereH3.h @@ -0,0 +1,304 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : SphereH3.fw +// file : SphereH3.h +// package : H3 (2.14) +// maintainer : Stefan Schirra +// revision : 2.14 +// revision_date : 15 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_SPHEREH3_H +#define CGAL_SPHEREH3_H + +#include +#include +#include +#include + +CGAL_BEGIN_NAMESPACE + +template +class Sphere_repH3 : public Ref_counted +{ + public: + friend class SphereH3; + + Sphere_repH3() + {} + + Sphere_repH3(const PointH3 p, + const FT sq_rad, + const Orientation& o) + : center(p), squared_radius(sq_rad), orientation_(o) + {} + + protected: + PointH3 center; + FT squared_radius; + Orientation orientation_; +}; + + +template +class SphereH3 : public Handle_for< Sphere_repH3 > +{ + public: + SphereH3(); + + SphereH3(const PointH3& p, const FT& sq_rad, + const Orientation& o = COUNTERCLOCKWISE); + + SphereH3(const PointH3& p, const PointH3& q, + const PointH3& r, const PointH3& u); + + SphereH3(const PointH3& p, const PointH3& q, + const PointH3& r, + const Orientation& o = COUNTERCLOCKWISE); + + SphereH3(const PointH3& p, const PointH3& q, + const Orientation& o = COUNTERCLOCKWISE); + + SphereH3(const PointH3& p, + const Orientation& o = COUNTERCLOCKWISE); + + bool + operator==(const SphereH3&) const; + + bool + operator!=(const SphereH3& s) const + { return !(*this == s); } + + PointH3 + center() const; + + FT + squared_radius() const; + + Orientation + orientation() const; + + SphereH3 + orthogonal_transform(const Aff_transformationH3& t) const; + + bool + is_degenerate() const; + + SphereH3 + opposite() const; + + Bbox_3 + bbox() const; + + Oriented_side + oriented_side(const PointH3& p) const; + + bool + has_on_boundary(const PointH3& p) const + { return oriented_side(p)==ON_ORIENTED_BOUNDARY; } + + bool + has_on_positive_side(const PointH3& p) const + { return oriented_side(p)==ON_POSITIVE_SIDE; } + + bool + has_on_negative_side(const PointH3& p) const + { return oriented_side(p)==ON_NEGATIVE_SIDE; } + + Bounded_side + bounded_side(const PointH3& p) const; + + bool + has_on_bounded_side(const PointH3& p) const + { return bounded_side(p)==ON_BOUNDED_SIDE; } + + bool + has_on_unbounded_side(const PointH3& p) const + { return bounded_side(p)==ON_UNBOUNDED_SIDE; } + +}; + + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +SphereH3::SphereH3() + : Handle_for< Sphere_repH3 >() +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +SphereH3::SphereH3(const PointH3& center, + const FT& squared_radius, + const Orientation& o) +{ + CGAL_kernel_precondition( !( squared_radius < FT(0)) + &&( o != COLLINEAR) ); + initialize_with( Sphere_repH3(center, squared_radius, o)); +} + +template +CGAL_KERNEL_CTOR_INLINE +SphereH3::SphereH3(const PointH3& center, + const Orientation& o) +{ + CGAL_kernel_precondition( ( o != COLLINEAR) ); + initialize_with( Sphere_repH3(center, FT(0), o)); +} + +template +CGAL_KERNEL_CTOR_MEDIUM_INLINE +SphereH3::SphereH3(const PointH3& p, + const PointH3& q, + const Orientation& o) +{ + CGAL_kernel_precondition( o != COLLINEAR); + PointH3 center = midpoint(p,q); + FT squared_radius = squared_distance(p,center); + initialize_with(Sphere_repH3(center, squared_radius, o)); +} + +template +CGAL_KERNEL_CTOR_MEDIUM_INLINE +SphereH3::SphereH3(const PointH3& p, + const PointH3& q, + const PointH3& r, + const Orientation& o) +{ + CGAL_kernel_precondition( o != COLLINEAR); + PointH3 center = circumcenter(p,q,r); + FT squared_radius = squared_distance(p,center); + initialize_with(Sphere_repH3(center, squared_radius, o)); +} + +template +CGAL_KERNEL_CTOR_MEDIUM_INLINE +SphereH3::SphereH3(const PointH3& p, + const PointH3& q, + const PointH3& r, + const PointH3& s) +{ + Orientation o = CGAL::orientation(p,q,r,s); + CGAL_kernel_precondition( o != COLLINEAR); + PointH3 center = circumcenter(p,q,r,s); + FT squared_radius = squared_distance(p,center); + initialize_with(Sphere_repH3(center, squared_radius, o)); +} + +template +CGAL_KERNEL_INLINE +bool +SphereH3::operator==(const SphereH3& s) const +{ + return ( orientation() == s.orientation()) + && ( center() == s.center()) + && ( squared_radius() == s.squared_radius()); +} + +template +inline +PointH3 +SphereH3::center() const +{ return ptr->center; } + +template +inline +FT +SphereH3::squared_radius() const +{ return ptr->squared_radius; } + +template +inline +Orientation +SphereH3::orientation() const +{ return ptr->orientation_; } + +template +inline +bool +SphereH3::is_degenerate() const +{ return ptr->squared_radius <= FT(0) ; } + +template +CGAL_KERNEL_MEDIUM_INLINE +Oriented_side +SphereH3::oriented_side(const PointH3& p) const +{ return Oriented_side(bounded_side(p) * orientation()); } + +template +CGAL_KERNEL_INLINE +Bounded_side +SphereH3::bounded_side(const PointH3& p) const +{ + return Bounded_side(CGAL::compare(squared_radius(), + squared_distance(center(),p))); +} +template +inline +SphereH3 +SphereH3::opposite() const +{ + return SphereH3(center(), squared_radius(), + CGAL::opposite(orientation()) ); +} + +template +CGAL_KERNEL_INLINE +Bbox_3 +SphereH3::bbox() const +{ + double eps = double(1.0) /(double(1<<26) * double(1<<26)); + double hxd = CGAL::to_double( center().hx() ); + double hyd = CGAL::to_double( center().hy() ); + double hzd = CGAL::to_double( center().hz() ); + double hwd = CGAL::to_double( center().hw() ); + double xmin = ( hxd - eps*hxd ) / ( hwd + eps*hwd ); + double xmax = ( hxd + eps*hxd ) / ( hwd - eps*hwd ); + double ymin = ( hyd - eps*hyd ) / ( hwd + eps*hwd ); + double ymax = ( hyd + eps*hyd ) / ( hwd - eps*hwd ); + double zmin = ( hzd - eps*hyd ) / ( hwd + eps*hwd ); + double zmax = ( hzd + eps*hyd ) / ( hwd - eps*hwd ); + if ( center().hx() < RT(0) ) + { std::swap(xmin, xmax); } + if ( center().hy() < RT(0) ) + { std::swap(ymin, ymax); } + if ( center().hz() < RT(0) ) + { std::swap(zmin, zmax); } + double sqradd = CGAL::to_double( squared_radius() ); + sqradd += sqradd*eps; + sqradd = sqrt(sqradd); + sqradd += sqradd*eps; + xmin -= sqradd; + xmax += sqradd; + xmin -= xmin*eps; + xmax += xmax*eps; + ymin -= sqradd; + ymax += sqradd; + ymin -= ymin*eps; + ymax += ymax*eps; + zmin -= sqradd; + zmax += sqradd; + zmin -= ymin*eps; + zmax += ymax*eps; + return Bbox_3(xmin, ymin, zmin, xmax, ymax, zmax); +} + + +CGAL_END_NAMESPACE + +#endif // CGAL_SPHEREH3_H diff --git a/Packages/H3/include/CGAL/TetrahedronH3.h b/Packages/H3/include/CGAL/TetrahedronH3.h new file mode 100644 index 00000000000..5cd6fb6af5e --- /dev/null +++ b/Packages/H3/include/CGAL/TetrahedronH3.h @@ -0,0 +1,366 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : TetrahedronH3.fw +// file : TetrahedronH3.h +// package : H3 (2.14) +// maintainer : Stefan Schirra +// revision : 2.14 +// revision_date : 15 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_TETRAHEDRONH3_H +#define CGAL_TETRAHEDRONH3_H + +#include +#include +#include +#include +#include +#include + +CGAL_BEGIN_NAMESPACE + +template < class FT, class RT > +class Tetrahedron_repH3 : public Ref_counted +{ + public: + Tetrahedron_repH3() : ordertype(DEGENERATE) {} + Tetrahedron_repH3(const PointH3 &p, + const PointH3 &q, + const PointH3 &r, + const PointH3 &s ) + : container(p,q,r,s), ordertype(orientation(p,q,r,s)) {} + + friend class TetrahedronH3; + + private: + Fourtuple< PointH3 > container; + Orientation ordertype; +}; + + + + +template < class FT, class RT > +class TetrahedronH3 : public Handle_for< Tetrahedron_repH3 > +{ +public: + TetrahedronH3(); + TetrahedronH3(const PointH3 &p, + const PointH3 &q, + const PointH3 &r, + const PointH3 &s); + + PointH3 vertex(int i) const; + PointH3 operator[](int i) const; + bool operator==(const TetrahedronH3 &t) const; + bool operator!=(const TetrahedronH3 &t) const; + Bbox_3 bbox() const; + TetrahedronH3 + transform(const Aff_transformationH3 &t) const; + Orientation orientation() const; + Oriented_side oriented_side(const PointH3 &p) const; + Bounded_side bounded_side(const PointH3 &p) const; + bool has_on_boundary(const PointH3 &p) const; + bool has_on_positive_side(const PointH3 &p) const; + bool has_on_negative_side(const PointH3 &p) const; + bool has_on_bounded_side(const PointH3 &p) const; + bool has_on_unbounded_side(const PointH3 &p) const; + bool is_degenerate() const; +}; + + + + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +TetrahedronH3::TetrahedronH3() + : Handle_for< Tetrahedron_repH3 >( Tetrahedron_repH3() ) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +TetrahedronH3::TetrahedronH3(const PointH3 &p, + const PointH3 &q, + const PointH3 &r, + const PointH3 &s) + : Handle_for< Tetrahedron_repH3 >( Tetrahedron_repH3(p,q,r,s)) +{} + + + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +TetrahedronH3::operator==(const TetrahedronH3 &t) const +{ + if ( ptr == t.ptr ) return true; + if ( orientation() != t.orientation() ) return false; + + std::vector< PointH3 > V1; + std::vector< PointH3 > V2; + typename std::vector< PointH3 >::iterator uniq_end1; + typename std::vector< PointH3 >::iterator uniq_end2; + int k; + for ( k=0; k < 4; k++) V1.push_back( vertex(k)); + for ( k=0; k < 4; k++) V2.push_back( t.vertex(k)); + std::sort(V1.begin(), V1.end(), Less_xyz< PointH3 >()); + std::sort(V2.begin(), V2.end(), Less_xyz< PointH3 >()); + uniq_end1 = std::unique( V1.begin(), V1.end()); + uniq_end2 = std::unique( V2.begin(), V2.end()); + V1.erase( uniq_end1, V1.end()); + V2.erase( uniq_end2, V2.end()); + return V1 == V2; +} + + +template < class FT, class RT > +inline +bool +TetrahedronH3::operator!=(const TetrahedronH3 &t) const +{ return !(*this == t); } +template < class FT, class RT > +CGAL_KERNEL_INLINE +PointH3 +TetrahedronH3::vertex(int i) const +{ + switch (i%4) + { + case 0: return ptr->container.e0; + case 1: return ptr->container.e1; + case 2: return ptr->container.e2; + case 3: return ptr->container.e3; + } + return PointH3(); +} + +template < class FT, class RT > +inline +PointH3 +TetrahedronH3::operator[](int i) const +{ return vertex(i); } +template < class FT, class RT > +inline +bool +TetrahedronH3:: +has_on_boundary(const PointH3 &p) const +{ return bounded_side(p) == ON_BOUNDARY; } + +template < class FT, class RT > +inline +bool +TetrahedronH3:: +has_on_positive_side(const PointH3 &p) const +{ return oriented_side(p) == ON_POSITIVE_SIDE; } + +template < class FT, class RT > +inline +bool +TetrahedronH3:: +has_on_negative_side(const PointH3 &p) const +{ return oriented_side(p) == ON_NEGATIVE_SIDE; } + +template < class FT, class RT > +inline +bool +TetrahedronH3:: +has_on_bounded_side(const PointH3 &p) const +{ return bounded_side(p) == ON_BOUNDED_SIDE; } + +template < class FT, class RT > +inline +bool +TetrahedronH3:: +has_on_unbounded_side(const PointH3 &p) const +{ return bounded_side(p) == ON_UNBOUNDED_SIDE; } + +template < class FT, class RT > +inline +Orientation +TetrahedronH3::orientation() const +{ return ptr->ordertype; } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +Oriented_side +TetrahedronH3::oriented_side(const PointH3 &p) const +{ + if ( orientation() == POSITIVE) + { + switch (bounded_side(p) ) + { + case ON_BOUNDED_SIDE: return ON_POSITIVE_SIDE; + case ON_BOUNDARY: return ON_ORIENTED_BOUNDARY; + case ON_UNBOUNDED_SIDE: return ON_NEGATIVE_SIDE; + } + } + else + { + switch (bounded_side(p) ) + { + case ON_UNBOUNDED_SIDE: return ON_POSITIVE_SIDE; + case ON_BOUNDARY: return ON_ORIENTED_BOUNDARY; + case ON_BOUNDED_SIDE: return ON_NEGATIVE_SIDE; + } + } + CGAL_kernel_assertion( !is_degenerate() ); + return ON_ORIENTED_BOUNDARY; +} + +template < class FT, class RT > +Bounded_side +TetrahedronH3:: +bounded_side(const PointH3 &p) const +{ + const RT RT0(0); + RT alpha; + RT beta ; + RT gamma; + + VectorH3 v1 = vertex(1)-vertex(0); + VectorH3 v2 = vertex(2)-vertex(0); + VectorH3 v3 = vertex(3)-vertex(0); + + VectorH3 vp = p - vertex(0); + + // want to solve alpha*v1 + beta*v2 + gamma*v3 == vp + // let vi' == vi*vi.hw() + // we solve alpha'*v1' + beta'*v2' + gamma'*v3' == vp' / vp.hw() + // muliplied by vp.hw() + // then we have alpha = alpha'*v1.hw() / vp.hw() + // and beta = beta' *v2.hw() / vp.hw() + // and gamma = gamma'*v3.hw() / vp.hw() + + RT v1x = v1.hx(); + RT v1y = v1.hy(); + RT v1z = v1.hz(); + RT v2x = v2.hx(); + RT v2y = v2.hy(); + RT v2z = v2.hz(); + RT v3x = v3.hx(); + RT v3y = v3.hy(); + RT v3z = v3.hz(); + RT vpx = vp.hx(); + RT vpy = vp.hy(); + RT vpz = vp.hz(); + + alpha = det3x3_by_formula( vpx, v2x, v3x, + vpy, v2y, v3y, + vpz, v2z, v3z ); + beta = det3x3_by_formula( v1x, vpx, v3x, + v1y, vpy, v3y, + v1z, vpz, v3z ); + gamma = det3x3_by_formula( v1x, v2x, vpx, + v1y, v2y, vpy, + v1z, v2z, vpz ); + RT det= det3x3_by_formula( v1x, v2x, v3x, + v1y, v2y, v3y, + v1z, v2z, v3z ); + + CGAL_kernel_assertion( det != RT0 ); + if (det < RT0 ) + { + alpha = - alpha; + beta = - beta ; + gamma = - gamma; + det = - det ; + } + + bool t1 = ( alpha < RT0 ); + bool t2 = ( beta < RT0 ); + bool t3 = ( gamma < RT0 ); + // t1 || t2 || t3 == not contained in cone + + RT lhs = alpha*v1.hw() + beta*v2.hw() + gamma*v3.hw(); + RT rhs = det * vp.hw(); + + bool t4 = ( lhs > rhs ); + // alpha + beta + gamma > 1 ? + bool t5 = ( lhs < rhs ); + // alpha + beta + gamma < 1 ? + bool t6 = ( (alpha > RT0) && (beta > RT0) && (gamma > RT0) ); + + if ( t1 || t2 || t3 || t4 ) + { + return ON_UNBOUNDED_SIDE; + } + return (t5 && t6) ? ON_BOUNDED_SIDE : ON_BOUNDARY; +} + +template < class FT, class RT > +inline +bool +TetrahedronH3::is_degenerate() const +{ return ( orientation() == DEGENERATE); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +Bbox_3 +TetrahedronH3::bbox() const +{ + return + vertex(0).bbox() + vertex(1).bbox() + vertex(2).bbox() + vertex(3).bbox(); +} + +template < class FT, class RT > +inline +TetrahedronH3 +TetrahedronH3:: +transform(const Aff_transformationH3 &t) const +{ + return TetrahedronH3(t.transform(vertex(0)), + t.transform(vertex(1)), + t.transform(vertex(2)), + t.transform(vertex(3))); +} + + +#ifndef NO_OSTREAM_INSERT_TETRAHEDRONH3 +template < class FT, class RT > +std::ostream &operator<<(std::ostream &os, const TetrahedronH3 &t) +{ + switch(os.iword(IO::mode)) + { + case IO::ASCII : + return os << t[0] << ' ' << t[1] << ' ' << t[2] << ' ' << t[3]; + case IO::BINARY : + return os << t[0] << t[1] << t[2] << t[3]; + default: + os << "TetrahedronH3(" << t[0] << ", " << t[1] << ", " << t[2] ; + os << ", " << t[3] << ")"; + return os; + } +} +#endif // NO_OSTREAM_INSERT_TETRAHEDRONH3 + +#ifndef NO_ISTREAM_EXTRACT_TETRAHEDRONH3 +template < class FT, class RT > +std::istream &operator>>(std::istream &is, TetrahedronH3 &t) +{ + PointH3 p, q, r, s; + is >> p >> q >> r >> s; + t = TetrahedronH3(p, q, r, s); + return is; +} +#endif // NO_ISTREAM_EXTRACT_TETRAHEDRONH3 + +CGAL_END_NAMESPACE + + +#endif // CGAL_TETRAHEDRONH3_H diff --git a/Packages/H3/include/CGAL/TriangleH3.h b/Packages/H3/include/CGAL/TriangleH3.h new file mode 100644 index 00000000000..43551173c53 --- /dev/null +++ b/Packages/H3/include/CGAL/TriangleH3.h @@ -0,0 +1,237 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : TriangleH3.fw +// file : TriangleH3.h +// package : H3 (2.14) +// maintainer : Stefan Schirra +// revision : 2.14 +// revision_date : 15 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_TRIANGLEH3_H +#define CGAL_TRIANGLEH3_H + +#ifndef PREDICATES_ON_POINTSH3_H +#include +#endif // PREDICATES_ON_POINTSH3_H +#ifndef CGAL_PLANEH3_H +#include +#endif // CGAL_PLANEH3_H +#ifndef CGAL_TETRAHEDRONH3_H +#include +#endif // CGAL_TETRAHEDRONH3_H + +CGAL_BEGIN_NAMESPACE + +template < class FT, class RT > +class TriangleH3 : public Handle_for< Threetuple< PointH3 > > +{ +public: + TriangleH3(); + TriangleH3(const PointH3 &p, + const PointH3 &q, + const PointH3 &r); + + bool operator==(const TriangleH3 &t) const; + bool operator!=(const TriangleH3 &t) const; + + PlaneH3 + supporting_plane() const; + + TriangleH3 + transform(const Aff_transformationH3 &t) const; + bool has_on(const PointH3 &p) const; + bool nondegenerate_has_on(const PointH3 &p) const; + bool is_degenerate() const; + + + PointH3 vertex(int i) const; + PointH3 operator[](int i) const; + + Bbox_3 bbox() const; + +}; + + + +template < class FT, class RT > +inline +TriangleH3::TriangleH3() + : Handle_for< Threetuple< PointH3 > >( Threetuple< PointH3 >()) +{} + +template < class FT, class RT > +CGAL_KERNEL_CTOR_INLINE +TriangleH3::TriangleH3(const PointH3 &p, + const PointH3 &q, + const PointH3 &r) + : Handle_for > >(Threetuple >(p,q,r)) +{} + +template < class FT, class RT > +CGAL_KERNEL_LARGE_INLINE +bool +TriangleH3::operator==(const TriangleH3 &t) const +{ + int i; + for(i = 0; (i< 3) && (vertex(0) != t.vertex(i) ); i++) {} + if (i==3) + { + return false; + } + return ( vertex(1) == t.vertex(i+1) && vertex(2) == t.vertex(i+2) ); +} + +template < class FT, class RT > +inline +bool +TriangleH3::operator!=(const TriangleH3 &t) const +{ return !(*this == t); } +template < class FT, class RT > +CGAL_KERNEL_INLINE +PointH3 +TriangleH3::vertex(int i) const +{ + switch (i) + { + case 0: return ptr->e0; + case 1: return ptr->e1; + case 2: return ptr->e2; + default: return vertex(i%3); + } + // return PointH3(); +} +template < class FT, class RT > +inline +PointH3 +TriangleH3::operator[](int i) const +{ return vertex(i); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +PlaneH3 +TriangleH3::supporting_plane() const +{ return PlaneH3(vertex(0), vertex(1), vertex(2)); } + +template < class FT, class RT > +inline +Bbox_3 +TriangleH3::bbox() const +{ return vertex(0).bbox() + vertex(1).bbox() + vertex(2).bbox(); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +TriangleH3 +TriangleH3:: +transform(const Aff_transformationH3 &t) const +{ + return TriangleH3(t.transform(vertex(0)), + t.transform(vertex(1)), + t.transform(vertex(2))); +} + + +#ifndef NO_OSTREAM_INSERT_TRIANGLEH3 +template < class FT, class RT > +std::ostream &operator<<(std::ostream &os, const TriangleH3 &t) +{ + switch(os.iword(IO::mode)) + { + case IO::ASCII : + return os << t[0] << ' ' << t[1] << ' ' << t[2]; + case IO::BINARY : + return os << t[0] << t[1] << t[2]; + default: + os << "TriangleH3(" << t[0] << ", " << t[1] << ", " << t[2] <<")"; + return os; + } +} +#endif // NO_OSTREAM_INSERT_TRIANGLEH3 + +#ifndef NO_ISTREAM_EXTRACT_TRIANGLEH3 +template < class FT, class RT > +std::istream &operator>>(std::istream &is, TriangleH3 &t) +{ + PointH3 p, q, r; + is >> p >> q >> r; + t = TriangleH3(p, q, r); + return is; +} +#endif // NO_ISTREAM_EXTRACT_TRIANGLEH3 +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +TriangleH3:: +nondegenerate_has_on(const PointH3 &p) const +{ + CGAL_kernel_precondition( !is_degenerate() ); + PlaneH3 sup_pl = supporting_plane(); + if ( !sup_pl.has_on(p) ) + { + return false; + } + TetrahedronH3 tetrapak( vertex(0), + vertex(1), + vertex(2), + vertex(0) + sup_pl.orthogonal_vector()); + return tetrapak.has_on_boundary(p); +} + +template < class FT, class RT > +CGAL_KERNEL_LARGE_INLINE +bool +TriangleH3::has_on(const PointH3 &p) const +{ + if (!is_degenerate() ) + { + return nondegenerate_has_on(p); + } + PointH3 minp( vertex(0) ); + PointH3 maxp( vertex(1) ); + if (lexicographically_xyz_smaller(vertex(1),vertex(0)) ) + { + minp = vertex(1); + maxp = vertex(0); + } + if (lexicographically_xyz_smaller(vertex(2),minp ) ) + { + minp = vertex(2); + } + if (lexicographically_xyz_smaller(maxp, vertex(2)) ) + { + maxp = vertex(2); + } + if (minp == maxp) + { + return (p == maxp); + } + SegmentH3 s(minp,maxp); + return s.has_on(p); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +TriangleH3::is_degenerate() const +{ return collinear(vertex(0),vertex(1),vertex(2)); } + +CGAL_END_NAMESPACE + + +#endif // CGAL_TRIANGLEH3_H diff --git a/Packages/H3/include/CGAL/VectorH3.h b/Packages/H3/include/CGAL/VectorH3.h new file mode 100644 index 00000000000..c6571c51b80 --- /dev/null +++ b/Packages/H3/include/CGAL/VectorH3.h @@ -0,0 +1,28 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : PointVectorDirectionH3.fw +// file : VectorH3.h +// package : H3 (2.14) +// maintainer : Stefan Schirra +// revision : 2.14 +// revision_date : 15 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + +#ifndef CGAL_PVDH3_H +#include +#endif // CGAL_PVDH3_H diff --git a/Packages/H3/include/CGAL/basic_constructionsH3.h b/Packages/H3/include/CGAL/basic_constructionsH3.h new file mode 100644 index 00000000000..e085bc93533 --- /dev/null +++ b/Packages/H3/include/CGAL/basic_constructionsH3.h @@ -0,0 +1,187 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : basic_constructionsH3.fw +// file : basic_constructionsH3.h +// package : H3 (2.14) +// maintainer : Stefan Schirra +// revision : 2.14 +// revision_date : 15 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_BASIC_CONSTRUCTIONSH3_H +#define CGAL_BASIC_CONSTRUCTIONSH3_H + +CGAL_BEGIN_NAMESPACE + +template +PointH3 +_projection(const PointH3& p, const PlaneH3& pl) +{ + if ( pl.has_on(p) ) return p; + + RT A = pl.a(); + RT B = pl.b(); + RT C = pl.c(); + RT D = pl.d(); + RT phx = p.hx(); + RT phy = p.hy(); + RT phz = p.hz(); + RT phw = p.hw(); + + RT num = A * phx + B * phy + C * phz + D * phw; + RT den = A * A + B * B + C * C; + + return PointH3( num * A - den * phx, + num * B - den * phy, + num * C - den * phz, + -den ); +} + +template +PointH3 +midpoint( const PointH3& p, + const PointH3& q ) +{ + RT phw = p.hw(); + RT qhw = q.hw(); + return PointH3( p.hx()*qhw + q.hx()*phw, + p.hy()*qhw + q.hy()*phw, + p.hz()*qhw + q.hz()*phw, + RT(2) * phw * qhw ); +} + + +template +PointH3 +gp_linear_intersection(const PlaneH3 &f, + const PlaneH3 &g, + const PlaneH3 &h) +{ + return PointH3( + det3x3_by_formula(-f.d(), f.b(), f.c(), + -g.d(), g.b(), g.c(), + -h.d(), h.b(), h.c()), + det3x3_by_formula( f.a(),-f.d(), f.c(), + g.a(),-g.d(), g.c(), + h.a(),-h.d(), h.c()), + det3x3_by_formula( f.a(), f.b(),-f.d(), + g.a(), g.b(),-g.d(), + h.a(), h.b(),-h.d()), + det3x3_by_formula( f.a(), f.b(), f.c(), + g.a(), g.b(), g.c(), + h.a(), h.b(), h.c())); +} + + +template +CGAL_KERNEL_INLINE +FT +squared_distance( PointH3 const& p, PointH3 const& q) +{ return (p-q)*(p-q); } + + +template +inline +PlaneH3 +bisector( PointH3 const& p, + PointH3 const& q) +{ return PlaneH3( midpoint(p,q), q-p); } + +template +PointH3 +circumcenter( PointH3 const& p, + PointH3 const& q, + PointH3 const& r, + PointH3 const& s) +{ + RT phw( p.hw() ); + RT qhw( q.hw() ); + RT rhw( r.hw() ); + RT shw( s.hw() ); + + RT phx( p.hx() ); + RT phy( p.hy() ); + RT phz( p.hz() ); + RT qhx( q.hx() ); + RT qhy( q.hy() ); + RT qhz( q.hz() ); + RT rhx( r.hx() ); + RT rhy( r.hy() ); + RT rhz( r.hz() ); + RT shx( s.hx() ); + RT shy( s.hy() ); + RT shz( s.hz() ); + + RT pssq( phx*phx + phy*phy + phz*phz ); + RT qssq( qhx*qhx + qhy*qhy + qhz*qhz ); + RT rssq( rhx*rhx + rhy*rhy + rhz*rhz ); + RT sssq( shx*shx + shy*shy + shz*shz ); + + phx *= phw; + phy *= phw; + phz *= phw; + phw *= phw; + qhx *= qhw; + qhy *= qhw; + qhz *= qhw; + qhw *= qhw; + rhx *= rhw; + rhy *= rhw; + rhz *= rhw; + rhw *= rhw; + shx *= shw; + shy *= shw; + shz *= shw; + shw *= shw; + + RT chx = det4x4_by_formula(phy, phz, pssq, phw, + qhy, qhz, qssq, qhw, + rhy, rhz, rssq, rhw, + shy, shz, sssq, shw ); + RT chy = det4x4_by_formula(phx, phz, pssq, phw, + qhx, qhz, qssq, qhw, + rhx, rhz, rssq, rhw, + shx, shz, sssq, shw ); + RT chz = det4x4_by_formula(phx, phy, pssq, phw, + qhx, qhy, qssq, qhw, + rhx, rhy, rssq, rhw, + shx, shy, sssq, shw ); + RT chw = det4x4_by_formula(phx, phy, phz, phw, + qhx, qhy, qhz, qhw, + rhx, rhy, rhz, rhw, + shx, shy, shz, shw ); + + return PointH3( chx, -chy, chz, RT(2)*chw); +} +template +CGAL_KERNEL_INLINE +PointH3 +circumcenter( PointH3 const& p, + PointH3 const& q, + PointH3 const& r) +{ + return gp_linear_intersection( PlaneH3(p,q,r), + bisector(p,q), + bisector(p,r)); +} + +CGAL_END_NAMESPACE + + +#endif // CGAL_BASIC_CONSTRUCTIONSH3_H diff --git a/Packages/H3/include/CGAL/distance_predicatesH3.h b/Packages/H3/include/CGAL/distance_predicatesH3.h new file mode 100644 index 00000000000..0d0470e8282 --- /dev/null +++ b/Packages/H3/include/CGAL/distance_predicatesH3.h @@ -0,0 +1,322 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : distance_predicatesH3.fw +// file : distance_predicatesH3.h +// package : H3 (2.14) +// maintainer : Stefan Schirra +// revision : 2.14 +// revision_date : 15 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_DISTANCE_PREDICATESH3_H +#define CGAL_DISTANCE_PREDICATESH3_H + +CGAL_BEGIN_NAMESPACE + +template +Comparison_result +cmp_dist_to_point(const PointH3& , + const PointH3& , + const PointH3& ); + +template +bool +has_larger_dist_to_point(const PointH3& , + const PointH3& , + const PointH3& ); + +template +bool +has_smaller_dist_to_point(const PointH3& , + const PointH3& , + const PointH3& ); + +template +Comparison_result +cmp_signed_dist_to_plane(const PlaneH3& , + const PointH3& , + const PointH3& ); + +template +bool +has_larger_signed_dist_to_plane(const PlaneH3& , + const PointH3& , + const PointH3& ); + +template +bool +has_smaller_signed_dist_to_plane(const PlaneH3&, + const PointH3& , + const PointH3& ); + +template +Comparison_result +cmp_signed_dist_to_plane(const PointH3& , + const PointH3& , + const PointH3& , + const PointH3& , + const PointH3& ); + +template +bool +has_larger_signed_dist_to_plane(const PointH3& , + const PointH3& , + const PointH3& , + const PointH3& , + const PointH3& ); + +template +bool +has_smaller_signed_dist_to_plane(const PointH3& , + const PointH3& , + const PointH3& , + const PointH3& , + const PointH3& ); + +template +CGAL_KERNEL_MEDIUM_INLINE +Comparison_result +cmp_dist_to_point(const PointH3& p, + const PointH3& q, + const PointH3& r) +{ + const RT phx = p.hx(); + const RT phy = p.hy(); + const RT phz = p.hz(); + const RT phw = p.hw(); + const RT qhx = q.hx(); + const RT qhy = q.hy(); + const RT qhz = q.hz(); + const RT qhw = q.hw(); + const RT rhx = r.hx(); + const RT rhy = r.hy(); + const RT rhz = r.hz(); + const RT rhw = r.hw(); + const RT RT0 = RT(0); + const RT RT2 = RT(2); + + RT dosd = // difference of squared distances + + rhw*rhw * ( phw * ( qhx*qhx + qhy*qhy + qhz*qhz ) + - RT2 * qhw * ( phx*qhx + phy*qhy + phz*qhz ) + ) + - qhw*qhw * ( phw * ( rhx*rhx + rhy*rhy + rhz*rhz ) + - RT2 * rhw * ( phx*rhx + phy*rhy + phz*rhz ) + ); + + if ( RT0 < dosd ) + { return LARGER; } + else + { return (dosd < RT0) ? SMALLER : EQUAL; } +} + +template < class FT, class RT> +CGAL_KERNEL_MEDIUM_INLINE +bool +has_larger_dist_to_point(const PointH3& p, + const PointH3& q, + const PointH3& r) +{ + const RT phx = p.hx(); + const RT phy = p.hy(); + const RT phz = p.hz(); + const RT phw = p.hw(); + const RT qhx = q.hx(); + const RT qhy = q.hy(); + const RT qhz = q.hz(); + const RT qhw = q.hw(); + const RT rhx = r.hx(); + const RT rhy = r.hy(); + const RT rhz = r.hz(); + const RT rhw = r.hw(); + const RT RT0 = RT(0); + const RT RT2 = RT(2); + + RT dosd = // difference of squared distances + + rhw*rhw * ( phw * ( qhx*qhx + qhy*qhy + qhz*qhz ) + - RT2 * qhw * ( phx*qhx + phy*qhy + phz*qhz ) + ) + - qhw*qhw * ( phw * ( rhx*rhx + rhy*rhy + rhz*rhz ) + - RT2 * rhw * ( phx*rhx + phy*rhy + phz*rhz ) + ); + + return ( RT0 < dosd ); +} + +template < class FT, class RT> +CGAL_KERNEL_MEDIUM_INLINE +bool +has_smaller_dist_to_point(const PointH3& p, + const PointH3& q, + const PointH3& r) +{ + const RT phx = p.hx(); + const RT phy = p.hy(); + const RT phz = p.hz(); + const RT phw = p.hw(); + const RT qhx = q.hx(); + const RT qhy = q.hy(); + const RT qhz = q.hz(); + const RT qhw = q.hw(); + const RT rhx = r.hx(); + const RT rhy = r.hy(); + const RT rhz = r.hz(); + const RT rhw = r.hw(); + const RT RT0 = RT(0); + const RT RT2 = RT(2); + + RT dosd = // difference of squared distances + + rhw*rhw * ( phw * ( qhx*qhx + qhy*qhy + qhz*qhz ) + - RT2 * qhw * ( phx*qhx + phy*qhy + phz*qhz ) + ) + - qhw*qhw * ( phw * ( rhx*rhx + rhy*rhy + rhz*rhz ) + - RT2 * rhw * ( phx*rhx + phy*rhy + phz*rhz ) + ); + + return ( dosd < RT0 ); +} + +template < class FT, class RT> +CGAL_KERNEL_INLINE +Comparison_result +cmp_signed_dist_to_plane(const PlaneH3& pl, + const PointH3& p, + const PointH3& q) +{ + const RT pla = pl.a(); + const RT plb = pl.b(); + const RT plc = pl.c(); + const RT phx = p.hx(); + const RT phy = p.hy(); + const RT phz = p.hz(); + const RT phw = p.hw(); + const RT qhx = q.hx(); + const RT qhy = q.hy(); + const RT qhz = q.hz(); + const RT qhw = q.hw(); + const RT RT0 = RT(0); + + RT scaled_dist_p_minus_scaled_dist_q = + pla*( phx*qhw - qhx*phw ) + + plb*( phy*qhw - qhy*phw ) + + plc*( phz*qhw - qhz*phw ); + + + + if ( scaled_dist_p_minus_scaled_dist_q < RT0 ) + { return SMALLER; } + else + { return (RT0 < scaled_dist_p_minus_scaled_dist_q ) ? LARGER : EQUAL;} +} + +template +bool +has_larger_signed_dist_to_plane(const PlaneH3& pl, + const PointH3& p, + const PointH3& q ) +{ + const RT pla = pl.a(); + const RT plb = pl.b(); + const RT plc = pl.c(); + const RT phx = p.hx(); + const RT phy = p.hy(); + const RT phz = p.hz(); + const RT phw = p.hw(); + const RT qhx = q.hx(); + const RT qhy = q.hy(); + const RT qhz = q.hz(); + const RT qhw = q.hw(); + const RT RT0 = RT(0); + + RT scaled_dist_p_minus_scaled_dist_q = + pla*( phx*qhw - qhx*phw ) + + plb*( phy*qhw - qhy*phw ) + + plc*( phz*qhw - qhz*phw ); + + + return ( RT0 < scaled_dist_p_minus_scaled_dist_q ); +} + +template +bool +has_smaller_signed_dist_to_plane(const PlaneH3& pl, + const PointH3& p, + const PointH3& q ) +{ + const RT pla = pl.a(); + const RT plb = pl.b(); + const RT plc = pl.c(); + const RT phx = p.hx(); + const RT phy = p.hy(); + const RT phz = p.hz(); + const RT phw = p.hw(); + const RT qhx = q.hx(); + const RT qhy = q.hy(); + const RT qhz = q.hz(); + const RT qhw = q.hw(); + const RT RT0 = RT(0); + + RT scaled_dist_p_minus_scaled_dist_q = + pla*( phx*qhw - qhx*phw ) + + plb*( phy*qhw - qhy*phw ) + + plc*( phz*qhw - qhz*phw ); + + + return ( scaled_dist_p_minus_scaled_dist_q < RT0 ); +} + +template +Comparison_result +cmp_signed_dist_to_plane(const PointH3& p, + const PointH3& q, + const PointH3& r, + const PointH3& s, + const PointH3& t) +{ + CGAL_kernel_precondition( !collinear(p,q,r) ); + PlaneH3 P(p,q,r); + return cmp_signed_dist_to_plane( P, s, t); +} + +template +bool +has_larger_signed_dist_to_plane(const PointH3& p, + const PointH3& q, + const PointH3& r, + const PointH3& s, + const PointH3& t) +{ return cmp_signed_dist_to_plane(p,q,r,s,t) == LARGER; } + + +template +bool +has_smaller_signed_dist_to_plane(const PointH3& p, + const PointH3& q, + const PointH3& r, + const PointH3& s, + const PointH3& t) +{ return cmp_signed_dist_to_plane(p,q,r,s,t) == SMALLER; } + + +CGAL_END_NAMESPACE + + +#endif //CGAL_DISTANCE_PREDICATESH3_H diff --git a/Packages/H3/include/CGAL/orientation_predicatesH3.h b/Packages/H3/include/CGAL/orientation_predicatesH3.h new file mode 100644 index 00000000000..e508ef51ccb --- /dev/null +++ b/Packages/H3/include/CGAL/orientation_predicatesH3.h @@ -0,0 +1,160 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : predicates_on_pointsH3.fw +// file : orientation_predicatesH3.h +// package : H3 (2.14) +// maintainer : Stefan Schirra +// revision : 2.14 +// revision_date : 15 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_ORIENTATION_PREDICATESH3_H +#define CGAL_ORIENTATION_PREDICATESH3_H + +#ifndef CGAL_PVDH3_H +#include +#endif // CGAL_PVDH3_H + +#include + +CGAL_BEGIN_NAMESPACE + +template < class FT, class RT> +CGAL_KERNEL_INLINE +Orientation +orientation( const PointH3& p, + const PointH3& q, + const PointH3& r, + const PointH3& s) +{ + RT det = det4x4_by_formula( + p.hx(), p.hy(), p.hz(), p.hw(), + q.hx(), q.hy(), q.hz(), q.hw(), + r.hx(), r.hy(), r.hz(), r.hw(), + s.hx(), s.hy(), s.hz(), s.hw() ); +/* + RT det= - p.hw()*( q.hx()*( r.hy()*s.hz() - r.hz()*s.hy() ) + - r.hx()*( q.hy()*s.hz() - q.hz()*s.hy() ) + + s.hx()*( q.hy()*r.hz() - q.hz()*r.hy() ) ) + + q.hw()*( p.hx()*( r.hy()*s.hz() - r.hz()*s.hy() ) + - r.hx()*( p.hy()*s.hz() - p.hz()*s.hy() ) + + s.hx()*( p.hy()*r.hz() - p.hz()*r.hy() ) ) + - r.hw()*( p.hx()*( q.hy()*s.hz() - q.hz()*s.hy() ) + - q.hx()*( p.hy()*s.hz() - p.hz()*s.hy() ) + + s.hx()*( p.hy()*q.hz() - p.hz()*q.hy() ) ) + + s.hw()*( p.hx()*( q.hy()*r.hz() - q.hz()*r.hy() ) + - q.hx()*( p.hy()*r.hz() - p.hz()*r.hy() ) + + r.hx()*( p.hy()*q.hz() - p.hz()*q.hy() ) ) ; +*/ + if (det == RT(0)) + { + return COPLANAR; + } + else + { + return det < RT(0) ? POSITIVE : NEGATIVE; + // switched, because the determinant above has the 1-row at the end + } +} + +template < class FT, class RT> +inline +bool +are_positive_oriented( const PointH3& p, + const PointH3& q, + const PointH3& r, + const PointH3& s) +{ return (orientation(p,q,r,s) == POSITIVE); } + +template < class FT, class RT> +inline +bool +are_negative_oriented( const PointH3& p, + const PointH3& q, + const PointH3& r, + const PointH3& s) +{ return (orientation(p,q,r,s) == NEGATIVE); } + +template < class FT, class RT> +inline +bool +coplanar( const PointH3& p, + const PointH3& q, + const PointH3& r, + const PointH3& s) +{ return (orientation(p,q,r,s) == COPLANAR); } + + +template +Orientation +coplanar_orientation(const PointH3& p, + const PointH3& q, + const PointH3& r, + const PointH3& s) +// p,q,r,s supposed to be coplanar +// p, q, r supposed to be non collinear +// tests whether s is on the same side of p,q as r +// returns : +// COLLINEAR if pqs collinear +// POSITIVE if pqr and pqs have the same orientation +// NEGATIVE if pqr and pqs have opposite orientations +{ + CGAL_kernel_precondition( coplanar( p, q, r, s)); + // p, q, r define a plane P: + CGAL_kernel_precondition( !collinear( p, q, r)); + // compute orientation of p,q,s in this plane P: + Orientation save; + if ( (save = orientationH2( p.hy(), p.hz(), p.hw(), + q.hy(), q.hz(), q.hw(), + r.hy(), r.hz(), r.hw())) != COLLINEAR) + { return + static_cast( + static_cast( save) + * static_cast( orientationH2( p.hy(), p.hz(), p.hw(), + q.hy(), q.hz(), q.hw(), + s.hy(), s.hz(), s.hw())) ); + } + if ( (save = orientationH2( p.hx(), p.hz(), p.hw(), + q.hx(), q.hz(), q.hw(), + r.hx(), r.hz(), r.hw())) != COLLINEAR) + { return + static_cast( + static_cast( save) + * static_cast( orientationH2( p.hx(), p.hz(), p.hw(), + q.hx(), q.hz(), q.hw(), + s.hx(), s.hz(), s.hw())) ); + } + if ( (save = orientationH2( p.hx(), p.hy(), p.hw(), + q.hx(), q.hy(), q.hw(), + r.hx(), r.hy(), r.hw())) != COLLINEAR) + { return + static_cast( + static_cast( save) + * static_cast( orientationH2( p.hx(), p.hy(), p.hw(), + q.hx(), q.hy(), q.hw(), + s.hx(), s.hy(), s.hw())) ); + } + CGAL_kernel_assertion( false); + return COLLINEAR; +} + +CGAL_END_NAMESPACE + + +#endif // ORIENTATION_PREDICATESH3_H diff --git a/Packages/H3/include/CGAL/predicates_on_pointsH3.h b/Packages/H3/include/CGAL/predicates_on_pointsH3.h new file mode 100644 index 00000000000..0cb64117631 --- /dev/null +++ b/Packages/H3/include/CGAL/predicates_on_pointsH3.h @@ -0,0 +1,503 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : predicates_on_pointsH3.fw +// file : predicates_on_pointsH3.h +// package : H3 (2.14) +// maintainer : Stefan Schirra +// revision : 2.14 +// revision_date : 15 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_PREDICATES_ON_POINTSH3_H +#define CGAL_PREDICATES_ON_POINTSH3_H + +#ifndef CGAL_PVDH3_H +#include +#endif // CGAL_PVDH3_H + +CGAL_BEGIN_NAMESPACE + +template < class FT, class RT > +inline +bool +x_equal(const PointH3 &p, + const PointH3 &q) +{ return p.x()*q.hw() == q.x()*p.hw(); } + +template < class FT, class RT > +inline +bool +y_equal(const PointH3 &p, + const PointH3 &q) +{ return p.y()*q.hw() == q.y()*p.hw(); } + +template < class FT, class RT > +inline +bool +z_equal(const PointH3 &p, + const PointH3 &q) +{ return p.z()*q.hw() == q.z()*p.hw(); } + +template < class FT, class RT> +CGAL_KERNEL_MEDIUM_INLINE +Comparison_result +compare_lexicographically_xyz(const PointH3& p, + const PointH3& q) +{ + RT pV = p.hx()*q.hw(); + RT qV = q.hx()*p.hw(); + if ( pV < qV ) + { + return SMALLER; + } + if ( qV < pV ) // ( pV > qV ) + { + return LARGER; + } + // same x + pV = p.hy()*q.hw(); + qV = q.hy()*p.hw(); + if ( pV < qV ) + { + return SMALLER; + } + if ( qV < pV ) // ( pV > qV ) + { + return LARGER; + } + // same x and y + pV = p.hz()*q.hw(); + qV = q.hz()*p.hw(); + if ( pV < qV ) + { + return SMALLER; + } + else + { + return (qV < pV) ? LARGER : EQUAL; + } +} + +template < class FT, class RT > +CGAL_KERNEL_MEDIUM_INLINE +bool +lexicographically_xyz_smaller_or_equal(const PointH3 &p, + const PointH3 &q) +{ + RT pV = p.hx()*q.hw(); + RT qV = q.hx()*p.hw(); + if ( qV < pV ) // ( pV > qV ) + { + return false; + } + if ( !(pV == qV) ) + { + return true; + } + // same x + pV = p.hy()*q.hw(); + qV = q.hy()*p.hw(); + if ( qV < pV ) // ( pV > qV ) + { + return false; + } + if ( !(pV == qV) ) + { + return true; + } + // same x and y + pV = p.hz()*q.hw(); + qV = q.hz()*p.hw(); + if ( qV < pV ) // ( pV > qV ) + { + return false; + } + return true; +} + +template < class FT, class RT > +CGAL_KERNEL_MEDIUM_INLINE +bool lexicographically_xyz_smaller(const PointH3 &p, + const PointH3 &q) +{ + RT pV = p.hx()*q.hw(); + RT qV = q.hx()*p.hw(); + if ( pV < qV ) + { + return true; + } + if ( qV < pV ) + { + return false; + } + // same x + pV = p.hy()*q.hw(); + qV = q.hy()*p.hw(); + if ( pV < qV ) + { + return true; + } + if ( qV < pV ) + { + return false; + } + // same x and y + pV = p.hz()*q.hw(); + qV = q.hz()*p.hw(); + if ( pV < qV ) + { + return true; + } + return false; +} + +template < class FT, class RT > +CGAL_KERNEL_MEDIUM_INLINE +bool lexicographically_xy_smaller(const PointH3 &p, + const PointH3 &q) +{ + RT pV = p.hx()*q.hw(); + RT qV = q.hx()*p.hw(); + if ( pV < qV ) + { + return true; + } + if ( qV < pV ) + { + return false; + } + // same x + pV = p.hy()*q.hw(); + qV = q.hy()*p.hw(); + if ( pV < qV ) + { + return true; + } + return false; +} + +template < class FT, class RT> +CGAL_KERNEL_MEDIUM_INLINE +Comparison_result +compare_lexicographically_xy(const PointH3& p, + const PointH3& q) +{ + RT pV = p.hx()*q.hw(); + RT qV = q.hx()*p.hw(); + if ( pV < qV ) + { + return SMALLER; + } + if ( qV < pV ) // ( pV > qV ) + { + return LARGER; + } + // same x + pV = p.hy()*q.hw(); + qV = q.hy()*p.hw(); + if ( pV < qV ) + { + return SMALLER; + } + if ( qV < pV ) // ( pV > qV ) + { + return LARGER; + } + // same x and y + return EQUAL; +} + +template < class FT, class RT > +inline +Comparison_result +compare_x(const PointH3 &p, const PointH3 &q) +{ return CGAL_NTS compare(p.hx() * q.hw(), q.hx() * p.hw() ); } + +template < class FT, class RT > +inline +Comparison_result +compare_y(const PointH3 &p, const PointH3 &q) +{ return CGAL_NTS compare(p.hy() * q.hw(), q.hy() * p.hw() ); } + +template < class FT, class RT > +inline +Comparison_result +compare_z(const PointH3 &p, const PointH3 &q) +{ return CGAL_NTS compare(p.hz() * q.hw(), q.hz() * p.hw() ); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +equal_xy(const PointH3 &p, const PointH3 &q) +{ + return (p.hx_ref() * q.hw_ref() == q.hx_ref() * p.hw_ref() ) + && (p.hy_ref() * q.hw_ref() == q.hy_ref() * p.hw_ref() ); +} + +template < class FT, class RT > // ??? -> == +CGAL_KERNEL_INLINE +bool +equal_xyz(const PointH3 &p, const PointH3 &q) +{ + return (p.hx_ref() * q.hw_ref() == q.hx_ref() * p.hw_ref() ) + && (p.hy_ref() * q.hw_ref() == q.hy_ref() * p.hw_ref() ) + && (p.hz_ref() * q.hw_ref() == q.hz_ref() * p.hw_ref() ); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +less_x(const PointH3 &p, const PointH3 &q) +{ return (p.hx_ref() * q.hw_ref() < q.hx_ref() * p.hw_ref() ); } + + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +less_y(const PointH3 &p, const PointH3 &q) +{ return (p.hy_ref() * q.hw_ref() < q.hy_ref() * p.hw_ref() ); } + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +less_z(const PointH3 &p, const PointH3 &q) +{ return (p.hz_ref() * q.hw_ref() < q.hz_ref() * p.hw_ref() ); } + + +CGAL_END_NAMESPACE + +#ifndef ORIENTATION_PREDICATESH3_H +#include +#endif // ORIENTATION_PREDICATESH3_H +CGAL_BEGIN_NAMESPACE + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +collinear(const PointH3 &p, + const PointH3 &q, + const PointH3 &r) +{ + DirectionH3 dir_pq = (p - q).direction(); + DirectionH3 dir_rq = (r - q).direction(); + + return ( dir_pq == dir_rq ) || (dir_pq == -dir_rq) + || ( p == q ) || ( p == r ) || ( q == r ) ; +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +are_ordered_along_line(const PointH3 &p, + const PointH3 &q, + const PointH3 &r) +{ + if (!collinear(p, q, r)) + { + return false; + } + return collinear_are_ordered_along_line(p, q, r); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +collinear_are_ordered_along_line(const PointH3 &p, + const PointH3 &q, + const PointH3 &r) +{ + CGAL_kernel_exactness_precondition( collinear(p, q, r) ); + const RT phx = p.hx(); + const RT phw = p.hw(); + const RT qhx = q.hx(); + const RT qhw = q.hw(); + const RT rhx = r.hx(); + const RT rhw = r.hw(); + + const RT pqx = phx*qhw; + const RT qpx = qhx*phw; + const RT prx = phx*rhw; + const RT qrx = qhx*rhw; + const RT rqx = rhx*qhw; + const RT rpx = rhx*phw; + + if ( prx != rpx ) // px != rx + { + // (px <= qx)&&(qx <= rx) || (px >= qx)&&(qx >= rx) + // !(((qx < px)||(rx < qx))&&((px < qx)||(qx < rx))) + return ! ( ((qpx < pqx) || (rqx < qrx)) + && ((pqx < qpx) || (qrx < rqx)) ); + } + + const RT phy = p.hy(); + const RT qhy = q.hy(); + const RT rhy = r.hy(); + + const RT pqy = phy*qhw; + const RT qpy = qhy*phw; + const RT pry = phy*rhw; + const RT qry = qhy*rhw; + const RT rqy = rhy*qhw; + const RT rpy = rhy*phw; + + if ( pry != rpy ) + { + return ! ( ((qpy < pqy) || (rqy < qry)) + && ((pqy < qpy) || (qry < rqy)) ); + } + + const RT phz = p.hz(); + const RT qhz = q.hz(); + const RT rhz = r.hz(); + + const RT pqz = phz*qhw; + const RT qpz = qhz*phw; + const RT prz = phz*rhw; + const RT qrz = qhz*rhw; + const RT rqz = rhz*qhw; + const RT rpz = rhz*phw; + + if ( prz != rpz ) + { + return ! ( ((qpz < pqz) || (rqz < qrz)) + && ((pqz < qpz) || (qrz < rqz)) ); + } + // p == r + return ((rqx == qrx) && (rqy == qry) && (rqz == qrz)); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +are_strictly_ordered_along_line(const PointH3 &p, + const PointH3 &q, + const PointH3 &r) +{ + if ( ! collinear(p, q, r) ) return false; + return collinear_are_strictly_ordered_along_line( p, q, r); +} + +template < class FT, class RT > +CGAL_KERNEL_INLINE +bool +collinear_are_strictly_ordered_along_line(const PointH3 &p, + const PointH3 &q, + const PointH3 &r) +{ + CGAL_kernel_exactness_precondition( collinear(p, q, r) ); + if ( p == r) return false; + DirectionH3 dir_pq = (p - q).direction(); + DirectionH3 dir_rq = (r - q).direction(); + return (dir_pq == -dir_rq); +} + + + +template < class FT, class RT > +CGAL_KERNEL_LARGE_INLINE +Oriented_side +side_of_oriented_sphere(const PointH3 &p, + const PointH3 &q, + const PointH3 &r, + const PointH3 &s, + const PointH3 &t) +{ + CGAL_kernel_precondition( !coplanar(p,q,r,s) ); + const RT phx = p.hx(); + const RT phy = p.hy(); + const RT phz = p.hz(); + const RT phw = p.hw(); + const RT phw2 = phw*phw; + + const RT qhx = q.hx(); + const RT qhy = q.hy(); + const RT qhz = q.hz(); + const RT qhw = q.hw(); + const RT qhw2 = qhw*qhw; + + const RT rhx = r.hx(); + const RT rhy = r.hy(); + const RT rhz = r.hz(); + const RT rhw = r.hw(); + const RT rhw2 = rhw*rhw; + + const RT shx = s.hx(); + const RT shy = s.hy(); + const RT shz = s.hz(); + const RT shw = s.hw(); + const RT shw2 = shw*shw; + + const RT thx = t.hx(); + const RT thy = t.hy(); + const RT thz = t.hz(); + const RT thw = t.hw(); + const RT thw2 = thw*thw; + + const RT det = det5x5_by_formula( + phx*phw, phy*phw, phz*phw, phx*phx + phy*phy + phz*phz, phw2, + qhx*qhw, qhy*qhw, qhz*qhw, qhx*qhx + qhy*qhy + qhz*qhz, qhw2, + rhx*rhw, rhy*rhw, rhz*rhw, rhx*rhx + rhy*rhy + rhz*rhz, rhw2, + shx*shw, shy*shw, shz*shw, shx*shx + shy*shy + shz*shz, shw2, + thx*thw, thy*thw, thz*thw, thx*thx + thy*thy + thz*thz, thw2); + if (det < RT(0)) + { + return ON_POSITIVE_SIDE; + } + else + { + return (RT(0) < det) ? ON_NEGATIVE_SIDE : ON_ORIENTED_BOUNDARY; + } +} + +template < class FT, class RT > +CGAL_KERNEL_MEDIUM_INLINE +Bounded_side +side_of_bounded_sphere(const PointH3 &p, + const PointH3 &q, + const PointH3 &r, + const PointH3 &s, + const PointH3 &test) +{ + Oriented_side oside = side_of_oriented_sphere(p,q,r,s,test); + if ( are_positive_oriented( p,q,r,s) ) + { + switch (oside) + { + case ON_POSITIVE_SIDE : return ON_BOUNDED_SIDE; + case ON_ORIENTED_BOUNDARY: return ON_BOUNDARY; + case ON_NEGATIVE_SIDE : return ON_UNBOUNDED_SIDE; + } + } + else + { + switch (oside) + { + case ON_POSITIVE_SIDE : return ON_UNBOUNDED_SIDE; + case ON_ORIENTED_BOUNDARY: return ON_BOUNDARY; + case ON_NEGATIVE_SIDE : return ON_BOUNDED_SIDE; + } + } + return ON_BOUNDARY; // Pls, no warnings anylonger +} + + +CGAL_END_NAMESPACE + + +#endif // PREDICATES_ON_POINTSH3_H diff --git a/Packages/H3/version b/Packages/H3/version new file mode 100644 index 00000000000..0394dd064b0 --- /dev/null +++ b/Packages/H3/version @@ -0,0 +1,2 @@ +2.14 (15 Oct 2000) +maintainer: Stefan Schirra diff --git a/Packages/Kernel_23/doc_tex/kernel/IsoCuboid.eps b/Packages/Kernel_23/doc_tex/kernel/IsoCuboid.eps new file mode 100644 index 00000000000..71feddd0e78 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/IsoCuboid.eps @@ -0,0 +1,185 @@ +%!PS-Adobe-2.0 EPSF-2.0 +%%Title: IsoCuboid.eps +%%Creator: fig2dev Version 3.2.3 Patchlevel +%%CreationDate: Tue Aug 8 14:12:52 2000 +%%For: stschirr@mpii01807 (Stefan Schirra) +%%BoundingBox: 0 0 258 136 +%%Magnification: 0.5000 +%%EndComments +/$F2psDict 200 dict def +$F2psDict begin +$F2psDict /mtrx matrix put +/col-1 {0 setgray} bind def +/col0 {0.000 0.000 0.000 srgb} bind def +/col1 {0.000 0.000 1.000 srgb} bind def +/col2 {0.000 1.000 0.000 srgb} bind def +/col3 {0.000 1.000 1.000 srgb} bind def +/col4 {1.000 0.000 0.000 srgb} bind def +/col5 {1.000 0.000 1.000 srgb} bind def +/col6 {1.000 1.000 0.000 srgb} bind def +/col7 {1.000 1.000 1.000 srgb} bind def +/col8 {0.000 0.000 0.560 srgb} bind def +/col9 {0.000 0.000 0.690 srgb} bind def +/col10 {0.000 0.000 0.820 srgb} bind def +/col11 {0.530 0.810 1.000 srgb} bind def +/col12 {0.000 0.560 0.000 srgb} bind def +/col13 {0.000 0.690 0.000 srgb} bind def +/col14 {0.000 0.820 0.000 srgb} bind def +/col15 {0.000 0.560 0.560 srgb} bind def +/col16 {0.000 0.690 0.690 srgb} bind def +/col17 {0.000 0.820 0.820 srgb} bind def +/col18 {0.560 0.000 0.000 srgb} bind def +/col19 {0.690 0.000 0.000 srgb} bind def +/col20 {0.820 0.000 0.000 srgb} bind def +/col21 {0.560 0.000 0.560 srgb} bind def +/col22 {0.690 0.000 0.690 srgb} bind def +/col23 {0.820 0.000 0.820 srgb} bind def +/col24 {0.500 0.190 0.000 srgb} bind def +/col25 {0.630 0.250 0.000 srgb} bind def +/col26 {0.750 0.380 0.000 srgb} bind def +/col27 {1.000 0.500 0.500 srgb} bind def +/col28 {1.000 0.630 0.630 srgb} bind def +/col29 {1.000 0.750 0.750 srgb} bind def +/col30 {1.000 0.880 0.880 srgb} bind def +/col31 {1.000 0.840 0.000 srgb} bind def + +end +save +newpath 0 136 moveto 0 0 lineto 258 0 lineto 258 136 lineto closepath clip newpath +-6.0 217.0 translate +1 -1 scale + +/cp {closepath} bind def +/ef {eofill} bind def +/gr {grestore} bind def +/gs {gsave} bind def +/sa {save} bind def +/rs {restore} bind def +/l {lineto} bind def +/m {moveto} bind def +/rm {rmoveto} bind def +/n {newpath} bind def +/s {stroke} bind def +/sh {show} bind def +/slc {setlinecap} bind def +/slj {setlinejoin} bind def +/slw {setlinewidth} bind def +/srgb {setrgbcolor} bind def +/rot {rotate} bind def +/sc {scale} bind def +/sd {setdash} bind def +/ff {findfont} bind def +/sf {setfont} bind def +/scf {scalefont} bind def +/sw {stringwidth} bind def +/tr {translate} bind def +/tnt {dup dup currentrgbcolor + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add + 4 -2 roll dup 1 exch sub 3 -1 roll mul add srgb} + bind def +/shd {dup dup currentrgbcolor 4 -2 roll mul 4 -2 roll mul + 4 -2 roll mul srgb} bind def +/$F2psBegin {$F2psDict begin /$F2psEnteredState save def} def +/$F2psEnd {$F2psEnteredState restore end} def + +$F2psBegin +%%Page: 1 1 +10 setmiterlimit + 0.03000 0.03000 sc +% Polyline +7.500 slw +n 3000 4200 m 6600 4200 l 6600 6600 l 3000 6600 l + cp gs col0 s gr +% Polyline +n 3000 4200 m + 4800 3000 l gs col0 s gr +% Polyline +n 6600 4200 m + 8400 3000 l gs col0 s gr +% Polyline +n 6600 6600 m + 8400 5400 l gs col0 s gr +% Polyline +n 4800 3000 m + 8400 3000 l gs col0 s gr +% Polyline +n 8400 3000 m + 8400 5400 l gs col0 s gr +% Polyline +15.000 slw + [15 68] 68 sd +n 4800 3000 m + 4800 5400 l gs col0 s gr [] 0 sd +% Polyline + [15 68] 68 sd +n 4800 5400 m + 8400 5400 l gs col0 s gr [] 0 sd +% Polyline +7.500 slw +gs clippath +2129 5716 m 2095 5666 l 1969 5750 l 2086 5709 l 2002 5800 l cp +eoclip +n 300 6900 m + 2100 5700 l gs col0 s gr gr + +% arrowhead +n 2002 5800 m 2086 5709 l 1969 5750 l col0 s +% Polyline +gs clippath +1230 5010 m 1170 5010 l 1170 5162 l 1200 5042 l 1230 5162 l cp +eoclip +n 1200 7200 m + 1200 5025 l gs col0 s gr gr + +% arrowhead +n 1230 5162 m 1200 5042 l 1170 5162 l col0 s +% Polyline +gs clippath +2415 6330 m 2415 6270 l 2263 6270 l 2383 6300 l 2263 6330 l cp +eoclip +n 225 6300 m + 2400 6300 l gs col0 s gr gr + +% arrowhead +n 2263 6330 m 2383 6300 l 2263 6270 l col0 s +/Times-Roman ff 450.00 scf sf +6900 4350 m +gs 1 -1 sc (6) col0 sh gr +/Times-Roman ff 450.00 scf sf +2700 6900 m +gs 1 -1 sc (0) col0 sh gr +/Times-Roman ff 450.00 scf sf +6900 6900 m +gs 1 -1 sc (1) col0 sh gr +/Times-Roman ff 450.00 scf sf +4950 5250 m +gs 1 -1 sc (3) col0 sh gr +/Times-Roman ff 450.00 scf sf +2700 4350 m +gs 1 -1 sc (4) col0 sh gr +/Times-Roman ff 450.00 scf sf +4500 3000 m +gs 1 -1 sc (5) col0 sh gr +/Times-Roman ff 450.00 scf sf +8550 3000 m +gs 1 -1 sc (7) col0 sh gr +/Times-Roman ff 450.00 scf sf +8550 5250 m +gs 1 -1 sc (2) col0 sh gr +/Times-Italic ff 360.00 scf sf +1800 5700 m +gs 1 -1 sc (y) col0 sh gr +/Times-Italic ff 360.00 scf sf +2175 6600 m +gs 1 -1 sc (x) col0 sh gr +/Times-Italic ff 360.00 scf sf +900 5175 m +gs 1 -1 sc (z) col0 sh gr +% Polyline +15.000 slw + [15 68] 68 sd +n 3000 6600 m + 4800 5400 l gs col0 s gr [] 0 sd +$F2psEnd +rs diff --git a/Packages/Kernel_23/doc_tex/kernel/IsoCuboid.gif b/Packages/Kernel_23/doc_tex/kernel/IsoCuboid.gif new file mode 100644 index 00000000000..812584163d3 Binary files /dev/null and b/Packages/Kernel_23/doc_tex/kernel/IsoCuboid.gif differ diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Aff_transformation_2.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Aff_transformation_2.tex new file mode 100644 index 00000000000..ffe32a08094 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Aff_transformation_2.tex @@ -0,0 +1,257 @@ +\begin{ccRefClass}{Aff_transformation_2} + +\ccInclude{CGAL/Aff_transformation_2.h} + +\ccDefinition +The class \ccRefName\ represents two-dimensioanl affine transformations. +The general form of an affine transformation is based on homogeneous +representation of points. Thereby all transformations can be realized by +matrix multiplication. + +Since the general form is based on the homogeneous representation, a +transformation matrix multiplication by a scalar does not change +the represented transformation. Therefore, any transformation represented +by a matrix with rational entries can be represented by a +transformation matrix with integer entries as well by multiplying +the matrix with the common denominator of the rational entries. +Hence it is sufficient to have number type \ccStyle{R::RT} for the entries +of an affine transformation. + +{\cgal} offers several specialized affine transformations. +Different constructors are provided to create them. +They are parameterized with a symbolic name to +denote the transformation type, followed by additional parameters. +The symbolic name tags solve ambiguities in the function +overloading and they make the code more readable, i.e.\ what type +of transformation is created. + +Since two-dimensional points have three +homogeneous coordinates we have a $3\times 3$ matrix ($m_{ij}$). +Following C-style, the indices start at zero. + +If the homogeneous representations are normalized such that the +homogenizing coordinate is 1, then the upper left $2\times 2$ matrix realizes +linear transformations and in the matrix form of a translation, the +translation vector $(v_0,$ $v_1,$ $1)$ appears in the last column of the +matrix. In the normalized case, entry $hw$ is always 1. +Entries $m_{20}$ and $m_{21}$ are always zero and therefore do not appear in +the constructors. + + +\ccCreation +\ccCreationVariable{t} + +\ccConstructor{Aff_transformation_2(const Identity_transformation& );} + {introduces an identity transformation.} + +\ccConstructor{Aff_transformation_2(const Translation, + const Vector_2 &v);} + {introduces a translation by a vector $v$.} + +\ccConstructor{Aff_transformation_2(const Rotation, + const Direction_2 &d, + const R::RT &num, + const R::RT &den = RT(1));} + {approximates the rotation over the angle indicated by direction + $d$, such that the differences between the sines and cosines + of the rotation given by d and the approximating rotation + are at most $num/den$ each. + \ccPrecond $num/den>0$. } + +\ccConstructor{Aff_transformation_2(const Rotation, + const R::RT &sine_rho, + const R::RT &cosine_rho, + const R::RT &hw = RT(1));} + {introduces a rotation by the angle \ccStyle{rho}. + \ccPrecond + \ccTexHtml{$\mbox{\it sine\_rho}^2 + \mbox{\it cosine\_rho}^2 == hw^2$}{sine_rho2 + cosine_rho2 == +hw2}.} + +\ccConstructor{Aff_transformation_2(const Scaling, + const R::RT &s, + const R::RT &hw = RT(1));} + {introduces a scaling by a scale factor $s/hw$.} + +\newsavebox{\arrtwo} +\newsavebox{\arrlintwo} +\newsavebox{\transvectwo} + +\savebox{\arrtwo}{\small $\left(\begin{array}{ccc} + m_{00} & m_{01} & m_{02}\\ + m_{10} & m_{11} & m_{12}\\ + 0 & 0 & hw + \end{array}\right)$} + +\savebox{\arrlintwo}{\small $\left(\begin{array}{cc} + m_{00} & m_{01}\\ + m_{10} & m_{11} + \end{array}\right)$} + +\savebox{\transvectwo}{\small $\left(\begin{array}{c} + m_{02}\\ + m_{12} + \end{array}\right)$} + +\ccConstructor{Aff_transformation_2( + const R::RT &m00, const R::RT &m01, const R::RT &m02, + const R::RT &m10, const R::RT &m11, const R::RT &m12, + const R::RT &hw = RT(1));} + {introduces a general affine transformation in the + \ccTexHtml{$3 \times 3$ matrix form \usebox{\arrtwo}.}% + {3x3 matrix .} + The sub-matrix \ccTexHtml{$1\over hw$\usebox{\arrlintwo}}% + {hw-1 } contains the scaling and rotation + information, the vector \ccTexHtml{$1\over hw$ + \usebox{\transvectwo}}{hw-1 + } + contains the translational part of the transformation.} + +\savebox{\arrtwo}{\small $\left(\begin{array}{ccc} + m_{00} & m_{01} & 0\\ + m_{10} & m_{11} & 0\\ + 0 & 0 & hw + \end{array}\right)$} + +\ccConstructor{Aff_transformation_2( + const R::RT &m00, const R::RT &m01, + const R::RT &m10, const R::RT &m11, + const R::RT &hw = RT(1));} + {introduces a general linear transformation + \ccTexHtml{\usebox{\arrtwo},}{ ,} + i.e.\ there is no translational part.} + + +\ccOperations + +The main thing to do with transformations is to apply them on +geometric objects. Each class \ccStyle{Class_2} representing +a geometric object has a member function: + +\ccStyle{Class_2 transform(Aff_transformation_2 t)}. + + +The transformation classes provide a member function \ccStyle{transform()} +for points, vectors, directions, and lines: + +\ccMethod{Point_2 transform(const Point_2 &p) const;} + {} +\ccGlue +\ccMethod{Vector_2 transform(const Vector_2 &p) const;} + {} +\ccGlue +\ccMethod{Direction_2 transform(const Direction_2 &p) const;} + {} +\ccGlue +\ccMethod{Line_2 transform(const Line_2 &p) const;} + {} + +\cgal\ provides function operators for these member functions: + +\ccMethod{Point_2 operator()(const Point_2 &p) const;} + {} +\ccGlue +\ccMethod{Vector_2 operator()(const Vector_2 &p) const;} + {} +\ccGlue +\ccMethod{Direction_2 operator()(const Direction_2 &p) const;} + {} +\ccGlue +\ccMethod{Line_2 operator()(const Line_2 &p) const;} + {} + +\ccHeading{Miscellaneous} + +\ccMethod{Aff_transformation_2 operator*(const Aff_transformation_2 &s) const;}{composes two affine transformations.} + +\ccMethod{Aff_transformation_2 inverse() const;} + {gives the inverse transformation.} + +%\ccMethod{Aff_transformation_2 transpose() const;} +% {returns the affine transformation defined by transposing +% the linear transformation in \ccVar\ and setting the +% translational part to zero.} + +\ccMethod{bool is_even() const;} + {returns \ccStyle{true}, if the transformation is not reflecting, + i.e.\ the determinant of the involved linear transformation is + non-negative.} + +\ccMethod{bool is_odd() const;} + {returns \ccStyle{true}, if the transformation is reflecting.} + + +%\ccMethod{Aff_transformation_2 general_form() const;} +% {returns the affine transformation in matrix form.} + +The matrix entries of a matrix representation of a +\ccStyle{Aff_transformation_2} +can be accessed trough the following member functions: + +\ccMethod{FT cartesian(int i, int j) const;} + {} +\ccGlue +\ccMethod{FT m(int i, int j) const;} + {returns entry $m_{ij}$ in a matrix representation in which $m_{22}$ is 1.} + +\ccMethod{RT homogeneous(int i, int j) const;} + {} +\ccGlue +\ccMethod{RT hm(int i, int j) const;} + {returns entry $m_{ij}$ in some fixed matrix representation.} + + +For affine transformations no I/O operators are defined. + +%\ccImplementation +%Depending on the constructor we have different internal representations. +%This approach uses less memory and the transformation can be applied +%faster. +% +%Affine transformations offer no \ccStyle{transform()} member function +%for complex objects because they are defined in terms of points vectors and +%directions. As the internal representation of a complex object +%is private the transformation code should go there. + +\ccSeeAlso +\ccc{Identity_transformation}, +\ccc{Rotation}, +\ccc{Scaling}, +\ccc{Translation} \\ +\ccc{rational_rotation_approximation} + +\ccExample + +\begin{cprog} + typedef Cartesian RepClass; + typedef Aff_transformation_2 Transformation; + typedef Point_2 Point; + typedef Vector_2 Vector; + typedef Direction_2 Direction; + + Transformation rotate(ROTATION, sin(pi), cos(pi)); + Transformation rational_rotate(ROTATION,Direction(1,1), 1, 100); + Transformation translate(TRANSLATION, Vector(-2, 0)); + Transformation scale(SCALING, 3); + + Point q(0, 1); + q = rational_rotate(q); + + Point p(1, 1); + + p = rotate(p); + + p = translate(p); + + p = scale(p); +\end{cprog} + +The same would have been achieved with + +\begin{cprog} + + Transformation transform = scale * (translate * rotate); + p = transform(Point(1.0, 1.0)); +\end{cprog} +\end{ccRefClass} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Aff_transformation_3.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Aff_transformation_3.tex new file mode 100644 index 00000000000..9e00f5dd9b7 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Aff_transformation_3.tex @@ -0,0 +1,188 @@ +\begin{ccRefClass}{Aff_transformation_3} +\ccInclude{CGAL/Aff_transformation_3.h} + +\ccDefinition +The class \ccRefName\ represents three-dimensioanl affine transformations. +The general form of an affine transformation is based on homogeneous +representation of points. Thereby all transformations can be realized by +matrix multiplication. + +Since the general form is based on the homogeneous representation, a +transformation matrix multiplication by a scalar does not change +the represented transformation. Therefore, any transformation represented +by a matrix with rational entries can be represented by a +transformation matrix with integer entries as well by multiplying +the matrix with the common denominator of the rational entries. +Hence it is sufficient to have number type \ccStyle{R::RT} for the entries +of an affine transformation. + +{\cgal} offers several specialized affine transformations. +Different constructors are provided to create them. +They are parameterized with a symbolic name to +denote the transformation type, followed by additional parameters. +The symbolic name tags solve ambiguities in the function +overloading and they make the code more readable, i.e.\ what type +of transformation is created. + +In three-dimensional space we have a $4\times 4$ matrix ($m_{ij}$). +Entries $m_{30}$, $m_{31}$, and $m_{32}$ are always zero and +therefore do not appear in the constructors. + +\ccCreation +\ccCreationVariable{t} + +\ccConstructor{Aff_transformation_3(const Identity_transformation& );} + {introduces an identity transformation.} + + +\ccConstructor{Aff_transformation_3(const Translation, + const Vector_3 &v);} + {introduces a translation by a vector $v$.} + +\ccConstructor{Aff_transformation_3(const Scaling, + const R::RT &s, + const R::RT &hw = RT(1));} + {introduces a scaling by a scale factor $s/hw$.} + +\newsavebox{\arrthree} +\newsavebox{\arrlinthree} +\newsavebox{\transvecthree} + +\savebox{\arrthree}{\small $\left(\begin{array}{cccc} + m_{00} & m_{01} & m_{02} & m_{03}\\ + m_{10} & m_{11} & m_{12} & m_{13}\\ + m_{20} & m_{21} & m_{22} & m_{23}\\ + 0 & 0 & 0 & hw + \end{array}\right)$} + +\savebox{\arrlinthree}{\small $\left(\begin{array}{ccc} + m_{00} & m_{01} & m_{02}\\ + m_{10} & m_{11} & m_{12}\\ + m_{20} & m_{21} & m_{22}\\ + \end{array}\right)$} + +\savebox{\transvecthree}{\small $\left(\begin{array}{c} + m_{03}\\ + m_{13}\\ + m_{23} + \end{array}\right)$} + +\ccConstructor{Aff_transformation_3( + const R::RT &m00, const R::RT &m01, const R::RT &m02, const R::RT &m03, + const R::RT &m10, const R::RT &m11, const R::RT &m12, const R::RT &m13, + const R::RT &m20, const R::RT &m21, const R::RT &m22, const R::RT &m23, + const R::RT &hw = RT(1));} + {introduces a general affine transformation of the matrix + form \ccTexHtml{\usebox{\arrthree}.}{ .} The part \ccTexHtml{$1\over hw$ + \usebox{\arrlinthree}}{hw-1 + } + defines the scaling and rotational part of the transformation, + while the vector \ccTexHtml{$1\over hw$\usebox{\transvecthree}}% + {hw-1 } contains the translational part.} + +\savebox{\arrthree}{\small $\left(\begin{array}{cccc} + m_{00} & m_{01} & m_{02} & 0\\ + m_{10} & m_{11} & m_{12} & 0\\ + m_{20} & m_{21} & m_{22} & 0\\ + 0 & 0 & 0 &hw + \end{array}\right)$} + +\ccConstructor{Aff_transformation_3( + const R::RT &m00, const R::RT &m01, const R::RT& m02, + const R::RT &m10, const R::RT &m11, const R::RT& m12, + const R::RT &m20, const R::RT &m21, const R::RT& m22, + const R::RT &hw = RT(1));} + {introduces a general linear transformation of the + matrix form \ccTexHtml{\usebox{\arrthree},}{ ,} i.e.\ an affine transformation without + translational part.} + + +\ccOperations + +Each class \ccStyle{Class_3} representing +a geometric object in 3D has a member function: + +\ccStyle{Class_3 transform(Aff_transformation_3 t)}. + + +The transformation classes provide a member function \ccStyle{transform()} +for points, vectors, directions, and planes: + +\ccMethod{Point_3 transform(const Point_3 &p) const;} + {} +\ccGlue +\ccMethod{Vector_3 transform(const Vector_3 &p) const;} + {} +\ccGlue +\ccMethod{Direction_3 transform(const Direction_3 &p) const;} + {} +\ccGlue +\ccMethod{Plane_3 transform(const Plane_3 &p) const;} + {} + +\cgal\ provides four function operators for these member functions: + +\ccMethod{Point_3 operator()(const Point_3 &p) const;} + {} +\ccGlue +\ccMethod{Vector_3 operator()(const Vector_3 &p) const;} + {} +\ccGlue +\ccMethod{Direction_3 operator()(const Direction_3 &p) const;} + {} +\ccGlue +\ccMethod{Plane_3 operator()(const Plane_3 &p) const;} + {} + + +\ccMethod{Aff_transformation_3 + operator*(const Aff_transformation_3 &s) const;} + {composes two affine transformations.} + +\ccMethod{Aff_transformation_3 inverse() const;} + {gives the inverse transformation.} + +%\ccMethod{Aff_transformation_3 transpose() const;} +% {returns the affine transformation defined by transposing +% the linear transformation in \ccVar\ and setting the +% translational part to zero.} + +\ccMethod{bool is_even() const;} + {returns \ccStyle{true}, if the transformation is not reflecting, + i.e.\ the determinant of the involved linear transformation is + non-negative.} + +\ccMethod{bool is_odd() const;} + {returns \ccStyle{true}, if the transformation is reflecting.} + + +%\ccMethod{Aff_transformation_3 general_form() const;} +% {returns the affine transformation in matrix form.} + +The matrix entries of a matrix representation of a \ccStyle{Aff_transformation_3} +can be accessed trough the following member functions: + +\ccMethod{FT cartesian(int i, int j) const;} + {} +\ccGlue +\ccMethod{FT m(int i, int j) const;} + {returns entry $m_{ij}$ in a matrix representation in which $m_{33}$ is 1.} + +\ccMethod{RT homogeneous(int i, int j) const;} + {} +\ccGlue +\ccMethod{RT hm(int i, int j) const;} + {returns entry $m_{ij}$ in some fixed matrix representation.} + +For affine transformations no I/O operators are defined. + +\ccSeeAlso +\ccc{Identity_transformation}, +\ccc{Scaling}, +\ccc{Translation} + + +\end{ccRefClass} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Bbox_2.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Bbox_2.tex new file mode 100644 index 00000000000..72ded213b06 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Bbox_2.tex @@ -0,0 +1,38 @@ +\begin{ccRefClass} {Bbox_2} +\ccInclude{CGAL/Bbox_2.h} + +\ccDefinition An object \ccStyle{b} of the class \ccRefName\ is a bounding +box in the two-dimensional Euclidean plane $\E^2$. This class is not templated. + +\ccCreation +\ccCreationVariable{b} + +\ccConstructor{Bbox_2(double x_min, double y_min, + double x_max, double y_max);} + {introduces a bounding box \ccVar\ with lower left corner at + \ccStyle{(xmin, ymin)} and with upper right corner at + \ccStyle{(xmax, ymax)}.} + + +\ccOperations + +\ccHidden\ccMethod{bool operator==(const Bbox_2 &c) const;} + {Test for equality.} + +\ccHidden\ccMethod{bool operator!=(const Bbox_2 &q) const;} + {Test for inequality.} + +\ccMethod{double xmin() const;}{} +\ccGlue +\ccMethod{double ymin() const;}{} +\ccGlue +\ccMethod{double xmax() const;}{} +\ccGlue +\ccMethod{double ymax() const;}{} + +\ccMethod{Bbox_2 operator+(const Bbox_2 &c) const;} + {returns a bounding box of \ccVar\ and \ccStyle{c}.} + +\ccSeeAlso +\ccc{do_overlap} +\end{ccRefClass} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Bbox_3.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Bbox_3.tex new file mode 100644 index 00000000000..c88738bf90a --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Bbox_3.tex @@ -0,0 +1,51 @@ +\begin{ccRefClass} {Bbox_3} +\ccInclude{CGAL/Bbox_3.h} + +\ccDefinition An object \ccStyle{b} of the class \ccRefName\ is a bounding +box in the three-dimensional Euclidean space $\E^3$. + +\ccCreation +\ccCreationVariable{b} + + +\ccConstructor{Bbox_3(double x_min, double y_min, double z_min, + double x_max, double y_max, double z_max);} + {introduces a bounding box \ccVar\ with lexicographically + smallest corner point at \ccStyle{(xmin, ymin, zmin)} + lexicographically largest corner point at + \ccStyle{(xmax, ymax, zmax)}.} + + +\ccOperations + +\ccHidden\ccMethod{bool operator==(const Bbox_3 &c) const;} + {Test for equality.} + +\ccHidden\ccMethod{bool operator!=(const Bbox_3 &q) const;} + {Test for inequality.} + +\ccMethod{double xmin() const;} + {} +\ccGlue +\ccMethod{double ymin() const;} + {} +\ccGlue +\ccMethod{double zmin() const;} + {} +\ccGlue +\ccMethod{double xmax() const;} + {} +\ccGlue +\ccMethod{double ymax() const;} + {} +\ccGlue +\ccMethod{double zmax() const;} + {} + + +\ccMethod{Bbox_3 operator+(const Bbox_3 &c) const;} + {returns a bounding box of \ccVar\ and \ccStyle{c}.} + +\ccSeeAlso +\ccc{do_overlap} +\end{ccRefClass} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Bounded_side.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Bounded_side.tex new file mode 100644 index 00000000000..d87c2b816da --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Bounded_side.tex @@ -0,0 +1,20 @@ +\begin{ccRefEnum}{Bounded_side} +\ccInclude{CGAL/enum.h} + +\ccGlobalEnum{enum Bounded_side {ON_UNBOUNDED_SIDE, ON_BOUNDARY, ON_BOUNDED_SIDE}; +} + +\ccRefLabel{ON_UNBOUNDED_SIDE} %% add label for table-of-contents in intro.tex. +\ccRefLabel{ON_BOUNDED_SIDE} %% add label for table-of-contents in intro.tex. +\ccRefLabel{ON_BOUNDARY} %% add label for table-of-contents in intro.tex. +\ccHtmlCrossLink{ON_UNBOUNDED_SIDE} %% add further rules for cross referencing links +\ccHtmlCrossLink{ON_BOUNDED_SIDE} %% add further rules for cross referencing links +\ccHtmlCrossLink{ON_BOUNDARY} %% add further rules for cross referencing links +\ccHtmlIndexC[enum_tags]{ON_UNBOUNDED_SIDE} %% add further index entries +\ccHtmlIndexC[enum_tags]{ON_BOUNDED_SIDE} %% add further index entries +\ccHtmlIndexC[enum_tags]{ON_BOUNDARY} %% add further index entries + +\ccSeeAlso +\ccc{Kernel::Has_on_bounded_side_2}, +\ccc{Kernel::Has_on_bounded_side_3} +\end{ccRefEnum} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/CLOCKWISE.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/CLOCKWISE.tex new file mode 100644 index 00000000000..878359ffbc8 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/CLOCKWISE.tex @@ -0,0 +1,7 @@ +\begin{ccRefConstant}{CLOCKWISE} +\ccGlobalVariable{const Orientation CLOCKWISE = NEGATIVE;} + +\ccSeeAlso +\ccc{COUNTERCLOCKWISE}, +\ccc{COLLINEAR} +\end{ccRefConstant} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/COUNTERCLOCKWISE.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/COUNTERCLOCKWISE.tex new file mode 100644 index 00000000000..dee79903212 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/COUNTERCLOCKWISE.tex @@ -0,0 +1,3 @@ +\begin{ccRefConstant}{COUNTERCLOCKWISE} +\ccGlobalVariable{const Orientation COUNTERCLOCKWISE = POSITIVE;} +\end{ccRefConstant} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Cartesian.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Cartesian.tex new file mode 100644 index 00000000000..32f734c0e0a --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Cartesian.tex @@ -0,0 +1,21 @@ +\begin{ccRefClass}{Cartesian} +\ccInclude{CGAL/Cartesian.h} + +\ccDefinition +A model for a \ccc{Kernel} using Cartesian coordinates to represent the +geometric objects. + +\ccRefines +\ccc{Kernel} + +\ccTypes +\ccTypedef{typedef FieldNumberType FT;}{} +\ccGlue +\ccTypedef{typedef FieldNumberType RT;}{} + +\ccImplementation +This model of a kernel uses reference counting. + +\ccSeeAlso +\ccc{Simple_cartesian}, \ccc{Homogeneous} +\end{ccRefClass} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Circle_2.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Circle_2.tex new file mode 100644 index 00000000000..90fc5de1bff --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Circle_2.tex @@ -0,0 +1,164 @@ +\begin{ccRefClass}{Circle_2} +\ccInclude{CGAL/Circle_2.h} + +\ccDefinition + +An object of type \ccRefName\ is a circle in the +two-dimensional Euclidean plane $\E^2$. The circle is oriented, i.e.\ +its boundary has clockwise or counterclockwise \ccHtmlNoLinksFrom{orientation}. The +boundary splits $\E^2$ into a positive and a negative side, where the +positive side is to the left of the boundary. The boundary further +splits $\E^2$ into a bounded and an unbounded side. Note that the +circle can be degenerated, i.e.\ the squared radius may be zero. + + +% ----------------------------------------------------------------------------- +\ccCreation +\ccCreationVariable{c} + +\ccHidden +\ccConstructor{ Circle_2( );}{ + introduces an uninitialized variable \ccVar\ of type + \ccClassTemplateName.} + +\ccConstructor{ Circle_2( Point_2 const& center, + R::FT const& squared_radius, + Orientation const& ori = COUNTERCLOCKWISE);}{ + introduces a variable \ccVar\ of type \ccClassTemplateName. + It is initialized to the circle with center \ccc{center}, + squared radius \ccc{squared_radius} and \ccHtmlNoLinksFrom{orientation} + \ccc{ori}. + \ccPrecond \ccc{ori} $\neq$ \ccc{COLLINEAR}, and further, + \ccc{squared_radius} $\geq$ 0.} + +\ccConstructor{ Circle_2( Point_2 const& p, + Point_2 const& q, + Point_2 const& r);}{ + introduces a variable \ccVar\ of type \ccClassTemplateName. + It is initialized to the unique circle which passes through + the points \ccc{p}, \ccc{q} and \ccc{r}. The \ccHtmlNoLinksFrom{orientation} of + the circle is the \ccHtmlNoLinksFrom{orientation} of the point triple \ccc{p}, + \ccc{q}, \ccc{r}. + \ccPrecond \ccc{p}, \ccc{q}, and \ccc{r} are not collinear.} + +\ccConstructor{ Circle_2( Point_2 const& p, + Point_2 const& q, + Orientation const& ori + = COUNTERCLOCKWISE);}{ + introduces a variable \ccVar\ of type \ccClassTemplateName. + It is initialized to the circle with diameter + $\ccTexHtml{\overline{pq}}{pq}$ + and \ccHtmlNoLinksFrom{orientation} \ccc{ori}. + \ccPrecond \ccc{ori} $\neq$ \ccc{COLLINEAR}.} + +\ccConstructor{ Circle_2( Point_2 const& center, + Orientation const& ori + = COUNTERCLOCKWISE);}{ + introduces a variable \ccVar\ of type \ccClassTemplateName. + It is initialized to the circle with center \ccc{center}, squared + radius zero and \ccHtmlNoLinksFrom{orientation} \ccc{ori}. + \ccPrecond \ccc{ori} $\neq$ \ccc{COLLINEAR}. + \ccPostcond \ccVar.\ccc{is_degenerate()} = \ccc{true}.} + +\ccHidden +\ccConstructor{ Circle_2( Circle_2 const&);}{ + copy constructor.} + +\ccHidden +\ccMemberFunction{ Circle_2& operator = ( Circle_2 const&);}{ + assignment.} + +% ----------------------------------------------------------------------------- +\ccAccessFunctions + +\ccMemberFunction{Point_2 const& center( ) const;}{ + returns the center of \ccVar.} +\ccGlue +\ccMemberFunction{ R::FT const& squared_radius( ) const;}{ + returns the squared radius of \ccVar.} +\ccGlue +\ccMemberFunction{ Orientation const& orientation( ) const;}{ + returns the \ccHtmlNoLinksFrom{orientation} of \ccVar.} + +% ----------------------------------------------------------------------------- + +\ccHidden\ccMemberFunction{ bool operator == ( Circle_2 const& circle2) const;}{ + returns \ccc{true}, iff \ccVar\ and \ccc{circle2} are equal, + i.e.\ if they have the same center, same squared radius and + same \ccHtmlNoLinksFrom{orientation}.} + +\ccHidden\ccMemberFunction{ bool operator != ( Circle_2 const& circle2) const;}{ + returns \ccc{true}, iff \ccVar\ and \ccc{circle2} are not equal.} + +% ----------------------------------------------------------------------------- +\ccPredicates + +\ccMemberFunction{ bool is_degenerate( ) const;}{ + returns \ccc{true}, iff \ccVar\ is degenerate, i.e.\ + if \ccVar\ has squared radius zero.} + +\ccMemberFunction{ Oriented_side + oriented_side( Point_2 const& p) const;}{ + returns either the constant \ccc{ON_ORIENTED_BOUNDARY}, + \ccc{ON_POSITIVE_SIDE}, or \ccc{ON_NEGATIVE_SIDE}, + iff \ccc{p} lies on the boundary, properly on the + positive side, or properly on the negative side + of \ccVar, resp.} + +\ccMemberFunction{ Bounded_side + bounded_side( Point_2 const& p) const;}{ + returns \ccc{ON_BOUNDED_SIDE}, + \ccc{ON_BOUNDARY}, or \ccc{ON_UNBOUNDED_SIDE} + iff \ccc{p} lies properly inside, on the boundary, or properly + outside of \ccVar, resp.} + +%\ccMemberFunction{ bool has_on_positive_side( Point const& p) const;}{ +% returns \ccc{true}, iff \ccc{p} lies properly on the +% positive side of \ccVar.} +% +%\ccMemberFunction{ bool has_on_negative_side( Point const& p) const;}{ +% returns \ccc{true}, iff \ccc{p} lies properly on the +% negative side of \ccVar.} +% +%\ccMemberFunction{ bool has_on_boundary( Point const& p) const;}{ +% returns \ccc{true}, iff \ccc{p} lies on the boundary +% of \ccVar.} +% +%\ccMemberFunction{ bool has_on_bounded_side( Point const& p) const;}{ +% returns \ccc{true}, iff \ccc{p} lies properly inside \ccVar.} +% +%\ccMemberFunction{ bool +% has_on_unbounded_side( Point const& p) const;}{ +% returns \ccc{true}, iff \ccc{p} lies properly outside of \ccVar.} +\ccMethod{bool has_on_positive_side(const Point_2 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_negative_side(const Point_2 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_boundary(const Point_2 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_bounded_side(const Point_2 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_unbounded_side(const Point_2 &p) const;} + {} + +% ----------------------------------------------------------------------------- +\ccHeading{Miscellaneous} + +\ccMemberFunction{ Circle_2 opposite() const;}{ + returns the circle with the same center and squared radius as + \ccVar\, but with \ccHtmlNoLinksFrom{opposite} \ccHtmlNoLinksFrom{orientation}.} + + +\ccMemberFunction{ Circle_2 orthogonal_transform( + Aff_transformation_2 const& at) const;}{ + returns the circle obtained by applying $at$ on \ccVar. + \ccPrecond \ccc{at} is an orthogonal transformation.} + +\ccMemberFunction{ Bbox_2 bbox() const;}{ + returns a bounding box containing \ccVar.} + +\end{ccRefClass} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Comparison_result.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Comparison_result.tex new file mode 100644 index 00000000000..319226f9de2 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Comparison_result.tex @@ -0,0 +1,17 @@ +\begin{ccRefEnum}{Comparison_result} +\ccInclude{CGAL/enum.h} + +\ccGlobalEnum{enum Comparison_result { SMALLER, EQUAL, LARGER };} + +\ccRefLabel{SMALLER} +\ccRefLabel{EQUAL} +\ccRefLabel{LARGER} +\ccHtmlCrossLink{SMALLER} +\ccHtmlCrossLink{EQUAL} +\ccHtmlCrossLink{LARGER} +\ccHtmlIndexC[enum_tags]{SMALLER} +\ccHtmlIndexC[enum_tags]{EQUAL} +\ccHtmlIndexC[enum_tags]{LARGER} + +\end{ccRefEnum} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/DEGENERATE.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/DEGENERATE.tex new file mode 100644 index 00000000000..f368b7d6125 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/DEGENERATE.tex @@ -0,0 +1,3 @@ +\begin{ccRefConstant}{DEGENERATE} +\ccGlobalVariable{const Orientation DEGENERATE = ZERO;} +\end{ccRefConstant} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Direction_2.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Direction_2.tex new file mode 100644 index 00000000000..7987b4c1a37 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Direction_2.tex @@ -0,0 +1,99 @@ +\begin{ccRefClass} {Direction_2} +\ccInclude{CGAL/Direction_2.h} + +\ccDefinition +An object of the class \ccRefName\ is a vector in the two-dimensional +vector space $\R^2$ where we forget about its length. They can be +viewed as unit vectors, although there is no normalization internally, +since this is error prone. Directions are used whenever the length of +a vector does not matter. +They also characterize a set of parallel oriented lines that have the same +orientations. +For example, you can ask for the direction +orthogonal to an oriented plane, or the direction of an oriented line. +Further, they can be used to indicate angles. The slope of a direction +is \ccStyle{dy()/dx()}. + + +\ccCreation +\ccCreationVariable{d} + + +\ccHidden \ccConstructor{Direction_2();} + {introduces an uninitialized direction \ccVar.} + +\ccHidden \ccConstructor{Direction_2(const Direction_2 &d);} + {copy constructor.} + +\ccConstructor{Direction_2(const Vector_2 &v);} + {introduces the direction \ccVar\ of vector $v$.} + +\ccConstructor{Direction_2(const R::RT &x, const R::RT &y);} + {introduces a direction \ccVar\ passing through the origin + and the point with Cartesian coordinates $(x, y)$.} + + +\ccOperations +%\ccSetTwoOfThreeColumns{5cm}{4cm} +\ccSetThreeColumns{Direction_2 & }{}{\hspace*{7.8cm}} + +\ccHidden \ccMethod{Direction_2 & operator=(const Direction_2 &e);} + {Assignment.} + +\ccMethod{R::RT delta(int i) const;} + {returns values, such that \ccVar \ccc{== Direction_2(delta(0),delta(1))}. + \ccPrecond: $0 \leq i \leq 1$.} + +\ccMethod{R::RT dx() const;} + {returns \ccc{delta(0)}.} + +\ccMethod{R::RT dy() const;} + {returns \ccc{delta(1)}.} + +There is a total order on directions. We compare the angles between the +positive $x$-axis and the directions in counterclockwise order. + +\ccMethod{bool operator==(const Direction_2 &e) const;} + {} +\ccGlue +\ccMethod{bool operator!=(const Direction_2 &e) const;} + {} +\ccGlue +\ccMethod{bool operator<(const Direction_2 &e) const;} + {} +\ccGlue +\ccMethod{bool operator>(const Direction_2 &e) const;} + {} +\ccGlue +\ccMethod{bool operator<=(const Direction_2 &e) const;} + {} +\ccGlue +\ccMethod{bool operator>=(const Direction_2 &e) const;} + {} + +Furthermore, we have + +\ccMethod{bool counterclockwise_in_between(const Direction_2 &d1, + const Direction_2 &d2) const;} + {returns true, iff \ccVar\ is not equal to \ccc{d1}, and + while rotating counterclockwise starting at \ccc{d1}, + \ccVar\ is reached strictly before \ccc{d2} is reached. + Note that true is returned if \ccc{d1} == \ccc{d2}, unless + also \ccVar\ == \ccc{d1}. + } + + +\ccMethod{Direction_2 operator-() const;} + {The direction opposite to \ccVar.} + +\ccHeading{Miscellaneous} + +\ccMethod{Vector_2 vector() const;} + {returns a vector that has the same direction as \ccVar.} + +\ccMethod{Direction_2 transform(const Aff_transformation_2 &t) const;} + {returns the direction obtained by applying $t$ on \ccVar.} + + +\end{ccRefClass} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Direction_3.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Direction_3.tex new file mode 100644 index 00000000000..5f276c474de --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Direction_3.tex @@ -0,0 +1,75 @@ +\begin{ccRefClass}{Direction_3} +\ccInclude{CGAL/Direction_3.h} + +\ccDefinition +An object of the class \ccRefName\ is a vector in the three-dimensional +vector space $\R^3$ where we forget about their length. They can be +viewed as unit vectors, although there is no normalization internally, +since this is error prone. Directions are used whenever the length of +a vector does not matter. +They also characterize a set of parallel lines that have the same orientation +or the direction normal to parallel planes that have the same orientation. +For example, you can ask for the direction +orthogonal to an oriented plane, or the direction of an oriented line. + + +\ccCreation +\ccCreationVariable{d} + + +\ccHidden \ccConstructor{Direction_3();} + {introduces an uninitialized direction \ccVar.} + +\ccHidden \ccConstructor{Direction_3(const Direction_3 &d);} + {copy constructor.} + +\ccConstructor{Direction_3(const Vector_3 &v);} + {introduces a direction \ccVar\ initialised with the + direction of vector $v$.} + +\ccConstructor{Direction_3(const R::RT &x, const R::RT &y, const R::RT &z);} + {introduces a direction \ccVar\ initialised with the direction + from the origin to the point with Cartesian coordinates $(x, y, z)$.} + + +\ccOperations +%\ccSetTwoOfThreeColumns{5cm}{4cm} +\ccSetThreeColumns{Direction_3 & }{}{\hspace*{7.8cm}} + +\ccHidden \ccMethod{Direction_3 & operator=(const Direction_3 &e);} + {Assignment.} + +\ccMethod{R::RT delta(int i) const;} + {returns values, such that \ccVar \ccc{== Direction_2(delta(0),delta(1),delta(2))}. + \ccPrecond: $0 \leq i \leq 2$.} + +\ccMethod{R::RT dx() const;} + {returns \ccc{delta(0)}.} +\ccGlue +\ccMethod{R::RT dy() const;} + {returns \ccc{delta(1)}.} +\ccGlue +\ccMethod{R::RT dz() const;} + {returns \ccc{delta(2)}.} + + +\ccMethod{bool operator==(const Direction_3 &e) const;} + {Test for equality.} +\ccGlue +\ccMethod{bool operator!=(const Direction_3 &e) const;} + {Test for inequality.} + + +\ccMethod{Direction_3 operator-() const;} + {The direction opposite to \ccVar.} + +\ccMethod{Vector_3 vector() const;} + {returns a vector that has the same direction as \ccVar.} + +\ccMethod{Direction_3 transform(const Aff_transformation_3 &t) const;} + {returns the direction obtained by applying $t$ on \ccVar.} + + + +\end{ccRefClass} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/FieldNumberType.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/FieldNumberType.tex new file mode 100644 index 00000000000..dd29074b8d7 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/FieldNumberType.tex @@ -0,0 +1,11 @@ +\begin{ccRefConcept}{FieldNumberType} + +A number type representing field elements, i.e., must be closed under +operations $+$, $-$, $*$ and also under division operation $/$. + +\ccRefines +\ccc{CopyConstructable}, \ccc{Assignable}, \ccc{RingNumberType} + +\ccSeeAlso +\ccc{Kernel}, \ccc{R} +\end{ccRefConcept} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Homogeneous.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Homogeneous.tex new file mode 100644 index 00000000000..d4d746df198 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Homogeneous.tex @@ -0,0 +1,22 @@ +\begin{ccRefClass}{Homogeneous} +\ccInclude{CGAL/Homogeneous.h} + +\ccDefinition +A model for a \ccc{Kernel} using homogeneous coordinates to represent the +geometric objects. + +\ccRefines +\ccc{Kernel} + +\ccTexHtml{\ccSetThreeColumns{typedef Quotient}{}{\hspace*{8.5cm}}}{} +\ccTypes +\ccTypedef{typedef Quotient FT;}{} +\ccGlue +\ccTypedef{typedef RingNumberType RT;}{} + +\ccImplementation +This model of a kernel uses reference counting. + +\ccSeeAlso +\ccc{Cartesian}, \ccc{Simple_cartesian} +\end{ccRefClass} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Identity_transformation.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Identity_transformation.tex new file mode 100644 index 00000000000..370ebf6d6b3 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Identity_transformation.tex @@ -0,0 +1,10 @@ +\begin{ccRefClass}{Identity_transformation} +\ccInclude{CGAL/aff_transformation_tags.h} + +\ccDefinition +Tag class for affine transformations. + +\ccSeeAlso +\ccc{Aff_transformation_2}, +\ccc{Aff_transformation_3} +\end{ccRefClass} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Iso_cuboid_3.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Iso_cuboid_3.tex new file mode 100644 index 00000000000..596b5ad07b5 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Iso_cuboid_3.tex @@ -0,0 +1,119 @@ +\begin{ccRefClass} {Iso_cuboid_3} +\ccInclude{CGAL/Iso_cuboid_3.h} + +\ccDefinition An object $s$ of the data type \ccRefName\ is a +cuboid in the Euclidean plane $\E^3$ with sides parallel to the $x$ and +$y$ axis of the coordinate system. + +Although they are represented in a canonical form by only two +vertices, namely the lexicographically smallest and largest vertex +with respect to Cartesian $xyz$ coordinates, we provide +functions for ``accessing'' the other vertices as well. + +Iso-oriented cuboids and bounding boxes are quite similar. The +difference however is that bounding boxes have always double coordinates, +whereas the coordinate type of an iso-oriented cuboid is chosen by +the user. + + +\ccCreation +\ccCreationVariable{c} + + +\ccHidden \ccConstructor{Iso_cuboid_3();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Iso_cuboid_3(const Iso_cuboid_3 &u);} + {copy constructor.} + +\ccConstructor{Iso_cuboid_3(const Point_3 &p, + const Point_3 &q);} + {introduces an iso-oriented cuboid \ccVar\ with diagonal + opposite vertices $p$ and $q$. Note that the object is + brought in the canonical form.} + + +\ccOperations +\ccHidden \ccMethod{Iso_cuboid_3 & operator=(const Iso_cuboid_3 &q);} + {Assignment.} + +\ccMethod{bool operator==(const Iso_cuboid_3 &c2) const;} + {Test for equality: two iso-oriented cuboid are equal, iff their + lower left and their upper right vertices are equal.} + +\ccMethod{bool operator!=(const Iso_cuboid_3 &c2) const;} + {Test for inequality.} + +\ccMethod{Point_3 vertex(int i) const;} + {returns the i'th vertex modulo 8 of \ccVar. + starting with the lower left vertex.} + +\ccMethod{Point_3 operator[](int i) const;} + {returns \ccStyle{vertex(i)}, as indicated in the figure below: + \lcTex{\epsfxsize=6cm\epsffile{IsoCuboid.eps}}} + +\begin{ccHtmlOnly} +
+vertex order of an iso-cuboid +
+\end{ccHtmlOnly} + + +\ccMethod{Point_3 min() const;} + {returns the smallest vertex of \ccVar\ (= \ccStyle{vertex(0)}).} + + +\ccMethod{Point_3 max() const;} + {returns the largest vertex of \ccVar\ (= \ccStyle{vertex(7)}).} +\ccMethod{ FT xmin() const;}{returns smallest Cartesian $x$-coordinate in \ccVar.} +\ccGlue +\ccMethod{ FT ymin() const;}{returns smallest Cartesian $y$-coordinate in \ccVar.} +\ccGlue +\ccMethod{ FT zmin() const;}{returns smallest Cartesian $z$-coordinate in \ccVar.} +\ccGlue +\ccMethod{ FT xmax() const;}{returns largest Cartesian $x$-coordinate in \ccVar.} +\ccGlue +\ccMethod{ FT ymax() const;}{returns largest Cartesian $y$-coordinate in \ccVar.} +\ccGlue +\ccMethod{ FT zmax() const;}{returns largest Cartesian $z$-coordinate in \ccVar.} + +\ccPredicates + +\ccMethod{bool is_degenerate() const;} + {%the iso-oriented cuboid + \ccVar\ is degenerate, if all vertices + are collinear.} + +\ccMethod{Bounded_side bounded_side(const Point_3 &p) const;} + {returns either \ccStyle{ON_UNBOUNDED_SIDE}, + \ccStyle{ON_BOUNDED_SIDE}, or the constant + \ccStyle{ON_BOUNDARY}, + depending on where point $p$ is.} + +\ccMethod{bool has_on_boundary(const Point_3 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_bounded_side(const Point_3 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_unbounded_side(const Point_3 &p) const;} + {} + +\ccHeading{Miscellaneous} + +\ccMethod{Bbox bbox() const;} + {returns a bounding box containing \ccVar. } + +\ccMethod{Iso_cuboid_3 transform(const Aff_transformation_3 &t) const;} + {returns the iso-oriented cuboid obtained by applying $t$ on + the smallest and the largest of \ccVar. + \ccPrecond The angle at a rotation must be a multiple of $\pi/2$, + otherwise the resulting cuboid does not have the same size. + Note that rotating about an arbitrary angle can even result in + a degenerate iso-oriented cuboid.} + + + + + +\end{ccRefClass} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Iso_rectangle_2.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Iso_rectangle_2.tex new file mode 100644 index 00000000000..8b063efa16c --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Iso_rectangle_2.tex @@ -0,0 +1,99 @@ +\begin{ccRefClass} {Iso_rectangle_2} +\ccInclude{CGAL/Iso_rectangle_2.h} + +\ccDefinition An object $s$ of the data type \ccRefName\ is a +rectangle in the Euclidean plane $\E^2$ with sides parallel to the $x$ and +$y$ axis of the coordinate system. + +Although they are represented in a canonical form by only two +vertices, namely the lower left and the upper right vertex, we provide +functions for ``accessing'' the other vertices as well. The vertices +are returned in counterclockwise order. + +Iso-oriented rectangles and bounding boxes are quite similar. The +difference however is that bounding boxes have always double coordinates, +whereas the coordinate type of an iso-oriented rectangle is chosen by +the user. + +\ccCreation +\ccCreationVariable{r} + + +\ccHidden \ccConstructor{Iso_rectangle_2();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Iso_rectangle_2(const Iso_rectangle_2 &u);} + {copy constructor.} + +\ccConstructor{Iso_rectangle_2(const Point_2 &p, + const Point_2 &q);} + {introduces an iso-oriented rectangle \ccVar\ with diagonal + opposite vertices $p$ and $q$. Note that the object is + brought in the canonical form.} + + +\ccOperations +\ccHidden \ccMethod{Iso_rectangle_2 & operator=(const Iso_rectangle_2 &q);} + {Assignment.} + +\ccMethod{bool operator==(const Iso_rectangle_2 &r2) const;} + {Test for equality: two iso-oriented rectangles are equal, iff their + lower left and their upper right vertices are equal.} + +\ccMethod{bool operator!=(const Iso_rectangle_2 &r2) const;} + {Test for inequality.} + +\ccMethod{Point_2 vertex(int i) const;} + {returns the i'th vertex modulo 4 of \ccVar\ in counterclockwise order, + starting with the lower left vertex.} + +\ccMethod{Point_2 operator[](int i) const;} + {returns \ccStyle{vertex(i)}.} + +\ccMethod{Point_2 min() const;} + {returns the lower left vertex of \ccVar\ (= \ccStyle{vertex(0)}).} + + +\ccMethod{Point_2 max() const;} + {returns the upper right vertex of \ccVar\ (= \ccStyle{vertex(2)}).} + +\ccPredicates + +\ccMethod{bool is_degenerate() const;} + {%the iso-oriented rectangle + \ccVar\ is degenerate, if all vertices + are collinear.} + +\ccMethod{Bounded_side bounded_side(const Point_2 &p) const;} + {returns either \ccStyle{ON_UNBOUNDED_SIDE}, + \ccStyle{ON_BOUNDED_SIDE}, or the constant + \ccStyle{ON_BOUNDARY}, + depending on where point $p$ is.} + +\ccMethod{bool has_on_boundary(const Point_2 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_bounded_side(const Point_2 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_unbounded_side(const Point_2 &p) const;} + {} + +\ccHeading{Miscellaneous} + +\ccMethod{Bbox bbox() const;} + {returns a bounding box containing \ccVar. } + +\ccMethod{Iso_rectangle_2 transform(const Aff_transformation_2 &t) const;} + {returns the iso-oriented rectangle obtained by applying $t$ on + the lower left and the upper right corner of \ccVar. + \ccPrecond The angle at a rotation must be a multiple of $\pi/2$, + otherwise the resulting rectangle does not have the same side length. + Note that rotating about an arbitrary angle can even result in + a degenerate iso-oriented rectangle.} + + + + + +\end{ccRefClass} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Kernel.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Kernel.tex new file mode 100644 index 00000000000..ff6c580f8e7 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Kernel.tex @@ -0,0 +1,661 @@ +\begin{ccRefConcept}{Kernel} +The concept of a {\em kernel} is defined by a set of requirements on +the provision of certain types and access member functions to create +objects of these types. The types are function object classes to be used +within the algorithms and data structures in the basic library of \cgal. +This allows you to use any model of a kernel as a traits class in +the \cgal\ algorithms and data structures, unless they require types +beyond those provided by a kernel. + +A kernel subsumes the concepts of {\em two-dimensional kernel}, +{\em three-dimensional kernel}, and {\em $d$-dimensional kernel}. + +A kernel provides types, construction objects, and generalized predicates. +The former replace constructors of the kernel classes and constructive procedures +in the kernel. There are also function objects replacing operators, especially +for equality testing. + +\ccCreationVariable{kernel} + +\ccTypes + +\ccNestedType{FT}{a number type that is a model for \ccc{FieldNumberType}} +\ccGlue +\ccNestedType{RT}{a number type that is a model for \ccc{RingNumberType}} + +\ccHeading{Two-dimensional Kernel} + +\ccHeading{Geometric Objects} + +\ccNestedType{Point_2}{} +\ccGlue +\ccNestedType{Vector_2}{} +\ccGlue +\ccNestedType{Direction_2}{} +\ccGlue +\ccNestedType{Line_2}{} +\ccGlue +\ccNestedType{Ray_2}{} +\ccGlue +\ccNestedType{Segment_2}{} +\ccGlue +\ccNestedType{Triangle_2}{} +\ccGlue +\ccNestedType{Iso_rectangle_2}{} +\ccGlue +\ccNestedType{Aff_transformation_2}{} +\ccGlue +\ccNestedType{Circle_2}{} + +\ccHeading{Constructors} + +\ccNestedType{Construct_point_2}{} +\ccGlue +\ccNestedType{Construct_vector_2}{} +\ccGlue +\ccNestedType{Construct_direction_2}{} +\ccGlue +\ccNestedType{Construct_segment_2}{} +\ccGlue +\ccNestedType{Construct_line_2}{} +\ccGlue +\ccNestedType{Construct_ray_2}{} +\ccGlue +\ccNestedType{Construct_circle_2}{} +\ccGlue +\ccNestedType{Construct_triangle_2}{} +\ccGlue +\ccNestedType{Construct_aff_transformation_2}{} +\ccGlue +\ccNestedType{Construct_point_on_2}{} +\ccGlue +\ccNestedType{Construct_second_point_on_2}{} +\ccGlue +\ccNestedType{Construct_source_point_2}{} +\ccGlue +\ccNestedType{Construct_target_point_2}{} +\ccGlue +\ccNestedType{Construct_min_point_2}{} +\ccGlue +\ccNestedType{Construct_max_point_2}{} +\ccGlue +\ccNestedType{Construct_direction_of_line_2}{} +\ccGlue +\ccNestedType{Construct_direction_of_ray_2}{} +\ccGlue +\ccNestedType{Construct_supporting_line_2}{} +\ccGlue +\ccNestedType{Construct_perpendicular_vector_2}{} +\ccGlue +\ccNestedType{Construct_perpendicular_direction_2}{} +\ccGlue +\ccNestedType{Construct_perpendicular_line_2}{} +\ccGlue +\ccNestedType{Construct_midpoint_2}{} +\ccGlue +\ccNestedType{Construct_circumcenter_2}{} +\ccGlue +\ccNestedType{Construct_bisector_2}{} +\ccGlue +\ccNestedType{Construct_opposite_segment_2}{} +\ccGlue +\ccNestedType{Construct_opposite_ray_2}{} +\ccGlue +\ccNestedType{Construct_opposite_line_2}{} +\ccGlue +\ccNestedType{Construct_opposite_triangle_2}{} +\ccGlue +\ccNestedType{Construct_opposite_circle_2}{} + +If the result type is not determined, there is no \ccc{Construct_} prefix: + +\ccNestedType{Transform_2}{} +\ccGlue +\ccNestedType{Intersect_2}{} +\ccGlue +\ccNestedType{Assign_2}{} + +If the result type is a number type, the prefix is \ccc{Compute_}: + +\ccNestedType{Compute_y_at_x_2}{} +\ccGlue +\ccNestedType{Compute_squared_length_2}{} + +\ccHeading{Generalized Predicates} + +\ccNestedType{Equal_2}{} +\ccGlue +\ccNestedType{Equal_x_2}{} +\ccGlue +\ccNestedType{Equal_y_2}{} +\ccGlue +\ccNestedType{Equal_xy_2}{} +\ccGlue +\ccNestedType{Less_x_2}{} +\ccGlue +\ccNestedType{Less_y_2}{} +\ccGlue +\ccNestedType{Less_xy_2}{} +\ccGlue +\ccNestedType{Compare_x_2}{} +\ccGlue +\ccNestedType{Compare_x_at_y_2}{} +\ccGlue +\ccNestedType{Compare_y_2}{} +\ccGlue +\ccNestedType{Compare_xy_2}{} +\ccGlue +\ccNestedType{Compare_y_at_x_2}{} +\ccGlue +\ccNestedType{Less_distance_to_point_2}{} +\ccGlue +\ccNestedType{Less_signed_distance_to_line_2}{} +\ccGlue +\ccNestedType{Less_rotate_ccw_2}{} +\ccGlue +\ccNestedType{Leftturn_2}{} +\ccGlue +\ccNestedType{Left_of_line_2}{} +\ccGlue +\ccNestedType{Collinear_2}{} +\ccGlue +\ccNestedType{Orientation_2}{} +\ccGlue +\ccNestedType{Side_of_oriented_circle_2}{} +\ccGlue +\ccNestedType{Side_of_bounded_circle_2}{} +\ccGlue +\ccNestedType{Is_horizontal_2}{} +\ccGlue +\ccNestedType{Is_vertical_2}{} +\ccGlue +\ccNestedType{Has_on_2}{} +\ccGlue +\ccNestedType{Collinear_has_on_2}{} +\ccGlue +\ccNestedType{Has_on_bounded_side_2}{} +\ccGlue +\ccNestedType{Has_on_unbounded_side_2}{} +\ccGlue +\ccNestedType{Has_on_boundary_2}{} +\ccGlue +\ccNestedType{Has_on_positive_side_2}{} +\ccGlue +\ccNestedType{Has_on_negative_side_2}{} +\ccGlue +\ccNestedType{Oriented_side_2}{} +\ccGlue +\ccNestedType{Are_ordered_along_line_2 }{} +\ccGlue +\ccNestedType{Are_strictly_ordered_along_line_2}{} +\ccGlue +\ccNestedType{Collinear_are_ordered_along_line_2}{} +\ccGlue +\ccNestedType{Collinear_are_strictly_ordered_along_line_2}{} +\ccGlue +\ccNestedType{Counterclockwise_in_between_2}{} + +\ccHeading{Three-dimensional Kernel} + +\ccHeading{Geometric Objects} + +\ccNestedType{Point_3}{} +\ccGlue +\ccNestedType{Vector_3}{} +\ccGlue +\ccNestedType{Direction_3}{} +\ccGlue +\ccNestedType{Iso_cuboid_3}{} +\ccGlue +\ccNestedType{Line_3}{} +\ccGlue +\ccNestedType{Ray_3}{} +\ccGlue +\ccNestedType{Sphere_3}{} +\ccGlue +\ccNestedType{Segment_3}{} +\ccGlue +\ccNestedType{Plane_3}{} +\ccGlue +\ccNestedType{Triangle_3}{} +\ccGlue +\ccNestedType{Tetrahedron_3}{} +\ccGlue +\ccNestedType{Aff_transformation_3}{} + +\ccHeading{Constructors} + +\ccNestedType{Construct_point_3}{} +\ccGlue +\ccNestedType{Construct_vector_3}{} +\ccGlue +\ccNestedType{Construct_direction_3}{} +\ccGlue +\ccNestedType{Construct_plane_3}{} +\ccGlue +\ccNestedType{Construct_iso_cuboid_3}{} +\ccGlue +\ccNestedType{Construct_line_3}{} +\ccGlue +\ccNestedType{Construct_ray_3}{} +\ccGlue +\ccNestedType{Construct_sphere_3}{} +\ccGlue +\ccNestedType{Construct_segment_3}{} +\ccGlue +\ccNestedType{Construct_triangle_3}{} +\ccGlue +\ccNestedType{Construct_tetrahedron_3}{} +\ccGlue +\ccNestedType{Construct_aff_transformation_3}{} +\ccGlue +\ccNestedType{Construct_point_on_3}{} +\ccGlue +\ccNestedType{Construct_second_point_on_3}{} +\ccGlue +\ccNestedType{Construct_source_point_3}{} +\ccGlue +\ccNestedType{Construct_target_point_3}{} +\ccGlue +\ccNestedType{Construct_min_point_3}{} +\ccGlue +\ccNestedType{Construct_max_point_3}{} +\ccGlue +\ccNestedType{Construct_direction_of_line_3}{} +\ccGlue +\ccNestedType{Construct_direction_of_ray_3}{} +\ccGlue +\ccNestedType{Construct_supporting_plane_3}{} +\ccGlue +\ccNestedType{Construct_perpendicular_plane_3}{} +\ccGlue +\ccNestedType{Construct_perpendicular_line_3}{} +\ccGlue +\ccNestedType{Construct_midpoint_3}{} +\ccGlue +\ccNestedType{Construct_opposite_segment_3}{} +\ccGlue +\ccNestedType{Construct_opposite_ray_3}{} +\ccGlue +\ccNestedType{Construct_opposite_line_3}{} +\ccGlue +\ccNestedType{Construct_opposite_plane_3}{} + +If the result type is not determined, there is no \ccc{Construct_} prefix: + +\ccNestedType{Transform_3}{} +\ccGlue +\ccNestedType{Intersect_3}{} +\ccGlue +\ccNestedType{Assign_3}{} + +If the result type is a number type, the prefix is \ccc{Compute_}: + +\ccNestedType{Compute_squared_length_3}{} + +\ccHeading{Generalized Predicates} + +\ccNestedType{Equal_3}{} +\ccGlue +\ccNestedType{Equal_x_3}{} +\ccGlue +\ccNestedType{Equal_y_3}{} +\ccGlue +\ccNestedType{Equal_z_3}{} +\ccGlue +\ccNestedType{Equal_xy_3}{} +\ccGlue +\ccNestedType{Equal_xyz_3}{} +\ccGlue +\ccNestedType{Less_x_3}{} +\ccGlue +\ccNestedType{Less_y_3}{} +\ccGlue +\ccNestedType{Less_z_3}{} +\ccGlue +\ccNestedType{Less_xy_3}{} +\ccGlue +\ccNestedType{Less_xyz_3}{} +\ccGlue +\ccNestedType{Compare_x_3}{} +\ccGlue +\ccNestedType{Compare_y_3}{} +\ccGlue +\ccNestedType{Compare_z_3}{} +\ccGlue +\ccNestedType{Compare_xy_3}{} +\ccGlue +\ccNestedType{Compare_xyz_3}{} +\ccGlue +\ccNestedType{Less_distance_to_point_3}{} +\ccGlue +\ccNestedType{Collinear_3}{} +\ccGlue +\ccNestedType{Coplanar_3}{} +\ccGlue +\ccNestedType{Orientation_3}{} +\ccGlue +\ccNestedType{Side_of_oriented_sphere_3}{} +\ccGlue +\ccNestedType{Side_of_bounded_sphere_3}{} +\ccGlue +\ccNestedType{Is_degenerate_3}{} +\ccGlue +\ccNestedType{Has_on_3}{} +\ccGlue +\ccNestedType{Has_on_bounded_side_3}{} +\ccGlue +\ccNestedType{Has_on_unbounded_side_3}{} +\ccGlue +\ccNestedType{Has_on_boundary_3}{} +\ccGlue +\ccNestedType{Has_on_positive_side_3}{} +\ccGlue +\ccNestedType{Has_on_negative_side_3}{} +\ccGlue +\ccNestedType{Oriented_side_3}{} +\ccGlue +\ccNestedType{Are_ordered_along_line_3 }{} +\ccGlue +\ccNestedType{Are_strictly_ordered_along_line_3}{} +\ccGlue +\ccNestedType{Collinear_are_ordered_along_line_3}{} +\ccGlue +\ccNestedType{Collinear_are_strictly_ordered_along_line_3}{} + + +\ccHeading{d-dimensional Kernel} + +\ccHeading{Geometric Objects} + +\ccNestedType{Point_d}{} + +\ccOperations + +The following member functions return function objects of the types listed above. +The name of the access function is the name of the type returned with an +\ccc{_object} suffix. + +\ccTexHtml{\ccSetThreeColumns{Kernel::Are_strictly_ordered_along_line}{}{\hspace*{4.5cm}}}{} + +\setlength{\ccAdditionalReturnSkip}{-\parskip} + +\def\ccTagRmEigenClassName{\ccFalse} +\ccMemberFunction{Kernel::Construct_point_2 construct_point_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_vector_2 construct_vector_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_direction_2 construct_direction_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_segment_2 construct_segment_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_line_2 construct_line_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_ray_2 construct_ray_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_circle_2 construct_circle_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_triangle_2 construct_triangle_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_iso_rectangle_2 construct_iso_rectangle_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_aff_transformation_2 construct_aff_transformation_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_point_on_2 construct_point_on_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_second_point_on_2 construct_second_point_on_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_source_point_2 construct_source_point_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_target_point_2 construct_target_point_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_min_point_2 construct_min_point_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_max_point_2 construct_max_point_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_direction_of_line_2 construct_direction_of_line_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_direction_of_ray_2 construct_direction_of_ray_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_supporting_line_2 construct_supporting_line_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_perpendicular_vector_2 construct_perpendicular_vector_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_perpendicular_direction_2 construct_perpendicular_direction_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_perpendicular_line_2 construct_perpendicular_line_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_midpoint_2 construct_midpoint_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_circumcenter_2 construct_circumcenter_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_bisector_2 construct_bisector_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_opposite_segment_2 construct_opposite_segment_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_opposite_ray_2 construct_opposite_ray_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_opposite_line_2 construct_opposite_line_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_opposite_triangle_2 construct_opposite_triangle_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_opposite_circle_2 construct_opposite_circle_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Transform_2 transform_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Assign_2 assign_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Intersect_2 intersect_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Compute_y_at_x_2 compute_y_at_x_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Compute_squared_length_2 compute_squared_length_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Equal_2 equal_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Equal_x_2 equal_x_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Equal_y_2 equal_y_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Equal_xy_2 equal_xy_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Less_x_2 less_x_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Less_y_2 less_y_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Less_xy_2 less_xy_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Less_yx_2 less_yx_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Compare_x_2 compare_x_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Compare_y_2 compare_y_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Compare_xy_2 compare_xy_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Compare_y_at_x_2 compare_y_at_x_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Compare_x_at_y_2 compare_x_at_y_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Less_distance_to_point_2 less_distance_to_point_2_object(const Kernel::Point_2& p) const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Less_signed_distance_to_line_2 less_signed_distance_to_line_2_object(const Kernel::Point_2& p, const Kernel::Point_2& q) const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Less_rotate_ccw_2 less_rotate_ccw_2_object(const Kernel::Point_2& p) const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Counterclockwise_in_between_2 counterclockwise_in_between_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Leftturn_2 leftturn_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Left_of_line_2 left_of_line_2_object(const Kernel::Point_2& p, const Kernel::Point_2& q) const ;}{} +\ccGlue +%\ccMemberFunction{Kernel::Right_of_line_2 right_of_line_2_object(const Kernel::Point_2& p, const Kernel::Point_2& q) const ;}{} +%\ccGlue +%\ccMemberFunction{Kernel::Left_of_line_2 left_of_vertical_2_object(const Kernel::Point_2& p) const ;}{} +%\ccGlue +\ccMemberFunction{Kernel::Collinear_2 collinear_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Orientation_2 orientation_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Side_of_oriented_circle_2 side_of_oriented_circle_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Side_of_bounded_circle_2 side_of_bounded_circle_2_object() const;}{} +\ccGlue +\ccMemberFunction{Kernel::Is_horizontal_2 is_horizontal_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Is_vertical_2 is_vertical_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Is_degenerate_2 is_degenerate_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Has_on_2 has_on_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Collinear_has_on_2 collinear_has_on_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Has_on_bounded_side_2 has_on_bounded_side_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Has_on_unbounded_side_2 has_on_unbounded_side_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Has_on_boundary_2 has_on_boundary_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Has_on_positive_side_2 has_on_positive_side_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Has_on_negative_side_2 has_on_negative_side_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Oriented_side_2 oriented_side_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Are_ordered_along_line_2 are_ordered_along_line_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Are_strictly_ordered_along_line_2 are_strictly_ordered_along_line_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Collinear_are_ordered_along_line_2 collinear_are_ordered_along_line_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Collinear_are_strictly_ordered_along_line_2 collinear_are_strictly_ordered_along_line_2_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_point_3 construct_point_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_vector_3 construct_vector_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_direction_3 construct_direction_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_iso_cuboid_3 construct_iso_cuboid_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_segment_3 construct_segment_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_sphere_3 construct_sphere_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_plane_3 construct_plane_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_line_3 construct_line_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_ray_3 construct_ray_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_triangle_3 construct_triangle_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_tetrahedron_3 construct_tetrahedron_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_iso_cuboid_3 construct_iso_cuboid_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_aff_transformation_3 construct_aff_transformation_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_point_on_3 construct_point_on_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_second_point_on_3 construct_second_point_on_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_midpoint_3 construct_midpoint_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_circumcenter_3 construct_circumcenter_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_opposite_segment_3 construct_opposite_segment_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_opposite_ray_3 construct_opposite_ray_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_opposite_line_3 construct_opposite_line_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_supporting_plane_3 construct_supporting_plane_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Transform_3 transform_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Assign_3 assign_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Intersect_3 intersect_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Compute_squared_length_3 compute_squared_length_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Equal_3 equal_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Equal_x_3 equal_x_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Equal_y_3 equal_y_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Equal_z_3 equal_z_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Equal_xy_3 equal_xy_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Equal_xyz_3 equal_xyz_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Less_x_3 less_x_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Less_y_3 less_y_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Less_z_3 less_z_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Less_xy_3 less_xy_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Less_xyz_3 less_xyz_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Compare_x_3 compare_x_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Compare_y_3 compare_y_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Compare_z_3 compare_z_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Compare_xy_3 compare_xy_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Compare_xyz_3 compare_xyz_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Less_distance_to_point_3 less_distance_to_point_3_object(const Kernel::Point_3& p) const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Collinear_3 collinear_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Coplanar_3 coplanar_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Orientation_3 orientation_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Is_degenerate_3 is_degenerate_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Has_on_3 has_on_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Has_on_bounded_side_3 has_on_bounded_side_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Has_on_unbounded_side_3 has_on_unbounded_side_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Has_on_boundary_3 has_on_boundary_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Has_on_positive_side_3 has_on_positive_side_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Has_on_negative_side_3 has_on_negative_side_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Oriented_side_3 oriented_side_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Are_ordered_along_line_3 are_ordered_along_line_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Are_strictly_ordered_along_line_3 are_strictly_ordered_along_line_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Collinear_are_ordered_along_line_3 collinear_are_ordered_along_line_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Collinear_are_strictly_ordered_along_line_3 collinear_are_strictly_ordered_along_line_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Side_of_oriented_sphere_3 side_of_oriented_sphere_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Side_of_bounded_sphere_3 side_of_bounded_sphere_3_object() const ;}{} +\ccGlue +\ccMemberFunction{Kernel::Construct_point_d construct_point_d_object() const ;}{} + +\def\ccTagRmEigenClassName{\ccTrue} +\setlength{\ccAdditionalReturnSkip}{0pt} + +\ccHasModels + +\ccc{Cartesian}, \ccc{Homogeneous}, +\ccc{Simple_cartesian} +\end{ccRefConcept} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Line_2.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Line_2.tex new file mode 100644 index 00000000000..92c6bfa3d01 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Line_2.tex @@ -0,0 +1,172 @@ +\begin{ccRefClass} {Line_2} +\ccInclude{CGAL/Line_2.h} + +\ccDefinition +An object \ccStyle{l} of the data type \ccRefName\ is a directed +straight line in the two-dimensional Euclidean plane $\E^2$. It is +defined by the set of points with Cartesian coordinates $(x,y)$ +that satisfy the equation +\begin{ccTexOnly} +\[ l:\; a\, x +b\, y +c = 0. \] +\end{ccTexOnly} +\begin{ccHtmlOnly} + l : ax + by + c = 0 +\end{ccHtmlOnly} + +The line splits $\E^2$ in a {\em positive} and a {\em negative} +side. A point $p$ with Cartesian coordinates +$(px, py)$ is on the positive side of \ccStyle{l}, iff +\ccTexHtml{$a\, px + b\, py +c > 0$}{a px + b py + c > 0}, it is +on the negative side of \ccStyle{l}, iff +\ccTexHtml{$a\, px + b\, py +c < 0$}{a px + b py + c < 0}. +The positive side is to the left of \ccc{l}. + +\ccCreation +\ccCreationVariable{l} + +\ccHidden \ccConstructor{Line_2();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Line_2(const Line_2 &h);} + {copy constructor.} + +\ccConstructor{Line_2(const R::RT &a, const R::RT &b, const R::RT &c)} + {introduces a line \ccVar\ with the line equation in Cartesian + coordinates $ax +by +c = 0$.} + +\ccConstructor{Line_2(const Point_2 &p, const Point_2 &q);} + {introduces a line \ccVar\ passing through the points $p$ and $q$. + Line \ccVar\ is directed from $p$ to $q$.} + +\ccConstructor{Line_2(const Point_2 &p, const Direction_2&d)} + {introduces a line \ccVar\ passing through point $p$ with + direction $d$.} + +\ccConstructor{Line_2(const Segment_2 &s);} + {introduces a line \ccVar\ supporting the segment $s$, + oriented from source to target.} + +\ccConstructor{Line_2(const Ray_2 &r)} + {introduces a line \ccVar\ supporting the ray $r$, + with same orientation.} + +\ccOperations + +\ccSetThreeColumns{Direction_2 & }{}{\hspace*{7.4cm}} + +\ccHidden \ccMethod{Line_2 & operator=(const Line_2 &h);} + {Assignment.} + +\ccMethod{bool operator==(const Line_2 &h) const;} + {Test for equality: two lines are equal, iff they have a non + empty \ccHtmlNoLinksFrom{intersection} and the same direction.} + +\ccMethod{bool operator!=(const Line_2 &h) const;} + {Test for inequality.} + + +\ccMethod{R::RT a() const;} + {returns the first coefficient of $l$.} +\ccGlue +\ccMethod{R::RT b() const;} + {returns the second coefficient of $l$.} +\ccGlue +\ccMethod{R::RT c() const;} + {returns the third coefficient of $l$.} + +\ccMethod{Point_2 point(int i) const;} + {returns an arbitrary point on \ccVar. It holds + \ccStyle{point(i) == point(j)}, iff \ccStyle{i==j}. + Furthermore, \ccVar\ is directed from \ccStyle{point(i)} + to \ccStyle{point(j)}, for all \ccStyle{i} $<$ \ccStyle{j}.} + +\ccMethod{Point_2 projection(const Point_2 &p) const;} + {returns the orthogonal projection of $p$ onto \ccVar.} + +\ccMethod{R::FT x_at_y(const R::FT &y) const;} + {returns the $x$-coordinate of the point at \ccVar\ with + given $y$-coordinate. + \ccPrecond \ccVar\ is not horizontal.} + +\ccMethod{R::FT y_at_x(const R::FT &x) const;} + {returns the $y$-coordinate of the point at \ccVar\ with + given $x$-coordinate. + \ccPrecond \ccVar\ is not vertical.} + +\ccHeading{Predicates} + +\ccMethod{bool is_degenerate() const;} + {line \ccVar\ is degenerate, if the coefficients \ccStyle{a} and + \ccStyle{b} of the line equation are zero.} + +\ccMethod{bool is_horizontal() const;} + {} +\ccGlue +\ccMethod{bool is_vertical() const;} + {} + +\ccMethod{Oriented_side oriented_side(const Point_2 &p) const;} + {returns \ccStyle{ON_ORIENTED_BOUNDARY}, + \ccStyle{ON_NEGATIVE_SIDE}, or the constant + \ccStyle{ON_POSITIVE_SIDE}, + depending on the position of $p$ relative to the oriented line \ccVar. + } + + +For convenience we provide the following boolean functions: + +\ccMethod{bool has_on(const Point_2 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_boundary(const Point_2 &p) const;} + {returns \ccStyle{has_on()}.} +\ccGlue +\ccMethod{bool has_on_positive_side(const Point_2 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_negative_side(const Point_2 &p) const;} + {} + +\ccHeading{Miscellaneous} + +\ccMethod{Direction_2 direction() const;} + {returns the direction of \ccVar.} + +\ccMethod{Line_2 opposite() const;} + {returns the line with opposite direction.} + +\ccMethod{Line_2 perpendicular(const Point_2 &p) const;} + {returns the line perpendicular to \ccVar\ and passing through $p$, + where the direction is the direction of \ccVar\ rotated + counterclockwise by 90 degrees.} + +\ccMethod{Line_2 transform(const Aff_transformation_2 &t) const;} + {returns the line obtained by applying $t$ on a point on \ccVar\ + and the direction of \ccVar.} + + +%\ccImplementation +%Lines are implemented as a line equation. +%Construction from points or a point and a direction, might lead to +%loss of precision if the number type is not exact. + +\ccExample +Let us first define two Cartesian two-dimensional points in the Euclidean +plane $\E^2$. Their +dimension and the fact that they are Cartesian is expressed by +the suffix \ccStyle{_2} and the representation type \ccStyle{Cartesian}. + +\begin{cprog} + + Point_2< Cartesian > p(1.0,1.0), q(4.0,7.0); +\end{cprog} + +To define a line $l$ we write: + +\begin{cprog} + + Line_2< Cartesian > l(p,q); +\end{cprog} + + +\end{ccRefClass} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Line_3.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Line_3.tex new file mode 100644 index 00000000000..b95ee47b793 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Line_3.tex @@ -0,0 +1,77 @@ +\begin{ccRefClass} {Line_3} +\ccInclude{CGAL/Line_3.h} + +\ccDefinition +An object \ccStyle{l} of the data type \ccRefName\ is a directed +straight line in the three-dimensional Euclidean space $\E^3$. + +\ccCreation +\ccCreationVariable{l} + +\ccHidden \ccConstructor{Line_3();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Line_3(const Line_3 &h);} + {copy constructor.} + +\ccConstructor{Line_3(const Point_3 &p, const Point_3 &q);} + {introduces a line \ccVar\ passing through the points $p$ and $q$. + Line \ccVar\ is directed from $p$ to $q$.} + + +\ccConstructor{Line_3(const Point_3 &p, const Direction_3&d)} + {introduces a line \ccVar\ passing through point $p$ with + direction $d$.} + +\ccConstructor{Line_3(const Segment_3 &s);} + {returns the line supporting the segment $s$, + oriented from source to target.} + +\ccConstructor{Line_3(const Ray_3 &r);} + {returns the line supporting the ray $r$, with the + same orientation.} + +\ccOperations +\ccSetThreeColumns{Direction_3 }{}{\hspace*{8.5cm}} + +\ccHidden \ccMethod{Line_3 & operator=(const Line_3 &h);} + {Assignment.} + +\ccMethod{bool operator==(const Line_3 &h) const;} + {Test for equality: two lines are equal, iff they have a non + empty \ccHtmlNoLinksFrom{intersection} and the same direction.} + +\ccMethod{bool operator!=(const Line_3 &h) const;} + {Test for inequality.} + +\ccMethod{Point_3 projection(const Point_3 &p) const;} + {returns the orthogonal \ccHtmlNoLinksFrom{projection} of $p$ on \ccVar.} + +\ccMethod{Point_3 point(int i) const;} + {returns an arbitrary point on \ccVar. It holds + \ccStyle{point(i) = point(j)}, iff \ccStyle{i=j}.} + +\ccPredicates + +\ccMethod{bool is_degenerate() const;} + {returns \ccc{true} iff line \ccVar\ is degenerated to a point.} + +\ccMethod{bool has_on(const Point_3 &p) const;} + {returns \ccc{true} iff \ccc{p} lies on \ccVar.} + +\ccHeading{Miscellaneous} + +\ccMethod{Plane_3 perpendicular_plane(const Point_3 &p) const;} + {returns the plane perpendicular to \ccVar\ passing through $p$.} + +\ccMethod{Line_3 opposite() const;} + {returns the line with opposite direction.} + +\ccMethod{Direction_3 direction() const;} + {returns the direction of \ccVar.} + +\ccMethod{Line_3 transform(const Aff_transformation_3 &t) const;} + {returns the line obtained by applying $t$ on a point on \ccVar\ + and the direction of \ccVar.} + +\end{ccRefClass} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Null_vector.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Null_vector.tex new file mode 100644 index 00000000000..76d83e368a3 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Null_vector.tex @@ -0,0 +1,13 @@ +\begin{ccRefClass}{Null_vector} +\ccInclude{Origin.h} + +\ccDefinition +\cgal\ defines a symbolic constant +\ccStyle{NULL_VECTOR} to construct zero length vectors. +\ccRefName\ is the type of this constant. + +\ccSeeAlso +\ccc{Vector_2}, \ccc{Vector_3}, \ccc{Kernel::Construct_vector_2}, +\ccc{Kernel::Construct_vector_3} + +\end{ccRefClass} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Object.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Object.tex new file mode 100644 index 00000000000..77a0609ced2 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Object.tex @@ -0,0 +1,106 @@ + +\begin{ccRefClass}{Object} + +\ccInclude{CGAL/Object.h} +%\ccInclude{CGAL/basic.h} + + +\ccDefinition +Some functions can return different types of objects. A typical +\CC\ solution to this problem is to derive all possible return +types from a common base class, to return a pointer to this +class and to perform a dynamic cast on this pointer. The class +\ccRefName\ provides an abstraction. +An object \ccStyle{obj} of the class \ccRefName\ can +represent an arbitrary class. The only operations it provides is +to make copies and assignments, so that you can put them in lists +or arrays. Note that \ccRefName\ is NOT a common base class for the +elementary classes. Therefore, there is no +automatic conversion from these classes to \ccRefName. Rather +this is done with the global function \ccc{make_object}. This +encapsulation mechanism requires the use of \ccc{assign} to use +the functionality of the encapsulated class. + +\ccCreation +\ccCreationVariable{obj} + +\ccConstructor{Object();} + {introduces an uninitialized variable.} + +\ccConstructor{Object(const Object &o);} + {Copy constructor.} + +Objects of type \ccRefName\ are normally created via the global function +\ccc{make_object}. + +\ccOperations + +\ccMethod{Object &operator=(const Object &o);} + {Assignment.} + +Assignment of an object of type \ccRefName\ to an object of type \ccc{T} +is done using \ccc{assign}. + +There is also a member function to check whether an object of type \ccRefName\ +contains an object. + +\ccMethod{bool is_empty();}{returns true, if \ccc{object} does not + contain an object.} + +\ccExample +In the following example, the object class is used as return value for the +\ccHtmlNoLinksFrom{intersection} computation, as there are possibly different return values. + +\begin{cprog} +{ + Point_2< Cartesian > point; + Segment_2< Cartesian > segment, segment_1, segment_2; + + std::cin >> segment_1 >> segment_2; + + Object obj = intersection(segment_1, segment_2); + + if (assign(point, obj)) { + /* do something with point */ + } else if ((assign(segment, obj)) { + /* do something with segment*/ + } +\end{cprog} +\ccHtmlLinksOff% +\begin{cprog} + /* there was no intersection */ +} +\end{cprog} +\ccHtmlLinksOn% + +\medskip +The \ccHtmlNoLinksFrom{intersection} routine itself looks roughly as follows: + +\begin{cprog} + +template < class R > +Object intersection(Segment_2 s1, Segment_2 s2) +{ +\end{cprog} +\ccHtmlLinksOff% +\begin{cprog} + if (/* intersection in a point */ ) { +\end{cprog} +\ccHtmlLinksOn% +\begin{cprog} + Point_2 p = ... ; + return make_object(p); +\end{cprog} +\ccHtmlLinksOff% +\begin{cprog} + } else if (/* intersection in a segment */ ) { +\end{cprog} +\ccHtmlLinksOn% +\begin{cprog} + Segment_2 s = ... ; + return make_object(s); + } + return Object(); +} +\end{cprog} +\end{ccRefClass} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Oriented_side.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Oriented_side.tex new file mode 100644 index 00000000000..a1c21ca6d93 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Oriented_side.tex @@ -0,0 +1,17 @@ +\begin{ccRefEnum}{Oriented_side} +\ccInclude{CGAL/enum.h} + +\ccGlobalEnum{enum Oriented_side {ON_NEGATIVE_SIDE, ON_ORIENTED_BOUNDARY, ON_POSITIVE_SIDE };} +\ccRefLabel{ON_NEGATIVE_SIDE} +\ccRefLabel{ON_POSITIVE_SIDE} +\ccRefLabel{ON_ORIENTED_BOUNDARY} +\ccHtmlCrossLink{ON_NEGATIVE_SIDE} +\ccHtmlCrossLink{ON_POSITIVE_SIDE} +\ccHtmlCrossLink{ON_ORIENTED_BOUNDARY} +\ccHtmlIndexC[enum_tags]{ON_NEGATIVE_SIDE} +\ccHtmlIndexC[enum_tags]{ON_POSITIVE_SIDE} +\ccHtmlIndexC[enum_tags]{ON_ORIENTED_BOUNDARY} + +\ccSeeAlso +\ccc{Kernel::Oriented_side_2}, \ccc{Kernel::Oriented_side_3} +\end{ccRefEnum} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Origin.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Origin.tex new file mode 100644 index 00000000000..b79fd054467 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Origin.tex @@ -0,0 +1,14 @@ +\begin{ccRefClass}{Origin} +\ccInclude{Origin.h} + +\ccDefinition +\cgal\ defines a symbolic constant +\ccStyle{ORIGIN} which denotes the point at the origin. +\ccRefName\ is the type of this constant. +It is used in the conversion between points and vectors. + +\ccSeeAlso +\ccc{Point_2}, \ccc{Point_3}, +\ccc{Vector_2}, \ccc{Vector_3}, +\ccc{operator+}, \ccc{operator-} +\end{ccRefClass} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Plane_3.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Plane_3.tex new file mode 100644 index 00000000000..25027c43356 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Plane_3.tex @@ -0,0 +1,184 @@ +\begin{ccRefClass} {Plane_3} +\ccInclude{CGAL/Plane_3.h} + +\ccDefinition +An object \ccStyle{h} of the data type \ccRefName\ is an oriented +plane in the three-dimensional Euclidean space $\E^3$. It is defined +by the set of points with coordinates Cartesian $(x,y,z)$ that satisfy +the plane equation + +\begin{ccTexOnly} +\[h :\; a\, x +b\, y +c\, z + d = 0.\] +\end{ccTexOnly} +\begin{ccHtmlOnly} +h : a x + b y + c z + d = 0 +\end{ccHtmlOnly} + +The plane splits $\E^3$ in a {\em positive} and a {\em negative +side}. +A point $p$ with Cartesian coordinates $(px, py, pz)$ is on the positive side of +\ccStyle{h}, iff \ccTexHtml{$a\, px +b\, py +c\, pz + d > 0$}{a px + b py +c pz + d > 0}, it is on the +negative side, iff \ccTexHtml{$a\, px +b\, py\, +c\, pz + d < 0$}{a px + b py +c pz + d < 0}. + + + +\ccCreation +\ccCreationVariable{h} + + +\ccHidden \ccConstructor{Plane_3();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Plane_3(const Plane_3 &h);} + {copy constructor.} + +\ccConstructor{Plane_3(const R::RT &a, + const R::RT &b, + const R::RT &c, + const R::RT &d)} +{creates a plane \ccVar\ defined by the equation + \ccTexHtml{$a\, px +b\, py +c\, pz + d = 0$}{a px + b py + c pz + d = 0}. +Notice that \ccVar\ is degenerate if \ccTexHtml{$a = b = c$}{a = b = c}.} + +\ccConstructor{Plane_3(const Point_3 &p, + const Point_3 &q, + const Point_3 &r);} +{creates a plane \ccVar\ passing through the points \ccStyle{p}, + \ccStyle{q} and \ccStyle{r}. The plane is oriented such that \ccStyle{p}, + \ccStyle{q} and \ccStyle{r} are oriented in a positive sense + (that is counterclockwise) when seen from the positive side of \ccVar. +Notice that \ccVar\ is degenerate if the points are collinear.} + + +\ccConstructor{Plane_3(const Point_3 &p, + const Direction_3&d)} +{introduces a plane \ccVar\ that passes through point \ccStyle{p} and + that has as an orthogonal direction equal to \ccStyle{d}.} + +\ccConstructor{Plane_3(const Line_3 &l, + const Point_3 &p)} +{introduces a plane \ccVar\ that is defined through the three points + \ccStyle{l.point(0)}, \ccStyle{l.point(1)} and \ccStyle{p}.} + +\ccConstructor{Plane_3(const Ray_3 &r, + const Point_3 &p)} +{introduces a plane \ccVar\ that is defined through the three points + \ccStyle{r.point(0)}, \ccStyle{r.point(1)} and \ccStyle{p}.} + +\ccConstructor{Plane_3(const Segment_3 &s, + const Point_3 &p)} +{introduces a plane \ccVar\ that is defined through the three points + \ccStyle{s.source()}, \ccStyle{s.target()} and \ccStyle{p}.} + +\ccOperations +\ccHidden \ccMethod{Plane_3 & operator=(const Plane_3 &h);} + {Assignment.} + +\ccMethod{bool operator==(const Plane_3 &h2) const;} + {Test for equality: two planes are equal, iff they have a non + empty intersection and the same orientation.} + +\ccMethod{bool operator!=(const Plane_3 &h2) const;} + {Test for inequality.} + +\ccMethod{R::RT a() const;} + {returns the first coefficient of \ccVar.} +\ccGlue +\ccMethod{R::RT b() const;} + {returns the second coefficient of \ccVar.} +\ccGlue +\ccMethod{R::RT c() const;} + {returns the third coefficient of \ccVar.} +\ccGlue +\ccMethod{R::RT d() const;} + {returns the fourth coefficient of \ccVar.} + +\ccMethod{Line_3 perpendicular_line(const Point_3 &p) const;} + {returns the line that is perpendicular to \ccVar\ and that + passes through point \ccStyle{p}. The line is oriented from + the negative to the positive side of \ccVar.} + +\ccMethod{Point_3 projection(const Point_3 &p) const;} + {returns the orthogonal projection of $p$ on \ccVar.} + +\ccMethod{Plane_3 opposite() const;} + {returns the plane with opposite orientation.} + +\ccMethod{Point_3 point() const;} + {returns an arbitrary point on \ccVar.} + +\ccMethod{Vector_3 orthogonal_vector() const;} + {returns a vector that is orthogonal to \ccVar\ and that + is directed to the positive side of \ccVar.} + +\ccMethod{Direction_3 orthogonal_direction() const;} + {returns the direction that is orthogonal to \ccVar\ and that + is directed to the positive side of \ccVar.} + +\ccMethod{Vector_3 base1() const;} + {returns a vector orthogonal to + \ccStyle{orthogonal_vector()}.} + +\ccMethod{Vector_3 base2() const;} + {returns a vector that is both orthogonal to \ccStyle{base1()}, + and to \ccStyle{orthogonal_vector()}, and such that the result of + \ccStyle{orientation( point(), point() + base1(), + point()+base2(), point() + orthogonal_vector() )} is positive.} + +\ccHeading{2D Conversion} + +The following functions provide conversion between a plane and +\cgal's two-dimensional space. The transformation is affine, but +not necessarily an isometry. This means, the transformation preserves +combinatorics, but not distances. + +\ccMethod{Point_2 to_2d(const Point_3 &p) const;} + {returns the image point of the projection of \ccStyle{p} + under an affine transformation, which maps \ccVar\ onto the + $xy$-plane, with the $z$-coordinate removed.} + +\ccMethod{Point_3 to_3d(const Point_2 &p) const;} + {returns a point $q$, such that \ccStyle{to_2d( to_3d( p ))} + is equal to \ccStyle{p}.} + + +\ccMethod{Oriented_side oriented_side(const Point_3 &p) const;} + {returns either \ccStyle{ON_ORIENTED_BOUNDARY}, or + the constant \ccStyle{ON_POSITIVE_SIDE}, or the con\-stant + \ccStyle{ON_NEGATIVE_SIDE}, + determined by the position of $p$ relative to the oriented plane \ccVar. + } + +\ccPredicates + +For convenience we provide the following boolean functions: + +\ccMethod{bool has_on(const Point_3 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_boundary(const Point_3 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_positive_side(const Point_3 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_negative_side(const Point_3 &p) const;} + {} + +\ccMethod{bool has_on(const Line_3 &l) const;} + {} +\ccGlue +\ccMethod{bool has_on_boundary(const Line_3 &l) const;} + {} + +\ccMethod{bool is_degenerate() const;} + {Plane \ccVar\ is degenerate, if the coefficients \ccStyle{a}, + \ccStyle{b}, and \ccc{c} of the plane equation are zero.} + +\ccHeading{Miscellaneous} + +\ccMethod{Plane_3 transform(const Aff_transformation_3 &t) const;} + {returns the plane obtained by applying $t$ on a point of \ccVar\ + and the orthogonal direction of \ccVar.} + +\end{ccRefClass} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Point_2.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Point_2.tex new file mode 100644 index 00000000000..07257140872 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Point_2.tex @@ -0,0 +1,143 @@ +\begin{ccRefClass} {Point_2} +\ccInclude{CGAL/Point_2.h} + +\ccDefinition +An object of the class \ccRefName\ is a point in the two-dimensional +Euclidean plane $\E^2$. + +Remember that \ccStyle{R::RT} and \ccStyle{R::FT} denote a ring type +and a field type. For the representation class +\ccStyle{Cartesian} the two types are the same. For the +representation class \ccStyle{Homogeneous} the ring type +\ccStyle{R::RT} is equal to \ccStyle{T}, and the field type \ccStyle{R::FT} is +equal to \ccStyle{Quotient}. + +\ccCreation +\ccCreationVariable{p} + + +\ccHidden \ccConstructor{Point_2();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Point_2(const Point_2 &q);} + {copy constructor.} + +\ccConstructor{Point_2(const Origin &ORIGIN);} + {introduces a variable \ccVar\ with \ccHtmlNoLinksFrom{Cartesian} coordinates + $(0,0)$.} + +\ccConstructor{Point_2(const R::RT &hx, const R::RT &hy, const R::RT &hw = R::RT(1));} + {introduces a point \ccVar\ initialized to $(hx/hw,hy/hw)$. + If the third argument is not explicitly given, it defaults + to \ccStyle{R::RT(1)}. + \ccPrecond \ccc{hw} $\neq$ \ccc{R::RT(0)} } + + +\ccOperations +%\ccSetTwoOfThreeColumns{5cm}{4cm} + +\ccHidden \ccMethod{Point_2 & operator=(const Point_2 &q);} + {Assignment.} + +\ccMethod{bool operator==(const Point_2 &q) const;} + {Test for equality. Two points are equal, iff their $x$ and $y$ + coordinates are equal. The point can be compared with + \ccc{ORIGIN}.} + +\ccMethod{bool operator!=(const Point_2 &q) const;} + {Test for inequality. The point can be compared with \ccc{ORIGIN}.} + +There are two sets of coordinate access functions, namely to the +homogeneous and to the \ccHtmlNoLinksFrom{Cartesian} coordinates. They can be used +independently from the chosen representation type \ccStyle{R}. + +\ccMethod{R::RT hx() const;} + {returns the homogeneous $x$ coordinate.} +\ccGlue +\ccMethod{R::RT hy() const;} + {returns the homogeneous $y$ coordinate.} +\ccGlue +\ccMethod{R::RT hw() const;} + {returns the homogenizing coordinate.} + +Here come the \ccHtmlNoLinksFrom{Cartesian} access functions. Note that you do not loose +information with the homogeneous representation, because then the field +type is a quotient. + +\ccMethod{R::FT x() const;} + {returns the \ccHtmlNoLinksFrom{Cartesian} $x$ coordinate, that is $hx/hw$.} +\ccGlue +\ccMethod{R::FT y() const;} + {returns the \ccHtmlNoLinksFrom{Cartesian} $y$ coordinate, that is $hy/hw$.} + + +The following operations are for convenience and for making this +point class compatible with code for higher dimensional points. +Again they come in a \ccHtmlNoLinksFrom{Cartesian} and homogeneous flavor. + +\ccMethod{R::RT homogeneous(int i) const;} + {returns the i'th homogeneous coordinate of \ccVar, starting with 0. + \ccPrecond $0\leq i \leq 2$.} + +\ccMethod{R::FT cartesian(int i) const;} + {returns the i'th \ccHtmlNoLinksFrom{Cartesian} coordinate of \ccVar, starting with 0. + \ccPrecond $0\leq i \leq 1$.} + +\ccMethod{R::FT operator[](int i) const;} + {returns \ccStyle{cartesian(i)}. + \ccPrecond $0\leq i \leq 1$.} + +\ccMethod{int dimension() const;} + {returns the dimension (the constant 2).} + +\ccMethod{Bbox_2 bbox() const;} + {returns a bounding box containing \ccVar. Note that bounding boxes + are not parameterized with whatsoever. } + +\ccMethod{Point_2 transform(const Aff_transformation_2 &t) const;} + {returns the point obtained by applying $t$ on \ccVar.} + + +\ccHeading{Operators} + +The following operations can be applied on points: + +\ccFunction{Vector_2 operator-(const Point_2 &p, + const Point_2 &q);} + {returns the difference vector between \ccStyle{q} and \ccStyle{p}. + You can substitute \ccc{ORIGIN} for either \ccc{p} or \ccc{q}, + but not for both.} + +\ccFunction{Point_2 operator+(const Point_2 &p, + const Vector_2 &v);} + {returns the point obtained by translating \ccStyle{p} by the + vector \ccStyle{v}.} + +\ccFunction{Point_2 operator-(const Point_2 &p, + const Vector_2 &v);} + {returns the point obtained by translating \ccStyle{p} by the + vector -\ccStyle{v}.} + +\ccExample + +The following declaration creates two points with \ccHtmlNoLinksFrom{Cartesian} double coordinates. + +\begin{cprog} + + Point_2< Cartesian > p, q(1.0, 2.0); +\end{cprog} + +The variable {\tt p} is uninitialized and should first be used on +the left hand side of an assignment. +\begin{cprog} + + p = q; + + std::cout << p.x() << " " << p.y() << std::endl; +\end{cprog} + +\ccSeeAlso + +\ccc{Point_3}, \ccc{Point_d}, \ccc{Vector_2}, \ccc{ORIGIN}, \ccc{operator+}, \ccc{operator-} + +\end{ccRefClass} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Point_3.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Point_3.tex new file mode 100644 index 00000000000..f4560b0655e --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Point_3.tex @@ -0,0 +1,139 @@ +\begin{ccRefClass} {Point_3} +\ccInclude{CGAL/Point_3.h} + +\ccDefinition +An object of the class \ccRefName\ is a point in the three-dimensional +Euclidean space $\E^3$. +%% +%% \cgal\ defines a symbolic constant +%% \ccStyle{ORIGIN} which denotes the point at the origin. It can be used +%% wherever a point can be used, with the only exception that you can not +%% access its dimension as it is dimensionless. +%% + +Remember that \ccStyle{R::RT} and \ccStyle{R::FT} denote a ring type +and a field type. +For the representation class \ccStyle{Cartesian}, the two types are +equivalent. +However, for the representation class \ccStyle{Homogeneous} the ring +type is \ccStyle{R::RT} is equal to \ccStyle{T} and the field type is +\ccStyle{R::FT} is equal to \ccStyle{Quotient}. + + +\ccCreation +\ccCreationVariable{p} + + +\ccHidden \ccConstructor{Point_3();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Point_3(const Point_3 &q);} + {copy constructor.} + +\ccConstructor{Point_3(const Origin &ORIGIN);} + {introduces a point with \ccHtmlNoLinks{Cartesian} coordinates$(0,0,0)$.} + +\ccConstructor{Point_3(const R::RT &hx, const R::RT &hy, const R::RT &hz, const R::RT &hw = R::RT(1));} + {introduces a point \ccVar\ initialized to $(hx/hw,hy/hw, hz/hw)$. + If the third argument is not explicitly given it defaults + to \ccStyle{R::RT(1)}. + \ccPrecond \ccc{hw} $\neq$ \ccc{Kernel::RT(0)}.} + + +\ccOperations +%\ccSetTwoOfThreeColumns{5cm}{4cm} + +\ccHidden \ccMethod{Point_3 & operator=(const Point_3 &q);} + {Assignment.} + +\ccMethod{bool operator==(const Point_3 &q) const;} + {Test for equality: Two points are equal, iff their $x$, $y$ and $z$ + coordinates are equal.} + +\ccMethod{bool operator!=(const Point_3 &q) const;} + {Test for inequality.} + + + +There are two sets of coordinate access functions, namely to the +homogeneous and to the \ccHtmlNoLinks{Cartesian} coordinates. They can be used +independently from the chosen representation type \ccStyle{R}. + +\ccMethod{R::RT hx() const;} + {returns the homogeneous $x$ coordinate.} +\ccGlue +\ccMethod{R::RT hy() const;} + {returns the homogeneous $y$ coordinate.} +\ccGlue +\ccMethod{R::RT hz() const;} + {returns the homogeneous $z$ coordinate.} +\ccGlue +\ccMethod{R::RT hw() const;} + {returns the homogenizing coordinate.} + +Here come the \ccHtmlNoLinks{Cartesian} access functions. Note that you do not loose +information with the homogeneous representation, because then the field +type is a quotient. + +\ccMethod{R::FT x() const;} + {returns the \ccHtmlNoLinks{Cartesian} $x$ coordinate, that is $hx/hw$.} +\ccGlue +\ccMethod{R::FT y() const;} + {returns the \ccHtmlNoLinks{Cartesian} $y$ coordinate, that is $hy/hw$.} +\ccGlue +\ccMethod{R::FT z() const;} + {returns the \ccHtmlNoLinks{Cartesian} $z$ coordinate, that is $hz/hw$.} + + +The following operations are for convenience and for making this +point class compatible with code for higher dimensional points. +Again they come in a \ccHtmlNoLinks{Cartesian} and homogeneous flavor. + +\ccMethod{R::RT homogeneous(int i) const;} + {returns the i'th homogeneous coordinate of \ccVar, starting with 0. + \ccPrecond $0\leq i \leq 3$.} + +\ccMethod{R::FT cartesian(int i) const;} + {returns the i'th \ccHtmlNoLinks{Cartesian} coordinate of \ccVar, starting with 0. + \ccPrecond $0\leq i \leq 2$.} + +\ccMethod{R::FT operator[](int i) const;} + {returns \ccStyle{cartesian(i)}. + \ccPrecond $0\leq i \leq 2$.} + +\ccMethod{int dimension() const;} + {returns the dimension (the constant 3).} + +\ccMethod{Bbox_3 bbox() const;} + {returns a bounding box containing \ccVar.} + +\ccMethod{Point_3 transform(const Aff_transformation_3 &t) const;} + {returns the point obtained by applying $t$ on \ccVar.} + +\ccHeading{Operators} + +The following operations can be applied on points: + +\ccFunction{Vector_3 operator-(const Point_3 &p, + const Point_3 &q);} + {returns the difference vector between \ccStyle{q} and \ccStyle{p}. + You can substitute \ccc{ORIGIN} for either \ccc{p} or \ccc{q} + ,but not for both.} + +\ccFunction{Point_3 operator+(const Point_3 &p, + const Vector_3 &v);} + {returns the point obtained by translating \ccStyle{p} by the + vector \ccStyle{v}.} + +\ccFunction{Point_3 operator-(const Point_3 &p, + const Vector_3 &v);} + {returns the point obtained by translating \ccStyle{p} by the + vector -\ccStyle{v}.} + +\ccSeeAlso + +\ccc{Point_2}, \ccc{Point_d}, \ccc{Vector_3}, \ccc{ORIGIN}, \ccc{operator+}, \ccc{operator-} + + +\end{ccRefClass} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Point_d.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Point_d.tex new file mode 100644 index 00000000000..c18707cca6b --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Point_d.tex @@ -0,0 +1,60 @@ +\begin{ccRefClass}{Point_d} +\ccInclude{CGAL/Point_d.h} + +\ccDefinition + +An object of the class \ccClassTemplateName\ is a point in $d$-dimensional +Euclidean space $E_d$, where $d$ is arbitrary. + + +% ----------------------------------------------------------------------------- +\ccCreation +\ccCreationVariable{p} + +A \ccClassTemplateName\ object can be created from an iterator range. + +\ccConstructor{ template + Point_d (int dim, + InputIterator first, + InputIterator last);} + {if the range \ccc{[first,last)} contains \ccc{dim} elements, + this creates a point with Cartesian coordinates as specified by + the range. If \ccc{[first,last)} contains \ccc{dim+1} elements, + the range specifies the homogeneous coordinates of \ccVar. + \ccPrecond \ccc{dim} is nonnegative, \ccc{[first,last)} has + \ccc{dim} or \ccc{dim+1} elements, and the value types of first + and last are \ccc{R::RT}.} + +\emph{Note}: in case your compiler does not support member templates, \cgal\ +provides the following specialized constructor. + +\ccConstructor {Point_d (int dim, const R::RT* first, + const R::RT* last);}{} + +% ----------------------------------------------------------------------------- +\ccOperations + +\ccMemberFunction{ bool operator == (const Point_d& q) const;} + {Equality test. Two points are equal if they have the same + dimension and agree in all coordinates.} + +\ccMemberFunction{ bool operator != (const Point_d& q) const;} + {Test for inequality.} + +\ccMemberFunction{ R::RT homogeneous( int i) const;} + {returns the i'th homogeneous coordinate of \ccVar, starting + with 0. \ccPrecond $0\leq i\leq \ccc{d}$.} + +\ccMemberFunction{ R::FT cartesian( int i) const;} + {returns the i'th Cartesian coordinate of \ccVar, starting + with 0. \ccPrecond $0\leq i < \ccc{d}$.} + +\ccMemberFunction{ R::FT operator [] (int i) const;} + {returns the i'th Cartesian coordinate of \ccVar, starting + with 0. \ccPrecond $0\leq i < \ccc{d}$.} + +\ccMemberFunction{ int dimension () const;} + {returns the dimension \ccc{d} of \ccVar.} + +% ----------------------------------------------------------------------------- +\end{ccRefClass}% diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Ray_2.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Ray_2.tex new file mode 100644 index 00000000000..2cc1c412f01 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Ray_2.tex @@ -0,0 +1,84 @@ +\begin{ccRefClass}{Ray_2} +\ccInclude{CGAL/Ray_2.h} + +\ccDefinition +An object \ccStyle{r} of the data type \ccRefName\ is a directed +straight ray in the two-dimensional Euclidean plane $\E^2$. It starts +in a point called the {\em source} of \ccStyle{r} and goes to infinity. + +\ccCreation +\ccCreationVariable{r} + + +\ccHidden \ccConstructor{Ray_2();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Ray_2(const Ray_2 &s);} + {copy constructor.} + +\ccConstructor{Ray_2(const Point_2 &p, const Point_2&q);} + {introduces a ray \ccVar\ + with source $p$ and passing through point $q$.} + +\ccConstructor{Ray_2(const Point_2 &p, const Direction_2 &d)} + {introduces a ray \ccVar\ starting at source $p$ with + direction $d$.} + +\ccOperations + +\ccHidden \ccMethod{Ray_2 &operator=(const Ray_2 &s);} + {Assignment.} + +\ccMethod{bool operator==(const Ray_2 &h) const;} + {Test for equality: two rays are equal, iff they have the same + source and the same direction.} + +\ccMethod{bool operator!=(const Ray_2 &h) const;} + {Test for inequality.} + +\ccMethod{Point_2 source() const;} + {returns the source of \ccVar.} + +\ccMethod{Point_2 point(int i) const;} + {returns a point on \ccVar. \ccStyle{point(0)} is the source, + \ccStyle{point(i)}, with $i>0$, is different from the + source. \ccPrecond $i \geq 0$.} + +\ccMethod{Direction_2 direction() const;} + {returns the direction of \ccVar.} + +\ccMethod{Line_2 supporting_line() const;} + {returns the line supporting \ccVar\ which has the same direction.} + +\ccMethod{Ray_2 opposite() const;} + {returns the ray with the same source and the opposite direction.} + +\ccPredicates + +\ccMethod{bool is_degenerate() const;} + {ray \ccVar\ is degenerate, if the source and the second defining + point fall together (that is if the direction is degenerate).} + +\ccMethod{bool is_horizontal() const;} + {} +\ccGlue +\ccMethod{bool is_vertical() const;} + {} + +\ccMethod{bool has_on(const Point_2 &p) const;} + {A point is on \ccVar, iff it is equal to the source + of \ccVar, or if it is in the interior of \ccVar.} + +\ccMethod{bool collinear_has_on(const Point_2 &p) const;} + {checks if point $p$ is on \ccVar. This function is faster + than function \ccStyle{has_on()} if the precondition + checking is disabled. + \ccPrecond{$p$ is on the supporting line of \ccVar.}} + +\ccHeading{Miscellaneous} + +\ccMethod{Ray_2 transform(const Aff_transformation_2 &t) const;} + {returns the ray obtained by applying $t$ on the source + and on the direction of \ccVar.} + +\end{ccRefClass} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Ray_3.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Ray_3.tex new file mode 100644 index 00000000000..8b83021e904 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Ray_3.tex @@ -0,0 +1,77 @@ +\begin{ccRefClass} {Ray_3} +\ccInclude{CGAL/Ray_3.h} + +\ccDefinition +An object \ccStyle{r} of the data type \ccRefName\ is a directed +straight ray in the three-dimensional Euclidean space $\E^3$. It starts +in a point called the {\em source} of \ccStyle{r} and it goes to infinity. + + +\ccCreation +\ccCreationVariable{r} + + +\ccHidden \ccConstructor{Ray_3();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Ray_3(const Ray_3 &s);} + {copy constructor.} + +\ccConstructor{Ray_3(const Point_3 &p, const Point_3 &q);} + {introduces a ray \ccVar\ + with source $p$ and passing through point $q$.} + +\ccConstructor{Ray_3(const Point_3 &p, const Direction_3 &d)} + {introduces a ray \ccVar\ with source $p$ and with + direction $d$.} + +\ccOperations + +\ccHidden \ccMethod{Ray_3 &operator=(const Ray_3 &s);} + {Assignment.} + +\ccMethod{bool operator==(const Ray_3 &h) const;} + {Test for equality: two rays are equal, iff they have the same + source and the same direction.} + +\ccMethod{bool operator!=(const Ray_3 &h) const;} + {Test for inequality.} + + + +\ccMethod{Point_3 source() const;} + {returns the source of \ccVar} + +\ccMethod{Point_3 point(int i) const;} + {returns a point on \ccVar. \ccStyle{point(0)} is the source. + \ccStyle{point(i)}, with $i>0$, is different from the + source. \ccPrecond $i \geq 0$.} + +\ccMethod{Direction_3 direction() const;} + {returns the direction of \ccVar.} + +\ccMethod{Line_3 supporting_line() const;} + {returns the line supporting \ccVar\ which has the same direction.} + +\ccMethod{Ray_3 opposite() const;} + {returns the ray with the same source and the opposite direction.} + +\ccMethod{bool is_degenerate() const;} + {ray \ccVar\ is degenerate, if the source and the second defining + point fall together (that is if the direction is degenerate).} + + +\ccMethod{bool has_on(const Point_3 &p) const;} + {A point is on \ccVar, iff it is equal to the source + of \ccVar, or if it is in the interior of \ccVar.} +% +% \ccMethod{bool collinear_has_on(const Point_3 &p) const;} +% {checks if point $p$ is on ray \ccVar. This function is faster +% than function \ccStyle{has_on()}. +% \ccPrecond{$p$ is collinear to \ccVar.}} +% +\ccMethod{Ray_3 transform(const Aff_transformation_3 &t) const;} + {returns the ray obtained by applying $t$ on the source + and on the direction of \ccVar.} + +\end{ccRefClass} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Reflection.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Reflection.tex new file mode 100644 index 00000000000..dcebce6c242 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Reflection.tex @@ -0,0 +1,10 @@ +\begin{ccRefClass}{Reflection} +\ccInclude{CGAL/aff_transformation_tags.h} + +\ccDefinition +Tag class for affine transformations. + +\ccSeeAlso +\ccc{Aff_transformation_2}, +\ccc{Aff_transformation_3} +\end{ccRefClass} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/RingNumberType.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/RingNumberType.tex new file mode 100644 index 00000000000..2f5e447725e --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/RingNumberType.tex @@ -0,0 +1,12 @@ +\begin{ccRefConcept}{RingNumberType} + +A number type representing ring elements, i.e., must be closed under +operations $+$, $-$, and $*$. A division operation is required only +for those cases where the remainder is zero. + +\ccRefines +\ccc{CopyConstructable}, \ccc{Assignable} + +\ccSeeAlso +\ccc{Kernel}, \ccc{R} +\end{ccRefConcept} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Rotation.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Rotation.tex new file mode 100644 index 00000000000..c1671c30c19 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Rotation.tex @@ -0,0 +1,10 @@ +\begin{ccRefClass}{Rotation} +\ccInclude{CGAL/aff_transformation_tags.h} + +\ccDefinition +Tag class for affine transformations. + +\ccSeeAlso +\ccc{Aff_transformation_2}, +\ccc{Aff_transformation_3} +\end{ccRefClass} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Scaling.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Scaling.tex new file mode 100644 index 00000000000..d5d3f485523 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Scaling.tex @@ -0,0 +1,10 @@ +\begin{ccRefClass}{Scaling} +\ccInclude{CGAL/aff_transformation_tags.h} + +\ccDefinition +Tag class for affine transformations. + +\ccSeeAlso +\ccc{Aff_transformation_2}, +\ccc{Aff_transformation_3} +\end{ccRefClass} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Segment_2.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Segment_2.tex new file mode 100644 index 00000000000..7a544791ea6 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Segment_2.tex @@ -0,0 +1,116 @@ +\begin{ccRefClass} {Segment_2} +\ccInclude{CGAL/Segment_2.h} + + +\ccDefinition An object $s$ of the data type \ccRefName\ is a directed +straight line segment in the two-dimensional Euclidean plane $\E^2$, i.e.\ a +straight line segment $[p,q]$ connecting two points $p,q$ +\ccTexHtml{$\in$}{in} +$\R^2$. The segment is topologically closed, i.e.\ the end +points belong to it. Point $p$ is called the {\em source} and $q$ +is called the {\em target} of $s$. The length of $s$ is the +Euclidean distance between $p$ and $q$. Note that there is only a function +to compute the square of the length, because otherwise we had to +perform a square root operation which is not defined for all +number types, is expensive, and may be inexact. + +\ccCreation +\ccCreationVariable{s} + + +\ccHidden \ccConstructor{Segment_2();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Segment_2(const Segment_2 &q);} + {copy constructor.} + +\ccConstructor{Segment_2(const Point_2 &p, const Point_2 &q);} + {introduces a segment \ccVar\ with source $p$ + and target $q$. The segment is directed from the source towards + the target.} + + +\ccOperations +%\ccSetTwoOfThreeColumns{5cm}{4cm} +\ccSetThreeColumns{Direction_2 & }{}{\hspace*{7.5cm}} + +\ccHidden \ccMethod{Segment_2 & operator=(const Segment_2 &q);} + {Assignment.} + +\ccMethod{bool operator==(const Segment_2 &q) const;} + {Test for equality: Two segments are equal, iff their sources and + targets are equal.} + +\ccMethod{bool operator!=(const Segment_2 &q) const;} + {Test for inequality.} + + +\ccMethod{Point_2 source() const;} + {returns the source of \ccVar.} + +\ccMethod{Point_2 target() const;} + {returns the target of \ccVar.} +\ccGlue +\ccMethod{Point_2 min() const;} + {returns the point of \ccVar\ with lexicographically smallest coordinate.} + +\ccMethod{Point_2 max() const;} + {returns the point of \ccVar\ with lexicographically largest coordinate.} + + +\ccMethod{Point_2 vertex(int i) const;} + {returns source or target of \ccVar: \ccStyle{vertex(0)} returns + the source of \ccVar, \ccStyle{vertex(1)} returns the target of \ccVar. + The parameter \ccStyle{i} is taken modulo 2, which gives + easy access to the other vertex. } + +\ccMethod{Point_2 point(int i) const;} + {returns \ccStyle{vertex(i)}.} + +\ccMethod{Point_2 operator[](int i) const;} + {returns \ccStyle{vertex(i)}.} + +\ccMethod{R::FT squared_length() const;} + {returns the squared length of \ccVar. } + +\ccMethod{Direction_2 direction() const;} + {returns the direction from source to target of \ccVar.} + + +\ccMethod{Segment_2 opposite() const; } + {returns a segment with source and target point interchanged.} + +\ccMethod{Line_2 supporting_line() const;} + {returns the line $l$ passing through \ccVar. Line $l$ has the + same orientation as segment \ccVar.} + +\ccPredicates + +\ccMethod{bool is_degenerate() const;} + {segment \ccVar\ is degenerate, if source and target are equal.} + +\ccMethod{bool is_horizontal() const;} + {} +\ccGlue +\ccMethod{bool is_vertical() const;} + {} + +\ccMethod{bool has_on(const Point_2 &p) const;} + {A point is on \ccVar, iff it is equal to the source or target + of \ccVar, or if it is in the interior of \ccVar.} + +\ccMethod{bool collinear_has_on(const Point_2 &p) const;} + {checks if point $p$ is on segment~\ccVar. This function is faster + than function \ccStyle{has_on()}. + \ccPrecond $p$ is on the supporting line of \ccVar.} + +\ccHeading{Miscellaneous} + +\ccMethod{Bbox_2 bbox() const;} + {returns a bounding box containing~\ccVar.} + +\ccMethod{Segment_2 transform(const Aff_transformation_2 &t) const;} + {returns the segment obtained by applying $t$ on the source + and the target of \ccVar.} + +\end{ccRefClass} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Segment_3.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Segment_3.tex new file mode 100644 index 00000000000..81ac22f02c3 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Segment_3.tex @@ -0,0 +1,104 @@ +\begin{ccRefClass} {Segment_3} +\ccInclude{CGAL/Segment_3.h} + + +\ccDefinition An object $s$ of the data type \ccRefName\ is a directed +straight line segment in the three-dimensional Euclidean space $\E^3$, i.e.\ a +straight line segment $[p,q]$ connecting two points $p,q \in +\R^3$. The segment is topologically closed, i.e.\ the end +points belong to it. Point $p$ is called the {\em source} and $q$ +is called the {\em target} of $s$. The length of $s$ is the +Euclidean distance between $p$ and $q$. Note that there is only a function +to compute the square of the length, because otherwise we had to +perform a square root operation which is not defined for all +number types, is expensive, and may not be exact. + +\ccCreation +\ccCreationVariable{s} + + +\ccHidden \ccConstructor{Segment_3();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Segment_3(const Segment_3 &q);} + {copy constructor.} + +\ccConstructor{Segment_3(const Point_3 &p, const Point_3 &q);} + {introduces a segment \ccVar\ with source $p$ + and target $q$. It is directed from the source towards + the target.} + + +\ccOperations +%\ccSetTwoOfThreeColumns{5cm}{4cm} + +\ccHidden \ccMethod{Segment_3 & operator=(const Segment_3 &q);} + {Assignment.} + +\ccMethod{bool operator==(const Segment_3 &q) const;} + {Test for equality: Two segments are equal, iff their sources and + targets are equal.} + +\ccMethod{bool operator!=(const Segment_3 &q) const;} + {Test for inequality.} + +\ccMethod{Point_3 source() const;} + {returns the source of \ccVar.} +\ccGlue +\ccMethod{Point_3 target() const;} + {returns the target of \ccVar.} + +\ccMethod{Point_3 min() const;} + {returns the point of \ccVar\ with smallest coordinate (lexicographically).} + +\ccMethod{Point_3 max() const;} + {returns the point of \ccVar\ with largest coordinate (lexicographically).} + +\ccMethod{Point_3 vertex(int i) const;} + {returns source or target of \ccVar: \ccStyle{vertex(0)} returns + the source, \ccStyle{vertex(1)} returns the target. + The parameter \ccStyle{i} is taken modulo 2, which gives + easy access to the other vertex.} + +\ccMethod{Point_3 point(int i) const;} + {returns \ccStyle{vertex(i)}.} +\ccGlue +\ccMethod{Point_3 operator[](int i) const;} + {returns \ccStyle{vertex(i)}.} + +\ccMethod{R::FT squared_length() const;} + {returns the squared length of \ccVar. } + +\ccMethod{Direction_3 direction() const;} + {returns the direction from source to target.} + + +\ccMethod{Segment_3 opposite() const; } + {returns a segment with source and target interchanged.} + +\ccMethod{Line_3 supporting_line() const;} + {returns the line $l$ passing through \ccVar. Line $l$ has the + same orientation as segment \ccVar, that is + from the source to the target of \ccVar.} + +\ccMethod{bool is_degenerate() const;} + {segment \ccVar\ is degenerate, if source and target fall together.} + + +\ccMethod{bool has_on(const Point_3 &p) const;} + {A point is on \ccVar, iff it is equal to the source or target + of \ccVar, or if it is in the interior of \ccVar.} +% +% \ccMethod{bool collinear_has_on(const Point_3 &p) const;} +% {checks if point $p$ is on segment~\ccVar. This function is faster +% than function \ccStyle{has_on()}. +% \ccPrecond $p$ is collinear to \ccVar.} +% +\ccMethod{Bbox_3 bbox() const;} + {returns a bounding box containing~\ccVar.} + +\ccMethod{Segment_3 transform(const Aff_transformation_3 &t) const;} + {returns the segment obtained by applying $t$ on the source + and the target of \ccVar.} + +\end{ccRefClass} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Sign.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Sign.tex new file mode 100644 index 00000000000..ff7bb72b49a --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Sign.tex @@ -0,0 +1,17 @@ +\begin{ccRefEnum}{Sign} +\ccInclude{CGAL/enum.h} + +\ccGlobalEnum{enum Sign { NEGATIVE, ZERO, POSITIVE }; } +\ccRefLabel{NEGATIVE} +\ccRefLabel{POSITIVE} +\ccRefLabel{ZERO} +\ccHtmlCrossLink{NEGATIVE} +\ccHtmlCrossLink{POSITIVE} +\ccHtmlCrossLink{ZERO} +\ccHtmlIndexC[enum_tags]{NEGATIVE} +\ccHtmlIndexC[enum_tags]{POSITIVE} +\ccHtmlIndexC[enum_tags]{ZERO} + +\ccSeeAlso +\ccc{Orientation} +\end{ccRefEnum} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Simple_cartesian.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Simple_cartesian.tex new file mode 100644 index 00000000000..026b6109217 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Simple_cartesian.tex @@ -0,0 +1,22 @@ +\begin{ccRefClass}{Simple_cartesian} +\ccInclude{CGAL/Simple_cartesian.h} + +\ccDefinition +A model for a \ccc{Kernel} using Cartesian coordinates to represent the +geometric objects. + +\ccRefines +\ccc{Kernel} + +\ccTypes +\ccTypedef{typedef FieldNumberType FT;}{} +\ccGlue +\ccTypedef{typedef FieldNumberType RT;}{} + +\ccImplementation In contrast to \ccc{Cartesian}, no reference counting +is used internally. This eases debugging, but may slow down algorithms +that copy objects intensively. + +\ccSeeAlso +\ccc{Cartesian}, \ccc{Homogeneous} +\end{ccRefClass} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Sphere_3.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Sphere_3.tex new file mode 100644 index 00000000000..52837701208 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Sphere_3.tex @@ -0,0 +1,175 @@ +\begin{ccRefClass}{Sphere_3} +\ccInclude{CGAL/Sphere_3.h} + +\ccDefinition + +An object of type \ccRefName\ is a sphere in the +three-dimensional Euclidean space $\E^3$. The sphere is oriented, i.e.\ +its boundary has clockwise or counterclockwise orientation. The +boundary splits $\E^3$ into a positive and a negative side, where the +positive side is to the left of the boundary. The boundary further +splits $\E^3$ into a bounded and an unbounded side. Note that the +sphere can be degenerated, i.e.\ the squared radius may be zero. + + +% ----------------------------------------------------------------------------- +\ccCreation +\ccCreationVariable{c} + +\ccHidden +\ccConstructor{ Sphere_3( );}{ + introduces an uninitialized variable \ccVar\ of type + \ccRefName.} + +\ccConstructor{ Sphere_3( Point_3 const& center, + R::FT const& squared_radius, + Orientation const& orientation = COUNTERCLOCKWISE);}{ + introduces a variable \ccVar\ of type \ccRefName. + It is initialized to the sphere with center \ccc{center}, + squared radius \ccc{squared_radius} and orientation + \ccc{orientation}. + \ccPrecond \ccc{orientation} $\neq$ \ccc{COPLANAR}, and furthermore, + \ccc{squared_radius} $\geq$ 0.} + +\ccConstructor{ Sphere_3( Point_3 const& p, + Point_3 const& q, + Point_3 const& r, + Point_3 const& s);}{ + introduces a variable \ccVar\ of type \ccRefName. + It is initialized to the unique sphere which passes through + the points \ccc{p}, \ccc{q}, \ccc{r} and \ccc{s}. The orientation of + the sphere is the orientation of the point quadruple \ccc{p}, + \ccc{q}, \ccc{r}, \ccc{s}. + \ccPrecond \ccc{p}, \ccc{q}, \ccc{r}, and \ccc{s} are not collinear.} + + +\ccConstructor{ Sphere_3( Point_3 const& p, + Point_3 const& q, + Point_3 const& r, + const Orientation& o = COUNTERCLOCKWISE);}{ + introduces a variable \ccVar\ of type \ccRefName. + It is initialized to the smallest sphere which passes through + the points \ccc{p}, \ccc{q}, and \ccc{r}. The orientation of + the sphere is \ccc{o}. \ccPrecond \ccc{o} is not + \ccc{COPLANAR}.} + +\ccConstructor{ Sphere_3( Point_3 const& p, + Point_3 const& q, + const Orientation& o = COUNTERCLOCKWISE);}{ + introduces a variable \ccVar\ of type \ccRefName. + It is initialized to the smallest sphere which passes through + the points \ccc{p} and \ccc{q}. The orientation of + the sphere is \ccc{o}. \ccPrecond \ccc{o} is not + \ccc{COPLANAR}.} + + +\ccConstructor{ Sphere_3( Point_3 const& center, + Orientation const& orientation = COUNTERCLOCKWISE);}{ + introduces a variable \ccVar\ of type \ccRefName. + It is initialized to the sphere with center \ccc{center}, squared + radius zero and orientation \ccc{orientation}. + \ccPrecond \ccc{orientation} $\neq$ \ccc{COPLANAR}. + \ccPostcond \ccVar.\ccc{is_degenerate()} = \ccc{true}.} + +\ccHidden +\ccConstructor{ Sphere_3( Sphere_3 const&);}{ + copy constructor.} + +\ccHidden +\ccMemberFunction{ Sphere_3& operator = ( Sphere_3 const&);}{ + assignment.} + +% ----------------------------------------------------------------------------- +\ccAccessFunctions + +\ccMemberFunction{Point_3 const& center( ) const;}{ + returns the center of \ccVar.} +\ccGlue +\ccMemberFunction{ R::FT const& squared_radius( ) const;}{ + returns the squared radius of \ccVar.} +\ccGlue +\ccMemberFunction{ orientation const& orientation( ) const;}{ + returns the orientation of \ccVar.} + +% ----------------------------------------------------------------------------- + +\ccHidden\ccMemberFunction{ bool operator == ( Sphere_3 const& sphere) const;}{ + returns \ccc{true}, iff \ccVar\ and \ccc{sphere} are equal, + i.e.\ if they have the same center, same squared radius and + same orientation.} + +\ccHidden\ccMemberFunction{ bool operator != ( Sphere_3 const& sphere) const;}{ + returns \ccc{true}, iff \ccVar\ and \ccc{sphere} are not equal.} + +% ----------------------------------------------------------------------------- +\ccPredicates + +\ccMemberFunction{ bool is_degenerate( ) const;}{ + returns \ccc{true}, iff \ccVar\ is degenerate, i.e.\ + if \ccVar\ has squared radius zero.} + +\ccMemberFunction{ Oriented_side + oriented_side( Point_3 const& p) const;}{ + returns either the constant \ccc{ON_ORIENTED_BOUNDARY}, + \ccc{ON_POSITIVE_SIDE}, or \ccc{ON_NEGATIVE_SIDE}, + iff \ccc{p} lies on the boundary, properly on the + positive side, or properly on the negative side + of \ccVar, resp.} + +\ccMemberFunction{ Bounded_side + bounded_side( Point_3 const& p) const;}{ + returns \ccc{ON_BOUNDED_SIDE}, + \ccc{ON_BOUNDARY}, or \ccc{ON_UNBOUNDED_SIDE} + iff \ccc{p} lies properly inside, on the boundary, or properly + outside of \ccVar, resp.} + +%\ccMemberFunction{ bool has_on_positive_side( Point const& p) const;}{ +% returns \ccc{true}, iff \ccc{p} lies properly on the +% positive side of \ccVar.} +% +%\ccMemberFunction{ bool has_on_negative_side( Point const& p) const;}{ +% returns \ccc{true}, iff \ccc{p} lies properly on the +% negative side of \ccVar.} +% +%\ccMemberFunction{ bool has_on_boundary( Point const& p) const;}{ +% returns \ccc{true}, iff \ccc{p} lies on the boundary +% of \ccVar.} +% +%\ccMemberFunction{ bool has_on_bounded_side( Point const& p) const;}{ +% returns \ccc{true}, iff \ccc{p} lies properly inside \ccVar.} +% +%\ccMemberFunction{ bool +% has_on_unbounded_side( Point const& p) const;}{ +% returns \ccc{true}, iff \ccc{p} lies properly outside of \ccVar.} +\ccMethod{bool has_on_positive_side(const Point_3 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_negative_side(const Point_3 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_boundary(const Point_3 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_bounded_side(const Point_3 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_unbounded_side(const Point_3 &p) const;} + {} + +% ----------------------------------------------------------------------------- +\ccHeading{Miscellaneous} + +\ccMemberFunction{ Sphere_3 opposite() const;}{ + returns the sphere with the same center and squared radius as + \ccVar\, but with opposite orientation.} + + +\ccMemberFunction{ Sphere_3 orthogonal_transform( + Aff_transformation_3 const& at) const;}{ + returns the sphere obtained by applying $at$ on \ccVar. + \ccPrecond \ccc{at} is an orthogonal transformation.} + +\ccMemberFunction{ Bbox_3 bbox() const;}{ + returns a bounding box containing \ccVar.} + +\end{ccRefClass} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Tetrahedron_3.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Tetrahedron_3.tex new file mode 100644 index 00000000000..a022ff5a336 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Tetrahedron_3.tex @@ -0,0 +1,102 @@ +\begin{ccRefClass} {Tetrahedron_3} +\ccInclude{CGAL/Tetrahedron_3.h} + + +\ccDefinition An object $t$ of the class \ccRefName\ is an oriented +tetrahedron in the three-dimensional Euclidean space $\E^3$. + +It is defined by four vertices $p_0$, $p_1$, $p_2$ and $p_3$. +The orientation of a tetrahedron is the orientation of its four +vertices. That means it is positive when $p_3$ is on the positive +side of the plane defined by $p_0$, $p_1$ and $p_2$. + +The tetrahedron itself splits the space $\E_3$ in a {\em positive} and +a {\em negative} side. + +The boundary of a tetrahedron splits the space in two open regions, a +bounded one and an unbounded one. + +\ccCreation +\ccCreationVariable{t} + + +\ccHidden \ccConstructor{Tetrahedron_3();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Tetrahedron_3(const Tetrahedron_3 &u);} + {copy constructor.} + + +\ccConstructor{Tetrahedron_3(const Point_3 &p0, + const Point_3 &p1, + const Point_3 &p2, + const Point_3 &p3);} + {introduces a tetrahedron \ccVar\ with vertices $p_0$, $p_1$, $p_2$ and $p_3$.} + + +\ccOperations + +\ccHidden \ccMethod{Tetrahedron_3 & operator=(const Tetrahedron_3 &t2);} + {Assignment.} + +\ccMethod{bool operator==(const Tetrahedron_3 &t2) const;} +% {Test for equality: two tetrahedra are equal, iff there exists a +% cyclic permutation of the vertices of $t2$, such that they are +% equal to the vertices of~\ccVar.} + {Test for equality: two tetrahedra \ccVar\ and \ccc{t2} are equal, + iff \ccVar\ and \ccc{t2} have the same orientation and + their sets (not sequences) of vertices are equal.} + +\ccMethod{bool operator!=(const Tetrahedron_3 &t2) const;} + {Test for inequality.} + +\ccMethod{Point_3 vertex(int i) const;} + {returns the i'th vertex modulo 4 of~\ccVar.} + +\ccMethod{Point_3 operator[](int i) const;} + {returns \ccStyle{vertex(int i)}.} + +\ccPredicates + +\ccMethod{bool is_degenerate() const;} + {Tetrahedron \ccVar\ is degenerate, if the vertices are coplanar.} + + +\ccMethod{Orientation orientation() const;} + { } + +\ccMethod{Oriented_side oriented_side(const Point_3 &p) const;} + {\ccPrecond: \ccVar\ is not degenerate.} + +\ccMethod{Bounded_side bounded_side(const Point_3 &p) const;} + {\ccPrecond: \ccVar\ is not degenerate.} + +For convenience we provide the following boolean functions: + +\ccMethod{bool has_on_positive_side(const Point_3 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_negative_side(const Point_3 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_boundary(const Point_3 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_bounded_side(const Point_3 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_unbounded_side(const Point_3 &p) const;} + {} + +\ccHeading{Miscellaneous} + +\ccMethod{Bbox_3 bbox() const;} + {returns a bounding box containing \ccVar.} + +\ccMethod{Tetrahedron_3 transform(const Aff_transformation_3 &at) const;} + {returns the tetrahedron obtained by applying $at$ on the three + vertices of~\ccVar.} + + + +\end{ccRefClass} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Translation.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Translation.tex new file mode 100644 index 00000000000..023f9db280c --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Translation.tex @@ -0,0 +1,10 @@ +\begin{ccRefClass}{Translation} +\ccInclude{CGAL/aff_transformation_tags.h} + +\ccDefinition +Tag class for affine transformations. + +\ccSeeAlso +\ccc{Aff_transformation_2}, +\ccc{Aff_transformation_3} +\end{ccRefClass} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Triangle_2.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Triangle_2.tex new file mode 100644 index 00000000000..5b585cfb612 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Triangle_2.tex @@ -0,0 +1,106 @@ +\begin{ccRefClass} {Triangle_2} +\ccInclude{CGAL/Triangle_2.h} + +\ccDefinition An object $t$ of the class \ccRefName\ is a triangle +in the two-dimensional Euclidean plane~$\E^2$. +Triangle $t$ is oriented, i.e., its boundary has +clockwise or counterclockwise orientation. We call the side to the left +of the boundary the positive side and the side to the right of the +boundary the negative side. + +As any Jordan curve the boundary of a triangle splits the plane in +two open regions, a bounded one and an unbounded one. + +\ccCreation +\ccCreationVariable{t} + + +\ccHidden \ccConstructor{Triangle_2();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Triangle_2(const Triangle_2 &u);} + {copy constructor.} + + +\ccConstructor{Triangle_2(const Point_2 &p, + const Point_2 &q, + const Point_2 &r);} + {introduces a triangle \ccVar\ with vertices $p$, $q$ and $r$.} + + +\ccOperations + +\ccHidden \ccMethod{Triangle_2 & operator=(const Triangle_2 &t2);} + {Assignment.} + +\ccMethod{bool operator==(const Triangle_2 &t2) const;} + {Test for equality: two triangles are equal, iff there exists a + cyclic permutation of the vertices of $t2$, such that they are + equal to the vertices of \ccVar.} + +\ccMethod{bool operator!=(const Triangle_2 &t2) const;} + {Test for inequality.} + +\ccMethod{Point_2 vertex(int i) const;} + {returns the i'th vertex modulo 3 of~\ccVar.} + +\ccMethod{Point_2 operator[](int i) const;} + {returns \ccStyle{vertex(i)}.} + +\ccPredicates + +\ccMethod{bool is_degenerate() const;} + {triangle \ccVar\ is degenerate, if the vertices are collinear.} + +\ccMethod{Orientation orientation() const;} + {returns the orientation of~\ccVar.} + +\ccMethod{Oriented_side oriented_side(const Point_2 &p) const;} + {returns + \ccStyle{ON_ORIENTED_BOUNDARY}, or + \ccStyle{POSITIVE_SIDE}, + or the constant + \ccStyle{ON_NEGATIVE_SIDE}, + determined by the position of point $p$. + \ccPrecond \ccVar\ is not degenerate.} + +\ccMethod{Bounded_side bounded_side(const Point_2 &p) const;} + {returns the constant \ccStyle{ON_BOUNDARY}, + \ccStyle{ON_BOUNDED_SIDE}, or else + \ccStyle{ON_UNBOUNDED_SIDE}, + depending on where point $p$ is. + \ccPrecond \ccVar\ is not degenerate.} + +For convenience we provide the following boolean functions: + +\ccMethod{bool has_on_positive_side(const Point_2 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_negative_side(const Point_2 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_boundary(const Point_2 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_bounded_side(const Point_2 &p) const;} + {} +\ccGlue +\ccMethod{bool has_on_unbounded_side(const Point_2 &p) const;} + {\ccPrecond \ccVar\ is not degenerate.} + +\ccHeading{Miscellaneous} + +\ccMethod{Triangle_2 opposite();} + {returns a triangle where the boundary is oriented the other + way round (this flips the positive and the negative side, but + not the bounded and unbounded side).} + +\ccMethod{Bbox_2 bbox() const;} + {returns a bounding box containing \ccVar.} + +\ccMethod{Triangle_2 transform(const Aff_transformation_2 &at) const;} + {returns the triangle obtained by applying $at$ on the three + vertices of \ccVar.} + + +\end{ccRefClass} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Triangle_3.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Triangle_3.tex new file mode 100644 index 00000000000..c1a677395c0 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Triangle_3.tex @@ -0,0 +1,63 @@ +\begin{ccRefClass} {Triangle_3} +\ccInclude{CGAL/Triangle_3.h} + +\ccDefinition An object $t$ of the class \ccRefName\ is a triangle in +the three-dimensional Euclidean space $\E^3$. As the triangle is not +a full-dimensional object there is only a test whether a point lies on +the triangle or not. + +\ccCreation +\ccCreationVariable{t} + +\ccHidden \ccConstructor{Triangle_3();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Triangle_3(const Triangle_3 &u);} + {copy constructor.} + +\ccConstructor{Triangle_3(const Point_3 &p, + const Point_3 &q, + const Point_3 &r);} + {introduces a triangle \ccVar\ with vertices $p$, $q$ and $r$.} + +\ccOperations + +\ccHidden \ccMethod{Triangle_3 & operator=(const Triangle_3 &t2);} + {Assignment.} + +\ccMethod{bool operator==(const Triangle_3 &t2) const;} + {Test for equality: two triangles t and $t_2$ are equal, iff there + exists a cyclic permutation of the vertices of $t2$, such that + they are equal to the vertices of~\ccVar.} + +\ccMethod{bool operator!=(const Triangle_3 &t2) const;} + {Test for inequality.} + +\ccMethod{Point_3 vertex(int i) const;} + {returns the i'th vertex modulo 3 of~\ccVar.} + +\ccMethod{Point_3 operator[](int i) const;} + {returns \ccStyle{vertex(int i)}.} + +\ccMethod{Plane_3 supporting_plane();} + {returns the supporting plane of \ccVar, with same + orientation.} + +\ccPredicates + +\ccMethod{bool is_degenerate() const;} + {{\ccVar} is degenerate if its vertices are collinear.} + +\ccMethod{bool has_on(const Point_3 &p) const;} + {A point is on \ccVar, if it is on a vertex, an edge or the + face of \ccVar.} + +\ccHeading{Miscellaneous} + +\ccMethod{Bbox_3 bbox() const;} + {returns a bounding box containing \ccVar.} + +\ccMethod{Triangle_3 transform(const Aff_transformation_3 &at) const;} + {returns the triangle obtained by applying $at$ on the three + vertices of~\ccVar.} +\end{ccRefClass} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Vector_2.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Vector_2.tex new file mode 100644 index 00000000000..a4cc35f1940 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Vector_2.tex @@ -0,0 +1,136 @@ +\begin{ccRefClass} {Vector_2} +\ccInclude{CGAL/Vector_2.h} + +\ccDefinition + +An object of the class \ccRefName\ is a vector in the two-dimensional +vector space $\R^2$. Geometrically spoken, a vector is the difference +of two points $p_2$, $p_1$ and denotes the direction and the distance +from $p_1$ to $p_2$. + +\cgal\ defines a symbolic constant \ccStyle{NULL_VECTOR}. We +will explicitly state where you can pass this constant as an argument +instead of a vector initialized with zeros. + + +\ccCreation +\ccCreationVariable{v} + + +\ccHidden\ccConstructor{Vector_2();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Vector_2(const Vector_2 &w);} + {copy constructor.} + +\ccConstructor{Vector_2(const Null_vector &NULL_VECTOR);} + {introduces a null vector \ccVar.} + +\ccConstructor{Vector_2(const R::RT &hx, const R::RT &hy, const R::RT &hw = R::RT(1));} + {introduces a vector \ccVar\ initialized to $(hx/hw,hy/hw)$. + If the third argument is not explicitly given, it defaults + to \ccStyle{R::RT(1)}. + \ccPrecond \ccTexHtml{$hw\neq 0$}{hw not equal to 0} } + + +\ccOperations + +\ccHidden \ccMethod{Vector_2 & operator=(const Vector_2 &w);} + {Assignment.} + +\ccMethod{bool operator==(const Vector_2 &w) const;} + {Test for equality: two vectors are equal, iff their $x$ and $y$ + coordinates are equal. You can compare a vector with the + \ccStyle{NULL_VECTOR}.} + +\ccMethod{bool operator!=(const Vector_2 &w) const;} + {Test for inequality. You can compare a vector with the + \ccStyle{NULL_VECTOR}.} + + +There are two sets of coordinate access functions, namely to the +homogeneous and to the \ccHtmlNoLinksFrom{Cartesian} coordinates. They can be used +independently from the chosen representation type \ccStyle{R}. + +\ccMethod{R::RT hx() const;} + {returns the homogeneous $x$ coordinate.} +\ccGlue +\ccMethod{R::RT hy() const;} + {returns the homogeneous $y$ coordinate.} +\ccGlue +\ccMethod{R::RT hw() const;} + {returns the homogenizing coordinate.} + +Here come the \ccHtmlNoLinksFrom{Cartesian} access functions. Note that you do not loose +information with the homogeneous representation, because then the field +type is a quotient. + +\ccMethod{R::FT x() const;} + {returns the \ccStyle{x}-coordinate of \ccVar, that is $hx/hw$.} +\ccGlue +\ccMethod{R::FT y() const;} + {returns the \ccStyle{y}-coordinate of \ccVar, that is $hy/hw$.} + +The following operations are for convenience and for making the +class \ccRefName\ compatible with code for higher dimensional vectors. +Again they come in a \ccHtmlNoLinksFrom{Cartesian} and homogeneous flavor. + +\ccMethod{R::RT homogeneous(int i) const;} + {returns the i'th homogeneous coordinate of \ccVar, starting with 0. + \ccPrecond $0\leq i \leq 2$.} +\ccGlue +\ccMethod{R::FT cartesian(int i) const;} + {returns the i'th \ccHtmlNoLinksFrom{Cartesian} coordinate of \ccVar, starting at 0. + \ccPrecond $0\leq i \leq 1$.} +\ccGlue +\ccMethod{R::FT operator[](int i) const;} + {returns \ccStyle{cartesian(i)}. + \ccPrecond $0\leq i \leq 1$.} + +\ccMethod{int dimension() const;} + {returns the dimension (the constant 2).} + +\ccMethod{Direction_2 direction() const;} + {returns the direction which passes through \ccVar.} + +\ccMethod{Vector_2 transform(const Aff_transformation_2 &t) const;} + {returns the vector obtained by applying $t$ on \ccVar.} + +\ccMethod{Vector_2 perpendicular(const Orientation &o) const;} + {returns the vector perpendicular to \ccVar\ in clockwise or + counterclockwise orientation.} + +\ccHeading{Operators} + +The following operations can be applied on vectors: + +\ccMethod{Vector_2 operator+(const Vector_2 &w) const;} + {Addition.} + +\ccMethod{Vector_2 operator-(const Vector_2 &w) const;} + {Subtraction.} + +\ccMethod{Vector_2 operator-() const;} + {returns the opposite vector.} + +\ccMethod{R::FT operator*(const Vector_2 &w) const;} + {returns the scalar product (= inner product) of the two vectors.} + + +\ccMethod{Vector_2 operator*(const R::RT &s) const;} + {Multiplication with a scalar from the right. Although it would + be more natural, \cgal\ does not offer a multiplication with a + scalar from the left. (This is due to problems of some compilers.)} + +\ccMethod{Vector_2 operator*(const Quotient &s) const;} + {Multiplication with a scalar from the right.} + + +%\ccFunction{Vector_2 operator*(const R::RT &s, +% const Vector_2 &w);} +% {Multiplication with a scalar from the left.} + +\ccMethod{Vector_2 operator/(const R::RT &s) const;} + {Division by a scalar.} + +\end{ccRefClass} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/Vector_3.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/Vector_3.tex new file mode 100644 index 00000000000..92c861f0aa1 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/Vector_3.tex @@ -0,0 +1,144 @@ +\begin{ccRefClass} {Vector_3} +\ccInclude{CGAL/Vector_3.h} + +\ccDefinition + +An object of the class \ccRefName\ is a vector in the three-dimensional +vector space $\R^3$. Geometrically spoken a vector is the difference +of two points $p_2$, $p_1$ and denotes the direction and the distance +from $p_1$ to $p_2$. + +\cgal\ defines a symbolic constant \ccStyle{NULL_VECTOR}. We +will explicitly state where you can pass this constant as an argument +instead of a vector initialized with zeros. + + +\ccCreation +\ccCreationVariable{v} + + +\ccHidden\ccConstructor{Vector_3();} + {introduces an uninitialized variable \ccVar.} + +\ccHidden \ccConstructor{Vector_3(const Vector_3 &w);} + {copy constructor.} + +\ccConstructor{Vector_3(const Null_vector &NULL_VECTOR);} + {introduces a null vector \ccVar.} + +\ccConstructor{Vector_3(const R::RT &hx, const R::RT &hy, const R::FT &hz, const R::RT &hw = R::RT(1));} + {introduces a vector \ccVar\ initialized to $(hx/hw, hy/hw, hz/hw)$. + If the third argument is not explicitly given it defaults + to \ccStyle{R::RT(1)}.} + + +\ccOperations + +\ccHidden \ccMethod{Vector_3 & operator=(const Vector_3 &w);} + {Assignment.} + +\ccMethod{bool operator==(const Vector_3 &w) const;} + {Test for equality: two vectors are equal, iff their $x$, $y$ + and $z$ coordinates are equal. You can compare a vector with the + \ccStyle{NULL_VECTOR}.} + +\ccMethod{bool operator!=(const Vector_3 &w) const;} + {Test for inequality. You can compare a vector with the + \ccStyle{NULL_VECTOR}.} + + +There are two sets of coordinate access functions, namely to the +homogeneous and to the \ccHtmlNoLinksFrom{Cartesian} coordinates. They can be used +independently from the chosen representation type \ccStyle{R}. + +\ccMethod{R::RT hx() const;} + {returns the homogeneous $x$ coordinate.} +\ccGlue +\ccMethod{R::RT hy() const;} + {returns the homogeneous $y$ coordinate.} +\ccGlue +\ccMethod{R::RT hz() const;} + {returns the homogeneous $z$ coordinate.} +\ccGlue +\ccMethod{R::RT hw() const;} + {returns the homogenizing coordinate.} + +Here come the \ccHtmlNoLinksFrom{Cartesian} access functions. Note that you do not loose +information with the homogeneous representation, because then the field +type is a quotient. + + +\ccMethod{R::FT x() const;} + {returns the \ccStyle{x}-coordinate of \ccVar, that is $hx/hw$.} +\ccGlue +\ccMethod{R::FT y() const;} + {returns the \ccStyle{y}-coordinate of \ccVar, that is $hy/hw$.} +\ccGlue +\ccMethod{R::FT z() const;} + {returns the \ccStyle{z} coordinate of \ccVar, that is $hz/hw$.} + +The following operations are for convenience and for making the +class \ccRefName\ compatible with code for higher dimensional vectors. +Again they come in a \ccHtmlNoLinksFrom{Cartesian} and homogeneous flavor. + +\ccMethod{R::RT homogeneous(int i) const;} + {returns the i'th homogeneous coordinate of \ccVar, starting with 0. + \ccPrecond $0\leq i \leq 3$.} + +\ccMethod{R::FT cartesian(int i) const;} + {returns the i'th \ccHtmlNoLinksFrom{Cartesian} coordinate of \ccVar, starting at 0. + \ccPrecond $0\leq i \leq 2$.} + +\ccMethod{R::FT operator[](int i) const;} + {returns \ccStyle{cartesian(i)}. + \ccPrecond $0\leq i \leq 2$.} + +\ccMethod{int dimension() const;} + {returns the dimension (the constant 3).} + +\ccMethod{Vector_3 transform(const Aff_transformation_3 &t) const;} + {returns the vector obtained by applying $t$ on \ccVar.} + +\ccMethod{Direction_3 direction() const;} + {returns the direction of \ccVar.} + +\ccHeading{Operators} + +The following operations can be applied on vectors: + +\ccMethod{Vector_3 operator+(const Vector_3 &w) const;} + {Addition.} + +\ccMethod{Vector_3 operator-(const Vector_3 &w) const;} + {Subtraction.} + +\ccMethod{Vector_3 operator-() const;} + {Negation.} + +\ccMethod{R::FT operator*(const Vector_3 &w) const;} + {returns the scalar product (= inner product) of the two vectors.} + + +\ccMethod{Vector_3 operator*(const R::RT &s) const;} + {Multiplication with a scalar from the right. Although it would + be more natural, \cgal\ does not offer a multiplication with a + scalar from the left. (This is due to problems of some compilers.)} + + +\ccMethod{Vector_3 operator*(const Quotient &s) const;} + {Multiplication with a scalar from the right.} + + +%\ccFunction{Vector_3 operator*(const R::RT &s, +% const Vector_3 &w);} +% {Multiplication with a scalar from the left.} + +\ccMethod{Vector_3 operator/(const R::RT &s) const;} + {Division by a scalar.} + + +\ccSeeAlso + +\ccc{Vector_2}, \ccc{NULL_VECTOR}, \ccc{Point_3}, \ccc{Direction_3}, +\ccc{ORIGIN}, \ccc{operator+}, \ccc{operator-} +\end{ccRefClass} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/are_ordered_along_line.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/are_ordered_along_line.tex new file mode 100644 index 00000000000..f141c28f036 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/are_ordered_along_line.tex @@ -0,0 +1,22 @@ +\begin{ccRefFunction}{are_ordered_along_line} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{bool are_ordered_along_line(const Point_2 &p, + const Point_2 &q, + const Point_2 &r);} + {returns \ccStyle{true}, iff the three points are collinear and + \ccStyle{q} lies between \ccStyle{p} and \ccStyle{r}. + Note that \ccStyle{true} is returned, if \ccStyle{q==p} or + \ccStyle{q==r}.} + +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{bool are_ordered_along_line(const Point_3 &p, + const Point_3 &q, + const Point_3 &r);} + {returns \ccStyle{true}, iff the three points are collinear and + \ccStyle{q} lies between \ccStyle{p} and \ccStyle{r}. + Note that \ccStyle{true} is returned, if \ccStyle{q==p} or + \ccStyle{q==r}.} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/are_strictly_ordered_along_line.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/are_strictly_ordered_along_line.tex new file mode 100644 index 00000000000..7289b5b8b57 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/are_strictly_ordered_along_line.tex @@ -0,0 +1,22 @@ +\begin{ccRefFunction}{are_strictly_ordered_along_line} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{bool are_strictly_ordered_along_line(const Point_2 &p, + const Point_2 &q, + const Point_2 &r);} + {returns \ccStyle{true}, iff the three points are collinear and + \ccStyle{q} lies strictly between \ccStyle{p} and \ccStyle{r}. + Note that \ccStyle{false} is returned, if \ccStyle{q==p} or + \ccStyle{q==r}.} + +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{bool are_strictly_ordered_along_line(const Point_3 &p, + const Point_3 &q, + const Point_3 &r);} + {returns \ccStyle{true}, iff the three points are collinear and + \ccStyle{q} lies strictly between \ccStyle{p} and \ccStyle{r}. + Note that \ccStyle{false} is returned, if \ccStyle{q==p} or + \ccStyle{q==r}.} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/assign.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/assign.tex new file mode 100644 index 00000000000..67611f27a5d --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/assign.tex @@ -0,0 +1,11 @@ +\begin{ccRefFunction}{assign} +\ccTexHtml{\ccSetThreeColumns{Orientation}{}{\hspace*{8.5cm}}}{} + +\ccInclude{CGAL/Object.h} + +\ccFunctionTemplate{T}{template bool assign(T& c, const Object& o);} + {assigns \ccStyle{o} to \ccStyle{c} if \ccStyle{o} + was constructed from an object of type \ccStyle{T}. + Returns \ccc{true}, if the assignment was possible.} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/cartesian_to_homogeneous.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/cartesian_to_homogeneous.tex new file mode 100644 index 00000000000..f4861082ec6 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/cartesian_to_homogeneous.tex @@ -0,0 +1,20 @@ +\begin{ccRefFunction}{cartesian_to_homogeneous} +\ccTexHtml{\ccSetThreeColumns{Point_2< Homogeneous > }{}{\hspace*{8.5cm}}}{} + +\ccInclude{CGAL/cartesian_homogeneous_conversion.h} + +\ccFunction{Point_2< Homogeneous > +cartesian_to_homogeneous(const Point_2< Cartesian >& cp);} + {converts 2d point \ccStyle{cp} with Cartesian representation + into a 2d point with homogeneous representation with the same + number type.} + +\ccFunction{Point_3< Homogeneous > +cartesian_to_homogeneous(const Point_3< Cartesian >& cp);} + {converts 3d point \ccStyle{cp} with Cartesian representation + into a 3d point with homogeneous representation with the same + number type.} + +\ccTexHtml{\KernelRefLayout}{} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/circumcenter.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/circumcenter.tex new file mode 100644 index 00000000000..fd2ed521f5a --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/circumcenter.tex @@ -0,0 +1,28 @@ +\begin{ccRefFunction}{circumcenter} +\ccInclude{CGAL/basic_constructions_2.h} + +\ccFunction{Point_2 +circumcenter( const Point_2& p, + const Point_2& q, + const Point_2& r);} + {compute the center of the circle passing through the points $p$, $q$, and $r$. + \ccPrecond $p$, $q$, and $r$ are not collinear.} + +\ccInclude{CGAL/basic_constructions_3.h} + +\ccFunction{Point_3 +circumcenter( const Point_3& p, + const Point_3& q, + const Point_3& r);} + {compute the center of the circle passing through the points $p$, $q$, and $r$. + \ccPrecond $p$, $q$, and $r$ are not collinear.} + +\ccFunction{Point_3 +circumcenter( const Point_3& p, + const Point_3& q, + const Point_3& r, + const Point_3& s);} + {compute the center of the sphere passing through the points $p$, $q$, $r$, and $s$. + \ccPrecond $p$, $q$, $r$, and $s$ are not coplanar.} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/collinear.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/collinear.tex new file mode 100644 index 00000000000..925d8eec9e4 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/collinear.tex @@ -0,0 +1,16 @@ +\begin{ccRefFunction}{collinear} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{bool collinear(const Point_2 &p, + const Point_2 &q, + const Point_2 &r);} +{returns \ccStyle{true}, iff $p$, $q$, and $r$ are collinear.} + +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{bool collinear(const Point_3 &p, + const Point_3&q, + const Point_3&r);} +{returns \ccStyle{true}, iff $p$, $q$, and $r$ are collinear.} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/collinear_are_ordered_along_line.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/collinear_are_ordered_along_line.tex new file mode 100644 index 00000000000..e20dade39c5 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/collinear_are_ordered_along_line.tex @@ -0,0 +1,20 @@ +\begin{ccRefFunction}{collinear_are_ordered_along_line} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{bool collinear_are_ordered_along_line(const Point_2 &p, + const Point_2 &q, + const Point_2 &r);} + {returns \ccStyle{true}, iff \ccStyle{q} lies between \ccStyle{p} + and \ccStyle{r}. \ccPrecond \ccStyle{p, q} and \ccStyle{r} are + collinear.} + +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{bool collinear_are_ordered_along_line(const Point_3 &p, + const Point_3 &q, + const Point_3 &r);} + {returns \ccStyle{true}, iff \ccStyle{q} lies between \ccStyle{p} + and \ccStyle{r}. \ccPrecond \ccStyle{p, q} and \ccStyle{r} are + collinear.} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/collinear_are_strictly_ordered_along_line.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/collinear_are_strictly_ordered_along_line.tex new file mode 100644 index 00000000000..cd59fa3a203 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/collinear_are_strictly_ordered_along_line.tex @@ -0,0 +1,21 @@ +\begin{ccRefFunction}{collinear_are_strictly_ordered_along_line} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{bool collinear_are_strictly_ordered_along_line(const Point_2 &p, + const Point_2 &q, + const Point_2 &r);} + {returns \ccStyle{true}, iff \ccStyle{q} lies strictly between + \ccStyle{p} and \ccStyle{r}. \ccPrecond \ccStyle{p, q} and \ccStyle{r} are + collinear.} + +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{bool collinear_are_strictly_ordered_along_line( + const Point_3 &p, + const Point_3 &q, + const Point_3 &r);} + {returns \ccStyle{true}, iff \ccStyle{q} lies strictly between \ccStyle{p} + and \ccStyle{r}. \ccPrecond \ccStyle{p, q} and \ccStyle{r} are + collinear.} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/compare_x.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/compare_x.tex new file mode 100644 index 00000000000..b0d5b6a998d --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/compare_x.tex @@ -0,0 +1,57 @@ +\begin{ccRefFunction}{compare_x} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{Comparison_result compare_x(const Point_2 &p, + const Point_2 &q);} + {compares the $x$-coordinates of $p$ and $q$.} + +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{Comparison_result compare_x(const Point_3 &p, + const Point_3 &q);} + {compares the $x$-coordinates of $p$ and $q$.} + +\begin{ccTexOnly} +\begin{figure}[hb] +\centerline{\Ipe{compare1.ipe}} +\caption{Comparison of the $x$ or $y$-coordinates of the (implicitly +given) points in the boxes.\label{fig-compare}} +\end{figure} +\end{ccTexOnly} + +\ccInclude{CGAL/predicates_on_lines_2.h} + +\ccFunction{Comparison_result compare_x(const Point_2 &p, + const Line_2 &l1, + const Line_2 &l2);} + {compares the $x$-coordinates of $p$ and the \ccHtmlNoLinksFrom{intersection} + of lines $l1$ and $l2$% + \ccTexHtml{ (Figure~\ref{fig-compare} (a))}{, see (a) in the figure + below}.} + + +\ccFunction{Comparison_result compare_x(const Line_2 &l, + const Line_2 &h1, + const Line_2 &h2);} + {compares the $x$-coordinates of the \ccHtmlNoLinksFrom{intersection} of line $l$ + with line $h1$ and with line $h2$% + \ccTexHtml{ (Figure~\ref{fig-compare} (b))}{, see (b) in the figure + below}.} + + +\ccFunction{Comparison_result compare_x(const Line_2 &l1, + const Line_2 &l2, + const Line_2 &h1, + const Line_2 &h2);} + {compares the $x$-coordinates of the \ccHtmlNoLinksFrom{intersection} of lines $l1$ + and $l2$ and the \ccHtmlNoLinksFrom{intersection} of lines $h1$ and $h2$% + \ccTexHtml{ (Figure~\ref{fig-compare} (c))}{, see (c) in the figure + below}.} + +\begin{ccHtmlOnly} +Comparison of the x 
+or y coordinates of the (implicitly given) points in the boxes +\end{ccHtmlOnly} + +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/compare_y.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/compare_y.tex new file mode 100644 index 00000000000..39e567fc4cf --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/compare_y.tex @@ -0,0 +1,57 @@ +\begin{ccRefFunction}{compare_y} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{Comparison_result compare_y(const Point_2 &p, + const Point_2 &q);} + {compares Cartesian $y$-coordinates of $p$ and $q$.} + +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{Comparison_result compare_y(const Point_3 &p, + const Point_3 &q);} + {compares Cartesian $y$-coordinates of $p$ and $q$.} + +\ccInclude{CGAL/predicates_on_lines_2.h} + +\begin{ccHtmlOnly} +Comparison of the x 
+or y coordinates of the (implicitly given) points in the boxes +\end{ccHtmlOnly} + +\begin{ccTexOnly} +\begin{figure}[hb] +\centerline{\Ipe{compare1.ipe}} +\caption{Comparison of the $x$ or $y$-coordinates of the (implicitly +given) points in the boxes.\label{fig-compare13}} +\end{figure} +\end{ccTexOnly} + +\ccFunction{Comparison_result compare_y(const Point_2 &p, + const Line_2 &l1, + const Line_2 &l2);} + {compares the $y$-coordinates of $p$ and the \ccHtmlNoLinksFrom{intersection} of lines + $l1$ and $l2$% + \ccTexHtml{ (Figure~\ref{fig-compare13} (a))}{, see (a) in the figure + above}.} + + +\ccFunction{Comparison_result compare_y(const Line_2 &l, + const Line_2 &h1, + const Line_2 &h2);} + {compares the $y$-coordinates of the \ccHtmlNoLinksFrom{intersection} of line $l$ + with line $h1$ and with line $h2$% + \ccTexHtml{ (Figure~\ref{fig-compare13} (b))}{, see (b) in the figure + above}.} + + +\ccFunction{Comparison_result compare_y(const Line_2 &l1, + const Line_2 &l2, + const Line_2 &h1, + const Line_2 &h2);} + {compares the $y$-coordinates of the \ccHtmlNoLinksFrom{intersection} of lines $l1$ + and $l2$ and the \ccHtmlNoLinksFrom{intersection} of lines $h1$ and $h2$ + \ccTexHtml{ (Figure~\ref{fig-compare13} (c))}{, see (c) in the figure + above}.} + +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/compare_y_at_x.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/compare_y_at_x.tex new file mode 100644 index 00000000000..10d57c65105 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/compare_y_at_x.tex @@ -0,0 +1,53 @@ +\begin{ccRefFunction}{compare_y_at_x} + +\ccInclude{CGAL/predicates_on_lines_2.h} + +\ccFunction{Comparison_result compare_y_at_x(const Point_2 &p, + const Line_2 &h);} + {compares the $y$-coordinates of $p$ and the vertical projection + of \ccStyle{p} on \ccStyle{h}% + \ccTexHtml{ (Figure~\ref{fig-compare2} (d))}{, see (d) in the figure + below}.} + + \begin{ccTexOnly} +\begin{figure}[h] +\centerline{\Ipe{compare2.ipe}} +\caption{Comparison of the $y$-coordinates of the (implicitly given) + points in the boxes, at an $x$-coordinate. The $x$-coordinate + is either given explicitly (disc) or implicitly (circle). + \label{fig-compare2}} +\end{figure} +\end{ccTexOnly} + +\ccFunction{Comparison_result compare_y_at_x(const Point_2 &p, + const Line_2 &h1, + const Line_2 &h2);} +{This function compares the $y$-coordinates of the vertical projection + of \ccStyle{p} on \ccStyle{h1} and on \ccStyle{h2}% + \ccTexHtml{ (Figure~\ref{fig-compare2} (e))}{, see (e) in the figure + below}.} +\ccFunction{Comparison_result compare_y_at_x(const Line_2 &l1, + const Line_2 &l2, + const Line_2 &h);} + {Let $p$ be the \ccHtmlNoLinksFrom{intersection} of lines $l1$ and $l2$. + This function compares the $y$-coordinates of $p$ and + the vertical projection of \ccStyle{p} on \ccStyle{h}% + \ccTexHtml{ (Figure~\ref{fig-compare2} (f))}{, see (f) in the figure + below}.} + + +\ccFunction{Comparison_result compare_y_at_x(const Line_2 &l1, + const Line_2 &l2, + const Line_2 &h1, + const Line_2 &h2);} +{Let $p$ be the \ccHtmlNoLinksFrom{intersection} of lines $l1$ and $l2$. This function + compares the $y$-coordinates of the vertical projection of \ccStyle{p} on + \ccStyle{h1} and on \ccStyle{h2}% + \ccTexHtml{ (Figure~\ref{fig-compare2} (g))}{, see (g) in the figure + below}.} + +\begin{ccHtmlOnly} +Comparison of y at x +\end{ccHtmlOnly} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/compare_z.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/compare_z.tex new file mode 100644 index 00000000000..5ea5b3c0a57 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/compare_z.tex @@ -0,0 +1,9 @@ +\begin{ccRefFunction}{compare_z} +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{Comparison_result compare_z(const Point_3 &p, + const Point_3 &q);} + {compares the $z$-coordinates of $p$ and $q$.} + +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/coplanar.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/coplanar.tex new file mode 100644 index 00000000000..b73be2e02bd --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/coplanar.tex @@ -0,0 +1,10 @@ +\begin{ccRefFunction}{coplanar} +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{bool coplanar(const Point_3 &p, + const Point_3&q, + const Point_3&r, + const Point_3&s);} +{returns \ccStyle{true}, if $p$, $q$, $r$, and $s$ are coplanar.} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/coplanar_orientation.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/coplanar_orientation.tex new file mode 100644 index 00000000000..868b44d8709 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/coplanar_orientation.tex @@ -0,0 +1,18 @@ +\begin{ccRefFunction}{coplanar_orientation} +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{Orientation coplanar_orientation(const Point_3& p, + const Point_3& q, + const Point_3& r, + const Point_3& s);} + {Let $P$ be the plane defined by the points \ccc{p}, \ccc{q}, + and \ccc{r}. Note that the order defines the orientation of + $P$. The function computes the orientation of points \ccc{p}, + \ccc{q}, and \ccc{s} in $P$: Iff \ccc{p}, \ccc{q}, \ccc{s} are + collinear, \ccc{COLLINEAR} is returned. Iff $P$ and the plane + defined by \ccc{p}, \ccc{q}, and \ccc{s} have the same orientation, + \ccc{POSITIVE} is returned; otherwise \ccc{NEGATIVE} is returned. + \ccPrecond \ccc{p}, \ccc{q}, \ccc{r}, and \ccc{s} are coplanar and + \ccc{p}, \ccc{q}, and \ccc{r} are not collinear.} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/cross_product.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/cross_product.tex new file mode 100644 index 00000000000..edde0b4dd58 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/cross_product.tex @@ -0,0 +1,8 @@ +\begin{ccRefFunction}{cross_product} +\ccInclude{CGAL/Vector_3.h} + +\ccFunction{Vector_3 cross_product( const Vector_3& u, + const Vector_3& v);} + {returns the cross product of $u$ and $v$.} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/do_intersect.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/do_intersect.tex new file mode 100644 index 00000000000..0b34d3f04a8 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/do_intersect.tex @@ -0,0 +1,49 @@ +\begin{ccRefFunction}{do_intersect} +\ccInclude{CGAL/intersections.h}\footnote{% +The drawback of \ccc{} is that a lot is included, +which results in long compilation times. +It is also possible to include only the intersections that are of interest. +The naming scheme of the header files is as follows. +Intersections of types \ccStyle{Type1} and \ccStyle{Type2} +are declared in header file \ccc{CGAL/Type1_Type2_intersection.h}. +So, \ccHtmlNoLinksFrom{intersection} routines of segments and lines in 2D are declared in +\ccc{}. The order of the type names does not +matter. It is also possible to include \ccc{}. +For intersections of two objects of the same type, the type name should be +mentioned twice: \ccc{} +} + +\ccUnchecked{ +\ccFunction{bool do_intersect(Type1 obj1, Type2 obj2);} +{checks whether \ccc{obj1} and \ccc{obj2} intersect. +Two objects \ccStyle{obj1} and \ccStyle{obj2} intersect if there is a point +\ccStyle{p} that is part of both \ccStyle{obj1} and \ccStyle{obj2}. +The \ccHtmlNoLinksFrom{intersection} region of those two objects is defined as the set of all +points \ccStyle{p} that are part of both \ccStyle{obj1} and \ccStyle{obj2}. +Note that for objects like triangles and polygons that enclose a +bounded region, this region is part of the object. +}} + +The types \ccStyle{Type1} and \ccStyle{Type2} can be any of the following: +\begin{itemize}\ccTexHtml{\itemsep0pt\topsep0pt\partopsep0pt\parskip0pt\parsep0pt}{} +\item \ccStyle{Point_2} +\item \ccStyle{Line_2} +\item \ccStyle{Ray_2} +\item \ccStyle{Segment_2} +\item \ccStyle{Triangle_2} +\item \ccStyle{Iso_rectangle_2} +\end{itemize} + +Also, in three-dimensional space \ccc{Type1} can be \ccc{Plane_3} and +\ccc{Type2} any of +\begin{itemize}\ccTexHtml{\itemsep0pt\topsep0pt\partopsep0pt\parskip0pt\parsep0pt}{} +\item \ccStyle{Plane_3} +\item \ccStyle{Line_3} +\item \ccStyle{Ray_3} +\item \ccStyle{Segment_3} +\end{itemize} + +\ccSeeAlso +\ccc{intersection} + +\end{ccRefFunction} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/do_overlap.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/do_overlap.tex new file mode 100644 index 00000000000..42b272e42d6 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/do_overlap.tex @@ -0,0 +1,14 @@ +\begin{ccRefFunction}{do_overlap} +\ccInclude{CGAL/Bbox_2.h} + +\ccFunction{bool do_overlap(const Bbox_2 &bb1, const Bbox_2 &bb2);} + {returns \ccc{true} iff \ccc{bb1} and \ccc{bb2} overlap, i.e., + iff their \ccHtmlNoLinksFrom{intersection} is non-empty.} + +\ccInclude{CGAL/Bbox_3.h} + +\ccFunction{bool do_overlap(const Bbox_3 &bb1, const Bbox_3 &bb2);} + {returns \ccc{true} iff \ccc{bb1} and \ccc{bb2} overlap, i.e., + iff their \ccHtmlNoLinksFrom{intersection} is non-empty.} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/homogeneous_to_cartesian.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/homogeneous_to_cartesian.tex new file mode 100644 index 00000000000..c03e8e1d872 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/homogeneous_to_cartesian.tex @@ -0,0 +1,18 @@ +\begin{ccRefFunction}{homogeneous_to_cartesian} +\ccTexHtml{\ccSetThreeColumns{Point_2< Homogeneous > }{}{\hspace*{8.5cm}}}{} + +\ccInclude{CGAL/cartesian_homogeneous_conversion.h} + +\ccFunction{Point_2< Cartesian > +homogeneous_to_cartesian(const Point_2< Homogeneous >& hp);} + {converts 2d point \ccStyle{hp} with homogeneous representation + into a 2d point with Cartesian representation with the same + number type.} + +\ccFunction{Point_3< Cartesian > +homogeneous_to_cartesian(const Point_3< Homogeneous >& hp);} + {converts 3d point \ccStyle{hp} with homogeneous representation + into a 3d point with Cartesian representation with the same + number type.} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/homogeneous_to_quotient_cartesian.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/homogeneous_to_quotient_cartesian.tex new file mode 100644 index 00000000000..c495c70e0c8 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/homogeneous_to_quotient_cartesian.tex @@ -0,0 +1,19 @@ +\begin{ccRefFunction}{homogeneous_to_quotient_cartesian} + +\ccInclude{CGAL/cartesian_homogeneous_conversion.h} + +\ccFunction{Point_2< Cartesian > > +homogeneous_to_quotient_cartesian( + const Point_2 >& hp);} + {converts the 2d point \ccStyle{hp} with homogeneous representation + with number type \ccStyle{RT} into a 2d point with Cartesian + representation with number type \ccStyle{Quotient}.} + +\ccFunction{Point_3< Cartesian > > +homogeneous_to_quotient_cartesian( + const Point_3 >& hp);} + {converts the 3d point \ccStyle{hp} with homogeneous representation + with number type \ccStyle{RT} into a 3d point with Cartesian + representation with number type \ccStyle{Quotient}.} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/intersection.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/intersection.tex new file mode 100644 index 00000000000..cd957c92d33 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/intersection.tex @@ -0,0 +1,343 @@ +\begin{ccRefFunction}{intersection} +\ccInclude{CGAL/intersections.h}\footnote{% +The drawback of \ccc{} is that a lot is included, +which results in long compilation times. +It is also possible to include only the intersections that are of interest. +The naming scheme of the header files is as follows. +Intersections of types \ccStyle{Type1} and \ccStyle{Type2} +are declared in header file \ccc{CGAL/Type1_Type2_intersection.h}. +So, intersection routines of segments and lines in 2D are declared in +\ccc{}. The order of the type names does not +matter. It is also possible to include \ccc{}. +For intersections of two objects of the same type, the type name should be +mentioned twice: \ccc{} +} + +\ccUnchecked{ +\ccFunction{Object intersection(Type1 obj1, Type2 obj2);} +{Two objects \ccStyle{obj1} and \ccStyle{obj2} intersect if there is a point +\ccStyle{p} that is part of both \ccStyle{obj1} and \ccStyle{obj2}. +The \ccHtmlNoLinksFrom{intersection} region of those two objects is defined as the set of all +points \ccStyle{p} that are part of both \ccStyle{obj1} and \ccStyle{obj2}. +Note that for objects like triangles and polygons that enclose a +bounded region, this region is considered part of the object. +If a segment lies completely inside a triangle, then those two objects +intersect and the \ccHtmlNoLinksFrom{intersection} region is the complete segment. +}} + +The possible value for types \ccStyle{Type1} and \ccStyle{Type2} and the +possible return values wrapped in \ccc{Object} are the +following: + + +\begin{ccTexOnly} +\begin{longtable}[c]{|l|l|l|} +%\caption{All available intersection computations}\\ +\multicolumn{3}{l}{\sl \ \ } +\endfirsthead +\multicolumn{3}{l}{\sl continued} +\endhead +\hline +type A & type B & \parbox{4 cm}{\vspace{1 mm}{return type}} \\ +\hline +\ccStyle{Line_2} & \ccStyle{Line_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Line_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Segment_2} & \ccStyle{Line_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Segment_2} & \ccStyle{Segment_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Ray_2} & \ccStyle{Line_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Ray_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Ray_2} & \ccStyle{Segment_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Ray_2} & \ccStyle{Ray_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \\ \ccStyle{Ray_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Triangle_2} & \ccStyle{Line_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Triangle_2} & \ccStyle{Segment_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Triangle_2} & \ccStyle{Ray_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Triangle_2} & \ccStyle{Triangle_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \\ \ccStyle{Triangle_2} + \\ \ccStyle{std::vector} + \vspace{1 mm}} \\ +\hline +\ccStyle{Iso_rectangle_2} & \ccStyle{Line_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Iso_rectangle_2} & \ccStyle{Segment_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Iso_rectangle_2} & \ccStyle{Ray_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Point_2} + \\ \ccStyle{Segment_2} + \vspace{1 mm}} \\ +\hline +\ccStyle{Iso_rectangle_2} & \ccStyle{Iso_rectangle_2} & \parbox{4 cm}{\vspace{1 mm} + \ccStyle{Iso_rectangle_2} + \vspace{1 mm}} \\ +\hline +{\ccStyle{Plane_3}} & {\ccStyle{Line_3}} & \parbox{4 cm}{\vspace{1 mm} +\ccStyle{Point_3} \\ + \ccStyle{Line_3} +\vspace{1 mm}} \\ +\hline +{\ccStyle{Plane_3}} & {\ccStyle{Ray_3}} & \parbox{4 cm}{\vspace{1 mm} +\ccStyle{Point_3} \\ + \ccStyle{Ray_3} +\vspace{1 mm}} \\ +\hline +{\ccStyle{Plane_3}} & {\ccStyle{Segment_3}} & \parbox{4 cm}{\vspace{1 mm} +\ccStyle{Point_3} \\ + \ccStyle{Segment_3} +\vspace{1 mm}} \\ +\hline +{\ccStyle{Plane_3}} & {\ccStyle{Plane_3}} & \parbox{4 cm}{\vspace{1 mm} +\ccStyle{Line_3} \\ + \ccStyle{Plane_3} +\vspace{1 mm}} \\ +\hline +\end{longtable} +\end{ccTexOnly} + +\begin{ccHtmlOnly} +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
type A type B return type
Line_2 Line_2 + + +
Point_2
Line_2
Segment_2 Line_2 + + +
Point_2
Segment_2
Segment_2 Segment_2 + + +
Point_2
Segment_2
Ray_2 Line_2 + + +
Point_2
Ray_2
Ray_2 Segment_2 + + +
Point_2
Segment_2
Ray_2 Ray_2 + + + +
Point_2
Segment_2
Ray_2
Triangle_2 Line_2 + + +
Point_2
Segment_2
Triangle_2 Segment_2 + + +
Point_2
Segment_2
Triangle_2 Ray_2 + + +
Point_2
Segment_2
Triangle_2 Triangle_2 + + + + +
Point_2
Segment_2
Triangle_2
std::vector<Point_2>
Iso_rectangle_2 Line_2 + + +
Point_2
Segment_2
Iso_rectangle_2 Segment_2 + + +
Point_2
Segment_2
Iso_rectangle_2 Ray_2 + + +
Point_2
Segment_2
Iso_rectangle_2 Iso_rectangle_2 + +
Iso_rectangle_2
Plane_3 Line_3 + + +
Point_3
Line_3
Plane_3 Ray_3 + + +
Point_3
Ray_3
Plane_3 Segment_3 + + +
Point_3
Segment_3
Plane_3 Plane_3 + + +
Line_3
Plane_3
+
+\end{ccHtmlOnly} + +\ccExample + +The following example demonstrates the most common use of +\ccc{intersection} routines. +\begin{verbatim} +#include +/* or #include */ + +template +void foo(Segment_2 seg, Line_2 line) +{ + Object result; + Point_2 ipoint; + Segment_2 iseg; + + result = intersection(seg, line); + if (assign(ipoint, result)) { +\end{verbatim}% +\ccHtmlLinksOff% +\begin{verbatim} + // handle the point intersection case. +\end{verbatim}% +\ccHtmlLinksOn% +\begin{verbatim} + } else + if (assign(iseg, result)) { +\end{verbatim}% +\ccHtmlLinksOff% +\begin{verbatim} + // handle the segment intersection case. +\end{verbatim}% +\ccHtmlLinksOn% +\begin{verbatim} + } else { +\end{verbatim}% +\ccHtmlLinksOff% +\begin{verbatim} + // handle the no intersection case. + } +} +\end{verbatim}% +\ccHtmlLinksOn% + +\ccSeeAlso +\ccc{do_intersect}, \ccc{Kernel::Intersect_2}, \ccc{Kernel::Intersect_3} +\end{ccRefFunction} + + + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/lexicographically_xy_larger.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/lexicographically_xy_larger.tex new file mode 100644 index 00000000000..d66a805e4e6 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/lexicographically_xy_larger.tex @@ -0,0 +1,10 @@ +\begin{ccRefFunction}{lexicographically_xy_larger} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{bool +lexicographically_xy_larger(const Point_2& p, + const Point_2& q);} +{returns \ccc{true} iff \ccc{p} is lexicographically larger +than \ccc{q} with respect to $xy$ order.} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/lexicographically_xy_larger_or_equal.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/lexicographically_xy_larger_or_equal.tex new file mode 100644 index 00000000000..248f971b2ae --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/lexicographically_xy_larger_or_equal.tex @@ -0,0 +1,10 @@ +\begin{ccRefFunction}{lexicographically_xy_larger_or_equal} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{bool +lexicographically_xy_larger_or_equal(const Point_2& p, + const Point_2& q);} +{returns \ccc{true} iff \ccc{p} is lexicographically not smaller +than \ccc{q} with respect to $xy$ order.} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/lexicographically_xy_smaller.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/lexicographically_xy_smaller.tex new file mode 100644 index 00000000000..9be08c54c5c --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/lexicographically_xy_smaller.tex @@ -0,0 +1,11 @@ +\begin{ccRefFunction}{lexicographically_xy_smaller} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{bool +lexicographically_xy_smaller(const Point_2& p, + const Point_2& q);} +{returns \ccc{true} iff \ccc{p} is lexicographically smaller +than \ccc{q} with respect to $xy$ order.} + +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/lexicographically_xy_smaller_or_equal.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/lexicographically_xy_smaller_or_equal.tex new file mode 100644 index 00000000000..14af4884cc9 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/lexicographically_xy_smaller_or_equal.tex @@ -0,0 +1,11 @@ +\begin{ccRefFunction}{lexicographically_xy_smaller_or_equal} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{bool +lexicographically_xy_smaller_or_equal(const Point_2& p, + const Point_2& q);} +{returns \ccc{true} iff \ccc{p} is lexicographically not larger +than \ccc{q} with respect to $xy$ order.} + +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/lexicographically_xyz_smaller.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/lexicographically_xyz_smaller.tex new file mode 100644 index 00000000000..3acf901a53d --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/lexicographically_xyz_smaller.tex @@ -0,0 +1,10 @@ +\begin{ccRefFunction}{lexicographically_xyz_smaller} +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{bool +lexicographically_xyz_smaller(const Point_3& p, + const Point_3& q);} +{returns \ccc{true} iff \ccc{p} is lexicographically smaller +than \ccc{q} with respect to $xyz$ order.} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/lexicographically_xyz_smaller_or_equal.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/lexicographically_xyz_smaller_or_equal.tex new file mode 100644 index 00000000000..cdae91e9715 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/lexicographically_xyz_smaller_or_equal.tex @@ -0,0 +1,10 @@ +\begin{ccRefFunction}{lexicographically_xyz_smaller_or_equal} +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{bool +lexicographically_xyz_smaller_or_equal(const Point_3& p, + const Point_3& q);} +{returns \ccc{true} iff \ccc{p} is lexicographically not larger +than \ccc{q} with respect to $xyz$ order.} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/make_object.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/make_object.tex new file mode 100644 index 00000000000..af18c00a87c --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/make_object.tex @@ -0,0 +1,7 @@ +\begin{ccRefFunction}{make_object} +\ccInclude{CGAL/Object.h} + +\ccFunctionTemplate{T}{template Object make_object(const T &t);} +{Creates an object that contains \ccStyle{t}.} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/midpoint.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/midpoint.tex new file mode 100644 index 00000000000..034d10978d0 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/midpoint.tex @@ -0,0 +1,13 @@ +\begin{ccRefFunction}{midpoint} +\ccInclude{CGAL/basic_constructions_2.h} + +\ccFunction{Point_2 midpoint( const Point_2& p, + const Point_2& q );} + {computes the midpoint of the segment $pq$.} + +\ccInclude{CGAL/basic_constructions_3.h} + +\ccFunction{Point_3 midpoint( const Point_3& p, const Point_3& q );} + {computes the midpoint of the segment $pq$.} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/operator+.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/operator+.tex new file mode 100644 index 00000000000..651c213b52d --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/operator+.tex @@ -0,0 +1,20 @@ +\ccTexHtml{\ccSetThreeColumns{Vector_2X }{}{\hspace*{8.0cm}}}{} + +\begin{ccRefFunction}{operator+} +\ccInclude{CGAL/Point_2.h} +\ccInclude{CGAL/Vector_2.h} + +\ccFunction{Point_2 operator+(const Point_2 &p, + const Vector_2 &v);} + {returns the point obtained by translating \ccStyle{p} by + vector \ccStyle{v}.} + +\ccInclude{CGAL/Point_3.h} +\ccInclude{CGAL/Vector_3.h} + +\ccFunction{Point_3 operator+(const Point_3 &p, + const Vector_3 &v);} + {returns a point obtained by translating \ccStyle{p} by + vector \ccStyle{v}.} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/operator-.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/operator-.tex new file mode 100644 index 00000000000..fefeaca4ca5 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/operator-.tex @@ -0,0 +1,37 @@ +\begin{ccRefFunction}{operator-} +\ccTexHtml{\ccSetThreeColumns{Vector_2X }{}{\hspace*{8.0cm}}}{} + +\ccInclude{CGAL/Point_2.h} +\ccInclude{CGAL/Vector_2.h} + +\ccFunction{Vector_2 operator-(const Point_2 &p, + const Point_2 &q);} + {returns the difference vector between \ccStyle{q} and \ccStyle{p}. + You can substitute \ccc{ORIGIN} for either \ccc{p} or \ccc{q} + ,but not for both.} + +\ccFunction{Point_2 operator-(const Point_2 &p, + const Vector_2 &v);} + {returns the point obtained by translating \ccStyle{p} by the + vector -\ccStyle{v}.} + +\ccInclude{CGAL/Point_3.h} +\ccInclude{CGAL/Vector_3.h} + +\ccFunction{Vector_3 operator-(const Point_3 &p, + const Point_3 &q);} + {returns the difference vector between \ccStyle{q} and \ccStyle{p}. + You can substitute \ccc{ORIGIN} for either $p$ + or $q$, but not both.} + +\ccFunction{Point_3 operator-(const Point_3 &p, + const Vector_3 &v);} + {returns a point obtained by translating \ccStyle{p} by the + vector $-$\ccStyle{v}.} + +\ccSeeAlso + +\ccc{Point_2}, \ccc{Point_3}, \ccc{Vector_2}, \ccc{Vector_3} + +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/operatorStar.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/operatorStar.tex new file mode 100644 index 00000000000..e09ca0c29e6 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/operatorStar.tex @@ -0,0 +1,14 @@ +\begin{ccRefFunction}{operator*} +\ccTexHtml{\ccSetThreeColumns{Vector_2X }{}{\hspace*{8.0cm}}}{} + +\ccInclude{CGAL/Vector_2.h} + +\ccFunction{Vector_2 operator*(const R::RT &s, const Vector_2 &w);} + {Multiplication with a scalar from the left.} + +\ccInclude{CGAL/Vector_3.h} + +\ccFunction{Vector_3 operator*(const R::RT &s, const Vector_3 &w);} + {Multiplication with a scalar from the left.} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/opposite.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/opposite.tex new file mode 100644 index 00000000000..b8d1e8f261d --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/opposite.tex @@ -0,0 +1,17 @@ +\ccHtmlNoRefLinks +\begin{ccRefFunction}{opposite} +\ccInclude{CGAL/functions_on_enums.h} + +\ccHtmlNoLinks +\ccFunction{Oriented_side opposite(const Oriented_side &o);} +{returns the opposite side (for example \ccc{ON_POSITIVE_SIDE} if + \ccc{o==ON_NEGATIVE_SIDE}), or \ccc{ON_ORIENTED_BOUNDARY} if + \ccc{o==ON_ORIENTED_BOUNDARY}.} + +\ccHtmlNoLinks +\ccFunction{Bounded_side opposite(const Bounded_side &o);} +{returns the opposite side (for example \ccc{BOUNDED_SIDE} if + \ccc{o==UNBOUNDED_SIDE}), or returns \ccc{ON_BOUNDARY} if + \ccc{o==ON_BOUNDARY}.} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/orientation.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/orientation.tex new file mode 100644 index 00000000000..0460bca6474 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/orientation.tex @@ -0,0 +1,26 @@ +\ccHtmlNoRefLinks +\begin{ccRefFunction}{orientation} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccHtmlNoLinks +\ccFunction{Orientation orientation(const Point_2& p, + const Point_2& q, + const Point_2& r);} +{returns \ccStyle{LEFTTURN}, if $r$ lies to the left of the oriented +line $l$ defined by $p$ and $q$, returns \ccStyle{RIGHTTURN} if $r$ +lies to the right of $l$, and returns \ccStyle{COLLINEAR} if $r$ lies +on $l$.} + +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccHtmlNoLinks +\ccFunction{Orientation orientation(const Point_3 &p, + const Point_3&q, + const Point_3&r, + const Point_3&s);} +{returns \ccStyle{POSITIVE}, if $s$ lies on the positive side of the oriented +plane $h$ defined by $p$, $q$, and $r$, returns \ccStyle{NEGATIVE} if $s$ +lies on the negative side of $h$, and returns \ccStyle{COPLANAR} if $s$ lies +on $h$.} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/quotient_cartesian_to_homogeneous.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/quotient_cartesian_to_homogeneous.tex new file mode 100644 index 00000000000..0869c298ed5 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/quotient_cartesian_to_homogeneous.tex @@ -0,0 +1,18 @@ +\begin{ccRefFunction}{quotient_cartesian_to_homogeneous} +\ccInclude{CGAL/cartesian_to_homogeneous_conversion.h} + +\ccFunction{Point_2< Homogeneous > +quotient_cartesian_to_homogeneous( + const Point_2< Cartesian< Quotient > >& cp);} + {converts 2d point \ccStyle{cp} with Cartesian representation + with number type \ccStyle{Quotient} into a 2d point + with homogeneous representation with number type \ccStyle{RT}.} + +\ccFunction{Point_3< Homogeneous > +quotient_cartesian_to_homogeneous( + const Point_3< Cartesian< Quotient > >& cp);} + {converts 3d point \ccStyle{cp} with Cartesian representation + with number type \ccStyle{Quotient} into a 3d point + with homogeneous representation with number type \ccStyle{RT}.} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/rational_rotation_approximation.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/rational_rotation_approximation.tex new file mode 100644 index 00000000000..d8e9a2fecd5 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/rational_rotation_approximation.tex @@ -0,0 +1,30 @@ +\begin{ccRefFunction}{rational_rotation_approximation} +\ccInclude{CGAL/rational_rotation.h} + +\ccFunction{ +template +void +rational_rotation_approximation( const RingNumberType & dirx, + const RingNumberType & diry, + RingNumberType & sin_num, + RingNumberType & cos_num, + RingNumberType & denom, + const RingNumberType & eps_num, + const RingNumberType & eps_den );} +{computes integers \ccc{sin_num}, \ccc{cos_num} and \ccc{denom}, such +that \ccc{sin_num}/\ccc{denom} approximates the sine of direction +$($\ccc{dirx},\ccc{diry}$)$. The difference between the sine and +the approximating rational is bounded by \ccc{eps_num}/\ccc{eps_den}. +\ccPrecond \ccc{eps_num} $\neq 0$.} + +\ccImplementation +The approximation is based on Farey sequences as described in +the rational rotation method presented by Canny and Ressler at the +8th SoCG 1992. We use a slower version which needs no division operation +in the approximation. + +\ccSeeAlso +\ccc{Aff_transformation_2} + +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/side_of_bounded_circle.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/side_of_bounded_circle.tex new file mode 100644 index 00000000000..9ec22d3f1e1 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/side_of_bounded_circle.tex @@ -0,0 +1,14 @@ +\begin{ccRefFunction}{side_of_bounded_circle} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{Bounded_side side_of_bounded_circle( + const Point_2 &p, + const Point_2 &q, + const Point_2 &r, + const Point_2 &test);} + {returns the relative position of point \ccStyle{test} + to the circle defined by $p$, $q$ and $r$. The order + of the points $p$, $q$ and $r$ does not matter. + \ccPrecond \ccStyle{p, q} and \ccStyle{r} are not collinear.} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/side_of_bounded_sphere.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/side_of_bounded_sphere.tex new file mode 100644 index 00000000000..4d8f2533479 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/side_of_bounded_sphere.tex @@ -0,0 +1,15 @@ +\begin{ccRefFunction}{side_of_bounded_sphere} +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{Bounded_side side_of_bounded_sphere( + const Point_3 &p, + const Point_3 &q, + const Point_3 &r, + const Point_3 &s, + const Point_3 &test);} + {returns the relative position of point \ccStyle{test} + to the sphere defined by $p$, $q$, $r$, and $s$. The order + of the points $p$, $q$, $r$, and $s$ does not matter. + \ccPrecond \ccStyle{p, q, r} and \ccStyle{s} are not coplanar.} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/side_of_oriented_circle.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/side_of_oriented_circle.tex new file mode 100644 index 00000000000..4a55abe5fca --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/side_of_oriented_circle.tex @@ -0,0 +1,16 @@ +\begin{ccRefFunction}{side_of_oriented_circle} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{Oriented_side side_of_oriented_circle( + const Point_2 &p, + const Point_2 &q, + const Point_2 &r, + const Point_2 &test);} + {returns the relative position of point \ccStyle{test} + to the oriented circle defined by $p$, $q$ and $r$. + The order of the points $p$, $q$ and $r$ is important, + since it determines the orientation of the implicitly + constructed circle. + \ccPrecond \ccStyle{p, q} and \ccStyle{r} are not collinear.} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/side_of_oriented_sphere.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/side_of_oriented_sphere.tex new file mode 100644 index 00000000000..4784304be07 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/side_of_oriented_sphere.tex @@ -0,0 +1,19 @@ +\begin{ccRefFunction}{side_of_oriented_sphere} +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{Oriented_side side_of_oriented_sphere( + const Point_3 &p, + const Point_3 &q, + const Point_3 &r, + const Point_3 &s, + const Point_3 &test);} + {returns the relative position of point \ccStyle{test} + to the oriented sphere defined by $p$, $q$, $r$ and $s$. + The order of the points $p$, $q$, $r$, and $s$ is important, + since it determines the orientation of the implicitly + constructed sphere. If the points $p$, $q$, $r$ and $s$ + are positive oriented, positive side is the bounded interior + of the sphere. + \ccPrecond \ccStyle{p, q, r} and \ccStyle{s} are not coplanar.} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/squared_distance.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/squared_distance.tex new file mode 100644 index 00000000000..bdfb35371e1 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/squared_distance.tex @@ -0,0 +1,40 @@ +\begin{ccRefFunction}{squared_distance} +\ccInclude{CGAL/squared_distance_2.h}\\ +\ccInclude{CGAL/squared_distance_3.h} + +\ccFunctionTemplate{R} +{R::FT squared_distance(Type1 obj1, Type2 obj2);} +{computes the square of the Euclidean distance between two geometric objects. +For arbitrary geometric objects \ccStyle{obj1} and +\ccStyle{obj2} the squared distance is defined as the minimal +\ccStyle{squared_distance(p1, p2)}, where \ccStyle{p1} is a point of +\ccStyle{obj1} and \ccStyle{p2} is a point of \ccStyle{obj2}. +Note that for objects that have an inside (a bounded region), this inside +is part of the object. So, the squared distance from a point inside is +zero, not the squared distance to the closest point on the boundary.} + +In 2D, the types \ccStyle{Type1} and \ccStyle{Type2} can be any of the +following: +\begin{itemize}\ccTexHtml{\itemsep0pt\topsep0pt\partopsep0pt\parskip0pt\parsep0pt}{} +\item \ccStyle{Point_2} +\item \ccStyle{Line_2} +\item \ccStyle{Ray_2} +\item \ccStyle{Segment_2} +\item \ccStyle{Triangle_2} +\end{itemize} + +In 3D, the types \ccStyle{Type1} and \ccStyle{Type2} can be any of the +following: +\begin{itemize}\ccTexHtml{\itemsep0pt\topsep0pt\partopsep0pt\parskip0pt\parsep0pt}{} +\item \ccStyle{Point_3} +\item \ccStyle{Line_3} +\item \ccStyle{Ray_3} +\item \ccStyle{Segment_3} +\item \ccStyle{Plane_3} +\end{itemize} + +\ccSeeAlso +\ccc{has_smaller_dist_to_point}, \ccc{has_smaller_signed_dist_to_line}\\ +%\ccc{Kernel::Compute_squared_distance_2}, \ccc{Kernel::Compute_squared_distance_3} + +\end{ccRefFunction} diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/wrapper.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/wrapper.tex new file mode 100644 index 00000000000..646f579a8ce --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/wrapper.tex @@ -0,0 +1,55 @@ +\documentclass{book} + +\usepackage{cprog} +\usepackage{cc_manual} +\usepackage{cc_manual_index} +\usepackage{latex_converter} +\usepackage{makeidx} +\usepackage{amssymb} +\usepackage{graphicx} +\usepackage{path} +\usepackage{ipe} +\usepackage{longtable} + +% page dimensions +% --------------- +\textwidth 15.6cm +\textheight 23 cm +\topmargin -14mm +\evensidemargin 3mm +\oddsidemargin 3mm + +% default column layout +% --------------------- +% This is the recommended layout. It may be changed inside main.tex. + +\newcommand{\cgalColumnLayout}{\ccTexHtml{% + \ccSetThreeColumns{Oriented_side}{}{\hspace*{10cm}} + \ccPropagateThreeToTwoColumns}{}} + +\marginparsep12mm +\marginparwidth13mm +\newcommand{\cgalrelease}{2.2} +\gdef\ccNewRefManualStyle{\ccTrue} +\gdef\ccTagOperatorLayout{\ccFalse} + + +\makeindex + +\sloppy + +\begin{document} + +\include{title} +\pagestyle{plain} + +\cgalColumnLayout + +\include{Traits} + +\bibliographystyle{alpha} +\bibliography{../cgal-manual,geom} + +\lcTex{\printindex} +\end{document} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/x_equal.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/x_equal.tex new file mode 100644 index 00000000000..529c9962902 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/x_equal.tex @@ -0,0 +1,16 @@ +\begin{ccRefFunction}{x_equal} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{bool x_equal(const Point_2 &p, + const Point_2 &q);} + {returns \ccStyle{true}, iff \ccStyle{p} and \ccStyle{q} + have the same \ccStyle{x}-coordinate.} + +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{bool x_equal(const Point_3 &p, + const Point_3 &q);} + {returns \ccStyle{true}, iff \ccStyle{p} and \ccStyle{q} + have the same \ccStyle{x}-coordinate.} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/y_equal.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/y_equal.tex new file mode 100644 index 00000000000..1f66aae9aba --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/y_equal.tex @@ -0,0 +1,16 @@ +\begin{ccRefFunction}{y_equal} +\ccInclude{CGAL/predicates_on_points_2.h} + +\ccFunction{bool y_equal(const Point_2 &p, + const Point_2 &q);} + {returns \ccStyle{true}, iff \ccStyle{p} and \ccStyle{q} + have the same \ccStyle{y}-coordinate.} + +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{bool y_equal(const Point_3 &p, + const Point_3 &q);} + {returns \ccStyle{true}, iff \ccStyle{p} and \ccStyle{q} + have the same \ccStyle{y}-coordinate.} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/Ref/z_equal.tex b/Packages/Kernel_23/doc_tex/kernel/Ref/z_equal.tex new file mode 100644 index 00000000000..db0baefdf5f --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/Ref/z_equal.tex @@ -0,0 +1,9 @@ +\begin{ccRefFunction}{z_equal} +\ccInclude{CGAL/predicates_on_points_3.h} + +\ccFunction{bool z_equal(const Point_3 &p, + const Point_3 &q);} + {returns \ccStyle{true}, iff \ccStyle{p} and \ccStyle{q} + have the same \ccStyle{z}-coordinate.} +\end{ccRefFunction} + diff --git a/Packages/Kernel_23/doc_tex/kernel/arrlinthree.gif b/Packages/Kernel_23/doc_tex/kernel/arrlinthree.gif new file mode 100644 index 00000000000..db05e69db29 Binary files /dev/null and b/Packages/Kernel_23/doc_tex/kernel/arrlinthree.gif differ diff --git a/Packages/Kernel_23/doc_tex/kernel/arrlintwo.gif b/Packages/Kernel_23/doc_tex/kernel/arrlintwo.gif new file mode 100644 index 00000000000..6a118cf4d32 Binary files /dev/null and b/Packages/Kernel_23/doc_tex/kernel/arrlintwo.gif differ diff --git a/Packages/Kernel_23/doc_tex/kernel/arrthree.gif b/Packages/Kernel_23/doc_tex/kernel/arrthree.gif new file mode 100644 index 00000000000..a5a1e93903c Binary files /dev/null and b/Packages/Kernel_23/doc_tex/kernel/arrthree.gif differ diff --git a/Packages/Kernel_23/doc_tex/kernel/arrthree2.gif b/Packages/Kernel_23/doc_tex/kernel/arrthree2.gif new file mode 100644 index 00000000000..2866c912c89 Binary files /dev/null and b/Packages/Kernel_23/doc_tex/kernel/arrthree2.gif differ diff --git a/Packages/Kernel_23/doc_tex/kernel/arrtwo.gif b/Packages/Kernel_23/doc_tex/kernel/arrtwo.gif new file mode 100644 index 00000000000..cdfdc188cff Binary files /dev/null and b/Packages/Kernel_23/doc_tex/kernel/arrtwo.gif differ diff --git a/Packages/Kernel_23/doc_tex/kernel/arrtwo2.gif b/Packages/Kernel_23/doc_tex/kernel/arrtwo2.gif new file mode 100644 index 00000000000..e988a673b00 Binary files /dev/null and b/Packages/Kernel_23/doc_tex/kernel/arrtwo2.gif differ diff --git a/Packages/Kernel_23/doc_tex/kernel/common_intro.tex b/Packages/Kernel_23/doc_tex/kernel/common_intro.tex new file mode 100644 index 00000000000..901fbdd6d51 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/common_intro.tex @@ -0,0 +1,12 @@ +\cgal, the {\em Computational Geometry Algorithms Library}, is written in +\CC\ and consists of three major parts. +The first part is the kernel, which consists of constant-size non-modifiable +geometric primitive objects and operations on these objects. +The objects are parameterized by a representation class, which specifies +the underlying number types used for calculations. +The second part is a collection of basic geometric data structures and +algorithms, which are parameterized by traits classes that define the +interface between the data structure or algorithm and the primitives they use. +The third part consists of non-geometric support facilities, such as +`circulators', random sources, I/O support for debugging and for interfacing +\cgal\ to various visualization tools. diff --git a/Packages/Kernel_23/doc_tex/kernel/compare1.gif b/Packages/Kernel_23/doc_tex/kernel/compare1.gif new file mode 100644 index 00000000000..d32ecc63fc3 Binary files /dev/null and b/Packages/Kernel_23/doc_tex/kernel/compare1.gif differ diff --git a/Packages/Kernel_23/doc_tex/kernel/compare1.ipe b/Packages/Kernel_23/doc_tex/kernel/compare1.ipe new file mode 100644 index 00000000000..89d4d43ce3f --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/compare1.ipe @@ -0,0 +1,405 @@ +%!PS-Adobe-2.0 EPSF-1.2 +%%Creator: Ipe 5.0 +%%BoundingBox: 124 352 475 447 +%%EndComments +{\catcode37=9\def\IPEdummy{({{)}} pop +%%}\makeatletter\let\@notdefinable\relax +%%\def\IPEc#1[#2]#3{\newcommand{#1}[#2]{#3}\ignorespaces}\@ifundefined +%%{selectfont}{\let\selectfont\relax\def\fontsize#1#2{}}{}\makeatother +%%\IPEc\IPEput[4]{\put(0,0){\special{psfile=\IPEfile}}} +%%\IPEc\IPEmp[2]{\minipage[t]{#1bp}#2\special{color pop}\endminipage} +%%\IPEc\IPEtext[1]{\makebox(0,0)[lb]{#1\special{color pop}}} +%%\IPEc\IPEfs[1]{\IPEcolfs{0 0 0}{#1}} +%%\IPEc\IPEcolfs[2]{\dimen0=#2pt\fontsize{#2}{1.2\dimen0}\selectfont +%%\special{color push rgb #1}} +%%\IPEc\IPEsize[2]{\unitlength1bp\ignorespaces} +%%\IPEsize{349.032}{92.6338} +%%\begin{picture}(349.032,92.6338)(125.484,353.683) +%%\IPEput{124}{352}{475}{447} +%%\put(127.922,419.494){\IPEtext{\IPEfs{10}\rm $l_1$}} +%%\put(125.484,401.613){\IPEtext{\IPEfs{10}\rm $l_2$}} +%%\put(143.359,379.667){\IPEtext{\IPEfs{10}\rm $p$}} +%%\put(265.234,435.75){\IPEtext{\IPEfs{10}\rm $l$}} +%%\put(321.296,402.426){\IPEtext{\IPEfs{10}\rm $h_1$}} +%%\put(262.111,403.924){\IPEtext{\IPEfs{10}\rm $h_2$}} +%%\put(374.109,404.051){\IPEtext{\IPEfs{10}\rm $l_1$}} +%%\put(378.171,385.357){\IPEtext{\IPEfs{10}\rm $l_2$}} +%%\put(393.609,435.75){\IPEtext{\IPEfs{10}\rm $h_1$}} +%%\put(464.296,424.371){\IPEtext{\IPEfs{10}\rm $h_2$}} +%%\put(161.621,355.588){\IPEtext{\IPEfs{12}\rm (a)}} +%%\put(275.879,353.683){\IPEtext{\IPEfs{12}\rm (b)}} +%%\put(423.779,353.683){\IPEtext{\IPEfs{12}\rm (c)}} +%%\end{picture}\endinput} +%% Ipe postscript prologue + +/IpeDict 60 dict def +IpeDict begin +/origmatrix matrix currentmatrix def + +/sg {setgray} bind def +/sc {setrgbcolor} bind def +/ss {0 setdash setlinewidth} bind def +/sk {stroke} bind def +/fi {fill} bind def +/sfi {gsave fill grestore} bind def +/mt {moveto} bind def +/lt {lineto} bind def +/np {newpath} bind def +/cl {closepath} bind def +/N {moveto} bind def +/L {lineto} bind def +/E {lineto} bind def +/C {lineto closepath} bind def +%%%% +%% x y size dx dy -> ar -> x y [ draws arrowhead, computes new vertex ] +/smallarrow {gsave exch atan 4 2 roll translate rotate dup scale +newpath 0 0 moveto -1 0.3 lineto -1 -0.3 lineto closepath fill +-1 0 moveto currentpoint transform grestore itransform} bind def +/ar {gsave exch atan 4 2 roll translate rotate dup scale +newpath 0 0 moveto -1 0.3 lineto -1 -0.3 lineto closepath +gsave origmatrix setmatrix [] 0 setdash stroke grestore fill +0 0 moveto currentpoint transform grestore itransform} bind def +%%%% +/af {ar moveto} bind def +/at {ar lineto} bind def +%% x y size dx dy -> arw -> [ draws arrowhead ] +/arw {ar pop pop} bind def +%%%% +/ci {0 360 arc} bind def +/el {gsave concat 0 exch 0 exch 0 360 newpath arc origmatrix +setmatrix} bind def +/gs {gsave} bind def +/gr {grestore} bind def +/gsts {gsave translate scale } bind def +%% +/marker {gsave translate 0 setlinewidth [] 0 setdash newpath} bind def +/m1 {marker 0 exch 0 exch 0 360 arc stroke grestore} bind def +/m2 {marker 0 exch 0 exch 0 360 arc fill grestore} bind def +/m3 {marker dup dup moveto dup dup neg lineto dup neg dup lineto dup +neg exch lineto closepath stroke grestore} bind def +/m4 {marker dup dup moveto dup dup neg lineto dup neg dup lineto dup +neg exch lineto closepath fill grestore} bind def +/m5 {marker dup dup moveto dup neg dup lineto dup dup neg moveto dup +neg exch lineto closepath stroke grestore} bind def + +%% splines +systemdict /setpacking known {/savepacking currentpacking def false + setpacking} if +/q0 {0 0} def +/q1 {0 0} def +/q2 {0 0} def +/q3 {0 0} def +/p0 {0 0} def +/p1 {0 0} def +/p2 {0 0} def +/p3 {0 0} def +systemdict /setpacking known {savepacking setpacking} if + +%% x y /qi -> defp -> [/qi [x y] def] +/defp {dup 4 1 roll load astore def} bind def + +/midpoint { exch 4 3 roll add 2 div 3 1 roll add 2 div } bind def +/thirdpoint { exch 4 3 roll 2 mul add 3 div 3 1 roll exch 2 mul add 3 +div } bind def + +/prespl {/p3 defp /p2 defp /p1 defp /p0 defp +p1 p2 thirdpoint /q1 defp +p2 p1 thirdpoint /q2 defp +p1 p0 thirdpoint q1 midpoint /q0 defp +p2 p3 thirdpoint q2 midpoint /q3 defp } bind def +/postspl { q1 q2 q3 curveto p1 p2 p3 } bind def +/fspl { prespl q0 moveto postspl } bind def +/spl { prespl postspl } bind def +/xspl { pop pop pop pop pop pop } bind def + +/qspl { /p2 defp /p1 defp /p0 defp +p1 p0 midpoint /q0 defp +p1 p2 midpoint /q3 defp +p1 q0 thirdpoint /q1 defp +p1 q3 thirdpoint /q2 defp q0 moveto q1 q2 q3 curveto } bind def + +/cqspl { /p2 defp /p1 defp /p0 defp +p1 p0 midpoint /q0 defp +p1 p2 midpoint /q3 defp +p1 q0 thirdpoint /q1 defp +p1 q3 thirdpoint /q2 defp q0 moveto q1 q2 q3 curveto +p2 p1 midpoint /q0 defp +p2 p0 midpoint /q3 defp +p2 q0 thirdpoint /q1 defp +p2 q3 thirdpoint /q2 defp q1 q2 q3 curveto +p0 p2 midpoint /q0 defp +p0 p1 midpoint /q3 defp +p0 q0 thirdpoint /q1 defp +p0 q3 thirdpoint /q2 defp q1 q2 q3 curveto } bind def + +%% bitmaps +/pix { /picstr exch string def } def +%% wd ht -> preimg -> ..stuff for image.. +/preimg { 8 [ 3 index 0 0 5 index neg 0 7 index ] + {currentfile picstr readhexstring pop} } def +/img { preimg image } bind def +/kimg { preimg false 3 colorimage } bind def +%% +end +%% Ipe prologue end + +IpeDict begin 300.984 363.411 translate + +% Preamble 1 +%%\documentclass[a4paper]{article} +% Group + +% Line +% ss 0 +0.4 [] ss +np % # 2 +-161.214 58.2883 mt +-91.3385 46.0963 lt +% sk +0 sg sk +% End + +% Line +% ss 0 +0.4 [] ss +np % # 2 +-165.276 41.2195 mt +-97.026 63.1651 lt +% sk +0 sg sk +% End + +% Mark +% sk +0 sg +% ty 3 +% sz +2.8 +% xy +-129.436 52.7437 m3 +% End + +% Mark +% sk +0 sg +% ty 2 +% sz +2.8 +% xy +-145.438 18.6944 m2 +% End + +% Text +% xy -173.062 56.0832 +% sk 0 +% f 0 10 +% s $l_1$ +% End + +% Text +% xy -175.5 38.2016 +% sk 0 +% f 0 10 +% s $l_2$ +% End + +% Text +% xy -157.625 16.256 +% sk 0 +% f 0 10 +% s $p$ +% End + +% Line +% ss 0 +0.4 [] ss +np % # 2 +-24.375 70.7136 mt +17.0625 24.384 lt +% sk +0 sg sk +% End + +% Line +% ss 0 +0.4 [] ss +np % # 2 +-41.4375 17.8816 mt +-11.375 69.088 lt +% sk +0 sg sk +% End + +% Line +% ss 0 +0.4 [] ss +np % # 2 +-45.5 27.6352 mt +22.75 37.3888 lt +% sk +0 sg sk +% End + +% Text +% xy -35.75 72.3392 +% sk 0 +% f 0 10 +% s $l$ +% End + +% Text +% xy 20.3125 39.0144 +% sk 0 +% f 0 10 +% s $h_1$ +% End + +% Text +% xy -38.873 40.513 +% sk 0 +% f 0 10 +% s $h_2$ +% End + +% Mark +% sk +0 sg +% ty 3 +% sz +2.8 +% xy +-15.9505 61.2945 m3 +% End + +% Mark +% sk +0 sg +% ty 3 +% sz +2.8 +% xy +7.39375 35.1942 m3 +% End + +% Line +% ss 0 +0.4 [] ss +np % # 2 +82.875 43.8912 mt +154.375 24.384 lt +% sk +0 sg sk +% End + +% Line +% ss 0 +0.4 [] ss +np % # 2 +99.125 49.5808 mt +87.75 23.5712 lt +% sk +0 sg sk +% End + +% Line +% ss 0 +0.4 [] ss +np % # 2 +105.625 75.5904 mt +169 75.5904 lt +% sk +0 sg sk +% End + +% Line +% ss 0 +0.4 [] ss +np % # 2 +134.875 82.9056 mt +165.75 56.0832 lt +% sk +0 sg sk +% End + +% Mark +% sk +0 sg +% ty 3 +% sz +2.8 +% xy +95.1697 40.5369 m3 +% End + +% Mark +% sk +0 sg +% ty 3 +% sz +2.8 +% xy +143.295 75.5904 m3 +% End + +% Text +% xy 73.125 40.64 +% sk 0 +% f 0 10 +% s $l_1$ +% End + +% Text +% xy 77.1875 21.9456 +% sk 0 +% f 0 10 +% s $l_2$ +% End + +% Text +% xy 92.625 72.3392 +% sk 0 +% f 0 10 +% s $h_1$ +% End + +% Text +% xy 163.312 60.96 +% sk 0 +% f 0 10 +% s $h_2$ +% End + +% Text +% xy -139.363 -7.8232 +% sk 0 +% f 0 12 +% s (a) +% End + +% Text +% xy -25.1051 -9.7282 +% sk 0 +% f 0 12 +% s (b) +% End + +% Text +% xy 122.795 -9.7282 +% sk 0 +% f 0 12 +% s (c) +% End + +% Mark +% sk +0 sg +% ty 3 +% sz +2.8 +% xy +-145.438 18.6944 m3 +% End + +% End + +end %% of Ipe figure diff --git a/Packages/Kernel_23/doc_tex/kernel/compare2.gif b/Packages/Kernel_23/doc_tex/kernel/compare2.gif new file mode 100644 index 00000000000..e2d0e751fd9 Binary files /dev/null and b/Packages/Kernel_23/doc_tex/kernel/compare2.gif differ diff --git a/Packages/Kernel_23/doc_tex/kernel/compare2.ipe b/Packages/Kernel_23/doc_tex/kernel/compare2.ipe new file mode 100644 index 00000000000..d058bf7400e --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/compare2.ipe @@ -0,0 +1,557 @@ +%!PS-Adobe-2.0 EPSF-1.2 +%%Creator: Ipe 5.0 +%%BoundingBox: 106 335 493 464 +%%EndComments +{\catcode37=9\def\IPEdummy{({{)}} pop +%%}\makeatletter\let\@notdefinable\relax +%%\def\IPEc#1[#2]#3{\newcommand{#1}[#2]{#3}\ignorespaces}\@ifundefined +%%{selectfont}{\let\selectfont\relax\def\fontsize#1#2{}}{}\makeatother +%%\IPEc\IPEput[4]{\put(0,0){\special{psfile=\IPEfile}}} +%%\IPEc\IPEmp[2]{\minipage[t]{#1bp}#2\special{color pop}\endminipage} +%%\IPEc\IPEtext[1]{\makebox(0,0)[lb]{#1\special{color pop}}} +%%\IPEc\IPEfs[1]{\IPEcolfs{0 0 0}{#1}} +%%\IPEc\IPEcolfs[2]{\dimen0=#2pt\fontsize{#2}{1.2\dimen0}\selectfont +%%\special{color push rgb #1}} +%%\IPEc\IPEsize[2]{\unitlength1bp\ignorespaces} +%%\IPEsize{385.853}{127.414} +%%\begin{picture}(385.853,127.414)(107.074,336.293) +%%\IPEput{106}{335}{493}{464} +%%\put(388.107,386.588){\IPEtext{\IPEfs{10}\rm $l_1$}} +%%\put(389.142,355.539){\IPEtext{\IPEfs{10}\rm $l_2$}} +%%\put(477.534,455.297){\IPEtext{\IPEfs{10}\rm $h_1$}} +%%\put(482.707,406.653){\IPEtext{\IPEfs{10}\rm $h_2$}} +%%\put(112.996,428.207){\IPEtext{\IPEfs{10}\rm $h$}} +%%\put(108.646,382.961){\IPEtext{\IPEfs{10}\rm $p$}} +%%\put(217.642,370.256){\IPEtext{\IPEfs{10}\rm $p$}} +%%\put(233.877,443.668){\IPEtext{\IPEfs{10}\rm $h_1$}} +%%\put(243.925,399.088){\IPEtext{\IPEfs{10}\rm $h_2$}} +%%\put(299.797,405.067){\IPEtext{\IPEfs{10}\rm $l_1$}} +%%\put(302.206,380.141){\IPEtext{\IPEfs{10}\rm $l_2$}} +%%\put(343.77,428.817){\IPEtext{\IPEfs{10}\rm $h$}} +%%\put(115.24,336.293){\IPEtext{\IPEfs{12}\rm (d)}} +%%\put(221.677,336.293){\IPEtext{\IPEfs{12}\rm (e)}} +%%\put(313.49,336.293){\IPEtext{\IPEfs{12}\rm (f)}} +%%\put(434.552,336.293){\IPEtext{\IPEfs{12}\rm (g)}} +%%\end{picture}\endinput} +%% Ipe postscript prologue + +/IpeDict 60 dict def +IpeDict begin +/origmatrix matrix currentmatrix def + +/sg {setgray} bind def +/sc {setrgbcolor} bind def +/ss {0 setdash setlinewidth} bind def +/sk {stroke} bind def +/fi {fill} bind def +/sfi {gsave fill grestore} bind def +/mt {moveto} bind def +/lt {lineto} bind def +/np {newpath} bind def +/cl {closepath} bind def +/N {moveto} bind def +/L {lineto} bind def +/E {lineto} bind def +/C {lineto closepath} bind def +%%%% +%% x y size dx dy -> ar -> x y [ draws arrowhead, computes new vertex ] +/smallarrow {gsave exch atan 4 2 roll translate rotate dup scale +newpath 0 0 moveto -1 0.3 lineto -1 -0.3 lineto closepath fill +-1 0 moveto currentpoint transform grestore itransform} bind def +/ar {gsave exch atan 4 2 roll translate rotate dup scale +newpath 0 0 moveto -1 0.3 lineto -1 -0.3 lineto closepath +gsave origmatrix setmatrix [] 0 setdash stroke grestore fill +0 0 moveto currentpoint transform grestore itransform} bind def +%%%% +/af {ar moveto} bind def +/at {ar lineto} bind def +%% x y size dx dy -> arw -> [ draws arrowhead ] +/arw {ar pop pop} bind def +%%%% +/ci {0 360 arc} bind def +/el {gsave concat 0 exch 0 exch 0 360 newpath arc origmatrix +setmatrix} bind def +/gs {gsave} bind def +/gr {grestore} bind def +/gsts {gsave translate scale } bind def +%% +/marker {gsave translate 0 setlinewidth [] 0 setdash newpath} bind def +/m1 {marker 0 exch 0 exch 0 360 arc stroke grestore} bind def +/m2 {marker 0 exch 0 exch 0 360 arc fill grestore} bind def +/m3 {marker dup dup moveto dup dup neg lineto dup neg dup lineto dup +neg exch lineto closepath stroke grestore} bind def +/m4 {marker dup dup moveto dup dup neg lineto dup neg dup lineto dup +neg exch lineto closepath fill grestore} bind def +/m5 {marker dup dup moveto dup neg dup lineto dup dup neg moveto dup +neg exch lineto closepath stroke grestore} bind def + +%% splines +systemdict /setpacking known {/savepacking currentpacking def false + setpacking} if +/q0 {0 0} def +/q1 {0 0} def +/q2 {0 0} def +/q3 {0 0} def +/p0 {0 0} def +/p1 {0 0} def +/p2 {0 0} def +/p3 {0 0} def +systemdict /setpacking known {savepacking setpacking} if + +%% x y /qi -> defp -> [/qi [x y] def] +/defp {dup 4 1 roll load astore def} bind def + +/midpoint { exch 4 3 roll add 2 div 3 1 roll add 2 div } bind def +/thirdpoint { exch 4 3 roll 2 mul add 3 div 3 1 roll exch 2 mul add 3 +div } bind def + +/prespl {/p3 defp /p2 defp /p1 defp /p0 defp +p1 p2 thirdpoint /q1 defp +p2 p1 thirdpoint /q2 defp +p1 p0 thirdpoint q1 midpoint /q0 defp +p2 p3 thirdpoint q2 midpoint /q3 defp } bind def +/postspl { q1 q2 q3 curveto p1 p2 p3 } bind def +/fspl { prespl q0 moveto postspl } bind def +/spl { prespl postspl } bind def +/xspl { pop pop pop pop pop pop } bind def + +/qspl { /p2 defp /p1 defp /p0 defp +p1 p0 midpoint /q0 defp +p1 p2 midpoint /q3 defp +p1 q0 thirdpoint /q1 defp +p1 q3 thirdpoint /q2 defp q0 moveto q1 q2 q3 curveto } bind def + +/cqspl { /p2 defp /p1 defp /p0 defp +p1 p0 midpoint /q0 defp +p1 p2 midpoint /q3 defp +p1 q0 thirdpoint /q1 defp +p1 q3 thirdpoint /q2 defp q0 moveto q1 q2 q3 curveto +p2 p1 midpoint /q0 defp +p2 p0 midpoint /q3 defp +p2 q0 thirdpoint /q1 defp +p2 q3 thirdpoint /q2 defp q1 q2 q3 curveto +p0 p2 midpoint /q0 defp +p0 p1 midpoint /q3 defp +p0 q0 thirdpoint /q1 defp +p0 q3 thirdpoint /q2 defp q1 q2 q3 curveto } bind def + +%% bitmaps +/pix { /picstr exch string def } def +%% wd ht -> preimg -> ..stuff for image.. +/preimg { 8 [ 3 index 0 0 5 index neg 0 7 index ] + {currentfile picstr readhexstring pop} } def +/img { preimg image } bind def +/kimg { preimg false 3 colorimage } bind def +%% +end +%% Ipe prologue end + +IpeDict begin 303.74 368.805 translate + +% Preamble 1 +%%\documentclass[a4paper]{article} +% Group + +% Group + +% Line +% ss 0 +0.4 [] ss +np % # 2 +96.7828 21.923 mt +187.826 -2.91621 lt +% sk +0 sg sk +% End + +% Text +% xy 84.3678 17.7831 +% sk 0 +% f 0 10 +% s $l_1$ +% End + +% Text +% xy 85.4024 -13.2659 +% sk 0 +% f 0 10 +% s $l_2$ +% End + +% Line +% ss 0 +0.4 [] ss +np % # 2 +98.852 -6.02111 mt +187.826 9.50338 lt +% sk +0 sg sk +% End + +% Line +% ss 0 +0.4 [] ss +np % # 2 +86.9339 58.0229 mt +175.908 42.4984 lt +% sk +0 sg sk +% End + +% Line +% ss 0 +0.4 [] ss +np % # 2 +89.4341 44.8654 mt +170.132 94.5438 lt +% sk +0 sg sk +% End + +% Text +% xy 173.794 86.4917 +% sk 0 +% f 0 10 +% s $h_1$ +% End + +% Text +% xy 178.967 37.8483 +% sk 0 +% f 0 10 +% s $h_2$ +% End + +% Line +% ss 4369 +0.4 [ 1 3 ] ss +np % # 2 +160.061 4.65886 mt +160.061 88.3443 lt +% sk +0 sg sk +% End + +% Mark +% sk +0 sg +% ty 3 +% sz +2.8 +% xy +160.061 88.3443 m3 +% End + +% Mark +% sk +0 sg +% ty 3 +% sz +2.8 +% xy +160.061 45.2634 m3 +% End + +% End + +% Group + +% Group + +% Line +% ss 0 +0.4 [] ss +np % # 2 +-196.666 56.6605 mt +-156.654 49.679 lt +% sk +0 sg sk +% End + +% Text +% xy -190.744 59.4022 +% sk 0 +% f 0 10 +% s $h$ +% End + +% Group + +% Mark +% sk +0 sg +% ty 2 +% sz +2.8 +% xy +-179.575 17.2612 m2 +% End + +% Text +% xy -195.094 14.1563 +% sk 0 +% f 0 10 +% s $p$ +% End + +% End + +% Line +% ss 4369 +0.4 [ 1 3 ] ss +np % # 2 +-179.575 17.2612 mt +-179.575 53.6784 lt +% sk +0 sg sk +% End + +% End + +% Mark +% sk +0 sg +% ty 3 +% sz +2.8 +% xy +-179.575 53.6784 m3 +% End + +% End + +% Group + +% Group + +% Mark +% sk +0 sg +% ty 2 +% sz +2.8 +% xy +-70.5784 4.55542 m2 +% End + +% Text +% xy -86.0972 1.45053 +% sk 0 +% f 0 10 +% s $p$ +% End + +% End + +% Line +% ss 4369 +0.4 [ 1 3 ] ss +np % # 2 +-70.5784 4.55542 mt +-70.5784 67.8476 lt +% sk +0 sg sk +% End + +% Line +% ss 0 +0.4 [] ss +np % # 2 +-138.035 41.5171 mt +-49.0611 25.9926 lt +% sk +0 sg sk +% End + +% Line +% ss 0 +0.4 [] ss +np % # 2 +-135.535 28.3596 mt +-54.8375 78.038 lt +% sk +0 sg sk +% End + +% Mark +% sk +0 sg +% ty 3 +% sz +2.8 +% xy +-71.3909 29.8888 m3 +% End + +% Mark +% sk +0 sg +% ty 3 +% sz +2.8 +% xy +-71.3909 67.8476 m3 +% End + +% Text +% xy -69.863 74.8627 +% sk 0 +% f 0 10 +% s $h_1$ +% End + +% Text +% xy -59.815 30.2833 +% sk 0 +% f 0 10 +% s $h_2$ +% End + +% End + +% Group + +% Line +% ss 0 +0.4 [] ss +np % # 2 +-3.593 71.7398 mt +36.9719 64.662 lt +% sk +0 sg sk +% End + +% Line +% ss 0 +0.4 [] ss +np % # 2 +-1.72568 33.0567 mt +48.89 19.2473 lt +% sk +0 sg sk +% End + +% Line +% ss 0 +0.4 [] ss +np % # 2 +-0.789862 22.9986 mt +48.89 31.6669 lt +% sk +0 sg sk +% End + +% Text +% xy -3.94271 36.2618 +% sk 0 +% f 0 10 +% s $l_1$ +% End + +% Text +% xy -1.53382 11.3361 +% sk 0 +% f 0 10 +% s $l_2$ +% End + +% Text +% xy 40.0305 60.0118 +% sk 0 +% f 0 10 +% s $h$ +% End + +% Line +% ss 4369 +0.4 [ 1 3 ] ss +np % # 2 +21.125 26.8224 mt +21.125 67.427 lt +% sk +0 sg sk +% End + +% Mark +% sk +0 sg +% ty 3 +% sz +2.8 +% xy +21.125 67.427 m3 +% End + +% Mark +% sk +0 sg +% ty 3 +% sz +2.8 +% xy +21.125 26.8224 m3 +% End + +% End + +% Text +% xy -188.5 -32.512 +% sk 0 +% f 0 12 +% s (d) +% End + +% Text +% xy -82.0625 -32.512 +% sk 0 +% f 0 12 +% s (e) +% End + +% Text +% xy 9.75 -32.512 +% sk 0 +% f 0 12 +% s (f) +% End + +% Text +% xy 130.812 -32.512 +% sk 0 +% f 0 12 +% s (g) +% End + +% Mark +% sk +0 sg +% ty 3 +% sz +2.8 +% xy +-179.575 17.2612 m3 +% End + +% Mark +% sk +0 sg +% ty 1 +% sz +2.8 +% xy +160.061 4.65886 m1 +% End + +% Mark +% sk +0 sg +% ty 1 +% sz +2.8 +% xy +21.125 26.8224 m1 +% End + +% End + +end %% of Ipe figure diff --git a/Packages/Kernel_23/doc_tex/kernel/htmlfiles b/Packages/Kernel_23/doc_tex/kernel/htmlfiles new file mode 100644 index 00000000000..f895a7af86b --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/htmlfiles @@ -0,0 +1,12 @@ +compare1.gif +compare2.gif +IsoCuboid.gif +arrlinthree.gif +arrlintwo.gif +arrthree.gif +arrthree2.gif +arrtwo.gif +arrtwo2.gif +transvecthree.gif +transvectwo.gif + diff --git a/Packages/Kernel_23/doc_tex/kernel/introduction.tex b/Packages/Kernel_23/doc_tex/kernel/introduction.tex new file mode 100644 index 00000000000..15341ae3ecf --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/introduction.tex @@ -0,0 +1,62 @@ +\chapter{Introduction} +\input{common_intro.tex} + +{This} part of the reference manual covers the kernel. +The kernel contains objects of constant size, such as point, vector, +direction, line, ray, segment, triangle, iso-oriented rectangle and +tetrahedron. +With each type comes a set of functions which can be applied to an object +of this type. +You will typically find access functions (e.g.\ to the coordinates of a point), +tests of the position of a point relative to the object, a function returning +the bounding box, the length, or the area of an object, and so on. +The \cgal\ kernel further contains basic operations such as affine +transformations, detection and computation of intersections, and distance +computations. + +\section{Robustness} +The correctness proof of nearly all geometric algorithms presented +in theory papers assumes exact computation with real numbers. +This leads to a fundamental problem with the implementation of geometric +algorithms. +Naively, often the exact real arithmetic is replaced by inexact floating-point +arithmetic in the implementation. +This often leads to acceptable results for many input data. +However, even for the implementation of the simplest geometric +algorithms this simplification occasionally does not work. +Rounding errors introduced by an inaccurate arithmetic may lead to +inconsistent decisions, causing unexpected failures for some correct +input data. +There are many approaches to this problem, one of them is to compute +exactly (compute so accurate that all decisions made by the algorithm +are exact) which is possible in many cases but more expensive +than standard floating-point arithmetic. +C.~M.~Hoffmann~\cite{h-gsm-89,h-pargc-89} illustrates some +of the problems arising in the implementation of geometric algorithms +and discusses some approaches to solve them. +A more recent overview is given in \cite{s-rpgc-99}. +The exact computation paradigm is discussed by Yap and Dub\'e +\cite{yd-ecp-95} and Yap \cite{y-tegc-97}. + +In \cgal\ you can choose the underlying number types and arithmetic. +You can use different types of arithmetic simultaneously and the choice can +be easily changed, e.g.\ for testing. +So you can choose between implementations with fast but occasionally inexact +arithmetic and implementations guaranteeing exact computation and exact +results. +Of course you have to pay for the exactness in terms of execution time +and storage space. +See the section on number types in the +\ccAnchor{./support/contents.html}{Support Library} +for more details on number types and their capabilities and performance. + +\section{CGAL and LEDA} + +\ccAnchor{http://www.mpi-sb.mpg.de/LEDA/leda.html}{\leda} +\ccTexHtml{\footnote{\tt http://www.mpi-sb.mpg.de/LEDA/leda.html}}{} +is a {\em Library of Efficient Data types and Algorithms} under development +at the {\em Max-Planck Institut f\"ur Informatik}, Saarbr\"ucken, Germany. +\cgal\ is partially based on \leda. +It makes a strong combination with the combinatorial part of it, +and can be used independently\footnote{There are very few exceptions, +e.g.~3D convex hull} as well. diff --git a/Packages/Kernel_23/doc_tex/kernel/kernel_geometry.tex b/Packages/Kernel_23/doc_tex/kernel/kernel_geometry.tex new file mode 100644 index 00000000000..22241fb05f8 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/kernel_geometry.tex @@ -0,0 +1,105 @@ +\chapter{Kernel Geometry} + +\section{Points and Vectors} +In \cgal, we strictly distinguish between points, vectors and directions. +A {\em point} is a point in the Euclidean space +$\E^d$, a {\em vector} is the difference of two points $p_2$, $p_1$ +and denotes the direction and the distance from $p_1$ to $p_2$ in the +vector space $\R^d$, and a {\em direction} is a vector where we forget +about its length. +They are different mathematical concepts. For example, they behave +different under affine transformations and an addition of two +points is meaningless in affine geometry. By putting them in different +classes we not only get cleaner code, but also type checking by the +compiler which avoids ambiguous expressions. Hence, it pays twice to +make this distinction. + +\cgal\ defines a symbolic constant \ccStyle{ORIGIN} of type \ccc{Origin} +which denotes the point at the origin. This constant is used in the conversion +between points and vectors. Subtracting it from a point $p$ results in the +locus vector of $p$. + +\begin{cprog} + Point_2< Cartesian > p(1.0, 1.0), q; + Vector_2< Cartesian > v; + v = p - ORIGIN; + q = ORIGIN + v; + assert( p == q ); +\end{cprog} + +In order to obtain the point corresponding to a vector $v$ you simply +have to add $v$ to \ccStyle{ORIGIN}. If you want to determine +the point $q$ in the middle between two points $p_1$ and $p_2$, you can write% +\footnote{you might call \ccc{midpoint(p_1,p_2)} instead} + +\begin{cprog} + q = p_1 + (p_2 - p_1) / 2.0; +\end{cprog} + +Note that these constructions do not involve any performance overhead for +the conversion with the currently available representation classes. + +\section{Kernel Objects} +Besides points (\ccc{Point_2}, \ccc{Point_3}, \ccc{Point_d}), +vectors (\ccc{Vector_2}, \ccc{Vector_3}), and +directions (\ccc{Direction_2}, \ccc{Direction_3}), +\cgal\ provides lines, rays, segments, planes, +triangles, tetrahedra, iso-rectangles, iso-cuboids, circles and spheres. + +Lines (\ccc{Line_2}, \ccc{Line_3}) in {\cgal} are oriented. In +two-dimensional space, they induce a partition of the plane +into a positive side and a negative side. +Any two points on a line induce an \ccHtmlNoLinksFrom{orientation} +of this line. +A ray (\ccc{Ray_2}, \ccc{Ray_3}) is semi-infinite interval on a line, +and this line is oriented from the finite endpoint of this interval towards +any other point in this interval. A segment (\ccc{Segment_2}, +\ccc{Segment_3}) is a bounded interval on a directed line, +and the endpoints are ordered so that they induce the same direction +as that of the line. + +Planes are affine subspaces of dimension two in $\E^3$, passing through +three points, or a point and a line, ray, or segment. +{\cgal} provides a correspondence between any plane in the ambient +space $\E^3$ and the embedding of $\E^2$ in that space. +Just like lines, planes are oriented and partition space into a positive side +and a negative side. +In \cgal, there are no special classes for halfspaces. Halfspaces in 2D and +3D are supposed to be represented by oriented lines and planes, respectively. + +Concerning polygons and polyhedra, the kernel provides triangles, +iso-oriented rectangles, iso-oriented cuboids and tetrahedra. +More complex polygons\footnote{Any sequence of points can be seen as +a (not necessary simple) polygon or polyline. This view is used +frequently in the basic library as well.} +and polyhedra or polyhedral surfaces can be obtained +from the basic library (\ccc{Polygon_2}, \ccc{Polyhedron_3}), +so they are not part of the kernel. +As with any Jordan curves, triangles, iso-oriented rectangles and circles +separate the plane into two regions, one bounded and one unbounded. + +\section{Orientation and Relative Position} +Geometric objects in \cgal\ have member functions that test the +position of a point relative to the object. Full dimensional objects +and their boundaries are represented by the same type, +e.g.\ halfspaces and hyperplanes are not distinguished, neither are balls and +spheres and discs and circles. Such objects split the ambient space into two +full-dimensional parts, a bounded part and an unbounded part +(e.g.\ circles), or two unbounded parts (e.g.\ hyperplanes). By default these +objects are oriented, i.e., one of the resulting parts is called the +positive side, the other one is called the negative side. Both of +these may be unbounded. + +For these objects there is a function \ccStyle{oriented_side()} that +determines whether a test point is on the positive side, the negative +side, or on the oriented boundary. These function returns a value of type +\ccc{Oriented_side}. + +Those objects that split the space in a bounded and an unbounded part, have +a member function \ccStyle{bounded_side()} with return type +\ccc{Bounded_side}. + +If an object is lower dimensional, e.g.\ a triangle in three-dimensional +space or a segment in two-dimensional space, there is only a test whether a +point belongs to the object or not. This member function, which takes a +point as an argument and returns a boolean value, is called \ccStyle{has_on()} diff --git a/Packages/Kernel_23/doc_tex/kernel/kernel_representation.tex b/Packages/Kernel_23/doc_tex/kernel/kernel_representation.tex new file mode 100644 index 00000000000..b089bbfb6a1 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/kernel_representation.tex @@ -0,0 +1,229 @@ +\chapter{Kernel Representations} +Our object of study is the $d$-dimensional affine Euclidean space. +Here we are mainly concerned with cases $d=2$ and $d=3$. +Objects in that space are sets of points. A common way to represent +the points is the use of \ccHtmlNoLinksFrom{Cartesian} coordinates, +which assumes a reference frame (an origin and $d$ orthogonal axes). +In that framework, a point is represented by a $d$-tuple +\ccTexHtml{$(c_0,c_1,\ldots,c_{d-1})$}{(c0,c1,...,cd-1)}, +and so are vectors in the underlying linear space. Each point is +represented uniquely by such \ccHtmlNoLinksFrom{Cartesian} coordinates. +%An object can then be represented by an equation, that is, it is the +%set of +%points whose coordinates satisfy the equation. For example, the +%equation of a +%line is usually given as $ax + by +c = 0$. +%The line can then be represented by three numbers $a$, $b$, $c$. +Another way to represent points is by homogeneous coordinates. In that +framework, a point is represented by a $(d+1)$-tuple +\ccTexHtml{$(h_0,h_1,\ldots,h_d)$}{(h0,h1,...,hd)}. +Via the formulae +\ccTexHtml{$c_i = h_i/h_d$}{ci=hi/hd}, +the corresponding point with \ccHtmlNoLinksFrom{Cartesian} coordinates +\ccTexHtml{$(c_0,c_1,\ldots,c_{d-1})$}{(c0,c1,...,cd-1)} +can be computed. Note that homogeneous coordinates are not unique. +For \ccTexHtml{$\lambda\ne 0$}{lambda != 0}, +the tuples +\ccTexHtml{$(h_0,h_1,\ldots,h_d)$}{(h0,h1 +,...,hd)} + and +\ccTexHtml{$(\lambda\cdot h_0,\lambda\cdot h_1,\ldots,\lambda\cdot +h_d)$}{(lambda h0,lambda h1,...,lambda +hd)} represent the +same point. +For a point with \ccHtmlNoLinksFrom{Cartesian} coordinates \ccTexHtml{$(c_0,c_1,\ldots,c_{ +d-1})$}{(c0,c1,...,cd-1)} a +possible homogeneous representation is +\ccTexHtml{$(c_0,c_1,\ldots,c_{d-1},1)$}{(c0,c1,...,cd-1,1)}. +\ccHtmlNoLinksFrom{Homogeneous} coordinates in fact allow to represent +objects in a more general space, the projective space +\ccTexHtml{$\P_d$}{Pd}. +In \cgal, we do not compute in projective geometry. Rather, we use +homogeneous coordinates to avoid division operations, +since the additional coordinate can serve as a common denominator. + +\section{Genericity through Parameterization} +Almost all the kernel objects (and the corresponding functions) are +templates with a parameter that allows the user to choose the +representation of the kernel objects. A type that is used as an +argument for this parameter must fulfill certain requirements on +syntax and semantics. The list of requirements defines an abstract +kernel concept. In \cgal\ such a kernel concept is often also called +a \emph{representation class} and denoted by \ccc{R}. A representation +class provides the actual implementations of the kernel objects. +For all kernel objects \ccc{Kernel_object}, the types +\ccc{CGAL::Kernel_object} and \ccc{R::Kernel_object} are identical. + +CGAL offers three families of concrete models for the concept +representation class, two based on the \ccHtmlNoLinksFrom{Cartesian} representation of points +and one based on the homogeneous representation of points. +The interface of the kernel objects is designed such that it works well +with both \ccHtmlNoLinksFrom{Cartesian} and homogeneous representation, for example, points +in 2D have a constructor with three arguments as well +(the three homogeneous coordinates of the point). +The common interfaces parameterized with a representation class allow +one to develop code independent of the chosen representation. +We said ``families'' of models, because both families are parameterized too. +A user can choose the number type used to represent the coordinates. + +For reasons that will become evident later, +a representation class provides two typenames for number types, +namely \ccc{R::FT} and \ccc{R::RT}.% +\ccTexHtml{\footnote{The double colon :: is the \CC\ scope operator.}}{} +The type \ccStyle{R::FT} must fulfill the requirements on what is +called a {\em field type} in \cgal. This roughly means that \ccStyle{R::FT} +is a type for which operations $+$, $-$, $*$ and $/$ are defined +with semantics (approximately) corresponding to those of a field in +a mathematical sense. Note that, strictly speaking, the built-in type +\ccc{int} does not fullfil the requirements on a field type, since \ccc{int}s +correspond to elements of a ring rather than a field, especially +operation $/$ is not the inverse of $*$. +The requirements on the type \ccStyle{R::RT} are weaker. +This type must fulfill the requirements on what is called a {\em ring type} +in \cgal. This roughly means that \ccStyle{R::RT} +is a type for which operations $+$, $-$, $*$ are defined with semantics +(approximately) corresponding to those of a ring in a mathematical sense. +A very limited division operation $/$ must be available as well. +It must work for exact (i.e., no remainder) integer divisions only. +Furthermore, both number types should fulfill \cgal's requirements on a +number type. %see +Note that a ring type is always a field type but not the other way +round. + +\section{Cartesian Kernels} +With \ccc{Cartesian} you can choose \ccHtmlNoLinksFrom{Cartesian} representation +of coordinates. When you choose \ccHtmlNoLinksFrom{Cartesian} representation you +have to declare at the same time the type of the coordinates. +A number type used with the \ccc{Cartesian} representation class +should be a {\em field type} as described above. +As mentioned above, the built-in type \ccc{int} is not a field type. +However, for some computations with \ccHtmlNoLinksFrom{Cartesian} representation, no +division operation is needed, i.e., +a {\em ring type} is sufficient in this case. +With \ccc{Cartesian}, both \ccc{Cartesian::FT} +and \ccc{Cartesian::RT} are mapped to number type \ccc{FieldNumberType}. + +\ccc{Cartesian} uses reference counting internally to save copying +costs. CGAL also provides \ccc{Simple_cartesian}, a kernel +that uses \ccHtmlNoLinksFrom{Cartesian} representation but no reference counting. +Debugging is easier with \ccc{Simple_cartesian}, since the coordinates +are stored within the class and hence direct access to the coordinates is +possible. +With \ccc{Simple_cartesian}, both \ccc{Simple_cartesian::FT} +and \ccc{Simple_cartesian::RT} are mapped to number type \ccc{FieldNumberType}, too. + +\section{Homogeneous Kernel} +As we mentioned before, homogeneous coordinates permit to avoid +division operations in numerical computations, since the additional +coordinate can serve as a common denominator. +Avoiding divisions can be useful for exact geometric computation. +With \ccc{Homogeneous} you can choose homogeneous representation +of coordinates with the kernel objects. As for \ccHtmlNoLinksFrom{Cartesian} representation you +have to declare at the same time the type used to store the homogeneous +coordinates. Since the homogeneous representation allows one to avoid the +divisions, the number type associated with a homogeneous representation class +must be a model for the weaker concept ring type only. However, +some operations provided by this kernel involve division operations, for +example computing squared distances or returning a \ccHtmlNoLinksFrom{Cartesian} coordinate. +To keep the requirements on the number type parameter of \ccc{Homogeneous} +low, the number type \ccStyle{Quotient} is used instead. +This number type turns a ring type into a field type. It maintains +numbers as quotients, i.e. a numerator and a denominator. +Thereby, divisions are circumvented. +With \ccc{Homogeneous}, \ccc{Homogeneous::FT} is +equal to \ccStyle{Quotient} while +\ccc{Homogeneous::RT} is equal to \ccc{RingNumberType}. + +\section{Naming conventions} + +The use of representation classes not only avoids problems, it +also makes all \cgal\ classes very uniform. They {\bf always} consist of: +\begin{enumerate} +\begin{ccTexOnly} +\itemsep0pt\topsep0pt\partopsep0pt\parskip0pt\parsep0pt +\end{ccTexOnly} + +%\item The {\em name space prefix} \ccStyle{}. This avoids name +% clashes. It will be dropped as soon as \CC\ compilers support the +% concept of name spaces as a feature of the programming language. + +\item The {\em capitalized base name} of the geometric object, such as + \ccStyle{Point}, \ccStyle{Segment}, \ccStyle{Triangle}. + +\item An {\em underscore} followed by the {\em dimension} of the object, + for example $\_2$, $\_3$ or $\_d$. + +\item A {\em representation class} as parameter, which itself is + parameterized with a number type, such as \ccStyle{Cartesian} + or \ccStyle{Homogeneous}. +\end{enumerate} + +\section{Kernel as a Traits Class} +Algorithms and data structures in the basic library of CGAL are parameterized +by a traits class that subsumes the objects on which the algorithm or data +structure operates as well as the operations to do so. For most of the +algorithms and data structures in the basic library you can use a kernel +as a traits class. For some algorithms you even do not have to specify +the kernel; it is detected automatically using the types of the geometric +objects passed to the algorithm. In some other cases, the algorithms +or data structures needs more than is provided by a kernel. In these +cases, a kernel can not be used as a traits class. + +\section{Choosing a Kernel} +If you start with integral \ccHtmlNoLinksFrom{Cartesian} coordinates, many geometric computations +will involve integral numerical values only. Especially, this is true for +geometric computations that evaluate only predicates, which are tantamount to +determinant computations. Examples are triangulation of point sets and +convex hull computation. +In this case, the \ccHtmlNoLinksFrom{Cartesian} representation is probably the first choice, even +with a ring type. You might use limited precision integer types like +\ccc{int} or \ccc{long}, use \ccc{double} to present your integers (they +have more bits in their mantissa than an \ccc{int} and overflow nicely), or an +arbitrary precision integer type like the wrapper \ccc{Gmpz} for the +GMP integers or \ccc{leda_integer}. Note, that unless you use an +arbitrary precision integer type, incorrect results might arise due to +overflow. + +If new points are to be constructed, for example +the \ccHtmlNoLinksFrom{intersection} point of two lines, computation of +\ccHtmlNoLinksFrom{Cartesian} coordinates usually involves divisions, so +you need to use a field type with \ccHtmlNoLinksFrom{Cartesian} representation +or have to switch to homogeneous representation. +\ccc{double} is a possible, but imprecise field type. +You can also put any ring type into \ccc{Quotient} to get a +field type and put it into \ccc{Cartesian}, but you better put +the ring type into \ccc{Homogeneous}. +\ccc{leda_rational} and \ccc{leda_real} are valid field types, too. + +If it is crucial for you that the computation is reliable, +the right choice are probably number types that guarantee +exact computation. The number type \ccc{leda_real} guarantees +that all decisions and hence all branchings in a computation +are correct. They also allow you to compute approximations to whatever +precision you need. Furthermore computation with +\ccc{leda_real} is faster than computation with arbitrary precision +arithmetic. So if you would like to avoid surprises caused by imprecise +computation, this is a good choice. In fact, it is a good choice with +both representations, since divisions slow down the computation of +the reals and hence it might pay-off to avoid them. + +Still other people will prefer the built-in +type {\tt double}, because they need speed and can live with +approximate results, or even algorithms that, from time to time, +crash or compute incorrect results due to accumulated rounding errors. + +\section{Inclusion Order} +You need to include a representation class first before you include any of +the geometric objects of the kernel that you would like to use with +the representation class, i.e., one or several of +\ccc{CGAL/Cartesian.h}, \ccc{CGAL/Homogeneous.h}, and \ccc{CGAL/Simple_cartesian.h}, +before \ccc{CGAL/..._2.h} and \ccc{CGAL/..._3.h}. + +\ccExample +\begin{cprog} +#include +#include +#include +/* ... */ +\end{cprog} + diff --git a/Packages/Kernel_23/doc_tex/kernel/longtable.sty b/Packages/Kernel_23/doc_tex/kernel/longtable.sty new file mode 100644 index 00000000000..5b9f65a1432 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/longtable.sty @@ -0,0 +1,431 @@ +%% +%% This is file `longtable.sty', +%% generated with the docstrip utility. +%% +%% The original source files were: +%% +%% longtable.dtx (with options: `package') +%% +%% IMPORTANT NOTICE: +%% +%% This file is a generated file from the sources of the `tools' bundle +%% in the LaTeX2e distribution. +%% +%% For the copyright notice see the source file(s). +%% +%% You are not allowed to modify this file. +%% +%% You are allowed to distribute this file if and only if +%% it is distributed with the corresponding source files in +%% the `tools' bundle. +%% +%% For the copying and distribution conditions of the source files, +%% see the file readme.txt distributed with the tools bundle. +%% +%% File: longtable.dtx Copyright (C) 1990-1997 David Carlisle +\NeedsTeXFormat{LaTeX2e}[1995/06/01] +\ProvidesPackage{longtable} + [1997/10/16 v4.07 Multi-page Table package (DPC)] +\def\LT@err{\PackageError{longtable}} +\def\LT@warn{\PackageWarning{longtable}} +\def\LT@final@warn{% + \AtEndDocument{% + \LT@warn{Table \@width s have changed. Rerun LaTeX.\@gobbletwo}}% + \global\let\LT@final@warn\relax} +\DeclareOption{errorshow}{% + \def\LT@warn{\PackageInfo{longtable}}} +\DeclareOption{pausing}{% + \def\LT@warn#1{% + \LT@err{#1}{This is not really an error}}} +\DeclareOption{set}{} +\DeclareOption{final}{} +\ProcessOptions +\newskip\LTleft \LTleft=\fill +\newskip\LTright \LTright=\fill +\newskip\LTpre \LTpre=\bigskipamount +\newskip\LTpost \LTpost=\bigskipamount +\newcount\LTchunksize \LTchunksize=20 +\let\c@LTchunksize\LTchunksize +\newdimen\LTcapwidth \LTcapwidth=4in +\newbox\LT@head +\newbox\LT@firsthead +\newbox\LT@foot +\newbox\LT@lastfoot +\newcount\LT@cols +\newcount\LT@rows +\newcounter{LT@tables} +\newcounter{LT@chunks}[LT@tables] +\ifx\c@table\undefined + \newcounter{table} + \def\fnum@table{\tablename~\thetable} +\fi +\ifx\tablename\undefined + \def\tablename{Table} +\fi +\newtoks\LT@p@ftn +\mathchardef\LT@end@pen=30000 +\def\longtable{% + \par + \ifx\multicols\@undefined + \else + \ifnum\col@number>\@ne + \@twocolumntrue + \fi + \fi + \if@twocolumn + \LT@err{longtable not in 1-column mode}\@ehc + \fi + \begingroup + \@ifnextchar[\LT@array{\LT@array[x]}} +\def\LT@array[#1]#2{% + \refstepcounter{table}\stepcounter{LT@tables}% + \if l#1% + \LTleft\z@ \LTright\fill + \else\if r#1% + \LTleft\fill \LTright\z@ + \else\if c#1% + \LTleft\fill \LTright\fill + \fi\fi\fi + \let\LT@mcol\multicolumn + \let\LT@@tabarray\@tabarray + \let\LT@@hl\hline + \def\@tabarray{% + \let\hline\LT@@hl + \LT@@tabarray}% + \let\\\LT@tabularcr\let\tabularnewline\\% + \def\newpage{\noalign{\break}}% + \def\pagebreak{\noalign{\ifnum`}=0\fi\@testopt{\LT@no@pgbk-}4}% + \def\nopagebreak{\noalign{\ifnum`}=0\fi\@testopt\LT@no@pgbk4}% + \let\hline\LT@hline \let\kill\LT@kill\let\caption\LT@caption + \@tempdima\ht\strutbox + \ifx\extrarowheight\@undefined + \let\@acol\@tabacol + \let\@classz\@tabclassz \let\@classiv\@tabclassiv + \def\@startpbox{\vtop\LT@startpbox}\let\LT@LL@FM@cr\@tabularcr + \else + \advance\@tempdima\extrarowheight + \col@sep\tabcolsep + \let\@startpbox\LT@startpbox\let\LT@LL@FM@cr\@arraycr + \fi + \setbox\@arstrutbox\hbox{\vrule + \@height \arraystretch \@tempdima + \@depth \arraystretch \dp \strutbox + \@width \z@}% + \let\@sharp##\let\protect\relax + \begingroup + \@mkpream{#2}% + \xdef\LT@bchunk{% + \global\advance\c@LT@chunks\@ne + \global\LT@rows\z@\setbox\z@\vbox\bgroup + \LT@setprevdepth + \tabskip\LTleft\halign to\hsize\bgroup + \tabskip\z@ \@arstrut \@preamble \tabskip\LTright \cr}% + \endgroup + \expandafter\LT@nofcols\LT@bchunk&\LT@nofcols + \LT@make@row + \let\@endpbox\LT@endpbox + \m@th\let\par\@empty + \everycr{}\lineskip\z@\baselineskip\z@ + \LT@bchunk} +\def\LT@no@pgbk#1[#2]{\penalty #1\@getpen{#2}\ifnum`{=0\fi}} +\def\LT@start{% + \let\LT@start\endgraf + \endgraf\penalty\z@\vskip\LTpre + \dimen@\pagetotal + \advance\dimen@ \ht\ifvoid\LT@firsthead\LT@head\else\LT@firsthead\fi + \advance\dimen@ \dp\ifvoid\LT@firsthead\LT@head\else\LT@firsthead\fi + \advance\dimen@ \ht\LT@foot + \dimen@ii\vfuzz + \vfuzz\maxdimen + \setbox\tw@\copy\z@ + \setbox\tw@\vsplit\tw@ to \ht\@arstrutbox + \setbox\tw@\vbox{\unvbox\tw@}% + \vfuzz\dimen@ii + \advance\dimen@ \ht + \ifdim\ht\@arstrutbox>\ht\tw@\@arstrutbox\else\tw@\fi + \advance\dimen@\dp + \ifdim\dp\@arstrutbox>\dp\tw@\@arstrutbox\else\tw@\fi + \advance\dimen@ -\pagegoal + \ifdim \dimen@>\z@\vfil\break\fi + \global\@colroom\@colht + \ifvoid\LT@foot\else + \advance\vsize-\ht\LT@foot + \global\advance\@colroom-\ht\LT@foot + \dimen@\pagegoal\advance\dimen@-\ht\LT@foot\pagegoal\dimen@ + \maxdepth\z@ + \fi + \ifvoid\LT@firsthead\copy\LT@head\else\box\LT@firsthead\fi + \output{\LT@output}} +\def\endlongtable{% + \crcr + \noalign{% + \let\LT@entry\LT@entry@chop + \xdef\LT@save@row{\LT@save@row}}% + \LT@echunk + \LT@start + \unvbox\z@ + \LT@get@widths + \if@filesw + {\let\LT@entry\LT@entry@write\immediate\write\@auxout{% + \gdef\expandafter\noexpand + \csname LT@\romannumeral\c@LT@tables\endcsname + {\LT@save@row}}}% + \fi + \ifx\LT@save@row\LT@@save@row + \else + \LT@warn{Column \@width s have changed\MessageBreak + in table \thetable}% + \LT@final@warn + \fi + \endgraf\penalty -\LT@end@pen + \endgroup + \global\@mparbottom\z@ + \pagegoal\vsize + \endgraf\penalty\z@\addvspace\LTpost + \ifvoid\footins\else\insert\footins{}\fi} +\def\LT@nofcols#1&{% + \futurelet\@let@token\LT@n@fcols} +\def\LT@n@fcols{% + \advance\LT@cols\@ne + \ifx\@let@token\LT@nofcols + \expandafter\@gobble + \else + \expandafter\LT@nofcols + \fi} +\def\LT@tabularcr{% + \relax\iffalse{\fi\ifnum0=`}\fi + \@ifstar + {\def\crcr{\LT@crcr\noalign{\nobreak}}\let\cr\crcr + \LT@t@bularcr}% + {\LT@t@bularcr}} +\let\LT@crcr\crcr +\let\LT@setprevdepth\relax +\def\LT@t@bularcr{% + \global\advance\LT@rows\@ne + \ifnum\LT@rows=\LTchunksize + \gdef\LT@setprevdepth{% + \prevdepth\z@\global + \global\let\LT@setprevdepth\relax}% + \expandafter\LT@xtabularcr + \else + \ifnum0=`{}\fi + \expandafter\LT@LL@FM@cr + \fi} +\def\LT@xtabularcr{% + \@ifnextchar[\LT@argtabularcr\LT@ntabularcr} +\def\LT@ntabularcr{% + \ifnum0=`{}\fi + \LT@echunk + \LT@start + \unvbox\z@ + \LT@get@widths + \LT@bchunk} +\def\LT@argtabularcr[#1]{% + \ifnum0=`{}\fi + \ifdim #1>\z@ + \unskip\@xargarraycr{#1}% + \else + \@yargarraycr{#1}% + \fi + \LT@echunk + \LT@start + \unvbox\z@ + \LT@get@widths + \LT@bchunk} +\def\LT@echunk{% + \crcr\LT@save@row\cr\egroup + \global\setbox\@ne\lastbox + \unskip + \egroup} +\def\LT@entry#1#2{% + \ifhmode\@firstofone{&}\fi\omit + \ifnum#1=\c@LT@chunks + \else + \kern#2\relax + \fi} +\def\LT@entry@chop#1#2{% + \noexpand\LT@entry + {\ifnum#1>\c@LT@chunks + 1}{0pt% + \else + #1}{#2% + \fi}} +\def\LT@entry@write{% + \noexpand\LT@entry^^J% + \@spaces} +\def\LT@kill{% + \LT@echunk + \LT@get@widths + \expandafter\LT@rebox\LT@bchunk} +\def\LT@rebox#1\bgroup{% + #1\bgroup + \unvbox\z@ + \unskip + \setbox\z@\lastbox} +\def\LT@blank@row{% + \xdef\LT@save@row{\expandafter\LT@build@blank + \romannumeral\number\LT@cols 001 }} +\def\LT@build@blank#1{% + \if#1m% + \noexpand\LT@entry{1}{0pt}% + \expandafter\LT@build@blank + \fi} +\def\LT@make@row{% + \global\expandafter\let\expandafter\LT@save@row + \csname LT@\romannumeral\c@LT@tables\endcsname + \ifx\LT@save@row\relax + \LT@blank@row + \else + {\let\LT@entry\or + \if!% + \ifcase\expandafter\expandafter\expandafter\LT@cols + \expandafter\@gobble\LT@save@row + \or + \else + \relax + \fi + !% + \else + \aftergroup\LT@blank@row + \fi}% + \fi} +\let\setlongtables\relax +\def\LT@get@widths{% + \setbox\tw@\hbox{% + \unhbox\@ne + \let\LT@old@row\LT@save@row + \global\let\LT@save@row\@empty + \count@\LT@cols + \loop + \unskip + \setbox\tw@\lastbox + \ifhbox\tw@ + \LT@def@row + \advance\count@\m@ne + \repeat}% + \ifx\LT@@save@row\@undefined + \let\LT@@save@row\LT@save@row + \fi} +\def\LT@def@row{% + \let\LT@entry\or + \edef\@tempa{% + \ifcase\expandafter\count@\LT@old@row + \else + {1}{0pt}% + \fi}% + \let\LT@entry\relax + \xdef\LT@save@row{% + \LT@entry + \expandafter\LT@max@sel\@tempa + \LT@save@row}} +\def\LT@max@sel#1#2{% + {\ifdim#2=\wd\tw@ + #1% + \else + \number\c@LT@chunks + \fi}% + {\the\wd\tw@}} +\def\LT@hline{% + \noalign{\ifnum0=`}\fi + \penalty\@M + \futurelet\@let@token\LT@@hline} +\def\LT@@hline{% + \ifx\@let@token\hline + \global\let\@gtempa\@gobble + \gdef\LT@sep{\penalty-\@medpenalty\vskip\doublerulesep}% + \else + \global\let\@gtempa\@empty + \gdef\LT@sep{\penalty-\@lowpenalty\vskip-\arrayrulewidth}% + \fi + \ifnum0=`{\fi}% + \multispan\LT@cols + \unskip\leaders\hrule\@height\arrayrulewidth\hfill\cr + \noalign{\LT@sep}% + \multispan\LT@cols + \unskip\leaders\hrule\@height\arrayrulewidth\hfill\cr + \noalign{\penalty\@M}% + \@gtempa} +\def\LT@caption{% + \noalign\bgroup + \@ifnextchar[{\egroup\LT@c@ption\@firstofone}\LT@capti@n} +\def\LT@c@ption#1[#2]#3{% + \LT@makecaption#1\fnum@table{#3}% + \def\@tempa{#2}% + \ifx\@tempa\@empty\else + {\let\\\space + \addcontentsline{lot}{table}{\protect\numberline{\thetable}{#2}}}% + \fi} +\def\LT@capti@n{% + \@ifstar + {\egroup\LT@c@ption\@gobble[]}% + {\egroup\@xdblarg{\LT@c@ption\@firstofone}}} +\def\LT@makecaption#1#2#3{% + \LT@mcol\LT@cols c{\hbox to\z@{\hss\parbox[t]\LTcapwidth{% + \sbox\@tempboxa{#1{#2: }#3}% + \ifdim\wd\@tempboxa>\hsize + #1{#2: }#3% + \else + \hbox to\hsize{\hfil\box\@tempboxa\hfil}% + \fi + \endgraf\vskip\baselineskip}% + \hss}}} +\def\LT@output{% + \ifnum\outputpenalty <-\@Mi + \ifnum\outputpenalty > -\LT@end@pen + \LT@err{floats and marginpars not allowed in a longtable}\@ehc + \else + \setbox\z@\vbox{\unvbox\@cclv}% + \ifdim \ht\LT@lastfoot>\ht\LT@foot + \dimen@\pagegoal + \advance\dimen@-\ht\LT@lastfoot + \ifdim\dimen@<\ht\z@ + \setbox\@cclv\vbox{\unvbox\z@\copy\LT@foot\vss}% + \@makecol + \@outputpage + \setbox\z@\vbox{\box\LT@head}% + \fi + \fi + \global\@colroom\@colht + \global\vsize\@colht + \vbox + {\unvbox\z@\box\ifvoid\LT@lastfoot\LT@foot\else\LT@lastfoot\fi}% + \fi + \else + \setbox\@cclv\vbox{\unvbox\@cclv\copy\LT@foot\vss}% + \@makecol + \@outputpage + \global\vsize\@colroom + \copy\LT@head + \fi} +\def\LT@end@hd@ft#1{% + \LT@echunk + \ifx\LT@start\endgraf + \LT@err + {Longtable head or foot not at start of table}% + {Increase LTchunksize}% + \fi + \setbox#1\box\z@ + \LT@get@widths + \LT@bchunk} +\def\endfirsthead{\LT@end@hd@ft\LT@firsthead} +\def\endhead{\LT@end@hd@ft\LT@head} +\def\endfoot{\LT@end@hd@ft\LT@foot} +\def\endlastfoot{\LT@end@hd@ft\LT@lastfoot} +\def\LT@startpbox#1{% + \bgroup + \let\@footnotetext\LT@p@ftntext + \hsize#1% + \@arrayparboxrestore + \vrule \@height \ht\@arstrutbox \@width \z@} +\def\LT@endpbox{% + \@finalstrut\@arstrutbox + \egroup + \the\LT@p@ftn + \global\LT@p@ftn{}% + \hfil} +\def\LT@p@ftntext#1{% + \edef\@tempa{\the\LT@p@ftn\noexpand\footnotetext[\the\c@footnote]}% + \global\LT@p@ftn\expandafter{\@tempa{#1}}}% +\endinput +%% +%% End of file `longtable.sty'. diff --git a/Packages/Kernel_23/doc_tex/kernel/main.tex b/Packages/Kernel_23/doc_tex/kernel/main.tex new file mode 100644 index 00000000000..3d1c12669e5 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/main.tex @@ -0,0 +1,572 @@ +\cleardoublepage + +\pagenumbering{arabic} + +\input{user_manual} + +\gdef\ccNewRefManualStyle{\ccTrue} +\marginparsep10mm +\marginparwidth15mm +\newcommand{\KernelRefLayout}{\ccTexHtml{% + \ccSetThreeColumns{const Comparison_result}{}{\hspace*{8cm}} + \ccPropagateThreeToTwoColumns}{}} + +\input{reference_manual} +\KernelRefLayout +\input{Ref/Aff_transformation_2.tex} +\KernelRefLayout +\input{Ref/Aff_transformation_3.tex} +\KernelRefLayout +\input{Ref/are_ordered_along_line.tex} +\KernelRefLayout +\input{Ref/are_strictly_ordered_along_line.tex} +\KernelRefLayout +\input{Ref/assign.tex} +\KernelRefLayout +\input{Ref/Bbox_2.tex} +\KernelRefLayout +\input{Ref/Bbox_3.tex} +\KernelRefLayout +\input{Ref/Bounded_side.tex} +\KernelRefLayout +\input{Ref/Cartesian.tex} +\KernelRefLayout +\input{Ref/cartesian_to_homogeneous.tex} +\KernelRefLayout +\input{Ref/Circle_2.tex} +\KernelRefLayout +\input{Ref/circumcenter.tex} +\KernelRefLayout +\input{Ref/CLOCKWISE.tex} +\KernelRefLayout +\input{Ref/cmp_dist_to_point.tex} +\KernelRefLayout +\input{Ref/cmp_signed_dist_to_line.tex} +\KernelRefLayout +\input{Ref/cmp_signed_dist_to_plane.tex} +\KernelRefLayout +\input{Ref/COLLINEAR.tex} +\KernelRefLayout +\input{Ref/collinear.tex} +\KernelRefLayout +\input{Ref/collinear_are_ordered_along_line.tex} +\KernelRefLayout +\input{Ref/collinear_are_strictly_ordered_along_line.tex} +\KernelRefLayout +\input{Ref/compare_lexicographically_xy.tex} +\KernelRefLayout +\input{Ref/compare_lexicographically_xyz.tex} +\KernelRefLayout +\input{Ref/compare_x.tex} +\KernelRefLayout +\input{Ref/compare_y.tex} +\KernelRefLayout +\input{Ref/compare_y_at_x.tex} +\KernelRefLayout +\input{Ref/compare_z.tex} +\KernelRefLayout +\input{Ref/Comparison_result.tex} +\KernelRefLayout +\input{Ref/COPLANAR.tex} +\KernelRefLayout +\input{Ref/coplanar.tex} +\KernelRefLayout +\input{Ref/coplanar_orientation.tex} +\KernelRefLayout +\input{Ref/COUNTERCLOCKWISE.tex} +\KernelRefLayout +\input{Ref/cross_product.tex} +\KernelRefLayout +\input{Ref/DEGENERATE.tex} +\KernelRefLayout +\input{Ref/Direction_2.tex} +\KernelRefLayout +\input{Ref/Direction_3.tex} +\KernelRefLayout +\input{Ref/do_intersect.tex} +\KernelRefLayout +\input{Ref/do_overlap.tex} +\KernelRefLayout +\input{Ref/FieldNumberType.tex} +\KernelRefLayout +\input{Ref/has_larger_dist_to_point.tex} +\KernelRefLayout +\input{Ref/has_larger_signed_dist_to_line.tex} +\KernelRefLayout +\input{Ref/has_larger_signed_dist_to_plane.tex} +\KernelRefLayout +\input{Ref/has_smaller_dist_to_point.tex} +\KernelRefLayout +\input{Ref/has_smaller_signed_dist_to_line.tex} +\KernelRefLayout +\input{Ref/has_smaller_signed_dist_to_plane.tex} +\KernelRefLayout +\input{Ref/Homogeneous.tex} +\KernelRefLayout +\input{Ref/homogeneous_to_cartesian.tex} +\KernelRefLayout +\input{Ref/homogeneous_to_quotient_cartesian.tex} +\KernelRefLayout +\input{Ref/Identity_transformation.tex} +\KernelRefLayout +\input{Ref/intersection.tex} +\KernelRefLayout +\input{Ref/Iso_cuboid_3.tex} +\KernelRefLayout +\input{Ref/Iso_rectangle_2.tex} +\KernelRefLayout +\input{Ref/Kernel.tex} +\KernelRefLayout +\input{Ref/Kernel::Aff_transformation_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Aff_transformation_3.tex} +\KernelRefLayout\gdef\ccTagOperatorLayout{\ccFalse} +\input{Ref/Kernel::Are_ordered_along_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Are_ordered_along_line_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Are_strictly_ordered_along_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Are_strictly_ordered_along_line_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Assign_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Assign_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Circle_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Collinear_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Collinear_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Collinear_are_ordered_along_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Collinear_are_ordered_along_line_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Collinear_are_strictly_ordered_along_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Collinear_are_strictly_ordered_along_line_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Collinear_has_on_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Collinear_has_on_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Compare_x_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Compare_x_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Compare_x_at_y_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Compare_xy_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Compare_xy_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Compare_xyz_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Compare_y_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Compare_y_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Compare_y_at_x_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Compare_z_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Compute_squared_length_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Compute_squared_length_3.tex} +\KernelRefLayout +%\input{Ref/Kernel::Compute_x_at_y_2.tex} +%\KernelRefLayout +\input{Ref/Kernel::Compute_y_at_x_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_aff_transformation_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_aff_transformation_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_bisector_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_circle_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_circumcenter_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_direction_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_direction_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_direction_of_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_direction_of_line_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_direction_of_ray_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_direction_of_ray_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_iso_cuboid_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_iso_rectangle_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_line_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_max_point_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_max_point_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_midpoint_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_midpoint_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_min_point_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_min_point_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_opposite_circle_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_opposite_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_opposite_line_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_opposite_plane_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_opposite_ray_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_opposite_ray_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_opposite_segment_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_opposite_segment_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_opposite_triangle_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_perpendicular_direction_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_perpendicular_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_perpendicular_line_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_perpendicular_plane_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_perpendicular_vector_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_plane_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_point_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_point_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_point_d.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_point_on_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_point_on_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_ray_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_ray_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_second_point_on_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_second_point_on_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_segment_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_segment_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_source_point_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_source_point_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_sphere_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_supporting_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_supporting_line_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_supporting_plane_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_target_point_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_target_point_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_tetrahedron_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_triangle_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_triangle_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_vector_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Construct_vector_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Coplanar_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Coplanar_orientation_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Counterclockwise_in_between_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Direction_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Direction_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Equal_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Equal_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Equal_x_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Equal_x_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Equal_xy_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Equal_xy_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Equal_xyz_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Equal_y_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Equal_y_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Equal_z_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_boundary_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_boundary_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_bounded_side_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_bounded_side_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_negative_side_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_negative_side_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_positive_side_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_positive_side_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_unbounded_side_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Has_on_unbounded_side_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Intersect_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Intersect_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Is_degenerate_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Is_degenerate_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Is_horizontal_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Is_vertical_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Iso_cuboid_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Iso_rectangle_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Left_of_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Leftturn_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_distance_to_point_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_distance_to_point_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_rotate_ccw_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_signed_distance_to_line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_x_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_x_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_xy_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_xy_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_xyz_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_y_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_y_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_yx_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Less_z_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Line_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Line_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Object_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Object_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Orientation_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Orientation_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Oriented_side_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Oriented_side_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Plane_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Point_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Point_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Point_d.tex} +\KernelRefLayout +\input{Ref/Kernel::Ray_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Ray_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Segment_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Segment_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Side_of_bounded_circle_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Side_of_bounded_sphere_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Side_of_oriented_circle_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Side_of_oriented_sphere_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Sphere_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Tetrahedron_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Transform_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Transform_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Triangle_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Triangle_3.tex} +\KernelRefLayout +\input{Ref/Kernel::Vector_2.tex} +\KernelRefLayout +\input{Ref/Kernel::Vector_3.tex} +\KernelRefLayout +\input{Ref/LEFTTURN.tex} +\KernelRefLayout +\input{Ref/leftturn.tex} +\KernelRefLayout +\input{Ref/lexicographically_xy_larger.tex} +\KernelRefLayout +\input{Ref/lexicographically_xy_larger_or_equal.tex} +\KernelRefLayout +\input{Ref/lexicographically_xy_smaller.tex} +\KernelRefLayout +\input{Ref/lexicographically_xy_smaller_or_equal.tex} +\KernelRefLayout +\input{Ref/lexicographically_xyz_smaller.tex} +\KernelRefLayout +\input{Ref/lexicographically_xyz_smaller_or_equal.tex} +\KernelRefLayout +\input{Ref/Line_2.tex} +\KernelRefLayout +\input{Ref/Line_3.tex} +\KernelRefLayout +\input{Ref/make_object.tex} +\KernelRefLayout +\input{Ref/midpoint.tex} +\KernelRefLayout +\input{Ref/NULL_VECTOR.tex} +\KernelRefLayout +\input{Ref/Null_vector.tex} +\KernelRefLayout +\input{Ref/Object.tex} +\KernelRefLayout\gdef\ccTagOperatorLayout{\ccTrue} +\input{Ref/operatorStar.tex} +\KernelRefLayout +\input{Ref/operator+.tex} +\KernelRefLayout +\input{Ref/operator-.tex} +\KernelRefLayout\gdef\ccTagOperatorLayout{\ccTrue} +\input{Ref/opposite.tex} +\KernelRefLayout +\input{Ref/Orientation.tex} +\KernelRefLayout +\input{Ref/orientation.tex} +\KernelRefLayout +\input{Ref/Oriented_side.tex} +\KernelRefLayout +\input{Ref/ORIGIN.tex} +\KernelRefLayout +\input{Ref/Origin.tex} +\KernelRefLayout +\input{Ref/Plane_3.tex} +\KernelRefLayout +\input{Ref/Point_2.tex} +\KernelRefLayout +\input{Ref/Point_3.tex} +\KernelRefLayout +\input{Ref/Point_d.tex} +\KernelRefLayout +\input{Ref/quotient_cartesian_to_homogeneous.tex} +\KernelRefLayout +\input{Ref/R.tex} +\KernelRefLayout +\input{Ref/rational_rotation_approximation.tex} +\KernelRefLayout +\input{Ref/Ray_2.tex} +\KernelRefLayout +\input{Ref/Ray_3.tex} +\KernelRefLayout +\input{Ref/Reflection.tex} +\KernelRefLayout +\input{Ref/RIGHTTURN.tex} +\KernelRefLayout +\input{Ref/rightturn.tex} +\KernelRefLayout +\input{Ref/RingNumberType.tex} +\KernelRefLayout +\input{Ref/Rotation.tex} +\KernelRefLayout +\input{Ref/Scaling.tex} +\KernelRefLayout +\input{Ref/Segment_2.tex} +\KernelRefLayout +\input{Ref/Segment_3.tex} +\KernelRefLayout +\input{Ref/side_of_bounded_circle.tex} +\KernelRefLayout +\input{Ref/side_of_bounded_sphere.tex} +\KernelRefLayout +\input{Ref/side_of_oriented_circle.tex} +\KernelRefLayout +\input{Ref/side_of_oriented_sphere.tex} +\KernelRefLayout +\input{Ref/Sign.tex} +\KernelRefLayout +\input{Ref/Simple_cartesian.tex} +\KernelRefLayout +\input{Ref/Sphere_3.tex} +\KernelRefLayout +\input{Ref/squared_distance.tex} +\KernelRefLayout +\input{Ref/Tetrahedron_3.tex} +\KernelRefLayout +\input{Ref/Translation.tex} +\KernelRefLayout +\input{Ref/Triangle_2.tex} +\KernelRefLayout +\input{Ref/Triangle_3.tex} +\KernelRefLayout +\input{Ref/Vector_2.tex} +\KernelRefLayout +\input{Ref/Vector_3.tex} +\KernelRefLayout +\input{Ref/x_equal.tex} +\KernelRefLayout +\input{Ref/y_equal.tex} +\KernelRefLayout +\input{Ref/z_equal.tex} diff --git a/Packages/Kernel_23/doc_tex/kernel/predicates_constructions.tex b/Packages/Kernel_23/doc_tex/kernel/predicates_constructions.tex new file mode 100644 index 00000000000..68bd04c54a6 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/predicates_constructions.tex @@ -0,0 +1,156 @@ +\chapter{Predicates and Constructions} + +\section{Predicates} +Predicates are at the heart of a geometry kernel. They are basic units +for the composition of geometric algorithms and encapsulate decisisons. +Hence their correctness is crucial for the control flow and hence for +the correctness of an implementation of a geometric algorithm. \cgal\ uses +the term predicate in a generalized sense. Not only components returning a +Boolean value are called predicates but also components returning an +enumeration type like a \ccc{Comparison_result} or an \ccc{Orientation}. +We say components, because predicates are implemented both as functions and +function objects (provided by a kernel class). + +\cgal\ provides predicates for the \ccHtmlNoLinksFrom{orientation} of point +sets (\ccc{orientation}, \ccc{leftturn}, \ccc{rightturn}, \ccc{collinear}, +\ccc{coplanar}), for comparing points according to some given order, +especially for comparing Cartesian coordinates +(e.g.~\ccc{lexicographically_xy_smaller}), in-circle and in-sphere tests, +and predicates to compare distances. + +\section{Constructions} +Functions and function objects that generate objects that are neither +of type \ccc{bool} nor enum types are called constructions. +Constructions involve computation of new numerical values and may be +imprecise due to rounding errors unless a kernel with an exact number type is +used. + +Affine transformations (\ccc{Aff_transformation_2}, +\ccc{Aff_transformation_3}) allow to generate new object instances under +arbitrary affine transformations. These transformations include translations, +rotations (in 2D only) and scaling. Most of the geometric objects in a +kernel have a member function \ccc{transform(Aff_transformation t)} +which applies the transformation to the object instance. + +{\cgal} also provides a set of functions that detect or compute the +\ccHtmlNoLinksFrom{intersection}\index{intersection} +between objects of the 2D kernel, and many objects in the 3D kernel, +and functions to calculate their +squared distance\index{distance}\index{distance!squared}. +Moreover, some member functions of kernel objects are constructions. + +So there are routines that compute the square of the Euclidean distance, but no +routines that compute the distance itself. Why? +First of all, the two values can be derived from each other quite easily (by +taking the square root or taking the square). So, supplying only the one and +not the other is only a minor inconvenience for the user. +Second, often either value can be used. This is for example the case when +(squared) distances are compared. +Third, the library wants to stimulate the use of the squared distance instead +of the distance. The squared distance can be computed in more cases and the +computation is cheaper. +We do this by not providing the perhaps more natural routine, +The problem of a distance routine is that it needs the \ccStyle{sqrt} +operation. +This has two drawbacks: +\begin{itemize} +\item +The \ccStyle{sqrt} operation can be costly. Even if it is not very costly for +a specific number type and platform, avoiding it is always cheaper. +\item +There are number types on which no \ccStyle{sqrt} operation is defined, +especially integer types and rationals. +\end{itemize} + +\section{Polymorphic Return Values} +Some functions can return different types of objects. A typical +\CC\ solution to this problem is to derive all possible return +types from a common base class, to return a pointer to this +class and to perform a dynamic cast on this pointer. The class +\ccc{Object} provides an abstraction. +An object \ccStyle{obj} of the class \ccc{Object} can +represent an arbitrary class. The only operations it provides is +to make copies and assignments, so that you can put them in lists +or arrays. Note that \ccc{Object} is NOT a common base class for the +elementary classes. Therefore, there is no +automatic conversion from these classes to \ccc{Object} Rather +this is done with the global function \ccc{make_object()}. This +encapsulation mechanism requires the use of \ccc{assign} to use +the functionality of the encapsulated class. + +\ccExample +In the following example, the object class is used as return value for the +\ccHtmlNoLinksFrom{intersection} computation, as there are possibly different return values. + +\begin{cprog} +{ + Point_2< Cartesian > point; + Segment_2< Cartesian > segment, segment_1, segment_2; + + std::cin >> segment_1 >> segment_2; + + Object obj = intersection(segment_1, segment_2); + + if (assign(point, obj)) { + /* do something with point */ + } else if ((assign(segment, obj)) { + /* do something with segment*/ + } +\end{cprog} +\ccHtmlLinksOff% +\begin{cprog} + /* there was no intersection */ +} +\end{cprog} +\ccHtmlLinksOn% + +\medskip +The \ccHtmlNoLinksFrom{intersection} routine itself looks roughly as follows: + +\begin{cprog} + +template < class R > +Object intersection(Segment_2 s1, Segment_2 s2) +{ +\end{cprog} +\ccHtmlLinksOff% +\begin{cprog} + if (/* intersection in a point */ ) { +\end{cprog} +\ccHtmlLinksOn% +\begin{cprog} + Point_2 p = ... ; + return make_object(p); +\end{cprog} +\ccHtmlLinksOff% +\begin{cprog} + } else if (/* intersection in a segment */ ) { +\end{cprog} +\ccHtmlLinksOn% +\begin{cprog} + Segment_2 s = ... ; + return make_object(s); + } + return Object(); +} +\end{cprog} + +\section{Constructive Predicates} +For testing where a point $p$ lies with respect to a plane defined by three +points $q$, $r$ and $s$, one may be tempted to construct the plane +\ccc{Plane_3(q,r,s)} and use the method \ccc{oriented_side(p)}. +This may pay off if many tests with respect to the plane are made. +Nevertheless, unless the number type is exact, the constructed plane +is only approximated, and round-off errors may lead +\ccc{oriented_side(p)} to return an \ccHtmlNoLinksFrom{orientation} +which is different from the \ccHtmlNoLinksFrom{orientation} of $p$, $q$, $r$, +and $s$. + +In {\cgal}, we provide predicates in which such +geometric decisions are made directly with a reference to the input points +$p$, $q$, $r$, $s$, without an intermediary object like a plane. +For the above test, the recommended way to get the result is to use +\ccc{orientation(p,q,r,s)}. For exact number types like \ccc{leda_real}, +the situation is different. If several tests are to be made with the same +plane, it pays off to construct the plane and to use \ccc{oriented_side(p)}. + diff --git a/Packages/Kernel_23/doc_tex/kernel/preface.tex b/Packages/Kernel_23/doc_tex/kernel/preface.tex new file mode 100644 index 00000000000..be846044e62 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/preface.tex @@ -0,0 +1,97 @@ +\lcTex{\chapter*{Preface}} +\lcHtml{\chapter{Preface}} + +\cgal\ is a {\em Computational Geometry Algorithms Library} written in \CC, +developed by a consortium consisting of +\ccAnchor{http://www.inf.ethz.ch/}{ETH Z\"urich} (Switzerland), +\ccAnchor{http://www.inf.fu-berlin.de/}{Freie Universit{\"a}t Berlin} (Germany), +\ccAnchor{http://www.inria.fr/Equipes/PRISME-eng.html}{{\sc Inria} +Sophia-Antipolis} (France), +\ccAnchor{http://www.informatik.uni-halle.de/}{Martin-Luther-Universit{\"a}t +Halle-Wittenberg} (Germany), +\ccAnchor{http://www.mpi-sb.mpg.de/}{Max-Planck Institut f{\"u}r Informatik}, +Saarbr\"ucken (Germany), +\ccAnchor{http://info.risc.uni-linz.ac.at/}{{\sc Risc}} Linz (Austria) +\ccAnchor{http://www.math.tau.ac.il/}{Tel-Aviv University} (Israel), and +\ccAnchor{http://www.cs.uu.nl/}{Utrecht University} (The Netherlands). +You can find more information on the project on the +\ccAnchor{http://www.cs.uu.nl/CGAL/}{\cgal\ home page} +\ccTexHtml{at URL {\tt http://www.cgal.org}}{}. + +Should you have any questions, comments, remarks or criticism concerning +\cgal, please send a message to +\ccTexHtml{{\tt contact@cgal.org}}{<contact@cgal.org>}. + + +\section*{Editors} + +Stefan Schirra (Max-Planck Institut f\"ur Informatik). \\ +Remco Veltkamp (Utrecht University). \\ +Mariette Yvinec ({\sc Inria} Sophia-Antipolis). + +\section*{Authors} + +Herv\'e Br\"onnimann ({\sc Inria} Sophia-Antipolis). \\ +Andreas Fabri ({\sc Inria} Sophia-Antipolis).\\ +Geert-Jan Giezeman (Utrecht University).\\ +Lutz Kettner (ETH Z\"urich).\\ +Stefan Schirra (Max-Planck Institut f\"ur Informatik).\\ +Sven Sch\"onherr (Freie Universit{\"a}t Berlin). + +\section*{Design and Implementation History} + +At a meeting at Utrecht University in January 1995, +Olivier Devillers, Andreas Fabri, Wolfgang Freiseisen, +Geert-Jan Giezeman, Mark Overmars, Stefan Schirra, Otfried Schwarzkopf +(now Otfried Cheong), and Sven Sch\"onherr +discussed the foundations of the \cgal\ kernel. +Many design and software engineering issues were addressed, +e.g.\ naming conventions, coupling of classes +(flat versus deep class hierarchy), +memory allocation, programming conventions, modifiability of +atomic objects, points and vectors, storing additional information, +orthogonality of operations on the kernel objects, +viewing non-constant-size objects like polygons as +dynamic data structures (and hence not as part of the (innermost) kernel). + +The people attending the meeting delegated the compilation of +a draft specification to Stefan Schirra. +The resulting draft specification was intentionally modeled on \cgal's +precursors \protocgal\ and \plageo\ as well as on the geometric part of \leda. +The specification already featured coexistence of +\ccHtmlNoLinksFrom{Cartesian} and +homogeneous representation of point/vector data and parameterization +by number type(s). +During the discussion of the draft a kernel design group was formed. +The members of this group were Andreas Fabri, Geert-Jan Giezeman, +Lutz Kettner, Stefan Schirra, and Sven Sch\"onherr. +The work of the kernel design group led to significant changes and +improvements of the original design, e.g.\ the strong separation between +points and vectors. Probably the most important enhancement was the design +of a common superstructure for the previously uncoupled +\ccHtmlNoLinksFrom{Cartesian} and +homogeneous representations. One can say, that the kernel was designed +by this group. +The kernel was later revised based on suggestions by Herv\'e Br\"onnimann, +Bernd G\"artner, Michael Hoffmann, and Lutz Kettner. + +A first version of the kernel was internally made available at the beginning +of the \cgal-project ({\sc esprit ltr iv} project number 21957). +Since then many more people contributed to the evolution of the kernel +through discussions on the \cgal\ mailing lists. +The implementation based on +\ccHtmlNoLinksFrom{Cartesian} representation was (mostly) provided +by Andreas Fabri, the homogeneous representation (mostly) by Stefan Schirra. +Intersection and distance computations were implemented by Geert-Jan Giezeman. +The kernel is now maintained by Mariette Yvinec, Geert-Jan Giezeman, +and Stefan Schirra. + +\section*{Acknowledgement} + +This work was supported +by the Graduiertenkolleg `Algorithmische Diskrete Mathematik', +under grant DFG We 1265/2-1, +and by ESPRIT IV Long Term Research Projects No.~21957 (CGAL) +and No.~28155 (GALIA). + + diff --git a/Packages/Kernel_23/doc_tex/kernel/title.tex b/Packages/Kernel_23/doc_tex/kernel/title.tex new file mode 100644 index 00000000000..dbf3f6bec51 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/title.tex @@ -0,0 +1,38 @@ + +\pagestyle{empty} + +\begin{titlepage} +\mbox{} +\vskip3cm + +\ccTexHtml +{\centerline{\IpeScale{25}\Ipe{../Fig/c-simp.ipe} + \Ipe{../Fig/g-simp.ipe} \Ipe{../Fig/a-simp.ipe} \Ipe{../Fig/l-simp.ipe}}} + {

+ Logo C + Logo G + Logo A + Logo L +
+ [Computational Geometry Algorithms Library] +


} + +\vskip2cm +\centerline{ {\Huge\bf CGAL} {\huge\bf Reference Manual } } +\vskip1cm +\centerline{ {\huge Part 1: Kernel Library } } + +\vskip2cm +\newcommand{\mydate}{July 1998} +\ccTexHtml +{\renewcommand{\mydate}{\ifcase\the\month \or January\or + February\or March\or April\or May\or June\or July\or August\or + September\or October\or November\or December\fi~\the\year}}{} + \centerline{ {\large Release \cgalrelease, \mydate} } + +\end{titlepage} + + + + diff --git a/Packages/Kernel_23/doc_tex/kernel/transvecthree.gif b/Packages/Kernel_23/doc_tex/kernel/transvecthree.gif new file mode 100644 index 00000000000..5a478dbca9a Binary files /dev/null and b/Packages/Kernel_23/doc_tex/kernel/transvecthree.gif differ diff --git a/Packages/Kernel_23/doc_tex/kernel/transvectwo.gif b/Packages/Kernel_23/doc_tex/kernel/transvectwo.gif new file mode 100644 index 00000000000..b7396c6c9c8 Binary files /dev/null and b/Packages/Kernel_23/doc_tex/kernel/transvectwo.gif differ diff --git a/Packages/Kernel_23/doc_tex/kernel/user_manual.tex b/Packages/Kernel_23/doc_tex/kernel/user_manual.tex new file mode 100644 index 00000000000..17134065e04 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/user_manual.tex @@ -0,0 +1,5 @@ +\cleardoublepage +\input{introduction} +\input{kernel_representation} +\input{kernel_geometry} +\input{predicates_constructions} diff --git a/Packages/Kernel_23/doc_tex/kernel/wrapper.tex b/Packages/Kernel_23/doc_tex/kernel/wrapper.tex new file mode 100644 index 00000000000..8858a515b19 --- /dev/null +++ b/Packages/Kernel_23/doc_tex/kernel/wrapper.tex @@ -0,0 +1,57 @@ +\documentclass{book} + +\usepackage{cprog} +\usepackage{cc_manual} +\usepackage{pslatex} +\usepackage{epsfig} +\usepackage{cc_manual_index} +\usepackage{latex_converter} +\usepackage{makeidx} +\usepackage{amssymb} +\usepackage{graphicx} +\usepackage{path} +\usepackage{ipe} +\usepackage{longtable} + +% page dimensions +% --------------- +\textwidth 15.6cm +\textheight 23 cm +\topmargin -14mm +\evensidemargin 3mm +\oddsidemargin 3mm + +% default column layout +% --------------------- +% This is the recommended layout. It may be changed inside main.tex. + +\newcommand{\cgalColumnLayout}{\ccTexHtml{% + \ccSetThreeColumns{Oriented_side}{}{\hspace*{10cm}} + \ccPropagateThreeToTwoColumns}{}} + +\newcommand{\cgalrelease}{2.2-I-..} + +\makeindex + +\sloppy + +\begin{document} + +\include{title} +\pagestyle{plain} +\pagenumbering{roman} +\setcounter{page}{0} +\include{preface} +\cleardoublepage +\tableofcontents + +\cgalColumnLayout + +\include{main} + +\bibliographystyle{alpha} +\bibliography{../cgal-manual,geom} + +\lcTex{\printindex} +\end{document} + diff --git a/Packages/Kernel_23/include/CGAL/Aff_transformation_2.h b/Packages/Kernel_23/include/CGAL/Aff_transformation_2.h new file mode 100644 index 00000000000..cf55f4493cb --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Aff_transformation_2.h @@ -0,0 +1,234 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : Aff_transformation_2.fw +// file : Aff_transformation_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_AFF_TRANSFORMATION_2_H +#define CGAL_AFF_TRANSFORMATION_2_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#if defined(CGAL_CFG_INCOMPLETE_TYPE_BUG_1) && \ + !defined(CGAL_NO_LINE_TRANSFORM_IN_AT) +#define CGAL_NO_LINE_TRANSFORM_IN_AT +#endif // CGAL_CFG_INCOMPLETE_TYPE_BUG_1 + +#ifndef CGAL_LINE_2_H +#include +#endif // CGAL_LINE_2_H + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_AFF_TRANSFORMATIONH2_H +#include +#endif // CGAL_AFF_TRANSFORMATIONH2_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_AFF_TRANSFORMATIONC2_H +#include +#endif // CGAL_AFF_TRANSFORMATIONC2_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +CGAL_BEGIN_NAMESPACE + +template +class Aff_transformation_2 : public R_::Aff_transformation_2_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Line_2_base RLine_2; + typedef typename R::Direction_2_base RDirection_2; + typedef typename R::Aff_transformation_2_base RAff_transformation_2; + + // default constructor + Aff_transformation_2() + : RAff_transformation_2() + {} + + // copy constructor + Aff_transformation_2(const CGAL::Aff_transformation_2 &t) + : RAff_transformation_2(t) + {} + + // up cast constructor + Aff_transformation_2(const RAff_transformation_2& t) + : RAff_transformation_2(t) + {} + + // Identity: + Aff_transformation_2(const Identity_transformation tag) + : RAff_transformation_2(tag) + {} + + // Translation: + Aff_transformation_2(const Translation tag, + const CGAL::Vector_2 &v) + : RAff_transformation_2(tag, v) + {} + + // Rational Rotation: + Aff_transformation_2(const Rotation tag, + const CGAL::Direction_2 &d, + const RT &num, + const RT &den = RT(1)) + : RAff_transformation_2(tag, RDirection_2(d), num, den) + {} + + Aff_transformation_2(const Rotation tag, + const RT &sin, + const RT &cos, + const RT &den = RT(1)) + : RAff_transformation_2(tag, sin, cos, den) + {} + + // Reflection: + Aff_transformation_2(const Reflection tag, + const CGAL::Line_2& l ) + : RAff_transformation_2(tag, l) + {} + + + // Scaling: + Aff_transformation_2(const Scaling tag, + const RT &s, + const RT &w= RT(1)) + : RAff_transformation_2(tag, s, w) + {} + + // The general case: + Aff_transformation_2(const RT & m11, + const RT & m12, + const RT & m13, + + const RT & m21, + const RT & m22, + const RT & m23, + + const RT &w= RT(1)) + : RAff_transformation_2(m11, m12, m13, + m21, m22, m23, + w) + {} + + Aff_transformation_2(const RT & m11, const RT & m12, + const RT & m21, const RT & m22, + const RT &w = RT(1)) + : RAff_transformation_2(m11, m12, + m21, m22, + w) + {} + + ~Aff_transformation_2() + {} + + CGAL::Point_2 transform(const CGAL::Point_2 &p) const + { return RAff_transformation_2::transform(p); } + + CGAL::Point_2 operator()(const CGAL::Point_2 &p) const + { return transform(p); } + + CGAL::Vector_2 transform(const CGAL::Vector_2 &v) const + { return RAff_transformation_2::transform(v); } + + CGAL::Vector_2 operator()(const CGAL::Vector_2 &v) const + { return transform(v); } + + CGAL::Direction_2 transform(const CGAL::Direction_2 &d) const + { return RAff_transformation_2::transform(d); } + + CGAL::Direction_2 operator()(const CGAL::Direction_2 &d) const + { return transform(d); } + + CGAL::Line_2 transform(const CGAL::Line_2 &l) const + { +#ifndef CGAL_NO_LINE_TRANSFORM_IN_AT + return RAff_transformation_2::transform(l); +#else + return + ((const RLine_2&)l).transform((const RAff_transformation_2&)(*this)); +#endif // CGAL_NO_LINE_TRANSFORM_IN_AT + } + + CGAL::Line_2 operator()(const CGAL::Line_2 &l) const + { return transform(l); } + + + CGAL::Aff_transformation_2 + inverse() const + { return RAff_transformation_2::inverse(); } + + bool is_even() const + { return RAff_transformation_2::is_even(); } + + bool is_odd() const + { return !is_even(); } + + CGAL::Aff_transformation_2 + operator*(const CGAL::Aff_transformation_2 &t) const + { return RAff_transformation_2::operator*(t); } + + FT cartesian(int i, int j) const + { return RAff_transformation_2::cartesian(i,j); } + RT homogeneous(int i, int j) const + { return RAff_transformation_2::homogeneous(i,j); } + FT m(int i, int j) const + { return RAff_transformation_2::m(i,j); } + RT hm(int i, int j) const + { return RAff_transformation_2::hm(i,j); } + +}; + +#ifndef NO_OSTREAM_INSERT_AFF_TRANSFORMATION_2 +template < class R > +std::ostream & +operator<<(std::ostream &os, const CGAL::Aff_transformation_2 &t) +{ + typedef typename R::Aff_transformation_2_base RAff_transformation_2; + return os << (const RAff_transformation_2&)t; +} +#endif // NO_OSTREAM_INSERT_AFF_TRANSFORMATION_2 + +#ifndef NO_ISTREAM_EXTRACT_AFF_TRANSFORMATION_2 +template < class R > +std::istream & +operator>>(std::istream &is, CGAL::Aff_transformation_2 &t) +{ + typedef typename R::Aff_transformation_2_base RAff_transformation_2; + return is >> (RAff_transformation_2&)t; +} +#endif // NO_ISTREAM_EXTRACT_AFF_TRANSFORMATION_2 + +CGAL_END_NAMESPACE + + +#endif // CGAL_AFF_TRANSFORMATION_2_H diff --git a/Packages/Kernel_23/include/CGAL/Aff_transformation_3.h b/Packages/Kernel_23/include/CGAL/Aff_transformation_3.h new file mode 100644 index 00000000000..a327c73858d --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Aff_transformation_3.h @@ -0,0 +1,202 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : Aff_transformation_3.fw +// file : Aff_transformation_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_AFF_TRANSFORMATION_3_H +#define CGAL_AFF_TRANSFORMATION_3_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#if defined(CGAL_CFG_INCOMPLETE_TYPE_BUG_1) && \ + !defined(CGAL_NO_PLANE_TRANSFORM_IN_AT) +#define CGAL_NO_PLANE_TRANSFORM_IN_AT +#endif // CGAL_CFG_INCOMPLETE_TYPE_BUG_1 + +#ifdef CGAL_HOMOGENEOUS_H +#include +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#include +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#include +#include +#include +#include + +CGAL_BEGIN_NAMESPACE + +template +class Aff_transformation_3 : public R_::Aff_transformation_3_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Plane_3_base RPlane_3; + typedef typename R::Aff_transformation_3_base RAff_transformation_3; + + // default constructor + Aff_transformation_3() : RAff_transformation_3() + {} + + // copy constructor + Aff_transformation_3(const CGAL::Aff_transformation_3& t) + : RAff_transformation_3(t) + {} + + // up cast constructor + Aff_transformation_3(const RAff_transformation_3& t) + : RAff_transformation_3(t) + {} + + // identity: + Aff_transformation_3(const Identity_transformation& tag) + : RAff_transformation_3(tag) + {} + + // translation: + Aff_transformation_3(const Translation tag, + const CGAL::Vector_3& v) + : RAff_transformation_3(tag, v) + {} + + // scaling: + Aff_transformation_3(const Scaling tag, + const RT& s, + const RT& w= RT(1) ) + : RAff_transformation_3(tag, s, w) + {} + + // the general case: + Aff_transformation_3( + const RT& m11, const RT& m12, const RT& m13, const RT& m14, + const RT& m21, const RT& m22, const RT& m23, const RT& m24, + const RT& m31, const RT& m32, const RT& m33, const RT& m34, + const RT& w= RT(1) ) + : RAff_transformation_3(m11, m12, m13, m14, + m21, m22, m23, m24, + m31, m32, m33, m34, + w) + {} + Aff_transformation_3( + const RT& m11, const RT& m12, const RT& m13, + const RT& m21, const RT& m22, const RT& m23, + const RT& m31, const RT& m32, const RT& m33, + const RT& w = RT(1) ) + : RAff_transformation_3(m11, m12, m13, + m21, m22, m23, + m31, m32, m33, + w) + {} + // dtor + ~Aff_transformation_3() + {} + // transformations + CGAL::Point_3 transform(const CGAL::Point_3& p) const + { return RAff_transformation_3::transform(p); } + CGAL::Point_3 operator()(const CGAL::Point_3& p) const + { return RAff_transformation_3::transform(p); } + CGAL::Vector_3 transform(const CGAL::Vector_3& v) const + { return RAff_transformation_3::transform(v); } + CGAL::Vector_3 operator()(const CGAL::Vector_3& v) const + { return RAff_transformation_3::transform(v); } + CGAL::Direction_3 transform(const CGAL::Direction_3& d) const + { return RAff_transformation_3::transform(d); } + CGAL::Direction_3 operator()(const CGAL::Direction_3& d) const + { return RAff_transformation_3::transform(d); } +#ifndef CGAL_NO_PLANE_TRANSFORM_IN_AT + CGAL::Plane_3 transform(const CGAL::Plane_3& pl) const + { return RAff_transformation_3::transform(pl); } +#else + CGAL::Plane_3 + transform(const CGAL::Plane_3& pl) const + { + return + (( const RPlane_3& )pl).transform( (const RAff_transformation_3& )(*this) ); + } +#endif // CGAL_NO_PLANE_TRANSFORM_IN_AT + CGAL::Plane_3 operator()(const CGAL::Plane_3& pl) const + { return transform(pl); } + // further members + CGAL::Aff_transformation_3 + inverse() const + { return RAff_transformation_3::inverse(); } + bool is_even() const + { return RAff_transformation_3::is_even(); } + bool is_odd() const + { return !is_even(); } + // access + FT cartesian(int i, int j) const + { return RAff_transformation_3::cartesian(i,j); } + RT homogeneous(int i, int j) const + { return RAff_transformation_3::homogeneous(i,j); } + FT m(int i, int j) const + { return RAff_transformation_3::m(i,j); } + RT hm(int i, int j) const + { return RAff_transformation_3::hm(i,j); } + // composition + CGAL::Aff_transformation_3 + operator*(const CGAL::Aff_transformation_3& t) const + { + return + static_cast(*this) * + static_cast(t) ; + } +}; + +// I/O operators +#ifndef NO_OSTREAM_INSERT_AFF_TRANSFORMATION_3 +template < class R > +std::ostream& +operator<<(std::ostream& os, const CGAL::Aff_transformation_3& t) +{ + typedef typename R::Aff_transformation_3_base RAff_transformation_3; + return os << static_cast(t); +} +#endif // NO_OSTREAM_INSERT_AFF_TRANSFORMATION_3 + +#ifndef NO_ISTREAM_EXTRACT_AFF_TRANSFORMATION_3 +template < class R > +std::istream& +operator>>(std::istream& is, CGAL::Aff_transformation_3& t) +{ + typedef typename R::Aff_transformation_3_base RAff_transformation_3; + return is >> static_cast(t); +} +#endif // NO_ISTREAM_EXTRACT_AFF_TRANSFORMATION_3 + +CGAL_END_NAMESPACE + + +#endif // CGAL_AFF_TRANSFORMATION_3_H diff --git a/Packages/Kernel_23/include/CGAL/Bbox_2.h b/Packages/Kernel_23/include/CGAL/Bbox_2.h new file mode 100644 index 00000000000..0ad2965252b --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Bbox_2.h @@ -0,0 +1,178 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : Bbox_2.fw +// file : Bbox_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_BBOX_2_H +#define CGAL_BBOX_2_H + +#ifndef CGAL_BASIC_H +#include +#endif // CGAL_BASIC_H +#ifndef CGAL_CARTESIAN_CLASSES_H +#include +#endif // CGAL_CARTESIAN_CLASSES_H +#ifndef FOURTUPLE_H +#include +#endif // FOURTUPLE_H + +CGAL_BEGIN_NAMESPACE + +class Bbox_2 : public Handle_for< Fourtuple > +{ +public: + Bbox_2(); + Bbox_2(double x_min, double y_min, + double x_max, double y_max); + + bool operator==(const Bbox_2 &b) const; + bool operator!=(const Bbox_2 &b) const; + + int dimension() const; + double xmin() const; + double ymin() const; + double xmax() const; + double ymax() const; + + double max(int i) const; + double min(int i) const; + + Bbox_2 operator+(const Bbox_2 &b) const; + +}; + + +inline +int +Bbox_2::dimension() const +{ return 2; } + +inline +double +Bbox_2::xmin() const +{ return ptr->e0; } + +inline +double +Bbox_2::ymin() const +{ return ptr->e1; } + +inline +double +Bbox_2::xmax() const +{ return ptr->e2; } + +inline +double +Bbox_2::ymax() const +{ return ptr->e3; } + +inline +double +Bbox_2::min(int i) const +{ + CGAL_kernel_precondition( (i == 0 ) || ( i == 1 ) ); + if(i == 0) { return xmin(); } + return ymin(); +} + +inline +double +Bbox_2::max(int i) const +{ + CGAL_kernel_precondition( (i == 0 ) || ( i == 1 ) ); + if(i == 0) { return xmax(); } + return ymax(); +} +inline Bbox_2 Bbox_2::operator+(const Bbox_2 &b) const +{ + return Bbox_2(std::min(xmin(), b.xmin()), + std::min(ymin(), b.ymin()), + std::max(xmax(), b.xmax()), + std::max(ymax(), b.ymax())); +} +inline bool do_overlap(const Bbox_2 &bb1, const Bbox_2 &bb2) +{ + // check for emptiness ?? + if (bb1.xmax() < bb2.xmin() || bb2.xmax() < bb1.xmin()) + return false; + if (bb1.ymax() < bb2.ymin() || bb2.ymax() < bb1.ymin()) + return false; + return true; +} + +#ifndef NO_OSTREAM_INSERT_BBOX_2 +inline +std::ostream& +operator<<(std::ostream &os, const Bbox_2 &b) +{ + switch(os.iword(IO::mode)) { + case IO::ASCII : + os << b.xmin() << ' ' << b.ymin() << ' ' + << b.xmax() << ' ' << b.ymax(); + break; + case IO::BINARY : + write(os, b.xmin()); + write(os, b.ymin()); + write(os, b.xmax()); + write(os, b.ymax()); + break; + default: + os << "Bbox_2(" << b.xmin() << ", " << b.ymin() << ", " + << b.xmax() << ", " << b.ymax() << ")"; + break; + } + return os; +} +#endif // NO_OSTREAM_INSERT_BBOX_2 + + + +#ifndef NO_ISTREAM_EXTRACT_BBOX_2 +inline +std::istream& +operator>>(std::istream &is, Bbox_2 &b) +{ + double xmin, ymin, xmax, ymax; + + switch(is.iword(IO::mode)) { + case IO::ASCII : + is >> xmin >> ymin >> xmax >> ymax; + break; + case IO::BINARY : + read(is, xmin); + read(is, ymin); + read(is, xmax); + read(is, ymax); + break; + } + b = Bbox_2(xmin, ymin, xmax, ymax); + return is; +} +#endif // NO_ISTREAM_EXTRACT_BBOX_2 + + +CGAL_END_NAMESPACE + + +#endif // CGAL_BBOX_2_H diff --git a/Packages/Kernel_23/include/CGAL/Bbox_3.h b/Packages/Kernel_23/include/CGAL/Bbox_3.h new file mode 100644 index 00000000000..b378a7f24ab --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Bbox_3.h @@ -0,0 +1,181 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : Bbox_3.fw +// file : Bbox_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_BBOX_3_H +#define CGAL_BBOX_3_H + +#ifndef CGAL_BASIC_H +#include +#endif // CGAL_BASIC_H +#ifndef CGAL_CARTESIAN_CLASSES_H +#include +#endif // CGAL_CARTESIAN_CLASSES_H +#ifndef SIXTUPLE_H +#include +#endif // SIXTUPLE_H + +CGAL_BEGIN_NAMESPACE + +class Bbox_3 : public Handle_for< Sixtuple > +{ +public: + Bbox_3(); + Bbox_3(double x_min, double y_min, double zmin, + double x_max, double y_max, double z_max); + + double xmin() const; + double ymin() const; + double zmin() const; + double xmax() const; + double ymax() const; + double zmax() const; + + Bbox_3 operator+(const Bbox_3& b) const; +}; + +inline +Bbox_3::Bbox_3() +{ new ( static_cast< void*>(ptr)) Sixtuple(); } + +inline +Bbox_3::Bbox_3(double x_min, double y_min, double z_min, + double x_max, double y_max, double z_max) +{ + new ( static_cast< void*>(ptr)) Sixtuple(x_min, y_min, z_min, + x_max, y_max, z_max); +} + +inline +double +Bbox_3::xmin() const +{ return ptr->e0; } + +inline +double +Bbox_3::ymin() const +{ return ptr->e1; } + +inline +double +Bbox_3::zmin() const +{ return ptr->e2; } + +inline +double +Bbox_3::xmax() const +{ return ptr->e3; } + +inline +double +Bbox_3::ymax() const +{ return ptr->e4; } + +inline +double +Bbox_3::zmax() const +{ return ptr->e5; } +inline Bbox_3 Bbox_3::operator+(const Bbox_3& b) const +{ + return Bbox_3(std::min(xmin(), b.xmin()), + std::min(ymin(), b.ymin()), + std::min(zmin(), b.zmin()), + std::max(xmax(), b.xmax()), + std::max(ymax(), b.ymax()), + std::max(zmax(), b.zmax())); +} +inline bool do_overlap(const Bbox_3& bb1, const Bbox_3& bb2) +{ + // check for emptiness ?? + if (bb1.xmax() < bb2.xmin() || bb2.xmax() < bb1.xmin()) + return false; + if (bb1.ymax() < bb2.ymin() || bb2.ymax() < bb1.ymin()) + return false; + if (bb1.zmax() < bb2.zmin() || bb2.zmax() < bb1.zmin()) + return false; + return true; +} +#ifndef NO_OSTREAM_INSERT_BBOX_3 +inline +std::ostream& +operator<<(std::ostream &os, const Bbox_3& b) +{ + switch(os.iword(IO::mode)) + { + case IO::ASCII : + return os << b.xmin() << ' ' << b.ymin() << ' ' << b.zmin(); + case IO::BINARY : + write(os, b.xmin()); + write(os, b.ymin()); + write(os, b.zmin()); + write(os, b.xmax()); + write(os, b.ymax()); + write(os, b.zmax()); + return os; + default: + os << "Bbox_3((" << b.xmin() + << ", " << b.ymin() + << ", " << b.zmin() << "), ("; + os << b.xmax() + << ", " << b.ymax() + << ", " << b.zmax() << "))"; + return os; + } +} +#endif // NO_OSTREAM_INSERT_BBOX_3 + + + +#ifndef NO_ISTREAM_EXTRACT_BBOX_3 +inline +std::istream& +operator>>(std::istream &is, Bbox_3& b) +{ + double xmin, ymin, zmin, xmax, ymax, zmax; + + switch(is.iword(IO::mode)) + { + case IO::ASCII : + is >> xmin >> ymin >> xmax >> ymax; + break; + case IO::BINARY : + read(is, xmin); + read(is, ymin); + read(is, zmin); + read(is, xmax); + read(is, ymax); + read(is, zmax); + break; + } + b = Bbox_3(xmin, ymin, zmin, xmax, ymax, zmax); + return is; +} + +#endif // NO_ISTREAM_EXTRACT_BBOX_3 + + +CGAL_END_NAMESPACE + + +#endif // CGAL_BBOX_3_H diff --git a/Packages/Kernel_23/include/CGAL/Circle_2.h b/Packages/Kernel_23/include/CGAL/Circle_2.h new file mode 100644 index 00000000000..44ae40e305a --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Circle_2.h @@ -0,0 +1,219 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : Circle_2.fw +// file : Circle_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Andreas Fabri +// Sven Schoenherr +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_CIRCLE_2_H +#define CGAL_CIRCLE_2_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_CIRCLEH2_H +#include +#endif // CGAL_CIRCLEH2_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_CIRCLEC2_H +#include +#endif // CGAL_CIRCLEC2_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_POINT_2_H +#include +#endif // CGAL_POINT_2_H + +CGAL_BEGIN_NAMESPACE + +template + class Circle_2 : public R_::Circle_2_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Circle_2_base RCircle_2; + + Circle_2() + : RCircle_2() + {} + + Circle_2(const CGAL::Circle_2 &t) + : RCircle_2((RCircle_2&)t) + {} + + Circle_2(const RCircle_2& t) + : RCircle_2(t) + {} + + Circle_2(const CGAL::Point_2 ¢er, + const FT &squared_radius, + const Orientation &orientation) + : RCircle_2(center, squared_radius, orientation) + {} + + Circle_2(const CGAL::Point_2 ¢er, + const FT &squared_radius) + : RCircle_2(center, squared_radius, COUNTERCLOCKWISE) + {} + + Circle_2(const CGAL::Point_2 &p, + const CGAL::Point_2 &q, + const CGAL::Point_2 &r) + : RCircle_2(p,q,r) + {} + + Circle_2(const CGAL::Point_2 & p, + const CGAL::Point_2 & q, + const Orientation &orientation) + : RCircle_2(p,q,orientation) + {} + + Circle_2(const CGAL::Point_2 & p, + const CGAL::Point_2 & q) + : RCircle_2(p,q,COUNTERCLOCKWISE) + {} + + Circle_2(const CGAL::Point_2 & center, + const Orientation& orientation) + : RCircle_2(center,FT(0),orientation) + {} + + Circle_2(const CGAL::Point_2 & center) + : RCircle_2(center,FT(0),COUNTERCLOCKWISE) + {} + + + bool + operator==(const CGAL::Circle_2 &t) const + { return RCircle_2::operator==(t); } + + bool + operator!=(const CGAL::Circle_2 &t) const + { return !(*this == t); } + + + CGAL::Point_2 + center() const + { return RCircle_2::center(); } + + FT + squared_radius() const + { return RCircle_2::squared_radius(); } + + Orientation orientation() const + { return RCircle_2::orientation(); } + + + CGAL::Circle_2 + + orthogonal_transform(const CGAL::Aff_transformation_2 &t) const + { return RCircle_2::orthogonal_transform(t); } + +/* + CGAL::Circle_2 transform(const CGAL::Aff_transformation_2 &t) const + { + return Circle_2::transform(t); + } +*/ + + Oriented_side + oriented_side(const CGAL::Point_2 &p) const + { return RCircle_2::oriented_side(p); } + + Bounded_side + bounded_side(const CGAL::Point_2 &p) const + { return RCircle_2::bounded_side(p); } + + bool + has_on_boundary(const CGAL::Point_2 &p) const + { return RCircle_2::has_on_boundary(p); } + + bool + has_on_positive_side(const CGAL::Point_2 &p) const + { return RCircle_2::has_on_positive_side(p); } + + bool + has_on_negative_side(const CGAL::Point_2 &p) const + { return RCircle_2::has_on_negative_side(p); } + + bool + has_on_bounded_side(const CGAL::Point_2 &p) const + { return RCircle_2::has_on_bounded_side(p); } + + bool + has_on_unbounded_side(const CGAL::Point_2 &p) const + { return RCircle_2::has_on_unbounded_side(p); } + + bool + is_degenerate() const + { return RCircle_2::is_degenerate(); } + + CGAL::Circle_2 + opposite() const + { + return CGAL::Circle_2(center(), squared_radius(), + CGAL::opposite(orientation())); + } + + Bbox_2 + bbox() const + { return RCircle_2::bbox(); } + +}; + + +#ifndef NO_OSTREAM_INSERT_CIRCLE_2 +template < class R > +std::ostream & +operator<<(std::ostream &os, const Circle_2 &c) +{ + typedef typename R::Circle_2_base RCircle_2; + return os << (const RCircle_2&)c; +} + +#endif // NO_OSTREAM_INSERT_CIRCLE_2 + +#ifndef NO_ISTREAM_EXTRACT_CIRCLE_2 +template < class R > +std::istream & +operator>>(std::istream &is, Circle_2 &c) +{ + typedef typename R::Circle_2_base RCircle_2; + return is >> (RCircle_2&)c; +} +#endif // NO_ISTREAM_EXTRACT_CIRCLE_2 + +CGAL_END_NAMESPACE + + +#endif // CGAL_CIRCLE_2_H diff --git a/Packages/Kernel_23/include/CGAL/Direction_2.h b/Packages/Kernel_23/include/CGAL/Direction_2.h new file mode 100644 index 00000000000..212ffd94173 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Direction_2.h @@ -0,0 +1,173 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : Direction_2.fw +// file : Direction_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_DIRECTION_2_H +#define CGAL_DIRECTION_2_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_DIRECTIONH2_H +#include +#endif // CGAL_DIRECTIONH2_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_DIRECTIONC2_H +#include +#endif // CGAL_DIRECTIONC2_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_VECTOR_2_H +#include +#endif // CGAL_VECTOR_2_H + +CGAL_BEGIN_NAMESPACE + +template +class Direction_2 : public R_::Direction_2_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Vector_2_base RVector_2; + typedef typename R::Direction_2_base RDirection_2; + // typedef typename R::Aff_transformation_2 Aff_transformation_2; + + Direction_2() + {} + + Direction_2(const CGAL::Direction_2 &d) + : RDirection_2((const RDirection_2&)d) + {} + + + Direction_2(const RDirection_2& d) + : RDirection_2(d) + {} + + + Direction_2(const RVector_2& v) + : RDirection_2(v) + {} + + Direction_2(const RT &x, const RT &y) + : RDirection_2(x,y) + {} + + bool + operator==(const CGAL::Direction_2 &d) const + { return RDirection_2::operator==(d); } + + bool + operator!=(const CGAL::Direction_2 &d) const + { return !(*this == d); } + + bool + operator>=(const CGAL::Direction_2 &d) const + { return RDirection_2::operator>=(d); } + + bool + operator<=(const CGAL::Direction_2 &d) const + { return RDirection_2::operator<=(d); } + + bool + operator>(const CGAL::Direction_2 &d) const + { return RDirection_2::operator>(d); } + + bool + operator<(const CGAL::Direction_2 &d) const + { return RDirection_2::operator<(d); } + + bool + counterclockwise_in_between(const CGAL::Direction_2 &d1, + const CGAL::Direction_2 &d2) const + { return RDirection_2::counterclockwise_in_between(d1,d2); } + + CGAL::Vector_2 + vector() const + { return (CGAL::Vector_2)RDirection_2::to_vector(); } + + CGAL::Vector_2 + to_vector() const + { return (CGAL::Vector_2)RDirection_2::to_vector(); } + + CGAL::Direction_2 + transform(const CGAL::Aff_transformation_2 &t) const + { return RDirection_2::transform(t); } + + CGAL::Direction_2 + operator-() const + { return RDirection_2::operator-(); } + + RT + delta(int i) const + { return RDirection_2::delta(i); } + + RT + dx() const + { return RDirection_2::dx(); } + + RT + dy() const + { return RDirection_2::dy(); } +}; + + +#ifndef NO_OSTREAM_INSERT_DIRECTION_2 +template < class R > +std::ostream & +operator<<(std::ostream &os, const Direction_2 &d) +{ + typedef typename R::Direction_2_base RDirection_2; + return os << (const RDirection_2&)d; +} + +#endif // NO_OSTREAM_INSERT_DIRECTION_2 + +#ifndef NO_ISTREAM_EXTRACT_DIRECTION_2 +template < class R > +std::istream & +operator>>(std::istream &is, Direction_2 &p) +{ + typedef typename R::Direction_2_base RDirection_2; + return is >> (RDirection_2&)p; +} +#endif // NO_ISTREAM_EXTRACT_DIRECTION_2 + + +CGAL_END_NAMESPACE + + +#endif // CGAL_DIRECTION_2_H diff --git a/Packages/Kernel_23/include/CGAL/Direction_3.h b/Packages/Kernel_23/include/CGAL/Direction_3.h new file mode 100644 index 00000000000..d4c9a7fb3fb --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Direction_3.h @@ -0,0 +1,134 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : Direction_3.fw +// file : Direction_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_DIRECTION_3_H +#define CGAL_DIRECTION_3_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_DIRECTIONH3_H +#include +#endif // CGAL_DIRECTIONH3_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_DIRECTIONC3_H +#include +#endif // CGAL_DIRECTIONC3_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_VECTOR_3_H +#include +#endif // CGAL_VECTOR_3_H + +CGAL_BEGIN_NAMESPACE + +template +class Direction_3 : public R_::Direction_3_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Direction_3_base RDirection_3; + typedef typename R::Vector_3_base RVector_3; + + Direction_3() + {} + Direction_3(const CGAL::Direction_3& d) + : RDirection_3( (const RDirection_3& )d ) + {} + Direction_3(const RDirection_3& d) + : RDirection_3(d) + {} + Direction_3(const RVector_3& v) + : RDirection_3(v) + {} + Direction_3(const RT& hx, const RT& hy, const RT& hz) + : RDirection_3(hx, hy, hz) + {} + + bool operator==(const CGAL::Direction_3 & d) const + { return RDirection_3::operator==(d); } + + bool operator!=(const CGAL::Direction_3 & d) const + { return !(*this == d); } + + CGAL::Vector_3 vector() const + { return (CGAL::Vector_3)RDirection_3::to_vector(); } + + CGAL::Vector_3 to_vector() const + { return (CGAL::Vector_3)RDirection_3::to_vector(); } + + CGAL::Direction_3 transform(const CGAL::Aff_transformation_3 & t) const + { return RDirection_3::transform(t); } + + CGAL::Direction_3 operator-() const + { return RDirection_3::operator-(); } + + RT delta(int i) const + { return RDirection_3::delta(i); } + + RT dx() const + { return RDirection_3::dx(); } + + RT dy() const + { return RDirection_3::dy(); } + + RT dz() const + { return RDirection_3::dz(); } +}; + + +#ifndef NO_OSTREAM_INSERT_DIRECTION_3 +template < class R > +std::ostream& operator<<(std::ostream& os, const Direction_3& d) +{ + typedef typename R::Direction_3_base RDirection_3; + return os << (const RDirection_3& )d; } +#endif // NO_OSTREAM_INSERT_DIRECTION_3 + + +#ifndef NO_ISTREAM_EXTRACT_DIRECTION_3 +template < class R > +std::istream& operator>>(std::istream& is, Direction_3& p) +{ + typedef typename R::Direction_3_base RDirection_3; + return is >> (RDirection_3& )p; } +#endif // NO_ISTREAM_EXTRACT_DIRECTION_3 + +CGAL_END_NAMESPACE + + +#endif // CGAL_DIRECTION_3_H diff --git a/Packages/Kernel_23/include/CGAL/Fourtuple.h b/Packages/Kernel_23/include/CGAL/Fourtuple.h new file mode 100644 index 00000000000..632d01ad4b7 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Fourtuple.h @@ -0,0 +1,70 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : Tuples.fw +// file : Fourtuple.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL__FOURTUPLE_H +#define CGAL__FOURTUPLE_H + +CGAL_BEGIN_NAMESPACE + +template < class T > +class _Fourtuple : public Rep +{ +public: + T e0; + T e1; + T e2; + T e3; + + _Fourtuple() + {} + _Fourtuple(const T & a0, const T & a1, const T & a2, const T & a3) + : e0(a0), e1(a1), e2(a2), e3(a3) + {} + + ~_Fourtuple() + {} +}; + +template < class T > +class Fourtuple : public Ref_counted +{ +public: + T e0; + T e1; + T e2; + T e3; + + Fourtuple() + {} + + Fourtuple(const T & a0, const T & a1, const T & a2, const T & a3) + : e0(a0), e1(a1), e2(a2), e3(a3) + {} + +}; + +CGAL_END_NAMESPACE + +#endif // CGAL__FOURTUPLE_H diff --git a/Packages/Kernel_23/include/CGAL/Handle.h b/Packages/Kernel_23/include/CGAL/Handle.h new file mode 100644 index 00000000000..117db545748 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Handle.h @@ -0,0 +1,119 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : Handle.fw +// file : Handle.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_HANDLE_H +#define CGAL_HANDLE_H +#include + +CGAL_BEGIN_NAMESPACE + +class Leda_like_rep +{ + friend class Leda_like_handle; + protected: + Leda_like_rep() { count = 1; } + virtual ~Leda_like_rep() {} + + int count; +}; + +class Leda_like_handle +{ + public: + Leda_like_handle() + { PTR = (Leda_like_rep*)NULL; } + // { PTR = (Leda_like_rep*)0xefefefef; } + + Leda_like_handle(const Leda_like_handle& x) + { + CGAL_kernel_precondition( x.PTR != (Leda_like_rep*)NULL ); + PTR = x.PTR; + PTR->count++; + } + + + ~Leda_like_handle() + { if ( PTR && (--PTR->count == 0)) { delete PTR; } } + + Leda_like_handle& + operator=(const Leda_like_handle& x) + { + CGAL_kernel_precondition( x.PTR != (Leda_like_rep*)NULL ); + x.PTR->count++; + if ( PTR && (--PTR->count == 0)) { delete PTR; } + PTR = x.PTR; + return *this; + } + + + int + refs() const { return PTR->count; } + + friend unsigned long id(const Leda_like_handle& x); + + protected: + Leda_like_rep* PTR; +}; + +inline +unsigned long +id(const Leda_like_handle& x) +{ return (unsigned long)x.PTR; } + +template < class T > +inline +bool +identical(const T &t1, const T &t2) +{ return id(t1) == id(t2); } +CGAL_END_NAMESPACE + + +#if defined(CGAL_USE_LEDA) && !defined(CGAL_NO_LEDA_HANDLE) +# include + +CGAL_BEGIN_NAMESPACE + +typedef handle_base Handle; +typedef handle_rep Rep; + +inline +unsigned long +id(const Handle& x) +{ return ID_Number(x); } +CGAL_END_NAMESPACE + + +# else + +CGAL_BEGIN_NAMESPACE + +typedef Leda_like_handle Handle; +typedef Leda_like_rep Rep; +CGAL_END_NAMESPACE + + +#endif // defined(CGAL_USE_LEDA) && !defined(CGAL_NO_LEDA_HANDLE) +#endif // CGAL_HANDLE_H diff --git a/Packages/Kernel_23/include/CGAL/Handle_for.h b/Packages/Kernel_23/include/CGAL/Handle_for.h new file mode 100644 index 00000000000..65c499b78f5 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Handle_for.h @@ -0,0 +1,151 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : Handle_for.fw +// file : Handle_for.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_HANDLE_FOR_H +#define CGAL_HANDLE_FOR_H +#include + +namespace CGAL { + + +template class Handle_for; +class Object; + + +class Ref_counted +{ + public: + Ref_counted() : count(1) {} + Ref_counted(const Ref_counted&) : count(1) {} + + void add_reference() { ++count; } + void remove_reference() { --count; } + bool is_referenced() { return (count != 0); } + bool is_shared() { return (count > 1); } + + friend class Object; + + protected: + unsigned int count; +}; + + +template +// RefCounted must provide +// add_reference() +// remove_reference() +// bool is_referenced() +// bool is_shared() +// and initialize count to 1 in default and copy constructor +class Handle_for +{ + public: + + typedef RefCounted element_type; + + Handle_for(const RefCounted& rc) + { + ptr = allocator.allocate(1); + allocator.construct(ptr, rc); + } + + Handle_for() + { + ptr = allocator.allocate(1); + } + + Handle_for( const Handle_for& h) + { + ptr = h.ptr; + ptr->add_reference(); + } + + ~Handle_for() + { + ptr->remove_reference(); + if ( !ptr->is_referenced() ) + { + allocator.destroy( ptr); + allocator.deallocate( ptr, 1); + } + } + + Handle_for& + operator=( const Handle_for& h) + { + h.ptr->add_reference(); + ptr->remove_reference(); + if ( !ptr->is_referenced() ) + { + allocator.destroy( ptr); + allocator.deallocate( ptr, 1); + } + ptr = h.ptr; + return *this; + } + + void + initialize_with( const RefCounted& rc) + { + allocator.construct(ptr, rc); + } + + void + copy_on_write() + { + if ( ptr->is_shared() ) + { + RefCounted* tmp_ptr = allocator.allocate(1); + allocator.construct( tmp_ptr, *ptr); + ptr->remove_reference(); + ptr = tmp_ptr; + } + } + + bool + identical( const Handle_for& h) const + { return ptr == h.ptr; } + + long int + id() const + { return reinterpret_cast( &(*ptr)); } + + const typename Allocator::pointer + Ptr() const + { return ptr; } + + protected: + static Allocator allocator; + typename Allocator::pointer ptr; +}; + + +template +Allocator Handle_for::allocator; + +} // namespace CGAL +#endif // CGAL_HANDLE_FOR_H diff --git a/Packages/Kernel_23/include/CGAL/Iso_cuboid_3.h b/Packages/Kernel_23/include/CGAL/Iso_cuboid_3.h new file mode 100644 index 00000000000..37780ce8ff6 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Iso_cuboid_3.h @@ -0,0 +1,142 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : Iso_cuboid_3.fw +// file : Iso_cuboid_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_ISO_CUBOID_3_H +#define CGAL_ISO_CUBOID_3_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#include +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#include +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#include + +CGAL_BEGIN_NAMESPACE + +template +class Iso_cuboid_3 : public R_::Iso_cuboid_3_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Iso_cuboid_3_base RIso_cuboid_3; + + Iso_cuboid_3() : RIso_cuboid_3() + {} + + Iso_cuboid_3(const CGAL::Iso_cuboid_3& r) : RIso_cuboid_3(r) + {} + + Iso_cuboid_3(const RIso_cuboid_3& r) : RIso_cuboid_3(r) + {} + + Iso_cuboid_3(const CGAL::Point_3& p, const CGAL::Point_3& q) + : RIso_cuboid_3(p,q) + {} + +/* + bool operator==(const CGAL::Iso_cuboid_3& r) const + { return (const RIso_cuboid_3& )*this == (const RIso_cuboid_3& )r ; } + bool operator!=(const CGAL::Iso_cuboid_3& r) const + { return !(*this == r); } + CGAL::Point_3 + min() const + { return RIso_cuboid_3::min(); } + CGAL::Point_3 + max() const + { return RIso_cuboid_3::max(); } + FT xmin() const + { return RIso_cuboid_3::xmin(); } + FT ymin() const + { return RIso_cuboid_3::ymin(); } + FT zmin() const + { return RIso_cuboid_3::zmin(); } + FT xmax() const + { return RIso_cuboid_3::xmax(); } + FT ymax() const + { return RIso_cuboid_3::ymax(); } + FT zmax() const + { return RIso_cuboid_3::zmax(); } + CGAL::Point_3 + vertex(int i) const + { return RIso_cuboid_3::vertex(i); } + CGAL::Point_3 + operator[](int i) const + { return vertex(i); } + Bounded_side + bounded_side(const CGAL::Point_3& p) const + { return RIso_cuboid_3::bounded_side(p); } + bool has_on_boundary(const CGAL::Point_3& p) const + { return RIso_cuboid_3::has_on_boundary(p); } + bool has_on_bounded_side(const CGAL::Point_3& p) const + { return RIso_cuboid_3::has_on_bounded_side(p); } + bool has_on_unbounded_side(const CGAL::Point_3& p) const + { return RIso_cuboid_3::has_on_unbounded_side(p); } + bool is_degenerate() const + { return RIso_cuboid_3::is_degenerate(); } + CGAL::Iso_cuboid_3 + transform(const CGAL::Aff_transformation_3& t) const + { return RIso_cuboid_3::transform(t); } +*/ +}; + +#ifndef NO_OSTREAM_INSERT_ISO_CUBOID_3 +template < class R > +std::ostream& +operator<<(std::ostream& os, const Iso_cuboid_3& r) +{ + typedef typename R::Iso_cuboid_3_base RIso_cuboid_3; + return os << (const RIso_cuboid_3& )r; } +#endif // NO_OSTREAM_INSERT_ISO_CUBOID_3 + +#ifndef NO_ISTREAM_EXTRACT_ISO_CUBOID_3 +template < class R > +std::istream& +operator>>(std::istream& is, Iso_cuboid_3& r) +{ + typedef typename R::Iso_cuboid_3_base RIso_cuboid_3; + is >> (RIso_cuboid_3& )r; + return is; +} +#endif // NO_ISTREAM_EXTRACT_ISO_CUBOID_3 + +CGAL_END_NAMESPACE + + +#endif // CGAL_ISO_CUBOID_3_H diff --git a/Packages/Kernel_23/include/CGAL/Iso_rectangle_2.h b/Packages/Kernel_23/include/CGAL/Iso_rectangle_2.h new file mode 100644 index 00000000000..75347365764 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Iso_rectangle_2.h @@ -0,0 +1,174 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : Iso_rectangle_2.fw +// file : Iso_rectangle_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_ISO_RECTANGLE_2_H +#define CGAL_ISO_RECTANGLE_2_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_ISO_RECTANGLEH2_H +#include +#endif // CGAL_ISO_RECTANGLEH2_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_ISO_RECTANGLEC2_H +#include +#endif // CGAL_ISO_RECTANGLEC2_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_POINT_2_H +#include +#endif // CGAL_POINT_2_H + +CGAL_BEGIN_NAMESPACE + +template +class Iso_rectangle_2 : public R_::Iso_rectangle_2_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Iso_rectangle_2_base RIso_rectangle_2; + + Iso_rectangle_2() + : RIso_rectangle_2() + {} + + Iso_rectangle_2(const CGAL::Iso_rectangle_2 &r) + : RIso_rectangle_2(r) + {} + + Iso_rectangle_2(const RIso_rectangle_2& r) + : RIso_rectangle_2(r) + {} + + Iso_rectangle_2(const CGAL::Point_2 &p, + const CGAL::Point_2 &q) + : RIso_rectangle_2(p,q) + {} + + + bool + operator==(const CGAL::Iso_rectangle_2 &r) const + { return vertex(0) == r.vertex(0) && vertex(2) == r.vertex(2); } + + bool + operator!=(const CGAL::Iso_rectangle_2 &r) const + { return !(*this == r); } + + + CGAL::Point_2 + min() const + { return RIso_rectangle_2::min(); } + + CGAL::Point_2 + max() const + { return RIso_rectangle_2::max(); } + + FT + xmin() const + { return RIso_rectangle_2::xmin(); } + + FT + ymin() const + { return RIso_rectangle_2::ymin(); } + + FT + xmax() const + { return RIso_rectangle_2::xmax(); } + + FT + ymax() const + { return RIso_rectangle_2::ymax(); } + + CGAL::Point_2 + vertex(int i) const + { return RIso_rectangle_2::vertex(i); } + + CGAL::Point_2 + operator[](int i) const + { return vertex(i); } + + Bounded_side + bounded_side(const CGAL::Point_2 &p) const + { return RIso_rectangle_2::bounded_side(p); } + + bool + has_on_boundary(const CGAL::Point_2 &p) const + { return RIso_rectangle_2::has_on_boundary(p); } + + bool + has_on_bounded_side(const CGAL::Point_2 &p) const + { return RIso_rectangle_2::has_on_bounded_side(p); } + + bool + has_on_unbounded_side(const CGAL::Point_2 &p) const + { return RIso_rectangle_2::has_on_unbounded_side(p); } + + bool + is_degenerate() const + { return RIso_rectangle_2::is_degenerate(); } + + CGAL::Iso_rectangle_2 + transform(const CGAL::Aff_transformation_2 &t) const + { return RIso_rectangle_2::transform(t); } + +}; + +#ifndef NO_OSTREAM_INSERT_ISO_RECTANGLE_2 +template < class R > +std::ostream & +operator<<(std::ostream &os, const Iso_rectangle_2 &r) +{ + typedef typename R::Iso_rectangle_2_base RIso_rectangle_2; + return os << (const RIso_rectangle_2&)r; +} +#endif // NO_OSTREAM_INSERT_ISO_RECTANGLE_2 + +#ifndef NO_ISTREAM_EXTRACT_ISO_RECTANGLE_2 +template < class R > +std::istream & +operator>>(std::istream &is, Iso_rectangle_2 &r) +{ + typedef typename R::Iso_rectangle_2_base RIso_rectangle_2; + is >> (RIso_rectangle_2&)r; + return is; +} +#endif // NO_ISTREAM_EXTRACT_ISO_RECTANGLE_2 + +CGAL_END_NAMESPACE + + +#endif // CGAL_ISO_RECTANGLE_2_H diff --git a/Packages/Kernel_23/include/CGAL/Kernel/function_objects.h b/Packages/Kernel_23/include/CGAL/Kernel/function_objects.h new file mode 100644 index 00000000000..b90cae3e9df --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Kernel/function_objects.h @@ -0,0 +1,885 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// release : +// release_date : 2000, December 10 +// +// source : for_function_objects.lw +// file : include/CGAL/Kernel/function_objects.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Stefan Schirra +// +// coordinator : MPI, Saarbruecken +// ====================================================================== + +#ifndef CGAL_KERNEL_FUNCTION_OBJECTS_H +#define CGAL_KERNEL_FUNCTION_OBJECTS_H + +CGAL_BEGIN_NAMESPACE +namespace CGALi { + +template +class Construct +{ + public: + typedef ToBeConstructed result_type; + + ToBeConstructed + operator()() const + { return ToBeConstructed(); } + + template + ToBeConstructed + operator()( const A1& a1) const + { return ToBeConstructed(a1); } + + template + ToBeConstructed + operator()( const A1& a1, const A2& a2) const + { return ToBeConstructed(a1,a2); } + + template + ToBeConstructed + operator()( const A1& a1, const A2& a2, const A3& a3) const + { return ToBeConstructed(a1,a2,a3); } + + template + ToBeConstructed + operator()( const A1& a1, const A2& a2, const A3& a3, const A4& a4) const + { return ToBeConstructed(a1,a2,a3,a4); } + + template + ToBeConstructed + operator()( const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5) const + { return ToBeConstructed(a1,a2,a3,a4,a5); } + + template + ToBeConstructed + operator()( const A& a1, const A& a2, const A& a3, + const A& a4, const A& a5, const A& a6 ) + { return ToBeConstructed(a1,a2,a3,a4,a5,a6); } + + template + ToBeConstructed + operator()( const A& a1, const A& a2, const A& a3, + const A& a4, const A& a5, const A& a6, + const A& a7 ) + { return ToBeConstructed(a1,a2,a3,a4,a5,a6,a7); } + + template + ToBeConstructed + operator()( const A& a1, const A& a2, const A& a3, + const A& a4, const A& a5, const A& a6, + const A& a7, const A& a8, const A& a9) + { return ToBeConstructed(a1,a2,a3,a4,a5,a6,a7,a8,a9); } + + template + ToBeConstructed + operator()( const A& a1, const A& a2, const A& a3, + const A& a4, const A& a5, const A& a6, + const A& a7, const A& a8, const A& a9, + const A& a10) + { return ToBeConstructed(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10); } + + template + ToBeConstructed + operator()( const A& a1, const A& a2, const A& a3, + const A& a4, const A& a5, const A& a6, + const A& a7, const A& a8, const A& a9, + const A& a10,const A& a11,const A& a12) + { return ToBeConstructed(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12); } + + template + ToBeConstructed + operator()( const A& a1, const A& a2, const A& a3, + const A& a4, const A& a5, const A& a6, + const A& a7, const A& a8, const A& a9, + const A& a10,const A& a11,const A& a12, + const A& a13) + { return ToBeConstructed(a1,a2,a3,a4,a5,a6,a7,a8,a9,a10,a11,a12,a13); } + +}; + + +template +class Call_point_to_get +{ + public: + typedef ReturnType result_type; + + template + ReturnType + operator()( const Cls& c) const + { return c.point(); } + + template + ReturnType + operator()( const Cls& c, int i) const + { return c.point(i); } +}; +template +class Call_second_point_to_get +{ + public: + typedef ReturnType result_type; + + template + ReturnType + operator()( const Cls& c) const + { return c.second_point(); } +}; +template +class Call_perpendicular_to_get +{ + public: + typedef ReturnType result_type; + + template + ReturnType + operator()( const Cls& c) const + { return c.perpendicular(); } + + template + ReturnType + operator()( const Cls& c, const A1& a1) const + { return c.perpendicular(a1); } +}; + +template +class Call_perpendicular_plane_to_get +{ + public: + typedef ReturnType result_type; + + template + ReturnType + operator()( const Cls& c, const A1& a1) const + { return c.perpendicular_plane(a1); } +}; + +template +class p_Midpoint +{ + public: + typedef Point result_type; + + Point + operator()(const Point& p, const Point& q) const { return midpoint(p,q); } +}; +template +class p_Circumcenter +{ + public: + typedef Point result_type; + + Point + operator()(const Point& p, const Point& q, const Point& r) const + { return circumcenter(p,q,r); } + + Point + operator()(const Point& p, const Point& q, + const Point& r, const Point& s) const + { return circumcenter(p,q,r,s); } +}; +template +class pl_Bisector +{ + public: + typedef Line result_type; + + Line + operator()(const Point& p, const Point& q) const { return bisector(p,q); } +}; +class Intersect +{ + public: + typedef CGAL::Object result_type; + + template + CGAL::Object + operator()(const T1& t1, const T2& t2) const + { return intersection( t1, t2); } +}; +class Assign +{ + public: + typedef bool result_type; + + template + bool + operator()(T1& t1, const CGAL::Object& o) const + { return assign( t1, o); } +}; +template +class Call_y_at_x_to_get +{ + public: + typedef ReturnType result_type; + + template + ReturnType + operator()( const Cls& c, const ReturnType& x) const + { return c.y_at_x(x); } +}; +template +class Call_x_at_y_to_get +{ + public: + typedef ReturnType result_type; + + template + ReturnType + operator()( const Cls& c, const ReturnType& x) const + { return c.x_at_y(x); } +}; +template +class Call_squared_length_to_get +{ + public: + typedef ReturnType result_type; + + template + ReturnType + operator()( const Cls& c) const + { return c.squared_length(); } +}; +class Counterclockwise_in_between +{ + public: + typedef bool result_type; + + template + bool + operator()(const T& p, const T& q, const T& r) const + { return p.counterclockwise_in_between(q,r); } +}; + + +class Collinear +{ + public: + typedef bool result_type; + + template + bool + operator()(const T& p, const T& q, const T& r) const + { return collinear(p,q,r); } +}; + +class Coplanar +{ + public: + typedef bool result_type; + + template + bool + operator()(const T& p, const T& q, const T& r, const T& s) const + { return coplanar(p,q,r,s); } +}; + +class Coplanar_orientation +{ + public: + typedef Orientation result_type; + + template + Orientation + operator()(const P& p, const P& q, const P& r, const P& s) const + { return coplanar_orientation(p,q,r,s); } + + template + Orientation + operator()(const P& p, const P& q, const P& r, const V& v) const + { return coplanar_orientation(p,q,r,v); } +}; + + +class Side_of_oriented_circle +{ + public: + typedef Oriented_side result_type; + + template + Oriented_side + operator()(const T& p, const T& q, const T& r, const T& t) const + { return side_of_oriented_circle(p,q,r,t); } +}; + +class Side_of_bounded_circle +{ + public: + typedef Bounded_side result_type; + + template + Bounded_side + operator()(const T& p, const T& q, const T& r, const T& t) const + { return side_of_bounded_circle(p,q,r,t); } +}; +class Side_of_oriented_sphere +{ + public: + typedef Oriented_side result_type; + + template + Oriented_side + operator()(const T& p, const T& q, const T& r, const T& s, const T& t) const + { return side_of_oriented_sphere(p,q,r,s,t); } +}; + +class Side_of_bounded_sphere +{ + public: + typedef Bounded_side result_type; + + template + Bounded_side + operator()(const T& p, const T& q, const T& r, const T& s, const T& t) const + { return side_of_bounded_sphere(p,q,r,s,t); } +}; +class Call_is_horizontal +{ + public: + typedef bool result_type; + + template + bool + operator()( const Cls& c) const + { return c.is_horizontal(); } +}; + +class Call_is_vertical +{ + public: + typedef bool result_type; + + template + bool + operator()( const Cls& c) const + { return c.is_vertical(); } +}; +class Call_is_degenerate +{ + public: + typedef bool result_type; + + template + bool + operator()( const Cls& c) const + { return c.is_degenerate(); } +}; +class Call_has_on_bounded_side +{ + public: + typedef bool result_type; + + template + bool + operator()( const Cls& c, const Arg& a) const + { return c.has_on_bounded_side(a); } +}; + +class Call_has_on_unbounded_side +{ + public: + typedef bool result_type; + + template + bool + operator()( const Cls& c, const Arg& a) const + { return c.has_on_unbounded_side(a); } +}; + +class Call_has_on_boundary +{ + public: + typedef bool result_type; + + template + bool + operator()( const Cls& c, const Arg& a) const + { return c.has_on_boundary(a); } +}; + +class Call_has_on_positive_side +{ + public: + typedef bool result_type; + + template + bool + operator()( const Cls& c, const Arg& a) const + { return c.has_on_positive_side(a); } +}; + +class Call_has_on_negative_side +{ + public: + typedef bool result_type; + + template + bool + operator()( const Cls& c, const Arg& a) const + { return c.has_on_negative_side(a); } +}; + +class Call_oriented_side +{ + public: + typedef bool result_type; + + template + Oriented_side + operator()( const Cls& c, const Arg& a) const + { return c.oriented_side(a); } +}; +class Less_x +{ + public: + typedef bool result_type; + + template + bool + operator()( const T1& a1, const T2& a2) const + { return less_x(a1,a2); } +}; + +class Less_y +{ + public: + typedef bool result_type; + + template + bool + operator()( const T1& a1, const T2& a2) const + { return less_y(a1,a2); } +}; + +class Less_z +{ + public: + typedef bool result_type; + + template + bool + operator()( const T1& a1, const T2& a2) const + { return less_y(a1,a2); } +}; + +class Less_xy +{ + public: + typedef bool result_type; + + template + bool + operator()( const T1& a1, const T2& a2) const + { return lexicographically_xy_smaller(a1,a2); } +}; + +class Less_yx +{ + public: + typedef bool result_type; + + template + bool + operator()( const T1& a1, const T2& a2) const + { return lexicographically_yx_smaller(a1,a2); } +}; + +class Less_xyz +{ + public: + typedef bool result_type; + + template + bool + operator()( const T1& a1, const T2& a2) const + { return lexicographically_xyz_smaller(a1,a2); } +}; + +class Equal +{ + public: + typedef bool result_type; + + template + bool + operator()(const T1& p, const T2& q) const + { return p == q; } +}; + +class Equal_x +{ + public: + typedef bool result_type; + + template + bool + operator()( const T1& a1, const T2& a2) const + { return x_equal(a1,a2); } +}; + +class Equal_y +{ + public: + typedef bool result_type; + + template + bool + operator()( const T1& a1, const T2& a2) const + { return y_equal(a1,a2); } +}; + +class Equal_z +{ + public: + typedef bool result_type; + + template + bool + operator()( const T1& a1, const T2& a2) const + { return z_equal(a1,a2); } +}; + +class Equal_xy +{ + public: + typedef bool result_type; + + template + bool + operator()( const T1& a1, const T2& a2) const + { return equal_xy(a1,a2); } +}; + +class Equal_xyz +{ + public: + typedef bool result_type; + + template + bool + operator()( const T1& a1, const T2& a2) const + { return equal_xyz(a1,a2); } +}; +class Compare_x +{ + public: + typedef Comparison_result result_type; + + template + Comparison_result + operator()( const T1& a1, const T2& a2) const + { return compare_x(a1,a2); } + + template + Comparison_result + operator()( const T1& a1, const T2& a2, const T3& a3) const + { return compare_x(a1,a2,a3); } + + template + Comparison_result + operator()( const T1& a1, const T2& a2, const T3& a3, const T4& a4) const + { return compare_x(a1,a2,a3,a4); } + +}; + +class Compare_y +{ + public: + typedef Comparison_result result_type; + + template + Comparison_result + operator()( const T1& a1, const T2& a2) const + { return compare_y(a1,a2); } + + template + Comparison_result + operator()( const T1& a1, const T2& a2, const T3& a3) const + { return compare_y(a1,a2,a3); } + + template + Comparison_result + operator()( const T1& a1, const T2& a2, const T3& a3, const T4& a4) const + { return compare_y(a1,a2,a3,a4); } + + +}; + +class Compare_z +{ + public: + typedef Comparison_result result_type; + + template + Comparison_result + operator()( const T1& a1, const T2& a2) const + { return compare_z(a1,a2); } +}; + +class Compare_xy +{ + public: + typedef Comparison_result result_type; + + template + Comparison_result + operator()( const T1& a1, const T2& a2) const + { return compare_lexicographically_xy(a1,a2); } +}; + +class Compare_xyz +{ + public: + typedef Comparison_result result_type; + + template + Comparison_result + operator()( const T1& a1, const T2& a2) const + { return compare_lexicographically_xyz(a1,a2); } +}; + +class Compare_y_at_x +{ + public: + typedef Comparison_result result_type; + + template + Comparison_result + operator()( const T1& a1, const T2& a2) const + { return compare_y_at_x(a1,a2); } + + template + Comparison_result + operator()( const T1& a1, const T2& a2, const T3& a3) const + { return compare_y_at_x(a1,a2,a3); } + + template + Comparison_result + operator()( const T1& a1, const T2& a2, const T3& a3, const T4& a4) const + { return compare_y_at_x(a1,a2,a3,a4); } +}; + +class Compare_x_at_y +{ + public: + typedef Comparison_result result_type; + + template + Comparison_result + operator()( const T1& a1, const T2& a2) const + { return compare_x_at_y(a1,a2); } + + template + Comparison_result + operator()( const T1& a1, const T2& a2, const T3& a3) const + { return compare_x_at_y(a1,a2,a3); } + + template + Comparison_result + operator()( const T1& a1, const T2& a2, const T3& a3, const T4& a4) const + { return compare_x_at_y(a1,a2,a3,a4); } +}; + +template +class Compare_distance_to_point +{ + public: + typedef Comparison_result result_type; + + Compare_distance_to_point(const T& cp) : p(cp) {} + + Comparison_result + operator()(const T& q, const T& r) const + { return cmp_dist_to_point(p,q,r); } + + T p; +}; + + +class Are_ordered_along_line +{ + public: + typedef bool result_type; + + template + bool + operator()(const T& p, const T& q, const T& r) const + { return are_ordered_along_line(p,q,r); } +}; + +class Are_strictly_ordered_along_line +{ + public: + typedef bool result_type; + + template + bool + operator()(const T& p, const T& q, const T& r) const + { return are_strictly_ordered_along_line(p,q,r); } +}; + +class Collinear_are_ordered_along_line +{ + public: + typedef bool result_type; + + template + bool + operator()(const T& p, const T& q, const T& r) const + { return collinear_are_ordered_along_line(p,q,r); } +}; + +class Collinear_are_strictly_ordered_along_line +{ + public: + typedef bool result_type; + + template + bool + operator()(const T& p, const T& q, const T& r) const + { return collinear_are_strictly_ordered_along_line(p,q,r); } +}; +class Call_transform +{ + public: + template + ArgumentType + operator()( const ArgumentType& a, const Transformation& t) + { return a.transform(t); } +}; +template +class Call_source_to_get +{ + public: + typedef ReturnType result_type; + + template + ReturnType + operator()( const Cls& c) const + { return c.source(); } +}; + +template +class Call_target_to_get +{ + public: + typedef ReturnType result_type; + + template + ReturnType + operator()( const Cls& c) const + { return c.target(); } +}; + +template +class Call_min_to_get +{ + public: + typedef ReturnType result_type; + + template + ReturnType + operator()( const Cls& c) const + { return c.min(); } +}; + +template +class Call_max_to_get +{ + public: + typedef ReturnType result_type; + + template + ReturnType + operator()( const Cls& c) const + { return c.max(); } +}; + +template +class Call_direction_to_get +{ + public: + typedef ReturnType result_type; + + template + ReturnType + operator()( const Cls& c) const + { return c.direction(); } +}; + +template +class Call_supporting_line_to_get +{ + public: + typedef ReturnType result_type; + + template + ReturnType + operator()( const Cls& c) const + { return c.supporting_line(); } +}; + +template +class Call_supporting_plane_to_get +{ + public: + typedef ReturnType result_type; + + template + ReturnType + operator()( const Cls& c) const + { return c.supporting_plane(); } +}; + +template +class Call_opposite_to_get +{ + public: + typedef ReturnType result_type; + + template + ReturnType + operator()( const Cls& c) const + { return c.opposite(); } +}; + +class Call_has_on +{ + public: + typedef bool result_type; + + template + bool + operator()( const Cls& c, const A1& a1) const + { return c.has_on(a1); } +}; + +class Call_collinear_has_on +{ + public: + typedef bool result_type; + + template + bool + operator()( const Cls& c, const A1& a1) const + { return c.collinear_has_on(a1); } +}; + + + +} // end namespace CGALi +CGAL_END_NAMESPACE + +#endif // CGAL_KERNEL_FUNCTION_OBJECTS_H diff --git a/Packages/Kernel_23/include/CGAL/Line_2.h b/Packages/Kernel_23/include/CGAL/Line_2.h new file mode 100644 index 00000000000..7a5b1f1d627 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Line_2.h @@ -0,0 +1,256 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : Line_2.fw +// file : Line_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_LINE_2_H +#define CGAL_LINE_2_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_LINEH2_H +#include +#endif // CGAL_LINEH2_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_LINEC2_H +#include +#endif // CGAL_LINEC2_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_PREDICATES_ON_POINTS_2_H +#include +#endif // CGAL_PREDICATES_ON_POINTS_2_H +#ifndef CGAL_VECTOR_2_H +#include +#endif // CGAL_VECTOR_2_H + +CGAL_BEGIN_NAMESPACE + +template +class Line_2 : public R_::Line_2_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Line_2_base RLine_2; + + Line_2() + : RLine_2() + {} + + ~Line_2() + {} + + Line_2(const CGAL::Line_2 &l) + : RLine_2((RLine_2&)l) + {} + + Line_2(const CGAL::Point_2 &p, const CGAL::Point_2 &q) + : RLine_2(p,q) + {} + + Line_2(const RT &a, const RT &b, const RT &c) + : RLine_2(a,b,c) + {} + + + Line_2(const RLine_2& l) // conversion impl -> interface class + : RLine_2(l) + {} + + + Line_2(const CGAL::Segment_2& s) + : RLine_2(s) + {} + + Line_2(const CGAL::Ray_2& r) + : RLine_2(r) + {} + + Line_2(const CGAL::Point_2 &p, const CGAL::Direction_2 &d) + : RLine_2(p,d) + {} + + + bool operator==(const CGAL::Line_2 &l) const + { + return RLine_2::operator==(l); + } + + bool operator!=(const CGAL::Line_2 &l) const + { + return !(*this == l); + } + + RT a() const + { + return RLine_2::a(); + } + + RT b() const + { + return RLine_2::b(); + } + + RT c() const + { + return RLine_2::c(); + } + + + FT x_at_y(const FT &y) const + { + return RLine_2::x_at_y(y); + } + + FT y_at_x(const FT &x) const + { + return RLine_2::y_at_x(x); + } + + CGAL::Line_2 perpendicular(const CGAL::Point_2 &p) const + { + return RLine_2::perpendicular(p); + } + + CGAL::Line_2 opposite() const + { + return RLine_2::opposite(); + } + + CGAL::Point_2 point(int i) const + { + return RLine_2::point(i); + } + + CGAL::Point_2 projection(const CGAL::Point_2 &p) const + { + return RLine_2::projection(p); + } + + CGAL::Point_2 point() const + { + return RLine_2::point(); + } + + CGAL::Direction_2 direction() const + { + + return RLine_2::direction(); + } + + Oriented_side oriented_side(const CGAL::Point_2 &p) const + { + return RLine_2::oriented_side(p); + } + + bool has_on(const CGAL::Point_2 &p) const + { + return RLine_2::has_on_boundary(p); + } + + bool has_on_boundary(const CGAL::Point_2 &p) const + { + return RLine_2::has_on_boundary(p); + } + + bool has_on_positive_side(const CGAL::Point_2 &p) const + { + return RLine_2::has_on_positive_side(p); + } + + bool has_on_negative_side(const CGAL::Point_2 &p) const + { + return RLine_2::has_on_negative_side(p); + } + + bool is_horizontal() const + { + + return RLine_2::is_horizontal(); + } + + bool is_vertical() const + { + + return RLine_2::is_vertical(); + } + + bool is_degenerate() const + { + + return RLine_2::is_degenerate(); + } + + CGAL::Line_2 transform(const CGAL::Aff_transformation_2 &t) const + { + return RLine_2::transform(t); + } +}; + + + +#ifndef NO_OSTREAM_INSERT_LINE_2 +template < class R > +std::ostream & +operator<<(std::ostream &os, const Line_2 &l) +{ + typedef typename R::Line_2_base RLine_2; + return os << (const RLine_2&)l; +} +#endif // NO_OSTREAM_INSERT_LINE_2 + +#ifndef NO_ISTREAM_EXTRACT_LINE_2 +template < class R > +std::istream & +operator>>(std::istream &is, Line_2 &p) +{ + typedef typename R::Line_2_base RLine_2; + return is >> (RLine_2&)p; +} +#endif // NO_ISTREAM_EXTRACT_LINE_2 + + + +CGAL_END_NAMESPACE + + +#ifndef CGAL_SEGMENT_2_H +#include +#endif // CGAL_SEGMENT_2_H +#ifndef CGAL_RAY_2_H +#include +#endif // CGAL_RAY_2_H + +#endif // CGAL_LINE_2_H diff --git a/Packages/Kernel_23/include/CGAL/Line_3.h b/Packages/Kernel_23/include/CGAL/Line_3.h new file mode 100644 index 00000000000..4293df24b5a --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Line_3.h @@ -0,0 +1,153 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : Line_3.fw +// file : Line_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + + +#ifndef CGAL_LINE_3_H +#define CGAL_LINE_3_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_LINEH3_H +#include +#endif // CGAL_LINEH3_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_LINEC3_H +#include +#endif // CGAL_LINEC3_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_SEGMENT_3_H +#include +#endif // CGAL_SEGMENT_3_H +#ifndef CGAL_POINT_3_H +#include +#endif // CGAL_POINT_3_H +#ifndef CGAL_RAY_3_H +#include +#endif // CGAL_RAY_3_H + +CGAL_BEGIN_NAMESPACE + +template +class Line_3 : public R_::Line_3_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Line_3_base RLine_3; + + Line_3() : RLine_3() + {} + Line_3(const CGAL::Line_3 & l) : RLine_3( ( const RLine_3& )l) + {} + Line_3(const CGAL::Point_3 & p, + const CGAL::Point_3 & q) : RLine_3(p,q) + {} + // conversion impl -> interface class + Line_3(const RLine_3& l) : RLine_3(l) + {} + Line_3(const CGAL::Segment_3 & s) : RLine_3( s ) + {} + Line_3(const CGAL::Ray_3 & r) : RLine_3( r ) + {} + Line_3(const CGAL::Point_3 & p, + const CGAL::Direction_3 & d) : RLine_3( p, d ) + {} + + bool operator==(const CGAL::Line_3 & l) const + { return RLine_3::operator==(l); } + + bool operator!=(const CGAL::Line_3 & l) const + { return !(*this == l); } + + CGAL::Plane_3 perpendicular_plane(const CGAL::Point_3 & p) const + { return RLine_3::perpendicular_plane(p); } + + CGAL::Line_3 opposite() const + { return RLine_3::opposite(); } + + CGAL::Point_3 point() const + { return RLine_3::point(); } + + CGAL::Point_3 point(int i) const + { return RLine_3::point(i); } + + CGAL::Point_3 projection(const CGAL::Point_3& p) const + { return RLine_3::projection(p); } + + CGAL::Direction_3 direction() const + { return RLine_3::direction(); } + + bool has_on(const CGAL::Point_3& p) const + { return RLine_3::has_on(p); } + + bool is_degenerate() const + { return RLine_3::is_degenerate(); } + + CGAL::Line_3 transform(const CGAL::Aff_transformation_3 & t) const + { return RLine_3::transform(t); } +}; + +#ifndef NO_OSTREAM_INSERT_LINE_3 +template < class R > +std::ostream& +operator<<(std::ostream& os, const Line_3& l) +{ + typedef typename R::Line_3_base RLine_3; + return os << (const RLine_3& )l; +} +#endif // NO_OSTREAM_INSERT_LINE_3 + +#ifndef NO_ISTREAM_EXTRACT_LINE_3 +template < class R > +std::istream& +operator>>(std::istream & is, Line_3 & p) +{ + typedef typename R::Line_3_base RLine_3; + is >> ( RLine_3& )p; + return is; +} +#endif // NO_ISTREAM_EXTRACT_LINE_3 + +CGAL_END_NAMESPACE + + +#ifndef CGAL_PLANE_3_H +#include +#endif // CGAL_PLANE_3_H + +#endif // CGAL_LINE_3_H diff --git a/Packages/Kernel_23/include/CGAL/Object.h b/Packages/Kernel_23/include/CGAL/Object.h new file mode 100644 index 00000000000..129f2df8f53 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Object.h @@ -0,0 +1,128 @@ +// ====================================================================== +// +// Copyright (c) 2000 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// file : include/CGAL/Object.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// source : Object.lw +// revision : 3.0 +// revision_date : 02 Feb 2000 +// author(s) : Stefan.Schirra +// Andreas Fabri +// Geert-Jan Giezeman +// Michael Seel +// +// coordinator : MPI Saarbruecken, Germany +// +// ====================================================================== + +#ifndef CGAL_OBJECT_H +#define CGAL_OBJECT_H + +#ifdef CGAL_CFG_NO_DYNAMIC_CAST +#error fatal error: dynamic cast not supported +#endif // CGAL_CFG_NO_DYNAMIC_CAST + +#include + +namespace CGAL { + +class Object; +class Object_base; +template class Wrapper; + + +class Object_base : public Ref_counted +{ + public: + virtual ~Object_base() {} +}; + + +template +class Wrapper : public Object_base +{ + public: + Wrapper(const T& object) : _object(object) {} + + Wrapper() {} + + operator T() { return _object; } + + virtual ~Wrapper() {} + + private: + T _object; +}; + + +class Object +{ + public: + Object() : ptr( static_cast(0) ) {} + + Object(Object_base *base) + { + ptr = base; + CGAL_kernel_assertion( !ptr || (ptr->count == 1)); + } + + Object(const Object& o) : ptr(o.ptr) + { if (ptr) ptr->count++; } + + ~Object() + { if (ptr && (--ptr->count == 0)) { delete ptr; } } + + Object& + operator=(const Object& o) + { + if (o.ptr) o.ptr->count++; + if (ptr && (--ptr->count == 0)) { delete ptr; } + ptr = o.ptr; + return *this; + } + + bool + is_empty() const { return ptr == static_cast(0); } + + template + friend bool assign(T& t, const Object& o); + + protected: + Object_base* ptr; +}; + + +template +Object +make_object(const T& t) +{ return Object(new Wrapper< T >(t)); } + + +template +bool +assign(T& t, const Object& o) +{ +# ifdef CGAL_CFG_DYNAMIC_CAST_BUG + Wrapper instantiate_it; +# endif // CGAL_CFG_DYNAMIC_CAST_BUG + Wrapper* wp = dynamic_cast*>(o.ptr); + if ( wp == static_cast*>(0) ) { return false; } + t = *(wp); + return true; +} + +} // namespace CGAL + +#endif // CGAL_OBJECT_H + diff --git a/Packages/Kernel_23/include/CGAL/Origin.h b/Packages/Kernel_23/include/CGAL/Origin.h new file mode 100644 index 00000000000..a27194c203b --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Origin.h @@ -0,0 +1,47 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : Origin.fw +// file : Origin.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_ORIGIN_H +#define CGAL_ORIGIN_H + +#ifndef CGAL_CONFIG_H +#include +#endif // CGAL_CONFIG_H + +CGAL_BEGIN_NAMESPACE + +class Origin +{}; + +extern Origin ORIGIN; + +class Null_vector +{}; + +extern Null_vector NULL_VECTOR; +CGAL_END_NAMESPACE + +#endif // CGAL_ORIGIN_H diff --git a/Packages/Kernel_23/include/CGAL/Plane_3.h b/Packages/Kernel_23/include/CGAL/Plane_3.h new file mode 100644 index 00000000000..123e325b14f --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Plane_3.h @@ -0,0 +1,205 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : Plane_3.fw +// file : Plane_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_PLANE_3_H +#define CGAL_PLANE_3_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#if defined(CGAL_CFG_INCOMPLETE_TYPE_BUG_1) && \ + !defined(CGAL_NO_PLANE_TRANSFORM_IN_AT) +#define CGAL_NO_PLANE_TRANSFORM_IN_AT +#endif // CGAL_CFG_INCOMPLETE_TYPE_BUG_1 + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_PLANEH3_H +#include +#endif // CGAL_PLANEH3_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_PLANEC3_H +#include +#endif // CGAL_PLANEC3_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_LINE_3_H +#include +#endif // CGAL_LINE_3_H +#ifndef CGAL_POINT_2_H +#include +#endif // CGAL_POINT_2_H + +CGAL_BEGIN_NAMESPACE + +template +class Plane_3 : public R_::Plane_3_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Plane_3_base RPlane_3; + + Plane_3() : RPlane_3() + {} + Plane_3(const CGAL::Plane_3& p) : RPlane_3(p) + {} + Plane_3(const RPlane_3& p) : RPlane_3(p) + {} + Plane_3(const CGAL::Point_3& p, + const CGAL::Point_3& q, + const CGAL::Point_3& r) + : RPlane_3(p,q,r) + {} + Plane_3(const CGAL::Point_3& p, const CGAL::Direction_3& d) + : RPlane_3(p,d) + {} + Plane_3(const CGAL::Point_3& p, const CGAL::Vector_3& v) + : RPlane_3(p,v) + {} + Plane_3(const RT& a, const RT& b, const RT& c, const RT& d) + : RPlane_3(a,b,c,d) + {} + Plane_3(const CGAL::Line_3& l, const CGAL::Point_3& p) + : RPlane_3(l,p) + {} + Plane_3(const CGAL::Segment_3& s, const CGAL::Point_3& p) + : RPlane_3(s,p) + {} + Plane_3(CGAL::Ray_3& r, const CGAL::Point_3& p) + : RPlane_3(r,p) + {} + + bool operator==(const CGAL::Plane_3& p) const + { return RPlane_3::operator==(p); } + + bool operator!=(const CGAL::Plane_3& p) const + { return !(*this == p); } + + + RT a() const + { return RPlane_3::a(); } + + RT b() const + { return RPlane_3::b(); } + + RT c() const + { return RPlane_3::c(); } + + RT d() const + { return RPlane_3::d(); } + + CGAL::Line_3 perpendicular_line(const CGAL::Point_3& p) const + { return RPlane_3::perpendicular_line(p); } + + CGAL::Plane_3 opposite() const + { return RPlane_3::opposite(); } + + CGAL::Point_3 projection(const CGAL::Point_3& p) const + { return RPlane_3::projection(p); } + + CGAL::Point_3 point() const + { return RPlane_3::point(); } + + CGAL::Vector_3 orthogonal_vector() const + { return RPlane_3::orthogonal_vector(); } + + CGAL::Direction_3 orthogonal_direction() const + { return RPlane_3::orthogonal_direction(); } + + CGAL::Vector_3 base1() const + { return RPlane_3::base1(); } + + CGAL::Vector_3 base2() const + { return RPlane_3::base2(); } + + CGAL::Point_2 to_2d(const CGAL::Point_3& p) const + { return RPlane_3::to_2d(p); } + + CGAL::Point_3 to_3d(const CGAL::Point_2& p) const + { return RPlane_3::to_3d(p); } + + CGAL::Plane_3 transform( CGAL::Aff_transformation_3& t) const + { return CGAL::Plane_3( RPlane_3::transform(t) ); } + + Oriented_side oriented_side(const CGAL::Point_3& p) const + { return RPlane_3::oriented_side(p); } + + bool has_on(const CGAL::Point_3& p) const + { return RPlane_3::has_on_boundary(p); } + + bool has_on(const CGAL::Line_3& l) const + { return RPlane_3::has_on_boundary(l); } + + bool has_on_boundary(const CGAL::Point_3& p) const + { return RPlane_3::has_on_boundary(p); } + + bool has_on_boundary(const CGAL::Line_3& l) const + { return RPlane_3::has_on_boundary(l); } + + bool has_on_positive_side(const CGAL::Point_3& p) const + { return RPlane_3::has_on_positive_side(p); } + + bool has_on_negative_side(const CGAL::Point_3& p) const + { return RPlane_3::has_on_negative_side(p); } + + bool is_degenerate() const + { return RPlane_3::is_degenerate(); } +}; + +#ifndef NO_OSTREAM_INSERT_PLANE_3 +template < class R > +std::ostream& +operator<<(std::ostream& os, const Plane_3& p) +{ + typedef typename R::Plane_3_base RPlane_3; + return os << (const RPlane_3& )p; +} +#endif // NO_OSTREAM_INSERT_PLANE_3 + +#ifndef NO_ISTREAM_EXTRACT_PLANE_3 +template < class R > +std::istream& +operator>>(std::istream& is, Plane_3& t) +{ + typedef typename R::Plane_3_base RPlane_3; + return is >> (RPlane_3& )t; +} +#endif // NO_ISTREAM_EXTRACT_PLANE_3 + + +CGAL_END_NAMESPACE + + +#endif // CGAL_PLANE_3_H diff --git a/Packages/Kernel_23/include/CGAL/Point_2.h b/Packages/Kernel_23/include/CGAL/Point_2.h new file mode 100644 index 00000000000..37cc7482e20 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Point_2.h @@ -0,0 +1,227 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : Point_2.fw +// file : Point_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_POINT_2_H +#define CGAL_POINT_2_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#include +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#include +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#include + +CGAL_BEGIN_NAMESPACE + +template +class Point_2 : public R_::Point_2_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Point_2_base RPoint_2; + typedef typename R::Vector_2_base RVector_2; + + +friend CGAL_FRIEND_INLINE + CGAL::Point_2 + CGAL_SCOPE vector_to_point_conversion CGAL_NULL_TMPL_ARGS + (const CGAL::Vector_2& v); + + Point_2() + {} + + Point_2(const Origin& o) + : RPoint_2(o) + {} + + Point_2(const CGAL::Point_2& p) + : RPoint_2((RPoint_2&)p) + {} + + Point_2(const RPoint_2& p) + : RPoint_2(p) + {} + + Point_2(const RT& hx, const RT& hy) + : RPoint_2(hx, hy) + {} + + Point_2(const RT& hx, const RT& hy, const RT& hw) + : RPoint_2(hx, hy, hw) + {} + + + bool operator==(const CGAL::Point_2& p) const + { + return RPoint_2::operator==(p); + } + + bool operator!=(const CGAL::Point_2& p) const + { + return !(*this == p); + } + + RT hx() const + { + return RPoint_2::hx(); + } + + RT hy() const + { + return RPoint_2::hy(); + } + + RT hw() const + { + return RPoint_2::hw(); + } + FT x() const + { + return RPoint_2::x(); + } + + FT y() const + { + return RPoint_2::y(); + } + + RT homogeneous(int i) const + { + return RPoint_2::homogeneous(i); + } + + FT cartesian(int i) const + { + return RPoint_2::cartesian(i); + } + + FT operator[](int i) const + { + return cartesian(i); + } + + int dimension() const + { + return 2; + } + + Bbox_2 bbox() const + { + return RPoint_2::bbox(); + } + + CGAL::Point_2 transform(const CGAL::Aff_transformation_2& t) const + { + return RPoint_2::transform(t); + } + +private: + + Point_2(const RVector_2& v) + : RPoint_2(v) + {} +}; + +#ifndef NO_OSTREAM_INSERT_POINT_2 +template < class R > +std::ostream& +operator<<(std::ostream& os, const Point_2& p) +{ + typedef typename R::Point_2_base RPoint_2; + return os << (const RPoint_2&)p; +} +#endif // NO_OSTREAM_INSERT_POINT_2 + +#ifndef NO_ISTREAM_EXTRACT_POINT_2 +template < class R > +std::istream& +operator>>(std::istream& is, Point_2& p) +{ + typedef typename R::Point_2_base RPoint_2; + return is >> (RPoint_2&)p; +} +#endif // NO_ISTREAM_EXTRACT_POINT_2 + +template +inline +Point_2 +operator+(const Origin& o, const Vector_2& v); + +template +inline +Point_2 +operator-(const Origin& o, const Vector_2& v); + +template +inline +Vector_2 +operator-(const Point_2& p, const Origin& ); + +CGAL_END_NAMESPACE + + +#ifndef CGAL_VECTOR_2_H +#include +#endif // CGAL_VECTOR_2_H + +#include + +#ifndef CGAL_AFF_TRANSFORMATION_2_H +#include +#endif // CGAL_AFF_TRANSFORMATION_2_H + +CGAL_BEGIN_NAMESPACE + +template +inline +bool +operator==(const Origin& o, const Point_2& p) +{ return p == o; } + +template +inline +bool +operator!=(const Origin& o, const Point_2& p) +{ return p != o; } + +CGAL_END_NAMESPACE + + +#endif // CGAL_POINT_2_H diff --git a/Packages/Kernel_23/include/CGAL/Point_3.h b/Packages/Kernel_23/include/CGAL/Point_3.h new file mode 100644 index 00000000000..a1d43e96bf2 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Point_3.h @@ -0,0 +1,188 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : Point_3.fw +// file : Point_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_POINT_3_H +#define CGAL_POINT_3_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_POINTH3_H +#include +#endif // CGAL_POINTH3_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_POINTC3_H +#include +#endif // CGAL_POINTC3_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#include + +CGAL_BEGIN_NAMESPACE + +template +class Point_3 : public R_::Point_3_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Point_3_base RPoint_3; + typedef typename R::Vector_3_base RVector_3; + +friend CGAL_FRIEND_INLINE + CGAL::Point_3 + vector_to_point_conversion CGAL_NULL_TMPL_ARGS + (const CGAL::Vector_3& v); + +public: + Point_3() + {} + Point_3(const Origin& o) : RPoint_3(o) + {} + Point_3(const CGAL::Point_3& p) : RPoint_3( (const RPoint_3& )p ) + {} + Point_3(const RPoint_3& p) : RPoint_3(p) + {} + Point_3(const RT& hx, const RT& hy, const RT& hz) + : RPoint_3(hx, hy, hz) + {} + Point_3(const RT& hx, const RT& hy, const RT& hz, const RT& hw) + : RPoint_3(hx, hy, hz, hw) + {} + + bool operator==(const CGAL::Point_3& p) const + { return RPoint_3::operator==(p); } + + bool operator!=(const CGAL::Point_3& p) const + { return !(*this == p); } + + + RT hx() const + { return RPoint_3::hx(); } + + RT hy() const + { return RPoint_3::hy(); } + + RT hz() const + { return RPoint_3::hz(); } + + RT hw() const + { return RPoint_3::hw(); } + + FT x() const + { return RPoint_3::x(); } + + FT y() const + { return RPoint_3::y(); } + + FT z() const + { return RPoint_3::z(); } + + RT homogeneous(int i) const + { return RPoint_3::homogeneous(i); } + + FT cartesian(int i) const + { return RPoint_3::cartesian(i); } + + FT operator[](int i) const + { return cartesian(i); } + + int dimension() const + { return 3; } + + Bbox_3 bbox() const + { return RPoint_3::bbox(); } + + CGAL::Point_3 transform(const CGAL::Aff_transformation_3& t) const + { return RPoint_3::transform(t); } + +private: + Point_3(const RVector_3& v) : RPoint_3(v) + {} +}; + +CGAL_END_NAMESPACE + + +#ifndef CGAL_VECTOR_3_H +#include +#endif // CGAL_VECTOR_3_H + +#include + +#ifndef CGAL_AFF_TRANSFORMATION_3_H +#include +#endif // CGAL_AFF_TRANSFORMATION_3_H + +CGAL_BEGIN_NAMESPACE + +template +inline +bool +operator==(const Origin& o, const Point_3& p) +{ return p == o; } + +template +inline +bool +operator!=(const Origin& o, const Point_3& p) +{ return p != o; } + + +#ifndef NO_OSTREAM_INSERT_POINT_3 + +template < class R > +std::ostream& +operator<<(std::ostream& os, const Point_3& p) +{ + typedef typename R::Point_3_base RPoint_3; + return os << (const RPoint_3& )p; +} +#endif // NO_OSTREAM_INSERT_POINT_3 + +#ifndef NO_ISTREAM_EXTRACT_POINT_3 +template < class R > +std::istream& operator>>(std::istream& is, Point_3& p) +{ + typedef typename R::Point_3_base RPoint_3; + return is >> (RPoint_3& )p; +} +#endif // NO_ISTREAM_EXTRACT_POINT_3 + +CGAL_END_NAMESPACE + + +#endif // CGAL_POINT_3_H diff --git a/Packages/Kernel_23/include/CGAL/Ray_2.h b/Packages/Kernel_23/include/CGAL/Ray_2.h new file mode 100644 index 00000000000..d7775a646a3 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Ray_2.h @@ -0,0 +1,165 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : Ray_2.fw +// file : Ray_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_RAY_2_H +#define CGAL_RAY_2_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifndef CGAL_SEGMENT_2_H +#include +#endif // CGAL_SEGMENT_2_H + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_RAYH2_H +#include +#endif // CGAL_RAYH2_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_RAYC2_H +#include +#endif // CGAL_RAYC2_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +CGAL_BEGIN_NAMESPACE + +template +class Ray_2 : public R_::Ray_2_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Ray_2_base RRay_2; + + Ray_2() + : RRay_2() + {} + + ~Ray_2() + {} + + Ray_2(const CGAL::Ray_2 &r) + : RRay_2((const RRay_2&)r) + { + + } + + Ray_2(const RRay_2& r) + : RRay_2(r) + { + + } + + Ray_2(const CGAL::Point_2 &sp, + const CGAL::Point_2 &secondp) + : RRay_2(sp, secondp) + {} + + Ray_2(const CGAL::Point_2 &sp, + const CGAL::Direction_2 &d) + : RRay_2(sp, d) + {} + + + bool operator==(const CGAL::Ray_2 &r) const + { return RRay_2::operator==(r); } + + bool operator!=(const CGAL::Ray_2 &r) const + { return !(*this == r); } + + CGAL::Point_2 start() const + { return RRay_2::start(); } + + CGAL::Point_2 source() const + { return RRay_2::source(); } + + CGAL::Point_2 second_point() const + { return RRay_2::second_point(); } + + CGAL::Point_2 point(int i) const + { return RRay_2::point(i); } + + CGAL::Direction_2 direction() const + { return RRay_2::direction(); } + + CGAL::Line_2 supporting_line() const + { return RRay_2::supporting_line(); } + + CGAL::Ray_2 opposite() const + { return RRay_2::opposite(); } + + CGAL::Ray_2 transform(const CGAL::Aff_transformation_2 &t) const + { return RRay_2::transform(t); } + + bool is_horizontal() const + { return RRay_2::is_horizontal(); } + + bool is_vertical() const + { return RRay_2::is_vertical(); } + + bool is_degenerate() const + { return RRay_2::is_degenerate(); } + + bool has_on(const CGAL::Point_2 &p) const + { return RRay_2::has_on(p); } + + bool collinear_has_on(const CGAL::Point_2 &p) const + { return RRay_2::collinear_has_on(p); } + +}; + +#ifndef NO_OSTREAM_INSERT_RAY_2 +template < class R > +std::ostream & +operator<<(std::ostream &os, const Ray_2 &r) +{ + typedef typename R::Ray_2_base RRay_2; + return os << (const RRay_2&)r; +} +#endif // NO_OSTREAM_INSERT_RAY_2 + +#ifndef NO_ISTREAM_EXTRACT_RAY_2 +template < class R > +std::istream & +operator>>(std::istream &is, Ray_2 &r) +{ + typedef typename R::Ray_2_base RRay_2; + return is >> (RRay_2&)r; +} +#endif // NO_ISTREAM_EXTRACT_RAY_2 + +CGAL_END_NAMESPACE + + +#endif // CGAL_RAY_2_H diff --git a/Packages/Kernel_23/include/CGAL/Ray_3.h b/Packages/Kernel_23/include/CGAL/Ray_3.h new file mode 100644 index 00000000000..42e485d7ccc --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Ray_3.h @@ -0,0 +1,132 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : Ray_3.fw +// file : Ray_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_RAY_3_H +#define CGAL_RAY_3_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_RAYH3_H +#include +#endif // CGAL_RAYH3_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_RAYC3_H +#include +#endif // CGAL_RAYC3_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +CGAL_BEGIN_NAMESPACE + +template +class Ray_3 : public R_::Ray_3_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Ray_3_base RRay_3; + + Ray_3() : RRay_3() + {} + Ray_3(const CGAL::Ray_3& r) : RRay_3(r) + {} + Ray_3(const RRay_3& r) : RRay_3(r) + {} + Ray_3(const CGAL::Point_3& sp, + const CGAL::Point_3& secondp) + : RRay_3(sp, secondp) + {} + Ray_3(const CGAL::Point_3& sp, + const CGAL::Direction_3& d) + : RRay_3(sp, d) + {} + + bool operator==(const CGAL::Ray_3& r) const + { return RRay_3::operator==(r); } + bool operator!=(const CGAL::Ray_3& r) const + { return !(*this == r); } + + CGAL::Point_3 start() const + { return RRay_3::start(); } + CGAL::Point_3 source() const + { return RRay_3::source(); } + CGAL::Point_3 second_point() const + { return RRay_3::second_point(); } + CGAL::Point_3 point(int i) const + { return RRay_3::point(i); } + CGAL::Direction_3 direction() const + { return RRay_3::direction(); } + CGAL::Line_3 supporting_line() const + { return RRay_3::supporting_line(); } + CGAL::Ray_3 opposite() const + { return RRay_3::opposite(); } + CGAL::Ray_3 transform(const CGAL::Aff_transformation_3& t) const + { return RRay_3::transform(t); } + bool is_degenerate() const + { return RRay_3::is_degenerate(); } + bool has_on(const CGAL::Point_3& p) const + { return RRay_3::has_on(p); } +}; + +#ifndef NO_OSTREAM_INSERT_RAY_3 +template < class R > +std::ostream& +operator<<(std::ostream& os, const Ray_3& r) +{ + typedef typename R::Ray_3_base RRay_3; + return os << (const RRay_3& )r; +} +#endif // NO_OSTREAM_INSERT_RAY_3 + +#ifndef NO_ISTREAM_EXTRACT_RAY_3 +template < class R > +std::istream& +operator>>(std::istream& is, Ray_3& r) +{ + typedef typename R::Ray_3_base RRay_3; + return is >> (RRay_3& )r; +} +#endif // NO_ISTREAM_EXTRACT_RAY_3 + + +CGAL_END_NAMESPACE + + +#ifndef CGAL_LINE_3_H +#include +#endif // CGAL_LINE_3_H + +#endif // CGAL_RAY_3_H diff --git a/Packages/Kernel_23/include/CGAL/Segment_2.h b/Packages/Kernel_23/include/CGAL/Segment_2.h new file mode 100644 index 00000000000..ea67ac4f964 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Segment_2.h @@ -0,0 +1,183 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : Segment_2.fw +// file : Segment_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_SEGMENT_2_H +#define CGAL_SEGMENT_2_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_SEGMENTH2_H +#include +#endif // CGAL_SEGMENTH2_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_SEGMENTC2_H +#include +#endif // CGAL_SEGMENTC2_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_LINE_2_H +#include +#endif // CGAL_LINE_2_H + +CGAL_BEGIN_NAMESPACE + +template +class Segment_2 : public R_::Segment_2_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Segment_2_base RSegment_2; + + Segment_2() // doesn't the default constructor do the same ??? + : RSegment_2() // does the handle stuff + {} + + ~Segment_2() + {} + + Segment_2(const CGAL::Segment_2& s) + : RSegment_2((RSegment_2&)s) // does the handle stuff + {} + + Segment_2(const CGAL::Point_2 &sp, const CGAL::Point_2 &ep) + : RSegment_2(sp,ep) + {} + + + // conversion from implementation class object to interface class object + Segment_2(const RSegment_2& s) + : RSegment_2(s) // does the handle stuff + {} + + + bool is_horizontal() const + { return RSegment_2::is_horizontal(); } + + bool is_vertical() const + { return RSegment_2::is_vertical(); } + + bool has_on(const CGAL::Point_2 &p) const + { return RSegment_2::has_on(p); } + + bool collinear_has_on(const CGAL::Point_2 &p) const + { return RSegment_2::collinear_has_on(p); } + + + bool operator==(const CGAL::Segment_2 &s) const + { return RSegment_2::operator==(s); } + + bool operator!=(const CGAL::Segment_2 &s) const + { return !(*this == s); } + + CGAL::Point_2 start() const + { return RSegment_2::start(); } + + CGAL::Point_2 end() const + { return RSegment_2::end(); } + + CGAL::Point_2 source() const + { return RSegment_2::source(); } + + CGAL::Point_2 target() const + { return RSegment_2::target(); } + + CGAL::Point_2 min() const + { return RSegment_2::min(); } + + CGAL::Point_2 max() const + { return RSegment_2::max(); } + + CGAL::Point_2 vertex(int i) const + { return RSegment_2::vertex(i); } + + CGAL::Point_2 point(int i) const + { return RSegment_2::vertex(i); } + + CGAL::Point_2 operator[](int i) const + { return vertex(i); } + + FT squared_length() const + { return RSegment_2::squared_length(); } + + CGAL::Direction_2 direction() const + { return RSegment_2::direction(); } + + CGAL::Segment_2 opposite() const + { return CGAL::Segment_2(target(),source()); } + + // this makes use of the constructor of the interface class + // taking an object of the implemetation class as argument. + + CGAL::Segment_2 transform(const CGAL::Aff_transformation_2 &t) const + { return RSegment_2::transform(t); } + + + CGAL::Line_2 supporting_line() const + { return RSegment_2::supporting_line(); } + + bool is_degenerate() const + { return RSegment_2::is_degenerate(); } + + Bbox_2 bbox() const + { return source().bbox() + target().bbox(); } + +}; + +#ifndef NO_OSTREAM_INSERT_SEGMENT_2 +template < class R> +std::ostream & +operator<<(std::ostream &os, const Segment_2 &s) +{ + typedef typename R::Segment_2_base RSegment_2; + return os << (const RSegment_2&)s; +} +#endif // NO_OSTREAM_INSERT_SEGMENT_2 + +#ifndef NO_ISTREAM_EXTRACT_SEGMENT_2 +template < class R> +std::istream & +operator>>(std::istream &is, Segment_2 &s) +{ + typedef typename R::Segment_2_base RSegment_2; + return is >> (RSegment_2&)s; +} +#endif // NO_ISTREAM_EXTRACT_SEGMENT_2 + +CGAL_END_NAMESPACE + + +#endif // CGAL_SEGMENT_2_H diff --git a/Packages/Kernel_23/include/CGAL/Segment_3.h b/Packages/Kernel_23/include/CGAL/Segment_3.h new file mode 100644 index 00000000000..4620a13a822 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Segment_3.h @@ -0,0 +1,139 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : Segment_3.fw +// file : Segment_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_SEGMENT_3_H +#define CGAL_SEGMENT_3_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_SEGMENTH3_H +#include +#endif // CGAL_SEGMENTH3_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_SEGMENTC3_H +#include +#endif // CGAL_SEGMENTC3_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_LINE_3_H +#include +#endif // CGAL_LINE_3_H + +CGAL_BEGIN_NAMESPACE + +template +class Segment_3 : public R_::Segment_3_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Segment_3_base RSegment_3; + + Segment_3() : RSegment_3() + {} + Segment_3(const CGAL::Segment_3& s) : RSegment_3(s) + {} + Segment_3(const CGAL::Point_3& sp, const CGAL::Point_3& ep) + : RSegment_3(sp,ep) + {} + Segment_3(const RSegment_3& s) : RSegment_3(s) + {} + + bool has_on(const CGAL::Point_3& p) const + { return RSegment_3::has_on(p); } + bool operator==(const CGAL::Segment_3& s) const + { return RSegment_3::operator==(s); } + bool operator!=(const CGAL::Segment_3& s) const + { return !(*this == s); } + CGAL::Point_3 start() const + { return RSegment_3::start(); } + CGAL::Point_3 end() const + { return RSegment_3::end(); } + CGAL::Point_3 source() const + { return RSegment_3::source(); } + CGAL::Point_3 target() const + { return RSegment_3::target(); } + CGAL::Point_3 min() const + { return RSegment_3::min(); } + CGAL::Point_3 max() const + { return RSegment_3::max(); } + CGAL::Point_3 vertex(int i) const + { return RSegment_3::vertex(i); } + CGAL::Point_3 operator[](int i) const + { return vertex(i); } + FT squared_length() const + { return RSegment_3::squared_length(); } + CGAL::Direction_3 direction() const + { return RSegment_3::direction(); } + CGAL::Segment_3 opposite() const + { return CGAL::Segment_3(target(),source()); } + CGAL::Segment_3 transform(const CGAL::Aff_transformation_3& t) const + { return RSegment_3::transform(t); } + CGAL::Line_3 supporting_line() const + { return RSegment_3::supporting_line(); } + bool is_degenerate() const + { return RSegment_3::is_degenerate(); } + Bbox_3 bbox() const + { return source().bbox() + target().bbox(); } +}; + + +#ifndef NO_OSTREAM_INSERT_SEGMENT_3 +template < class R> +std::ostream& +operator<<(std::ostream& os, const Segment_3& s) +{ + typedef typename R::Segment_3_base RSegment_3; + return os << (const RSegment_3& )s; +} +#endif // NO_OSTREAM_INSERT_SEGMENT_3 + +#ifndef NO_ISTREAM_EXTRACT_SEGMENT_3 +template < class R> +std::istream& +operator>>(std::istream& is, Segment_3& s) +{ + typedef typename R::Segment_3_base RSegment_3; + return is >> (RSegment_3& )s; +} +#endif // NO_ISTREAM_EXTRACT_SEGMENT_3 + + +CGAL_END_NAMESPACE + + +#endif // CGAL_SEGMENT_3_H diff --git a/Packages/Kernel_23/include/CGAL/Sixtuple.h b/Packages/Kernel_23/include/CGAL/Sixtuple.h new file mode 100644 index 00000000000..642e42ba8d8 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Sixtuple.h @@ -0,0 +1,78 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : Tuples.fw +// file : Sixtuple.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL__SIXTUPLE_H +#define CGAL__SIXTUPLE_H + +CGAL_BEGIN_NAMESPACE + +template < class T > +class _Sixtuple : public Rep +{ +public: + + T e0; + T e1; + T e2; + T e3; + T e4; + T e5; + + _Sixtuple() + { + } + _Sixtuple(const T & a0, const T & a1, const T & a2, + const T & a3, const T & a4, const T & a5) + : e0(a0), e1(a1), e2(a2), e3(a3), e4(a4), e5(a5) + {} + + ~_Sixtuple() + {} +}; + +template < class T > +class Sixtuple : public Ref_counted +{ +public: + + T e0; + T e1; + T e2; + T e3; + T e4; + T e5; + + Sixtuple() + {} + + Sixtuple(const T & a0, const T & a1, const T & a2, + const T & a3, const T & a4, const T & a5) + : e0(a0), e1(a1), e2(a2), e3(a3), e4(a4), e5(a5) + {} +}; + +CGAL_END_NAMESPACE + +#endif // CGAL__SIXTUPLE_H diff --git a/Packages/Kernel_23/include/CGAL/Sphere_3.h b/Packages/Kernel_23/include/CGAL/Sphere_3.h new file mode 100644 index 00000000000..88441c125e9 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Sphere_3.h @@ -0,0 +1,98 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : Sphere_3.fw +// file : Sphere_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_SPHERE_3_H +#define CGAL_SPHERE_3_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#include +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#include +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +namespace CGAL { + + +template +class Sphere_3 : public R_::Sphere_3_base + +{ + public: + + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Sphere_3_base RSphere_3; + + Sphere_3() + {} + + Sphere_3(const RSphere_3& s) + : RSphere_3(s) + {} + + Sphere_3(const CGAL::Point_3& p, const FT& sq_rad, + const Orientation& o = COUNTERCLOCKWISE) + : RSphere_3(p, sq_rad, o) + {} + + Sphere_3(const CGAL::Point_3& p, const CGAL::Point_3& q, + const CGAL::Point_3& r, const CGAL::Point_3& u) + : RSphere_3(p, q, r, u) + {} + + Sphere_3(const CGAL::Point_3& p, const CGAL::Point_3& q, + const CGAL::Point_3& r, + const Orientation& o = COUNTERCLOCKWISE) + : RSphere_3(p, q, r, o) + {} + + Sphere_3(const CGAL::Point_3& p, const CGAL::Point_3& q, + const Orientation& o = COUNTERCLOCKWISE) + : RSphere_3(p, q, o) + {} + + Sphere_3(const CGAL::Point_3& p, + const Orientation& o = COUNTERCLOCKWISE) + : RSphere_3(p, o) + {} + +}; + +} // namespace CGAL + +#endif // CGAL_SPHERE_3_H diff --git a/Packages/Kernel_23/include/CGAL/Tetrahedron_3.h b/Packages/Kernel_23/include/CGAL/Tetrahedron_3.h new file mode 100644 index 00000000000..e2b43b8a2fb --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Tetrahedron_3.h @@ -0,0 +1,142 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : Tetrahedron_3.fw +// file : Tetrahedron_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_TETRAHEDRON_3_H +#define CGAL_TETRAHEDRON_3_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_TETRAHEDRONH3_H +#include +#endif // CGAL_TETRAHEDRONH3_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_TETRAHEDRONC3_H +#include +#endif // CGAL_TETRAHEDRONC3_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_PLANE_3_H +#include +#endif // CGAL_PLANE_3_H + +CGAL_BEGIN_NAMESPACE + +template +class Tetrahedron_3 : public R_::Tetrahedron_3_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Tetrahedron_3_base RTetrahedron_3; + + Tetrahedron_3() : RTetrahedron_3() + {} + Tetrahedron_3(const CGAL::Tetrahedron_3& t) : RTetrahedron_3(t) + {} + Tetrahedron_3(const RTetrahedron_3& t) : RTetrahedron_3(t) + {} + Tetrahedron_3(const CGAL::Point_3& p, + const CGAL::Point_3& q, + const CGAL::Point_3& r, + const CGAL::Point_3& s) + : RTetrahedron_3(p,q,r,s) + {} + + CGAL::Point_3 vertex(int i) const + { return RTetrahedron_3::vertex(i); } + CGAL::Point_3 operator[](int i) const + { return vertex(i); } + bool operator==(const CGAL::Tetrahedron_3& t) const + { return RTetrahedron_3::operator==(t); } + bool operator!=(const CGAL::Tetrahedron_3& t) const + { return !(*this == t); } + Bbox_3 bbox() const + { + return vertex(0).bbox() + vertex(1).bbox() + + vertex(2).bbox() + vertex(3).bbox(); + } + CGAL::Tetrahedron_3 + transform(const CGAL::Aff_transformation_3& t) const + { + return + CGAL::Tetrahedron_3(RTetrahedron_3::transform(t)); + } + Orientation orientation() const + { return RTetrahedron_3::orientation(); } + Oriented_side oriented_side(const CGAL::Point_3& p) const + { return RTetrahedron_3::oriented_side(p); } + bool has_on_positive_side(const CGAL::Point_3& p) const + { return oriented_side(p) == ON_POSITIVE_SIDE; } + bool has_on_negative_side(const CGAL::Point_3& p) const + { return oriented_side(p) == ON_NEGATIVE_SIDE; } + Bounded_side bounded_side(const CGAL::Point_3& p) const + { return RTetrahedron_3::bounded_side(p); } + bool has_on_boundary(const CGAL::Point_3& p) const + { return bounded_side(p) == ON_BOUNDARY; } + bool has_on_bounded_side(const CGAL::Point_3& p) const + { return bounded_side(p) == ON_BOUNDED_SIDE; } + bool has_on_unbounded_side(const CGAL::Point_3& p) const + { return bounded_side(p) == ON_UNBOUNDED_SIDE; } + bool is_degenerate() const + { return RTetrahedron_3::is_degenerate(); } +}; + +#ifndef NO_OSTREAM_INSERT_TETRAHEDRON_3 +template < class R > +std::ostream& +operator<<(std::ostream& os, const Tetrahedron_3& t) +{ + typedef typename R::Tetrahedron_3_base RTetrahedron_3; + return os << (const RTetrahedron_3& )t; +} +#endif // NO_OSTREAM_INSERT_TETRAHEDRON_3 + +#ifndef NO_ISTREAM_EXTRACT_TETRAHEDRON_3 +template < class R > +std::istream& +operator>>(std::istream& is, Tetrahedron_3& t) +{ + typedef typename R::Tetrahedron_3_base RTetrahedron_3; + return is >> (RTetrahedron_3& )t; +} +#endif // NO_ISTREAM_EXTRACT_TETRAHEDRON_3 + + +CGAL_END_NAMESPACE + + +#endif // CGAL_TETRAHEDRON_3_H diff --git a/Packages/Kernel_23/include/CGAL/Threetuple.h b/Packages/Kernel_23/include/CGAL/Threetuple.h new file mode 100644 index 00000000000..dad793568a1 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Threetuple.h @@ -0,0 +1,68 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : Tuple.fw +// file : Threetuple.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL__THREETUPLE_H +#define CGAL__THREETUPLE_H + +CGAL_BEGIN_NAMESPACE + +template < class T > +class _Threetuple : public Rep +{ +public: + + T e0; + T e1; + T e2; + + _Threetuple() + {} + + _Threetuple(const T & a0, const T & a1, const T & a2) + : e0(a0), e1(a1), e2(a2) + {} + + ~_Threetuple() + {} +}; + +template < class T > +struct Threetuple : public Ref_counted +{ + T e0; + T e1; + T e2; + + Threetuple() + {} + + Threetuple(const T & a0, const T & a1, const T & a2) + : e0(a0), e1(a1), e2(a2) + {} +}; + +CGAL_END_NAMESPACE + +#endif // CGAL__THREETUPLE_H diff --git a/Packages/Kernel_23/include/CGAL/Triangle_2.h b/Packages/Kernel_23/include/CGAL/Triangle_2.h new file mode 100644 index 00000000000..8f21b55c508 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Triangle_2.h @@ -0,0 +1,164 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : Triangle_2.fw +// file : Triangle_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_TRIANGLE_2_H +#define CGAL_TRIANGLE_2_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_TRIANGLEH2_H +#include +#endif // CGAL_TRIANGLEH2_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_TRIANGLEC2_H +#include +#endif // CGAL_TRIANGLEC2_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_POINT_2_H +#include +#endif // CGAL_POINT_2_H + +CGAL_BEGIN_NAMESPACE + +template + class Triangle_2 : public R_::Triangle_2_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Triangle_2_base RTriangle_2; + + Triangle_2() : RTriangle_2() {} + + Triangle_2(const CGAL::Triangle_2 &t) : RTriangle_2((RTriangle_2&)t) {} + + Triangle_2(const RTriangle_2& t) : RTriangle_2(t) {} + + Triangle_2(const CGAL::Point_2 &p, + const CGAL::Point_2 &q, + const CGAL::Point_2 &r) : RTriangle_2(p,q,r) {} + + + bool + operator==(const CGAL::Triangle_2 &t) const + { return RTriangle_2::operator==(t); } + + bool + operator!=(const CGAL::Triangle_2 &t) const + { return !(*this == t); } + + CGAL::Point_2 + vertex(int i) const + { return RTriangle_2::vertex(i); } + + CGAL::Point_2 + operator[](int i) const + { return vertex(i); } + + CGAL::Triangle_2 + transform(const CGAL::Aff_transformation_2 &t) const + { return RTriangle_2::transform(t); } + + CGAL::Triangle_2 opposite() const + { return CGAL::Triangle_2(vertex(0), vertex(2), vertex(1)); } + + Orientation + orientation() const + { return RTriangle_2::orientation(); } + + Oriented_side + oriented_side(const CGAL::Point_2 &p) const + { return RTriangle_2::oriented_side(p); } + + Bounded_side + bounded_side(const CGAL::Point_2 &p) const + { return RTriangle_2::bounded_side(p); } + + bool + has_on_boundary(const CGAL::Point_2 &p) const + { return RTriangle_2::has_on_boundary(p); } + + bool + has_on_positive_side(const CGAL::Point_2 &p) const + { return RTriangle_2::has_on_positive_side(p); } + + bool + has_on_negative_side(const CGAL::Point_2 &p) const + { return RTriangle_2::has_on_negative_side(p); } + + bool + has_on_unbounded_side(const CGAL::Point_2 &p) const + { return RTriangle_2::has_on_unbounded_side(p); } + + bool + has_on_bounded_side(const CGAL::Point_2 &p) const + { return RTriangle_2::has_on_bounded_side(p); } + + bool + is_degenerate() const + { return RTriangle_2::is_degenerate(); } + + Bbox_2 + bbox() const + { return vertex(0).bbox() + vertex(1).bbox() + vertex(2).bbox(); } +}; + +#ifndef NO_OSTREAM_INSERT_TRIANGLE_2 +template < class R > +std::ostream & +operator<<(std::ostream &os, const Triangle_2 &t) +{ + typedef typename R::Triangle_2_base RTriangle_2; + return os << (const RTriangle_2&)t; +} +#endif // NO_OSTREAM_INSERT_TRIANGLE_2 + +#ifndef NO_ISTREAM_EXTRACT_TRIANGLE_2 +template < class R > +std::istream & +operator>>(std::istream &is, Triangle_2 &t) +{ + typedef typename R::Triangle_2_base RTriangle_2; + return is >> (RTriangle_2&)t; +} +#endif // NO_ISTREAM_EXTRACT_TRIANGLE_2 + +CGAL_END_NAMESPACE + + +#endif // CGAL_TRIANGLE_2_H diff --git a/Packages/Kernel_23/include/CGAL/Triangle_3.h b/Packages/Kernel_23/include/CGAL/Triangle_3.h new file mode 100644 index 00000000000..eee5720cd50 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Triangle_3.h @@ -0,0 +1,135 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : Triangle_3.fw +// file : Triangle_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_TRIANGLE_3_H +#define CGAL_TRIANGLE_3_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_TRIANGLEH3_H +#include +#endif // CGAL_TRIANGLEH3_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_TRIANGLEC3_H +#include +#endif // CGAL_TRIANGLEC3_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_PLANE_3_H +#include +#endif // CGAL_PLANE_3_H + +CGAL_BEGIN_NAMESPACE + +template +class Triangle_3 : public R_::Triangle_3_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Triangle_3_base RTriangle_3; + + Triangle_3() : RTriangle_3() + {} + Triangle_3(const CGAL::Triangle_3& t) : RTriangle_3(t) + {} + Triangle_3(const RTriangle_3& t) : RTriangle_3(t) + {} + Triangle_3(const CGAL::Point_3& p, + const CGAL::Point_3& q, + const CGAL::Point_3& r) + : RTriangle_3(p,q,r) + {} + + bool operator==(const CGAL::Triangle_3& t) const + { return RTriangle_3::operator==(t); } + bool operator!=(const CGAL::Triangle_3& t) const + { return !(*this == t); } + CGAL::Plane_3 supporting_plane() const + { + return + CGAL::Plane_3( + RTriangle_3::supporting_plane()); + } + CGAL::Triangle_3 transform( + const CGAL::Aff_transformation_3& t) const + { + return + CGAL::Triangle_3(RTriangle_3::transform( t )); + } + bool has_on(const CGAL::Point_3& p) const + { return RTriangle_3::has_on(p); } + bool is_degenerate() const + { return RTriangle_3::is_degenerate(); } + CGAL::Point_3 vertex(int i) const + { return RTriangle_3::vertex(i); } + CGAL::Point_3 operator[](int i) const + { return vertex(i); } + Bbox_3 bbox() const + { + return vertex(0).bbox() + + vertex(1).bbox() + + vertex(2).bbox(); + } +}; + +#ifndef NO_OSTREAM_INSERT_TRIANGLE_3 +template < class R > +std::ostream& +operator<<(std::ostream& os, const Triangle_3& t) +{ + typedef typename R::Triangle_3_base RTriangle_3; + return os << (const RTriangle_3& )t; +} +#endif // NO_OSTREAM_INSERT_TRIANGLE_3 + +#ifndef NO_ISTREAM_EXTRACT_TRIANGLE_3 +template < class R > +std::istream& +operator>>(std::istream& is, Triangle_3& t) +{ + typedef typename R::Triangle_3_base RTriangle_3; + return is >> (RTriangle_3& )t; +} +#endif // NO_ISTREAM_EXTRACT_TRIANGLE_3 + + +CGAL_END_NAMESPACE + + +#endif // CGAL_TRIANGLE_3_H diff --git a/Packages/Kernel_23/include/CGAL/Twotuple.h b/Packages/Kernel_23/include/CGAL/Twotuple.h new file mode 100644 index 00000000000..a06ba5e4d16 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Twotuple.h @@ -0,0 +1,65 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : Tuple.fw +// file : Twotuple.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL__TWOTUPLE_H +#define CGAL__TWOTUPLE_H + +CGAL_BEGIN_NAMESPACE + +template < class T > +class _Twotuple : public Rep +{ +public: + T e0; + T e1; + + _Twotuple() + {} + + _Twotuple(const T & a0, const T &a1) + : e0(a0), e1(a1) + {} + + ~_Twotuple() + {} +}; + +template < class T > +class Twotuple : public Ref_counted +{ +public: + T e0; + T e1; + + Twotuple() + {} + + Twotuple(const T & a0, const T &a1) : e0(a0), e1(a1) + {} +}; + +CGAL_END_NAMESPACE + +#endif // CGAL__TWOTUPLE_H diff --git a/Packages/Kernel_23/include/CGAL/Vector_2.h b/Packages/Kernel_23/include/CGAL/Vector_2.h new file mode 100644 index 00000000000..39b997223c8 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Vector_2.h @@ -0,0 +1,209 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : Vector_2.fw +// file : Vector_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_VECTOR_2_H +#define CGAL_VECTOR_2_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifndef CGAL_POINT_2_H +#include +#endif // CGAL_POINT_2_H + + +#ifndef CGAL_DIRECTION_2_H +#include +#endif // CGAL_DIRECTION_2_H + + + +#ifdef VECTOR_WRAPPER +#ifndef VECTOR_2_RFT_WRAPPER_H +#include +#endif // VECTOR_2_RFT_WRAPPER_H +#endif // VECTOR_WRAPPER + +CGAL_BEGIN_NAMESPACE + +template class Quotient; +template +class Vector_2 : public R_::Vector_2_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Vector_2_base RVector_2; + +friend CGAL_FRIEND_INLINE + CGAL::Vector_2 + CGAL_SCOPE point_to_vector_conversion CGAL_NULL_TMPL_ARGS + (const CGAL::Point_2 &p); + + Vector_2() {} + + Vector_2(const CGAL::Vector_2 &v) : RVector_2((const RVector_2&)v) {} + + Vector_2(const RVector_2& v) : RVector_2(v) {} + + Vector_2(const Null_vector &v) : RVector_2(v) {} + + Vector_2(const RT &x, const RT &y) : RVector_2(x,y) {} + + Vector_2(const RT &x, const RT &y, const RT &w) : RVector_2(x,y,w) {} + + + bool + operator==(const CGAL::Vector_2 &v) const + { return RVector_2::operator==(v); } + + bool + operator!=(const CGAL::Vector_2 &v) const + { return !(*this == v); } + + bool + operator==(const Null_vector &v) const + { return RVector_2::operator==(v); } + + bool + operator!=(const Null_vector &v) const + { return !(*this == v); } + + RT + hx() const + { return RVector_2::hx(); } + + RT + hy() const + { return RVector_2::hy(); } + + RT + hw() const + { return RVector_2::hw(); } + + FT x() const + { return RVector_2::x(); } + + FT y() const + { return RVector_2::y(); } + + RT homogeneous(int i) const + { return RVector_2::homogeneous(i); } + + FT + cartesian(int i) const + { return RVector_2::cartesian(i); } + + FT + operator[](int i) const + { return cartesian(i); } + + int + dimension() const + { return 2; } + + CGAL::Vector_2 + operator+(const CGAL::Vector_2 &w) const + { return (const RVector_2&)(*this) + (const RVector_2&)(w); } + + CGAL::Vector_2 + operator-(const CGAL::Vector_2 &w) const + { return (const RVector_2&)(*this) - (const RVector_2&)(w); } + + CGAL::Vector_2 + operator-() const + { return RVector_2::operator-(); } + + FT + operator*(const CGAL::Vector_2 &w) const + { return (const RVector_2&)(*this) * (const RVector_2&)(w); } + +#ifndef VECTOR_WRAPPER + CGAL::Vector_2 + operator*(const RT &c) const + { return c * (const RVector_2&)(*this); } + + CGAL::Vector_2 + operator*(const Quotient &q) const + { return (q.numerator() * (const RVector_2&)(*this)) / q.denominator(); } + + CGAL::Vector_2 + operator/(const Quotient &q) const + { return (q.denominator() * (const RVector_2&)(*this)) / q.numerator(); } +#endif // VECTOR_WRAPPER + + CGAL::Vector_2 + operator/(const RT &c) const + { return (const RVector_2&)(*this) / c; } + + CGAL::Direction_2 + direction() const + { return RVector_2::direction(); } + + CGAL::Vector_2 + perpendicular(const Orientation &o) const + { return RVector_2::perpendicular(o); } + + CGAL::Vector_2 + transform(const CGAL::Aff_transformation_2 &t) const + { return RVector_2::transform(t); } + +private: + Vector_2(const CGAL::Point_2 &p) : RVector_2(p) {} + + Vector_2(const CGAL::Direction_2 &d) : RVector_2(d) {} +}; + +template < class R > +No_number_tag +number_type_tag(const Vector_2 &) +{ return No_number_tag(); } +#ifndef NO_OSTREAM_INSERT_VECTOR_2 +template < class R > +std::ostream & +operator<<(std::ostream &os, const Vector_2 &v) +{ + typedef typename R::Vector_2_base RVector_2; + return os << (const RVector_2&)v; +} +#endif // NO_OSTREAM_INSERT_VECTOR_2 + +#ifndef NO_ISTREAM_EXTRACT_VECTOR_2 +template < class R > +std::istream & +operator>>(std::istream &is, Vector_2 &p) +{ + typedef typename R::Vector_2_base RVector_2; + return is >> (RVector_2&)p; +} +#endif // NO_ISTREAM_EXTRACT_VECTOR_2 + +CGAL_END_NAMESPACE + + +#endif // CGAL_VECTOR_2_H diff --git a/Packages/Kernel_23/include/CGAL/Vector_3.h b/Packages/Kernel_23/include/CGAL/Vector_3.h new file mode 100644 index 00000000000..142fccb79e2 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/Vector_3.h @@ -0,0 +1,193 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : Vector_3.fw +// file : Vector_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_VECTOR_3_H +#define CGAL_VECTOR_3_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifndef CGAL_POINT_3_H +#include +#endif // CGAL_POINT_3_H + + +#ifndef CGAL_DIRECTION_3_H +#include +#endif // CGAL_DIRECTION_3_H + +#ifdef VECTOR_WRAPPER +#ifndef VECTOR_3_RFT_WRAPPER_H +#include +#endif // VECTOR_3_RFT_WRAPPER_H +#endif // VECTOR_WRAPPER + +CGAL_BEGIN_NAMESPACE + +template class Quotient; +template +class Vector_3 : public R_::Vector_3_base +{ +public: + typedef R_ R; + typedef typename R::RT RT; + typedef typename R::FT FT; + typedef typename R::Vector_3_base RVector_3; + +friend CGAL_FRIEND_INLINE + CGAL::Vector_3 + point_to_vector_conversion CGAL_NULL_TMPL_ARGS + (const CGAL::Point_3& p); +/* +friend CGAL::Vector_3 + CGAL::Direction_3::vector() const; +*/ + + Vector_3() + {} + Vector_3(const CGAL::Vector_3& v) + : RVector_3( (const RVector_3& )v ) + {} + Vector_3(const RVector_3& v) : RVector_3(v) + {} + Vector_3(const Null_vector& v) : RVector_3(v) + {} + Vector_3(const RT& x, const RT& y, const RT& z) + : RVector_3(x, y, z) + {} + Vector_3(const RT& x, const RT& y, const RT& z, const RT& w) + : RVector_3(x, y, z, w) + {} + + bool operator==(const CGAL::Vector_3& v) const + { return RVector_3::operator==(v); } + bool operator!=(const CGAL::Vector_3& v) const + { return !(*this == v); } + bool operator==(const Null_vector& v) const + { return RVector_3::operator==(v); } + bool operator!=(const Null_vector& v) const + { return !(*this == v); } + RT hx() const + { return RVector_3::hx(); } + RT hy() const + { return RVector_3::hy(); } + RT hz() const + { return RVector_3::hz(); } + RT hw() const + { return RVector_3::hw(); } + FT x() const + { return RVector_3::x(); } + FT y() const + { return RVector_3::y(); } + FT z() const + { return RVector_3::z(); } + RT homogeneous(int i) const + { return RVector_3::homogeneous(i); } + FT cartesian(int i) const + { return RVector_3::cartesian(i); } + FT operator[](int i) const + { return cartesian(i); } + int dimension() const + { return 3; } + CGAL::Vector_3 operator+(const CGAL::Vector_3& w) const + { return (const RVector_3& )(*this) + (const RVector_3& )(w); } + CGAL::Vector_3 operator-(const CGAL::Vector_3& w) const + { return (const RVector_3& )(*this) - (const RVector_3& )(w); } + CGAL::Vector_3 operator-() const + { return RVector_3::operator-(); } + FT operator*(const CGAL::Vector_3& w) const + { return (const RVector_3& )(*this) * (const RVector_3& )(w); } + +#ifndef VECTOR_WRAPPER + CGAL::Vector_3 operator*(const RT& c) const + { return c * (const RVector_3& )(*this) ; } + CGAL::Vector_3 operator*(const Quotient& q) const + { + return (q.numerator() * (const RVector_3& )(*this)) / + q.denominator(); + } + CGAL::Vector_3 operator/(const Quotient& q) const + { + return (q.denominator() * (const RVector_3& )(*this)) / + q.numerator(); + } +#endif // VECTOR_WRAPPER + + CGAL::Vector_3 operator/(const RT& c) const + { return (const RVector_3& )(*this) / c; } + CGAL::Direction_3 direction() const + { return RVector_3::direction(); } + CGAL::Vector_3 transform(const CGAL::Aff_transformation_3& t) const + { return RVector_3::transform(t); } + +private: + Vector_3(const CGAL::Point_3& p) : RVector_3(p) + {} + Vector_3(const CGAL::Direction_3& d) : RVector_3(d) + {} +}; + +template < class R > +No_number_tag number_type_tag(const Vector_3& ) +{ + return No_number_tag(); +} + +#ifndef NO_OSTREAM_INSERT_VECTOR_3 +template < class R > +std::ostream& +operator<<(std::ostream& os, const Vector_3& v) +{ + typedef typename R::Vector_3_base RVector_3; + return os << (const RVector_3& )v; +} +#endif // NO_OSTREAM_INSERT_VECTOR_3 + +#ifndef NO_ISTREAM_EXTRACT_VECTOR_3 +template < class R > +std::istream& +operator>>(std::istream& is, Vector_3& p) +{ + typedef typename R::Vector_3_base RVector_3; + return is >> (RVector_3& )p; +} +#endif // NO_ISTREAM_EXTRACT_VECTOR_3 + + +template +inline +Vector_3 +cross_product(const Vector_3& v, const Vector_3& w) +{ + typedef typename R::Vector_3_base RVector_3; + return cross_product((const RVector_3& )v,(const RVector_3& )w); +} + +CGAL_END_NAMESPACE + + +#endif // CGAL_VECTOR_3_H diff --git a/Packages/Kernel_23/include/CGAL/aff_transformation_tags.h b/Packages/Kernel_23/include/CGAL/aff_transformation_tags.h new file mode 100644 index 00000000000..30b73582b05 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/aff_transformation_tags.h @@ -0,0 +1,49 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : aff_transformation_tags.fw +// file : aff_transformation_tags.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_AFF_TRANSFORMATION_TAGS_H +#define CGAL_AFF_TRANSFORMATION_TAGS_H + +#ifndef CGAL_CONFIG_H +#include +#endif // CGAL_CONFIG_H + +CGAL_BEGIN_NAMESPACE + +class Translation {}; +class Rotation {}; +class Scaling {}; +class Reflection {}; +class Identity_transformation {}; + +extern Translation TRANSLATION; +extern Rotation ROTATION; +extern Scaling SCALING; +extern Reflection REFLECTION; +extern Identity_transformation IDENTITY; + +CGAL_END_NAMESPACE + +#endif // CGAL_AFF_TRANSFORMATION_TAGS_H diff --git a/Packages/Kernel_23/include/CGAL/assertions.h b/Packages/Kernel_23/include/CGAL/assertions.h new file mode 100644 index 00000000000..9b498e81a13 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/assertions.h @@ -0,0 +1,320 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// file : CGAL/assertions.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// source : +// author(s) : Geert-Jan Giezeman and Sven Schönherr +// +// coordinator : MPI, Saarbruecken +// +// ====================================================================== + +#ifndef CGAL_CONFIG_H +#include +#endif // CGAL_CONFIG_H + +#ifndef CGAL_ASSERTIONS_H +#define CGAL_ASSERTIONS_H + +CGAL_BEGIN_NAMESPACE + +// types +// ===== + +enum Failure_behaviour { ABORT, EXIT, EXIT_WITH_SUCCESS, CONTINUE }; + +// function declarations +// ===================== +// failure functions +// ----------------- +void assertion_fail ( const char*, const char*, int, const char*); +void precondition_fail ( const char*, const char*, int, const char*); +void postcondition_fail ( const char*, const char*, int, const char*); + +// warning function +// ---------------- +void warning_fail( const char*, const char*, int, const char*); + + +// macro definitions +// ================= +// assertions +// ---------- + + +#if defined(CGAL_KERNEL_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ + || defined(NDEBUG) +# define CGAL_assertion(EX) ((void)0) +# define CGAL_assertion_msg(EX,MSG) ((void)0) +# define CGAL_assertion_code(CODE) +#else +# define CGAL_assertion(EX) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_assertion_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_assertion_code(CODE) CODE +#endif // CGAL_KERNEL_NO_ASSERTIONS + +#if defined(CGAL_KERNEL_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || defined(NDEBUG) +# define CGAL_exactness_assertion(EX) ((void)0) +# define CGAL_exactness_assertion_msg(EX,MSG) ((void)0) +# define CGAL_exactness_assertion_code(CODE) +#else +# define CGAL_exactness_assertion(EX) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_exactness_assertion_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_exactness_assertion_code(CODE) CODE +#endif // CGAL_KERNEL_NO_ASSERTIONS + +#if defined(CGAL_KERNEL_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\ + || defined(NDEBUG) +# define CGAL_expensive_assertion(EX) ((void)0) +# define CGAL_expensive_assertion_msg(EX,MSG) ((void)0) +# define CGAL_expensive_assertion_code(CODE) +#else +# define CGAL_expensive_assertion(EX) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_expensive_assertion_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_expensive_assertion_code(CODE) CODE +#endif // CGAL_KERNEL_NO_ASSERTIONS + +#if defined(CGAL_KERNEL_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\ + || defined(NDEBUG) +# define CGAL_expensive_exactness_assertion(EX) ((void)0) +# define CGAL_expensive_exactness_assertion_msg(EX,MSG) ((void)0) +# define CGAL_expensive_exactness_assertion_code(CODE) +#else +# define CGAL_expensive_exactness_assertion(EX) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_expensive_exactness_assertion_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_expensive_exactness_assertion_code(CODE) CODE +#endif // CGAL_KERNEL_NO_ASSERTIONS + + +// preconditions +// ------------- + +#if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ + || defined(NDEBUG) +# define CGAL_precondition(EX) ((void)0) +# define CGAL_precondition_msg(EX,MSG) ((void)0) +# define CGAL_precondition_code(CODE) +#else +# define CGAL_precondition(EX) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_precondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_precondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_PRECONDITIONS + +#if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || defined(NDEBUG) +# define CGAL_exactness_precondition(EX) ((void)0) +# define CGAL_exactness_precondition_msg(EX,MSG) ((void)0) +# define CGAL_exactness_precondition_code(CODE) +#else +# define CGAL_exactness_precondition(EX) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_exactness_precondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_exactness_precondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_PRECONDITIONS + +#if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\ + || defined(NDEBUG) +# define CGAL_expensive_precondition(EX) ((void)0) +# define CGAL_expensive_precondition_msg(EX,MSG) ((void)0) +# define CGAL_expensive_precondition_code(CODE) +#else +# define CGAL_expensive_precondition(EX) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_expensive_precondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_expensive_precondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_PRECONDITIONS + +#if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\ + || defined(NDEBUG) +# define CGAL_expensive_exactness_precondition(EX) ((void)0) +# define CGAL_expensive_exactness_precondition_msg(EX,MSG) ((void)0) +# define CGAL_expensive_exactness_precondition_code(CODE) +#else +# define CGAL_expensive_exactness_precondition(EX) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_expensive_exactness_precondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_expensive_exactness_precondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_PRECONDITIONS + + +// postconditions +// -------------- + +#if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ + || defined(NDEBUG) +# define CGAL_postcondition(EX) ((void)0) +# define CGAL_postcondition_msg(EX,MSG) ((void)0) +# define CGAL_postcondition_code(CODE) +#else +# define CGAL_postcondition(EX) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_postcondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_postcondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_POSTCONDITIONS + +#if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || defined(NDEBUG) +# define CGAL_exactness_postcondition(EX) ((void)0) +# define CGAL_exactness_postcondition_msg(EX,MSG) ((void)0) +# define CGAL_exactness_postcondition_code(CODE) +#else +# define CGAL_exactness_postcondition(EX) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_exactness_postcondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_exactness_postcondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_POSTCONDITIONS + +#if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\ + || defined(NDEBUG) +# define CGAL_expensive_postcondition(EX) ((void)0) +# define CGAL_expensive_postcondition_msg(EX,MSG) ((void)0) +# define CGAL_expensive_postcondition_code(CODE) +#else +# define CGAL_expensive_postcondition(EX) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_expensive_postcondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_expensive_postcondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_POSTCONDITIONS + +#if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\ + || defined(NDEBUG) +# define CGAL_expensive_exactness_postcondition(EX) ((void)0) +# define CGAL_expensive_exactness_postcondition_msg(EX,MSG) ((void)0) +# define CGAL_expensive_exactness_postcondition_code(CODE) +#else +# define CGAL_expensive_exactness_postcondition(EX) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_expensive_exactness_postcondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_expensive_exactness_postcondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_POSTCONDITIONS + + +// warnings +// -------- + +#if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ + || defined(NDEBUG) +# define CGAL_warning(EX) ((void)0) +# define CGAL_warning_msg(EX,MSG) ((void)0) +# define CGAL_warning_code(CODE) +#else +# define CGAL_warning(EX) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_warning_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_warning_code(CODE) CODE +#endif // CGAL_KERNEL_NO_WARNINGS + +#if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || defined(NDEBUG) +# define CGAL_exactness_warning(EX) ((void)0) +# define CGAL_exactness_warning_msg(EX,MSG) ((void)0) +# define CGAL_exactness_warning_code(CODE) +#else +# define CGAL_exactness_warning(EX) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_exactness_warning_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_exactness_warning_code(CODE) CODE +#endif // CGAL_KERNEL_NO_WARNINGS + +#if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\ + || defined(NDEBUG) +# define CGAL_expensive_warning(EX) ((void)0) +# define CGAL_expensive_warning_msg(EX,MSG) ((void)0) +# define CGAL_expensive_warning_code(CODE) +#else +# define CGAL_expensive_warning(EX) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_expensive_warning_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_expensive_warning_code(CODE) CODE +#endif // CGAL_KERNEL_NO_WARNINGS + +#if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE))\ + || defined(NDEBUG) +# define CGAL_expensive_exactness_warning(EX) ((void)0) +# define CGAL_expensive_exactness_warning_msg(EX,MSG) ((void)0) +# define CGAL_expensive_exactness_warning_code(CODE) +#else +# define CGAL_expensive_exactness_warning(EX) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_expensive_exactness_warning_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_expensive_exactness_warning_code(CODE) CODE +#endif // CGAL_KERNEL_NO_WARNINGS + + +// failure handler declarations +// ========================== +// failure handler +// --------------- +typedef + void + (*Failure_function)( + const char*, const char*, const char*, int, const char*); + +Failure_function +set_error_handler( Failure_function handler); + +Failure_function +set_warning_handler( Failure_function handler); + +// failure behaviour handler +// ------------------------- +Failure_behaviour +set_error_behaviour(Failure_behaviour eb); + +Failure_behaviour +set_warning_behaviour(Failure_behaviour eb); + +CGAL_END_NAMESPACE + +#endif // CGAL_ASSERTIONS_H + diff --git a/Packages/Kernel_23/include/CGAL/basic.h b/Packages/Kernel_23/include/CGAL/basic.h new file mode 100644 index 00000000000..96b32f7679b --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/basic.h @@ -0,0 +1,191 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : basic.fw +// file : basic.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Lutz Kettner +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_BASIC_H +#define CGAL_BASIC_H + +#ifndef CGAL_CONFIG_H +# include +#endif // CGAL_CONFIG_H + +#define CGAL_NTS CGAL::NTS:: + +#if ((__GNUC__ == 2) && (__GNUC_MINOR__ == 95)) +#include +#endif // gcc 2.95 + +#include +#include + + +// Big endian or little endian machine. +// ==================================== +#ifdef CGAL_CFG_NO_BIG_ENDIAN +#define CGAL_LITTLE_ENDIAN 1 +#else +#define CGAL_BIG_ENDIAN 1 +#endif + + +#ifdef CGAL_USE_LEDA +# ifndef CGAL_PROTECT_LEDA_BASIC_H +# if ( __LEDA__ < 380 ) +# define Max leda_Max +# define Min leda_Min +# endif // __LEDA__ < 380 +# include +# if ( __LEDA__ < 380 ) +# undef Max +# undef Min +# endif // __LEDA__ < 380 +# define CGAL_PROTECT_LEDA_BASIC_H +# endif // CGAL_PROTECT_LEDA_BASIC_H +#endif // CGAL_USE_LEDA + +// CGAL uses std::min and std::max +// (see ISO C++ 25.3.7, page 562), +// if feasible +#include + +namespace CGAL { + +#if !defined(CGAL_CFG_USING_USING_BUG) && !defined(CGAL_CFG_BROKEN_USING) + + using std::min; + using std::max; + +#else + + template + inline + NT + // const NT& + min(const NT& x, const NT& y) + { return (y < x) ? y : x; } + + template + inline + NT + // const NT& + max(const NT& x, const NT& y) + { return (x < y) ? y : x; } + +#endif // CGAL_CFG_BROKEN_USING +} // namespace CGAL + + +#ifndef CGAL_ASSERTIONS_H +#include +#endif // CGAL_ASSERTIONS_H +#ifndef CGAL_KERNEL_ASSERTIONS_H +#include +#endif // CGAL_KERNEL_ASSERTIONS_H +#ifndef CGAL_HANDLE_H +#include +#endif // CGAL_HANDLE_H +#ifndef CGAL_OBJECT_H +#include +#endif // CGAL_OBJECT_H +#ifndef CGAL_ENUM_H +#include +#endif // CGAL_ENUM_H +#ifndef CGAL_TAGS_H +#include +#endif // CGAL_TAGS_H +#ifndef CGAL_MISC_H +#include +#endif // CGAL_MISC_H +#ifndef CGAL_NUMBER_TYPE_BASIC_H +#include +#endif // CGAL_NUMBER_TYPE_BASIC_H +#ifndef CGAL_IO_IO_H +#include +#endif // CGAL_IO_IO_H +#ifndef CGAL_KERNEL_BASIC_H +#include +#endif // CGAL_KERNEL_BASIC_H + +#ifndef CGAL_KNOWN_BIT_SIZE_INTEGERS_H +#include +#endif // CGAL_KNOWN_BIT_SIZE_INTEGERS_H + +CGAL_BEGIN_NAMESPACE + + +// Two struct's to denote boolean compile time decisions. +// ====================================================== +struct Tag_true {}; +struct Tag_false {}; + +inline bool check_tag( Tag_true) {return true;} +inline bool check_tag( Tag_false) {return false;} + +// A function that asserts a specific compile time tag +// forcing its two arguments to have equal type. +// It is encapsulated with #ifdef since it will be defined also elsewhere. +// ====================================================== +#ifndef CGAL_ASSERT_COMPILE_TIME_TAG +#define CGAL_ASSERT_COMPILE_TIME_TAG 1 +template +struct Assert_tag_class +{ + void match_compile_time_tag( const Base&) const {} +}; + +template +inline +void +Assert_compile_time_tag( const Tag&, const Derived& b) +{ + Assert_tag_class x; + x.match_compile_time_tag(b); +} +#endif // CGAL_ASSERT_COMPILE_TIME_TAG + +template < class T> +inline +void +assert_equal_types( const T&, const T&) {} + + + +// Symbolic constants to tailor inlining. Inlining Policy. +// ======================================================= +#ifndef CGAL_MEDIUM_INLINE +#define CGAL_MEDIUM_INLINE inline +#endif +#ifndef CGAL_LARGE_INLINE +#define CGAL_LARGE_INLINE +#endif +#ifndef CGAL_HUGE_INLINE +#define CGAL_HUGE_INLINE +#endif + +CGAL_END_NAMESPACE + + + +#endif // CGAL_BASIC_H diff --git a/Packages/Kernel_23/include/CGAL/basic_classes.h b/Packages/Kernel_23/include/CGAL/basic_classes.h new file mode 100644 index 00000000000..43e44df1366 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/basic_classes.h @@ -0,0 +1,36 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : user_classes.fw +// file : basic_classes.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_BASIC_CLASSES_H +#define CGAL_BASIC_CLASSES_H + +#include +#include +#include +#include +#include + +#endif // CGAL_BASIC_CLASSES_H diff --git a/Packages/Kernel_23/include/CGAL/basic_constructions_2.h b/Packages/Kernel_23/include/CGAL/basic_constructions_2.h new file mode 100644 index 00000000000..0fef93d3c49 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/basic_constructions_2.h @@ -0,0 +1,73 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : basic_constructions_2.fw +// file : basic_constructions_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Sven Schoenherr +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_BASIC_CONSTRUCTIONS_2_H +#define CGAL_BASIC_CONSTRUCTIONS_2_H 1 + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_BASIC_CONSTRUCTIONSH2_H +#include +#endif // CGAL_BASIC_CONSTRUCTIONSH2_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_BASIC_CONSTRUCTIONSC2_H +#include +#endif // CGAL_BASIC_CONSTRUCTIONSC2_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +CGAL_BEGIN_NAMESPACE + +template < class R > +inline +Point_2 +midpoint( const Point_2& p, + const Point_2& q ) +{ + typedef typename R::Point_2_base RPoint_2; + return( midpoint( static_cast(p), + static_cast(q))); +} +template < class R > +inline +Point_2 +circumcenter( const Point_2& p, + const Point_2& q, + const Point_2& r) +{ + typedef typename R::Point_2_base RPoint_2; + return( circumcenter( static_cast(p), + static_cast(q), + static_cast(r))); +} +CGAL_END_NAMESPACE + + +#endif // CGAL_BASIC_CONSTRUCTIONS_2_H diff --git a/Packages/Kernel_23/include/CGAL/basic_constructions_3.h b/Packages/Kernel_23/include/CGAL/basic_constructions_3.h new file mode 100644 index 00000000000..8d1c4fa0ce0 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/basic_constructions_3.h @@ -0,0 +1,72 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : basic_constructions_3.fw +// file : basic_constructions_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_BASIC_CONSTRUCTIONS_3_H +#define CGAL_BASIC_CONSTRUCTIONS_3_H + +#ifdef CGAL_HOMOGENEOUS_H +#include +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#include +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +CGAL_BEGIN_NAMESPACE + +template < class R > +inline +Point_3 +midpoint( const Point_3& p, + const Point_3& q ) +{ + typedef typename R::Point_3_base RPoint_3; + return( midpoint( static_cast(p), + static_cast(q))); +} +template < class R > +inline +Point_3 +circumcenter( const Point_3& p, + const Point_3& q, + const Point_3& r, + const Point_3& s) +{ + typedef typename R::Point_3_base RPoint_3; + return( circumcenter( static_cast(p), + static_cast(q), + static_cast(r), + static_cast(s))); +} +CGAL_END_NAMESPACE + + +#endif // CGAL_BASIC_CONSTRUCTIONS_3_H diff --git a/Packages/Kernel_23/include/CGAL/cartesian_homogeneous_conversion.h b/Packages/Kernel_23/include/CGAL/cartesian_homogeneous_conversion.h new file mode 100644 index 00000000000..5da7f8d1745 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/cartesian_homogeneous_conversion.h @@ -0,0 +1,132 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : Point_conversion.fw +// file : cartesian_homogeneous_conversion.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_CARTESIAN_HOMOGENEOUS_CONVERSION_H +#define CGAL_CARTESIAN_HOMOGENEOUS_CONVERSION_H + +CGAL_BEGIN_NAMESPACE + +template +Point_2< Cartesian > +homogeneous_to_cartesian(const Point_2< Homogeneous >& hp) +{ + return + Point_2< Cartesian >(hp.hx(), hp.hy(), hp.hw() ); +} + +template +Point_2< Homogeneous > +cartesian_to_homogeneous(const Point_2< Cartesian >& cp) +{ + return + Point_2< Homogeneous >(cp.hx(), cp.hy()); +} + +template +Point_3< Cartesian > +homogeneous_to_cartesian(const Point_3< Homogeneous >& hp) +{ + return + Point_3< Cartesian >(hp.hx(), hp.hy(), hp.hz(), hp.hw() ); +} + +template +Point_3< Homogeneous > +cartesian_to_homogeneous(const Point_3< Cartesian >& cp) +{ + return + Point_3< Homogeneous >(cp.hx(), cp.hy(), cp.hz() ); +} + +template +Point_2< Cartesian > > +homogeneous_to_quotient_cartesian( + const Point_2 >& hp) +{ + typedef Quotient QT; + return Point_2< Cartesian >( QT( hp.hx(), hp.hw() ), + QT( hp.hy(), hp.hw() ) ); +} + +template +Point_2< Homogeneous > +quotient_cartesian_to_homogeneous( + const Point_2< Cartesian< Quotient > >& cp) +{ + typedef Point_2 > HPoint; + if ( cp.x().denominator() != cp.y().denominator() ) + { + return HPoint( cp.x().numerator() * cp.y().denominator(), + cp.y().numerator() * cp.x().denominator(), + cp.x().denominator()* cp.y().denominator()); + } + else + { + return HPoint( cp.x().numerator(), + cp.y().numerator(), + cp.x().denominator()); + } +} + +template +Point_3< Cartesian > > +homogeneous_to_quotient_cartesian( + const Point_3 >& hp) +{ + typedef Quotient QT; + return Point_3< Cartesian >( QT( hp.hx(), hp.hw() ), + QT( hp.hy(), hp.hw() ), + QT( hp.hz(), hp.hw() ) ); +} + +template +Point_3< Homogeneous > +quotient_cartesian_to_homogeneous( + const Point_3< Cartesian< Quotient > >& cp) +{ + typedef Point_3 > HPoint; + if ( (cp.x().denominator() != cp.y().denominator() ) + ||(cp.x().denominator() != cp.z().denominator() ) ) + { + return + HPoint(cp.x().numerator() *cp.y().denominator()*cp.z().denominator(), + cp.y().numerator() *cp.x().denominator()*cp.z().denominator(), + cp.z().numerator() *cp.x().denominator()*cp.y().denominator(), + cp.x().denominator()*cp.y().denominator()*cp.z().denominator()); + } + else + { + return HPoint( cp.x().numerator(), + cp.y().numerator(), + cp.z().numerator(), + cp.x().denominator()); + } +} + +CGAL_END_NAMESPACE + + +#endif // CGAL_CARTESIAN_HOMOGENEOUS_CONVERSION_H diff --git a/Packages/Kernel_23/include/CGAL/determinant.h b/Packages/Kernel_23/include/CGAL/determinant.h new file mode 100644 index 00000000000..84d354fde8f --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/determinant.h @@ -0,0 +1,213 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : determinant.fw +// file : determinant.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Sylvain Pion +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_DETERMINANT_H +#define CGAL_DETERMINANT_H + +CGAL_BEGIN_NAMESPACE + +template +inline +FT +det2x2_by_formula( + const FT& a00, const FT& a01, + const FT& a10, const FT& a11) +{ +// First compute the det2x2 + const FT m01 = a00*a11 - a10*a01; + return m01; +} + +template +CGAL_KERNEL_MEDIUM_INLINE +FT +det3x3_by_formula( + const FT& a00, const FT& a01, const FT& a02, + const FT& a10, const FT& a11, const FT& a12, + const FT& a20, const FT& a21, const FT& a22) +{ +// First compute the det2x2 + const FT m01 = a00*a11 - a10*a01; + const FT m02 = a00*a21 - a20*a01; + const FT m12 = a10*a21 - a20*a11; +// Now compute the minors of rank 3 + const FT m012 = m01*a22 - m02*a12 + m12*a02; + return m012; +} + +template +CGAL_KERNEL_LARGE_INLINE +FT +det4x4_by_formula( + const FT& a00, const FT& a01, const FT& a02, const FT& a03, + const FT& a10, const FT& a11, const FT& a12, const FT& a13, + const FT& a20, const FT& a21, const FT& a22, const FT& a23, + const FT& a30, const FT& a31, const FT& a32, const FT& a33) +{ +// First compute the det2x2 + const FT m01 = a10*a01 - a00*a11; + const FT m02 = a20*a01 - a00*a21; + const FT m03 = a30*a01 - a00*a31; + const FT m12 = a20*a11 - a10*a21; + const FT m13 = a30*a11 - a10*a31; + const FT m23 = a30*a21 - a20*a31; +// Now compute the minors of rank 3 + const FT m012 = m12*a02 - m02*a12 + m01*a22; + const FT m013 = m13*a02 - m03*a12 + m01*a32; + const FT m023 = m23*a02 - m03*a22 + m02*a32; + const FT m123 = m23*a12 - m13*a22 + m12*a32; +// Now compute the minors of rank 4 + const FT m0123 = m123*a03 - m023*a13 + m013*a23 - m012*a33; + return m0123; +} + +template +CGAL_KERNEL_LARGE_INLINE +FT +det5x5_by_formula( + const FT& a00, const FT& a01, const FT& a02, const FT& a03, const FT& a04, + const FT& a10, const FT& a11, const FT& a12, const FT& a13, const FT& a14, + const FT& a20, const FT& a21, const FT& a22, const FT& a23, const FT& a24, + const FT& a30, const FT& a31, const FT& a32, const FT& a33, const FT& a34, + const FT& a40, const FT& a41, const FT& a42, const FT& a43, const FT& a44) +{ +// First compute the det2x2 + const FT m01 = a10*a01 - a00*a11; + const FT m02 = a20*a01 - a00*a21; + const FT m03 = a30*a01 - a00*a31; + const FT m04 = a40*a01 - a00*a41; + const FT m12 = a20*a11 - a10*a21; + const FT m13 = a30*a11 - a10*a31; + const FT m14 = a40*a11 - a10*a41; + const FT m23 = a30*a21 - a20*a31; + const FT m24 = a40*a21 - a20*a41; + const FT m34 = a40*a31 - a30*a41; +// Now compute the minors of rank 3 + const FT m012 = m12*a02 - m02*a12 + m01*a22; + const FT m013 = m13*a02 - m03*a12 + m01*a32; + const FT m014 = m14*a02 - m04*a12 + m01*a42; + const FT m023 = m23*a02 - m03*a22 + m02*a32; + const FT m024 = m24*a02 - m04*a22 + m02*a42; + const FT m034 = m34*a02 - m04*a32 + m03*a42; + const FT m123 = m23*a12 - m13*a22 + m12*a32; + const FT m124 = m24*a12 - m14*a22 + m12*a42; + const FT m134 = m34*a12 - m14*a32 + m13*a42; + const FT m234 = m34*a22 - m24*a32 + m23*a42; +// Now compute the minors of rank 4 + const FT m0123 = m123*a03 - m023*a13 + m013*a23 - m012*a33; + const FT m0124 = m124*a03 - m024*a13 + m014*a23 - m012*a43; + const FT m0134 = m134*a03 - m034*a13 + m014*a33 - m013*a43; + const FT m0234 = m234*a03 - m034*a23 + m024*a33 - m023*a43; + const FT m1234 = m234*a13 - m134*a23 + m124*a33 - m123*a43; +// Now compute the minors of rank 5 + const FT m01234 = m1234*a04 - m0234*a14 + m0134*a24 - m0124*a34 + m0123*a44; + return m01234; +} + +template +FT +det6x6_by_formula( + const FT& a00, const FT& a01, const FT& a02, const FT& a03, const FT& a04, const FT& a05, + const FT& a10, const FT& a11, const FT& a12, const FT& a13, const FT& a14, const FT& a15, + const FT& a20, const FT& a21, const FT& a22, const FT& a23, const FT& a24, const FT& a25, + const FT& a30, const FT& a31, const FT& a32, const FT& a33, const FT& a34, const FT& a35, + const FT& a40, const FT& a41, const FT& a42, const FT& a43, const FT& a44, const FT& a45, + const FT& a50, const FT& a51, const FT& a52, const FT& a53, const FT& a54, const FT& a55) +{ +// First compute the det2x2 + const FT m01 = a00*a11 - a10*a01; + const FT m02 = a00*a21 - a20*a01; + const FT m03 = a00*a31 - a30*a01; + const FT m04 = a00*a41 - a40*a01; + const FT m05 = a00*a51 - a50*a01; + const FT m12 = a10*a21 - a20*a11; + const FT m13 = a10*a31 - a30*a11; + const FT m14 = a10*a41 - a40*a11; + const FT m15 = a10*a51 - a50*a11; + const FT m23 = a20*a31 - a30*a21; + const FT m24 = a20*a41 - a40*a21; + const FT m25 = a20*a51 - a50*a21; + const FT m34 = a30*a41 - a40*a31; + const FT m35 = a30*a51 - a50*a31; + const FT m45 = a40*a51 - a50*a41; +// Now compute the minors of rank 3 + const FT m012 = m01*a22 - m02*a12 + m12*a02; + const FT m013 = m01*a32 - m03*a12 + m13*a02; + const FT m014 = m01*a42 - m04*a12 + m14*a02; + const FT m015 = m01*a52 - m05*a12 + m15*a02; + const FT m023 = m02*a32 - m03*a22 + m23*a02; + const FT m024 = m02*a42 - m04*a22 + m24*a02; + const FT m025 = m02*a52 - m05*a22 + m25*a02; + const FT m034 = m03*a42 - m04*a32 + m34*a02; + const FT m035 = m03*a52 - m05*a32 + m35*a02; + const FT m045 = m04*a52 - m05*a42 + m45*a02; + const FT m123 = m12*a32 - m13*a22 + m23*a12; + const FT m124 = m12*a42 - m14*a22 + m24*a12; + const FT m125 = m12*a52 - m15*a22 + m25*a12; + const FT m134 = m13*a42 - m14*a32 + m34*a12; + const FT m135 = m13*a52 - m15*a32 + m35*a12; + const FT m145 = m14*a52 - m15*a42 + m45*a12; + const FT m234 = m23*a42 - m24*a32 + m34*a22; + const FT m235 = m23*a52 - m25*a32 + m35*a22; + const FT m245 = m24*a52 - m25*a42 + m45*a22; + const FT m345 = m34*a52 - m35*a42 + m45*a32; +// Now compute the minors of rank 4 + const FT m0123 = m012*a33 - m013*a23 + m023*a13 - m123*a03; + const FT m0124 = m012*a43 - m014*a23 + m024*a13 - m124*a03; + const FT m0125 = m012*a53 - m015*a23 + m025*a13 - m125*a03; + const FT m0134 = m013*a43 - m014*a33 + m034*a13 - m134*a03; + const FT m0135 = m013*a53 - m015*a33 + m035*a13 - m135*a03; + const FT m0145 = m014*a53 - m015*a43 + m045*a13 - m145*a03; + const FT m0234 = m023*a43 - m024*a33 + m034*a23 - m234*a03; + const FT m0235 = m023*a53 - m025*a33 + m035*a23 - m235*a03; + const FT m0245 = m024*a53 - m025*a43 + m045*a23 - m245*a03; + const FT m0345 = m034*a53 - m035*a43 + m045*a33 - m345*a03; + const FT m1234 = m123*a43 - m124*a33 + m134*a23 - m234*a13; + const FT m1235 = m123*a53 - m125*a33 + m135*a23 - m235*a13; + const FT m1245 = m124*a53 - m125*a43 + m145*a23 - m245*a13; + const FT m1345 = m134*a53 - m135*a43 + m145*a33 - m345*a13; + const FT m2345 = m234*a53 - m235*a43 + m245*a33 - m345*a23; +// Now compute the minors of rank 5 + const FT m01234 = m0123*a44 - m0124*a34 + m0134*a24 - m0234*a14 + m1234*a04; + const FT m01235 = m0123*a54 - m0125*a34 + m0135*a24 - m0235*a14 + m1235*a04; + const FT m01245 = m0124*a54 - m0125*a44 + m0145*a24 - m0245*a14 + m1245*a04; + const FT m01345 = m0134*a54 - m0135*a44 + m0145*a34 - m0345*a14 + m1345*a04; + const FT m02345 = m0234*a54 - m0235*a44 + m0245*a34 - m0345*a24 + m2345*a04; + const FT m12345 = m1234*a54 - m1235*a44 + m1245*a34 - m1345*a24 + m2345*a14; +// Now compute the minors of rank 6 + const FT m012345 = m01234*a55 - m01235*a45 + m01245*a35 - m01345*a25 + m02345*a15 - m12345*a05; + return m012345; +} + + +CGAL_END_NAMESPACE + + +#ifndef CGAL_PREDICATES_SIGN_OF_DETERMINANT_H +#include +#endif // CGAL_PREDICATES_SIGN_OF_DETERMINANT_H + +#endif // CGAL_DETERMINANT_H diff --git a/Packages/Kernel_23/include/CGAL/distance_predicates_2.h b/Packages/Kernel_23/include/CGAL/distance_predicates_2.h new file mode 100644 index 00000000000..431c6a694f9 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/distance_predicates_2.h @@ -0,0 +1,190 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : distance_predicates_2.fw +// file : distance_predicates_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_DISTANCE_PREDICATES_2_H +#define CGAL_DISTANCE_PREDICATES_2_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_DISTANCE_PREDICATESH2_H +#include +#endif // CGAL_DISTANCE_PREDICATESH2_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_DISTANCE_PREDICATESC2_H +#include +#endif // CGAL_DISTANCE_PREDICATESC2_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_POINT_2_H +#include +#endif // CGAL_POINT_2_H +#ifndef CGAL_LINE_2_H +#include +#endif // CGAL_LINE_2_H + +CGAL_BEGIN_NAMESPACE + + +template < class R > +inline +Comparison_result +cmp_dist_to_point(const Point_2& p, + const Point_2& q, + const Point_2& r) +{ + typedef typename R::Point_2_base RPoint_2; + return cmp_dist_to_point((const RPoint_2& )p, + (const RPoint_2& )q, + (const RPoint_2& )r ); +} + +template < class R > +inline +bool +has_larger_dist_to_point(const Point_2& p, + const Point_2& q, + const Point_2& r) +{ + typedef typename R::Point_2_base RPoint_2; + return has_larger_dist_to_point((const RPoint_2& )p, + (const RPoint_2& )q, + (const RPoint_2& )r ); +} + +template < class R > +inline +bool +has_smaller_dist_to_point(const Point_2& p, + const Point_2& q, + const Point_2& r) +{ + typedef typename R::Point_2_base RPoint_2; + return has_smaller_dist_to_point((const RPoint_2& )p, + (const RPoint_2& )q, + (const RPoint_2& )r ); +} + +template < class R > +inline +Comparison_result +cmp_signed_dist_to_line(const Line_2& l, + const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + typedef typename R::Line_2_base RLine_2 ; + return cmp_signed_dist_to_line((const RLine_2& )l, + (const RPoint_2& )p, + (const RPoint_2& )q ); +} + +template < class R > +inline +bool +has_larger_signed_dist_to_line(const Line_2& l, + const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + typedef typename R::Line_2_base RLine_2 ; + return has_larger_signed_dist_to_line((const RLine_2& )l, + (const RPoint_2& )p, + (const RPoint_2& )q ); +} + +template < class R > +inline +bool +has_smaller_signed_dist_to_line(const Line_2& l, + const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + typedef typename R::Line_2_base RLine_2 ; + return has_smaller_signed_dist_to_line((const RLine_2& )l, + (const RPoint_2& )p, + (const RPoint_2& )q ); +} + +template < class R > +inline +Comparison_result +cmp_signed_dist_to_line(const Point_2& p, + const Point_2& q, + const Point_2& r, + const Point_2& s) +{ + typedef typename R::Point_2_base RPoint_2; + return cmp_signed_dist_to_line((const RPoint_2& )p, + (const RPoint_2& )q, + (const RPoint_2& )r, + (const RPoint_2& )s ); +} + +template < class R > +inline +bool +has_smaller_signed_dist_to_line(const Point_2& p, + const Point_2& q, + const Point_2& r, + const Point_2& s) +{ + typedef typename R::Point_2_base RPoint_2; + return has_smaller_signed_dist_to_line((const RPoint_2& )p, + (const RPoint_2& )q, + (const RPoint_2& )r, + (const RPoint_2& )s ); +} + +template < class R > +inline +bool +has_larger_signed_dist_to_line(const Point_2& p, + const Point_2& q, + const Point_2& r, + const Point_2& s) +{ + typedef typename R::Point_2_base RPoint_2; + return has_larger_signed_dist_to_line((const RPoint_2& )p, + (const RPoint_2& )q, + (const RPoint_2& )r, + (const RPoint_2& )s ); +} + +CGAL_END_NAMESPACE + + +#endif //CGAL_DISTANCE_PREDICATES_2_H diff --git a/Packages/Kernel_23/include/CGAL/distance_predicates_3.h b/Packages/Kernel_23/include/CGAL/distance_predicates_3.h new file mode 100644 index 00000000000..08c8b2e3980 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/distance_predicates_3.h @@ -0,0 +1,58 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : distance_predicates_3.fw +// file : distance_predicates_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_DISTANCE_PREDICATES_3_H +#define CGAL_DISTANCE_PREDICATES_3_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_DISTANCE_PREDICATESH3_H +#include +#endif // CGAL_DISTANCE_PREDICATESH3_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_DISTANCE_PREDICATESC3_H +#include +#endif // CGAL_DISTANCE_PREDICATESC3_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_POINT_3_H +#include +#endif // CGAL_POINT_3_H +#ifndef CGAL_PLANE_3_H +#include +#endif // CGAL_PLANE_3_H + +#endif //CGAL_DISTANCE_PREDICATES_3_H diff --git a/Packages/Kernel_23/include/CGAL/enum.h b/Packages/Kernel_23/include/CGAL/enum.h new file mode 100644 index 00000000000..d65cd4fe85f --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/enum.h @@ -0,0 +1,84 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : enum.fw +// file : enum.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_ENUM_H +#define CGAL_ENUM_H + +CGAL_BEGIN_NAMESPACE + + +enum Sign + { + NEGATIVE = -1, + ZERO, + POSITIVE + }; + +typedef Sign Orientation; + +const Orientation LEFTTURN = POSITIVE; +const Orientation RIGHTTURN = NEGATIVE; + +const Orientation CLOCKWISE = NEGATIVE; +const Orientation COUNTERCLOCKWISE = POSITIVE; + +const Orientation COLLINEAR = ZERO; +const Orientation COPLANAR = ZERO; +const Orientation DEGENERATE = ZERO; + + + +enum Oriented_side + { + ON_NEGATIVE_SIDE = -1, + ON_ORIENTED_BOUNDARY, + ON_POSITIVE_SIDE + }; + + +enum Bounded_side + { + ON_UNBOUNDED_SIDE = -1, + ON_BOUNDARY, + ON_BOUNDED_SIDE + }; + + +enum Comparison_result + { + SMALLER = -1, + EQUAL, + LARGER + }; + +CGAL_END_NAMESPACE + + +#ifndef CGAL_FUNCTIONS_ON_ENUMS_H +#include +#endif // CGAL_FUNCTIONS_ON_ENUMS_H + +#endif // CGAL_ENUM_H diff --git a/Packages/Kernel_23/include/CGAL/functions_on_enums.h b/Packages/Kernel_23/include/CGAL/functions_on_enums.h new file mode 100644 index 00000000000..efd0648474d --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/functions_on_enums.h @@ -0,0 +1,67 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : functions_on_enums.fw +// file : functions_on_enums.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_FUNCTIONS_ON_ENUMS_H +#define CGAL_FUNCTIONS_ON_ENUMS_H + +#ifndef CGAL_CONFIG_H +#include +#endif // CGAL_CONFIG_H + +#ifndef CGAL_ENUM_H +#include +#endif // CGAL_ENUM_H + +CGAL_BEGIN_NAMESPACE + +template +inline +T +opposite(const T& t) +{ return -t; } + +CGAL_TEMPLATE_NULL +inline +Sign +opposite(const Sign& o) +{ return (Sign)(-(int)o); } + +CGAL_TEMPLATE_NULL +inline +Oriented_side +opposite(const Oriented_side& os) +{ return (Oriented_side)(-(int)os); } + +CGAL_TEMPLATE_NULL +inline +Bounded_side +opposite(const Bounded_side &bs) +{ return (Bounded_side)(-(int)bs); } + +CGAL_END_NAMESPACE + + +#endif // CGAL_FUNCTIONS_ON_ENUMS_H diff --git a/Packages/Kernel_23/include/CGAL/kernel_assertions.h b/Packages/Kernel_23/include/CGAL/kernel_assertions.h new file mode 100644 index 00000000000..026c38c8645 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/kernel_assertions.h @@ -0,0 +1,271 @@ +// ====================================================================== +// +// Copyright (c) 1997 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : Generated from script create_assertions.sh +// file : include/CGAL/kernel_assertions.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : +// revision_date : 15 Mar 1999 +// author(s) : script by Geert-Jan Giezeman and Sven Schönherr +// +// coordinator : MPI, Saarbruecken +// +// ====================================================================== + + + +// macro definitions +// ================= +// assertions +// ---------- + + +#if defined(CGAL_KERNEL_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ + || defined(NDEBUG) +# define CGAL_kernel_assertion(EX) ((void)0) +# define CGAL_kernel_assertion_msg(EX,MSG) ((void)0) +# define CGAL_kernel_assertion_code(CODE) +#else +# define CGAL_kernel_assertion(EX) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_assertion_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_assertion_code(CODE) CODE +#endif // CGAL_KERNEL_NO_ASSERTIONS + +#if defined(CGAL_KERNEL_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || defined(NDEBUG) +# define CGAL_kernel_exactness_assertion(EX) ((void)0) +# define CGAL_kernel_exactness_assertion_msg(EX,MSG) ((void)0) +# define CGAL_kernel_exactness_assertion_code(CODE) +#else +# define CGAL_kernel_exactness_assertion(EX) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_exactness_assertion_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_exactness_assertion_code(CODE) CODE +#endif // CGAL_KERNEL_NO_ASSERTIONS + +#if defined(CGAL_KERNEL_NO_ASSERTIONS) \ + || defined(CGAL_NO_ASSERTIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) \ + || defined(NDEBUG) +# define CGAL_kernel_expensive_assertion(EX) ((void)0) +# define CGAL_kernel_expensive_assertion_msg(EX,MSG) ((void)0) +# define CGAL_kernel_expensive_assertion_code(CODE) +#else +# define CGAL_kernel_expensive_assertion(EX) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_expensive_assertion_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_expensive_assertion_code(CODE) CODE +#endif // CGAL_KERNEL_NO_ASSERTIONS + +#if defined(CGAL_KERNEL_NO_ASSERTIONS) || defined(CGAL_NO_ASSERTIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) \ + || defined(NDEBUG) +# define CGAL_kernel_expensive_exactness_assertion(EX) ((void)0) +# define CGAL_kernel_expensive_exactness_assertion_msg(EX,MSG) ((void)0) +# define CGAL_kernel_expensive_exactness_assertion_code(CODE) +#else +# define CGAL_kernel_expensive_exactness_assertion(EX) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_expensive_exactness_assertion_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::assertion_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_expensive_exactness_assertion_code(CODE) CODE +#endif // CGAL_KERNEL_NO_ASSERTIONS + + +// preconditions +// ------------- + +#if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ + || defined(NDEBUG) +# define CGAL_kernel_precondition(EX) ((void)0) +# define CGAL_kernel_precondition_msg(EX,MSG) ((void)0) +# define CGAL_kernel_precondition_code(CODE) +#else +# define CGAL_kernel_precondition(EX) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_precondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_precondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_PRECONDITIONS + +#if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || defined(NDEBUG) +# define CGAL_kernel_exactness_precondition(EX) ((void)0) +# define CGAL_kernel_exactness_precondition_msg(EX,MSG) ((void)0) +# define CGAL_kernel_exactness_precondition_code(CODE) +#else +# define CGAL_kernel_exactness_precondition(EX) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_exactness_precondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_exactness_precondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_PRECONDITIONS + +#if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) \ + || defined(NDEBUG) +# define CGAL_kernel_expensive_precondition(EX) ((void)0) +# define CGAL_kernel_expensive_precondition_msg(EX,MSG) ((void)0) +# define CGAL_kernel_expensive_precondition_code(CODE) +#else +# define CGAL_kernel_expensive_precondition(EX) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_expensive_precondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_expensive_precondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_PRECONDITIONS + +#if defined(CGAL_KERNEL_NO_PRECONDITIONS) || defined(CGAL_NO_PRECONDITIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) \ + || defined(NDEBUG) +# define CGAL_kernel_expensive_exactness_precondition(EX) ((void)0) +# define CGAL_kernel_expensive_exactness_precondition_msg(EX,MSG) ((void)0) +# define CGAL_kernel_expensive_exactness_precondition_code(CODE) +#else +# define CGAL_kernel_expensive_exactness_precondition(EX) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_expensive_exactness_precondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::precondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_expensive_exactness_precondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_PRECONDITIONS + + +// postconditions +// -------------- + +#if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ + || defined(NDEBUG) +# define CGAL_kernel_postcondition(EX) ((void)0) +# define CGAL_kernel_postcondition_msg(EX,MSG) ((void)0) +# define CGAL_kernel_postcondition_code(CODE) +#else +# define CGAL_kernel_postcondition(EX) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_postcondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_postcondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_POSTCONDITIONS + +#if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || defined(NDEBUG) +# define CGAL_kernel_exactness_postcondition(EX) ((void)0) +# define CGAL_kernel_exactness_postcondition_msg(EX,MSG) ((void)0) +# define CGAL_kernel_exactness_postcondition_code(CODE) +#else +# define CGAL_kernel_exactness_postcondition(EX) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_exactness_postcondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_exactness_postcondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_POSTCONDITIONS + +#if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) \ + || defined(NDEBUG) +# define CGAL_kernel_expensive_postcondition(EX) ((void)0) +# define CGAL_kernel_expensive_postcondition_msg(EX,MSG) ((void)0) +# define CGAL_kernel_expensive_postcondition_code(CODE) +#else +# define CGAL_kernel_expensive_postcondition(EX) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_expensive_postcondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_expensive_postcondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_POSTCONDITIONS + +#if defined(CGAL_KERNEL_NO_POSTCONDITIONS) || defined(CGAL_NO_POSTCONDITIONS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) \ + || defined(NDEBUG) +# define CGAL_kernel_expensive_exactness_postcondition(EX) ((void)0) +# define CGAL_kernel_expensive_exactness_postcondition_msg(EX,MSG) ((void)0) +# define CGAL_kernel_expensive_exactness_postcondition_code(CODE) +#else +# define CGAL_kernel_expensive_exactness_postcondition(EX) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_expensive_exactness_postcondition_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::postcondition_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_expensive_exactness_postcondition_code(CODE) CODE +#endif // CGAL_KERNEL_NO_POSTCONDITIONS + + +// warnings +// -------- + +#if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ + || defined(NDEBUG) +# define CGAL_kernel_warning(EX) ((void)0) +# define CGAL_kernel_warning_msg(EX,MSG) ((void)0) +# define CGAL_kernel_warning_code(CODE) +#else +# define CGAL_kernel_warning(EX) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_warning_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_warning_code(CODE) CODE +#endif // CGAL_KERNEL_NO_WARNINGS + +#if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || defined(NDEBUG) +# define CGAL_kernel_exactness_warning(EX) ((void)0) +# define CGAL_kernel_exactness_warning_msg(EX,MSG) ((void)0) +# define CGAL_kernel_exactness_warning_code(CODE) +#else +# define CGAL_kernel_exactness_warning(EX) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_exactness_warning_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_exactness_warning_code(CODE) CODE +#endif // CGAL_KERNEL_NO_WARNINGS + +#if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) \ + || defined(NDEBUG) +# define CGAL_kernel_expensive_warning(EX) ((void)0) +# define CGAL_kernel_expensive_warning_msg(EX,MSG) ((void)0) +# define CGAL_kernel_expensive_warning_code(CODE) +#else +# define CGAL_kernel_expensive_warning(EX) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_expensive_warning_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_expensive_warning_code(CODE) CODE +#endif // CGAL_KERNEL_NO_WARNINGS + +#if defined(CGAL_KERNEL_NO_WARNINGS) || defined(CGAL_NO_WARNINGS) \ + || (!defined(CGAL_KERNEL_CHECK_EXACTNESS) && !defined(CGAL_CHECK_EXACTNESS))\ + || (!defined(CGAL_KERNEL_CHECK_EXPENSIVE) && !defined(CGAL_CHECK_EXPENSIVE)) \ + || defined(NDEBUG) +# define CGAL_kernel_expensive_exactness_warning(EX) ((void)0) +# define CGAL_kernel_expensive_exactness_warning_msg(EX,MSG) ((void)0) +# define CGAL_kernel_expensive_exactness_warning_code(CODE) +#else +# define CGAL_kernel_expensive_exactness_warning(EX) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, 0)) +# define CGAL_kernel_expensive_exactness_warning_msg(EX,MSG) \ + ((EX)?((void)0): ::CGAL::warning_fail( # EX , __FILE__, __LINE__, MSG)) +# define CGAL_kernel_expensive_exactness_warning_code(CODE) CODE +#endif // CGAL_KERNEL_NO_WARNINGS + + diff --git a/Packages/Kernel_23/include/CGAL/kernel_basic.h b/Packages/Kernel_23/include/CGAL/kernel_basic.h new file mode 100644 index 00000000000..6971112a22a --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/kernel_basic.h @@ -0,0 +1,40 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : kernel_basic.fw +// file : kernel_basic.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_KERNEL_BASIC_H +#define CGAL_KERNEL_BASIC_H + +#define CGAL_KERNEL_INLINE inline +#define CGAL_KERNEL_MEDIUM_INLINE +#define CGAL_KERNEL_LARGE_INLINE +#define CGAL_KERNEL_CTOR_INLINE +#define CGAL_KERNEL_CTOR_MEDIUM_INLINE +#define CGAL_KERNEL_CTOR_LARGE_INLINE + +#define CGAL_FRIEND_INLINE +#define CGAL_KERNEL_FRIEND_INLINE + +#endif // CGAL_KERNEL_BASIC_H diff --git a/Packages/Kernel_23/include/CGAL/kernel_to_kernel.h b/Packages/Kernel_23/include/CGAL/kernel_to_kernel.h new file mode 100644 index 00000000000..777e800d53c --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/kernel_to_kernel.h @@ -0,0 +1,142 @@ + +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : webmisc/kernel_to_kernel.fw +// file : include/CGAL/kernel_to_kernel.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifdef CGAL_USE_LEDA +#include +#include +#endif // CGAL_USE_LEDA + +namespace CGAL { + +template +struct Cartesian_double_to_Homogeneous +{ + typedef Point_2< Homogeneous< NumberType> > Point2; + typedef Segment_2< Homogeneous< NumberType> > Segment; + + Point2 + operator()( const Point_2 >& p) + { return Point2( NumberType(p.x()), NumberType(p.y()) ); } + + Segment + operator()( const Segment_2 >& s) + { + return Segment( Point2( NumberType(s.source().x()), + NumberType(s.source().y()) ), + Point2( NumberType(s.target().x()), + NumberType(s.target().y()) ) ); + } +}; + + +template +struct Cartesian_double_to_Cartesian +{ + typedef Point_2< Cartesian< NumberType> > Point2; + typedef Point_3< Cartesian< NumberType> > Point3; + typedef Segment_2< Cartesian< NumberType> > Segment; + + Point2 + operator()( const Point_2 >& p) + { return Point2( NumberType(p.x()), NumberType(p.y()) ); } + + Point3 + operator()( const Point_3 >& p) + { return Point3( NumberType(p.x()), + NumberType(p.y()), + NumberType(p.z()) ); } + + Segment + operator()( const Segment_2 >& s) + { + return Segment( Point2( NumberType(s.source().x()), + NumberType(s.source().y()) ), + Point2( NumberType(s.target().x()), + NumberType(s.target().y()) ) ); + } +}; + +template +struct Cartesian_float_to_Cartesian +{ + typedef Point_2< Cartesian< NumberType> > Point2; + typedef Segment_2< Cartesian< NumberType> > Segment; + + Point2 + operator()( const Point_2 >& p) + { return Point2( NumberType(p.x()), NumberType(p.y()) ); } + + Segment + operator()( const Segment_2 >& s) + { + return Segment( Point2( NumberType(s.source().x()), + NumberType(s.source().y()) ), + Point2( NumberType(s.target().x()), + NumberType(s.target().y()) ) ); + } +}; + + +#ifdef CGAL_USE_LEDA +struct Cartesian_double_to_H_double_int +{ + typedef Point_2< Homogeneous< double> > Point2; + typedef Segment_2< Homogeneous< double> > Segment; + + Segment + operator()( const Segment_2< Cartesian< double> >& s) + { + leda_rat_point rs = leda_point(s.source().x(), s.source().y()); + leda_rat_point rt = leda_point(s.target().x(), s.target().y()); + + return + Segment( + Point2(::to_double(rs.X()),::to_double(rs.Y()),::to_double(rs.W())), + Point2(::to_double(rt.X()),::to_double(rt.Y()),::to_double(rt.W())) ); + } +}; + +struct Cartesian_float_to_H_double_int +{ + typedef Point_2< Homogeneous< double> > Point2; + typedef Segment_2< Homogeneous< double> > Segment; + + Segment + operator()( const Segment_2< Cartesian< float> >& s) + { + leda_rat_point rs = leda_point(s.source().x(), s.source().y()); + leda_rat_point rt = leda_point(s.target().x(), s.target().y()); + + return + Segment( + Point2(::to_double(rs.X()),::to_double(rs.Y()),::to_double(rs.W())), + Point2(::to_double(rt.X()),::to_double(rt.Y()),::to_double(rt.W())) ); + } +}; +#endif // CGAL_USE_LEDA + +} // namespace CGAL diff --git a/Packages/Kernel_23/include/CGAL/known_bit_size_integers.h b/Packages/Kernel_23/include/CGAL/known_bit_size_integers.h new file mode 100644 index 00000000000..44744f9c9fe --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/known_bit_size_integers.h @@ -0,0 +1,74 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : basic.fw +// file : known_bit_size_integers.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Lutz Kettner +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_KNOWN_BIT_SIZE_INTEGERS_H +#define CGAL_KNOWN_BIT_SIZE_INTEGERS_H +CGAL_BEGIN_NAMESPACE + + +#if (defined(__sparc__) || defined(__sparc) || defined(sparc)) || \ + (defined(__sgi__) || defined(__sgi) || defined(sgi)) || \ + (defined(__i386__) || defined(__i386) || defined(i386)) || \ + (defined(__powerpc__) || defined(__powerpc) || defined(powerpc)) + typedef signed char Integer8; + typedef short Integer16; + typedef int Integer32; + typedef unsigned char UInteger8; + typedef unsigned short UInteger16; + typedef unsigned int UInteger32; +// ANSI C++ does not support `long long' +// typedef long long int Integer64; +// typedef unsigned long long int UInteger64; +// the above definitions for long long are now in file +// include/CGAL/long_long.h and not included automatically anymore +#else +# if defined(__BORLANDC__) + typedef __int8 Integer8; + typedef __int16 Integer16; + typedef __int32 Integer32; + typedef __int64 Integer64; + typedef unsigned __int8 UInteger8; + typedef unsigned __int16 UInteger16; + typedef unsigned __int32 UInteger32; + typedef unsigned __int64 UInteger64; +# else +# if defined(_MSC_VER) + typedef signed char Integer8; + typedef short Integer16; + typedef int Integer32; + typedef __int64 Integer64; + typedef unsigned char UInteger8; + typedef unsigned short UInteger16; + typedef unsigned int UInteger32; + typedef unsigned __int64 UInteger64; +# else +# error "patch this" +# endif +# endif +#endif + +CGAL_END_NAMESPACE + +#endif // CGAL_KNOWN_BIT_SIZE_INTEGERS_H diff --git a/Packages/Kernel_23/include/CGAL/memory.h b/Packages/Kernel_23/include/CGAL/memory.h new file mode 100644 index 00000000000..a3e510dc167 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/memory.h @@ -0,0 +1,39 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : Memory.fw +// file : memory.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Michael Seel +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_MEMORY_H +#define CGAL_MEMORY_H +#include + +#ifdef CGAL_USE_LEDA +#include +#define CGAL_ALLOCATOR(t) leda_allocator< t > +#define CGAL_ALLOC leda_allocator +#else +#define CGAL_ALLOCATOR(t) std::allocator< t > +#define CGAL_ALLOC std::allocator +#endif + +#endif // CGAL_MEMORY_H diff --git a/Packages/Kernel_23/include/CGAL/misc.h b/Packages/Kernel_23/include/CGAL/misc.h new file mode 100644 index 00000000000..ba3dc726f33 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/misc.h @@ -0,0 +1,81 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : misc.fw +// file : misc.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_MISC_H +#define CGAL_MISC_H + +#include + +CGAL_BEGIN_NAMESPACE + + +/* +template < class T > +inline +void +swap(T& a, T& b) +{ + T c; + c = a; + a = b; + b = c; +} +*/ + +#ifndef CGAL_CFG_NO_EXPLICIT_TEMPLATE_FUNCTION_ARGUMENT_SPECIFICATION +// A helper class: +// --------------------- +template +struct converter +{ + static inline Target do_it(const Source& s) + { return static_cast(s); } +}; + +template +inline +Target +convert_to (const Source& s) +{ return converter::do_it(s); } + +/* +template +inline +Target +convert_to( const Source& s) +{ return Target(s); } +*/ +#endif // CGAL_CFG_NO_EXPLICIT_TEMPLATE_FUNCTION_ARGUMENT_SPECIFICATION + +template +inline +Target +convert_from_to( const Target& t, const Source& s) +{ return Target(s); } + +CGAL_END_NAMESPACE + +#endif // CGAL_MISC_H diff --git a/Packages/Kernel_23/include/CGAL/predicates/sign_of_determinant.h b/Packages/Kernel_23/include/CGAL/predicates/sign_of_determinant.h new file mode 100644 index 00000000000..1f530900518 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/predicates/sign_of_determinant.h @@ -0,0 +1,116 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : determinant.fw +// file : predicates/sign_of_determinant.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Sylvain Pion +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_PREDICATES_SIGN_OF_DETERMINANT_H +#define CGAL_PREDICATES_SIGN_OF_DETERMINANT_H + +#ifndef CGAL_DETERMINANT_H +#include +#endif // CGAL_DETERMINANT_H + +CGAL_BEGIN_NAMESPACE + +template +inline +Sign +sign_of_determinant2x2( const FT& a00, const FT& a01, + const FT& a10, const FT& a11) +{ + return + static_cast(static_cast(CGAL_NTS compare( a00*a11, a10*a01))); +} + +template +inline +Sign +sign_of_determinant3x3( const FT& a00, const FT& a01, const FT& a02, + const FT& a10, const FT& a11, const FT& a12, + const FT& a20, const FT& a21, const FT& a22) +{ + return CGAL_NTS sign(det3x3_by_formula(a00, a01, a02, + a10, a11, a12, + a20, a21, a22)); +} + +template +inline +Sign +sign_of_determinant4x4( + const FT& a00, const FT& a01, const FT& a02, const FT& a03, + const FT& a10, const FT& a11, const FT& a12, const FT& a13, + const FT& a20, const FT& a21, const FT& a22, const FT& a23, + const FT& a30, const FT& a31, const FT& a32, const FT& a33) +{ + return CGAL_NTS sign(det4x4_by_formula(a00, a01, a02, a03, + a10, a11, a12, a13, + a20, a21, a22, a23, + a30, a31, a32, a33)); +} + +template +CGAL_KERNEL_LARGE_INLINE +Sign +sign_of_determinant5x5( + const FT& a00, const FT& a01, const FT& a02, const FT& a03, const FT& a04, + const FT& a10, const FT& a11, const FT& a12, const FT& a13, const FT& a14, + const FT& a20, const FT& a21, const FT& a22, const FT& a23, const FT& a24, + const FT& a30, const FT& a31, const FT& a32, const FT& a33, const FT& a34, + const FT& a40, const FT& a41, const FT& a42, const FT& a43, const FT& a44) +{ + return CGAL_NTS sign(det5x5_by_formula(a00, a01, a02, a03, a04, + a10, a11, a12, a13, a14, + a20, a21, a22, a23, a24, + a30, a31, a32, a33, a34, + a40, a41, a42, a43, a44)); +} + +template +CGAL_KERNEL_LARGE_INLINE +Sign +sign_of_determinant6x6( + const FT& a00, const FT& a01, const FT& a02, const FT& a03, const FT& a04, const FT& a05, + const FT& a10, const FT& a11, const FT& a12, const FT& a13, const FT& a14, const FT& a15, + const FT& a20, const FT& a21, const FT& a22, const FT& a23, const FT& a24, const FT& a25, + const FT& a30, const FT& a31, const FT& a32, const FT& a33, const FT& a34, const FT& a35, + const FT& a40, const FT& a41, const FT& a42, const FT& a43, const FT& a44, const FT& a45, + const FT& a50, const FT& a51, const FT& a52, const FT& a53, const FT& a54, const FT& a55) +{ + return CGAL_NTS sign(det6x6_by_formula(a00, a01, a02, a03, a04, a05, + a10, a11, a12, a13, a14, a15, + a20, a21, a22, a23, a24, a25, + a30, a31, a32, a33, a34, a35, + a40, a41, a42, a43, a44, a45, + a50, a51, a52, a53, a54, a55)); +} + +CGAL_END_NAMESPACE + + +#ifdef CGAL_ARITHMETIC_FILTER_H +#include +#endif // CGAL_ARITHMETIC_FILTER_H + +#endif // CGAL_PREDICATES_SIGN_OF_DETERMINANT_H diff --git a/Packages/Kernel_23/include/CGAL/predicates_on_lines_2.h b/Packages/Kernel_23/include/CGAL/predicates_on_lines_2.h new file mode 100644 index 00000000000..aab26084126 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/predicates_on_lines_2.h @@ -0,0 +1,202 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : predicates_on_lines_2.fw +// file : predicates_on_lines_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_PREDICATES_ON_LINES_2_H +#define CGAL_PREDICATES_ON_LINES_2_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_PREDICATES_ON_LINESH2_H +#include +#endif // CGAL_PREDICATES_ON_LINESH2_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_PREDICATES_ON_LINESC2_H +#include +#endif // CGAL_PREDICATES_ON_LINESC2_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_POINT_2_H +#include +#endif // CGAL_POINT_2_H +#ifndef CGAL_PREDICATES_ON_POINTS_2_H +#include +#endif // CGAL_PREDICATES_ON_POINTS_2_H +#ifndef CGAL_LINE_2_H +#include +#endif // CGAL_LINE_2_H + +CGAL_BEGIN_NAMESPACE + + +template < class R > +inline +Comparison_result +compare_x(const Point_2 &p, + const Line_2 &l1, + const Line_2 &l2) +{ + typedef typename R::Point_2_base RPoint_2; + typedef typename R::Line_2_base RLine_2 ; + return compare_x((const RPoint_2&)p, + (const RLine_2&)l1, + (const RLine_2&)l2); +} + +template < class R > +inline +Comparison_result +compare_x(const Line_2 &l1, + const Line_2 &l2, + const Line_2 &h1, + const Line_2 &h2) +{ + typedef typename R::Line_2_base RLine_2 ; + return compare_x((const RLine_2&)l1, (const RLine_2&)l2, + (const RLine_2&)h1, (const RLine_2&)h2); +} + + +template < class R > +inline +Comparison_result +compare_x(const Line_2 &l, + const Line_2 &h1, + const Line_2 &h2) +{ + typedef typename R::Line_2_base RLine_2 ; + return compare_x((const RLine_2&)l, (const RLine_2&)h1, + (const RLine_2&)l, (const RLine_2&)h2); +} + +template < class R > +inline +Comparison_result +compare_y(const Point_2 &p, + const Line_2 &l1, + const Line_2 &l2) +{ + typedef typename R::Point_2_base RPoint_2; + typedef typename R::Line_2_base RLine_2 ; + return compare_y((const RPoint_2&)p, + (const RLine_2&)l1, + (const RLine_2&)l2); +} + +template < class R > +inline +Comparison_result +compare_y(const Line_2 &l1, + const Line_2 &l2, + const Line_2 &h1, + const Line_2 &h2) +{ + typedef typename R::Line_2_base RLine_2 ; + return compare_y((const RLine_2&)l1, (const RLine_2&)l2, + (const RLine_2&)h1, (const RLine_2&)h2); +} + +template < class R > +inline +Comparison_result +compare_y(const Line_2 &l, + const Line_2 &h1, + const Line_2 &h2) +{ + typedef typename R::Line_2_base RLine_2 ; + return compare_y((const RLine_2&)l, (const RLine_2&)h1, + (const RLine_2&)l, (const RLine_2&)h2); +} + + +template < class R > +inline +Comparison_result +compare_y_at_x(const Point_2 &p, const Line_2 &h) +{ + typedef typename R::Point_2_base RPoint_2; + typedef typename R::Line_2_base RLine_2 ; + return compare_y_at_x((const RPoint_2&)p, + (const RLine_2&)h); +} + +template < class R > +inline +Comparison_result +compare_y_at_x(const Line_2 &l1, + const Line_2 &l2, + const Line_2 &h) +{ + typedef typename R::Line_2_base RLine_2 ; + return compare_y_at_x((const RLine_2&)l1, + (const RLine_2&)l2, + (const RLine_2&)h) ; +} + +template < class R > +inline +Comparison_result +compare_y_at_x(const Point_2 &p, + const Line_2 &h1, + const Line_2 &h2) +{ + CGAL_kernel_precondition( (! h1.is_vertical()) && (! h2.is_vertical()) ); + typedef typename R::Point_2_base RPoint_2; + typedef typename R::Line_2_base RLine_2 ; + return compare_y_at_x((const RPoint_2&)p, + (const RLine_2&)h1, + (const RLine_2&)h2); +} + +template < class R > +inline +Comparison_result +compare_y_at_x(const Line_2 &l1, + const Line_2 &l2, + const Line_2 &h1, + const Line_2 &h2) +{ + CGAL_kernel_precondition( (! h1.is_vertical()) && (! h2.is_vertical()) ); + typedef typename R::Line_2_base RLine_2 ; + return compare_y_at_x((const RLine_2&)l1, + (const RLine_2&)l2, + (const RLine_2&)h1, + (const RLine_2&)h2); +} + +CGAL_END_NAMESPACE + + +#endif // CGAL_PREDICATES_ON_LINES_2_H diff --git a/Packages/Kernel_23/include/CGAL/predicates_on_points_2.h b/Packages/Kernel_23/include/CGAL/predicates_on_points_2.h new file mode 100644 index 00000000000..ae7d82d5224 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/predicates_on_points_2.h @@ -0,0 +1,367 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, July 30 +// +// source : predicates_on_points_2.fw +// file : predicates_on_points_2.h +// package : _2 (3.6) +// maintainer : Stefan Schirra +// revision : 3.6 +// revision_date : 30 Jul 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_PREDICATES_ON_POINTS_2_H +#define CGAL_PREDICATES_ON_POINTS_2_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef CGAL_PREDICATES_ON_POINTSH2_H +#include +#endif // CGAL_PREDICATES_ON_POINTSH2_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_PREDICATES_ON_POINTSC2_H +#include +#endif // CGAL_PREDICATES_ON_POINTSC2_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_POINT_2_H +#include +#endif // CGAL_POINT_2_H + +CGAL_BEGIN_NAMESPACE + +template < class R > +inline +bool x_equal(const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + return x_equal((const RPoint_2&)p, (const RPoint_2&)q); +} + +template < class R > +inline +bool y_equal(const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + return y_equal((const RPoint_2&)p, (const RPoint_2&)q); +} + + +template < class R > +inline +Comparison_result compare_x(const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + return compare_x((const RPoint_2&)p, (const RPoint_2&)q); +} + +template < class R > +inline +Comparison_result compare_y(const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + return compare_y((const RPoint_2&)p, (const RPoint_2&)q); +} + +template < class R > +inline +Comparison_result +compare_deltax_deltay(const Point_2& p, + const Point_2& q, + const Point_2& r, + const Point_2& s) +{ + typedef typename R::Point_2_base RPoint_2; + return compare_deltax_deltay((const RPoint_2&)p, + (const RPoint_2&)q, + (const RPoint_2&)r, + (const RPoint_2&)s); +} + +template < class R > +inline +Comparison_result +compare_lexicographically_xy(const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + return compare_lexicographically_xy((const RPoint_2&)p, + (const RPoint_2&)q); +} + +template < class R > +inline +bool +lexicographically_xy_smaller_or_equal(const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + return lexicographically_xy_smaller_or_equal((const RPoint_2&)p, + (const RPoint_2&)q); +} + +template < class R > +inline +bool +lexicographically_xy_smaller(const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + return lexicographically_xy_smaller((const RPoint_2&)p, + (const RPoint_2&)q); +} + +template < class R > +inline +bool +lexicographically_xy_larger_or_equal(const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + return !lexicographically_xy_smaller((const RPoint_2&)p, + (const RPoint_2&)q); +} + +template < class R > +inline +bool +lexicographically_xy_larger(const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + return !lexicographically_xy_smaller_or_equal((const RPoint_2&)p, + (const RPoint_2&)q); +} + + +template < class R > +inline +Comparison_result +compare_lexicographically_yx(const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + return compare_lexicographically_yx((const RPoint_2&)p, + (const RPoint_2&)q); +} + +template < class R > +inline +bool +lexicographically_yx_smaller_or_equal(const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + return lexicographically_yx_smaller_or_equal((const RPoint_2&)p, + (const RPoint_2&)q); +} + +template < class R > +inline +bool +lexicographically_yx_smaller(const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + return lexicographically_yx_smaller((const RPoint_2&)p, + (const RPoint_2&)q); +} + +template < class R > +inline +bool +lexicographically_yx_larger_or_equal(const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + return !lexicographically_yx_smaller((const RPoint_2&)p, + (const RPoint_2&)q); +} + +template < class R > +inline +bool +lexicographically_yx_larger(const Point_2& p, + const Point_2& q) +{ + typedef typename R::Point_2_base RPoint_2; + return !lexicographically_yx_smaller_or_equal((const RPoint_2&)p, + (const RPoint_2&)q); +} + +template < class R > +inline +bool +are_ordered_along_line(const Point_2& p, + const Point_2& q, + const Point_2& r) +{ + typedef typename R::Point_2_base RPoint_2; + return are_ordered_along_line((const RPoint_2&)p, + (const RPoint_2&)q, + (const RPoint_2&)r); +} + +template < class R > +inline +bool +collinear_are_ordered_along_line(const Point_2& p, + const Point_2& q, + const Point_2& r) +{ + typedef typename R::Point_2_base RPoint_2; + return collinear_are_ordered_along_line((const RPoint_2&)p, + (const RPoint_2&)q, + (const RPoint_2&)r); +} + +template < class R > +inline +bool +are_strictly_ordered_along_line(const Point_2& p, + const Point_2& q, + const Point_2& r) +{ + typedef typename R::Point_2_base RPoint_2; + return are_strictly_ordered_along_line((const RPoint_2&)p, + (const RPoint_2&)q, + (const RPoint_2&)r); +} +template < class R > +inline +bool +collinear_are_strictly_ordered_along_line(const Point_2& p, + const Point_2& q, + const Point_2& r) +{ + typedef typename R::Point_2_base RPoint_2; + return + collinear_are_strictly_ordered_along_line((const RPoint_2&)p, + (const RPoint_2&)q, + (const RPoint_2&)r); +} +template < class R > +inline +bool +collinear(const Point_2& p, + const Point_2& q, + const Point_2& r) +{ + typedef typename R::Point_2_base RPoint_2; + return (collinear((const RPoint_2&)p, + (const RPoint_2&)q, + (const RPoint_2&)r)); +} + +template < class R > +inline +bool +leftturn(const Point_2& p, + const Point_2& q, + const Point_2& r) +{ + typedef typename R::Point_2_base RPoint_2; + return leftturn((const RPoint_2&)p, + (const RPoint_2&)q, + (const RPoint_2&)r); +} + +template < class R > +inline +bool +rightturn(const Point_2& p, + const Point_2& q, + const Point_2& r) +{ + typedef typename R::Point_2_base RPoint_2; + return rightturn((const RPoint_2&)p, + (const RPoint_2&)q, + (const RPoint_2&)r); +} + +template < class R > +inline +bool +rightturn(const Origin& o, + const Point_2& q, + const Point_2& r) +{ + typedef typename R::Point_2_base RPoint_2; + return rightturn(o, (const RPoint_2&)q, (const RPoint_2&)r); +} + +template < class R > +inline +Orientation +orientation(const Point_2& p, + const Point_2&q, + const Point_2& r) +{ + typedef typename R::Point_2_base RPoint_2; + return orientation((const RPoint_2&)p, + (const RPoint_2&)q, + (const RPoint_2&)r); +} + +template +inline +Oriented_side +side_of_oriented_circle(const Point_2& p, + const Point_2& q, + const Point_2& r, + const Point_2& test) +{ + typedef typename R::Point_2_base RPoint_2; + return side_of_oriented_circle((const RPoint_2&)p, + (const RPoint_2&)q, + (const RPoint_2&)r, + (const RPoint_2&)test); +} + +template +inline +Bounded_side +side_of_bounded_circle(const Point_2& p, + const Point_2& q, + const Point_2& r, + const Point_2& test) +{ + typedef typename R::Point_2_base RPoint_2; + return side_of_bounded_circle((const RPoint_2&)p, + (const RPoint_2&)q, + (const RPoint_2&)r, + (const RPoint_2&)test); +} + +CGAL_END_NAMESPACE + + +#endif // CGAL_PREDICATES_ON_POINTS_2_H diff --git a/Packages/Kernel_23/include/CGAL/predicates_on_points_3.h b/Packages/Kernel_23/include/CGAL/predicates_on_points_3.h new file mode 100644 index 00000000000..bc1f25dbb98 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/predicates_on_points_3.h @@ -0,0 +1,281 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, October 15 +// +// source : predicates_on_points_3.fw +// file : predicates_on_points_3.h +// package : _3 (3.9) +// maintainer : Stefan Schirra +// revision : 3.9 +// revision_date : 15 Oct 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_PREDICATES_ON_POINTS_3_H +#define CGAL_PREDICATES_ON_POINTS_3_H + +#ifndef CGAL_REP_CLASS_DEFINED +#error no representation class defined +#endif // CGAL_REP_CLASS_DEFINED + +#ifdef CGAL_HOMOGENEOUS_H +#ifndef PREDICATES_ON_POINTSH3_H +#include +#endif // PREDICATES_ON_POINTSH3_H +#endif // CGAL_HOMOGENEOUS_H + +#ifdef CGAL_CARTESIAN_H +#ifndef CGAL_PREDICATES_ON_POINTSC3_H +#include +#endif // CGAL_PREDICATES_ON_POINTSC3_H +#endif // CGAL_CARTESIAN_H + +#ifdef CGAL_SIMPLE_CARTESIAN_H +#include +#endif // CGAL_SIMPLE_CARTESIAN_H + + +#ifndef CGAL_POINT_3_H +#include +#endif // CGAL_POINT_3_H + +CGAL_BEGIN_NAMESPACE + +template < class R > +inline +Comparison_result +compare_lexicographically_xyz( const Point_3 &p, + const Point_3 &q) +{ + typedef typename R::Point_3_base RPoint_3; + return compare_lexicographically_xyz((const RPoint_3& )p, + (const RPoint_3& )q); +} + +template < class R > +inline +bool +lexicographically_xyz_smaller_or_equal(const Point_3 &p, + const Point_3 &q) +{ + typedef typename R::Point_3_base RPoint_3; + return ( !( compare_lexicographically_xyz((const RPoint_3& )p, + (const RPoint_3& )q) + == LARGER ) ); +} + +template < class R > +inline +bool +lexicographically_xyz_smaller(const Point_3 &p, + const Point_3 &q) +{ + typedef typename R::Point_3_base RPoint_3; + return ( compare_lexicographically_xyz((const RPoint_3& )p, + (const RPoint_3& )q) + == SMALLER ); +} + +template < class R > +inline +Comparison_result +compare_x(const Point_3 &p, const Point_3 &q) +{ + typedef typename R::Point_3_base RPoint_3; + return compare_x((const RPoint_3& )p, (const RPoint_3& )q); +} + + +template < class R > +inline +Comparison_result +compare_y(const Point_3 &p, const Point_3 &q) +{ + typedef typename R::Point_3_base RPoint_3; + return compare_y((const RPoint_3& )p, (const RPoint_3& )q); +} + + +template < class R > +inline +Comparison_result +compare_z(const Point_3 &p, const Point_3 &q) +{ + typedef typename R::Point_3_base RPoint_3; + return compare_z((const RPoint_3& )p, (const RPoint_3& )q); +} + +template < class R > +inline +bool +x_equal(const Point_3 &p, + const Point_3 &q) +{ + typedef typename R::Point_3_base RPoint_3; + return x_equal((const RPoint_3& )p, (const RPoint_3& )q); +} + +template < class R > +inline +bool +y_equal(const Point_3 &p, + const Point_3 &q) +{ + typedef typename R::Point_3_base RPoint_3; + return y_equal((const RPoint_3& )p, (const RPoint_3& )q); +} + +template < class R > +inline +bool +z_equal(const Point_3 &p, + const Point_3 &q) +{ + typedef typename R::Point_3_base RPoint_3; + return z_equal((const RPoint_3& )p, (const RPoint_3& )q); +} + +template < class R > +inline +bool +coplanar(const Point_3 &p, + const Point_3 &q, + const Point_3 &r, + const Point_3 &s) +{ + typedef typename R::Point_3_base RPoint_3; + return ( coplanar((const RPoint_3& )p, (const RPoint_3& )q, + (const RPoint_3& )r, (const RPoint_3& )s) ); +} + +template < class R > +inline +bool +collinear(const Point_3 &p, + const Point_3 &q, + const Point_3 &r) +{ + typedef typename R::Point_3_base RPoint_3; + return (collinear((const RPoint_3& )p, + (const RPoint_3& )q, + (const RPoint_3& )r)); +} + +template < class R > +inline +bool +are_ordered_along_line(const Point_3 &p, + const Point_3 &q, + const Point_3 &r) +{ + typedef typename R::Point_3_base RPoint_3; + return (are_ordered_along_line((const RPoint_3& )p, + (const RPoint_3& )q, + (const RPoint_3& )r)); +} + +template < class R > +inline +bool +collinear_are_ordered_along_line(const Point_3 &p, + const Point_3 &q, + const Point_3 &r) +{ + typedef typename R::Point_3_base RPoint_3; + return collinear_are_ordered_along_line((const RPoint_3& )p, + (const RPoint_3& )q, + (const RPoint_3& )r + ); +} + +template < class R > +inline +bool +are_strictly_ordered_along_line(const Point_3 &p, + const Point_3 &q, + const Point_3 &r) +{ + typedef typename R::Point_3_base RPoint_3; + return (are_strictly_ordered_along_line((const RPoint_3& )p, + (const RPoint_3& )q, + (const RPoint_3& )r)); +} + +template < class R > +inline +bool +collinear_are_strictly_ordered_along_line(const Point_3 &p, + const Point_3 &q, + const Point_3 &r) +{ + typedef typename R::Point_3_base RPoint_3; + return collinear_are_strictly_ordered_along_line((const RPoint_3& )p, + (const RPoint_3& )q, + (const RPoint_3& )r + ); +} + +template < class R > +inline +Orientation +orientation(const Point_3 &p, + const Point_3 &q, + const Point_3 &r, + const Point_3 &s) +{ + typedef typename R::Point_3_base RPoint_3; + return orientation((const RPoint_3& )p, (const RPoint_3& )q, + (const RPoint_3& )r, (const RPoint_3& )s); +} + +template +inline +Bounded_side +side_of_bounded_sphere( const Point_3 &p, + const Point_3 &q, + const Point_3 &r, + const Point_3 &s, + const Point_3 &test) +{ + typedef typename R::Point_3_base RPoint_3; + return side_of_bounded_sphere((const RPoint_3& )p, + (const RPoint_3& )q, + (const RPoint_3& )r, + (const RPoint_3& )s, + (const RPoint_3& )test); +} + +template +inline +Oriented_side +side_of_oriented_sphere( const Point_3 &p, + const Point_3 &q, + const Point_3 &r, + const Point_3 &s, + const Point_3 &test) +{ + typedef typename R::Point_3_base RPoint_3; + return side_of_oriented_sphere((const RPoint_3& )p, + (const RPoint_3& )q, + (const RPoint_3& )r, + (const RPoint_3& )s, + (const RPoint_3& )test); +} + +CGAL_END_NAMESPACE + + +#endif // CGAL_PREDICATES_ON_POINTS_3_H diff --git a/Packages/Kernel_23/include/CGAL/rational_rotation.h b/Packages/Kernel_23/include/CGAL/rational_rotation.h new file mode 100644 index 00000000000..6e4b22d4b48 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/rational_rotation.h @@ -0,0 +1,279 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : rational_rotation.fw +// file : rational_rotation.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_RATIONAL_ROTATION_H +#define CGAL_RATIONAL_ROTATION_H + +#include + +CGAL_BEGIN_NAMESPACE + +template < class NT > +void +rational_rotation_approximation( const NT & dirx, // dir.x() + const NT & diry, // dir.y() + NT & sin_num, // return + NT & cos_num, // return + NT & denom, // return + const NT & eps_num, // quality_bound + const NT & eps_den ) +{ +#ifndef CGAL_CFG_NO_NAMESPACE + using std::swap; +#endif // CGAL_CFG_NO_NAMESPACE + + const NT& n = eps_num; + const NT& d = eps_den; + const NT NT0 = NT(0) ; + const NT NT1 = NT(1) ; + CGAL_kernel_precondition( n > NT0 ); + CGAL_kernel_precondition( d > NT0 ); + NT & sin = sin_num; + NT & cos = cos_num; + NT & den = denom; + NT dx = CGAL_NTS abs(dirx); + NT dy = CGAL_NTS abs(diry); + NT sq_hypotenuse = dx*dx + dy*dy; + NT common_part; + NT diff_part; + NT rhs; + bool lower_ok; + bool upper_ok; + + if (dy > dx) + { + swap (dx,dy); + } + // approximate sin = dy / sqrt(sq_hypotenuse) + // if ( dy / sqrt(sq_hypotenuse) < n/d ) + if (dy * dy * d * d < sq_hypotenuse * n * n) + { + cos = NT1; + sin = NT0; + den = NT1; + } + else + { + NT p; + NT q; + NT p0 = NT0; + NT q0 = NT1; + NT p1 = NT1; + NT q1 = NT1; + + for(;;) + { + p = p0 + p1; + q = q0 + q1; + sin = NT(2)*p*q; + den = p*p + q*q; + + // sanity check for approximation + // sin/den < dy/sqrt(hypotenuse) + n/d + // && sin/den > dy/sqrt(hypotenuse) - n/d + // === sin/den - n/d < dy/sqrt(sq_hypotenuse) + // && sin/den + n/d > dy/sqrt(sq_hypotenuse) + // === (sin^2 d^2 + n^2 den^2)sq_hypotenuse - 2... < dy^2 d^2 den^2 + // && (sin^2 d^2 + n^2 den^2)sq_hypotenuse + 2... > dy^2 d^2 den^2 + + common_part = (sin*sin*d*d + n*n*den*den)*sq_hypotenuse; + diff_part = NT(2)*n*sin*d*den*sq_hypotenuse; + rhs = dy*dy*d*d*den*den; + + upper_ok = (common_part - diff_part < rhs); + lower_ok = (common_part + diff_part > rhs); + + if ( lower_ok && upper_ok ) + { + // if ( (p*p)%2 + (q*q)%2 > NT1) + // { + // sin = p*q; + // cos = (q*q - p*p)/2; // exact division + // den = (p*p + q*q)/2; // exact division + // } + // else + // { + cos = q*q - p*p; + // } + + break; + } + else + { + // if ( dy/sqrt(sq_hypotenuse) < sin/den ) + if ( dy*dy*den*den < sin*sin*sq_hypotenuse ) + { + p1 = p; + q1 = q; + } + else + { + p0 = p; + q0 = q; + } + } + } // for(;;) + } + dx = dirx; + dy = diry; + + + if (dy > dx ) { swap (sin,cos); } + + if (dx < NT0) { cos = - cos; } + + if (dy < NT0) { sin = - sin; } + + sin_num = sin; + cos_num = cos; + denom = den; +} + + +template < class NT > +void +rational_rotation_approximation( const double& angle, + NT & sin_num, // return + NT & cos_num, // return + NT & denom, // return + const NT & eps_num, // quality_bound + const NT & eps_den ) +{ +#ifndef CGAL_CFG_NO_NAMESPACE + using std::swap; +#endif // CGAL_CFG_NO_NAMESPACE + + const NT& n = eps_num; + const NT& d = eps_den; + const NT NT0 = NT(0) ; + const NT NT1 = NT(1) ; + CGAL_kernel_precondition( n > NT0 ); + CGAL_kernel_precondition( d > NT0 ); + NT& isin = sin_num; + NT& icos = cos_num; + NT& iden = denom; + double dsin = sin(angle); + double dcos = cos(angle); + double dn = CGAL::to_double(n); + double dd = CGAL::to_double(d); + double eps = dn / dd; + dsin = CGAL_NTS abs( dsin); + dcos = CGAL_NTS abs( dcos); + NT common_part; + NT diff_part; + NT os; + bool lower_ok; + bool upper_ok; + bool swapped = false; + + if (dsin > dcos) + { + swapped = true; + swap (dsin,dcos); + } + if ( dsin < eps ) + { + icos = NT1; + isin = NT0; + iden = NT1; + } + else + { + NT p; + NT q; + NT p0 = NT0; + NT q0 = NT1; + NT p1 = NT1; + NT q1 = NT1; + + for(;;) + { + p = p0 + p1; + q = q0 + q1; + isin = NT(2)*p*q; + iden = p*p + q*q; + + // XXX sanity check for approximation + // sin/den < dsin + n/d + // && sin/den > dsin - n/d + // sin < dsin * den + n/d * den + // && sin > dsin * den - n/d * den + os = CGAL::to_double(isin); + diff_part = eps * CGAL::to_double(iden); + common_part = dsin * CGAL::to_double(iden); + + upper_ok = (common_part - diff_part < os); + lower_ok = (os < common_part + diff_part); + + if ( lower_ok && upper_ok ) + { + // if ( (p*p)%2 + (q*q)%2 > NT1) + // { + // isin = p*q; + // icos = (q*q - p*p)/2; // exact division + // iden = (p*p + q*q)/2; // exact division + // } + // else + // { + icos = q*q - p*p; + // } + + break; + } + else + { + // XXX if ( dsin < sin/den ) + if ( dsin * CGAL::to_double(iden) < CGAL::to_double(isin) ) + { + p1 = p; + q1 = q; + } + else + { + p0 = p; + q0 = q; + } + } + } // for(;;) + } + + if ( swapped ) { swap (isin,icos); } + + dsin = sin( angle); + dcos = cos( angle); + if (dcos < 0.0) { icos = - icos; } + if (dsin < 0.0) { isin = - isin; } + + sin_num = isin; + cos_num = icos; + denom = iden; +} + + +CGAL_END_NAMESPACE + + +#endif // CGAL_RATIONAL_ROTATION_H diff --git a/Packages/Kernel_23/include/CGAL/representation_tags.h b/Packages/Kernel_23/include/CGAL/representation_tags.h new file mode 100644 index 00000000000..7ac404c1e7f --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/representation_tags.h @@ -0,0 +1,37 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : representation_tags.fw +// file : representation_tags.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_REPRESENTATION_TAGS_H +#define CGAL_REPRESENTATION_TAGS_H +CGAL_BEGIN_NAMESPACE + +class Cartesian_tag {}; +class Homogeneous_tag {}; +class Old_style_tag {}; + +CGAL_END_NAMESPACE + +#endif // CGAL_REPRESENTATION_TAGS_H diff --git a/Packages/Kernel_23/include/CGAL/solve.h b/Packages/Kernel_23/include/CGAL/solve.h new file mode 100644 index 00000000000..7f59b9123f7 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/solve.h @@ -0,0 +1,68 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : solve.fw +// file : solve.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_SOLVE_H +#define CGAL_SOLVE_H + +CGAL_BEGIN_NAMESPACE + + +template +void solve (const FT &a1, const FT &a2, const FT &a3, + const FT &b1, const FT &b2, const FT &b3, + const FT &c1, const FT &c2, const FT &c3, + const FT &d1, const FT &d2, const FT &d3, + FT &x, FT &y, FT &z) +{ + FT denom = b2*c1*a3-b1*c2*a3+c3*b1*a2+b3*c2*a1-c1*b3*a2-b2*c3*a1; + + x = - (b2*c3*d1-b2*c1*d3+c1*b3*d2+b1*c2*d3-c3*b1*d2-b3*c2*d1)/denom; + + z = (b2*d1*a3-b2*a1*d3+b1*a2*d3-b1*d2*a3-d1*b3*a2+a1*b3*d2)/denom; + + y = (a2*c3*d1-a2*c1*d3-c2*d1*a3+c2*a1*d3+d2*c1*a3-d2*c3*a1)/denom; +} + + +// this is for a parabola c1, c2, c3 are equal to 1 +template +void solve_quadratic (const FT &a1, const FT &a2, const FT &a3, + const FT &b1, const FT &b2, const FT &b3, + const FT &d1, const FT &d2, const FT &d3, + FT &x, FT &y, FT &z) +{ + FT denom = b2*a3-b1*a3+b1*a2+b3*a1-b3*a2-b2*a1; + + x = - (b2*d1-b2*d3+b3*d2+b1*d3-b1*d2-b3*d1)/denom; + + z = (b2*d1*a3-b2*a1*d3+b1*a2*d3-b1*d2*a3-d1*b3*a2+a1*b3*d2)/denom; + + y = (a2*d1-a2*d3-d1*a3+a1*d3+d2*a3-d2*a1)/denom; +} + + +CGAL_END_NAMESPACE + +#endif // CGAL_SOLVE_H diff --git a/Packages/Kernel_23/include/CGAL/tags.h b/Packages/Kernel_23/include/CGAL/tags.h new file mode 100644 index 00000000000..dac718184d6 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/tags.h @@ -0,0 +1,42 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : tags.fw +// file : tags.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_TAGS_H +#define CGAL_TAGS_H + +#ifndef CGAL_AFF_TRANSFORMATION_TAGS_H +#include +#endif // CGAL_AFF_TRANSFORMATION_TAGS_H +#ifndef CGAL_NUMBER_TYPE_TAGS_H +#include +#endif // CGAL_NUMBER_TYPE_TAGS_H +#ifndef CGAL_IO_IO_TAGS_H +#include +#endif // CGAL_IO_IO_TAGS_H + +// compile time assertion tags are in + +#endif // CGAL_TAGS_H diff --git a/Packages/Kernel_23/include/CGAL/user_classes.h b/Packages/Kernel_23/include/CGAL/user_classes.h new file mode 100644 index 00000000000..654c8e45228 --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/user_classes.h @@ -0,0 +1,111 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : user_classes.fw +// file : user_classes.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_USER_CLASSES_H +#define CGAL_USER_CLASSES_H + +CGAL_BEGIN_NAMESPACE + +template < class R > +class Point_2; + +template < class R > +class Vector_2; + +template < class R > +class Direction_2; + +template < class R > +class Line_2; + +template < class R > +class Ray_2; + +template < class R > +class Segment_2; + +template < class R > +class Triangle_2; + +template < class R > +class Iso_rectangle_2; + +template < class R > +class Circle_2; + +template < class R > +class Aff_transformation_base_2; + +template < class R > +class Aff_transformation_2; + +template < class R > +class Aff_transformation_3; + +template < class R > +class Plane_3; + +template < class FT > +class Point_3; + +template < class FT > +class Vector_3; + +template < class FT > +class Direction_3; + +template < class R > +class Line_3; + +template < class FT > +class Ray_3; + +template < class FT > +class Segment_3; + +template < class FT > +class Triangle_3; + +template < class FT > +class Tetrahedron_3; + +template < class R > +class Iso_cuboid_3; + +template < class R > +class Sphere_3; + +// template < class R > +// class Vector_2_rft_wrapper; +// +// template < class R > +// class Vector_3_rft_wrapper; + +template < class R> +class Point_d; +CGAL_END_NAMESPACE + +#endif // CGAL_USER_CLASSES_H diff --git a/Packages/Kernel_23/include/CGAL/utils.h b/Packages/Kernel_23/include/CGAL/utils.h new file mode 100644 index 00000000000..5b481cbfcbd --- /dev/null +++ b/Packages/Kernel_23/include/CGAL/utils.h @@ -0,0 +1,36 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : utils.fw +// file : utils.h +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Geert-Jan Giezeman +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_UTILS_H +#define CGAL_UTILS_H + +#ifndef CGAL_ASSERTIONS_H +#include +#endif // CGAL_ASSERTIONS_H +#ifndef CGAL_KERNEL_ASSERTIONS_H +#include +#endif // CGAL_KERNEL_ASSERTIONS_H + +#endif diff --git a/Packages/Kernel_23/src/Origin.C b/Packages/Kernel_23/src/Origin.C new file mode 100644 index 00000000000..ece71d32835 --- /dev/null +++ b/Packages/Kernel_23/src/Origin.C @@ -0,0 +1,40 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : Origin.fw +// file : Origin.C +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_CONFIG_H +#include +#endif // CGAL_CONFIG_H + +#ifndef CGAL_ORIGIN_H +#include +#endif // CGAL_ORIGIN_H + +CGAL_BEGIN_NAMESPACE + +Origin ORIGIN ; +Null_vector NULL_VECTOR ; +CGAL_END_NAMESPACE + diff --git a/Packages/Kernel_23/src/aff_transformation_tags.C b/Packages/Kernel_23/src/aff_transformation_tags.C new file mode 100644 index 00000000000..ea39e6d1259 --- /dev/null +++ b/Packages/Kernel_23/src/aff_transformation_tags.C @@ -0,0 +1,40 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// source : aff_transformation_tags.fw +// file : aff_transformation_tags.C +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// revision : 3.17 +// revision_date : 10 Dec 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_AFF_TRANSFORMATION_TAGS_H +#include +#endif // CGAL_AFF_TRANSFORMATION_TAGS_H + +CGAL_BEGIN_NAMESPACE + + +Translation TRANSLATION; +Rotation ROTATION; +Scaling SCALING; +Reflection REFLECTION; +Identity_transformation IDENTITY; + +CGAL_END_NAMESPACE + diff --git a/Packages/Kernel_23/src/assertions.C b/Packages/Kernel_23/src/assertions.C new file mode 100644 index 00000000000..28c4871c5a5 --- /dev/null +++ b/Packages/Kernel_23/src/assertions.C @@ -0,0 +1,212 @@ +// ====================================================================== +// +// Copyright (c) 1997 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 10 +// +// file : assertions.C +// package : Kernel_basic (3.17) +// maintainer : Stefan Schirra +// source : assertions.fw +// author(s) : Geert-Jan Giezeman and Sven Schönherr +// +// coordinator : MPI, Saarbruecken () +// +// ====================================================================== + + +#include +#include +#include +#include + +#include + +CGAL_BEGIN_NAMESPACE +// not_implemented function +// ------------------------ +void +not_implemented() +{ + assert( false); +} + +// static behaviour variables +// -------------------------- + +static Failure_behaviour _error_behaviour = ABORT; +static Failure_behaviour _warning_behaviour = CONTINUE; + +// standard error handlers +// ----------------------- +static +void +_standard_error_handler( + const char* what, + const char* expr, + const char* file, + int line, + const char* msg ) +{ + std::cerr << "CGAL error: " << what << " violation!" << std::endl + << "Expr: " << expr << std::endl + << "File: " << file << std::endl + << "Line: " << line << std::endl; + if ( msg != 0) + std::cerr << "Explanation:" << msg << std::endl; +} + + +// standard warning handler +// ------------------------ +static +void +_standard_warning_handler( const char *, + const char* expr, + const char* file, + int line, + const char* msg ) +{ + std::cerr << "CGAL warning: check violation!" << std::endl + << "Expr: " << expr << std::endl + << "File: " << file << std::endl + << "Line: " << line << std::endl; + if ( msg != 0) + std::cerr << "Explanation:" << msg << std::endl; + +} + +// default handler settings +// ------------------------ +static Failure_function +_error_handler = _standard_error_handler; + +static Failure_function +_warning_handler = _standard_warning_handler; + +// failure functions +// ----------------- +void +assertion_fail( const char* expr, + const char* file, + int line, + const char* msg ) +{ + (*_error_handler)("assertion", expr, file, line, msg); + switch (_error_behaviour) { + case ABORT: + abort(); + case EXIT: + exit(1); // EXIT_FAILURE + case EXIT_WITH_SUCCESS: + exit(0); // EXIT_SUCCESS + case CONTINUE: + ; + } +} + +void +precondition_fail( const char* expr, + const char* file, + int line, + const char* msg ) +{ + (*_error_handler)("precondition", expr, file, line, msg); + switch (_error_behaviour) { + case ABORT: + abort(); + case EXIT: + exit(1); // EXIT_FAILURE + case EXIT_WITH_SUCCESS: + exit(0); // EXIT_SUCCESS + case CONTINUE: + ; + } +} + +void +postcondition_fail(const char* expr, + const char* file, + int line, + const char* msg ) +{ + (*_error_handler)("postcondition", expr, file, line, msg); + switch (_error_behaviour) { + case ABORT: + abort(); + case EXIT: + exit(1); // EXIT_FAILURE + case EXIT_WITH_SUCCESS: + exit(0); // EXIT_SUCCESS + case CONTINUE: + ; + } +} + + +// warning function +// ---------------- +void +warning_fail( const char* expr, + const char* file, + int line, + const char* msg ) +{ + (*_warning_handler)("warning", expr, file, line, msg); + switch (_warning_behaviour) { + case ABORT: + abort(); + case EXIT: + exit(1); // EXIT_FAILURE + case EXIT_WITH_SUCCESS: + exit(0); // EXIT_SUCCESS + case CONTINUE: + ; + } +} + + +// error handler set functions +// --------------------------- +Failure_function +set_error_handler( Failure_function handler) +{ + Failure_function result = _error_handler; + _error_handler = handler; + return( result); +} + +Failure_function +set_warning_handler( Failure_function handler) +{ + Failure_function result = _warning_handler; + _warning_handler = handler; + return( result); +} + +Failure_behaviour +set_error_behaviour(Failure_behaviour eb) +{ + Failure_behaviour result = _error_behaviour; + _error_behaviour = eb; + return result; +} + +Failure_behaviour +set_warning_behaviour(Failure_behaviour eb) +{ + Failure_behaviour result = _warning_behaviour; + _warning_behaviour = eb; + return result; +} + +CGAL_END_NAMESPACE + + diff --git a/Packages/Kernel_23/test/Kernel/cgal_test b/Packages/Kernel_23/test/Kernel/cgal_test new file mode 100755 index 00000000000..acf451fd507 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/cgal_test @@ -0,0 +1,66 @@ +#! /bin/sh +# This is a script for the CGAL test suite. Such a script must obey +# the following rules: +# +# - the name of the script is cgal_test +# - for every target two one line messages are written to the file 'error.txt' +# the first one indicates if the compilation was successful +# the second one indicates if the execution was successful +# if one of the two was not successful, the line should start with 'ERROR:' +# - running the script should not require any user interaction +# - the script should clean up object files and executables + +ERRORFILE=error.txt + +#---------------------------------------------------------------------# +# compile_and_run +#---------------------------------------------------------------------# + +compile_and_run() +{ + echo "Compiling $1 ... " + if eval 'make CGAL_MAKEFILE=$CGAL_MAKEFILE \ + TESTSUITE_CXXFLAGS="$TESTSUITE_CXXFLAGS" \ + TESTSUITE_LDFLAGS="$TESTSUITE_LDFLAGS" $1' ; then + echo " compilation of $1 succeeded" >> $ERRORFILE + else + echo " ERROR: compilation of $1 failed" >> $ERRORFILE + fi + + if [ -f $1 ] ; then + OUTPUTFILE=ProgramOutput.$1.$PLATFORM + rm -f $OUTPUTFILE + COMMAND="./$1" + if [ -f $1.cmd ] ; then + COMMAND="$COMMAND '`cat $1.cmd`'" + fi + if [ -f $1.cin ] ; then + COMMAND="echo '`cat $1.cin`' | $COMMAND" + fi + echo "Executing $1 ... " + echo + if eval 2>&1 $COMMAND > $OUTPUTFILE ; then + echo " execution of $1 succeeded" >> $ERRORFILE + else + echo " ERROR: execution of $1 failed" >> $ERRORFILE + fi + else + echo " ERROR: could not execute $1" >> $ERRORFILE + fi + + eval "2>&1 make CGAL_MAKEFILE=$CGAL_MAKEFILE clean > /dev/null " +} + +#---------------------------------------------------------------------# +# remove the previous error file +#---------------------------------------------------------------------# + +rm -f $ERRORFILE +touch $ERRORFILE + +#---------------------------------------------------------------------# +# compile and run the tests +#---------------------------------------------------------------------# + + +compile_and_run test_kernel__ diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_2.C b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_2.C new file mode 100644 index 00000000000..30e82facba1 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_2.C @@ -0,0 +1,74 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_2.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_2_C +#define CGAL__TEST_2_C + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +template bool _test_2(const R& r); + + +template +bool +_test_2(const R& r) +{ + return + _test_cls_vector_2(r) + && _test_fct_vector_2(r) + && _test_cls_point_2(r) + && _test_fct_point_vector_2(r) + && _test_fct_point_2(r) + && _test_further_fct_point_2(r) + && _test_fct_direction_2(r) + && _test_fct_point_line_2( r ) + && _test_further_fct_point_line_2( r ) + && _test_cls_line_2( r ) + && _test_cls_segment_2( r ) + && _test_cls_ray_2( r ) + && _test_cls_triangle_2( r ) + && _test_cls_circle_2( r ) + && _test_cls_iso_rectangle_2( r ) + && _test_cls_aff_transformation_2( r ) + ; +} +#endif // CGAL__TEST_2_C diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_3.C b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_3.C new file mode 100644 index 00000000000..e449e1ad3a0 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_3.C @@ -0,0 +1,70 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_3.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_3_C +#define CGAL__TEST_3_C + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +template bool _test_3(const R& r); + + +template +bool +_test_3(const R& r) +{ + return + _test_cls_vector_3(r) + && _test_fct_vector_3(r) + && _test_cls_point_3(r) + && _test_fct_point_vector_3(r) + && _test_fct_point_3(r) + && _test_cls_direction_3(r) + && _test_cls_plane_3( r ) + && _test_cls_line_3( r ) + && _test_cls_segment_3( r ) + && _test_cls_sphere_3(r) + && _test_cls_ray_3( r ) + && _test_cls_triangle_3( r ) + && _test_cls_tetrahedron_3( r ) + && _test_cls_aff_transformation_3( r ) + ; +} + +#endif // CGAL__TEST_3_C diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_aff_transformation_2.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_aff_transformation_2.h new file mode 100644 index 00000000000..b65c59d8306 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_aff_transformation_2.h @@ -0,0 +1,42 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_cls_aff_transformation_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_AFF_TRANSFORMATION_2_H +#define CGAL__TEST_CLS_AFF_TRANSFORMATION_2_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +template bool _test_cls_aff_transformation_2(const R& ); + +#endif // CGAL__TEST_CLS_AFF_TRANSFORMATION_2_H diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_aff_transformation_3.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_aff_transformation_3.h new file mode 100644 index 00000000000..5972f5fe77b --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_aff_transformation_3.h @@ -0,0 +1,39 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_aff_transformation_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +template bool _test_cls_aff_transformation_3(const R& ); + diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_circle_2.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_circle_2.h new file mode 100644 index 00000000000..10f94f5c4c4 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_circle_2.h @@ -0,0 +1,40 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_cls_circle_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_CIRCLE_2_H +#define CGAL__TEST_CLS_CIRCLE_2_H + +#ifndef CGAL_CIRCLE_2_H +#include +#endif // CGAL_CIRCLE_2_H +#ifndef CGAL_AFF_TRANSFORMATION_2_H +#include +#endif // CGAL_AFF_TRANSFORMATION_2_H + + +template bool _test_cls_circle_2(const R& ); + + +#endif // CGAL__TEST_CLS_CIRCLE_2_H diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_direction_2.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_direction_2.h new file mode 100644 index 00000000000..208264cbb92 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_direction_2.h @@ -0,0 +1,40 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_cls_direction_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_DIRECTION_2_H +#define CGAL__TEST_CLS_DIRECTION_2_H + +#ifndef CGAL_VECTOR_2_H +#include +#endif // CGAL_VECTOR_2_H +#ifndef CGAL_DIRECTION_2_H +#include +#endif // CGAL_DIRECTION_2_H + + +template bool _test_cls_direction_2(const R& ); + + +#endif // CGAL__TEST_CLS_DIRECTION_2_H diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_direction_3.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_direction_3.h new file mode 100644 index 00000000000..d8e4d0cd373 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_direction_3.h @@ -0,0 +1,36 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_direction_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_VECTOR_3_H +#include +#endif // CGAL_VECTOR_3_H +#ifndef CGAL_DIRECTION_3_H +#include +#endif // CGAL_DIRECTION_3_H + + +template bool _test_cls_direction_3(const R& ); + + diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_iso_cuboid_3.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_iso_cuboid_3.h new file mode 100644 index 00000000000..9081c4a5f5d --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_iso_cuboid_3.h @@ -0,0 +1,32 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_iso_cuboid_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_ISO_CUBOID_3_H +#define CGAL__TEST_CLS_ISO_CUBOID_3_H +#include + +template bool _test_cls_iso_cuboid_3(const R& ); + +#endif // CGAL__TEST_CLS_ISO_CUBOID_3_H diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_iso_rectangle_2.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_iso_rectangle_2.h new file mode 100644 index 00000000000..09071e1c2c4 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_iso_rectangle_2.h @@ -0,0 +1,37 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_cls_iso_rectangle_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_ISO_RECTANGLE_2_H +#define CGAL__TEST_CLS_ISO_RECTANGLE_2_H + +#ifndef CGAL_ISO_RECTANGLE_2_H +#include +#endif // CGAL_ISO_RECTANGLE_2_H + + +template bool _test_cls_iso_rectangle_2(const R& ); + + +#endif // CGAL__TEST_CLS_ISO_RECTANGLE_2_H diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_line_2.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_line_2.h new file mode 100644 index 00000000000..66fd892c922 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_line_2.h @@ -0,0 +1,40 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_cls_line_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_LINE_2_H +#define CGAL__TEST_CLS_LINE_2_H + +#ifndef CGAL_LINE_2_H +#include +#endif // CGAL_LINE_2_H +#ifndef CGAL_AFF_TRANSFORMATION_2_H +#include +#endif // CGAL_AFF_TRANSFORMATION_2_H + + +template bool _test_cls_line_2(const R& ); + + +#endif // CGAL__TEST_CLS_LINE_2_H diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_line_3.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_line_3.h new file mode 100644 index 00000000000..8037b7dde76 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_line_3.h @@ -0,0 +1,33 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_line_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_LINE_3_H +#include +#endif // CGAL_LINE_3_H + + +template bool _test_cls_line_3(const R& ); + + diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_object.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_object.h new file mode 100644 index 00000000000..4922af37567 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_object.h @@ -0,0 +1,40 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_misc.fw +// file : _test_cls_object.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_OBJECT_H +#define CGAL__TEST_CLS_OBJECT_H + +#include +#include +#include +#include +#include +#include + + +template bool _test_cls_object(const R& ); + + +#endif // CGAL__TEST_CLS_OBJECT_H diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_plane_3.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_plane_3.h new file mode 100644 index 00000000000..dfcacf8bc2a --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_plane_3.h @@ -0,0 +1,33 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_plane_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_PLANE_3_H +#include +#endif // CGAL_PLANE_3_H + + +template bool _test_cls_plane_3(const R& ); + + diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_point_2.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_point_2.h new file mode 100644 index 00000000000..80ead721588 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_point_2.h @@ -0,0 +1,37 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_cls_point_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_POINT_2_H +#define CGAL__TEST_CLS_POINT_2_H + +#ifndef CGAL_POINT_2_H +#include +#endif // CGAL_POINT_2_H + + +template bool _test_cls_point_2(const R& ); + + +#endif // CGAL__TEST_CLS_POINT_2_H diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_point_3.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_point_3.h new file mode 100644 index 00000000000..9b6ac6c2505 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_point_3.h @@ -0,0 +1,33 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_point_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_POINT_3_H +#include +#endif // CGAL_POINT_3_H + + +template bool _test_cls_point_3(const R& ); + + diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_quotient.C b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_quotient.C new file mode 100644 index 00000000000..0a6c8fc513d --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_quotient.C @@ -0,0 +1,88 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_misc.fw +// file : _test_cls_quotient.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + + +template bool _test_cls_quotient(const NT& ); + + +template +bool +_test_cls_quotient(const NT& ) +{ + std::cout << "testing class quotient" ; + + typedef CGAL::Quotient QT; + + NT n0(0); + NT n1(1); + NT n2(2); + NT n3(3); + NT n4(4); + NT n5(5); + NT n6(6); + QT q0(0); + QT q1(1); + QT q2(2); + QT q1_2(n1,n2); + QT q1_3(n1,n3); + QT q3_4(n3,n4); + QT q3_6(n3,n6); + QT q1_4(n1,n4); + + std::cout << '.'; + + assert( q0 + q0 == q0 ); + assert( q1 + q0 == q1 ); + assert( q0 + q1 == q1 ); + assert( q1 + n0 == q1 ); + assert( n0 + q1 == q1 ); + assert( n1 + q0 == q1 ); + assert( q0 + n1 == q1 ); + assert( q1 + q1 == q2 ); + assert( q2 - q1 == q1 ); + assert( q2 - n1 == q1 ); + assert( q0 + q0 != q1 ); + + assert( q1_2 + q1_2 == n1 ); + assert( q1_2 - q1_4 == q1_4 ); + assert( q1_2 * q1_2 == q1_4 ); + assert( q1_2 == q1 / q2 ); + assert( q1_2 == n1 / q2 ); + assert( q1_3 == q1 / n3 ); + assert( q1_2 + q1_3 == QT(n5,n6) ); + assert( q1_2 == q3_6 ); + assert( q1_2 * n5 == n2 + q1_4 + q1_4 ); + + std::cout << '.'; + + assert( q1_2 < q3_4 ); + assert( q1_3 < q3_4 ); + assert( n1 < QT(n6,n4) ); + assert( q3_6 < n2 ); + + std::cout << q1_2 << "done"; + return true; +} + diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_ray_2.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_ray_2.h new file mode 100644 index 00000000000..7bcbbcfe53e --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_ray_2.h @@ -0,0 +1,37 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_cls_ray_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_RAY_2_H +#define CGAL__TEST_CLS_RAY_2_H + +#ifndef CGAL_RAY_2_H +#include +#endif // CGAL_RAY_2_H + + +template bool _test_cls_ray_2(const R& ); + + +#endif // CGAL__TEST_CLS_RAY_2_H diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_ray_3.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_ray_3.h new file mode 100644 index 00000000000..0c32ad3f1be --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_ray_3.h @@ -0,0 +1,33 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_ray_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_RAY_3_H +#include +#endif // CGAL_RAY_3_H + + +template bool _test_cls_ray_3(const R& ); + + diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_segment_2.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_segment_2.h new file mode 100644 index 00000000000..843749c9693 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_segment_2.h @@ -0,0 +1,37 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_cls_segment_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_SEGMENT_2_H +#define CGAL__TEST_CLS_SEGMENT_2_H + +#ifndef CGAL_SEGMENT_2_H +#include +#endif // CGAL_SEGMENT_2_H + + +template bool _test_cls_segment_2(const R& ); + + +#endif // CGAL__TEST_CLS_SEGMENT_2_H diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_segment_3.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_segment_3.h new file mode 100644 index 00000000000..0b1f5928a76 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_segment_3.h @@ -0,0 +1,33 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_segment_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_SEGMENT_3_H +#include +#endif // CGAL_SEGMENT_3_H + + +template bool _test_cls_segment_3(const R& ); + + diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_sphere_3.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_sphere_3.h new file mode 100644 index 00000000000..ff8a4c30841 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_sphere_3.h @@ -0,0 +1,31 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_sphere_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_SPHERE_3_H +#include +#endif // CGAL_SPHERE_3_H + +template bool _test_cls_sphere_3(const R& ); + diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_tetrahedron_3.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_tetrahedron_3.h new file mode 100644 index 00000000000..7d05059e48a --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_tetrahedron_3.h @@ -0,0 +1,33 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_tetrahedron_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_TETRAHEDRON_3_H +#include +#endif // CGAL_TETRAHEDRON_3_H + + +template bool _test_cls_tetrahedron_3(const R& ); + + diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_triangle_2.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_triangle_2.h new file mode 100644 index 00000000000..cfbb392431e --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_triangle_2.h @@ -0,0 +1,37 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_cls_triangle_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_TRIANGLE_2_H +#define CGAL__TEST_CLS_TRIANGLE_2_H + +#ifndef CGAL_TRIANGLE_2_H +#include +#endif // CGAL_TRIANGLE_2_H + + +template bool _test_cls_triangle_2(const R& ); + + +#endif // CGAL__TEST_CLS_TRIANGLE_2_H diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_triangle_3.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_triangle_3.h new file mode 100644 index 00000000000..44c9dc5298f --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_triangle_3.h @@ -0,0 +1,33 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_triangle_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_TRIANGLE_3_H +#include +#endif // CGAL_TRIANGLE_3_H + + +template bool _test_cls_triangle_3(const R& ); + + diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_vector_2.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_vector_2.h new file mode 100644 index 00000000000..7b1e34b5609 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_vector_2.h @@ -0,0 +1,40 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_cls_vector_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_CLS_VECTOR_2_H +#define CGAL__TEST_CLS_VECTOR_2_H + +#ifndef CGAL_USER_CLASSES_H +#include +#endif // CGAL_USER_CLASSES_H +#ifndef CGAL_VECTOR_2_H +#include +#endif // CGAL_VECTOR_2_H + + +template bool _test_cls_vector_2(const R& ); + + +#endif // CGAL__TEST_CLS_VECTOR_2_H diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_vector_3.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_vector_3.h new file mode 100644 index 00000000000..45aaf4a1760 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_cls_vector_3.h @@ -0,0 +1,36 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_cls_vector_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_USER_CLASSES_H +#include +#endif // CGAL_USER_CLASSES_H +#ifndef CGAL_VECTOR_3_H +#include +#endif // CGAL_VECTOR_3_H + + +template bool _test_cls_vector_3(const R& ); + + diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_constructions_2.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_constructions_2.h new file mode 100644 index 00000000000..3eb523d9170 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_constructions_2.h @@ -0,0 +1,42 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : +// file : _test_fct_constructions_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_CONSTRUCTIONS_2_H +#define CGAL__TEST_FCT_CONSTRUCTIONS_2_H + +#include +#include + + +template +bool +_test_fct_constructions_2(const R&); + + +#ifdef CGAL_CFG_NO_AUTOMATIC_TEMPLATE_INCLUSION +#include +#endif // CGAL_CFG_NO_AUTOMATIC_TEMPLATE_INCLUSION + +#endif // CGAL__TEST_FCT_CONSTRUCTIONS_2_H diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_constructions_3.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_constructions_3.h new file mode 100644 index 00000000000..905f15a5159 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_constructions_3.h @@ -0,0 +1,40 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : +// file : _test_fct_constructions_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_CONSTRUCTIONS_3_H +#define CGAL__TEST_FCT_CONSTRUCTIONS_3_H + +#include +#include + + +template bool _test_fct_constructions_3(const R&); + + +#ifdef CGAL_CFG_NO_AUTOMATIC_TEMPLATE_INCLUSION +#include +#endif // CGAL_CFG_NO_AUTOMATIC_TEMPLATE_INCLUSION + +#endif // CGAL__TEST_FCT_CONSTRUCTIONS_3_H diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_coplanar_3.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_coplanar_3.h new file mode 100644 index 00000000000..3c34def3aa5 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_coplanar_3.h @@ -0,0 +1,38 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : +// file : _test_fct_coplanar_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_COPLANAR_3_H +#define CGAL__TEST_FCT_COPLANAR_3_H + +#include +#include + +template bool _test_fct_coplanar_3(const R&); + +#ifdef CGAL_CFG_NO_AUTOMATIC_TEMPLATE_INCLUSION +#include +#endif // CGAL_CFG_NO_AUTOMATIC_TEMPLATE_INCLUSION + +#endif // CGAL__TEST_FCT_COPLANAR_3_H diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_determinant.C b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_determinant.C new file mode 100644 index 00000000000..d3e29bd1227 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_determinant.C @@ -0,0 +1,131 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : +// file : _test_fct_determinant.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_DETERMINANT_C +#define CGAL__TEST_DETERMINANT_C + +#include +#include + +template +bool +_test_fct_determinant(const NT&) +{ + NT zero= NT(0); + NT one = NT(1); + NT two = NT(2); + + // detDxD_by_formula + + assert( CGAL::det2x2_by_formula( zero, one, \ + one, zero) == - one ); + + assert( CGAL::det2x2_by_formula( one, one, \ + zero, -one) == - one ); + + assert( CGAL::det3x3_by_formula( one, zero, one, \ + zero, one, one, \ + -one, -one, zero ) == \ + one * CGAL::det2x2_by_formula( one, one, \ + -one, zero ) \ + - one * CGAL::det2x2_by_formula( zero, one, \ + one, one ) ); + + assert( CGAL::det4x4_by_formula( one, zero, one, -one, \ + zero, one, one, -one, \ + one, two, zero, one, \ + -one, -one, zero, zero ) == \ + one * CGAL::det3x3_by_formula( zero, one, -one, \ + one, one, -one, \ + two, zero, one ) \ + - one * CGAL::det3x3_by_formula( one, one, -one, \ + zero, one, -one, \ + one, zero, one ) ); + + assert( CGAL::det5x5_by_formula( one, zero, one, -one, zero, \ + zero, one, one, -one, zero, \ + one, two, zero, one, two, \ + one, one, zero, -one, zero, \ + -one, -one, zero, zero, one ) == \ + two * CGAL::det4x4_by_formula( one, zero, one, -one, \ + zero, one, one, -one, \ + one, one, zero, -one, \ + -one, -one, zero, zero) \ + + one * CGAL::det4x4_by_formula( one, zero, one, -one, \ + zero, one, one, -one, \ + one, two, zero, one, \ + one, one, zero, -one) ); + + assert( CGAL::det6x6_by_formula( one, zero, zero, zero, zero, zero, \ + zero, one, zero, one, -one, zero, \ + zero, zero, one, one, -one, zero, \ + zero, one, two, zero, one, two, \ + zero, one, one, zero, -one, zero, \ + zero, -one, -one, zero, zero, one ) == \ + CGAL::det5x5_by_formula( one, zero, one, -one, zero, \ + zero, one, one, -one, zero, \ + one, two, zero, one, two, \ + one, one, zero, -one, zero, \ + -one, -one, zero, zero, one ) ); + + // sign_of_determinantDxD + + assert( CGAL::sign_of_determinant2x2( zero, one, \ + one, zero) == CGAL::NEGATIVE ); + + assert( CGAL::sign_of_determinant2x2( one, one, \ + zero, -one) == CGAL::NEGATIVE ); + + assert( CGAL::sign_of_determinant2x2( one, one, \ + zero, one) == CGAL::POSITIVE ); + + assert( CGAL::sign_of_determinant2x2( zero, -one, \ + zero, one) == CGAL::ZERO ); + + + assert( CGAL::sign_of_determinant4x4( one, zero, one, -one, \ + zero, one, one, -one, \ + zero, two, zero, one, \ + zero, -one, zero, zero ) == \ + CGAL::sign_of_determinant3x3( one, one, -one, \ + two, zero, one, \ + -one, zero, zero ) ); + + assert( CGAL::sign_of_determinant6x6( one, zero, zero, zero, zero, zero, \ + zero, one, zero, one, -one, zero, \ + zero, zero, one, one, -one, zero, \ + zero, one, two, zero, one, two, \ + zero, one, one, zero, -one, zero, \ + zero, -one, -one, zero, zero, one )==\ + CGAL::sign_of_determinant5x5( one, zero, one, -one, zero, \ + zero, one, one, -one, zero, \ + one, two, zero, one, two, \ + one, one, zero, -one, zero, \ + -one, -one, zero, zero, one ) ); + + + return true; +} +#endif // CGAL__TEST_DETERMINANT_C diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_direction_2.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_direction_2.h new file mode 100644 index 00000000000..de81541bfc3 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_direction_2.h @@ -0,0 +1,37 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_fct_direction_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_DIRECTION_2_H +#define CGAL__TEST_FCT_DIRECTION_2_H + +#ifndef CGAL_DIRECTION_2_H +#include +#endif // CGAL_DIRECTION_2_H + + +template bool _test_fct_direction_2(const R& ); + + +#endif // CGAL__TEST_FCT_DIRECTION_2_H diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_point_2.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_point_2.h new file mode 100644 index 00000000000..957bf8ebef0 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_point_2.h @@ -0,0 +1,40 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_fct_point_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_POINT_2_H +#define CGAL__TEST_FCT_POINT_2_H + +#ifndef CGAL_POINT_2_H +#include +#endif // CGAL_POINT_2_H +#ifndef CGAL_PREDICATES_ON_POINTS_2_H +#include +#endif // CGAL_PREDICATES_ON_POINTS_2_H + + +template bool _test_fct_point_2(const R& ); + + +#endif // CGAL__TEST_FCT_POINT_2_H diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_point_3.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_point_3.h new file mode 100644 index 00000000000..45d158dab4b --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_point_3.h @@ -0,0 +1,40 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_fct_point_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_POINT_3_H +#include +#endif // CGAL_POINT_3_H +#ifndef CGAL_VECTOR_3_H +#include +#endif // CGAL_VECTOR_3_H +#ifndef CGAL_PREDICATES_ON_POINTS_3_H +#include +#endif // CGAL_PREDICATES_ON_POINTS_3_H +#include + + +template bool _test_fct_point_3(const R& ); + + diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_point_conversion.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_point_conversion.h new file mode 100644 index 00000000000..321c8cdebb5 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_point_conversion.h @@ -0,0 +1,39 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_misc.fw +// file : _test_fct_point_conversion.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_POINT_CONVERSION_H +#define CGAL__TEST_FCT_POINT_CONVERSION_H +#include +#include +#include +#include +#include +#include + + +template bool _test_fct_point_conversion(const NT& ); + + +#endif // CGAL__TEST_FCT_POINT_CONVERSION_H diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_point_line_2.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_point_line_2.h new file mode 100644 index 00000000000..e3819a68a0f --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_point_line_2.h @@ -0,0 +1,44 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_fct_point_line_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_POINT_2_LINE_2_H +#define CGAL__TEST_FCT_POINT_2_LINE_2_H + +#ifndef CGAL_POINT_2_H +#include +#endif // CGAL_POINT_2_H +#ifndef CGAL_LINE_2_H +#include +#endif // CGAL_LINE_2_H +#ifndef CGAL_PREDICATES_ON_LINES_2_H +#include +#endif // CGAL_PREDICATES_ON_LINES_2_H + + +template bool _test_fct_point_line_2(const R& ); + + + +#endif // CGAL__TEST_FCT_POINT_2_LINE_2_H diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_point_vector_2.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_point_vector_2.h new file mode 100644 index 00000000000..e0cf032ff7f --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_point_vector_2.h @@ -0,0 +1,40 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_fct_point_vector_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_POINT_VECTOR_2_H +#define CGAL__TEST_FCT_POINT_VECTOR_2_H + +#ifndef CGAL_POINT_2_H +#include +#endif // CGAL_POINT_2_H +#ifndef CGAL_VECTOR_2_H +#include +#endif // CGAL_VECTOR_2_H + + +template bool _test_fct_point_vector_2(const R& ); + + +#endif // CGAL__TEST_FCT_POINT_VECTOR_2_H diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_point_vector_3.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_point_vector_3.h new file mode 100644 index 00000000000..2c136e8e661 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_point_vector_3.h @@ -0,0 +1,36 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_fct_point_vector_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_POINT_3_H +#include +#endif // CGAL_POINT_3_H +#ifndef CGAL_VECTOR_3_H +#include +#endif // CGAL_VECTOR_3_H + + +template bool _test_fct_point_vector_3(const R& ); + + diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_points_implicit_sphere.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_points_implicit_sphere.h new file mode 100644 index 00000000000..b641c71e7ac --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_points_implicit_sphere.h @@ -0,0 +1,43 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : +// file : _test_fct_points_implicit_sphere.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_POINTS_IMPLICIT_SPHERE_H +#define CGAL__TEST_FCT_POINTS_IMPLICIT_SPHERE_H + +#include +#include +#include +#include +#include + + +template bool _test_fct_points_implicit_sphere(const R&); + + +#ifdef CGAL_CFG_NO_AUTOMATIC_TEMPLATE_INCLUSION +#include +#endif // CGAL_CFG_NO_AUTOMATIC_TEMPLATE_INCLUSION + +#endif // CGAL__TEST_FCT_POINTS_IMPLICIT_SPHERE_H diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_vector_2.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_vector_2.h new file mode 100644 index 00000000000..35afdeff830 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_vector_2.h @@ -0,0 +1,37 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_fct_vector_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FCT_VECTOR_2_H +#define CGAL__TEST_FCT_VECTOR_2_H + +#ifndef CGAL_VECTOR_2_H +#include +#endif // CGAL_VECTOR_2_H + + +template bool _test_fct_vector_2(const R& ); + + +#endif // CGAL__TEST_FCT_VECTOR_2_H diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_vector_3.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_vector_3.h new file mode 100644 index 00000000000..acdd52a6a66 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_fct_vector_3.h @@ -0,0 +1,33 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_fct_vector_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_VECTOR_3_H +#include +#endif // CGAL_VECTOR_3_H + + +template bool _test_fct_vector_3(const R& ); + + diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_further_fct_point_2.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_further_fct_point_2.h new file mode 100644 index 00000000000..f257465bdd1 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_further_fct_point_2.h @@ -0,0 +1,46 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_further_fct_point_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FURTHER_FCT_POINT_2_H +#define CGAL__TEST_FURTHER_FCT_POINT_2_H + +#ifndef CGAL_POINT_2_H +#include +#endif // CGAL_POINT_2_H +#ifndef CGAL_VECTOR_2_H +#include +#endif // CGAL_VECTOR_2_H +#ifndef CGAL_PREDICATES_ON_POINTS_2_H +#include +#endif // CGAL_PREDICATES_ON_POINTS_2_H +#ifndef CGAL_DISTANCE_PREDICATES_2_H +#include +#endif // CGAL_DISTANCE_PREDICATES_2_H + + +template bool _test_further_fct_point_2(const R& ); + + +#endif // CGAL__TEST_FURTHER_FCT_POINT_2_H diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_further_fct_point_line_2.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_further_fct_point_line_2.h new file mode 100644 index 00000000000..c4d175010c3 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_further_fct_point_line_2.h @@ -0,0 +1,43 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_2.fw +// file : _test_further_fct_point_line_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_FURTHER_FCT_POINT_2_LINE_2_H +#define CGAL__TEST_FURTHER_FCT_POINT_2_LINE_2_H + +#ifndef CGAL_POINT_2_H +#include +#endif // CGAL_POINT_2_H +#ifndef CGAL_LINE_2_H +#include +#endif // CGAL_LINE_2_H +#ifndef CGAL_DISTANCE_PREDICATES_2_H +#include +#endif // CGAL_DISTANCE_PREDICATES_2_H + + +template bool _test_further_fct_point_line_2(const R& ); + + +#endif // CGAL__TEST_FURTHER_FCT_POINT_2_LINE_2_H diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_mf_plane_3_to_2d.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_mf_plane_3_to_2d.h new file mode 100644 index 00000000000..c41aca616ea --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_mf_plane_3_to_2d.h @@ -0,0 +1,34 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_3.fw +// file : _test_mf_plane_3_to_2d.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include +#include +#include + + +template bool _test_mf_plane_3_to_2d( const R&); + + diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_new_2.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_new_2.h new file mode 100644 index 00000000000..6a8dd610e7a --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_new_2.h @@ -0,0 +1,474 @@ + +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_new_kernel.fw +// file : test/Kernel/include/CGAL/_test_new_2.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Michael Seel +// Stefan Schirra +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_NEW_2_H +#define CGAL__TEST_NEW_2_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +void use(bool) {}; +void use(CGAL::Sign) {} +void use(CGAL::Bounded_side) {} +void use(CGAL::Oriented_side) {} +void use(CGAL::Comparison_result) {} + + +template +bool +test_new_2(const R& rep) +{ + std::cout << "Testing 2 dimensional functionality" << std::endl; + + using namespace CGAL; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + typedef typename R::Point_2 Point_2; + typedef typename R::Vector_2 Vector_2; + typedef typename R::Direction_2 Direction_2; + typedef typename R::Segment_2 Segment_2; + typedef typename R::Line_2 Line_2; + typedef typename R::Ray_2 Ray_2; + typedef typename R::Circle_2 Circle_2; + typedef typename R::Triangle_2 Triangle_2; + typedef typename R::Iso_rectangle_2 Iso_rectangle_2; + typedef typename R::Aff_transformation_2 Aff_transformation_2; + typedef typename R::Object_2 Object2; + + typename R::Construct_point_2 construct_point = + rep.construct_point_2_object(); + Point_2 p1 = construct_point(); + Point_2 p2 = construct_point(ORIGIN); + Point_2 p3 = construct_point(1,1); + Point_2 p4 = construct_point(1,2,2); + Point_2 p5 = construct_point(3,4,5); + Point_2 p6 = construct_point(3,4,6); + + typename R::Construct_vector_2 construct_vector = + rep.construct_vector_2_object(); + Vector_2 v1 = construct_vector(); + Vector_2 v2 = construct_vector(NULL_VECTOR); + Vector_2 v3 = construct_vector(1,3); + Vector_2 v4 = construct_vector(1,2,3); + + typename R::Construct_direction_2 construct_direction + = rep.construct_direction_2_object(); + Direction_2 d1 = construct_direction(); + Direction_2 d2 = construct_direction(v3); + Direction_2 d3 = construct_direction(1,4); + + typename R::Construct_segment_2 construct_segment + = rep.construct_segment_2_object(); + Segment_2 s1 = construct_segment(); + Segment_2 s2 = construct_segment(p2,p3); + + typename R::Construct_ray_2 construct_ray = + rep.construct_ray_2_object(); + Ray_2 r1 = construct_ray(); + Ray_2 r2 = construct_ray(p2,p5); + Ray_2 r3 = construct_ray(p2,d3); + + typename R::Construct_line_2 construct_line + = rep.construct_line_2_object(); + Line_2 l1 = construct_line(); + Line_2 l2 = construct_line(1,1,1); + Line_2 l3 = construct_line(p2,p6); + Line_2 l4 = construct_line(p2,d3); + Line_2 l5 = construct_line(s2); + Line_2 l6 = construct_line(r2); + + typename R::Construct_circle_2 construct_circle + = rep.construct_circle_2_object(); + Circle_2 c1 = construct_circle(p2,1); + Circle_2 c11 = construct_circle(p2,1,COUNTERCLOCKWISE); + Circle_2 c2 = construct_circle(p2,p3,p4); + Circle_2 c31 = construct_circle(p2,p3,COUNTERCLOCKWISE); + Circle_2 c4 = construct_circle(p2); + Circle_2 c41 = construct_circle(p2,COUNTERCLOCKWISE); + + typename R::Construct_triangle_2 construct_triangle + = rep.construct_triangle_2_object(); + Triangle_2 t1 = construct_triangle(); + Triangle_2 t2 = construct_triangle(p2,p3,p4); + + typename R::Construct_aff_transformation_2 construct_aff_transformation + = rep.construct_aff_transformation_2_object(); + Aff_transformation_2 a1 = construct_aff_transformation(Translation(),v2); + Aff_transformation_2 a2 = construct_aff_transformation(Rotation(),d2,1); + Aff_transformation_2 a21 = construct_aff_transformation(Rotation(),d2,1,2); + Aff_transformation_2 a3 = construct_aff_transformation(Rotation(),1,1); + Aff_transformation_2 a31 = construct_aff_transformation(Rotation(),3,4,5); + Aff_transformation_2 a4 = construct_aff_transformation(Scaling(),5); + Aff_transformation_2 a41 = construct_aff_transformation(Scaling(),5,2); + Aff_transformation_2 a5 = construct_aff_transformation(1,2,3,4,5,6); + Aff_transformation_2 a51 = construct_aff_transformation(1,2,3,4,5,6,1); + Aff_transformation_2 a6 = construct_aff_transformation(1,2,3,4); + Aff_transformation_2 a61 = construct_aff_transformation(1,2,3,4,1); + + + typename R::Construct_point_on_2 construct_point_on + = rep.construct_point_on_2_object(); + Point_2 tmp1 = construct_point_on(l2); + + + typename R::Construct_second_point_on_2 construct_second_point_on + = rep.construct_second_point_on_2_object(); + Point_2 tmp2 = construct_second_point_on(r2); + + + typename R::Construct_source_point_2 construct_source_point + = rep.construct_source_point_2_object(); + Point_2 tmp3 = construct_source_point(s2); + + + typename R::Construct_target_point_2 construct_target_point + = rep.construct_target_point_2_object(); + Point_2 tmp4 = construct_target_point(s2); + + + typename R::Construct_min_point_2 construct_min_point + = rep.construct_min_point_2_object(); + Point_2 tmp5a = construct_min_point(s2); + // Point_2 tmp5b = construct_min_point(t2); + + typename R::Construct_max_point_2 construct_max_point + = rep.construct_max_point_2_object(); + Point_2 tmp6a = construct_max_point(s2); + // Point_2 tmp6b = construct_max_point(t2); + + + typename R::Construct_direction_of_line_2 construct_direction_from + = rep.construct_direction_of_line_2_object(); + Direction_2 tmp7a = construct_direction_from(l2); + + typename R::Construct_direction_of_ray_2 construct_direction_from_ray + = rep.construct_direction_of_ray_2_object(); + Direction_2 tmp7b = construct_direction_from_ray(r2); + + + typename R::Construct_supporting_line_2 construct_supporting_line + = rep.construct_supporting_line_2_object(); + Line_2 tmp8a = construct_supporting_line(r2); + Line_2 tmp8b = construct_supporting_line(s2); + + typename R::Construct_perpendicular_vector_2 construct_perpendicular_vector + = rep.construct_perpendicular_vector_2_object(); + Vector_2 tmp9 = construct_perpendicular_vector(v2,CLOCKWISE); + + typename R::Construct_perpendicular_direction_2 construct_perpendicular_direction + = rep.construct_perpendicular_direction_2_object(); + Direction_2 tmp10 = construct_perpendicular_direction(d2,COUNTERCLOCKWISE); + + typename R::Construct_perpendicular_line_2 construct_perpendicular_line + = rep.construct_perpendicular_line_2_object(); + Line_2 tmp11 = construct_perpendicular_line(l2,p2); + + + typename R::Construct_midpoint construct_midpoint + = rep.construct_midpoint_object(); + Point_2 tmp12 = construct_midpoint(p2,p3); + + + typename R::Construct_circumcenter_2 construct_circumcenter + = rep.construct_circumcenter_2_object(); + Point_2 tmp13 = construct_circumcenter(p2,p3,p4); + + + typename R::Construct_bisector_2 construct_bisector + = rep.construct_bisector_2_object(); + Line_2 tmp14 = construct_bisector(p2,p3); + + + typename R::Construct_opposite_segment_2 construct_opposite_segment + = rep.construct_opposite_segment_2_object(); + Segment_2 tmp15 = construct_opposite_segment(s2); + + + typename R::Construct_opposite_ray_2 construct_opposite_ray + = rep.construct_opposite_ray_2_object(); + Ray_2 tmp16 = construct_opposite_ray(r2); + + + typename R::Construct_opposite_line_2 construct_opposite_line + = rep.construct_opposite_line_2_object(); + Line_2 tmp17 = construct_opposite_line(l2); + + + typename R::Construct_opposite_triangle_2 construct_opposite_triangle + = rep.construct_opposite_triangle_2_object(); + Triangle_2 tmp18 = construct_opposite_triangle(t2); + + + typename R::Construct_opposite_circle_2 construct_opposite_circle + = rep.construct_opposite_circle_2_object(); + Circle_2 tmp19 = construct_opposite_circle(c2); + + typename R::Transform_2 transform + = rep.transform_2_object(); + Point_2 tmp20a = transform(p2,a3); + Line_2 tmp20b = transform(l2,a3); + + + typename R::Intersect_2 intersect + = rep.intersect_2_object(); + Object2 tmp21a = intersect(l2,l3); + Object2 tmp21b = intersect(l2,r2); + + bool tmp_bool; + + typename R::Assign_2 assign + = rep.assign_2_object(); + tmp_bool = assign(p1,tmp21a); + tmp_bool = assign(p1,tmp21b); + + + typename R::Compute_y_at_x_2 compute_y_at_x + = rep.compute_y_at_x_2_object(); + FT tmp22 = compute_y_at_x(l2, FT(11)); + + + typename R::Compute_squared_length_2 Compute_squared_length + = rep.Compute_squared_length_2_object(); + FT tmp23 = Compute_squared_length(s2); + + + typename R::Equal_2 equal + = rep.equal_2_object(); + bool tmp24 = equal(p2,p3); + + + typename R::Equal_x_2 equal_x + = rep.equal_x_2_object(); + bool tmp25 = equal_x(p2,p3); + + + typename R::Equal_y_2 equal_y + = rep.equal_y_2_object(); + bool tmp26 = equal_y(p2,p3); + + + typename R::Equal_xy_2 equal_xy + = rep.equal_xy_2_object(); + bool tmp27 = equal_xy(p2,p3); + + typename R::Less_x_2 less_x + = rep.less_x_2_object(); + bool tmp28 = less_x(p2,p3); + + + typename R::Less_y_2 less_y + = rep.less_y_2_object(); + bool tmp29 = less_y(p2,p3); + + + typename R::Less_xy_2 less_xy + = rep.less_xy_2_object(); + bool tmp30 = less_xy(p2,p3); + + + typename R::Compare_x_2 compare_x + = rep.compare_x_2_object(); + Comparison_result tmp31a = compare_x(p2,p3); + Comparison_result tmp31b = compare_x(p2,l2,l3); + Comparison_result tmp31c = compare_x(l2,l3,l4); + Comparison_result tmp31d = compare_x(l2,l3,l4,l5); + + + typename R::Compare_y_2 compare_y + = rep.compare_y_2_object(); + Comparison_result tmp32a = compare_y(p2,p3); + Comparison_result tmp32b = compare_y(p2,l2,l3); + Comparison_result tmp32c = compare_y(l2,l3,l4); + Comparison_result tmp32d = compare_y(l2,l3,l4,l5); + + + typename R::Compare_xy_2 compare_xy + = rep.compare_xy_2_object(); + Comparison_result tmp33a = compare_xy(p2,p3); + + + typename R::Compare_y_at_x_2 compare_y_at_x + = rep.compare_y_at_x_2_object(); + Comparison_result tmp34a = compare_y_at_x(p2,l2); + Comparison_result tmp34b = compare_y_at_x(p2,l2,l3); + Comparison_result tmp34c = compare_y_at_x(l2,l3,l4); + Comparison_result tmp34d = compare_y_at_x(l2,l3,l4,l5); + + + typename R::Less_distance_to_point_2 less_distance_to_point + = rep.less_distance_to_point_2_object(p2); + bool tmp35 = less_distance_to_point(p3,p4); + + + typename R::Less_signed_distance_to_line_2 less_signed_distance_to_line + = rep.less_signed_distance_to_line_2_object(p4,p5); + bool tmp36 = less_signed_distance_to_line(p2,p3); + + typename R::Leftturn_2 leftturn + = rep.leftturn_2_object(); + bool tmp37 = leftturn(p2,p3,p4); + + + typename R::Left_of_line_2 left_of_line + = rep.left_of_line_2_object(p2,p3); + bool tmp38 = left_of_line(p4); + + + bool tmp39; + + typename R::Counterclockwise_in_between_2 ccwib + = rep.counterclockwise_in_between_2_object(); + tmp39 = ccwib(d1,d2,d3); + + typename R::Collinear_2 collinear + = rep.collinear_2_object(); + tmp39 = collinear(p2,p3,p4); + + + typename R::Orientation_2 orientation + = rep.orientation_2_object(); + Orientation tmp40 = orientation(p2,p3,p4); + + + typename R::Side_of_oriented_circle_2 side_of_oriented_circle + = rep.side_of_oriented_circle_2_object(); + Oriented_side tmp41 = side_of_oriented_circle(p2,p3,p4,p5); + + + typename R::Side_of_bounded_circle_2 side_of_bounded_circle + = rep.side_of_bounded_circle_2_object(); + Bounded_side tmp42 = side_of_bounded_circle(p2,p3,p4,p5); + + + typename R::Is_horizontal_2 is_horizontal + = rep.is_horizontal_2_object(); + bool tmp43 = is_horizontal(l2); + + + typename R::Is_vertical_2 is_vertical + = rep.is_vertical_2_object(); + bool tmp44 = is_vertical(l2); + + + typename R::Is_degenerate_2 is_degenerate + = rep.is_degenerate_2_object(); + bool tmp45 = is_degenerate(l2); + + + typename R::Has_on_2 has_on + = rep.has_on_2_object(); + bool tmp46 = has_on(l2,p2); + + + typename R::Collinear_has_on_2 collinear_has_on + = rep.collinear_has_on_2_object(); + bool tmp47 = collinear_has_on(s2,p2); + + + typename R::Has_on_bounded_side_2 has_on_bounded_side + = rep.has_on_bounded_side_2_object(); + bool tmp48a = has_on_bounded_side(c2,p2); + bool tmp48b = has_on_bounded_side(t2,p2); + + + typename R::Has_on_unbounded_side_2 has_on_unbounded_side + = rep.has_on_unbounded_side_2_object(); + bool tmp49a = has_on_unbounded_side(c2,p2); + bool tmp49b = has_on_unbounded_side(t2,p2); + + + typename R::Has_on_boundary_2 has_on_boundary + = rep.has_on_boundary_2_object(); + bool tmp50a = has_on_boundary(c2,p2); + bool tmp50b = has_on_boundary(t2,p2); + + + typename R::Has_on_positive_side_2 has_on_positive_side + = rep.has_on_positive_side_2_object(); + bool tmp51a = has_on_positive_side(l2,p2); + bool tmp51b = has_on_positive_side(c2,p2); + + + typename R::Has_on_negative_side_2 has_on_negative_side + = rep.has_on_negative_side_2_object(); + bool tmp52a = has_on_negative_side(l2,p2); + bool tmp52b = has_on_negative_side(c2,p2); + + + typename R::Oriented_side_2 oriented_side + = rep.oriented_side_2_object(); + Oriented_side tmp53a = oriented_side(l2,p2); + Oriented_side tmp53b = oriented_side(c2,p2); + + + typename R::Are_ordered_along_line_2 are_ordered_along_line + = rep.are_ordered_along_line_2_object(); + bool tmp54 = are_ordered_along_line(p2,p2,p3); + + + typename R::Are_strictly_ordered_along_line_2 are_strictly_ordered_along_line + = rep.are_strictly_ordered_along_line_2_object(); + bool tmp55 = are_strictly_ordered_along_line(p2,p2,p3); + + + typename R::Collinear_are_ordered_along_line_2 collinear_are_ordered_along_line + = rep.collinear_are_ordered_along_line_2_object(); + bool tmp56 = collinear_are_ordered_along_line(p2,p2,p3); + + + typename R::Collinear_are_strictly_ordered_along_line_2 collinear_are_strictly_ordered_along_line + = rep.collinear_are_strictly_ordered_along_line_2_object(); + bool tmp57 = collinear_are_strictly_ordered_along_line(p2,p2,p3); + + use(tmp57); use(tmp56); use(tmp55); use(tmp54); use(tmp53b); use(tmp53a); + use(tmp52b); use(tmp52a); use(tmp51b); use(tmp51a); use(tmp50b); use(tmp50a); + use(tmp49b); use(tmp49a); use(tmp48b); use(tmp48a); use(tmp47); use(tmp46); + use(tmp45); use(tmp44); use(tmp43); use(tmp42); use(tmp41); use(tmp40); + use(tmp39); use(tmp38); use(tmp37); use(tmp36); use(tmp35); use(tmp34d); + use(tmp34c); use(tmp34b); use(tmp34a); use(tmp32d); use(tmp32c); use(tmp32b); + use(tmp32a); use(tmp31d); use(tmp31c); use(tmp31b); use(tmp31a); use(tmp30); + use(tmp26); use(tmp25); use(tmp24); + use(tmp29); use(tmp28); use(tmp27); use(tmp33a); + use(tmp_bool); + + + return true; +} + +#endif // CGAL__TEST_NEW_2_H diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_new_3.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_new_3.h new file mode 100644 index 00000000000..ded0e97c3b4 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_new_3.h @@ -0,0 +1,406 @@ + +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_new_kernel.fw +// file : test/Kernel/include/CGAL/_test_new_3.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Michael Seel +// Stefan Schirra +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_TEST_NEW_3_H +#define CGAL_TEST_NEW_3_H + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +void use(bool) {}; +void use(CGAL::Sign) {} +void use(CGAL::Bounded_side) {} +void use(CGAL::Oriented_side) {} +void use(CGAL::Comparison_result) {} + + +template +bool +test_new_3(const R& rep) +{ + std::cout << "Testing 3 dimensional functionality" << std::endl; + + using namespace CGAL; + + typedef typename R::RT RT; + typedef typename R::FT FT; + + typedef typename R::Point_3 Point_3; + typedef typename R::Vector_3 Vector_3; + typedef typename R::Direction_3 Direction_3; + typedef typename R::Segment_3 Segment_3; + typedef typename R::Line_3 Line_3; + typedef typename R::Ray_3 Ray_3; + typedef typename R::Plane_3 Plane_3; + typedef typename R::Triangle_3 Triangle_3; + typedef typename R::Tetrahedron_3 Tetrahedron_3; + typedef typename R::Aff_transformation_3 Aff_transformation_3; + typedef typename R::Object_3 Object3; + + typename R::Construct_point_3 construct_point + = rep.construct_point_3_object(); + Point_3 p1 = construct_point(); + Point_3 p2 = construct_point(ORIGIN); + Point_3 p3 = construct_point(1,1,1); + Point_3 p4 = construct_point(1,1,2,2); + Point_3 p5 = construct_point(1,2,3,4); + Point_3 p6 = construct_point(4,2,1,2); + + typename R::Construct_vector_3 construct_vector + = rep.construct_vector_3_object(); + Vector_3 v1 = construct_vector(); + Vector_3 v2 = construct_vector(NULL_VECTOR); + Vector_3 v3 = construct_vector(1,1,1); + Vector_3 v4 = construct_vector(1,1,2,2); + + typename R::Construct_direction_3 construct_direction + = rep.construct_direction_3_object(); + Direction_3 d1 = construct_direction(); + Direction_3 d2 = construct_direction(v3); + Direction_3 d3 = construct_direction(1,1,5); + Direction_3 d4 = construct_direction(1,5,5); + + typename R::Construct_segment_3 construct_segment + = rep.construct_segment_3_object(); + Segment_3 s1 = construct_segment(); + Segment_3 s2 = construct_segment(p2,p3); + + typename R::Construct_ray_3 construct_ray = + rep.construct_ray_3_object(); + Ray_3 r1 = construct_ray(); + Ray_3 r2 = construct_ray(p2,p4); + Ray_3 r3 = construct_ray(p2,d3); + + typename R::Construct_line_3 construct_line + = rep.construct_line_3_object(); + Line_3 l1 = construct_line(); + Line_3 l2 = construct_line(p5,p6); + Line_3 l3 = construct_line(p2,p3); + Line_3 l4 = construct_line(p2,d4); + Line_3 l5 = construct_line(s2); + Line_3 l6 = construct_line(r2); + + typename R::Construct_plane_3 construct_plane + = rep.construct_plane_3_object(); + Plane_3 h1 = construct_plane(); + Plane_3 h2 = construct_plane(1,1,1,1); + Plane_3 h3 = construct_plane(p2,p3,p4); + Plane_3 h4 = construct_plane(p2,d4); + Plane_3 h5 = construct_plane(l2,p4); + Plane_3 h6 = construct_plane(r2,p4); + Plane_3 h7 = construct_plane(s2,p4); + + typename R::Construct_triangle_3 construct_triangle + = rep.construct_triangle_3_object(); + Triangle_3 t1 = construct_triangle(); + Triangle_3 t2 = construct_triangle(p2,p3,p4); + + typename R::Construct_tetrahedron_3 construct_tetrahedron + = rep.construct_tetrahedron_object(); + Tetrahedron_3 th1 = construct_tetrahedron(); + Tetrahedron_3 th2 = construct_tetrahedron(p2,p3,p4,p5); + + typename R::Construct_aff_transformation_3 construct_aff_transformation + = rep.construct_aff_transformation_3_object(); + Aff_transformation_3 a1 = construct_aff_transformation(); + Aff_transformation_3 a2 = construct_aff_transformation(Translation(),v2); + Aff_transformation_3 a4 = construct_aff_transformation(Scaling(),5); + Aff_transformation_3 a41 = construct_aff_transformation(Scaling(),5,2); + Aff_transformation_3 a5 = + construct_aff_transformation(1,2,3,4,5,6,7,8,9,10,11,12); + Aff_transformation_3 a51 = + construct_aff_transformation(1,2,3,4,5,6,7,8,9,10,11,12,1); + Aff_transformation_3 a6 = + construct_aff_transformation(1,2,3,4,5,6,7,8,9); + Aff_transformation_3 a61 = + construct_aff_transformation(1,2,3,4,5,6,7,8,9,10); + + + typename R::Construct_point_on_3 construct_point_on + = rep.construct_point_on_3_object(); + Point_3 tmp1 = construct_point_on(l2); + + + typename R::Construct_second_point_on_3 construct_second_point_on + = rep.construct_second_point_on_3_object(); + Point_3 tmp2 = construct_second_point_on(r2); + + + typename R::Construct_perpendicular_plane_3 construct_perpendicular_plane + = rep.construct_perpendicular_plane_3(); + Plane_3 tmp3 = construct_perpendicular_plane(l2,p2); + + + typename R::Construct_midpoint_3 construct_midpoint + = rep.construct_midpoint_3_object(); + Point_3 tmp4 = construct_midpoint(p2,p3); + + + typename R::Construct_circumcenter_3 construct_circumcenter + = rep.construct_circumcenter_3_object(); + tmp4 = construct_circumcenter(p2,p3,p4,p5); + + + typename R::Construct_opposite_segment_3 construct_opposite_segment + = rep.construct_opposite_segment_3_object(); + Segment_3 tmp5 = construct_opposite_segment(s2); + + + typename R::Construct_opposite_ray_3 construct_opposite_ray + = rep.construct_opposite_ray_3_object(); + Ray_3 tmp6 = construct_opposite_ray(r2); + + + typename R::Construct_opposite_line_3 construct_opposite_line + = rep.construct_opposite_line_3_object(); + Line_3 tmp7 = construct_opposite_line(l2); + + + typename R::Construct_supporting_plane_3 construct_supporting_plane + = rep.construct_supporting_plane_3_object(); + Plane_3 tmp8 = construct_supporting_plane(t2); + + + typename R::Transform_3 transform + = rep.transform_3_object(); + Point_3 tmp9a = transform(p2,a2); + Triangle_3 tmp9b = transform(t2,a2); + + + typename R::Intersect_3 intersect + = rep.intersect_3_object(); + Object3 tmp10a = intersect(l2,h2); + Object3 tmp10b = intersect(r2,h2); + + bool tmp12a; + bool tmp12b; + + typename R::Assign_3 assign + = rep.assign_3_object(); + tmp12a = assign(p1,tmp10a); + tmp12b = assign(p1,tmp10b); + + + typename R::Compute_squared_length_3 compute_squared_length + = rep.compute_squared_length_3_object(); + FT tmp11 = compute_squared_length(s2); + + + typename R::Equal_3 equal + = rep.equal_3_object(); + tmp12a = equal(p2,p3); + tmp12b = equal(l2,l3); + + + typename R::Equal_x_3 equal_x + = rep.equal_x_3_object(); + bool tmp13 = equal_x(p2,p3); + + + typename R::Equal_y_3 equal_y + = rep.equal_y_3_object(); + bool tmp14 = equal_y(p2,p3); + + + typename R::Equal_z_3 equal_z + = rep.equal_z_3_object(); + bool tmp15 = equal_z(p2,p3); + + + typename R::Equal_xy_3 equal_xy + = rep.equal_xy_3_object(); + bool tmp16 = equal_xy(p2,p3); + + + typename R::Equal_xyz_3 equal_xyz + = rep.equal_xyz_3_object(); + bool tmp17 = equal_xyz(p2,p3); + + + typename R::Less_x_3 less_x + = rep.less_x_3_object(); + bool tmp18 = less_x(p2,p3); + + + typename R::Less_y_3 less_y + = rep.less_y_3_object(); + bool tmp19 = less_y(p2,p3); + + + typename R::Less_z_3 less_z + = rep.less_z_3_object(); + bool tmp20 = less_z(p2,p3); + + + typename R::Less_xy_3 less_xy + = rep.less_xy_3_object(); + bool tmp21 = less_xy(p2,p3); + + + typename R::Less_xyz_3 less_xyz + = rep.less_xyz_3_object(); + bool tmp22 = less_xyz(p2,p3); + + + typename R::Compare_x_3 compare_x + = rep.compare_x_3_object(); + Comparison_result tmp23 = compare_x(p2,p3); + + + typename R::Compare_y_3 compare_y + = rep.compare_y_3_object(); + Comparison_result tmp24 = compare_y(p2,p3); + + + typename R::Compare_z_3 compare_z + = rep.compare_z_3_object(); + Comparison_result tmp25 = compare_z(p2,p3); + + + typename R::Compare_xy_3 compare_xy + = rep.compare_xy_3_object(); + Comparison_result tmp26 = compare_xy(p2,p3); + + + typename R::Compare_xyz_3 compare_xyz + = rep.compare_xyz_3_object(); + Comparison_result tmp27 = compare_xyz(p2,p3); + + typename R::Less_distance_to_point_3 less_distance_to_point + = rep.less_distance_to_point_3_object(p4); + bool tmp28 = less_distance_to_point(p2,p3); + + + typename R::Collinear_3 collinear + = rep.collinear_3_object(); + bool tmp29 = collinear(p2,p3,p4); + + + typename R::Coplanar_3 coplanar + = rep.coplanar_3_object(); + bool tmp30 = coplanar(p2,p3,p4,p5); + + + typename R::Orientation_3 orientation + = rep.orientation_3_object(); + Orientation tmp31 = orientation(p2,p3,p4,p5); + + + typename R::Is_degenerate_3 is_degenerate + = rep.is_degenerate_3_object(); + bool tmp32 = is_degenerate(l2); + + + typename R::Has_on_3 has_on + = rep.has_on_3_object(); + bool tmp33a = has_on(l2,p2); + bool tmp33b = has_on(t2,p2); + + + typename R::Has_on_bounded_side_3 has_on_bounded_side + = rep.has_on_bounded_side_3_object(); + bool tmp34 = has_on_bounded_side(th2,p2); + + + typename R::Has_on_unbounded_side_3 has_on_unbounded_side + = rep.has_on_unbounded_side_3_object(); + bool tmp35 = has_on_unbounded_side(th2,p2); + + + typename R::Has_on_boundary_3 has_on_boundary + = rep.has_on_boundary_3_object(); + bool tmp36a = has_on_boundary(h2,p2); + bool tmp36b = has_on_boundary(th2,p2); + + + typename R::Has_on_positive_side_3 has_on_positive_side + = rep.has_on_positive_side_3_object(); + bool tmp37 = has_on_positive_side(h2,p2); + + + typename R::Has_on_negative_side_3 has_on_negative_side + = rep.has_on_negative_side_3_object(); + bool tmp38 = has_on_negative_side(h2,p2); + + + typename R::Oriented_side_3 oriented_side + = rep.oriented_side_3_object(); + Oriented_side tmp39 = oriented_side(h2,p2); + + + typename R::Are_ordered_along_line_3 are_ordered_along_line + = rep.are_ordered_along_line_3_object(); + bool tmp40 = are_ordered_along_line(p2,p3,p4); + + + typename R::Are_strictly_ordered_along_line_3 are_strictly_ordered_along_line + = rep.are_strictly_ordered_along_line_3_object(); + bool tmp41 = are_strictly_ordered_along_line(p2,p3,p4); + + + typename R::Collinear_are_ordered_along_line_3 collinear_are_ordered_along_line + = rep.collinear_are_ordered_along_line_3_object(); + bool tmp42 = collinear_are_ordered_along_line(p2,p2,p3); + + + typename R::Collinear_are_strictly_ordered_along_line_3 collinear_are_strictly_ordered_along_line + = rep.collinear_are_strictly_ordered_along_line_3_object(); + bool tmp43 = collinear_are_strictly_ordered_along_line(p2,p2,p3); + + + typename R::Side_of_oriented_sphere_3 side_of_oriented_sphere + = rep.side_of_oriented_sphere_3_object(); + Oriented_side tmp44 = side_of_oriented_sphere(p2,p3,p4,p5,p6); + + + typename R::Side_of_bounded_sphere_3 side_of_bounded_sphere + = rep.side_of_bounded_sphere_3_object(); + Bounded_side tmp45 = side_of_bounded_sphere(p2,p3,p4,p5,p6); + + use(tmp45); use(tmp44); use(tmp43); use(tmp42); use(tmp41); use(tmp40); + use(tmp39); use(tmp38); use(tmp37); use(tmp36b); use(tmp36a); use(tmp35); + use(tmp34); use(tmp33b); use(tmp33a); use(tmp32); use(tmp31); use(tmp30); + use(tmp29); use(tmp27); use(tmp25); use(tmp24); use(tmp23); use(tmp22); + use(tmp15); use(tmp14); use(tmp13); use(tmp12b); use(tmp12a); + use(tmp16); use(tmp17); use(tmp18); use(tmp19); use(tmp20); use(tmp21); + use(tmp26); use(tmp28); + + + return true; +} + +#endif // CGAL_TEST_NEW_3_H diff --git a/Packages/Kernel_23/test/Kernel/include/CGAL/_test_orientation_and_bounded_side.h b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_orientation_and_bounded_side.h new file mode 100644 index 00000000000..5632c7a1a49 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/include/CGAL/_test_orientation_and_bounded_side.h @@ -0,0 +1,42 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : +// file : _test_orientation_and_bounded_side.h +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL__TEST_ORIENTATION_AND_BOUNDED_SIDE_H +#define CGAL__TEST_ORIENTATION_AND_BOUNDED_SIDE_H + +#include +#include + + +template +bool +_test_orientation_and_bounded_side(const R&); + + +#ifdef CGAL_CFG_NO_AUTOMATIC_TEMPLATE_INCLUSION +#include +#endif // CGAL_CFG_NO_AUTOMATIC_TEMPLATE_INCLUSION + +#endif // CGAL__TEST_ORIENTATION_AND_BOUNDED_SIDE_H diff --git a/Packages/Kernel_23/test/Kernel/makefile b/Packages/Kernel_23/test/Kernel/makefile new file mode 100644 index 00000000000..d42547ba387 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/makefile @@ -0,0 +1,56 @@ +# Created by the script create_makefile +# This is the makefile for compiling a CGAL application. + +#---------------------------------------------------------------------# +# include platform specific settings +#---------------------------------------------------------------------# +# Choose the right include file from the /make directory. +include $(CGAL_MAKEFILE) +#include /KM/projects/CGAL/Work_in_Progress/CGAL-2.1-I-32/make/makefile_sparc_SunOS-5.6_g++-2.95.2_LEDA++ +#include /KM/projects/CGAL/Work_in_Progress/CGAL-2.1-I-39/make/makefile_sparc_SunOS-5.6_g++-2.95.2_LEDA++ + +#---------------------------------------------------------------------# +# compiler flags +#---------------------------------------------------------------------# + +CXXFLAGS = \ + $(TESTSUITE_CXXFLAGS) \ + $(EXTRA_FLAGS) \ + -Iinclude \ + $(CGAL_CXXFLAGS) \ + $(DEBUG_OPT) + +# -DCGAL_NO_LEDA_HANDLE \ + +#---------------------------------------------------------------------# +# linker flags +#---------------------------------------------------------------------# + +LIBPATH = \ + $(TESTSUITE_LIBPATH) \ + $(CGAL_LIBPATH) + +LDFLAGS = \ + $(TESTSUITE_LDFLAGS) \ + $(CGAL_LDFLAGS) + +#---------------------------------------------------------------------# +# target entries +#---------------------------------------------------------------------# + +all: \ + test_kernel__ + +test_kernel__$(EXE_EXT): test_kernel__$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_kernel__ test_kernel__$(OBJ_EXT) $(LDFLAGS) + +clean: \ + test_kernel__.clean + +#---------------------------------------------------------------------# +# suffix rules +#---------------------------------------------------------------------# + +.C$(OBJ_EXT): + $(CGAL_CXX) $(CXXFLAGS) $(OBJ_OPT) $< + diff --git a/Packages/Kernel_23/test/Kernel/test_kernel__.C b/Packages/Kernel_23/test/Kernel/test_kernel__.C new file mode 100644 index 00000000000..6c896504b95 --- /dev/null +++ b/Packages/Kernel_23/test/Kernel/test_kernel__.C @@ -0,0 +1,75 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_kernel_programs.fw +// file : test_kernel__.C +// revision : 3.8 +// revision_date : 08 Oct 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include +#ifdef CGAL_USE_GMP +#include +#endif // CGAL_USE_GMP +#include +#include +#include +#include +#include +#include +#include +#ifdef CGAL_USE_LEDA +#include +#endif // CGAL_USE_LEDA + +int +main() +{ + std::cout << "Testing miscellanous" << std::endl; +#ifdef CGAL_USE_GMP + typedef CGAL::Gmpz Precise_integer; +#else +# ifdef CGAL_USE_LEDA + typedef leda_integer Precise_integer; +# endif // CGAL_USE_LEDA +#endif // CGAL_USE_GMP + typedef CGAL::Homogeneous H_Cls; + typedef CGAL::Cartesian > C_Cls; + typedef CGAL::Simple_cartesian > S_Cls; + _test_cls_object( C_Cls() ); + _test_cls_object( H_Cls() ); + _test_cls_object( S_Cls() ); + _test_cls_quotient( int(1) ); + _test_cls_quotient( double(1.0) ); + _test_cls_quotient( long(1) ); + _test_cls_quotient( short(1) ); + _test_fct_determinant( Precise_integer(1) ); + _test_fct_point_conversion( int(1) ); + _test_fct_point_conversion( double(1.0) ); +#ifdef CGAL_USE_GMP + _test_cls_quotient( CGAL::Gmpz(1) ); + _test_fct_point_conversion( CGAL::Gmpz(1) ); +#endif // CGAL_USE_GMP +#ifdef CGAL_USE_LEDA + _test_cls_quotient( leda_integer(1) ); + _test_fct_point_conversion( leda_integer(1) ); +#endif // CGAL_USE_LEDA + return 0; +} diff --git a/Packages/Number_types/changes.txt b/Packages/Number_types/changes.txt new file mode 100644 index 00000000000..f6a914e3f0e --- /dev/null +++ b/Packages/Number_types/changes.txt @@ -0,0 +1,417 @@ +4.2 (13 Dec 00) + +- #inlcude replaced by #include in src/Double.C + in order to fix a bug with building libCGAL + +4.1 (10 Dec 00) + +- test_to_interval corrected as suggested by Sylvain +- #include added to CGAL/number_type_basics.h +- #include removed from CGAL/leda_bigfloat.h +- #include removed from CGAL/leda_integer.h +- #include removed from CGAL/leda_rational.h +- #include removed from CGAL/leda_real.h +- #include removed from CGAL/Gmpz.h +- #include removed from CGAL/Quotient.h +- to_interval() added in Int.h for short, int, long and long long + the code for long and long long is problematic +- In Quotient.h: + #include moved outside #ifndef ... #define ...QUOTIENT... + +4.0 (26 Nov 00) + +- to_interval() added for Gmpz +- to_interval() added for Quotient +- to_interval() added for leda_bigfloat +- to_interval() added for leda_integer +- to_interval() added for leda_rational +- to_interval() added for leda_real +- to_interval() added for double +- to_interval() added for float +- test for to_interval added to test suite + +3.4 (13 Jul 00) + +- todouble() replaced by to_double() for leda_integer and + leda_rational + +3.3 (27 Jun 00) + +- CGAL:: replaced by CGAL_NTS with sign in number_utils.h + +3.2 (08 Jun 00) + +- CGAL_NTS used +- is_integral(double) added to double.h + +3.1 (30 May 00) + +- min and max are now handled in + (by using std::min; ... ) + +3.0 (25 May 00) + +- namespace CGAL::NTS introduced + templates from moved there + smooth transition phase with warning about unused variable + e.g. inline bool is_zero(const NT& x) + { + #ifndef CGAL_NO_NTS_NAMESPACE + bool is_zero_is_obsolete__qualify_call_by_CGAL_NTS; + #endif // CGAL_NO_NTS_NAMESPACE + return x == NT(0); + } + + +2.7.2 (18 Apr 00) + +- sized_integer.h revised leading _s removed + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 2. 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +2.7 -> 2.7.1 (04 Dec 99) +- CGAL_CLIB_STD used in and +- dito in + +2.6.6 -> 2.7 (04 Dec 99) +- long long removed from + definitions are now in + +2.6.5 -> 2.6.6 (22 Nov 99) +- added !=0 to mask tests in double.h and float.h as suggested + by Oren. Gives a performance warning on M$VC++ otherwise. Although + I think performance is now worse than before + +2.6.4 -> 2.6.5 (20 Nov 99) +- Quotient::normalize() removed (as suggested by Dima to + please Borland) + +2.6.3 -> 2.6.4 (16 Nov 99) +- typedef modified in Quotient.C + +2.6.2 -> 2.6.3 (14 Nov 99) +- some NumberType() replaced by NT() and a typedef + NumberType NT to please Borland + +2.6.1 -> 2.6.2 (02 Nov 99) +- typedef in Quotient class used for NumberType + to workaround Borland problem + +2.6 -> 2.6.1 (28 Oct 99) +- test for __BORLANDC__ added to double.h and float.h + +2.5.6 -> 2.6 (28 Oct 99) +- CGAL::max and CGAL::min revived + +2.5.5 -> 2.5.6 (25 Oct 99) +- substitution bugs fixed :) QUOTIENumberType_H + +2.5.4 -> 2.5.5 (18 Oct 99) +- NT template parameter renamed to NumberType in Quotient + to please Borland :) +- to_double() qualified in leda_bigfloat.h + +2.5.3 -> 2.5.4 (13 Oct 99) +- show(p) removed in double.h (left over from testing phase) +- #include moved out of namespace CGAL + +2.5.2 -> 2.5.3 (12 Oct 99) +- #include added to double.h and float.h + +2.5.1 -> 2.5.2 (12 Oct 99) +- #include added to IEEE_754_unions.h + +2.5 -> 2.5.1 (11 Oct 99) +- modified is_[valid|finite](); version using bitoperations + implemented and activated for _MSC_VER + can be activated also by -DCGAL_MASK_FINITE_VALID +- IEEE_754_unions.h added + +2.4.3 -> 2.5 (08 Oct 99) +- modified _test_valid_finite.C: added std:: to sqrt(double) +- modified IEEE_double::show() to use C++ iostream stuff + #include added +- removed / from /rm in cgal_test :) +- new makefile created +- _test_valid_finite split into two tests, one for double + one for float +- is_[valid|finite]() on SGI revised +- test quotient_io.C revised + +2.4.2 -> 2.4.3 (08 Oct 99) +- locale problem (isdigit) in Gmpz.h fixed (missing flag) + +2.4.1 -> 2.4.2 (08 Oct 99) +- std::classic -> std::locale::classic in Quotient, Gmpz + +2.4 -> 2.4.1 (05 Oct 99) +- include iterator_traits_pointer_specs_for_cartesian_quotient.h + added to Quotient.h +- test/NumberTypeSupport/include/CGAL/Ieee_double.h modified +- in cgal_test, '/bin' removed + +2.3.5 -> 2.4 (17 Sep 99) +- inline double sqrt(double d) { return std::sqrt(d); } + added to double.h +- inline leda_real sqrt(const leda_real & r) { return ::sqrt(r); } + added to leda_real.h + +2.3.4 -> 2.3.5 (02 Sep 99) +- added std::classic() as second argument to isspace(), isdigit() + cf. locale -- flagged by CGAL_CFG_NO_LOCALE + +2.3.3 -> 2.3.4 (01 Sep 99) +- added std:: to isspace and isdigit in Gmpz and Quotient + +2.3.2 -> 2.3.3 (31 Aug 99) +- test _test_valid_finite() modified such that it shows me the bits + if certain tests fail + +2.3.1 -> 2.3.2 (19 Aug 99) +- test file quotient_io.C updated for std:: ... + +2.3 -> 2.3.1 (06 Aug 99) +- makefile updated: $(OBJ_EXT) + +2.2.1 -> 2.3 (04 Aug 99) +- Quotient.h revised for gcc-2.95: + num and den made public in order to make all friends non-friends + +2.2 -> 2.2.1 (09 Jul 99) +- CGAL::compare(leda_real, ...) made inline + +2.1.5 -> 2.2 (26 Jun 99) +- #include added to + +- delete replaced by delete[] in Gmpz.h in ostream operator + (detected by Sylvain using purify) +- CGAL_ added to CHECK_... in Gmpz.h + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 2. 0 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +2.1.4 -> 2.1.5 (09 May 99) +- placement of CGAL_KERNEL_INLINE corrected in Quotient.h (caused a warning) + +2.1.3 -> 2.1.4 (02 May 99) +- flag CGAL_NO_NAMESPACE corrected in + +2.1.2 -> 2.1.3 (28 Apr 99) +- fix for change in 2.1.1 + +2.1.1 -> 2.1.2 (28 Apr 99) +- version number updated + +2.1 -> 2.1.1 (28 Apr 99) +- used special code for __sgi for is_[finite|valid]() +- define abs specialisation only if namespaces are supported + +2.0.13-> 2.1 (16 Apr 99) +- iostream parts prefixed by std:: +- CGAL::compare(leda_real, leda_real) added + +2.0.12-> 2.0.13 (06 Apr 99) +- flag CGAL_NO_QUOTIENT_INT_FRIENDS added to ease removing friend declarations + from specialisation Quotient. These friend declarations cause problems + with latest egcs snapshots as reported by Sylvain. + +2.0.11-> 2.0.12 (30 Mar 99) +- to_double encapsualted in #ifndef CGAL_NO_NAMESPACE for + bigfloat, integer, real, rational from LEDA + +2.0.10-> 2.0.11 (30 Mar 99) +- sign() prefixed in lexicographical_sign() defined in +- CGAL_NO_STL_PROVIDED_REL_OPS defined in for g++-2.8. + +2.0.9 -> 2.0.10 (28 Mar 99) +- inclusion of std files , ... moved out of namespace CGAL + +2.0.8 -> 2.0.9 (25 Mar 99) +- to_double() calls in Quotient::to_double 'prefixed' by CGAL:: + +2.0.7 -> 2.0.8 (23 Mar 99) +- flag CGAL_NO_NAMESPACE corrected :) + +2.0.6 -> 2.0.7 (20 Mar 99) +- flag CGAL_NO_NAMESPACE corrected + +2.0.5 -> 2.0.6 (15 Mar 99) +- fabs prefixed with std:: in Double.C + +2.0.4 -> 2.0.5 (14 Mar 99) +- min()/max() removed from ; + use std::min/max instead; defined in + included in . +- std::min, std::max used in +- 'public std::' replaced by 'public CGAL_STD::' in +- #ifdef CGAL_INTERVAL_ARITHMETIC_H + #include + #endif // CGAL_INTERVAL_ARITHMETIC_H + added to +- #include moved to front in and + +2.0.3 -> 2.0.4 (02 Mar 99) +- sign encapsulated in #ifndef CGAL_NO_NAMESPACES for + leda_[integer|rational|real] and global scope operator + added to call of sign in function definition. + +2.0.2 -> 2.0.3 (25 Feb 99) +- CGAL_[BEGIN|END]_NAMESPACE used +- CGAL:: added to sign()-calls in + quotient_cmp(const Quotient& x, const Quotient& y) + +2.0.1 -> 2.0.2 (16 Feb 99) +- std:: added to unary/binary_function in + +2.0 -> 2.0.1 (11 Feb 99) +- #ifdef CGAL_PROVIDE_STL_PROVIDED_REL_OPS changed to + #ifndef CGAL_NO_STL_PROVIDED_REL_OPS in , + thereby defining >, >=, <=, and != by default now. +- sign() defintion for leda_integer removed from + +1.6 -> 2.0 +- namespace CGAL { } introduced +- inclusion of removed from +- inclusion of added to + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 1 . 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +1.5.4 -> 1.6 +- bug (memory leak) in CGAL_Gmpz corrected: + e.g.: CGAL_Gmpz_rep* Res = new CGAL_Gmpz_rep(); + mpz_add(Res->mpZ, ptr()->mpZ, z.ptr()->mpZ); + return CGAL_Gmpz(Res); + now replaces + mpz_t res; // <- limb not cleared !!! + mpz_init(res); + mpz_add(res, ptr()->mpZ, z.ptr()->mpZ); + return CGAL_Gmpz(res); + + +1.5.3 -> 1.5.4 +- test order modified in _test_valid_finite.C + +1.5.2 -> 1.5.3 +- include added to + such that CGAL_Sign is known in files including the latter, e.g + + +1.5.1 -> 1.5.2 +- CGAL_sign() specialized for leda_[integer|rational|real] + _test_sign.C added + +1.5 -> 1.5.1 +- CGAL_square() and struct CGAL_Square added + +1.4.5 -> 1.5 +- Use of CGAL...INLINE made consistent between declarations and + definitions (otherwise SunPro CC 4.2 does not like it). + +1.4.4 -> 1.4.5 +- return type of Gmpz::sign() and CGAL_Sign(Gmpz) changed to CGAL_Sign + +1.4.3 -> 1.4.4 +- return true; added in <_test_valid_finite.C> + +1.4.2 -> 1.4.3 +- CGAL_KERNEL_INLINE replaced by inline for CGAL_abs(double) + +1.4.1 -> 1.4.2 +- CGAL_sign now returns a CGAL_Sign instead of an int + affects and +- specialisation for CGAL_abs(double) (uses fabs()) added to + +1.4 -> 1.4.1 +- added to package + +1.3 -> 1.4 +- valid(d) and finite(d) defined inline in double.h as + { return (d == d); } and { return (d == d) && (CGAL_is_valid(d-d)); } + respectively, unless flag CGAL_OLD_FINITE_VALID is defined, which restores + the old situation +- same for float in float.h +- Double.C and Float.C in CGAL/src modified accordingly. +- comments with definitions of CGAL_abs(), CGAL_numerator(), CGAL_denominator() + removed from double.h and float.h +- DOUBLECOMP_H replaced by CGAL_DOUBLE_H in double.h + +1.2.8 -> 1.3 +- include statements for added + for Gmpz, leda_integer, leda_real, leda_bigfloat, and leda_rational + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 1 . 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +1.2.7 -> 1.2.8 +- correction for CGAL_PROVIDE_STL_PROVIDED_REL_OPS in Quotient.h + +1.2.6 -> 1.2.7 +- operator?( Quotient, NT ) and operator?( NT, Quotient) + for ? in { !=, >, >=, <= } put in + #ifdef CGAL_PROVIDE_STL_PROVIDED_REL_OPS +- buglet in doc fixed: operators +=, -=, *=, /= are now required + to return NT ( not bool as before) + +1.2.5 -> 1.2.6 +- bug in CGAL_is_one() fixed +- missing leda_-prefix in operator/= added + +1.2.4 -> 1.2.5 +- workaround for missing operator/= for leda_real added +- io_tags() for unsigned types added + +1.2.3 -> 1.2.4 +- rearranged order of definitions in Quotient.h to please + Borland C++ (specialization for int is now at the end of + Quotient.h) +- made input operator for Quotient more flexible: accepts now + also format ` num ' besides ` num/den '. + +1.2.2 -> 1.2.3 +- +=, -=, /= added for Gmpz + +1.2.1 -> 1.2.2 +- CGAL_CFG_NO_STL_PROVIDED_COMPARISONS renamed to + (!) CGAL_PROVIDE_STL_PROVIDED_REL_OPS in Quotient. + As a consequence of this, the rel ops defined as templates + in in namespace rel_ops nested in namespace std + are no longer defined (nor declared) by default for Quotient. + +1.2 -> 1.2.1 +- inline and CGAL_KERNEL_INLINE added to declaration of function + templates + +1.1.4 -> 1.2 +- made fit for egcs + uses CGAL_TEMPLATE_NULL macro with explicit specialization + +1.1.3 -> 1.1.4 +- inclusion of number_utils_classes.h postponed + +1.1.2 -> 1.1.3 +- CGAL_CFG_NO_STL_PROVIDED_COMPARISONS added in Quotient.h to reduce + problems with g++2.7.2.3 with early inclusion of function.h + +1.1.1 -> 1.1.2 +- inconsistencies between file names removed (double.h - float.h) in + Double.C, Float.C, Double_eps.C + +1.1 -> 1.1.1 +- number_utils_classes.h (written by Michael Hoffmann) added to the + package + +1.0 -> 1.1 +- Geert-Jan's new version of Double.C and Float.C added (including + testsuite) +- Quotient has now a specialisation for int and hence no more + problems with ambigous ctors +- operator<<(ostream, Quotient) is no longer a friend of the + class -> egcs compiles the kernel test if called with -fguided-decls + +0.9 -> 1.0 +- files not defining a new class start with lower case letters now + e.g. Int.h -> int.h + gnu_Integer.h -> gnu_integer.h +- furthermore leda number types got a prefix, + e.g. Integer.h -> leda_integer.h +- leda_bigloat support added +- new inline policy + diff --git a/Packages/Number_types/description.txt b/Packages/Number_types/description.txt new file mode 100644 index 00000000000..b78bbf78011 --- /dev/null +++ b/Packages/Number_types/description.txt @@ -0,0 +1 @@ +number type support diff --git a/Packages/Number_types/include/CGAL/Double_eps.h b/Packages/Number_types/include/CGAL/Double_eps.h new file mode 100644 index 00000000000..00682ae82c0 --- /dev/null +++ b/Packages/Number_types/include/CGAL/Double_eps.h @@ -0,0 +1,207 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 13 +// +// source : Double_eps.fw +// file : Double_eps.h +// package : Number_types (4.2) +// maintainer : Stefan Schirra +// revision : 4.2 +// revision_date : 13 Dec 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_DOUBLE_EPS_H +#define CGAL_DOUBLE_EPS_H + +#ifndef CGAL_DOUBLE_H +#include +#endif // CGAL_DOUBLE_H +#ifndef CGAL_NUMBER_UTILS_H +#include +#endif // CGAL_NUMBER_UTILS_H + +CGAL_BEGIN_NAMESPACE + + +class Double_eps +{ +friend double set_eps(double eps); +friend std::istream& operator>>(std::istream&, Double_eps& ); +friend std::ostream& operator<<(std::ostream&, const Double_eps& ); + +public: + Double_eps() + : _d(0.0) + {} + + Double_eps(double d) + : _d(d) + {} + + double d() const + { + return _d; + } + + double eps() const + { + return _eps; + } + + operator double() const + { + return _d; + } + + Double_eps operator+(const Double_eps &de) const + { + return Double_eps(_d + de._d); + } + + Double_eps operator-(const Double_eps &de) const + { + return Double_eps(_d - de._d); + } + + Double_eps operator-() const + { + return Double_eps(-_d); + } + + Double_eps operator*(const Double_eps &de) const + { + return Double_eps(_d * de._d); + } + + Double_eps operator/(const Double_eps &de) const + { + return Double_eps(_d / de._d); + } + + Double_eps& operator+=(const Double_eps &de) + { + _d += de._d; + return *this; + } + + Double_eps& operator-=(const Double_eps &de) + { + _d -= de._d; + return *this; + } + + Double_eps& operator*=(const Double_eps &de) + { + _d *= de._d; + return *this; + } + + Double_eps& operator/=(const Double_eps &de) + { + _d /= de._d; + return *this; + } + + bool operator==(const Double_eps &de) const + { + return CGAL_NTS abs(_d - de._d) <= _eps; + } + + bool operator!=(const Double_eps &de) const + { + return !(*this == de); + } + + bool operator<(const Double_eps &de) const + { + if (*this == de) { + return false; + } + return _d < de._d; + } + + bool operator>(const Double_eps &de) const + { + if (*this == de) { + return false; + } + return _d > de._d; + } + + bool operator<=(const Double_eps &de) const + { + if (*this == de) { + return true; + } + return _d <= de._d; + } + + bool operator>=(const Double_eps &de) const + { + if (*this == de) { + return true; + } + return _d >= de._d; + } + +private: + double _d; + static double _eps; +}; + +inline bool is_valid(const Double_eps &de) + { + return is_valid(de.d()); + } + +inline bool is_finite(const Double_eps &de) + { + return is_finite(de.d()); + } + +inline double to_double(const Double_eps &de) + { + return de.d(); + } + +inline Double_eps numerator(const Double_eps &d) +{ + return d; +} + +inline Double_eps denominator(const Double_eps &) +{ + return Double_eps(1.0); +} + +inline Number_tag number_type_tag(const Double_eps &) +{ + return Number_tag(); +} + +inline io_Operator io_tag(const Double_eps &) +{ + return io_Operator(); +} + +extern double set_eps(double eps); + +extern std::ostream &operator<<(std::ostream& os, const Double_eps &); + +CGAL_END_NAMESPACE + +#endif // CGAL_DOUBLE_EPS_H + diff --git a/Packages/Number_types/include/CGAL/Gmpz.h b/Packages/Number_types/include/CGAL/Gmpz.h new file mode 100644 index 00000000000..07ef9ad3f6a --- /dev/null +++ b/Packages/Number_types/include/CGAL/Gmpz.h @@ -0,0 +1,630 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 13 +// +// source : Gmpz.fw +// file : Gmpz.h +// package : Number_types (4.2) +// maintainer : Stefan Schirra +// revision : 4.2 +// revision_date : 13 Dec 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_GMPZ_H +#define CGAL_GMPZ_H + + +#ifndef CGAL_BASIC_H +#include +#endif // CGAL_BASIC_H +#ifndef CGAL_CFG_NO_LOCALE +#include +#else +#include +#endif // CGAL_CFG_NO_LOCALE +#include + +CGAL_BEGIN_NAMESPACE + +class Gmpz_rep : public Rep +{ +public: + mpz_t mpZ; + + Gmpz_rep() + // { mpz_init_set_si(mpZ, 0); } + { mpz_init(mpZ); } + + Gmpz_rep(mpz_t z) + { mpz_init_set(mpZ, z); } + + Gmpz_rep(int si) + { mpz_init_set_si(mpZ, si); } + + Gmpz_rep(long li) + { mpz_init_set_si(mpZ, li); } + + Gmpz_rep(unsigned long li) + { mpz_init_set_ui(mpZ, li); } + + Gmpz_rep(double d) + { mpz_init_set_d(mpZ, d); } + + Gmpz_rep(char* str) + { mpz_init_set_str(mpZ, str, 10); } + + Gmpz_rep(char* str, int base) + { mpz_init_set_str(mpZ, str, base); } + + ~Gmpz_rep() + { mpz_clear(mpZ); } +}; + +CGAL_END_NAMESPACE + + + +CGAL_BEGIN_NAMESPACE + +class Gmpz; + +class Gmpz : public Handle +{ +public: + Gmpz(); + + Gmpz(const Gmpz &z); + + Gmpz(mpz_t z); + + Gmpz(int i); + + Gmpz(long l); + + Gmpz(unsigned long l); + + Gmpz(double d); + + Gmpz(char* str); + Gmpz(char* str, int base); + + Gmpz(Gmpz_rep* R); + + ~Gmpz(); + + Gmpz &operator=(const Gmpz &z); + + bool operator==(const Gmpz &z) const; + bool operator==(int i) const; + + bool operator!=(const Gmpz &z) const; + bool operator!=(int i) const; + + bool operator<(const Gmpz &z) const; + bool operator<(int i) const; + + bool operator<=(const Gmpz &z) const; + bool operator<=(int i) const; + + bool operator>(const Gmpz &z) const; + bool operator>(int i) const; + + bool operator>=(const Gmpz &z) const; + bool operator>=(int i) const; + + Gmpz operator-() const; + + Gmpz operator+(const Gmpz &z) const; + Gmpz operator+(int i) const; + + Gmpz operator-(const Gmpz &z) const; + Gmpz operator-(int i) const; + + Gmpz operator*(const Gmpz &z) const; + Gmpz operator*(int i) const; + + Gmpz operator/(const Gmpz &z) const; + Gmpz operator/(int i) const; + + Gmpz& operator+=(const Gmpz &z); + Gmpz operator+=(int i); + + Gmpz& operator-=(const Gmpz &z); + Gmpz operator-=(int i); + + Gmpz& operator*=(const Gmpz &z); + Gmpz operator*=(int i); + + Gmpz& operator/=(const Gmpz &z); + Gmpz operator/=(int i); + + size_t approximate_decimal_length() const; + + Gmpz_rep* ptr() const; + double to_double() const; + Sign sign() const; +}; + + +inline +Gmpz_rep* +Gmpz::ptr() const +{ return (Gmpz_rep*) PTR; } + +inline // CGAL_KERNEL_CTOR_INLINE +Gmpz::Gmpz() +{ PTR = new Gmpz_rep(0); } + +inline // CGAL_KERNEL_CTOR_INLINE +Gmpz::Gmpz(const Gmpz &z) + : Handle((Handle&)z) +{} + +inline // CGAL_KERNEL_CTOR_INLINE +Gmpz::Gmpz(mpz_t z) +{ std::cout << "OLD construction called"; PTR = new Gmpz_rep(z); } + +inline // CGAL_KERNEL_CTOR_INLINE +Gmpz::Gmpz(int i) +{ PTR = new Gmpz_rep(i); } + +inline // CGAL_KERNEL_CTOR_INLINE +Gmpz::Gmpz(long l) +{ PTR = new Gmpz_rep(l); } + +inline // CGAL_KERNEL_CTOR_INLINE +Gmpz::Gmpz(unsigned long l) +{ PTR = new Gmpz_rep(l); } + +inline // CGAL_KERNEL_CTOR_INLINE +Gmpz::Gmpz(double d) +{ PTR = new Gmpz_rep(d); } + +inline // CGAL_KERNEL_CTOR_INLINE +Gmpz::Gmpz(char* str) +{ PTR = new Gmpz_rep(str); } + +inline // CGAL_KERNEL_CTOR_INLINE +Gmpz::Gmpz(char* str, int base) +{ PTR = new Gmpz_rep(str, base); } + +inline // CGAL_KERNEL_CTOR_INLINE +Gmpz::Gmpz(Gmpz_rep* R) +{ PTR = R; } + +inline +Gmpz::~Gmpz() +{} + +inline +Gmpz & +Gmpz::operator=(const Gmpz &z) +{ + Handle::operator=(z); + return *this; +} + +inline +bool +Gmpz::operator==(const Gmpz &z) const +{ return ( mpz_cmp(ptr()->mpZ, z.ptr()->mpZ) == 0 ); } + +inline +bool +Gmpz::operator<(const Gmpz &z) const +{ return ( mpz_cmp(ptr()->mpZ, z.ptr()->mpZ) < 0 ); } + +inline +bool +Gmpz::operator<(int i) const +{ return ( mpz_cmp_si(ptr()->mpZ, i) < 0 ); } + +inline +bool /* XXX */ +Gmpz::operator<=(const Gmpz &z) const +{ return ( mpz_cmp(ptr()->mpZ, z.ptr()->mpZ) <= 0 ); } + + +inline +bool +Gmpz::operator<=(int i) const +{ return ( mpz_cmp_si(ptr()->mpZ, i) <= 0 ); } + +inline +bool /* XXX */ +Gmpz::operator>(const Gmpz &z) const +{ return ( mpz_cmp(ptr()->mpZ, z.ptr()->mpZ) > 0 ); } + +inline +bool +Gmpz::operator>(int i) const +{ return ( mpz_cmp_si(ptr()->mpZ, i) > 0 ); } + +inline +bool /* XXX */ +Gmpz::operator>=(const Gmpz &z) const +{ return ( mpz_cmp(ptr()->mpZ, z.ptr()->mpZ) >= 0 ); } + +inline +bool +Gmpz::operator>=(int i) const +{ return ( mpz_cmp_si(ptr()->mpZ, i) >= 0 ); } + +inline +bool /* XXX */ +Gmpz::operator!=(const Gmpz &z) const +{ return ! (*this == z); } + +inline +bool +Gmpz::operator==(int i) const +{ return ( mpz_cmp_si(ptr()->mpZ, i) == 0 ); } + +inline +bool +Gmpz::operator!=(int i) const +{ return ! (*this == i); } + +inline +Gmpz +Gmpz::operator-() const +{ + Gmpz_rep* Res = new Gmpz_rep(); + mpz_neg(Res->mpZ, ptr()->mpZ); + return Gmpz(Res); +} + +inline +Gmpz +Gmpz::operator+(const Gmpz &z) const +{ + Gmpz_rep* Res = new Gmpz_rep(); + mpz_add(Res->mpZ, ptr()->mpZ, z.ptr()->mpZ); + return Gmpz(Res); +} + +inline +Gmpz +Gmpz::operator+(int i) const +{ + if (i>0) + { + Gmpz_rep* Res = new Gmpz_rep(); + mpz_add_ui(Res->mpZ, ptr()->mpZ, i); + return Gmpz(Res); + } + return *this + Gmpz(i); +} + +inline +Gmpz& +Gmpz::operator+=(const Gmpz &z) +{ + *this = *this + z; + return *this; +} + +inline +Gmpz +Gmpz::operator+=(int i) +{ + *this = *this + Gmpz(i); + return *this; +} + +inline +Gmpz +Gmpz::operator-(const Gmpz &z) const +{ + Gmpz_rep* Res = new Gmpz_rep(); + mpz_sub(Res->mpZ, ptr()->mpZ, z.ptr()->mpZ); + return Gmpz(Res); +} + +inline +Gmpz Gmpz::operator-(int i) const +{ + if (i>0) + { + Gmpz_rep* Res = new Gmpz_rep(); + mpz_sub_ui(Res->mpZ, ptr()->mpZ, i); + return Gmpz(Res); + } + return *this - Gmpz(i); +} + +inline +Gmpz& +Gmpz::operator-=(const Gmpz &z) +{ + *this = *this - z; + return *this; +} + +inline +Gmpz +Gmpz::operator-=(int i) +{ + *this = *this - Gmpz(i); + return *this; +} + +inline +Gmpz +Gmpz::operator*(const Gmpz &z) const +{ + Gmpz_rep* Res = new Gmpz_rep(); + mpz_mul(Res->mpZ, ptr()->mpZ, z.ptr()->mpZ); + return Gmpz(Res); +} + +inline +Gmpz +Gmpz::operator*(int i) const +{ + if (i>0) + { + Gmpz_rep* Res = new Gmpz_rep(); + mpz_mul_ui(Res->mpZ, ptr()->mpZ, i); + return Gmpz(Res); + } + return *this * Gmpz(i); +} + +inline +Gmpz& +Gmpz::operator*=(const Gmpz &z) +{ + *this = *this * z; + return *this; +} + +inline +Gmpz +Gmpz::operator*=(int i) +{ + *this = *this * Gmpz(i); + return *this; +} + +inline +Gmpz +Gmpz::operator/(const Gmpz &z) const +{ + Gmpz_rep* Res = new Gmpz_rep(); + mpz_tdiv_q(Res->mpZ, ptr()->mpZ, z.ptr()->mpZ); + return Gmpz(Res); +} + +inline +Gmpz +Gmpz::operator/(int i) const +{ + if (i>0) + { + Gmpz_rep* Res = new Gmpz_rep(); + mpz_tdiv_q_ui(Res->mpZ, ptr()->mpZ, i); + return Gmpz(Res); + } + return *this / Gmpz(i); +} + +inline +Gmpz& +Gmpz::operator/=(const Gmpz &z) +{ + *this = *this / z; + return *this; +} + +inline +Gmpz +Gmpz::operator/=(int i) +{ + *this = *this / Gmpz(i); + return *this; +} + +inline +double +Gmpz::to_double() const +{ return mpz_get_d(ptr()->mpZ); } + +inline +io_Operator +io_tag(const Gmpz&) +{ return io_Operator(); } + +inline +Sign +Gmpz::sign() const +{ return (Sign)mpz_sgn(ptr()->mpZ); } + +inline +Gmpz +operator+(int i, const Gmpz &z) +{ return z + i; } + +inline +Gmpz +operator-(int i, const Gmpz &z) +{ return Gmpz(i) - z; } + +inline +Gmpz +operator*(int i, const Gmpz &z) +{ return z * i; } + +inline +double +to_double(const Gmpz &z) +{ return z.to_double(); } + +inline +Number_tag +number_type_tag(const Gmpz& ) +{ return Number_tag(); } + +inline +Sign +sign(const Gmpz &z) +{ return z.sign(); } + +inline +bool +is_valid(const Gmpz &) +{ return true; } + +inline +bool +is_finite(const Gmpz &) +{ return true; } + +inline +Gmpz +sqrt(const Gmpz &z) +{ + Gmpz_rep* Res = new Gmpz_rep(); + mpz_sqrt(Res->mpZ, z.ptr()->mpZ); + return Gmpz(Res); +} + +inline +Gmpz +gcd(const Gmpz &z1, const Gmpz &z2) +{ + Gmpz_rep* Res = new Gmpz_rep(); + mpz_gcd(Res->mpZ, z1.ptr()->mpZ, z2.ptr()->mpZ); + return Gmpz(Res); +} + +inline +Gmpz +gcd(const Gmpz &z, int i) +{ + if (i > 0) + { + Gmpz_rep* Res = new Gmpz_rep(); + mpz_gcd_ui(Res->mpZ, z.ptr()->mpZ, i); + return Gmpz(Res); + } + return gcd(z, Gmpz(i)); +} + +inline +Gmpz +exact_division(const Gmpz &z1, + const Gmpz &z2) +{ + Gmpz_rep* Res = new Gmpz_rep(); + mpz_divexact(Res->mpZ, z1.ptr()->mpZ, z2.ptr()->mpZ); +#ifdef CGAL_CHECK_POSTCONDITIONS + mpz_t prod; + mpz_init(prod); + mpz_mul(prod, Res->mpZ, z2.ptr()->mpZ); + CGAL_kernel_postcondition_msg(mpz_cmp(prod, z1.ptr()->mpZ) == 0, + "exact_division failed\n"); + mpz_clear( prod); +#endif // CGAL_CHECK_POSTCONDITIONS + return Gmpz(Res); +} + +inline +size_t +Gmpz::approximate_decimal_length() const +{ return mpz_sizeinbase(ptr()->mpZ,10); } + +inline +std::ostream& +operator<<(std::ostream& os, const Gmpz &z) +{ + char *str = new char [mpz_sizeinbase(z.ptr()->mpZ,10) + 2]; + str = mpz_get_str(str, 10, z.ptr()->mpZ); + os << str ; + delete[] str; + return os; +} + +inline +std::istream& +operator>>(std::istream& is, Gmpz &z) +{ + int negative = 0; + const int null = '0'; + char c; + +#ifndef CGAL_CFG_NO_LOCALE + while (is.get(c) && std::isspace(c, std::locale::classic() )) +#else + while (is.get(c) && CGAL_CLIB_STD::isspace(c)) +#endif // CGAL_CFG_NO_LOCALE + {} + + if (c == '-') + { + negative = 1; +#ifndef CGAL_CFG_NO_LOCALE + while (is.get(c) && std::isspace(c, std::locale::classic() )) +#else + while (is.get(c) && CGAL_CLIB_STD::isspace(c)) +#endif // CGAL_CFG_NO_LOCALE + {} + } +#ifndef CGAL_CFG_NO_LOCALE + if (std::isdigit(c, std::locale::classic() )) +#else + if (std::isdigit(c)) +#endif // CGAL_CFG_NO_LOCALE + { + z = c - '0'; +#ifndef CGAL_CFG_NO_LOCALE + while (is.get(c) && std::isdigit(c, std::locale::classic() )) +#else + while (is.get(c) && std::isdigit(c)) +#endif // CGAL_CFG_NO_LOCALE + { + z = 10*z + (c-null); + } + } + if (is) + { + is.putback(c); + } + if (sign(z) != (Sign)0 && negative) + { + z = -z; + } + return is; +} + +inline +Interval_base +to_interval (const Gmpz & z) +{ + // GMP returns the closest double (seen in the code). + Protect_FPU_rounding P(CGAL_FE_TONEAREST); + Interval_nt_advanced approx (CGAL::to_double(z)); + FPU_set_cw(CGAL_FE_UPWARD); + return approx + Interval_base::Smallest; +} + + +CGAL_END_NAMESPACE + + + +#endif // CGAL_GMPZ_H diff --git a/Packages/Number_types/include/CGAL/IEEE_754_unions.h b/Packages/Number_types/include/CGAL/IEEE_754_unions.h new file mode 100644 index 00000000000..f94b48a5cb1 --- /dev/null +++ b/Packages/Number_types/include/CGAL/IEEE_754_unions.h @@ -0,0 +1,90 @@ + +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 13 +// +// source : IEEE.fw +// file : IEEE_754_unions.h +// package : Number_types (4.2) +// maintainer : Stefan Schirra +// revision : 4.2 +// revision_date : 13 Dec 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#include + +#ifndef CGAL_IEEE_754_UNIONS_H +#define CGAL_IEEE_754_UNIONS_H + + +union IEEE_754_double +{ + double a; +#ifdef CGAL_BIG_ENDIAN + struct { unsigned sign : 1; + unsigned exp :11; + unsigned high :20; + unsigned low :32; + } b; + struct { unsigned H :32; + unsigned L :32; + } c; +#else + struct { unsigned low :32; + unsigned sign : 1; + unsigned exp :11; + unsigned high :20; + } b; + struct { unsigned L :32; + unsigned H :32; + } c; +#endif +}; + +union IEEE_754_float +{ + float a; + struct { unsigned sign : 1; + unsigned exp : 8; + unsigned high :23; + } b; + unsigned c; +}; + +inline +void +show( IEEE_754_double* p) +{ + std::cout << std::endl; + std::cout << std::hex << std::setw(8) << std::setfill('0') << p->c.H; + std::cout << ' '; + std::cout << std::hex << std::setw(8) << std::setfill('0') << p->c.L; + std::cout << std::endl; +} + +inline +void +show( IEEE_754_float* p) +{ + std::cout << std::endl; + std::cout << std::hex << std::setw(8) << std::setfill('0') << p->c; + std::cout << std::endl; +} + + + +#endif // CGAL_IEEE_754_UNIONS_H diff --git a/Packages/Number_types/include/CGAL/Quotient.C b/Packages/Number_types/include/CGAL/Quotient.C new file mode 100644 index 00000000000..b35ff40038e --- /dev/null +++ b/Packages/Number_types/include/CGAL/Quotient.C @@ -0,0 +1,566 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 13 +// +// source : Quotient.fw +// file : Quotient.C +// package : Number_types (4.2) +// maintainer : Stefan Schirra +// revision : 4.2 +// revision_date : 13 Dec 2000 +// +// author(s) : +// +// The template class Quotient is based on the LEDA class +// leda_rational written by Stefan Naeher and Christian Uhrig. +// It is basically a templated version with restricted functionality +// of the version of rational in LEDA release 3.3. +// The modification was done by Stefan.Schirra@mpi-sb.mpg.de +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#include + +#ifndef CGAL_QUOTIENT_C +#define CGAL_QUOTIENT_C + +CGAL_BEGIN_NAMESPACE + +template +CGAL_KERNEL_MEDIUM_INLINE +Quotient& +Quotient::normalize() +{ + typedef NumberType NT; + if (num == den) + { + num = den = NT(1); + return (*this); + } + if (-num == den) + { + num = NT(-1); + den = NT( 1); + return (*this); + } + NumberType ggt = gcd(num, den); + if (ggt != NT(1) ) + { + num /= ggt; + den /= ggt; + } + return (*this); +} + +template +CGAL_KERNEL_INLINE +Quotient& +Quotient::operator+= (const Quotient& r) +{ + num = num * r.den + r.num * den; + den *= r.den; + return (*this); +} + +template +CGAL_KERNEL_INLINE +Quotient& +Quotient::operator-= (const Quotient& r) +{ + num = num * r.den - r.num * den; + den *= r.den; + return (*this); +} + +template +CGAL_KERNEL_INLINE +Quotient& +Quotient::operator*= (const Quotient& r) +{ + num *= r.num; + den *= r.den; + return (*this); +} + +template +CGAL_KERNEL_INLINE +Quotient& +Quotient::operator/= (const Quotient& r) +{ + typedef NumberType NT; + CGAL_kernel_precondition( r.num != NT(0) ); + num *= r.den; + den *= r.num; + return (*this); +} +template +CGAL_KERNEL_INLINE +Quotient& +Quotient::operator+= (const NumberType& r) +{ + num = num + r * den; + return (*this); +} + +template +CGAL_KERNEL_INLINE +Quotient& +Quotient::operator-= (const NumberType& r) +{ + num = num - r * den; + return (*this); +} + +template +CGAL_KERNEL_INLINE +Quotient& +Quotient::operator*= (const NumberType& r) +{ + num *= r ; + return (*this); +} + +template +CGAL_KERNEL_INLINE +Quotient& +Quotient::operator/= (const NumberType& r) +{ + CGAL_kernel_precondition_code( typedef NumberType NT; ) + CGAL_kernel_precondition( r != NT(0) ); + den *= r ; + return (*this); +} +template +CGAL_KERNEL_MEDIUM_INLINE +Comparison_result +quotient_cmp(const Quotient& x, const Quotient& y) +{ + // In contrast to LEDA class rational, no assumptions + // on the sign of den are made + + // code assumes that SMALLER == - 1; + CGAL_kernel_precondition( SMALLER == (Comparison_result)(-1) ); + + int xsign = CGAL_NTS sign(x.num) * CGAL_NTS sign(x.den) ; + int ysign = CGAL_NTS sign(y.num) * CGAL_NTS sign(y.den) ; + if (xsign == 0) return (Comparison_result) -ysign; + if (ysign == 0) return (Comparison_result) xsign; + // now (x != 0) && (y != 0) + int diff = xsign - ysign; + if (diff == 0) + { + int msign = CGAL_NTS sign(x.den) * CGAL_NTS sign(y.den); + NumberType leftop = x.num * y.den * NumberType(msign); + NumberType rightop = y.num * x.den * NumberType(msign); + if (leftop < rightop) + { + return SMALLER; + } + else + { + return (rightop < leftop) ? LARGER : EQUAL; + } + } + else + { + return (xsign < ysign) ? SMALLER : LARGER; + } +} + +template +std::ostream& +operator<<(std::ostream& s, const Quotient& r) +{ + s << r.numerator() << "/" << r.denominator(); + return s; +} + +template +std::istream& +operator>>(std::istream& in, Quotient& r) +{ + /* format num/den or simply num */ + + char c = 0; + +#ifndef CGAL_CFG_NO_LOCALE + while (in.get(c) && std::isspace(c, std::locale::classic() )); +#else + while (in.get(c) && CGAL_CLIB_STD::isspace(c)); +#endif // CGAL_CFG_NO_LOCALE + if ( !in ) return in; + in.putback(c); + + NumberType num; + NumberType den(1); + in >> num; + +#ifndef CGAL_CFG_NO_LOCALE + while (in.get(c) && std::isspace(c, std::locale::classic() )); +#else + while (in.get(c) && CGAL_CLIB_STD::isspace(c)); +#endif // CGAL_CFG_NO_LOCALE + if (( in ) && ( c == '/')) + { +#ifndef CGAL_CFG_NO_LOCALE + while (in.get(c) && std::isspace(c, std::locale::classic() )); +#else + while (in.get(c) && CGAL_CLIB_STD::isspace(c)); +#endif // CGAL_CFG_NO_LOCALE + CGAL_kernel_assertion( in ); + in.putback(c); + in >> den; + } + else + { + in.putback(c); + if ( in.eof() ) in.clear(); + } + r = Quotient( num, den); + return in; +} + +template +inline +io_Operator +io_tag(const Quotient&) +{ return io_Operator(); } +template +inline +NumberType +Quotient::numerator() const +{ return num; } + +template +inline +NumberType +Quotient::denominator() const +{ return den; } +template +CGAL_KERNEL_INLINE +Quotient +operator+(const Quotient& x, const Quotient& y) +{ + Quotient z = x; + return z += y; +} + +template +CGAL_KERNEL_INLINE +Quotient +operator-(const Quotient& x, const Quotient& y) +{ return (Quotient(x) -= y); } + +template +CGAL_KERNEL_INLINE +Quotient +operator*(const Quotient& x, const Quotient& y) +{ + Quotient z = x; + return z *= y; +} + +template +CGAL_KERNEL_INLINE +Quotient +operator/(const Quotient& x, const Quotient& y) +{ + Quotient z = x; + return z /= y; +} + +template +inline +Quotient +operator-(const Quotient& x) +{ return Quotient(-x.num,x.den); } + +template +CGAL_KERNEL_INLINE +Quotient +operator+(const NumberType& x, const Quotient& y) +{ + Quotient z(x); + return z += y; +} + +template +CGAL_KERNEL_INLINE +Quotient +operator+(const Quotient& x, const NumberType& y) +{ + Quotient z = x; + return z += y; +} + +template +CGAL_KERNEL_INLINE +Quotient +operator-(const NumberType& x, const Quotient& y) +{ + Quotient z(x); + return z -= y; +} + +template +CGAL_KERNEL_INLINE +Quotient +operator-(const Quotient& x, const NumberType& y) +{ + Quotient z = x; + return z -= y; +} + +template +CGAL_KERNEL_INLINE +Quotient +operator*(const NumberType& x, const Quotient& y) +{ + Quotient z(x); + return z *= y; +} + +template +CGAL_KERNEL_INLINE +Quotient +operator*(const Quotient& x, const NumberType& y) +{ + Quotient z = x; + return z *= y; +} + +template +CGAL_KERNEL_INLINE +Quotient +operator/(const NumberType& x, const Quotient& y) +{ + Quotient z(x) ; + return z /= y; +} + +template +CGAL_KERNEL_INLINE +Quotient +operator/(const Quotient& x, const NumberType& y) +{ + Quotient z = x; + return z /= y; +} +template +CGAL_KERNEL_INLINE +NumberType +quotient_truncation(const Quotient& r) +{ return (r.num / r.den); } + +template +CGAL_KERNEL_INLINE +bool +operator==(const Quotient& x, const Quotient& y) +{ return x.num * y.den == x.den * y.num; } + +template +CGAL_KERNEL_INLINE +bool +operator<(const Quotient& x, const Quotient& y) +{ + return quotient_cmp(x,y) == SMALLER; // < 0 +} +template +CGAL_KERNEL_INLINE +bool +operator==(const Quotient& x, const NumberType& y) +{ return x.den * y == x.num; } + +template +CGAL_KERNEL_INLINE +bool +operator==(const NumberType& x, const Quotient& y) +{ return y.den * x == y.num; } + +template +CGAL_KERNEL_INLINE +bool +operator<(const Quotient& x, const NumberType& y) +{ + return quotient_cmp(x,Quotient(y)) == SMALLER; // < 0 +} + +template +CGAL_KERNEL_INLINE +bool +operator<(const NumberType& x, const Quotient& y) +{ + return quotient_cmp(Quotient(x),y) == SMALLER; // < 0 +} +#ifndef CGAL_NO_STL_PROVIDED_REL_OPS +template +CGAL_KERNEL_INLINE +bool +operator!=(const Quotient& x, const Quotient& y) +{ return x.num * y.den != x.den * y.num; } + +template +CGAL_KERNEL_INLINE +bool +operator<=(const Quotient& x, const Quotient& y) +{ + return quotient_cmp(x,y) != LARGER; // <= 0 +} + +template +CGAL_KERNEL_INLINE +bool +operator>(const Quotient& x, const Quotient& y) +{ + return quotient_cmp(x,y) == LARGER; // > 0 +} + +template +CGAL_KERNEL_INLINE +bool +operator>=(const Quotient& x, const Quotient& y) +{ + return quotient_cmp(x,y) != SMALLER; // >= 0 +} +#endif // CGAL_NO_STL_PROVIDED_REL_OPS +#ifndef CGAL_NO_STL_PROVIDED_REL_OPS +template +CGAL_KERNEL_INLINE +bool +operator!=(const Quotient& x, const NumberType& y) +{ return x.den * y != x.num; } + +template +CGAL_KERNEL_INLINE +bool +operator!=(const NumberType& x, const Quotient& y) +{ return y.den * x != y.num; } + +template +CGAL_KERNEL_INLINE +bool +operator<=(const Quotient& x, const NumberType& y) +{ + return quotient_cmp(x,Quotient(y)) != LARGER; // <= 0 +} + +template +CGAL_KERNEL_INLINE +bool +operator<=(const NumberType& x, const Quotient& y) +{ + return quotient_cmp(Quotient(x),y) != LARGER; // <= 0 +} + +template +CGAL_KERNEL_INLINE +bool +operator>(const Quotient& x, const NumberType& y) +{ + return quotient_cmp(x,Quotient(y)) == LARGER; // > 0 +} + +template +CGAL_KERNEL_INLINE +bool +operator>(const NumberType& x, const Quotient& y) +{ + return quotient_cmp(Quotient(x),y) == LARGER; // > 0 +} + +template +CGAL_KERNEL_INLINE +bool +operator>=(const Quotient& x, const NumberType& y) +{ + return quotient_cmp(x,Quotient(y)) != SMALLER; // >= 0 +} + +template +CGAL_KERNEL_INLINE +bool +operator>=(const NumberType& x, const Quotient& y) +{ + return quotient_cmp(Quotient(x),y) != SMALLER; // >= 0 +} +#endif // CGAL_NO_STL_PROVIDED_REL_OPS + +template +double +to_double(const Quotient& q) /* TODO */ +{ + if (q.num == NumberType(0) ) + { return 0; } + + double nd = CGAL::to_double( q.num ); + + if (q.den == NumberType(1) ) + { return nd; } + + double dd = CGAL::to_double( q.den ); + + if ( is_finite( q.den )&&(is_finite( q.num )) ) + { return nd/dd ; } + if ( CGAL_NTS abs(q.num) > CGAL_NTS abs(q.den) ) + { + NumberType nt_div = q.num / q.den; + double divd = CGAL::to_double(nt_div); + if ( divd >= ldexp(1.0,53) ) + { return divd; } + } + if ( CGAL_NTS abs(q.num) < CGAL_NTS abs(q.den) ) + { return 1.0 / CGAL::to_double( NumberType(1) / q ); } + + return nd/dd ; +} + +template +CGAL_KERNEL_INLINE +bool +is_valid(const Quotient& q) +{ return is_valid(q.num) && is_valid(q.den) ; } + +template +CGAL_KERNEL_INLINE +bool +is_finite(const Quotient& q) +{ return (is_finite(q.num))&&(is_finite(q.den)) ; } + +template +CGAL_KERNEL_INLINE +NumberType +denominator(const Quotient& q) +{ return q.den ; } + +template +CGAL_KERNEL_INLINE +NumberType +numerator(const Quotient& q) +{ return q.num ; } + +template +inline +Quotient_tag +number_type_tag(const Quotient& q) +{ return Quotient_tag(); } + +template +NumberType +gcd(const NumberType&, const NumberType&) +{ return NumberType(1); } + +CGAL_END_NAMESPACE + + +#endif // CGAL_QUOTIENT_C diff --git a/Packages/Number_types/include/CGAL/Quotient.h b/Packages/Number_types/include/CGAL/Quotient.h new file mode 100644 index 00000000000..70e4d613360 --- /dev/null +++ b/Packages/Number_types/include/CGAL/Quotient.h @@ -0,0 +1,426 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 13 +// +// source : Quotient.fw +// file : Quotient.h +// package : Number_types (4.2) +// maintainer : Stefan Schirra +// revision : 4.2 +// revision_date : 13 Dec 2000 +// +// author(s) : +// +// The template class Quotient is based on the LEDA class +// leda_rational written by Stefan Naeher and Christian Uhrig. +// It is basically a templated version with restricted functionality +// of the version of rational in LEDA release 3.3. +// The modification was done by Stefan.Schirra@mpi-sb.mpg.de +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_BASIC_H +#include +#endif // CGAL_BASIC_H + +#ifndef CGAL_QUOTIENT_H +#define CGAL_QUOTIENT_H + +#ifndef CGAL_NO_STL_PROVIDED_REL_OPS +# if ((__GNUC__ == 2) && (__GNUC_MINOR__ <= 8)) +# define CGAL_NO_STL_PROVIDED_REL_OPS +# endif // g++ 2.8 +#endif // CGAL_NO_STL_PROVIDED_REL_OPS + + + +#ifndef CGAL_CFG_NO_LOCALE +#include +#else +#include +#endif // CGAL_CFG_NO_LOCALE +#ifndef IO_IO_TAGS_H +#include +#endif // IO_IO_TAGS_H + +CGAL_BEGIN_NAMESPACE + +template class Quotient; +CGAL_TEMPLATE_NULL class Quotient; + +template +double +to_double(const Quotient& q); + +template +CGAL_KERNEL_INLINE +bool +is_valid(const Quotient& q); + +template +CGAL_KERNEL_INLINE +bool +is_finite(const Quotient& q); + +template +CGAL_KERNEL_INLINE +NumberType +numerator(const Quotient& q); + +template +CGAL_KERNEL_INLINE +NumberType +denominator(const Quotient& q); + +template +inline +Quotient_tag +number_type_tag(const Quotient& q); + +template < class NumberType > +inline +io_Operator +io_tag(const Quotient&); + +template +CGAL_KERNEL_MEDIUM_INLINE +Comparison_result +quotient_cmp(const Quotient& q, const Quotient& r); + +template +CGAL_KERNEL_INLINE +Quotient +operator+ (const Quotient& q, const Quotient& r); + +template +CGAL_KERNEL_INLINE +Quotient +operator+ (const NumberType& q, const Quotient& r); + +template +CGAL_KERNEL_INLINE +Quotient +operator+ (const Quotient& q, const NumberType& r); + +template +CGAL_KERNEL_INLINE +Quotient +operator- (const Quotient& q, const Quotient& r); + +template +CGAL_KERNEL_INLINE +Quotient +operator- (const NumberType& q, const Quotient& r); + +template +CGAL_KERNEL_INLINE +Quotient +operator- (const Quotient& q, const NumberType& r); + +template +CGAL_KERNEL_INLINE +Quotient +operator* (const Quotient& q, const Quotient& r); + +template +CGAL_KERNEL_INLINE +Quotient +operator* (const NumberType& q, const Quotient& r); + +template +CGAL_KERNEL_INLINE +Quotient +operator* (const Quotient& q, const NumberType& r); + +template +CGAL_KERNEL_INLINE +Quotient +operator/ (const Quotient& q, const Quotient& r); + +template +CGAL_KERNEL_INLINE +Quotient +operator/ (const NumberType& q, const Quotient& r); + +template +CGAL_KERNEL_INLINE +Quotient +operator/ (const Quotient& q, const NumberType& r); + +template +inline +Quotient +operator- (const Quotient&); + +template +CGAL_KERNEL_INLINE +bool +operator==(const Quotient& q, const Quotient& r); + +template +CGAL_KERNEL_INLINE +bool +operator==(const Quotient& q, const NumberType& a); + +template +CGAL_KERNEL_INLINE +bool +operator==(const NumberType& n, const Quotient& q); + +template +CGAL_KERNEL_INLINE +bool +operator< (const Quotient& q, const Quotient& r); + +template +CGAL_KERNEL_INLINE +bool +operator< (const Quotient& q, const NumberType& r); + +template +CGAL_KERNEL_INLINE +bool +operator< (const NumberType& q, const Quotient& r); + +#ifndef CGAL_NO_STL_PROVIDED_REL_OPS +template +CGAL_KERNEL_INLINE +bool +operator!=(const Quotient& q, const Quotient& r); + +template +CGAL_KERNEL_INLINE +bool +operator<=(const Quotient& q, const Quotient& r); + +template +CGAL_KERNEL_INLINE +bool +operator> (const Quotient& q, const Quotient& r); + +template +CGAL_KERNEL_INLINE +bool +operator>=(const Quotient& q, const Quotient& r); + +template +CGAL_KERNEL_INLINE +bool +operator!=(const Quotient& q, const NumberType& a); + +template +CGAL_KERNEL_INLINE +bool +operator!=(const NumberType& n, const Quotient& q); + +template +CGAL_KERNEL_INLINE +bool +operator<=(const Quotient& q, const NumberType& r); + +template +CGAL_KERNEL_INLINE +bool +operator<=(const NumberType& q, const Quotient& r); + +template +CGAL_KERNEL_INLINE +bool +operator> (const Quotient& q, const NumberType& r); + +template +CGAL_KERNEL_INLINE +bool +operator> (const NumberType& q, const Quotient& r); + +template +CGAL_KERNEL_INLINE +bool +operator>=(const Quotient& q, const NumberType& r); + +template +CGAL_KERNEL_INLINE +bool +operator>=(const NumberType& q, const Quotient& r); +#endif // CGAL_NO_STL_PROVIDED_REL_OPS + +template +std::istream& +operator>>(std::istream& in, Quotient& q); + +template +std::ostream& +operator<<(std::ostream& out, const Quotient& q); + +template +CGAL_KERNEL_INLINE +NumberType +quotient_truncation(const Quotient& r); + +template +NumberType +gcd(const NumberType& , const NumberType&); + +template +class Quotient +{ + public: + typedef NumberType NT; + + Quotient() : num( NT(0) ), den( NT(1) ) {} + + Quotient(const NT& n) : num(n), den( NT(1) ) {} + + Quotient(int i) : num(NT(i)), den( NT(1) ) {} + + Quotient(const NT& n, const NT& d) : num(n), den(d) + { CGAL_kernel_precondition( d!= NT(0) ); } + + Quotient(const Quotient& r) : num(r.num), den(r.den) {} + + ~Quotient() {} + + + + Quotient& operator+= (const Quotient& r); + Quotient& operator-= (const Quotient& r); + Quotient& operator*= (const Quotient& r); + Quotient& operator/= (const Quotient& r); + Quotient& operator+= (const NT& r); + Quotient& operator-= (const NT& r); + Quotient& operator*= (const NT& r); + Quotient& operator/= (const NT& r); + + + Quotient& normalize(); + + + NT numerator() const; + NT denominator() const; + + + public: + NT num; + NT den; + +}; + +template +Interval_base +to_interval (const Quotient& z) +{ + return Interval_nt<>(CGAL::to_interval(z.numerator())) / + Interval_nt<>(CGAL::to_interval(z.denominator())); +} + +CGAL_END_NAMESPACE + + +#ifdef CGAL_CFG_NO_AUTOMATIC_TEMPLATE_INCLUSION +#include +#endif // CGAL_CFG_NO_AUTOMATIC_TEMPLATE_INCLUSION + +CGAL_BEGIN_NAMESPACE + +CGAL_TEMPLATE_NULL +class Quotient +{ + public: + Quotient() : num( 0 ), den( 1 ) {} + Quotient(int i) : num( i ), den( 1 ) {} + Quotient(const int& n, const int& d) : num(n), den(d) + { CGAL_kernel_precondition( d!= 0 ); } + Quotient(const Quotient& r) : num(r.num), den(r.den) {} + ~Quotient() {} + + int + numerator() const { return num; } + + int + denominator() const { return den; } + + + Quotient& + operator+= (const Quotient& r) + { + num = num * r.den + r.num * den; + den *= r.den; + return (*this); + } + + Quotient& + operator-= (const Quotient& r) + { + num = num * r.den - r.num * den; + den *= r.den; + return (*this); + } + + Quotient& + operator*= (const Quotient& r) + { + num *= r.num; + den *= r.den; + return (*this); + } + + Quotient& + operator/= (const Quotient& r) + { + CGAL_kernel_precondition( r.num != 0 ); + num *= r.den; + den *= r.num; + return (*this); + } + Quotient& + operator+= (const int& r) + { + num = num + r * den; + return (*this); + } + + Quotient& + operator-= (const int& r) + { + num = num - r * den; + return (*this); + } + + Quotient& + operator*= (const int& r) + { + num *= r ; + return (*this); + } + + Quotient& + operator/= (const int& r) + { + CGAL_kernel_precondition( r != 0 ); + den *= r ; + return (*this); + } + + public: + int num; + int den; + +}; + +CGAL_END_NAMESPACE + + +#include + +#endif // CGAL_QUOTIENT_H diff --git a/Packages/Number_types/include/CGAL/double.h b/Packages/Number_types/include/CGAL/double.h new file mode 100644 index 00000000000..f429b15fd1e --- /dev/null +++ b/Packages/Number_types/include/CGAL/double.h @@ -0,0 +1,214 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 13 +// +// source : Double.fw +// file : double.h +// package : Number_types (4.2) +// maintainer : Stefan Schirra +// revision : 4.2 +// revision_date : 13 Dec 2000 +// author(s) : Geert-Jan Giezeman +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_DOUBLE_H +#define CGAL_DOUBLE_H 1 + +#include +#include +#include +#include +#ifdef __sgi +#include +#endif // __sgi +#include + +CGAL_BEGIN_NAMESPACE + + +inline +double +to_double(double d) +{ return d; } + +inline +double +sqrt(double d) +{ return std::sqrt(d); } + +inline +bool +is_integral (const double d) +{ return ceil(d) == d; } + +inline +Number_tag +number_type_tag(double) +{ return Number_tag(); } + +#ifdef OLD_FINITE_VALID +extern +bool +is_finite(double d); + +extern +bool +is_valid(double d); + +#else + +#ifdef __sgi + +// double +inline +bool is_finite(double d) +{ + switch (fp_class_d(d)) { + case FP_POS_NORM: + case FP_NEG_NORM: + case FP_POS_ZERO: + case FP_NEG_ZERO: + case FP_POS_DENORM: + case FP_NEG_DENORM: + return true; + case FP_SNAN: + case FP_QNAN: + case FP_POS_INF: + case FP_NEG_INF: + return false; + } + return false; // NOT REACHED +} + +inline +bool is_valid(double d) +{ + switch (fp_class_d(d)) { + case FP_POS_NORM: + case FP_NEG_NORM: + case FP_POS_ZERO: + case FP_NEG_ZERO: + case FP_POS_INF: + case FP_NEG_INF: + case FP_POS_DENORM: + case FP_NEG_DENORM: + return true; + case FP_SNAN: + case FP_QNAN: + return false; + } + return false; // NOT REACHED +} + +#else +#if defined(_MSC_VER) || defined(CGAL_MASK_FINITE_VALID) || defined(__BORLANDC__) + +#define CGAL_EXPONENT_DOUBLE_MASK 0x7ff00000 +#define CGAL_MANTISSA_DOUBLE_MASK 0x000fffff + +inline +bool +is_finite_by_mask_double(unsigned int h) +{ + unsigned int e = h & CGAL_EXPONENT_DOUBLE_MASK; + return ( ( e ^ CGAL_EXPONENT_DOUBLE_MASK ) != 0 ); +} + +inline +bool +is_nan_by_mask_double(unsigned int h, unsigned int l) +{ + if ( is_finite_by_mask_double(h) ) return false; + return ( (( h & CGAL_MANTISSA_DOUBLE_MASK ) != 0) || (( l & 0xffffffff ) != 0)); +} + +inline +bool +is_finite( const double& dble) +{ + double d = dble; + IEEE_754_double* p = reinterpret_cast(&d); + return is_finite_by_mask_double( p->c.H ); +} + +inline +bool +is_valid( const double& dble) +{ + double d = dble; + IEEE_754_double* p = reinterpret_cast(&d); + return ! ( is_nan_by_mask_double( p->c.H, p->c.L )); +} + + +#else + +inline +bool +is_valid(double d) +{ return (d == d); } + +inline +bool +is_finite(double d) +{ return (d == d) && (is_valid(d-d)); } + +#endif // MSC_VER || ... +#endif // __sgi + +#endif // OLD_FINITE_VALID + +inline +io_Operator +io_tag(double) +{ return io_Operator(); } + +#ifndef CGAL_NO_NTS_NAMESPACE +namespace NTS { +#ifndef CGAL_NUMBER_UTILS_H +template NT abs(const NT &x); +#endif // CGAL_NUMBER_UTILS_H + +CGAL_TEMPLATE_NULL +inline +double +abs(const double& d) +{ return CGAL_CLIB_STD::fabs(d); } + + +} // namespace NTS +#else +#ifndef CGAL_NUMBER_UTILS_H +template NT abs(const NT &x); +#endif // CGAL_NUMBER_UTILS_H + +CGAL_TEMPLATE_NULL +inline +double +abs(const double& d) +{ return CGAL_CLIB_STD::fabs(d); } + + +#endif // CGAL_NO_NTS_NAMESPACE + +inline +Interval_base +to_interval (const double& z) +{ return Interval_base(z); } + + +CGAL_END_NAMESPACE + +#endif // CGAL_DOUBLE_H diff --git a/Packages/Number_types/include/CGAL/float.h b/Packages/Number_types/include/CGAL/float.h new file mode 100644 index 00000000000..914b86c5c47 --- /dev/null +++ b/Packages/Number_types/include/CGAL/float.h @@ -0,0 +1,177 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 13 +// +// source : Float.fw +// file : float.h +// package : Number_types (4.2) +// maintainer : Stefan Schirra +// revision : 4.2 +// revision_date : 13 Dec 2000 +// author(s) : Geert-Jan Giezeman +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_FLOAT_H +#define CGAL_FLOAT_H 1 + +#include +#ifndef CGAL_TAGS_H +#include +#endif // CGAL_TAGS_H +#include +#include +#ifdef __sgi +#include +#endif +#include + +CGAL_BEGIN_NAMESPACE + +inline +double +to_double(float f) +{ return (double)f; } + +inline +Number_tag +number_type_tag(float) +{ return Number_tag(); } + +#ifdef OLD_FINITE_VALID +extern +bool +is_finite(float d); + +extern +bool +is_valid(float d); + +#else +#ifdef __sgi + +inline +bool is_finite(float f) +{ + switch (fp_class_f(f)) { + case FP_POS_NORM: + case FP_NEG_NORM: + case FP_POS_ZERO: + case FP_NEG_ZERO: + case FP_POS_DENORM: + case FP_NEG_DENORM: + return true; + case FP_SNAN: + case FP_QNAN: + case FP_POS_INF: + case FP_NEG_INF: + return false; + } + return false; // NOT REACHED +} + +inline +bool is_valid(float d) +{ + switch (fp_class_f(d)) { + case FP_POS_NORM: + case FP_NEG_NORM: + case FP_POS_ZERO: + case FP_NEG_ZERO: + case FP_POS_INF: + case FP_NEG_INF: + case FP_POS_DENORM: + case FP_NEG_DENORM: + return true; + case FP_SNAN: + case FP_QNAN: + return false; + } + return false; // NOT REACHED +} + +#else +#if defined(_MSC_VER) || defined(CGAL_MASK_FINITE_VALID) || defined(__BORLANDC__) + +#define CGAL_EXPONENT_FLOAT_MASK 0x7f800000 +#define CGAL_MANTISSA_FLOAT_MASK 0x007fffff + +inline +bool +is_finite_by_mask_float(unsigned int u) +{ + unsigned int e = u & CGAL_EXPONENT_FLOAT_MASK; + return ( (e ^ CGAL_EXPONENT_FLOAT_MASK) != 0); +} + +inline +bool +is_nan_by_mask_float(unsigned int u) +{ + if ( is_finite_by_mask_float(u) ) return false; + // unsigned int m = u & CGAL_MANTISSA_FLOAT_MASK; + return ( (u & CGAL_MANTISSA_FLOAT_MASK) != 0); +} + +inline +bool +is_finite( const float& flt) +{ + float f = flt; + IEEE_754_float* p = reinterpret_cast(&f); + return is_finite_by_mask_float( p->c ); +} + +inline +bool +is_valid( const float& flt) +{ + float f = flt; + IEEE_754_float* p = reinterpret_cast(&f); + return !is_nan_by_mask_float( p->c ); +} + + + +#else + +inline +bool +is_valid(float d) +{ return (d == d); } + +inline +bool +is_finite(float d) +{ return (d == d) && (is_valid(d-d)); } + +#endif // MSC_VER || ... +#endif // __sgi + +#endif // OLD_FINITE_VALID + +inline +io_Operator +io_tag(float) +{ return io_Operator(); } + +inline +Interval_base +to_interval (const float& z) +{ return Interval_base(z); } + + +CGAL_END_NAMESPACE + +#endif // CGAL_FLOAT_H diff --git a/Packages/Number_types/include/CGAL/gnu_integer.h b/Packages/Number_types/include/CGAL/gnu_integer.h new file mode 100644 index 00000000000..f67d05ecc73 --- /dev/null +++ b/Packages/Number_types/include/CGAL/gnu_integer.h @@ -0,0 +1,64 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 13 +// +// source : Gnu_Integer.fw +// file : gnu_integer.h +// package : Number_types (4.2) +// maintainer : Stefan Schirra +// revision : 4.2 +// revision_date : 13 Dec 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_GNU_INTEGER_H +#define CGAL_GNU_INTEGER_H + +#ifndef CGAL_PROTECT_INTEGER_H +#include +#define CGAL_PROTECT_INTEGER_H +#endif // CGAL_PROTECT_INTEGER_H + +CGAL_BEGIN_NAMESPACE + +inline +bool +is_finite(const Integer &) +{ return true; } + +inline +bool +is_valid(const Integer &) +{ return true; } + +inline +double +to_double(const Integer & i) +{ return i.as_double(); } + +inline +Number_tag +number_type_tag(const Integer& ) +{ return Number_tag(); } + +inline +io_Operator +io_tag(const Integer& ) +{ return io_Operator(); } + +CGAL_END_NAMESPACE + +#endif // CGAL_GNU_INTEGER_H diff --git a/Packages/Number_types/include/CGAL/int.h b/Packages/Number_types/include/CGAL/int.h new file mode 100644 index 00000000000..f14b7425c87 --- /dev/null +++ b/Packages/Number_types/include/CGAL/int.h @@ -0,0 +1,199 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 13 +// +// source : Int.fw +// file : int.h +// package : Number_types (4.2) +// maintainer : Stefan Schirra +// revision : 4.2 +// revision_date : 13 Dec 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_INT_H +#define CGAL_INT_H + +#ifndef CGAL_NUMBER_TYPE_TAGS_H +#include +#endif // CGAL_NUMBER_TYPE_TAGS_H + +// int + +CGAL_BEGIN_NAMESPACE + + +inline +double +to_double(int i) +{ return (double)i; } + +inline +Interval_base +to_interval(int i) +{ return CGAL::to_interval(double(i)); } + +inline +Number_tag +number_type_tag(int) +{ return Number_tag(); } + +inline +bool +is_finite(int) +{ return true; } + +inline +bool +is_valid(int) +{ return true; } + +inline +io_Operator +io_tag(int) +{ return io_Operator(); } + +// long + +inline +double +to_double(long int i) +{ return (double)i; } + +inline +Interval_base +to_interval(long int i) +{ + // actually we would like to compare number of mantissa bits, + // this seems to be a sufficient approximation + CGAL_kernel_assertion( sizeof( double) > sizeof( long)); + // need something else for 64 bits longs. + return CGAL::to_interval(double(i)); +} + +inline +Number_tag +number_type_tag(long int) +{ return Number_tag(); } + +inline +bool +is_finite(long int) +{ return true; } + +inline +bool +is_valid(long int) +{ return true; } + +inline +io_Operator +io_tag(long int) +{ return io_Operator(); } + +// short + +inline +double +to_double(short int i) +{ return (double)i; } + +inline +Interval_base +to_interval(short int i) +{ return CGAL::to_interval(double(i)); } + +inline +Number_tag +number_type_tag(short int) +{ return Number_tag(); } + +inline +bool +is_finite(short int) +{ return true; } + +inline +bool +is_valid(short int) +{ return true; } + +inline +io_Operator +io_tag(short int) +{ return io_Operator(); } + +// long long + +#ifdef LONG_LONG + +inline +double +to_double(long long i) +{ return (double)i; } + +inline +Interval_base +to_interval(long int i) +{ + // actually we would like to compare number of mantissa bits, + // this seems to be a sufficient approximation + CGAL_kernel_assertion( sizeof( double) > sizeof( long long)); + // need something else for 64 bits longs. + return CGAL::to_interval(double(i)); +} + +inline +Number_tag +number_type_tag(long long) +{ return Number_tag(); } + +inline +bool +is_finite(long long) +{ return true; } + +inline +bool +is_valid(long long) +{ return true; } +#endif // LONG_LONG + +// io_tags for unsigned types +inline +io_Operator +io_tag(unsigned char) +{ return io_Operator(); } + +inline +io_Operator +io_tag(unsigned short) +{ return io_Operator(); } + +inline +io_Operator +io_tag(unsigned int) +{ return io_Operator(); } + +inline +io_Operator +io_tag(unsigned long) +{ return io_Operator(); } + +CGAL_END_NAMESPACE + + +#endif // CGAL_INT_H diff --git a/Packages/Number_types/include/CGAL/leda_bigfloat.h b/Packages/Number_types/include/CGAL/leda_bigfloat.h new file mode 100644 index 00000000000..1c8466b467e --- /dev/null +++ b/Packages/Number_types/include/CGAL/leda_bigfloat.h @@ -0,0 +1,90 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 13 +// +// source : Bigfloat.fw +// file : leda_bigfloat.h +// package : Number_types (4.2) +// maintainer : Stefan Schirra +// revision : 4.2 +// revision_date : 13 Dec 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_BIGFLOAT_H +#define CGAL_BIGFLOAT_H + +#include + +// #ifndef IO_IO_TAGS_H +// #include +// #endif // IO_IO_TAGS_H +// #ifndef CGAL_NUMBER_TYPE_TAGS_H +// #include +// #endif // CGAL_NUMBER_TYPE_TAGS_H + +#ifndef CGAL_PROTECT_LEDA_BIGFLOAT_H +#include +#define CGAL_PROTECT_LEDA_BIGFLOAT_H +#endif // CGAL_PROTECT_LEDA_BIGFLOAT_H + +CGAL_BEGIN_NAMESPACE + + +#ifndef CGAL_CFG_NO_NAMESPACE +inline +double +to_double(const leda_bigfloat & b) +{ return ::to_double(b); } +#endif // CGAL_CFG_NO_NAMESPACE + +inline +Number_tag +number_type_tag(const leda_bigfloat& ) +{ return Number_tag(); } + +inline +bool +is_finite(const leda_bigfloat & b) +{ return !( isInf(b) || isNaN(b) ); } + +inline +bool +is_valid(const leda_bigfloat & b) +{ return !( isNaN(b) ); } + +inline +io_Operator +io_tag(const leda_bigfloat &) +{ return io_Operator(); } + +inline +Interval_base +to_interval (const leda_bigfloat & z) +{ + // assuming leda_bigfloat guarantee 1 bit error max + Protect_FPU_rounding P (CGAL_FE_TONEAREST); + Interval_nt_advanced approx (::to_double(z)); + FPU_set_cw(CGAL_FE_UPWARD); + return approx + Interval_base::Smallest; +} + + +CGAL_END_NAMESPACE + + + +#endif // CGAL_BIGFLOAT_H diff --git a/Packages/Number_types/include/CGAL/leda_integer.h b/Packages/Number_types/include/CGAL/leda_integer.h new file mode 100644 index 00000000000..8a721a6d1c9 --- /dev/null +++ b/Packages/Number_types/include/CGAL/leda_integer.h @@ -0,0 +1,108 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 13 +// +// source : Integer.fw +// file : leda_integer.h +// package : Number_types (4.2) +// maintainer : Stefan Schirra +// revision : 4.2 +// revision_date : 13 Dec 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_INTEGER_H +#define CGAL_INTEGER_H + +#include + +// #ifndef IO_IO_TAGS_H +// #include +// #endif // IO_IO_TAGS_H +// #ifndef CGAL_NUMBER_TYPE_TAGS_H +// #include +// #endif // CGAL_NUMBER_TYPE_TAGS_H + +/* +#if !defined(LEDA_ROOT_INCL_ID) +#define LEDA_ROOT_INCL_ID 349063 +#include +#endif +*/ + +#ifndef CGAL_PROTECT_LEDA_INTEGER_H +#include +#define CGAL_PROTECT_LEDA_INTEGER_H +#endif // CGAL_PROTECT_LEDA_INTEGER_H + +CGAL_BEGIN_NAMESPACE + + +#ifndef CGAL_CFG_NO_NAMESPACE +inline +double +to_double(const leda_integer & i) +{ return i.to_double(); } +#endif // CGAL_CFG_NO_NAMESPACE + +inline +Number_tag +number_type_tag(const leda_integer& ) +{ return Number_tag(); } + +inline +bool +is_finite(const leda_integer &) +{ return true; } + +inline +bool +is_valid(const leda_integer &) +{ return true; } + +inline +io_Operator +io_tag(const leda_integer &) +{ return io_Operator(); } + +#ifndef CGAL_CFG_NO_NAMESPACE +inline +Sign +sign(const leda_integer& n) +{ return (Sign)::sign(n); } +#endif // CGAL_CFG_NO_NAMESPACE + +inline +Interval_base +to_interval (const leda_integer & z) +{ + Protect_FPU_rounding P (CGAL_FE_TONEAREST); + Interval_nt_advanced approx (z.to_double()); + FPU_set_cw(CGAL_FE_UPWARD); + return approx + Interval_base::Smallest; +} + + +CGAL_END_NAMESPACE + + +/* +#if LEDA_ROOT_INCL_ID == 349063 +#undef LEDA_ROOT_INCL_ID +#include +#endif +*/ + +#endif // CGAL_INTEGER_H diff --git a/Packages/Number_types/include/CGAL/leda_rational.h b/Packages/Number_types/include/CGAL/leda_rational.h new file mode 100644 index 00000000000..3cf0b5ac230 --- /dev/null +++ b/Packages/Number_types/include/CGAL/leda_rational.h @@ -0,0 +1,111 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 13 +// +// source : Rational.fw +// file : leda_rational.h +// package : Number_types (4.2) +// maintainer : Stefan Schirra +// revision : 4.2 +// revision_date : 13 Dec 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_LEDA_RATIONAL_H +#define CGAL_LEDA_RATIONAL_H + +#include + +// #ifndef CGAL_NUMBER_TYPE_TAGS_H +// #include +// #endif // CGAL_NUMBER_TYPE_TAGS_H +// #ifndef IO_IO_TAGS_H +// #include +// #endif // IO_IO_TAGS_H + +/* +#if !defined(LEDA_ROOT_INCL_ID) +#define LEDA_ROOT_INCL_ID 349115 +#include +#endif +*/ + +#ifndef CGAL_PROTECT_LEDA_RATIONAL_H +#include +#define CGAL_PROTECT_LEDA_RATIONAL_H +#endif // CGAL_PROTECT_LEDA_RATIONAL_H + +CGAL_BEGIN_NAMESPACE + + +#ifndef CGAL_NO_NAMESPACE +inline +double +to_double(const leda_rational &r) +{ return r.to_double(); } +#endif // CGAL_NO_NAMESPACE + +inline +Number_tag +number_type_tag(const leda_rational &) +{ return Number_tag(); } + +inline +bool +is_finite(const leda_rational &) +{ return true; } + +inline +bool +is_valid(const leda_rational &) +{ return true; } + +inline +io_Operator +io_tag(const leda_rational &) +{ return io_Operator(); } + +#ifndef CGAL_CFG_NO_NAMESPACE +inline +Sign +sign(const leda_rational& r) +{ return (Sign)::sign(r); } +#endif // CGAL_CFG_NO_NAMESPACE + +inline +Interval_base +to_interval (const leda_rational & z) +{ + // There's no guarantee about the error of to_double(), so I add 3 ulps... + Protect_FPU_rounding P (CGAL_FE_TONEAREST); + Interval_nt_advanced approx (z.to_double()); + FPU_set_cw(CGAL_FE_UPWARD); + + return ( (approx + Interval_base::Smallest) + Interval_base::Smallest) + + Interval_base::Smallest; +} + + +CGAL_END_NAMESPACE + + +/* +#if LEDA_ROOT_INCL_ID == 349115 +#undef LEDA_ROOT_INCL_ID +#include +#endif +*/ + +#endif // CGAL_LEDA_RATIONAL_H diff --git a/Packages/Number_types/include/CGAL/leda_real.h b/Packages/Number_types/include/CGAL/leda_real.h new file mode 100644 index 00000000000..7a4bccf88b2 --- /dev/null +++ b/Packages/Number_types/include/CGAL/leda_real.h @@ -0,0 +1,129 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 13 +// +// source : Real.fw +// file : leda_real.h +// package : Number_types (4.2) +// maintainer : Stefan Schirra +// revision : 4.2 +// revision_date : 13 Dec 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_REAL_H +#define CGAL_REAL_H + +/* +#if !defined(LEDA_ROOT_INCL_ID) +#define LEDA_ROOT_INCL_ID 349117 +#include +#endif +*/ + +#include + +// #ifndef IO_IO_TAGS_H +// #include +// #endif // IO_IO_TAGS_H +// #ifndef CGAL_NUMBER_TYPE_TAGS_H +// #include +// #endif // CGAL_NUMBER_TYPE_TAGS_H +#ifndef CGAL_PROTECT_LEDA_REAL_H +#include +#define CGAL_PROTECT_LEDA_REAL_H +#endif // CGAL_PROTECT_LEDA_REAL_H + +CGAL_BEGIN_NAMESPACE + + +#ifndef CGAL_NO_NAMESPACE +inline +double +to_double(const leda_real & r) +{ return r.to_double(); } +#endif // CGAL_NO_NAMESPACE + +inline +leda_real +sqrt(const leda_real & r) +{ return ::sqrt(r); } + +inline +Number_tag +number_type_tag(const leda_real& ) +{ return Number_tag(); } + +inline +bool +is_finite(const leda_real &) +{ return true; } + +inline +bool +is_valid(const leda_real &) +{ return true; } + +inline +io_Operator +io_tag(const leda_real &) +{ return io_Operator(); } + +#ifndef CGAL_CFG_NO_NAMESPACE +inline +Sign +sign(const leda_real& r) +{ return (Sign)::sign(r); } + +inline +Comparison_result +compare(const leda_real& r1, const leda_real& r2) +{ + int c = ::compare(r1,r2); + return (c < 0) ? SMALLER : ((0 < c) ? LARGER : EQUAL); +} +#endif // CGAL_CFG_NO_NAMESPACE + +inline +Interval_base +to_interval (const leda_real & z) +{ + Protect_FPU_rounding P (CGAL_FE_TONEAREST); + double approx = z.to_double(); + double rel_error = z.get_double_error(); + FPU_set_cw(CGAL_FE_UPWARD); + return ( Interval_nt_advanced(-rel_error,rel_error) + 1 ) * approx; +} + + +CGAL_END_NAMESPACE + + +#if ( __LEDA__ < 362 ) +inline +leda_real +operator/= (leda_real&x, const leda_real&y) +{ x = x / y; return x; } +#endif // __LEDA__ < 362 + +/* +#if LEDA_ROOT_INCL_ID == 349117 +#undef LEDA_ROOT_INCL_ID +#include +#endif +*/ + +#endif // CGAL_REAL_H diff --git a/Packages/Number_types/include/CGAL/long_long.h b/Packages/Number_types/include/CGAL/long_long.h new file mode 100644 index 00000000000..fc013e0fd30 --- /dev/null +++ b/Packages/Number_types/include/CGAL/long_long.h @@ -0,0 +1,67 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 13 +// +// source : webNT/Long_long.fw +// file : include/CGAL/long_long.h +// package : Number_types (4.2) +// maintainer : Stefan Schirra +// revision : 4.2 +// revision_date : 13 Dec 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +// !!! ANSI C++ does not support `long long' !!! + +#ifndef CGAL_LONG_LONG_H +#define CGAL_LONG_LONG_H + +#include + +CGAL_BEGIN_NAMESPACE + + +inline +double +to_double(long long int i) +{ return (double)i; } + +inline +Number_tag +number_type_tag(long long int) +{ return Number_tag(); } + +inline +bool +is_finite(long long int) +{ return true; } + +inline +bool +is_valid(long long int) +{ return true; } + +#if (defined(__sparc__) || defined(__sparc) || defined(sparc)) || \ + (defined(__sgi__) || defined(__sgi) || defined(sgi)) || \ + (defined(__i386__) || defined(__i386) || defined(i386)) || \ + (defined(__powerpc__) || defined(__powerpc) || defined(powerpc)) +typedef long long int Integer64; +typedef unsigned long long int UInteger64; +#endif // __sparc__ || ... + +CGAL_END_NAMESPACE + +#endif // CGAL_LONG_LONG_H diff --git a/Packages/Number_types/include/CGAL/number_type_basic.h b/Packages/Number_types/include/CGAL/number_type_basic.h new file mode 100644 index 00000000000..f3fdb57b1c2 --- /dev/null +++ b/Packages/Number_types/include/CGAL/number_type_basic.h @@ -0,0 +1,37 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 13 +// +// source : number_type_basic.fw +// file : number_type_basic.h +// package : Number_types (4.2) +// maintainer : Stefan Schirra +// revision : 4.2 +// revision_date : 13 Dec 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_NUMBER_TYPE_BASIC_H +#define CGAL_NUMBER_TYPE_BASIC_H + +#include +#include +#include +#include +#include +#include + +#endif // CGAL_NUMBER_TYPE_BASIC_H diff --git a/Packages/Number_types/include/CGAL/number_type_tags.h b/Packages/Number_types/include/CGAL/number_type_tags.h new file mode 100644 index 00000000000..cd7f9f0349a --- /dev/null +++ b/Packages/Number_types/include/CGAL/number_type_tags.h @@ -0,0 +1,45 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 13 +// +// source : number_type_tags.fw +// file : number_type_tags.h +// package : Number_types (4.2) +// maintainer : Stefan Schirra +// revision : 4.2 +// revision_date : 13 Dec 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_NUMBER_TYPE_TAGS_H +#define CGAL_NUMBER_TYPE_TAGS_H + +#ifndef CGAL_ENUM_H +#include +#endif // CGAL_ENUM_H + + + +CGAL_BEGIN_NAMESPACE + +struct No_number_tag{}; +struct Number_tag{}; +struct Quotient_tag{}; + +CGAL_END_NAMESPACE + + +#endif // CGAL_NUMBER_TYPE_TAGS_H diff --git a/Packages/Number_types/include/CGAL/number_utils.h b/Packages/Number_types/include/CGAL/number_utils.h new file mode 100644 index 00000000000..86437a48c37 --- /dev/null +++ b/Packages/Number_types/include/CGAL/number_utils.h @@ -0,0 +1,256 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 13 +// +// source : number_utils.fw +// file : number_utils.h +// package : Number_types (4.2) +// maintainer : Stefan Schirra +// revision : 4.2 +// revision_date : 13 Dec 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_NUMBER_UTILS_H +#define CGAL_NUMBER_UTILS_H + +#include +#include +#include +#include + +namespace CGAL { + +template +inline +bool +is_zero(const NT& x) +{ +#ifndef CGAL_NO_NTS_NAMESPACE + bool is_zero_is_obsolete__qualify_call_by_CGAL_NTS; +#endif // CGAL_NO_NTS_NAMESPACE + return x == NT(0); +} + +template +inline +bool +is_one(const NT& x) +{ +#ifndef CGAL_NO_NTS_NAMESPACE + bool is_one_is_obsolete__qualify_call_by_CGAL_NTS; +#endif // CGAL_NO_NTS_NAMESPACE + return x == NT(1); +} + +template +inline +bool +is_negative(const NT& x) +{ +#ifndef CGAL_NO_NTS_NAMESPACE + bool is_negative_is_obsolete__qualify_call_by_CGAL_NTS; +#endif // CGAL_NO_NTS_NAMESPACE + return x < NT(0); +} + +template +inline +bool +is_positive(const NT& x) +{ +#ifndef CGAL_NO_NTS_NAMESPACE + bool is_positive_is_obsolete__qualify_call_by_CGAL_NTS; +#endif // CGAL_NO_NTS_NAMESPACE + return NT(0) < x; +} + +template +CGAL_KERNEL_INLINE +Sign +sign(const NT& x) +{ +#ifndef CGAL_NO_NTS_NAMESPACE + bool sign_is_obsolete__qualify_call_by_CGAL_NTS; +#endif // CGAL_NO_NTS_NAMESPACE + return (x < NT(0)) ? NEGATIVE : (NT(0) < x) ? POSITIVE : ZERO; +} + +template +CGAL_KERNEL_INLINE +Sign +lexicographical_sign(const NT& x, const NT& y) +{ +#ifndef CGAL_NO_NTS_NAMESPACE + bool lexicographical_sign_is_obsolete__qualify_call_by_CGAL_NTS; +#endif // CGAL_NO_NTS_NAMESPACE + return (x == NT(0)) ? CGAL::sign(y) : CGAL::sign(x); +} + +template +CGAL_KERNEL_INLINE +NT +abs(const NT& x) +{ +#ifndef CGAL_NO_NTS_NAMESPACE + bool abs_is_obsolete__qualify_call_by_CGAL_NTS; +#endif // CGAL_NO_NTS_NAMESPACE + return (x < NT(0)) ? -x: x; +} + +// for min and max see + +template +CGAL_KERNEL_INLINE +Comparison_result +compare(const NT& n1, const NT& n2) +{ +#ifndef CGAL_NO_NTS_NAMESPACE + bool compare_is_obsolete__qualify_call_by_CGAL_NTS; +#endif // CGAL_NO_NTS_NAMESPACE + if (n1 < n2) + { + return SMALLER ; + } + return (n2 < n1) ? LARGER : EQUAL; +} + +template +inline +NT +square( const NT& n) +{ +#ifndef CGAL_NO_NTS_NAMESPACE + bool square_is_obsolete__qualify_call_by_CGAL_NTS; +#endif // CGAL_NO_NTS_NAMESPACE + return n*n; +} + + +#ifndef CGAL_NO_NTS_NAMESPACE +namespace NTS { + +template +inline +bool +is_zero(const NT& x) +{ return x == NT(0); } + +template +inline +bool +is_one(const NT& x) +{ return x == NT(1); } + +template +inline +bool +is_negative(const NT& x) +{ return x < NT(0); } + +template +inline +bool +is_positive(const NT& x) +{ return NT(0) < x; } + +template +CGAL_KERNEL_INLINE +Sign +sign(const NT& x) +{ return (x < NT(0)) ? NEGATIVE : (NT(0) < x) ? POSITIVE : ZERO; } + +template +CGAL_KERNEL_INLINE +Sign +lexicographical_sign(const NT& x, const NT& y) +{ return (x == NT(0)) ? CGAL_NTS sign(y) : CGAL_NTS sign(x); } + +template +CGAL_KERNEL_INLINE +NT +abs(const NT& x) +{ return (x < NT(0)) ? -x: x; } + +template +CGAL_KERNEL_INLINE +const NT& +min(const NT& x, const NT& y) +{ return (y < x) ? y : x; } + +template +CGAL_KERNEL_INLINE +const NT& +max(const NT& x, const NT& y) +{ return (x < y) ? y : x; } + +template +CGAL_KERNEL_INLINE +Comparison_result +compare(const NT& n1, const NT& n2) +{ + if (n1 < n2) + { + return SMALLER ; + } + return (n2 < n1) ? LARGER : EQUAL; +} + +template +inline +NT +square( const NT& n) +{ return n*n; } + +template +inline +double +to_double( const NT& n) +{ return CGAL::to_double(n); } + +template +inline +NT +sqrt( const NT& n) +{ return CGAL::sqrt(n); } + +template +inline +bool +is_valid( const NT& n) +{ return CGAL::is_valid(n); } + +template +inline +bool +is_finite( const NT& n) +{ return CGAL::is_finite(n); } + +template +inline +bool +is_integral( const NT& n) +{ return CGAL::is_integral(n); } + + + +} // namespace NTS + +#endif // CGAL_NO_NTS_NAMESPACE + +} // namespace CGAL + +#endif // CGAL_NUMBER_UTILS_H diff --git a/Packages/Number_types/include/CGAL/number_utils_classes.h b/Packages/Number_types/include/CGAL/number_utils_classes.h new file mode 100644 index 00000000000..30de2a15f83 --- /dev/null +++ b/Packages/Number_types/include/CGAL/number_utils_classes.h @@ -0,0 +1,117 @@ +// ====================================================================== +// +// Copyright (c) 1997 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 13 +// +// file : include/CGAL/number_utils_classes.h +// package : Number_types (4.2) +// maintainer : Stefan Schirra +// source : +// revision : 2.0.5 +// revision_date : 14 Mar 99 +// author(s) : Michael Hoffmann +// +// coordinator : MPI, Saarbruecken () +// +// slight modification of Michael's 1.1 version +// ====================================================================== + +// to be included by number_utils.h + +#ifndef CGAL_NUMBER_UTILS_CLASSES_H +#define CGAL_NUMBER_UTILS_CLASSES_H 1 + +#ifndef CGAL_CONFIG_H +#include +#endif // CGAL_CONFIG_H + +#include +#include + +CGAL_BEGIN_NAMESPACE + +template < class NT > +struct Is_zero :public CGAL_STD::unary_function< NT, bool > { + bool operator()( const NT& x) const + { return is_zero( x); } +}; + +template < class NT > +struct Is_one :public CGAL_STD::unary_function< NT, bool > { + bool operator()( const NT& x) const + { return is_one( x); } +}; + +template < class NT > +struct Is_negative :public CGAL_STD::unary_function< NT, bool > { + bool operator()( const NT& x) const + { return is_negative( x); } +}; + +template < class NT > +struct Is_positive :public CGAL_STD::unary_function< NT, bool > { + bool operator()( const NT& x) const + { return is_positive( x); } +}; + +// Sign would result in a name clash with enum.h +template < class NT > +struct Sgn :public CGAL_STD::unary_function< NT, int > { + Sign operator()( const NT& x) const + { return sign( x); } +}; + +template < class NT > +struct Lexicographical_sign + :public CGAL_STD::binary_function< NT, NT, int > { + + Sign operator()( const NT& x, const NT& y) const + { return lexicographical_sign( x, y); } +}; + +template < class NT > +struct Abs :public CGAL_STD::unary_function< NT, NT > { + NT operator()( const NT& x) const + { return abs( x); } +}; + +template < class NT > +struct Min :public CGAL_STD::binary_function< NT, NT, NT > { + NT operator()( const NT& x, const NT& y) const + { return std::min( x, y); } +}; + +template < class NT > +struct Max :public CGAL_STD::binary_function< NT, NT, NT > { + NT operator()( const NT& x, const NT& y) const + { return std::max( x, y); } +}; + +template < class NT > +struct Compare + :public CGAL_STD::binary_function< NT, NT, Comparison_result > { + + Comparison_result + operator()( const NT& x, const NT& y) const + { return compare( x, y); } +}; + +template < class NT > +struct Square :public CGAL_STD::unary_function< NT, NT > { + + NT + operator()( const NT& x) const + { return square( x ); } +}; + +CGAL_END_NAMESPACE + +#endif // CGAL_NUMBER_UTILS_CLASSES_H diff --git a/Packages/Number_types/src/Double.C b/Packages/Number_types/src/Double.C new file mode 100644 index 00000000000..ce0ee027f29 --- /dev/null +++ b/Packages/Number_types/src/Double.C @@ -0,0 +1,173 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 13 +// +// source : Double.fw +// file : src/Double.C +// package : Number_types (4.2) +// maintainer : Stefan Schirra +// revision : 4.2 +// revision_date : 13 Dec 2000 +// author(s) : Stefan Schirra +// Geert-Jan Giezeman +// Sylvain Pion +// +// coordinator : MPI Informatik, Saarbruecken +// +// ====================================================================== + + +#include + +CGAL_BEGIN_NAMESPACE + + +#ifdef CGAL_OLD_FINITE_VALID + +#if !defined(__sgi) && !defined(__sun) && !defined(__hpux) && !defined(__linux) + +bool is_valid(double d) +{ + return (d == d); /* !!! */ +} + +bool is_finite(double d) +{ + return (d == d) && (CGAL_is_valid(d-d)); +} + +#else // custom definitions. + +#ifdef __sgi + +// implementation for SGI IRIX 5.3. +#include + +bool is_finite(double d) +{ + switch (fp_class_d(d)) { + case FP_POS_NORM: + case FP_NEG_NORM: + case FP_POS_ZERO: + case FP_NEG_ZERO: + case FP_POS_DENORM: + case FP_NEG_DENORM: + return true; + case FP_SNAN: + case FP_QNAN: + case FP_POS_INF: + case FP_NEG_INF: + return false; + } + return false; // NOT REACHED +} + +bool is_valid(double d) +{ + switch (fp_class_d(d)) { + case FP_POS_NORM: + case FP_NEG_NORM: + case FP_POS_ZERO: + case FP_NEG_ZERO: + case FP_POS_INF: + case FP_NEG_INF: + case FP_POS_DENORM: + case FP_NEG_DENORM: + return true; + case FP_SNAN: + case FP_QNAN: + return false; + } + return false; // NOT REACHED +} + +#endif // __sgi + +#ifdef __hpux + +// implementation for HP + +bool is_valid(double d) +{ + return isnan(d) == 0; +} + +bool is_finite(double d) +{ + switch (fpclassify(d)) { + case FP_PLUS_NORM: + case FP_MINUS_NORM: + case FP_PLUS_ZERO: + case FP_MINUS_ZERO: + case FP_PLUS_DENORM: + case FP_MINUS_DENORM: + return true; + case FP_PLUS_INF: + case FP_MINUS_INF: + case FP_SNAN: + case FP_QNAN: + return false; + } + return false; // NOT REACHED +} + +#endif // __hpux + +#ifdef __sun + +// implementation for SUN + +#ifdef __SVR4 +#include +#endif // __SVR4 + +#ifdef __svr4__ +#include +#endif // __svr4__ + +#include +bool is_finite(double d) +{ + if(finite(d)){ + return true; + } + return false; // NOT REACHED +} + +bool is_valid(double d) +{ + return isnan(d) == 0; +} + +#endif // __sun + +#ifdef __linux + +// Implementation for Linux + +bool is_finite(double d) +{ + return finite(d) != 0; +} + +bool is_valid(double d) +{ + return isnan(d) == 0; +} + +#endif // __linux +#endif // of custom definitions +#endif // CGAL_OLD_FINITE_VALID + +CGAL_END_NAMESPACE + + diff --git a/Packages/Number_types/src/Double_eps.C b/Packages/Number_types/src/Double_eps.C new file mode 100644 index 00000000000..6cc5eb16533 --- /dev/null +++ b/Packages/Number_types/src/Double_eps.C @@ -0,0 +1,64 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 13 +// +// source : Double_eps.fw +// file : Double_eps.C +// package : Number_types (4.2) +// maintainer : Stefan Schirra +// revision : 4.2 +// revision_date : 13 Dec 2000 +// author(s) : Andreas Fabri +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_BASIC_H +#include +#endif // CGAL_BASIC_H +#ifndef CGAL_DOUBLE_EPS_H +#include +#endif // CGAL_DOUBLE_EPS_H + +CGAL_BEGIN_NAMESPACE + +double Double_eps::_eps = 0.0; + + +double set_eps(double eps) + { + double e = Double_eps::_eps; + Double_eps::_eps = eps; + return e; + } + +Double_eps sqrt(const Double_eps &de) + { + return Double_eps(sqrt(de.d())); + } + +std::ostream& +operator<<(std::ostream& os, const Double_eps &de) +{ + os << de.d(); + return os; +} + +std::istream& +operator>>(std::istream& is, Double_eps &de) +{ + is >> de._d; + return is; +} +CGAL_END_NAMESPACE + diff --git a/Packages/Number_types/src/Float.C b/Packages/Number_types/src/Float.C new file mode 100644 index 00000000000..351af2efac0 --- /dev/null +++ b/Packages/Number_types/src/Float.C @@ -0,0 +1,181 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, December 13 +// +// source : Float.fw +// file : src/Float.C +// package : Number_types (4.2) +// maintainer : Stefan Schirra +// revision : 4.2 +// revision_date : 13 Dec 2000 +// author(s) : Stefan Schirra +// Geert-Jan Giezeman +// Sylvain Pion +// +// coordinator : MPI Informatik, Saarbruecken +// +// ====================================================================== + + +#include + + +#ifdef OLD_FINITE_VALID + +#if !defined(__sgi) && !defined(__sun) && !defined(__hpux) && !defined(__linux) + +CGAL_BEGIN_NAMESPACE + +bool is_valid(float d) +{ + return (d == d); /* !!! */ +} + +bool is_finite(float d) +{ + return (d == d) && (is_valid(d-d)); +} +CGAL_END_NAMESPACE + + +#else // custom definitions. + +#ifdef __sgi + +// implementation for SGI IRIX 5.3. +#include + +CGAL_BEGIN_NAMESPACE + +bool is_finite(float d) +{ + switch (fp_class_f(d)) { + case FP_POS_NORM: + case FP_NEG_NORM: + case FP_POS_ZERO: + case FP_NEG_ZERO: + case FP_POS_DENORM: + case FP_NEG_DENORM: + return true; + case FP_SNAN: + case FP_QNAN: + case FP_POS_INF: + case FP_NEG_INF: + return false; + } + return false; // NOT REACHED +} + +bool is_valid(float d) +{ + switch (fp_class_f(d)) { + case FP_POS_NORM: + case FP_NEG_NORM: + case FP_POS_ZERO: + case FP_NEG_ZERO: + case FP_POS_INF: + case FP_NEG_INF: + case FP_POS_DENORM: + case FP_NEG_DENORM: + return true; + case FP_SNAN: + case FP_QNAN: + return false; + } + return false; // NOT REACHED +} +CGAL_END_NAMESPACE + +#endif // __sgi + +#ifdef __hpux + +// implementation for HP + +CGAL_BEGIN_NAMESPACE + +bool is_valid(float f) +{ + return isnanf(f) == 0; +} + +bool is_finite(float f) +{ + switch (fpclassifyf(f)) { + case FP_PLUS_NORM: + case FP_MINUS_NORM: + case FP_PLUS_ZERO: + case FP_MINUS_ZERO: + case FP_PLUS_DENORM: + case FP_MINUS_DENORM: + return true; + case FP_PLUS_INF: + case FP_MINUS_INF: + case FP_SNAN: + case FP_QNAN: + return false; + } + return false; // NOT REACHED +} +CGAL_END_NAMESPACE + +#endif // __hpux + +#ifdef __sun + +// implementation for SUN + +#ifdef __SVR4 +#include +#endif // __SVR4 + +#ifdef __svr4__ +#include +#endif // __svr4__ + +// implementation for Sun + +CGAL_BEGIN_NAMESPACE + +bool is_valid(float f) +{ + return isnanf(f) == 0; +} + +bool is_finite(float f) +{ + return finite(f); +} +CGAL_END_NAMESPACE + +#endif // __sun + +#ifdef __linux +// Implementation for Linux +CGAL_BEGIN_NAMESPACE + +bool is_finite(float f) +{ + return finite(f) != 0; +} + +bool is_valid(float f) +{ + return isnan(f) == 0; +} +CGAL_END_NAMESPACE + + +#endif // __linux +#endif // custom definitions. +#endif // OLD_FINITE_VALID + diff --git a/Packages/Number_types/test/NumberTypeSupport/_test_Double.C b/Packages/Number_types/test/NumberTypeSupport/_test_Double.C new file mode 100644 index 00000000000..f232d5de818 --- /dev/null +++ b/Packages/Number_types/test/NumberTypeSupport/_test_Double.C @@ -0,0 +1 @@ +#include "../../src/Double.C" diff --git a/Packages/Number_types/test/NumberTypeSupport/_test_sign.C b/Packages/Number_types/test/NumberTypeSupport/_test_sign.C new file mode 100644 index 00000000000..24aef23e0cd --- /dev/null +++ b/Packages/Number_types/test/NumberTypeSupport/_test_sign.C @@ -0,0 +1,21 @@ +#include +#ifdef USE_LEDA +#include +#include +#include +#endif // USE_LEDA + +using namespace CGAL; + +int +main() +{ +#ifdef USE_LEDA + assert( _test_sign( leda_integer(1))); + assert( _test_sign( leda_rational(1))); + assert( _test_sign( leda_real(1))); +#endif // USE_LEDA + + return 0; +} + diff --git a/Packages/Number_types/test/NumberTypeSupport/_test_to_interval.C b/Packages/Number_types/test/NumberTypeSupport/_test_to_interval.C new file mode 100644 index 00000000000..c038eee017f --- /dev/null +++ b/Packages/Number_types/test/NumberTypeSupport/_test_to_interval.C @@ -0,0 +1,82 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : Test.fw +// file : _test_to_interval.C +// revision : 4.2 +// revision_date : 13 Dec 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include +#include + +#ifdef CGAL_USE_LEDA +#include +#include +#include +#include +#endif + +#ifdef CGAL_USE_GMP +#include +#endif + +#ifdef CGAL_USE_CLN +#include +#include +#endif + +int +main() +{ + bool ok = + test_to_interval( double()) + && test_to_interval( float()) + && test_to_interval( short()) + && test_to_interval( int()) + && test_to_interval( long()) + // && test_to_interval( long long()) + && test_to_interval( CGAL::Quotient< double>() ) + && test_to_interval( CGAL::Quotient< float>() ) + +#ifdef CGAL_USE_LEDA + && test_to_interval( leda_bigfloat() ) + && test_to_interval( leda_integer() ) + && test_to_interval( leda_rational() ) + && test_to_interval( leda_real() ) + && test_to_interval( CGAL::Quotient< leda_bigfloat>() ) + && test_to_interval( CGAL::Quotient< leda_integer>() ) + && test_to_interval( CGAL::Quotient< leda_real>() ) +#endif // CGAL_USE_LEDA + +#ifdef CGAL_USE_GMP + && test_to_interval( CGAL::Gmpz() ) + && test_to_interval( CGAL::Quotient< CGAL::Gmpz>() ) +#endif // CGAL_USE_GMP + +#ifdef CGAL_USE_CLN + && test_to_interval( cl_integer() ) + && test_to_interval( cl_rational() ) + && test_to_interval( CGAL::Quotient< cl_integer>() ) +#endif // CGAL_USE_CLN + ; + + return ok ? 0 : 1; +} diff --git a/Packages/Number_types/test/NumberTypeSupport/_test_valid_finite_double.C b/Packages/Number_types/test/NumberTypeSupport/_test_valid_finite_double.C new file mode 100644 index 00000000000..93f474c95db --- /dev/null +++ b/Packages/Number_types/test/NumberTypeSupport/_test_valid_finite_double.C @@ -0,0 +1,36 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : Test.fw +// file : _test_valid_finite_double.C +// revision : 4.2 +// revision_date : 13 Dec 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include +#include + +int +main() +{ + _test_valid_finite( (double)1.0 ); + + return 0; +} diff --git a/Packages/Number_types/test/NumberTypeSupport/_test_valid_finite_float.C b/Packages/Number_types/test/NumberTypeSupport/_test_valid_finite_float.C new file mode 100644 index 00000000000..8e804e64484 --- /dev/null +++ b/Packages/Number_types/test/NumberTypeSupport/_test_valid_finite_float.C @@ -0,0 +1,36 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : Test.fw +// file : _test_valid_finite_float.C +// revision : 4.2 +// revision_date : 13 Dec 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include +#include + +int +main() +{ + _test_valid_finite( (float)1.0 ); + + return 0; +} diff --git a/Packages/Number_types/test/NumberTypeSupport/cgal_test b/Packages/Number_types/test/NumberTypeSupport/cgal_test new file mode 100755 index 00000000000..7cbfd280fab --- /dev/null +++ b/Packages/Number_types/test/NumberTypeSupport/cgal_test @@ -0,0 +1,72 @@ +#! /bin/sh + +# This is a script for the CGAL test suite. Such a script must obey +# the following rules: +# +# - the name of the script is cgal_test +# - for every target two one line messages are written to the file 'error.txt' +# the first one indicates if the compilation was successful +# the second one indicates if the execution was successful +# if one of the two was not successful, the line should start with 'ERROR:' +# - running the script should not require any user interaction +# - the script should clean up object files and executables + +ERRORFILE=error.txt + +#---------------------------------------------------------------------# +# compile_and_run +#---------------------------------------------------------------------# + +compile_and_run() +{ + echo "Compiling $1 ... " + if eval 'make CGAL_MAKEFILE=$CGAL_MAKEFILE \ + TESTSUITE_CXXFLAGS="$TESTSUITE_CXXFLAGS" \ + TESTSUITE_LDFLAGS="$TESTSUITE_LDFLAGS" $1' ; then + echo " compilation of $1 succeeded" >> $ERRORFILE + else + echo " ERROR: compilation of $1 failed" >> $ERRORFILE + fi + + if [ -f $1 ] ; then + OUTPUTFILE=ProgramOutput.$1.$PLATFORM + rm -f $OUTPUTFILE + COMMAND="./$1" + if [ -f $1.cmd ] ; then + COMMAND="$COMMAND '`cat $1.cmd`'" + fi + if [ -f $1.cin ] ; then + COMMAND="echo '`cat $1.cin`' | $COMMAND" + fi + echo "Executing $1 ... " + echo + if eval 2>&1 $COMMAND > $OUTPUTFILE ; then + echo " execution of $1 succeeded" >> $ERRORFILE + else + echo " ERROR: execution of $1 failed" >> $ERRORFILE + fi + else + echo " ERROR: could not execute $1" >> $ERRORFILE + fi + + eval "2>&1 make CGAL_MAKEFILE=$CGAL_MAKEFILE clean > /dev/null " +} + +#---------------------------------------------------------------------# +# remove the previous error file +#---------------------------------------------------------------------# + +rm -f $ERRORFILE +touch $ERRORFILE + +#---------------------------------------------------------------------# +# compile and run the tests +#---------------------------------------------------------------------# + +compile_and_run _test_valid_finite_double +compile_and_run _test_valid_finite_float +compile_and_run doubletst +compile_and_run floattst +compile_and_run quotient_io +compile_and_run _test_sign +compile_and_run _test_to_interval diff --git a/Packages/Number_types/test/NumberTypeSupport/doubletst.C b/Packages/Number_types/test/NumberTypeSupport/doubletst.C new file mode 100644 index 00000000000..4f565509adc --- /dev/null +++ b/Packages/Number_types/test/NumberTypeSupport/doubletst.C @@ -0,0 +1,37 @@ +#include + +int main() +{ + double zero = 0.0; + double posnormal = 1.3; + double negnormal = -1.0; + double nan = zero/zero; + double posinf = posnormal/zero; + double neginf = negnormal/zero; + + if (!CGAL::is_valid(zero)) + return 1; + if (!CGAL::is_finite(zero)) + return 1; + if (!CGAL::is_valid(posnormal)) + return 1; + if (!CGAL::is_finite(posnormal)) + return 1; + if (!CGAL::is_valid(negnormal)) + return 1; + if (!CGAL::is_finite(negnormal)) + return 1; + if (CGAL::is_valid(nan)) + return 1; + if (CGAL::is_finite(nan)) + return 1; + if (!CGAL::is_valid(posinf)) + return 1; + if (CGAL::is_finite(posinf)) + return 1; + if (!CGAL::is_valid(neginf)) + return 1; + if (CGAL::is_finite(neginf)) + return 1; + return 0; +} diff --git a/Packages/Number_types/test/NumberTypeSupport/floattst.C b/Packages/Number_types/test/NumberTypeSupport/floattst.C new file mode 100644 index 00000000000..1fa76e6fbcf --- /dev/null +++ b/Packages/Number_types/test/NumberTypeSupport/floattst.C @@ -0,0 +1,37 @@ +#include + +int main() +{ + float zero = 0.0; + float posnormal = 1.3; + float negnormal = -1.0; + float nan = zero/zero; + float posinf = posnormal/zero; + float neginf = negnormal/zero; + + if (!CGAL::is_valid(zero)) + return 1; + if (!CGAL::is_finite(zero)) + return 1; + if (!CGAL::is_valid(posnormal)) + return 1; + if (!CGAL::is_finite(posnormal)) + return 1; + if (!CGAL::is_valid(negnormal)) + return 1; + if (!CGAL::is_finite(negnormal)) + return 1; + if (CGAL::is_valid(nan)) + return 1; + if (CGAL::is_finite(nan)) + return 1; + if (!CGAL::is_valid(posinf)) + return 1; + if (CGAL::is_finite(posinf)) + return 1; + if (!CGAL::is_valid(neginf)) + return 1; + if (CGAL::is_finite(neginf)) + return 1; + return 0; +} diff --git a/Packages/Number_types/test/NumberTypeSupport/include/CGAL/Ieee_double.h b/Packages/Number_types/test/NumberTypeSupport/include/CGAL/Ieee_double.h new file mode 100644 index 00000000000..3afaad838f5 --- /dev/null +++ b/Packages/Number_types/test/NumberTypeSupport/include/CGAL/Ieee_double.h @@ -0,0 +1,47 @@ + +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : Test.fw +// file : Ieee_double.h +// revision : 2.5 +// revision_date : 08 Oct 1999 +// author(s) : Stefan Schirra +// +// coordinator : MPI, Saarbruecken +// ============================================================================ + + +#include + +union IEEE_fpst_double { + double a; + struct { unsigned sign : 1; + unsigned exp :11; + unsigned high :20; + unsigned low :32; + } b; + struct { unsigned H :32; + unsigned L :32; + } c; +}; + +void +show( IEEE_fpst_double* p) +{ + std::cout << std::endl; + std::cout << std::hex << std::setw(8) << std::setfill('0') << p->c.H; + std::cout << ' '; + std::cout << std::hex << std::setw(8) << std::setfill('0') << p->c.L; + std::cout << std::endl; +} diff --git a/Packages/Number_types/test/NumberTypeSupport/include/CGAL/Ieee_float.h b/Packages/Number_types/test/NumberTypeSupport/include/CGAL/Ieee_float.h new file mode 100644 index 00000000000..ffe5fdfbe64 --- /dev/null +++ b/Packages/Number_types/test/NumberTypeSupport/include/CGAL/Ieee_float.h @@ -0,0 +1,43 @@ + +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : Test.fw +// file : Ieee_float.h +// revision : 2.5 +// revision_date : 08 Oct 1999 +// author(s) : Stefan Schirra +// +// coordinator : MPI, Saarbruecken +// ============================================================================ + + +#include + +union IEEE_fpst_float { + float a; + struct { unsigned sign : 1; + unsigned exp : 8; + unsigned high :23; + } b; + struct { unsigned L :32; + } c; +}; + +void +show( IEEE_fpst_float* p) +{ + std::cout << std::endl; + std::cout << std::hex << std::setw(8) << std::setfill('0') << p->c.L; + std::cout << std::endl; +} diff --git a/Packages/Number_types/test/NumberTypeSupport/include/CGAL/_test_sign.h b/Packages/Number_types/test/NumberTypeSupport/include/CGAL/_test_sign.h new file mode 100644 index 00000000000..08fe93c5163 --- /dev/null +++ b/Packages/Number_types/test/NumberTypeSupport/include/CGAL/_test_sign.h @@ -0,0 +1,40 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : Test.fw +// file : _test_sign.h +// revision : 4.2 +// revision_date : 13 Dec 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include + +CGAL_BEGIN_NAMESPACE + +template +bool +_test_sign(const NT& n) +{ + return ( (sign( NT( 0)) == ZERO) + && (sign( NT( 1)) == POSITIVE) + && (sign( NT(-1)) == NEGATIVE) ); +} +CGAL_END_NAMESPACE + diff --git a/Packages/Number_types/test/NumberTypeSupport/include/CGAL/_test_to_interval.h b/Packages/Number_types/test/NumberTypeSupport/include/CGAL/_test_to_interval.h new file mode 100644 index 00000000000..47b4859b9e9 --- /dev/null +++ b/Packages/Number_types/test/NumberTypeSupport/include/CGAL/_test_to_interval.h @@ -0,0 +1,36 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : Test.fw +// file : _test_to_interval.h +// revision : 4.2 +// revision_date : 13 Dec 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +template bool test_to_interval(const NT& n); + +template +bool +test_to_interval(const NT& n) +{ + CGAL::Interval_base I = CGAL::to_interval( NT(2) ); + assert( I.inf()<=2.0 && I.sup()>=2.0 ); + return true; +} diff --git a/Packages/Number_types/test/NumberTypeSupport/include/CGAL/_test_valid_finite_double.h b/Packages/Number_types/test/NumberTypeSupport/include/CGAL/_test_valid_finite_double.h new file mode 100644 index 00000000000..23032c6c0fc --- /dev/null +++ b/Packages/Number_types/test/NumberTypeSupport/include/CGAL/_test_valid_finite_double.h @@ -0,0 +1,59 @@ + +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : Test.fw +// file : _test_valid_finite_double.h +// revision : 4.2 +// revision_date : 13 Dec 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include + +bool +_test_valid_finite( const double& ) +{ + double d0 = 0.0; + double d1 = 1.0; + double d2; + + // d0 = 0.0; + // d1 = 1.0; + + assert( CGAL::is_valid( d0) ); + assert( CGAL::is_valid( d1) ); + + assert( CGAL::is_finite( d0) ); + assert( CGAL::is_finite( d1) ); + + if ( CGAL::is_valid( d1/d0 - d1/d0 )) + { d2 = d1/d0 - d1/d0; show( reinterpret_cast(&d2)); } + if ( CGAL::is_finite( d1/d0 )) + { d2 = d1/d0; show( reinterpret_cast(&d2)); } + + assert( CGAL::is_valid( d1/d0 )); + assert( !CGAL::is_valid( d1/d0 - d1/d0 )); + assert( !CGAL::is_finite( d1/d0 )); + + + assert( CGAL::is_valid( std::sqrt( d1)) ); + assert( !CGAL::is_valid( std::sqrt( -d1)) ); + + return true; +} diff --git a/Packages/Number_types/test/NumberTypeSupport/include/CGAL/_test_valid_finite_float.h b/Packages/Number_types/test/NumberTypeSupport/include/CGAL/_test_valid_finite_float.h new file mode 100644 index 00000000000..89d9a9a8673 --- /dev/null +++ b/Packages/Number_types/test/NumberTypeSupport/include/CGAL/_test_valid_finite_float.h @@ -0,0 +1,58 @@ + +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : Test.fw +// file : _test_valid_finite_float.h +// revision : 4.2 +// revision_date : 13 Dec 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include + +bool +_test_valid_finite( const float& ) +{ + float d0 = 0.0; + float d1 = 1.0; + float d2; + + // d0 = 0.0; + // d1 = 1.0; + + assert( CGAL::is_valid( d0) ); + assert( CGAL::is_valid( d1) ); + + assert( CGAL::is_finite( d0) ); + assert( CGAL::is_finite( d1) ); + + if ( CGAL::is_valid( d1/d0 - d1/d0 )) + { d2 = d1/d0 - d1/d0; show( reinterpret_cast(&d2)); } + if ( CGAL::is_finite( d1/d0 )) + { d2 = d1/d0; show( reinterpret_cast(&d2)); } + + assert( CGAL::is_valid( d1/d0 )); + assert( !CGAL::is_valid( d1/d0 - d1/d0 )); + assert( !CGAL::is_finite( d1/d0 )); + + + + return true; +} + diff --git a/Packages/Number_types/test/NumberTypeSupport/makefile b/Packages/Number_types/test/NumberTypeSupport/makefile new file mode 100644 index 00000000000..29a2c4c7eb5 --- /dev/null +++ b/Packages/Number_types/test/NumberTypeSupport/makefile @@ -0,0 +1,87 @@ +# Created by the script create_makefile +# This is the makefile for compiling a CGAL application. + +#---------------------------------------------------------------------# +# include platform specific settings +#---------------------------------------------------------------------# +# Choose the right include file from the /make directory. + +# CGAL_MAKEFILE = ENTER_YOUR_INCLUDE_MAKEFILE_HERE +include $(CGAL_MAKEFILE) + +#---------------------------------------------------------------------# +# compiler flags +#---------------------------------------------------------------------# + +CXXFLAGS = \ + $(TESTSUITE_CXXFLAGS) \ + $(EXTRA_FLAGS) \ + -Iinclude \ + $(CGAL_CXXFLAGS) \ + $(DEBUG_OPT) + +#---------------------------------------------------------------------# +# linker flags +#---------------------------------------------------------------------# + +LIBPATH = \ + $(TESTSUITE_LIBPATH) \ + $(CGAL_LIBPATH) + +LDFLAGS = \ + $(TESTSUITE_LDFLAGS) \ + $(CGAL_LDFLAGS) + +#---------------------------------------------------------------------# +# target entries +#---------------------------------------------------------------------# + +all: \ + _test_Double \ + _test_sign \ + _test_valid_finite_double \ + _test_valid_finite_float \ + _test_to_interval \ + doubletst \ + floattst \ + quotient_io + +_test_Double$(EXE_EXT): _test_Double$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)_test_Double _test_Double$(OBJ_EXT) $(LDFLAGS) + +_test_sign$(EXE_EXT): _test_sign$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)_test_sign _test_sign$(OBJ_EXT) $(LDFLAGS) + +_test_valid_finite_double$(EXE_EXT): _test_valid_finite_double$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)_test_valid_finite_double _test_valid_finite_double$(OBJ_EXT) $(LDFLAGS) + +_test_valid_finite_float$(EXE_EXT): _test_valid_finite_float$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)_test_valid_finite_float _test_valid_finite_float$(OBJ_EXT) $(LDFLAGS) + +_test_to_interval$(EXE_EXT): _test_to_interval$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)_test_to_interval _test_to_interval$(OBJ_EXT) $(LDFLAGS) + +doubletst$(EXE_EXT): doubletst$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)doubletst doubletst$(OBJ_EXT) $(LDFLAGS) + +floattst$(EXE_EXT): floattst$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)floattst floattst$(OBJ_EXT) $(LDFLAGS) + +quotient_io$(EXE_EXT): quotient_io$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)quotient_io quotient_io$(OBJ_EXT) $(LDFLAGS) + +clean: \ + _test_sign.clean \ + _test_valid_finite_double.clean \ + _test_valid_finite_float.clean \ + doubletst.clean \ + floattst.clean \ + quotient_io.clean + +#---------------------------------------------------------------------# +# suffix rules +#---------------------------------------------------------------------# + +.C$(OBJ_EXT): + $(CGAL_CXX) $(CXXFLAGS) $(OBJ_OPT) $< + diff --git a/Packages/Number_types/test/NumberTypeSupport/quotient_in b/Packages/Number_types/test/NumberTypeSupport/quotient_in new file mode 100644 index 00000000000..2b1e046e633 --- /dev/null +++ b/Packages/Number_types/test/NumberTypeSupport/quotient_in @@ -0,0 +1,8 @@ +98.25 / 27.5 +19.0 +20.05 +1998 / 29.875 +12 +/ +10.0 +42.25 diff --git a/Packages/Number_types/test/NumberTypeSupport/quotient_io.C b/Packages/Number_types/test/NumberTypeSupport/quotient_io.C new file mode 100644 index 00000000000..d7c92832652 --- /dev/null +++ b/Packages/Number_types/test/NumberTypeSupport/quotient_io.C @@ -0,0 +1,51 @@ +#include +#include +#include +// #include +#include +#include +#include + +int +main() +{ + std::ifstream S; + std::ofstream T; + std::ifstream U; + S.open("quotient_in"); + assert( S ); + + std::vector > V1; + std::vector > V2; + std::copy( std::istream_iterator >(S), + std::istream_iterator >(), + std::back_inserter(V1) ); + S.close(); + + T.open("quotient_out"); + assert( T ); + std::copy( V1.begin(), + V1.end(), + std::ostream_iterator >(T,"\n") ); + T.close(); + + U.open("quotient_out"); + assert( T ); + std::copy( std::istream_iterator >(U), + std::istream_iterator >(), + std::back_inserter(V2) ); + U.close(); + + + if ( V1 != V2 ) + { + std::cout << "V1" << std::endl; + std::copy( V1.begin(), V1.end(), std::ostream_iterator >(std::cout,"\n") ); + std::cout << "V2" << std::endl; + std::copy( V2.begin(), V2.end(), std::ostream_iterator >(std::cout,"\n") ); + } + + assert( V1 == V2 ); + + return 0; +} diff --git a/Packages/Number_types/test/NumberTypeSupport/quotient_out b/Packages/Number_types/test/NumberTypeSupport/quotient_out new file mode 100644 index 00000000000..0ea0a7cd48b --- /dev/null +++ b/Packages/Number_types/test/NumberTypeSupport/quotient_out @@ -0,0 +1,6 @@ +98.25/27.5 +19/1 +20.05/1 +1998/29.875 +12/10 +42.25/1 diff --git a/Packages/Number_types/version b/Packages/Number_types/version new file mode 100644 index 00000000000..7b9d0f34fc3 --- /dev/null +++ b/Packages/Number_types/version @@ -0,0 +1,2 @@ +4.2 (13 Dec 2000) +maintainer: Stefan Schirra diff --git a/Packages/Robustness/changes.txt b/Packages/Robustness/changes.txt new file mode 100644 index 00000000000..336829bb55d --- /dev/null +++ b/Packages/Robustness/changes.txt @@ -0,0 +1,70 @@ +1.5 (20 Sep 2000) + +- workaround for VC++ added in triangulation_of_intersection_points_2: + #ifdef CGAL_CFG_MATCHING_BUG_2 + #define CGAL_IA_CT double + #define CGAL_IA_PROTECTED true + #define CGAL_IA_ET leda_real + #define CGAL_IA_CACHE No_Filter_Cache + #endif + #include + as suggested by Sylvain Pion + +1.4 (01 Aug 2000) + +- C-array with non-constant size in orientation.C moved to dynamic + heap, i.e. allocated using new + +1.3 (17 Jul 2000) + +- std::atoi replaced by CGAL_CLIB_STD::atoi +- missing std:: added to some back_inserter calls +- adjustments to changes in interval arithmetic + o Interval_nt used instead of Interval_nt + o Interval_base::unsafe_comparison used + +1.2 (18 May 2000) + +- README file added +- orientation_2.C and orientation_IA_2.C added to demo/Robustness + they count how often orientation test computation is successful + with double and with interval arithmetic, respectively. + +1.1.2 (08 May 2000) + +- std:: added to cin + +1.1.1 (19 Apr 2000) + +- std:: added to back_inserter +- CGAL_CLIB_STD:: added to atoi +- decls moved out of for scope to please VC++ +- CGAL_USE_LEDA checked + +1.1 (18 Apr 2000) + +- hull_of_intersection_points_2.C in demo/Robustness + computes the convex hull of intersection points of random + line segments using doubles and leda_reals. Shows points + incorrectly classified as extreme points by the double-based + computation + +- triangulation_of_intersection_points_2.C in demo/Robustness + computes the Delaunay triangulation of intersection points of + random line segments using leda_reals, Filtered_exact< double, + leda_real> and double. With doubles you often get assertion + violations. By altering the failure behaviour of CGAL, the + assertion violation is shown in the window. (Also, sometimes + the Delaunay code run into an infinite loop.) + +1.0.1 (21 Mar 2000) + +- packaging script fixed +- file header fixed + +1.0 (21 Mar 2000) + +- intersection_points_on_segment_2.C in demo/Robustness + creates segments with integral endpoints and checks whether + intersection point lies on segments using different kernels + diff --git a/Packages/Robustness/demo/Robustness/README b/Packages/Robustness/demo/Robustness/README new file mode 100644 index 00000000000..3da3c7bd026 --- /dev/null +++ b/Packages/Robustness/demo/Robustness/README @@ -0,0 +1,232 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : readme.fw +// file : demo/Robustness/README +// revision : 1.5 +// revision_date : 20 Sep 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +This directory contains some example programs that +illustrate robustness and precision issues in CGAL. +The demos use LEDA, so LEDA must be installed to run the +examples: + +intersection_points_on_segment_2 +triangulation_of_intersection_points_2 +hull_of_intersection_points_2 + + + + +*********************************************************** + intersection_points_on_segment_2: +*********************************************************** + +In this program, two groups of segments with endpoints on +two horizontal and vertical lines resp. are generated at +random. Then for all pairs of segments with one segments +from the first group and one segments from the second group +their intersection point is computed and checked to lie on +the intersectiong segments. Of course, with real geometry +an intersection point of two segments lies on these +segments. With floating-point arithmetic this "axiom" often +does not hold anymore. + +The program does the intersection and checking step for +different CGAL kernels and reports a success statistics +for each of them. They all operate on the same input data. +The standard CGAL intersection routine is used to compute +the intersection point, the checking uses the has_on() +member function of CGAL segments, see also the reference +manual. The program visualizes problematic intersection +points. Whenever the has_on() fails for both segments, the +point is drawn in red. If exactly one of the two has_on() +test fails, the intersection point is drawn in orange. + +The kernels used are the Cartesian and the homogeneous +CGAL kernels, both instantiated with float and double. +The statistics shows that it pays off to have kernels with +different coordinate representation. For our example, where +all segments have integral endpoints with absolute value +less than 100 000 , the homogeneous kernel is almost 100% +correct; the checks fail only rarely, whereas with the other +kernels they fail very often. The homogeneous kernel is +superior in this context, because it avoids division +operation. On the other hand, it is slower, because it does +more basic arithmetic operations. + +The success of the CGAL::Homogeneous depends on the +size (number of bits) of the coordinates of the segment +endpoints. For smaller coordinates CGAL::Homogeneous +would even guarantee corrcet results, while for larger +absolute coordinates, the results would be worse. +As CGAL::Homogeneous versus CGAL::Cartesian +shows, for larger absolute coordinates, the results with +CGAL::Homogeneous might be even worse than the +results with CGAL::Cartesian. + +----------------------------------------------------------- +To quit, click into the window outside the drawing areas. +----------------------------------------------------------- +You can pass a number to intersection_points_on_segment_2, +which specifies the number of segments generated in a +group. Be aware that the number of intersection points and +hence the running time is quadratic in the number of +segments. The default number of segments is 50. +----------------------------------------------------------- +*********************************************************** + + + + +*********************************************************** + orientation_2: +*********************************************************** + +n points with double coordinates are generated at random, +once uniformly distributed in a square and once uniformly +distributed on a segment. n^3 orientation tests are made +using the CGAL::orientation predicate from Cartesian. +In the first setting, almost always all orientation tests +give the correct result. This is the basic observation +for the use of floating-point filters: Often (how often +depends on the type of predicates that are used) floating- +point computation gives the correct results. Only if there +are degeneracies or near-degeneracies, the float based +computation fails. The random points on a segment are not +really degenerate. Since the coordinate type is double, +they are only almost on a segment. In this near-degenerate +configuration, a significant portion of the orientation +tests fails. + +----------------------------------------------------------- +To quit, click into the window outside the drawing areas. +----------------------------------------------------------- +You can pass a number to orientation_2, which specifies the +number of points generated in a group. Be aware that the +running time is cubic (!) in the number of points. The +default number of points is 30 (-> 27000 tests). +----------------------------------------------------------- +*********************************************************** + + + + +*********************************************************** + orientation_IA_2: +*********************************************************** + +Same as orientation_2, but the orientation test computation +is now done with interval arithmetic (CGAL::Interval_nt). +The interval arithmetic throws an exception, if intervals to +be compared do overlap. We count, how often interval +arithmetic can reliably determine the orientation. Only the +near degenerate cases cause problems. + +----------------------------------------------------------- +To quit, click into the window outside the drawing areas. +----------------------------------------------------------- +You can pass a number to orientation_IA_2, which specifies +the number of points generated in a group. Be aware that the +running time is cubic (!) in the number of points. The +default number of points is 30 (-> 27000 tests). +----------------------------------------------------------- +*********************************************************** + + + + +*********************************************************** + triangulation_of_intersection_points_2: +*********************************************************** + +In this examples, segments are generated at random (random +endpoints in a square) and their intersection points are +computed. Then the Delaunay triangulation of this set of +points is constructed, using different kernels: First, +Cartesian, next Cartesian>, and finally Cartesian. + +Computation with Cartesian gives a correct +Delaunay triangulation, but it takes some time due to the +constructed degeneracies in the point set. + +Computation with Cartesian> +does not give the correct triangulation, but it causes no +robustness problems. The first step, computation of +intersection points, is still subject to rounding errors. +The second step, computation of the Delaunay triangulation +of the points computed in the first step, is done exactly! +Since some collinearities might get lost in the first step, +the number of triangles might differ from the triangulation +of the correct intersection points. + +Cartesian often causes serious problems. Both steps +are subject to rounding errors. Inconsistent results due +to rounding errors then cause violation of invariants and +the CGAL algorithm complains about this. If such a violation +of invariants, pre- or postconditions arises, the error +message is printed in red in the window. + +See also hull_of_intersection_points_2. + +----------------------------------------------------------- +To quit, click into the drawing area. +----------------------------------------------------------- +*********************************************************** + + + + +*********************************************************** + hull_of_intersection_points_2: +*********************************************************** + +In this examples, segments are generated at random (random +endpoints in a square) and their intersection points are +computed. Then the convex hull of these intersection points +is computed. The extreme points computed with double +arithmetic and the Cartesian kernel, are shown in blue, +edges of the hull that are not supported by an input segment +are shown in blue. With CGAL::Cartesian, sometimes +intersection points are classified as extreme although they +are not. Such points are encircled by a red circle (you may +have to try a few times before this happens). It is easy to +verify visually that such an point incorrectly classified +as extreme point, is not extreme. Let's call the point P. +For one of the segments intersecting in P, let's call it S, +there is for each of two endpoints of S an extreme (blue) +points on it that is closer to the endpoint then P. Hence P +cannot be extreme. The detection of points incorrectly +classified as extreme points uses Cartesian. + +This precision problem is caused by rounding-errors in the +intersection point computation and the orientation tests. +These rounding-errors destroy collinearity of the +intersection points on a segment. + +See also triangulation_of_intersection_points_2. + +----------------------------------------------------------- +To quit, click into the drawing area. +----------------------------------------------------------- +*********************************************************** + + diff --git a/Packages/Robustness/demo/Robustness/cgal_test b/Packages/Robustness/demo/Robustness/cgal_test new file mode 100755 index 00000000000..da8c1be7158 --- /dev/null +++ b/Packages/Robustness/demo/Robustness/cgal_test @@ -0,0 +1,48 @@ +#! /bin/sh + +# This is a script for the CGAL test suite. Such a script must obey +# the following rules: +# +# - the name of the script is cgal_test +# - for every target two one line messages are written to the file 'error.txt' +# the first one indicates if the compilation was successful +# the second one indicates if the execution was successful +# if one of the two was not successful, the line should start with 'ERROR:' +# - running the script should not require any user interaction +# - the script should clean up object files and executables + +ERRORFILE=error.txt + +#---------------------------------------------------------------------# +# compile +#---------------------------------------------------------------------# + +compile() +{ + if eval 'make CGAL_MAKEFILE=$CGAL_MAKEFILE \ + TESTSUITE_CXXFLAGS="$TESTSUITE_CXXFLAGS" \ + TESTSUITE_LDFLAGS="$TESTSUITE_LDFLAGS" all' >compiler_output 2>&1 ; then + echo " succesful compilation " >> $ERRORFILE + cat compiler_output + else + echo " ERROR: compilation " >> $ERRORFILE + eval 'make -k CGAL_MAKEFILE=$CGAL_MAKEFILE \ + TESTSUITE_CXXFLAGS="$TESTSUITE_CXXFLAGS" \ + TESTSUITE_LDFLAGS="$TESTSUITE_LDFLAGS" all' + fi + rm compiler_output + eval "2>&1 make CGAL_MAKEFILE=$CGAL_MAKEFILE clean > /dev/null " +} + +#---------------------------------------------------------------------# +# remove the previous error file +#---------------------------------------------------------------------# + +rm -f $ERRORFILE +touch $ERRORFILE + +#---------------------------------------------------------------------# +# compile and run the tests +#---------------------------------------------------------------------# + + compile diff --git a/Packages/Robustness/demo/Robustness/cocircular_2.C b/Packages/Robustness/demo/Robustness/cocircular_2.C new file mode 100644 index 00000000000..b38ddb91702 --- /dev/null +++ b/Packages/Robustness/demo/Robustness/cocircular_2.C @@ -0,0 +1,123 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : orientation.fw +// file : demo/Robustness/cocircular_2.C +// revision : 1.5 +// revision_date : 20 Sep 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#ifndef CGAL_USE_LEDA +int main() { std::cout << "\nSorry, this demo needs LEDA\n"; return 0; } +#else +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +typedef CGAL::Cartesian CartesianDouble; +typedef CGAL::Point_2 Point; +typedef CGAL::Creator_uniform_2 Pt_creator; +typedef std::vector Vector; +typedef CGAL::Cartesian CartesianLedaReal; +typedef CGAL::Min_circle_2_traits_2 Traits; + +typedef CGAL::Min_circle_2_traits_2 Traits; +typedef CGAL::Min_circle_2 Min_circle; +typedef CGAL::Min_ellipse_2_traits_2 ETraits; +typedef CGAL::Min_ellipse_2 Min_ellipse; +typedef CGAL::Triangulation_euclidean_traits_2 Gtd; +typedef CGAL::Triangulation_vertex_base_2 Vbd; +typedef CGAL::Triangulation_face_base_2 Fbd; +typedef CGAL::Triangulation_default_data_structure_2 Tdsd; +typedef CGAL::Delaunay_triangulation_2 DT_double; + + +int +main(int argc, char** argv) +{ + int N = (argc > 1) ? CGAL_CLIB_STD::atoi(argv[1]) : 30; + + typedef leda_window CGAL_Stream; + CGAL_Stream W( 500, 550); + CGAL_Stream W1( 400, 400); + CGAL::cgalize(W); + CGAL::cgalize(W1); + + W.init( 0, 500, 0); + W1.init(-0.12, 0.12, -0.12); + W.display(); + W1.display(W,50,50); + + + Vector points1; + typedef CGAL::Random_points_on_circle_2 P_on_circle; + P_on_circle pc1( 0.1); + CGAL::copy_n( pc1, N, std::back_inserter(points1)); + + W1.set_fg_color(leda_pink); + std::copy( points1.begin(), points1.end(), + CGAL::Ostream_iterator< Point, CGAL_Stream>( W1)); + + Min_circle mc2( points1.begin(), points1.end(), true); + W1 << mc2.circle(); + W.draw_ctext(250, 80, "min circle computed"); + + Min_ellipse me2( points1.begin(), points1.end(), true); + W1.set_fg_color(leda_blue); + W1 << me2.ellipse(); + W.draw_ctext(250, 60, "min ellipse computed"); + + DT_double DTD; + std::copy( points1.begin(), points1.end(), std::back_inserter( DTD )); + W1.set_fg_color(leda_grey1); + W1 << DTD; + W1.set_fg_color(leda_pink); + W1 << mc2.circle(); + W1.set_fg_color(leda_blue); + W1 << me2.ellipse(); + W1.set_fg_color(leda_pink); + std::copy( points1.begin(), points1.end(), + CGAL::Ostream_iterator< Point, CGAL_Stream>( W1)); + W.draw_ctext(250, 40, "Delaunay triangulation computed"); + + W.read_mouse(); + + return 0; +} +#endif // USE_LEDA diff --git a/Packages/Robustness/demo/Robustness/hull_of_intersection_points_2.C b/Packages/Robustness/demo/Robustness/hull_of_intersection_points_2.C new file mode 100644 index 00000000000..5abb36de823 --- /dev/null +++ b/Packages/Robustness/demo/Robustness/hull_of_intersection_points_2.C @@ -0,0 +1,188 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : intersection_and_then.fw +// file : demo/Robustness/hull_of_intersection_points_2.C +// revision : 1.5 +// revision_date : 20 Sep 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#ifndef CGAL_USE_LEDA +int main() { std::cout << "\nSorry, this demo needs LEDA\n"; return 0; } +#else +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + + +int +main( int argc, char** argv) +{ + typedef CGAL::Cartesian C_double; + typedef CGAL::Point_2< C_double> double_Point; + typedef CGAL::Segment_2< C_double> double_Segment; + typedef CGAL::Cartesian C_real; + typedef CGAL::Point_2< C_real> real_Point; + typedef CGAL::Segment_2< C_real> real_Segment; + typedef CGAL::Creator_uniform_2 + Point_creator; + typedef CGAL::Random_points_in_square_2 + Source; + typedef CGAL::Creator_uniform_2 + Segment_creator; + typedef CGAL::Join_input_iterator_2 + Segment_iterator; + + Source RS(280); + Segment_iterator g( RS, RS); + + int N; + if ( argc == 2) + { N = CGAL_CLIB_STD::atoi( argv[1]); } + else + { std::cout << "How many segments? "; std::cin >> N; } + + std::vector< double_Segment> double_segments; + CGAL::copy_n( g, N, std::back_inserter( double_segments) ); + std::vector real_segments; + CGAL::Cartesian_double_to_Cartesian converter; + std::transform( double_segments.begin(), + double_segments.end(), + std::back_inserter( real_segments), + converter ); + std::vector double_intersection_points; + std::vector real_intersection_points; + + CGAL::segment_intersection_points_2( + double_segments.begin(), + double_segments.end(), + std::back_inserter( double_intersection_points), + C_double() ); + CGAL::segment_intersection_points_2( + real_segments.begin(), + real_segments.end(), + std::back_inserter( real_intersection_points), + C_real() ); + + + std::vector double_convex_hull; + std::vector real_convex_hull; + + typedef leda_window CGAL_Stream; + CGAL_Stream W0( 450, 500); + CGAL_Stream W( 400, 400); + CGAL::cgalize(W0); + CGAL::cgalize(W); + + W.init( -300.0, 300.0, -300.0); + W0.init( 0, 450, 0); + W0.display(); + W.display(W0,25,25); + W0.set_fg_color(leda_black); + W0.draw_ctext(225,485, + leda_string("Convex hull of intersection points")); + W0.set_fg_color(leda_blue); + W0 << double_Point(50,50); + W0.set_fg_color(leda_red); + W0 << double_Point(50,25); + W0 << CGAL::Circle_2< C_double>( double_Point(50,25), 40.0); + W0.set_fg_color(leda_black); + W0.draw_text(65,58, + leda_string("correct extreme point")); + W0.set_fg_color(leda_black); + W0.draw_text(65,35, + leda_string("incorrect extreme point computed with double arithmetic")); + + CGAL::convex_hull_points_2( + double_intersection_points.begin(), + double_intersection_points.end(), + std::back_inserter( double_convex_hull)); + W.set_fg_color( leda_grey2); + CGAL::send_to_stream_as_polygon( W, double_convex_hull.begin(), + double_convex_hull.end()); + W.set_fg_color( leda_green); + std::copy( double_segments.begin(), + double_segments.end(), + CGAL::Ostream_iterator< double_Segment, CGAL_Stream>( W)); + CGAL::convex_hull_points_2( + real_intersection_points.begin(), + real_intersection_points.end(), + std::back_inserter( real_convex_hull)); + W.set_fg_color( leda_blue); + std::copy( double_convex_hull.begin(), + double_convex_hull.end(), + CGAL::Ostream_iterator< double_Point, CGAL_Stream>( W)); + + if ( real_convex_hull.size() != double_convex_hull.size() ) + { + W.set_fg_color( leda_red); + std::copy( double_convex_hull.begin(), + double_convex_hull.end(), + CGAL::Ostream_iterator< double_Point, CGAL_Stream>( W)); + W.set_fg_color( leda_blue); + std::copy( real_convex_hull.begin(), + real_convex_hull.end(), + CGAL::Ostream_iterator< real_Point, CGAL_Stream>( W)); + std::vector::iterator dble_it; + std::vector::iterator real_it; + real_it = real_convex_hull.begin(); + W.set_fg_color(leda_red); + for ( dble_it = double_convex_hull.begin(); + dble_it != double_convex_hull.end(); + ++dble_it ) + { + if ( (real_it == real_convex_hull.end()) + || (( CGAL::squared_distance( + *dble_it, + double_Point( CGAL::to_double(real_it->x()), + CGAL::to_double(real_it->y()) )) + ) > 0.125 ) + ) + { + W << CGAL::Circle_2< C_double>( *dble_it, 80.0); + } + else + { + if ( real_it != real_convex_hull.end() ) + { ++real_it; } + } + } + } + W.read_mouse(); + + return 0; +} +#endif // USE_LEDA diff --git a/Packages/Robustness/demo/Robustness/include/CGAL/further_point_generators_2.h b/Packages/Robustness/demo/Robustness/include/CGAL/further_point_generators_2.h new file mode 100644 index 00000000000..e798cb9f19d --- /dev/null +++ b/Packages/Robustness/demo/Robustness/include/CGAL/further_point_generators_2.h @@ -0,0 +1,134 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : online.fw +// file : demo/Robustness/include/CGAL/further_point_generators_2.h +// revision : 1.5 +// revision_date : 20 Sep 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_FURTHER_POINT_GENERATORS_2_H +#define CGAL_FURTHER_POINT_GENERATORS_2_H + +#include +#include +#include + +namespace CGAL { + +class Point_on_horizontal_bar +{ + public: + typedef Cartesian::Point_2 Point_2; + typedef std::output_iterator_tag iterator_category; + typedef Point_2 value_type; + typedef void difference_type; + typedef void pointer; + typedef void reference; + + Point_on_horizontal_bar( int lo_x, int hi_x, int Y) + : a(lo_x), b(hi_x), y(Y) + { generate_point(); } + + void + generate_point() + { + int x = RS.get_int(a,b); + p = Point_2( x, y); + } + + Point_2 + operator*() + { return p; } + + Point_on_horizontal_bar& + operator++() + { + generate_point(); + return *this; + } + + Point_on_horizontal_bar + operator++(int) + { + Point_on_horizontal_bar tmp = *this; + ++(*this); + return tmp; + } + + + private: + int a, b; + Random RS; + int y; + Point_2 p; + +}; + +class Point_on_vertical_bar +{ + public: + typedef Cartesian::Point_2 Point_2; + typedef std::output_iterator_tag iterator_category; + typedef Point_2 value_type; + typedef void difference_type; + typedef void pointer; + typedef void reference; + + Point_on_vertical_bar( int lo_y, int hi_y, int X) + : a(lo_y), b(hi_y), x(X) + { generate_point(); } + + void + generate_point() + { + int y = RS.get_int(a,b); + p = Point_2( x, y); + } + + Point_2 + operator*() + { return p; } + + Point_on_vertical_bar& + operator++() + { + generate_point(); + return *this; + } + + Point_on_vertical_bar + operator++(int) + { + Point_on_vertical_bar tmp = *this; + ++(*this); + return tmp; + } + + + private: + int a, b; + Random RS; + int x; + Point_2 p; + +}; + +} // namespace CGAL +#endif // CGAL_FURTHER_POINT_GENERATORS_2_H diff --git a/Packages/Robustness/demo/Robustness/include/CGAL/intersection_test_statistics.h b/Packages/Robustness/demo/Robustness/include/CGAL/intersection_test_statistics.h new file mode 100644 index 00000000000..19aef7d2999 --- /dev/null +++ b/Packages/Robustness/demo/Robustness/include/CGAL/intersection_test_statistics.h @@ -0,0 +1,107 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : online.fw +// file : demo/Robustness/include/CGAL/intersection_test_statistics.h +// revision : 1.5 +// revision_date : 20 Sep 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifndef CGAL_INTERSECTION_TEST_STATISTICS_H +#define CGAL_INTERSECTION_TEST_STATISTICS_H + +#include + +template +void +intersection_statistics( ForwardIterator1 first1, ForwardIterator1 last1, + ForwardIterator2 first2, ForwardIterator2 last2, + leda_string& str, const Traits& T ) +{ + typename Traits::Point_2 p; + typename Traits::Intersect_2 intersection = T.intersect_2_object(); + CGAL::Timer watch; + int is_count = 0; + int ol_count = 0; + int bl_count = 0; + watch.start(); + for( ForwardIterator1 i = first1; i != last1; ++i) + for( ForwardIterator2 j = first2; j != last2; ++j) + { + if ( assign(p, intersection(*i,*j)) ) + { + is_count++; + int ok1 = ( i->has_on(p)) ? 1 : 0; + int ok2 = ( j->has_on(p)) ? 1 : 0; + bl_count += ok1*ok2; + ol_count += ok1+ok2; + } + } + watch.stop(); + + str = leda_string(); + str += leda_string("%d intersection points found,\n", + is_count); + str += leda_string("%d of them (%2.2f%%) lie on both\n segments. ", + bl_count, (double)bl_count/is_count * 100); + str += leda_string("Out of the %d \npoint-on-segment tests, \n%d ", + 2*is_count, ol_count ); + str += leda_string("(%2.2f%%) are positive.\n", + (double)ol_count/is_count * 50); + str += leda_string("Computation time %2.2f secs.\n", + watch.time() ); +} + + +template +void +draw_errors( Stream& S, + ForwardIterator1 first1, ForwardIterator1 last1, + ForwardIterator2 first2, ForwardIterator2 last2, + const Traits& T ) +{ + typename Traits::Point_2 p; + typename Traits::Intersect_2 intersection = T.intersect_2_object(); + int is_count = 0; + int ol_count = 0; + int bl_count = 0; + for( ForwardIterator1 i = first1; i != last1; ++i) + for( ForwardIterator2 j = first2; j != last2; ++j) + { + if ( assign(p, intersection(*i,*j)) ) + { + is_count++; + int ok1 = ( i->has_on(p)) ? 1 : 0; + int ok2 = ( j->has_on(p)) ? 1 : 0; + bl_count += ok1*ok2; + ol_count += ok1+ok2; + if ( !( ok1 && ok2 ) ) + { + if ( ok1 || ok2 ) + S << CGAL::ORANGE; + else + S << CGAL::RED; + S << p; + } + } + } +} + +#endif // CGAL_INTERSECTION_TEST_STATISTICS_H diff --git a/Packages/Robustness/demo/Robustness/include/CGAL/kernel_to_kernel.h b/Packages/Robustness/demo/Robustness/include/CGAL/kernel_to_kernel.h new file mode 100644 index 00000000000..d1f5ce9a521 --- /dev/null +++ b/Packages/Robustness/demo/Robustness/include/CGAL/kernel_to_kernel.h @@ -0,0 +1,102 @@ +#include + +namespace CGAL { + +template +struct Cartesian_double_to_Homogeneous +{ + typedef Point_2< Homogeneous< NumberType> > Point; + typedef Segment_2< Homogeneous< NumberType> > Segment; + + Point + operator()( const Point_2 >& p) + { return Point( NumberType(p.x()), NumberType(p.y()) ); } + + Segment + operator()( const Segment_2 >& s) + { + return Segment( Point( NumberType(s.source().x()), + NumberType(s.source().y()) ), + Point( NumberType(s.target().x()), + NumberType(s.target().y()) ) ); + } +}; + + +template +struct Cartesian_double_to_Cartesian +{ + typedef Point_2< Cartesian< NumberType> > Point; + typedef Segment_2< Cartesian< NumberType> > Segment; + + Point + operator()( const Point_2 >& p) + { return Point( NumberType(p.x()), NumberType(p.y()) ); } + + Segment + operator()( const Segment_2 >& s) + { + return Segment( Point( NumberType(s.source().x()), + NumberType(s.source().y()) ), + Point( NumberType(s.target().x()), + NumberType(s.target().y()) ) ); + } +}; + +template +struct Cartesian_float_to_Cartesian +{ + typedef Point_2< Cartesian< NumberType> > Point; + typedef Segment_2< Cartesian< NumberType> > Segment; + + Point + operator()( const Point_2 >& p) + { return Point( NumberType(p.x()), NumberType(p.y()) ); } + + Segment + operator()( const Segment_2 >& s) + { + return Segment( Point( NumberType(s.source().x()), + NumberType(s.source().y()) ), + Point( NumberType(s.target().x()), + NumberType(s.target().y()) ) ); + } +}; + + +struct Cartesian_double_to_H_double_int +{ + typedef Point_2< Homogeneous< double> > Point; + typedef Segment_2< Homogeneous< double> > Segment; + + Segment + operator()( const Segment_2< Cartesian< double> >& s) + { + leda_rat_point rs = leda_point(s.source().x(), s.source().y()); + leda_rat_point rt = leda_point(s.target().x(), s.target().y()); + + return + Segment( Point(to_double(rs.X()), to_double(rs.Y()), to_double(rs.W())), + Point(to_double(rt.X()), to_double(rt.Y()), to_double(rt.W())) ); + } +}; + +struct Cartesian_float_to_H_double_int +{ + typedef Point_2< Homogeneous< double> > Point; + typedef Segment_2< Homogeneous< double> > Segment; + + Segment + operator()( const Segment_2< Cartesian< float> >& s) + { + leda_rat_point rs = leda_point(s.source().x(), s.source().y()); + leda_rat_point rt = leda_point(s.target().x(), s.target().y()); + + return + Segment( Point(to_double(rs.X()), to_double(rs.Y()), to_double(rs.W())), + Point(to_double(rt.X()), to_double(rt.Y()), to_double(rt.W())) ); + } +}; + +} // namespace CGAL + diff --git a/Packages/Robustness/demo/Robustness/include/CGAL/orientation_test_statistics.h b/Packages/Robustness/demo/Robustness/include/CGAL/orientation_test_statistics.h new file mode 100644 index 00000000000..ae842e8cc04 --- /dev/null +++ b/Packages/Robustness/demo/Robustness/include/CGAL/orientation_test_statistics.h @@ -0,0 +1,91 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : orientation.fw +// file : demo/Robustness/orientation_2.C +// revision : 1.5 +// revision_date : 20 Sep 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include + +template +void +orientation_statistics( ForwardIterator first, ForwardIterator last, + CGAL::Orientation* C, + leda_string& s1, leda_string& s2, + const Traits& T ) +{ + typename Traits::Orientation_2 orientation = T.orientation_2_object(); + int c = 0; + int success = 0; + for( ForwardIterator i = first; i != last; ++i) + for( ForwardIterator j = first; j != last; ++j) + for( ForwardIterator k = first; k != last; ++k) + if ( C[c++] == orientation(*i, *j, *k)) ++success; + + s1 = leda_string("Out of %d orientation tests, %d", c, success); + s2 = leda_string("( %2.2f %%) give the correct result.", + (double)success/c * 100); +} + +template +void +fill_control_field( ForwardIterator first, ForwardIterator last, + CGAL::Orientation* C, + const Traits& T ) +{ + typename Traits::Orientation_2 orientation = T.orientation_2_object(); + int c = 0; + for( ForwardIterator i = first; i != last; ++i) + for( ForwardIterator j = first; j != last; ++j) + for( ForwardIterator k = first; k != last; ++k) + C[c++] = orientation(*i, *j, *k); +} + +template +void +orientation_statistics_IA( ForwardIterator first, ForwardIterator last, + leda_string& s1, leda_string& s2, + const Traits& T ) +{ + typename Traits::Orientation_2 orientation = T.orientation_2_object(); + int c = 0; + int success = 0; + for( ForwardIterator i = first; i != last; ++i) + for( ForwardIterator j = first; j != last; ++j) + for( ForwardIterator k = first; k != last; ++k) + { + CGAL::Orientation ori; + try + { + ori = orientation(*i, *j, *k); + ++success; + } + catch ( CGAL::Interval_base::unsafe_comparison ) + {} + ++c; + } + + s1 = leda_string("Out of %d orientation tests, %d", c, success); + s2 = leda_string("( %2.2f %%) do not throw an exception.", + (double)success/c * 100); +} + + diff --git a/Packages/Robustness/demo/Robustness/intersection_points_on_segment_2.C b/Packages/Robustness/demo/Robustness/intersection_points_on_segment_2.C new file mode 100644 index 00000000000..b0da02e803f --- /dev/null +++ b/Packages/Robustness/demo/Robustness/intersection_points_on_segment_2.C @@ -0,0 +1,199 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : online.fw +// file : demo/Robustness/intersection_points_on_segment_2.C +// revision : 1.5 +// revision_date : 20 Sep 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#ifndef CGAL_USE_LEDA +int main() { std::cout << "\nSorry, this demo needs LEDA\n"; return 0; } +#else +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + + +#include + +using namespace CGAL; + +typedef Cartesian CartesianFloat; +typedef Cartesian CartesianDouble; +typedef Homogeneous HomogeneousFloat; +typedef Homogeneous HomogeneousDouble; + +typedef Point_2 Point; +typedef Segment_2 Segment; +typedef std::vector Vector; + + + +int +main(int argc, char** argv) +{ + int N = (argc > 1) ? CGAL_CLIB_STD::atoi(argv[1]) : 50; + + typedef Creator_uniform_2< Point, Segment> Seg_creator; + typedef Join_input_iterator_2< Point_on_vertical_bar, + Point_on_vertical_bar, + Seg_creator> Seg1_iterator; + typedef Join_input_iterator_2< Point_on_horizontal_bar, + Point_on_horizontal_bar, + Seg_creator> Seg2_iterator; + Point_on_vertical_bar p1( -100000, 100000, -120000); + Point_on_vertical_bar p2( -100000, 100000, 120000); + Point_on_horizontal_bar p3( -100000, 100000, -120000); + Point_on_horizontal_bar p4( -100000, 100000, 120000); + Seg1_iterator g1( p1, p2); + Seg2_iterator g2( p3, p4); + Vector CD1; // vertical segments + Vector CD2; // horizontal segments + CGAL::copy_n( g1, N, std::back_inserter(CD1)); + CGAL::copy_n( g2, N, std::back_inserter(CD2)); + + leda_window W(1000,550); + leda_window W1(250,250); + leda_window W2(250,250); + leda_window W3(250,250); + leda_window W4(250,250); + CGAL::cgalize(W); + CGAL::cgalize(W1); + CGAL::cgalize(W2); + CGAL::cgalize(W3); + CGAL::cgalize(W4); + W.init(0,1000,0); + W1.init(-133000,133000,-133000); + W2.init(-133000,133000,-133000); + W3.init(-133000,133000,-133000); + W4.init(-133000,133000,-133000); + W1.set_node_width(2); + W2.set_node_width(2); + W3.set_node_width(2); + W4.set_node_width(2); + W.display(); + W1.display(W, 0, 170); + W2.display(W, 250, 170); + W3.display(W, 500, 170); + W4.display(W, 750, 170); + W1 << CGAL::GREEN; W2 << CGAL::GREEN; W3 << CGAL::GREEN; W4 << GREEN; + Vector::iterator s; + for( s = CD1.begin(); s != CD1.end(); s++) + { W1 << *s; W2 << *s; W3 << *s; W4 << *s; } + for( s = CD2.begin(); s != CD2.end(); s++) + { W1 << *s; W2 << *s; W3 << *s; W4 << *s; } + + std::vector< CartesianFloat::Segment_2> CF1; + std::vector< CartesianFloat::Segment_2> CF2; + Cartesian_double_to_Cartesian< CartesianFloat::RT > converter1; + std::transform( CD1.begin(), CD1.end(), std::back_inserter( CF1), converter1); + std::transform( CD2.begin(), CD2.end(), std::back_inserter( CF2), converter1); + std::vector< HomogeneousFloat::Segment_2> HF1; + std::vector< HomogeneousFloat::Segment_2> HF2; + Cartesian_double_to_Homogeneous< HomogeneousFloat::RT > converter2; + std::transform( CD1.begin(), CD1.end(), std::back_inserter( HF1), converter2); + std::transform( CD2.begin(), CD2.end(), std::back_inserter( HF2), converter2); + std::vector< HomogeneousDouble::Segment_2> HD1; + std::vector< HomogeneousDouble::Segment_2> HD2; + Cartesian_double_to_Homogeneous< HomogeneousDouble::RT > converter3; + std::transform( CD1.begin(), CD1.end(), std::back_inserter( HD1), converter3); + std::transform( CD2.begin(), CD2.end(), std::back_inserter( HD2), converter3); + + leda_string str; + + leda_string header("Two sets of segments are generated at random."); + header += leda_string("All endpoint coordinates are integral and have "); + header += leda_string("absolute value at most 100 000.\n"); + header += leda_string("The endpoints of the first set of segments lie on "); + header += leda_string("two vertical bars; in the second set, the segments "); + header += leda_string("lie on two horizontal bars.\n"); + header += leda_string("Each segment in the first set is intersected with "); + header += leda_string("each segment in the second set. Then, it is checked "); + header += leda_string("whether the intersection points\n "); + header += leda_string("lie on the intersecting segments. "); + header += leda_string("Computation is done with kernels "); + header += leda_string("differing in representation and float precision."); + W.draw_text( 5, 540, header); + Point o_p(300,450); + W << CGAL::ORANGE; + W << o_p; + Point r_p(300,435); + W << CGAL::RED; + W << r_p; + W << CGAL::BLACK; + leda_string + orange("INCORRECT intersection point: lies on one of the lines only."); + leda_string + red("INCORRECT intersection point: lies on neither of the two lines."); + W.draw_text( 310, 458, orange); + W.draw_text( 310, 443, red); + + W.draw_ctext( 125, 400, leda_string("Cartesian")); + intersection_statistics(CF1.begin(), CF1.end(), + CF2.begin(), CF2.end(), + str, CartesianFloat()); + draw_errors(W1, CF1.begin(), CF1.end(), CF2.begin(), CF2.end(), + CartesianFloat()); + W.draw_text( 5, 110, str); + + W.draw_ctext( 375, 400, leda_string("Cartesian")); + intersection_statistics(CD1.begin(), CD1.end(), + CD2.begin(), CD2.end(), + str, CartesianDouble()); + draw_errors(W2, CD1.begin(), CD1.end(), CD2.begin(), CD2.end(), + CartesianDouble()); + W.draw_text( 255, 110, str); + + W.draw_ctext( 625, 400, leda_string("Homogeneous")); + intersection_statistics(HF1.begin(), HF1.end(), + HF2.begin(), HF2.end(), + str, HomogeneousFloat()); + draw_errors(W3, HF1.begin(), HF1.end(), HF2.begin(), HF2.end(), + HomogeneousFloat()); + W.draw_text( 505, 110, str); + + W.draw_ctext( 875, 400, leda_string("Homogeneous")); + intersection_statistics(HD1.begin(), HD1.end(), + HD2.begin(), HD2.end(), + str, HomogeneousDouble()); + draw_errors(W4, HD1.begin(), HD1.end(), HD2.begin(), HD2.end(), + HomogeneousDouble()); + W.draw_text( 755, 110, str); + + W.read_mouse(); + return 0; +} + +#endif // USE_LEDA diff --git a/Packages/Robustness/demo/Robustness/makefile b/Packages/Robustness/demo/Robustness/makefile new file mode 100644 index 00000000000..a6849d1a2bd --- /dev/null +++ b/Packages/Robustness/demo/Robustness/makefile @@ -0,0 +1,81 @@ +# Created by the script create_makefile +# This is the makefile for compiling a CGAL application. + +#---------------------------------------------------------------------# +# include platform specific settings +#---------------------------------------------------------------------# +# Choose the right include file from the /make directory. + +# CGAL_MAKEFILE = ENTER_YOUR_INCLUDE_MAKEFILE_HERE +include $(CGAL_MAKEFILE) + +#---------------------------------------------------------------------# +# compiler flags +#---------------------------------------------------------------------# + +CXXFLAGS = \ + -Iinclude \ + $(CGAL_CXXFLAGS) \ + $(DEBUG_OPT) + +#---------------------------------------------------------------------# +# linker flags +#---------------------------------------------------------------------# + +LIBPATH = \ + $(CGAL_WINDOW_LIBPATH) + +LDFLAGS = \ + $(CGAL_WINDOW_LDFLAGS) + +#---------------------------------------------------------------------# +# target entries +#---------------------------------------------------------------------# + +all: \ + intersection_points_on_segment_2 \ + orientation_2 \ + orientation_IA_2 \ + hull_of_intersection_points_2 \ + triangulation_of_intersection_points_2 \ + cocircular_2 \ + rotation_2 + +intersection_points_on_segment_2$(EXE_EXT): intersection_points_on_segment_2$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)intersection_points_on_segment_2 intersection_points_on_segment_2$(OBJ_EXT) $(LDFLAGS) + +orientation_2$(EXE_EXT): orientation_2$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)orientation_2 orientation_2$(OBJ_EXT) $(LDFLAGS) + +orientation_IA_2$(EXE_EXT): orientation_IA_2$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)orientation_IA_2 orientation_IA_2$(OBJ_EXT) $(LDFLAGS) + +hull_of_intersection_points_2$(EXE_EXT): hull_of_intersection_points_2$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)hull_of_intersection_points_2 hull_of_intersection_points_2$(OBJ_EXT) $(LDFLAGS) + +triangulation_of_intersection_points_2$(EXE_EXT): triangulation_of_intersection_points_2$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)triangulation_of_intersection_points_2 triangulation_of_intersection_points_2$(OBJ_EXT) $(LDFLAGS) + +cocircular_2$(EXE_EXT): cocircular_2$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)cocircular_2 cocircular_2$(OBJ_EXT) $(LDFLAGS) + +rotation_2$(EXE_EXT): rotation_2$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)rotation_2 rotation_2$(OBJ_EXT) $(LDFLAGS) + + +clean: \ + intersection_points_on_segment_2.clean \ + orientation_2.clean \ + orientation_IA_2.clean \ + hull_of_intersection_points_2.clean \ + triangulation_of_intersection_points_2.clean \ + cocircular_2.clean \ + rotation_2.clean + +#---------------------------------------------------------------------# +# suffix rules +#---------------------------------------------------------------------# + +.C$(OBJ_EXT): + $(CGAL_CXX) $(CXXFLAGS) $(OBJ_OPT) $< + diff --git a/Packages/Robustness/demo/Robustness/orientation_2.C b/Packages/Robustness/demo/Robustness/orientation_2.C new file mode 100644 index 00000000000..20b848fab2d --- /dev/null +++ b/Packages/Robustness/demo/Robustness/orientation_2.C @@ -0,0 +1,122 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : orientation.fw +// file : demo/Robustness/orientation_2.C +// revision : 1.5 +// revision_date : 20 Sep 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#ifndef CGAL_USE_LEDA +int main() { std::cout << "\nSorry, this demo needs LEDA\n"; return 0; } +#else +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef CGAL::Cartesian CartesianDouble; +typedef CGAL::Point_2 Point; +typedef CGAL::Creator_uniform_2 Pt_creator; +typedef std::vector Vector; +typedef CGAL::Cartesian CartesianLedaReal; + + +int +main(int argc, char** argv) +{ + int N = (argc > 1) ? CGAL_CLIB_STD::atoi(argv[1]) : 30; + + typedef leda_window CGAL_Stream; + CGAL_Stream W( 950, 520); + CGAL_Stream W1( 400, 400); + CGAL_Stream W2( 400, 400); + CGAL::cgalize(W); + CGAL::cgalize(W1); + CGAL::cgalize(W2); + + W.init( 0, 950, 0); + W1.init(-1.1, 1.1, -1.1); + W2.init(-1.1, 1.1, -1.1); + W.display(); + W1.display(W,50,50); + W2.display(W,500,50); + + W.draw_ctext(475,495,"Orientation computation"); + W1 << CGAL::RED; + W2 << CGAL::RED; + + Vector points1; + Vector points2; + typedef CGAL::Random_points_in_square_2 P_in_square; + typedef CGAL::Random_points_on_segment_2 P_on_seg; + P_in_square pc1; + Point p1 = Point(-0.8, 0.3); + Point p2 = Point( 0.8,-0.4); + P_on_seg pc2(p1, p2); + CGAL::copy_n( pc1, N, std::back_inserter(points1)); + CGAL::copy_n( pc2, N, std::back_inserter(points2)); + + std::copy( points1.begin(), points1.end(), + CGAL::Ostream_iterator< Point, CGAL_Stream>( W1)); + std::copy( points2.begin(), points2.end(), + CGAL::Ostream_iterator< Point, CGAL_Stream>( W2)); + + CGAL::Orientation* C = new CGAL::Orientation[N*N*N]; + std::vector< CartesianLedaReal::Point_2> S; + CGAL::Cartesian_double_to_Cartesian< CartesianLedaReal::RT > converter; + leda_string s1; + leda_string s2; + + + std::transform( points1.begin(), points1.end(), + std::back_inserter( S), converter); + fill_control_field( S.begin(), S.end(), C, CartesianLedaReal()); + orientation_statistics(points1.begin(), points1.end(), + C, s1, s2, CartesianDouble()); + W.draw_ctext( 250, 50, s1); + W.draw_ctext( 250, 30, s2); + + + std::transform( points2.begin(), points2.end(), + S.begin(), converter); + fill_control_field( S.begin(), S.end(), C, CartesianLedaReal()); + orientation_statistics(points2.begin(), points2.end(), + C, s1, s2, CartesianDouble()); + W.draw_ctext( 700, 50, s1); + W.draw_ctext( 700, 30, s2); + + W.read_mouse(); + delete[] C; + + return 0; +} +#endif // USE_LEDA diff --git a/Packages/Robustness/demo/Robustness/orientation_IA_2.C b/Packages/Robustness/demo/Robustness/orientation_IA_2.C new file mode 100644 index 00000000000..21bdb854a3a --- /dev/null +++ b/Packages/Robustness/demo/Robustness/orientation_IA_2.C @@ -0,0 +1,117 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : orientation.fw +// file : demo/Robustness/orientation_IA_2.C +// revision : 1.5 +// revision_date : 20 Sep 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#ifndef CGAL_USE_LEDA +int main() { std::cout << "\nSorry, this demo needs LEDA\n"; return 0; } +#else +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef CGAL::Cartesian CartesianDouble; +typedef CGAL::Point_2 Point; +typedef CGAL::Creator_uniform_2 Pt_creator; +typedef std::vector Vector; +typedef CGAL::Cartesian > CartesianInterval; + +int +main(int argc, char** argv) +{ + int N = (argc > 1) ? CGAL_CLIB_STD::atoi(argv[1]) : 30; + + typedef leda_window CGAL_Stream; + CGAL_Stream W( 950, 520); + CGAL_Stream W1( 400, 400); + CGAL_Stream W2( 400, 400); + CGAL::cgalize(W); + CGAL::cgalize(W1); + CGAL::cgalize(W2); + + W.init( 0, 950, 0); + W1.init(-1.1, 1.1, -1.1); + W2.init(-1.1, 1.1, -1.1); + W.display(); + W1.display(W,50,50); + W2.display(W,500,50); + + W.draw_ctext(475,495,"Orientation computation with interval arithmetic"); + W1 << CGAL::GREEN; + W2 << CGAL::GREEN; + + Vector points1; + Vector points2; + typedef CGAL::Random_points_in_square_2 P_in_square; + typedef CGAL::Random_points_on_segment_2 P_on_seg; + P_in_square pc1; + Point p1 = Point(-0.8, 0.3); + Point p2 = Point( 0.8,-0.4); + P_on_seg pc2(p1, p2); + CGAL::copy_n( pc1, N, std::back_inserter(points1)); + CGAL::copy_n( pc2, N, std::back_inserter(points2)); + + std::copy( points1.begin(), points1.end(), + CGAL::Ostream_iterator< Point, CGAL_Stream>( W1)); + std::copy( points2.begin(), points2.end(), + CGAL::Ostream_iterator< Point, CGAL_Stream>( W2)); + + std::vector< CartesianInterval::Point_2> SIA; + CGAL::Cartesian_double_to_Cartesian< CartesianInterval::RT > converterIA; + leda_string s1; + leda_string s2; + + + std::transform( points1.begin(), points1.end(), + std::back_inserter( SIA), converterIA); + orientation_statistics_IA(SIA.begin(), SIA.end(), + s1, s2, CartesianInterval()); + W.draw_ctext( 250, 50, s1); + W.draw_ctext( 250, 30, s2); + + + std::transform( points2.begin(), points2.end(), + SIA.begin(), converterIA); + orientation_statistics_IA(SIA.begin(), SIA.end(), + s1, s2, CartesianInterval()); + W.draw_ctext( 700, 50, s1); + W.draw_ctext( 700, 30, s2); + + W.read_mouse(); + + return 0; +} +#endif // USE_LEDA diff --git a/Packages/Robustness/demo/Robustness/rotation_2.C b/Packages/Robustness/demo/Robustness/rotation_2.C new file mode 100644 index 00000000000..04a73abc407 --- /dev/null +++ b/Packages/Robustness/demo/Robustness/rotation_2.C @@ -0,0 +1,181 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : rotation.fw +// file : demo/Robustness/rotation_2.C +// revision : 1.5 +// revision_date : 20 Sep 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#ifndef CGAL_USE_LEDA +int main() { std::cout << "\nSorry, this demo needs LEDA\n"; return 0; } +#else +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +typedef CGAL::Cartesian CartesianDouble; +typedef CGAL::Point_2 Point; +typedef CGAL::Direction_2 Direction; +typedef std::vector Vector; +typedef CGAL::Homogeneous HomogeneousInteger; +typedef CGAL::Cartesian CartesianLedaReal; + + +int +main() +{ + Vector L; + + L.push_back( Point(6,0)); + L.push_back( Point(4,0)); + L.push_back( Point(2,0)); + L.push_back( Point(0,0)); + L.push_back( Point(3,0)); + L.push_back( Point(-4,0)); + L.push_back( Point(-2,0)); + L.push_back( Point(7,0)); + + Vector C; + + C.push_back( Point(0,5)); + C.push_back( Point(3,4)); + C.push_back( Point(4,3)); + C.push_back( Point(5,0)); + // C.push_back( Point(-3,4)); + C.push_back( Point(-4,3)); + C.push_back( Point(-5,0)); + // C.push_back( Point(-3,-4)); + // C.push_back( Point(-4,-3)); + C.push_back( Point(0,-5)); + // C.push_back( Point(3,-4)); + C.push_back( Point(4,-3)); + + + typedef leda_window CGAL_Stream; + CGAL_Stream W( 950, 550); + CGAL_Stream W1( 400, 400); + CGAL_Stream W2( 400, 400); + CGAL::cgalize(W); + CGAL::cgalize(W1); + CGAL::cgalize(W2); + + W.init( 0, 950, 0); + W1.init(-8, 8, -8); + W2.init(-8, 8, -8); + W.display(); + W1.display(W,50,50); + W2.display(W,500,50); + + W1.set_fg_color(leda_green2); + std::copy( L.begin(), L.end(), + CGAL::Ostream_iterator< Point, CGAL_Stream>( W1)); + W2 << CGAL::RED; + std::copy( C.begin(), C.end(), + CGAL::Ostream_iterator< Point, CGAL_Stream>( W2)); + + Direction dir = Direction( 7, 4); + double alpha = CGAL_CLIB_STD::atan( 7.0/4.0); + + CartesianDouble::Aff_transformation_2 rotate = + CartesianDouble::Aff_transformation_2( CGAL::ROTATION, + CGAL_CLIB_STD::sin( alpha), + CGAL_CLIB_STD::cos( alpha)); + + + Vector LR; + Vector CR; + std::transform( L.begin(), L.end(), std::back_inserter(LR), rotate); + std::transform( C.begin(), C.end(), std::back_inserter(CR), rotate); + W1 << CGAL::GREEN; + std::copy( LR.begin(), LR.end(), + CGAL::Ostream_iterator< Point, CGAL_Stream>( W1)); + W2 << CGAL::ORANGE; + std::copy( CR.begin(), CR.end(), + CGAL::Ostream_iterator< Point, CGAL_Stream>( W2)); + + + int n = 0; + int s = 0; + leda_string str; + leda_string trailer = leda_string("of all collinearity tests return true"); + + typedef Vector::iterator Iterator; + Iterator i,j,k; + for( i = L.begin(); i != L.end(); ++i) + for( j = L.begin(); j != L.end(); ++j) + for( k = L.begin(); k != L.end(); ++k) + { + if ( CGAL::collinear( *i, *j, *k) ) ++s; + ++n; + } + str = leda_string("Before rotation, %2.2f%% ", 100.0* s/n ); + str += trailer; + W.draw_ctext(250,60, str); + + + n = 0; + s = 0; + for( i = LR.begin(); i != LR.end(); ++i) + for( j = LR.begin(); j != LR.end(); ++j) + for( k = LR.begin(); k != LR.end(); ++k) + { + if ( CGAL::collinear( *i, *j, *k) ) ++s; + ++n; + } + str = leda_string("After rotation, only %2.2f%% ", 100.0* s/n ); + str += trailer; + W.draw_ctext(250,40, str); + + + Vector D; + D.push_back( L.front()); + Point o = Point( CGAL::ORIGIN); + CartesianDouble::Less_distance_to_point_2 less = + CartesianDouble().less_distance_to_point_2_object(o); + for ( i = CR.begin(); i != CR.end(); ++i) + { + bool new_distance = true; + for ( j = D.begin(); j != D.end(); ++j) + { if ( !( less( *i, *j))||( less( *j, *i)) ) new_distance = false; } + if ( new_distance ) { D.push_back( *i); } + } + + str = leda_string("%d different distances", + std::distance( D.begin(), D.end() )); + W.draw_ctext(700,50,str); + + + W.read_mouse(); + + return 0; +} +#endif // USE_LEDA diff --git a/Packages/Robustness/demo/Robustness/triangulation_of_intersection_points_2.C b/Packages/Robustness/demo/Robustness/triangulation_of_intersection_points_2.C new file mode 100644 index 00000000000..41fa56e2bad --- /dev/null +++ b/Packages/Robustness/demo/Robustness/triangulation_of_intersection_points_2.C @@ -0,0 +1,280 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : intersection_and_then.fw +// file : demo/Robustness/triangulation_of_intersection_points_2.C +// revision : 1.5 +// revision_date : 20 Sep 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#ifndef CGAL_USE_LEDA +int main() { std::cout << "\nSorry, this demo needs LEDA\n"; return 0; } +#else +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + + + +// Workaround for VC++ +#ifdef CGAL_CFG_MATCHING_BUG_2 +#define CGAL_IA_CT double +#define CGAL_IA_PROTECTED true +#define CGAL_IA_ET leda_real +#define CGAL_IA_CACHE No_Filter_Cache +#endif +#include + + +namespace CGAL { + +class Assertion_violation +{ + public: + Assertion_violation( const char* type, + const char* expression, + const char* file, + int line, + const char* explanation) + : ty( type), ex(expression), fi(file), wo(line) + { + if (explanation) wh = leda_string(explanation); + else wh = leda_string(); + } + + leda_string ty; + leda_string ex; + leda_string fi; + leda_string wh; + int wo; +}; + + +void +throw_exception_for_assertion_violation( const char* type, + const char* expression, + const char* file, + int line, + const char* explanation) +{ throw Assertion_violation(type,expression,file,line,explanation); } + +} // namespace CGAL + + + +int +main( int argc, char** argv) +{ + CGAL::set_error_behaviour( CGAL::CONTINUE); + CGAL::set_error_handler( CGAL::throw_exception_for_assertion_violation); + + typedef CGAL::Cartesian C_double; + typedef CGAL::Point_2< C_double> double_Point; + typedef CGAL::Segment_2< C_double> double_Segment; + typedef CGAL::Cartesian C_real; + typedef CGAL::Point_2< C_real> real_Point; + typedef CGAL::Segment_2< C_real> real_Segment; + typedef CGAL::Creator_uniform_2 + Point_creator; + typedef CGAL::Random_points_in_square_2 + Source; + typedef CGAL::Creator_uniform_2 + Segment_creator; + typedef CGAL::Join_input_iterator_2 + Segment_iterator; + + typedef CGAL::Cartesian > + C_filtered; + typedef CGAL::Point_2< C_filtered> C_filtered_Point; + typedef CGAL::Segment_2< C_filtered> C_filtered_Segment; + + typedef CGAL::Triangulation_euclidean_traits_2 Gtd; + typedef CGAL::Triangulation_vertex_base_2 Vbd; + typedef CGAL::Triangulation_face_base_2 Fbd; + typedef CGAL::Triangulation_default_data_structure_2 + Tdsd; + typedef CGAL::Delaunay_triangulation_2 DT_double; + + typedef CGAL::Triangulation_euclidean_traits_2 Gtf; + typedef CGAL::Triangulation_vertex_base_2 Vbf; + typedef CGAL::Triangulation_face_base_2 Fbf; + typedef CGAL::Triangulation_default_data_structure_2 + Tdsf; + typedef CGAL::Delaunay_triangulation_2 DT_filtered; + + typedef CGAL::Triangulation_euclidean_traits_2 Gtr; + typedef CGAL::Triangulation_vertex_base_2 Vbr; + typedef CGAL::Triangulation_face_base_2 Fbr; + typedef CGAL::Triangulation_default_data_structure_2 + Tdsr; + typedef CGAL::Delaunay_triangulation_2 DT_real; + Source RS(280); + Segment_iterator g( RS, RS); + + int N; + if ( argc == 2) + { N = CGAL_CLIB_STD::atoi( argv[1]); } + else + { std::cout << "How many segments? "; std::cin >> N; } + + std::vector< double_Segment> double_segments; + CGAL::copy_n( g, N, std::back_inserter( double_segments) ); + std::vector real_segments; + CGAL::Cartesian_double_to_Cartesian converter; + std::transform( double_segments.begin(), + double_segments.end(), + std::back_inserter( real_segments), + converter ); + std::vector double_intersection_points; + std::vector real_intersection_points; + + CGAL::segment_intersection_points_2( + double_segments.begin(), + double_segments.end(), + std::back_inserter( double_intersection_points), + C_double() ); + CGAL::segment_intersection_points_2( + real_segments.begin(), + real_segments.end(), + std::back_inserter( real_intersection_points), + C_real() ); + + + + std::vector filtered_segments; + typedef CGAL::Filtered_exact< double, leda_real> Filtered; + CGAL::Cartesian_double_to_Cartesian Fconverter; + std::transform( double_segments.begin(), + double_segments.end(), + std::back_inserter( filtered_segments), + Fconverter ); + std::vector filtered_intersection_points; + CGAL::segment_intersection_points_2( + filtered_segments.begin(), + filtered_segments.end(), + std::back_inserter( filtered_intersection_points), + C_filtered() ); + + std::transform( double_segments.begin(), + double_segments.end(), + std::back_inserter( real_segments), + converter ); + + + typedef leda_window CGAL_Stream; + CGAL_Stream W0( 450, 550); + CGAL_Stream W( 400, 400); + CGAL::cgalize(W0); + CGAL::cgalize(W); + + W.init( -300.0, 300.0, -300.0); + W0.init( 0, 450, 0); + W0.display(); + W.display(W0,25,25); + W0.set_fg_color(leda_black); + W0.draw_ctext(225,535, + leda_string("Delaunay triangulation of intersection points")); + + W.set_fg_color( leda_green); + std::copy( double_segments.begin(), + double_segments.end(), + CGAL::Ostream_iterator< double_Segment, CGAL_Stream>( W)); + W0.draw_text(25,115, leda_string("Cartesian< leda_real >")); + std::cout << "First with Cartesian< leda_real > "; + std::cout << std::endl; + DT_real DTR; + std::copy( real_intersection_points.begin(), + real_intersection_points.end(), + std::back_inserter( DTR )); + std::cout << std::distance( DTR.faces_begin(), DTR.faces_end() ); + std::cout << " triangles" << std::endl; + W.set_fg_color(leda_blue); + W << DTR; + W.set_fg_color( leda_red); + std::copy( double_intersection_points.begin(), + double_intersection_points.end(), + CGAL::Ostream_iterator< double_Point, CGAL_Stream>( W)); + W.read_mouse(); + + W0.draw_text(25,100, + leda_string("Cartesian< Filtered_exact< double, leda_real > >")); + std::cout << "Next with Cartesian< Filtered_exact< double, leda_real> > "; + std::cout << std::endl; + DT_filtered FTD; + std::copy( filtered_intersection_points.begin(), + filtered_intersection_points.end(), + std::back_inserter( FTD )); + std::cout << std::distance( FTD.faces_begin(), FTD.faces_end() ); + std::cout << " triangles" << std::endl; + W.read_mouse(); + + W0.draw_text(25,85, leda_string("Cartesian< double >")); + std::cout << "Next with Cartesian< double > "; + std::cout << std::endl; + try + { + DT_double DTD; + std::copy( double_intersection_points.begin(), + double_intersection_points.end(), + std::back_inserter( DTD )); + std::cout << std::distance( DTD.faces_begin(), DTD.faces_end() ); + std::cout << " triangles" << std::endl; + } + catch (const CGAL::Assertion_violation& Msg) + { + W0.set_fg_color( leda_red); + leda_string fi = Msg.fi; + int fistart = fi.pos(leda_string("include/CGAL/"),0); + fistart += 13; + W0.draw_text(25,85, + leda_string("Cartesian< double >: ") + + Msg.ty + + leda_string(" violation") + + leda_string(" in line ") + + leda_string("%d", Msg.wo) + + leda_string(" of file ")); + W0.draw_text(25,70, fi( fistart, 200 )); + W0.draw_text(25,55, Msg.ex(0,60) ); + W0.draw_text(25,40, Msg.ex(60,120) ); + W0.draw_text(25,25, Msg.ex(120,180) ); + std::cout << Msg.ex << std::endl; + } + + W.read_mouse(); + + return 0; +} +#endif // USE_LEDA diff --git a/Packages/Robustness/description.txt b/Packages/Robustness/description.txt new file mode 100644 index 00000000000..e24a18a4075 --- /dev/null +++ b/Packages/Robustness/description.txt @@ -0,0 +1,2 @@ +Some demo programs illustrating robustness in CGAL: +- intersection_points_on_segment_2 ? diff --git a/Packages/Robustness/version b/Packages/Robustness/version new file mode 100644 index 00000000000..bc691f04735 --- /dev/null +++ b/Packages/Robustness/version @@ -0,0 +1,2 @@ +1.5 (20 Sep 2000) +maintainer: Stefan Schirra diff --git a/Packages/window/changes.txt b/Packages/window/changes.txt new file mode 100644 index 00000000000..71fb7b5fc46 --- /dev/null +++ b/Packages/window/changes.txt @@ -0,0 +1,166 @@ +2.7.1 (22 Aug 2000) + +- bug in documentation of Window_stream fixed, reported by H. Tangelder + h*(x1-x0)/w instead of h*w/(x1-x0) + +2.7 (21 Aug 2000) + +- example code in + doc_tex/support/Colors_and_windows/Postscript_file.tex fixed +- test file for the example above added + test/WindowStream/manual_example_ps.C + +2.6 (05 Aug 2000) + +- added send_to_stream_as_polygon( Stream& W, Circulator C, + const Forward_circulator_tag&, const Traits& ) + + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 2 . 0 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +2.5.7 -> 2.5.8 ( 13 Jan 00) +- added const to xpm for esprit logo: static const char* + for __LEDA__ > 400 + +2.5.6 -> 2.5.7 ( 16 Dec 99) +- demo/Window_stream/cgal_test removed +- LEDA versions tested with includes in Postscript_file_stream.h + revised. Now all tests for >= 400. (There have been problems + with compiling LEDA/rectangle.h and 380 in the test suite) + +2.5.5 -> 2.5.6 ( 16 Dec 99) +- demo/Window_stream/cgal_test added +- demo/Window_stream made test-safe: checks for USE_LEDA now + +2.5.4 -> 2.5.5 ( 30 Nov 99) +- undefined W replaced by std::cout in test/.../polygonal.C + for use without LEDA + +2.5.3 -> 2.5.4 ( 29 Nov 99) +- type of node's width changed to double in Postscript_file_stream.h +- ifstream qualified in test/WindowStream/polygonal.C +- CGAL_USE_LEDA checked before inclusion of leda_window.h +- CGAL_USE_LEDA checked in test_window_stream_xy_3.C + +2.5.2 -> 2.5.3 ( 22 Nov 99) +- LEDA versions tested with includes in Postscript_file_stream.h + +2.5.1 -> 2.5.2 ( 16 Nov 99) +- added input file for test/WindowStream/polygonal.C +- updated frame label in window to 2.1 + +2.5 -> 2.5.1 ( 12 Nov 99) +- added to package +- documentation revised: bugs in new Postscript_file.tex file, + Window.tex + +2.4.5 -> 2.5 ( 11 Nov 99) +- ps_file renamed to Postscript_file_stream; + in + now includes the file above +- documentation updated +- hack to work around leda_color and display problem with + Postscript_file_stream added; + +2.4.3 -> 2.4.4 ( 15 Oct 99) +- cgal_test updated '/bin/' removed + +2.4.2 -> 2.4.3 ( 29 Sep 99) +- prefixed line_style in leda_ps_file.h for __LEDA__ >= 400 + +2.4.1 -> 2.4.2 ( 17 Sep 99) +- qualified calls of sqrt(double) by std:: in leda_window.h +- value_type() -> ch_value_type() in polygonal.h +- max() qualified by std:: in polygonal.h +- makefile updated + +2.4 -> 2.4.1 ( 14 Sep 99) +- prefixed line_style in leda_window for __LEDA__ >= 400 + +2.3.1 -> 2.4 ( 19 Aug 99) +- added + +2.3 -> 2.3.1 ( 06 Aug 99) +- packaging script updated + +2.2.7 -> 2.3 ( 06 Aug 99) +- send_to_stream_as_poly[gon|line]() functions provided in + +- makefile updated: $(OBJ_EXT) +- test files in test/WindowStream (return true if started with any argument +- corresponding non-empty .cmd files added in test/WindowStream + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 2 . 0 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +2.2.6 -> 2.2.7 ( 27 May 99) +- demo for WindowStream updated + +2.2.5 -> 2.2.6 ( 19 May 99) +- frame label for demo windows set to CGAL-2.0 + +2.2.4 -> 2.2.5 ( 03 May 99) +- changed access rights for *.cmd in testsuite + +2.2.3 -> 2.2.4 ( 28 Apr 99) +- return true in testsuite if LEDA is not used + +2.2.2 -> 2.2.3 ( 28 Apr 99) +- fix for testing WindowStream added + +2.2 -> 2.2.2 ( 30 Mar 99) +- packaging cleaned ( [long_]description.txt ) + +2.2 -> 2.2.1 ( 30 Mar 99) +- to_double() prefixed by CGAL:: + +2.1.3 -> 2.2 ( 25 Mar 99) +- for drawing polygons and polylines given + as iterator ranges of points + +2.1.2 -> 2.1.3 ( 24 Mar 99) +- name conflicts for _3 objects fixed in test_window_stream_xy_3 + +2.1.1 -> 2.1.2 ( 15 Mar 99) +- makefile fixed (WINDOW_LDFLAGS used) + +2.1 -> 2.1.1 ( 15 Mar 99) +- typedefs used for R::RT in window_stream_xy_3.h +- Point_3 p( R::RT(x1), R::RT(y1), 0); replaced by + Point_3 p = Point_3( RT(x1), RT(y1), RT(0)); in window_stream_xy_3.h + +2.0.1 -> 2.1 ( 13 Mar 99) +- Window_stream_3 package from Lutz included. + long_description.txt of that package: + - CGAL/IO/window_stream_xy_3.h + Stream operators for the 3D objects in the CGAL kernel. + They project onto the xy-plane. + +2.0 -> 2.0.1 ( 25 Feb 99) +- typedef leda_window Window_stream; put in namespace CGAL +- #include moved out of namespace CGAL + +1.2 -> 2.0 +- namespace CGAL { } introduced + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 1 . 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +1.1.1 -> 1.2 ( 03 Sep 98) +- bug fix: CGAL_create... functions made inline + +%%%%%%%%%%%%%%%%%%%%%% R e l e a s e 1 . 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%% + +1.1. -> 1.1.1 +- headers added in include/CGAL/IO/forward_decl_window_stream.h + and include/CGAL/IO/esprit_logo.xpm + +1.0 -> 1.1 +- functions + leda_window* + CGAL_create_demo_window( float w = 512.0, float h = 512.0, + const char* str = "CGAL", + double x_extension = 1.0) and + leda_window* + CGAL_create_and_display_demo_window(float w = 512.0, float h = 512.0, + const char* str = "CGAL", + double x_extension = 1.0) + added to ease writing demo-programs diff --git a/Packages/window/demo/Window_stream/makefile b/Packages/window/demo/Window_stream/makefile new file mode 100644 index 00000000000..3ba8aa0f207 --- /dev/null +++ b/Packages/window/demo/Window_stream/makefile @@ -0,0 +1,49 @@ +# Created by the script create_makefile +# This is the makefile for compiling a CGAL application. + +#---------------------------------------------------------------------# +# include platform specific settings +#---------------------------------------------------------------------# +# Choose the right include file from the /make directory. + +# CGAL_MAKEFILE = ENTER_YOUR_INCLUDE_MAKEFILE_HERE +include $(CGAL_MAKEFILE) + +#---------------------------------------------------------------------# +# compiler flags +#---------------------------------------------------------------------# + +CXXFLAGS = \ + $(CGAL_CXXFLAGS) \ + $(DEBUG_OPT) + +#---------------------------------------------------------------------# +# linker flags +#---------------------------------------------------------------------# + +LIBPATH = \ + $(CGAL_WINDOW_LIBPATH) + +LDFLAGS = \ + $(CGAL_WINDOW_LDFLAGS) + +#---------------------------------------------------------------------# +# target entries +#---------------------------------------------------------------------# + +all: \ + window_input + +window_input$(EXE_EXT): window_input$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)window_input window_input$(OBJ_EXT) $(LDFLAGS) + +clean: \ + window_input.clean + +#---------------------------------------------------------------------# +# suffix rules +#---------------------------------------------------------------------# + +.C$(OBJ_EXT): + $(CGAL_CXX) $(CXXFLAGS) $(OBJ_OPT) $< + diff --git a/Packages/window/demo/Window_stream/window_input.C b/Packages/window/demo/Window_stream/window_input.C new file mode 100644 index 00000000000..f03e7279a43 --- /dev/null +++ b/Packages/window/demo/Window_stream/window_input.C @@ -0,0 +1,115 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : webIO/demo.fw +// file : demo/Window_stream/window_input.C +// revision : 2.7 +// revision_date : 21 Aug 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include +#include +#include +#include +#include +#include +#include +#ifndef CGAL_USE_LEDA +int main() { std::cout << "Sorry, this demo needs LEDA"; return 0; } +#else +#include + +typedef CGAL::Cartesian< double > RepCls; +typedef CGAL::Point_2 Point; +typedef CGAL::Segment_2 Segment; +typedef CGAL::Line_2 Line; +typedef CGAL::Ray_2 Ray; +typedef CGAL::Iso_rectangle_2 Iso; +typedef CGAL::Triangle_2 Triangle; +typedef CGAL::Circle_2 Circle; + +int +main() +{ + leda_window W; + CGAL::cgalize( W); + W.set_fg_color( leda_red); + W.set_bg_color( leda_yellow); + W.display(); + + CGAL::set_pretty_mode( std::cout); + + W.acknowledge("Input Points"); + W.clear(); + Point p; + while ( W >> p) { std::cout << p << std::endl; } + + W.acknowledge("Input Segments"); + W.clear(); + Segment s; + while ( W >> s) { std::cout << s << std::endl; } + + W.acknowledge("Input Lines"); + W.clear(); + Line l; + while ( W >> l) { std::cout << l << std::endl; } + + W.acknowledge("Input Rays"); + W.clear(); + Ray ray; + while ( W >> ray) { std::cout << ray << std::endl; } + + W.acknowledge("Input Triangles"); + W.clear(); + Triangle t; + while ( W >> t) { std::cout << t << std::endl; } + + W.acknowledge("Input Iso_rectangles"); + W.clear(); + Iso x; + while ( W >> x) { std::cout << x << std::endl; } + + W.acknowledge("Input Circles"); + W.clear(); + Circle c; + while ( W >> c) { std::cout << c << std::endl; } + + W.acknowledge("Read Functions"); + W.clear(); + W.message("Point"); + CGAL::read( W, p); + W.message("Segment"); + CGAL::read( W, s); + W.message("Line"); + CGAL::read( W, l); + W.message("Ray"); + CGAL::read( W, ray); + W.message("Triangle"); + CGAL::read( W, t); + W.message("Iso_rectangle"); + CGAL::read( W, x); + W.message("Circle"); + CGAL::read( W, c); + + + W.acknowledge("THE END"); + return 0; +} +#endif // USE_LEDA diff --git a/Packages/window/description.txt b/Packages/window/description.txt new file mode 100644 index 00000000000..adb0147394e --- /dev/null +++ b/Packages/window/description.txt @@ -0,0 +1 @@ +visualization through leda_window diff --git a/Packages/window/doc_tex/Colors_and_windows/Postscript_file.tex b/Packages/window/doc_tex/Colors_and_windows/Postscript_file.tex new file mode 100644 index 00000000000..5c60ee0475c --- /dev/null +++ b/Packages/window/doc_tex/Colors_and_windows/Postscript_file.tex @@ -0,0 +1,134 @@ +\ccSetThreeColumns{Postscript_file_stream}{}{\hspace*{8.5cm}} +\ccSetTwoColumns{}{\hspace*{8.5cm}} + +\medskip +\begin{ccClass} {Postscript_file_stream} +\ccSection{PostScript File Stream} + +Note: For the functionality described in this section you need \leda. + +\ccDefinition +An object of type \ccClassName\ provides graphical output in PostScript. +\ccClassName\ is derived from the \leda\ class \ccStyle{ps_file}. +Therefore, the functionality of \ccStyle{ps_file} is available on \ccClassName\ as well. +In addition, the class \ccClassName\ provides input and output +operators for the classes which are defined in the \cgal\ kernel. +The interface of \ccClassName s is very similar to the interface of \ccStyle{leda_window}s. +To increase similarity, some functions have been added with respect to \ccStyle{ps_file}. +\begin{ccTexOnly} +For further information on \ccStyle{ps_file}, we refer to \cite{mnsu-lum}. +\end{ccTexOnly} +\begin{ccHtmlOnly} +For further information on ps_file, we refer to the +LEDA manual. +\end{ccHtmlOnly} + +\ccInclude{CGAL/IO/Postscript_file_stream.h} + +\ccCreation +\ccCreationVariable{PS} + +\ccConstructor{Postscript_file_stream();} +{creates a postscript file stream. The name of the output file is +\ccc{CGAL_unnamed.ps} .} + +\ccConstructor{Postscript_file_stream(const char* filename);} +{creates a postscript file stream. The name of the output file is +\ccc{filename} .} + +\ccConstructor{Postscript_file_stream(float w, float h);} +{creates a postscript file stream that draws the output to a box +of physical size \ccStyle{width/40} $\times$ \ccStyle{height/40} cm. +The name of the output file is \ccc{CGAL_unnamed.ps} .} + +\ccConstructor{Postscript_file_stream(float w, float h, const char* filename);} +{creates a postscript file stream that draws the output to a box +of physical size \ccStyle{width/40} $\times$ \ccStyle{height/40} cm. +The name of the output file is \ccc{filename} .} + + +\ccOperations +The drawing region of a postscript file stream is initialized by a part of the +object space by + +\ccMethod{void init(double x0, double x1, double y0); } +%{sets $xmin$ to $x_0$, $xmax$ to $x_1$, and $ymin$ to $y_0$, +% the scaling factor $scaling$ to $w / (xmax-xmin)$, and +% $ymax$ to $ymin + h \cdot scaling$. Here $w$ and $h$ are the +% width and height of the drawing section in pixels. } +{initializes the part of the object space that is mapped to the physical +drawing box to [\ccc{x0},\ccc{x1}] $\times$ [\ccc{y0},\ccc{y0} + +\ccc{height}$*$\ccc{width}/(\ccc{x1}-\ccc{x0})], where \ccc{width} and \ccc{height} +are the width and the height of the drawing box in cm.} + +The following functions have been added to give \ccClassName\ the same interface +as \ccc{Window_stream} to allow easily replacement of \ccc{Window_stream} by +\ccClassName. + +\ccMethod{void display();} +{does nothing} + +\ccMethod{void display(int x, int y);} +{does nothing} + +\ccMethod{int read_mouse(double& x, double& y);} +{returns 1} + +\ccMethod{leda_color set_fg_color(leda_color c);} +{class \ccc{set_color(c).}} + +See the \ccAnchor{http://www.mpi-sb.mpg.de/LEDA/MANUAL/MANUAL.html}{LEDA Manual} +\cite{mnsu-lum} for further operations on \ccc{ps_file}. + +\def\ccTagRmEigenClassName{\ccFalse} +\ccHeading{Output Operators} + +\ccSetThreeColumns{Postscript_file_stream& }{}{\hspace*{8.5cm}} + +The output operator is defined for all geometric classes in the two-dimensional +\cgal\ kernel. + +\ccFunction{Postscript_file_stream& operator<<(Postscript_file_stream& PS, const Class& c);} + {inserts object \ccStyle{c} into the stream \ccVar.} + +\ccFunction{Postscript_file_stream& operator<<(Postscript_file_stream& PS, const Color& c);} + {changes the foreground color for the next objects that + will be inserted into \ccVar.} + +\ccFunction{void cgalize(Postscript_file_stream& ps);} +{sets a few default values for drawing to ps. In particular, node width is +set to 5 and line width to 1.} + +There are no input operators of course. + +\ccExample + +It is important that the postscript file stream header file gets included +{\em after} the inclusion of the header files of geometric classes +that get inserted to the postscript stream file. + +\begin{cprog} + +#include +#include +#include + +typedef CGAL::Point_2< CGAL::Cartesian > Point; +typedef CGAL::Segment_2< CGAL::Cartesian > Segment; + +int main() +{ + Point p(0,1), q(2,2); + Segment s(p,q); + + CGAL::Postscript_file_stream PS(100,100); + PS.init(0,10,0); + CGAL::cgalize( PS); + PS.display(); + + PS << CGAL::RED << s << CGAL::BLACK << p << q ; + return 0; +} +\end{cprog} + +\end{ccClass} diff --git a/Packages/window/doc_tex/Colors_and_windows/Window.tex b/Packages/window/doc_tex/Colors_and_windows/Window.tex new file mode 100644 index 00000000000..9663baf4ac7 --- /dev/null +++ b/Packages/window/doc_tex/Colors_and_windows/Window.tex @@ -0,0 +1,179 @@ +\ccSetThreeColumns{Window_stream}{}{\hspace*{8.5cm}} +\ccSetTwoColumns{}{\hspace*{8.5cm}} + +%\cleardoublepage +%\chapter{Window Stream} \label{window} + +\medskip +\begin{ccClass} {Window_stream} +\ccSection{Window Stream} + +Note: For the functionality described in this section you need \leda. + +\ccDefinition + +An object of type \ccClassName\ is a two-dimensional window for +graphical IO. The input and output operations performs a mapping from +object coordinates to window coordinates. +Actually, \ccClassName\ is identical to the \leda\ class \ccStyle{leda_window}. +Therefore, the rich functionality of \ccStyle{leda_window} is available on +\ccClassName\ as well, for example panels. +In addition, the class \ccClassName\ provides input and output +operators for the classes which are defined in the \cgal\ kernel. +\ccClassName s should be initialized with a coordinate frame (by calling member function +\ccc{init}) and must be displayed (by calling member function \ccc{display}) before +drawing. + +\begin{ccTexOnly} +For further information on \ccStyle{leda_window}, we refer to \cite{mnsu-lum}. +\end{ccTexOnly} +\begin{ccHtmlOnly} +For further information on leda_window, we refer to the +LEDA manual. +\end{ccHtmlOnly} + +\ccInclude{CGAL/IO/Window_stream.h} + +\ccCreation +\ccCreationVariable{W} +\ccConstructor{Window_stream();} +{creates a squared window with maximal possible edge length +(minimum of width and height of the display).} + +\ccConstructor{Window_stream(const char* label);} +{creates a maximal squared window with frame label $label$.} + +\ccConstructor{Window_stream(float width, float height);} +{creates a window \ccVar\ of physical size \ccStyle{width} $\times$ \ccStyle{height} pixels.} + + +\ccConstructor{Window_stream(float width, float height, const char* label);} +{creates a window \ccVar\ of physical size \ccStyle{width} $\times$ \ccStyle{height} pixels +and frame label \ccc{label}.} + +In addition, \ccClassName s can be created by the functions + +\ccFunction{Window_stream* create_demo_window();} +{creates a window of 512 $\times$ 512 pixels, sets the window label to +CGAL, and initializes the object space that is mapped to the physical window to +[-1.0, 1.0] $\times$ [-1.0, 1.0]. +Returns a pointer to the window created.} + +\ccFunction{Window_stream* create_and_display_demo_window();} +{creates a window of 512 $\times$ 512 pixels, sets the window label to +CGAL, initializes the object space that is mapped to the physical window to +[-1.0, 1.0] $\times$ [-1.0, 1.0] and +displays it at default position on the display. Returns a pointer to the window created.} + +\ccFunction{Window_stream* create_demo_window( float width, float height, const char* str, double x_extension);} +{creates a window of \ccStyle{width} $\times$ \ccStyle{height} pixels, sets the window label to +\ccc{str}, and initializes the $x$-range in object space that is mapped to the physical window by +[-\ccc{x_extension}, \ccc{x_extension}]. The $y$-range is initialized such that the origin is at +the center of the window. +Returns a pointer to the window created.} + +\ccFunction{Window_stream* create_and_dislpay_demo_window( float width, float height, const char* str, double x_extension);} +{creates a window of \ccStyle{width} $\times$ \ccStyle{height} pixels, sets the window label to +\ccc{str}, and initializes the $x$-range in object space that is mapped to the physical window by +[-\ccc{x_extension}, \ccc{x_extension}]. The $y$-range is initialized such that the origin is at +the center of the window. The window is displayed at default position on the display. +Returns a pointer to the window created.} + +\ccOperations +A window is initialized by a part of the object space by + +\ccMethod{void init(double x0, double x1, double y0); } +%{sets $xmin$ to $x_0$, $xmax$ to $x_1$, and $ymin$ to $y_0$, +% the scaling factor $scaling$ to $w / (xmax-xmin)$, and +% $ymax$ to $ymin + h \cdot scaling$. Here $w$ and $h$ are the +% width and height of the drawing section in pixels. } +{initializes the part of the object space that is mapped to the physical +window to [\ccc{x0},\ccc{x1}] $\times$ +[\ccc{y0},\ccc{y0} + \ccc{height}$*$(\ccc{x1}-\ccc{x0})/\ccc{width}], +where \ccc{width} and \ccc{height} are the width and the height of the window in pixels.} + +To display a window, the following functions can be used. Note that \ccc{W.display()} +has to be called before all drawing operations on \ccc{W} and that all operations adding +panel items to \ccc{W} have to be called before the first call of \ccc{W.display()}. + +\ccMethod{void display();} +{opens \ccc{W} and displays it at the default position, i.e. +with its right upper corner in the upper right corner of the screen.} + +\ccMethod{void display(int x, int y);} +{opens \ccc{W} and displays it with its left upper corner at position +(\ccc{x},\ccc{y}).} + +\ccMethod{void display(Window_stream& W0, int x, int y);}{} +\ccMethod{void display(int x, int y, Window_stream& W0);} +{opens \ccc{W} and displays it with its left upper corner at position +(\ccc{x},\ccc{y}) relative to the upper left corner of window \ccc{W0}.} + +See the \ccAnchor{http://www.mpi-sb.mpg.de/LEDA/MANUAL/MANUAL.html}{LEDA Manual} +\cite{mnsu-lum} for further operations on \ccc{leda_window}. + +\def\ccTagRmEigenClassName{\ccFalse} +\ccHeading{Output Operators} + +\ccSetThreeColumns{Window_stream& }{}{\hspace*{8.5cm}} + +The output operator is defined for all geometric classes in the \cgal\ kernel. + +\ccFunction{Window_stream& operator<<(Window_stream &W, const Class &c);} + {inserts object \ccStyle{c} into the stream \ccVar.} + +\ccFunction{Window_stream& operator<<(Window_stream &W, const Color &c);} + {changes the foreground color for the next objects that + will be inserted into \ccVar.} + +Note that CGAL points are drawn using \leda\ functions for drawing nodes of a graph. +Before drawing points, the size for drawing nodes should be adjusted, either by calling +member function \ccc{set_node_width(int)} or by + +\ccFunction{void cgalize(Window_stream& w);} +{sets a few default values for drawing in window \ccc{w}. In particular, node width is +set to 3 and line width to 2.} + + +\ccHeading{Input Operators} + +The input operator is defined for all geometric classes in the \cgal\ kernel. +The coordinates of the geometric objects are in object space. Data are +entered with the left mouse button. + +\ccFunction{Window_stream& + operator>>(Window_stream &W, Class &c);} + {extracts object \ccStyle{c} from the stream \ccVar.} + +\ccExample + +It is important that the window stream header file gets included +{\em after} the inclusion of the header files of geometric classes +that get inserted to or extracted from the window stream. + +\begin{cprog} + +#include +#include +#include + +typedef CGAL::Point_2< Cartesian > Point; +typedef CGAL::Segment_2< Cartesian > Segment; + +int main() +{ + Point p(0,1), q(2,2); + Segment s(p,q); + + CGAL::Window_stream W(100,100); + W.init(0,10,10); + CGAL::cgalize( W); + W.display(); + + W << CGAL::RED << s << CGAL::BLACK << p << q ; + W >> s >> p; + return 0; +} +\end{cprog} + +\end{ccClass} diff --git a/Packages/window/doc_tex/Colors_and_windows/window_stream_xy_3.tex b/Packages/window/doc_tex/Colors_and_windows/window_stream_xy_3.tex new file mode 100644 index 00000000000..120cbd56592 --- /dev/null +++ b/Packages/window/doc_tex/Colors_and_windows/window_stream_xy_3.tex @@ -0,0 +1,9 @@ +% +------------------------------------------------------------------------+ +\section{3D Objects with Window Stream} + +3D objects can be used with \ccc{Window_stream}. The stream output +operator \ccc{<<} projects them to the $xy$-plane. The stream input +operator \ccc{>>} sets the $z$ coordinate to zero. + +\ccInclude{CGAL/IO/window_stream_xy_3.h} + diff --git a/Packages/window/doc_tex/support/Colors_and_windows/Postscript_file.tex b/Packages/window/doc_tex/support/Colors_and_windows/Postscript_file.tex new file mode 100644 index 00000000000..5c60ee0475c --- /dev/null +++ b/Packages/window/doc_tex/support/Colors_and_windows/Postscript_file.tex @@ -0,0 +1,134 @@ +\ccSetThreeColumns{Postscript_file_stream}{}{\hspace*{8.5cm}} +\ccSetTwoColumns{}{\hspace*{8.5cm}} + +\medskip +\begin{ccClass} {Postscript_file_stream} +\ccSection{PostScript File Stream} + +Note: For the functionality described in this section you need \leda. + +\ccDefinition +An object of type \ccClassName\ provides graphical output in PostScript. +\ccClassName\ is derived from the \leda\ class \ccStyle{ps_file}. +Therefore, the functionality of \ccStyle{ps_file} is available on \ccClassName\ as well. +In addition, the class \ccClassName\ provides input and output +operators for the classes which are defined in the \cgal\ kernel. +The interface of \ccClassName s is very similar to the interface of \ccStyle{leda_window}s. +To increase similarity, some functions have been added with respect to \ccStyle{ps_file}. +\begin{ccTexOnly} +For further information on \ccStyle{ps_file}, we refer to \cite{mnsu-lum}. +\end{ccTexOnly} +\begin{ccHtmlOnly} +For further information on ps_file, we refer to the +LEDA manual. +\end{ccHtmlOnly} + +\ccInclude{CGAL/IO/Postscript_file_stream.h} + +\ccCreation +\ccCreationVariable{PS} + +\ccConstructor{Postscript_file_stream();} +{creates a postscript file stream. The name of the output file is +\ccc{CGAL_unnamed.ps} .} + +\ccConstructor{Postscript_file_stream(const char* filename);} +{creates a postscript file stream. The name of the output file is +\ccc{filename} .} + +\ccConstructor{Postscript_file_stream(float w, float h);} +{creates a postscript file stream that draws the output to a box +of physical size \ccStyle{width/40} $\times$ \ccStyle{height/40} cm. +The name of the output file is \ccc{CGAL_unnamed.ps} .} + +\ccConstructor{Postscript_file_stream(float w, float h, const char* filename);} +{creates a postscript file stream that draws the output to a box +of physical size \ccStyle{width/40} $\times$ \ccStyle{height/40} cm. +The name of the output file is \ccc{filename} .} + + +\ccOperations +The drawing region of a postscript file stream is initialized by a part of the +object space by + +\ccMethod{void init(double x0, double x1, double y0); } +%{sets $xmin$ to $x_0$, $xmax$ to $x_1$, and $ymin$ to $y_0$, +% the scaling factor $scaling$ to $w / (xmax-xmin)$, and +% $ymax$ to $ymin + h \cdot scaling$. Here $w$ and $h$ are the +% width and height of the drawing section in pixels. } +{initializes the part of the object space that is mapped to the physical +drawing box to [\ccc{x0},\ccc{x1}] $\times$ [\ccc{y0},\ccc{y0} + +\ccc{height}$*$\ccc{width}/(\ccc{x1}-\ccc{x0})], where \ccc{width} and \ccc{height} +are the width and the height of the drawing box in cm.} + +The following functions have been added to give \ccClassName\ the same interface +as \ccc{Window_stream} to allow easily replacement of \ccc{Window_stream} by +\ccClassName. + +\ccMethod{void display();} +{does nothing} + +\ccMethod{void display(int x, int y);} +{does nothing} + +\ccMethod{int read_mouse(double& x, double& y);} +{returns 1} + +\ccMethod{leda_color set_fg_color(leda_color c);} +{class \ccc{set_color(c).}} + +See the \ccAnchor{http://www.mpi-sb.mpg.de/LEDA/MANUAL/MANUAL.html}{LEDA Manual} +\cite{mnsu-lum} for further operations on \ccc{ps_file}. + +\def\ccTagRmEigenClassName{\ccFalse} +\ccHeading{Output Operators} + +\ccSetThreeColumns{Postscript_file_stream& }{}{\hspace*{8.5cm}} + +The output operator is defined for all geometric classes in the two-dimensional +\cgal\ kernel. + +\ccFunction{Postscript_file_stream& operator<<(Postscript_file_stream& PS, const Class& c);} + {inserts object \ccStyle{c} into the stream \ccVar.} + +\ccFunction{Postscript_file_stream& operator<<(Postscript_file_stream& PS, const Color& c);} + {changes the foreground color for the next objects that + will be inserted into \ccVar.} + +\ccFunction{void cgalize(Postscript_file_stream& ps);} +{sets a few default values for drawing to ps. In particular, node width is +set to 5 and line width to 1.} + +There are no input operators of course. + +\ccExample + +It is important that the postscript file stream header file gets included +{\em after} the inclusion of the header files of geometric classes +that get inserted to the postscript stream file. + +\begin{cprog} + +#include +#include +#include + +typedef CGAL::Point_2< CGAL::Cartesian > Point; +typedef CGAL::Segment_2< CGAL::Cartesian > Segment; + +int main() +{ + Point p(0,1), q(2,2); + Segment s(p,q); + + CGAL::Postscript_file_stream PS(100,100); + PS.init(0,10,0); + CGAL::cgalize( PS); + PS.display(); + + PS << CGAL::RED << s << CGAL::BLACK << p << q ; + return 0; +} +\end{cprog} + +\end{ccClass} diff --git a/Packages/window/doc_tex/support/Colors_and_windows/Window.tex b/Packages/window/doc_tex/support/Colors_and_windows/Window.tex new file mode 100644 index 00000000000..9663baf4ac7 --- /dev/null +++ b/Packages/window/doc_tex/support/Colors_and_windows/Window.tex @@ -0,0 +1,179 @@ +\ccSetThreeColumns{Window_stream}{}{\hspace*{8.5cm}} +\ccSetTwoColumns{}{\hspace*{8.5cm}} + +%\cleardoublepage +%\chapter{Window Stream} \label{window} + +\medskip +\begin{ccClass} {Window_stream} +\ccSection{Window Stream} + +Note: For the functionality described in this section you need \leda. + +\ccDefinition + +An object of type \ccClassName\ is a two-dimensional window for +graphical IO. The input and output operations performs a mapping from +object coordinates to window coordinates. +Actually, \ccClassName\ is identical to the \leda\ class \ccStyle{leda_window}. +Therefore, the rich functionality of \ccStyle{leda_window} is available on +\ccClassName\ as well, for example panels. +In addition, the class \ccClassName\ provides input and output +operators for the classes which are defined in the \cgal\ kernel. +\ccClassName s should be initialized with a coordinate frame (by calling member function +\ccc{init}) and must be displayed (by calling member function \ccc{display}) before +drawing. + +\begin{ccTexOnly} +For further information on \ccStyle{leda_window}, we refer to \cite{mnsu-lum}. +\end{ccTexOnly} +\begin{ccHtmlOnly} +For further information on leda_window, we refer to the +LEDA manual. +\end{ccHtmlOnly} + +\ccInclude{CGAL/IO/Window_stream.h} + +\ccCreation +\ccCreationVariable{W} +\ccConstructor{Window_stream();} +{creates a squared window with maximal possible edge length +(minimum of width and height of the display).} + +\ccConstructor{Window_stream(const char* label);} +{creates a maximal squared window with frame label $label$.} + +\ccConstructor{Window_stream(float width, float height);} +{creates a window \ccVar\ of physical size \ccStyle{width} $\times$ \ccStyle{height} pixels.} + + +\ccConstructor{Window_stream(float width, float height, const char* label);} +{creates a window \ccVar\ of physical size \ccStyle{width} $\times$ \ccStyle{height} pixels +and frame label \ccc{label}.} + +In addition, \ccClassName s can be created by the functions + +\ccFunction{Window_stream* create_demo_window();} +{creates a window of 512 $\times$ 512 pixels, sets the window label to +CGAL, and initializes the object space that is mapped to the physical window to +[-1.0, 1.0] $\times$ [-1.0, 1.0]. +Returns a pointer to the window created.} + +\ccFunction{Window_stream* create_and_display_demo_window();} +{creates a window of 512 $\times$ 512 pixels, sets the window label to +CGAL, initializes the object space that is mapped to the physical window to +[-1.0, 1.0] $\times$ [-1.0, 1.0] and +displays it at default position on the display. Returns a pointer to the window created.} + +\ccFunction{Window_stream* create_demo_window( float width, float height, const char* str, double x_extension);} +{creates a window of \ccStyle{width} $\times$ \ccStyle{height} pixels, sets the window label to +\ccc{str}, and initializes the $x$-range in object space that is mapped to the physical window by +[-\ccc{x_extension}, \ccc{x_extension}]. The $y$-range is initialized such that the origin is at +the center of the window. +Returns a pointer to the window created.} + +\ccFunction{Window_stream* create_and_dislpay_demo_window( float width, float height, const char* str, double x_extension);} +{creates a window of \ccStyle{width} $\times$ \ccStyle{height} pixels, sets the window label to +\ccc{str}, and initializes the $x$-range in object space that is mapped to the physical window by +[-\ccc{x_extension}, \ccc{x_extension}]. The $y$-range is initialized such that the origin is at +the center of the window. The window is displayed at default position on the display. +Returns a pointer to the window created.} + +\ccOperations +A window is initialized by a part of the object space by + +\ccMethod{void init(double x0, double x1, double y0); } +%{sets $xmin$ to $x_0$, $xmax$ to $x_1$, and $ymin$ to $y_0$, +% the scaling factor $scaling$ to $w / (xmax-xmin)$, and +% $ymax$ to $ymin + h \cdot scaling$. Here $w$ and $h$ are the +% width and height of the drawing section in pixels. } +{initializes the part of the object space that is mapped to the physical +window to [\ccc{x0},\ccc{x1}] $\times$ +[\ccc{y0},\ccc{y0} + \ccc{height}$*$(\ccc{x1}-\ccc{x0})/\ccc{width}], +where \ccc{width} and \ccc{height} are the width and the height of the window in pixels.} + +To display a window, the following functions can be used. Note that \ccc{W.display()} +has to be called before all drawing operations on \ccc{W} and that all operations adding +panel items to \ccc{W} have to be called before the first call of \ccc{W.display()}. + +\ccMethod{void display();} +{opens \ccc{W} and displays it at the default position, i.e. +with its right upper corner in the upper right corner of the screen.} + +\ccMethod{void display(int x, int y);} +{opens \ccc{W} and displays it with its left upper corner at position +(\ccc{x},\ccc{y}).} + +\ccMethod{void display(Window_stream& W0, int x, int y);}{} +\ccMethod{void display(int x, int y, Window_stream& W0);} +{opens \ccc{W} and displays it with its left upper corner at position +(\ccc{x},\ccc{y}) relative to the upper left corner of window \ccc{W0}.} + +See the \ccAnchor{http://www.mpi-sb.mpg.de/LEDA/MANUAL/MANUAL.html}{LEDA Manual} +\cite{mnsu-lum} for further operations on \ccc{leda_window}. + +\def\ccTagRmEigenClassName{\ccFalse} +\ccHeading{Output Operators} + +\ccSetThreeColumns{Window_stream& }{}{\hspace*{8.5cm}} + +The output operator is defined for all geometric classes in the \cgal\ kernel. + +\ccFunction{Window_stream& operator<<(Window_stream &W, const Class &c);} + {inserts object \ccStyle{c} into the stream \ccVar.} + +\ccFunction{Window_stream& operator<<(Window_stream &W, const Color &c);} + {changes the foreground color for the next objects that + will be inserted into \ccVar.} + +Note that CGAL points are drawn using \leda\ functions for drawing nodes of a graph. +Before drawing points, the size for drawing nodes should be adjusted, either by calling +member function \ccc{set_node_width(int)} or by + +\ccFunction{void cgalize(Window_stream& w);} +{sets a few default values for drawing in window \ccc{w}. In particular, node width is +set to 3 and line width to 2.} + + +\ccHeading{Input Operators} + +The input operator is defined for all geometric classes in the \cgal\ kernel. +The coordinates of the geometric objects are in object space. Data are +entered with the left mouse button. + +\ccFunction{Window_stream& + operator>>(Window_stream &W, Class &c);} + {extracts object \ccStyle{c} from the stream \ccVar.} + +\ccExample + +It is important that the window stream header file gets included +{\em after} the inclusion of the header files of geometric classes +that get inserted to or extracted from the window stream. + +\begin{cprog} + +#include +#include +#include + +typedef CGAL::Point_2< Cartesian > Point; +typedef CGAL::Segment_2< Cartesian > Segment; + +int main() +{ + Point p(0,1), q(2,2); + Segment s(p,q); + + CGAL::Window_stream W(100,100); + W.init(0,10,10); + CGAL::cgalize( W); + W.display(); + + W << CGAL::RED << s << CGAL::BLACK << p << q ; + W >> s >> p; + return 0; +} +\end{cprog} + +\end{ccClass} diff --git a/Packages/window/doc_tex/support/Colors_and_windows/window_stream_xy_3.tex b/Packages/window/doc_tex/support/Colors_and_windows/window_stream_xy_3.tex new file mode 100644 index 00000000000..120cbd56592 --- /dev/null +++ b/Packages/window/doc_tex/support/Colors_and_windows/window_stream_xy_3.tex @@ -0,0 +1,9 @@ +% +------------------------------------------------------------------------+ +\section{3D Objects with Window Stream} + +3D objects can be used with \ccc{Window_stream}. The stream output +operator \ccc{<<} projects them to the $xy$-plane. The stream input +operator \ccc{>>} sets the $z$ coordinate to zero. + +\ccInclude{CGAL/IO/window_stream_xy_3.h} + diff --git a/Packages/window/include/CGAL/IO/Postscript_file_stream.h b/Packages/window/include/CGAL/IO/Postscript_file_stream.h new file mode 100644 index 00000000000..38c26581e16 --- /dev/null +++ b/Packages/window/include/CGAL/IO/Postscript_file_stream.h @@ -0,0 +1,794 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, August 22 +// +// source : ps_file.fw +// file : CGAL/IO/Postscript_file_stream.h +// package : window (2.7.1) +// maintainer : Stefan Schirra +// revision : 2.7 +// revision_date : 21 Aug 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_POSTSCRIPT_FILE_STREAM_H +#define CGAL_POSTSCRIPT_FILE_STREAM_H + +#include +#ifdef LEDA_PS_FILE_H +# error Internal CGAL error: should not have been included yet +#else +# include +# include +# include +# include +# include +# include +# include +# include +# include +# if (__LEDA__ >= 400) +# include +# endif // 400 +# include +# include +# if (__LEDA__ >= 400) +# include +# include +# endif // 400 +# define private protected +# include +# undef private +#endif // LEDA_PS_FILE_H +#include + +CGAL_BEGIN_NAMESPACE + + +typedef ::ps_file leda_ps_file; + +class Postscript_file_stream : public leda_ps_file +{ + public: + Postscript_file_stream(double w,double h, leda_string name="CGAL_unnamed.ps") + : leda_ps_file(w/40.0, h/40.0, name) + {} + + Postscript_file_stream(leda_string name="CGAL_unnamed.ps") + : leda_ps_file( name ) + { set_draw_bb(false); } + + void display() {} + void display(int x, int y) {} + int read_mouse(double& x, double& y) {return 1;} + leda_color set_fg_color(leda_color c) { return set_color(c); } + void set_font(const leda_string& ls) { set_text_font(ls); } + void change_rgb(const Color&); + bool is_in_colormode(); +}; + + +inline +void +Postscript_file_stream::change_rgb(const Color& c) +{ + file << double(c.r())/255.0 << " " + << double(c.g())/255.0 << " " + << double(c.b())/255.0 << " srgb\n"; +} + + +inline +bool +Postscript_file_stream::is_in_colormode() +{ return (outputmode==colored_mode); } + + +inline +Postscript_file_stream& +operator<<(Postscript_file_stream& w, const Color& c) +{ + assert( w.is_in_colormode() ); + w.change_rgb(c); + return w; +} + + +inline +void +cgalize(Postscript_file_stream& w) +{ + w.set_node_width( 5); + w.set_line_width( 1); +} + + +inline +Postscript_file_stream* +create_demo_postscript_file_stream( float w = 512.0, float h = 512.0, + const char* str = "CGAL", + double x_extension = 1.0) +{ + Postscript_file_stream* Wptr = new Postscript_file_stream( w, h); + cgalize( *Wptr); + double y_extension = x_extension * h / w; + Wptr->init(-x_extension, x_extension, -y_extension); + return Wptr; +} + + +inline +Postscript_file_stream* +create_and_display_demo_postscript_file_stream(float w = 512.0, float h = 512.0, + const char* str = "CGAL", + double x_extension = 1.0) +{ + Postscript_file_stream* Wptr = new Postscript_file_stream( w, h); + cgalize( *Wptr); + double y_extension = x_extension * h / w; + Wptr->init(-x_extension, x_extension, -y_extension); + return Wptr; +} + + +#endif // CGAL_POSTSCRIPT_FILE_STREAM_H + +// Each of the following operators is individually +// protected against multiple inclusion. + +#ifdef CGAL_POINT_2_H +#ifndef CGAL_POSTSCRIPT_FILE_STREAM_POINT_2 +#define CGAL_POSTSCRIPT_FILE_STREAM_POINT_2 +template< class R > +Postscript_file_stream& +operator<<(Postscript_file_stream& w, const Point_2& p) +{ + double x = CGAL::to_double(p.x()); + double y = CGAL::to_double(p.y()); + double width = w.get_node_width(); + if (width < 2.0) + w.draw_point(x,y); + else + w.draw_filled_node(x,y); + + return w; +} + +template< class R > +Postscript_file_stream& +operator>>(Postscript_file_stream& w, Point_2& p) +{ + typedef typename R::RT RT; + leda_point l_p; + leda_drawing_mode save = w.set_mode(leda_xor_mode); + if (w >> l_p) + { + double x = l_p.xcoord(); + double y = l_p.ycoord(); + w << l_p; + w.set_mode( save); + double width = w.get_node_width(); + if (width < 2.0) + w.draw_point(x,y); + else + w.draw_filled_node(x,y); + + p = Point_2( RT(x), RT(y)); + } + else + { + w.set_mode( save); + } + return w; +} + +template< class R > +Postscript_file_stream& +read(Postscript_file_stream& w, Point_2& p) +{ + typedef typename R::RT RT; + leda_point l_p; + if (w >> l_p) + { + double x = l_p.xcoord(); + double y = l_p.ycoord(); + p = Point_2( RT(x), RT(y)); + } + return w; +} + +template +void +read_mouse_plus(Postscript_file_stream& w, Point_2& p, int& button) +{ + typedef typename R::RT RT; + double x, y; + button = w.read_mouse(x,y); + double width = w.get_node_width(); + if (width < 2.0) + w.draw_point(x,y); + else + w.draw_filled_node(x,y); + + p = Point_2(RT(x), RT(y)); +} + +#endif // CGAL_POSTSCRIPT_FILE_STREAM_POINT_2 +#endif // CGAL_POINT_2_H + + +#ifdef CGAL_SEGMENT_2_H +#ifndef CGAL_POSTSCRIPT_FILE_STREAM_SEGMENT_2 +#define CGAL_POSTSCRIPT_FILE_STREAM_SEGMENT_2 +template< class R > +Postscript_file_stream& +operator<<(Postscript_file_stream& w, const Segment_2& s) +{ + w.draw_segment(CGAL::to_double(s.source().x()), + CGAL::to_double(s.source().y()), + CGAL::to_double(s.target().x()), + CGAL::to_double(s.target().y())); + return w; +} + +template< class R > +Postscript_file_stream& +operator>>(Postscript_file_stream& w, Segment_2& s) +{ + typedef typename R::RT RT; + leda_segment l_s; + leda_drawing_mode save = w.set_mode(leda_xor_mode); + if ( w.read( l_s)) + { + double x1 = l_s.xcoord1(); + double y1 = l_s.ycoord1(); + double x2 = l_s.xcoord2(); + double y2 = l_s.ycoord2(); + w.set_mode( save); + w.draw_segment(x1,y1, x2, y2); + s = Segment_2(Point_2( RT(x1), RT(y1)), + Point_2( RT(x2), RT(y2))); + } + else + { + w.set_mode( save); + } + return w; +} + +template< class R > +Postscript_file_stream& +read(Postscript_file_stream& w, Segment_2& s) +{ + typedef typename R::RT RT; + leda_segment l_s; + if ( w.read( l_s)) + { + double x1 = l_s.xcoord1(); + double y1 = l_s.ycoord1(); + double x2 = l_s.xcoord2(); + double y2 = l_s.ycoord2(); + s = Segment_2(Point_2( RT(x1), RT(y1)), + Point_2( RT(x2), RT(y2))); + } + return w; +} +#endif // CGAL_POSTSCRIPT_FILE_STREAM_SEGMENT_2 +#endif // CGAL_SEGMENT_2_H + + +#ifdef CGAL_LINE_2_H +#ifndef CGAL_POSTSCRIPT_FILE_STREAM_LINE_2 +#define CGAL_POSTSCRIPT_FILE_STREAM_LINE_2 + +template< class R > +Postscript_file_stream& +operator<<(Postscript_file_stream& w, const Line_2& l) +{ + Point_2 p1 = l.point(), + p2 = p1 + l.direction().vector(); + w.draw_line(CGAL::to_double(p1.x()), CGAL::to_double(p1.y()), + CGAL::to_double(p2.x()), CGAL::to_double(p2.y())); + return w; +} + +template< class R > +Postscript_file_stream& +operator>>(Postscript_file_stream& w, Line_2& l) +{ + typedef typename R::RT RT; + leda_segment l_s; + leda_drawing_mode save = w.set_mode(leda_xor_mode); + if ( w.read( l_s)) + { + double x1 = l_s.xcoord1(); + double y1 = l_s.ycoord1(); + double x2 = l_s.xcoord2(); + double y2 = l_s.ycoord2(); + w.set_mode( save); + w.draw_line(x1,y1, x2, y2); + l = Line_2(Point_2( RT(x1), RT(y1)), + Point_2( RT(x2), RT(y2))); + } + else + { + w.set_mode( save); + } + return w; +} + +template< class R > +Postscript_file_stream& +read(Postscript_file_stream& w, Line_2& l) +{ + typedef typename R::RT RT; + leda_segment l_s; + if ( w.read( l_s)) + { + double x1 = l_s.xcoord1(); + double y1 = l_s.ycoord1(); + double x2 = l_s.xcoord2(); + double y2 = l_s.ycoord2(); + l = Line_2(Point_2( RT(x1), RT(y1)), + Point_2( RT(x2), RT(y2))); + } + return w; +} +#endif // CGAL_POSTSCRIPT_FILE_STREAM_LINE_2 +#endif //CGAL_LINE_2_H + +#ifdef CGAL_RAY_2_H +#ifndef CGAL_POSTSCRIPT_FILE_STREAM_RAY_2 +#define CGAL_POSTSCRIPT_FILE_STREAM_RAY_2 +template< class R > +Postscript_file_stream& +operator<<(Postscript_file_stream& w, const Ray_2& r) +{ + Point_2 p = r.point(0); + Point_2 q = r.point(1); + w.draw_ray(CGAL::to_double(p.x()), + CGAL::to_double(p.y()), + CGAL::to_double(q.x()), + CGAL::to_double(q.y())); + return w; +} + +template< class R > +Postscript_file_stream& +operator>>(Postscript_file_stream& w, Ray_2& r) +{ + typedef typename R::RT RT; + leda_segment l_s; + leda_drawing_mode save = w.set_mode(leda_xor_mode); + if ( w.read( l_s)) + { + double x1 = l_s.xcoord1(); + double y1 = l_s.ycoord1(); + double x2 = l_s.xcoord2(); + double y2 = l_s.ycoord2(); + w.set_mode( save); + r = Ray_2(Point_2( RT(x1), RT(y1)), + Point_2( RT(x2), RT(y2))); + w << r; + } + else + { + w.set_mode( save); + } + return w; +} + +template< class R > +Postscript_file_stream& +read(Postscript_file_stream& w, Ray_2& r) +{ + typedef typename R::RT RT; + leda_segment l_s; + if ( w.read( l_s)) + { + double x1 = l_s.xcoord1(); + double y1 = l_s.ycoord1(); + double x2 = l_s.xcoord2(); + double y2 = l_s.ycoord2(); + r = Ray_2(Point_2( RT(x1), RT(y1)), + Point_2( RT(x2), RT(y2))); + } + return w; +} +#endif // CGAL_POSTSCRIPT_FILE_STREAM_RAY_2 +#endif //CGAL_RAY_2_H + +#ifdef CGAL_TRIANGLE_2_H +#ifndef CGAL_POSTSCRIPT_FILE_STREAM_TRIANGLE_2 +#define CGAL_POSTSCRIPT_FILE_STREAM_TRIANGLE_2 +template< class R > +Postscript_file_stream& +operator<<(Postscript_file_stream& w, const Triangle_2& t) +{ + double x0 = CGAL::to_double(t.vertex(0).x()), + y0 = CGAL::to_double(t.vertex(0).y()), + x1 = CGAL::to_double(t.vertex(1).x()), + y1 = CGAL::to_double(t.vertex(1).y()), + x2 = CGAL::to_double(t.vertex(2).x()), + y2 = CGAL::to_double(t.vertex(2).y()); + w.draw_segment(x0, y0, x1, y1); + w.draw_segment(x1, y1, x2, y2); + w.draw_segment(x2, y2, x0, y0); + return w; +} + +template< class R > +Postscript_file_stream& +operator>>(Postscript_file_stream& w, Triangle_2& t) +{ + typedef typename R::RT RT; + double x,y; + int key = 0; +#if ( __LEDA__ < 362 ) + w.state = 1; +#else + w.set_state( 1); +#endif // __LEDA__ < ... + leda_point first, second, third, p; + leda_drawing_mode save = w.set_mode(leda_xor_mode); + if ( !( w >> first)) { w.set_mode( save); return w; } + int save_but[8]; + w.std_buttons(save_but); + key = w.read_mouse_seg( first.xcoord(), first.ycoord(), x, y); + if ( key == MOUSE_BUTTON(3)) + { + w.set_buttons( save_but); + w.set_mode( save); +#if ( __LEDA__ < 362 ) + w.state = 0; +#else + w.set_state( 0); +#endif // __LEDA__ < ... + return w; + } + else + { + w << leda_segment( first.xcoord(), first.ycoord(), x, y); + second = leda_point( x, y); + } + key = w.read_mouse_seg( second.xcoord(), second.ycoord(), x, y); + if ( key == MOUSE_BUTTON(3)) + { + w << leda_segment( first, second ); + w.set_buttons( save_but); + w.set_mode( save); +#if ( __LEDA__ < 362 ) + w.state = 0; +#else + w.set_state( 0); +#endif // __LEDA__ < ... + return w; + } + else + { + w << leda_segment( second.xcoord(), second.ycoord(), x, y); + third = leda_point( x, y); + } + w << leda_segment( first, second ); + w << leda_segment( second, third ); + double x0 = first.xcoord(); + double y0 = first.ycoord(); + double x1 = second.xcoord(); + double y1 = second.ycoord(); + double x2 = third.xcoord(); + double y2 = third.ycoord(); + w.set_mode( save); + w.draw_segment(x0,y0, x1, y1); + w.draw_segment(x1,y1, x2, y2); + w.draw_segment(x2,y2, x0, y0); + + t = Triangle_2(Point_2( RT(x0), RT(y0)), + Point_2( RT(x1), RT(y1)), + Point_2( RT(x2), RT(y2))); + return w; +} + +template< class R > +Postscript_file_stream& +read(Postscript_file_stream& w, Triangle_2& t) +{ + typedef typename R::RT RT; + double x,y; + int key = 0; +#if ( __LEDA__ < 362 ) + w.state = 1; +#else + w.set_state( 1); +#endif // __LEDA__ < ... + leda_point first, second, third, p; + leda_drawing_mode save = w.set_mode(leda_xor_mode); + if ( !( w >> first)) { w.set_mode( save); return w; } + int save_but[8]; + w.std_buttons(save_but); + key = w.read_mouse_seg( first.xcoord(), first.ycoord(), x, y); + if ( key == MOUSE_BUTTON(3)) + { + w.set_buttons( save_but); + w.set_mode( save); +#if ( __LEDA__ < 362 ) + w.state = 0; +#else + w.set_state( 0); +#endif // __LEDA__ < ... + return w; + } + else + { + w << leda_segment( first.xcoord(), first.ycoord(), x, y); + second = leda_point( x, y); + } + key = w.read_mouse_seg( second.xcoord(), second.ycoord(), x, y); + if ( key == MOUSE_BUTTON(3)) + { + w << leda_segment( first, second ); + w.set_buttons( save_but); + w.set_mode( save); +#if ( __LEDA__ < 362 ) + w.state = 0; +#else + w.set_state( 0); +#endif // __LEDA__ < ... + return w; + } + else + { + w << leda_segment( second.xcoord(), second.ycoord(), x, y); + third = leda_point( x, y); + } + w << leda_segment( first, second ); + w << leda_segment( second, third ); + double x0 = first.xcoord(); + double y0 = first.ycoord(); + double x1 = second.xcoord(); + double y1 = second.ycoord(); + double x2 = third.xcoord(); + double y2 = third.ycoord(); + w.set_mode( save); + t = Triangle_2(Point_2( RT(x0), RT(y0)), + Point_2( RT(x1), RT(y1)), + Point_2( RT(x2), RT(y2))); + return w; +} +#endif // CGAL_POSTSCRIPT_FILE_STREAM_TRIANGLE_2 +#endif // CGAL_TRIANGLE_2_H + +#ifdef CGAL_CIRCLE_2_H +#ifndef CGAL_POSTSCRIPT_FILE_STREAM_CIRCLE_2 +#define CGAL_POSTSCRIPT_FILE_STREAM_CIRCLE_2 +template< class R > +Postscript_file_stream& +operator<<(Postscript_file_stream& w, const Circle_2& c) +{ + double cx = CGAL::to_double(c.center().x()), + cy = CGAL::to_double(c.center().y()), + r = CGAL::to_double(c.squared_radius()); + w.draw_circle(cx, cy , sqrt(r)); + return w; +} + +template< class R > +Postscript_file_stream& +operator>>(Postscript_file_stream& w, Circle_2& c) +{ + typedef typename R::RT RT; + double x,y; + int key = 0; +#if ( __LEDA__ < 362 ) + w.state = 1; +#else + w.set_state( 1); +#endif // __LEDA__ < ... + leda_point p; + leda_drawing_mode save = w.set_mode(leda_xor_mode); + if ( !( w.read( p))) { w.set_mode( save); return w; } + double cx = p.xcoord(); + double cy = p.ycoord(); + Point_2 center = Point_2( RT(cx), RT(cy)); + int save_but[8]; + w.std_buttons(save_but); + key = w.read_mouse_circle(cx, cy, x, y); + if ( key == MOUSE_BUTTON(3)) + { + w.set_buttons( save_but); + w.set_mode( save); +#if ( __LEDA__ < 362 ) + w.state = 0; +#else + w.set_state( 0); +#endif // __LEDA__ < ... + return w; + } + double dx = x - cx; + double dy = y - cy; + double sqr = dx*dx+dy*dy; + w.set_mode( save); + w.set_buttons( save_but); + w.draw_circle(cx, cy , sqrt(sqr)); + c = Circle_2(center, RT(sqr)); + return w; +} + +template< class R > +Postscript_file_stream& +read(Postscript_file_stream& w, Circle_2& c) +{ + typedef typename R::RT RT; + double x,y; + int key = 0; +#if ( __LEDA__ < 362 ) + w.state = 1; +#else + w.set_state( 1); +#endif // __LEDA__ < ... + leda_point p; + leda_drawing_mode save = w.set_mode(leda_xor_mode); + if ( !( w.read( p))) { w.set_mode( save); return w; } + double cx = p.xcoord(); + double cy = p.ycoord(); + Point_2 center = Point_2( RT(cx), RT(cy)); + int save_but[8]; + w.std_buttons(save_but); + key = w.read_mouse_circle(cx, cy, x, y); + if ( key == MOUSE_BUTTON(3)) + { + w.set_buttons( save_but); + w.set_mode( save); +#if ( __LEDA__ < 362 ) + w.state = 0; +#else + w.set_state( 0); +#endif // __LEDA__ < ... + return w; + } + double dx = x - cx; + double dy = y - cy; + double sqr = dx*dx+dy*dy; + w.set_mode( save); + w.set_buttons( save_but); + c = Circle_2(center, RT(sqr)); + return w; +} +#endif // CGAL_POSTSCRIPT_FILE_STREAM_CIRCLE_2 +#endif // CGAL_CIRCLE_2_H + +#ifdef CGAL_ISO_RECTANGLE_2_H +#ifndef CGAL_POSTSCRIPT_FILE_STREAM_ISO_RECTANGLE_2 +#define CGAL_POSTSCRIPT_FILE_STREAM_ISO_RECTANGLE_2 +template< class R > +Postscript_file_stream& +operator<<(Postscript_file_stream& w, const Iso_rectangle_2& r) +{ + double xmin = CGAL::to_double(r.min().x()), + ymin = CGAL::to_double(r.min().y()), + xmax = CGAL::to_double(r.max().x()), + ymax = CGAL::to_double(r.max().y()); + w.draw_segment(xmin, ymin, xmax, ymin); + w.draw_segment(xmax, ymin, xmax, ymax); + w.draw_segment(xmax, ymax, xmin, ymax); + w.draw_segment(xmin, ymax, xmin, ymin); + return w; +} + +template< class R > +Postscript_file_stream& +operator>>(Postscript_file_stream& w, Iso_rectangle_2& r) +{ + typedef typename R::RT RT; + double x,y; + int key = 0; +#if ( __LEDA__ < 362 ) + w.state = 1; +#else + w.set_state( 1); +#endif // __LEDA__ < ... + leda_point first, second; + leda_drawing_mode save = w.set_mode(leda_xor_mode); + if ( !( w.read( first))) { w.set_mode( save); return w; } + int save_but[8]; + w.std_buttons(save_but); + key = w.read_mouse_rect( first.xcoord(), first.ycoord(), x, y); + if ( key == MOUSE_BUTTON(3)) + { + w.set_buttons( save_but); + w.set_mode( save); +#if ( __LEDA__ < 362 ) + w.state = 0; +#else + w.set_state( 0); +#endif // __LEDA__ < ... + return w; + } + r = Iso_rectangle_2(Point_2( RT(first.xcoord()), + RT(first.ycoord())), + Point_2( RT(x), RT(y))); + w.set_mode( save); + w.draw_rectangle( first.xcoord(), first.ycoord(), x, y); + w.set_buttons( save_but); + return w; +} + +template< class R > +Postscript_file_stream& +read(Postscript_file_stream& w, Iso_rectangle_2& r) +{ + typedef typename R::RT RT; + double x,y; + int key = 0; +#if ( __LEDA__ < 362 ) + w.state = 1; +#else + w.set_state( 1); +#endif // __LEDA__ < ... + leda_point first, second; + leda_drawing_mode save = w.set_mode(leda_xor_mode); + if ( !( w.read( first))) { w.set_mode( save); return w; } + int save_but[8]; + w.std_buttons(save_but); + key = w.read_mouse_rect( first.xcoord(), first.ycoord(), x, y); + if ( key == MOUSE_BUTTON(3)) + { + w.set_buttons( save_but); + w.set_mode( save); +#if ( __LEDA__ < 362 ) + w.state = 0; +#else + w.set_state( 0); +#endif // __LEDA__ < ... + return w; + } + r = Iso_rectangle_2(Point_2( RT(first.xcoord()), + RT(first.ycoord())), + Point_2( RT(x), RT(y))); + w.set_mode( save); + w.set_buttons( save_but); + return w; +} +#endif // CGAL_POSTSCRIPT_FILE_STREAM_ISO_RECTANGLE_2 +#endif // CGAL_ISO_RECTANGLE_2_H + +#ifdef CGAL_BBOX_2_H +#ifndef CGAL_POSTSCRIPT_FILE_STREAM_BBOX_2 +#define CGAL_POSTSCRIPT_FILE_STREAM_BBOX_2 +inline +Postscript_file_stream& +operator<<(Postscript_file_stream& w, const Bbox_2& b) +{ +#if (__LEDA__ >= 400) + leda_line_style style = w.set_line_style(leda_dotted); +#else + line_style style = w.set_line_style(leda_dotted); +#endif // 400 + double xmin = b.xmin(), + ymin = b.ymin(), + xmax = b.xmax(), + ymax = b.ymax(); + w.draw_segment(xmin, ymin, xmax, ymin); + w.draw_segment(xmax, ymin, xmax, ymax); + w.draw_segment(xmax, ymax, xmin, ymax); + w.draw_segment(xmin, ymax, xmin, ymin); + w.set_line_style(style); + return w; +} +#endif // CGAL_POSTSCRIPT_FILE_STREAM_BBOX_2 +#endif // CGAL_BBOX_2_H + +CGAL_END_NAMESPACE + diff --git a/Packages/window/include/CGAL/IO/Window_stream.h b/Packages/window/include/CGAL/IO/Window_stream.h new file mode 100644 index 00000000000..cd8fc684157 --- /dev/null +++ b/Packages/window/include/CGAL/IO/Window_stream.h @@ -0,0 +1,38 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, August 22 +// +// source : leda_window.fw +// file : Window_stream.h +// package : window (2.7.1) +// maintainer : Stefan Schirra +// revision : 2.7 +// revision_date : 21 Aug 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#include + +#ifndef IO_TRIANGULATION_WINDOW_STREAM_H +#include +#endif // IO_TRIANGULATION_WINDOW_STREAM_H +#ifndef IO_OPTIMISATION_WINDOW_STREAM_H +#include +#endif // IO_OPTIMISATION_WINDOW_STREAM_H +#ifndef IO_POLYGON_WINDOW_STREAM_H +#include +#endif // IO_POLYGON_WINDOW_STREAM_H + diff --git a/Packages/window/include/CGAL/IO/esprit_logo.xpm b/Packages/window/include/CGAL/IO/esprit_logo.xpm new file mode 100644 index 00000000000..28a9dea9362 --- /dev/null +++ b/Packages/window/include/CGAL/IO/esprit_logo.xpm @@ -0,0 +1,157 @@ +#ifndef CGAL_IO_ESPRIT_LOGO_XPM +#define CGAL_IO_ESPRIT_LOGO_XPM +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : (leda_window.fw) +// file : IO/esprit_logo.xpm +// revision : 2.7 +// revision_date : 21 Aug 2000 +// author(s) : created automatically using ... +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +CGAL_BEGIN_NAMESPACE + +/* XPM */ +#if (__LEDA__ > 400) +static const char* esprit_logo[] = { +#else +static char* esprit_logo[] = { +#endif // __LEDA__ +/* width height num_colors chars_per_pixel */ +" 89 87 27 1", +/* colors */ +". c #ffffff", +"# c #333333", +"a c #000066", +"b c #333366", +"c c #666666", +"d c #000099", +"e c #333399", +"f c #666699", +"g c #999999", +"h c #3333cc", +"i c #6666cc", +"j c #9999cc", +"k c #cccccc", +"l c #9999ff", +"m c #ccccff", +"n c #ffffff", +"o c #111111", +"p c #222222", +"q c #444444", +"r c #555555", +"s c #777777", +"t c #888888", +"u c #aaaaaa", +"v c #bbbbbb", +"w c #dddddd", +"x c #eeeeee", +"y c #000000", +/* pixels */ +"......ktifffffftjn.......................................................................", +"....kfjm.......xvifjw....................................................................", +"...vix.............ktfjw.................................................................", +"..xfn.................kifv...............................................................", +"..fw....................njfjn............................................................", +".nf.......................nufjx..........................................................", +".mj..........................vfjn........................................................", +".vu............................vev.......................................................", +".vv.............................njfw.....................................................", +".vl...............................xfjn...................................................", +".xt.................................ufm..................................................", +"..f..................................xftn................................................", +"..fx...................................kew...............................................", +"..jm....................................nitn.............................................", +"..wi......................................vfm............................................", +"...fn......................................xfj...........................................", +"...ul........................................jfx.........................................", +"...nf.........................................wfk........................................", +"....jv.........................................xiu.......................................", +"....ne...........................................jfn.....................................", +".....uj...........................................mfx....................................", +".....nfx...........................................ww....................................", +"......nfn..............................x.................................................", +".......uj..............................xjjx..............................................", +"........fw..............................xjaejx...........................................", +"........xfn...............................vaaafk..............................wtiux......", +".........uj................................xtaaaesw..........................kaaaaatx....", +"..........fm.................................weaaaaeun.......................faaaaadew...", +"..........nex..................................veaadadtmn....................faaaaaaabm..", +"...........xfn..................................njeaaaaaasmn.................jaaaaaaaaax.", +"............vt....................................nveaaaaaaafvn..............xbaaaaaaaae.", +".............jj......................................veaaaaaaaafjx............jaaaaaaaaav", +"..............im.......................................xteaaaaaaaaegmn.......nveaaaaaaaaf", +"..............nfw.........................................wjeaaaaaaaaafjx..xteaaaaaaaaaae", +"...............xen...........................................nvtebaaaaabkxfadaaaaabaaaaae", +"................xf......................................xxmkkvmvmvvjjvmnmtjjvmwn....nmtej", +".................vt............................xwujffebaaaaaaaaaaadaaabeux...............", +"..................jj......................xvjfeaaaaaaaaaaaaaaaaaaaaaaaaaaex..............", +"...................iu.................wjfeaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaj..............", +"....................ij............nvibaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaj..............", +".....................iu........xjrdaaaaaaaaaaaeftjvmww..xxxmvjfaaaaaaaaaaax..............", +"......................jj....wjeaaaaaaaaefiumx..............xjeaaaaaaaaaaau...............", +".......................jnxjeaaaaaaefvmn..................xtdaaaaaaaaaaaaj................", +"......................xueaaaeftvwn.....................xtdaaaaaaaaaaaaew.................", +"....................xufefjwx.........................njadaaaaaaaaaaafw...................", +"...................nx.w...xfk.......................nfaaaaaaaaaaaejx.....................", +"...........................xfu.....................xeaaaababeetux........................", +"............................nij....................xkxn..................................", +"..............................lin................xvjfeebk................................", +"...............................kfw...........nvieaaaaabj.................................", +"................................xfu........kfaaaaaaaatn..................................", +".................................njj....njbaaaaaaaafm....................................", +"...................................jt.njaaaaaaaaaewnteaebeeftvx..........................", +"....................................wjbaaaaaaaaek..madaaaaaaadaefvx......................", +"...................................medaaaaaaaev....xaaaaaaaaaaaaaaafk....................", +".................................ntdaaaaaaabjn......xfaaaaaaaaaaaaadaev..................", +"................................vdaaaaaaabjx..........kiaaaaaaaaaaaaaaafx................", +"..............................weaaaaaaaatxwfj...........nueaaaaaaaaaaaaaev...............", +"............................njaaaaaaaatx...njf..nkjjffeeeefbaaaaaaaaaaaaaaj..............", +"...........................weaaaaaaafw.....nkthbaaaaaaaaaaaaaaaaaaaaaaaaaadj.............", +".........................ntdaaaaaabv....wjeaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaae.............", +"........................xeaaaaaaatx..xjeaaaeeeaeerieferebbaaaaaaaaaaaaaaaaak.............", +".......................vaaaaaaafx..xiabevjkwxxn.....jjx.....xwwmujtiffeebej..............", +".....................nfdaaaaaew..njijvxn.............kftx................................", +"....................weaaaaabu....mw....................mifk..............................", +"..................njaaaaabtx.............................xvjjjx..........................", +".................xeaaaaaex...................................wiftw.......................", +"................xeaaaaajn.......................................mjffwuu..................", +"...............weaaaabk............................................xwyy..................", +"..............weaaaafx............................wuk...............ntu..wtg.............", +".............kaaaaaj................n......n......qyvn......n...n....n...tyc.............", +"............vdaaabk..............xccor...gpcoq...kyycpov..xcygvop.ntoon.spyqu............", +"...........vdaaabm..............woqxoyx.xyykv#..v#yr.uyp..crycrpp.tgyo..xyon.............", +"..........kaaaafw..............npyvtyq...pyok....cyt.uyp..xqy#nwx.xsyc..uyq..............", +".........maaaajn...............kyycsvn...wpyow..noyw.syr..xyyu....noyk..ryg..............", +"........waaaev.................vyon.vw.xqwxpyu..kyp.npyk..vyon....uypuw.oykg.............", +".......xdaaew..................npyrct..xopwqpx..sy#kcou...cyt.....sypg.xyyrx.............", +"......xeaasn....................xgtk....wgtux...#yugtk....vun.....ktk...ugx..............", +".....nfaaun....................................xyon......................................", +".....tdau.....................................krypv......................................", +"....vdav......................................gguugn.....................................", +"...xdpv..................................................................................", +"...rdm...................................................................................", +"..jek....................................................................................", +".xbm.....................................................................................", +".ik......................................................................................", +"xx......................................................................................." +}; +CGAL_END_NAMESPACE + + +#endif // CGAL_IO_ESPRIT_LOGO_XPM diff --git a/Packages/window/include/CGAL/IO/forward_decl_window_stream.h b/Packages/window/include/CGAL/IO/forward_decl_window_stream.h new file mode 100644 index 00000000000..13174298bb9 --- /dev/null +++ b/Packages/window/include/CGAL/IO/forward_decl_window_stream.h @@ -0,0 +1,34 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, August 22 +// +// source : leda_window.fw +// file : IO/forward_decl_window_stream.h +// package : window (2.7.1) +// maintainer : Stefan Schirra +// revision : 2.7 +// revision_date : 21 Aug 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + +#ifndef CGAL_IO_FORWARD_DECL_WINDOW_STREAM_H +#define CGAL_IO_FORWARD_DECL_WINDOW_STREAM_H +class leda_window; +CGAL_BEGIN_NAMESPACE + +typedef leda_window Window_stream; +CGAL_END_NAMESPACE + +#endif // CGAL_IO_FORWARD_DECL_WINDOW_STREAM_H diff --git a/Packages/window/include/CGAL/IO/leda_ps_file.h b/Packages/window/include/CGAL/IO/leda_ps_file.h new file mode 100644 index 00000000000..3d845aac8ee --- /dev/null +++ b/Packages/window/include/CGAL/IO/leda_ps_file.h @@ -0,0 +1,32 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, August 22 +// +// source : ps_file.fw +// file : CGAL/IO/leda_ps_file.h +// package : window (2.7.1) +// maintainer : Stefan Schirra +// revision : 2.7 +// revision_date : 21 Aug 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#include +CGAL_BEGIN_NAMESPACE + +typedef Postscript_file_stream ps_file; +CGAL_END_NAMESPACE + diff --git a/Packages/window/include/CGAL/IO/leda_window.h b/Packages/window/include/CGAL/IO/leda_window.h new file mode 100644 index 00000000000..83ed256970b --- /dev/null +++ b/Packages/window/include/CGAL/IO/leda_window.h @@ -0,0 +1,771 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, August 22 +// +// source : leda_window.fw +// file : leda_window.h +// package : window (2.7.1) +// maintainer : Stefan Schirra +// revision : 2.7 +// revision_date : 21 Aug 2000 +// author(s) : Andreas Fabri +// Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_LEDA_WINDOW_H +#define CGAL_LEDA_WINDOW_H + +#include +#include +// #include +#include + + +CGAL_BEGIN_NAMESPACE + + +// #if ( __LEDA__ < 360 ) +// #define leda_window window +// #define leda_color color +// #endif + +#if ( __LEDA__ < 361 ) +#define leda_black black +#define leda_dotted dotted +#define leda_xor_mode xor_mode +#define leda_blue blue +#define leda_red red +#endif + +#if (( __LEDA__ < 362 ) || defined(NOTEBOOK)) +#define leda_drawing_mode drawing_mode +#endif + +typedef leda_window Window_stream; + +inline +leda_window& +operator<<(leda_window& w, const Color& c) +{ + w.set_fg_color(leda_color(c.red(), c.green(), c.blue())); + return w; +} + + +inline +void +cgalize(leda_window& w) +{ + w.set_frame_label("CGAL-2.1"); + w.set_icon_label("CGAL"); + w.set_node_width( 3); + w.set_line_width( 2); + w.set_icon_pixrect( w.create_pixrect( esprit_logo)); +} + +inline +leda_window* +create_demo_window( float w = 512.0, float h = 512.0, + const char* str = "CGAL", + double x_extension = 1.0) +{ + leda_window* Wptr = new leda_window( w, h); + cgalize( *Wptr); + double y_extension = x_extension * h / w; + Wptr->init(-x_extension, x_extension, -y_extension); + Wptr->set_frame_label( str); + return Wptr; +} + + +inline +leda_window* +create_and_display_demo_window(float w = 512.0, float h = 512.0, + const char* str = "CGAL", + double x_extension = 1.0) +{ + leda_window* Wptr = new leda_window( w, h); + cgalize( *Wptr); + double y_extension = x_extension * h / w; + Wptr->init(-x_extension, x_extension, -y_extension); + Wptr->set_frame_label( str); + Wptr->display(); + return Wptr; +} + +CGAL_END_NAMESPACE + + +#endif // CGAL_LEDA_WINDOW_H + +CGAL_BEGIN_NAMESPACE + +// Each of the following operators is individually +// protected against multiple inclusion. + +#ifdef CGAL_POINT_2_H +#ifndef CGAL_LEDA_WINDOW_POINT_2 +#define CGAL_LEDA_WINDOW_POINT_2 +template< class R > +leda_window& +operator<<(leda_window& w, const Point_2& p) +{ + double x = CGAL::to_double(p.x()); + double y = CGAL::to_double(p.y()); + int width = w.get_node_width(); + if (width < 2) + w.draw_point(x,y); + else + w.draw_filled_node(x,y); + + return w; +} + +template< class R > +leda_window& +operator>>(leda_window& w, Point_2& p) +{ + typedef typename R::RT RT; + leda_point l_p; + leda_drawing_mode save = w.set_mode(leda_xor_mode); + if (w >> l_p) + { + double x = l_p.xcoord(); + double y = l_p.ycoord(); + w << l_p; + w.set_mode( save); + int width = w.get_node_width(); + if (width < 2) + w.draw_point(x,y); + else + w.draw_filled_node(x,y); + + p = Point_2( RT(x), RT(y)); + } + else + { + w.set_mode( save); + } + return w; +} + +template< class R > +leda_window& +read(leda_window& w, Point_2& p) +{ + typedef typename R::RT RT; + leda_point l_p; + if (w >> l_p) + { + double x = l_p.xcoord(); + double y = l_p.ycoord(); + p = Point_2( RT(x), RT(y)); + } + return w; +} + +template +void +read_mouse_plus(leda_window& w, Point_2& p, int& button) +{ + typedef typename R::RT RT; + double x, y; + button = w.read_mouse(x,y); + int width = w.get_node_width(); + if (width < 2) + w.draw_point(x,y); + else + w.draw_filled_node(x,y); + + p = Point_2(RT(x), RT(y)); +} + +#endif // CGAL_LEDA_WINDOW_POINT_2 +#endif // CGAL_POINT_2_H + + +#ifdef CGAL_SEGMENT_2_H +#ifndef CGAL_LEDA_WINDOW_SEGMENT_2 +#define CGAL_LEDA_WINDOW_SEGMENT_2 +template< class R > +leda_window& +operator<<(leda_window& w, const Segment_2& s) +{ + w.draw_segment(CGAL::to_double(s.source().x()), + CGAL::to_double(s.source().y()), + CGAL::to_double(s.target().x()), + CGAL::to_double(s.target().y())); + return w; +} + +template< class R > +leda_window& +operator>>(leda_window& w, Segment_2& s) +{ + typedef typename R::RT RT; + leda_segment l_s; + leda_drawing_mode save = w.set_mode(leda_xor_mode); + if ( w.read( l_s)) + { + double x1 = l_s.xcoord1(); + double y1 = l_s.ycoord1(); + double x2 = l_s.xcoord2(); + double y2 = l_s.ycoord2(); + w.set_mode( save); + w.draw_segment(x1,y1, x2, y2); + s = Segment_2(Point_2( RT(x1), RT(y1)), + Point_2( RT(x2), RT(y2))); + } + else + { + w.set_mode( save); + } + return w; +} + +template< class R > +leda_window& +read(leda_window& w, Segment_2& s) +{ + typedef typename R::RT RT; + leda_segment l_s; + if ( w.read( l_s)) + { + double x1 = l_s.xcoord1(); + double y1 = l_s.ycoord1(); + double x2 = l_s.xcoord2(); + double y2 = l_s.ycoord2(); + s = Segment_2(Point_2( RT(x1), RT(y1)), + Point_2( RT(x2), RT(y2))); + } + return w; +} +#endif // CGAL_LEDA_WINDOW_SEGMENT_2 +#endif // CGAL_SEGMENT_2_H + + +#ifdef CGAL_LINE_2_H +#ifndef CGAL_LEDA_WINDOW_LINE_2 +#define CGAL_LEDA_WINDOW_LINE_2 + +template< class R > +leda_window& +operator<<(leda_window& w, const Line_2& l) +{ + Point_2 p1 = l.point(), + p2 = p1 + l.direction().vector(); + w.draw_line(CGAL::to_double(p1.x()), CGAL::to_double(p1.y()), + CGAL::to_double(p2.x()), CGAL::to_double(p2.y())); + return w; +} + +template< class R > +leda_window& +operator>>(leda_window& w, Line_2& l) +{ + typedef typename R::RT RT; + leda_segment l_s; + leda_drawing_mode save = w.set_mode(leda_xor_mode); + if ( w.read( l_s)) + { + double x1 = l_s.xcoord1(); + double y1 = l_s.ycoord1(); + double x2 = l_s.xcoord2(); + double y2 = l_s.ycoord2(); + w.set_mode( save); + w.draw_line(x1,y1, x2, y2); + l = Line_2(Point_2( RT(x1), RT(y1)), + Point_2( RT(x2), RT(y2))); + } + else + { + w.set_mode( save); + } + return w; +} + +template< class R > +leda_window& +read(leda_window& w, Line_2& l) +{ + typedef typename R::RT RT; + leda_segment l_s; + if ( w.read( l_s)) + { + double x1 = l_s.xcoord1(); + double y1 = l_s.ycoord1(); + double x2 = l_s.xcoord2(); + double y2 = l_s.ycoord2(); + l = Line_2(Point_2( RT(x1), RT(y1)), + Point_2( RT(x2), RT(y2))); + } + return w; +} +#endif // CGAL_LEDA_WINDOW_LINE_2 +#endif //CGAL_LINE_2_H + +#ifdef CGAL_RAY_2_H +#ifndef CGAL_LEDA_WINDOW_RAY_2 +#define CGAL_LEDA_WINDOW_RAY_2 +template< class R > +leda_window& +operator<<(leda_window& w, const Ray_2& r) +{ + Point_2 p = r.point(0); + Point_2 q = r.point(1); + w.draw_ray(CGAL::to_double(p.x()), + CGAL::to_double(p.y()), + CGAL::to_double(q.x()), + CGAL::to_double(q.y())); + return w; +} + +template< class R > +leda_window& +operator>>(leda_window& w, Ray_2& r) +{ + typedef typename R::RT RT; + leda_segment l_s; + leda_drawing_mode save = w.set_mode(leda_xor_mode); + if ( w.read( l_s)) + { + double x1 = l_s.xcoord1(); + double y1 = l_s.ycoord1(); + double x2 = l_s.xcoord2(); + double y2 = l_s.ycoord2(); + w.set_mode( save); + r = Ray_2(Point_2( RT(x1), RT(y1)), + Point_2( RT(x2), RT(y2))); + w << r; + } + else + { + w.set_mode( save); + } + return w; +} + +template< class R > +leda_window& +read(leda_window& w, Ray_2& r) +{ + typedef typename R::RT RT; + leda_segment l_s; + if ( w.read( l_s)) + { + double x1 = l_s.xcoord1(); + double y1 = l_s.ycoord1(); + double x2 = l_s.xcoord2(); + double y2 = l_s.ycoord2(); + r = Ray_2(Point_2( RT(x1), RT(y1)), + Point_2( RT(x2), RT(y2))); + } + return w; +} +#endif // CGAL_LEDA_WINDOW_RAY_2 +#endif //CGAL_RAY_2_H + +#ifdef CGAL_TRIANGLE_2_H +#ifndef CGAL_LEDA_WINDOW_TRIANGLE_2 +#define CGAL_LEDA_WINDOW_TRIANGLE_2 +template< class R > +leda_window& +operator<<(leda_window& w, const Triangle_2& t) +{ + double x0 = CGAL::to_double(t.vertex(0).x()), + y0 = CGAL::to_double(t.vertex(0).y()), + x1 = CGAL::to_double(t.vertex(1).x()), + y1 = CGAL::to_double(t.vertex(1).y()), + x2 = CGAL::to_double(t.vertex(2).x()), + y2 = CGAL::to_double(t.vertex(2).y()); + w.draw_segment(x0, y0, x1, y1); + w.draw_segment(x1, y1, x2, y2); + w.draw_segment(x2, y2, x0, y0); + return w; +} + +template< class R > +leda_window& +operator>>(leda_window& w, Triangle_2& t) +{ + typedef typename R::RT RT; + double x,y; + int key = 0; +#if ( __LEDA__ < 362 ) + w.state = 1; +#else + w.set_state( 1); +#endif // __LEDA__ < ... + leda_point first, second, third, p; + leda_drawing_mode save = w.set_mode(leda_xor_mode); + if ( !( w >> first)) { w.set_mode( save); return w; } + int save_but[8]; + w.std_buttons(save_but); + key = w.read_mouse_seg( first.xcoord(), first.ycoord(), x, y); + if ( key == MOUSE_BUTTON(3)) + { + w.set_buttons( save_but); + w.set_mode( save); +#if ( __LEDA__ < 362 ) + w.state = 0; +#else + w.set_state( 0); +#endif // __LEDA__ < ... + return w; + } + else + { + w << leda_segment( first.xcoord(), first.ycoord(), x, y); + second = leda_point( x, y); + } + key = w.read_mouse_seg( second.xcoord(), second.ycoord(), x, y); + if ( key == MOUSE_BUTTON(3)) + { + w << leda_segment( first, second ); + w.set_buttons( save_but); + w.set_mode( save); +#if ( __LEDA__ < 362 ) + w.state = 0; +#else + w.set_state( 0); +#endif // __LEDA__ < ... + return w; + } + else + { + w << leda_segment( second.xcoord(), second.ycoord(), x, y); + third = leda_point( x, y); + } + w << leda_segment( first, second ); + w << leda_segment( second, third ); + double x0 = first.xcoord(); + double y0 = first.ycoord(); + double x1 = second.xcoord(); + double y1 = second.ycoord(); + double x2 = third.xcoord(); + double y2 = third.ycoord(); + w.set_mode( save); + w.draw_segment(x0,y0, x1, y1); + w.draw_segment(x1,y1, x2, y2); + w.draw_segment(x2,y2, x0, y0); + + t = Triangle_2(Point_2( RT(x0), RT(y0)), + Point_2( RT(x1), RT(y1)), + Point_2( RT(x2), RT(y2))); + return w; +} + +template< class R > +leda_window& +read(leda_window& w, Triangle_2& t) +{ + typedef typename R::RT RT; + double x,y; + int key = 0; +#if ( __LEDA__ < 362 ) + w.state = 1; +#else + w.set_state( 1); +#endif // __LEDA__ < ... + leda_point first, second, third, p; + leda_drawing_mode save = w.set_mode(leda_xor_mode); + if ( !( w >> first)) { w.set_mode( save); return w; } + int save_but[8]; + w.std_buttons(save_but); + key = w.read_mouse_seg( first.xcoord(), first.ycoord(), x, y); + if ( key == MOUSE_BUTTON(3)) + { + w.set_buttons( save_but); + w.set_mode( save); +#if ( __LEDA__ < 362 ) + w.state = 0; +#else + w.set_state( 0); +#endif // __LEDA__ < ... + return w; + } + else + { + w << leda_segment( first.xcoord(), first.ycoord(), x, y); + second = leda_point( x, y); + } + key = w.read_mouse_seg( second.xcoord(), second.ycoord(), x, y); + if ( key == MOUSE_BUTTON(3)) + { + w << leda_segment( first, second ); + w.set_buttons( save_but); + w.set_mode( save); +#if ( __LEDA__ < 362 ) + w.state = 0; +#else + w.set_state( 0); +#endif // __LEDA__ < ... + return w; + } + else + { + w << leda_segment( second.xcoord(), second.ycoord(), x, y); + third = leda_point( x, y); + } + w << leda_segment( first, second ); + w << leda_segment( second, third ); + double x0 = first.xcoord(); + double y0 = first.ycoord(); + double x1 = second.xcoord(); + double y1 = second.ycoord(); + double x2 = third.xcoord(); + double y2 = third.ycoord(); + w.set_mode( save); + t = Triangle_2(Point_2( RT(x0), RT(y0)), + Point_2( RT(x1), RT(y1)), + Point_2( RT(x2), RT(y2))); + return w; +} +#endif // CGAL_LEDA_WINDOW_TRIANGLE_2 +#endif // CGAL_TRIANGLE_2_H + +#ifdef CGAL_CIRCLE_2_H +#ifndef CGAL_LEDA_WINDOW_CIRCLE_2 +#define CGAL_LEDA_WINDOW_CIRCLE_2 +template< class R > +leda_window& +operator<<(leda_window& w, const Circle_2& c) +{ + double cx = CGAL::to_double(c.center().x()), + cy = CGAL::to_double(c.center().y()), + r = CGAL::to_double(c.squared_radius()); + w.draw_circle(cx, cy , std::sqrt(r)); + return w; +} + +template< class R > +leda_window& +operator>>(leda_window& w, Circle_2& c) +{ + typedef typename R::RT RT; + double x,y; + int key = 0; +#if ( __LEDA__ < 362 ) + w.state = 1; +#else + w.set_state( 1); +#endif // __LEDA__ < ... + leda_point p; + leda_drawing_mode save = w.set_mode(leda_xor_mode); + if ( !( w.read( p))) { w.set_mode( save); return w; } + double cx = p.xcoord(); + double cy = p.ycoord(); + Point_2 center = Point_2( RT(cx), RT(cy)); + int save_but[8]; + w.std_buttons(save_but); + key = w.read_mouse_circle(cx, cy, x, y); + if ( key == MOUSE_BUTTON(3)) + { + w.set_buttons( save_but); + w.set_mode( save); +#if ( __LEDA__ < 362 ) + w.state = 0; +#else + w.set_state( 0); +#endif // __LEDA__ < ... + return w; + } + double dx = x - cx; + double dy = y - cy; + double sqr = dx*dx+dy*dy; + w.set_mode( save); + w.set_buttons( save_but); + w.draw_circle(cx, cy , std::sqrt(sqr)); + c = Circle_2(center, RT(sqr)); + return w; +} + +template< class R > +leda_window& +read(leda_window& w, Circle_2& c) +{ + typedef typename R::RT RT; + double x,y; + int key = 0; +#if ( __LEDA__ < 362 ) + w.state = 1; +#else + w.set_state( 1); +#endif // __LEDA__ < ... + leda_point p; + leda_drawing_mode save = w.set_mode(leda_xor_mode); + if ( !( w.read( p))) { w.set_mode( save); return w; } + double cx = p.xcoord(); + double cy = p.ycoord(); + Point_2 center = Point_2( RT(cx), RT(cy)); + int save_but[8]; + w.std_buttons(save_but); + key = w.read_mouse_circle(cx, cy, x, y); + if ( key == MOUSE_BUTTON(3)) + { + w.set_buttons( save_but); + w.set_mode( save); +#if ( __LEDA__ < 362 ) + w.state = 0; +#else + w.set_state( 0); +#endif // __LEDA__ < ... + return w; + } + double dx = x - cx; + double dy = y - cy; + double sqr = dx*dx+dy*dy; + w.set_mode( save); + w.set_buttons( save_but); + c = Circle_2(center, RT(sqr)); + return w; +} +#endif // CGAL_LEDA_WINDOW_CIRCLE_2 +#endif // CGAL_CIRCLE_2_H + +#ifdef CGAL_ISO_RECTANGLE_2_H +#ifndef CGAL_LEDA_WINDOW_ISO_RECTANGLE_2 +#define CGAL_LEDA_WINDOW_ISO_RECTANGLE_2 +template< class R > +leda_window& +operator<<(leda_window& w, const Iso_rectangle_2& r) +{ + double xmin = CGAL::to_double(r.min().x()), + ymin = CGAL::to_double(r.min().y()), + xmax = CGAL::to_double(r.max().x()), + ymax = CGAL::to_double(r.max().y()); + w.draw_segment(xmin, ymin, xmax, ymin); + w.draw_segment(xmax, ymin, xmax, ymax); + w.draw_segment(xmax, ymax, xmin, ymax); + w.draw_segment(xmin, ymax, xmin, ymin); + return w; +} + +template< class R > +leda_window& +operator>>(leda_window& w, Iso_rectangle_2& r) +{ + typedef typename R::RT RT; + double x,y; + int key = 0; +#if ( __LEDA__ < 362 ) + w.state = 1; +#else + w.set_state( 1); +#endif // __LEDA__ < ... + leda_point first, second; + leda_drawing_mode save = w.set_mode(leda_xor_mode); + if ( !( w.read( first))) { w.set_mode( save); return w; } + int save_but[8]; + w.std_buttons(save_but); + key = w.read_mouse_rect( first.xcoord(), first.ycoord(), x, y); + if ( key == MOUSE_BUTTON(3)) + { + w.set_buttons( save_but); + w.set_mode( save); +#if ( __LEDA__ < 362 ) + w.state = 0; +#else + w.set_state( 0); +#endif // __LEDA__ < ... + return w; + } + r = Iso_rectangle_2(Point_2( RT(first.xcoord()), + RT(first.ycoord())), + Point_2( RT(x), RT(y))); + w.set_mode( save); + w.draw_rectangle( first.xcoord(), first.ycoord(), x, y); + w.set_buttons( save_but); + return w; +} + +template< class R > +leda_window& +read(leda_window& w, Iso_rectangle_2& r) +{ + typedef typename R::RT RT; + double x,y; + int key = 0; +#if ( __LEDA__ < 362 ) + w.state = 1; +#else + w.set_state( 1); +#endif // __LEDA__ < ... + leda_point first, second; + leda_drawing_mode save = w.set_mode(leda_xor_mode); + if ( !( w.read( first))) { w.set_mode( save); return w; } + int save_but[8]; + w.std_buttons(save_but); + key = w.read_mouse_rect( first.xcoord(), first.ycoord(), x, y); + if ( key == MOUSE_BUTTON(3)) + { + w.set_buttons( save_but); + w.set_mode( save); +#if ( __LEDA__ < 362 ) + w.state = 0; +#else + w.set_state( 0); +#endif // __LEDA__ < ... + return w; + } + r = Iso_rectangle_2(Point_2( RT(first.xcoord()), + RT(first.ycoord())), + Point_2( RT(x), RT(y))); + w.set_mode( save); + w.set_buttons( save_but); + return w; +} +#endif // CGAL_LEDA_WINDOW_ISO_RECTANGLE_2 +#endif // CGAL_ISO_RECTANGLE_2_H + +#ifdef CGAL_BBOX_2_H +#ifndef CGAL_LEDA_WINDOW_BBOX_2 +#define CGAL_LEDA_WINDOW_BBOX_2 +inline +leda_window& +operator<<(leda_window& w, const Bbox_2& b) +{ +#if (__LEDA__ >= 400) + leda_line_style style = w.set_line_style(leda_dotted); +#else + line_style style = w.set_line_style(leda_dotted); +#endif + double xmin = b.xmin(), + ymin = b.ymin(), + xmax = b.xmax(), + ymax = b.ymax(); + w.draw_segment(xmin, ymin, xmax, ymin); + w.draw_segment(xmax, ymin, xmax, ymax); + w.draw_segment(xmax, ymax, xmin, ymax); + w.draw_segment(xmin, ymax, xmin, ymin); + w.set_line_style(style); + return w; +} +#endif // CGAL_LEDA_WINDOW_BBOX_2 +#endif // CGAL_BBOX_2_H + + +CGAL_END_NAMESPACE + +#ifndef IO_TRIANGULATION_WINDOW_STREAM_H +#include +#endif // IO_TRIANGULATION_WINDOW_STREAM_H +#ifndef IO_OPTIMISATION_WINDOW_STREAM_H +#include +#endif // IO_OPTIMISATION_WINDOW_STREAM_H +#ifndef IO_POLYGON_WINDOW_STREAM_H +#include +#endif // IO_POLYGON_WINDOW_STREAM_H + diff --git a/Packages/window/include/CGAL/IO/polygonal_2.h b/Packages/window/include/CGAL/IO/polygonal_2.h new file mode 100644 index 00000000000..41a0451036a --- /dev/null +++ b/Packages/window/include/CGAL/IO/polygonal_2.h @@ -0,0 +1,182 @@ + +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, August 22 +// +// source : polygonal.fw +// file : include/CGAL/IO/polygonal_2.h +// package : window (2.7.1) +// maintainer : Stefan Schirra +// revision : 2.7 +// revision_date : 21 Aug 2000 +// author(s) : Stefan Schirra +// +// +// coordinator : MPI, Saarbruecken () +// ====================================================================== + + +#ifndef CGAL_IO_POLYGONAL_2_H +#define CGAL_IO_POLYGONAL_2_H + +#include +#include +#include +#include +#include +#include +#include + +namespace CGAL { + +//---------------------- Polygon -------------------------- + +template +void +send_to_stream_as_polygon(Stream& W, + ForwardIterator first, ForwardIterator last, + const Traits& ); + + +template +inline +void +_send_to_stream_as_polygon(Stream& W, + ForwardIterator first, ForwardIterator last, + Point_2* ) +{ send_to_stream_as_polygon(W, first, last, convex_hull_traits_2() ); } + + +template +inline +void +send_to_stream_as_polygon(Stream& W, + ForwardIterator first, ForwardIterator last) +{ _send_to_stream_as_polygon(W, first, last, ch_value_type(first)); } + + +template +void +send_to_stream_as_polygon(Stream& W, + ForwardIterator first, ForwardIterator last, + const Traits& ) +{ + typedef typename Traits::Segment_2 Segment2; + if (first == last) return; + ForwardIterator it = first; + ForwardIterator fifi = CGAL::successor(first); + while ( fifi != last ) + { + W << Segment2(*it,*fifi); + it = fifi++; + } + W << Segment2(*it,*first); + return; +} + + +//---------------------- Polyline -------------------------- + + +template +void +send_to_stream_as_polyline(Stream& W, + ForwardIterator first, ForwardIterator last, + const Traits& ); + + +template +inline +void +_send_to_stream_as_polyline(Stream& W, + ForwardIterator first, ForwardIterator last, + Point_2* ) +{ send_to_stream_as_polyline(W, first, last, convex_hull_traits_2() ); } + + +template +inline +void +send_to_stream_as_polyline(Stream& W, + ForwardIterator first, ForwardIterator last) +{ _send_to_stream_as_polyline(W, first, last, ch_value_type(first)); } + + +template +void +send_to_stream_as_polyline(Stream& W, + ForwardIterator first, ForwardIterator last, + const Traits& ) +{ + typedef typename Traits::Segment_2 Segment2; + if (first == last) return; + ForwardIterator it = first; + ForwardIterator fifi = CGAL::successor(first); + while ( fifi != last ) + { + W << Segment2(*it,*fifi); + it = fifi++; + } + return; +} + + + +template +void +send_to_stream_as_polygon(Stream& W, + Circulator C, + const Forward_circulator_tag&, + const Traits& ); + + +template +inline +void +_send_to_stream_as_polygon(Stream& W, + Circulator C, + const Forward_circulator_tag& ct, + Point_2* ) +{ send_to_stream_as_polygon(W, C, ct, R() ); } + + +template +inline +void +send_to_stream_as_polygon(Stream& W, + Circulator C, + const Forward_circulator_tag& ct) +{ _send_to_stream_as_polygon(W, C, ct, ch_value_type(C)); } + + +template +void +send_to_stream_as_polygon(Stream& W, + Circulator C, + const Forward_circulator_tag&, + const Traits& ) +{ + typedef typename Traits::Segment_2 Segment2; + if ( is_empty_range(C,C) ) return; + Circulator start = C; + do + { + W << Segment2(*C, *successor(C)); + ++C; + } while ( C != start ); +} + + +} // namespace CGAL + + +#endif // CGAL_IO_POLYGONAL_2_H diff --git a/Packages/window/include/CGAL/IO/window_stream_xy_3.h b/Packages/window/include/CGAL/IO/window_stream_xy_3.h new file mode 100644 index 00000000000..6ced4f50939 --- /dev/null +++ b/Packages/window/include/CGAL/IO/window_stream_xy_3.h @@ -0,0 +1,319 @@ +// ====================================================================== +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------- +// +// release : +// release_date : 2000, August 22 +// +// file : IO/window_stream_xy_3.h +// package : window (2.7.1) +// maintainer : Stefan Schirra +// chapter : $CGAL_Chapter: Window Stream $ +// source : +// revision : 2.1.3 +// revision_date : +// author(s) : Lutz Kettner +// +// coordinator : MPI, Saarbruecken () +// +// Supports the display of 3D objects in the 2d CGAL_Window_stream. +// ====================================================================== + +// Note: This file could be included multiple times. Thus, the +// usual protection against multiple inclusion is not used. +// The following section protects itself against multiple inclusion +// with a non-standard macro name to hinder redundant protection +// guards in other files to exclude this file from inclusion. + +// (This section is currently empty.) +#ifndef CGAL_IO_WINDOW_STREAM_XY_3_H_1 +#define CGAL_IO_WINDOW_STREAM_XY_3_H_1 1 +#endif // CGAL_IO_WINDOW_STREAM_XY_3_H_1 // + + +// Each of the following operators is individually +// protected against multiple inclusion. + +// Check first, whether the related 2d files are included. +// ------------------------------------------------------- +#if defined(CGAL_POINT_3_H) && ! defined(CGAL_POINT_2_H) +#include +#endif +#if defined(CGAL_VECTOR_3_H) && ! defined(CGAL_VECTOR_2_H) +#include +#endif +#if defined(CGAL_DIRECTION_3_H) && ! defined(CGAL_DIRECTION_2_H) +#include +#endif +#if defined(CGAL_LINE_3_H) && ! defined(CGAL_LINE_2_H) +#include +#endif +#if defined(CGAL_RAY_3_H) && ! defined(CGAL_RAY_2_H) +#include +#endif +#if defined(CGAL_SEGMENT_3_H) && ! defined(CGAL_SEGMENT_2_H) +#include +#endif +#if defined(CGAL_TRIANGLE_3_H) && ! defined(CGAL_TRIANGLE_2_H) +#include +#endif +#if defined(CGAL_TETRAHEDRON_3_H) && ! defined(CGAL_SEGMENT_2_H) +#include +#endif +#if defined(CGAL_TETRAHEDRON_3_H) && ! defined(CGAL_TRIANGLE_2_H) +#include +#endif +#if defined(CGAL_BBOX_3_H) && ! defined(CGAL_BBOX_2_H) +#include +#endif + +#if defined(CGAL_LINE_3_H) || defined(CGAL_RAY_3_H) \ + || defined(CGAL_SEGMENT_3_H) || defined(CGAL_TRIANGLE_3_H) \ + || defined(CGAL_TETRAHEDRON_3_H) +#ifndef CGAL_POINT_2_H +#include +#endif +#ifndef CGAL_POINT_3_H +#include +#endif +#endif + +// Define necessary 2d stream operators. +// ------------------------------------- +#ifndef CGAL_IO_WINDOW_STREAM_H +#include +#endif // CGAL_IO_WINDOW_STREAM_H + +CGAL_BEGIN_NAMESPACE + +// Define the stream operators for the xy projected 3d objects. +// Note that data structures like polygons and triangulations +// work independant from the dimension of the stored geometry. +// ------------------------------------------------------------ + +#ifdef CGAL_POINT_3_H +#ifndef CGAL_WINDOW_STREAM_POINT_3 +#define CGAL_WINDOW_STREAM_POINT_3 +template< class R > +inline +Window_stream& operator<<( Window_stream &w, const Point_3 &p) +{ + return w << Point_2( p.hx(), p.hy(), p.hw()); +} +template< class R > +Window_stream& operator>>( Window_stream &w, Point_3 &p) +{ + typedef typename R::RT RT; + Point_2 q; + w >> q; + p = Point_3( q.hx(), q.hy(), RT(0), q.hw()); + return w; +} +#endif // CGAL_WINDOW_STREAM_POINT_3 +#endif // CGAL_POINT_3_H + +#ifdef CGAL_VECTOR_3_H +#ifndef CGAL_WINDOW_STREAM_VECTOR_3 +#define CGAL_WINDOW_STREAM_VECTOR_3 +template< class R > +inline +Window_stream& operator<<( Window_stream &w, const Vector_3 &v) +{ + return w << Vector_2( v.hx(), v.hy(), v.hw()); +} +template< class R > +Window_stream& operator>>( Window_stream &w, Vector_3 &v) +{ + typedef typename R::RT RT; + Vector_2 q; + w >> q; + v = Vector_3( q.hx(), q.hy(), RT(0), q.hw()); + return w; +} +#endif // CGAL_WINDOW_STREAM_VECTOR_3 +#endif // CGAL_VECTOR_3_H + +#ifdef CGAL_DIRECTION_3_H +#ifndef CGAL_WINDOW_STREAM_DIRECTION_3 +#define CGAL_WINDOW_STREAM_DIRECTION_3 +template< class R > +Window_stream& operator<<( Window_stream &w, const Direction_3 &d) +{ + return w << Direction_2( d.dx(), d.dy()); +} +template< class R > +Window_stream& operator>>( Window_stream &w, Direction_3 &d) +{ + typedef typename R::RT RT; + Direction_2 q; + w >> q; + d = Direction_3( q.dx(), q.dy(), RT(0)); + return w; +} +#endif // CGAL_WINDOW_STREAM_DIRECTION_3 +#endif // CGAL_DIRECTION_3_H + +#ifdef CGAL_LINE_3_H +#ifndef CGAL_WINDOW_STREAM_LINE_3 +#define CGAL_WINDOW_STREAM_LINE_3 +template< class R > +Window_stream& operator<<( Window_stream &w, const Line_3 &l) +{ + return w << Line_2( + Point_2( l.point(0).hx(), l.point(0).hy(), l.point(0).hw()), + Point_2( l.point(1).hx(), l.point(1).hy(), l.point(1).hw())); +} +template< class R > +Window_stream& operator>>( Window_stream &w, Line_3 &l) +{ + Line_2 q; + w >> q; + l = Line_3( + Point_3( q.point(0).hx(),q.point(0).hy(),0,q.point(0).hw()), + Point_3( q.point(1).hx(),q.point(1).hy(),0,q.point(1).hw())); + return w; +} +#endif // CGAL_WINDOW_STREAM_LINE_3 +#endif // CGAL_LINE_3_H + +#ifdef CGAL_RAY_3_H +#ifndef CGAL_WINDOW_STREAM_RAY_3 +#define CGAL_WINDOW_STREAM_RAY_3 +template< class R > +Window_stream& operator<<( Window_stream &w, const Ray_3 &r) +{ + return w << Ray_2( + Point_2( r.point(0).hx(), r.point(0).hy(), r.point(0).hw()), + Point_2( r.point(1).hx(), r.point(1).hy(), r.point(1).hw())); +} +template< class R > +Window_stream& operator>>( Window_stream &w, Ray_3 &r) +{ + Ray_2 q; + w >> q; + r = Ray_3( + Point_3( q.point(0).hx(),q.point(0).hy(),0,q.point(0).hw()), + Point_3( q.point(1).hx(),q.point(1).hy(),0,q.point(1).hw())); + return w; +} +#endif // CGAL_WINDOW_STREAM_RAY_3 +#endif // CGAL_RAY_3_H + +#ifdef CGAL_SEGMENT_3_H +#ifndef CGAL_WINDOW_STREAM_SEGMENT_3 +#define CGAL_WINDOW_STREAM_SEGMENT_3 +template< class R > +Window_stream& operator<<( Window_stream &w, const Segment_3 &s) +{ + return w << Segment_2( + Point_2( s.source().hx(), s.source().hy(), s.source().hw()), + Point_2( s.target().hx(), s.target().hy(), s.target().hw())); +} +template< class R > +Window_stream& operator>>( Window_stream &w, Segment_3 &s) +{ + Segment_2 q; + w >> q; + s = Segment_3( + Point_3( q.source().hx(),q.source().hy(),0,q.source().hw()), + Point_3( q.target().hx(),q.target().hy(),0,q.target().hw())); + return w; +} +#endif // CGAL_WINDOW_STREAM_SEGMENT_3 +#endif // CGAL_SEGMENT_3_H + +#ifdef CGAL_TRIANGLE_3_H +#ifndef CGAL_WINDOW_STREAM_TRIANGLE_3 +#define CGAL_WINDOW_STREAM_TRIANGLE_3 +template< class R > +Window_stream& operator<<( Window_stream &w, const Triangle_3 &t) +{ + return w << Triangle_2( + Point_2( t[0].hx(), t[0].hy(), t[0].hw()), + Point_2( t[1].hx(), t[1].hy(), t[1].hw()), + Point_2( t[2].hx(), t[2].hy(), t[2].hw())); +} +template< class R > +Window_stream& operator>>( Window_stream &w, Triangle_3 &t) +{ + Triangle_2 q; + w >> q; + t = Triangle_3( + Point_3( q[0].hx(), q[0].hy(), 0, q[0].hw()), + Point_3( q[1].hx(), q[1].hy(), 0, q[1].hw()), + Point_3( q[2].hx(), q[2].hy(), 0, q[2].hw())); + return w; +} +#endif // CGAL_WINDOW_STREAM_TRIANGLE_3 +#endif // CGAL_TRIANGLE_3_H + +#ifdef CGAL_TETRAHEDRON_3_H +#ifndef CGAL_WINDOW_STREAM_TETRAHEDRON_3 +#define CGAL_WINDOW_STREAM_TETRAHEDRON_3 +template< class R > +Window_stream& operator<<( Window_stream &w, const Tetrahedron_3 &t) +{ + w << Segment_3( t[0], t[1]); + w << Segment_3( t[1], t[2]); + w << Segment_3( t[2], t[0]); + w << Segment_3( t[0], t[3]); + w << Segment_3( t[1], t[3]); + w << Segment_3( t[2], t[3]); + return w; +} +template< class R > +Window_stream& operator>>( Window_stream &w, Tetrahedron_3 &t) +{ + typedef typename R::RT RT; + Triangle_3 q; + w >> q; + double x0 = to_double( q[0].x()); + double y0 = to_double( q[0].y()); + double x1, y1; + w.read_mouse_seg(x0, y0, x1, y1); + Point_3 p = Point_3( RT(x1), RT(y1), RT(0)); + w << Segment_3( q[0], p); + w << Segment_3( q[1], p); + w << Segment_3( q[2], p); + t = Tetrahedron_3( q[0], q[1], q[2], p); + return w; +} +#endif // CGAL_WINDOW_STREAM_TETRAHEDRON_3 +#endif // CGAL_TETRAHEDRON_3_H + +#ifdef CGAL_BBOX_3_H +#ifndef CGAL_WINDOW_STREAM_BBOX_3 +#define CGAL_WINDOW_STREAM_BBOX_3 +inline +Window_stream& operator<<( Window_stream &w, const Bbox_3 &b) +{ + return w << Bbox_2( b.xmin(), b.ymin(), b.xmax(), b.ymax()); +} +inline +Window_stream& operator>>( Window_stream &w, Bbox_3 &b) +{ + double x0, y0, x1, y1; + w.read_mouse(x0,y0); + w.read_mouse_rect(x0,y0, x1, y1); + if ( x1 < x0) { + double tmp = x0; x0 = x1; x1 = tmp; + } + if ( y1 < y0) { + double tmp = y0; y0 = y1; y1 = tmp; + } + b = Bbox_3( x0, y0, 0, x1, y1, 0); + w << b; + return w; +} +#endif // CGAL_WINDOW_STREAM_BBOX_3 +#endif // CGAL_BBOX_3_H + +CGAL_END_NAMESPACE + +// EOF // diff --git a/Packages/window/long_description.txt b/Packages/window/long_description.txt new file mode 100644 index 00000000000..3164d02e87e --- /dev/null +++ b/Packages/window/long_description.txt @@ -0,0 +1,47 @@ +Replacement for Window_stream.h + +CGAL_Window_stream is not longer a subclass of leda_window, but now only a typedef +to leda_window (corresponding to a decision made at the Saarbrücken meeting). +This has several (more than we thought, I guess) consequences. + +1. A user has to call leda_window::display() yourself; + so far, this call was hidden in the init function of CGAL_Window_stream; +2. There is no initialization with a CGAL_Bbox_2 any longer :) +3. The last button pressed is not maintained anymore! + There is a small workaround to get backwards compatibility in terms of + functionality. We have a function void + CGAL_read_mouse_plus(leda_window& w, CGAL_Point_2& p, int& button); + It can be used to replace a w << p; /*...*/ int b = w.last_button_pressed(); + code sequence by int k; CGAL_read_mouse_plus( w, p, k); /*...*/ int b = k; +4. There is no class CGAL_Window_stream anymore; Thus all forward declarations + for class CGAL_Window_stream are an error now (e.g. in Optimisation_ellipse_2.h) + Include instead. + BTW, ostream and istream will become typedefs in the C++-Standard as well + => same problem with forward declarations of `classes' [io]stream . +5. There is also a function to `cgalize' the LEDA window: CGAL_cgalize( leda_window&); + It sets some defaults (frame label, icon label, node width, ...). +6. The input functions now expect that you click with the left mouse button! If you + click with the right button, the leda_window is set in a mode converting to false; + This is done to have input sequences easily terminated. See Lutz's mail on May, 29. +7. By default, input functions for window streams draw the object that is put + into the stream. There are non-drawing equivalents: + leda_window& CGAL_read( leda_window&, CGAL_...); 6. applies to these functions, too. + BTW, in LEDA, window input operations don't draw the object. +8. Finally, the drawing of points has been modified. Instead of crosses, + points are now drawn as LEDA nodes, using the current node width. + Via the leda_window::set_node_width() you can influence the size of a point + to be drawn. + Remark: Redrawing points with the backround color does not erase them anymore, + since they have a black border now! + + +Files: +description.txt (this file) +changes.txt +version +include/CGAL/IO/Window_stream.h +include/CGAL/IO/leda_window.h +include/CGAL/IO/forward_decl_window_stream.h +include/CGAL/IO/esprit_logo.xpm +demo/Window_stream/makefile +demo/Window_stream/window_input.C diff --git a/Packages/window/test/WindowStream/cgal_test b/Packages/window/test/WindowStream/cgal_test new file mode 100755 index 00000000000..0a2da07f5ee --- /dev/null +++ b/Packages/window/test/WindowStream/cgal_test @@ -0,0 +1,68 @@ +#! /bin/sh + +# This is a script for the CGAL test suite. Such a script must obey +# the following rules: +# +# - the name of the script is cgal_test +# - for every target two one line messages are written to the file 'error.txt' +# the first one indicates if the compilation was successful +# the second one indicates if the execution was successful +# if one of the two was not successful, the line should start with 'ERROR:' +# - running the script should not require any user interaction +# - the script should clean up object files and executables + +ERRORFILE=error.txt + +#---------------------------------------------------------------------# +# compile_and_run +#---------------------------------------------------------------------# + +compile_and_run() +{ + echo "Compiling $1 ... " + if eval 'make CGAL_MAKEFILE=$CGAL_MAKEFILE \ + TESTSUITE_CXXFLAGS="$TESTSUITE_CXXFLAGS" \ + TESTSUITE_LDFLAGS="$TESTSUITE_LDFLAGS" $1' ; then + echo " compilation of $1 succeeded" >> $ERRORFILE + else + echo " ERROR: compilation of $1 failed" >> $ERRORFILE + fi + + if [ -f $1 ] ; then + OUTPUTFILE=ProgramOutput.$1.$PLATFORM + rm -f $OUTPUTFILE + COMMAND="./$1" + if [ -f $1.cmd ] ; then + COMMAND="$COMMAND '`cat $1.cmd`'" + fi + if [ -f $1.cin ] ; then + COMMAND="echo '`cat $1.cin`' | $COMMAND" + fi + echo "Executing $1 ... " + echo + if eval 2>&1 $COMMAND > $OUTPUTFILE ; then + echo " execution of $1 succeeded" >> $ERRORFILE + else + echo " ERROR: execution of $1 failed" >> $ERRORFILE + fi + else + echo " ERROR: could not execute $1" >> $ERRORFILE + fi + + eval "2>&1 make CGAL_MAKEFILE=$CGAL_MAKEFILE clean > /dev/null " +} + +#---------------------------------------------------------------------# +# remove the previous error file +#---------------------------------------------------------------------# + +rm -f $ERRORFILE +touch $ERRORFILE + +#---------------------------------------------------------------------# +# compile and run the tests +#---------------------------------------------------------------------# + +compile_and_run polygonal +compile_and_run manual_example_ps +compile_and_run test_window_stream_xy_3 diff --git a/Packages/window/test/WindowStream/makefile b/Packages/window/test/WindowStream/makefile new file mode 100644 index 00000000000..b3ce2ef2f66 --- /dev/null +++ b/Packages/window/test/WindowStream/makefile @@ -0,0 +1,61 @@ +# This is the makefile for compiling a CGAL application. + +#---------------------------------------------------------------------# +# include platform specific settings +#---------------------------------------------------------------------# +# Choose the right include file from the /make directory. + +# CGAL_MAKEFILE = ENTER_YOUR_INCLUDE_MAKEFILE_HERE +include $(CGAL_MAKEFILE) + +#---------------------------------------------------------------------# +# compiler flags +#---------------------------------------------------------------------# + +CXXFLAGS = \ + $(TESTSUITE_CXXFLAGS) \ + $(EXTRA_FLAGS) \ + $(CGAL_CXXFLAGS) \ + $(DEBUG_OPT) + +#---------------------------------------------------------------------# +# linker flags +#---------------------------------------------------------------------# + +LIBPATH = \ + $(TESTSUITE_LIBPATH) \ + $(CGAL_WINDOW_LIBPATH) + +LDFLAGS = \ + $(TESTSUITE_LDFLAGS) \ + $(CGAL_WINDOW_LDFLAGS) + +#---------------------------------------------------------------------# +# target entries +#---------------------------------------------------------------------# + +all: \ + test_window_stream_xy_3 \ + polygonal + +test_window_stream_xy_3$(EXE_EXT): test_window_stream_xy_3$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)test_window_stream_xy_3 test_window_stream_xy_3$(OBJ_EXT) $(LDFLAGS) + +polygonal$(EXE_EXT): polygonal$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)polygonal polygonal$(OBJ_EXT) $(LDFLAGS) + +manual_example_ps$(EXE_EXT): manual_example_ps$(OBJ_EXT) + $(CGAL_CXX) $(LIBPATH) $(EXE_OPT)manual_example_ps manual_example_ps$(OBJ_EXT) $(LDFLAGS) + +clean: \ + polygonal.clean \ + manual_example_ps.clean \ + test_window_stream_xy_3.clean + +#---------------------------------------------------------------------# +# suffix rules +#---------------------------------------------------------------------# + +.C$(OBJ_EXT): + $(CGAL_CXX) $(CXXFLAGS) $(OBJ_OPT) $< + diff --git a/Packages/window/test/WindowStream/manual_example_ps.C b/Packages/window/test/WindowStream/manual_example_ps.C new file mode 100644 index 00000000000..55e3f271dc6 --- /dev/null +++ b/Packages/window/test/WindowStream/manual_example_ps.C @@ -0,0 +1,50 @@ + +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : ps_file.fw +// file : include/CGAL/test/WindowStream/manual_example_ps.C +// revision : 2.7 +// revision_date : 21 Aug 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#ifdef CGAL_USE_LEDA +int main() { return 0; } +#else +#include +#include +#include + +typedef CGAL::Point_2< CGAL::Cartesian > Point; +typedef CGAL::Segment_2< CGAL::Cartesian > Segment; + +int main() +{ + Point p(0,1), q(2,2); + Segment s(p,q); + + CGAL::Postscript_file_stream PS(100,100); + PS.init(0,10,0); + CGAL::cgalize( PS); + PS.display(); + + PS << CGAL::RED << s << CGAL::BLACK << p << q ; + return 0; +} +#endif // USE_LEDA diff --git a/Packages/window/test/WindowStream/polygon_coordinates b/Packages/window/test/WindowStream/polygon_coordinates new file mode 100644 index 00000000000..8964f0825dd --- /dev/null +++ b/Packages/window/test/WindowStream/polygon_coordinates @@ -0,0 +1,575 @@ +2.52765e+06 5.49044e+06 +2.52588e+06 5.48886e+06 +2.52603e+06 5.48723e+06 +2.52655e+06 5.486e+06 +2.52688e+06 5.4843e+06 +2.52664e+06 5.48306e+06 +2.52703e+06 5.48125e+06 +2.52753e+06 5.48099e+06 +2.52862e+06 5.48094e+06 +2.52946e+06 5.48117e+06 +2.53007e+06 5.48164e+06 +2.53059e+06 5.48221e+06 +2.53129e+06 5.48217e+06 +2.53184e+06 5.4814e+06 +2.53303e+06 5.48082e+06 +2.53385e+06 5.48105e+06 +2.53502e+06 5.47991e+06 +2.5355e+06 5.47946e+06 +2.53627e+06 5.47938e+06 +2.53712e+06 5.47872e+06 +2.53848e+06 5.47775e+06 +2.53931e+06 5.47751e+06 +2.53933e+06 5.47725e+06 +2.54027e+06 5.47623e+06 +2.54043e+06 5.47594e+06 +2.54031e+06 5.4757e+06 +2.54007e+06 5.47582e+06 +2.53938e+06 5.47515e+06 +2.53921e+06 5.47506e+06 +2.53937e+06 5.47402e+06 +2.53963e+06 5.47394e+06 +2.53978e+06 5.47378e+06 +2.54013e+06 5.47377e+06 +2.54017e+06 5.47332e+06 +2.54033e+06 5.47303e+06 +2.5408e+06 5.47258e+06 +2.54118e+06 5.47242e+06 +2.54154e+06 5.47248e+06 +2.54198e+06 5.47263e+06 +2.54212e+06 5.4723e+06 +2.54259e+06 5.47214e+06 +2.54249e+06 5.47033e+06 +2.54332e+06 5.47057e+06 +2.54371e+06 5.47021e+06 +2.54358e+06 5.46956e+06 +2.54313e+06 5.46891e+06 +2.54276e+06 5.46843e+06 +2.54247e+06 5.46889e+06 +2.542e+06 5.46908e+06 +2.54183e+06 5.46916e+06 +2.54106e+06 5.46885e+06 +2.54128e+06 5.46797e+06 +2.54156e+06 5.46763e+06 +2.54206e+06 5.46715e+06 +2.54233e+06 5.46657e+06 +2.54253e+06 5.4665e+06 +2.54273e+06 5.46674e+06 +2.54344e+06 5.4663e+06 +2.54301e+06 5.46532e+06 +2.54313e+06 5.46498e+06 +2.54396e+06 5.4642e+06 +2.54404e+06 5.46401e+06 +2.54471e+06 5.46326e+06 +2.54491e+06 5.46297e+06 +2.54513e+06 5.46305e+06 +2.54578e+06 5.4627e+06 +2.54615e+06 5.46232e+06 +2.54642e+06 5.46219e+06 +2.54697e+06 5.46174e+06 +2.54748e+06 5.46128e+06 +2.54764e+06 5.46065e+06 +2.54811e+06 5.46096e+06 +2.5487e+06 5.46062e+06 +2.5486e+06 5.46037e+06 +2.54875e+06 5.45934e+06 +2.54816e+06 5.45852e+06 +2.5486e+06 5.45767e+06 +2.54934e+06 5.45797e+06 +2.55036e+06 5.45715e+06 +2.55003e+06 5.45649e+06 +2.5503e+06 5.45569e+06 +2.5504e+06 5.45495e+06 +2.55025e+06 5.45439e+06 +2.55048e+06 5.45358e+06 +2.55084e+06 5.45339e+06 +2.55129e+06 5.45345e+06 +2.5519e+06 5.45359e+06 +2.55258e+06 5.45404e+06 +2.55287e+06 5.45372e+06 +2.5533e+06 5.45248e+06 +2.55211e+06 5.4503e+06 +2.55263e+06 5.44876e+06 +2.55301e+06 5.44855e+06 +2.55325e+06 5.44816e+06 +2.55463e+06 5.44772e+06 +2.5551e+06 5.44787e+06 +2.55566e+06 5.4477e+06 +2.55744e+06 5.44797e+06 +2.55842e+06 5.4474e+06 +2.55865e+06 5.44745e+06 +2.55909e+06 5.44697e+06 +2.55971e+06 5.44693e+06 +2.56068e+06 5.44634e+06 +2.56093e+06 5.44627e+06 +2.56193e+06 5.44697e+06 +2.56183e+06 5.44875e+06 +2.56266e+06 5.44895e+06 +2.56279e+06 5.44907e+06 +2.56283e+06 5.44943e+06 +2.56275e+06 5.4498e+06 +2.56223e+06 5.45095e+06 +2.56221e+06 5.45163e+06 +2.56203e+06 5.45207e+06 +2.56122e+06 5.45304e+06 +2.56141e+06 5.45336e+06 +2.5625e+06 5.45413e+06 +2.56285e+06 5.45413e+06 +2.56325e+06 5.45398e+06 +2.5636e+06 5.45351e+06 +2.56403e+06 5.45332e+06 +2.56507e+06 5.4528e+06 +2.5654e+06 5.45304e+06 +2.56598e+06 5.45343e+06 +2.56623e+06 5.45336e+06 +2.56686e+06 5.4538e+06 +2.56687e+06 5.45433e+06 +2.56744e+06 5.45448e+06 +2.56795e+06 5.4543e+06 +2.56822e+06 5.45433e+06 +2.56844e+06 5.45366e+06 +2.56945e+06 5.45259e+06 +2.56998e+06 5.4523e+06 +2.57075e+06 5.45293e+06 +2.57289e+06 5.4513e+06 +2.57345e+06 5.45116e+06 +2.57373e+06 5.45068e+06 +2.57404e+06 5.45103e+06 +2.57436e+06 5.45109e+06 +2.57455e+06 5.45068e+06 +2.57538e+06 5.45087e+06 +2.57537e+06 5.44998e+06 +2.57534e+06 5.44958e+06 +2.57504e+06 5.44885e+06 +2.57532e+06 5.44776e+06 +2.57531e+06 5.44726e+06 +2.57639e+06 5.44501e+06 +2.57649e+06 5.44253e+06 +2.57775e+06 5.44252e+06 +2.57801e+06 5.44295e+06 +2.57825e+06 5.44358e+06 +2.57955e+06 5.44426e+06 +2.57968e+06 5.4446e+06 +2.57936e+06 5.44554e+06 +2.57912e+06 5.44632e+06 +2.57909e+06 5.44683e+06 +2.57949e+06 5.44678e+06 +2.58009e+06 5.44694e+06 +2.58069e+06 5.44702e+06 +2.58093e+06 5.44685e+06 +2.5811e+06 5.44674e+06 +2.58051e+06 5.44578e+06 +2.58073e+06 5.44525e+06 +2.5821e+06 5.4456e+06 +2.58283e+06 5.44431e+06 +2.58315e+06 5.44413e+06 +2.58373e+06 5.44393e+06 +2.58452e+06 5.44342e+06 +2.58496e+06 5.4439e+06 +2.58535e+06 5.44427e+06 +2.5858e+06 5.44422e+06 +2.58633e+06 5.44445e+06 +2.58668e+06 5.44428e+06 +2.58688e+06 5.44394e+06 +2.58719e+06 5.44368e+06 +2.58735e+06 5.44345e+06 +2.58748e+06 5.4431e+06 +2.58761e+06 5.4429e+06 +2.58778e+06 5.44294e+06 +2.58794e+06 5.44335e+06 +2.58802e+06 5.44355e+06 +2.5883e+06 5.44375e+06 +2.589e+06 5.44387e+06 +2.58927e+06 5.44388e+06 +2.59074e+06 5.44444e+06 +2.59123e+06 5.44412e+06 +2.59163e+06 5.44393e+06 +2.59163e+06 5.44393e+06 +2.59234e+06 5.44366e+06 +2.59278e+06 5.44381e+06 +2.59325e+06 5.44356e+06 +2.59354e+06 5.44362e+06 +2.59356e+06 5.44312e+06 +2.5942e+06 5.44291e+06 +2.59452e+06 5.44293e+06 +2.59561e+06 5.44461e+06 +2.59579e+06 5.44523e+06 +2.59631e+06 5.44571e+06 +2.59751e+06 5.44632e+06 +2.59802e+06 5.44603e+06 +2.59857e+06 5.44618e+06 +2.59891e+06 5.44608e+06 +2.59942e+06 5.44623e+06 +2.59944e+06 5.44725e+06 +2.5995e+06 5.44751e+06 +2.59978e+06 5.44809e+06 +2.59939e+06 5.4478e+06 +2.59926e+06 5.44797e+06 +2.5989e+06 5.44796e+06 +2.5985e+06 5.44825e+06 +2.59797e+06 5.44923e+06 +2.5973e+06 5.44968e+06 +2.59751e+06 5.45047e+06 +2.59731e+06 5.45077e+06 +2.59692e+06 5.45101e+06 +2.59651e+06 5.45098e+06 +2.59606e+06 5.45136e+06 +2.59571e+06 5.45174e+06 +2.59522e+06 5.45228e+06 +2.595e+06 5.45282e+06 +2.59459e+06 5.45279e+06 +2.59444e+06 5.45298e+06 +2.59474e+06 5.45329e+06 +2.59459e+06 5.45382e+06 +2.59479e+06 5.45407e+06 +2.59492e+06 5.4545e+06 +2.59499e+06 5.45486e+06 +2.59491e+06 5.45495e+06 +2.59402e+06 5.45561e+06 +2.59415e+06 5.45615e+06 +2.59389e+06 5.4565e+06 +2.59476e+06 5.45711e+06 +2.59493e+06 5.4581e+06 +2.59512e+06 5.4587e+06 +2.59529e+06 5.45877e+06 +2.59552e+06 5.45836e+06 +2.59592e+06 5.45795e+06 +2.59633e+06 5.45772e+06 +2.59668e+06 5.45872e+06 +2.59655e+06 5.45902e+06 +2.5974e+06 5.45958e+06 +2.59784e+06 5.46035e+06 +2.59784e+06 5.46069e+06 +2.59767e+06 5.46067e+06 +2.59711e+06 5.46098e+06 +2.59759e+06 5.4615e+06 +2.59791e+06 5.46146e+06 +2.59858e+06 5.46154e+06 +2.59928e+06 5.4612e+06 +2.59938e+06 5.46155e+06 +2.59967e+06 5.46164e+06 +2.59989e+06 5.46142e+06 +2.60019e+06 5.46174e+06 +2.60087e+06 5.46283e+06 +2.60083e+06 5.46283e+06 +2.60069e+06 5.46295e+06 +2.60045e+06 5.46329e+06 +2.60034e+06 5.46368e+06 +2.6005e+06 5.46411e+06 +2.6005e+06 5.46439e+06 +2.60077e+06 5.46466e+06 +2.60111e+06 5.46472e+06 +2.60111e+06 5.46483e+06 +2.60139e+06 5.4653e+06 +2.60109e+06 5.46579e+06 +2.60084e+06 5.46585e+06 +2.60083e+06 5.46614e+06 +2.60129e+06 5.46675e+06 +2.6014e+06 5.4671e+06 +2.60158e+06 5.46748e+06 +2.6018e+06 5.46773e+06 +2.60191e+06 5.46812e+06 +2.60202e+06 5.4684e+06 +2.60198e+06 5.46866e+06 +2.60176e+06 5.46886e+06 +2.60165e+06 5.46919e+06 +2.60124e+06 5.46917e+06 +2.60122e+06 5.46938e+06 +2.60168e+06 5.46957e+06 +2.60186e+06 5.46988e+06 +2.60134e+06 5.47028e+06 +2.60131e+06 5.47056e+06 +2.60184e+06 5.47111e+06 +2.6017e+06 5.47135e+06 +2.59941e+06 5.47068e+06 +2.59938e+06 5.47131e+06 +2.59948e+06 5.47174e+06 +2.59844e+06 5.47177e+06 +2.59843e+06 5.47232e+06 +2.59719e+06 5.47249e+06 +2.59671e+06 5.47217e+06 +2.59467e+06 5.47294e+06 +2.59474e+06 5.47322e+06 +2.59433e+06 5.47347e+06 +2.59374e+06 5.47338e+06 +2.59366e+06 5.47372e+06 +2.59422e+06 5.47434e+06 +2.59409e+06 5.4745e+06 +2.59408e+06 5.4745e+06 +2.59418e+06 5.47492e+06 +2.59397e+06 5.47524e+06 +2.5938e+06 5.47578e+06 +2.59378e+06 5.47623e+06 +2.59309e+06 5.47649e+06 +2.59282e+06 5.47678e+06 +2.59246e+06 5.47704e+06 +2.59198e+06 5.47714e+06 +2.59158e+06 5.47711e+06 +2.59153e+06 5.4773e+06 +2.5912e+06 5.47741e+06 +2.59115e+06 5.47774e+06 +2.59096e+06 5.47792e+06 +2.59083e+06 5.4782e+06 +2.59102e+06 5.47836e+06 +2.59106e+06 5.47878e+06 +2.59079e+06 5.47911e+06 +2.59055e+06 5.47929e+06 +2.59065e+06 5.47958e+06 +2.59105e+06 5.47988e+06 +2.59193e+06 5.48027e+06 +2.5922e+06 5.48018e+06 +2.59238e+06 5.4805e+06 +2.59323e+06 5.48071e+06 +2.5933e+06 5.4811e+06 +2.59431e+06 5.48189e+06 +2.59425e+06 5.48215e+06 +2.5946e+06 5.4826e+06 +2.59426e+06 5.48312e+06 +2.59388e+06 5.48371e+06 +2.59362e+06 5.48365e+06 +2.59315e+06 5.48371e+06 +2.5929e+06 5.48378e+06 +2.59279e+06 5.48409e+06 +2.593e+06 5.48533e+06 +2.5932e+06 5.48541e+06 +2.59314e+06 5.48567e+06 +2.59301e+06 5.48567e+06 +2.59295e+06 5.48612e+06 +2.59279e+06 5.48624e+06 +2.59292e+06 5.48655e+06 +2.59335e+06 5.48688e+06 +2.59343e+06 5.48708e+06 +2.59333e+06 5.48754e+06 +2.5935e+06 5.48788e+06 +2.5937e+06 5.48796e+06 +2.59395e+06 5.4875e+06 +2.59455e+06 5.48772e+06 +2.59463e+06 5.48787e+06 +2.59483e+06 5.48796e+06 +2.59468e+06 5.48827e+06 +2.5943e+06 5.48845e+06 +2.59406e+06 5.48888e+06 +2.59425e+06 5.48935e+06 +2.59402e+06 5.48952e+06 +2.59338e+06 5.48936e+06 +2.59313e+06 5.48948e+06 +2.59266e+06 5.48964e+06 +2.59248e+06 5.48966e+06 +2.59238e+06 5.48972e+06 +2.59224e+06 5.49155e+06 +2.5924e+06 5.49188e+06 +2.59219e+06 5.49208e+06 +2.59224e+06 5.49231e+06 +2.59208e+06 5.49241e+06 +2.59182e+06 5.49251e+06 +2.59183e+06 5.49289e+06 +2.59166e+06 5.49322e+06 +2.59138e+06 5.49344e+06 +2.59126e+06 5.49356e+06 +2.5918e+06 5.49485e+06 +2.59163e+06 5.49487e+06 +2.59138e+06 5.4948e+06 +2.59118e+06 5.49458e+06 +2.59109e+06 5.49426e+06 +2.59086e+06 5.49398e+06 +2.59062e+06 5.49372e+06 +2.59007e+06 5.49368e+06 +2.58979e+06 5.49365e+06 +2.58982e+06 5.49347e+06 +2.58959e+06 5.49315e+06 +2.58923e+06 5.493e+06 +2.58904e+06 5.49293e+06 +2.58873e+06 5.49277e+06 +2.58826e+06 5.49274e+06 +2.5878e+06 5.49282e+06 +2.58764e+06 5.49294e+06 +2.5878e+06 5.49383e+06 +2.58764e+06 5.49404e+06 +2.58704e+06 5.49409e+06 +2.58666e+06 5.4941e+06 +2.58639e+06 5.49405e+06 +2.58623e+06 5.49397e+06 +2.58599e+06 5.49407e+06 +2.58581e+06 5.49398e+06 +2.58492e+06 5.49501e+06 +2.58503e+06 5.49609e+06 +2.58481e+06 5.49663e+06 +2.58462e+06 5.49659e+06 +2.58427e+06 5.49672e+06 +2.58369e+06 5.4969e+06 +2.58329e+06 5.49691e+06 +2.58272e+06 5.49673e+06 +2.58267e+06 5.49652e+06 +2.58238e+06 5.49617e+06 +2.58238e+06 5.49617e+06 +2.58182e+06 5.49611e+06 +2.58141e+06 5.49604e+06 +2.58079e+06 5.49622e+06 +2.58039e+06 5.49638e+06 +2.58005e+06 5.49635e+06 +2.57979e+06 5.49713e+06 +2.57955e+06 5.49709e+06 +2.57957e+06 5.49698e+06 +2.57946e+06 5.49691e+06 +2.57922e+06 5.49694e+06 +2.57882e+06 5.49667e+06 +2.57869e+06 5.49691e+06 +2.57789e+06 5.49829e+06 +2.57726e+06 5.49933e+06 +2.57651e+06 5.49997e+06 +2.57536e+06 5.50035e+06 +2.5744e+06 5.50072e+06 +2.57346e+06 5.50006e+06 +2.5734e+06 5.49971e+06 +2.5731e+06 5.49975e+06 +2.57247e+06 5.49993e+06 +2.57179e+06 5.4992e+06 +2.5714e+06 5.49884e+06 +2.57145e+06 5.49947e+06 +2.57173e+06 5.49996e+06 +2.57164e+06 5.50026e+06 +2.57146e+06 5.50008e+06 +2.57116e+06 5.50008e+06 +2.57096e+06 5.50015e+06 +2.57092e+06 5.50033e+06 +2.57069e+06 5.50039e+06 +2.56983e+06 5.49975e+06 +2.56954e+06 5.49968e+06 +2.56936e+06 5.49974e+06 +2.56915e+06 5.49961e+06 +2.56898e+06 5.49943e+06 +2.56882e+06 5.49937e+06 +2.56861e+06 5.50027e+06 +2.56841e+06 5.50041e+06 +2.56742e+06 5.49984e+06 +2.56769e+06 5.49927e+06 +2.56761e+06 5.49904e+06 +2.56761e+06 5.49904e+06 +2.56767e+06 5.49843e+06 +2.56761e+06 5.4983e+06 +2.56712e+06 5.49845e+06 +2.56721e+06 5.49789e+06 +2.56698e+06 5.4977e+06 +2.56668e+06 5.49819e+06 +2.56622e+06 5.4981e+06 +2.56579e+06 5.498e+06 +2.56549e+06 5.49788e+06 +2.56478e+06 5.49791e+06 +2.5641e+06 5.49767e+06 +2.56394e+06 5.4975e+06 +2.56412e+06 5.49744e+06 +2.56407e+06 5.4972e+06 +2.56384e+06 5.49716e+06 +2.56368e+06 5.49698e+06 +2.56348e+06 5.49662e+06 +2.56313e+06 5.49667e+06 +2.56288e+06 5.49708e+06 +2.56182e+06 5.49652e+06 +2.56114e+06 5.49523e+06 +2.56092e+06 5.49535e+06 +2.56081e+06 5.4948e+06 +2.56063e+06 5.49452e+06 +2.56039e+06 5.49445e+06 +2.55999e+06 5.49472e+06 +2.55974e+06 5.49492e+06 +2.55945e+06 5.49483e+06 +2.55887e+06 5.49525e+06 +2.5578e+06 5.49449e+06 +2.55702e+06 5.49362e+06 +2.55652e+06 5.49299e+06 +2.55593e+06 5.49257e+06 +2.55585e+06 5.49271e+06 +2.55514e+06 5.49203e+06 +2.55434e+06 5.49151e+06 +2.55386e+06 5.4913e+06 +2.55346e+06 5.49149e+06 +2.55322e+06 5.4916e+06 +2.55281e+06 5.49148e+06 +2.55266e+06 5.49131e+06 +2.55148e+06 5.49082e+06 +2.55095e+06 5.48967e+06 +2.5507e+06 5.48938e+06 +2.55037e+06 5.48924e+06 +2.55029e+06 5.48896e+06 +2.55011e+06 5.48892e+06 +2.54997e+06 5.48897e+06 +2.54997e+06 5.48939e+06 +2.5498e+06 5.49015e+06 +2.54953e+06 5.49025e+06 +2.54815e+06 5.48967e+06 +2.54773e+06 5.48982e+06 +2.54738e+06 5.49051e+06 +2.54725e+06 5.49032e+06 +2.54726e+06 5.49013e+06 +2.54729e+06 5.48991e+06 +2.54722e+06 5.48963e+06 +2.54713e+06 5.4894e+06 +2.54686e+06 5.48931e+06 +2.54651e+06 5.48918e+06 +2.54627e+06 5.48944e+06 +2.5459e+06 5.4895e+06 +2.54573e+06 5.4894e+06 +2.54567e+06 5.48923e+06 +2.54487e+06 5.48882e+06 +2.54494e+06 5.48846e+06 +2.54489e+06 5.4883e+06 +2.54472e+06 5.4883e+06 +2.54454e+06 5.4883e+06 +2.54417e+06 5.48806e+06 +2.5444e+06 5.48754e+06 +2.54438e+06 5.48728e+06 +2.54431e+06 5.48709e+06 +2.54413e+06 5.48702e+06 +2.5439e+06 5.48696e+06 +2.54363e+06 5.48704e+06 +2.54327e+06 5.48711e+06 +2.54277e+06 5.487e+06 +2.54252e+06 5.48715e+06 +2.54222e+06 5.48735e+06 +2.54215e+06 5.48761e+06 +2.54198e+06 5.48805e+06 +2.54195e+06 5.4881e+06 +2.54144e+06 5.48892e+06 +2.54126e+06 5.489e+06 +2.54112e+06 5.48914e+06 +2.54097e+06 5.4894e+06 +2.54052e+06 5.48915e+06 +2.5403e+06 5.4889e+06 +2.54012e+06 5.48891e+06 +2.53914e+06 5.48913e+06 +2.53821e+06 5.48822e+06 +2.53791e+06 5.48812e+06 +2.53779e+06 5.48805e+06 +2.53764e+06 5.48796e+06 +2.53747e+06 5.48795e+06 +2.53727e+06 5.48879e+06 +2.53693e+06 5.4889e+06 +2.53634e+06 5.48844e+06 +2.53613e+06 5.48832e+06 +2.53587e+06 5.48831e+06 +2.53551e+06 5.4884e+06 +2.53529e+06 5.48868e+06 +2.53503e+06 5.48897e+06 +2.53485e+06 5.48933e+06 +2.53466e+06 5.48962e+06 +2.53449e+06 5.48988e+06 +2.53411e+06 5.48987e+06 +2.53383e+06 5.48981e+06 +2.53362e+06 5.48971e+06 +2.53342e+06 5.48961e+06 +2.53285e+06 5.48922e+06 +2.53273e+06 5.48958e+06 +2.53239e+06 5.48965e+06 +2.53179e+06 5.48993e+06 +2.5314e+06 5.49015e+06 +2.53114e+06 5.49022e+06 +2.53095e+06 5.49021e+06 +2.53075e+06 5.49006e+06 +2.5305e+06 5.48991e+06 +2.53029e+06 5.48987e+06 +2.53012e+06 5.4899e+06 +2.53002e+06 5.49014e+06 +2.52955e+06 5.49024e+06 +2.52913e+06 5.49022e+06 +2.52876e+06 5.49007e+06 +2.52839e+06 5.49011e+06 diff --git a/Packages/window/test/WindowStream/polygonal.C b/Packages/window/test/WindowStream/polygonal.C new file mode 100644 index 00000000000..5ab2e9d19af --- /dev/null +++ b/Packages/window/test/WindowStream/polygonal.C @@ -0,0 +1,79 @@ + +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : polygonal.fw +// file : include/CGAL/test/WindowStream/polygonal.C +// revision : 2.7 +// revision_date : 21 Aug 2000 +// author(s) : Stefan Schirra +// +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include +#include +#include +#include +#ifdef CGAL_USE_LEDA +# include +#endif // CGAL_USE_LEDA +#include + +typedef CGAL::Point_2 > Point2; + +int +main(int argc, char *argv[]) +{ + if (argc >= 2) { return 0; } + + std::ifstream F("polygon_coordinates"); + CGAL::set_ascii_mode(F); + CGAL::set_ascii_mode(std::cout); + std::istream_iterator< Point2> in_start(F); + std::istream_iterator< Point2> in_end; + std::vector V ; + std::copy( in_start, in_end, std::back_inserter(V) ); + #ifdef CGAL_USE_LEDA + CGAL::Window_stream W; + CGAL::Bbox_2 b = V.begin()->bbox(); + for ( std::vector::iterator it = V.begin(); it != V.end(); ++it) + { b = b + (*it).bbox(); } + double x_span = b.xmax() - b.xmin(); + double y_span = b.ymax() - b.ymin(); + double span = std::max( x_span, y_span); + span *= 1.1; + W.init((b.xmin()+b.xmax()-span)/2, + (b.xmin()+b.xmax()+span)/2, + (b.ymin()+b.ymax()-span)/2 ); + CGAL::cgalize(W); + W.display(); + W << CGAL::RED; + CGAL::send_to_stream_as_polygon( W, V.begin(), V.end()); + leda_wait( 5); + W.clear(); + W << CGAL::GREEN; + CGAL::send_to_stream_as_polyline( W, V.begin(), V.end()); + leda_wait( 5); + #else + std::cout << std::endl << "Polygon" << std::endl; + CGAL::send_to_stream_as_polygon( std::cout, V.begin(), V.end()); + std::cout << std::endl << "Polyline" << std::endl; + CGAL::send_to_stream_as_polyline( std::cout, V.begin(), V.end()); + #endif // LEDA + + return 0; +} diff --git a/Packages/window/test/WindowStream/polygonal.cmd b/Packages/window/test/WindowStream/polygonal.cmd new file mode 100644 index 00000000000..3bb52f80529 --- /dev/null +++ b/Packages/window/test/WindowStream/polygonal.cmd @@ -0,0 +1 @@ +do not execute polygonal diff --git a/Packages/window/test/WindowStream/test_window_stream_xy_3.C b/Packages/window/test/WindowStream/test_window_stream_xy_3.C new file mode 100644 index 00000000000..7dcadae6d8f --- /dev/null +++ b/Packages/window/test/WindowStream/test_window_stream_xy_3.C @@ -0,0 +1,132 @@ +// ============================================================================ +// +// Copyright (c) 1999 The CGAL Consortium +// +// This software and related documentation is part of an INTERNAL release +// of the Computational Geometry Algorithms Library (CGAL). It is not +// intended for general use. +// +// ---------------------------------------------------------------------------- +// +// release : +// release_date : +// +// source : test_window_stream_xy_3.fw +// file : test/WindowStream/test_window_stream_xy_3.C +// revision : 2.7 +// revision_date : 21 Aug 2000 +// author(s) : Lutz Kettner +// Stefan Schirra +// maintainer : Stefan Schirra +// +// coordinator : MPI, Saarbruecken () +// ============================================================================ + + +#include + +#ifdef CGAL_USE_LEDA +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// Check that multiple inclusion works. +#include + +typedef CGAL::Cartesian REP; +typedef CGAL::Point_3 Point3; +typedef CGAL::Vector_3 Vector3; +typedef CGAL::Direction_3 Direction3; +typedef CGAL::Line_3 Line3; +typedef CGAL::Ray_3 Ray3; +typedef CGAL::Segment_3 Segment3; +typedef CGAL::Triangle_3 Triangle3; +typedef CGAL::Tetrahedron_3 Tetrahedron3; +typedef CGAL::Bbox_3 Bbox3; + +void test_window_stream_xy_3() { + CGAL::Window_stream W(512, 512); + CGAL::cgalize(W); + W.init(-256.0, 255.0, -256.0); + W.display(0,0); + + Point3 p1(10,10,10), + p2(10,-10,20), + p3(-10,10,30), + p4(-10,-10,23890); + W << p1 << p2 << p3 << p4; + + // No output available for 2d vectors at the moment. + // Vector_3 v(50,10,-300); + // W << CGAL::GREEN << v; + + // No output available for 2d directions at the moment. + // Direction_3 d(40,-20,5); + // W << CGAL::GREEN << d; + + p1 = Point3(-200,100,32); + p2 = Point3( 200,120,32); + Line3 l( p1, p2); + W << CGAL::BLUE << l; + p1 = Point3(-200,140,32); + p2 = Point3( 200,160,32); + Ray3 ray( p1, p2); + W << ray; + p1 = Point3(-200,180,32); + p2 = Point3( 200,200,32); + Segment3 segment( p1, p2); + W << segment; + p1 = Point3(-125, -50,32); + p2 = Point3( -50,-200,32); + p3 = Point3(-200,-200,32); + Triangle3 triangle( p1, p2, p3); + W << CGAL::RED << triangle; + p1 = Point3( 125,- 50,32); + p2 = Point3( 50,-200,32); + p3 = Point3( 200,-200,32); + p4 = Point3( 125,-150,32); + Tetrahedron3 tetra( p1, p2, p3, p4); + W << tetra; + Bbox3 bbox(-240,-240,-240, 240, 240, 240); + W << CGAL::BLACK << bbox; + + W >> p1; + W.clear(); + + // Test stream input operators. + W << CGAL::BLACK; + W >> p1; + // No input available for 2d vectors and directions at the moment. + // W >> v >> d; + W << CGAL::BLUE; + W >> l >> ray >> segment; + W << CGAL::RED; + W >> triangle >> tetra; + W << CGAL::BLACK; + W >> bbox; + + W >> p1; +} + +int +main( int argc, char *argv[]) +{ + if (argc >= 2) { return 0; } + test_window_stream_xy_3(); + + return 0; +} +#else +int main() { return 0; } +#endif // CGAL_USE_LEDA diff --git a/Packages/window/test/WindowStream/test_window_stream_xy_3.cmd b/Packages/window/test/WindowStream/test_window_stream_xy_3.cmd new file mode 100644 index 00000000000..842dea93d7e --- /dev/null +++ b/Packages/window/test/WindowStream/test_window_stream_xy_3.cmd @@ -0,0 +1 @@ +do not execute diff --git a/Packages/window/version b/Packages/window/version new file mode 100644 index 00000000000..cc057c7f312 --- /dev/null +++ b/Packages/window/version @@ -0,0 +1,2 @@ +2.7.1 (21 Aug 2000) +maintainer: Stefan Schirra