BALL  1.4.1
colorUnitHue.h
Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 
00005 #ifndef BALL_VIEW_DATATYPE_COLORUNITHUE_H
00006 #define BALL_VIEW_DATATYPE_COLORUNITHUE_H
00007 
00008 #ifndef BALL_COMMON_H
00009 # include <BALL/common.h>
00010 #endif
00011 
00012 #ifndef BALL_DATATYPE_STRING_H
00013 # include <BALL/DATATYPE/string.h>
00014 #endif
00015 
00016 #ifndef BALL_VIEW_DATATYPE_COLORUNIT_H
00017 # include <BALL/VIEW/DATATYPE/colorUnit.h>
00018 #endif
00019 
00020 #include <iostream>
00021 #include <stdio.h>
00022 
00023 namespace BALL 
00024 {
00025   namespace VIEW
00026   {
00036     class BALL_VIEW_EXPORT ColorUnitHue
00037     {
00038       public:
00039 
00040       BALL_CREATE(ColorUnitHue)
00041       
00042       
00045 
00048       ColorUnitHue();
00049     
00052       ColorUnitHue(const ColorUnitHue& colcor_h_unit);
00053 
00059       ColorUnitHue(const char* value);
00060 
00065       ColorUnitHue(const String& value);
00066 
00071       ColorUnitHue(const short value);
00072 
00077       ColorUnitHue(const unsigned short value);
00078 
00083       ColorUnitHue(const int value);
00084     
00089       ColorUnitHue(const unsigned int value);
00090 
00095       ColorUnitHue(const long value);
00096 
00101       ColorUnitHue(const unsigned long value);
00102     
00107       ColorUnitHue(const float value);
00108     
00113       ColorUnitHue(const double value);
00114 
00119       ColorUnitHue(const long double value);
00120 
00122 
00124 
00127       virtual ~ColorUnitHue();
00128 
00132       virtual void clear();
00133 
00135 
00138 
00142       operator String () const;
00143 
00147       operator short () const;
00148       
00152       operator unsigned short () const;
00153       
00157       operator int () const;
00158 
00162       operator unsigned int () const;
00163 
00167       operator long () const;
00168 
00172       operator unsigned long () const;
00173 
00177       operator float () const;
00178 
00182       operator double () const;
00183       
00187       operator long double () const;
00188 
00190 
00193       
00196       void set(const ColorUnitHue& color_unit_hue);
00197 
00200       const ColorUnitHue& operator = (const ColorUnitHue& color_unit_hue);
00201     
00204       void swap(ColorUnitHue& color_unit_hue);
00205 
00212       void set(const char* value);
00213 
00220       const ColorUnitHue& operator = (const char* value);
00221     
00228       void get(char* value) const;
00229 
00235       void set(const String& value);
00236 
00243       const ColorUnitHue& operator = (const String& value);
00244     
00249       void get(String& value) const;
00250 
00255       void set(const short value);
00256 
00262       const ColorUnitHue& operator = (const short value);
00263 
00267       void get(short& value) const;
00268 
00273       void set(const unsigned short value);
00274 
00280       const ColorUnitHue& operator = (const unsigned short value);
00281 
00285       void get(unsigned short& value) const;
00286 
00291       void set(const int value);
00292 
00298       const ColorUnitHue& operator = (const int value);
00299 
00303       void get(int& value) const;
00304 
00309       void set(const unsigned int value);
00310 
00316       const ColorUnitHue& operator = (const unsigned int value);
00317 
00321       void get(unsigned int& value) const;
00322 
00327       void set(const long value);
00328 
00334       const ColorUnitHue& operator = (const long value);
00335 
00339       void get(long& value) const;
00340 
00345       void set(const unsigned long value);
00346 
00352       const ColorUnitHue& operator = (const unsigned long value);
00353 
00357       void get(unsigned long& value) const;
00358 
00363       void set(const float value);
00364 
00370       const ColorUnitHue& operator = (const float init);
00371 
00376       void get(float& value) const;
00377 
00382       void set(const double value);
00383 
00389       const ColorUnitHue& operator = (const double value);
00390 
00394       void get(double& value) const;
00395 
00400       void set(const long double value);
00401 
00407       const ColorUnitHue& operator = (const long double value);
00408 
00412       void get(long double& value) const;
00413 
00415 
00418 
00421       bool operator == (const ColorUnitHue& color_unit_hue) const;
00422 
00425       bool operator != (const ColorUnitHue& color_unit_hue) const;
00426       
00429       bool operator < (const ColorUnitHue& color_unit_hue) const;
00430       
00433       bool operator <= (const ColorUnitHue& color_unit_hue) const;
00434       
00437       bool operator > (const ColorUnitHue& color_unit_hue) const;
00438 
00441       bool operator >= (const ColorUnitHue& color_unit_hue) const;
00442 
00444 
00447 
00454       virtual void dump(std::ostream& s = std::cout, Size depth = 0) const;
00455 
00457 
00460 
00468       friend std::istream& operator >> (std::istream& s, ColorUnitHue& color_unit_hue);
00469 
00477       friend std::ostream& operator << (std::ostream& s, const ColorUnitHue& color_unit_hue);
00479 
00480       private:
00481       
00482       // @throw Exception::InvalidRange 
00483       // @throw Exception::NotInHexFormat
00484       float hexToFloat_(const char* string);
00485       
00486       float value_;
00487     };
00488 
00489 #   ifndef BALL_NO_INLINE_FUNCTIONS
00490 #     include <BALL/VIEW/DATATYPE/colorUnitHue.iC>
00491 #   endif
00492   
00493   } // namspace VIEW
00494 } // namespace BALL
00495 
00496 #endif // BALL_VIEW_DATATYPE_COLORUNITHUE_H
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines