2D Geom Bibliothek
Öffentliche Methoden | Aufstellung aller Elemente
MyPolygon Klassenreferenz

#include <MyPolygon.h>

Klassendiagramm für MyPolygon:
Shape Transformable Area Drawable Drawable Triangle

Öffentliche Methoden

 MyPolygon (const Point &a, const Point &b, const Point &c)
 
 MyPolygon (const Point *a, const Point *b, const Point *c)
 
 ~MyPolygon ()
 
virtual void addPoint (const Point &p, int pos=0)
 
virtual void delPoint (const Point &p)
 
bool contains (const Point &p)
 
PointgetPoint (int pos)
 
Pointoperator[] (int pos)
 
int size ()
 
virtual void move (double dx, double dy)
 
virtual void reflect (const Point *p)
 
virtual void reflect (const Line *e)
 
virtual void rotate (const Point *p, double degree)
 
virtual double getArea ()
 
virtual double getPerimeter ()
 
virtual bool isInside (const Point *e)
 
virtual void draw ()
 
- Öffentliche Methoden geerbt von Drawable
 Drawable ()
 
void setColor (float red, float green, float blue)
 
const float * getColor () const
 

Weitere Geerbte Elemente

- Geschützte Methoden geerbt von Drawable
virtual void setupColor ()
 

Ausführliche Beschreibung

Diese Klasse verwirklicht ein Polygon

Beschreibung der Konstruktoren und Destruktoren

MyPolygon::MyPolygon ( const Point a,
const Point b,
const Point c 
)

Iniziert die Polygon durch 3 Punkten ( a , b , c ) (Referenzen)
mehrere Punkten kann man mit addPoint() hinzufügen

MyPolygon::MyPolygon ( const Point a,
const Point b,
const Point c 
)

Iniziert die Polygon durch 3 Punkten ( a , b , c ) (Zeiger)
mehrere Punkten kann man mit addPoint() hinzufügen

MyPolygon::~MyPolygon ( )

Entfernt alle Punkte der Polygons

Dokumentation der Elementfunktionen

void MyPolygon::addPoint ( const Point p,
int  pos = 0 
)
virtual

Fügt p Punkt zu dem Polygon hinzu
pos : nach welchem Punkt wird es hinzufügt
ACHTUNG: Falls pos größer ist als der Anzahl der Punkten, dann wird es nicht hinzufügt!

bool MyPolygon::contains ( const Point p)

Entscheidet ob ein Punkt ist in der Liste

void MyPolygon::delPoint ( const Point p)
virtual

Entfern p Punkt von dem Polygon
Falls es ist nicht in die Liste, dann wird nichts passieren

void MyPolygon::draw ( )
virtual

Zeichnet die Komponent auf einer openGL Fläche zeichnen

Implementiert Drawable.

double MyPolygon::getArea ( )
virtual

Gibt die Flächeninhalt zurück

Implementiert Area.

double MyPolygon::getPerimeter ( )
virtual

Gibt die Umfang zurück

Implementiert Area.

Point & MyPolygon::getPoint ( int  pos)

Gibt die Referenz zu dem pos -sten Punkt zurück

bool MyPolygon::isInside ( const Point p)
virtual

Gibt zurück, ob die Punkt p ist innerhalb der Komponent

Implementiert Area.

void MyPolygon::move ( double  dx,
double  dy 
)
virtual

Verschiebt die Komponent mit dx und dy

Implementiert Transformable.

Point & MyPolygon::operator[] ( int  pos)

Gibt die Referenz zu dem pos -sten Punkt zurück

void MyPolygon::reflect ( const Point p)
virtual

Spiegelt die Komponent auf den p Punkt

Implementiert Transformable.

void MyPolygon::reflect ( const Line e)
virtual

Spiegelt die Komponent auf die Gerade e

Implementiert Transformable.

void MyPolygon::rotate ( const Point p,
double  degree 
)
virtual

Rotiert die Komponent um p Punkt mit degree Grad

Implementiert Transformable.

int MyPolygon::size ( )
inline

Gibt die Anzahl der Punkten zurück


Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Dateien: