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

Convenience class for procedural linear arrays in cartesian coordinates. More...

#include <UniformCartesianArray.hpp>

Inheritance diagram for Fiber::UniformCartesianArray:
Fiber::LinearDirectProductMemArray< Eagle::point3, Eagle::tvector3 > Fiber::DirectProductMemArray< T, Category, MDIMS > Fiber::DirectProductMemArrayBase< T, Category, MDIMS > Fiber::TypedArray< T > Fiber::MemArrayBase< MDIMS > Fiber::MemBase Fiber::MemBase MemCore::Cacheable MemCore::Intercube MemCore::Cacheable MemCore::Intercube MemCore::ReferenceBase< Cacheable > MemCore::ReferenceBase< Cacheable >

Public Types

typedef LinearDirectProductMemArray< Eagle::point3, Eagle::tvector3 > UniformCartesianArrayBase_t
 
- Public Types inherited from Fiber::LinearDirectProductMemArray< Eagle::point3, Eagle::tvector3 >
enum  
 
typedef DirectProductMemArray< Eagle::point3, LinearCoordinateAxisArray, T::SIZE > Base_t
 
typedef Base_t::CoordinateAxisArray_t CoordinateAxisArray_t
 
typedef T::value_type component_type
 The components of the structured type T.
 
- Public Types inherited from Fiber::DirectProductMemArray< T, Category, MDIMS >
enum  { COMPONENTS = DirectProductMemArrayBase_t::COMPONENTS , Dims = DirectProductMemArrayBase_t::Dims }
 
typedef MemArray< MDIMS, T > MemArray_t
 
typedefvalue_type
 The type of values that are delivered here.
 
typedef T::value_type component_type
 The type of the elements of each component.
 
typedef DirectProductMemArrayBase< typename T::FixedArray_t, Category, MDIMSDirectProductMemArrayBase_t
 
- Public Types inherited from Fiber::DirectProductMemArrayBase< T, Category, MDIMS >
enum  { COMPONENTS = T::SIZE , Dims = MDIMS }
 
typedef T::value_type component_type
 The components of the structured type T.
 
typedef CoordinateAxisArray< component_type, CategoryCoordinateAxisArray_t
 
typedef FixedArray< double, MDIMSFloatIndex_t
 A multidimensional floating-point index.
 
- Public Types inherited from Fiber::MemArrayBase< MDIMS >
enum  Dims_t
 
typedef MultiIndex< N > MIndex_t
 
- Public Types inherited from Fiber::MemBase
typedef WeakPtrCreativeArrayBase_t Creator_t
 
- Public Types inherited from MemCore::Cacheable
typedef unsigned long cachecounter_t
 
- Public Types inherited from MemCore::ReferenceBase< Cacheable >
typedef Object reference_domain_t
 
typedef WeakPtr< Object, Object > SelfPtr_t
 
- Public Types inherited from Fiber::TypedArray< T >
typedefvalue_type
 

Public Member Functions

 UniformCartesianArray (const Eagle::point3 &start, const MultiIndex< 3 > &dims, const Eagle::point3 &end, const MemBase::Creator_t &C=MemCore::NullPtr())
 Construct a uniform cartesian array from corner coordinates.
 
 UniformCartesianArray (const Eagle::BoundingBox &BBox, const MultiIndex< 3 > &dims, const MemBase::Creator_t &C=MemCore::NullPtr())
 Construct a uniform cartesian array from bounding box.
 
 UniformCartesianArray (const MultiIndex< 3 > &dims, const Eagle::point3 &start, const Eagle::tvector3 &delta, const MemBase::Creator_t &C=MemCore::NullPtr())
 Construct a uniform cartesian array from origin point and the first point of the one grid cell diagonally across, using a tangential vector for expressing the cell size.
 
 UniformCartesianArray (const UniformCartesianArray &UCA, const MemBase::Creator_t &C=MemCore::NullPtr())
 
RefPtr< MemBasecopy (const MemBase::Creator_t &C=nullptr) const override
 Create a copy of the current array, duplicating all data and allocating new memory for it.
 
RefPtr< Eagle::BoundingBoxgetBoundingBox () const
 Return a bounding box from this uniform array, which encompasses the first and last point.
 
Eagle::tvector3 cell_diagonal () const
 Return the "size" of a cell as a tangential vector that crosses the diagonal corners of a cell.
 
- Public Member Functions inherited from Fiber::LinearDirectProductMemArray< Eagle::point3, Eagle::tvector3 >
const voidOriginPtr () const override
 Get pointer to origin of linearly procedural array, if it is linear.
 
const voidDeltaPtr () const override
 Get pointer to delta of linearly procedural array, if it is linear.
 
const Eagle::point3 & Origin () const
 
const Eagle::tvector3 & Delta () const
 
 LinearDirectProductMemArray (const index_t dims[T::SIZE], const Eagle::point3 &base, const Eagle::tvector3 &delta, const MemBase::Creator_t &C=MemCore::NullPtr())
 Constructor, initializes the Components members.
 
 LinearDirectProductMemArray (const MultiIndex< T::SIZE > &dims, const Eagle::point3 &base, const Eagle::tvector3 &delta, const MemBase::Creator_t &C=MemCore::NullPtr())
 Constructor via multidimensional array with base and delta information on the field/array data values.
 
 LinearDirectProductMemArray (const LinearDirectProductMemArray &Src, const MemBase::Creator_t &C=MemCore::NullPtr())
 
bool getFlooredMultiIndex (const Eagle::point3 &pos, MultiIndex< T::SIZE > &index) const
 Get an index of the linear array (MultiIndex) from a given global float coordinate.
 
bool getNearestMultiIndex (const Eagle::point3 &pos, MultiIndex< T::SIZE > &index) const
 Get an index of the linear array (MultiIndex) from a given global float coordinate.
 
- Public Member Functions inherited from Fiber::DirectProductMemArray< T, Category, MDIMS >
template<class TBase >
 DirectProductMemArray (const DirectProductMemArrayCreateBaseArray &, const DirectProductMemArray< TBase, Category > &D, const MemBase::Creator_t &C=MemCore::NullPtr())
 The base value which is used as default for each component when the ComponentMap does not specify a mapping from the manifold index to a Component array.
 
 DirectProductMemArray (const MemBase::Creator_t &C=MemCore::NullPtr())
 
 DirectProductMemArray (const DirectProductMemArray &DPM, const MemBase::Creator_t &C=MemCore::NullPtr())
 
operator[] (const MultiIndex< Dims > &I) const
 
getElement (const index_t i) const
 
std::string getElementAsString (size_t index) const override
 
RefPtr< MemBasemakeMemArray (const MemBase::Creator_t &C) const override
 Create an actual memory-occupying array from the procedural data here.
 
RefPtr< MemBasenewMemArraynD (const MultiIndex< Dims > &, const MemBase::Creator_t &C) const override
 
RefPtr< MemBasecreateSubMemArray (const MultiIndex< Dims > &, const MultiIndex< Dims > &, const MemBase::Creator_t &C) const override
 
const type_infogetType () const override
 Return the element type of the certain array.
 
CreativeIterator< T > * creativeIterator () override
 Procedural arrays return 0 here.
 
const CreativeIterator< T > * creativeIterator () const override
 Procedural arrays return 0 here.
 
RefPtr< MemCore::TypedChunk< T > > myChunk () const override
 Procedural arrays return a NullPtr here.
 
first () const override
 Get the data value at the firstIndex()
 
last () const override
 Get the data value at the lastIndex()
 
MultiIndex< Dims > Size () const override
 Return the multidimensional number of points covered by this array.
 
- Public Member Functions inherited from Fiber::DirectProductMemArrayBase< T, Category, MDIMS >
 DirectProductMemArrayBase (const MemBase::Creator_t &C=MemCore::NullPtr())
 The constructor sets the component map such that the dimensions of the manifold are mapped to the first components of the structure.
 
 DirectProductMemArrayBase (const RefPtr< CoordinateAxisArray_t > C[COMPONENTS], const Eagle::Vector< int, Dims > &CMap, const MemBase::Creator_t &theCreator=MemCore::NullPtr())
 
 DirectProductMemArrayBase (const DirectProductMemArrayBase &Src, const MemBase::Creator_t &theCreator=MemCore::NullPtr())
 
void DeferredConstructor () override
 Virtual deferred reference pointer construction pointer Don't overload if you don't know exactly what this function is supposed to do. See class DynPtr for more info.
 
MemCore::memsize_t memsize () const override
 
bool copyFrom (const RefPtr< MemCore::ChunkBase > &theChunk) override
 
RefPtr< MemArray< MDIMS, T > > createMemArray (const RefPtr< MemCore::ChunkBase > &Data, const MemBase::Creator_t &C) const
 Create a memory array of the same dimensions as the current array, but with data as provided by the Storage.
 
RefPtr< MemBasecreateEquallySizedMemArray (const RefPtr< MemCore::ChunkBase > &Storage, const MemBase::Creator_t &C) const override
 Create a memory array of the same dimensions as the current array, but with data as provided by the Storage.
 
RefPtr< MemBasegetComponentArray (int member, const MemBase::Creator_t &C) override
 
void retrieve (T &retval, const MultiIndex< Dims > &I) const
 Evaluate an index, deliver the coordinate value.
 
FloatIndex_t getIndex (const T &PointCoordinates) const
 Given the coordinates of a point, yield the index where it resides in the array.
 
MultiIndex< DimsSize () const override
 Return the multidimensional number of points covered by this array.
 
MultiIndex< DimsfirstIndex () const
 Return a multidimensional index for the 1st data element, which is just all components to be zero.
 
MultiIndex< DimslastIndex () const
 Return a multidimensional index for the last data element, which is just the largest index in each dimension, the number of elements minus one.
 
RefPtr< MemBasegetSlice (index_t i, const MemBase::Creator_t &C) const override
 For a multidimensional array retrieve the nth slice.
 
voidgetPtr () override
 Implementation of the virtual MemArray function.
 
HyperslabParametersgetHyperslabParameters () override
 
- Public Member Functions inherited from Fiber::MemArrayBase< MDIMS >
 MemArrayBase (const FiberTypeIndex &theFiberTypeIndex, const WeakPtr< CreativeArrayBase > &theCreator)
 
 MemArrayBase (const MemArrayBase< N > &)=delete
 
void operator= (const MemArrayBase< N > &)=delete
 
Fiber::Dims_t rank () const override
 Return the number of array dimensions.
 
virtual RefPtr< MemBasenewMemArraynD (const MultiIndex< N > &NewSize, const MemBase::Creator_t &C) const=0
 Create a new array of the same type as the current one, but using the specified dimensions.
 
virtual RefPtr< MemBasecreateSubMemArray (const MultiIndex< N > &Offset, const MultiIndex< N > &CopySize, const MemBase::Creator_t &C) const=0
 Create a new MemArray from a subset of the current array's data.
 
RefPtr< MemBasecreateSubArray (const DynamicSize &Offset, const DynamicSize &CopySize, const MemBase::Creator_t &C) const override
 Implement creation of new memory sub array using the DynamicSize class.
 
DynamicSize getSize () const override
 Return the size of this dataset.
 
RefPtr< ArrayInterpolatorgetInterpolator () const
 
- Public Member Functions inherited from Fiber::MemBase
 MemBase (const FiberTypeIndex &theFiberTypeIndex, const Creator_t &theCreator)
 Empty default constructor.
 
 ~MemBase ()
 Destructor.
 
 MemBase (const MemBase &)=delete
 
MemCore::WeakPtr< MemBasemembase () const
 
virtual index_t nElements () const
 return the number of elements in this array
 
auto NumberOfElements () const
 
auto getNumberOfElements () const
 
MemCore::WeakPtr< FiberTypeBasegetFiberType () const
 
MemCore::memsize_t element_memsize () const
 
bool copyFrom (const RefPtr< MemBase > &Mb)
 Copy all data values from the given MemBase.
 
RefPtr< MemBasecreate (const RefPtr< FiberTypeBase > &FT, const type_info &layout=typeid(void)) const
 Create a new mem array of the same dimensions but different type.
 
template<class T >
RefPtr< MemBasecreate (const type_info &layout=typeid(void)) const
 Create a new mem array of the same dimensions but different type.
 
RefPtr< MemBasecreate (const DynamicSize &DS, const type_info &layout=typeid(void)) const
 Create a new mem array of the same type but different dimensions.
 
RefPtr< MemBasecreate (const type_info &layout=typeid(void)) const
 Create a new mem array of the same type and dimensions, but default values.
 
MemCore::memsize_t memsize () const override
 How much memory is occupied here at all in case it's stored in a chunk?
 
- Public Member Functions inherited from MemCore::Cacheable
 Cacheable (const WeakPtr< Creature > &C)
 
bool isCached () const
 
bool isUncached () const
 
bool markAsUsed ()
 
WeakPtr< CacheBasemyCache () const
 
const WeakPtr< Creature > & myCreator () const
 
int NumberOfListEntries () const
 
void PreDestructor ()
 
void push_back (CacheQueue &Q)
 
void push_front (CacheQueue &Q)
 
void setCreator (const WeakPtr< Creature > &C)
 
- Public Member Functions inherited from MemCore::ReferenceBase< Cacheable >
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
 
- 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< InterfaceBasecreateInterface (const type_info &) const
 
RefPtr< InterfaceBasefindInterface (const type_info &t) const
 
RefPtr< InterfaceBasegetInterface (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 Member Functions inherited from Fiber::TypedArray< T >
 TypedArray (const MemBase::Creator_t &C)
 
 TypedArray (const TypedArray< T > &)=delete
 
void operator= (const TypedArray< T > &)=delete
 
RefPtr< MemCore::ChunkBasegetChunk () const override
 Implement the virtual getChunk() function.
 
const type_infogetType () const override
 Return the element type of the certain array.
 
template<class UnaryOperator >
RefPtr< MemBaseapplyOperator (const UnaryOperator &theOperator, const MemBase::Creator_t &theCreator) const
 Apply an unary operator on the data contained here, and provide a new memory array of the same size and dimensionality.
 
template<class result_t >
RefPtr< MemBaseapplyFunction (const std::function< result_t(const T &)> &theOperator) const
 Apply a functor, possibly yielding a different type.
 
RefPtr< MemBaseapplyFunction (const std::function< T(const T &)> &theOperator) const
 Apply a functor yielding the same type.
 
template<class result_t >
RefPtr< MemBaseapplyFunction (const std::function< result_t(const T &, index_t I)> &theOperator) const
 Apply a functor, possibly yielding a different type.
 
RefPtr< MemBaseapplyFunction (const std::function< T(const T &, index_t I)> &theOperator) const
 Apply a functor yielding the same type.
 
template<class result_t , class SecondType >
RefPtr< MemBaseapplyFunction (const TypedArray< SecondType > &R, const std::function< result_t(const T &, const SecondType &ST, index_t I)> &theOperator) const
 Apply a binary functor, possibly yielding a different type.
 
template<class BinaryOperator >
RefPtr< MemBaseapplyOperator (const BinaryOperator &theOperator, const RefPtr< MemBase > &rightValue, const MemBase::Creator_t &theCreator) const
 Apply a binary operator on the data contained here, and provide a new memory array of the same size and dimensionality.
 
auto getComponent (int Component) -> decltype(getComponentArrayIterator(*this, Component))
 
auto operator() (int Component) -> decltype(getComponentArrayIterator(*this, Component))
 
ranged_for_iterator< T > begin ()
 
ranged_for_iterator< T > end ()
 
const_ranged_for_iterator< T > begin () const
 
const_ranged_for_iterator< T > end () const
 
RefPtr< MemBasecreate (const RefPtr< FiberTypeBase > &FT, const type_info &layout=typeid(void)) const
 Create a new mem array of the same dimensions but different type.
 
template<class T >
RefPtr< MemBasecreate (const type_info &layout=typeid(void)) const
 Create a new mem array of the same dimensions but different type.
 
RefPtr< MemBasecreate (const DynamicSize &DS, const type_info &layout=typeid(void)) const
 Create a new mem array of the same type but different dimensions.
 
RefPtr< MemBasecreate (const type_info &layout=typeid(void)) const
 Create a new mem array of the same type and dimensions, but default values.
 

Static Public Member Functions

static Eagle::tvector3 idiv (const Eagle::tvector3 &what, const MultiIndex< 3 > &divisor)
 
- Static Public Member Functions inherited from Fiber::MemBase
static RefPtr< MemBasecreate (const RefPtr< FiberTypeBase > &FT, const DynamicSize &DS, const type_info &layout=typeid(void))
 Given a description of a certain data type for each element on array, allocate a multidimensional array of the given type.
 
static bool registerCreator (const RefPtr< Allocator > &A, const RefPtr< FiberTypeBase > &FT)
 
- Static Public Member Functions inherited from Fiber::TypedArray< T >
static MemCore::WeakPtr< FiberTypeBasegetFiberType ()
 
static RefPtr< MemBasecreate (const RefPtr< MemBase > &SourceLayout, const type_info &layout=typeid(void))
 
static RefPtr< MemBasecreate (const RefPtr< FiberTypeBase > &FT, const DynamicSize &DS, const type_info &layout=typeid(void))
 Given a description of a certain data type for each element on array, allocate a multidimensional array of the given type.
 

Protected Member Functions

 ~UniformCartesianArray ()
 Destructor, a necessary evil.
 
- Protected Member Functions inherited from MemCore::Cacheable
void adjustCacheableSize (memsize_t memDiff)
 
- Protected Member Functions inherited from MemCore::ReferenceBase< Cacheable >
virtual void extremeUnction ()
 
ReferenceBaseoperator= (const ReferenceBase &R)
 
void suicide ()
 

Additional Inherited Members

- Public Attributes inherited from Fiber::LinearDirectProductMemArray< Eagle::point3, Eagle::tvector3 >
const Eagle::point3 baseValue
 
const Eagle::tvector3 deltaValue
 
- Public Attributes inherited from Fiber::DirectProductMemArrayBase< T, Category, MDIMS >
RefPtr< CoordinateAxisArray_tComponents [COMPONENTS]
 The respective components of the array.
 
Eagle::Vector< int, DimsComponentMap
 Mapping from manifold dimension to component array.
 
- Static Public Attributes inherited from Fiber::MemBase
static int RegisteredTypes = 0
 

Detailed Description

Convenience class for procedural linear arrays in cartesian coordinates.

Constructor & Destructor Documentation

◆ UniformCartesianArray() [1/2]

Fiber::UniformCartesianArray::UniformCartesianArray ( const Eagle::point3 &  start,
const MultiIndex< 3 > &  dims,
const Eagle::point3 &  end,
const MemBase::Creator_t C = MemCore::NullPtr() 
)

Construct a uniform cartesian array from corner coordinates.

Note: dims must be larger than two in each dimension, we must have at least two points here to cover a volume, otherwise it's all nuts.

◆ UniformCartesianArray() [2/2]

Fiber::UniformCartesianArray::UniformCartesianArray ( const Eagle::BoundingBox BBox,
const MultiIndex< 3 > &  dims,
const MemBase::Creator_t C = MemCore::NullPtr() 
)

Construct a uniform cartesian array from bounding box.

Note: dims must be larger than two in each dimension, we must have at least two points here to cover a volume, otherwise it's all nuts.

Member Function Documentation

◆ copy()

RefPtr< MemBase > Fiber::UniformCartesianArray::copy ( const MemBase::Creator_t C = nullptr) const
inlineoverridevirtual

Create a copy of the current array, duplicating all data and allocating new memory for it.

Reimplemented from Fiber::DirectProductMemArray< T, Category, MDIMS >.

◆ getBoundingBox()

RefPtr< Eagle::BoundingBox > Fiber::UniformCartesianArray::getBoundingBox ( ) const

Return a bounding box from this uniform array, which encompasses the first and last point.

This function will always return a new BoundingBox object.

References Fiber::DirectProductMemArray< T, Category, MDIMS >::first(), and Fiber::DirectProductMemArray< T, Category, MDIMS >::last().