GemaCoreLib
The GeMA Core library
Loading...
Searching...
No Matches
GmAcResultsDataSrcBase Class Referenceabstract

A class storing basic information about a result data to be exported (monitored / saved), that is common to node, cell and Gauss data sources. More...

#include <gmAcResultsDataSrc.h>

Inheritance diagram for GmAcResultsDataSrcBase:
Collaboration diagram for GmAcResultsDataSrcBase:

Public Member Functions

 GmAcResultsDataSrcBase ()
 Default constructor.
 
virtual ~GmAcResultsDataSrcBase ()
 Destructor.
 
virtual int monitorTrackId () const
 Returns a numeric id for this data src (a value between 0 and the number of monitored data sources in the model, or -1 if this data src is not monitored)
 
virtual void setMonitorTrackId (int id)
 Updates the data src's monitor track id.
 
virtual QString id () const =0
 
virtual QString alias () const
 Returns the data src "exported" id.
 
virtual QString formatStr () const
 How should dataSrc values be formatted?
 
virtual bool isScalar () const =0
 Returns true if the accessor value is a scalar value or there is a dimensional filter.
 
virtual int dimSize () const =0
 Returns the accessor valueSize() adjusted by an optional dimension filter.
 
int history () const
 Returns the state accessed by this data src.
 
int dimFilter () const
 Returns the dimension filter value (-1 if there is no filter)
 
GmInterpolatorinterp () const
 Returns the associated interpolator, if any.
 
bool hasTransformationFunction () const
 Returns true if this data src is associated with a transfromation function.
 
GmInterpolatorSubset subsetType () const
 
void setBasicData (int dim, const QString &alias, int history, GmInterpolatorType interpType, const QVariant &interpParam, GmInterpolatorSubset subset)
 Sets the values of the given basic object attributes.
 
void setFormatStr (const QString &formatStr)
 Sets the format string.
 
void setTransformationFunction (LuaFunction &tfunc, int nresLin, int nresCol)
 Sets the transformation function along with its result dimensions.
 
void setInterpolator (GmInterpolator *interp)
 Sets the configured interpolator for this data source. Takes ownership of the object.
 
bool interpAcceptDiscSet () const
 
- Public Member Functions inherited from GmResultsDataSrcInfo
virtual ~GmResultsDataSrcInfo ()
 Virtual destructor.
 
virtual GmResultsDataSrcType type () const =0
 Returns the data src type.
 
virtual QString description () const =0
 Returns the data src description, when available.
 
virtual Unit unit () const =0
 Returns the unit in which the data is expressed.
 
virtual int size () const =0
 Returns the dimension of the data src values, taking into account any applied transformations or dim filters. Equal to nlin() * ncol(). A size of zero means that this data src returns string values (valid only for attribute type). A value of -1 means that this object has not been fully initialized yet.
 
virtual int nlin () const =0
 The number of lines in the returned result, taking into account any applied transformations or dim filters. A size of zero means that this data src returns string values (valid only for attribute type). A value of -1 means that this object has not been fully initialized yet.
 
virtual int ncol () const =0
 The number of columns in the returned result, taking into account any applied transformations or dim filters. A size of zero means that this data src returns string values (valid only for attribute type). A value of -1 means that this object has not been fully initialized yet.
 
QString formatedNumericDataSrcValue (const double *v, QString err) const
 Returns the numeric result value in v formated as a string, according to the current format. If v is NULL, will either return "NA" or "ERROR" if err is not empty.
 

Protected Member Functions

 Q_DISABLE_COPY (GmAcResultsDataSrcBase)
 
 GmAcResultsDataSrcBase (const GmAcResultsDataSrcBase *ptr)
 A kind of "copy" constructor geting a pointer instead of a reference that copies the contents of the given data src.
 

Protected Attributes

int _trackId
 The numeric id for this data src (a value between 0 and the number of monitored data srcs in the model, or -1 if unmonitored)
 
QString _alias
 The name given to the "exported" data. Always filled (might be equal to id())
 
int _dim
 A "bound" dimension for returning a scalar when the data is multidimensional (-1 for returning all values)
 
QString _formatStr
 The format string for the data. Usually equal to the accessor format.
 
int _history
 The state accessed by this data src (0 = current state, 1 = previous, etc..)
 
GmInterpolatorType _interpType
 How do we interpolate data?
 
QVariant _interpParam
 Optional interpolation parameters.
 
LuaFunction _tFunc
 An optional transformation function applied over the data (filtered by _dim) before exporting.
 
int _nResLin
 The number of lines of the result returned by _tFunc.
 
int _nResCol
 The number of columns of the result returned by _tFunc.
 
GmInterpolatorSubset _subset
 The subset of data to be considered when interpolating discontinuous elements.
 

Private Attributes

GmInterpolator_interp
 The configured interpolator object. Can be NULL. !!Should not be set directly, use setInterpolator() instead!!
 
bool _acceptDiscontinuitySet
 True if the _interp type accepts discontinuitySet aware interpolation.
 

Friends

class GmResultsDataSet
 

Additional Inherited Members

- Static Public Member Functions inherited from GmResultsDataSrcInfo
static QString formatedNumericDataSrcValue (QString fmt, const double *v, int size)
 Returns the numeric result value in v string formated.
 

Detailed Description

A class storing basic information about a result data to be exported (monitored / saved), that is common to node, cell and Gauss data sources.

Constructor & Destructor Documentation

◆ GmAcResultsDataSrcBase()

GmAcResultsDataSrcBase::GmAcResultsDataSrcBase ( const GmAcResultsDataSrcBase * ptr)
inlineprotected

A kind of "copy" constructor geting a pointer instead of a reference that copies the contents of the given data src.

IMPORTANT: Does NOT handle interpolators. Any given interpolator in ptr will be discarded from the new copy. Needed to enable the GmAcResultsDataSrc::dimSplit() and cloneSameAcNoInterp() implementations

Member Function Documentation

◆ alias()

virtual QString GmAcResultsDataSrcBase::alias ( ) const
inlinevirtual

Returns the data src "exported" id.

Implements GmResultsDataSrcInfo.

◆ dimSize()

virtual int GmAcResultsDataSrcBase::dimSize ( ) const
pure virtual

Returns the accessor valueSize() adjusted by an optional dimension filter.

Implemented in GmAcResultsDataSrc< T >, GmAcResultsDataSrc< GmCellAccessor >, GmAcResultsDataSrc< GmGaussAccessor >, and GmAcResultsDataSrc< GmValueAccessor >.

◆ formatStr()

virtual QString GmAcResultsDataSrcBase::formatStr ( ) const
inlinevirtual

How should dataSrc values be formatted?

Implements GmResultsDataSrcInfo.

◆ isScalar()

virtual bool GmAcResultsDataSrcBase::isScalar ( ) const
pure virtual

Returns true if the accessor value is a scalar value or there is a dimensional filter.

Implemented in GmAcResultsDataSrc< T >, GmAcResultsDataSrc< GmCellAccessor >, GmAcResultsDataSrc< GmGaussAccessor >, and GmAcResultsDataSrc< GmValueAccessor >.

◆ monitorTrackId()

virtual int GmAcResultsDataSrcBase::monitorTrackId ( ) const
inlinevirtual

Returns a numeric id for this data src (a value between 0 and the number of monitored data sources in the model, or -1 if this data src is not monitored)

Implements GmResultsDataSrcInfo.

◆ setMonitorTrackId()

virtual void GmAcResultsDataSrcBase::setMonitorTrackId ( int id)
inlinevirtual

Updates the data src's monitor track id.

Implements GmResultsDataSrcInfo.


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