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)  

Column Class Reference

Aspect that manages a column. More...

#include <Column.h>

Inheritance diagram for Column:
[legend]
Collaboration diagram for Column:
[legend]

Signals

void requestProjectContextMenu (QMenu *)
 
- Signals inherited from AbstractColumn
void formatChanged (const AbstractColumn *source)
 
void reset (const AbstractColumn *source)
 
void plotDesignationAboutToChange (const AbstractColumn *source)
 Column plot designation will be changed. More...
 
void plotDesignationChanged (const AbstractColumn *source)
 Column plot designation changed. More...
 
void modeAboutToChange (const AbstractColumn *source)
 Column mode (possibly also the data type) will be changed. More...
 
void modeChanged (const AbstractColumn *source)
 Column mode (possibly also the data type) changed. More...
 
void dataAboutToChange (const AbstractColumn *source)
 Data of the column will be changed. More...
 
void dataChanged (const AbstractColumn *source)
 Data of the column has changed. More...
 
void rowsAboutToBeInserted (const AbstractColumn *source, int before, int count)
 Rows will be inserted. More...
 
void rowsInserted (const AbstractColumn *source, int before, int count)
 Rows have been inserted. More...
 
void rowsAboutToBeRemoved (const AbstractColumn *source, int first, int count)
 Rows will be deleted. More...
 
void rowsRemoved (const AbstractColumn *source, int first, int count)
 Rows have been deleted. More...
 
void maskingAboutToChange (const AbstractColumn *source)
 Rows are about to be masked or unmasked. More...
 
void maskingChanged (const AbstractColumn *source)
 Rows have been masked or unmasked. More...
 
void aboutToBeDestroyed (const AbstractColumn *source)
 Emitted shortl before this column is deleted. More...
 
- 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

 Column (const QString &name, AbstractColumn::ColumnMode=ColumnMode::Numeric)
 
template<typename T >
 Column (const QString &name, QVector< T > data, AbstractColumn::ColumnMode mode=ColumnMode::Numeric)
 
void init ()
 Common part of ctors. More...
 
 ~Column () override
 
QMenu * createContextMenu () override
 Return a new context menu. More...
 
void updateLocale ()
 
void setColumnMode (AbstractColumn::ColumnMode) override
 Set the column mode. More...
 
void setColumnModeFast (AbstractColumn::ColumnMode)
 
bool isDraggable () const override
 
QVector< AspectTypedropableOn () const override
 
bool copy (const AbstractColumn *) override
 Copy another column of the same type. More...
 
bool copy (const AbstractColumn *source, int source_start, int dest_start, int num_rows) override
 Copies a part of another column of the same type. More...
 
void setPlotDesignation (AbstractColumn::PlotDesignation) override
 Set the column plot designation. More...
 
int width () const
 Get width. More...
 
void setWidth (const int)
 Set width. More...
 
void clear () override
 Clear the whole column. More...
 
void setSuppressDataChangedSignal (const bool)
 
void addUsedInPlots (QVector< CartesianPlot * > &)
 
- Public Member Functions inherited from AbstractColumn
 AbstractColumn (const QString &name, AspectType type)
 Ctor. More...
 
 ~AbstractColumn () override
 
bool isNumeric () const
 
bool isPlottable () const
 
void insertRows (int before, int count)
 Insert some empty (or initialized with invalid values) rows. More...
 
void removeRows (int first, int count)
 Remove 'count' rows starting from row 'first'. More...
 
bool isValid (int row) const
 Convenience method for mode-independent testing of validity. More...
 
bool isMasked (int row) const
 Return whether a certain row is masked. More...
 
bool isMasked (const Interval< int > &i) const
 Return whether a certain interval of rows is fully masked. More...
 
QVector< Interval< int > > maskedIntervals () const
 Return all intervals of masked rows. More...
 
void clearMasks ()
 Clear all masking information. More...
 
void setMasked (const Interval< int > &i, bool mask=true)
 Set an interval masked. More...
 
void setMasked (int row, bool mask=true)
 Overloaded function for convenience. More...
 
- 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...
 

Private Slots

void navigateTo (QAction *)
 
void copyData ()
 

Private Member Functions

void handleRowInsertion (int before, int count) override
 Insert some empty (or initialized with zero) rows. More...
 
void handleRowRemoval (int first, int count) override
 Remove 'count' rows starting from row 'first'. More...
 

Private Attributes

bool m_suppressDataChangedSignal {false}
 
QAction * m_copyDataAction {nullptr}
 
QActionGroup * m_usedInActionGroup {nullptr}
 
ColumnPrivated
 
ColumnStringIOm_string_io
 

Friends

class ColumnPrivate
 
class ColumnStringIO
 

type specific functions

QIcon icon () const override
 Return an icon to be used for decorating the views and spreadsheet column headers. More...
 
const AbstractColumn::ColumnStatisticsstatistics () const
 
void * data () const
 
bool hasValues () const
 
void setFromColumn (int, AbstractColumn *, int)
 
QString textAt (int) const override
 Return the content of row 'row'. More...
 
void setTextAt (int, const QString &) override
 Set the content of row 'row'. More...
 
void replaceTexts (int, const QVector< QString > &) override
 Replace a range of values. More...
 
QDate dateAt (int) const override
 Return the date part of row 'row'. More...
 
void setDateAt (int, QDate) override
 Set the content of row 'row'. More...
 
QTime timeAt (int) const override
 Return the time part of row 'row'. More...
 
void setTimeAt (int, QTime) override
 Set the content of row 'row'. More...
 
QDateTime dateTimeAt (int) const override
 Return the QDateTime in row 'row'. More...
 
void setDateTimeAt (int, const QDateTime &) override
 Set the content of row 'row'. More...
 
void replaceDateTimes (int, const QVector< QDateTime > &) override
 Replace a range of values. More...
 
double valueAt (int) const override
 Return the double value in row 'row'. More...
 
void setValueAt (int, double) override
 Set the content of row 'row'. More...
 
void replaceValues (int, const QVector< double > &) override
 Replace a range of values. More...
 
int integerAt (int) const override
 Return the int value in row 'row'. More...
 
void setIntegerAt (int, int) override
 Set the content of row 'row'. More...
 
void replaceInteger (int, const QVector< int > &) override
 Replace a range of values. More...
 
qint64 bigIntAt (int) const override
 Return the bigint value in row 'row'. More...
 
void setBigIntAt (int, qint64) override
 Set the content of row 'row'. More...
 
void replaceBigInt (int, const QVector< qint64 > &) override
 Replace a range of values. More...
 
Properties properties () const override
 Column::properties Returns the column properties of this curve (monoton increasing, monoton decreasing, ... ) More...
 
void setChanged ()
 
void calculateStatistics () const
 

serialize/deserialize

AbstractColumn::ColumnMode columnMode () const override
 Return the column mode. More...
 
AbstractColumn::PlotDesignation plotDesignation () const override
 Return the column plot designation. More...
 
QString plotDesignationString () const override
 
bool isReadOnly () const override
 Return whether the object is read-only. More...
 
int rowCount () const override
 Return the data vector size. More...
 
int availableRowCount () const override
 Return the number of available data rows. More...
 
AbstractSimpleFilteroutputFilter () const
 
ColumnStringIOasStringColumn () const
 Return a wrapper column object used for String I/O. More...
 
void save (QXmlStreamWriter *) const override
 Save the column as XML. More...
 
bool load (XmlStreamReader *, bool preview) override
 Load the column from XML. More...
 
void finalizeLoad ()
 
bool XmlReadInputFilter (XmlStreamReader *)
 Read XML input filter element. More...
 
bool XmlReadOutputFilter (XmlStreamReader *)
 Read XML output filter element. More...
 
bool XmlReadFormula (XmlStreamReader *)
 Read XML formula element. More...
 
bool XmlReadRow (XmlStreamReader *)
 Read XML row element. More...
 

Formula related functions

void setFormula (const QString &formula, const QStringList &variableNames, const QVector< Column * > &columns, bool autoUpdate)
 Sets the formula used to generate column values. More...
 
QString formula () const
 Returns the formula used to generate column values. More...
 
const QStringList & formulaVariableNames () const
 
const QVector< Column * > & formulaVariableColumns () const
 
const QStringList & formulaVariableColumnPaths () const
 
void setformulVariableColumnsPath (int index, const QString &path)
 
void setformulVariableColumn (int index, Column *)
 
bool formulaAutoUpdate () const
 
void setFormula (const Interval< int > &, const QString &) override
 Set a formula string for an interval of rows. More...
 
void setFormula (int, const QString &) override
 Overloaded function for convenience. More...
 
void clearFormulas () override
 Clear all formulas. More...
 
void updateFormula ()
 

IntervalAttribute related functions

QString formula (int) const override
 Return the formula associated with row 'row'. More...
 
QVector< Interval< int > > formulaIntervals () const override
 Return the intervals that have associated formulas. More...
 
double maximum (int count=0) const override
 
double maximum (int startIndex, int endIndex) const override
 Column::maximum Calculates the maximum value in the column between the startIndex and endIndex. If startIndex is greater than endIndex the indices are swapped startIndex endIndex. More...
 
double minimum (int count=0) const override
 
double minimum (int startIndex, int endIndex) const override
 Column::minimum Calculates the minimum value in the column between the startIndex and endIndex, endIndex is excluded. If startIndex is greater than endIndex the indices are swapped startIndex endIndex. More...
 
int indexForValue (double x) const override
 
bool indicesMinMax (double v1, double v2, int &start, int &end) const override
 Column::indicesForX. More...
 
static int calculateMaxSteps (unsigned int value)
 
static int indexForValue (double x, QVector< double > &column, Properties properties=Properties::No)
 
static int indexForValue (const double x, const QVector< QPointF > &column, Properties properties=Properties::No)
 
static int indexForValue (double x, QVector< QLineF > &lines, Properties properties=Properties::No)
 
void handleFormatChange ()
 

Additional Inherited Members

- Public Types inherited from AbstractColumn
enum class  PlotDesignation {
  NoDesignation , X , Y , Z ,
  XError , XErrorPlus , XErrorMinus , YError ,
  YErrorMinus , YErrorPlus
}
 
enum class  ColumnMode {
  Numeric = 0 , Text = 1 , Month = 4 , Day = 5 ,
  DateTime = 6 , Integer = 24 , BigInt = 26
}
 
enum class  Properties { No = 0x00 , Constant = 0x01 , MonotonicIncreasing = 0x02 , MonotonicDecreasing = 0x04 }
 
- Public Types inherited from AbstractAspect
enum class  ChildIndexFlag { IncludeHidden = 0x01 , Recursive = 0x02 , Compress = 0x04 }
 Flags which control numbering scheme of children. More...
 
- 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...
 
- Static Public Member Functions inherited from AbstractColumn
static QStringList dateFormats ()
 
static QStringList timeFormats ()
 
static QStringList dateTimeFormats ()
 
static QIcon iconForMode (ColumnMode mode)
 Convenience method for mode-dependent icon. More...
 
- Protected Slots inherited from AbstractAspect
virtual void childSelected (const AbstractAspect *)
 
virtual void childDeselected (const AbstractAspect *)
 
- Protected Member Functions inherited from AbstractColumn
bool XmlReadMask (XmlStreamReader *)
 Read XML mask element. More...
 
void XmlWriteMask (QXmlStreamWriter *) const
 Write XML mask element. More...
 
- 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 AbstractAspect
const AspectType m_type
 

Detailed Description

Aspect that manages a column.

File : Column.cpp Project : LabPlot

Description : Aspect that manages a column

Copyright : (C) 2007-2009 Tilman Benkert (thzs@.nosp@m.gmx..nosp@m.net) Copyright : (C) 2013-2017 Alexander Semke (alexa.nosp@m.nder.nosp@m..semk.nosp@m.e@we.nosp@m.b.de) Copyright : (C) 2017 Stefan Gerlach (stefa.nosp@m.n.ge.nosp@m.rlach.nosp@m.@uni.nosp@m..kn)

  • 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 *

This class represents a column, i.e., (mathematically) a 1D vector of values with a header. It provides a public reading and (undo aware) writing interface as defined in AbstractColumn. A column can have one of currently three data types: double, QString, or QDateTime. The string representation of the values can differ depending on the mode of the column.

Column inherits from AbstractAspect and is intended to be a child of the corresponding Spreadsheet in the aspect hierarchy. Columns don't have a view as they are intended to be displayed inside a spreadsheet.

Definition at line 42 of file Column.h.

Constructor & Destructor Documentation

◆ Column() [1/2]

Column::Column ( const QString &  name,
AbstractColumn::ColumnMode  mode = ColumnMode::Numeric 
)
explicit

Definition at line 80 of file Column.cpp.

References init().

◆ Column() [2/2]

template<typename T >
Column::Column ( const QString &  name,
QVector< T >  data,
AbstractColumn::ColumnMode  mode = ColumnMode::Numeric 
)
inline

Definition at line 49 of file Column.h.

References init().

◆ ~Column()

Column::~Column ( )
override

Definition at line 107 of file Column.cpp.

References d, and m_string_io.

Member Function Documentation

◆ addUsedInPlots()

void Column::addUsedInPlots ( QVector< CartesianPlot * > &  plots)

◆ asStringColumn()

◆ availableRowCount()

int Column::availableRowCount ( ) const
overridevirtual

Return the number of available data rows.

This returns the number of rows that actually contain data. Rows beyond this can be masked etc. but should be ignored by filters, plots etc.

Implements AbstractColumn.

Definition at line 1406 of file Column.cpp.

References ColumnPrivate::availableRowCount(), and d.

Referenced by ColumnStringIO::availableRowCount().

◆ bigIntAt()

qint64 Column::bigIntAt ( int  row) const
overridevirtual

Return the bigint value in row 'row'.

Reimplemented from AbstractColumn.

Definition at line 989 of file Column.cpp.

References ColumnPrivate::bigIntAt(), and d.

Referenced by AddSubtractValueDialog::setColumns().

◆ calculateMaxSteps()

int Column::calculateMaxSteps ( unsigned int  value)
static

calculates log2(x)+1 for an integer value. Used in y(double x) to calculate the maximum steps source: https://stackoverflow.com/questions/11376288/fast-computing-of-log2-for-64-bit-integers source: https://graphics.stanford.edu/~seander/bithacks.html#IntegerLogLookup

Parameters
value
Returns
returns calculated value

Definition at line 1795 of file Column.cpp.

Referenced by indexForValue().

◆ calculateStatistics()

◆ clear()

void Column::clear ( )
overridevirtual

Clear the whole column.

Reimplemented from AbstractColumn.

Definition at line 425 of file Column.cpp.

References d, and AbstractAspect::exec().

Referenced by SpreadsheetView::clearSelectedCells().

◆ clearFormulas()

void Column::clearFormulas ( )
overridevirtual

Clear all formulas.

Reimplemented from AbstractColumn.

Definition at line 505 of file Column.cpp.

References d, and AbstractAspect::exec().

◆ columnMode()

◆ copy() [1/2]

bool Column::copy ( const AbstractColumn other)
overridevirtual

Copy another column of the same type.

This function will return false if the data type of 'other' is not the same as the type of 'this'. Use a filter to convert a column to another type.

Reimplemented from AbstractColumn.

Definition at line 348 of file Column.cpp.

References AbstractColumn::columnMode(), columnMode(), d, and AbstractAspect::exec().

Referenced by ColumnStringIO::copy(), Spreadsheet::copy(), and ColumnStringIO::setTextAt().

◆ copy() [2/2]

bool Column::copy ( const AbstractColumn source,
int  source_start,
int  dest_start,
int  num_rows 
)
overridevirtual

Copies a part of another column of the same type.

This function will return false if the data type of 'other' is not the same as the type of 'this'.

Parameters
sourcepointer to the column to copy
source_startfirst row to copy in the column to copy
dest_startfirst row to copy in
num_rowsthe number of rows to copy

Reimplemented from AbstractColumn.

Definition at line 365 of file Column.cpp.

References AbstractColumn::columnMode(), columnMode(), d, and AbstractAspect::exec().

◆ copyData

void Column::copyData ( )
privateslot

◆ createContextMenu()

QMenu * Column::createContextMenu ( )
overridevirtual

◆ data()

◆ dateAt()

QDate Column::dateAt ( int  row) const
overridevirtual

Return the date part of row 'row'.

Use this only when columnMode() is DateTime, Month or Day

Reimplemented from AbstractColumn.

Definition at line 950 of file Column.cpp.

References d, and ColumnPrivate::dateAt().

Referenced by setTimeAt().

◆ dateTimeAt()

QDateTime Column::dateTimeAt ( int  row) const
overridevirtual

Return the QDateTime in row 'row'.

Use this only when columnMode() is DateTime, Month or Day

Reimplemented from AbstractColumn.

Definition at line 968 of file Column.cpp.

References d, and ColumnPrivate::dateTimeAt().

Referenced by hasValues(), indexForValue(), indicesMinMax(), maximum(), SpreadsheetView::maxRowToExport(), minimum(), save(), AddSubtractValueDialog::setColumns(), and Spreadsheet::sortColumns().

◆ dropableOn()

QVector< AspectType > Column::dropableOn ( ) const
overridevirtual

Reimplemented from AbstractAspect.

Definition at line 337 of file Column.cpp.

References CartesianPlot.

◆ finalizeLoad()

void Column::finalizeLoad ( )

Definition at line 1223 of file Column.cpp.

References d, and ColumnPrivate::finalizeLoad().

◆ formula() [1/2]

QString Column::formula ( ) const

Returns the formula used to generate column values.

Definition at line 440 of file Column.cpp.

References d, and ColumnPrivate::formula().

Referenced by SpreadsheetModel::data(), save(), setFormula(), and XmlReadFormula().

◆ formula() [2/2]

QString Column::formula ( int  row) const
overridevirtual

Return the formula associated with row 'row'.

Reimplemented from AbstractColumn.

Definition at line 1462 of file Column.cpp.

References d, and ColumnPrivate::formula().

◆ formulaAutoUpdate()

bool Column::formulaAutoUpdate ( ) const

Definition at line 464 of file Column.cpp.

References d, and ColumnPrivate::formulaAutoUpdate().

◆ formulaIntervals()

QVector< Interval< int > > Column::formulaIntervals ( ) const
overridevirtual

Return the intervals that have associated formulas.

This can be used to make a list of formulas with their intervals. Here is some example code:

QStringList list;
QVector< Interval<int> > intervals = my_column.formulaIntervals();
foreach(Interval<int> interval, intervals)
list << QString(interval.toString() + ": " + my_column.formula(interval.start()));
T start() const
Definition: Interval.h:50
QString toString() const
Return a string in the format '[start,end]'.
Definition: Interval.h:192
Auxiliary class for interval based data.
Definition: Interval.h:212

Reimplemented from AbstractColumn.

Definition at line 1479 of file Column.cpp.

References d, and ColumnPrivate::formulaIntervals().

◆ formulaVariableColumnPaths()

const QStringList & Column::formulaVariableColumnPaths ( ) const

Definition at line 452 of file Column.cpp.

References d, and ColumnPrivate::formulaVariableColumnPaths().

Referenced by save().

◆ formulaVariableColumns()

const QVector< Column * > & Column::formulaVariableColumns ( ) const

Definition at line 448 of file Column.cpp.

References d, and ColumnPrivate::formulaVariableColumns().

◆ formulaVariableNames()

const QStringList & Column::formulaVariableNames ( ) const

Definition at line 444 of file Column.cpp.

References d, and ColumnPrivate::formulaVariableNames().

Referenced by save().

◆ handleFormatChange

◆ handleRowInsertion()

void Column::handleRowInsertion ( int  before,
int  count 
)
overrideprivatevirtual

◆ handleRowRemoval()

void Column::handleRowRemoval ( int  first,
int  count 
)
overrideprivatevirtual

◆ hasValues()

◆ icon()

QIcon Column::icon ( ) const
overridevirtual

Return an icon to be used for decorating the views and spreadsheet column headers.

Reimplemented from AbstractAspect.

Definition at line 1015 of file Column.cpp.

References columnMode(), and AbstractColumn::iconForMode().

◆ indexForValue() [1/4]

int Column::indexForValue ( const double  x,
const QVector< QPointF > &  points,
Properties  properties = Properties::No 
)
static

Find index which corresponds to a x . In a vector of values When monotonic increasing or decreasing a different algorithm will be used, which needs less steps (mean) (log_2(rowCount)) to find the value.

Parameters
x
Returns
-1 if index not found, otherwise the index

Definition at line 1898 of file Column.cpp.

References calculateMaxSteps(), AbstractColumn::Constant, AbstractColumn::MonotonicDecreasing, AbstractColumn::MonotonicIncreasing, properties(), rowCount(), and nsl_smooth_check::x.

◆ indexForValue() [2/4]

◆ indexForValue() [3/4]

int Column::indexForValue ( double  x,
QVector< double > &  column,
Properties  properties = Properties::No 
)
static

Find index which corresponds to a x . In a vector of values When monotonic increasing or decreasing a different algorithm will be used, which needs less steps (mean) (log_2(rowCount)) to find the value.

Parameters
x
Returns
-1 if index not found, otherwise the index

Definition at line 1831 of file Column.cpp.

References calculateMaxSteps(), AbstractColumn::Constant, AbstractColumn::MonotonicDecreasing, AbstractColumn::MonotonicIncreasing, properties(), rowCount(), and nsl_smooth_check::x.

Referenced by XYCurvePrivate::activateCurve(), indicesMinMax(), XYCurvePrivate::retransform(), and XYCurvePrivate::updateLines().

◆ indexForValue() [4/4]

int Column::indexForValue ( double  x,
QVector< QLineF > &  lines,
Properties  properties = Properties::No 
)
static

Find index which corresponds to a x . In a vector of values When monotonic increasing or decreasing a different algorithm will be used, which needs less steps (mean) (log_2(rowCount)) to find the value.

Parameters
x
Returns
-1 if index not found, otherwise the index

Definition at line 1968 of file Column.cpp.

References calculateMaxSteps(), AbstractColumn::Constant, AbstractColumn::MonotonicDecreasing, AbstractColumn::MonotonicIncreasing, properties(), rowCount(), and nsl_smooth_check::x.

◆ indicesMinMax()

bool Column::indicesMinMax ( double  v1,
double  v2,
int &  start,
int &  end 
) const
overridevirtual

◆ init()

◆ integerAt()

int Column::integerAt ( int  row) const
overridevirtual

Return the int value in row 'row'.

Reimplemented from AbstractColumn.

Definition at line 982 of file Column.cpp.

References d, and ColumnPrivate::integerAt().

Referenced by AddSubtractValueDialog::setColumns().

◆ isDraggable()

bool Column::isDraggable ( ) const
overridevirtual

Reimplemented from AbstractAspect.

Definition at line 333 of file Column.cpp.

◆ isReadOnly()

bool Column::isReadOnly ( ) const
overridevirtual

Return whether the object is read-only.

Reimplemented from AbstractColumn.

Definition at line 1377 of file Column.cpp.

◆ load()

◆ maximum() [1/2]

double Column::maximum ( int  count = 0) const
overridevirtual

calculates the maximal value in the column. for count = 0, the maximum of all elements is returned. for count > 0, the maximum of the first count elements is returned. for count < 0, the maximum of the last count elements is returned.

Reimplemented from AbstractColumn.

Definition at line 1653 of file Column.cpp.

References d, AbstractColumn::ColumnStatistics::maximum, rowCount(), statistics(), and ColumnPrivate::statisticsAvailable.

Referenced by XYFitCurve::initStartValues().

◆ maximum() [2/2]

double Column::maximum ( int  startIndex,
int  endIndex 
) const
overridevirtual

◆ minimum() [1/2]

double Column::minimum ( int  count = 0) const
overridevirtual

calculates the minimal value in the column. for count = 0, the minimum of all elements is returned. for count > 0, the minimum of the first count elements is returned. for count < 0, the minimum of the last count elements is returned.

Reimplemented from AbstractColumn.

Definition at line 1507 of file Column.cpp.

References d, AbstractColumn::ColumnStatistics::minimum, rowCount(), statistics(), and ColumnPrivate::statisticsAvailable.

Referenced by XYFitCurve::initStartValues().

◆ minimum() [2/2]

double Column::minimum ( int  startIndex,
int  endIndex 
) const
overridevirtual

Column::minimum Calculates the minimum value in the column between the startIndex and endIndex, endIndex is excluded. If startIndex is greater than endIndex the indices are swapped startIndex endIndex.

Reimplemented from AbstractColumn.

Definition at line 1537 of file Column.cpp.

References AbstractColumn::BigInt, columnMode(), AbstractColumn::Constant, data(), AbstractColumn::DateTime, dateTimeAt(), AbstractColumn::Day, AbstractColumn::Integer, AbstractColumn::isMasked(), AbstractColumn::isValid(), nsl_smooth_check::mode, AbstractColumn::MonotonicDecreasing, AbstractColumn::MonotonicIncreasing, AbstractColumn::Month, AbstractColumn::No, AbstractColumn::Numeric, properties(), rowCount(), AbstractColumn::Text, and valueAt().

◆ navigateTo

void Column::navigateTo ( QAction *  action)
privateslot

Definition at line 206 of file Column.cpp.

References asan_symbolize::action, Project::navigateTo(), and AbstractAspect::project().

Referenced by init().

◆ outputFilter()

◆ plotDesignation()

◆ plotDesignationString()

◆ properties()

AbstractColumn::Properties Column::properties ( ) const
overridevirtual

Column::properties Returns the column properties of this curve (monoton increasing, monoton decreasing, ... )

See also
AbstractColumn::properties

Reimplemented from AbstractColumn.

Definition at line 639 of file Column.cpp.

References d, ColumnPrivate::properties, ColumnPrivate::propertiesAvailable, and ColumnPrivate::updateProperties().

Referenced by indexForValue(), indicesMinMax(), maximum(), and minimum().

◆ replaceBigInt()

void Column::replaceBigInt ( int  first,
const QVector< qint64 > &  new_values 
)
overridevirtual

Replace a range of values.

Use this only when columnMode() is BigInt

Reimplemented from AbstractColumn.

Definition at line 629 of file Column.cpp.

References d, and AbstractAspect::exec().

Referenced by SpreadsheetView::pasteIntoSelection(), and DropValuesTask::run().

◆ replaceDateTimes()

void Column::replaceDateTimes ( int  first,
const QVector< QDateTime > &  new_values 
)
overridevirtual

Replace a range of values.

Use this only when columnMode() is DateTime, Month or Day

Reimplemented from AbstractColumn.

Definition at line 569 of file Column.cpp.

References d, and AbstractAspect::exec().

◆ replaceInteger()

void Column::replaceInteger ( int  first,
const QVector< int > &  new_values 
)
overridevirtual

Replace a range of values.

Use this only when columnMode() is Integer

Reimplemented from AbstractColumn.

Definition at line 607 of file Column.cpp.

References d, and AbstractAspect::exec().

Referenced by SpreadsheetView::pasteIntoSelection(), and DropValuesTask::run().

◆ replaceTexts()

void Column::replaceTexts ( int  first,
const QVector< QString > &  new_values 
)
overridevirtual

Replace a range of values.

Use this only when columnMode() is Text

Reimplemented from AbstractColumn.

Definition at line 532 of file Column.cpp.

References d, and AbstractAspect::exec().

◆ replaceValues()

void Column::replaceValues ( int  first,
const QVector< double > &  new_values 
)
overridevirtual

Replace a range of values.

Use this only when columnMode() is Numeric

Reimplemented from AbstractColumn.

Definition at line 588 of file Column.cpp.

References d, and AbstractAspect::exec().

Referenced by CantorWorksheet::dataChanged(), SpreadsheetView::pasteIntoSelection(), CantorWorksheet::rowsInserted(), and DropValuesTask::run().

◆ requestProjectContextMenu

void Column::requestProjectContextMenu ( QMenu *  )
signal

◆ rowCount()

◆ save()

◆ setBigIntAt()

void Column::setBigIntAt ( int  row,
qint64  new_value 
)
overridevirtual

Set the content of row 'row'.

Use this only when columnMode() is BigInt

Reimplemented from AbstractColumn.

Definition at line 617 of file Column.cpp.

References d, AbstractAspect::exec(), ColumnPrivate::hasValuesAvailable, ColumnPrivate::propertiesAvailable, and ColumnPrivate::statisticsAvailable.

Referenced by SpreadsheetView::pasteIntoSelection(), setFromColumn(), and XmlReadRow().

◆ setChanged()

◆ setColumnMode()

◆ setColumnModeFast()

◆ setDateAt()

void Column::setDateAt ( int  row,
QDate  new_value 
)
overridevirtual

Set the content of row 'row'.

Use this only when columnMode() is DateTime, Month or Day

Reimplemented from AbstractColumn.

Definition at line 542 of file Column.cpp.

References setDateTimeAt(), and timeAt().

◆ setDateTimeAt()

void Column::setDateTimeAt ( int  row,
const QDateTime &  new_value 
)
overridevirtual

Set the content of row 'row'.

Use this only when columnMode() is DateTime, Month or Day

Reimplemented from AbstractColumn.

Definition at line 560 of file Column.cpp.

References d, and AbstractAspect::exec().

Referenced by setDateAt(), setFromColumn(), setTimeAt(), and XmlReadRow().

◆ setFormula() [1/3]

void Column::setFormula ( const Interval< int > &  i,
const QString &  formula 
)
overridevirtual

Set a formula string for an interval of rows.

Reimplemented from AbstractColumn.

Definition at line 491 of file Column.cpp.

References d, AbstractAspect::exec(), and formula().

◆ setFormula() [2/3]

void Column::setFormula ( const QString &  formula,
const QStringList &  variableNames,
const QVector< Column * > &  columns,
bool  autoUpdate 
)

Sets the formula used to generate column values.

Definition at line 471 of file Column.cpp.

References d, AbstractAspect::exec(), and formula().

Referenced by Spreadsheet::copy(), SpreadsheetModel::setData(), and setFormula().

◆ setFormula() [3/3]

void Column::setFormula ( int  row,
const QString &  formula 
)
overridevirtual

Overloaded function for convenience.

Reimplemented from AbstractColumn.

Definition at line 498 of file Column.cpp.

References formula(), and setFormula().

◆ setformulVariableColumn()

void Column::setformulVariableColumn ( int  index,
Column column 
)

Definition at line 460 of file Column.cpp.

References d, and ColumnPrivate::setformulVariableColumn().

◆ setformulVariableColumnsPath()

void Column::setformulVariableColumnsPath ( int  index,
const QString &  path 
)

◆ setFromColumn()

◆ setIntegerAt()

void Column::setIntegerAt ( int  row,
int  new_value 
)
overridevirtual

Set the content of row 'row'.

Use this only when columnMode() is Integer

Reimplemented from AbstractColumn.

Definition at line 598 of file Column.cpp.

References d, and AbstractAspect::exec().

Referenced by SpreadsheetView::pasteIntoSelection(), setFromColumn(), and XmlReadRow().

◆ setPlotDesignation()

◆ setSuppressDataChangedSignal()

◆ setTextAt()

void Column::setTextAt ( int  row,
const QString &  new_value 
)
overridevirtual

Set the content of row 'row'.

Use this only when columnMode() is Text

Reimplemented from AbstractColumn.

Definition at line 523 of file Column.cpp.

References d, and AbstractAspect::exec().

Referenced by OriginProjectParser::loadSpreadsheet(), setFromColumn(), and XmlReadRow().

◆ setTimeAt()

void Column::setTimeAt ( int  row,
QTime  new_value 
)
overridevirtual

Set the content of row 'row'.

Use this only when columnMode() is DateTime, Month or Day

Reimplemented from AbstractColumn.

Definition at line 551 of file Column.cpp.

References dateAt(), and setDateTimeAt().

◆ setValueAt()

void Column::setValueAt ( int  row,
double  new_value 
)
overridevirtual

Set the content of row 'row'.

Use this only when columnMode() is Numeric

Reimplemented from AbstractColumn.

Definition at line 579 of file Column.cpp.

References d, and AbstractAspect::exec().

Referenced by OriginProjectParser::loadSpreadsheet(), SpreadsheetView::pasteIntoSelection(), setFromColumn(), and XmlReadRow().

◆ setWidth()

void Column::setWidth ( const int  value)

◆ statistics()

const Column::ColumnStatistics & Column::statistics ( ) const

◆ textAt()

QString Column::textAt ( int  row) const
overridevirtual

Return the content of row 'row'.

Use this only when columnMode() is Text

Reimplemented from AbstractColumn.

Definition at line 941 of file Column.cpp.

References d, and ColumnPrivate::textAt().

Referenced by hasValues(), SpreadsheetView::maxRowToExport(), save(), Spreadsheet::sortColumns(), and FITSFilterPrivate::writeCHDU().

◆ timeAt()

QTime Column::timeAt ( int  row) const
overridevirtual

Return the time part of row 'row'.

Use this only when columnMode() is DateTime, Month or Day

Reimplemented from AbstractColumn.

Definition at line 959 of file Column.cpp.

References d, and ColumnPrivate::timeAt().

Referenced by setDateAt().

◆ updateFormula

void Column::updateFormula ( )
slot

in case the cell values are calculated via a global column formula, updates the values on data changes in all the dependent changes in the "variable columns".

Definition at line 481 of file Column.cpp.

References d, ColumnPrivate::hasValuesAvailable, ColumnPrivate::propertiesAvailable, ColumnPrivate::statisticsAvailable, and ColumnPrivate::updateFormula().

Referenced by ColumnPrivate::connectFormulaColumn().

◆ updateLocale()

void Column::updateLocale ( )

◆ valueAt()

◆ width()

int Column::width ( ) const

Get width.

Definition at line 411 of file Column.cpp.

References d, and ColumnPrivate::width().

Referenced by SpreadsheetView::handleAspectAdded(), and save().

◆ XmlReadFormula()

bool Column::XmlReadFormula ( XmlStreamReader reader)
private

Read XML formula element.

Definition at line 1254 of file Column.cpp.

References d, formula(), and ColumnPrivate::setFormula().

Referenced by load().

◆ XmlReadInputFilter()

bool Column::XmlReadInputFilter ( XmlStreamReader reader)
private

Read XML input filter element.

Definition at line 1230 of file Column.cpp.

References d, ColumnPrivate::inputFilter(), AbstractSimpleFilter::load(), and XmlStreamReader::skipToNextTag().

Referenced by load().

◆ XmlReadOutputFilter()

bool Column::XmlReadOutputFilter ( XmlStreamReader reader)
private

Read XML output filter element.

Definition at line 1242 of file Column.cpp.

References d, AbstractSimpleFilter::load(), ColumnPrivate::outputFilter(), and XmlStreamReader::skipToNextTag().

Referenced by load().

◆ XmlReadRow()

Friends And Related Function Documentation

◆ ColumnPrivate

friend class ColumnPrivate
friend

Definition at line 175 of file Column.h.

◆ ColumnStringIO

friend class ColumnStringIO
friend

Definition at line 176 of file Column.h.

Referenced by init().

Member Data Documentation

◆ d

◆ m_copyDataAction

QAction* Column::m_copyDataAction {nullptr}
private

Definition at line 161 of file Column.h.

Referenced by createContextMenu(), and init().

◆ m_string_io

◆ m_suppressDataChangedSignal

◆ m_usedInActionGroup

QActionGroup* Column::m_usedInActionGroup {nullptr}
private

Definition at line 162 of file Column.h.

Referenced by createContextMenu(), and init().


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