aimstil  5.0.5
scaling.h
Go to the documentation of this file.
1 #ifndef TIL_SCALING_H
2 #define TIL_SCALING_H
3 
4 // includes from TIL library
5 #include "til/til_common.h"
6 #include "til/til_declarations.h"
7 #include "til/traits.h"
8 
9 namespace til {
10 
12  //namespace linalg {
13 
16  template < typename T >
17  class Scaling
18  {
19  public: // constructors & destructor
20 
21  Scaling() {}
22  Scaling(const numeric_array<T,3> &scale, const numeric_array<T,3> &transl)
23  : m_scale(scale), m_transl(transl) {}
24 
25 
26  public: // set & get
27 
28  const numeric_array<T,3> & getScale() const { return m_scale; }
29  const numeric_array<T,3> & getTransl() const { return m_transl; }
30  numeric_array<T,3> & getScale() { return m_scale; }
31  numeric_array<T,3> & getTransl() { return m_transl; }
32 
33  void setScale(const numeric_array<T,3> &scale) { m_scale = scale; }
34  void setTransl(const numeric_array<T,3> &transl) { m_transl = transl; }
35 
36 
37  private: // data
38 
39  numeric_array<T,3> m_scale;
40  numeric_array<T,3> m_transl;
41  };
42 
43 
44  template < typename T1, typename T2 >
45  INLINE
48  {
49  return mul<numeric_array<T1,3> >(s.getScale(), v) + s.getTransl();
50  }
51 
52  //} // namespace linalg
53 } // namespace til
54 
55 #endif
56 
numeric_array< T, 3 > & getTransl()
Definition: scaling.h:31
Scaling(const numeric_array< T, 3 > &scale, const numeric_array< T, 3 > &transl)
Definition: scaling.h:22
Belongs to package Box Do not include directly, include til/Box.h instead.
Definition: Accumulator.h:10
General macros, definitions and functions.
This file contains forward declarations of classes defined in the TIL library.
INLINE numeric_array< typename combine< T1, T2 >::type, 3 > operator*(const Affine< T1 > &a, const numeric_array< T2, 3 > &v)
Multiplication between a 3D affine transform and a 3D vector.
#define INLINE
Definition: til_common.h:26
numeric_array< T, 3 > & getScale()
Definition: scaling.h:30
const numeric_array< T, 3 > & getScale() const
Definition: scaling.h:28
Namespace for all linear algebra related stuff.
Definition: scaling.h:17
const numeric_array< T, 3 > & getTransl() const
Definition: scaling.h:29
void setScale(const numeric_array< T, 3 > &scale)
Definition: scaling.h:33
void setTransl(const numeric_array< T, 3 > &transl)
Definition: scaling.h:34