vcsl_composition.h
Go to the documentation of this file.
1 // This is core/vcsl/vcsl_composition.h
2 #ifndef vcsl_composition_h_
3 #define vcsl_composition_h_
4 //:
5 // \file
6 // \brief Composition of transformations
7 // \author Francois BERTEL
8 //
9 // \verbatim
10 // Modifications
11 // 2000/06/28 Francois BERTEL Creation. Adapted from IUE
12 // 2002/01/22 Peter Vanroose - return type of execute() and inverse() changed to non-ptr
13 // 2002/01/28 Peter Vanroose - std::vector member transformations_ changed to non-ptr
14 // 2004/09/17 Peter Vanroose - made composition() non-virtual - it just returns a member and should not be overloaded
15 // \endverbatim
16 
17 #include <vector>
20 #ifdef _MSC_VER
21 # include <vcl_msvc_warnings.h>
22 #endif
23 
24 //: Composition of transformations
25 // This transformation handles a composition of transformations, that is,
26 // at a given time, all the transformations are applied on a given point
29 {
30  public:
31  //***************************************************************************
32  // Constructors/Destructor
33  //***************************************************************************
34 
35  // Default constructor
36  vcsl_composition() = default;
37 
38  // Destructor
39  ~vcsl_composition() override = default;
40 
41  //***************************************************************************
42  // Status report
43  //***************************************************************************
44 
45  //: Is `this' invertible at time `time'?
46  // REQUIRE: valid_time(time)
47  // Pure virtual function of vcsl_spatial_transformation
48  bool is_invertible(double time) const override;
49 
50  //: Is `this' correctly set ?
51  // Virtual function of vcsl_spatial_transformation
52  bool is_valid() const override;
53 
54  //: Return the list of transformations
55  std::vector<vcsl_spatial_transformation_sptr> composition() const { return transformations_; }
56 
57  //***************************************************************************
58  // Status setting
59  //***************************************************************************
60 
61  //: Set the list of transformations of the composition
62  // The transformations are performed in the order of the list
63  void set_composition(std::vector<vcsl_spatial_transformation_sptr> const& t) { transformations_=t; }
64 
65  //***************************************************************************
66  // Basic operations
67  //***************************************************************************
68 
69  //: Image of `v' by `this'
70  // REQUIRE: is_valid()
71  // Pure virtual function of vcsl_spatial_transformation
73  double time) const override;
74 
75  //: Image of `v' by the inverse of `this'
76  // REQUIRE: is_valid()
77  // REQUIRE: is_invertible(time)
78  // Pure virtual function of vcsl_spatial_transformation
80  double time) const override;
81  protected:
82  std::vector<vcsl_spatial_transformation_sptr> transformations_;
83 };
84 
85 #endif // vcsl_composition_h_
vnl_vector< double > inverse(const vnl_vector< double > &v, double time) const override
Image of ‘v’ by the inverse of ‘this’.
~vcsl_composition() override=default
Transformation between 2 spatial coordinate systems.
bool is_valid() const override
Is ‘this’ correctly set ?.
bool is_invertible(double time) const override
Is ‘this’ invertible at time ‘time’?.
Transformation between 2 spatial coordinate systems.
void set_composition(std::vector< vcsl_spatial_transformation_sptr > const &t)
Set the list of transformations of the composition.
Composition of transformations.
std::vector< vcsl_spatial_transformation_sptr > composition() const
Return the list of transformations.
std::vector< vcsl_spatial_transformation_sptr > transformations_
vcsl_composition()=default
vnl_vector< double > execute(const vnl_vector< double > &v, double time) const override
Image of ‘v’ by ‘this’.