Nakuja Flight Computer Testing and Simulation Engine (NaFCTSE) 1.0
A testing and verification tool for the Nakuja Rocket Project flight computers
Loading...
Searching...
No Matches
QCPPolarAxisRadial Class Reference

The radial axis inside a radial plot. More...

Inheritance diagram for QCPPolarAxisRadial:
QCPLayerable

Public Types

enum  AngleReference { arAbsolute , arAngularAxis }
 
enum  ScaleType { stLinear , stLogarithmic }
 
enum  SelectablePart { spNone = 0 , spAxis = 0x001 , spTickLabels = 0x002 , spAxisLabel = 0x004 }
 
enum  LabelMode { lmUpright , lmRotated }
 

Signals

void rangeChanged (const QCPRange &newRange)
 
void rangeChanged (const QCPRange &newRange, const QCPRange &oldRange)
 
void scaleTypeChanged (QCPPolarAxisRadial::ScaleType scaleType)
 
void selectionChanged (const QCPPolarAxisRadial::SelectableParts &parts)
 
void selectableChanged (const QCPPolarAxisRadial::SelectableParts &parts)
 
- Signals inherited from QCPLayerable
void layerChanged (QCPLayer *newLayer)
 

Public Member Functions

 QCPPolarAxisRadial (QCPPolarAxisAngular *parent)
 
bool rangeDrag () const
 
bool rangeZoom () const
 
double rangeZoomFactor () const
 
QCPPolarAxisAngularangularAxis () const
 
ScaleType scaleType () const
 
const QCPRange range () const
 
bool rangeReversed () const
 
double angle () const
 
AngleReference angleReference () const
 
QSharedPointer< QCPAxisTickerticker () const
 
bool ticks () const
 
bool tickLabels () const
 
int tickLabelPadding () const
 
QFont tickLabelFont () const
 
QColor tickLabelColor () const
 
double tickLabelRotation () const
 
LabelMode tickLabelMode () const
 
QString numberFormat () const
 
int numberPrecision () const
 
QVector< double > tickVector () const
 
QVector< double > subTickVector () const
 
QVector< QString > tickVectorLabels () const
 
int tickLengthIn () const
 
int tickLengthOut () const
 
bool subTicks () const
 
int subTickLengthIn () const
 
int subTickLengthOut () const
 
QPen basePen () const
 
QPen tickPen () const
 
QPen subTickPen () const
 
QFont labelFont () const
 
QColor labelColor () const
 
QString label () const
 
int labelPadding () const
 
SelectableParts selectedParts () const
 
SelectableParts selectableParts () const
 
QFont selectedTickLabelFont () const
 
QFont selectedLabelFont () const
 
QColor selectedTickLabelColor () const
 
QColor selectedLabelColor () const
 
QPen selectedBasePen () const
 
QPen selectedTickPen () const
 
QPen selectedSubTickPen () const
 
void setRangeDrag (bool enabled)
 
void setRangeZoom (bool enabled)
 
void setRangeZoomFactor (double factor)
 
Q_SLOT void setScaleType (QCPPolarAxisRadial::ScaleType type)
 
Q_SLOT void setRange (const QCPRange &range)
 
void setRange (double lower, double upper)
 
void setRange (double position, double size, Qt::AlignmentFlag alignment)
 
void setRangeLower (double lower)
 
void setRangeUpper (double upper)
 
void setRangeReversed (bool reversed)
 
void setAngle (double degrees)
 
void setAngleReference (AngleReference reference)
 
void setTicker (QSharedPointer< QCPAxisTicker > ticker)
 
void setTicks (bool show)
 
void setTickLabels (bool show)
 
void setTickLabelPadding (int padding)
 
void setTickLabelFont (const QFont &font)
 
void setTickLabelColor (const QColor &color)
 
void setTickLabelRotation (double degrees)
 
void setTickLabelMode (LabelMode mode)
 
void setNumberFormat (const QString &formatCode)
 
void setNumberPrecision (int precision)
 
void setTickLength (int inside, int outside=0)
 
void setTickLengthIn (int inside)
 
void setTickLengthOut (int outside)
 
void setSubTicks (bool show)
 
void setSubTickLength (int inside, int outside=0)
 
void setSubTickLengthIn (int inside)
 
void setSubTickLengthOut (int outside)
 
void setBasePen (const QPen &pen)
 
void setTickPen (const QPen &pen)
 
void setSubTickPen (const QPen &pen)
 
void setLabelFont (const QFont &font)
 
void setLabelColor (const QColor &color)
 
void setLabel (const QString &str)
 
void setLabelPadding (int padding)
 
void setSelectedTickLabelFont (const QFont &font)
 
void setSelectedLabelFont (const QFont &font)
 
void setSelectedTickLabelColor (const QColor &color)
 
void setSelectedLabelColor (const QColor &color)
 
void setSelectedBasePen (const QPen &pen)
 
void setSelectedTickPen (const QPen &pen)
 
void setSelectedSubTickPen (const QPen &pen)
 
Q_SLOT void setSelectableParts (const QCPPolarAxisRadial::SelectableParts &selectableParts)
 
Q_SLOT void setSelectedParts (const QCPPolarAxisRadial::SelectableParts &selectedParts)
 
virtual double selectTest (const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE
 
void moveRange (double diff)
 
void scaleRange (double factor)
 
void scaleRange (double factor, double center)
 
void rescale (bool onlyVisiblePlottables=false)
 
void pixelToCoord (QPointF pixelPos, double &angleCoord, double &radiusCoord) const
 
QPointF coordToPixel (double angleCoord, double radiusCoord) const
 
double coordToRadius (double coord) const
 
double radiusToCoord (double radius) const
 
SelectablePart getPartAt (const QPointF &pos) const
 
- Public Member Functions inherited from QCPLayerable
 QCPLayerable (QCustomPlot *plot, QString targetLayer=QString(), QCPLayerable *parentLayerable=nullptr)
 
bool visible () const
 
QCustomPlotparentPlot () const
 
QCPLayerableparentLayerable () const
 
QCPLayerlayer () const
 
bool antialiased () const
 
void setVisible (bool on)
 
Q_SLOT bool setLayer (QCPLayer *layer)
 
bool setLayer (const QString &layerName)
 
void setAntialiased (bool enabled)
 
bool realVisibility () const
 

Protected Member Functions

virtual void applyDefaultAntialiasingHint (QCPPainter *painter) const Q_DECL_OVERRIDE
 
virtual void draw (QCPPainter *painter) Q_DECL_OVERRIDE
 
virtual QCP::Interaction selectionCategory () const Q_DECL_OVERRIDE
 
virtual void selectEvent (QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged) Q_DECL_OVERRIDE
 
virtual void deselectEvent (bool *selectionStateChanged) Q_DECL_OVERRIDE
 
virtual void mousePressEvent (QMouseEvent *event, const QVariant &details) Q_DECL_OVERRIDE
 
virtual void mouseMoveEvent (QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE
 
virtual void mouseReleaseEvent (QMouseEvent *event, const QPointF &startPos) Q_DECL_OVERRIDE
 
virtual void wheelEvent (QWheelEvent *event) Q_DECL_OVERRIDE
 
void updateGeometry (const QPointF &center, double radius)
 
void setupTickVectors ()
 
QPen getBasePen () const
 
QPen getTickPen () const
 
QPen getSubTickPen () const
 
QFont getTickLabelFont () const
 
QFont getLabelFont () const
 
QColor getTickLabelColor () const
 
QColor getLabelColor () const
 
- Protected Member Functions inherited from QCPLayerable
virtual void parentPlotInitialized (QCustomPlot *parentPlot)
 
virtual QRect clipRect () const
 
virtual void mouseDoubleClickEvent (QMouseEvent *event, const QVariant &details)
 
void initializeParentPlot (QCustomPlot *parentPlot)
 
void setParentLayerable (QCPLayerable *parentLayerable)
 
bool moveToLayer (QCPLayer *layer, bool prepend)
 
void applyAntialiasingHint (QCPPainter *painter, bool localAntialiased, QCP::AntialiasedElement overrideElement) const
 

Protected Attributes

bool mRangeDrag
 
bool mRangeZoom
 
double mRangeZoomFactor
 
QCPPolarAxisAngularmAngularAxis
 
double mAngle
 
AngleReference mAngleReference
 
SelectableParts mSelectableParts
 
SelectableParts mSelectedParts
 
QPen mBasePen
 
QPen mSelectedBasePen
 
int mLabelPadding
 
QString mLabel
 
QFont mLabelFont
 
QFont mSelectedLabelFont
 
QColor mLabelColor
 
QColor mSelectedLabelColor
 
bool mTickLabels
 
QFont mTickLabelFont
 
QFont mSelectedTickLabelFont
 
QColor mTickLabelColor
 
QColor mSelectedTickLabelColor
 
int mNumberPrecision
 
QLatin1Char mNumberFormatChar
 
bool mNumberBeautifulPowers
 
bool mNumberMultiplyCross
 
bool mTicks
 
bool mSubTicks
 
int mTickLengthIn
 
int mTickLengthOut
 
int mSubTickLengthIn
 
int mSubTickLengthOut
 
QPen mTickPen
 
QPen mSelectedTickPen
 
QPen mSubTickPen
 
QPen mSelectedSubTickPen
 
QCPRange mRange
 
bool mRangeReversed
 
ScaleType mScaleType
 
QPointF mCenter
 
double mRadius
 
QSharedPointer< QCPAxisTickermTicker
 
QVector< double > mTickVector
 
QVector< QString > mTickVectorLabels
 
QVector< double > mSubTickVector
 
bool mDragging
 
QCPRange mDragStartRange
 
QCP::AntialiasedElements mAADragBackup
 
QCP::AntialiasedElements mNotAADragBackup
 
QCPLabelPainterPrivate mLabelPainter
 
- Protected Attributes inherited from QCPLayerable
bool mVisible
 
QCustomPlotmParentPlot
 
QPointer< QCPLayerablemParentLayerable
 
QCPLayermLayer
 
bool mAntialiased
 

Friends

class QCustomPlot
 
class QCPPolarAxisAngular
 

Detailed Description

The radial axis inside a radial plot.

Warning
In this QCustomPlot version, polar plots are a tech preview. Expect documentation and functionality to be incomplete, as well as changing public interfaces in the future.

Each axis holds an instance of QCPAxisTicker which is used to generate the tick coordinates and tick labels. You can access the currently installed ticker or set a new one (possibly one of the specialized subclasses, or your own subclass) via setTicker. For details, see the documentation of QCPAxisTicker.

Member Enumeration Documentation

◆ AngleReference

Defines the reference of the angle at which a radial axis is tilted (setAngle).

Enumerator
arAbsolute 

The axis tilt is given in absolute degrees. The zero is to the right and positive angles are measured counter-clockwise.

arAngularAxis 

The axis tilt is measured in the angular coordinate system given by the parent angular axis.

◆ ScaleType

Defines the scale of an axis.

See also
setScaleType
Enumerator
stLinear 

Linear scaling.

stLogarithmic 

Logarithmic scaling with correspondingly transformed axis coordinates (possibly also setTicker to a QCPAxisTickerLog instance).

◆ SelectablePart

Defines the selectable parts of an axis.

See also
setSelectableParts, setSelectedParts
Enumerator
spNone 

None of the selectable parts.

spAxis 

The axis backbone and tick marks.

spTickLabels 

Tick labels (numbers) of this axis (as a whole, not individually)

spAxisLabel 

The axis label.

Constructor & Destructor Documentation

◆ QCPPolarAxisRadial()

QCPPolarAxisRadial::QCPPolarAxisRadial ( QCPPolarAxisAngular * parent)
explicit

Constructs an Axis instance of Type type for the axis rect parent.

Usually it isn't necessary to instantiate axes directly, because you can let QCustomPlot create them for you with QCPAxisRect::addAxis. If you want to use own QCPAxis-subclasses however, create them manually and then inject them also via QCPAxisRect::addAxis.

Member Function Documentation

◆ applyDefaultAntialiasingHint()

void QCPPolarAxisRadial::applyDefaultAntialiasingHint ( QCPPainter * painter) const
protectedvirtual

Implements QCPLayerable.

◆ coordToPixel()

QPointF QCPPolarAxisRadial::coordToPixel ( double angleCoord,
double radiusCoord ) const

Transforms value, in coordinates of the axis, to pixel coordinates of the QCustomPlot widget.

◆ deselectEvent()

void QCPPolarAxisRadial::deselectEvent ( bool * selectionStateChanged)
protectedvirtual

Reimplemented from QCPLayerable.

◆ draw()

void QCPPolarAxisRadial::draw ( QCPPainter * painter)
protectedvirtual

Implements QCPLayerable.

◆ getPartAt()

QCPPolarAxisRadial::SelectablePart QCPPolarAxisRadial::getPartAt ( const QPointF & pos) const

Returns the part of the axis that is hit by pos (in pixels). The return value of this function is independent of the user-selectable parts defined with setSelectableParts. Further, this function does not change the current selection state of the axis.

If the axis is not visible (setVisible), this function always returns spNone.

See also
setSelectedParts, setSelectableParts, QCustomPlot::setInteractions

◆ mouseMoveEvent()

void QCPPolarAxisRadial::mouseMoveEvent ( QMouseEvent * event,
const QPointF & startPos )
protectedvirtual

This event gets called when the user moves the mouse while holding a mouse button, after this layerable has become the mouse grabber by accepting the preceding mousePressEvent.

The current pixel position of the cursor on the QCustomPlot widget is accessible via event->pos(). The parameter startPos indicates the position where the initial mousePressEvent occurred, that started the mouse interaction.

The default implementation does nothing.

See also
mousePressEvent, mouseReleaseEvent, mouseDoubleClickEvent, wheelEvent

Reimplemented from QCPLayerable.

◆ mousePressEvent()

void QCPPolarAxisRadial::mousePressEvent ( QMouseEvent * event,
const QVariant & details )
protectedvirtual

This event gets called when the user presses a mouse button while the cursor is over the layerable. Whether a cursor is over the layerable is decided by a preceding call to selectTest.

The current pixel position of the cursor on the QCustomPlot widget is accessible via event->pos(). The parameter details contains layerable-specific details about the hit, which were generated in the previous call to selectTest. For example, One-dimensional plottables like QCPGraph or QCPBars convey the clicked data point in the details parameter, as QCPDataSelection packed as QVariant. Multi-part objects convey the specific SelectablePart that was hit (e.g. QCPAxis::SelectablePart in the case of axes).

QCustomPlot uses an event propagation system that works the same as Qt's system. If your layerable doesn't reimplement the mousePressEvent or explicitly calls event->ignore() in its reimplementation, the event will be propagated to the next layerable in the stacking order.

Once a layerable has accepted the mousePressEvent, it is considered the mouse grabber and will receive all following calls to mouseMoveEvent or mouseReleaseEvent for this mouse interaction (a "mouse interaction" in this context ends with the release).

The default implementation does nothing except explicitly ignoring the event with event->ignore().

See also
mouseMoveEvent, mouseReleaseEvent, mouseDoubleClickEvent, wheelEvent

Reimplemented from QCPLayerable.

◆ mouseReleaseEvent()

void QCPPolarAxisRadial::mouseReleaseEvent ( QMouseEvent * event,
const QPointF & startPos )
protectedvirtual

This event gets called when the user releases the mouse button, after this layerable has become the mouse grabber by accepting the preceding mousePressEvent.

The current pixel position of the cursor on the QCustomPlot widget is accessible via event->pos(). The parameter startPos indicates the position where the initial mousePressEvent occurred, that started the mouse interaction.

The default implementation does nothing.

See also
mousePressEvent, mouseMoveEvent, mouseDoubleClickEvent, wheelEvent

Reimplemented from QCPLayerable.

◆ moveRange()

void QCPPolarAxisRadial::moveRange ( double diff)

If the scale type (setScaleType) is stLinear, diff is added to the lower and upper bounds of the range. The range is simply moved by diff.

If the scale type is stLogarithmic, the range bounds are multiplied by diff. This corresponds to an apparent "linear" move in logarithmic scaling by a distance of log(diff).

◆ pixelToCoord()

void QCPPolarAxisRadial::pixelToCoord ( QPointF pixelPos,
double & angleCoord,
double & radiusCoord ) const

Transforms value, in pixel coordinates of the QCustomPlot widget, to axis coordinates.

◆ rangeChanged [1/2]

void QCPPolarAxisRadial::rangeChanged ( const QCPRange & newRange)
signal

This signal is emitted when the range of this axis has changed. You can connect it to the setRange slot of another axis to communicate the new range to the other axis, in order for it to be synchronized.

You may also manipulate/correct the range with setRange in a slot connected to this signal. This is useful if for example a maximum range span shall not be exceeded, or if the lower/upper range shouldn't go beyond certain values (see QCPRange::bounded). For example, the following slot would limit the x axis to ranges between 0 and 10:

customPlot->xAxis->setRange(newRange.bounded(0, 10))

◆ rangeChanged [2/2]

void QCPPolarAxisRadial::rangeChanged ( const QCPRange & newRange,
const QCPRange & oldRange )
signal

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Additionally to the new range, this signal also provides the previous range held by the axis as oldRange.

◆ rescale()

void QCPPolarAxisRadial::rescale ( bool onlyVisiblePlottables = false)

Changes the axis range such that all plottables associated with this axis are fully visible in that dimension.

See also
QCPAbstractPlottable::rescaleAxes, QCustomPlot::rescaleAxes

◆ scaleRange() [1/2]

void QCPPolarAxisRadial::scaleRange ( double factor)

Scales the range of this axis by factor around the center of the current axis range. For example, if factor is 2.0, then the axis range will double its size, and the point at the axis range center won't have changed its position in the QCustomPlot widget (i.e. coordinates around the center will have moved symmetrically closer).

If you wish to scale around a different coordinate than the current axis range center, use the overload scaleRange(double factor, double center).

◆ scaleRange() [2/2]

void QCPPolarAxisRadial::scaleRange ( double factor,
double center )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Scales the range of this axis by factor around the coordinate center. For example, if factor is 2.0, center is 1.0, then the axis range will double its size, and the point at coordinate 1.0 won't have changed its position in the QCustomPlot widget (i.e. coordinates around 1.0 will have moved symmetrically closer to 1.0).

See also
scaleRange(double factor)

◆ scaleTypeChanged

void QCPPolarAxisRadial::scaleTypeChanged ( QCPPolarAxisRadial::ScaleType scaleType)
signal

This signal is emitted when the scale type changes, by calls to setScaleType

◆ selectableChanged

void QCPPolarAxisRadial::selectableChanged ( const QCPPolarAxisRadial::SelectableParts & parts)
signal

This signal is emitted when the selectability changes, by calls to setSelectableParts

◆ selectEvent()

void QCPPolarAxisRadial::selectEvent ( QMouseEvent * event,
bool additive,
const QVariant & details,
bool * selectionStateChanged )
protectedvirtual

Reimplemented from QCPLayerable.

◆ selectionCategory()

QCP::Interaction QCPPolarAxisRadial::selectionCategory ( ) const
protectedvirtual

Reimplemented from QCPLayerable.

◆ selectionChanged

void QCPPolarAxisRadial::selectionChanged ( const QCPPolarAxisRadial::SelectableParts & parts)
signal

This signal is emitted when the selection state of this axis has changed, either by user interaction or by a direct call to setSelectedParts.

◆ selectTest()

double QCPPolarAxisRadial::selectTest ( const QPointF & pos,
bool onlySelectable,
QVariant * details = 0 ) const
virtual

This function is used to decide whether a click hits a layerable object or not.

pos is a point in pixel coordinates on the QCustomPlot surface. This function returns the shortest pixel distance of this point to the object. If the object is either invisible or the distance couldn't be determined, -1.0 is returned. Further, if onlySelectable is true and the object is not selectable, -1.0 is returned, too.

If the object is represented not by single lines but by an area like a QCPItemText or the bars of a QCPBars plottable, a click inside the area should also be considered a hit. In these cases this function thus returns a constant value greater zero but still below the parent plot's selection tolerance. (typically the selectionTolerance multiplied by 0.99).

Providing a constant value for area objects allows selecting line objects even when they are obscured by such area objects, by clicking close to the lines (i.e. closer than 0.99*selectionTolerance).

The actual setting of the selection state is not done by this function. This is handled by the parent QCustomPlot when the mouseReleaseEvent occurs, and the finally selected object is notified via the selectEvent/ deselectEvent methods.

details is an optional output parameter. Every layerable subclass may place any information in details. This information will be passed to selectEvent when the parent QCustomPlot decides on the basis of this selectTest call, that the object was successfully selected. The subsequent call to selectEvent will carry the details. This is useful for multi-part objects (like QCPAxis). This way, a possibly complex calculation to decide which part was clicked is only done once in selectTest. The result (i.e. the actually clicked part) can then be placed in details. So in the subsequent selectEvent, the decision which part was selected doesn't have to be done a second time for a single selection operation.

In the case of 1D Plottables (QCPAbstractPlottable1D, like QCPGraph or QCPBars) details will be set to a QCPDataSelection, describing the closest data point to pos.

You may pass nullptr as details to indicate that you are not interested in those selection details.

See also
selectEvent, deselectEvent, mousePressEvent, wheelEvent, QCustomPlot::setInteractions, QCPAbstractPlottable1D::selectTestRect

Reimplemented from QCPLayerable.

◆ setBasePen()

void QCPPolarAxisRadial::setBasePen ( const QPen & pen)

Sets the pen, the axis base line is drawn with.

See also
setTickPen, setSubTickPen

◆ setLabel()

void QCPPolarAxisRadial::setLabel ( const QString & str)

Sets the text of the axis label that will be shown below/above or next to the axis, depending on its orientation. To disable axis labels, pass an empty string as str.

◆ setLabelColor()

void QCPPolarAxisRadial::setLabelColor ( const QColor & color)

Sets the color of the axis label.

See also
setLabelFont

◆ setLabelFont()

void QCPPolarAxisRadial::setLabelFont ( const QFont & font)

Sets the font of the axis label.

See also
setLabelColor

◆ setLabelPadding()

void QCPPolarAxisRadial::setLabelPadding ( int padding)

Sets the distance between the tick labels and the axis label.

See also
setTickLabelPadding, setPadding

◆ setNumberFormat()

void QCPPolarAxisRadial::setNumberFormat ( const QString & formatCode)

Sets the number format for the numbers in tick labels. This formatCode is an extended version of the format code used e.g. by QString::number() and QLocale::toString(). For reference about that, see the "Argument Formats" section in the detailed description of the QString class.

formatCode is a string of one, two or three characters. The first character is identical to the normal format code used by Qt. In short, this means: 'e'/'E' scientific format, 'f' fixed format, 'g'/'G' scientific or fixed, whichever is shorter.

The second and third characters are optional and specific to QCustomPlot:
If the first char was 'e' or 'g', numbers are/might be displayed in the scientific format, e.g. "5.5e9", which is ugly in a plot. So when the second char of formatCode is set to 'b' (for "beautiful"), those exponential numbers are formatted in a more natural way, i.e. "5.5 [multiplication sign] 10 [superscript] 9". By default, the multiplication sign is a centered dot. If instead a cross should be shown (as is usual in the USA), the third char of formatCode can be set to 'c'. The inserted multiplication signs are the UTF-8 characters 215 (0xD7) for the cross and 183 (0xB7) for the dot.

Examples for formatCode:

  • g normal format code behaviour. If number is small, fixed format is used, if number is large, normal scientific format is used
  • gb If number is small, fixed format is used, if number is large, scientific format is used with beautifully typeset decimal powers and a dot as multiplication sign
  • ebc All numbers are in scientific format with beautifully typeset decimal power and a cross as multiplication sign
  • fb illegal format code, since fixed format doesn't support (or need) beautifully typeset decimal powers. Format code will be reduced to 'f'.
  • hello illegal format code, since first char is not 'e', 'E', 'f', 'g' or 'G'. Current format code will not be changed.

◆ setNumberPrecision()

void QCPPolarAxisRadial::setNumberPrecision ( int precision)

Sets the precision of the tick label numbers. See QLocale::toString(double i, char f, int prec) for details. The effect of precisions are most notably for number Formats starting with 'e', see setNumberFormat

◆ setRange() [1/3]

void QCPPolarAxisRadial::setRange ( const QCPRange & range)

Sets the range of the axis.

This slot may be connected with the rangeChanged signal of another axis so this axis is always synchronized with the other axis range, when it changes.

To invert the direction of an axis, use setRangeReversed.

◆ setRange() [2/3]

void QCPPolarAxisRadial::setRange ( double lower,
double upper )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Sets the lower and upper bound of the axis range.

To invert the direction of an axis, use setRangeReversed.

There is also a slot to set a range, see setRange(const QCPRange &range).

◆ setRange() [3/3]

void QCPPolarAxisRadial::setRange ( double position,
double size,
Qt::AlignmentFlag alignment )

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Sets the range of the axis.

The position coordinate indicates together with the alignment parameter, where the new range will be positioned. size defines the size of the new axis range. alignment may be Qt::AlignLeft, Qt::AlignRight or Qt::AlignCenter. This will cause the left border, right border, or center of the range to be aligned with position. Any other values of alignment will default to Qt::AlignCenter.

◆ setRangeLower()

void QCPPolarAxisRadial::setRangeLower ( double lower)

Sets the lower bound of the axis range. The upper bound is not changed.

See also
setRange

◆ setRangeReversed()

void QCPPolarAxisRadial::setRangeReversed ( bool reversed)

Sets whether the axis range (direction) is displayed reversed. Normally, the values on horizontal axes increase left to right, on vertical axes bottom to top. When reversed is set to true, the direction of increasing values is inverted.

Note that the range and data interface stays the same for reversed axes, e.g. the lower part of the setRange interface will still reference the mathematically smaller number than the upper part.

◆ setRangeUpper()

void QCPPolarAxisRadial::setRangeUpper ( double upper)

Sets the upper bound of the axis range. The lower bound is not changed.

See also
setRange

◆ setScaleType()

void QCPPolarAxisRadial::setScaleType ( QCPPolarAxisRadial::ScaleType type)

Sets whether the axis uses a linear scale or a logarithmic scale.

Note that this method controls the coordinate transformation. For logarithmic scales, you will likely also want to use a logarithmic tick spacing and labeling, which can be achieved by setting the axis ticker to an instance of QCPAxisTickerLog :

See the documentation of QCPAxisTickerLog about the details of logarithmic axis tick creation.

setNumberPrecision

◆ setSelectableParts()

void QCPPolarAxisRadial::setSelectableParts ( const QCPPolarAxisRadial::SelectableParts & selectableParts)

Sets whether the user can (de-)select the parts in selectable by clicking on the QCustomPlot surface. (When QCustomPlot::setInteractions contains iSelectAxes.)

However, even when selectable is set to a value not allowing the selection of a specific part, it is still possible to set the selection of this part manually, by calling setSelectedParts directly.

See also
SelectablePart, setSelectedParts

◆ setSelectedBasePen()

void QCPPolarAxisRadial::setSelectedBasePen ( const QPen & pen)

Sets the pen that is used to draw the axis base line when selected.

See also
setBasePen, setSelectableParts, setSelectedParts, QCustomPlot::setInteractions

◆ setSelectedLabelColor()

void QCPPolarAxisRadial::setSelectedLabelColor ( const QColor & color)

Sets the color that is used for the axis label when it is selected.

See also
setLabelColor, setSelectableParts, setSelectedParts, QCustomPlot::setInteractions

◆ setSelectedLabelFont()

void QCPPolarAxisRadial::setSelectedLabelFont ( const QFont & font)

Sets the font that is used for the axis label when it is selected.

See also
setLabelFont, setSelectableParts, setSelectedParts, QCustomPlot::setInteractions

◆ setSelectedParts()

void QCPPolarAxisRadial::setSelectedParts ( const QCPPolarAxisRadial::SelectableParts & selectedParts)

Sets the selected state of the respective axis parts described by SelectablePart. When a part is selected, it uses a different pen/font.

The entire selection mechanism for axes is handled automatically when QCustomPlot::setInteractions contains iSelectAxes. You only need to call this function when you wish to change the selection state manually.

This function can change the selection state of a part, independent of the setSelectableParts setting.

emits the selectionChanged signal when selected is different from the previous selection state.

See also
SelectablePart, setSelectableParts, selectTest, setSelectedBasePen, setSelectedTickPen, setSelectedSubTickPen, setSelectedTickLabelFont, setSelectedLabelFont, setSelectedTickLabelColor, setSelectedLabelColor

◆ setSelectedSubTickPen()

void QCPPolarAxisRadial::setSelectedSubTickPen ( const QPen & pen)

Sets the pen that is used to draw the subticks when selected.

See also
setSubTickPen, setSelectableParts, setSelectedParts, QCustomPlot::setInteractions

◆ setSelectedTickLabelColor()

void QCPPolarAxisRadial::setSelectedTickLabelColor ( const QColor & color)

Sets the color that is used for tick labels when they are selected.

See also
setTickLabelColor, setSelectableParts, setSelectedParts, QCustomPlot::setInteractions

◆ setSelectedTickLabelFont()

void QCPPolarAxisRadial::setSelectedTickLabelFont ( const QFont & font)

Sets the font that is used for tick labels when they are selected.

See also
setTickLabelFont, setSelectableParts, setSelectedParts, QCustomPlot::setInteractions

◆ setSelectedTickPen()

void QCPPolarAxisRadial::setSelectedTickPen ( const QPen & pen)

Sets the pen that is used to draw the (major) ticks when selected.

See also
setTickPen, setSelectableParts, setSelectedParts, QCustomPlot::setInteractions

◆ setSubTickLength()

void QCPPolarAxisRadial::setSubTickLength ( int inside,
int outside = 0 )

Sets the length of the subticks in pixels. inside is the length the subticks will reach inside the plot and outside is the length they will reach outside the plot. If outside is greater than zero, the tick labels and axis label will increase their distance to the axis accordingly, so they won't collide with the ticks.

See also
setTickLength, setSubTickLengthIn, setSubTickLengthOut

◆ setSubTickLengthIn()

void QCPPolarAxisRadial::setSubTickLengthIn ( int inside)

Sets the length of the inward subticks in pixels. inside is the length the subticks will reach inside the plot.

See also
setSubTickLengthOut, setSubTickLength, setTickLength

◆ setSubTickLengthOut()

void QCPPolarAxisRadial::setSubTickLengthOut ( int outside)

Sets the length of the outward subticks in pixels. outside is the length the subticks will reach outside the plot. If outside is greater than zero, the tick labels will increase their distance to the axis accordingly, so they won't collide with the ticks.

See also
setSubTickLengthIn, setSubTickLength, setTickLength

◆ setSubTickPen()

void QCPPolarAxisRadial::setSubTickPen ( const QPen & pen)

Sets the pen, subtick marks will be drawn with.

See also
setSubTickCount, setSubTickLength, setBasePen

◆ setSubTicks()

void QCPPolarAxisRadial::setSubTicks ( bool show)

Sets whether sub tick marks are displayed.

Sub ticks are only potentially visible if (major) ticks are also visible (see setTicks)

See also
setTicks

◆ setTicker()

void QCPPolarAxisRadial::setTicker ( QSharedPointer< QCPAxisTicker > ticker)

The axis ticker is responsible for generating the tick positions and tick labels. See the documentation of QCPAxisTicker for details on how to work with axis tickers.

You can change the tick positioning/labeling behaviour of this axis by setting a different QCPAxisTicker subclass using this method. If you only wish to modify the currently installed axis ticker, access it via ticker.

Since the ticker is stored in the axis as a shared pointer, multiple axes may share the same axis ticker simply by passing the same shared pointer to multiple axes.

See also
ticker

◆ setTickLabelColor()

void QCPPolarAxisRadial::setTickLabelColor ( const QColor & color)

Sets the color of the tick labels.

See also
setTickLabels, setTickLabelFont

◆ setTickLabelFont()

void QCPPolarAxisRadial::setTickLabelFont ( const QFont & font)

Sets the font of the tick labels.

See also
setTickLabels, setTickLabelColor

◆ setTickLabelPadding()

void QCPPolarAxisRadial::setTickLabelPadding ( int padding)

Sets the distance between the axis base line (including any outward ticks) and the tick labels.

See also
setLabelPadding, setPadding

◆ setTickLabelRotation()

void QCPPolarAxisRadial::setTickLabelRotation ( double degrees)

Sets the rotation of the tick labels. If degrees is zero, the labels are drawn normally. Else, the tick labels are drawn rotated by degrees clockwise. The specified angle is bound to values from -90 to 90 degrees.

If degrees is exactly -90, 0 or 90, the tick labels are centered on the tick coordinate. For other angles, the label is drawn with an offset such that it seems to point toward or away from the tick mark.

◆ setTickLabels()

void QCPPolarAxisRadial::setTickLabels ( bool show)

Sets whether tick labels are displayed. Tick labels are the numbers drawn next to tick marks.

◆ setTickLength()

void QCPPolarAxisRadial::setTickLength ( int inside,
int outside = 0 )

Sets the length of the ticks in pixels. inside is the length the ticks will reach inside the plot and outside is the length they will reach outside the plot. If outside is greater than zero, the tick labels and axis label will increase their distance to the axis accordingly, so they won't collide with the ticks.

See also
setSubTickLength, setTickLengthIn, setTickLengthOut

◆ setTickLengthIn()

void QCPPolarAxisRadial::setTickLengthIn ( int inside)

Sets the length of the inward ticks in pixels. inside is the length the ticks will reach inside the plot.

See also
setTickLengthOut, setTickLength, setSubTickLength

◆ setTickLengthOut()

void QCPPolarAxisRadial::setTickLengthOut ( int outside)

Sets the length of the outward ticks in pixels. outside is the length the ticks will reach outside the plot. If outside is greater than zero, the tick labels and axis label will increase their distance to the axis accordingly, so they won't collide with the ticks.

See also
setTickLengthIn, setTickLength, setSubTickLength

◆ setTickPen()

void QCPPolarAxisRadial::setTickPen ( const QPen & pen)

Sets the pen, tick marks will be drawn with.

See also
setTickLength, setBasePen

◆ setTicks()

void QCPPolarAxisRadial::setTicks ( bool show)

Sets whether tick marks are displayed.

Note that setting show to false does not imply that tick labels are invisible, too. To achieve that, see setTickLabels.

See also
setSubTicks

◆ ticker()

QSharedPointer< QCPAxisTicker > QCPPolarAxisRadial::ticker ( ) const
inline

Returns a modifiable shared pointer to the currently installed axis ticker. The axis ticker is responsible for generating the tick positions and tick labels of this axis. You can access the QCPAxisTicker with this method and modify basic properties such as the approximate tick count (QCPAxisTicker::setTickCount).

You can gain more control over the axis ticks by setting a different QCPAxisTicker subclass, see the documentation there. A new axis ticker can be set with setTicker.

Since the ticker is stored in the axis as a shared pointer, multiple axes may share the same axis ticker simply by passing the same shared pointer to multiple axes.

See also
setTicker

◆ wheelEvent()

void QCPPolarAxisRadial::wheelEvent ( QWheelEvent * event)
protectedvirtual

This event gets called when the user turns the mouse scroll wheel while the cursor is over the layerable. Whether a cursor is over the layerable is decided by a preceding call to selectTest.

The current pixel position of the cursor on the QCustomPlot widget is accessible via event->pos().

The event->angleDelta() indicates how far the mouse wheel was turned, which is usually +/- 120 for single rotation steps. However, if the mouse wheel is turned rapidly, multiple steps may accumulate to one event, making the delta larger. On the other hand, if the wheel has very smooth steps or none at all, the delta may be smaller.

The default implementation does nothing.

See also
mousePressEvent, mouseMoveEvent, mouseReleaseEvent, mouseDoubleClickEvent

Reimplemented from QCPLayerable.


The documentation for this class was generated from the following files: