Skip to content
Permalink
Browse files

add docs

  • Loading branch information
NEDJIMAbelgacem authored and wonder-sk committed Jan 13, 2021
1 parent d136c3e commit 398144ee93bf7fda0858ba2e22d9e1d9c963b995
@@ -88,7 +88,7 @@ the number of points returned to ``pointsLimit`` points
}
}
%End
QVector<IndexedPointCloudNode> getNodesIntersectingWithRay( const QgsPointCloudIndex *pc, IndexedPointCloudNode n, double maxError, double nodeError, double cameraFov, int screenSizePx, const QVector3D &rayOrigin, const QVector3D &rayDirection );


virtual QgsPointCloudDataProvider::Capabilities capabilities() const;
%Docstring
@@ -122,6 +122,12 @@ class _3D_EXPORT Qgs3DMapScene : public Qt3DCore::QEntity
//! Exports the scene according to the scene export settings
void exportScene( const Qgs3DMapExportSettings &exportSettings );

/**
* Identifies the points that are positioned on the ray specified in world coordinates as a point \a rayOrigin and direction \a rayDirection
* for every point cloud layer and returns the identified points in \a selectedPoints vector
*
* \since QGIS 3.18
*/
void identifyPointCloudOnRay( QVector<QPair<QgsMapLayer *, QVector<QVariantMap>>> &selectedPoints, const QVector3D &rayOrigin, const QVector3D &rayDirection );

signals:
@@ -254,7 +254,7 @@ void Qgs3DMapCanvas::updateTemporalRange( const QgsDateTimeRange &temporalrange
mScene->updateTemporal();
}

bool Qgs3DMapCanvas::identifyPointCloudOnMouseEvent( QVector<QPair<QgsMapLayer *, QVector<QVariantMap>>> &result, QMouseEvent *event )
void Qgs3DMapCanvas::identifyPointCloudOnMouseEvent( QVector<QPair<QgsMapLayer *, QVector<QVariantMap>>> &result, QMouseEvent *event )
{
QVector3D deviceCoords( event->x(), event->y(), 0.0 );
QSize windowSize = mEngine->size();
@@ -86,8 +86,12 @@ class Qgs3DMapCanvas : public QWidget
*/
void setTemporalController( QgsTemporalController *temporalController );

//
bool identifyPointCloudOnMouseEvent( QVector<QPair<QgsMapLayer *, QVector<QVariantMap>>> &result, QMouseEvent *event );
/**
* Identifies point cloud using mouse event
*
* \since QGIS 3.18
*/
void identifyPointCloudOnMouseEvent( QVector<QPair<QgsMapLayer *, QVector<QVariantMap>>> &result, QMouseEvent *event );

signals:
//! Emitted when the 3D map canvas was successfully saved as image
@@ -100,7 +104,6 @@ class Qgs3DMapCanvas : public QWidget
void fpsCountChanged( float fpsCount );
//! Emitted when the FPS counter is enabled or disabeld
void fpsCounterEnabledChanged( bool enabled );
public slots:
private slots:
void updateTemporalRange( const QgsDateTimeRange &timeRange );

@@ -85,6 +85,7 @@ void Qgs3DMapToolIdentify::mouseReleaseEvent( QMouseEvent *event )
if ( event->button() != Qt::MouseButton::LeftButton )
return;

// point cloud identification
QVector<QPair<QgsMapLayer *, QVector<QVariantMap>>> layerPoints;
canvas()->identifyPointCloudOnMouseEvent( layerPoints, event );

@@ -409,9 +409,9 @@ QVector<IndexedPointCloudNode> QgsPointCloudDataProvider::traverseTree(
return nodes;
}

QVector<QMap<QString, QVariant>> QgsPointCloudDataProvider::getPointsOnRay( const QVector3D &rayOrigin, const QVector3D &rayDirection, double maxScreenError, double cameraFov, int screenSizePx, double pointAngle )
QVector<QVariantMap> QgsPointCloudDataProvider::getPointsOnRay( const QVector3D &rayOrigin, const QVector3D &rayDirection, double maxScreenError, double cameraFov, int screenSizePx, double pointAngle )
{
QVector<QMap<QString, QVariant>> points;
QVector<QVariantMap> points;
QgsPointCloudIndex *index = this->index();
IndexedPointCloudNode root = index->root();
QgsRectangle rootNodeExtentMapCoords = index->nodeMapExtent( root );
@@ -121,8 +121,21 @@ class CORE_EXPORT QgsPointCloudDataProvider: public QgsDataProvider
}
% End
#endif
QVector<QMap<QString, QVariant>> getPointsOnRay( const QVector3D &rayOrigin, const QVector3D &rayDirection, double maxScreenError, double cameraFov, int screenSizePx, double pointAngle ) SIP_SKIP;
QVector<IndexedPointCloudNode> getNodesIntersectingWithRay( const QgsPointCloudIndex *pc, IndexedPointCloudNode n, double maxError, double nodeError, double cameraFov, int screenSizePx, const QVector3D &rayOrigin, const QVector3D &rayDirection );

/**
* Returns the Points that are on a ray
*
* \param rayOrigin : The origin of the ray in layer coordinates
* \param rayDirection : The direction of the ray in layer coordinates
* \param maxScreenError : Maximum screen error (as taken from the 3D point cloud layer renderer)
* \param cameraFov : The field of view of the camera in degrees
* \param screenSizePx : The size of the screen's viewport in pixels
* \param pointAngle : the maximum accepted angle between the point and it's projected point on the ray in degrees
* \return a vector of the identified points
*
* \since QGIS 3.18
*/
QVector<QVariantMap> getPointsOnRay( const QVector3D &rayOrigin, const QVector3D &rayDirection, double maxScreenError, double cameraFov, int screenSizePx, double pointAngle ) SIP_SKIP;

/**
* Returns flags containing the supported capabilities for the data provider.
@@ -346,6 +359,7 @@ class CORE_EXPORT QgsPointCloudDataProvider: public QgsDataProvider

private:
QVector<IndexedPointCloudNode> traverseTree( const QgsPointCloudIndex *pc, IndexedPointCloudNode n, double maxError, double nodeError, const QgsGeometry &extentGeometry, const QgsDoubleRange &extentZRange );
QVector<IndexedPointCloudNode> getNodesIntersectingWithRay( const QgsPointCloudIndex *pc, IndexedPointCloudNode n, double maxError, double nodeError, double cameraFov, int screenSizePx, const QVector3D &rayOrigin, const QVector3D &rayDirection );
};

#endif // QGSMESHDATAPROVIDER_H

0 comments on commit 398144e

Please sign in to comment.
You can’t perform that action at this time.