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 | |
void | erase (size_t row) |
removes the entry row | |
void | erase (size_t row, size_t rowEnd) |
removes the entries row to rowEnd | |
JKQTPDatastore * | getDatastore () |
const JKQTPDatastore * | getDatastore () const |
void | replaceMemory (size_t datastoreItem_=0, size_t datastoreOffset_=0) |
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())
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
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 |
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?