sources:


website:
more info here


screenshot:
studies/grafik/Computergrafik-Code4/Aufgabe9/cgellipse.h
download file

  1 // Computergraphik I
  2 // Prof. Dr. Juergen Doellner
  3 // Sommersemester 2001
  4 //
  5 // Rahmenprogramm fuer Aufgabenzettel 4
  6
  7 // Stephan Brumme, 702544
  8 // last changes: May 19, 2001
  9
 10 #ifndef CG_BRESENHAM_H
 11 #define CG_BRESENHAM_H
 12
 13 #include "cgapplication.h"
 14 #include "cgraster.h"
 15
 16 class CGEllipse : public CGApplication {
 17 public:
 18     CGEllipse(int width, int height);
 19
 20     virtual void onInit();
 21     virtual void onDraw();
 22     virtual void onSize(unsigned int newWidth,unsigned  int newHeight);
 23
 24     virtual void onButton(MouseButton button, MouseButtonEvent event, int x, int y);
 25     virtual void onMove(MouseButton button, int x, int y);
 26
 27 private:
 28     // zeichenen der Ellipse in das Raster raster_
 29     void drawEllipse(int x1, int y1, int x2, int y2);
 30     void drawEllipsePoints(int midx, int midy, int x, int y);
 31
 32     // interne Raster-Klasse
 33     CGRaster raster_;
 34
 35     // Fenstergroesse speichern
 36     int winWidth_;
 37     int winHeight_;
 38
 39     // linke untere und rechte obere Ecke des Rechteckes, das die Ellipse beschreibt
 40     int xBegin_;
 41     int yBegin_;
 42     int xEnd_;
 43     int yEnd_;
 44     bool First_;
 45 };
 46
 47 #endif // CG_BRESENHAM_H
 48
 49