Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::SpatialCoordinateTransformer Class Referenceabstract
Inheritance diagram for inviwo::SpatialCoordinateTransformer:

Public Member Functions

virtual SpatialCoordinateTransformer * clone () const =0
virtual glm::mat4 getDataToModelMatrix () const =0
virtual glm::mat4 getDataToWorldMatrix () const =0
glm::mat3 getInverseMetricTensor () const
 Computes the inverse metric tensor for the dataToWorld basis. This it useful for gradient computation.
virtual glm::mat4 getMatrix (CoordinateSpace from, CoordinateSpace to) const
glm::mat3 getMetricTensor () const
 Computes the metric tensor for the dataToWorld basis.
virtual glm::mat4 getModelToDataMatrix () const =0
virtual glm::mat4 getModelToWorldMatrix () const =0
virtual glm::mat4 getWorldToDataMatrix () const =0
virtual glm::mat4 getWorldToModelMatrix () const =0
virtual glm::vec3 transformNormal (const vec3 &normal, CoordinateSpace from, CoordinateSpace to) const
virtual glm::vec3 transformPosition (const vec3 &pos, CoordinateSpace from, CoordinateSpace to) const
virtual glm::vec4 transformPositionHomogeneous (const vec4 &pos, CoordinateSpace from, CoordinateSpace to) const

Static Public Member Functions

static glm::mat3 getMetricTensor (glm::mat3 basis)
 Computes the metric tensor g_ij from a set of basis vectors.

Protected Member Functions

SpatialCoordinateTransformer & operator= (const SpatialCoordinateTransformer &)=delete
SpatialCoordinateTransformer & operator= (SpatialCoordinateTransformer &&)=delete
 SpatialCoordinateTransformer (const SpatialCoordinateTransformer &)=default
 SpatialCoordinateTransformer (SpatialCoordinateTransformer &&)=delete

Member Function Documentation

◆ getDataToModelMatrix()

virtual glm::mat4 inviwo::SpatialCoordinateTransformer::getDataToModelMatrix ( ) const
pure virtual

Returns the matrix transformation mapping from raw data numbers to model space coordinates, i.e. from generally (-inf, inf), ([0,1] for textures) to (data min, data max)

Implemented in inviwo::SpatialCameraCoordinateTransformerImpl, inviwo::SpatialCoordinateTransformerImpl, inviwo::StructuredCameraCoordinateTransformerImpl< N >, and inviwo::StructuredCoordinateTransformerImpl< N >.

◆ getDataToWorldMatrix()

virtual glm::mat4 inviwo::SpatialCoordinateTransformer::getDataToWorldMatrix ( ) const
pure virtual

Returns the matrix transformation mapping from raw data numbers to world space coordinates, i.e. from generally (-inf, inf), ([0,1] for textures) to (-inf, inf)

Implemented in inviwo::SpatialCameraCoordinateTransformerImpl, inviwo::SpatialCoordinateTransformerImpl, inviwo::StructuredCameraCoordinateTransformerImpl< N >, and inviwo::StructuredCoordinateTransformerImpl< N >.

◆ getInverseMetricTensor()

glm::mat3 inviwo::SpatialCoordinateTransformer::getInverseMetricTensor ( ) const

Computes the inverse metric tensor for the dataToWorld basis. This it useful for gradient computation.

The gradient ∇f in world space is then computed based on the partial derivatives in u and v direction ∇f = g_11 ∂f/∂u a_1 + g_12 ∂f/∂u a_2 + g_21 ∂f/∂v a_1 + g_22 ∂f/∂v a_2, where g_ij refers to the inverse metric tensor and a_i to the ith basis vector.

Returns
inverse metric tensor

◆ getMatrix()

virtual glm::mat4 inviwo::SpatialCoordinateTransformer::getMatrix ( CoordinateSpace from,
CoordinateSpace to ) const
virtual

Returns the matrix transformation mapping from from coordinates to to coordinates

Reimplemented in inviwo::SpatialCameraCoordinateTransformer, inviwo::StructuredCameraCoordinateTransformer, and inviwo::StructuredCoordinateTransformer.

◆ getMetricTensor()

glm::mat3 inviwo::SpatialCoordinateTransformer::getMetricTensor ( glm::mat3 basis)
static

Computes the metric tensor g_ij from a set of basis vectors.

The metric tensor is defined as:

g_ij = dot(a_i, a_j)

where a_i are the basis vectors of the coordinate system.

Parameters
basisA 3×3 matrix whose columns contain the basis vectors of the coordinate system expressed in Cartesian coordinates.
Returns
A 3×3 symmetric matrix containing the metric tensor g_ij.

◆ getModelToDataMatrix()

virtual glm::mat4 inviwo::SpatialCoordinateTransformer::getModelToDataMatrix ( ) const
pure virtual

Returns the matrix transformation mapping from model space coordinates to raw data numbers, i.e. from (data min, data max) to generally (-inf, inf), ([0,1] for textures)

Implemented in inviwo::SpatialCameraCoordinateTransformerImpl, inviwo::SpatialCoordinateTransformerImpl, inviwo::StructuredCameraCoordinateTransformerImpl< N >, and inviwo::StructuredCoordinateTransformerImpl< N >.

◆ getModelToWorldMatrix()

virtual glm::mat4 inviwo::SpatialCoordinateTransformer::getModelToWorldMatrix ( ) const
pure virtual

Returns the matrix transformation mapping from model space coordinates to world space coordinates, i.e. from (data min, data max) to (-inf, inf)

Implemented in inviwo::SpatialCameraCoordinateTransformerImpl, inviwo::SpatialCoordinateTransformerImpl, inviwo::StructuredCameraCoordinateTransformerImpl< N >, and inviwo::StructuredCoordinateTransformerImpl< N >.

◆ getWorldToDataMatrix()

virtual glm::mat4 inviwo::SpatialCoordinateTransformer::getWorldToDataMatrix ( ) const
pure virtual

Returns the matrix transformation mapping from world space coordinates to raw data numbers, i.e. from (-inf, inf) to generally (-inf, inf), ([0,1] for textures)

Implemented in inviwo::SpatialCameraCoordinateTransformerImpl, inviwo::SpatialCoordinateTransformerImpl, inviwo::StructuredCameraCoordinateTransformerImpl< N >, and inviwo::StructuredCoordinateTransformerImpl< N >.

◆ getWorldToModelMatrix()

virtual glm::mat4 inviwo::SpatialCoordinateTransformer::getWorldToModelMatrix ( ) const
pure virtual

Returns the matrix transformation mapping from world space coordinates to model space coordinates, i.e. from (-inf, inf) to (data min, data max)

Implemented in inviwo::SpatialCameraCoordinateTransformerImpl, inviwo::SpatialCoordinateTransformerImpl, inviwo::StructuredCameraCoordinateTransformerImpl< N >, and inviwo::StructuredCoordinateTransformerImpl< N >.

◆ transformNormal()

virtual glm::vec3 inviwo::SpatialCoordinateTransformer::transformNormal ( const vec3 & normal,
CoordinateSpace from,
CoordinateSpace to ) const
virtual

Transforms the given normal from from coordinates to to coordinates. Only considers transformations between supported by this SpatialCoordinateTransformer. That is Data to Model, Model to World, Data to World and their inverse, camera or index coordinates are not supported.

◆ transformPosition()

virtual glm::vec3 inviwo::SpatialCoordinateTransformer::transformPosition ( const vec3 & pos,
CoordinateSpace from,
CoordinateSpace to ) const
virtual

Transforms the given position pos from from coordinates to to coordinates. The resulting position is divided by w.

◆ transformPositionHomogeneous()

virtual glm::vec4 inviwo::SpatialCoordinateTransformer::transformPositionHomogeneous ( const vec4 & pos,
CoordinateSpace from,
CoordinateSpace to ) const
virtual

Transforms the given position pos from from coordinates to to coordinates using homogeneous coordinates


The documentation for this class was generated from the following file:
  • include/inviwo/core/datastructures/coordinatetransformer.h