A Representation is a set of Field objects, each of them accessed via some FieldID identifier. More...
#include <Representation.hpp>
A Representation is a set of Field objects, each of them accessed via some FieldID identifier.
The class describes the representation of a Skeleton in a coordinate system or relative to another Skeleton. Examples are the coordinate system representation (positions, fields) of a Grid object's geometrical representation, or the representation of the triangles of a triangular surface by its vertices or edges.
RefPtr< FieldID > Representation::createFieldID | ( | const string & | name | ) |
Create a new FieldID from a given textual description.
Operating on FieldID's instead of just strings is beneficial to store additional information on fields, such as dependency relationships (e.g. one field is derived from another field).
name | The field name. |
Empty strings are not supported, field names must be of at least one character length.
References findFieldID().
Referenced by createSharedFieldID(), and setPositions().
RefPtr< FieldID > Representation::createSharedFieldID | ( | Representation & | Carrier, | |
const string & | name | |||
) |
Use field identifier which resides on the given Carrier Representation.
If none exists there yet, create one. If a field identifier already existed for the current Representation, then this one is used, and the Carrier is not touched at all.
Carrier | The Representation which hosts the field identifier, and field identifiers are shared with this one. | |
name | The string that makes up a field identifier. |
References createFieldID(), and findFieldID().
RefPtr< FieldID > Representation::findFieldID | ( | const string & | name | ) | const |
Get a field ID, returning Null when none exists yet.
The get function creates an entry in any case. Ensure the string is valid. Use the operator() to query if a certain field ID exists for a string.
Referenced by createFieldID(), createSharedFieldID(), and insertSharedFieldID().
RefPtr<SizeInterface> Representation::getSize | ( | ) | const [inline] |
The size of this representation, which is the sum of all fragments of the Positions field.
RefPtr< FieldID > Representation::insertSharedFieldID | ( | const Representation & | R, | |
const string & | name | |||
) |
Retrieve an existing field ID if existent, otherwise insert a field ID that is shared with another Representation.
If that Representation doesn't contain an according field ID for the given name, no FieldID is created here either.
References findFieldID().
RefPtr<Field> Representation::operator() | ( | const string & | name | ) | const [inline] |
Operator interface to the findField function.
Return a field from a textual description, if a field identifier with a compatible name exists on this Representation.
name | The name component of a field identifier. |
Return a Field for the given ID.
If a new field shall be created for the given ID, then use the alternative [] operator function that takes a RefPtr<FieldID> as argument.
int Representation::rank | ( | ) | const |
Determine the dimensionality of the manifold that is represented here.
Set the positional component of this Representation object.
An eventually existing component is overwritten. Semantically, this function is equivalent with creating a field named FIBER_POSITIONS:
Representation R; R[ *R[FIBER_POSITIONS] ]
References createFieldID().