Gaia
|
The Applier abstract base class. More...
#include <applier.h>
Public Member Functions | |
Applier (const Transformation &transfo) | |
void | checkLayout (const PointLayout &layout) const |
Check that the given layout is the same as the one that was used during the analysis part of this transformation. More... | |
void | checkLayout (const DataSet *dataset) const |
Check that the given dataset has the same layout as the one that was used during the analysis part of this transformation. More... | |
virtual Point * | mapPoint (const Point *p) const =0 |
Ownership of resulting point is handed to caller of this function. | |
virtual DataSet * | mapDataSet (const DataSet *dataset) const |
Provides a default function that maps a whole dataset but which can be overriden in derived classes to provide a more efficient implementation. | |
Protected Member Functions | |
void | transferHistory (const DataSet *original, DataSet *destination) const |
This method tranfers the transformation history from the original dataset to the one being created, and adds itself at the end of the history. | |
void | addPointsNoLayoutCheck (DataSet *dataset, const QVector< Point * > &points) const |
Adds the given points to a DataSet without checking for the layout to be correct. More... | |
Protected Attributes | |
Transformation | _transfo |
The Applier abstract base class.
Derived classes will have to implement a constructor taking all its arguments as a string, and a mapPoint method. They will also have to set _originalDimension and _targetDimension in the constructor, as well as the other specific params they need for themselves. A helper function checkSize should be called at the very beginning of the mapPoint method to ensure consistency in error reporting. Do not forget as well to call the transferHistory() helper method at the end of your mapDataSet() function, or you might end up with invalid datasets (NB: it needs to be at the end, not at the beginning).
|
protected |
Adds the given points to a DataSet without checking for the layout to be correct.
The guarantee that it is correct is provided by the Applier algorithm.
References gaia2::DataSet::addPoints().
void gaia2::Applier::checkLayout | ( | const PointLayout & | layout | ) | const |
Check that the given layout is the same as the one that was used during the analysis part of this transformation.
GaiaException | if the layout was different than the current one. |
References gaia2::PointLayout::symmetricDifferenceWith().
Referenced by checkLayout(), and gaia2::DotProduct::mapPoint().
void gaia2::Applier::checkLayout | ( | const DataSet * | dataset | ) | const |
Check that the given dataset has the same layout as the one that was used during the analysis part of this transformation.
Also check that the dataset is consistent.
GaiaException | if the layout was different than the current one. |
References gaia2::DataSet::checkAllPointsShareSameLayout(), checkLayout(), and gaia2::DataSet::layout().