33 Q_PROPERTY(
float topRadius READ topRadius WRITE setTopRadius NOTIFY topRadiusChanged FINAL)
34 Q_PROPERTY(
float bottomRadius READ bottomRadius WRITE setBottomRadius NOTIFY bottomRadiusChanged FINAL)
35 Q_PROPERTY(
float length READ length WRITE setLength NOTIFY lengthChanged FINAL)
36 Q_PROPERTY(
int rings READ rings WRITE setRings NOTIFY ringsChanged FINAL)
37 Q_PROPERTY(
int segments READ segments WRITE setSegments NOTIFY segmentsChanged FINAL)
38 Q_PROPERTY(
bool asynchronous READ asynchronous WRITE setAsynchronous NOTIFY asynchronousChanged)
39 Q_PROPERTY(Status status READ status NOTIFY statusChanged)
41 QML_ADDED_IN_VERSION(6, 9)
43 enum Status { Null, Ready, Loading, Error };
46 explicit ConeGeometry(QQuick3DObject *parent =
nullptr);
47 ~ConeGeometry() override;
48 float topRadius()
const;
49 void setTopRadius(
float newTopRadius);
50 float bottomRadius()
const;
51 void setBottomRadius(
float newBottomRadius);
54 void setLength(
float newLength);
57 void setRings(
int newRings);
60 void setSegments(
int newSegments);
62 bool asynchronous()
const;
63 void setAsynchronous(
bool newAsynchronous);
65 Status status()
const;
68 void doUpdateGeometry();
69 void requestFinished();
72 void topRadiusChanged();
73 void bottomRadiusChanged();
76 void segmentsChanged();
77 void asynchronousChanged();
82 QByteArray vertexData;
88 void scheduleGeometryUpdate();
89 void updateGeometry(
const GeometryData &geometryData);
91 static ConeGeometry::GeometryData generateConeGeometry(
float topRadius,
96#if QT_CONFIG(concurrent)
97 static void generateConeGeometryAsync(QPromise<ConeGeometry::GeometryData> &promise,
105 float m_topRadius = 0.0f;
106 float m_bottomRadius = 50.0f;
107 float m_length = 100.0f;
110 bool m_asynchronous =
true;
111 Status m_status = Null;
112#if QT_CONFIG(concurrent)
113 QFuture<GeometryData> m_geometryDataFuture;
114 QFutureWatcher<GeometryData> m_geometryDataWatcher;
116 bool m_geometryUpdateRequested =
false;
117 bool m_pendingAsyncUpdate =
false;