LibreOffice Module lotuswordpro (master) 1
|
SdwRectangle: Not like rectangle in SODC, rectangles in Word Pro are defined by 4 points. More...
#include <lwpsdwrect.hxx>
Public Member Functions | |
SdwRectangle () | |
SdwRectangle (const Point &rPt0, const Point &rPt1, const Point &rPt2, const Point &rPt3) | |
bool | IsRectRotated () const |
Point | GetRectCenter () const |
tools::Long | GetWidth () const |
tools::Long | GetHeight () const |
tools::Rectangle | GetOriginalRect () const |
double | GetRotationAngle () const |
Static Public Member Functions | |
static double | CalcDistBetween2Points (tools::Long nX1, tools::Long nY1, tools::Long nX2, tools::Long nY2) |
Private Attributes | |
bool | m_bRotated |
std::array< Point, 4 > | m_nRectCorner |
SdwRectangle: Not like rectangle in SODC, rectangles in Word Pro are defined by 4 points.
So they can be any posture in the two-dimensional coordinate system. The class is used to describe such rectangles. The four corner points must be saved in member variable:m_nRectCorner one after another. We assume the input order(the same order in .lwp files) is as below:
y ^ m_nRectCorner[3] m_nRectCorner[2]
-----------------— | |
---|---|
-----------------— |
| m_nRectCorner[0] m_nRectCorner[1] | |----------------------------------------------------—> (0,0) x
Definition at line 88 of file lwpsdwrect.hxx.
SdwRectangle::SdwRectangle | ( | ) |
Definition at line 68 of file lwpsdwrect.cxx.
SdwRectangle::SdwRectangle | ( | const Point & | rPt0, |
const Point & | rPt1, | ||
const Point & | rPt2, | ||
const Point & | rPt3 | ||
) |
Definition at line 77 of file lwpsdwrect.cxx.
References Y.
|
static |
Definition at line 171 of file lwpsdwrect.cxx.
Referenced by GetHeight(), and GetWidth().
tools::Long SdwRectangle::GetHeight | ( | ) | const |
Definition at line 112 of file lwpsdwrect.cxx.
References CalcDistBetween2Points(), and m_nRectCorner.
Referenced by GetOriginalRect().
tools::Rectangle SdwRectangle::GetOriginalRect | ( | ) | const |
Definition at line 125 of file lwpsdwrect.cxx.
References GetHeight(), GetRectCenter(), GetWidth(), m_bRotated, m_nRectCorner, Point::X(), and Point::Y().
Referenced by LwpDrawRectangle::CreateStandardDrawObj().
Point SdwRectangle::GetRectCenter | ( | ) | const |
Definition at line 88 of file lwpsdwrect.cxx.
References m_nRectCorner.
Referenced by GetOriginalRect(), and GetRotationAngle().
double SdwRectangle::GetRotationAngle | ( | ) | const |
Definition at line 148 of file lwpsdwrect.cxx.
References GetRectCenter(), m_bRotated, m_nRectCorner, Point::X(), and Point::Y().
Referenced by LwpDrawRectangle::CreateStandardDrawObj().
tools::Long SdwRectangle::GetWidth | ( | ) | const |
Definition at line 99 of file lwpsdwrect.cxx.
References CalcDistBetween2Points(), and m_nRectCorner.
Referenced by GetOriginalRect().
|
inline |
Definition at line 104 of file lwpsdwrect.hxx.
References m_bRotated.
Referenced by LwpDrawRectangle::CreateStandardDrawObj().
|
private |
Definition at line 91 of file lwpsdwrect.hxx.
Referenced by GetOriginalRect(), GetRotationAngle(), and IsRectRotated().
|
private |
Definition at line 92 of file lwpsdwrect.hxx.
Referenced by GetHeight(), GetOriginalRect(), GetRectCenter(), GetRotationAngle(), and GetWidth().