ICF 3.1.1.10
Technical documentation of ICF Libraries
CFpImageShape.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// Qt includes
10#include <QtGui/QPixmap>
11
12// ICF includes
13#include <istd/TRange.h>
14#include <iimg/IBitmap.h>
15#include <iview/CShapeBase.h>
16
17
18namespace iview
19{
20
21
26{
27public:
29
30 explicit CFpImageShape();
31
32 void SetValueRange(const istd::CRange& valueRange);
33
34 // reimplemented (iview::IShape)
35 virtual void Draw(QPainter& drawContext) const;
36
37 // reimplemented (imod::IObserver)
38 virtual bool OnModelAttached(imod::IModel* modelPtr, istd::IChangeable::ChangeSet& changeMask);
39 virtual void AfterModelChange(imod::IModel* modelPtr, const istd::IChangeable::ChangeSet& changeSet);
40
41 // reimplemented (iview::CShapeBase)
42 virtual i2d::CRect CalcBoundingBox() const;
43
44 // reimplemented (iview::ITouchable)
45 virtual TouchState IsTouched(istd::CIndex2d position) const;
46 virtual QString GetShapeDescriptionAt(istd::CIndex2d position) const;
47
48protected:
49 virtual bool CalcColoredImage() const;
50 virtual void CalcColorTable();
51 virtual void DrawImage(
52 QPainter& painter,
53 const QImage& image,
54 const i2d::CRect& bitmapArea,
55 const i2d::CAffine2d& destTransform) const;
56
57private:
58 mutable QImage m_coloredImage;
59 QList<QRgb> m_colorTable;
60
61 istd::CRange m_valueRange;
62};
63
64
65} // namespace iview
66
67
This class defines an affine 2D-transformation.
Definition CAffine2d.h:22
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
View visualization of floating point images.
virtual void CalcColorTable()
virtual void DrawImage(QPainter &painter, const QImage &image, const i2d::CRect &bitmapArea, const i2d::CAffine2d &destTransform) const
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 QString GetShapeDescriptionAt(istd::CIndex2d position) const
Get description to shape at specified position.
virtual bool CalcColoredImage() const
virtual i2d::CRect CalcBoundingBox() const
Calculate bounding box.
virtual void AfterModelChange(imod::IModel *modelPtr, const istd::IChangeable::ChangeSet &changeSet)
This function will be called after update of the observer contents occures.
void SetValueRange(const istd::CRange &valueRange)
virtual TouchState IsTouched(istd::CIndex2d position) const
Check, if any shape is touched.
virtual void Draw(QPainter &drawContext) const
Draw this shape using draw context.
Base class of standard shape implementation.
Definition CShapeBase.h:34
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