vcsl_translation.h
Go to the documentation of this file.
1 // This is core/vcsl/vcsl_translation.h
2 #ifndef vcsl_translation_h_
3 #define vcsl_translation_h_
4 //:
5 // \file
6 // \brief Translation transformation
7 // \author Francois BERTEL
8 //
9 // \verbatim
10 // Modifications
11 // 2000/06/28 Francois BERTEL Creation. Adapted from IUE
12 // 2001/04/10 Ian Scott (Manchester) Converted perceps header to doxygen
13 // 2002/01/22 Peter Vanroose - return type of execute() and inverse() changed to non-ptr
14 // 2002/01/28 Peter Vanroose - std::vector member vector_ changed to non-ptr
15 // 2004/09/17 Peter Vanroose - made vector() non-virtual - it just returns a member and should not be overloaded
16 // \endverbatim
17 
20 #include <vnl/vnl_vector.h>
21 
22 //: Translation transformation
25 {
26  public:
27  //***************************************************************************
28  // Constructors/Destructor
29  //***************************************************************************
30 
31  // Default constructor
32  vcsl_translation() = default;
33 
34  // Destructor
35  ~vcsl_translation() override = default;
36 
37  //***************************************************************************
38  // Status report
39  //***************************************************************************
40 
41  //: Is `this' invertible at time `time'?
42  // REQUIRE: valid_time(time)
43  // Pure virtual function of vcsl_spatial_transformation
44  bool is_invertible(double time) const override;
45 
46  //: Is `this' correctly set ?
47  // Virtual function of vcsl_spatial_transformation
48  bool is_valid() const override
50  ((this->duration()==0&&vector_.size()==1) ||
51  this->duration()==vector_.size()); }
52 
53  //***************************************************************************
54  // Transformation parameters
55  //***************************************************************************
56 
57  //: Set the parameters of a static translation
58  void set_static(vnl_vector<double> const& new_vector);
59 
60  //: Set the direction vector variation along the time
61  void set_vector(list_of_vectors const&new_vector){vector_=new_vector;}
62 
63  //: Return the angle variation along the time
64  list_of_vectors vector() const { return vector_; }
65 
66  //***************************************************************************
67  // Basic operations
68  //***************************************************************************
69 
70  //: Image of `v' by `this'
71  // REQUIRE: is_valid()
72  // Pure virtual function of vcsl_spatial_transformation
74  double time) const override;
75 
76  //: Image of `v' by the inverse of `this'
77  // REQUIRE: is_valid()
78  // REQUIRE: is_invertible(time)
79  // Pure virtual function of vcsl_spatial_transformation
81  double time) const override;
82 
83  protected:
84  //: Compute the value of the parameter at time `time'
85  vnl_vector<double> vector_value(double time) const;
86 
87  //: Direction vector variation along the time
89 };
90 
91 #endif // vcsl_translation_h_
unsigned int duration() const
Return the time duration.
Transformation between 2 spatial coordinate systems.
bool is_valid() const override
Is ‘this’ correctly set ?.
std::vector< vnl_vector< double > > list_of_vectors
vcsl_translation()=default
Transformation between 2 spatial coordinate systems.
vnl_vector< double > vector_value(double time) const
Compute the value of the parameter at time ‘time’.
void set_static()
Empty the time clock and interpolators, thereby making the transf static.
vnl_vector< double > inverse(const vnl_vector< double > &v, double time) const override
Image of ‘v’ by the inverse of ‘this’.
list_of_vectors vector() const
Return the angle variation along the time.
vnl_vector< double > execute(const vnl_vector< double > &v, double time) const override
Image of ‘v’ by ‘this’.
virtual bool is_valid() const
Is ‘this’ correctly set ?.
Translation transformation.
void set_vector(list_of_vectors const &new_vector)
Set the direction vector variation along the time.
~vcsl_translation() override=default
list_of_vectors vector_
Direction vector variation along the time.
bool is_invertible(double time) const override
Is ‘this’ invertible at time ‘time’?.