svgui
1.9
|
#include <ViewProxy.h>
Public Member Functions | |
ViewProxy (View *view, int scaleFactor) | |
Create a standard ViewProxy for the given view, mapping using the given scale factor. More... | |
ViewProxy (View *view, int scaleFactor, ModelId alignment) | |
Create a re-aligning ViewProxy for the given view, mapping using the given scale factor. More... | |
int | getId () const override |
Retrieve the id of this object. More... | |
sv_frame_t | getStartFrame () const override |
Retrieve the first visible sample frame on the widget. More... | |
sv_frame_t | getCentreFrame () const override |
Return the centre frame of the visible widget. More... | |
sv_frame_t | getEndFrame () const override |
Retrieve the last visible sample frame on the widget. More... | |
int | getXForFrame (sv_frame_t frame) const override |
Return the pixel x-coordinate corresponding to a given sample frame (which may be negative). More... | |
sv_frame_t | getFrameForX (int x) const override |
Return the closest frame to the given pixel x-coordinate. More... | |
int | getXForViewX (int viewx) const override |
Return the closest pixel x-coordinate corresponding to a given view x-coordinate. More... | |
int | getViewXForX (int x) const override |
Return the closest view x-coordinate corresponding to a given pixel x-coordinate. More... | |
sv_frame_t | getModelsStartFrame () const override |
sv_frame_t | getModelsEndFrame () const override |
double | getYForFrequency (double frequency, double minFreq, double maxFreq, bool logarithmic) const override |
Return the (maybe fractional) pixel y-coordinate corresponding to a given frequency, if the frequency range is as specified. More... | |
double | getFrequencyForY (double y, double minFreq, double maxFreq, bool logarithmic) const override |
Return the closest frequency to the given (maybe fractional) pixel y-coordinate, if the frequency range is as specified. More... | |
int | getTextLabelYCoord (const Layer *layer, QPainter &paint) const override |
Return a y-coordinate at which text labels for individual items in a layer may be drawn, so as not to overlap with those of other layers. More... | |
bool | getVisibleExtentsForUnit (QString unit, double &min, double &max, bool &log) const override |
Return the visible vertical extents for the given unit, if any. More... | |
ZoomLevel | getZoomLevel () const override |
Return the zoom level, i.e. More... | |
QRect | getPaintRect () const override |
To be called from a layer, to obtain the extent of the surface that the layer is currently painting to. More... | |
QSize | getPaintSize () const override |
int | getPaintWidth () const override |
int | getPaintHeight () const override |
bool | hasLightBackground () const override |
QColor | getForeground () const override |
QColor | getBackground () const override |
ViewManager * | getViewManager () const override |
bool | shouldIlluminateLocalFeatures (const Layer *layer, QPoint &point) const override |
bool | shouldShowFeatureLabels () const override |
void | drawMeasurementRect (QPainter &p, const Layer *layer, QRect rect, bool focus) const override |
void | updatePaintRect (QRect r) override |
double | scaleSize (double size) const override |
Scale up a size in pixels for a hi-dpi display without pixel doubling. More... | |
int | scalePixelSize (int size) const override |
Integer version of scaleSize. More... | |
double | scalePenWidth (double width) const override |
Scale up pen width for a hi-dpi display without pixel doubling. More... | |
QPen | scalePen (QPen pen) const override |
Apply scalePenWidth to a pen. More... | |
View * | getView () override |
const View * | getView () const override |
Static Protected Member Functions | |
static int | getNextId () |
Private Member Functions | |
sv_frame_t | alignToReference (sv_frame_t frame) const |
sv_frame_t | alignFromReference (sv_frame_t frame) const |
Private Attributes | |
View * | m_view |
int | m_scaleFactor |
ModelId | m_alignment |
Detailed Description
Definition at line 22 of file ViewProxy.h.
Constructor & Destructor Documentation
|
inline |
Create a standard ViewProxy for the given view, mapping using the given scale factor.
The scale factor is generally used with pixel-doubled "retina" Mac displays and is usually 1 elsewhere.
Definition at line 30 of file ViewProxy.h.
|
inline |
Create a re-aligning ViewProxy for the given view, mapping using the given scale factor.
The scale factor is generally used with pixel-doubled "retina" Mac displays and is usually 1 elsewhere.
Coordinates are mapped through the given alignment model, such that frame values passed from the caller are mapped "from reference" by that alignment before being used by the view or converted to pixel coordinates, and returned values are mapped back "to reference" before being passed back to the caller.
This form of proxy may be created specially for rendering a single layer which comes from a different alignment to that of the rest of the containing view.
Definition at line 49 of file ViewProxy.h.
Member Function Documentation
|
inlineoverridevirtual |
Retrieve the id of this object.
Implements LayerGeometryProvider.
Definition at line 52 of file ViewProxy.h.
References View::getId(), and m_view.
|
inlineoverridevirtual |
Retrieve the first visible sample frame on the widget.
This is a calculated value based on the centre-frame, widget width and zoom level. The result may be negative.
Implements LayerGeometryProvider.
Definition at line 55 of file ViewProxy.h.
References alignToReference(), View::getStartFrame(), and m_view.
|
inlineoverridevirtual |
Return the centre frame of the visible widget.
This is an exact value that does not depend on the zoom block size. Other frame values (start, end) are calculated from this based on the zoom and other factors.
Implements LayerGeometryProvider.
Definition at line 58 of file ViewProxy.h.
References alignToReference(), View::getCentreFrame(), and m_view.
|
inlineoverridevirtual |
Retrieve the last visible sample frame on the widget.
This is a calculated value based on the centre-frame, widget width and zoom level.
Implements LayerGeometryProvider.
Definition at line 61 of file ViewProxy.h.
References alignToReference(), View::getEndFrame(), and m_view.
|
inlineoverridevirtual |
Return the pixel x-coordinate corresponding to a given sample frame (which may be negative).
!! not actually correct, if frame lies between view's pixels
Implements LayerGeometryProvider.
Definition at line 64 of file ViewProxy.h.
References alignFromReference(), View::getXForFrame(), m_scaleFactor, and m_view.
|
inlineoverridevirtual |
Return the closest frame to the given pixel x-coordinate.
Implements LayerGeometryProvider.
Definition at line 68 of file ViewProxy.h.
References alignToReference(), View::getFrameForX(), m_scaleFactor, and m_view.
|
inlineoverridevirtual |
Return the closest pixel x-coordinate corresponding to a given view x-coordinate.
Implements LayerGeometryProvider.
Definition at line 75 of file ViewProxy.h.
References m_scaleFactor.
|
inlineoverridevirtual |
Return the closest view x-coordinate corresponding to a given pixel x-coordinate.
Implements LayerGeometryProvider.
Definition at line 78 of file ViewProxy.h.
References m_scaleFactor.
|
inlineoverridevirtual |
Implements LayerGeometryProvider.
Definition at line 81 of file ViewProxy.h.
References alignToReference(), View::getModelsStartFrame(), and m_view.
|
inlineoverridevirtual |
Implements LayerGeometryProvider.
Definition at line 84 of file ViewProxy.h.
References alignToReference(), View::getModelsEndFrame(), and m_view.
|
inlineoverridevirtual |
Return the (maybe fractional) pixel y-coordinate corresponding to a given frequency, if the frequency range is as specified.
This does not imply any policy about layer frequency ranges, but it might be useful for layers to match theirs up if desired.
Not thread-safe in logarithmic mode. Call only from GUI thread.
Implements LayerGeometryProvider.
Definition at line 87 of file ViewProxy.h.
References View::getYForFrequency(), m_scaleFactor, and m_view.
|
inlineoverridevirtual |
Return the closest frequency to the given (maybe fractional) pixel y-coordinate, if the frequency range is as specified.
Not thread-safe in logarithmic mode. Call only from GUI thread.
Implements LayerGeometryProvider.
Definition at line 93 of file ViewProxy.h.
References View::getFrequencyForY(), m_scaleFactor, and m_view.
|
inlineoverridevirtual |
Return a y-coordinate at which text labels for individual items in a layer may be drawn, so as not to overlap with those of other layers.
The returned coordinate will be near the top of the visible widget, but adjusted downward depending on how many other visible layers return true from their implementation of Layer::needsTextLabelHeight().
Implements LayerGeometryProvider.
Definition at line 98 of file ViewProxy.h.
References View::getTextLabelYCoord(), m_scaleFactor, and m_view.
|
inlineoverridevirtual |
Return the visible vertical extents for the given unit, if any.
That is:
- if at least one non-dormant layer uses the same unit and returns some values from its getDisplayExtents() method, return the extents from the topmost of those
- otherwise, if at least one non-dormant layer uses the same unit, return the union of the value extents of all of those
- otherwise return false
Implements LayerGeometryProvider.
Definition at line 101 of file ViewProxy.h.
References View::getVisibleExtentsForUnit(), and m_view.
|
inlineoverridevirtual |
Return the zoom level, i.e.
the number of frames per pixel or pixels per frame
Implements LayerGeometryProvider.
Definition at line 105 of file ViewProxy.h.
References View::getZoomLevel(), m_scaleFactor, and m_view.
|
inlineoverridevirtual |
To be called from a layer, to obtain the extent of the surface that the layer is currently painting to.
This may be the extent of the view (if 1x display scaling is in effect) or of a larger cached pixmap (if greater display scaling is in effect).
Implements LayerGeometryProvider.
Definition at line 117 of file ViewProxy.h.
References View::getPaintRect(), m_scaleFactor, and m_view.
Referenced by getPaintHeight(), getPaintSize(), and getPaintWidth().
|
inlineoverridevirtual |
Reimplemented from LayerGeometryProvider.
Definition at line 124 of file ViewProxy.h.
References getPaintRect().
|
inlineoverridevirtual |
Reimplemented from LayerGeometryProvider.
Definition at line 127 of file ViewProxy.h.
References getPaintRect().
|
inlineoverridevirtual |
Reimplemented from LayerGeometryProvider.
Definition at line 130 of file ViewProxy.h.
References getPaintRect().
|
inlineoverridevirtual |
Implements LayerGeometryProvider.
Definition at line 133 of file ViewProxy.h.
References View::hasLightBackground(), and m_view.
|
inlineoverridevirtual |
Implements LayerGeometryProvider.
Definition at line 136 of file ViewProxy.h.
References View::getForeground(), and m_view.
|
inlineoverridevirtual |
Implements LayerGeometryProvider.
Definition at line 139 of file ViewProxy.h.
References View::getBackground(), and m_view.
|
inlineoverridevirtual |
Implements LayerGeometryProvider.
Definition at line 142 of file ViewProxy.h.
References View::getViewManager(), and m_view.
|
inlineoverridevirtual |
Implements LayerGeometryProvider.
Definition at line 146 of file ViewProxy.h.
References m_scaleFactor, m_view, and View::shouldIlluminateLocalFeatures().
|
inlineoverridevirtual |
Implements LayerGeometryProvider.
Definition at line 154 of file ViewProxy.h.
References m_view, and View::shouldShowFeatureLabels().
|
inlineoverridevirtual |
Implements LayerGeometryProvider.
Definition at line 158 of file ViewProxy.h.
References View::drawMeasurementRect(), and m_view.
|
inlineoverridevirtual |
Implements LayerGeometryProvider.
Definition at line 163 of file ViewProxy.h.
References m_scaleFactor, and m_view.
|
inlineoverridevirtual |
Scale up a size in pixels for a hi-dpi display without pixel doubling.
This is like ViewManager::scalePixelSize, but taking and returning floating-point values rather than integer pixels. It is also a little more conservative - it never shrinks the size, it can only increase or leave it unchanged.
Implements LayerGeometryProvider.
Definition at line 177 of file ViewProxy.h.
References m_scaleFactor, m_view, and View::scaleSize().
|
inlineoverridevirtual |
Integer version of scaleSize.
Implements LayerGeometryProvider.
Definition at line 184 of file ViewProxy.h.
References m_scaleFactor, m_view, and View::scalePixelSize().
|
inlineoverridevirtual |
Scale up pen width for a hi-dpi display without pixel doubling.
This is like scaleSize except that it also scales the zero-width case.
Implements LayerGeometryProvider.
Definition at line 193 of file ViewProxy.h.
References m_scaleFactor, m_view, and View::scalePenWidth().
Referenced by scalePen().
|
inlineoverridevirtual |
Apply scalePenWidth to a pen.
Implements LayerGeometryProvider.
Definition at line 204 of file ViewProxy.h.
References scalePenWidth().
|
inlineoverridevirtual |
|
inlineoverridevirtual |
|
inlineprivate |
Definition at line 216 of file ViewProxy.h.
Referenced by getCentreFrame(), getEndFrame(), getFrameForX(), getModelsEndFrame(), getModelsStartFrame(), and getStartFrame().
|
inlineprivate |
Definition at line 224 of file ViewProxy.h.
Referenced by getXForFrame().
|
inlinestaticprotectedinherited |
Definition at line 48 of file LayerGeometryProvider.h.
Member Data Documentation
|
private |
Definition at line 212 of file ViewProxy.h.
Referenced by drawMeasurementRect(), getBackground(), getCentreFrame(), getEndFrame(), getForeground(), getFrameForX(), getFrequencyForY(), getId(), getModelsEndFrame(), getModelsStartFrame(), getPaintRect(), getStartFrame(), getTextLabelYCoord(), getView(), getViewManager(), getVisibleExtentsForUnit(), getXForFrame(), getYForFrequency(), getZoomLevel(), hasLightBackground(), scalePenWidth(), scalePixelSize(), scaleSize(), shouldIlluminateLocalFeatures(), shouldShowFeatureLabels(), and updatePaintRect().
|
private |
Definition at line 213 of file ViewProxy.h.
Referenced by getFrameForX(), getFrequencyForY(), getPaintRect(), getTextLabelYCoord(), getViewXForX(), getXForFrame(), getXForViewX(), getYForFrequency(), getZoomLevel(), scalePenWidth(), scalePixelSize(), scaleSize(), shouldIlluminateLocalFeatures(), and updatePaintRect().
|
private |
Definition at line 214 of file ViewProxy.h.
The documentation for this class was generated from the following file:
Generated by 1.8.11