ICF 3.1.1.10
Technical documentation of ICF Libraries
COrientRectangle.h
Go to the documentation of this file.
1/********************************************************************************
2** This file is part of the ICF Framework. Copyright (C) Witold Gantzke & Kirill Lepskiy
3** ICF Framework may be used under the terms of the LGPL License v. 2.1 by the Free Software Foundation.
4********************************************************************************/
5
6#pragma once
7
8
9// ICF includes
10#include <i2d/CRectangle.h>
11
12
13namespace i2d
14{
15
16
21{
22public:
24
26 {
27 CF_ORIENTATION = 0x6ba370
28 };
29
30 enum class Orientation
31 {
32 Up,
33 Right,
34 Down,
35 Left
36 };
37
45 void SetOrientation(Orientation orientation);
46
51
55 bool IsAxisReflected() const;
59 void SetAxisReflected(bool state);
60
81
82 // reimplemented (iser::ISerializable)
83 bool Serialize(iser::IArchive& archive) override;
84
85 // reimplemented (istd::IChangeable)
86 bool CopyFrom(const IChangeable& object, CompatibilityMode mode = CM_WITHOUT_REFS) override;
87 std::unique_ptr<istd::IChangeable> CloneMe(CompatibilityMode mode = CM_WITHOUT_REFS) const override;
88
89private:
90 Orientation m_orientation = Orientation::Up;
91 bool m_isReflected = false;
92};
93
94
95} // namespace i2d
96
97
Definition of orinted rectangle being parallel to axes.
CVector2d GetOrientRightBottom() const
Get oriented right-bottom point of this rectangle.
bool IsAxisReflected() const
Check if this rectangle is reflected along the orientation axis.
bool CopyFrom(const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS) override
bool Serialize(iser::IArchive &archive) override
Load or store state of this object as a archive stream.
Orientation GetOrientation() const
Get orientation of this rectangle.
CVector2d GetOrientLeftTop() const
Get oriented left-top point of this rectangle.
CVector2d GetOrientRightTop() const
Get oriented right-top point of this rectangle.
bool IsOrientationHorizontal() const
Check if orientation is horizontal.
CVector2d GetOrientLeftBottom() const
Get oriented left-bottom point of this rectangle.
std::unique_ptr< istd::IChangeable > CloneMe(CompatibilityMode mode=CM_WITHOUT_REFS) const override
Make a copy of this object.
void SetAxisReflected(bool state)
Set this rectangle to be reflected or not along the orientation axis.
void SetOrientation(Orientation orientation)
Set orientation of this rectangle.
Definition of rectangle area orthogonal to axis of coordination system.
Definition CRectangle.h:31
Definition of position or mathematical vector on 2D plane.
Definition CVector2d.h:29
Represent input/output persistence archive.
Definition IArchive.h:34
CompatibilityMode
Control how relationship betweeen objects are interpreted.
@ CM_WITHOUT_REFS
External references are simple ignored.
Contains the 2D objects.
Definition CAffine2d.h:15

© Witold Gantzke and Kirill Lepskiy