16#ifndef QGSRUBBERBAND3D_H
17#define QGSRUBBERBAND3D_H
54#if QT_VERSION >= QT_VERSION_CHECK( 6, 0, 0 )
63#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
68 class QGeometryRenderer;
82class _3D_EXPORT QgsRubberBand3D
106 void setWidth(
float width );
109 QColor color()
const;
112 void setColor( QColor color );
118 QColor outlineColor()
const;
124 void setOutlineColor( QColor color );
129 void setMarkerType( MarkerType marker );
134 MarkerType markerType()
const;
141 void setMarkerOutlineStyle( Qt::PenStyle style );
147 Qt::PenStyle markerOutlineStyle()
const;
153 void setMarkersEnabled(
bool enable );
159 bool hasMarkersEnabled()
const;
165 void setEdgesEnabled(
bool enable );
171 bool hasEdgesEnabled()
const;
177 void setFillEnabled(
bool enable );
183 bool hasFillEnabled()
const;
187 void addPoint(
const QgsPoint &pt );
197 void removeLastPoint();
200 void removePenultimatePoint();
203 void moveLastPoint(
const QgsPoint &pt );
206 void setHideLastMarker(
const bool hide ) { mHideLastMarker = hide; }
208 bool isEmpty()
const {
return mGeometry.isEmpty(); }
211 void updateGeometry();
212 void updateMarkerMaterial();
213 void setupMarker( Qt3DCore::QEntity *parentEntity );
215 void setupPolygon( Qt3DCore::QEntity *parentEntity );
217 void removePoint(
int index );
219 const float DEFAULT_POLYGON_OPACITY = 0.25;
222 bool mHideLastMarker =
false;
229 MarkerType mMarkerType = Circle;
231 QColor mColor = Qt::red;
232 QColor mOutlineColor;
233 Qt::PenStyle mMarkerOutlineStyle = Qt::PenStyle::SolidLine;
235 bool mMarkerEnabled =
true;
236 bool mEdgesEnabled =
true;
237 bool mPolygonFillEnabled =
true;
239 Qt3DCore::QEntity *mLineEntity =
nullptr;
240 Qt3DCore::QEntity *mPolygonEntity =
nullptr;
241 Qt3DCore::QEntity *mMarkerEntity =
nullptr;
248 Qt3DRender::QGeometryRenderer *mLineGeometryRenderer =
nullptr;
249#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
250 Qt3DRender::QGeometry *mLineGeometry =
nullptr;
251 Qt3DRender::QAttribute *mPositionAttribute =
nullptr;
252 Qt3DRender::QAttribute *mIndexAttribute =
nullptr;
254 Qt3DCore::QGeometry *mLineGeometry =
nullptr;
255 Qt3DCore::QAttribute *mPositionAttribute =
nullptr;
256 Qt3DCore::QAttribute *mIndexAttribute =
nullptr;
258 QgsLineMaterial *mLineMaterial =
nullptr;
261 Qt3DRender::QGeometryRenderer *mMarkerGeometryRenderer =
nullptr;
265 std::unique_ptr<QgsMarkerSymbol> mMarkerSymbol;
268 QgsRubberBand3D(
const QgsRubberBand3D & ) =
delete;
269 QgsRubberBand3D &operator=(
const QgsRubberBand3D & ) =
delete;
GeometryType
The geometry types are used to group Qgis::WkbType in a coarse way.
Base class for 3D engine implementation.
Geometry of the billboard rendering for points in 3D map view.
A geometry is the spatial representation of a feature.
A marker symbol type, for rendering Point and MultiPoint geometries.
Base class for all materials used within QGIS 3D views.
Basic shading material used for rendering based on the Phong shading model with three color component...
Material of the billboard rendering for points in 3D map view.
Point geometry type, with support for z-dimension and m-values.
Qt3DRender::QGeometry subclass that represents polygons tessellated into 3D geometry.