.Simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
DataVisualizerGUI::QCPExtended Class Reference

Extension of the QCustomPlot class that allows an implementation of the class with different event handlers. More...

#include <QCPExtended.h>

Inheritance diagram for DataVisualizerGUI::QCPExtended:
QCPlot::QCustomPlot DataVisualizerGUI::Graph< T > DataVisualizerGUI::Graph< DataRPK > DataVisualizerGUI::Graph< DataSnapshot > DataVisualizerGUI::G_WallRadTime DataVisualizerGUI::G_DensityRadius DataVisualizerGUI::G_IonizationRadius DataVisualizerGUI::G_TempRadius

Public Member Functions

 QCPExtended (QWidget *parent=NULL)
 Constructor.
 
- Public Member Functions inherited from QCPlot::QCustomPlot
 QCustomPlot (QWidget *parent=0)
 Constructs a QCustomPlot and sets reasonable default values. More...
 
QString title () const
 
QFont titleFont () const
 
QColor titleColor () const
 
QRect axisRect () const
 
QRect viewport () const
 Returns the viewport rect of this QCustomPlot instance. More...
 
int marginLeft () const
 
int marginRight () const
 
int marginTop () const
 
int marginBottom () const
 
bool autoMargin () const
 
QColor color () const
 
Qt::Orientations rangeDrag () const
 
Qt::Orientations rangeZoom () const
 
QCPAxisrangeDragAxis (Qt::Orientation orientation)
 Returns the range drag axis of the orientation provided. More...
 
QCPAxisrangeZoomAxis (Qt::Orientation orientation)
 Returns the range zoom axis of the orientation provided. More...
 
double rangeZoomFactor (Qt::Orientation orientation)
 Returns the range zoom factor of the orientation provided. More...
 
QCP::AntialiasedElements antialiasedElements () const
 
QCP::AntialiasedElements notAntialiasedElements () const
 
bool autoAddPlottableToLegend () const
 
QPixmap axisBackground () const
 
bool axisBackgroundScaled () const
 
Qt::AspectRatioMode axisBackgroundScaledMode () const
 
const Interactions interactions () const
 
int selectionTolerance () const
 
QFont selectedTitleFont () const
 
QColor selectedTitleColor () const
 
bool titleSelected () const
 
bool noAntialiasingOnDrag () const
 
QCP::PlottingHints plottingHints () const
 
Qt::KeyboardModifier multiSelectModifier () const
 
void setTitle (const QString &title)
 Sets the plot title which will be drawn centered at the top of the widget. More...
 
void setTitleFont (const QFont &font)
 Sets the font of the plot title. More...
 
void setTitleColor (const QColor &color)
 Sets the text color of the plot title. More...
 
void setAxisRect (const QRect &arect)
 An alternative way to set the margins, by directly setting the wanted axis rect. More...
 
void setMarginLeft (int margin)
 Sets the left margin manually. More...
 
void setMarginRight (int margin)
 Sets the right margin manually. More...
 
void setMarginTop (int margin)
 Sets the top margin manually. More...
 
void setMarginBottom (int margin)
 Sets the bottom margin manually. More...
 
void setMargin (int left, int right, int top, int bottom)
 Sets the margins manually. More...
 
void setAutoMargin (bool enabled)
 Sets whether the margins are calculated automatically depeding on the sizes of the tick labels, axis labels, paddings etc. More...
 
void setColor (const QColor &color)
 Sets the background color of the QCustomPlot widget.
 
void setRangeDrag (Qt::Orientations orientations)
 Sets which axis orientation may be range dragged by the user with mouse interaction. More...
 
void setRangeZoom (Qt::Orientations orientations)
 Sets which axis orientation may be zoomed by the user with the mouse wheel. More...
 
void setRangeDragAxes (QCPAxis *horizontal, QCPAxis *vertical)
 Sets the axes whose range will be dragged when setRangeDrag enables mouse range dragging on the QCustomPlot widget. More...
 
void setRangeZoomAxes (QCPAxis *horizontal, QCPAxis *vertical)
 Sets the axes whose range will be zoomed when setRangeZoom enables mouse wheel zooming on the QCustomPlot widget. More...
 
void setRangeZoomFactor (double horizontalFactor, double verticalFactor)
 Sets how strong one rotation step of the mouse wheel zooms, when range zoom was activated with setRangeZoom. More...
 
void setRangeZoomFactor (double factor)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets both the horizontal and vertical zoom factor.
 
void setAntialiasedElements (const QCP::AntialiasedElements &antialiasedElements)
 Sets which elements are forcibly drawn antialiased as an or combination of QCP::AntialiasedElement. More...
 
void setAntialiasedElement (QCP::AntialiasedElement antialiasedElement, bool enabled=true)
 Sets whether the specified antialiasedElement is forcibly drawn antialiased. More...
 
void setNotAntialiasedElements (const QCP::AntialiasedElements &notAntialiasedElements)
 Sets which elements are forcibly drawn not antialiased as an or combination of QCP::AntialiasedElement. More...
 
void setNotAntialiasedElement (QCP::AntialiasedElement notAntialiasedElement, bool enabled=true)
 Sets whether the specified notAntialiasedElement is forcibly drawn not antialiased. More...
 
void setAutoAddPlottableToLegend (bool on)
 If set to true, adding a plottable (e.g. More...
 
void setAxisBackground (const QPixmap &pm)
 Sets pm as the axis background pixmap. More...
 
void setAxisBackground (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, whether it shall be scaled and how it shall be scaled in one call. More...
 
void setAxisBackgroundScaled (bool scaled)
 Sets whether the axis background pixmap shall be scaled to fit the current axis rect or not. More...
 
void setAxisBackgroundScaledMode (Qt::AspectRatioMode mode)
 If scaling of the axis background pixmap is enabled (setAxisBackgroundScaled), use this function to define whether and how the aspect ratio of the original pixmap passed to setAxisBackground is preserved. More...
 
void setInteractions (const Interactions &interactions)
 Sets the possible interactions of this QCustomPlot as an or-combination of Interaction enums. More...
 
void setInteraction (const Interaction &interaction, bool enabled=true)
 Sets the single interaction of this QCustomPlot to enabled. More...
 
void setSelectionTolerance (int pixels)
 Sets the tolerance that is used when deciding whether a click on the QCustomPlot surface selects an object (e.g. More...
 
void setSelectedTitleFont (const QFont &font)
 This font is used to draw the title, when it is selected. More...
 
void setSelectedTitleColor (const QColor &color)
 This color is used to draw the title, when it is selected. More...
 
void setTitleSelected (bool selected)
 Sets whether the plot title is selected. More...
 
void setNoAntialiasingOnDrag (bool enabled)
 Sets whether antialiasing is disabled for all elements while the user is dragging axes ranges. More...
 
void setPlottingHints (const QCP::PlottingHints &hints)
 Sets the plotting hints for this QCustomPlot instance. More...
 
void setPlottingHint (QCP::PlottingHint hint, bool enabled=true)
 Sets the specified plotting hint to enabled. More...
 
void setMultiSelectModifier (Qt::KeyboardModifier modifier)
 Sets the keyboard modifier that will be recognized as multi-select-modifier. More...
 
QCPAbstractPlottableplottable (int index)
 Returns the plottable with index. More...
 
QCPAbstractPlottableplottable ()
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns the last plottable, that was added with addPlottable. More...
 
bool addPlottable (QCPAbstractPlottable *plottable)
 Adds the specified plottable to the plot and, if setAutoAddPlottableToLegend is enabled, to the legend. More...
 
bool removePlottable (QCPAbstractPlottable *plottable)
 Removes the specified plottable from the plot and, if necessary, from the legend. More...
 
bool removePlottable (int index)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Removes the plottable by its index.
 
int clearPlottables ()
 Removes all plottables from the plot (and the legend, if necessary). More...
 
int plottableCount () const
 Returns the number of currently existing plottables in the plot. More...
 
QList< QCPAbstractPlottable * > selectedPlottables () const
 Returns a list of the selected plottables. More...
 
QCPAbstractPlottableplottableAt (const QPointF &pos, bool onlySelectable=false) const
 Returns the plottable at the pixel position pos. More...
 
bool hasPlottable (QCPAbstractPlottable *plottable) const
 Returns whether this QCustomPlot instance contains the plottable. More...
 
QCPGraphgraph (int index) const
 Returns the graph with index. More...
 
QCPGraphgraph () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns the last graph, that was created with addGraph. More...
 
QCPGraphaddGraph (QCPAxis *keyAxis=0, QCPAxis *valueAxis=0)
 Creates a new graph inside the plot. More...
 
bool removeGraph (QCPGraph *graph)
 Removes the specified graph from the plot and, if necessary, from the legend. More...
 
bool removeGraph (int index)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Removes the graph by its index.
 
int clearGraphs ()
 Removes all graphs from the plot (and the legend, if necessary). More...
 
int graphCount () const
 Returns the number of currently existing graphs in the plot. More...
 
QList< QCPGraph * > selectedGraphs () const
 Returns a list of the selected graphs. More...
 
QCPAbstractItemitem (int index) const
 Returns the item with index. More...
 
QCPAbstractItemitem () const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns the last item, that was added with addItem. More...
 
bool addItem (QCPAbstractItem *item)
 Adds the specified item to the plot. More...
 
bool removeItem (QCPAbstractItem *item)
 Removes the specified item from the plot. More...
 
bool removeItem (int index)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Removes the item by its index.
 
int clearItems ()
 Removes all items from the plot. More...
 
int itemCount () const
 Returns the number of currently existing items in the plot. More...
 
QList< QCPAbstractItem * > selectedItems () const
 Returns a list of the selected items. More...
 
QCPAbstractItemitemAt (const QPointF &pos, bool onlySelectable=false) const
 Returns the item at the pixel position pos. More...
 
QCPLayerlayer (const QString &name) const
 Returns the layer with the specified name. More...
 
QCPLayerlayer (int index) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Returns the layer by index. More...
 
QCPLayercurrentLayer () const
 Returns the layer that is set as current layer (see setCurrentLayer).
 
bool setCurrentLayer (const QString &name)
 Sets the layer with the specified name to be the current layer. More...
 
bool setCurrentLayer (QCPLayer *layer)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Sets the provided layer to be the current layer. More...
 
int layerCount () const
 Returns the number of currently existing layers in the plot. More...
 
bool addLayer (const QString &name, QCPLayer *otherLayer=0, LayerInsertMode insertMode=limAbove)
 Adds a new layer to this QCustomPlot instance. More...
 
bool removeLayer (QCPLayer *layer)
 Removes the specified layer and returns true on success. More...
 
bool moveLayer (QCPLayer *layer, QCPLayer *otherLayer, LayerInsertMode insertMode=limAbove)
 Moves the specified layer to the position relative to otherLayer. More...
 
QList< QCPAxis * > selectedAxes () const
 Returns the axes that currently have selected parts, i.e. More...
 
QList< QCPLegend * > selectedLegends () const
 Returns the legends (typically one or zero) that currently have selected parts, i.e. More...
 
void setupFullAxesBox ()
 Convenience function to make the top and right axes visible and assign them the following properties from their corresponding bottom/left axes: More...
 
bool savePdf (const QString &fileName, bool noCosmeticPen=false, int width=0, int height=0)
 Saves a PDF with the vectorized plot to the file fileName. More...
 
bool savePng (const QString &fileName, int width=0, int height=0, double scale=1.0, int quality=-1)
 Saves a PNG image file to fileName on disc. More...
 
bool saveJpg (const QString &fileName, int width=0, int height=0, double scale=1.0, int quality=-1)
 Saves a JPG image file to fileName on disc. More...
 
bool saveBmp (const QString &fileName, int width=0, int height=0, double scale=1.0)
 Saves a BMP image file to fileName on disc. More...
 
bool saveRastered (const QString &fileName, int width, int height, double scale, const char *format, int quality=-1)
 Saves the plot to a rastered image file fileName in the image format format. More...
 

Protected Slots

void ShiftViewport (int value)
 Shifts the viewport of the graph along the x axis. More...
 

Protected Member Functions

void SetBounds ()
 Sets the new upper and lower bounds and replots. More...
 
- Protected Member Functions inherited from QCPlot::QCustomPlot
virtual QSize minimumSizeHint () const
 
virtual void paintEvent (QPaintEvent *event)
 
virtual void resizeEvent (QResizeEvent *event)
 
virtual void mouseDoubleClickEvent (QMouseEvent *event)
 
virtual void mousePressEvent (QMouseEvent *event)
 
virtual void mouseMoveEvent (QMouseEvent *event)
 
virtual void mouseReleaseEvent (QMouseEvent *event)
 
virtual void wheelEvent (QWheelEvent *event)
 
virtual bool handlePlottableSelection (QMouseEvent *event, bool additiveSelection, bool &modified)
 
virtual bool handleItemSelection (QMouseEvent *event, bool additiveSelection, bool &modified)
 
virtual bool handleAxisSelection (QMouseEvent *event, bool additiveSelection, bool &modified)
 
virtual bool handleTitleSelection (QMouseEvent *event, bool additiveSelection, bool &modified)
 
virtual void draw (QCPPainter *painter)
 
virtual void drawAxisBackground (QCPPainter *painter)
 
void updateAxisRect ()
 
bool selectTestTitle (const QPointF &pos) const
 

Protected Attributes

double XLower_
 
double XUpper_
 
double YLower_
 
double YUpper_
 
double FullXUpper_
 
double FullXLower_
 
double FullYUpper_
 
double FullYLower_
 
- Protected Attributes inherited from QCPlot::QCustomPlot
QString mTitle
 
QFont mTitleFont
 
QFont mSelectedTitleFont
 
QColor mTitleColor
 
QColor mSelectedTitleColor
 
QRect mViewport
 
QRect mAxisRect
 
int mMarginLeft
 
int mMarginRight
 
int mMarginTop
 
int mMarginBottom
 
bool mAutoMargin
 
bool mAutoAddPlottableToLegend
 
QColor mColor
 
QList< QCPAbstractPlottable * > mPlottables
 
QList< QCPGraph * > mGraphs
 
QList< QCPAbstractItem * > mItems
 
QList< QCPLayer * > mLayers
 
Qt::Orientations mRangeDrag
 
Qt::Orientations mRangeZoom
 
QCPAxismRangeDragHorzAxis
 
QCPAxismRangeDragVertAxis
 
QCPAxismRangeZoomHorzAxis
 
QCPAxismRangeZoomVertAxis
 
double mRangeZoomFactorHorz
 
double mRangeZoomFactorVert
 
bool mDragging
 
QCP::AntialiasedElements mAntialiasedElements
 
QCP::AntialiasedElements mNotAntialiasedElements
 
QPixmap mAxisBackground
 
bool mAxisBackgroundScaled
 
Qt::AspectRatioMode mAxisBackgroundScaledMode
 
Interactions mInteractions
 
int mSelectionTolerance
 
bool mTitleSelected
 
QRect mTitleBoundingBox
 
bool mNoAntialiasingOnDrag
 
QPixmap mPaintBuffer
 
QPoint mDragStart
 
QCPRange mDragStartHorzRange
 
QCPRange mDragStartVertRange
 
QPixmap mScaledAxisBackground
 
bool mReplotting
 
QCP::AntialiasedElements mAADragBackup
 
QCP::AntialiasedElements mNotAADragBackup
 
QCPLayermCurrentLayer
 
QCP::PlottingHints mPlottingHints
 
Qt::KeyboardModifier mMultiSelectModifier
 

Additional Inherited Members

- Public Types inherited from QCPlot::QCustomPlot
enum  Interaction {
  iRangeDrag = 0x001, iRangeZoom = 0x002, iMultiSelect = 0x004, iSelectTitle = 0x008,
  iSelectPlottables = 0x010, iSelectAxes = 0x020, iSelectLegend = 0x040, iSelectItems = 0x080
}
 Defines the mouse interactions possible with QCustomPlot. More...
 
enum  LayerInsertMode { limBelow, limAbove }
 Defines how a layer should be inserted relative to a specified other layer. More...
 
- Public Slots inherited from QCPlot::QCustomPlot
void deselectAll ()
 Deselects everything in the QCustomPlot (plottables, items, axes, legend and title). More...
 
void replot ()
 Causes a complete replot (axes, labels, graphs, etc.) into the internal buffer. More...
 
void rescaleAxes ()
 Rescales the axes such that all plottables (e.g. More...
 
- Signals inherited from QCPlot::QCustomPlot
void mouseDoubleClick (QMouseEvent *event)
 This signal is emitted when the QCustomPlot receives a mouse double click event.
 
void mousePress (QMouseEvent *event)
 This signal is emitted when the QCustomPlot receives a mouse press event. More...
 
void mouseMove (QMouseEvent *event)
 This signal is emitted when the QCustomPlot receives a mouse move event. More...
 
void mouseRelease (QMouseEvent *event)
 This signal is emitted when the QCustomPlot receives a mouse release event. More...
 
void mouseWheel (QWheelEvent *event)
 This signal is emitted when the QCustomPlot receives a mouse wheel event. More...
 
void plottableClick (QCPAbstractPlottable *plottable, QMouseEvent *event)
 This signal is emitted when a plottable is clicked. More...
 
void plottableDoubleClick (QCPAbstractPlottable *plottable, QMouseEvent *event)
 This signal is emitted when a plottable is double clicked. More...
 
void itemClick (QCPAbstractItem *item, QMouseEvent *event)
 This signal is emitted when an item is clicked. More...
 
void itemDoubleClick (QCPAbstractItem *item, QMouseEvent *event)
 This signal is emitted when an item is double clicked. More...
 
void axisClick (QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event)
 This signal is emitted when an axis is clicked. More...
 
void axisDoubleClick (QCPAxis *axis, QCPAxis::SelectablePart part, QMouseEvent *event)
 This signal is emitted when an axis is double clicked. More...
 
void legendClick (QCPLegend *legend, QCPAbstractLegendItem *item, QMouseEvent *event)
 This signal is emitted when a legend (item) is clicked. More...
 
void legendDoubleClick (QCPLegend *legend, QCPAbstractLegendItem *item, QMouseEvent *event)
 This signal is emitted when a legend (item) is double clicked. More...
 
void titleClick (QMouseEvent *event)
 This signal is emitted when the plot title is clicked. More...
 
void titleDoubleClick (QMouseEvent *event)
 This signal is emitted when the plot title is double clicked. More...
 
void selectionChangedByUser ()
 This signal is emitted after the user has changed the selection in the QCustomPlot, e.g. More...
 
void beforeReplot ()
 This signal is emitted immediately before a replot takes place (caused by a call to the slot replot). More...
 
void afterReplot ()
 This signal is emitted immediately after a replot has taken place (caused by a call to the slot replot). More...
 
- Public Attributes inherited from QCPlot::QCustomPlot
QCPAxisxAxis
 
QCPAxisyAxis
 
QCPAxisxAxis2
 
QCPAxisyAxis2
 
QCPLegendlegend
 

Detailed Description

Extension of the QCustomPlot class that allows an implementation of the class with different event handlers.

The purpose of this extension is to provide extra slots and signals support that will not conflict with templating.

Member Function Documentation

void QCPExtended::SetBounds ( )
protected

Sets the new upper and lower bounds and replots.

NOTE: This method should be called after adjusting bound member variables.

void QCPExtended::ShiftViewport ( int  value)
protectedslot

Shifts the viewport of the graph along the x axis.

NOTE: "value" changes the value of the lower bound.


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