summaryrefslogtreecommitdiffstats
path: root/Trapezocube.h
diff options
context:
space:
mode:
authorConstantin Riß <constantin.riss@dre.de>2009-12-03 22:15:45 +0100
committerConstantin Riß <constantin.riss@dre.de>2009-12-03 22:15:45 +0100
commitbfa11fa56f513f68cfd9ec1da1443c5cf624c4dc (patch)
tree7e1e8963f255df7d92a0c4389ae98e006714ddb5 /Trapezocube.h
parent9581542002a57f72afcbaebfe1ae6fc3b4021400 (diff)
downloadc3d-bfa11fa56f513f68cfd9ec1da1443c5cf624c4dc.tar
c3d-bfa11fa56f513f68cfd9ec1da1443c5cf624c4dc.zip
Dateien zu adden wurde nachgeholt.
Diffstat (limited to 'Trapezocube.h')
-rw-r--r--Trapezocube.h55
1 files changed, 55 insertions, 0 deletions
diff --git a/Trapezocube.h b/Trapezocube.h
new file mode 100644
index 0000000..b2cdd9a
--- /dev/null
+++ b/Trapezocube.h
@@ -0,0 +1,55 @@
+#ifndef _TRAPEZOCUBE_H_
+#define _TRAPEZOCUBE_H_
+
+#include "gl.h"
+#include "Color.h"
+#include "Triangle.h"
+#include <list>
+
+class Trapezocube
+{
+ public:
+ Trapezocube(): widthfront(0), widthback(0), height(0), depth(0), x(0), y(0), z(0) {}
+ Trapezocube(float widthfront, float widthback, float height, float depth): x(0), y(0), z(0){
+ setSize(widthfront, widthback, height, depth);
+ }
+ Trapezocube(float widthfront, float widthback, float height, float depth, float x, float y, float z): rotate(0) {
+ setSize(widthfront, widthback, height, depth);
+ setPos(x, y, z);
+ }
+ Trapezocube(float widthfront, float widthback, float height, float depth, float x, float y, float z, float rotate) {
+ setSize(widthfront, widthback, height, depth);
+ setPos(x, y, z);
+ setRotate(rotate);
+ }
+ float getHeight() {return height;}
+ float getWidthFront() {return widthfront;}
+ float getWidthBack() {return widthback;}
+ float getDepth() {return depth;}
+ float getPosX() {return x;}
+ float getPosY() {return y;}
+ float getPosZ() {return z;}
+ float getRotate() {return rotate;}
+ void setSize(float wf, float wb, float h, float d)
+ {
+ widthfront = wf;
+ widthback = wb;
+ height = h;
+ depth = d;
+ }
+ void setPos(float x, float y, float z)
+ {
+ this->x = x;
+ this->y = y;
+ this->z = z;
+ }
+ void setRotate(float r) {rotate = r;}
+ void setColor(Color col) {color = col;}
+ std::list<Triangle> getTriangles(const Matrix &modelview);
+
+ private:
+ float x, y, z, widthfront, widthback, height, depth, rotate;
+ Color color;
+};
+
+#endif /*_TRAPEZOCUBE_H_ */