Nakuja Flight Computer Testing and Simulation Engine (NaFCTSE) 1.0
A testing and verification tool for the Nakuja Rocket Project flight computers
|
The main container for polar plots, representing the angular axis as a circle. More...
Public Types | |
enum | SelectablePart { spNone = 0 , spAxis = 0x001 , spTickLabels = 0x002 , spAxisLabel = 0x004 } |
enum | LabelMode { lmUpright , lmRotated } |
Public Types inherited from QCPLayoutElement | |
enum | UpdatePhase { upPreparation , upMargins , upLayout } |
enum | SizeConstraintRect { scrInnerRect , scrOuterRect } |
Signals | |
void | rangeChanged (const QCPRange &newRange) |
void | rangeChanged (const QCPRange &newRange, const QCPRange &oldRange) |
void | selectionChanged (const QCPPolarAxisAngular::SelectableParts &parts) |
void | selectableChanged (const QCPPolarAxisAngular::SelectableParts &parts) |
Signals inherited from QCPLayerable | |
void | layerChanged (QCPLayer *newLayer) |
Public Member Functions | |
QCPPolarAxisAngular (QCustomPlot *parentPlot) | |
QPixmap | background () const |
QBrush | backgroundBrush () const |
bool | backgroundScaled () const |
Qt::AspectRatioMode | backgroundScaledMode () const |
bool | rangeDrag () const |
bool | rangeZoom () const |
double | rangeZoomFactor () const |
const QCPRange | range () const |
bool | rangeReversed () const |
double | angle () const |
QSharedPointer< QCPAxisTicker > | ticker () 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< 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 |
QCPPolarGrid * | grid () const |
void | setBackground (const QPixmap &pm) |
void | setBackground (const QPixmap &pm, bool scaled, Qt::AspectRatioMode mode=Qt::KeepAspectRatioByExpanding) |
void | setBackground (const QBrush &brush) |
void | setBackgroundScaled (bool scaled) |
void | setBackgroundScaledMode (Qt::AspectRatioMode mode) |
void | setRangeDrag (bool enabled) |
void | setRangeZoom (bool enabled) |
void | setRangeZoomFactor (double factor) |
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 | 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 | setLabelPosition (Qt::AlignmentFlag position) |
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 QCPPolarAxisAngular::SelectableParts &selectableParts) |
Q_SLOT void | setSelectedParts (const QCPPolarAxisAngular::SelectableParts &selectedParts) |
virtual double | selectTest (const QPointF &pos, bool onlySelectable, QVariant *details=0) const Q_DECL_OVERRIDE |
virtual void | update (UpdatePhase phase) Q_DECL_OVERRIDE |
virtual QList< QCPLayoutElement * > | elements (bool recursive) const Q_DECL_OVERRIDE |
bool | removeGraph (QCPPolarGraph *graph) |
int | radialAxisCount () const |
QCPPolarAxisRadial * | radialAxis (int index=0) const |
QList< QCPPolarAxisRadial * > | radialAxes () const |
QCPPolarAxisRadial * | addRadialAxis (QCPPolarAxisRadial *axis=0) |
bool | removeRadialAxis (QCPPolarAxisRadial *axis) |
QCPLayoutInset * | insetLayout () const |
QRegion | exactClipRegion () const |
void | moveRange (double diff) |
void | scaleRange (double factor) |
void | scaleRange (double factor, double center) |
void | rescale (bool onlyVisiblePlottables=false) |
double | coordToAngleRad (double coord) const |
double | angleRadToCoord (double angleRad) const |
void | pixelToCoord (QPointF pixelPos, double &angleCoord, double &radiusCoord) const |
QPointF | coordToPixel (double angleCoord, double radiusCoord) const |
SelectablePart | getPartAt (const QPointF &pos) const |
int | left () const |
int | right () const |
int | top () const |
int | bottom () const |
int | width () const |
int | height () const |
QSize | size () const |
QPoint | topLeft () const |
QPoint | topRight () const |
QPoint | bottomLeft () const |
QPoint | bottomRight () const |
QPointF | center () const |
double | radius () const |
Public Member Functions inherited from QCPLayoutElement | |
QCPLayoutElement (QCustomPlot *parentPlot=nullptr) | |
QCPLayout * | layout () const |
QRect | rect () const |
QRect | outerRect () const |
QMargins | margins () const |
QMargins | minimumMargins () const |
QCP::MarginSides | autoMargins () const |
QSize | minimumSize () const |
QSize | maximumSize () const |
SizeConstraintRect | sizeConstraintRect () const |
QCPMarginGroup * | marginGroup (QCP::MarginSide side) const |
QHash< QCP::MarginSide, QCPMarginGroup * > | marginGroups () const |
void | setOuterRect (const QRect &rect) |
void | setMargins (const QMargins &margins) |
void | setMinimumMargins (const QMargins &margins) |
void | setAutoMargins (QCP::MarginSides sides) |
void | setMinimumSize (const QSize &size) |
void | setMinimumSize (int width, int height) |
void | setMaximumSize (const QSize &size) |
void | setMaximumSize (int width, int height) |
void | setSizeConstraintRect (SizeConstraintRect constraintRect) |
void | setMarginGroup (QCP::MarginSides sides, QCPMarginGroup *group) |
virtual QSize | minimumOuterSizeHint () const |
virtual QSize | maximumOuterSizeHint () const |
Public Member Functions inherited from QCPLayerable | |
QCPLayerable (QCustomPlot *plot, QString targetLayer=QString(), QCPLayerable *parentLayerable=nullptr) | |
bool | visible () const |
QCustomPlot * | parentPlot () const |
QCPLayerable * | parentLayerable () const |
QCPLayer * | layer () 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 | 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 |
bool | registerPolarGraph (QCPPolarGraph *graph) |
void | drawBackground (QCPPainter *painter, const QPointF ¢er, 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 QCPLayoutElement | |
virtual int | calculateAutoMargin (QCP::MarginSide side) |
virtual void | layoutChanged () |
virtual void | parentPlotInitialized (QCustomPlot *parentPlot) Q_DECL_OVERRIDE |
Protected Member Functions inherited from QCPLayerable | |
virtual QRect | clipRect () const |
virtual void | selectEvent (QMouseEvent *event, bool additive, const QVariant &details, bool *selectionStateChanged) |
virtual void | deselectEvent (bool *selectionStateChanged) |
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 | |
QBrush | mBackgroundBrush |
QPixmap | mBackgroundPixmap |
QPixmap | mScaledBackgroundPixmap |
bool | mBackgroundScaled |
Qt::AspectRatioMode | mBackgroundScaledMode |
QCPLayoutInset * | mInsetLayout |
bool | mRangeDrag |
bool | mRangeZoom |
double | mRangeZoomFactor |
double | mAngle |
double | mAngleRad |
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 |
QPointF | mCenter |
double | mRadius |
QList< QCPPolarAxisRadial * > | mRadialAxes |
QCPPolarGrid * | mGrid |
QList< QCPPolarGraph * > | mGraphs |
QSharedPointer< QCPAxisTicker > | mTicker |
QVector< double > | mTickVector |
QVector< QString > | mTickVectorLabels |
QVector< QPointF > | mTickVectorCosSin |
QVector< double > | mSubTickVector |
QVector< QPointF > | mSubTickVectorCosSin |
bool | mDragging |
QCPRange | mDragAngularStart |
QList< QCPRange > | mDragRadialStart |
QCP::AntialiasedElements | mAADragBackup |
QCP::AntialiasedElements | mNotAADragBackup |
QCPLabelPainterPrivate | mLabelPainter |
Protected Attributes inherited from QCPLayoutElement | |
QCPLayout * | mParentLayout |
QSize | mMinimumSize |
QSize | mMaximumSize |
SizeConstraintRect | mSizeConstraintRect |
QRect | mRect |
QRect | mOuterRect |
QMargins | mMargins |
QMargins | mMinimumMargins |
QCP::MarginSides | mAutoMargins |
QHash< QCP::MarginSide, QCPMarginGroup * > | mMarginGroups |
Protected Attributes inherited from QCPLayerable | |
bool | mVisible |
QCustomPlot * | mParentPlot |
QPointer< QCPLayerable > | mParentLayerable |
QCPLayer * | mLayer |
bool | mAntialiased |
Friends | |
class | QCustomPlot |
class | QCPPolarGrid |
class | QCPPolarGraph |
The main container for polar plots, representing the angular axis as a circle.
TODO
Defines the selectable parts of an axis.
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. |
|
explicit |
Creates a QCPPolarAxis instance and sets default values. An axis is added for each of the four sides, the top and right axes are set invisible initially.
QCPPolarAxisRadial * QCPPolarAxisAngular::addRadialAxis | ( | QCPPolarAxisRadial * | axis = 0 | ) |
Adds a new axis to the axis rect side specified with type, and returns it. If axis is 0, a new QCPAxis instance is created internally. QCustomPlot owns the returned axis, so if you want to remove an axis, use removeAxis instead of deleting it manually.
You may inject QCPAxis instances (or subclasses of QCPAxis) by setting axis to an axis that was previously created outside QCustomPlot. It is important to note that QCustomPlot takes ownership of the axis, so you may not delete it afterwards. Further, the axis must have been created with this axis rect as parent and with the same axis type as specified in type. If this is not the case, a debug output is generated, the axis is not added, and the method returns 0.
This method can not be used to move axis between axis rects. The same axis instance must not be added multiple times to the same or different axis rects.
If an axis rect side already contains one or more axes, the lower and upper endings of the new axis (QCPAxis::setLowerEnding, QCPAxis::setUpperEnding) are set to QCPLineEnding::esHalfBar.
|
protectedvirtual |
Reimplemented from QCPLayoutElement.
|
inline |
Returns the pixel position of the bottom border of this axis rect. Margins are not taken into account here, so the returned value is with respect to the inner rect.
|
inline |
Returns the bottom left corner of this axis rect in pixels. Margins are not taken into account here, so the returned value is with respect to the inner rect.
|
inline |
Returns the bottom right corner of this axis rect in pixels. Margins are not taken into account here, so the returned value is with respect to the inner rect.
|
inline |
Returns the center of this axis rect in pixels. Margins are not taken into account here, so the returned value is with respect to the inner rect.
QPointF QCPPolarAxisAngular::coordToPixel | ( | double | angleCoord, |
double | radiusCoord ) const |
Transforms value, in coordinates of the axis, to pixel coordinates of the QCustomPlot widget.
|
protectedvirtual |
Reimplemented from QCPLayoutElement.
|
virtual |
Returns a list of all child elements in this layout element. If recursive is true, all sub-child elements are included in the list, too.
nullptr
entries in the returned list. For example, QCPLayoutGrid may have empty cells which yield nullptr
at the respective index. Reimplemented from QCPLayoutElement.
QCPPolarAxisAngular::SelectablePart QCPPolarAxisAngular::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.
|
inline |
Returns the pixel height of this axis rect. Margins are not taken into account here, so the returned value is with respect to the inner rect.
|
inline |
Returns the inset layout of this axis rect. It can be used to place other layout elements (or even layouts with multiple other elements) inside/on top of an axis rect.
|
inline |
Returns the pixel position of the left border of this axis rect. Margins are not taken into account here, so the returned value is with respect to the inner rect.
|
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.
Reimplemented from QCPLayerable.
|
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()
.
Reimplemented from QCPLayerable.
|
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.
Reimplemented from QCPLayerable.
void QCPPolarAxisAngular::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).
void QCPPolarAxisAngular::pixelToCoord | ( | QPointF | pixelPos, |
double & | angleCoord, | ||
double & | radiusCoord ) const |
Transforms value, in pixel coordinates of the QCustomPlot widget, to axis coordinates.
QList< QCPPolarAxisRadial * > QCPPolarAxisAngular::radialAxes | ( | ) | const |
Returns all axes on the axis rect sides specified with types.
types may be a single QCPAxis::AxisType or an or
-combination, to get the axes of multiple sides.
QCPPolarAxisRadial * QCPPolarAxisAngular::radialAxis | ( | int | index = 0 | ) | const |
Returns the axis with the given index on the axis rect side specified with type.
int QCPPolarAxisAngular::radialAxisCount | ( | ) | const |
Returns the number of axes on the axis rect side specified with type.
bool QCPPolarAxisAngular::removeRadialAxis | ( | QCPPolarAxisRadial * | radialAxis | ) |
Removes the specified axis from the axis rect and deletes it.
Returns true on success, i.e. if axis was a valid axis in this axis rect.
void QCPPolarAxisAngular::rescale | ( | bool | onlyVisiblePlottables = false | ) |
Changes the axis range such that all plottables associated with this axis are fully visible in that dimension.
|
inline |
Returns the pixel position of the right border of this axis rect. Margins are not taken into account here, so the returned value is with respect to the inner rect.
void QCPPolarAxisAngular::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).
void QCPPolarAxisAngular::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).
|
protectedvirtual |
Reimplemented from QCPLayerable.
|
virtual |
Layout elements are sensitive to events inside their outer rect. If pos is within the outer rect, this method returns a value corresponding to 0.99 times the parent plot's selection tolerance. However, layout elements are not selectable by default. So if onlySelectable is true, -1.0 is returned.
See QCPLayerable::selectTest for a general explanation of this virtual method.
QCPLayoutElement subclasses may reimplement this method to provide more specific selection test behaviour.
Reimplemented from QCPLayoutElement.
void QCPPolarAxisAngular::setBackground | ( | const QBrush & | brush | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Sets brush as the background brush. The axis rect background will be filled with this brush. Since axis rects place themselves on the "background" layer by default, the axis rect backgrounds are usually drawn below everything else.
The brush will be drawn before (under) any background pixmap, which may be specified with setBackground(const QPixmap &pm).
To disable drawing of a background brush, set brush to Qt::NoBrush.
void QCPPolarAxisAngular::setBackground | ( | const QPixmap & | pm | ) |
Sets pm as the axis background pixmap. The axis background pixmap will be drawn inside the axis rect. Since axis rects place themselves on the "background" layer by default, the axis rect backgrounds are usually drawn below everything else.
For cases where the provided pixmap doesn't have the same size as the axis rect, scaling can be enabled with setBackgroundScaled and the scaling mode (i.e. whether and how the aspect ratio is preserved) can be set with setBackgroundScaledMode. To set all these options in one call, consider using the overloaded version of this function.
Below the pixmap, the axis rect may be optionally filled with a brush, if specified with setBackground(const QBrush &brush).
void QCPPolarAxisAngular::setBackground | ( | const QPixmap & | pm, |
bool | scaled, | ||
Qt::AspectRatioMode | mode = Qt::KeepAspectRatioByExpanding ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Allows setting the background pixmap of the axis rect, whether it shall be scaled and how it shall be scaled in one call.
void QCPPolarAxisAngular::setBackgroundScaled | ( | bool | scaled | ) |
Sets whether the axis background pixmap shall be scaled to fit the axis rect or not. If scaled is set to true, you may control whether and how the aspect ratio of the original pixmap is preserved with setBackgroundScaledMode.
Note that the scaled version of the original pixmap is buffered, so there is no performance penalty on replots. (Except when the axis rect dimensions are changed continuously.)
void QCPPolarAxisAngular::setBackgroundScaledMode | ( | Qt::AspectRatioMode | mode | ) |
If scaling of the axis background pixmap is enabled (setBackgroundScaled), use this function to define whether and how the aspect ratio of the original pixmap passed to setBackground is preserved.
void QCPPolarAxisAngular::setBasePen | ( | const QPen & | pen | ) |
Sets the pen, the axis base line is drawn with.
void QCPPolarAxisAngular::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.
void QCPPolarAxisAngular::setLabelColor | ( | const QColor & | color | ) |
Sets the color of the axis label.
void QCPPolarAxisAngular::setLabelFont | ( | const QFont & | font | ) |
Sets the font of the axis label.
void QCPPolarAxisAngular::setLabelPadding | ( | int | padding | ) |
Sets the distance between the tick labels and the axis label.
void QCPPolarAxisAngular::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 might be visually unappealing 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. void QCPPolarAxisAngular::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
void QCPPolarAxisAngular::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.
void QCPPolarAxisAngular::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).
void QCPPolarAxisAngular::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.
void QCPPolarAxisAngular::setRangeLower | ( | double | lower | ) |
Sets the lower bound of the axis range. The upper bound is not changed.
void QCPPolarAxisAngular::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.
void QCPPolarAxisAngular::setRangeUpper | ( | double | upper | ) |
Sets the upper bound of the axis range. The lower bound is not changed.
void QCPPolarAxisAngular::setSelectableParts | ( | const QCPPolarAxisAngular::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.
void QCPPolarAxisAngular::setSelectedBasePen | ( | const QPen & | pen | ) |
Sets the pen that is used to draw the axis base line when selected.
void QCPPolarAxisAngular::setSelectedLabelColor | ( | const QColor & | color | ) |
Sets the color that is used for the axis label when it is selected.
void QCPPolarAxisAngular::setSelectedLabelFont | ( | const QFont & | font | ) |
Sets the font that is used for the axis label when it is selected.
void QCPPolarAxisAngular::setSelectedParts | ( | const QCPPolarAxisAngular::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.
void QCPPolarAxisAngular::setSelectedSubTickPen | ( | const QPen & | pen | ) |
Sets the pen that is used to draw the subticks when selected.
void QCPPolarAxisAngular::setSelectedTickLabelColor | ( | const QColor & | color | ) |
Sets the color that is used for tick labels when they are selected.
void QCPPolarAxisAngular::setSelectedTickLabelFont | ( | const QFont & | font | ) |
Sets the font that is used for tick labels when they are selected.
void QCPPolarAxisAngular::setSelectedTickPen | ( | const QPen & | pen | ) |
Sets the pen that is used to draw the (major) ticks when selected.
void QCPPolarAxisAngular::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.
void QCPPolarAxisAngular::setSubTickLengthIn | ( | int | inside | ) |
Sets the length of the inward subticks in pixels. inside is the length the subticks will reach inside the plot.
void QCPPolarAxisAngular::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.
void QCPPolarAxisAngular::setSubTickPen | ( | const QPen & | pen | ) |
Sets the pen, subtick marks will be drawn with.
void QCPPolarAxisAngular::setSubTicks | ( | bool | show | ) |
void QCPPolarAxisAngular::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.
void QCPPolarAxisAngular::setTickLabelColor | ( | const QColor & | color | ) |
Sets the color of the tick labels.
void QCPPolarAxisAngular::setTickLabelFont | ( | const QFont & | font | ) |
Sets the font of the tick labels.
void QCPPolarAxisAngular::setTickLabelPadding | ( | int | padding | ) |
Sets the distance between the axis base line (including any outward ticks) and the tick labels.
void QCPPolarAxisAngular::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.
void QCPPolarAxisAngular::setTickLabels | ( | bool | show | ) |
Sets whether tick labels are displayed. Tick labels are the numbers drawn next to tick marks.
void QCPPolarAxisAngular::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.
void QCPPolarAxisAngular::setTickLengthIn | ( | int | inside | ) |
Sets the length of the inward ticks in pixels. inside is the length the ticks will reach inside the plot.
void QCPPolarAxisAngular::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.
void QCPPolarAxisAngular::setTickPen | ( | const QPen & | pen | ) |
Sets the pen, tick marks will be drawn with.
void QCPPolarAxisAngular::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.
|
inline |
Returns the pixel size of this axis rect. Margins are not taken into account here, so the returned value is with respect to the inner rect.
|
inline |
Returns the pixel position of the top border of this axis rect. Margins are not taken into account here, so the returned value is with respect to the inner rect.
|
inline |
Returns the top left corner of this axis rect in pixels. Margins are not taken into account here, so the returned value is with respect to the inner rect.
|
inline |
Returns the top right corner of this axis rect in pixels. Margins are not taken into account here, so the returned value is with respect to the inner rect.
|
virtual |
This method is called automatically upon replot and doesn't need to be called by users of QCPPolarAxisAngular.
Calls the base class implementation to update the margins (see QCPLayoutElement::update), and finally passes the rect to the inset layout (insetLayout) and calls its QCPInsetLayout::update function.
\seebaseclassmethod
Reimplemented from QCPLayoutElement.
|
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.
Reimplemented from QCPLayerable.
|
inline |
Returns the pixel width of this axis rect. Margins are not taken into account here, so the returned value is with respect to the inner rect.