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
108 void setWidth(
float width );
111 QColor color()
const;
114 void setColor( QColor color );
120 QColor outlineColor()
const;
126 void setOutlineColor( QColor color );
131 void setMarkerType( MarkerType marker );
136 MarkerType markerType()
const;
143 void setMarkerOutlineStyle( Qt::PenStyle style );
149 Qt::PenStyle markerOutlineStyle()
const;
155 void setMarkersEnabled(
bool enable );
161 bool hasMarkersEnabled()
const;
167 void setEdgesEnabled(
bool enable );
173 bool hasEdgesEnabled()
const;
179 void setFillEnabled(
bool enable );
185 bool hasFillEnabled()
const;
189 void addPoint(
const QgsPoint &pt );
196 void setGeometry(
const QgsGeometry &geometry );
199 void removeLastPoint();
202 void removePenultimatePoint();
205 void moveLastPoint(
const QgsPoint &pt );
208 void setHideLastMarker(
const bool hide ) { mHideLastMarker = hide; }
210 bool isEmpty()
const {
return mGeometry.isEmpty(); }
213 void updateGeometry();
214 void updateMarkerMaterial();
215 void setupMarker( Qt3DCore::QEntity *parentEntity );
216 void setupLine( Qt3DCore::QEntity *parentEntity, QgsAbstract3DEngine *engine );
217 void setupPolygon( Qt3DCore::QEntity *parentEntity );
219 void removePoint(
int index );
221 const float DEFAULT_POLYGON_OPACITY = 0.25;
223 QgsGeometry mGeometry;
224 bool mHideLastMarker =
false;
226 Qgs3DMapSettings *mMapSettings =
nullptr;
227 QgsAbstract3DEngine *mEngine =
nullptr;
231 MarkerType mMarkerType = Circle;
233 QColor mColor = Qt::red;
234 QColor mOutlineColor;
235 Qt::PenStyle mMarkerOutlineStyle = Qt::PenStyle::SolidLine;
237 bool mMarkerEnabled =
true;
238 bool mEdgesEnabled =
true;
239 bool mPolygonFillEnabled =
true;
241 Qt3DCore::QEntity *mLineEntity =
nullptr;
242 Qt3DCore::QEntity *mPolygonEntity =
nullptr;
243 Qt3DCore::QEntity *mMarkerEntity =
nullptr;
245 QgsGeoTransform *mLineTransform =
nullptr;
246 QgsGeoTransform *mPolygonTransform =
nullptr;
247 QgsGeoTransform *mMarkerTransform =
nullptr;
250 QgsTessellatedPolygonGeometry *mPolygonGeometry =
nullptr;
251 QgsMaterial *mPolygonMaterial =
nullptr;
254 Qt3DRender::QGeometryRenderer *mLineGeometryRenderer =
nullptr;
255#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
256 Qt3DRender::QGeometry *mLineGeometry =
nullptr;
257 Qt3DRender::QAttribute *mPositionAttribute =
nullptr;
258 Qt3DRender::QAttribute *mIndexAttribute =
nullptr;
260 Qt3DCore::QGeometry *mLineGeometry =
nullptr;
261 Qt3DCore::QAttribute *mPositionAttribute =
nullptr;
262 Qt3DCore::QAttribute *mIndexAttribute =
nullptr;
264 QgsLineMaterial *mLineMaterial =
nullptr;
267 Qt3DRender::QGeometryRenderer *mMarkerGeometryRenderer =
nullptr;
268 QgsBillboardGeometry *mMarkerGeometry =
nullptr;
269 QgsPoint3DBillboardMaterial *mMarkerMaterial =
nullptr;
271 std::unique_ptr<QgsMarkerSymbol> mMarkerSymbol;
274 QgsRubberBand3D(
const QgsRubberBand3D & ) =
delete;
275 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.