![]() |
JKQTPlotter trunk/v5.0.0
an extensive Qt5+Qt6 Plotter framework (including a feature-richt plotter widget, a speed-optimized, but limited variant and a LaTeX equation renderer!), written fully in C/C++ and without external dependencies
|
internally stores information about one data column. See JKQTPDatastore for more information. More...
#include <jkqtpdatastorage.h>
Public Types | |
| typedef JKQTPColumnConstIterator | const_iterator |
| typedef JKQTPColumnIterator | iterator |
Public Member Functions | |
| JKQTPColumn () | |
| JKQTPColumn (JKQTPDatastore *datastore, const QString &name=QString(""), size_t datastoreItem=0, size_t datastoreOffset=0, size_t imageColumns=1) | |
| class constructor that binds the column to a specific datastore object. | |
| double & | at (int n) |
| returns a reference to the n -th row in this column (possibly throwing an exception if it does not exist!) | |
| const double & | at (int n) const |
| returns a reference to the n -th row in this column (possibly throwing an exception if it does not exist!) | |
| iterator | begin () |
| returns an iterator to the internal data | |
| const_iterator | begin () const |
| returns an iterator to the internal data | |
| quint16 | calculateChecksum () const |
| calculates a checksum over the contents of the column (using qChecksum()) | |
| void | copy (const double *data, size_t N, size_t offset=0) |
| copy data from the given array into the column | |
| QVector< double > | copyData () |
| returns a QVector with the contained data (as a copy) | |
| void | copyData (QVector< double > ©To) const |
| copies the contained data into a QVector | |
| void | decValue (size_t n, double decrement=1.0) |
| decrement the n'th value from the column | |
| iterator | end () |
| returns an iterator to the internal data | |
| const_iterator | end () const |
| returns an iterator to the internal data | |
| void | exchange (double value, double replace) |
| exchange every occurence of a given value by a replace value | |
| JKQTPDatastoreItem * | getDatastoreItem () |
| returns a pointer to the datastore item representing this column | |
| const JKQTPDatastoreItem * | getDatastoreItem () const |
| returns a pointer to the datastore item representing this column | |
| size_t | getDatastoreItemNum () const |
| index of the item in the datastore that contains the data for this column | |
| size_t | getDatastoreOffset () const |
| offset, if the datastore item contains more than one column | |
| size_t | getImageColumns () const |
| number of columns, if interpreted as a row-major image | |
| QString | getName () const |
| a name describing the column | |
| double | getPixelValue (size_t x, size_t y) const |
| returns the element at (x,y) in the column, where the data is interpreted as a row-major ordered Matrix of the width imageWidth | |
| double * | getPointer (size_t n=0) |
| gets a pointer to the n-th value in the column | |
| const double * | getPointer (size_t n=0) const |
| gets a pointer to the n-th value in the column | |
| size_t | getRows () const |
| returns the number of rows in this column (accesses the datastore) | |
| double | getValue (int n) const |
| reads the n'th value from the column | |
| double | getValue (size_t n) const |
| reads the n'th value from the column | |
| void | incValue (size_t n, double increment=1.0) |
| increment the n'th value from the column | |
| bool | isValid () const |
| bool | operator== (const JKQTPColumn &other) const |
| two columns are equal, if the same memory in the same datastore is referenced | |
| void | scale (double factor) |
| scales all members of the column with the given factor | |
| void | setAll (double value) |
| set all values in the column to a specific value | |
| void | setImageColumns (size_t imageWidth) |
| number of columns, if interpreted as a row-major image | |
| void | setName (const QString &__value) |
| a name describing the column | |
| void | setPixelValue (size_t x, size_t y, double val) |
| sets the element at (x,y) in the column, where the data is interpreted as a row-major ordered Matrix of the width imageWidth | |
| void | setPixelValue (size_t x, size_t y, size_t width, double val) |
| sets the element at (x,y) in the column, where the data is interpreted as a row-major ordered Matrix of the given width | |
| void | setValue (size_t n, double val) |
| sets the n'th value from the column | |
| void | subtract (double value) |
| subtracts a given value from all members of the column | |
Protected Member Functions | |
| bool | convertVectorItem (size_t *usedVectorItem=nullptr) |
| if the column's data is \u not stored in an internal vector item, this copies the data into a vector item This does copies all data. | |
| bool | convertVectorItemFromRange (size_t start1, size_t end1, size_t *usedVectorItem=nullptr) |
| if the column's data is \u not stored in an internal vector item, this copies the data into a vector item This does not copy all data, but only the inclusive row range [start1..end1]. | |
| bool | convertVectorItemFromRanges (size_t start1, size_t end1, size_t start2, size_t end2, size_t *usedVectorItem=nullptr) |
| if the column's data is \u not stored in an internal vector item, this copies the data into a vector item This does not copy all data, but only the inclusive row ranges [start1..end1] and [start2..end2]. | |
| void | eraseFromVectorColumn (size_t row) |
| removes the entry row | |
| void | eraseFromVectorColumn (size_t row, size_t rowEnd) |
| removes the entries row to rowEnd (inclusive) | |
| JKQTPDatastore * | getDatastore () |
| const JKQTPDatastore * | getDatastore () const |
| void | replaceMemory (size_t datastoreItem_=0, size_t datastoreOffset_=0) |
| lets the column point to another datastore item with id datastoreItem_ (of type JKQTPDatastoreItem) in the owning JKQTPDataStore. The column points to the datastoreOffset_ -th column within that JKQTPDatastoreItem . | |
Private Attributes | |
| JKQTPDatastore * | datastore |
| pointer to the datastore object used to manage the data of the plot | |
| size_t | datastoreItem |
| index of the item in the datastore that contains the data for this column | |
| size_t | datastoreOffset |
| offset, if the datastore item contains more than one column | |
| size_t | imageColumns |
| number of columns, if interpreted as a row-major image | |
| QString | name |
| a name describing the column | |
| bool | valid |
| is this item valid?/usable? | |
Friends | |
| class | JKQTPColumnConstIterator |
| class | JKQTPColumnIterator |
| class | JKQTPDatastore |
internally stores information about one data column. See JKQTPDatastore for more information.
| JKQTPColumn::JKQTPColumn | ( | ) |
| JKQTPColumn::JKQTPColumn | ( | JKQTPDatastore * | datastore, |
| const QString & | name = QString(""), | ||
| size_t | datastoreItem = 0, | ||
| size_t | datastoreOffset = 0, | ||
| size_t | imageColumns = 1 ) |
class constructor that binds the column to a specific datastore object.
The use of this constructor is mandatory. The default constructor (no arguments) is hidden. Also note that you cannot change the binding of a column to a datastore object after creation of the column.
|
inline |
returns a reference to the n -th row in this column (possibly throwing an exception if it does not exist!)
This method accesses the datastore and returns the double value stored in the n'th row of the according column.
|
inline |
returns a reference to the n -th row in this column (possibly throwing an exception if it does not exist!)
This method accesses the datastore and returns the double value stored in the n'th row of the according column.
|
inline |
returns an iterator to the internal data
|
inline |
returns an iterator to the internal data
|
inline |
calculates a checksum over the contents of the column (using qChecksum())
|
protected |
if the column's data is \u not stored in an internal vector item, this copies the data into a vector item This does copies all data.
| [out] | usedVectorItem | optionally returns the ID of the JKQTPDatastoreItem that was generated or is used! |
true if a conversion was performed, or false if the column already linked to a vector item. In the latter case the range [start1..end1] are ignored (i.e. a vector column is not modified!!!)!!! Especially this returns false if isVectorColumn()==true!!!
|
protected |
if the column's data is \u not stored in an internal vector item, this copies the data into a vector item This does not copy all data, but only the inclusive row range [start1..end1].
| start1 | start of first range. If start1>getRows() or end1<start1 the range [start1..end1] is ignored. If start1==end1==getRows() all data is copied. | |
| end1 | end of first range | |
| [out] | usedVectorItem | optionally returns the ID of the JKQTPDatastoreItem that was generated or is used! |
true if a conversion was performed, or false if the column already linked to a vector item. In the latter case the range [start1..end1] are ignored (i.e. a vector column is not modified!!!)!!! Especially this returns false if isVectorColumn()==true!!!
|
protected |
if the column's data is \u not stored in an internal vector item, this copies the data into a vector item This does not copy all data, but only the inclusive row ranges [start1..end1] and [start2..end2].
| start1 | start of first range. If start1>getRows() or end1<start1 the range [start1..end1] is ignored. | |
| end1 | end of first range | |
| start2 | start of second range. If start2>getRows() or end2<start2 the range [start2..end2] is ignored. | |
| end2 | end of second range | |
| [out] | usedVectorItem | optionally returns the ID of the JKQTPDatastoreItem that was generated or is used! |
true if a conversion was performed, or false if the column already linked to a vector item. In the latter case the ranges [start1..end1] and [start2..end2] are ignored (i.e. a vector column is not modified!!!)!!! Especially this returns false if isVectorColumn()==true!!!| void JKQTPColumn::copy | ( | const double * | data, |
| size_t | N, | ||
| size_t | offset = 0 ) |
copy data from the given array into the column
This copies N elements from data into the column where the first overwritten column line is offset, so you can shift the location where the copy process starts.
| QVector< double > JKQTPColumn::copyData | ( | ) |
returns a QVector with the contained data (as a copy)
| void JKQTPColumn::copyData | ( | QVector< double > & | copyTo | ) | const |
copies the contained data into a QVector
|
inline |
decrement the n'th value from the column
|
inline |
returns an iterator to the internal data
|
inline |
returns an iterator to the internal data
|
inlineprotected |
removes the entry row
|
inlineprotected |
removes the entries row to rowEnd (inclusive)
| void JKQTPColumn::exchange | ( | double | value, |
| double | replace ) |
exchange every occurence of a given value by a replace value
|
inlineprotected |
|
inlineprotected |
|
inline |
returns a pointer to the datastore item representing this column
|
inline |
returns a pointer to the datastore item representing this column
|
inline |
index of the item in the datastore that contains the data for this column
|
inline |
offset, if the datastore item contains more than one column
|
inline |
number of columns, if interpreted as a row-major image
| QString JKQTPColumn::getName | ( | ) | const |
a name describing the column
|
inline |
returns the element at (x,y) in the column, where the data is interpreted as a row-major ordered Matrix of the width imageWidth
This method accesses the datastore and returns the double value stored in the (y*imageColumns+x)'th row of the according column.
| double * JKQTPColumn::getPointer | ( | size_t | n = 0 | ) |
gets a pointer to the n-th value in the column
| const double * JKQTPColumn::getPointer | ( | size_t | n = 0 | ) | const |
gets a pointer to the n-th value in the column
| size_t JKQTPColumn::getRows | ( | ) | const |
returns the number of rows in this column (accesses the datastore)
|
inline |
reads the n'th value from the column
This method accesses the datastore and returns the double value stored in the n'th row of the according column.
|
inline |
reads the n'th value from the column
This method accesses the datastore and returns the double value stored in the n'th row of the according column.
|
inline |
increment the n'th value from the column
|
inline |
|
inline |
two columns are equal, if the same memory in the same datastore is referenced
|
inlineprotected |
lets the column point to another datastore item with id datastoreItem_ (of type JKQTPDatastoreItem) in the owning JKQTPDataStore. The column points to the datastoreOffset_ -th column within that JKQTPDatastoreItem .
| void JKQTPColumn::scale | ( | double | factor | ) |
scales all members of the column with the given factor
| void JKQTPColumn::setAll | ( | double | value | ) |
set all values in the column to a specific value
| void JKQTPColumn::setImageColumns | ( | size_t | imageWidth | ) |
number of columns, if interpreted as a row-major image
| void JKQTPColumn::setName | ( | const QString & | __value | ) |
a name describing the column
|
inline |
sets the element at (x,y) in the column, where the data is interpreted as a row-major ordered Matrix of the width imageWidth
This method accesses the datastore and returns the double value stored in the (y*imageColumns+x)'th row of the according column.
|
inline |
sets the element at (x,y) in the column, where the data is interpreted as a row-major ordered Matrix of the given width
This method accesses the datastore and returns the double value stored in the (y*width+x)'th row of the according column.
|
inline |
sets the n'th value from the column
This method accesses the datastore and sets the value stored in the n'th row of the according column.
| void JKQTPColumn::subtract | ( | double | value | ) |
subtracts a given value from all members of the column
|
friend |
|
friend |
|
friend |
|
private |
pointer to the datastore object used to manage the data of the plot
|
private |
index of the item in the datastore that contains the data for this column
|
private |
offset, if the datastore item contains more than one column
|
private |
number of columns, if interpreted as a row-major image
|
private |
a name describing the column
|
private |
is this item valid?/usable?