00001 #ifndef RING_IMPLEMENTATION_FILE
00002 #define RING_IMPLEMENTATION_FILE
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
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