ACF $AcfVersion:0$
IShape.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-2.1-or-later OR GPL-2.0-or-later OR GPL-3.0-or-later OR LicenseRef-ACF-Commercial
2#pragma once
3
4
5// Qt includes
6#include <QtCore/QString>
7
8// ACF includes
9#include <imod/IModel.h>
10#include <imod/IObserver.h>
11#include <i2d/CRect.h>
12#include <iview/IVisualizable.h>
13#include <iview/ITouchable.h>
14#include <iview/ISelectable.h>
15
16
17namespace iview
18{
19
20
21class IColorSchema;
22
23
28class IShape:
29 virtual public imod::IObserver,
30 virtual public IVisualizable,
31 virtual public ITouchable
32{
33public:
38 {
39 CF_CALIB = 0x3663adf
40 };
41
46 virtual int GetLayerType() const = 0;
47
54 virtual i2d::CRect GetBoundingBox() const = 0;
55
59 virtual void SetVisible(bool state = true) = 0;
60
64 virtual const iview::IColorSchema* GetUserColorSchema() const = 0;
65
69 virtual void SetUserColorSchema(const IColorSchema* schemaPtr) = 0;
70
74 virtual void SetDefaultDescription(const QString& description) = 0;
75
76 virtual void SetToolTip(const QString& toolTip) = 0;
77
78 virtual bool IsInside(const istd::CIndex2d& screenPosition) const = 0;
79
80 virtual i2d::CVector2d GetLogPosition(const i2d::CVector2d& screenPosition) const = 0;
81
82 virtual bool IsAreaTouchAllowed() const { return false; }
83 virtual void SetAreaTouchAllowed(bool /*state*/ = true) {}
84
87 ITouchable::TouchState /*lastTouchState*/,
88 const istd::CIndex2d& /*screenPosition*/) const { return defaultPointer; }
89};
90
91
92} // namespace iview
93
94
95
96
Simple rectangle with integer bounds.
Definition CRect.h:22
Definition of position or mathematical vector on 2D plane.
Definition CVector2d.h:29
Common interface for all classes implementing the Observer functionality in the Model/Observer design...
Definition IObserver.h:156
Index implementation for addressing elements in 2D-space.
Definition CIndex2d.h:21
Defines set of standard pens, brushes and simple management of unions.
MousePointerMode
Defines possible states of mouse pointer.
Definition ISelectable.h:29
Common interface for all display console shapes.
Definition IShape.h:32
virtual const iview::IColorSchema * GetUserColorSchema() const =0
Get color schema from view or user defined.
ChangeFlags
Data model change notification flags.
Definition IShape.h:38
virtual i2d::CRect GetBoundingBox() const =0
Return bounding box in client window coordinates.
virtual void SetAreaTouchAllowed(bool=true)
Definition IShape.h:83
virtual void SetDefaultDescription(const QString &description)=0
Set default description will be used to display on console.
virtual void SetVisible(bool state=true)=0
Make shape to be visible or not.
virtual void SetToolTip(const QString &toolTip)=0
virtual bool IsInside(const istd::CIndex2d &screenPosition) const =0
virtual bool IsAreaTouchAllowed() const
Definition IShape.h:82
virtual void SetUserColorSchema(const IColorSchema *schemaPtr)=0
Set color schema to draw shape.
virtual int GetLayerType() const =0
Get layer type of this shape object.
virtual iview::ISelectable::MousePointerMode UpdateMousePointer(iview::ISelectable::MousePointerMode defaultPointer, ITouchable::TouchState, const istd::CIndex2d &) const
Definition IShape.h:85
virtual i2d::CVector2d GetLogPosition(const i2d::CVector2d &screenPosition) const =0
This interface describes all untransparent GUI objects, which can be touched.
Definition ITouchable.h:18
TouchState
Enumeration for possible shape touch states.
Definition ITouchable.h:25
In this library is defined 2D view concept and standard visualisation objects.