16#ifndef QGSRUBBERBAND3D_H
17#define QGSRUBBERBAND3D_H
63 class QGeometryRenderer;
77class _3D_EXPORT QgsRubberBand3D
102 void setWidth(
float width );
105 QColor color()
const;
108 void setColor( QColor color );
114 QColor outlineColor()
const;
120 void setOutlineColor( QColor color );
125 void setMarkerType( MarkerType marker );
130 MarkerType markerType()
const;
137 void setMarkerOutlineStyle( Qt::PenStyle style );
143 Qt::PenStyle markerOutlineStyle()
const;
149 void setMarkersEnabled(
bool enable );
155 bool hasMarkersEnabled()
const;
161 void setEdgesEnabled(
bool enable );
167 bool hasEdgesEnabled()
const;
173 void setFillEnabled(
bool enable );
179 bool hasFillEnabled()
const;
183 void addPoint(
const QgsPoint &pt );
190 void setGeometry(
const QgsGeometry &geometry );
193 void removeLastPoint();
196 void removePenultimatePoint();
199 void moveLastPoint(
const QgsPoint &pt );
202 void setHideLastMarker(
const bool hide ) { mHideLastMarker = hide; }
204 bool isEmpty()
const {
return mGeometry.isEmpty(); }
207 void updateGeometry();
208 void updateMarkerMaterial();
209 void setupMarker( Qt3DCore::QEntity *parentEntity );
210 void setupLine( Qt3DCore::QEntity *parentEntity );
211 void setupPolygon( Qt3DCore::QEntity *parentEntity );
213 void removePoint(
int index );
215 const float DEFAULT_POLYGON_OPACITY = 0.25;
217 QgsGeometry mGeometry;
218 bool mHideLastMarker =
false;
220 Qgs3DMapSettings *mMapSettings =
nullptr;
221 QgsAbstract3DEngine *mEngine =
nullptr;
225 MarkerType mMarkerType = Circle;
227 QColor mColor = Qt::red;
228 QColor mOutlineColor;
229 Qt::PenStyle mMarkerOutlineStyle = Qt::PenStyle::SolidLine;
231 bool mMarkerEnabled =
true;
232 bool mEdgesEnabled =
true;
233 bool mPolygonFillEnabled =
true;
235 QObjectUniquePtr<Qt3DCore::QEntity> mLineEntity =
nullptr;
236 QObjectUniquePtr<Qt3DCore::QEntity> mPolygonEntity =
nullptr;
237 QObjectUniquePtr<Qt3DCore::QEntity> mMarkerEntity =
nullptr;
239 QgsGeoTransform *mLineTransform =
nullptr;
240 QgsGeoTransform *mPolygonTransform =
nullptr;
241 QgsGeoTransform *mMarkerTransform =
nullptr;
244 QgsTessellatedPolygonGeometry *mPolygonGeometry =
nullptr;
245 QgsMaterial *mPolygonMaterial =
nullptr;
248 Qt3DRender::QGeometryRenderer *mLineGeometryRenderer =
nullptr;
249 Qt3DCore::QGeometry *mLineGeometry =
nullptr;
250 Qt3DCore::QAttribute *mPositionAttribute =
nullptr;
251 Qt3DCore::QAttribute *mIndexAttribute =
nullptr;
252 QgsLineMaterial *mLineMaterial =
nullptr;
255 Qt3DRender::QGeometryRenderer *mMarkerGeometryRenderer =
nullptr;
256 QgsBillboardGeometry *mMarkerGeometry =
nullptr;
257 QgsPoint3DBillboardMaterial *mMarkerMaterial =
nullptr;
259 std::unique_ptr<QgsMarkerSymbol> mMarkerSymbol;
262 QgsRubberBand3D(
const QgsRubberBand3D & ) =
delete;
263 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.