91 double* errorFactorPtr =
nullptr)
override;
95 double* errorFactorPtr =
nullptr)
override;
100 double* errorFactorPtr =
nullptr)
const override;
105 double* errorFactorPtr =
nullptr)
const override;
117 bool IsEqual(
const IChangeable&
object)
const override;
127 typedef std::vector<i2d::CVector2d> Nodes;
132 static bool ApplyTransform(Nodes& nodes,
135 double* errorFactorPtr =
nullptr);
140 static bool ApplyInverseTransform(
144 double* errorFactorPtr =
nullptr);
154 return int(m_positions.size());
160 return m_positions.empty();
166 Q_ASSERT(index >= 0 && index <
int(m_positions.size()));
168 return m_positions[index];
174 Q_ASSERT(index >= 0 && index <
int(m_positions.size()));
176 return m_positions[index];
182 Q_ASSERT(index >= 0 && index <
int(m_positions.size()));
186 m_positions[index] = position;
Base class for 2D-objects implementing interface i2d::IObject2d.
Definition of the data model for a polygon.
static QByteArray GetTypeName()
static const istd::IChangeable::ChangeSet s_removePolygonNodeChange
QByteArray GetFactoryId() const override
bool InvTransform(const ITransformation2d &transformation, ITransformation2d::ExactnessMode mode=ITransformation2d::EM_NONE, double *errorFactorPtr=nullptr) override
Do inverse transformation of this object.
i2d::CRectangle GetBoundingBox() const override
Get bounding box of this shape.
virtual bool InsertNode(const i2d::CVector2d &position)
Insert a node at the end of node table.
bool CopyFrom(const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS) override
virtual const i2d::CVector2d & GetNodePos(int index) const
Return position of node at specified index.
virtual void Clear()
Removes all nodes.
bool Transform(const ITransformation2d &transformation, ITransformation2d::ExactnessMode mode=ITransformation2d::EM_NONE, double *errorFactorPtr=nullptr) override
Transform this object using some transformation.
std::unique_ptr< istd::IChangeable > CloneMe(CompatibilityMode mode=CM_WITHOUT_REFS) const override
Make a copy of this object.
virtual void SetNodePos(int index, const i2d::CVector2d &position)
Set node at specified index.
bool IsEmpty() const
Return true if there are no points.
virtual int GetNodesCount() const
Return size of node table.
bool GetTransformed(const ITransformation2d &transformation, IObject2d &result, ITransformation2d::ExactnessMode mode=ITransformation2d::EM_NONE, double *errorFactorPtr=nullptr) const override
Calulate transformation of the object into second one.
bool Serialize(iser::IArchive &archive) override
Load or store state of this object as a archive stream.
i2d::CVector2d & GetNodePosRef(int index)
Get reference to position object for node.
bool GetInvTransformed(const ITransformation2d &transformation, IObject2d &result, ITransformation2d::ExactnessMode mode=ITransformation2d::EM_NONE, double *errorFactorPtr=nullptr) const override
Calulate inverse transformation of the object into second one.
virtual void SetNodesCount(int nodesCount)
Set new nodes count.
static const istd::IChangeable::ChangeSet s_insertPolygonNodeChange
static const istd::IChangeable::ChangeSet s_clearAllNodesChange
virtual bool RemoveNode(int index)
Remove a node at specified index.
virtual bool InsertNode(int index, const i2d::CVector2d &position)
Insert a node at specified index.
static const istd::IChangeable::ChangeSet s_createPolygonNodesChange
CVector2d GetCenter() const override
Returns center of this 2D-object.
void MoveCenterTo(const CVector2d &position) override
Move object to position position.
bool IsEqual(const IChangeable &object) const override
int GetSupportedOperations() const override
Get set of flags for supported operations.
Definition of rectangle area orthogonal to axis of coordination system.
Definition of position or mathematical vector on 2D plane.
Common interface for describing the 2D-objects.
Represent input/output persistence archive.
Help class which provides the automatic update mechanism of the model.
Set of change flags (its IDs).
CompatibilityMode
Control how relationship betweeen objects are interpreted.
@ CM_WITHOUT_REFS
External references are simple ignored.