core/vcsl/vcsl_displacement.h
Go to the documentation of this file.
00001 // This is core/vcsl/vcsl_displacement.h
00002 #ifndef vcsl_displacement_h_
00003 #define vcsl_displacement_h_
00004 //:
00005 // \file
00006 // \brief Affine rotation
00007 // \author François BERTEL
00008 //
00009 // \verbatim
00010 //  Modifications
00011 //   2000/06/28 François BERTEL Creation. Adapted from IUE
00012 //   2002/01/22 Peter Vanroose - return type of execute() and inverse() changed to non-ptr
00013 //   2002/01/28 Peter Vanroose - vcl_vector member point_ changed to non-ptr
00014 //   2004/09/17 Peter Vanroose - made point() non-virtual - it just returns a member and should not be overloaded
00015 // \endverbatim
00016 
00017 #include <vcsl/vcsl_rotation.h>
00018 #include <vcsl/vcsl_displacement_sptr.h>
00019 
00020 //: Affine rotation
00021 // A displacement rotates a point with a given angle around an axis defined by
00022 // a point and a unit vector
00023 class vcsl_displacement
00024   :public vcsl_rotation
00025 {
00026  public:
00027   //***************************************************************************
00028   // Constructors/Destructor
00029   //***************************************************************************
00030 
00031   // Default constructor
00032   vcsl_displacement() {}
00033 
00034   // Destructor
00035   virtual ~vcsl_displacement() {}
00036 
00037   //***************************************************************************
00038   // Status report
00039   //***************************************************************************
00040 
00041   //: Is `this' correctly set ?
00042   // Virtual function of vcsl_spatial_transformation
00043   virtual bool is_valid() const
00044   { return vcsl_rotation::is_valid() && this->duration()==point_.size(); }
00045 
00046   //***************************************************************************
00047   // Transformation parameters
00048   //***************************************************************************
00049 
00050   //: Set the point for a static displacement
00051   void set_static_point(vnl_vector<double> const& new_point);
00052 
00053   //: Set the variation of the point of the axis along the time
00054   void set_point(list_of_vectors const& new_point) { point_=new_point; }
00055 
00056   //: Return the variation of the point of the axis along the time
00057   list_of_vectors point() const { return point_; }
00058 
00059   //***************************************************************************
00060   // Basic operations
00061   //***************************************************************************
00062 
00063   //: Image of `v' by `this'
00064   //  REQUIRE: is_valid()
00065   // Pure virtual function of vcsl_spatial_transformation
00066   virtual vnl_vector<double> execute(const vnl_vector<double> &v,
00067                                      double time) const;
00068 
00069   //: Image of `v' by the inverse of `this'
00070   //  REQUIRE: is_valid()
00071   //  REQUIRE: is_invertible(time)
00072   // Pure virtual function of vcsl_spatial_transformation
00073   virtual vnl_vector<double> inverse(const vnl_vector<double> &v,
00074                                      double time) const;
00075  protected:
00076 
00077   //: Compute the value of the vector at time `time'
00078   vnl_vector<double> vector_value(double time) const;
00079 
00080   //: Variation of the point of the axis along the time
00081   list_of_vectors point_;
00082 };
00083 
00084 #endif // vcsl_displacement_h_