soma-io 6.0.6
soma::AffineTransformationBase Class Reference

#include <soma-io/transformation/affinetransformation3d_base.h>

Inheritance diagram for soma::AffineTransformationBase:
Collaboration diagram for soma::AffineTransformationBase:

Classes

class  Table
 

Public Member Functions

 AffineTransformationBase (int order=3)
 
 AffineTransformationBase (const AffineTransformationBase &other)
 
 AffineTransformationBase (const std::vector< float > &mat)
 Create a AffineTransformation3d from a matrix given as a line vector.
 
 AffineTransformationBase (const carto::Object mat)
 Create a AffineTransformation from a NxN matrix given as a line vector in an Object.
 
virtual ~AffineTransformationBase ()
 
virtual AffineTransformationBaseoperator= (const AffineTransformationBase &other)
 
virtual AffineTransformationBaseoperator= (const std::vector< float > &mat)
 
virtual AffineTransformationBaseoperator= (const carto::Object mat)
 
virtual bool operator== (const AffineTransformationBase &) const
 
AffineTransformationBaseoperator*= (const AffineTransformationBase &trans)
 
AffineTransformationBase operator- () const
 
void negate ()
 
bool isIdentity () const CARTO_OVERRIDE
 Test if the transformation can safely be omitted.
 
virtual void setToIdentity ()
 
bool isDirect () const override
 true if the transformation is direct, false if it changes orientation
 
bool invertible () const CARTO_OVERRIDE
 Test if the transformation can be inverted.
 
std::unique_ptr< AffineTransformationBaseinverse () const
 
std::unique_ptr< TransformationgetInverse () const CARTO_OVERRIDE
 Obtain the inverse transformation.
 
int order () const
 
virtual void extendOrder (unsigned n)
 
virtual void squeezeOrder (unsigned n, bool check=true, bool notify_fail=true)
 
virtual std::vector< double > transform (const std::vector< double > &pos) const
 
virtual std::vector< float > transform (const std::vector< float > &pos) const
 
virtual std::vector< int > transform (const std::vector< int > &pos) const
 
Table< float > & matrix ()
 
const Table< float > & matrix () const
 
std::vector< float > toVector () const
 conversions and IO)
 
std::vector< float > toColumnVector () const
 transform AffineTransformation3d to a column vector (useful for conversions to OpenGL matrices)
 
void fromColumnVector (const std::vector< float > &vec)
 transform a column vector to an AffineTransformation3d (useful for conversions from OpenGL matrices)
 
void fromColumnVector (const float *vec, unsigned size)
 transform a column vector to an AffineTransformation3d (useful for conversions from OpenGL matrices)
 
- Public Member Functions inherited from soma::Transformation
virtual ~Transformation ()
 
virtual Transformationoperator= (const Transformation &other)
 
carto::Object header ()
 
const carto::Object header () const
 
void setHeader (carto::Object ph)
 
virtual std::vector< double > transformVector (const std::vector< double > &pos) const
 
virtual std::vector< float > transformVector (const std::vector< float > &pos) const
 
virtual std::vector< int > transformVector (const std::vector< int > &pos) const
 
- Public Member Functions inherited from carto::RCObject
 RCObject ()
 
 RCObject (const RCObject &)
 
RCObjectoperator= (const RCObject &)
 
virtual ~RCObject ()
 

Static Public Attributes

static float epsilon
 used to test equality on elements
 

Protected Attributes

Table< float > _matrix
 
- Protected Attributes inherited from soma::Transformation
carto::Object _header
 

Additional Inherited Members

- Public Types inherited from carto::RCObject
typedef int RefCounterType
 
- Static Public Member Functions inherited from soma::Transformation
template<typename T>
static std::vector< T > vadd (const std::vector< T > &v1, const std::vector< T > &v2)
 vector arithmetics, as convenience static functions
 
template<typename T>
static std::vector< T > vsub (const std::vector< T > &v1, const std::vector< T > &v2)
 vector arithmetics, as convenience static functions
 
template<typename T>
static std::vector< T > vadd (const std::vector< T > &v1, const T &v2)
 vector arithmetics, as convenience static functions
 
template<typename T>
static std::vector< T > vsub (const std::vector< T > &v1, const T &v2)
 vector arithmetics, as convenience static functions
 
template<typename T>
static std::vector< T > vadd (const T &v1, const std::vector< T > &v2)
 vector arithmetics, as convenience static functions
 
template<typename T>
static std::vector< T > vsub (const T &v1, const std::vector< T > &v2)
 vector arithmetics, as convenience static functions
 
- Protected Member Functions inherited from soma::Transformation
 Transformation ()
 

Detailed Description

Definition at line 47 of file affinetransformation3d_base.h.

Constructor & Destructor Documentation

◆ AffineTransformationBase() [1/4]

soma::AffineTransformationBase::AffineTransformationBase ( int order = 3)

◆ AffineTransformationBase() [2/4]

soma::AffineTransformationBase::AffineTransformationBase ( const AffineTransformationBase & other)

◆ AffineTransformationBase() [3/4]

soma::AffineTransformationBase::AffineTransformationBase ( const std::vector< float > & mat)

Create a AffineTransformation3d from a matrix given as a line vector.

◆ AffineTransformationBase() [4/4]

soma::AffineTransformationBase::AffineTransformationBase ( const carto::Object mat)

Create a AffineTransformation from a NxN matrix given as a line vector in an Object.

◆ ~AffineTransformationBase()

virtual soma::AffineTransformationBase::~AffineTransformationBase ( )
virtual

Member Function Documentation

◆ extendOrder()

virtual void soma::AffineTransformationBase::extendOrder ( unsigned n)
virtual

◆ fromColumnVector() [1/2]

void soma::AffineTransformationBase::fromColumnVector ( const float * vec,
unsigned size )

transform a column vector to an AffineTransformation3d (useful for conversions from OpenGL matrices)

◆ fromColumnVector() [2/2]

void soma::AffineTransformationBase::fromColumnVector ( const std::vector< float > & vec)
inline

transform a column vector to an AffineTransformation3d (useful for conversions from OpenGL matrices)

Definition at line 143 of file affinetransformation3d_base.h.

References fromColumnVector().

Referenced by fromColumnVector().

◆ getInverse()

std::unique_ptr< Transformation > soma::AffineTransformationBase::getInverse ( ) const
virtual

Obtain the inverse transformation.

This method should only be called if invertible() returns true. Otherwise, it will throw an exception if the transformation is not actually invertible.

Reimplemented from soma::Transformation.

References getInverse(), and soma::Transformation::Transformation().

Referenced by getInverse().

◆ inverse()

std::unique_ptr< AffineTransformationBase > soma::AffineTransformationBase::inverse ( ) const

References AffineTransformationBase(), and inverse().

Referenced by inverse().

◆ invertible()

bool soma::AffineTransformationBase::invertible ( ) const
virtual

Test if the transformation can be inverted.

getInverse() can be called if this method returns true, in order to obtain the inverse transformation.

Reimplemented from soma::Transformation.

References invertible().

Referenced by invertible().

◆ isDirect()

bool soma::AffineTransformationBase::isDirect ( ) const
overridevirtual

true if the transformation is direct, false if it changes orientation

Implements soma::Transformation.

References isDirect().

Referenced by isDirect().

◆ isIdentity()

bool soma::AffineTransformationBase::isIdentity ( ) const
virtual

Test if the transformation can safely be omitted.

This method returns true only if the transformation behaves exactly like an identity transformation (notably, the transform methods will always return the input coordinates unchanged).

Note
{Implementors of derived classes may choose to always return false if a test would be difficult to implement or expensive to run. As a result, a false result does not guarantee in general that the transformation is different from identity.}

Reimplemented from soma::Transformation.

◆ matrix() [1/2]

Table< float > & soma::AffineTransformationBase::matrix ( )
inline

Definition at line 133 of file affinetransformation3d_base.h.

References _matrix.

◆ matrix() [2/2]

const Table< float > & soma::AffineTransformationBase::matrix ( ) const
inline

Definition at line 134 of file affinetransformation3d_base.h.

References _matrix.

◆ negate()

void soma::AffineTransformationBase::negate ( )

◆ operator*=()

AffineTransformationBase & soma::AffineTransformationBase::operator*= ( const AffineTransformationBase & trans)

◆ operator-()

AffineTransformationBase soma::AffineTransformationBase::operator- ( ) const

◆ operator=() [1/3]

virtual AffineTransformationBase & soma::AffineTransformationBase::operator= ( const AffineTransformationBase & other)
virtual

◆ operator=() [2/3]

virtual AffineTransformationBase & soma::AffineTransformationBase::operator= ( const carto::Object mat)
virtual

◆ operator=() [3/3]

virtual AffineTransformationBase & soma::AffineTransformationBase::operator= ( const std::vector< float > & mat)
virtual

◆ operator==()

virtual bool soma::AffineTransformationBase::operator== ( const AffineTransformationBase & ) const
virtual

◆ order()

int soma::AffineTransformationBase::order ( ) const
inline

Definition at line 120 of file affinetransformation3d_base.h.

References _matrix, and order().

Referenced by AffineTransformationBase(), and order().

◆ setToIdentity()

virtual void soma::AffineTransformationBase::setToIdentity ( )
virtual

Reimplemented in soma::AffineTransformation3dBase.

References setToIdentity().

Referenced by setToIdentity().

◆ squeezeOrder()

virtual void soma::AffineTransformationBase::squeezeOrder ( unsigned n,
bool check = true,
bool notify_fail = true )
virtual

◆ toColumnVector()

std::vector< float > soma::AffineTransformationBase::toColumnVector ( ) const

transform AffineTransformation3d to a column vector (useful for conversions to OpenGL matrices)

◆ toVector()

std::vector< float > soma::AffineTransformationBase::toVector ( ) const

conversions and IO)

◆ transform() [1/3]

virtual std::vector< double > soma::AffineTransformationBase::transform ( const std::vector< double > & pos) const
virtual

◆ transform() [2/3]

virtual std::vector< float > soma::AffineTransformationBase::transform ( const std::vector< float > & pos) const
inlinevirtual

Reimplemented from soma::Transformation.

Reimplemented in soma::AffineTransformation3dBase.

Definition at line 128 of file affinetransformation3d_base.h.

References soma::Transformation::transform().

◆ transform() [3/3]

virtual std::vector< int > soma::AffineTransformationBase::transform ( const std::vector< int > & pos) const
inlinevirtual

Reimplemented from soma::Transformation.

Reimplemented in soma::AffineTransformation3dBase.

Definition at line 130 of file affinetransformation3d_base.h.

References soma::Transformation::transform().

Member Data Documentation

◆ _matrix

Table<float> soma::AffineTransformationBase::_matrix
protected

Definition at line 158 of file affinetransformation3d_base.h.

Referenced by matrix(), matrix(), and order().

◆ epsilon

float soma::AffineTransformationBase::epsilon
static

used to test equality on elements

Definition at line 152 of file affinetransformation3d_base.h.


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