|
FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
|
A Representation is a set of Field objects, each of them accessed via some FieldID identifier. More...
#include <Representation.hpp>
Public Types | |
| typedef FiberMap< RefPtr< FieldID > > | Base_t |
| using | const_iterator_t = std::function< bool(const FieldID &, const Field &)> |
| using | iterator_t = std::function< bool(const FieldID &, Field &)> |
| Note that an iterator_t can be implicitly cast into an const_iterator_t, thus functions taking an iterator_t must be named differently to avoid ambiguity. | |
| typedef FieldIterator | Iterator |
| using | iterate_all_t = std::function< bool(const FieldID &d, Field &F, const RefPtr< CreativeArrayBase > &CAB, const RefPtr< FragmentID > &fid)> |
Public Types inherited from Fiber::OwnerBase | |
| template<class ItemType > | |
| using | Item = MemCore::InterfaceData< ItemType > |
| An optional convenience class that allows to easily add arbitrary types to Intercubes . | |
Public Member Functions | |
| Representation (const Representation &)=delete | |
| Prevent accidental copy construction. | |
| void | operator= (const Representation &)=delete |
| Prevent accidental copy assignment. | |
| void | extremeUnction () override |
| RefPtr< FieldID > | makeFieldID (const string &name) |
| Create a new FieldID from a given textual description if it does not exist yet. | |
| RefPtr< FieldID > | findFieldID (const string &name) const |
| Get a field ID, returning Null when none exists yet. | |
| bool | removeField (const string &name) |
| bool | removeField (const RefPtr< FieldID > &FID) |
| RefPtr< FieldID > | renameField (const string &OldName, const string &NewName) |
| RefPtr< FieldID > | 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. | |
| RefPtr< FieldID > | createSharedFieldID (Representation &Carrier, const string &name) |
| Use field identifier which resides on the given Carrier Representation. | |
| RefPtr< Field > & | getField (const RefPtr< FieldID > &f) |
| Given a certain FieldID, retrieve the according field. | |
| const RefPtr< Field > & | findField (const RefPtr< FieldID > &f) const |
| Search and find a Field from its ID. | |
| const RefPtr< Field > & | findField (const FieldID &f) const |
| Search and find a Field from its ID. | |
| bool | checkIfFieldSizeIsIncompatible (const RefPtr< Field > &FieldPtr) |
| Check if a given Field is incompatible with the index space of this representations, i.e. | |
| FieldProxy | makeField (const WeakPtr< FieldID > &rf, const RefPtr< FragmentIDCollection > &ExistingFragmentIDCollection=NullPtr(), const RefPtr< MemBase > &theFragmentTopology=MemCore::NullPtr()) |
| Field & | makeField (const FieldID &f) |
| void | own (Field &) const |
| Set ownership information on the given Field. | |
| Field & | operator[] (const FieldID &f) |
| Return a Field for the given ID. | |
| FieldProxy | operator[] (const RefPtr< FieldID > &f) |
| Return reference to the internally stored Field pointer, which may be overwritten by the caller. | |
| FieldProxy | operator[] (const string &name) |
| Make a field reference from a string, field ID is created if not yet existent. | |
| const RefPtr< Field > & | findField (const string &name) const |
| Retrieve a field by its name; usually fields should be retrieved via their field identifier instead, using the () operator. | |
| const RefPtr< Field > & | findField (const char *name) const |
| template<class FieldNameContainer > | |
| const RefPtr< Field > & | findField (const FieldNameContainer &FieldNames) const |
| const RefPtr< Field > & | operator() (const string &name) const |
| Operator interface to the findField function. | |
| const RefPtr< Field > & | operator() (const char *name) const |
| const RefPtr< Field > & | operator() (const FieldID &fid) const |
| const RefPtr< Field > & | operator() (const RefPtr< FieldID > &f) const |
| Look for a field, given its field identifier. | |
| template<class FieldNameContainer > | |
| const RefPtr< Field > & | operator() (const FieldNameContainer &FieldNames) const |
| RefPtr< CreativeArrayBase > | operator() (const string &name, const RefPtr< FragmentID > &f) |
| Shortcut function: Checks if a field exist, and if so, retrieves the data that are associated with a certain field fragment ID. | |
| RefPtr< CreativeArrayBase > | operator() (const string &name, const string &FragmentName) |
| const RefPtr< Field > & | Positions () const |
| Get the positions component of this Representation object. | |
| const RefPtr< Field > & | getPositions () const |
| Get the positions component of this Representation object. | |
| RefPtr< SizeInterface > | getSize () const |
| The size of this representation, which is the sum of all fragments of the Positions field. | |
| RefPtr< SizeInterface > | getFragmentSize (const RefPtr< FragmentID > &Fid) const |
| Shortcut function: Get the size of field's fragment, if possible. | |
| bool | setField (const string &Fieldname, const RefPtr< Field > &P) |
| Add a field under the given name. | |
| bool | setPositions (const RefPtr< Field > &P) |
| Set the positional component of this Representation object. | |
| template<class Data , Dims_t Dims> | |
| bool | setPositions (const Data &D, const MultiIndex< Dims > &Size, const RefPtr< FragmentIDCollection > &theFragmentIDCollection=nullptr) |
| Convenience function to set unfragmented positions directly from some data set, e.g. | |
| template<class T , Dims_t N> | |
| bool | setPositions (const MemCore::WeakPtr< MemArray< N, T > > &MemRefPtr, const RefPtr< FragmentIDCollection > &theFragmentIDCollection=nullptr) |
| Convenience function to set unfragmented positions directly from some MemArray. | |
| bool | setPositions (const MemCore::RefPtr< MemBase > &MemRefPtr, const RefPtr< FragmentIDCollection > &theFragmentIDCollection=nullptr) |
| Convenience function to set unfragmented positions directly from some MemBase. | |
| bool | setPositions (const MemCore::RefPtr< CreativeArrayBase > &CrecRefPtr, const RefPtr< FragmentIDCollection > &theFragmentIDCollection=nullptr) |
| Convenience function to set unfragmented positions directly from some CreativeArrayBase. | |
| template<class Data , Dims_t Dims> | |
| bool | setField (const string &Fieldname, const Data &D, const MultiIndex< Dims > &Size, const RefPtr< FragmentIDCollection > &theFragmentIDCollection=nullptr) |
| Convenience function to set an unfragmented field direcly from some data that can be used for constucting a Field. | |
| template<class T , Dims_t N> | |
| bool | setField (const string &Fieldname, const MemCore::WeakPtr< MemArray< N, T > > &MemRefPtr, const RefPtr< FragmentIDCollection > &theFragmentIDCollection=nullptr) |
| Convenience function to set an unfragmented field direcly from a MemArray. | |
| bool | setField (const string &Fieldname, const MemCore::RefPtr< MemBase > &MemRefPtr, const RefPtr< FragmentIDCollection > &theFragmentIDCollection=nullptr) |
| Convenience function to set an unfragmented field direcly from a MemBase. | |
| bool | setField (const string &Fieldname, const MemCore::RefPtr< CreativeArrayBase > &CrecPtr, const RefPtr< FragmentIDCollection > &theFragmentIDCollection=nullptr) |
| Convenience function to set an unfragmented field direcly from a CreativeArrayBase. | |
| int | iterate (FieldIterator &FI) const |
| Iterate over all fields in this Representation. | |
| int | iterate_fields (const iterator_t &F) const |
| iterate over all fields contained in this Representation | |
| int | iterate_const_fields (const const_iterator_t &F) const |
| Functor iterator with constant field. | |
| int | iterate (const iterator_t &F) const |
| Functor iterator. | |
| int | iterate_m (const iterator_t &F) const |
| Functor iterator with non-constant, modifyable field. | |
| int | iterate_all (const iterate_all_t &f) const |
| int | iterate (const iterate_all_t &f) const |
| template<class Functor > | |
| int | Iterate_all (const Functor &F) const |
| Dims_t | Dims () const |
| Determine the dimensionality of the data that live here. | |
| DEPRECATED ("Use Dims() or getSize() instead", Dims_t rank() const) | |
| RefPtr< FragmentIDCollection > | getFragmentIDCollection () const override |
| memsize_t | getMemoryUsage (memsize_t &UsedMemory, memsize_t &WantedMemory) const |
| Get memory usage. | |
| void | Speak (int indent=0, int maxindent=-1) const |
| Informative debug message. | |
| string | xml () const |
| Analyse this representation's content in XML format. | |
| void | createLinkedFields (const Representation &linked_from) |
| Creates links to the fields of a different representation in the current representation. | |
Public Member Functions inherited from Fiber::FiberMap< RefPtr< FieldID > > | |
| RefPtr< FragmentIDCollection > | getFragmentIDCollection () const |
| Return the associated fragment ID collection of the first field that has one. | |
| FiberMap () | |
| Default constructor. | |
| size_t | getNumberOfFields () const |
| Get the number of fields contained here. | |
| Field & | operator[] (const RefPtr< FieldID > &id) |
| Access field by name, create one, in case. | |
| void | mkFieldID (const RefPtr< FieldID > &id) |
| void | insertField (const RefPtr< FieldID > &id, const RefPtr< Field > &F) |
| const RefPtr< Field > & | find (const RefPtr< FieldID > &id) const |
| Find an entry. | |
| RefPtr< CreativeArrayBase > | find (const RefPtr< FieldID > &id, const RefPtr< FragmentID > &f) const |
| RefPtr< CreativeArrayBase > | find (const RefPtr< FieldID > &id, const string &FragmentName) const |
| const RefPtr< Field > & | operator() (const RefPtr< FieldID > &id) const |
| Find an entry, operator interface to the find() member function for convenience. | |
| void | iterate (const std::function< bool(const RefPtr< FieldID > &, const RefPtr< Field > &)> &F) const |
| bool | remove (const RefPtr< FieldID > &id) |
| Remove an Field. | |
| void | getMinMaxAge (Ageable &Youngest, Ageable &Oldest) const |
| Get the youngest/oldest age of all fields contained here, including the fiber space itself taking into account when fields have last been inserted or removed here. | |
| RefPtr< Field > | findMostFragmentedField () const |
| Find the Field with the most fragments. | |
| int | getMemoryUsage (memsize_t &UsedMemory, memsize_t &WantedMemory) const |
| Memory usage. | |
| int | providesFieldType (const Fiber::TypeList_t &AcceptedFields) const |
| Check how many fields exist here that conform to the given type. | |
| string | xml () const |
| void | clear_fields () |
| const RefPtr< Field > & | getFirstField () const |
Public Member Functions inherited from Fiber::BaseSpaceDependency | |
| BaseSpaceDependency () | |
| Constructor. | |
| virtual | ~BaseSpaceDependency () |
| Destructor. | |
Public Member Functions inherited from Fiber::Ownable< BaseSpaceDependency > | |
| void | x_updateOwnershipAge (const MemCore::Ageable &theNewAge) override |
| Forward some age to all Owners. | |
| void | insertOwner (const Container &theOwner) |
| Add some owner. | |
| bool | insertOwner (const MemCore::WeakPtr< Container > &theOwner) |
| Add some owner. | |
| void | addOwner (const Container &theOwner, const MemCore::Ageable &theNewAge) |
| Add some owner and broadcast a new age to all Ownerrs. | |
| void | addOwner (const MemCore::WeakPtr< Container > &theOwner, const MemCore::Ageable &theNewAge) |
| Add some owner and broadcast a new age to all Ownerrs. | |
| Ownable () | |
| Default constructor, empty Ownership list. | |
| Ownable (const Ownable &) | |
| Copy constructor, does NOT copy any ownership information, the new Ownable will be unowned. | |
| Ownable (const MemCore::WeakPtr< Container > &theOwner, const MemCore::Ageable &theNewAge) | |
| Construct an Ownable with an initial owner. | |
| Ownable (const Container &theOwner, const MemCore::Ageable &theNewAge) | |
| Construct an Ownable with an initial owner. | |
| Ownable & | operator= (const Ownable &) |
| Assignment, does NOT copy any ownership information, the assigned Ownable will retain all its ownership information. | |
| MemCore::WeakPtr< Container > | getPrimaryOwner () const |
| Get the first valid owner. | |
| size_t | getNumberOfValidOwners () const |
| Get the first valid owner. | |
| bool | processOwnership (MemCore::Intercube &Output, const MemCore::Intercube &Input) const override |
| Process some ownership action. | |
Public Member Functions inherited from Fiber::OwnerBase | |
| bool | processOwnership (MemCore::Intercube &OutputAndInput) const |
| Process ownership where the input information is shared with the output information in the same Intercube. | |
Public Member Functions inherited from MemCore::Ageable | |
| constexpr | Ageable (age_t t) noexcept |
| constexpr | Ageable (const Ageable &A) noexcept |
| Ageable (const volatile Ageable &A) noexcept | |
| constexpr const Ageable & | getAge () const |
| bool | isNewerThan (const Ageable &a) const noexcept |
| bool | isOlderThan (const Ageable &a) const noexcept |
| bool | isYoungerThan (const Ageable &a) const noexcept |
| bool | operator!= (const Ageable &a) const noexcept |
| bool | operator< (const Ageable &a) const noexcept |
| bool | operator<= (const Ageable &a) const noexcept |
| bool | operator<= (const volatile Ageable &a) const volatile noexcept |
| bool | operator== (const Ageable &a) const noexcept |
| bool | operator> (const Ageable &a) const noexcept |
| bool | operator> (const volatile Ageable &a) const volatile |
| bool | operator>= (const Ageable &a) const noexcept |
| bool | operator>= (const volatile Ageable &a) const volatile noexcept |
| constexpr void | resetAge () noexcept |
| void | setInfinitelyNew () noexcept |
| age_t | time_value () const noexcept |
| age_t | time_value () const volatile noexcept |
| Ageable & | touch () noexcept |
| age_t | update (age_t age) noexcept |
| age_t | update (const Ageable &Other) noexcept |
| age_t | update (const volatile Ageable &Other) volatile noexcept |
Public Member Functions inherited from MemCore::Intercube | |
| void | addInterface (const RefPtr< InterfaceBase > &I) const |
| void | addInterfaceData (const Data &D) |
| void | addInterfaceData (const Data &D) |
| void | clearInterfaces () |
| bool | const_iterateInterfaces (const RefPtr< InterfaceIterationParameter > &IIP) const |
| virtual RefPtr< InterfaceBase > | createInterface (const type_info &) const |
| RefPtr< InterfaceBase > | findInterface (const type_info &t) const |
| RefPtr< InterfaceBase > | getInterface (const type_info &t) |
| std::string | getInterfaceNames (const char delim=';') const |
| bool | gotNewInterfaceData (const Data &D) |
| bool | gotNewInterfaceData (mutex &M, const Data &D) |
| bool | gotNewInterfaceData (mutex &M, const Data &D) |
| bool | gotNewInterfaceData (mutex &M, const Data &D, const Selector &S) |
| bool | gotNewInterfaceData (mutex &M, const Data &D, const Selector *S) |
| bool | hasChangedInterfaceData (const Data &D) const |
| bool | hasChangedInterfaceData (const Data &D) const |
| bool | hasChangedInterfaceData (const Data &D, const Selector &) const |
| bool | hasChangedInterfaceData (const Data &D, const Selector *) const |
| bool | hasInterface (const type_info &t) const |
| bool | iterateInterfaces (const RefPtr< InterfaceIterationParameter > &IIP) |
| void | printInterfaces () const |
| void | registerInterface (const type_info &t) |
| void | removeInterface () |
| void | removeInterfaceBase (const type_info &InterfaceBaseID) |
Public Attributes | |
| unsigned long | RenameOperations = 0 |
| unsigned long | RemovalOperations = 0 |
Public Attributes inherited from Fiber::Ownable< BaseSpaceDependency > | |
| std::unordered_set< MemCore::WeakPtr< Container > > | Owners |
| The (internal) list of owners. | |
Static Public Attributes | |
| static constexpr unsigned long | MaxOperations = -22U |
Friends | |
| struct | FieldProxy |
Additional Inherited Members | |
Static Public Member Functions inherited from MemCore::Ageable | |
| static const Ageable & | InfinitelyNew () noexcept |
| static constexpr const Ageable & | InfinitelyOld () noexcept |
| static age_t | now () noexcept |
Protected Member Functions inherited from Fiber::FiberMap< RefPtr< FieldID > > | |
| RefPtr< Field > & | create_entry (const RefPtr< FieldID > &id) |
| Get a modifyable field entry. | |
| Fields_t | copy_Fields_map () const |
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.
Use Representation::iterate(FieldIterator&) to find all fields.
The Representation is an Intercube and can carry arbitrary interfaces. There is no specific reason why the FiberMap should not be an Intercube either.
Check if a given Field is incompatible with the index space of this representations, i.e.
whether the dimensions match. If for various reasons this cannot be determined, the function will return false, indicating that the field may be compatible, we just don't know yet.
References getPositions().
| void Fiber::Representation::createLinkedFields | ( | const Representation & | linked_from | ) |
Creates links to the fields of a different representation in the current representation.
The current representation will contain then all the data fields of the 'linked from' representation.
References apply().
| RefPtr< FieldID > Fiber::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 findFieldID().
Referenced by Fiber::PartialDerivative().
| Dims_t Fiber::Representation::Dims | ( | ) | const |
Determine the dimensionality of the data that live here.
References getPositions().
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 createSharedFieldID(), insertSharedFieldID(), and makeFieldID().
|
overridevirtual |
Implements Fiber::FragmentIDCollectionProvider.
| RefPtr< SizeInterface > Fiber::Representation::getSize | ( | ) | const |
The size of this representation, which is the sum of all fragments of the Positions field.
References getPositions().
| RefPtr< FieldID > Fiber::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().
| int Fiber::Representation::iterate | ( | FieldIterator & | FI | ) | const |
Iterate over all fields in this Representation.
References Fiber::FieldIterator::apply().
Referenced by Fiber::ExecuteExpression(), and Fiber::operator<<=().
Iterate over all fields and all fragments contained in this Representation.
Referenced by Fiber::RepresentationMap::iterate_all().
Create a new FieldID from a given textual description if it does not exist yet.
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 setField().
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.
|
inline |
Convenience function to set unfragmented positions directly from some data set, e.g.
from a MemVector<Eagle::point3> .
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:
References setField().