usage of new-style headers and namespace `std'.

namespace `CGAL' introduced.
This commit is contained in:
Sven Schönherr 1999-02-25 17:01:48 +00:00
parent e7aaeb3be7
commit c6b8e03ed5
4 changed files with 47 additions and 38 deletions

View File

@ -1,6 +1,6 @@
// ============================================================================
//
// Copyright (c) 1997,1998 The CGAL Consortium
// Copyright (c) 1997,1998,1999 The CGAL Consortium
//
// This software and related documentation is part of an INTERNAL release
// of the Computational Geometry Algorithms Library (CGAL). It is not
@ -33,18 +33,19 @@
// !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// includes
#include <CGAL/Cartesian.h>
#include <CGAL/Homogeneous.h>
#include <CGAL/Point_2.h>
#include <CGAL/Min_circle_2.h>
#include <CGAL/Min_circle_2_traits_2.h>
#include <CGAL/IO/Window_stream.h>
using namespace CGAL;
// typedefs
typedef CGAL_Homogeneous< double > Rep;
typedef CGAL_Point_2< Rep > Point;
typedef CGAL_Min_circle_2_traits_2< Rep > Traits;
typedef CGAL_Min_circle_2< Traits > Min_circle;
typedef Homogeneous< double > R;
typedef Point_2< R > Point;
typedef Min_circle_2_traits_2< R > Traits;
typedef Min_circle_2< Traits > Min_circle;
// main
int
@ -58,7 +59,7 @@ main( int, char**)
Min_circle mc;
// open window
CGAL_Window_stream ws( "CGAL Demo: Smallest Enclosing Circle in 2D");
Window_stream ws( "CGAL Demo: Smallest Enclosing Circle in 2D");
ws.set_icon_label("CGAL");
ws.set_icon_pixrect( ws.create_pixrect( esprit_logo));
ws.set_node_width( 5);
@ -75,11 +76,11 @@ main( int, char**)
switch ( button) {
case MOUSE_BUTTON( 1): // left button
ws << CGAL_WHITE << mc.circle();
ws << WHITE << mc.circle();
mc.insert( ::Point( x, y));
ws << CGAL_BLACK << mc;
ws << CGAL_BLUE << mc.circle();
ws << CGAL_RED;
ws << BLACK << mc;
ws << BLUE << mc.circle();
ws << RED;
for ( i = 0; i < mc.number_of_support_points(); ++i)
ws << mc.support_point( i);
break;

View File

@ -1,6 +1,6 @@
// ============================================================================
//
// Copyright (c) 1997,1998 The CGAL Consortium
// Copyright (c) 1997,1998,1999 The CGAL Consortium
//
// This software and related documentation is part of an INTERNAL release
// of the Computational Geometry Algorithms Library (CGAL). It is not
@ -26,19 +26,22 @@
// ============================================================================
// includes
#include <CGAL/Gmpz.h>
#include <CGAL/Homogeneous.h>
#include <CGAL/Point_2.h>
#include <CGAL/Min_circle_2.h>
#include <CGAL/Min_circle_2_traits_2.h>
#include <iostream.h>
#include <CGAL/Gmpz.h>
#include <iostream>
using namespace CGAL;
using std::cout;
// typedefs
typedef CGAL_Gmpz NT;
typedef CGAL_Homogeneous<NT> R;
typedef CGAL_Point_2<R> Point;
typedef CGAL_Min_circle_2_traits_2<R> Traits;
typedef CGAL_Min_circle_2<Traits> Min_circle;
typedef Gmpz NT;
typedef Homogeneous<NT> R;
typedef Point_2<R> Point;
typedef Min_circle_2_traits_2<R> Traits;
typedef Min_circle_2<Traits> Min_circle;
// main
int
@ -54,7 +57,7 @@ main( int, char**)
Min_circle mc1( P, P+n); // very slow
Min_circle mc2( P, P+n, true); // fast
CGAL_set_pretty_mode( cout);
set_pretty_mode( cout);
cout << mc2;
delete[] P;

View File

@ -1,6 +1,6 @@
// ============================================================================
//
// Copyright (c) 1997,1998 The CGAL Consortium
// Copyright (c) 1997,1998,1999 The CGAL Consortium
//
// This software and related documentation is part of an INTERNAL release
// of the Computational Geometry Algorithms Library (CGAL). It is not
@ -39,11 +39,13 @@
#include <CGAL/Min_ellipse_2_traits_2.h>
#include <CGAL/IO/Window_stream.h>
using namespace CGAL;
// typedefs
typedef CGAL_Cartesian< double > Rep;
typedef CGAL_Point_2< Rep > Point;
typedef CGAL_Min_ellipse_2_traits_2< Rep > Traits;
typedef CGAL_Min_ellipse_2< Traits > Min_ellipse;
typedef Cartesian< double > R;
typedef Point_2< R > Point;
typedef Min_ellipse_2_traits_2< R > Traits;
typedef Min_ellipse_2< Traits > Min_ellipse;
// main
int
@ -57,7 +59,7 @@ main( int, char**)
Min_ellipse me;
// open window
CGAL_Window_stream ws( "CGAL Demo: Smallest Enclosing Ellipse in 2D");
Window_stream ws( "CGAL Demo: Smallest Enclosing Ellipse in 2D");
ws.set_icon_label("CGAL");
ws.set_icon_pixrect( ws.create_pixrect( esprit_logo));
ws.set_node_width( 5);
@ -74,11 +76,11 @@ main( int, char**)
switch ( button) {
case MOUSE_BUTTON( 1): // left button
ws << CGAL_WHITE << me.ellipse();
ws << WHITE << me.ellipse();
me.insert( ::Point( x, y));
ws << CGAL_BLACK << me;
ws << CGAL_BLUE << me.ellipse();
ws << CGAL_RED;
ws << BLACK << me;
ws << BLUE << me.ellipse();
ws << RED;
for ( i = 0; i < me.number_of_support_points(); ++i)
ws << me.support_point( i);
break;

View File

@ -1,6 +1,6 @@
// ============================================================================
//
// Copyright (c) 1997,1998 The CGAL Consortium
// Copyright (c) 1997,1998,1999 The CGAL Consortium
//
// This software and related documentation is part of an INTERNAL release
// of the Computational Geometry Algorithms Library (CGAL). It is not
@ -26,18 +26,21 @@
// ============================================================================
// includes
#include <CGAL/Gmpz.h>
#include <CGAL/Homogeneous.h>
#include <CGAL/Point_2.h>
#include <CGAL/Min_ellipse_2.h>
#include <CGAL/Min_ellipse_2_traits_2.h>
#include <CGAL/Gmpz.h>
using namespace CGAL;
using std::cout;
// typedefs
typedef CGAL_Gmpz NT;
typedef CGAL_Homogeneous<NT> R;
typedef CGAL_Point_2<R> Point;
typedef CGAL_Min_ellipse_2_traits_2<R> Traits;
typedef CGAL_Min_ellipse_2<Traits> Min_ellipse;
typedef Gmpz NT;
typedef Homogeneous<NT> R;
typedef Point_2<R> Point;
typedef Min_ellipse_2_traits_2<R> Traits;
typedef Min_ellipse_2<Traits> Min_ellipse;
// main
int
@ -53,7 +56,7 @@ main( int, char**)
Min_ellipse me1( P, P+n); // very slow
Min_ellipse me2( P, P+n, true); // fast
CGAL_set_pretty_mode( cout);
set_pretty_mode( cout);
cout << me2;
delete[] P;