core/vcsl/vcsl_length_unit.h
Go to the documentation of this file.
00001 #ifndef vcsl_length_unit_h_
00002 #define vcsl_length_unit_h_
00003 //:
00004 // \file
00005 // \brief Abstract unit associated to the length dimension
00006 // \author François BERTEL
00007 //
00008 // \verbatim
00009 //  Modifications
00010 //   2000/06/28 François BERTEL Creation. Adapted from IUE
00011 //   2001/04/10 Ian Scott (Manchester) Converted perceps header to doxygen
00012 //   2004/09/10 Peter Vanroose  Inlined all 1-line methods in class decl
00013 //   2004/09/17 Peter Vanroose  do not pass vcsl_unit objects; use vcsl_unit_sptr instead
00014 // \endverbatim
00015 
00016 #include <vcsl/vcsl_unit.h>
00017 #include <vcsl/vcsl_length_unit_sptr.h>
00018 #include <vcsl/vcsl_unit_sptr.h>
00019 
00020 //: Abstract unit associated to the length dimension
00021 class vcsl_length_unit
00022   : public vcsl_unit
00023 {
00024   //***************************************************************************
00025   // Constructors/Destructor
00026   //***************************************************************************
00027 
00028  protected:
00029   // Default constructor
00030   vcsl_length_unit() {}
00031 
00032  public:
00033   // Destructor
00034   virtual ~vcsl_length_unit() {}
00035 
00036   //***************************************************************************
00037   // Status report
00038   //***************************************************************************
00039 
00040   //: Are `this' and `other' compatible units ?
00041   // (Are they associated to the same dimension ?)
00042   // Pure virtual function of vcsl_unit
00043   virtual bool compatible_units(vcsl_unit_sptr const& other) const;
00044 
00045   //: Return the standard unit associated to the dimension of `this'
00046   // Pure virtual function of vcsl_unit
00047   virtual vcsl_unit_sptr standard_unit() const;
00048 
00049   //***************************************************************************
00050   // Because VXL does not necessarily use dynamic_cast<>
00051   //***************************************************************************
00052 
00053   virtual const vcsl_length_unit *cast_to_length_unit() const { return this; }
00054 };
00055 
00056 #endif // vcsl_length_unit_h_