mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-07 00:15:48 -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
|
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.
|
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
|
%End
|
||||||
|
|
||||||
QgsRectangle toRectangle() const;
|
QgsRectangle toRectangle() const;
|
||||||
|
@ -124,11 +124,3 @@ bool QgsBox3d::operator==( const QgsBox3d &other ) const
|
|||||||
qgsDoubleNear( mZmin, other.mZmin ) &&
|
qgsDoubleNear( mZmin, other.mZmin ) &&
|
||||||
qgsDoubleNear( mZmax, other.mZmax );
|
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;
|
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.
|
* 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
|
double QgsRay3D::distanceTo( const QgsBox3d &box ) const
|
||||||
{
|
{
|
||||||
float dx = std::max( box.xMinimum() - mOrigin.x(), std::max( 0., mOrigin.x() - box.xMaximum() ) );
|
double 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() ) );
|
double 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 dz = std::max( box.zMinimum() - mOrigin.z(), std::max( 0., mOrigin.z() - box.zMaximum() ) );
|
||||||
return sqrt( dx * dx + dy * dy + dz * dz );
|
return sqrt( dx * dx + dy * dy + dz * dz );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user