|
Krita Source Code Documentation
|
#include <KoViewConverter.h>
Inheritance diagram for KoViewConverter:Public Member Functions | |
| QTransform | documentToView () const |
| virtual QPointF | documentToView (const QPointF &documentPoint) const |
| virtual QRectF | documentToView (const QRectF &documentRect) const |
| virtual QSizeF | documentToView (const QSizeF &documentSize) const |
| virtual qreal | documentToViewX (qreal documentX) const |
| virtual qreal | documentToViewY (qreal documentY) const |
| KoViewConverter () | |
| virtual KoViewTransformStillPoint | makeDocStillPoint (const QPointF &docPoint) const |
Creates a still point that links the docPoint of the image (in document pixels!) to the corresponding point on the screen (in the canvas widget). | |
| virtual KoViewTransformStillPoint | makeWidgetStillPoint (const QPointF &viewPoint) const |
Creates a still point that links the viewPoint of the widget to the corresponding point of the image. | |
| virtual void | setZoom (qreal zoom) |
| QTransform | viewToDocument () const |
| virtual QPointF | viewToDocument (const QPointF &viewPoint) const |
| virtual QRectF | viewToDocument (const QRectF &viewRect) const |
| virtual QSizeF | viewToDocument (const QSizeF &viewSize) const |
| virtual qreal | viewToDocumentX (qreal viewX) const |
| virtual qreal | viewToDocumentY (qreal viewY) const |
| virtual QTransform | viewToWidget () const |
| virtual QTransform | widgetToView () const |
| qreal | zoom () const |
| virtual void | zoom (qreal *zoomX, qreal *zoomY) const |
| virtual | ~KoViewConverter () |
Private Attributes | |
| qreal | m_zoomLevel |
The interface for view conversions.
All KoShape based objects are using a postscript-point (pt) based measurement system which requires a conversion to view coordinates (in pixel sizes) at the moment we are painting, and a conversion to the normalized coordinate system if we receive mouse events so we can figure out which KoShape object was touched.
The zoom level is expressed on a scale of 0.0 to 1.0 to infinite, where 1.0 is 100%
Definition at line 31 of file KoViewConverter.h.
| KoViewConverter::KoViewConverter | ( | ) |
Definition at line 13 of file KoViewConverter.cpp.
|
inlinevirtual |
Definition at line 35 of file KoViewConverter.h.
| QTransform KoViewConverter::documentToView | ( | ) | const |
Definition at line 111 of file KoViewConverter.cpp.
References zoom().
|
virtual |
Convert a coordinate in pt to pixels.
| documentPoint | the point in the document coordinate system of a KoShape. |
Reimplemented in KoZoomHandler.
Definition at line 18 of file KoViewConverter.cpp.
References documentToViewX(), documentToViewY(), m_zoomLevel, and qFuzzyCompare().
|
virtual |
Convert a rectangle in pt to pixels.
| documentRect | the rect in the document coordinate system of a KoShape. |
Reimplemented in KoZoomHandler.
Definition at line 32 of file KoViewConverter.cpp.
References documentToView(), m_zoomLevel, and qFuzzyCompare().
|
virtual |
Convert a size in pt to pixels.
| documentSize | the size in pt. |
Reimplemented in KoZoomHandler.
Definition at line 46 of file KoViewConverter.cpp.
References documentToViewX(), documentToViewY(), m_zoomLevel, and qFuzzyCompare().
|
virtual |
Convert a single x coordinate in pt to pixels.
| documentX | the x coordinate in pt. |
Reimplemented in KisImageViewConverter, and KoZoomHandler.
Definition at line 66 of file KoViewConverter.cpp.
References m_zoomLevel.
|
virtual |
Convert a single y coordinate in pt to pixels.
| documentY | the y coordinate in pt. |
Reimplemented in KisImageViewConverter, and KoZoomHandler.
Definition at line 71 of file KoViewConverter.cpp.
References m_zoomLevel.
|
virtual |
Creates a still point that links the docPoint of the image (in document pixels!) to the corresponding point on the screen (in the canvas widget).
The link is "baked" in KoViewTransformStillPoint object, hence intermediate transformations will not affect it.
Reimplemented in KisCoordinatesConverter.
Reimplemented in KisCoordinatesConverter.
Definition at line 106 of file KoViewConverter.cpp.
|
virtual |
Creates a still point that links the viewPoint of the widget to the corresponding point of the image.
The link is "baked" in KoViewTransformStillPoint object, hence intermediate transformations will not affect it.
Reimplemented in KisCoordinatesConverter.
Reimplemented in KisCoordinatesConverter.
Definition at line 101 of file KoViewConverter.cpp.
References viewToDocument(), and widgetToView().
|
virtual |
Set the zoom level. 1.0 is 100%.
Reimplemented in KisCoordinatesConverter, and KoZoomHandler.
Definition at line 88 of file KoViewConverter.cpp.
References m_zoomLevel, qFuzzyCompare(), and zoom().
| QTransform KoViewConverter::viewToDocument | ( | ) | const |
Definition at line 118 of file KoViewConverter.cpp.
References zoom().
|
virtual |
Convert a coordinate in pixels to pt.
| viewPoint | the point in the coordinate system of the widget, or window. |
Reimplemented in KoZoomHandler.
Definition at line 25 of file KoViewConverter.cpp.
References m_zoomLevel, qFuzzyCompare(), viewToDocumentX(), and viewToDocumentY().
|
virtual |
Convert a rectangle in pixels to pt.
| viewRect | the rect in the coordinate system of the widget, or window. |
Reimplemented in KoZoomHandler.
Definition at line 39 of file KoViewConverter.cpp.
References m_zoomLevel, qFuzzyCompare(), and viewToDocument().
|
virtual |
Convert a size in pixels to pt.
| viewSize | the size in pixels. |
Reimplemented in KoZoomHandler.
Definition at line 53 of file KoViewConverter.cpp.
References m_zoomLevel, qFuzzyCompare(), viewToDocumentX(), and viewToDocumentY().
|
virtual |
Convert a single x coordinate in pixels to pt.
| viewX | the x coordinate in pixels. |
Reimplemented in KisImageViewConverter, and KoZoomHandler.
Definition at line 76 of file KoViewConverter.cpp.
References m_zoomLevel.
|
virtual |
Convert a single y coordinate in pixels to pt.
| viewY | the y coordinate in pixels. |
Reimplemented in KisImageViewConverter, and KoZoomHandler.
Definition at line 81 of file KoViewConverter.cpp.
References m_zoomLevel.
|
virtual |
Reimplemented in KisCoordinatesConverter.
Definition at line 125 of file KoViewConverter.cpp.
|
virtual |
Reimplemented in KisCoordinatesConverter.
Definition at line 130 of file KoViewConverter.cpp.
| qreal KoViewConverter::zoom | ( | ) | const |
Return the current zoom level. 1.0 is 100%.
Definition at line 96 of file KoViewConverter.cpp.
References m_zoomLevel.
|
virtual |
Retrieve the zoom levels of the individual x and y axes.
| zoomX | a pointer to a qreal which will be modified to the horizontal zoom. |
| zoomY | a pointer to a qreal which will be modified to the vertical zoom. |
Reimplemented in KoZoomHandler, KisImageViewConverter, and KoZoomHandler.
Definition at line 60 of file KoViewConverter.cpp.
References m_zoomLevel.
|
private |
Definition at line 150 of file KoViewConverter.h.