LibreOffice Module lotuswordpro (master) 1
Public Member Functions | Static Public Member Functions | Private Attributes | List of all members
SdwRectangle Class Reference

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
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ SdwRectangle() [1/2]

SdwRectangle::SdwRectangle ( )

Definition at line 68 of file lwpsdwrect.cxx.

◆ SdwRectangle() [2/2]

SdwRectangle::SdwRectangle ( const Point rPt0,
const Point rPt1,
const Point rPt2,
const Point rPt3 
)

Definition at line 77 of file lwpsdwrect.cxx.

References Y.

Member Function Documentation

◆ CalcDistBetween2Points()

double SdwRectangle::CalcDistBetween2Points ( tools::Long  nX1,
tools::Long  nY1,
tools::Long  nX2,
tools::Long  nY2 
)
static

Definition at line 171 of file lwpsdwrect.cxx.

Referenced by GetHeight(), and GetWidth().

◆ GetHeight()

tools::Long SdwRectangle::GetHeight ( ) const

Definition at line 112 of file lwpsdwrect.cxx.

References CalcDistBetween2Points(), and m_nRectCorner.

Referenced by GetOriginalRect().

◆ GetOriginalRect()

tools::Rectangle SdwRectangle::GetOriginalRect ( ) const

◆ GetRectCenter()

Point SdwRectangle::GetRectCenter ( ) const

Definition at line 88 of file lwpsdwrect.cxx.

References m_nRectCorner.

Referenced by GetOriginalRect(), and GetRotationAngle().

◆ GetRotationAngle()

double SdwRectangle::GetRotationAngle ( ) const

◆ GetWidth()

tools::Long SdwRectangle::GetWidth ( ) const

Definition at line 99 of file lwpsdwrect.cxx.

References CalcDistBetween2Points(), and m_nRectCorner.

Referenced by GetOriginalRect().

◆ IsRectRotated()

bool SdwRectangle::IsRectRotated ( ) const
inline

Definition at line 104 of file lwpsdwrect.hxx.

References m_bRotated.

Referenced by LwpDrawRectangle::CreateStandardDrawObj().

Member Data Documentation

◆ m_bRotated

bool SdwRectangle::m_bRotated
private

Definition at line 91 of file lwpsdwrect.hxx.

Referenced by GetOriginalRect(), GetRotationAngle(), and IsRectRotated().

◆ m_nRectCorner

std::array<Point, 4> SdwRectangle::m_nRectCorner
private

Definition at line 92 of file lwpsdwrect.hxx.

Referenced by GetHeight(), GetOriginalRect(), GetRectCenter(), GetRotationAngle(), and GetWidth().


The documentation for this class was generated from the following files: