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 );
196 void removeLastPoint();
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 );
210 void setupPolygon( Qt3DCore::QEntity *parentEntity );
212 const float DEFAULT_POLYGON_OPACITY = 0.25;
215 bool mHideLastMarker =
false;
222 MarkerType mMarkerType = Circle;
224 QColor mColor = Qt::red;
225 QColor mOutlineColor;
226 Qt::PenStyle mMarkerOutlineStyle = Qt::PenStyle::SolidLine;
228 bool mMarkerEnabled =
true;
229 bool mEdgesEnabled =
true;
230 bool mPolygonFillEnabled =
true;
232 Qt3DCore::QEntity *mLineEntity =
nullptr;
233 Qt3DCore::QEntity *mPolygonEntity =
nullptr;
234 Qt3DCore::QEntity *mMarkerEntity =
nullptr;
241 Qt3DRender::QGeometryRenderer *mLineGeometryRenderer =
nullptr;
242#if QT_VERSION < QT_VERSION_CHECK( 6, 0, 0 )
243 Qt3DRender::QGeometry *mLineGeometry =
nullptr;
244 Qt3DRender::QAttribute *mPositionAttribute =
nullptr;
245 Qt3DRender::QAttribute *mIndexAttribute =
nullptr;
247 Qt3DCore::QGeometry *mLineGeometry =
nullptr;
248 Qt3DCore::QAttribute *mPositionAttribute =
nullptr;
249 Qt3DCore::QAttribute *mIndexAttribute =
nullptr;
251 QgsLineMaterial *mLineMaterial =
nullptr;
254 Qt3DRender::QGeometryRenderer *mMarkerGeometryRenderer =
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.
A geometry is the spatial representation of a feature.
A marker symbol type, for rendering Point and MultiPoint geometries.
Point geometry type, with support for z-dimension and m-values.