ICF 3.1.1.10
Technical documentation of ICF Libraries
CPinShape.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#ifndef iview_CPinShape_included
7#define iview_CPinShape_included
8
9
10#include <i2d/CVector2d.h>
11#include <i2d/CPosition2d.h>
12
14
15
16namespace iview
17{
18
19
21{
22public:
24
26
27 // reimplemented (iview::IInteractiveShape)
28 virtual TouchState IsTouched(istd::CIndex2d position) const;
29
30 // reimplemented (imod::IObserver)
31 virtual bool OnModelAttached(imod::IModel* modelPtr, istd::IChangeable::ChangeSet& changeMask);
32
33 // reimplemented (iview::IVisualizable)
34 virtual void Draw(QPainter& drawContext) const;
35
36 // reimplemented (iview::IMouseActionObserver)
37 virtual bool OnMouseButton(istd::CIndex2d position, Qt::MouseButton buttonType, bool downFlag);
38 virtual bool OnMouseMove(istd::CIndex2d position);
39
40protected:
41 // reimplemented (iview::CShapeBase)
42 virtual i2d::CRect CalcBoundingBox() const;
43
44 // reimplemented (iview::CInteractiveShapeBase)
45 virtual void BeginLogDrag(const i2d::CVector2d& reference);
46 virtual void SetLogDragPosition(const i2d::CVector2d& position);
47
49};
50
51
52} // namespace iview
53
54
55#endif // !iview_CPinShape_included
56
57
Simple rectangle with integer bounds.
Definition CRect.h:26
Definition of position or mathematical vector on 2D plane.
Definition CVector2d.h:29
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
Base class of shape implementation with user interaction.
virtual void SetLogDragPosition(const i2d::CVector2d &position)
i2d::CVector2d m_referencePosition
Definition CPinShape.h:48
CInteractiveShapeBase BaseClass
Definition CPinShape.h:23
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 BeginLogDrag(const i2d::CVector2d &reference)
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 Draw(QPainter &drawContext) const
Draw this shape using draw context.
virtual bool OnMouseMove(istd::CIndex2d position)
It is called, when mouse is moved.
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