00001 // This is core/vcsl/vcsl_cylindrical_to_cartesian_3d.h 00002 #ifndef vcsl_cylindrical_to_cartesian_3d_h_ 00003 #define vcsl_cylindrical_to_cartesian_3d_h_ 00004 //: 00005 // \file 00006 // \brief Convert 3D cartesian coordinates to cylindrical coordinates 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 // 2004/09/17 Peter Vanroose - made "instance_" a local static variable of method instance() 00014 // \endverbatim 00015 00016 #include <vcsl/vcsl_spatial_transformation.h> 00017 #include <vcsl/vcsl_cylindrical_to_cartesian_3d_sptr.h> 00018 00019 //: Convert 3D cartesian coordinates to cylindrical coordinates 00020 class vcsl_cylindrical_to_cartesian_3d 00021 : public vcsl_spatial_transformation 00022 { 00023 //*************************************************************************** 00024 // Constructors/Destructor 00025 //*************************************************************************** 00026 00027 // Default constructor 00028 vcsl_cylindrical_to_cartesian_3d() {} 00029 00030 public: 00031 // Destructor 00032 virtual ~vcsl_cylindrical_to_cartesian_3d() {} 00033 00034 //*************************************************************************** 00035 // Status report 00036 //*************************************************************************** 00037 00038 //: Is `this' invertible at time `time'? 00039 // REQUIRE: valid_time(time) 00040 // Pure virtual function of vcsl_spatial_transformation 00041 virtual bool is_invertible(double time) const; 00042 00043 //: Is `this' correctly set ? 00044 // Always true. 00045 // Virtual function of vcsl_spatial_transformation 00046 virtual bool is_valid() const { return true; } 00047 00048 //*************************************************************************** 00049 // Basic operations 00050 //*************************************************************************** 00051 00052 //: Image of `v' by `this' 00053 // REQUIRE: is_valid() 00054 // REQUIRE: v.size()==3 00055 // Pure virtual function of vcsl_spatial_transformation 00056 virtual vnl_vector<double> execute(const vnl_vector<double> &v, 00057 double time) const; 00058 00059 //: Image of `v' by the inverse of `this' 00060 // REQUIRE: is_valid() 00061 // REQUIRE: is_invertible(time) 00062 // REQUIRE: v.size()==3 00063 // Pure virtual function of vcsl_spatial_transformation 00064 virtual vnl_vector<double> inverse(const vnl_vector<double> &v, 00065 double time) const; 00066 00067 //*************************************************************************** 00068 // Singleton pattern 00069 //*************************************************************************** 00070 00071 //: Return the reference to the unique vcsl_length object 00072 static vcsl_cylindrical_to_cartesian_3d_sptr instance(); 00073 }; 00074 00075 #endif // vcsl_cylindrical_to_cartesian_3d_h_