[transform] rename ublas_transformer to matrix_transformer

This commit is contained in:
barendgehrels 2017-01-04 15:38:43 +01:00
parent 138879adb9
commit f334af7d78
5 changed files with 29 additions and 29 deletions

View File

@ -144,7 +144,7 @@ int main()
// Compose matrix for the two transformation
// Create transformer attached to the transformation matrix
ublas_transformer<double, 2, 2> combined(rotate.matrix() * translate.matrix());
matrix_transformer<double, 2, 2> combined(rotate.matrix() * translate.matrix());
// Apply transformation to subject geometry point-by-point
model::polygon<point_2d> g4;

View File

@ -37,7 +37,7 @@ template
std::size_t Dimension2
>
class inverse_transformer
: public ublas_transformer<CalculationType, Dimension1, Dimension2>
: public matrix_transformer<CalculationType, Dimension1, Dimension2>
{
public :
template <typename Transformer>

View File

@ -46,7 +46,7 @@ template
bool SameScale = true
>
class map_transformer
: public ublas_transformer<CalculationType, Dimension1, Dimension2>
: public matrix_transformer<CalculationType, Dimension1, Dimension2>
{
typedef boost::qvm::mat<CalculationType, Dimension1 + 1, Dimension2 + 1> M;
typedef boost::qvm::mat<CalculationType, 3, 3> matrix33;

View File

@ -56,13 +56,13 @@ template
std::size_t Dimension1,
std::size_t Dimension2
>
class ublas_transformer
class matrix_transformer
{
};
template <typename CalculationType>
class ublas_transformer<CalculationType, 2, 2>
class matrix_transformer<CalculationType, 2, 2>
{
protected :
typedef CalculationType ct;
@ -71,7 +71,7 @@ protected :
public :
inline ublas_transformer(
inline matrix_transformer(
ct const& m_0_0, ct const& m_0_1, ct const& m_0_2,
ct const& m_1_0, ct const& m_1_1, ct const& m_1_2,
ct const& m_2_0, ct const& m_2_1, ct const& m_2_2)
@ -81,12 +81,12 @@ public :
qvm::A<2,0>(m_matrix) = m_2_0; qvm::A<2,1>(m_matrix) = m_2_1; qvm::A<2,2>(m_matrix) = m_2_2;
}
inline ublas_transformer(matrix_type const& matrix)
inline matrix_transformer(matrix_type const& matrix)
: m_matrix(matrix)
{}
inline ublas_transformer() {}
inline matrix_transformer() {}
template <typename P1, typename P2>
inline bool apply(P1 const& p1, P2& p2) const
@ -113,29 +113,29 @@ public :
// It IS possible to go from 3 to 2 coordinates
template <typename CalculationType>
class ublas_transformer<CalculationType, 3, 2> : public ublas_transformer<CalculationType, 2, 2>
class matrix_transformer<CalculationType, 3, 2> : public matrix_transformer<CalculationType, 2, 2>
{
typedef CalculationType ct;
public :
inline ublas_transformer(
inline matrix_transformer(
ct const& m_0_0, ct const& m_0_1, ct const& m_0_2,
ct const& m_1_0, ct const& m_1_1, ct const& m_1_2,
ct const& m_2_0, ct const& m_2_1, ct const& m_2_2)
: ublas_transformer<CalculationType, 2, 2>(
: matrix_transformer<CalculationType, 2, 2>(
m_0_0, m_0_1, m_0_2,
m_1_0, m_1_1, m_1_2,
m_2_0, m_2_1, m_2_2)
{}
inline ublas_transformer()
: ublas_transformer<CalculationType, 2, 2>()
inline matrix_transformer()
: matrix_transformer<CalculationType, 2, 2>()
{}
};
template <typename CalculationType>
class ublas_transformer<CalculationType, 3, 3>
class matrix_transformer<CalculationType, 3, 3>
{
protected :
typedef CalculationType ct;
@ -143,7 +143,7 @@ protected :
matrix_type m_matrix;
public :
inline ublas_transformer(
inline matrix_transformer(
ct const& m_0_0, ct const& m_0_1, ct const& m_0_2, ct const& m_0_3,
ct const& m_1_0, ct const& m_1_1, ct const& m_1_2, ct const& m_1_3,
ct const& m_2_0, ct const& m_2_1, ct const& m_2_2, ct const& m_2_3,
@ -156,7 +156,7 @@ public :
qvm::A<3,0>(m_matrix) = m_3_0; qvm::A<3,1>(m_matrix) = m_3_1; qvm::A<3,2>(m_matrix) = m_3_2; qvm::A<3,3>(m_matrix) = m_3_3;
}
inline ublas_transformer() {}
inline matrix_transformer() {}
template <typename P1, typename P2>
inline bool apply(P1 const& p1, P2& p2) const
@ -201,7 +201,7 @@ class translate_transformer
template<typename CalculationType>
class translate_transformer<CalculationType, 2, 2> : public ublas_transformer<CalculationType, 2, 2>
class translate_transformer<CalculationType, 2, 2> : public matrix_transformer<CalculationType, 2, 2>
{
public :
// To have translate transformers compatible for 2/3 dimensions, the
@ -209,7 +209,7 @@ public :
inline translate_transformer(CalculationType const& translate_x,
CalculationType const& translate_y,
CalculationType const& = 0)
: ublas_transformer<CalculationType, 2, 2>(
: matrix_transformer<CalculationType, 2, 2>(
1, 0, translate_x,
0, 1, translate_y,
0, 0, 1)
@ -218,13 +218,13 @@ public :
template <typename CalculationType>
class translate_transformer<CalculationType, 3, 3> : public ublas_transformer<CalculationType, 3, 3>
class translate_transformer<CalculationType, 3, 3> : public matrix_transformer<CalculationType, 3, 3>
{
public :
inline translate_transformer(CalculationType const& translate_x,
CalculationType const& translate_y,
CalculationType const& translate_z)
: ublas_transformer<CalculationType, 3, 3>(
: matrix_transformer<CalculationType, 3, 3>(
1, 0, 0, translate_x,
0, 1, 0, translate_y,
0, 0, 1, translate_z,
@ -254,14 +254,14 @@ class scale_transformer
template <typename CalculationType>
class scale_transformer<CalculationType, 2, 2> : public ublas_transformer<CalculationType, 2, 2>
class scale_transformer<CalculationType, 2, 2> : public matrix_transformer<CalculationType, 2, 2>
{
public :
inline scale_transformer(CalculationType const& scale_x,
CalculationType const& scale_y,
CalculationType const& = 0)
: ublas_transformer<CalculationType, 2, 2>(
: matrix_transformer<CalculationType, 2, 2>(
scale_x, 0, 0,
0, scale_y, 0,
0, 0, 1)
@ -269,7 +269,7 @@ public :
inline scale_transformer(CalculationType const& scale)
: ublas_transformer<CalculationType, 2, 2>(
: matrix_transformer<CalculationType, 2, 2>(
scale, 0, 0,
0, scale, 0,
0, 0, 1)
@ -278,13 +278,13 @@ public :
template <typename CalculationType>
class scale_transformer<CalculationType, 3, 3> : public ublas_transformer<CalculationType, 3, 3>
class scale_transformer<CalculationType, 3, 3> : public matrix_transformer<CalculationType, 3, 3>
{
public :
inline scale_transformer(CalculationType const& scale_x,
CalculationType const& scale_y,
CalculationType const& scale_z)
: ublas_transformer<CalculationType, 3, 3>(
: matrix_transformer<CalculationType, 3, 3>(
scale_x, 0, 0, 0,
0, scale_y, 0, 0,
0, 0, scale_z, 0,
@ -293,7 +293,7 @@ public :
inline scale_transformer(CalculationType const& scale)
: ublas_transformer<CalculationType, 3, 3>(
: matrix_transformer<CalculationType, 3, 3>(
scale, 0, 0, 0,
0, scale, 0, 0,
0, 0, scale, 0,
@ -342,11 +342,11 @@ template
std::size_t Dimension2
>
class rad_rotate_transformer
: public ublas_transformer<CalculationType, Dimension1, Dimension2>
: public matrix_transformer<CalculationType, Dimension1, Dimension2>
{
public :
inline rad_rotate_transformer(CalculationType const& angle)
: ublas_transformer<CalculationType, Dimension1, Dimension2>(
: matrix_transformer<CalculationType, Dimension1, Dimension2>(
cos(angle), sin(angle), 0,
-sin(angle), cos(angle), 0,
0, 0, 1)

View File

@ -518,7 +518,7 @@ inline T scaled_epsilon(T const& value)
}
// Maybe replace this by boost equals or boost ublas numeric equals or so
// Maybe replace this by boost equals or so
/*!
\brief returns true if both arguments are equal.