From e95daa4db60f039d643c516f0967eebd360f5c3a Mon Sep 17 00:00:00 2001 From: Geert-Jan Giezeman Date: Tue, 2 Jul 2002 07:21:17 +0000 Subject: [PATCH] *** empty log message *** --- Packages/Polygon/changes.txt | 3 + .../include/CGAL/IO/polygon_Window_stream.h | 64 +++++++++++++++++-- Packages/Polygon/version | 2 +- 3 files changed, 61 insertions(+), 8 deletions(-) diff --git a/Packages/Polygon/changes.txt b/Packages/Polygon/changes.txt index d9013e32c48..f38e1247d1c 100644 --- a/Packages/Polygon/changes.txt +++ b/Packages/Polygon/changes.txt @@ -1,3 +1,6 @@ +4.9 (2 July 2002) ++ Added fill color support for window + 4.8.1 (11 April 2002) + Corrected typo in Traits name in Edge_const_iterator diff --git a/Packages/Polygon/include/CGAL/IO/polygon_Window_stream.h b/Packages/Polygon/include/CGAL/IO/polygon_Window_stream.h index 658fe2fa7db..c0b20c34b45 100644 --- a/Packages/Polygon/include/CGAL/IO/polygon_Window_stream.h +++ b/Packages/Polygon/include/CGAL/IO/polygon_Window_stream.h @@ -1,4 +1,4 @@ -// ============================================================================ +// ====================================================================== // // Copyright (c) 1997 The CGAL Consortium // @@ -8,14 +8,12 @@ // // ---------------------------------------------------------------------------- // -// release : $CGAL_Revision: CGAL-0.9-I-06 $ -// release_date : $CGAL_Date: 1998/03/11 $ +// release : +// release_date : // // file : include/CGAL/IO/polygon_Window_stream.h // source : -// revision : 1.8a -// revision_date : 13 Mar 1998 -// author(s) : Wieger Wesselink +// author(s) : Wieger Wesselink, Geert-Jan Giezeman, Matthias Baesken // // coordinator : Utrecht University // ============================================================================ @@ -29,6 +27,12 @@ #ifndef CGAL_WINDOW_STREAM_POLYGON_2_H #define CGAL_WINDOW_STREAM_POLYGON_2_H + +#if defined(CGAL_USE_CGAL_WINDOW) +#include +#endif + + CGAL_BEGIN_NAMESPACE template @@ -37,7 +41,52 @@ operator<<(Window_stream& ws, const Polygon_2 &polygon) { typedef typename Polygon_2::Edge_const_circulator EI; + typedef typename Traits::Point_2 Point_2; + EI e = polygon.edges_circulator(); + +#if defined(CGAL_USE_CGAL_WINDOW) + CGAL::color cl = ws.get_fill_color(); + + if (cl != CGAL::invisible) { + std::list LP; + + if (e != NULL) { + EI end = e; + do { + Point_2 p = (*e).source(); + double x = CGAL::to_double(p.x()); + double y = CGAL::to_double(p.y()); + + LP.push_back(CGAL::window_point(x,y)); + ++e; + } while (e != end); + } + + ws.draw_filled_polygon(LP,cl); + } +#else + leda_color cl = ws.get_fill_color(); + + if (cl != leda_invisible) { // draw filled polygon ... + leda_list LP; + + if (e != NULL) { + EI end = e; + do { + Point_2 p = (*e).source(); + double x = CGAL::to_double(p.x()); + double y = CGAL::to_double(p.y()); + + LP.append(leda_point(x,y)); + ++e; + } while (e != end); + } + + ws.draw_filled_polygon(LP,cl); + } +#endif + else { if (e != NULL) { EI end = e; do { @@ -46,6 +95,8 @@ operator<<(Window_stream& ws, ++e; } while (e != end); } + } + return ws; } @@ -53,4 +104,3 @@ CGAL_END_NAMESPACE #endif // CGAL_WINDOW_STREAM_POLYGON_2_H #endif // CGAL_POLYGON_2_H - diff --git a/Packages/Polygon/version b/Packages/Polygon/version index 53a6791576c..073ff38e54a 100644 --- a/Packages/Polygon/version +++ b/Packages/Polygon/version @@ -1 +1 @@ -4.8.1 (11 Apr 2002) +4.9 ( 2 Jul 2002)