OpenWalnut  1.2.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Types | Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
WGridRegular3D Class Reference

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

#include <WGridRegular3D.h>

+ Inheritance diagram for WGridRegular3D:

Public Types

typedef boost::shared_ptr
< WGridRegular3D
SPtr
 Convenience typedef for a boost::shared_ptr< WGridRegular3D >.
typedef boost::shared_ptr
< const WGridRegular3D
ConstSPtr
 Convenience typedef for a boost::shared_ptr< const WGridRegular3D >.

Public Member Functions

 WGridRegular3D (unsigned int nbPosX, unsigned int nbPosY, unsigned int nbPosZ, WGridTransformOrtho const transform=WGridTransformOrtho())
 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.
double getOffsetX () const
 Returns the distance between samples in x direction.
double getOffsetY () const
 Returns the distance between samples in y direction.
double getOffsetZ () const
 Returns the distance between samples in z direction.
WVector3d getDirectionX () const
 Returns the vector determining the direction of samples in x direction.
WVector3d getDirectionY () const
 Returns the vector determining the direction of samples in y direction.
WVector3d getDirectionZ () const
 Returns the vector determining the direction of samples in z direction.
WVector3d getUnitDirectionX () const
 Returns the vector determining the unit (normalized) direction of samples in x direction.
WVector3d getUnitDirectionY () const
 Returns the vector determining the unit (normalized) direction of samples in y direction.
WVector3d getUnitDirectionZ () const
 Returns the vector determining the unit (normalized) direction of samples in z direction.
WPosition getOrigin () const
 Returns the position of the origin of the grid.
WMatrix< double > getTransformationMatrix () const
 Returns a 4x4 matrix that represents the grid's transformation.
WBoundingBox getBoundingBox () const
 Axis aligned Bounding Box that encloses this grid.
WPosition getPosition (unsigned int i) const
 Returns the i-th position on the grid.
WPosition 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.
WVector3d worldCoordToTexCoord (WPosition point)
 Transforms world coordinates to texture coordinates.
WPosition texCoordToWorldCoord (WVector3d coords)
 Transforms texture coordinates to world coordinates.
int getVoxelNum (const WPosition &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 WPosition &pos) const
 Computes the X coordinate of that voxel that contains the position pos.
int getYVoxelCoord (const WPosition &pos) const
 Computes the Y coordinate of that voxel that contains the position pos.
int getZVoxelCoord (const WPosition &pos) const
 Computes the Z coordinate of that voxel that contains the position pos.
int getXVoxelCoordRotated (const WPosition &pos) const
 Computes the X coordinate of that voxel that contains the position pos.
int getYVoxelCoordRotated (const WPosition &pos) const
 Computes the Y coordinate of that voxel that contains the position pos.
int getZVoxelCoordRotated (const WPosition &pos) const
 Computes the Z coordinate of that voxel that contains the position pos.
WValue< int > getVoxelCoord (const WPosition &pos) const
 Computes the voxel coordinates of that voxel which contains the position pos.
size_t getCellId (const WPosition &pos, bool *success) const
 Computes the id of the cell containing the position pos.
std::vector< size_t > getCellVertexIds (const size_t cellId) const
 Computes the ids of the vertices of a cell given by its id.
boost::shared_ptr< std::vector
< WPosition > > 
getVoxelVertices (const WPosition &point, const double margin=0.0) const
 Computes the vertices for a voxel cuboid around the given point:
std::vector< size_t > getNeighbours (size_t id) const
 Return the list of neighbour voxels.
std::vector< size_t > getNeighbours27 (size_t id) const
 Return the list of all neighbour voxels.
std::vector< size_t > getNeighbours9XY (size_t id) const
 Return the list of all neighbour voxels.
std::vector< size_t > getNeighbours9YZ (size_t id) const
 Return the list of all neighbour voxels.
std::vector< size_t > getNeighbours9XZ (size_t id) const
 Return the list of all neighbour voxels.
bool encloses (const WPosition &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.
WGridTransformOrtho const getTransform () const
 Returns the transformation used by this grid.
- Public Member Functions inherited from WGrid
 WGrid (size_t size)
 Constructs a new WGrid instance.
virtual ~WGrid ()
 Since WGrid is a base class and thus should be polymorphic we add virtual destructor.
size_t size () const
 The number of positions in this grid.
boost::shared_ptr< WPropertiesgetInformationProperties () const
 Returns a pointer to the information properties object of the grid.

Private Member Functions

int getNVoxelCoord (const WPosition &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.
WGridTransformOrtho const m_transform
 The grid's transformation.

Friends

class WGridRegular3DTest
 Only test are allowed as friends.

Additional Inherited Members

- Protected Attributes inherited from WGrid
boost::shared_ptr< WPropertiesm_infoProperties
 The property object for the grid containing only props whose purpose is "PV_PURPOSE_INFORMNATION".

Detailed Description

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 54 of file WGridRegular3D.h.

Member Typedef Documentation

typedef boost::shared_ptr< const WGridRegular3D > WGridRegular3D::ConstSPtr

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

Definition at line 69 of file WGridRegular3D.h.

typedef boost::shared_ptr< WGridRegular3D > WGridRegular3D::SPtr

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

Definition at line 64 of file WGridRegular3D.h.

Constructor & Destructor Documentation

WGridRegular3D::WGridRegular3D ( unsigned int  nbPosX,
unsigned int  nbPosY,
unsigned int  nbPosZ,
WGridTransformOrtho const  transform = WGridTransformOrtho() 
)

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 38 of file WGridRegular3D.cpp.

References initInformationProperties().

Member Function Documentation

bool WGridRegular3D::encloses ( const WPosition pos) const

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 517 of file WGridRegular3D.cpp.

References m_nbPosX, m_nbPosY, m_nbPosZ, m_transform, and WGridTransformOrtho::positionToGridSpace().

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

WBoundingBox WGridRegular3D::getBoundingBox ( ) const
virtual

Axis aligned Bounding Box that encloses this grid.

Returns
Axis aligned Bounding Box that encloses this grid.

Implements WGrid.

Definition at line 536 of file WGridRegular3D.cpp.

References WBoundingBoxImpl< VT >::expandBy(), getNbCoordsX(), getNbCoordsY(), getNbCoordsZ(), m_transform, and WGridTransformOrtho::positionToWorldSpace().

size_t WGridRegular3D::getCellId ( const WPosition pos,
bool *  success 
) const

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 171 of file WGridRegular3D.cpp.

References getOffsetX(), getOffsetY(), getOffsetZ(), getOrigin(), isNotRotated(), m_nbPosX, m_nbPosY, and m_nbPosZ.

Referenced by WGridRegular3DTest::testGetCellId().

std::vector< size_t > WGridRegular3D::getCellVertexIds ( const size_t  cellId) const

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 186 of file WGridRegular3D.cpp.

References m_nbPosX, and m_nbPosY.

Referenced by WGridRegular3DTest::testGetCellVertexIds().

WVector3d WGridRegular3D::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 607 of file WGridRegular3D.h.

References WGridTransformOrtho::getDirectionX(), and m_transform.

Referenced by WGridRegular3DTest::testOrientation().

WVector3d WGridRegular3D::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 612 of file WGridRegular3D.h.

References WGridTransformOrtho::getDirectionY(), and m_transform.

Referenced by WGridRegular3DTest::testOrientation().

WVector3d WGridRegular3D::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 617 of file WGridRegular3D.h.

References WGridTransformOrtho::getDirectionZ(), and m_transform.

Referenced by WGridRegular3DTest::testOrientation().

unsigned int WGridRegular3D::getNbCoordsX ( ) const
inline
unsigned int WGridRegular3D::getNbCoordsY ( ) const
inline

Returns the number of samples in y direction.

Returns
The number of samples in y direction.

Definition at line 567 of file WGridRegular3D.h.

References m_nbPosY.

Referenced by getBoundingBox(), initInformationProperties(), and WGridRegular3DTest::testGetNbCoords().

unsigned int WGridRegular3D::getNbCoordsZ ( ) const
inline

Returns the number of samples in z direction.

Returns
The number of samples in z direction.

Definition at line 572 of file WGridRegular3D.h.

References m_nbPosZ.

Referenced by getBoundingBox(), initInformationProperties(), and WGridRegular3DTest::testGetNbCoords().

std::vector< size_t > WGridRegular3D::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 226 of file WGridRegular3D.cpp.

References m_nbPosX, m_nbPosY, and m_nbPosZ.

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

std::vector< size_t > WGridRegular3D::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 270 of file WGridRegular3D.cpp.

References getVoxelNum(), m_nbPosX, m_nbPosY, and m_nbPosZ.

std::vector< size_t > WGridRegular3D::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 329 of file WGridRegular3D.cpp.

References getVoxelNum(), m_nbPosX, m_nbPosY, and m_nbPosZ.

std::vector< size_t > WGridRegular3D::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 454 of file WGridRegular3D.cpp.

References getVoxelNum(), m_nbPosX, m_nbPosY, and m_nbPosZ.

std::vector< size_t > WGridRegular3D::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 391 of file WGridRegular3D.cpp.

References getVoxelNum(), m_nbPosX, m_nbPosY, and m_nbPosZ.

int WGridRegular3D::getNVoxelCoord ( const WPosition 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
double WGridRegular3D::getOffsetX ( ) const
inline

Returns the distance between samples in x direction.

Returns
The distance between samples in x direction.

Definition at line 577 of file WGridRegular3D.h.

References WGridTransformOrtho::getOffsetX(), and m_transform.

Referenced by getCellId(), getVoxelVertices(), initInformationProperties(), and WGridRegular3DTest::testGetVectorOffset().

double WGridRegular3D::getOffsetY ( ) const
inline

Returns the distance between samples in y direction.

Returns
The distance between samples in y direction.

Definition at line 582 of file WGridRegular3D.h.

References WGridTransformOrtho::getOffsetY(), and m_transform.

Referenced by getCellId(), getVoxelVertices(), initInformationProperties(), and WGridRegular3DTest::testGetVectorOffset().

double WGridRegular3D::getOffsetZ ( ) const
inline

Returns the distance between samples in z direction.

Returns
The distance between samples in z direction.

Definition at line 587 of file WGridRegular3D.h.

References WGridTransformOrtho::getOffsetZ(), and m_transform.

Referenced by getCellId(), getVoxelVertices(), initInformationProperties(), and WGridRegular3DTest::testGetVectorOffset().

WPosition WGridRegular3D::getOrigin ( ) const
inline

Returns the position of the origin of the grid.

Returns
The position of the origin of the grid.

Definition at line 622 of file WGridRegular3D.h.

References WGridTransformOrtho::getOrigin(), and m_transform.

Referenced by getCellId(), and WGridRegular3DTest::testOrientation().

WPosition WGridRegular3D::getPosition ( unsigned int  i) const

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 49 of file WGridRegular3D.cpp.

References m_nbPosX, and m_nbPosY.

Referenced by WGridRegular3DTest::testGetPositionScalarOffset().

WPosition WGridRegular3D::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.

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 54 of file WGridRegular3D.cpp.

References m_transform, and WGridTransformOrtho::positionToWorldSpace().

WGridTransformOrtho const WGridRegular3D::getTransform ( ) const
inline

Returns the transformation used by this grid.

Returns
The transformation.

Definition at line 627 of file WGridRegular3D.h.

References m_transform.

Referenced by initInformationProperties().

WMatrix< double > WGridRegular3D::getTransformationMatrix ( ) const
inline

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

Returns
The grid's transformation.

Definition at line 632 of file WGridRegular3D.h.

References WGridTransformOrtho::getTransformationMatrix(), and m_transform.

WVector3d WGridRegular3D::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 592 of file WGridRegular3D.h.

References WGridTransformOrtho::getUnitDirectionX(), and m_transform.

WVector3d WGridRegular3D::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 597 of file WGridRegular3D.h.

References WGridTransformOrtho::getUnitDirectionY(), and m_transform.

WVector3d WGridRegular3D::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 602 of file WGridRegular3D.h.

References WGridTransformOrtho::getUnitDirectionZ(), and m_transform.

WValue< int > WGridRegular3D::getVoxelCoord ( const WPosition pos) const

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 157 of file WGridRegular3D.cpp.

References getXVoxelCoord(), getYVoxelCoord(), and getZVoxelCoord().

int WGridRegular3D::getVoxelNum ( const WPosition pos) const

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 77 of file WGridRegular3D.cpp.

References getXVoxelCoord(), getYVoxelCoord(), getZVoxelCoord(), m_nbPosX, and m_nbPosY.

Referenced by getNeighbours27(), getNeighbours9XY(), getNeighbours9XZ(), getNeighbours9YZ(), and WGridRegular3DTest::testGetVoxelNumberOfPositionExactlyBetweenVoxels().

int WGridRegular3D::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

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 102 of file WGridRegular3D.cpp.

References m_nbPosX, m_nbPosY, and m_nbPosZ.

boost::shared_ptr< std::vector< WPosition > > WGridRegular3D::getVoxelVertices ( const WPosition point,
const double  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 207 of file WGridRegular3D.cpp.

References getOffsetX(), getOffsetY(), and getOffsetZ().

int WGridRegular3D::getXVoxelCoord ( const WPosition pos) const

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 125 of file WGridRegular3D.cpp.

References m_nbPosX, m_transform, and WGridTransformOrtho::positionToGridSpace().

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

int WGridRegular3D::getXVoxelCoordRotated ( const WPosition pos) const

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

Works on rotated grids.

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.
int WGridRegular3D::getYVoxelCoord ( const WPosition pos) const

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 137 of file WGridRegular3D.cpp.

References m_nbPosY, m_transform, and WGridTransformOrtho::positionToGridSpace().

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

int WGridRegular3D::getYVoxelCoordRotated ( const WPosition pos) const

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

Works on rotated grids.

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.
int WGridRegular3D::getZVoxelCoord ( const WPosition pos) const

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 147 of file WGridRegular3D.cpp.

References m_nbPosZ, m_transform, and WGridTransformOrtho::positionToGridSpace().

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

int WGridRegular3D::getZVoxelCoordRotated ( const WPosition pos) const

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

Works on rotated grids.

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.
void WGridRegular3D::initInformationProperties ( )
private

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

Definition at line 113 of file WGridRegular3D.cpp.

References getNbCoordsX(), getNbCoordsY(), getNbCoordsZ(), getOffsetX(), getOffsetY(), getOffsetZ(), getTransform(), and WGrid::m_infoProperties.

Referenced by WGridRegular3D().

bool WGridRegular3D::isNotRotated ( ) const

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

Returns
Transformation does not contain rotation?

Definition at line 166 of file WGridRegular3D.cpp.

References WGridTransformOrtho::isNotRotated(), and m_transform.

Referenced by getCellId().

WPosition WGridRegular3D::texCoordToWorldCoord ( WVector3d  coords)

Transforms texture coordinates to world coordinates.

Parameters
coordsThe point with these coordinates will be transformed.
Returns
coords transformed into world coordinate system.
WVector3d WGridRegular3D::worldCoordToTexCoord ( WPosition  point)

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 60 of file WGridRegular3D.cpp.

References m_nbPosX, m_nbPosY, m_nbPosZ, m_transform, and WGridTransformOrtho::positionToGridSpace().

Friends And Related Function Documentation

friend class WGridRegular3DTest
friend

Only test are allowed as friends.

Definition at line 59 of file WGridRegular3D.h.

Member Data Documentation

unsigned int WGridRegular3D::m_nbPosX
private
unsigned int WGridRegular3D::m_nbPosY
private
unsigned int WGridRegular3D::m_nbPosZ
private
WGridTransformOrtho const WGridRegular3D::m_transform
private

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