From a48a9ca1ab3cc7e278cbfc970b976bec7019a0c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sven=20Sch=C3=B6nherr?= Date: Tue, 17 Jul 2001 12:33:00 +0000 Subject: [PATCH] renamed concept names and template parameters --- .../demo/Min_ellipse_2/demo_Min_ellipse_2.C | 26 +- .../Optimisation_ref/Min_ellipse_2.tex | 38 +-- .../Min_ellipse_2_traits_2.tex | 16 +- .../Optimisation_ref/main_Min_ellipse_2.tex | 2 +- .../Optimisation_ref/Min_ellipse_2.tex | 38 +-- .../Min_ellipse_2_traits_2.tex | 16 +- .../Optimisation_ref/main_Min_ellipse_2.tex | 2 +- .../Min_ellipse_2/example_Min_ellipse_2.C | 6 +- Packages/Min_ellipse_2/web/Min_ellipse_2.aw | 260 +++++++++--------- 9 files changed, 164 insertions(+), 240 deletions(-) diff --git a/Packages/Min_ellipse_2/demo/Min_ellipse_2/demo_Min_ellipse_2.C b/Packages/Min_ellipse_2/demo/Min_ellipse_2/demo_Min_ellipse_2.C index 9169c4c4283..40d199b1120 100644 --- a/Packages/Min_ellipse_2/demo/Min_ellipse_2/demo_Min_ellipse_2.C +++ b/Packages/Min_ellipse_2/demo/Min_ellipse_2/demo_Min_ellipse_2.C @@ -32,9 +32,6 @@ // contain all points nor be the smallest one. // !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -// needs LEDA -#ifdef CGAL_USE_LEDA - // includes #include #include @@ -43,9 +40,9 @@ #include // typedefs -typedef CGAL::Cartesian< double > R; -typedef CGAL::Point_2< R > Point; -typedef CGAL::Min_ellipse_2_traits_2< R > Traits; +typedef CGAL::Cartesian< double > K; +typedef CGAL::Point_2< K > Point; +typedef CGAL::Min_ellipse_2_traits_2< K > Traits; typedef CGAL::Min_ellipse_2< Traits > Min_ellipse; // main @@ -64,7 +61,6 @@ main( int, char**) // open window CGAL::Window_stream ws( "CGAL Demo: Smallest Enclosing Ellipse in 2D"); ws.set_icon_label("CGAL"); - ws.set_icon_pixrect( ws.create_pixrect( CGAL::esprit_logo)); ws.set_node_width( 5); ws.init( -100.0, 100.0, -100.0); ws.display(); @@ -98,20 +94,4 @@ main( int, char**) return( 0); } -#else -// no LEDA available - -#include - -int -main( int, char**) -{ - using namespace std; - - cerr << "This demo program needs LEDA!" << endl; - - return( 0); -} -#endif // CGAL_USE_LEDA - // ===== EOF ================================================================== diff --git a/Packages/Min_ellipse_2/doc_tex/Optimisation/Optimisation_ref/Min_ellipse_2.tex b/Packages/Min_ellipse_2/doc_tex/Optimisation/Optimisation_ref/Min_ellipse_2.tex index 4b576207616..b158b14bc89 100644 --- a/Packages/Min_ellipse_2/doc_tex/Optimisation/Optimisation_ref/Min_ellipse_2.tex +++ b/Packages/Min_ellipse_2/doc_tex/Optimisation/Optimisation_ref/Min_ellipse_2.tex @@ -51,7 +51,7 @@ set $S$ which remains fixed until the next insert or clear operation. \ccRequirements \ccIndexRequirements -The template parameter \ccc{Traits} is a model for \ccc{Min_ellipse_2_traits}. +The template parameter \ccc{Traits} is a model for \ccc{MinEllipse2Traits}. We provide the model \ccc{Min_ellipse_2_traits_2} using the two-dimensional \cgal~kernel. @@ -322,8 +322,8 @@ validity check. \ccSeeAlso \ccRefIdfierPage{CGAL::Min_circle_2}\\[1ex] -\ccRefIdfierPage{CGAL::Min_ellipse_2_traits_2}\\[1ex] -\ccRefConceptPage{Min_ellipse_2_traits} +\ccRefIdfierPage{CGAL::Min_ellipse_2_traits_2}\\[1ex] +\ccRefConceptPage{MinEllipse2Traits} % ----------------------------------------------------------------------------- \ccImplementation @@ -350,37 +350,7 @@ for validity each takes linear time. To illustrate the creation of \ccRefName\ and to show that randomization can be useful in certain cases, we give an example. -\ccTexHtml{\small}{} -\begin{verbatim} -#include -#include -#include -#include -#include - -typedef CGAL::Gmpz NT; -typedef CGAL::Homogeneous R; -typedef R::Point_2 Point; -typedef CGAL::Min_ellipse_2_traits_2 Traits; -typedef CGAL::Min_ellipse_2 Min_ellipse; - -int main() -{ - int n = 1000; - Point* P = new Point[ n]; - - for ( int i = 0; i < n; ++i) - P[ i] = Point( (i%2 == 0 ? i : -i), 0); - // (0,0), (-1,0), (2,0), (-3,0), ... - - Min_ellipse me1( P, P+n); // very slow - Min_ellipse me2( P, P+n, true); // fast - - delete[] P; - return( 0); -} -\end{verbatim} -\ccTexHtml{\normalsize}{} +\ccIncludeExampleCode{Optimisation_ref/example_Min_ellipse_2_noheader.C} % ----------------------------------------------------------------------------- diff --git a/Packages/Min_ellipse_2/doc_tex/Optimisation/Optimisation_ref/Min_ellipse_2_traits_2.tex b/Packages/Min_ellipse_2/doc_tex/Optimisation/Optimisation_ref/Min_ellipse_2_traits_2.tex index 86b2962d638..c77410d60d7 100644 --- a/Packages/Min_ellipse_2/doc_tex/Optimisation/Optimisation_ref/Min_ellipse_2_traits_2.tex +++ b/Packages/Min_ellipse_2/doc_tex/Optimisation/Optimisation_ref/Min_ellipse_2_traits_2.tex @@ -2,7 +2,7 @@ % ============================================================================= % The CGAL Reference Manual % Chapter: Geometric Optimisation -% Class : CGAL::Min_ellipse_2_traits_2 +% Class : CGAL::Min_ellipse_2_traits_2 % ----------------------------------------------------------------------------- % file : doc_tex/basic/Optimisation/..._ref/Min_ellipse_2_traits_2.tex % package: Min_ellipse_2 @@ -14,7 +14,7 @@ \ccAutoIndexingOff -\begin{ccRefClass}{Min_ellipse_2_traits_2} +\begin{ccRefClass}{Min_ellipse_2_traits_2} \ccIndexTraitsClassBegin{Min_ellipse_2_traits_2}{Min_ellipse_2}{} \ccAutoIndexingOn @@ -30,20 +30,20 @@ using the two-di\-men\-sional \cgal\ kernel. % ----------------------------------------------------------------------------- \ccRequirements -The template parameter \ccc{R} is a model for \ccc{Kernel}. +The template parameter \ccc{K} is a model for \ccc{Kernel}. % ----------------------------------------------------------------------------- \ccIsModel -\ccRefConceptPage{Min_ellipse_2_traits} +\ccRefConceptPage{MinEllipse2Traits} % ----------------------------------------------------------------------------- \ccTypes \ccSaveThreeColumns -\ccSetTwoColumns{Min_ellipse_2_traits_2:: Ellipse}{} +\ccSetTwoColumns{Min_ellipse_2_traits_2:: Ellipse}{} -\ccNestedType{Point }{typedef to \ccc{R::Point_2}.} +\ccNestedType{Point }{typedef to \ccc{K::Point_2}.} \ccNestedType{Ellipse}{internal type.} % ----------------------------------------------------------------------------- @@ -52,13 +52,13 @@ The template parameter \ccc{R} is a model for \ccc{Kernel}. \ccConstructor{ Min_ellipse_2_traits_2( );}{default constructor.} \ccConstructor{ Min_ellipse_2_traits_2( - const Min_ellipse_2_traits_2&);}{copy constructor.} + const Min_ellipse_2_traits_2&);}{copy constructor.} % ----------------------------------------------------------------------------- \ccSeeAlso \ccRefIdfierPage{CGAL::Min_ellipse_2}\\[1ex] -\ccRefConceptPage{Min_ellipse_2_traits} +\ccRefConceptPage{MinEllipse2Traits} % ----------------------------------------------------------------------------- diff --git a/Packages/Min_ellipse_2/doc_tex/Optimisation/Optimisation_ref/main_Min_ellipse_2.tex b/Packages/Min_ellipse_2/doc_tex/Optimisation/Optimisation_ref/main_Min_ellipse_2.tex index 09668130770..70e882da7aa 100644 --- a/Packages/Min_ellipse_2/doc_tex/Optimisation/Optimisation_ref/main_Min_ellipse_2.tex +++ b/Packages/Min_ellipse_2/doc_tex/Optimisation/Optimisation_ref/main_Min_ellipse_2.tex @@ -24,6 +24,6 @@ \inputOpt{Min_ellipse_2_traits_2} -\inputOpt{Min_ellipse_2_traits} +\inputOpt{MinEllipse2Traits} % ===== EOF =================================================================== diff --git a/Packages/Min_ellipse_2/doc_tex/basic/Optimisation/Optimisation_ref/Min_ellipse_2.tex b/Packages/Min_ellipse_2/doc_tex/basic/Optimisation/Optimisation_ref/Min_ellipse_2.tex index 4b576207616..b158b14bc89 100644 --- a/Packages/Min_ellipse_2/doc_tex/basic/Optimisation/Optimisation_ref/Min_ellipse_2.tex +++ b/Packages/Min_ellipse_2/doc_tex/basic/Optimisation/Optimisation_ref/Min_ellipse_2.tex @@ -51,7 +51,7 @@ set $S$ which remains fixed until the next insert or clear operation. \ccRequirements \ccIndexRequirements -The template parameter \ccc{Traits} is a model for \ccc{Min_ellipse_2_traits}. +The template parameter \ccc{Traits} is a model for \ccc{MinEllipse2Traits}. We provide the model \ccc{Min_ellipse_2_traits_2} using the two-dimensional \cgal~kernel. @@ -322,8 +322,8 @@ validity check. \ccSeeAlso \ccRefIdfierPage{CGAL::Min_circle_2}\\[1ex] -\ccRefIdfierPage{CGAL::Min_ellipse_2_traits_2}\\[1ex] -\ccRefConceptPage{Min_ellipse_2_traits} +\ccRefIdfierPage{CGAL::Min_ellipse_2_traits_2}\\[1ex] +\ccRefConceptPage{MinEllipse2Traits} % ----------------------------------------------------------------------------- \ccImplementation @@ -350,37 +350,7 @@ for validity each takes linear time. To illustrate the creation of \ccRefName\ and to show that randomization can be useful in certain cases, we give an example. -\ccTexHtml{\small}{} -\begin{verbatim} -#include -#include -#include -#include -#include - -typedef CGAL::Gmpz NT; -typedef CGAL::Homogeneous R; -typedef R::Point_2 Point; -typedef CGAL::Min_ellipse_2_traits_2 Traits; -typedef CGAL::Min_ellipse_2 Min_ellipse; - -int main() -{ - int n = 1000; - Point* P = new Point[ n]; - - for ( int i = 0; i < n; ++i) - P[ i] = Point( (i%2 == 0 ? i : -i), 0); - // (0,0), (-1,0), (2,0), (-3,0), ... - - Min_ellipse me1( P, P+n); // very slow - Min_ellipse me2( P, P+n, true); // fast - - delete[] P; - return( 0); -} -\end{verbatim} -\ccTexHtml{\normalsize}{} +\ccIncludeExampleCode{Optimisation_ref/example_Min_ellipse_2_noheader.C} % ----------------------------------------------------------------------------- diff --git a/Packages/Min_ellipse_2/doc_tex/basic/Optimisation/Optimisation_ref/Min_ellipse_2_traits_2.tex b/Packages/Min_ellipse_2/doc_tex/basic/Optimisation/Optimisation_ref/Min_ellipse_2_traits_2.tex index 86b2962d638..c77410d60d7 100644 --- a/Packages/Min_ellipse_2/doc_tex/basic/Optimisation/Optimisation_ref/Min_ellipse_2_traits_2.tex +++ b/Packages/Min_ellipse_2/doc_tex/basic/Optimisation/Optimisation_ref/Min_ellipse_2_traits_2.tex @@ -2,7 +2,7 @@ % ============================================================================= % The CGAL Reference Manual % Chapter: Geometric Optimisation -% Class : CGAL::Min_ellipse_2_traits_2 +% Class : CGAL::Min_ellipse_2_traits_2 % ----------------------------------------------------------------------------- % file : doc_tex/basic/Optimisation/..._ref/Min_ellipse_2_traits_2.tex % package: Min_ellipse_2 @@ -14,7 +14,7 @@ \ccAutoIndexingOff -\begin{ccRefClass}{Min_ellipse_2_traits_2} +\begin{ccRefClass}{Min_ellipse_2_traits_2} \ccIndexTraitsClassBegin{Min_ellipse_2_traits_2}{Min_ellipse_2}{} \ccAutoIndexingOn @@ -30,20 +30,20 @@ using the two-di\-men\-sional \cgal\ kernel. % ----------------------------------------------------------------------------- \ccRequirements -The template parameter \ccc{R} is a model for \ccc{Kernel}. +The template parameter \ccc{K} is a model for \ccc{Kernel}. % ----------------------------------------------------------------------------- \ccIsModel -\ccRefConceptPage{Min_ellipse_2_traits} +\ccRefConceptPage{MinEllipse2Traits} % ----------------------------------------------------------------------------- \ccTypes \ccSaveThreeColumns -\ccSetTwoColumns{Min_ellipse_2_traits_2:: Ellipse}{} +\ccSetTwoColumns{Min_ellipse_2_traits_2:: Ellipse}{} -\ccNestedType{Point }{typedef to \ccc{R::Point_2}.} +\ccNestedType{Point }{typedef to \ccc{K::Point_2}.} \ccNestedType{Ellipse}{internal type.} % ----------------------------------------------------------------------------- @@ -52,13 +52,13 @@ The template parameter \ccc{R} is a model for \ccc{Kernel}. \ccConstructor{ Min_ellipse_2_traits_2( );}{default constructor.} \ccConstructor{ Min_ellipse_2_traits_2( - const Min_ellipse_2_traits_2&);}{copy constructor.} + const Min_ellipse_2_traits_2&);}{copy constructor.} % ----------------------------------------------------------------------------- \ccSeeAlso \ccRefIdfierPage{CGAL::Min_ellipse_2}\\[1ex] -\ccRefConceptPage{Min_ellipse_2_traits} +\ccRefConceptPage{MinEllipse2Traits} % ----------------------------------------------------------------------------- diff --git a/Packages/Min_ellipse_2/doc_tex/basic/Optimisation/Optimisation_ref/main_Min_ellipse_2.tex b/Packages/Min_ellipse_2/doc_tex/basic/Optimisation/Optimisation_ref/main_Min_ellipse_2.tex index 09668130770..70e882da7aa 100644 --- a/Packages/Min_ellipse_2/doc_tex/basic/Optimisation/Optimisation_ref/main_Min_ellipse_2.tex +++ b/Packages/Min_ellipse_2/doc_tex/basic/Optimisation/Optimisation_ref/main_Min_ellipse_2.tex @@ -24,6 +24,6 @@ \inputOpt{Min_ellipse_2_traits_2} -\inputOpt{Min_ellipse_2_traits} +\inputOpt{MinEllipse2Traits} % ===== EOF =================================================================== diff --git a/Packages/Min_ellipse_2/examples/Min_ellipse_2/example_Min_ellipse_2.C b/Packages/Min_ellipse_2/examples/Min_ellipse_2/example_Min_ellipse_2.C index ebba2fe666a..a8cdbb48789 100644 --- a/Packages/Min_ellipse_2/examples/Min_ellipse_2/example_Min_ellipse_2.C +++ b/Packages/Min_ellipse_2/examples/Min_ellipse_2/example_Min_ellipse_2.C @@ -33,9 +33,9 @@ // typedefs typedef CGAL::Gmpz NT; -typedef CGAL::Homogeneous R; -typedef CGAL::Point_2 Point; -typedef CGAL::Min_ellipse_2_traits_2 Traits; +typedef CGAL::Homogeneous K; +typedef CGAL::Point_2 Point; +typedef CGAL::Min_ellipse_2_traits_2 Traits; typedef CGAL::Min_ellipse_2 Min_ellipse; // main diff --git a/Packages/Min_ellipse_2/web/Min_ellipse_2.aw b/Packages/Min_ellipse_2/web/Min_ellipse_2.aw index 86f554727ff..d84a5530de5 100644 --- a/Packages/Min_ellipse_2/web/Min_ellipse_2.aw +++ b/Packages/Min_ellipse_2/web/Min_ellipse_2.aw @@ -194,7 +194,7 @@ slow -- random shuffling gives these orders a very small probability. First, we declare the class template \ccc{Min_ellipse_2}. @macro = @begin - template < class _Traits > + template < class Traits_ > class Min_ellipse_2; @end @@ -206,7 +206,7 @@ case $\me(\emptyset,B)$, see Section~\ref{sec:algo}. The class interface looks as follows. @macro = @begin - template < class _Traits > + template < class Traits_ > class Min_ellipse_2 { public: @ @@ -216,8 +216,8 @@ The class interface looks as follows. @ // copying and assignment not allowed! - Min_ellipse_2( const Min_ellipse_2<_Traits>&); - Min_ellipse_2<_Traits>& operator = ( const Min_ellipse_2<_Traits>&); + Min_ellipse_2( const Min_ellipse_2&); + Min_ellipse_2& operator = ( const Min_ellipse_2&); @ @@ -273,9 +273,9 @@ section, so we do not comment on it here. @macro = @begin // types - typedef _Traits Traits; - typedef typename _Traits::Point Point; - typedef typename _Traits::Ellipse Ellipse; + typedef Traits_ Traits; + typedef typename Traits_::Point Point; + typedef typename Traits_::Ellipse Ellipse; typedef typename std::list::const_iterator Point_iterator; typedef const Point * Support_point_iterator; @@ -912,24 +912,24 @@ traits class object. \subsubsection{I/O} @macro = @begin - template < class _Traits > + template < class Traits_ > std::ostream& - operator << ( std::ostream& os, const Min_ellipse_2<_Traits>& me); + operator << ( std::ostream& os, const Min_ellipse_2& me); - template < class _Traits > + template < class Traits_ > std::istream& - operator >> ( std::istream& is, Min_ellipse_2<_Traits>& me); + operator >> ( std::istream& is, Min_ellipse_2& me); @end @macro = @begin - template < class _Traits > + template < class Traits_ > std::ostream& operator << ( std::ostream& os, - const Min_ellipse_2<_Traits>& min_ellipse) + const Min_ellipse_2& min_ellipse) { CGAL_USING_NAMESPACE_STD - typedef Min_ellipse_2<_Traits>::Point Point; + typedef Min_ellipse_2::Point Point; typedef ostream_iterator Os_it; switch ( CGAL::get_mode( os)) { @@ -971,9 +971,9 @@ traits class object. return( os); } - template < class _Traits > + template < class Traits_ > std::istream& - operator >> ( std::istream& is, CGAL::Min_ellipse_2<_Traits>& min_ellipse) + operator >> ( std::istream& is, CGAL::Min_ellipse_2& min_ellipse) { CGAL_USING_NAMESPACE_STD @@ -986,7 +986,7 @@ traits class object. case CGAL::IO::ASCII: case CGAL::IO::BINARY: - typedef Min_ellipse_2<_Traits>::Point Point; + typedef Min_ellipse_2::Point Point; typedef istream_iterator Is_it; min_ellipse.clear(); min_ellipse.insert( Is_it( is), Is_it()); @@ -1008,12 +1008,12 @@ traits class object. #ifndef CGAL_IO_WINDOW_STREAM_MIN_ELLIPSE_2 #define CGAL_IO_WINDOW_STREAM_MIN_ELLIPSE_2 - template< class R > + template< class Traits_ > CGAL::Window_stream& operator << ( CGAL::Window_stream &ws, - const CGAL::Min_ellipse_2& min_ellipse) + const CGAL::Min_ellipse_2& min_ellipse) { - typedef CGAL::Min_ellipse_2::Point_iterator Point_iterator; + typedef CGAL::Min_ellipse_2::Point_iterator Point_iterator; Point_iterator first( min_ellipse.points_begin()); Point_iterator last ( min_ellipse.points_end()); @@ -1112,30 +1112,30 @@ pseudo-code above. @end @! ---------------------------------------------------------------------------- -@! Class template Optimisation_ellipse_2 +@! Class template Optimisation_ellipse_2 @! ---------------------------------------------------------------------------- -\subsection{Class template \ccFont Optimisation\_ellipse\_2} +\subsection{Class template \ccFont Optimisation\_ellipse\_2} First, we declare the class template \ccc{Optimisation_ellipse_2}, @macro = @begin - template < class _R > + template < class K_ > class Optimisation_ellipse_2; @end The class interface looks as follows. @macro = @begin - template < class _R > + template < class K_ > class Optimisation_ellipse_2 { /* friend std::ostream& operator << CGAL_NULL_TMPL_ARGS ( - std::ostream&, const Optimisation_ellipse_2<_R>&); + std::ostream&, const Optimisation_ellipse_2&); friend std::istream& operator >> CGAL_NULL_TMPL_ARGS ( - std::istream&, Optimisation_ellipse_2<_R> &); + std::istream&, Optimisation_ellipse_2 &); friend CGAL::Window_stream& operator << CGAL_NULL_TMPL_ARGS ( - CGAL::Window_stream&, const Optimisation_ellipse_2<_R>&); + CGAL::Window_stream&, const Optimisation_ellipse_2&); */ public: @ @@ -1180,11 +1180,11 @@ section, so we do not comment on it here. @macro = @begin // types - typedef _R R; - typedef typename _R::RT RT; - typedef typename _R::FT FT; - typedef CGAL::Point_2 Point; - typedef CGAL::Conic_2 Conic; + typedef K_ K; + typedef typename K_::RT RT; + typedef typename K_::FT FT; + typedef CGAL::Point_2 Point; + typedef CGAL::Conic_2 Conic; /************************************************************************** WORKAROUND: Some compilers are unable to match member functions defined @@ -1207,8 +1207,8 @@ section, so we do not comment on it here. int number_of_boundary_points() // equality tests - bool operator == ( const Optimisation_ellipse_2& e) const; - bool operator != ( const Optimisation_ellipse_2& e) const; + bool operator == ( const Optimisation_ellipse_2& e) const; + bool operator != ( const Optimisation_ellipse_2& e) const; // predicates CGAL::Bounded_side bounded_side( const Point& p) const; @@ -1240,7 +1240,7 @@ points, if any, are stored directly in \ccc{boundary_point1} and @end Given three or five points, the ellipse is represented as a conic, -using the class \ccc{Conic_2}. The case with four boundary +using the class \ccc{Conic_2}. The case with four boundary points is the most complicated one, since in general a direct representation with one conic has irrational coordinates~\cite{gs-seefe-97a}. Therefore the ellipse is represented @@ -1360,7 +1360,7 @@ points as its boundary points. if ( n_boundary_points == 4) t = conic1.vol_minimum( dr, ds, dt, du, dv, dw); - Conic_2 c( conic1); + Conic_2 c( conic1); Conic_2< Cartesian > e; e.set( CGAL::to_double( c.r()) + t*CGAL::to_double( dr), CGAL::to_double( c.s()) + t*CGAL::to_double( ds), @@ -1378,7 +1378,7 @@ points as its boundary points. @macro = @begin bool - operator == ( const Optimisation_ellipse_2& e) const + operator == ( const Optimisation_ellipse_2& e) const { if ( n_boundary_points != e.n_boundary_points) return( false); @@ -1410,7 +1410,7 @@ points as its boundary points. inline bool - operator != ( const Optimisation_ellipse_2& e) const + operator != ( const Optimisation_ellipse_2& e) const { return( ! operator == ( e)); } @@ -1503,19 +1503,19 @@ one. \subsubsection{I/O} @macro = @begin - template < class _R > + template < class K_ > std::ostream& - operator << ( std::ostream&, const CGAL::Optimisation_ellipse_2<_R>&); + operator << ( std::ostream&, const CGAL::Optimisation_ellipse_2&); - template < class _R > + template < class K_ > std::istream& - operator >> ( std::istream&, CGAL::Optimisation_ellipse_2<_R>&); + operator >> ( std::istream&, CGAL::Optimisation_ellipse_2&); @end @macro = @begin - template < class _R > + template < class K_ > std::ostream& - operator << ( std::ostream& os, const CGAL::Optimisation_ellipse_2<_R>& e) + operator << ( std::ostream& os, const CGAL::Optimisation_ellipse_2& e) { const char* const empty = ""; const char* const pretty_head = "CGAL::Optimisation_ellipse_2( "; @@ -1567,9 +1567,9 @@ one. return( os); } - template < class _R > + template < class K_ > std::istream& - operator >> ( std::istream& is, CGAL::Optimisation_ellipse_2<_R>& e) + operator >> ( std::istream& is, CGAL::Optimisation_ellipse_2& e) { switch ( CGAL::get_mode( is)) { @@ -1618,10 +1618,10 @@ one. #ifndef CGAL_IO_WINDOW_STREAM_OPTIMISATION_ELLIPSE_2 #define CGAL_IO_WINDOW_STREAM_OPTIMISATION_ELLIPSE_2 - template< class R > + template< class Traits_ > CGAL::Window_stream& operator << ( CGAL::Window_stream &ws, - const CGAL::Optimisation_ellipse_2& oe) + const CGAL::Optimisation_ellipse_2& oe) { switch ( oe.n_boundary_points) { case 0: @@ -1653,19 +1653,19 @@ one. @! ---------------------------------------------------------------------------- -@! Class template Min_ellipse_2_traits_2 +@! Class template Min_ellipse_2_traits_2 @! ---------------------------------------------------------------------------- -\subsection{Class template \ccFont Min\_ellipse\_2\_traits\_2} +\subsection{Class template \ccFont Min\_ellipse\_2\_traits\_2} First, we declare the class templates \ccc{Min_ellipse_2} and \ccc{Min_ellipse_2_traits_2}. @macro = @begin - template < class _Traits > + template < class Traits_ > class Min_ellipse_2; - template < class _R > + template < class K_ > class Min_ellipse_2_traits_2; @end @@ -1678,25 +1678,25 @@ it. Since the algorithm needs to access and modify the current ellipse, it is declared \ccc{friend}. @macro = @begin - template < class _R > + template < class K_ > class Min_ellipse_2_traits_2 { public: // types - typedef _R R; - typedef CGAL::Point_2 Point; - typedef CGAL::Optimisation_ellipse_2 Ellipse; + typedef K_ K; + typedef CGAL::Point_2 Point; + typedef CGAL::Optimisation_ellipse_2 Ellipse; private: // data members Ellipse ellipse; // current ellipse // friends - friend class CGAL::Min_ellipse_2< CGAL::Min_ellipse_2_traits_2< R > >; + friend class CGAL::Min_ellipse_2< CGAL::Min_ellipse_2_traits_2 >; public: // creation (use default implementations) // Min_ellipse_2_traits_2( ); - // Min_ellipse_2_traits_2( Min_ellipse_2_traits_2 const&); + // Min_ellipse_2_traits_2( Min_ellipse_2_traits_2 const&); }; @end @@ -1711,13 +1711,13 @@ First, we declare the class templates \ccc{Min_ellipse_2}, \ccc{_Min_ellipse_2_adapterC2__Ellipse}. @macro = @begin - template < class _Traits > + template < class Traits_ > class Min_ellipse_2; - template < class _PT, class _DA > + template < class PT_, class DA_ > class Min_ellipse_2_adapterC2; - template < class _PT, class _DA > + template < class PT_, class DA_ > class _Min_ellipse_2_adapterC2__Ellipse; @end @@ -1731,12 +1731,12 @@ it. Since the algorithm needs to access and modify the current ellipse, it is declared \ccc{friend}. @macro = @begin - template < class _PT, class _DA > + template < class PT_, class DA_ > class Min_ellipse_2_adapterC2 { public: // types - typedef _PT PT; - typedef _DA DA; + typedef PT_ PT; + typedef DA_ DA; // nested types typedef PT Point; @@ -1772,7 +1772,7 @@ it is declared \ccc{friend}. CGAL::Orientation orientation( const Point& p, const Point& q, const Point& r) const { - typedef typename _DA::FT FT; + typedef typename DA_::FT FT; FT px; FT py; @@ -1794,23 +1794,23 @@ it is declared \ccc{friend}. \subsubsection{Nested Type \ccFont Ellipse} @macro = @begin - template < class _PT, class _DA > + template < class PT_, class DA_ > std::ostream& operator << ( std::ostream& os, - const _Min_ellipse_2_adapterC2__Ellipse<_PT,_DA>& c); + const _Min_ellipse_2_adapterC2__Ellipse& c); - template < class _PT, class _DA > + template < class PT_, class DA_ > std::istream& operator >> ( std::istream& is, - _Min_ellipse_2_adapterC2__Ellipse<_PT,_DA>& c); + _Min_ellipse_2_adapterC2__Ellipse& c); - template < class _PT, class _DA > + template < class PT_, class DA_ > class _Min_ellipse_2_adapterC2__Ellipse { public: // typedefs - typedef _PT PT; - typedef _DA DA; + typedef PT_ PT; + typedef DA_ DA; typedef ConicCPA2< PT, DA> CT; - typedef typename _DA::FT FT; + typedef typename DA_::FT FT; private: // data members @@ -1821,11 +1821,11 @@ it is declared \ccc{friend}. friend std::ostream& operator << CGAL_NULL_TMPL_ARGS ( std::ostream& os, - const _Min_ellipse_2_adapterC2__Ellipse<_PT,_DA>& c); + const _Min_ellipse_2_adapterC2__Ellipse& c); friend std::istream& operator >> CGAL_NULL_TMPL_ARGS ( std::istream& is, - _Min_ellipse_2_adapterC2__Ellipse<_PT,_DA>& c); + _Min_ellipse_2_adapterC2__Ellipse& c); public: // types @@ -1957,7 +1957,7 @@ it is declared \ccc{friend}. // additional operations for checking bool operator == ( - const CGAL::_Min_ellipse_2_adapterC2__Ellipse<_PT,_DA>& e) const + const CGAL::_Min_ellipse_2_adapterC2__Ellipse& e) const { if ( n_boundary_points != e.n_boundary_points) return( false); @@ -1989,17 +1989,17 @@ it is declared \ccc{friend}. bool operator != ( - const CGAL::_Min_ellipse_2_adapterC2__Ellipse<_PT,_DA>& e) const + const CGAL::_Min_ellipse_2_adapterC2__Ellipse& e) const { return( ! ( *this == e)); } }; // I/O - template < class _PT, class _DA > + template < class PT_, class DA_ > std::ostream& operator << ( std::ostream& os, - const CGAL::_Min_ellipse_2_adapterC2__Ellipse<_PT,_DA>& e) + const CGAL::_Min_ellipse_2_adapterC2__Ellipse& e) { const char* const empty = ""; const char* const pretty_head = @@ -2052,10 +2052,10 @@ it is declared \ccc{friend}. return( os); } - template < class _PT, class _DA > + template < class PT_, class DA_ > std::istream& operator >> ( std::istream& is, - CGAL::_Min_ellipse_2_adapterC2__Ellipse<_PT,_DA>& e) + CGAL::_Min_ellipse_2_adapterC2__Ellipse& e) { switch ( CGAL::get_mode( is)) { @@ -2107,13 +2107,13 @@ First, we declare the class templates \ccc{Min_ellipse_2}, \ccc{_Min_ellipse_2_adapterH2__Ellipse}. @macro = @begin - template < class _Traits > + template < class Traits_ > class Min_ellipse_2; - template < class _PT, class _DA > + template < class PT_, class DA_ > class Min_ellipse_2_adapterH2; - template < class _PT, class _DA > + template < class PT_, class DA_ > class _Min_ellipse_2_adapterH2__Ellipse; @end @@ -2127,12 +2127,12 @@ it. Since the algorithm needs to access and modify the current ellipse, it is declared \ccc{friend}. @macro = @begin - template < class _PT, class _DA > + template < class PT_, class DA_ > class Min_ellipse_2_adapterH2 { public: // types - typedef _PT PT; - typedef _DA DA; + typedef PT_ PT; + typedef DA_ DA; // nested types typedef PT Point; @@ -2168,7 +2168,7 @@ it is declared \ccc{friend}. CGAL::Orientation orientation( const Point& p, const Point& q, const Point& r) const { - typedef typename _DA::RT RT; + typedef typename DA_::RT RT; RT phx; RT phy; @@ -2194,25 +2194,25 @@ it is declared \ccc{friend}. \subsubsection{Nested Type \ccFont Ellipse} @macro = @begin - template < class _PT, class _DA > + template < class PT_, class DA_ > std::ostream& operator << ( std::ostream&, - const CGAL::_Min_ellipse_2_adapterH2__Ellipse<_PT,_DA>&); + const CGAL::_Min_ellipse_2_adapterH2__Ellipse&); - template < class _PT, class _DA > + template < class PT_, class DA_ > std::istream& operator >> ( std::istream&, - CGAL::_Min_ellipse_2_adapterH2__Ellipse<_PT,_DA>&); + CGAL::_Min_ellipse_2_adapterH2__Ellipse&); - template < class _PT, class _DA > + template < class PT_, class DA_ > class _Min_ellipse_2_adapterH2__Ellipse { public: // typedefs - typedef _PT PT; - typedef _DA DA; + typedef PT_ PT; + typedef DA_ DA; typedef CGAL::ConicHPA2< PT, DA> CT; - typedef typename _DA::RT RT; + typedef typename DA_::RT RT; private: // data members @@ -2222,10 +2222,10 @@ it is declared \ccc{friend}. RT dr, ds, dt, du, dv, dw; // the gradient vector friend std::ostream& operator << CGAL_NULL_TMPL_ARGS ( std::ostream&, - const _Min_ellipse_2_adapterH2__Ellipse<_PT,_DA>&); + const _Min_ellipse_2_adapterH2__Ellipse&); friend std::istream& operator >> CGAL_NULL_TMPL_ARGS ( std::istream&, - _Min_ellipse_2_adapterH2__Ellipse<_PT,_DA>&); + _Min_ellipse_2_adapterH2__Ellipse&); public: // types @@ -2357,7 +2357,7 @@ it is declared \ccc{friend}. // additional operations for checking bool operator == ( - const CGAL::_Min_ellipse_2_adapterH2__Ellipse<_PT,_DA>& e) const + const CGAL::_Min_ellipse_2_adapterH2__Ellipse& e) const { if ( n_boundary_points != e.n_boundary_points) return( false); @@ -2389,17 +2389,17 @@ it is declared \ccc{friend}. bool operator != ( - const CGAL::_Min_ellipse_2_adapterH2__Ellipse<_PT,_DA>& e) const + const CGAL::_Min_ellipse_2_adapterH2__Ellipse& e) const { return( ! ( *this == e)); } }; // I/O - template < class _PT, class _DA > + template < class PT_, class DA_ > std::ostream& operator << ( std::ostream& os, - const CGAL::_Min_ellipse_2_adapterH2__Ellipse<_PT,_DA>& e) + const CGAL::_Min_ellipse_2_adapterH2__Ellipse& e) { const char* const empty = ""; const char* const pretty_head = @@ -2452,10 +2452,10 @@ it is declared \ccc{friend}. return( os); } - template < class _PT, class _DA > + template < class PT_, class DA_ > std::istream& operator >> ( std::istream& is, - CGAL::_Min_ellipse_2_adapterH2__Ellipse<_PT,_DA>& e) + CGAL::_Min_ellipse_2_adapterH2__Ellipse& e) { switch ( CGAL::get_mode( is)) { @@ -2531,10 +2531,10 @@ number type \ccc{Gmpz} or \ccc{integer}. typedef CGAL::Quotient< CGAL::Gmpz > Ft; #endif - typedef CGAL::Cartesian< Ft > RepC; - typedef CGAL::Homogeneous< Rt > RepH; - typedef CGAL::Min_ellipse_2_traits_2< RepC > TraitsC; - typedef CGAL::Min_ellipse_2_traits_2< RepH > TraitsH; + typedef CGAL::Cartesian< Ft > KerC; + typedef CGAL::Homogeneous< Rt > KerH; + typedef CGAL::Min_ellipse_2_traits_2< KerC > TraitsC; + typedef CGAL::Min_ellipse_2_traits_2< KerH > TraitsH; @end The command line option \ccc{-verbose} enables verbose output. @@ -2810,25 +2810,25 @@ representation) and corresponding data accessors. public: typedef ::Ft FT; private: - FT _x; - FT _y; + FT x_; + FT y_; public: MyPointC2( ) { } - MyPointC2( const FT& x, const FT& y) : _x( x), _y( y) { } + MyPointC2( const FT& x, const FT& y) : x_( x), y_( y) { } - const FT& x( ) const { return( _x); } - const FT& y( ) const { return( _y); } + const FT& x( ) const { return( x_); } + const FT& y( ) const { return( y_); } bool operator == ( const MyPointC2& p) const { - return( ( _x == p._x) && ( _y == p._y)); + return( ( x_ == p.x_) && ( y_ == p.y_)); } bool operator != ( const MyPointC2& p) const { - return( ( _x != p._x) || ( _y != p._y)); + return( ( x_ != p.x_) || ( y_ != p.y_)); } friend @@ -2841,13 +2841,13 @@ representation) and corresponding data accessors. std::ostream& operator << ( std::ostream& os, const MyPointC2& p) { - return( os << p._x << ' ' << p._y); + return( os << p.x_ << ' ' << p.y_); } std::istream& operator >> ( std::istream& is, MyPointC2& p) { - return( is >> p._x >> p._y); + return( is >> p.x_ >> p.y_); } // 2D Cartesian point class data accessor @@ -2855,6 +2855,8 @@ representation) and corresponding data accessors. public: typedef ::Ft FT; + MyPointC2DA( ) { } + const FT& get_x( const MyPointC2& p) const { return( p.x()); } const FT& get_y( const MyPointC2& p) const { return( p.y()); } @@ -2883,28 +2885,28 @@ representation) and corresponding data accessors. public: typedef ::Rt RT; private: - RT _hx; - RT _hy; - RT _hw; + RT hx_; + RT hy_; + RT hw_; public: MyPointH2( ) { } MyPointH2( const RT& hx, const RT& hy, const RT& hw = RT( 1)) - : _hx( hx), _hy( hy), _hw( hw) { } + : hx_( hx), hy_( hy), hw_( hw) { } - const RT& hx( ) const { return( _hx); } - const RT& hy( ) const { return( _hy); } - const RT& hw( ) const { return( _hw); } + const RT& hx( ) const { return( hx_); } + const RT& hy( ) const { return( hy_); } + const RT& hw( ) const { return( hw_); } bool operator == ( const MyPointH2& p) const { - return( ( _hx*p._hw == p._hx*_hw) && ( _hy*p._hw == p._hy*_hw)); + return( ( hx_*p.hw_ == p.hx_*hw_) && ( hy_*p.hw_ == p.hy_*hw_)); } bool operator != ( const MyPointH2& p) const { - return( ( _hx*p._hw != p._hx*_hw) || ( _hy*p._hw != p._hy*_hw)); + return( ( hx_*p.hw_ != p.hx_*hw_) || ( hy_*p.hw_ != p.hy_*hw_)); } friend @@ -2917,13 +2919,13 @@ representation) and corresponding data accessors. std::ostream& operator << ( std::ostream& os, const MyPointH2& p) { - return( os << p._hx << ' ' << p._hy << ' ' << p._hw); + return( os << p.hx_ << ' ' << p.hy_ << ' ' << p.hw_); } std::istream& operator >> ( std::istream& is, MyPointH2& p) { - return( is >> p._hx >> p._hy >> p._hw); + return( is >> p.hx_ >> p.hy_ >> p.hw_); } // 2D homogeneous point class data accessor @@ -2931,6 +2933,8 @@ representation) and corresponding data accessors. public: typedef ::Rt RT; + MyPointH2DA( ) { } + const RT& get_hx( const MyPointH2& p) const { return( p.hx()); } const RT& get_hy( const MyPointH2& p) const { return( p.hy()); } const RT& get_hw( const MyPointH2& p) const { return( p.hw()); }