mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-06 00:07:29 -04:00
remove distanceFromPoint
This commit is contained in:
parent
4e2133f229
commit
0073c35b65
@ -217,13 +217,6 @@ Returns ``True`` when box contains a ``point``.
|
||||
|
||||
If the point is a 2D point (no z-coordinate), then the containment test
|
||||
will be performed on the x/y extent of the box only.
|
||||
%End
|
||||
|
||||
float distanceFromPoint( double x, double y, double z ) const;
|
||||
%Docstring
|
||||
Returns shortest distance from the box to a point (returns 0 if the point is inside the box)
|
||||
|
||||
.. versionadded:: 3.18
|
||||
%End
|
||||
|
||||
QgsRectangle toRectangle() const;
|
||||
|
@ -124,11 +124,3 @@ bool QgsBox3d::operator==( const QgsBox3d &other ) const
|
||||
qgsDoubleNear( mZmin, other.mZmin ) &&
|
||||
qgsDoubleNear( mZmax, other.mZmax );
|
||||
}
|
||||
|
||||
float QgsBox3d::distanceFromPoint( double x, double y, double z ) const
|
||||
{
|
||||
float dx = std::max( mBounds2d.xMinimum() - x, std::max( 0., x - mBounds2d.xMaximum() ) );
|
||||
float dy = std::max( mBounds2d.yMinimum() - y, std::max( 0., y - mBounds2d.yMaximum() ) );
|
||||
float dz = std::max( mZmin - z, std::max( 0., z - mZmax ) );
|
||||
return sqrt( dx * dx + dy * dy + dz * dz );
|
||||
}
|
||||
|
@ -198,12 +198,6 @@ class CORE_EXPORT QgsBox3d
|
||||
*/
|
||||
bool contains( const QgsPoint &point ) const;
|
||||
|
||||
/**
|
||||
* Returns shortest distance from the box to a point (returns 0 if the point is inside the box)
|
||||
* \since QGIS 3.18
|
||||
*/
|
||||
float distanceFromPoint( double x, double y, double z ) const;
|
||||
|
||||
/**
|
||||
* Converts the box to a 2D rectangle.
|
||||
*/
|
||||
|
@ -81,8 +81,8 @@ double QgsRay3D::angleToPoint( const QVector3D &point ) const
|
||||
|
||||
double QgsRay3D::distanceTo( const QgsBox3d &box ) const
|
||||
{
|
||||
float dx = std::max( box.xMinimum() - mOrigin.x(), std::max( 0., mOrigin.x() - box.xMaximum() ) );
|
||||
float dy = std::max( box.yMinimum() - mOrigin.y(), std::max( 0., mOrigin.y() - box.yMaximum() ) );
|
||||
float dz = std::max( box.zMinimum() - mOrigin.z(), std::max( 0., mOrigin.z() - box.zMaximum() ) );
|
||||
double dx = std::max( box.xMinimum() - mOrigin.x(), std::max( 0., mOrigin.x() - box.xMaximum() ) );
|
||||
double dy = std::max( box.yMinimum() - mOrigin.y(), std::max( 0., mOrigin.y() - box.yMaximum() ) );
|
||||
double dz = std::max( box.zMinimum() - mOrigin.z(), std::max( 0., mOrigin.z() - box.zMaximum() ) );
|
||||
return sqrt( dx * dx + dy * dy + dz * dz );
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user