File indexing completed on 2025-01-18 10:03:30
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
0032 {
0033 return NCollection_Vec2<float> (Left, Top);
0034 }
0035
0036
0037 NCollection_Vec2<float>& TopLeft (NCollection_Vec2<float>& theVec) const
0038 {
0039 theVec.x() = Left;
0040 theVec.y() = Top;
0041 return theVec;
0042 }
0043
0044
0045 NCollection_Vec2<float>& TopRight (NCollection_Vec2<float>& theVec) const
0046 {
0047 theVec.x() = Right;
0048 theVec.y() = Top;
0049 return theVec;
0050 }
0051
0052
0053 NCollection_Vec2<float>& BottomLeft (NCollection_Vec2<float>& theVec) const
0054 {
0055 theVec.x() = Left;
0056 theVec.y() = Bottom;
0057 return theVec;
0058 }
0059
0060
0061 NCollection_Vec2<float>& BottomRight (NCollection_Vec2<float>& theVec) const
0062 {
0063 theVec.x() = Right;
0064 theVec.y() = Bottom;
0065 return theVec;
0066 }
0067
0068
0069 float Width() const
0070 {
0071 return Right - Left;
0072 }
0073
0074
0075 float Height() const
0076 {
0077 return Top - Bottom;
0078 }
0079
0080
0081 void DumpJson (Standard_OStream& theOStream, Standard_Integer) const
0082 {
0083 OCCT_DUMP_CLASS_BEGIN (theOStream, Font_Rect)
0084
0085 OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Left)
0086 OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Right)
0087 OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Top)
0088 OCCT_DUMP_FIELD_VALUE_NUMERICAL (theOStream, Bottom)
0089 }
0090 };
0091
0092 #endif