summaryrefslogtreecommitdiffstats
path: root/Trapezocube.h
blob: 694ecde51fa065948cc3ae74eee7f25a8b07c0e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef _TRAPEZOCUBE_H_
#define _TRAPEZOCUBE_H_

#include "gl.h"
#include "Triangle.h"
#include <list>

class Trapezocube
{
  public:
    Trapezocube(): widthfront(0), widthback(0), height(0), depth(0), x(0), y(0), z(0), rotate(0) {}
    Trapezocube(float widthfront, float widthback, float height, float depth): x(0), y(0), z(0), rotate(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(const vmml::vec4f &col) {color = col;}
    std::list<Triangle> getTriangles(/*const Matrix &modelview*/);

  private:
    float x, y, z, widthfront, widthback, height, depth, rotate;
    vmml::vec4f color;
};

#endif /*_TRAPEZOCUBE_H_ */