Merge pull request #19671 from kadet1090/placement-indicator

Gui: Add Show Placement helper
This commit is contained in:
Chris Hennes
2025-02-25 17:40:58 +00:00
committed by GitHub
12 changed files with 458 additions and 2 deletions

View File

@@ -119,6 +119,7 @@ public:
inline BoundBox2d(double fX1, double fY1, double fX2, double fY2);
~BoundBox2d() = default;
inline bool IsValid() const;
inline bool IsInfinite() const;
inline bool IsEqual(const BoundBox2d& bbox, double tolerance) const;
// operators
@@ -477,6 +478,11 @@ inline bool BoundBox2d::IsValid() const
return (MaxX >= MinX) && (MaxY >= MinY);
}
inline bool BoundBox2d::IsInfinite() const
{
return MaxX >= DOUBLE_MAX && MaxY >= DOUBLE_MAX && MinX <= -DOUBLE_MAX && MinY <= -DOUBLE_MAX;
}
inline bool BoundBox2d::IsEqual(const BoundBox2d& bbox, double tolerance) const
{
return Vector2d(MinX, MinY).IsEqual(Vector2d(bbox.MinX, bbox.MinY), tolerance)

View File

@@ -101,6 +101,10 @@ template<class float_type>
class Vector3
{
public:
static const Vector3 UnitX;
static const Vector3 UnitY;
static const Vector3 UnitZ;
using num_type = float_type;
using traits_type = float_traits<num_type>;
[[nodiscard]] static constexpr num_type epsilon()
@@ -256,7 +260,12 @@ public:
//@}
};
// global functions
template<class float_type>
Vector3<float_type> const Vector3<float_type>::UnitX(1.0, 0.0, 0.0);
template<class float_type>
Vector3<float_type> const Vector3<float_type>::UnitY(0.0, 1.0, 0.0);
template<class float_type>
Vector3<float_type> const Vector3<float_type>::UnitZ(0.0, 0.0, 1.0);
/// Returns the distance between two points
template<class float_type>