![]() |
GemaCoreLib
The GeMA Core library
|
The index data for a result rule, storing "evaluation point" data for node, cell or gauss based indices. Thanks to the implicitly shared nature of a QVector, the result data can be transfered to and from a message object without copying. More...
#include <gmResultTrackedData.h>
Public Types | |
enum | IndexType { NODE_INDEX, CELL_INDEX, GAUSS_INDEX } |
Defines over which kind of data this index refers to. More... | |
enum | IndexDataType { NODE_DATA, GHOST_DATA, CELL_CENTROID_DATA, CELL_IP_DATA, CELL_POINT_DATA, POINT_DATA, NUM_DATA_TYPES } |
Defines the type of an index line. More... | |
Public Member Functions | |
GmResultTrackedIndexData () | |
Default constructor (needed by QVector) | |
GmResultTrackedIndexData (IndexType type, int coordDim) | |
Constructor. Line data should be filled by calls to addData. | |
void | addLine (IndexDataType type, int index) |
Adds a data line for types requiring only a node or cell index. | |
void | addLine (IndexDataType type, int index, int ip) |
Adds a data line for types requiring a cell index + ip index. | |
void | addLine (IndexDataType type, int index, const GmVector &coord) |
Adds a data line for types requiring a coordinate (for point only data, index can be set to 0) | |
int | coordDim () const |
Returns the coordinate dimension. | |
int | numLines () const |
Returns the number of lines in the index. | |
IndexDataType | lineType (int line) const |
Returns the type of the given index line. | |
int | lineIndex (int line) const |
Returns the node/cell index of the given index line. | |
int | lineIp (int line) const |
Returns the ip index of the given index line. | |
const double * | lineCoord (int line) const |
Returns the coordinates of the given index line. | |
QString | lineStr (int line) const |
Returns a string representation of the line data (with 1 based indices) | |
Public Attributes | |
IndexType | _indexType |
The index type;. | |
int | _coordDim |
The dimension coordinate (defining the size of a coordinate data) | |
QVector< int > | _index |
A vector with entries for each result set line, with its type in the 3 most significant bits + the node or cell index. | |
QVector< short > | _ip |
A vector with size equal to the number of lines of type CELL_IP_DATA. | |
QVector< double > | _coordinates |
A vector with size equal to the number of lines of type CELL_POINT_DATA or POINT_DATA multiplied by the coord dimension. | |
int | _firstIpLine |
The line index of the first line of type CELL_IP_DATA (-1 if no such line exists) | |
int | _firstCoordLine |
The line index of the first line of type CELL_POINT_DATA or POINT_DATA (-1 if no such line exists) | |
Private Member Functions | |
int | encode (IndexDataType type, int index) const |
Encodes the type info in the high bits of an integre with the index on the lower ones. | |
IndexDataType | decodeType (int v) const |
Decodes the type info from a combined type+index value. | |
int | decodeIndex (int v) const |
Decodes the index info from a combined type+index value. | |
The index data for a result rule, storing "evaluation point" data for node, cell or gauss based indices. Thanks to the implicitly shared nature of a QVector, the result data can be transfered to and from a message object without copying.
This class assumes that when the index mixes lines with differet types, they are clustered, obeying a node, cell, point order.
Defines the type of an index line.