OpenWalnut  1.4.0
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends
WGridRegular3DTemplate< T > Class Template Reference

A grid that has parallelepiped cells which all have the same proportion. More...

#include <WGridRegular3D.h>

+ Inheritance diagram for WGridRegular3DTemplate< T >:

List of all members.

Public Types

typedef WMatrixFixed< T, 3, 1 > Vector3Type
 Convenience typedef for 3d vectors of the appropriate numerical type.
typedef boost::shared_ptr
< WGridRegular3DTemplate
SPtr
 Convenience typedef for a boost::shared_ptr< WGridRegular3DTemplate >.
typedef boost::shared_ptr
< const WGridRegular3DTemplate
ConstSPtr
 Convenience typedef for a boost::shared_ptr< const WGridRegular3DTemplate >.
typedef boost::array< size_t, 8 > CellVertexArray
 Convenience typedef for a boost::array< size_t, 8 >.

Public Member Functions

template<typename InputType >
 WGridRegular3DTemplate (WGridRegular3DTemplate< InputType > const &rhs)
 Copy constructor.
 WGridRegular3DTemplate (unsigned int nbPosX, unsigned int nbPosY, unsigned int nbPosZ, WGridTransformOrthoTemplate< T > const transform=WGridTransformOrthoTemplate< T >())
 Defines the number of samples in each coordinate direction as ints, and the transformation of the grid via a grid transform.
 WGridRegular3DTemplate (unsigned int nbPosX, unsigned int nbPosY, unsigned int nbPosZ, double scaleX, double scaleY, double scaleZ)
 Defines the number of samples in each coordinate direction as ints, and the transformation of the grid via a grid transform.
unsigned int getNbCoordsX () const
 Returns the number of samples in x direction.
unsigned int getNbCoordsY () const
 Returns the number of samples in y direction.
unsigned int getNbCoordsZ () const
 Returns the number of samples in z direction.
getOffsetX () const
 Returns the distance between samples in x direction.
getOffsetY () const
 Returns the distance between samples in y direction.
getOffsetZ () const
 Returns the distance between samples in z direction.
Vector3Type getDirectionX () const
 Returns the vector determining the direction of samples in x direction.
Vector3Type getDirectionY () const
 Returns the vector determining the direction of samples in y direction.
Vector3Type getDirectionZ () const
 Returns the vector determining the direction of samples in z direction.
Vector3Type getUnitDirectionX () const
 Returns the vector determining the unit (normalized) direction of samples in x direction.
Vector3Type getUnitDirectionY () const
 Returns the vector determining the unit (normalized) direction of samples in y direction.
Vector3Type getUnitDirectionZ () const
 Returns the vector determining the unit (normalized) direction of samples in z direction.
Vector3Type getOrigin () const
 Returns the position of the origin of the grid.
WMatrix< T > getTransformationMatrix () const
 Returns a 4x4 matrix that represents the grid's transformation.
WBoundingBox getBoundingBox () const
 

Axis aligned Bounding Box that encloses this grid.


WBoundingBox getBoundingBoxIncludingBorder () const
 Calculates the bounding box but includes the border voxel associated cell too.
WBoundingBox getVoxelBoundingBox () const
 Calculate the bounding box in voxel space.
Vector3Type getPosition (unsigned int i) const
 Returns the i-th position on the grid.
Vector3Type getPosition (unsigned int iX, unsigned int iY, unsigned int iZ) const
 Returns the position that is the iX-th in x direction, the iY-th in y direction and the iZ-th in z direction.
Vector3Type worldCoordToTexCoord (Vector3Type point)
 Transforms world coordinates to texture coordinates.
int getVoxelNum (const Vector3Type &pos) const
 Returns the i'th voxel where the given position belongs too.
int getVoxelNum (const size_t x, const size_t y, const size_t z) const
 returns the voxel index for a given discrete position in the grid
int getXVoxelCoord (const Vector3Type &pos) const
 Computes the X coordinate of that voxel that contains the position pos.
int getYVoxelCoord (const Vector3Type &pos) const
 Computes the Y coordinate of that voxel that contains the position pos.
int getZVoxelCoord (const Vector3Type &pos) const
 Computes the Z coordinate of that voxel that contains the position pos.
WVector3i getVoxelCoord (const Vector3Type &pos) const
 Computes the voxel coordinates of that voxel which contains the position pos.
size_t getCellId (const Vector3Type &pos, bool *success) const
 Computes the id of the cell containing the position pos.
CellVertexArray getCellVertexIds (size_t cellId) const
 Computes the ids of the vertices of a cell given by its id.
boost::shared_ptr< std::vector
< Vector3Type > > 
getVoxelVertices (const Vector3Type &point, const T margin=0.0) const
 Computes the vertices for a voxel cuboid around the given point:
std::vector< size_tgetNeighbours (size_t id) const
 Return the list of neighbour voxels.
std::vector< size_tgetNeighbours27 (size_t id) const
 Return the list of all neighbour voxels.
std::vector< size_tgetNeighboursRange (size_t id, size_t range) const
 Return the list of all neighbour voxels.
std::vector< size_tgetNeighbours9XY (size_t id) const
 Return the list of all neighbour voxels.
std::vector< size_tgetNeighbours9YZ (size_t id) const
 Return the list of all neighbour voxels.
std::vector< size_tgetNeighbours9XZ (size_t id) const
 Return the list of all neighbour voxels.
bool encloses (const Vector3Type &pos) const
 Decides whether a certain position is inside this grid or not.
bool isNotRotated () const
 Return whether the transformations of the grid are only translation and/or scaling.
WGridTransformOrthoTemplate< T >
const 
getTransform () const
 Returns the transformation used by this grid.
bool operator== (const WGridRegular3DTemplate< T > &other) const
 Compares two grids.

Private Member Functions

int getNVoxelCoord (const Vector3Type &pos, size_t axis) const
 Computes for the n'th component of the voxel coordinate where the voxel contains the position pos.
void initInformationProperties ()
 Adds the specific information of this grid type to the informational properties.

Private Attributes

unsigned int m_nbPosX
 Number of positions in x direction.
unsigned int m_nbPosY
 Number of positions in y direction.
unsigned int m_nbPosZ
 Number of positions in z direction.
WGridTransformOrthoTemplate< T >
const 
m_transform
 The grid's transformation.

Friends

class WGridRegular3DTemplate
class WGridRegular3DTest
 Only test are allowed as friends.

Detailed Description

template<typename T>
class WGridRegular3DTemplate< T >

A grid that has parallelepiped cells which all have the same proportion.

I.e. the samples along a single axis are equidistant. The distance of samples may vary between axes.

Warning:
Positions on the upper bounddaries in x, y and z are considered outside the grid.

Definition at line 60 of file WGridRegular3D.h.


Member Typedef Documentation

template<typename T>
typedef boost::array< size_t, 8 > WGridRegular3DTemplate< T >::CellVertexArray

Convenience typedef for a boost::array< size_t, 8 >.

Return type of getCellVertexIds.

Definition at line 88 of file WGridRegular3D.h.

template<typename T>
typedef boost::shared_ptr< const WGridRegular3DTemplate > WGridRegular3DTemplate< T >::ConstSPtr

Convenience typedef for a boost::shared_ptr< const WGridRegular3DTemplate >.

Definition at line 83 of file WGridRegular3D.h.

template<typename T>
typedef boost::shared_ptr< WGridRegular3DTemplate > WGridRegular3DTemplate< T >::SPtr

Convenience typedef for a boost::shared_ptr< WGridRegular3DTemplate >.

Definition at line 78 of file WGridRegular3D.h.

template<typename T>
typedef WMatrixFixed< T, 3, 1 > WGridRegular3DTemplate< T >::Vector3Type

Convenience typedef for 3d vectors of the appropriate numerical type.

Definition at line 73 of file WGridRegular3D.h.


Constructor & Destructor Documentation

template<typename T >
template<typename InputType >
WGridRegular3DTemplate< T >::WGridRegular3DTemplate ( WGridRegular3DTemplate< InputType > const &  rhs)

Copy constructor.

Copies the data from an WGridRegular3DTemplate object with arbitary numerical type.

Parameters:
rhsA WGridRegular3DTemplate object, which mustn't have the same numerical type.

Definition at line 552 of file WGridRegular3D.h.

References WGridRegular3DTemplate< T >::initInformationProperties().

template<typename T >
WGridRegular3DTemplate< T >::WGridRegular3DTemplate ( unsigned int  nbPosX,
unsigned int  nbPosY,
unsigned int  nbPosZ,
WGridTransformOrthoTemplate< T > const  transform = WGridTransformOrthoTemplate< T >() 
)

Defines the number of samples in each coordinate direction as ints, and the transformation of the grid via a grid transform.

Parameters:
nbPosXnumber of positions along first axis
nbPosYnumber of positions along second axis
nbPosZnumber of positions along third axis
transforma grid transformation

Definition at line 563 of file WGridRegular3D.h.

References WGridRegular3DTemplate< T >::initInformationProperties().

template<typename T >
WGridRegular3DTemplate< T >::WGridRegular3DTemplate ( unsigned int  nbPosX,
unsigned int  nbPosY,
unsigned int  nbPosZ,
double  scaleX,
double  scaleY,
double  scaleZ 
)

Defines the number of samples in each coordinate direction as ints, and the transformation of the grid via a grid transform.

Parameters:
nbPosXnumber of positions along first axis
nbPosYnumber of positions along second axis
nbPosZnumber of positions along third axis
scaleXscaling of a voxel in x direction
scaleYscaling of a voxel in y direction
scaleZscaling of a voxel in z direction

Definition at line 575 of file WGridRegular3D.h.

References WGridRegular3DTemplate< T >::initInformationProperties().


Member Function Documentation

template<typename T>
bool WGridRegular3DTemplate< T >::encloses ( const Vector3Type pos) const [inline]

Decides whether a certain position is inside this grid or not.

Parameters:
posPosition to test
Returns:
True if and only if the given point is inside or on boundary of this grid, otherwise false.

Definition at line 1224 of file WGridRegular3D.h.

Referenced by WGridRegular3DTest::testEnclosesQuery(), and WGridRegular3DTest::testEnclosesRotated().

template<typename T >
WBoundingBox WGridRegular3DTemplate< T >::getBoundingBox ( ) const [inline, virtual]

Axis aligned Bounding Box that encloses this grid.

Returns:

Axis aligned Bounding Box that encloses this grid.

Implements WGrid.

Definition at line 671 of file WGridRegular3D.h.

References WBoundingBoxImpl< VT >::expandBy().

template<typename T >
WBoundingBox WGridRegular3DTemplate< T >::getBoundingBoxIncludingBorder ( ) const [inline]

Calculates the bounding box but includes the border voxel associated cell too.

Returns:
the bounding box

Definition at line 686 of file WGridRegular3D.h.

References WBoundingBoxImpl< VT >::expandBy().

template<typename T>
size_t WGridRegular3DTemplate< T >::getCellId ( const Vector3Type pos,
bool *  success 
) const [inline]

Computes the id of the cell containing the position pos.

Note that the upper bound of the grid does not belong to any cell

Parameters:
posThe position selecting the cell.
successTrue if the position pos is inside the grid.
Returns:
id of the containing the position.

Definition at line 831 of file WGridRegular3D.h.

Referenced by WGridRegular3DTest::testGetCellId().

template<typename T >
WGridRegular3DTemplate< T >::CellVertexArray WGridRegular3DTemplate< T >::getCellVertexIds ( size_t  cellId) const [inline]

Computes the ids of the vertices of a cell given by its id.

Parameters:
cellIdThe id of the cell we want to know ther vertices of.
Returns:
Ids of vertices belonging to cell with given cellId.
        z-axis  y-axis
        |      /
        | 6___/_7
        |/:    /|
        4_:___5 |
        | :...|.|
        |.2   | 3
        |_____|/ ____x-axis
       0      1
       

Definition at line 845 of file WGridRegular3D.h.

Referenced by WGridRegular3DTest::testGetCellVertexIds().

template<typename T >
WGridRegular3DTemplate< T >::Vector3Type WGridRegular3DTemplate< T >::getDirectionX ( ) const [inline]

Returns the vector determining the direction of samples in x direction.

Adding this vector to a grid position in world coordinates yields the position of the next sample along the grids (world coordinate) x-axis.

Returns:
The vector determining the direction of samples in x direction.

Definition at line 623 of file WGridRegular3D.h.

Referenced by WGridRegular3DTest::testOrientation().

template<typename T >
WGridRegular3DTemplate< T >::Vector3Type WGridRegular3DTemplate< T >::getDirectionY ( ) const [inline]

Returns the vector determining the direction of samples in y direction.

Adding this vector to a grid position in world coordinates yields the position of the next sample along the grids (world coordinate) y-axis.

Returns:
The vector determining the direction of samples in y direction.

Definition at line 629 of file WGridRegular3D.h.

Referenced by WGridRegular3DTest::testOrientation().

template<typename T >
WGridRegular3DTemplate< T >::Vector3Type WGridRegular3DTemplate< T >::getDirectionZ ( ) const [inline]

Returns the vector determining the direction of samples in z direction.

Adding this vector to a grid position in world coordinates yields the position of the next sample along the grids (world coordinate) z-axis.

Returns:
The vector determining the direction of samples in z direction.

Definition at line 635 of file WGridRegular3D.h.

Referenced by WGridRegular3DTest::testOrientation().

template<typename T >
unsigned int WGridRegular3DTemplate< T >::getNbCoordsX ( ) const [inline]
template<typename T >
unsigned int WGridRegular3DTemplate< T >::getNbCoordsY ( ) const [inline]

Returns the number of samples in y direction.

Returns:
The number of samples in y direction.

Definition at line 593 of file WGridRegular3D.h.

Referenced by WGridRegular3DTemplate< T >::operator==(), and WGridRegular3DTest::testGetNbCoords().

template<typename T >
unsigned int WGridRegular3DTemplate< T >::getNbCoordsZ ( ) const [inline]

Returns the number of samples in z direction.

Returns:
The number of samples in z direction.

Definition at line 599 of file WGridRegular3D.h.

Referenced by WGridRegular3DTemplate< T >::operator==(), and WGridRegular3DTest::testGetNbCoords().

template<typename T >
std::vector< size_t > WGridRegular3DTemplate< T >::getNeighbours ( size_t  id) const

Return the list of neighbour voxels.

Exceptions:
WOutOfBoundsIf the voxel id is outside of the grid.
Parameters:
idNumber of the voxel for which the neighbours should be computed
Returns:
Vector of voxel ids which are all neighboured

Definition at line 887 of file WGridRegular3D.h.

Referenced by WGridRegular3DTest::testNeighbourOfVoxelNotInsideThisGrid(), WGridRegular3DTest::testNeighbourOnBackUpperRight(), WGridRegular3DTest::testNeighbourOnLeftBorderPlane(), WGridRegular3DTest::testNeighboursInsideAGrid(), and WGridRegular3DTest::testNeighboursOnFrontLowerLeft().

template<typename T >
std::vector< size_t > WGridRegular3DTemplate< T >::getNeighbours27 ( size_t  id) const

Return the list of all neighbour voxels.

Exceptions:
WOutOfBoundsIf the voxel id is outside of the grid.
Parameters:
idNumber of the voxel for which the neighbours should be computed
Returns:
Vector of voxel ids which are all neighboured

Definition at line 932 of file WGridRegular3D.h.

template<typename T >
std::vector< size_t > WGridRegular3DTemplate< T >::getNeighbours9XY ( size_t  id) const

Return the list of all neighbour voxels.

Exceptions:
WOutOfBoundsIf the voxel id is outside of the grid.
Parameters:
idNumber of the voxel for which the neighbours should be computed
Returns:
Vector of voxel ids which are all neighboured along the XY plane

Definition at line 1033 of file WGridRegular3D.h.

template<typename T >
std::vector< size_t > WGridRegular3DTemplate< T >::getNeighbours9XZ ( size_t  id) const

Return the list of all neighbour voxels.

Exceptions:
WOutOfBoundsIf the voxel id is outside of the grid.
Parameters:
idNumber of the voxel for which the neighbours should be computed
Returns:
Vector of voxel ids which are all neighboured along the XZ plane

Definition at line 1160 of file WGridRegular3D.h.

template<typename T >
std::vector< size_t > WGridRegular3DTemplate< T >::getNeighbours9YZ ( size_t  id) const

Return the list of all neighbour voxels.

Exceptions:
WOutOfBoundsIf the voxel id is outside of the grid.
Parameters:
idNumber of the voxel for which the neighbours should be computed
Returns:
Vector of voxel ids which are all neighboured along the YZ plane

Definition at line 1096 of file WGridRegular3D.h.

template<typename T >
std::vector< size_t > WGridRegular3DTemplate< T >::getNeighboursRange ( size_t  id,
size_t  range 
) const

Return the list of all neighbour voxels.

Exceptions:
WOutOfBoundsIf the voxel id is outside of the grid.
Parameters:
idNumber of the voxel for which the neighbours should be computed
rangeneighborhood range selected. It specifies the distance to count as neighbour in each direction.
Returns:
Vector of voxel ids which are all neighboured

Definition at line 992 of file WGridRegular3D.h.

template<typename T>
int WGridRegular3DTemplate< T >::getNVoxelCoord ( const Vector3Type pos,
size_t  axis 
) const [private]

Computes for the n'th component of the voxel coordinate where the voxel contains the position pos.

Parameters:
posThe position for which the n'th component of the voxel coordinates should be computed.
axisThe number of the component. (0 == x-axis, 1 == y-axis, ...)
Returns:
The n'th component of the voxel coordinate
template<typename T >
T WGridRegular3DTemplate< T >::getOffsetX ( ) const [inline]

Returns the distance between samples in x direction.

Returns:
The distance between samples in x direction.

Definition at line 605 of file WGridRegular3D.h.

Referenced by WGridRegular3DTest::testGetVectorOffset().

template<typename T >
T WGridRegular3DTemplate< T >::getOffsetY ( ) const [inline]

Returns the distance between samples in y direction.

Returns:
The distance between samples in y direction.

Definition at line 611 of file WGridRegular3D.h.

Referenced by WGridRegular3DTest::testGetVectorOffset().

template<typename T >
T WGridRegular3DTemplate< T >::getOffsetZ ( ) const [inline]

Returns the distance between samples in z direction.

Returns:
The distance between samples in z direction.

Definition at line 617 of file WGridRegular3D.h.

Referenced by WGridRegular3DTest::testGetVectorOffset().

template<typename T >
WGridRegular3DTemplate< T >::Vector3Type WGridRegular3DTemplate< T >::getOrigin ( ) const [inline]

Returns the position of the origin of the grid.

Returns:
The position of the origin of the grid.

Definition at line 659 of file WGridRegular3D.h.

Referenced by WGridRegular3DTest::testOrientation().

template<typename T >
WGridRegular3DTemplate< T >::Vector3Type WGridRegular3DTemplate< T >::getPosition ( unsigned int  i) const [inline]

Returns the i-th position on the grid.

Parameters:
iid of position to be obtained
Returns:
i-th position of the grid.

Definition at line 716 of file WGridRegular3D.h.

Referenced by WGridRegular3DTest::testGetPositionScalarOffset().

template<typename T >
WGridRegular3DTemplate< T >::Vector3Type WGridRegular3DTemplate< T >::getPosition ( unsigned int  iX,
unsigned int  iY,
unsigned int  iZ 
) const [inline]

Returns the position that is the iX-th in x direction, the iY-th in y direction and the iZ-th in z direction.

Parameters:
iXid along first axis of position to be obtained
iYid along second axis of position to be obtained
iZid along third axis of position to be obtained
Returns:
Position (iX,iY,iZ)

Definition at line 722 of file WGridRegular3D.h.

template<typename T >
WGridTransformOrthoTemplate< T > const WGridRegular3DTemplate< T >::getTransform ( ) const [inline]

Returns the transformation used by this grid.

Returns:
The transformation.

Definition at line 1250 of file WGridRegular3D.h.

template<typename T >
WMatrix< T > WGridRegular3DTemplate< T >::getTransformationMatrix ( ) const [inline]

Returns a 4x4 matrix that represents the grid's transformation.

Returns:
The grid's transformation.

Definition at line 665 of file WGridRegular3D.h.

template<typename T >
WGridRegular3DTemplate< T >::Vector3Type WGridRegular3DTemplate< T >::getUnitDirectionX ( ) const [inline]

Returns the vector determining the unit (normalized) direction of samples in x direction.

Returns:
The vector determining the unit (normalized) direction of samples in x direction.

Definition at line 641 of file WGridRegular3D.h.

template<typename T >
WGridRegular3DTemplate< T >::Vector3Type WGridRegular3DTemplate< T >::getUnitDirectionY ( ) const [inline]

Returns the vector determining the unit (normalized) direction of samples in y direction.

Returns:
The vector determining the unit (normalized) direction of samples in y direction.

Definition at line 647 of file WGridRegular3D.h.

template<typename T >
WGridRegular3DTemplate< T >::Vector3Type WGridRegular3DTemplate< T >::getUnitDirectionZ ( ) const [inline]

Returns the vector determining the unit (normalized) direction of samples in z direction.

Returns:
The vector determining the unit (normalized) direction of samples in z direction.

Definition at line 653 of file WGridRegular3D.h.

template<typename T >
WBoundingBox WGridRegular3DTemplate< T >::getVoxelBoundingBox ( ) const [inline]

Calculate the bounding box in voxel space.

In contrast to the cell bounding box, this includes the space of the last voxel in each direction.

Returns:
the voxel space bounding box.

Definition at line 701 of file WGridRegular3D.h.

References WBoundingBoxImpl< VT >::expandBy().

template<typename T>
WVector3i WGridRegular3DTemplate< T >::getVoxelCoord ( const Vector3Type pos) const [inline]

Computes the voxel coordinates of that voxel which contains the position pos.

Parameters:
posThe position selecting the voxel.
Returns:
A vector of ints where the first component is the X voxel coordinate, the second the Y component voxel coordinate and the last the Z component of the voxel coordinate. If the selecting position is outside of the grid then -1 -1 -1 is returned.

Definition at line 821 of file WGridRegular3D.h.

template<typename T >
int WGridRegular3DTemplate< T >::getVoxelNum ( const Vector3Type pos) const [inline]

Returns the i'th voxel where the given position belongs too.

A voxel is a cuboid which surrounds a point on the grid.

      Voxel:
                     ______________ ____ (0.5, 0.5, 0.5)
                    /:            /|
                   / :           / |
                  /  :          /  |
                 /   :         /   |
               _/____:_ ___ __/    |
                |    :        |    |
                |    :    *<--|--------- grid point (0, 0, 0)
                |    :........|....|__
         dz == 1|   /         |   /
                |  /          |  / dy == 1
                | /           | /
               _|/____________|/__
                |<- dx == 1 ->|
         -0.5,-0.5,-0.5
       

Please note the first voxel has only 1/8 of the size a normal voxel would have since all positions outside the grid do not belong to any voxel. Note: a cell is different to a voxel in terms of position. A voxel has a grid point as center whereas a cell has grid points as corners.

Parameters:
posPosition for which we want to have the voxel number.
Returns:
Voxel number or -1 if the position refers to a point outside of the grid.

Definition at line 749 of file WGridRegular3D.h.

Referenced by WGridRegular3DTest::testGetVoxelNumberOfPositionExactlyBetweenVoxels().

template<typename T >
int WGridRegular3DTemplate< T >::getVoxelNum ( const size_t  x,
const size_t  y,
const size_t  z 
) const [inline]

returns the voxel index for a given discrete position in the grid

Parameters:
xPosition for which we want to have the voxel number.
yPosition for which we want to have the voxel number.
zPosition for which we want to have the voxel number.
Returns:
Voxel number or -1 if the position refers to a point outside of the grid.

Definition at line 775 of file WGridRegular3D.h.

template<typename T>
boost::shared_ptr< std::vector< typename WGridRegular3DTemplate< T >::Vector3Type > > WGridRegular3DTemplate< T >::getVoxelVertices ( const Vector3Type point,
const T  margin = 0.0 
) const

Computes the vertices for a voxel cuboid around the given point:

        z-axis  y-axis
        |      /
        | h___/_g
        |/:    /|
        d_:___c |
        | :...|.|
        |.e   | f
        |_____|/ ____x-axis
       a      b
       

As you can see the order of the points is: a, b, c, d, e, f, g, h.

Parameters:
pointCenter of the cuboid which must not necesarrily be a point of the grid.
marginIf you need to shrink the Voxel put here the delta > 0.
Returns:
Reference to a list of vertices which are the corner points of the cube. Note this must not be a voxel, but has the same size of the an voxel. If you need voxels at grid positions fill this function with voxel center positions aka grid points.

Definition at line 867 of file WGridRegular3D.h.

template<typename T>
int WGridRegular3DTemplate< T >::getXVoxelCoord ( const Vector3Type pos) const [inline]

Computes the X coordinate of that voxel that contains the position pos.

Parameters:
posThe position which selects the voxel for which the X coordinate is computed.
Returns:
The X coordinate or -1 if pos refers to point outside of the grid.

Definition at line 786 of file WGridRegular3D.h.

Referenced by WGridRegular3DTest::testRotatedVoxelNum(), and WGridRegular3DTest::testRotatedVoxelOutOfGrid().

template<typename T>
int WGridRegular3DTemplate< T >::getYVoxelCoord ( const Vector3Type pos) const [inline]

Computes the Y coordinate of that voxel that contains the position pos.

Parameters:
posThe position which selects the voxel for which the Y coordinate is computed.
Returns:
The Y coordinate or -1 if pos refers to point outside of the grid.

Definition at line 799 of file WGridRegular3D.h.

Referenced by WGridRegular3DTest::testRotatedVoxelNum(), and WGridRegular3DTest::testRotatedVoxelOutOfGrid().

template<typename T>
int WGridRegular3DTemplate< T >::getZVoxelCoord ( const Vector3Type pos) const [inline]

Computes the Z coordinate of that voxel that contains the position pos.

Parameters:
posThe position which selects the voxel for which the Z coordinate is computed.
Returns:
The Z coordinate or -1 if pos refers to point outside of the grid.

Definition at line 810 of file WGridRegular3D.h.

Referenced by WGridRegular3DTest::testRotatedVoxelNum(), and WGridRegular3DTest::testRotatedVoxelOutOfGrid().

template<typename T >
void WGridRegular3DTemplate< T >::initInformationProperties ( ) [private]

Adds the specific information of this grid type to the informational properties.

Definition at line 1256 of file WGridRegular3D.h.

Referenced by WGridRegular3DTemplate< T >::WGridRegular3DTemplate().

template<typename T >
bool WGridRegular3DTemplate< T >::isNotRotated ( ) const [inline]

Return whether the transformations of the grid are only translation and/or scaling.

Returns:
Transformation does not contain rotation?

Definition at line 1244 of file WGridRegular3D.h.

template<typename T >
bool WGridRegular3DTemplate< T >::operator== ( const WGridRegular3DTemplate< T > &  other) const

Compares two grids.

Matches the transform and x,y,z resolution.

Parameters:
otherthe one to compare against
Returns:
true if transform and resolution matches

Definition at line 1280 of file WGridRegular3D.h.

References WGridRegular3DTemplate< T >::getNbCoordsX(), WGridRegular3DTemplate< T >::getNbCoordsY(), WGridRegular3DTemplate< T >::getNbCoordsZ(), and WGridRegular3DTemplate< T >::m_transform.

template<typename T>
WGridRegular3DTemplate< T >::Vector3Type WGridRegular3DTemplate< T >::worldCoordToTexCoord ( Vector3Type  point) [inline]

Transforms world coordinates to texture coordinates.

Parameters:
pointThe point with these coordinates will be transformed.
Returns:
point transformed into texture coordinate system

Definition at line 731 of file WGridRegular3D.h.


Friends And Related Function Documentation

template<typename T>
friend class WGridRegular3DTest [friend]

Only test are allowed as friends.

Definition at line 68 of file WGridRegular3D.h.


Member Data Documentation

template<typename T>
unsigned int WGridRegular3DTemplate< T >::m_nbPosX [private]

Number of positions in x direction.

Definition at line 537 of file WGridRegular3D.h.

template<typename T>
unsigned int WGridRegular3DTemplate< T >::m_nbPosY [private]

Number of positions in y direction.

Definition at line 538 of file WGridRegular3D.h.

template<typename T>
unsigned int WGridRegular3DTemplate< T >::m_nbPosZ [private]

Number of positions in z direction.

Definition at line 539 of file WGridRegular3D.h.

template<typename T>
WGridTransformOrthoTemplate< T > const WGridRegular3DTemplate< T >::m_transform [private]

The grid's transformation.

Definition at line 542 of file WGridRegular3D.h.

Referenced by WGridRegular3DTemplate< T >::operator==().


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