ring.cpp

Go to the documentation of this file.
00001 #ifndef RING_IMPLEMENTATION_FILE
00002 #define RING_IMPLEMENTATION_FILE
00003 
00004 /*****************************************************************************\
00005 *                                                                             *
00006 *  Name   : ring                                                              *
00007 *  Author : Chris Koeritz                                                     *
00008 *                                                                             *
00009 *******************************************************************************
00010 * Copyright (c) 1991-$now By Author.  This program is free software; you can  *
00011 * redistribute it and/or modify it under the terms of the GNU General Public  *
00012 * License as published by the Free Software Foundation; either version 2 of   *
00013 * the License or (at your option) any later version.  This is online at:      *
00014 *     http://www.fsf.org/copyleft/gpl.html                                    *
00015 * Please send any updates to: fred@gruntose.com                               *
00016 \*****************************************************************************/
00017 
00018 #include "ring.h"
00019 #include "wp_implementation.h"
00020 
00021 #include <basis/function.h>
00022 
00023 using namespace geometric;
00024 
00025 ring::ring(canvas &draw_on, const circle &where, const color &f, bool attach)
00026 : circle(where), paintable(draw_on, where.center(), f, attach) {}
00027 
00028 c_rectangle ring::dimensions() const { return circle::dimensions(); }
00029 
00030 void ring::plot(const color &plot_in)
00031 {
00032 #ifdef __XWINDOWS__
00033   color to_plot_in = plot_in;
00034   if (to_plot_in.index() < 0) target().colormap().add(to_plot_in);
00035   XSetForeground(target().display(), target().details()._gc,
00036       to_plot_in.index());
00037   c_rectangle dim(target().world_to_device(dimensions()));
00038   if (filled()) XFillArc
00039     (target().display(), target().window(), target().details()._gc,
00040      int(dim.vertex_1().x()), int(dim.vertex_1().y()), int(dim.width()),
00041      int(dim.height()), 0, 64 * 360);
00042   else XDrawArc
00043     (target().display(), target().window(), target().details()._gc,
00044      int(dim.vertex_1().x()), int(dim.vertex_1().y()), int(dim.width()),
00045      int(dim.height()), 0, 64 * 360);
00046 #elif defined(MS_WINDOWS)
00047 #elif defined(OS_2)
00048 #endif
00049 }
00050 
00051 circle ring::base() const { return *this; }
00052 
00053 void ring::base(const circle &where) { *(circle *)this = where; }
00054 
00055 #endif //RING_IMPLEMENTATION_FILE
00056 

Generated on Fri Nov 21 04:29:36 2008 for HOOPLE Libraries by  doxygen 1.5.1