16#ifndef QGSRUBBERBAND3D_H
17#define QGSRUBBERBAND3D_H
62 class QGeometryRenderer;
76class _3D_EXPORT QgsRubberBand3D
101 void setWidth(
float width );
104 QColor color()
const;
107 void setColor( QColor color );
113 QColor outlineColor()
const;
119 void setOutlineColor( QColor color );
124 void setMarkerType( MarkerType marker );
129 MarkerType markerType()
const;
136 void setMarkerOutlineStyle( Qt::PenStyle style );
142 Qt::PenStyle markerOutlineStyle()
const;
148 void setMarkersEnabled(
bool enable );
154 bool hasMarkersEnabled()
const;
160 void setEdgesEnabled(
bool enable );
166 bool hasEdgesEnabled()
const;
172 void setFillEnabled(
bool enable );
178 bool hasFillEnabled()
const;
182 void addPoint(
const QgsPoint &pt );
189 void setGeometry(
const QgsGeometry &geometry );
192 void removeLastPoint();
195 void removePenultimatePoint();
198 void moveLastPoint(
const QgsPoint &pt );
201 void setHideLastMarker(
const bool hide ) { mHideLastMarker = hide; }
203 bool isEmpty()
const {
return mGeometry.isEmpty(); }
206 void updateGeometry();
207 void updateMarkerMaterial();
208 void setupMarker( Qt3DCore::QEntity *parentEntity );
209 void setupLine( Qt3DCore::QEntity *parentEntity );
210 void setupPolygon( Qt3DCore::QEntity *parentEntity );
212 void removePoint(
int index );
214 const float DEFAULT_POLYGON_OPACITY = 0.25;
216 QgsGeometry mGeometry;
217 bool mHideLastMarker =
false;
219 Qgs3DMapSettings *mMapSettings =
nullptr;
220 QgsAbstract3DEngine *mEngine =
nullptr;
224 MarkerType mMarkerType = Circle;
226 QColor mColor = Qt::red;
227 QColor mOutlineColor;
228 Qt::PenStyle mMarkerOutlineStyle = Qt::PenStyle::SolidLine;
230 bool mMarkerEnabled =
true;
231 bool mEdgesEnabled =
true;
232 bool mPolygonFillEnabled =
true;
234 QObjectUniquePtr<Qt3DCore::QEntity> mLineEntity =
nullptr;
235 QObjectUniquePtr<Qt3DCore::QEntity> mPolygonEntity =
nullptr;
236 QObjectUniquePtr<Qt3DCore::QEntity> mMarkerEntity =
nullptr;
238 QgsGeoTransform *mLineTransform =
nullptr;
239 QgsGeoTransform *mPolygonTransform =
nullptr;
240 QgsGeoTransform *mMarkerTransform =
nullptr;
243 QgsTessellatedPolygonGeometry *mPolygonGeometry =
nullptr;
244 QgsMaterial *mPolygonMaterial =
nullptr;
247 Qt3DRender::QGeometryRenderer *mLineGeometryRenderer =
nullptr;
248 Qt3DCore::QGeometry *mLineGeometry =
nullptr;
249 Qt3DCore::QAttribute *mPositionAttribute =
nullptr;
250 Qt3DCore::QAttribute *mIndexAttribute =
nullptr;
251 QgsLineMaterial *mLineMaterial =
nullptr;
254 Qt3DRender::QGeometryRenderer *mMarkerGeometryRenderer =
nullptr;
255 QgsBillboardGeometry *mMarkerGeometry =
nullptr;
256 QgsPoint3DBillboardMaterial *mMarkerMaterial =
nullptr;
258 std::unique_ptr<QgsMarkerSymbol> mMarkerSymbol;
261 QgsRubberBand3D(
const QgsRubberBand3D & ) =
delete;
262 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.