ICF 3.1.1.10
Technical documentation of ICF Libraries
CDistanceToolShape.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 <iview/CShapeBase.h>
12
13
14namespace iview
15{
16
17
19 public CShapeBase,
20 virtual public iview::IInteractiveShape
21{
22public:
24
26
27 // reimplemented (iview::IMouseActionObserver)
28 virtual bool OnMouseButton(istd::CIndex2d position, Qt::MouseButton buttonType, bool downFlag);
29 virtual bool OnMouseMove(istd::CIndex2d position);
30
31 // reimplemented (iview::IInteractiveShape)
32 virtual bool IsSelected() const;
33 virtual void SetSelected(bool selectFlag = true);
34
35 // reimplemented (imod::IObserver)
36 virtual bool OnModelAttached(imod::IModel* modelPtr, istd::IChangeable::ChangeSet& changeMask);
37
38 // reimplemented (iview::ITouchable)
39 virtual TouchState IsTouched(istd::CIndex2d position) const;
40
41protected:
43
44 virtual void DrawLabel(QPainter& drawContext) const;
45
46 // reimplemented (iview::IVisualizable)
47 virtual void Draw(QPainter& drawContext) const;
48
49 // reimplemented (iview::CShapeBase)
50 virtual i2d::CRect CalcBoundingBox() const;
51
52private:
53 enum MeasureState
54 {
55 MS_NONE = 0,
56 MS_START,
57 MS_DONE
58 };
59
60 bool IsDistanceMeasureToolActive() const;
61 void BeginDrag();
62 void EndDrag();
63
64private:
65 istd::CIndex2d m_screenPos;
66 MeasureState m_measureState;
67 int m_dragNodeIndex;
68 bool m_isSelected;
69};
70
71
72} // namespace iview
73
Simple rectangle with integer bounds.
Definition CRect.h:26
Common interface for model objects, that supports Model/Observer design pattern.
Definition IModel.h:29
Index implementation for addressing elements in 2D-space.
Definition CIndex2d.h:25
Set of change flags (its IDs).
Definition IChangeable.h:38
virtual TouchState IsTouched(istd::CIndex2d position) const
Check, if any shape is touched.
virtual bool OnMouseButton(istd::CIndex2d position, Qt::MouseButton buttonType, bool downFlag)
It is called, when mouse button is pushed down or up on this object.
virtual void DrawLabel(QPainter &drawContext) const
const i2d::ICalibration2d * GetCalibration() const
virtual bool IsSelected() const
Check, if this shape is selected.
virtual i2d::CRect CalcBoundingBox() const
Calculate bounding box.
virtual bool OnModelAttached(imod::IModel *modelPtr, istd::IChangeable::ChangeSet &changeMask)
This call back function will be called, if an observable object is about to be attached.
virtual void Draw(QPainter &drawContext) const
Draw this shape using draw context.
virtual bool OnMouseMove(istd::CIndex2d position)
It is called, when mouse is moved.
virtual void SetSelected(bool selectFlag=true)
Inform that this object was selected or deselected.
Base class of standard shape implementation.
Definition CShapeBase.h:34
Common interface for all display console shapes which can interacts with user.
TouchState
Enumeration for possible shape touch states.
Definition ITouchable.h:30
In this library is defined 2D view concept and standard visualisation objects.

© Witold Gantzke and Kirill Lepskiy