src/vertex.h

changeset 5
593a658cba8e
parent 3
55a55a9ec2c2
child 6
73e448b2943d
equal deleted inserted replaced
4:68988ebc2a68 5:593a658cba8e
21 #include <QVector3D> 21 #include <QVector3D>
22 #include "basics.h" 22 #include "basics.h"
23 23
24 struct Vertex 24 struct Vertex
25 { 25 {
26 qreal x; 26 using ValueType = float;
27 qreal y; 27 ValueType x;
28 qreal z; 28 ValueType y;
29 ValueType z;
29 // void transform(const class Matrix& matrix, const Vertex& pos); 30 // void transform(const class Matrix& matrix, const Vertex& pos);
30 Vertex transformed(const GLRotationMatrix& matrix) const; 31 Vertex transformed(const GLRotationMatrix& matrix) const;
31 void setCoordinate(Axis ax, qreal value); 32 void setCoordinate(Axis ax, ValueType value);
32 Vertex& operator+=(const QVector3D& other); 33 Vertex& operator+=(const QVector3D& other);
33 Vertex operator+(const QVector3D& other) const; 34 Vertex operator+(const QVector3D& other) const;
34 QVector3D operator-(const Vertex& other) const; 35 QVector3D operator-(const Vertex& other) const;
35 Vertex operator-(const QVector3D& vector) const; 36 Vertex operator-(const QVector3D& vector) const;
36 Vertex& operator-=(const QVector3D& vector); 37 Vertex& operator-=(const QVector3D& vector);
37 Vertex& operator*=(qreal scalar); 38 Vertex& operator*=(ValueType scalar);
38 Vertex operator*(qreal scalar) const; 39 Vertex operator*(ValueType scalar) const;
39 bool operator<(const Vertex& other) const; 40 bool operator<(const Vertex& other) const;
40 double& operator[](Axis ax); 41 ValueType& operator[](Axis ax);
41 double operator[](Axis ax) const; 42 ValueType operator[](Axis ax) const;
42 bool operator==(const Vertex& other) const; 43 bool operator==(const Vertex& other) const;
43 bool operator!=(const Vertex& other) const; 44 bool operator!=(const Vertex& other) const;
44 operator QVariant() const; 45 operator QVariant() const;
45 }; 46 };
46 47

mercurial