File indexing completed on 2026-09-11 09:17:33
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015 #ifndef _Font_Rect_H__
0016 #define _Font_Rect_H__
0017
0018 #include <NCollection_Vec2.hxx>
0019 #include <Standard_Dump.hxx>
0020
0021
0022 struct Font_Rect
0023 {
0024
0025 float Left;
0026 float Right;
0027 float Top;
0028 float Bottom;
0029
0030
0031 NCollection_Vec2<float> TopLeft() const { return NCollection_Vec2<float>(Left, Top); }
0032
0033
0034 NCollection_Vec2<float>& TopLeft(NCollection_Vec2<float>& theVec) const
0035 {
0036 theVec.x() = Left;
0037 theVec.y() = Top;
0038 return theVec;
0039 }
0040
0041
0042 NCollection_Vec2<float>& TopRight(NCollection_Vec2<float>& theVec) const
0043 {
0044 theVec.x() = Right;
0045 theVec.y() = Top;
0046 return theVec;
0047 }
0048
0049
0050 NCollection_Vec2<float>& BottomLeft(NCollection_Vec2<float>& theVec) const
0051 {
0052 theVec.x() = Left;
0053 theVec.y() = Bottom;
0054 return theVec;
0055 }
0056
0057
0058 NCollection_Vec2<float>& BottomRight(NCollection_Vec2<float>& theVec) const
0059 {
0060 theVec.x() = Right;
0061 theVec.y() = Bottom;
0062 return theVec;
0063 }
0064
0065
0066 float Width() const { return Right - Left; }
0067
0068
0069 float Height() const { return Top - Bottom; }
0070
0071
0072 void DumpJson(Standard_OStream& theOStream, int) const
0073 {
0074 OCCT_DUMP_CLASS_BEGIN(theOStream, Font_Rect)
0075
0076 OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, Left)
0077 OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, Right)
0078 OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, Top)
0079 OCCT_DUMP_FIELD_VALUE_NUMERICAL(theOStream, Bottom)
0080 }
0081 };
0082
0083 #endif