Chemical Data Processing Library C++ API - Version 1.4.0
Public Types | Public Member Functions | Friends | List of all members
CDPL::Math::RegularSpatialGrid< T, C, GD, XF > Class Template Reference

3D grid data structure combining a grid data store with a coordinate-system transformation that maps grid cell indices to 3D world positions. More...

#include <RegularSpatialGrid.hpp>

+ Inheritance diagram for CDPL::Math::RegularSpatialGrid< T, C, GD, XF >:

Public Types

typedef T ValueType
 The grid cell value type. More...
 
typedef C CoordinatesValueType
 The xyz-coordinates value type. More...
 
typedef GD GridDataType
 The underlying grid data container type. More...
 
typedef XF CoordinatesTransformType
 The coordinate transformation type mapping grid space coordinates to world coordinates. More...
 
typedef CoordinatesTransformType::MatrixTemporaryType InvCoordinatesTransformType
 The inverse coordinate transformation type mapping world coordinates to grid space coordinates. More...
 
typedef std::conditional< std::is_const< GD >::value, typename GD::ConstReference, typename GD::Reference >::type Reference
 Mutable grid cell reference type (degrades to ConstReference when the data container is const). More...
 
typedef GD::ConstReference ConstReference
 Constant grid cell reference type. More...
 
typedef GD::SizeType SizeType
 The unsigned size type used by the grid data container. More...
 
typedef std::ptrdiff_t SSizeType
 A signed size type used for offset arithmetic. More...
 
typedef GD::DifferenceType DifferenceType
 The signed difference type used by the grid data container. More...
 
typedef SelfType ClosureType
 Closure type used when this grid appears inside another expression. More...
 
typedef const SelfType ConstClosureType
 Constant closure type used when this grid appears inside another expression. More...
 
typedef std::shared_ptr< SelfTypeSharedPointer
 A reference-counted smart pointer [SHPTR] for dynamically allocated RegularSpatialGrid instances. More...
 
- Public Types inherited from CDPL::Math::GridExpression< RegularSpatialGrid< T, typename TypeTraits< T >::RealType, Grid< T >, CMatrix< typename TypeTraits< T >::RealType, 4, 4 > > >
typedef RegularSpatialGrid< T, typename TypeTraits< T >::RealType, Grid< T >, CMatrix< typename TypeTraits< T >::RealType, 4, 4 > > ExpressionType
 The derived grid expression type. More...
 
- Public Types inherited from CDPL::Math::Expression< E >
typedef E ExpressionType
 The derived expression type. More...
 

Public Member Functions

 RegularSpatialGrid (const CoordinatesValueType &xs, const CoordinatesValueType &ys, const CoordinatesValueType &zs)
 Constructs an empty grid with the specified anisotropic per-axis step sizes. More...
 
 RegularSpatialGrid (const GridDataType &data, const CoordinatesValueType &xs, const CoordinatesValueType &ys, const CoordinatesValueType &zs)
 Constructs the grid with the specified anisotropic per-axis step sizes initialized to the supplied grid data. More...
 
 RegularSpatialGrid (const CoordinatesValueType &s)
 Constructs an empty grid with the specified isotropic step size s on all three axes. More...
 
 RegularSpatialGrid (const GridDataType &data, const CoordinatesValueType &s)
 Constructs the grid with the isotropic step size s and the supplied grid data. More...
 
 RegularSpatialGrid (const RegularSpatialGrid &usg)
 Constructs a copy of the RegularSpatialGrid instance usg. More...
 
 RegularSpatialGrid (RegularSpatialGrid &&usg)
 Move-constructs the grid by moving usg. More...
 
virtual ~RegularSpatialGrid ()
 Virtual destructor. More...
 
Reference operator() (SizeType i)
 Returns a mutable reference to the cell at the linear index i. More...
 
ConstReference operator() (SizeType i) const
 Returns a const reference to the value of the cell at the linear index i. More...
 
Reference operator() (SizeType i, SizeType j, SizeType k)
 Returns a mutable reference to the value of cell at (i, j, k). More...
 
ConstReference operator() (SizeType i, SizeType j, SizeType k) const
 Returns a const reference to the value of cell at (i, j, k). More...
 
SizeType getSize () const
 Returns the total number of cells of the grid. More...
 
SizeType getSize1 () const
 Returns the number of cells along the x-axis. More...
 
SizeType getSize2 () const
 Returns the number of cells along the y-axis. More...
 
SizeType getSize3 () const
 Returns the number of cells along the z-axis. More...
 
SizeType getMaxSize () const
 Returns the maximum total number of cells the grid can hold. More...
 
SizeType getMaxSize1 () const
 Returns the maximum number of cells along the x-axis. More...
 
SizeType getMaxSize2 () const
 Returns the maximum number of cells along the y-axis. More...
 
SizeType getMaxSize3 () const
 Returns the maximum number of cells along the z-axis. More...
 
CoordinatesValueType getXStepSize () const
 Returns the per-cell step size along the x-axis. More...
 
CoordinatesValueType getYStepSize () const
 Returns the per-cell step size along the y-axis. More...
 
CoordinatesValueType getZStepSize () const
 Returns the per-cell step size along the z-axis. More...
 
void setXStepSize (const CoordinatesValueType &xs)
 Sets the per-cell step size along the x-axis to xs. More...
 
void setYStepSize (const CoordinatesValueType &ys)
 Sets the per-cell step size along the y-axis to ys. More...
 
void setZStepSize (const CoordinatesValueType &zs)
 Sets the per-cell step size along the z-axis to zs. More...
 
CoordinatesValueType getXExtent () const
 Returns the spatial extent of the grid along the x-axis. More...
 
CoordinatesValueType getYExtent () const
 Returns the spatial extent of the grid along the y-axis. More...
 
CoordinatesValueType getZExtent () const
 Returns the spatial extent of the grid along the z-axis. More...
 
template<typename V >
void getCoordinates (SizeType i, V &coords) const
 Outputs the world space 3D position of the cell with linear index i into coords. More...
 
template<typename V >
void getCoordinates (SSizeType i, SSizeType j, SSizeType k, V &coords) const
 Writes the world space 3D position of the cell at (i, j, k) into coords. More...
 
template<typename V >
void getLocalCoordinates (SSizeType i, SSizeType j, SSizeType k, V &coords) const
 Writes the grid space 3D position of the cell at (i, j, k) into coords. More...
 
template<typename V1 , typename V2 >
void getLocalCoordinates (const V1 &world_coords, V2 &local_coords) const
 Transforms the world space point world_coords into the grid's local coordinate frame and stores the result in local_coords. More...
 
template<typename V >
bool containsPoint (const V &pos) const
 Tells whether the world space point pos lies within the grid bounds. More...
 
template<typename V >
bool containsLocalPoint (const V &pos) const
 Tells whether the grid space point pos lies within the grid bounds. More...
 
template<typename V1 , typename V2 >
void getContainingCell (const V1 &pos, V2 &indices) const
 Writes the (i, j, k) indices of the cell containing the world space point pos into indices. More...
 
template<typename V1 , typename V2 >
void getLocalContainingCell (const V1 &pos, V2 &indices) const
 Writes the (i, j, k) indices of the cell containing the grid space point pos into indices. More...
 
bool isEmpty () const
 Tells whether the grid is empty (zero cells along any dimension). More...
 
const GridDataTypegetData () const
 Returns a const reference to the underlying grid data container. More...
 
GridDataTypegetData ()
 Returns a mutable reference to the underlying grid data container. More...
 
const CoordinatesTransformTypegetCoordinatesTransform () const
 Returns the coordinate transformation mapping grid space to world coordinates. More...
 
template<typename T1 >
void setCoordinatesTransform (const T1 &xform)
 Sets the grid space to world coordinates transformation to xform and caches its calculated inverse. More...
 
RegularSpatialGridoperator= (const RegularSpatialGrid &usg)
 Copy-assigns the state of usg to this grid. More...
 
RegularSpatialGridoperator= (RegularSpatialGrid &&usg)
 Move-assigns the state of usg to this grid. More...
 
template<typename E >
RegularSpatialGridoperator= (const GridExpression< E > &e)
 Assigns the grid expression e to the underlying grid data (the spatial parameters are left unchanged). More...
 
template<typename E >
RegularSpatialGridoperator+= (const GridExpression< E > &e)
 Adds the grid expression e cell-wise to the underlying grid data. More...
 
template<typename E >
RegularSpatialGridoperator-= (const GridExpression< E > &e)
 Subtracts the grid expression e cell-wise from the underlying grid data. More...
 
template<typename T1 >
std::enable_if< IsScalar< T >::value, RegularSpatialGrid >::type & operator*= (const T1 &t)
 Multiplies every cell value by the scalar t. More...
 
template<typename T1 >
std::enable_if< IsScalar< T >::value, RegularSpatialGrid >::type & operator/= (const T1 &t)
 Divides every cell value by the scalar t. More...
 
template<typename E >
RegularSpatialGridassign (const GridExpression< E > &e)
 Assigns the grid expression e to the underlying grid data without intermediate temporary. More...
 
template<typename E >
RegularSpatialGridplusAssign (const GridExpression< E > &e)
 Adds the grid expression e to the underlying grid data without intermediate temporary. More...
 
template<typename E >
RegularSpatialGridminusAssign (const GridExpression< E > &e)
 Subtracts the grid expression e from the underlying grid data without intermediate temporary. More...
 
void swap (RegularSpatialGrid &usg)
 Swaps the data of this grid with those of usg. More...
 
void clear (const ValueType &v=ValueType())
 Sets every cell of the grid to the value v. More...
 
void resize (SizeType m, SizeType n, SizeType o, bool preserve=true, const ValueType &v=ValueType())
 Resizes the grid to m×n×o cells. More...
 
- Public Member Functions inherited from CDPL::Math::GridExpression< RegularSpatialGrid< T, typename TypeTraits< T >::RealType, Grid< T >, CMatrix< typename TypeTraits< T >::RealType, 4, 4 > > >
const ExpressionTypeoperator() () const
 Returns a const reference to the derived grid expression class instance. More...
 
ExpressionTypeoperator() ()
 Returns a reference to the derived grid expression class instance. More...
 

Friends

void swap (RegularSpatialGrid &usg1, RegularSpatialGrid &usg2)
 ADL-enabled free-function form of swap(). More...
 

Additional Inherited Members

- Protected Member Functions inherited from CDPL::Math::GridExpression< RegularSpatialGrid< T, typename TypeTraits< T >::RealType, Grid< T >, CMatrix< typename TypeTraits< T >::RealType, 4, 4 > > >
 GridExpression ()
 
 ~GridExpression ()
 
- Protected Member Functions inherited from CDPL::Math::Expression< E >
 Expression ()
 
 ~Expression ()
 

Detailed Description

template<typename T, typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
class CDPL::Math::RegularSpatialGrid< T, C, GD, XF >

3D grid data structure combining a grid data store with a coordinate-system transformation that maps grid cell indices to 3D world positions.

Template Parameters
TThe grid cell value type.
CThe xyz-coordinates value type.
GDThe underlying grid data container type (default: Math::Grid).
XFThe transformation type that maps cell indices to world coordinates.

Member Typedef Documentation

◆ ValueType

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
typedef T CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::ValueType

The grid cell value type.

◆ CoordinatesValueType

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
typedef C CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::CoordinatesValueType

The xyz-coordinates value type.

◆ GridDataType

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
typedef GD CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::GridDataType

The underlying grid data container type.

◆ CoordinatesTransformType

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
typedef XF CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::CoordinatesTransformType

The coordinate transformation type mapping grid space coordinates to world coordinates.

◆ InvCoordinatesTransformType

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
typedef CoordinatesTransformType::MatrixTemporaryType CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::InvCoordinatesTransformType

The inverse coordinate transformation type mapping world coordinates to grid space coordinates.

◆ Reference

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
typedef std::conditional<std::is_const<GD>::value, typename GD::ConstReference, typename GD::Reference>::type CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::Reference

Mutable grid cell reference type (degrades to ConstReference when the data container is const).

◆ ConstReference

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
typedef GD::ConstReference CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::ConstReference

Constant grid cell reference type.

◆ SizeType

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
typedef GD::SizeType CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::SizeType

The unsigned size type used by the grid data container.

◆ SSizeType

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
typedef std::ptrdiff_t CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::SSizeType

A signed size type used for offset arithmetic.

◆ DifferenceType

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
typedef GD::DifferenceType CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::DifferenceType

The signed difference type used by the grid data container.

◆ ClosureType

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
typedef SelfType CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::ClosureType

Closure type used when this grid appears inside another expression.

◆ ConstClosureType

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
typedef const SelfType CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::ConstClosureType

Constant closure type used when this grid appears inside another expression.

◆ SharedPointer

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
typedef std::shared_ptr<SelfType> CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::SharedPointer

A reference-counted smart pointer [SHPTR] for dynamically allocated RegularSpatialGrid instances.

Constructor & Destructor Documentation

◆ RegularSpatialGrid() [1/6]

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::RegularSpatialGrid ( const CoordinatesValueType xs,
const CoordinatesValueType ys,
const CoordinatesValueType zs 
)
inline

Constructs an empty grid with the specified anisotropic per-axis step sizes.

Parameters
xsThe step size along the x-axis.
ysThe step size along the y-axis.
zsThe step size along the z-axis.

◆ RegularSpatialGrid() [2/6]

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::RegularSpatialGrid ( const GridDataType data,
const CoordinatesValueType xs,
const CoordinatesValueType ys,
const CoordinatesValueType zs 
)
inline

Constructs the grid with the specified anisotropic per-axis step sizes initialized to the supplied grid data.

Parameters
dataThe grid data container.
xsThe step size along the x-axis.
ysThe step size along the y-axis.
zsThe step size along the z-axis.

◆ RegularSpatialGrid() [3/6]

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::RegularSpatialGrid ( const CoordinatesValueType s)
inlineexplicit

Constructs an empty grid with the specified isotropic step size s on all three axes.

Parameters
sThe step size used on every axis.

◆ RegularSpatialGrid() [4/6]

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::RegularSpatialGrid ( const GridDataType data,
const CoordinatesValueType s 
)
inline

Constructs the grid with the isotropic step size s and the supplied grid data.

Parameters
dataThe grid data container.
sThe step size used on every axis.

◆ RegularSpatialGrid() [5/6]

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::RegularSpatialGrid ( const RegularSpatialGrid< T, C, GD, XF > &  usg)
inline

Constructs a copy of the RegularSpatialGrid instance usg.

Parameters
usgThe grid to copy.

◆ RegularSpatialGrid() [6/6]

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::RegularSpatialGrid ( RegularSpatialGrid< T, C, GD, XF > &&  usg)
inline

Move-constructs the grid by moving usg.

Parameters
usgThe source grid (left in a valid but unspecified state).

◆ ~RegularSpatialGrid()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
virtual CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::~RegularSpatialGrid ( )
inlinevirtual

Virtual destructor.

Member Function Documentation

◆ operator()() [1/4]

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
Reference CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::operator() ( SizeType  i)
inline

Returns a mutable reference to the cell at the linear index i.

Parameters
iThe zero-based linear cell index.
Returns
A mutable reference to the cell value.

◆ operator()() [2/4]

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
ConstReference CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::operator() ( SizeType  i) const
inline

Returns a const reference to the value of the cell at the linear index i.

Parameters
iThe zero-based linear cell index.
Returns
A const reference to the cell value.

◆ operator()() [3/4]

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
Reference CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::operator() ( SizeType  i,
SizeType  j,
SizeType  k 
)
inline

Returns a mutable reference to the value of cell at (i, j, k).

Parameters
iThe zero-based cell index along the x-axis.
jThe zero-based cell index along the y-axis.
kThe zero-based cell index along the z-axis.
Returns
A mutable reference to the cell value.

◆ operator()() [4/4]

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
ConstReference CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::operator() ( SizeType  i,
SizeType  j,
SizeType  k 
) const
inline

Returns a const reference to the value of cell at (i, j, k).

Parameters
iThe zero-based cell index along the x-axis.
jThe zero-based cell index along the y-axis.
kThe zero-based cell index along the z-axis.
Returns
A const reference to the cell value.

◆ getSize()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
SizeType CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::getSize ( ) const
inline

Returns the total number of cells of the grid.

Returns
The total cell count.

◆ getSize1()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
SizeType CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::getSize1 ( ) const
inline

Returns the number of cells along the x-axis.

Returns
The number of cells along the x-axis.

◆ getSize2()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
SizeType CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::getSize2 ( ) const
inline

Returns the number of cells along the y-axis.

Returns
The number of cells along the y-axis.

◆ getSize3()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
SizeType CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::getSize3 ( ) const
inline

Returns the number of cells along the z-axis.

Returns
The number of cells along the z-axis.

◆ getMaxSize()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
SizeType CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::getMaxSize ( ) const
inline

Returns the maximum total number of cells the grid can hold.

Returns
The maximum total cell capacity.

◆ getMaxSize1()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
SizeType CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::getMaxSize1 ( ) const
inline

Returns the maximum number of cells along the x-axis.

Returns
The maximum number of cells along the x-axis.

◆ getMaxSize2()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
SizeType CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::getMaxSize2 ( ) const
inline

Returns the maximum number of cells along the y-axis.

Returns
The maximum number of cells along the y-axis.

◆ getMaxSize3()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
SizeType CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::getMaxSize3 ( ) const
inline

Returns the maximum number of cells along the z-axis.

Returns
The maximum number of cells along the z-axis.

◆ getXStepSize()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
CoordinatesValueType CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::getXStepSize ( ) const
inline

Returns the per-cell step size along the x-axis.

Returns
The x-axis step size.

◆ getYStepSize()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
CoordinatesValueType CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::getYStepSize ( ) const
inline

Returns the per-cell step size along the y-axis.

Returns
The y-axis step size.

◆ getZStepSize()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
CoordinatesValueType CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::getZStepSize ( ) const
inline

Returns the per-cell step size along the z-axis.

Returns
The z-axis step size.

◆ setXStepSize()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
void CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::setXStepSize ( const CoordinatesValueType xs)
inline

Sets the per-cell step size along the x-axis to xs.

Parameters
xsThe new x-axis step size.

◆ setYStepSize()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
void CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::setYStepSize ( const CoordinatesValueType ys)
inline

Sets the per-cell step size along the y-axis to ys.

Parameters
ysThe new y-axis step size.

◆ setZStepSize()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
void CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::setZStepSize ( const CoordinatesValueType zs)
inline

Sets the per-cell step size along the z-axis to zs.

Parameters
zsThe new z-axis step size.

◆ getXExtent()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
CoordinatesValueType CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::getXExtent ( ) const
inline

Returns the spatial extent of the grid along the x-axis.

Returns
The x-axis extent.

◆ getYExtent()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
CoordinatesValueType CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::getYExtent ( ) const
inline

Returns the spatial extent of the grid along the y-axis.

Returns
The y-axis extent.

◆ getZExtent()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
CoordinatesValueType CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::getZExtent ( ) const
inline

Returns the spatial extent of the grid along the z-axis.

Returns
The z-axis extent.

◆ getCoordinates() [1/2]

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
template<typename V >
void CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::getCoordinates ( SizeType  i,
V &  coords 
) const
inline

Outputs the world space 3D position of the cell with linear index i into coords.

Template Parameters
VThe output vector type.
Parameters
iThe zero-based linear cell index.
coordsThe output vector receiving the xyz-coordinates.

◆ getCoordinates() [2/2]

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
template<typename V >
void CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::getCoordinates ( SSizeType  i,
SSizeType  j,
SSizeType  k,
V &  coords 
) const
inline

Writes the world space 3D position of the cell at (i, j, k) into coords.

Template Parameters
VThe output vector type.
Parameters
iThe zero-based cell index along the x-axis.
jThe zero-based cell index along the y-axis.
kThe zero-based cell index along the z-axis.
coordsThe output vector receiving the world space 3D position.

◆ getLocalCoordinates() [1/2]

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
template<typename V >
void CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::getLocalCoordinates ( SSizeType  i,
SSizeType  j,
SSizeType  k,
V &  coords 
) const
inline

Writes the grid space 3D position of the cell at (i, j, k) into coords.

Template Parameters
VThe output vector type.
Parameters
iThe zero-based cell index along the x-axis.
jThe zero-based cell index along the y-axis.
kThe zero-based cell index along the z-axis.
coordsThe output vector receiving the grid space 3D position.

◆ getLocalCoordinates() [2/2]

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
template<typename V1 , typename V2 >
void CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::getLocalCoordinates ( const V1 &  world_coords,
V2 &  local_coords 
) const
inline

Transforms the world space point world_coords into the grid's local coordinate frame and stores the result in local_coords.

Template Parameters
V1The input vector type.
V2The output vector type.
Parameters
world_coordsThe input world space 3D position.
local_coordsThe output vector receiving the grid space 3D position.

◆ containsPoint()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
template<typename V >
bool CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::containsPoint ( const V &  pos) const
inline

Tells whether the world space point pos lies within the grid bounds.

Template Parameters
VThe point vector type.
Parameters
posThe world space 3D position to test.
Returns
true if pos is inside the grid, and false otherwise.

◆ containsLocalPoint()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
template<typename V >
bool CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::containsLocalPoint ( const V &  pos) const
inline

Tells whether the grid space point pos lies within the grid bounds.

Template Parameters
VThe point vector type.
Parameters
posThe grid space 3D position to test.
Returns
true if pos is inside the grid, and false otherwise.

◆ getContainingCell()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
template<typename V1 , typename V2 >
void CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::getContainingCell ( const V1 &  pos,
V2 &  indices 
) const
inline

Writes the (i, j, k) indices of the cell containing the world space point pos into indices.

Template Parameters
V1The input point type.
V2The output indices type.
Parameters
posThe world space 3D position.
indicesThe output vector receiving the three zero-based cell indices.

◆ getLocalContainingCell()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
template<typename V1 , typename V2 >
void CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::getLocalContainingCell ( const V1 &  pos,
V2 &  indices 
) const
inline

Writes the (i, j, k) indices of the cell containing the grid space point pos into indices.

Template Parameters
V1The input point type.
V2The output indices type.
Parameters
posThe local-frame 3D position.
indicesThe output vector receiving the three zero-based cell indices.

◆ isEmpty()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
bool CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::isEmpty ( ) const
inline

Tells whether the grid is empty (zero cells along any dimension).

Returns
true if the grid is empty, and false otherwise.

◆ getData() [1/2]

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
const GridDataType& CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::getData ( ) const
inline

Returns a const reference to the underlying grid data container.

Returns
A const reference to the grid data.

◆ getData() [2/2]

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
GridDataType& CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::getData ( )
inline

Returns a mutable reference to the underlying grid data container.

Returns
A mutable reference to the grid data.

◆ getCoordinatesTransform()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
const CoordinatesTransformType& CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::getCoordinatesTransform ( ) const
inline

Returns the coordinate transformation mapping grid space to world coordinates.

Returns
A const reference to the transformation matrix.

◆ setCoordinatesTransform()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
template<typename T1 >
void CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::setCoordinatesTransform ( const T1 &  xform)
inline

Sets the grid space to world coordinates transformation to xform and caches its calculated inverse.

Template Parameters
T1A type assignable to CoordinatesTransformType.
Parameters
xformThe new transformation.
Exceptions
Base::CalculationFailedif the transformation cannot be inverted (only when math checks are enabled).

◆ operator=() [1/3]

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
RegularSpatialGrid& CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::operator= ( const RegularSpatialGrid< T, C, GD, XF > &  usg)
inline

Copy-assigns the state of usg to this grid.

Parameters
usgThe source grid.
Returns
A reference to itself.

◆ operator=() [2/3]

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
RegularSpatialGrid& CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::operator= ( RegularSpatialGrid< T, C, GD, XF > &&  usg)
inline

Move-assigns the state of usg to this grid.

Parameters
usgThe source grid (left in a valid but unspecified state).
Returns
A reference to itself.

◆ operator=() [3/3]

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
template<typename E >
RegularSpatialGrid& CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::operator= ( const GridExpression< E > &  e)
inline

Assigns the grid expression e to the underlying grid data (the spatial parameters are left unchanged).

Template Parameters
EThe source grid expression type.
Parameters
eThe source grid expression.
Returns
A reference to itself.

◆ operator+=()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
template<typename E >
RegularSpatialGrid& CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::operator+= ( const GridExpression< E > &  e)
inline

Adds the grid expression e cell-wise to the underlying grid data.

Template Parameters
EThe source grid expression type.
Parameters
eThe grid expression to add.
Returns
A reference to itself.

◆ operator-=()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
template<typename E >
RegularSpatialGrid& CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::operator-= ( const GridExpression< E > &  e)
inline

Subtracts the grid expression e cell-wise from the underlying grid data.

Template Parameters
EThe source grid expression type.
Parameters
eThe grid expression to subtract.
Returns
A reference to itself.

◆ operator*=()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
template<typename T1 >
std::enable_if<IsScalar<T>::value, RegularSpatialGrid>::type& CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::operator*= ( const T1 &  t)
inline

Multiplies every cell value by the scalar t.

Template Parameters
T1The scalar type.
Parameters
tThe scalar multiplier.
Returns
A reference to itself.

◆ operator/=()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
template<typename T1 >
std::enable_if<IsScalar<T>::value, RegularSpatialGrid>::type& CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::operator/= ( const T1 &  t)
inline

Divides every cell value by the scalar t.

Template Parameters
T1The scalar type.
Parameters
tThe scalar divisor.
Returns
A reference to itself.

◆ assign()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
template<typename E >
RegularSpatialGrid& CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::assign ( const GridExpression< E > &  e)
inline

Assigns the grid expression e to the underlying grid data without intermediate temporary.

Template Parameters
EThe source grid expression type.
Parameters
eThe source grid expression.
Returns
A reference to itself.

◆ plusAssign()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
template<typename E >
RegularSpatialGrid& CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::plusAssign ( const GridExpression< E > &  e)
inline

Adds the grid expression e to the underlying grid data without intermediate temporary.

Template Parameters
EThe source grid expression type.
Parameters
eThe source grid expression.
Returns
A reference to itself.

◆ minusAssign()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
template<typename E >
RegularSpatialGrid& CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::minusAssign ( const GridExpression< E > &  e)
inline

Subtracts the grid expression e from the underlying grid data without intermediate temporary.

Template Parameters
EThe source grid expression type.
Parameters
eThe source grid expression.
Returns
A reference to itself.

◆ swap()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
void CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::swap ( RegularSpatialGrid< T, C, GD, XF > &  usg)
inline

Swaps the data of this grid with those of usg.

Parameters
usgThe grid to swap with.

◆ clear()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
void CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::clear ( const ValueType v = ValueType())
inline

Sets every cell of the grid to the value v.

Parameters
vThe fill value.

◆ resize()

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
void CDPL::Math::RegularSpatialGrid< T, C, GD, XF >::resize ( SizeType  m,
SizeType  n,
SizeType  o,
bool  preserve = true,
const ValueType v = ValueType() 
)
inline

Resizes the grid to m×n×o cells.

Parameters
mThe new size along the x-axis.
nThe new size along the y-axis.
oThe new size along the z-axis.
preserveIf true, existing cell values are kept where the indices remain valid. If false, all cells are set to v.
vThe fill value used for newly added cells (and for all cells if preserve is false).

Friends And Related Function Documentation

◆ swap

template<typename T , typename C = typename TypeTraits<T>::RealType, typename GD = Grid<T>, typename XF = CMatrix<C, 4, 4>>
void swap ( RegularSpatialGrid< T, C, GD, XF > &  usg1,
RegularSpatialGrid< T, C, GD, XF > &  usg2 
)
friend

ADL-enabled free-function form of swap().

Parameters
usg1The first grid.
usg2The second grid.

The documentation for this class was generated from the following file: