src/linetypes/quadrilateral.h

Wed, 22 Jan 2020 22:41:17 +0200

author
Teemu Piippo <teemu@hecknology.net>
date
Wed, 22 Jan 2020 22:41:17 +0200
changeset 28
c92c1daf735f
parent 26
3a9e761e4faa
child 33
4c41bfe2ec6e
permissions
-rw-r--r--

modelview matrix set up

15
9e18ec63eec3 split quadrilateral and triangle into their own source files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
1 #pragma once
9e18ec63eec3 split quadrilateral and triangle into their own source files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
2 #include "object.h"
9e18ec63eec3 split quadrilateral and triangle into their own source files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
3
9e18ec63eec3 split quadrilateral and triangle into their own source files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
4 namespace linetypes
9e18ec63eec3 split quadrilateral and triangle into their own source files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
5 {
9e18ec63eec3 split quadrilateral and triangle into their own source files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
6 class Quadrilateral;
9e18ec63eec3 split quadrilateral and triangle into their own source files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
7 }
9e18ec63eec3 split quadrilateral and triangle into their own source files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
8
9e18ec63eec3 split quadrilateral and triangle into their own source files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
9 class linetypes::Quadrilateral : public ColoredObject
9e18ec63eec3 split quadrilateral and triangle into their own source files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
10 {
9e18ec63eec3 split quadrilateral and triangle into their own source files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
11 public:
9e18ec63eec3 split quadrilateral and triangle into their own source files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
12 Quadrilateral() = default;
9e18ec63eec3 split quadrilateral and triangle into their own source files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
13 Quadrilateral(
18
Teemu Piippo <teemu@hecknology.net>
parents: 15
diff changeset
14 const Point3D &point_1,
Teemu Piippo <teemu@hecknology.net>
parents: 15
diff changeset
15 const Point3D &point_2,
Teemu Piippo <teemu@hecknology.net>
parents: 15
diff changeset
16 const Point3D &point_3,
Teemu Piippo <teemu@hecknology.net>
parents: 15
diff changeset
17 const Point3D &point_4,
15
9e18ec63eec3 split quadrilateral and triangle into their own source files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
18 Color colorIndex = colors::main);
18
Teemu Piippo <teemu@hecknology.net>
parents: 15
diff changeset
19 Quadrilateral(const QVector<Point3D>& vertices, const Color color);
15
9e18ec63eec3 split quadrilateral and triangle into their own source files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
20 QVariant getProperty(Property id) const override;
9e18ec63eec3 split quadrilateral and triangle into their own source files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
21 SetPropertyResult setProperty(Property id, const QVariant& value) override;
9e18ec63eec3 split quadrilateral and triangle into their own source files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
22 QString textRepresentation() const override;
21
Teemu Piippo <teemu@hecknology.net>
parents: 18
diff changeset
23 void getPolygons(std::vector<gl::Polygon>& polygons, GetPolygonsContext* context) const override;
26
3a9e761e4faa at least VAOs work now
Teemu Piippo <teemu@hecknology.net>
parents: 21
diff changeset
24 void invert() override;
15
9e18ec63eec3 split quadrilateral and triangle into their own source files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
25 private:
18
Teemu Piippo <teemu@hecknology.net>
parents: 15
diff changeset
26 Point3D points[4] = {{}};
15
9e18ec63eec3 split quadrilateral and triangle into their own source files
Teemu Piippo <teemu@hecknology.net>
parents:
diff changeset
27 };

mercurial