FiberVISH 0.2
Fish - The Fiber Bundle API for the Vish Visualization Shell
Public Member Functions | List of all members
Fiber::Transformation Class Referenceabstract

Transformation objects that provide chart transformations, particularily for coordinates, but also other vectorial, tensorial or geometric types. More...

#include <Transformation.hpp>

Inheritance diagram for Fiber::Transformation:
MemCore::ReferenceBase< Transformation > MyTransformation ProjTransformation ProjTransformation

Public Member Functions

virtual RefPtr< Fieldtransform (const Field &F, const RefPtr< Field > &Positions) const
 Transformation of an entire Field, where the Positions of the source coordinate system is provided unless transforming coordinates.
 
virtual RefPtr< CreativeArrayBasetransform (CreativeArrayBase &F, const RefPtr< CreativeArrayBase > &Positions) const
 Transformation of a Field fragment, allowing to provide a customized Creator.
 
virtual RefPtr< MemBasetransform (const RefPtr< MemBase > &SourceData, const RefPtr< CreativeArrayBase > &SourcePositionsFragment) const =0
 Implementation of the actual coordinate transition, the function must yield the transformed field in the destination coordinate system.
 
- Public Member Functions inherited from MemCore::ReferenceBase< Transformation >
auto getObjectCountID () const noexcept
 
bool isIdentical (const WeakPtr< Object, Object > &PossibleSelf) const noexcept
 
void mkAutoDestructive ()
 
refcount_t refcount () const noexcept
 
 ReferenceBase (Object *that) noexcept
 
const auto & self () const
 
refcount_t wrefcount () const noexcept
 

Additional Inherited Members

- Public Types inherited from MemCore::ReferenceBase< Transformation >
typedef Object reference_domain_t
 
typedef WeakPtr< Object, Object > SelfPtr_t
 
- Protected Member Functions inherited from MemCore::ReferenceBase< Transformation >
virtual void extremeUnction ()
 
ReferenceBaseoperator= (const ReferenceBase &R)
 
void suicide ()
 

Detailed Description

Transformation objects that provide chart transformations, particularily for coordinates, but also other vectorial, tensorial or geometric types.

The actual transformation routine needs to be implemented in a derived object implementing the transform() function, where it needs to check the respective type.

Transformation objects are based on the textual name of Chart objects and can be installed globally - valid for all kinds of Chart objects based on the same name - or locally within a specific Grid object. If they are specific to a Grid object, identification is by name as well, but the Transformation objects may carry Grid-specific transformation parameters.

Example for providing a global transformation object:

{
RefPtr<MemBase> transform(const RefPtr<MemBase>&MB) const override
{
{
// ... implement coordinate transformation here ...
}
return nullptr;
}
};
MyTransformation FromSpecialToStandard = // initialize transformation object
;
Atlas::GlobalTransformations()[ "StandardCartesian3D" ][ "SpecialChart" ] = FromSpecialToStandard.self();
constexpr _OutputIterator transform(_InputIterator __first, _InputIterator __last, _OutputIterator __result, _UnaryOperation __unary_op)
An iterator with an optional DataCreator, which is just a class to intercept creation of data along a...
Definition CreativeIterator.hpp:34
Transformation objects that provide chart transformations, particularily for coordinates,...
Definition Transformation.hpp:88
const auto & self() const
Possible implementation of a Transformation object via a std::function<>.
Definition TransformationExample.cpp:16

Similarly, Transformation objects can be added to the Atlas::LocalTransformations within an Atlas instance, such as available on a Grid via Grid::MyAtlas().

Eventually, application code may request a Field in a coordinate system from a Grid object, which - if not existent yet - will be computed via invokation of the Transformation object, possibly transitiong a chain of transformations recursively until success.

StdCoordinateField = myGrid.getField(StandardCartesian3D, FIBER_POSITIONS ) )
{
}

Member Function Documentation

◆ transform() [1/3]

RefPtr< Field > Fiber::Transformation::transform ( const Field F,
const RefPtr< Field > &  Positions 
) const
virtual

Transformation of an entire Field, where the Positions of the source coordinate system is provided unless transforming coordinates.

Usually the child class will not need to override this function, but the function operating on the MemBase objects.

References transform().

◆ transform() [2/3]

virtual RefPtr< MemBase > Fiber::Transformation::transform ( const RefPtr< MemBase > &  SourceData,
const RefPtr< CreativeArrayBase > &  SourcePositionsFragment 
) const
pure virtual

Implementation of the actual coordinate transition, the function must yield the transformed field in the destination coordinate system.

The function must check the type of the SourceData and provide actual type-dependent transformation. Note that the field name is not available in order to avoid implementations that involve usage of the field name - all transformations must be based on types only to ensure consistency of transformations.

◆ transform() [3/3]

RefPtr< CreativeArrayBase > Fiber::Transformation::transform ( CreativeArrayBase F,
const RefPtr< CreativeArrayBase > &  Positions 
) const
virtual

Transformation of a Field fragment, allowing to provide a customized Creator.

By default, this function will provide a FunctionalCreator. The Positions of the source coordinate system is provided unless transforming coordinates. Usually the child class will not need to override this function, but the function operating on the MemBase objects.

References MemCore::CreatorBase< class Domain >::create(), MemCore::ReferenceBase< class Object >::self(), and transform().