Wed, 25 May 2022 17:42:02 +0300
Simplify PolygonCache
186 | 1 | #pragma once |
2 | #include "compoundobject.h" | |
3 | #include "propertygenerics.h" | |
4 | ||
5 | namespace ldraw | |
6 | { | |
7 | class CircularPrimitive; | |
8 | } | |
9 | ||
10 | class ldraw::CircularPrimitive : public CompoundObject | |
11 | { | |
12 | public: | |
13 | using BaseClass = CompoundObject; | |
14 | CircularPrimitive() = default; | |
15 | CircularPrimitive(CircularPrimitiveType type, int segments, int divisions); | |
16 | QVariant getProperty(Property property) const override; | |
17 | QString textRepresentation() const override; | |
18 | static QString circularPrimitiveTypeName(CircularPrimitiveType type); | |
19 | Type typeIdentifier() const override; | |
20 | QDataStream& serialize(QDataStream& stream) const override; | |
21 | QDataStream& deserialize(QDataStream& stream) override; | |
22 | QString toLDrawCode() const override; | |
23 | QString iconName() const override; | |
24 | QString typeName() const override; | |
25 | void getPolygons(std::vector<gl::Polygon>& polygons, GetPolygonsContext*) const override; | |
26 | float fraction() const; | |
27 | CircularPrimitiveType type = Circle; | |
28 | int segments = 16; | |
29 | int divisions = 16; | |
30 | }; | |
31 |