6#include <QtCore/QRectF>
32 CRectangle(
double left,
double top,
double width,
double height);
277 operator QRectF()
const;
286 double* errorFactorPtr =
NULL)
override;
290 double* errorFactorPtr =
NULL)
override;
295 double* errorFactorPtr =
NULL)
const override;
300 double* errorFactorPtr =
NULL)
const override;
361 return m_horizontalRange;
367 return m_horizontalRange;
373 return m_verticalRange;
379 return m_verticalRange;
Definition of a line in 2D-space.
Base class for 2D-objects implementing interface i2d::IObject2d.
Simple rectangle with integer bounds.
Definition of rectangle area orthogonal to axis of coordination system.
double GetTop() const
Get value of top boundary.
double GetHeight() const
Get height of this rectangle.
void SetBottom(double bottom)
Set value of bottom boundary.
void SetBottomLeft(const CVector2d &bottomLeft)
Set left-bottom point of this rectangle.
CVector2d GetTopCenter() const
Get point in center of top edge.
CRectangle GetTranslated(const i2d::CVector2d &delta) const
virtual bool Serialize(iser::IArchive &archive) override
Load or store state of this object as a archive stream.
void Reset()
Make rectangle empty.
double GetDistance(const CVector2d &position) const
Get distance from nearest point of this rectangle to specified position.
void Intersect(const CRectangle &rectangle)
Set new rectangle as intersection of the current rectangle with a given one.
CVector2d GetLeftBottom() const
Get left-bottom point of this rectangle.
const istd::CRange & GetHorizontalRange() const
Get values of horizontal boundaries.
CVector2d GetBottomCenter() const
Get point in center of bottom edge.
virtual QByteArray GetFactoryId() const override
double GetLeft() const
Get value of left boundary.
void Translate(const i2d::CVector2d &delta)
void SetTop(double top)
Set value of top boundary.
bool IsIntersectedBy(const CLine2d &line) const
Returns true, if this rectangle is intersected by the line rect.
CVector2d GetRightTop() const
Get right-top point of this rectangle.
void SetBottomRight(const CVector2d &bottomRight)
Set right-bottom point of this rectangle.
bool IsEmpty() const
Return true if the rectangle is empty.
void Expand(const CRectangle &rect)
Expand rectangle.
CVector2d GetRightBottom() const
Get right-bottom point of this rectangle.
void Unite(const i2d::CVector2d &position)
Set this rectangle to union of rectangle and point.
CLine2d GetIntersection(const CLine2d &line) const
Get resulting line of the intersection of this rectangle with the line line.
bool operator==(const CRectangle &rect) const
virtual int GetSupportedOperations() const override
Get set of flags for supported operations.
double GetBottom() const
Get value of bottom boundary.
void SetRight(double right)
Set value of right boundary.
void SetTopLeft(const CVector2d &topLeft)
Set left-top point of this rectangle.
CRectangle(const istd::CRange &horizontalRange, const istd::CRange &verticalRange)
CVector2d GetLeftTop() const
Get left-top point of this rectangle.
virtual CRectangle GetBoundingBox() const override
Get bounding box of this shape.
CVector2d GetRightCenter() const
Get point in center of right edge.
bool Contains(const CVector2d &point) const
Check if some point is contained in this rectangle.
CRectangle(double left, double top, double width, double height)
static QByteArray GetTypeName()
CRectangle GetUnion(const CRectangle &rect) const
Get union of two rectangles.
istd::CRange & GetVerticalRangeRef()
Get values of vertical boundaries as reference.
bool operator!=(const CRectangle &rect) const
virtual bool GetTransformed(const ITransformation2d &transformation, IObject2d &result, ITransformation2d::ExactnessMode mode=ITransformation2d::EM_NONE, double *errorFactorPtr=NULL) const override
Calulate transformation of the object into second one.
CRectangle GetIntersection(const CRectangle &rect) const
Get resulting rectangle of the intersection of this rectangle with rect.
void SetVerticalRange(const istd::CRange &range)
Set values of vertical boundaries.
virtual CVector2d GetCenter() const override
Returns center of this 2D-object.
CVector2d GetNearestPointTo(const CVector2d &point) const
Get the nearest point in the rectangle for the some given point.
virtual bool InvTransform(const ITransformation2d &transformation, ITransformation2d::ExactnessMode mode=ITransformation2d::EM_NONE, double *errorFactorPtr=NULL) override
Do inverse transformation of this object.
CRectangle GetUnion(const i2d::CVector2d &position) const
Get union of this rectangle and point.
istd::CRange & GetHorizontalRangeRef()
Get values of horizontal boundaries as reference.
static const i2d::CRectangle & GetInvalid()
Get invalid rectangle.
double GetMaxDistance(const CVector2d &position) const
Get maximal distance from points of this rectangle to specified position.
void SetHorizontalRange(const istd::CRange &range)
Set values of horizontal boundaries.
static const i2d::CRectangle & GetEmpty()
Get empty rectangle with all values set to 0.
virtual bool Transform(const ITransformation2d &transformation, ITransformation2d::ExactnessMode mode=ITransformation2d::EM_NONE, double *errorFactorPtr=NULL) override
Transform this object using some transformation.
bool IsValidNonEmpty() const
Return true if the rectangle is valid and it is not empty.
virtual bool CopyFrom(const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS) override
const istd::CRange & GetVerticalRange() const
Get values of vertical boundaries.
CRectangle(const istd::CIndex2d &size)
bool Contains(const CRectangle &rect) const
Check if some rectangle is fully contained in this rectangle.
double GetRight() const
Get value of right boundary.
void Unite(const CRectangle &rect)
Set this rectangle to union of two rectangles.
CRectangle(const i2d::CRect &rect)
CVector2d GetSize() const
Get size of this rectangle.
void SetLeft(double left)
Set value of left boundary.
bool IsIntersectedBy(const CRectangle &rect) const
Returns true, if this rectangle is intersected by the other rectangle rect.
virtual void MoveCenterTo(const CVector2d &position) override
Move object to position position.
CRectangle(const CVector2d &topLeft, const CVector2d &bottomRight)
double GetWidth() const
Get width of this rectangle.
void SetTopRight(const CVector2d &topRight)
Set right-top point of this rectangle.
CRectangle GetExpanded(const CRectangle &rect) const
Get expanded rectangle (simple sum of boundary values).
virtual istd::TUniqueInterfacePtr< istd::IChangeable > CloneMe(CompatibilityMode mode=CM_WITHOUT_REFS) const override
Make a copy of this object.
bool IsValid() const
Return true if the rectangle is valid.
virtual bool GetInvTransformed(const ITransformation2d &transformation, IObject2d &result, ITransformation2d::ExactnessMode mode=ITransformation2d::EM_NONE, double *errorFactorPtr=NULL) const override
Calulate inverse transformation of the object into second one.
CVector2d GetLeftCenter() const
Get point in center of left edge.
bool Contains(const istd::CIndex2d &point) const
Check if some point is contained in this rectangle.
Definition of position or mathematical vector on 2D plane.
Common interface for describing the 2D-objects.
Represents an input/output persistence archive for object serialization.
Index implementation for addressing elements in 2D-space.
CompatibilityMode
Control how relationship betweeen objects are interpreted.
@ CM_WITHOUT_REFS
External references are simple ignored.
ValueType GetMaxValue() const
Get the top value.
ValueType GetMinValue() const
Get the bottom value.
Unique ownership smart pointer for interface types.