16#ifndef QGSRUBBERBAND3D_H
17#define QGSRUBBERBAND3D_H
55#if QT_VERSION >= QT_VERSION_CHECK( 6, 0, 0 )
64#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
69 class QGeometryRenderer;
83class _3D_EXPORT QgsRubberBand3D
107 void setWidth(
float width );
110 QColor color()
const;
113 void setColor( QColor color );
119 QColor outlineColor()
const;
125 void setOutlineColor( QColor color );
130 void setMarkerType( MarkerType marker );
135 MarkerType markerType()
const;
142 void setMarkerOutlineStyle( Qt::PenStyle style );
148 Qt::PenStyle markerOutlineStyle()
const;
154 void setMarkersEnabled(
bool enable );
160 bool hasMarkersEnabled()
const;
166 void setEdgesEnabled(
bool enable );
172 bool hasEdgesEnabled()
const;
178 void setFillEnabled(
bool enable );
184 bool hasFillEnabled()
const;
188 void addPoint(
const QgsPoint &pt );
198 void removeLastPoint();
201 void removePenultimatePoint();
204 void moveLastPoint(
const QgsPoint &pt );
207 void setHideLastMarker(
const bool hide ) { mHideLastMarker = hide; }
209 bool isEmpty()
const {
return mGeometry.isEmpty(); }
212 void updateGeometry();
213 void updateMarkerMaterial();
214 void setupMarker( Qt3DCore::QEntity *parentEntity );
216 void setupPolygon( Qt3DCore::QEntity *parentEntity );
218 void removePoint(
int index );
220 const float DEFAULT_POLYGON_OPACITY = 0.25;
223 bool mHideLastMarker =
false;
230 MarkerType mMarkerType = Circle;
232 QColor mColor = Qt::red;
233 QColor mOutlineColor;
234 Qt::PenStyle mMarkerOutlineStyle = Qt::PenStyle::SolidLine;
236 bool mMarkerEnabled =
true;
237 bool mEdgesEnabled =
true;
238 bool mPolygonFillEnabled =
true;
240 Qt3DCore::QEntity *mLineEntity =
nullptr;
241 Qt3DCore::QEntity *mPolygonEntity =
nullptr;
242 Qt3DCore::QEntity *mMarkerEntity =
nullptr;
244 QgsGeoTransform *mLineTransform =
nullptr;
245 QgsGeoTransform *mPolygonTransform =
nullptr;
246 QgsGeoTransform *mMarkerTransform =
nullptr;
253 Qt3DRender::QGeometryRenderer *mLineGeometryRenderer =
nullptr;
254#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
255 Qt3DRender::QGeometry *mLineGeometry =
nullptr;
256 Qt3DRender::QAttribute *mPositionAttribute =
nullptr;
257 Qt3DRender::QAttribute *mIndexAttribute =
nullptr;
259 Qt3DCore::QGeometry *mLineGeometry =
nullptr;
260 Qt3DCore::QAttribute *mPositionAttribute =
nullptr;
261 Qt3DCore::QAttribute *mIndexAttribute =
nullptr;
263 QgsLineMaterial *mLineMaterial =
nullptr;
266 Qt3DRender::QGeometryRenderer *mMarkerGeometryRenderer =
nullptr;
270 std::unique_ptr<QgsMarkerSymbol> mMarkerSymbol;
273 QgsRubberBand3D(
const QgsRubberBand3D & ) =
delete;
274 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.