Distance *make(QString str, QObject *parent)
Make a Distance from a string. This function converts the abbreviation character + into it's full-length alternative.
Abbreviation | Translation |
---|---|
+ | PipeDistance. Each Distance linked by a + is turned into a child of a single PipeDistance. "Distance1+Distance2" becomes "Pipe([Distance1,Distance2])". Templates are projected through the children of a pipe in series, the output of one become the input of the next. |
The expanded string is then passed to Factory::make to be turned into a distance.
-
function definition:
static Distance *make(QString str, QObject *parent)
-
parameters:
Parameter Type Description str QString String describing the distance parent QObject * Parent of the object to be created -
output: (Distance *) Returns a pointer to the Distance described by the string
- see: Factory::make
- example:
Distance::make("Distance1+Distance2+Distance3")->description(); // returns "Pipe(distances=[Distance1,Distance2,Distance3])".
QSharedPointer<Distance> fromAlgorithm(const QString &algorithm)
Create a Distance from an OpenBR algorithm string. The Distance is created using everything to the right of a : or a ! in the string.
-
function definition:
static QSharedPointer<Distance> fromAlgorithm(const QString &algorithm)
-
parameters:
Parameter Type Description algorithm const QString & Algorithm string to construct the Distance from -
output: (QSharedPointer<Distance>) Returns a pointer to the Distance described by the algorithm.
-
example:
Distance::fromAlgorithm("EnrollmentTransform:Distance")->decription(); // returns "Distance" Distance::fromAlgorithm("EnrollmentTransform!Distance1+Distance2")->decription(); // returns "Pipe(distances=[Distance1,Distance2])