labplot  2.8.2
About: LabPlot is an application for plotting and analysis of 2D and 3D functions and data. It is a complete rewrite of LabPlot1 and lacks in the first release a lot of features available in the predecessor. On the other hand, the GUI and the usability is more superior.
  Fossies Dox: labplot-2.8.2.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

DatapickerImage Class Reference

container to open image/plot. More...

#include <DatapickerImage.h>

Inheritance diagram for DatapickerImage:
Collaboration diagram for DatapickerImage:


struct  EditorSettings
struct  ReferencePoints

Public Types

enum class  GraphType {
  Cartesian , PolarInDegree , PolarInRadians , LogarithmicX ,
  LogarithmicY , Ternary
enum class  ColorAttributes {
  None , Intensity , Foreground , Hue ,
  Saturation , Value
enum class  PlotImageType { NoImage , OriginalImage , ProcessedImage }
enum class  PointsType { AxisPoints , CurvePoints , SegmentPoints }
typedef DatapickerImagePrivate Private
- Public Types inherited from AbstractAspect
enum class  ChildIndexFlag { IncludeHidden = 0x01 , Recursive = 0x02 , Compress = 0x04 }
 Flags which control numbering scheme of children. More...


void requestProjectContextMenu (QMenu *)
void requestUpdate ()
void requestUpdateActions ()
void fileNameChanged (const QString &)
void rotationAngleChanged (float)
void axisPointsChanged (const DatapickerImage::ReferencePoints &)
void settingsChanged (const DatapickerImage::EditorSettings &)
void minSegmentLengthChanged (const int)
void pointStyleChanged (Symbol::Style)
void pointSizeChanged (qreal)
void pointRotationAngleChanged (qreal)
void pointOpacityChanged (qreal)
void pointBrushChanged (QBrush)
void pointPenChanged (const QPen &)
void pointVisibilityChanged (bool)
- Signals inherited from AbstractPart
void showRequested ()
void importFromFileRequested ()
void importFromSQLDatabaseRequested ()
void exportRequested ()
void printRequested ()
void printPreviewRequested ()
- Signals inherited from AbstractAspect
void aspectDescriptionAboutToChange (const AbstractAspect *)
 Emitted before the name, comment or caption spec is changed. More...
void aspectDescriptionChanged (const AbstractAspect *)
 Emitted after the name, comment or caption spec have changed. More...
void aspectAboutToBeAdded (const AbstractAspect *parent, const AbstractAspect *before, const AbstractAspect *child)
 Emitted before a new child is inserted. More...
void aspectAdded (const AbstractAspect *)
 Emitted after a new Aspect has been added to the tree. More...
void aspectAboutToBeRemoved (const AbstractAspect *)
 Emitted before an aspect is removed from its parent. More...
void aspectRemoved (const AbstractAspect *parent, const AbstractAspect *before, const AbstractAspect *child)
 Emitted from the parent after removing a child. More...
void aspectHiddenAboutToChange (const AbstractAspect *)
 Emitted before the hidden attribute is changed. More...
void aspectHiddenChanged (const AbstractAspect *)
 Emitted after the hidden attribute has changed. More...
void statusInfo (const QString &)
 Emitted whenever some aspect in the tree wants to give status information to the user. More...
void renameRequested ()
void selected (const AbstractAspect *)
void deselected (const AbstractAspect *)
void childAspectSelectedInView (const AbstractAspect *)
void childAspectDeselectedInView (const AbstractAspect *)

Public Member Functions

 DatapickerImage (const QString &name, bool loading=false)
 ~DatapickerImage () override
QIcon icon () const override
QMenu * createContextMenu () override
void createContextMenu (QMenu *)
QWidget * view () const override
 Construct a primary view on me. More...
bool exportView () const override
bool printView () override
bool printPreview () const override
void save (QXmlStreamWriter *) const override
 Save as XML. More...
bool load (XmlStreamReader *, bool preview) override
 Load from XML. More...
QRectF pageRect () const
void setPageRect (const QRectF &)
QGraphicsScene * scene () const
void setPrinting (bool) const
void setSelectedInView (const bool)
void setSegmentsHoverEvent (const bool)
void setPlotImageType (const DatapickerImage::PlotImageType)
DatapickerImage::PlotImageType plotImageType ()
- Public Member Functions inherited from AbstractPart
 AbstractPart (const QString &name, AspectType type)
 ~AbstractPart () override
void deleteView () const
PartMdiViewmdiSubWindow () const
 Wrap the view() into a PartMdiView. More...
bool hasMdiSubWindow () const
bool isDraggable () const override
QVector< AspectTypedropableOn () const override
virtual void registerShortcuts ()
virtual void unregisterShortcuts ()
- Public Member Functions inherited from AbstractAspect
 AbstractAspect (const QString &name, AspectType type)
 ~AbstractAspect () override
QString name () const
QString comment () const
void setCreationTime (const QDateTime &)
QDateTime creationTime () const
virtual Projectproject ()
 Return the Project this Aspect belongs to, or 0 if it is currently not part of one. More...
virtual QString path () const
 Return the path that leads from the top-most Aspect (usually a Project) to me. More...
void setHidden (bool)
 Set "hidden" property, i.e. whether to exclude this aspect from being shown in the explorer. More...
bool hidden () const
void setIsLoading (bool)
bool isLoading () const
AspectType type () const
bool inherits (AspectType type) const
AbstractAspectparentAspect () const
 Return my parent Aspect or 0 if I currently don't have one. More...
AbstractAspectparent (AspectType type) const
 In the parent-child hierarchy, return the first parent of type. More...
void setParentAspect (AbstractAspect *)
Folderfolder ()
 Return the folder the Aspect is contained in or 0 if there is none. More...
bool isDescendantOf (AbstractAspect *other)
 Return whether the there is a path upwards to the given aspect. More...
void addChild (AbstractAspect *)
 Add the given Aspect to my list of children. More...
void addChildFast (AbstractAspect *)
 Add the given Aspect to my list of children without any checks and without putting this step onto the undo-stack. More...
virtual void finalizeAdd ()
QVector< AbstractAspect * > children (AspectType type, ChildIndexFlags flags={}) const
void insertChildBefore (AbstractAspect *child, AbstractAspect *before)
 Insert the given Aspect at a specific position in my list of children. More...
void insertChildBeforeFast (AbstractAspect *child, AbstractAspect *before)
 Insert the given Aspect at a specific position in my list of children.without any checks and without putting this step onto the undo-stack. More...
void reparent (AbstractAspect *newParent, int newIndex=-1)
 Move a child to another parent aspect and transfer ownership. More...
void removeChild (AbstractAspect *)
 Remove the given Aspect from my list of children. More...
void removeAllChildren ()
 Remove all child Aspects. More...
virtual QVector< AbstractAspect * > dependsOn () const
virtual void processDropEvent (const QVector< quintptr > &)
template<class T >
T * ancestor () const
 Return the closest ancestor of class T (or NULL if none found). More...
template<class T >
QVector< T * > children (ChildIndexFlags flags={}) const
template<class T >
T * child (int index, ChildIndexFlags flags={}) const
template<class T >
T * child (const QString &name) const
 Get child by name and class. More...
template<class T >
int childCount (ChildIndexFlags flags={}) const
 Return the number of child Aspects inheriting from given class. More...
template<class T >
int indexOfChild (const AbstractAspect *child, ChildIndexFlags flags={}) const
 Return (0 based) index of child in the list of children inheriting from class T. More...
void setSelected (bool)
void setUndoAware (bool)
virtual QUndoStack * undoStack () const
 Return the undo stack of the Project, or 0 if this Aspect is not part of a Project. More...
void exec (QUndoCommand *)
 Execute the given command, pushing it on the undoStack() if available. More...
void exec (QUndoCommand *command, const char *preChangeSignal, const char *postChangeSignal, QGenericArgument val0=QGenericArgument(), QGenericArgument val1=QGenericArgument(), QGenericArgument val2=QGenericArgument(), QGenericArgument val3=QGenericArgument())
 Execute command and arrange for signals to be sent before/after it is redone or undone. More...
void beginMacro (const QString &text)
 Begin an undo stack macro (series of commands) More...
void endMacro ()
 End the current undo stack macro. More...

Public Attributes

bool isLoaded {false}
QImage originalPlotImage
QImage processedPlotImage
QColor background
int * foregroundBins
int * hueBins
int * saturationBins
int * valueBins
int * intensityBins
QGraphicsPixmapItem * m_magnificationWindow {nullptr}

Private Member Functions

void init ()

Private Attributes

DatapickerImagePrivate *const d
DatapickerImageViewm_view {nullptr}


class DatapickerImagePrivate

Additional Inherited Members

- Public Slots inherited from AbstractAspect
bool setName (const QString &, bool autoUnique=true)
 AbstractAspect::setName sets the name of the abstract aspect. More...
void setComment (const QString &)
void remove ()
 Remove me from my parent's list of children. More...
- Protected Slots inherited from AbstractAspect
virtual void childSelected (const AbstractAspect *)
virtual void childDeselected (const AbstractAspect *)
- Protected Member Functions inherited from AbstractAspect
void info (const QString &text)
 Implementations should call this whenever status information should be given to the user. More...
bool readBasicAttributes (XmlStreamReader *)
 Load name and creation time from XML. More...
void writeBasicAttributes (QXmlStreamWriter *) const
 Save name and creation time to XML. More...
void writeCommentElement (QXmlStreamWriter *) const
 Save the comment to XML. More...
bool readCommentElement (XmlStreamReader *)
 Load comment from an XML element. More...
- Protected Attributes inherited from AbstractPart
QWidget * m_partView {nullptr}
- Protected Attributes inherited from AbstractAspect
const AspectType m_type

Detailed Description

container to open image/plot.

File : DatapickerImage.cpp Project : LabPlot

Description : Worksheet for Datapicker

Copyright : (C) 2015 by Ankit Wagadre ( Copyright : (C) 2015-2019 by Alexander Semke (

  • This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. *
  • This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. *
  • You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301 USA *

Top-level container for DatapickerPoint.

Definition at line 49 of file DatapickerImage.h.

Member Typedef Documentation

◆ Private

Member Enumeration Documentation

◆ ColorAttributes


Definition at line 57 of file DatapickerImage.h.

◆ GraphType


Definition at line 56 of file DatapickerImage.h.

◆ PlotImageType


Definition at line 58 of file DatapickerImage.h.

◆ PointsType


Definition at line 59 of file DatapickerImage.h.

Constructor & Destructor Documentation

◆ DatapickerImage()

DatapickerImage::DatapickerImage ( const QString &  name,
bool  loading = false 

Definition at line 60 of file DatapickerImage.cpp.

References init().

◆ ~DatapickerImage()

DatapickerImage::~DatapickerImage ( )

Definition at line 74 of file DatapickerImage.cpp.

References d, foregroundBins, hueBins, intensityBins, m_segments, saturationBins, and valueBins.

Member Function Documentation

◆ axisPointsChanged

void DatapickerImage::axisPointsChanged ( const DatapickerImage::ReferencePoints )

◆ createContextMenu() [1/2]

QMenu * DatapickerImage::createContextMenu ( )

Return a new context menu

Reimplemented from AbstractPart.

Definition at line 132 of file DatapickerImage.cpp.

References requestProjectContextMenu().

Referenced by Datapicker::createContextMenu(), DatapickerView::createContextMenu(), and DatapickerView::showTabContextMenu().

◆ createContextMenu() [2/2]

void DatapickerImage::createContextMenu ( QMenu *  menu)

Definition at line 138 of file DatapickerImage.cpp.

References requestProjectContextMenu().

◆ exportView()

bool DatapickerImage::exportView ( ) const

◆ fileNameChanged

void DatapickerImage::fileNameChanged ( const QString &  )

◆ icon()

QIcon DatapickerImage::icon ( ) const

Returns an icon to be used in the project explorer.

Reimplemented from AbstractAspect.

Definition at line 125 of file DatapickerImage.cpp.

◆ init()

◆ load()

◆ minSegmentLengthChanged

void DatapickerImage::minSegmentLengthChanged ( const int  )

◆ pageRect()

QRectF DatapickerImage::pageRect ( ) const

Definition at line 212 of file DatapickerImage.cpp.

References d, and DatapickerImagePrivate::m_scene.

◆ plotImageType()

◆ pointBrushChanged

void DatapickerImage::pointBrushChanged ( QBrush  )

◆ pointOpacityChanged

void DatapickerImage::pointOpacityChanged ( qreal  )

◆ pointPenChanged

void DatapickerImage::pointPenChanged ( const QPen &  )

◆ pointRotationAngleChanged

void DatapickerImage::pointRotationAngleChanged ( qreal  )

◆ pointSizeChanged

void DatapickerImage::pointSizeChanged ( qreal  )

◆ pointStyleChanged

void DatapickerImage::pointStyleChanged ( Symbol::Style  )

◆ pointVisibilityChanged

void DatapickerImage::pointVisibilityChanged ( bool  )

◆ printPreview()

bool DatapickerImage::printPreview ( ) const

Implements AbstractPart.

Definition at line 185 of file DatapickerImage.cpp.

References m_view, and DatapickerImageView::print().

Referenced by Datapicker::printPreview().

◆ printView()

bool DatapickerImage::printView ( )

Implements AbstractPart.

Definition at line 173 of file DatapickerImage.cpp.

References m_view, and DatapickerImageView::print().

Referenced by Datapicker::printView().

◆ requestProjectContextMenu

void DatapickerImage::requestProjectContextMenu ( QMenu *  )

◆ requestUpdate

◆ requestUpdateActions

void DatapickerImage::requestUpdateActions ( )

◆ rotationAngleChanged

void DatapickerImage::rotationAngleChanged ( float  )

◆ save()

void DatapickerImage::save ( QXmlStreamWriter *  writer) const

Save as XML.

Implements AbstractAspect.

Definition at line 455 of file DatapickerImage.cpp.

References DatapickerImagePrivate::axisPoints, AbstractAspect::child(), d, DatapickerImagePrivate::fileName, DatapickerImage::EditorSettings::foregroundThresholdHigh, DatapickerImage::EditorSettings::foregroundThresholdLow, DatapickerImage::EditorSettings::hueThresholdHigh, DatapickerImage::EditorSettings::hueThresholdLow, AbstractAspect::IncludeHidden, DatapickerImage::EditorSettings::intensityThresholdHigh, DatapickerImage::EditorSettings::intensityThresholdLow, DatapickerImage::ReferencePoints::logicalPos, DatapickerImagePrivate::minSegmentLength, DatapickerImagePrivate::plotImageType, DatapickerImagePrivate::plotPointsType, DatapickerImagePrivate::pointBrush, DatapickerImagePrivate::pointOpacity, DatapickerImagePrivate::pointPen, DatapickerImagePrivate::pointRotationAngle, DatapickerImagePrivate::pointSeparation, DatapickerImagePrivate::pointSize, DatapickerImagePrivate::pointStyle, DatapickerImagePrivate::pointVisibility, DatapickerImagePrivate::rotationAngle, DatapickerImage::EditorSettings::saturationThresholdHigh, DatapickerImage::EditorSettings::saturationThresholdLow, DatapickerImage::ReferencePoints::scenePos, DatapickerImagePrivate::settings, DatapickerImage::ReferencePoints::ternaryScale, DatapickerImage::ReferencePoints::type, DatapickerImage::EditorSettings::valueThresholdHigh, DatapickerImage::EditorSettings::valueThresholdLow, WRITE_QBRUSH, WRITE_QPEN, and AbstractAspect::writeBasicAttributes().

◆ scene()

◆ setPageRect()

void DatapickerImage::setPageRect ( const QRectF &  )

◆ setPlotImageType()

◆ setPrinting()

◆ setSegmentsHoverEvent()

void DatapickerImage::setSegmentsHoverEvent ( const bool  on)

◆ setSelectedInView()

void DatapickerImage::setSelectedInView ( const bool  b)

Selects or deselects the Datapicker/DatapickerImage in the project explorer. This function is called in DatapickerImageView. The DatapickerImage gets deselected if there are selected items in the view, and selected if there are no selected items in the view.

Definition at line 197 of file DatapickerImage.cpp.

References AbstractAspect::childAspectDeselectedInView(), and AbstractAspect::childAspectSelectedInView().

◆ settingsChanged

void DatapickerImage::settingsChanged ( const DatapickerImage::EditorSettings )

◆ view()

QWidget * DatapickerImage::view ( ) const

Construct a primary view on me.

This method may be called multiple times during the life time of an Aspect, or it might not get called at all. Aspects must not depend on the existence of a view for their operation.

Implements AbstractPart.

Definition at line 147 of file DatapickerImage.cpp.

References AbstractPart::m_partView, m_view, AbstractAspect::statusInfo(), and DatapickerImageView::statusInfo().

Referenced by DatapickerView::fillToolBar().

Friends And Related Function Documentation

◆ DatapickerImagePrivate

friend class DatapickerImagePrivate

Definition at line 138 of file DatapickerImage.h.

Member Data Documentation

◆ background

QColor DatapickerImage::background

◆ d

DatapickerImagePrivate* const DatapickerImage::d

◆ foregroundBins

int* DatapickerImage::foregroundBins

◆ hueBins

int* DatapickerImage::hueBins

◆ intensityBins

int* DatapickerImage::intensityBins

◆ isLoaded

◆ m_magnificationWindow

◆ m_segments

◆ m_view

DatapickerImageView* DatapickerImage::m_view {nullptr}

Definition at line 137 of file DatapickerImage.h.

Referenced by exportView(), printPreview(), printView(), and view().

◆ originalPlotImage

◆ processedPlotImage

◆ saturationBins

int* DatapickerImage::saturationBins

◆ valueBins

int* DatapickerImage::valueBins

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