Public Types | Public Member Functions

Representation Class Reference
[The Grid Entity]

A Representation is a set of Field objects, each of them accessed via some FieldID identifier. More...

#include <Representation.hpp>

List of all members.

Public Types

Public Member Functions


Detailed Description

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.

Examples:

Sphere.cpp, trimesh.cpp, and uniform_scalar.cpp.


Member Function Documentation

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).

Parameters:
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.

Parameters:
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.

Returns:
A NullPtr() will be returned if the size cannot be determined, e.g. due to inconsistent rank of fragments, or no fragments existing here at all.
Todo:
Consider the case of unfragmented Positions with fragmented fields.
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.

See also:
FieldID, operator[](const string&name)
Parameters:
name The name component of a field identifier.
Field& Representation::operator[] ( const FieldID f  )  [inline]

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.

Returns:
If no fields are defined on this representation, a negative value is returned, i.e. the dimensionality is yet unspecified.
RefPtr< Field > & Representation::setPositions ( const RefPtr< Field > &  P  ) 

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] ]
See also:
RefPtr<Field>&operator[](const RefPtr<FieldID>&f), FieldID&operator[](const string&name)
Examples:
trimesh.cpp.

References createFieldID().