FiberVISH  0.2
Fish-TheFiberBundleAPIfortheVishVisualizationShell
Public Member Functions | Protected Member Functions | Friends | Related Functions | List of all members
Fiber::Skeleton Class Reference

A Skeleton is a set of Representation object, each of them accessed by an Representer object. More...

#include <Skeleton.hpp>

Inheritance diagram for Fiber::Skeleton:
Fiber::BaseSpace Fiber::RepresentationMap Fiber::SkeletonID Fiber::SaveableAttributes Fiber::Ownable< BaseSpace > MemCore::Intercube MemCore::Attributes Fiber::OwnerBase

Public Member Functions

void clear ()
 
void extremeUnction () override
 
Representationoperator[] (const Representer &D)
 
RefPtr< RepresentationmakeRepresentation (const Representer &D)
 
Representationoperator[] (const BaseSpace &D)
 
RefPtr< RepresentationUniqueRepresentation () const
 Return a default Representation for this Skeleton. More...
 
RefPtr< RepresentationFirstRepresentation () const
 Return the first representation found, which has not much usage beside retrieving general information common to all Representation, so it is not of relevance which one to use here. More...
 
int Dims () const override
 Dimensionality of this base space.
 
int DataRank () const
 
RefPtr< SizeInterfacegetSize () const
 Get the data dimensionality of this Skeleton, which is taken from the positions field of the first representation, whatever it is.
 
RefPtr< SizeInterfacegetFragmentSize (const RefPtr< FragmentID > &Fid) const
 
RefPtr< FieldcreateIndirectedField (const Representer &WantRep, const RefPtr< Field > &RelativeIndices, const string &FieldName, const RefPtr< Field > &SourceField)
 
RefPtr< FieldgetField (const Representer &R, const RefPtr< FieldID > &Fid)
 Get a field relative to the specified representer. More...
 
RefPtr< FieldgetField (const Representer &R, const std::string &FieldName)
 Get a field relative to the specified representer. More...
 
std::string xml () const override
 
std::string Name () const override
 
- Public Member Functions inherited from Fiber::BaseSpace
void addDependency (const MemCore::WeakPtr< BaseSpaceDependency > &)
 Add an object that will be dependent on the existence of this base space. More...
 
 BaseSpace ()
 Constructor.
 
virtual ~BaseSpace ()
 Virtual destructor.
 
- Public Member Functions inherited from Fiber::Ownable< BaseSpace >
void 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.
 
Ownableoperator= (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::RepresentationMap
RefPtrRepresentation_t makeRepresentation (const Representer &D)
 
Representationoperator[] (const Representer &D)
 Retrieve (and possibly create) a Representation.
 
Representationoperator[] (const BaseSpace &D)
 
RefPtrRepresentation_t findRepresentation (const Representer &D) const
 Query a representation.
 
RefPtrRepresentation_t findRepresentation (const BaseSpace &D)
 
RefPtrRepresentation_t operator() (const Representer &D) const
 Use operator () to query a representation.
 
RefPtrRepresentation_t operator() (const BaseSpace &D)
 
int size () const
 Return the number of representations available here.
 
RefPtr< FragmentIDCollectiongetFragmentIDCollection () const
 Get the FragmentIDCollection that is responsible for all fields of this Representation. More...
 
std::tuple< Representer,
RefPtrRepresentation_t, RefPtr
< FragmentIDCollection > > 
getFragmentIDCollectionRepresentation () const
 
RefPtr< FragmentIDfindFragmentIDByName (const std::string &FragmentName) const
 
DynamicSize getFragmentLayout () const
 
int iterate (ConstIterator &) const
 Inspect all elements of this map.
 
int iterate (Iterator &)
 Iterate over all elements of this map.
 
int iterate (const std::function< bool(const Representer &, const Representation &)> &F) const
 Immutable iteration via std::function.
 
int iterate (const std::function< bool(const Representer &, Representation &)> &F)
 Mutable iteration via std::function.
 
template<class Functor >
int iterate_representations (const Functor &F) const
 Iterate over all representations using a functor or lambda function: More...
 
template<class Functor >
int iterate_all (const Functor &F) const
 Iterate over everything contained here. More...
 
int 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
 
- Public Member Functions inherited from Fiber::SkeletonID
 SkeletonID (int dimension, int index_depth=0)
 Constructor via dimensionality and index depth.
 
 SkeletonID (const std::nullptr_t &)
 
 SkeletonID (const DynamicSize &theDomainSize, int IndexDepth, const DynamicSize &theRefinementSize)
 
 SkeletonID (const SkeletonID &Sid, int index_depth_increment)
 Construct a skeleton ID with the same properties but its index depth incremented by a certain amount.
 
 ~SkeletonID ()
 Destructor.
 
const SkeletonIDID () const
 Shortcut to ease type conversion in child classes.
 
bool operator< (const SkeletonID &S) const
 Ordering operator, mostly used for stl::map.
 
int IndexDepth () const
 Index depth of this skeleton.
 
const DynamicSizeDomainSize () const
 
const DynamicSizeSize () const
 
const DynamicSizeRefinementSize () const
 
const DynamicSizegetRefinementSize () const
 
template<class T >
DynamicSizesetSize (int N, const T values[])
 
template<class T >
DynamicSizesetRefinementSize (int N, const T values[])
 
template<int N>
DynamicSizesetSize (const MultiIndex< N > &I)
 
template<int N>
DynamicSizesetRefinementSize (const MultiIndex< N > &I)
 
int Dims () const
 Dimensionality of this skeleton.
 
int getRank () const
 Dimensionality of this skeleton.
 
bool hasCompatibleHigherDims (const DynamicSize &DS) const
 
int NumberOfRefinementLevels () const
 Number of available refinement levels This usually matches Dims, but in case of Dims=0 also allows a refinement level.
 
index_t Refinement (unsigned int i) const
 
bool isIsotropicRefinementFactor (index_t F) const
 Check if the given skeleton ID corresponds to a refinement by factor F in all dimensions.
 
index_t getHomogeneousLevel () const
 IF this skeleton ID refers to a refinement level that is same in all dimensions, return that single integer. More...
 
index_t getTotalRefinement () const
 
unsigned getDomainSize (unsigned i) const
 
bool setSize (unsigned i, index_t extension)
 
template<int N>
bool setSize (MultiIndex< N > &MI) const
 
bool setSize (const DynamicSize &DS) const
 
const DynamicSizesetRefinementSize (const DynamicSize &DS)
 
bool setRefinement (unsigned i, index_t extension)
 
void setIsotropicRefinement (index_t ref_level)
 Set the same refinement level in all dimensions of the skeleton dimensionality. More...
 
bool hasRefinement ()
 
std::string Name () const
 Create a textual representation of the inherent parameters of the Skeleton ID.
 
bool operator! () const
 check for mere validity of this SkeletonID
 
 operator bool () const
 check for validity of this SkeletonID
 
- Public Member Functions inherited from Fiber::SaveableAttributes
void attributesHaveBeenSaved () const
 
bool attributesNeedSaving () const
 
- Public Member Functions inherited from MemCore::Attributes
MemCore::RefPtr
< MemCore::ChunkBase
getAttribute (const std::string &name) const
 
attributes_t & getAttributeValues ()
 
const attributes_t & getAttributeValues () const
 
size_t getNumberOfAttributes () const
 
bool hasAttribute (const std::string &name) const
 
int iterate (Iterator &it) const
 
int Iterate (const Functor &L) const
 
int iterate_attributes (const Functor &L) const
 
size_t NumberOfAttributes () const
 
void setAttribute (const std::string &name, const MemCore::RefPtr< MemCore::ChunkBase > &AttribData)
 
ResizableChunk< T > & setAttributeValue (const std::string &name, const T &AttribData)
 
ResizableChunk< T > & setAttributeValues (const std::string &name, const std::initializer_list< T > &AttribData)
 
string toString () const
 
const AgeabletouchAttributes () const
 
const AgeableupdateAttributeAge (const Ageable &A) const
 

Protected Member Functions

 ~Skeleton ()
 Destructor.
 

Friends

class SkeletonMap
 
std::string to_string (const Skeleton &)
 

Related Functions

(Note that these are not member functions.)

typedef RefPtr< SkeletonpSkeleton
 Shortcut for a strong pointer to a Skeleton object. More...
 
typedef WeakPtr< SkeletonwSkeleton
 Shortcut for a weak pointer to a Skeleton object. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Fiber::SkeletonID
static SkeletonID nextRefinement (const SkeletonID &Sid, int refinement_increment)
 Create a SkeletonID that is refined by a certain increment.
 
static SkeletonID refinedSkeleton (const SkeletonID &Sid, int refinement_value)
 Create a SkeletonID that is refined by a certain value.
 
- Public Attributes inherited from Fiber::Ownable< BaseSpace >
std::unordered_set
< MemCore::WeakPtr< Container > > 
Owners
 The (internal) list of owners. More...
 
- Public Attributes inherited from Fiber::SaveableAttributes
MemCore::Ageable LastSavedAttributes
 
- Protected Types inherited from Fiber::RepresentationMap
typedef map< Representer,
RefPtrRepresentation_t > 
Representations_t
 
- Protected Attributes inherited from Fiber::RepresentationMap
Representations_t Representations
 

Detailed Description

A Skeleton is a set of Representation object, each of them accessed by an Representer object.

It defines the Skeleton Space of a discretized Grid. Allows to store sets as mappings from Domain objects to corresponding Representations of the underlying discretized space.

Note, that Skeleton inherits all operators and functions to create and access Representations from the RepresentationMap!

// e.g.: create cartesian vertex representation:
// note that there are convenience function for that in Grid
Grid &G = ...;
SkeletonID vertices_id(0,1);
Skeleton& vertices = G[ vertices_id ];
RefPtr< Chart > cartesian = grid->makeCartesianChart();
Representation& vertices_as_cartesian = vertices[ *cartesian ];
// e.g.: create a relative vertex selection representation using a skeleton instead of a chart:
SkeletonID vertex_selection_id(0,3);
Skeleton& vertex_selection = (*grid)[ vertex_selection_id ];
RefPtr< Skeleton > vertices = grid->findVertices();
// relative
Representation& vertex_selection_as_vertices = vertex_selection[ vertices ];
Examples:
Sphere.cpp, trimesh.cpp, XF_LineSetFragmented.cpp, XF_LineSetHierarchical.cpp, and XF_LineSetHierarchicalRegularized.cpp.

Member Function Documentation

RefPtr< Representation > Fiber::Skeleton::FirstRepresentation ( ) const

Return the first representation found, which has not much usage beside retrieving general information common to all Representation, so it is not of relevance which one to use here.

The ordering of Representations is undefined, thus this Representation is undefined as well.

Referenced by getSize().

RefPtr< Field > Fiber::Skeleton::getField ( const Representer R,
const RefPtr< FieldID > &  Fid 
)

Get a field relative to the specified representer.

This function might involve some coordinate transformation or re-indexing if the queried field does not yet exist relative to the given representer.

Parameters
RThe identifier of the representation in which the field is requested. For instance, this may be a chart object (a coordinate system).
FidA field identifier, it must match exactly.

References Fiber::Representation::findField(), and Fiber::RepresentationMap::findRepresentation().

RefPtr<Field> Fiber::Skeleton::getField ( const Representer R,
const std::string &  FieldName 
)

Get a field relative to the specified representer.

This function might involve some coordinate transformation or re-indexing if the queried field does not yet exist relative to the given representer.

Parameters
RThe identifier of the representation in which the field is requested. For instance, this may be a chart object (a coordinate system). Given a ChartID, a Chart object, suitable as Representer, can be retrieved from a Grid object.
FidA field identifier, it is sufficient if the name matches.
RefPtr< Representation > Fiber::Skeleton::UniqueRepresentation ( ) const

Return a default Representation for this Skeleton.

Currently, such a default Representation is only defined if there is exactly one Representation on this Skeleton. A future version might employ the last Representation used. In any case, at least one Representation must exist yet, as the DefaultRepresention cannot decide what domain to represent initially.

Friends And Related Function Documentation

typedef RefPtr<Skeleton> pSkeleton
related

Shortcut for a strong pointer to a Skeleton object.

typedef WeakPtr<Skeleton> wSkeleton
related

Shortcut for a weak pointer to a Skeleton object.