sources:
attribute.cpp (1.1k)
attribute.h (1.5k)
cgapplication.cpp (4.1k)
cgapplication.h (4.8k)
cgrobot.cpp (7.9k)
cgrobot.h (716 bytes)
node.cpp (2.4k)
node.h (2.3k)
shape.cpp (3.2k)
shape.h (966 bytes)
transformation.cpp (2.9k)
transformation.h (2.4k)
vector.cpp (1.4k)
vector.h (5.3k)


website:
more info here


screenshot:
studies/grafik/Computergrafik-Code8/attribute.h
download file

  1 // Computergraphik I
  2 // Prof. Dr. Juergen Doellner
  3 // Sommersemester 2001
  4 //
  5 // Rahmenprogramm fuer Aufgabenzettel 8
  6
  7 #ifndef ATTRIBUTE_H
  8 #define ATTRIBUTE_H
  9
 10 #include "vector.h"
 11
 12 //
 13 // Attribute
 14 //
 15
 16 class Attribute {
 17 public:
 18     // set() wird aufgerufen, wenn das Attribute gesetzt wird.
 19     // Man muss dafuer sorgen, dass man den aktuellen
 20     // Zustand zwischenspeichert, damit man diesen wieder her-
 21     // stellen kann, wenn mit unset() dieses Attribute wieder
 22     // "zurueckgenommen" wird.
 23     virtual void set() = 0;
 24     virtual void unset() = 0;
 25 };
 26
 27 //
 28 // Color
 29 //
 30
 31 class Color : public Attribute {
 32 public:
 33     Color(double red = 0, double green = 0, double blue = 0);
 34     // Setzt die Farbe auf (red, green, blue)
 35
 36     virtual void set();
 37     virtual void unset();
 38
 39 private:
 40     double color_[3];
 41 };
 42
 43 //
 44 // Style
 45 //
 46
 47 class Style : public Attribute {
 48 public:
 49     enum FaceStyle { Filled, Outlined, Points };
 50     Style(FaceStyle frontFace = Filled, FaceStyle backFace = Filled);
 51     // Setzt den Stiel, mit dem die Polygone gezeichnet werden:
 52     // Filled: das Polygon wird ausgefuellt dargestellt
 53     // Outlined: das Polygon wird umrandet dargestellt
 54     // Points: es werden nur die Polygon-Eckpunkte dargestellt
 55     // Man kann dieses fuer die Vorder- und Rueckseiten getrennt
 56     // einstellen (siehe hierzu auch GL_CW und GL_CCW).
 57
 58     virtual void set();
 59     virtual void unset();
 60
 61 private:
 62     FaceStyle frontFace_;
 63     FaceStyle backFace_;
 64 };
 65
 66 #endif // ATTRIBUTE_H
 67
 68