FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | List of all members
Fiber::SkeletonMap Class Reference

A Skeleton Map is a unique map from SkeletonID's to Skeletons. More...

#include <SkeletonMap.hpp>

Inheritance diagram for Fiber::SkeletonMap:
Fiber::Grid

Public Types

typedef std::list< RefPtr< Skeleton > > Skeletons_t
 
typedef SkeletonIterator Iterator
 Associated Iterator class.
 

Public Member Functions

RefPtr< SkeletonfindVertices (int TotalRefinement=-1) const
 Find the Skeleton describing the Vertices on this Grid.
 
RefPtr< SkeletongetVerticesInfo (int TotalRefinement=-1) const
 Find the skeleton describing the vertices of this Grid.
 
RefPtr< SkeletongetEdgeInfo (int TotalRefinement=-1) const
 Find the skeleton describing the faces of this Grid.
 
RefPtr< SkeletongetFaceInfo (int TotalRefinement=-1) const
 Find the skeleton describing the edges of this Grid.
 
double NumberOfHoles (int TotalRefinement=-1) const
 Implements the Euler-Poincare formula to determine the topological number of holes within some surface.
 
SkeletonmakeVertices (int dims)
 Create a Skeleton describing the vertices of a Grid.
 
Skeletonoperator[] (const SkeletonID &Sid)
 Create a Skeleton.
 
RefPtr< SkeletongetSkeleton (const SkeletonID &Sid) const
 Find a Skeleton.
 
RefPtr< Skeletonoperator() (const SkeletonID &Sid) const
 Find a Skeleton.
 
RefPtr< RepresentationCellsAsVertices (int dims) const
 
int MinLevel (int IndexDepth=0) const
 Get a Skeleton that would describe the topology of the fragments of a given Skeleton, which is corresponds to a skeleton of index depth two larger.
 
int MaxLevel (int IndexDepth=0) const
 Find the maximal refinement level for the given index depth.
 
RefPtr< SkeletonfindMaxHomogenousRefinement (int IndexDepth) const
 Find the skeleton with the maximal homogenous refinement level.
 
bool replaceSkeletonID (const SkeletonID &old_id, const SkeletonID &new_id)
 
RefPtr< SkeletonfindIsotropicRefinementFactor (int Factor, int IndexDepth) const
 Find a Skeleton that corresponds to isotropic refinement by the given factor.
 
int iterate (ConstSkeletonIterator &) const
 Iterate over all skeletons of this Grid.
 
int iterate (SkeletonIterator &)
 Iterate over all skeletons of this Grid.
 
int iterate (std::function< bool(const SkeletonID &id, Skeleton &S)>) const
 
int iterate_const (std::function< bool(const SkeletonID &id, const Skeleton &S)>) const
 
template<class SkeletonFunctor >
int Iterate (const SkeletonFunctor &F) const
 
template<class Functor >
int iterate_all (const Functor &F) const
 
int nSkeletons () const
 Return the number of skeletons defined on this grid.
 
int nSkeletons (int IndexDepth) const
 
int getMemoryUsage (memsize_t &UsedMemory, memsize_t &WantedMemory) const
 Get the memory occupied by this Grid (and all of its fields).
 
void Speak (int indent=0, int maxindent=-1) const
 Informative debug message.
 
string xml () const
 

Public Attributes

Skeletons_t Skeletons
 

Protected Member Functions

 ~SkeletonMap ()
 Destructor.
 
void extremeUnction () override
 

Detailed Description

A Skeleton Map is a unique map from SkeletonID's to Skeletons.

Member Function Documentation

◆ findIsotropicRefinementFactor()

RefPtr< Skeleton > Fiber::SkeletonMap::findIsotropicRefinementFactor ( int  Factor,
int  IndexDepth 
) const

Find a Skeleton that corresponds to isotropic refinement by the given factor.

Isotropic refinement means that the same factor is used in each dimension. This factor will be a power of two in most practical but in theory may be an arbitrary integer number.

◆ findMaxHomogenousRefinement()

RefPtr< Skeleton > Fiber::SkeletonMap::findMaxHomogenousRefinement ( int  IndexDepth) const

Find the skeleton with the maximal homogenous refinement level.

Will return a null ptr if none such is found, for instance there are no skeletons of the given index depth or all Skeletons of this index depth are inhomogeneous (different refinement resolution in each coordinate direction).

◆ getMemoryUsage()

int Fiber::SkeletonMap::getMemoryUsage ( memsize_t UsedMemory,
memsize_t WantedMemory 
) const

Get the memory occupied by this Grid (and all of its fields).

Not that if a field is shared on another location then it will be counted twice here. Use the MemCache::Cache function to determine the actual memory usage.

Returns
The number of fragments that actually have data stored.

◆ Iterate()

template<class SkeletonFunctor >
int Fiber::SkeletonMap::Iterate ( const SkeletonFunctor F) const
inline
       Lambda functor iteration over skeletons:
g.Fiber::SkeletonMap::Iterate( [](const SkeletonID&id, const Skeleton&S)
{
return true;
}
);
Identifier for Skeletons within a Grid.
Definition SkeletonID.hpp:24
A Skeleton is a set of Representation object, each of them accessed by an Representer object.
Definition Skeleton.hpp:102

References apply().

◆ makeVertices()

Skeleton & Fiber::SkeletonMap::makeVertices ( int  dims)

Create a Skeleton describing the vertices of a Grid.

Parameters
dimsThe dimensionality of the Grid.
Examples
XF_LineSetFragmented.cpp.

References std::list< typename _Tp, typename _Alloc >::push_back().

Referenced by Fiber::Grid::makeCartesianRepresentation(), and Fiber::Grid::operator[]().

◆ MinLevel()

int Fiber::SkeletonMap::MinLevel ( int  IndexDepth = 0) const

Get a Skeleton that would describe the topology of the fragments of a given Skeleton, which is corresponds to a skeleton of index depth two larger.

This function is identical to:

SkeletonID FragmentSkeletonID(mySkeletonID, +2);
if (RefPtr<Skeleton> pFragmentSkeleton = myGrid( FragmentSkeletonID ) )
{
...
}
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34

Get a Representation describing the topology of the fragments for the given SkeletonID, if there is such.

This function is equivalent to:

return getFragmentSkeleton(Sid)->findRepresentation( (*this)( Sid ) );

Get a field describing the topology of this Skeleton's fragments. This will be the positions field of the Fragment Representation, equivalent to:

getFragmentRepresentation(Sid)->getPositions();

◆ NumberOfHoles()

double Fiber::SkeletonMap::NumberOfHoles ( int  TotalRefinement = -1) const

Implements the Euler-Poincare formula to determine the topological number of holes within some surface.

It is given by

\[
\frac{E-V-F+2}{2}
\]

where E is the number of edges, V the number of vertices and F the number of faces. All this information is retrieved from the respective skeletons as defined on this skeleton map (e.g. a Grid).

References getEdgeInfo(), getFaceInfo(), and getVerticesInfo().