35 Q_PROPERTY(
float topRadius READ topRadius WRITE setTopRadius NOTIFY topRadiusChanged FINAL)
36 Q_PROPERTY(
float bottomRadius READ bottomRadius WRITE setBottomRadius NOTIFY bottomRadiusChanged FINAL)
37 Q_PROPERTY(
float length READ length WRITE setLength NOTIFY lengthChanged FINAL)
38 Q_PROPERTY(
int rings READ rings WRITE setRings NOTIFY ringsChanged FINAL)
39 Q_PROPERTY(
int segments READ segments WRITE setSegments NOTIFY segmentsChanged FINAL)
40 Q_PROPERTY(
bool asynchronous READ asynchronous WRITE setAsynchronous NOTIFY asynchronousChanged)
41 Q_PROPERTY(Status status READ status NOTIFY statusChanged)
43 QML_ADDED_IN_VERSION(6, 9)
45 enum Status { Null, Ready, Loading, Error };
48 explicit ConeGeometry(QQuick3DObject *parent =
nullptr);
49 ~ConeGeometry() override;
50 float topRadius()
const;
51 void setTopRadius(
float newTopRadius);
52 float bottomRadius()
const;
53 void setBottomRadius(
float newBottomRadius);
56 void setLength(
float newLength);
59 void setRings(
int newRings);
62 void setSegments(
int newSegments);
64 bool asynchronous()
const;
65 void setAsynchronous(
bool newAsynchronous);
67 Status status()
const;
70 void doUpdateGeometry();
71 void requestFinished();
74 void topRadiusChanged();
75 void bottomRadiusChanged();
78 void segmentsChanged();
79 void asynchronousChanged();
84 QByteArray vertexData;
90 void scheduleGeometryUpdate();
91 void updateGeometry(
const GeometryData &geometryData);
93 static ConeGeometry::GeometryData generateConeGeometry(
float topRadius,
98#if QT_CONFIG(concurrent)
99 static void generateConeGeometryAsync(QPromise<ConeGeometry::GeometryData> &promise,
107 float m_topRadius = 0.0f;
108 float m_bottomRadius = 50.0f;
109 float m_length = 100.0f;
112 bool m_asynchronous =
true;
113 Status m_status = Null;
114#if QT_CONFIG(concurrent)
115 QFuture<GeometryData> m_geometryDataFuture;
116 QFutureWatcher<GeometryData> m_geometryDataWatcher;
118 bool m_geometryUpdateRequested =
false;
119 bool m_pendingAsyncUpdate =
false;