FMX.Types3D.TBoundingBox

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

  TBoundingBox = record
  private
    function GetWidth: Single;
    procedure SetWidth(const Value: Single);
    function GetHeight: Single;
    procedure SetHeight(const Value: Single);
    function GetDepth: Single;
    procedure SetDepth(const Value: Single);
    function GetCenterPoint: TPoint3D;
  public
    constructor Create(const AnOrigin: TPoint3D); overload;
    constructor Create(const AnOrigin: TPoint3D; const Width, Height, Depth: Single); overload;
    constructor Create(const Left, Top, Near, Right, Bottom, Far: Single); overload;
    constructor Create(const APoint1, APoint2: TPoint3D; NormalizeBox: Boolean = False); overload;
    constructor Create(const ABox: TBoundingBox; NormalizeBox: Boolean = False); overload;
    constructor Create(const Points: TArray<TPoint3D>); overload;
    constructor Create(const Points: PPoint3D; const PointCount: Integer); overload;
    class operator Equal(const LeftBox, RightBox: TBoundingBox): Boolean;
    class operator NotEqual(const LeftBox, RightBox: TBoundingBox): Boolean;
    class operator Add(const LeftBox, RightBox: TBoundingBox): TBoundingBox;
    class operator Multiply(const LeftBox, RightBox: TBoundingBox): TBoundingBox;
    class function Empty: TBoundingBox; inline; static;
    function FitIntoScale(const ADesignatedArea: TBoundingBox): Single;
    function FitInto(const ADesignatedArea: TBoundingBox; out ARatio: Single): TBoundingBox; overload;
    function FitInto(const ADesignatedArea: TBoundingBox): TBoundingBox; overload;
    function Normalize: TBoundingBox;
    function IsEmpty(const Epsilon: Single = TEpsilon.Vector): Boolean;
    function Contains(const APoint: TPoint3D): Boolean; overload;
    function Contains(const ABox: TBoundingBox): Boolean; overload;
    function IntersectsWith(const ABox: TBoundingBox): Boolean;
    function Intersect(const DestBox: TBoundingBox): TBoundingBox;
    function Union(const DestBox: TBoundingBox): TBoundingBox; overload;
    function Offset(const DX, DY, DZ: Single): TBoundingBox; overload;
    function Offset(const APoint: TPoint3D): TBoundingBox; overload;
    function Inflate(const DX, DY, DZ: Single): TBoundingBox; overload;
    function Inflate(const DL, DT, DN, DR, DB, DF: Single): TBoundingBox; overload;
    function GetSize: TPoint3D;
    function EqualsTo(const ABox: TBoundingBox; const Epsilon: Single = 0): Boolean;
    property Width: Single read GetWidth write SetWidth;
    property Height: Single read GetHeight write SetHeight;
    property Depth: Single read GetDepth write SetDepth;
    property CenterPoint: TPoint3D read GetCenterPoint;
    case Integer of
      0: (Left, Top, Near, Right, Bottom, Far: Single;);
      1: (TopLeftNear, BottomRightFar: TPoint3D);
      2: (MinCorner, MaxCorner: TPoint3D);
  end;

C++

struct DECLSPEC_DRECORD TBoundingBox
{
private:
    float __fastcall GetWidth();
    void __fastcall SetWidth(const float Value);
    float __fastcall GetHeight();
    void __fastcall SetHeight(const float Value);
    float __fastcall GetDepth();
    void __fastcall SetDepth(const float Value);
    System::Math::Vectors::TPoint3D __fastcall GetCenterPoint();
public:
    __fastcall TBoundingBox(const System::Math::Vectors::TPoint3D &AnOrigin)/* overload */;
    __fastcall TBoundingBox(const System::Math::Vectors::TPoint3D &AnOrigin, const float Width, const float Height, const float Depth)/* overload */;
    __fastcall TBoundingBox(const float Left, const float Top, const float Near, const float Right, const float Bottom, const float Far)/* overload */;
    __fastcall TBoundingBox(const System::Math::Vectors::TPoint3D &APoint1, const System::Math::Vectors::TPoint3D &APoint2, bool NormalizeBox)/* overload */;
    __fastcall TBoundingBox(const TBoundingBox &ABox, bool NormalizeBox)/* overload */;
#ifndef _WIN64
    __fastcall TBoundingBox(const System::DynamicArray<System::Math::Vectors::TPoint3D> Points)/* overload */;
#else /* _WIN64 */
    __fastcall TBoundingBox(const System::TArray__1<System::Math::Vectors::TPoint3D> Points)/* overload */;
#endif /* _WIN64 */
    __fastcall TBoundingBox(const System::Math::Vectors::PPoint3D Points, const int PointCount)/* overload */;
    static bool __fastcall _op_Equality(const TBoundingBox &LeftBox, const TBoundingBox &RightBox);
    bool __fastcall operator==(const TBoundingBox& __rhs) { return TBoundingBox::_op_Equality(*this, __rhs); };
    static bool __fastcall _op_Inequality(const TBoundingBox &LeftBox, const TBoundingBox &RightBox);
    bool __fastcall operator!=(const TBoundingBox& __rhs) { return TBoundingBox::_op_Inequality(*this, __rhs); };
    static TBoundingBox __fastcall _op_Addition(const TBoundingBox &LeftBox, const TBoundingBox &RightBox);
    TBoundingBox __fastcall operator+(const TBoundingBox& __rhs) { return TBoundingBox::_op_Addition(*this, __rhs); };
    static TBoundingBox __fastcall _op_Multiply(const TBoundingBox &LeftBox, const TBoundingBox &RightBox);
    TBoundingBox __fastcall operator*(const TBoundingBox& __rhs) { return TBoundingBox::_op_Multiply(*this, __rhs); };
    static TBoundingBox __fastcall Empty();
    float __fastcall FitIntoScale(const TBoundingBox &ADesignatedArea);
    TBoundingBox __fastcall FitInto(const TBoundingBox &ADesignatedArea, /* out */ float &ARatio)/* overload */;
    TBoundingBox __fastcall FitInto(const TBoundingBox &ADesignatedArea)/* overload */;
    TBoundingBox __fastcall Normalize();
    bool __fastcall IsEmpty(const float Epsilon = 1.000000E-04f);
    bool __fastcall Contains(const System::Math::Vectors::TPoint3D &APoint)/* overload */;
    bool __fastcall Contains(const TBoundingBox &ABox)/* overload */;
    bool __fastcall IntersectsWith(const TBoundingBox &ABox);
    TBoundingBox __fastcall Intersect(const TBoundingBox &DestBox);
    TBoundingBox __fastcall Union(const TBoundingBox &DestBox)/* overload */;
    TBoundingBox __fastcall Offset(const float DX, const float DY, const float DZ)/* overload */;
    TBoundingBox __fastcall Offset(const System::Math::Vectors::TPoint3D &APoint)/* overload */;
    TBoundingBox __fastcall Inflate(const float DX, const float DY, const float DZ)/* overload */;
    TBoundingBox __fastcall Inflate(const float DL, const float DT, const float DN, const float DR, const float DB, const float DF)/* overload */;
    System::Math::Vectors::TPoint3D __fastcall GetSize();
    bool __fastcall EqualsTo(const TBoundingBox &ABox, const float Epsilon = 0.000000E+00f);
    __property float Width = {read=GetWidth, write=SetWidth};
    __property float Height = {read=GetHeight, write=SetHeight};
    __property float Depth = {read=GetDepth, write=SetDepth};
    __property System::Math::Vectors::TPoint3D CenterPoint = {read=GetCenterPoint};
    TBoundingBox() {}
public:
    union
    {
        struct
        {
            System::Math::Vectors::TPoint3D MinCorner;
            System::Math::Vectors::TPoint3D MaxCorner;
        };
        struct
        {
            System::Math::Vectors::TPoint3D TopLeftNear;
            System::Math::Vectors::TPoint3D BottomRightFar;
        };
        struct
        {
            float Left;
            float Top;
            float Near;
            float Right;
            float Bottom;
            float Far;
        };
    };
};

Properties

Type Visibility Source Unit Parent
record
struct
public
FMX.Types3D.pas
FMX.Types3D.hpp
FMX.Types3D FMX.Types3D

Description

Record type for the information of an axis aligned box in 3D.

The TBoundingBox record type stores the maximum and minimum vertices which describe the box.

See Also