Skip to content

Commit

Permalink
fix and docs
Browse files Browse the repository at this point in the history
  • Loading branch information
andiwand committed Dec 19, 2024
1 parent 5032c8b commit bf236b4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
16 changes: 11 additions & 5 deletions Core/include/Acts/Surfaces/Surface.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,19 @@ class Surface : public virtual GeometryObject,
const BoundaryTolerance& boundaryTolerance = BoundaryTolerance::None(),
double tolerance = s_onSurfaceTolerance) const;

/// Calculates the closest point on the boundary of the surface to a given
/// point in local coordinates.
/// @param lposition The local position to check
/// @param metric The metric to use for the calculation
/// @return The closest point on the boundary of the surface
virtual Vector2 closestPointOnBounds(
const Vector2& lposition,
const std::optional<SquareMatrix2>& metric) const;
const Vector2& lposition, std::optional<SquareMatrix2>& metric) const;

virtual double distanceToBounds(
const Vector2& lposition,
const std::optional<SquareMatrix2>& metric) const;
/// Calculates the distance to the boundary of the surface from a given point
/// in local coordinates.
/// @param lposition The local position to check
/// @return The distance to the boundary of the surface
virtual double distanceToBounds(const Vector2& lposition) const;

/// The insideBounds method for local positions
///
Expand Down
6 changes: 2 additions & 4 deletions Core/src/Surfaces/Surface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,8 @@ Vector2 Surface::closestPointOnBounds(
return bounds().closestPoint(lposition, metric);
}

double Surface::distanceToBounds(
const Vector2& lposition,
const std::optional<SquareMatrix2>& metric) const {
return bounds().distance(lposition, metric);
double Surface::distanceToBounds(const Vector2& lposition) const {
return bounds().distance(lposition);
}

bool Surface::insideBounds(const Vector2& lposition,
Expand Down

0 comments on commit bf236b4

Please sign in to comment.