colorUnitHue.h

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // $Id: colorUnitHue.h,v 1.26 2005/12/23 17:02:08 amoll Exp $
00005 //
00006 
00007 #ifndef BALL_VIEW_DATATYPE_COLORUNITHUE_H
00008 #define BALL_VIEW_DATATYPE_COLORUNITHUE_H
00009 
00010 #ifndef BALL_COMMON_H
00011 # include <BALL/common.h>
00012 #endif
00013 
00014 #ifndef BALL_DATATYPE_STRING_H
00015 # include <BALL/DATATYPE/string.h>
00016 #endif
00017 
00018 #ifndef BALL_VIEW_DATATYPE_COLORUNIT_H
00019 # include <BALL/VIEW/DATATYPE/colorUnit.h>
00020 #endif
00021 
00022 #include <iostream>
00023 #include <stdio.h>
00024 
00025 namespace BALL 
00026 {
00027   namespace VIEW
00028   {
00038     class BALL_VIEW_EXPORT ColorUnitHue
00039     {
00040       public:
00041 
00042       BALL_CREATE(ColorUnitHue)
00043       
00044       
00047 
00050       ColorUnitHue();
00051     
00054       ColorUnitHue(const ColorUnitHue& colcor_h_unit);
00055 
00061       ColorUnitHue(const char* value)
00062         throw(Exception::InvalidRange, ColorUnit::NotInHexFormat);
00063 
00068       ColorUnitHue(const String& value)
00069         throw(Exception::InvalidRange, ColorUnit::NotInHexFormat);
00070 
00075       ColorUnitHue(const short value)
00076         throw(Exception::InvalidRange);
00077 
00082       ColorUnitHue(const unsigned short value)
00083         throw(Exception::InvalidRange);
00084 
00089       ColorUnitHue(const int value)
00090         throw(Exception::InvalidRange);
00091     
00096       ColorUnitHue(const unsigned int value)
00097         throw(Exception::InvalidRange);
00098 
00103       ColorUnitHue(const long value)
00104         throw(Exception::InvalidRange);
00105 
00110       ColorUnitHue(const unsigned long value)
00111         throw(Exception::InvalidRange);
00112     
00117       ColorUnitHue(const float value)
00118         throw(Exception::InvalidRange);
00119     
00124       ColorUnitHue(const double value)
00125         throw(Exception::InvalidRange);
00126 
00131       ColorUnitHue(const long double value)
00132         throw(Exception::InvalidRange);
00133 
00135 
00137 
00140       virtual ~ColorUnitHue();
00141 
00145       virtual void clear();
00146 
00148 
00151 
00155       operator String () const;
00156 
00160       operator short () const;
00161       
00165       operator unsigned short () const;
00166       
00170       operator int () const;
00171 
00175       operator unsigned int () const;
00176 
00180       operator long () const;
00181 
00185       operator unsigned long () const;
00186 
00190       operator float () const;
00191 
00195       operator double () const;
00196       
00200       operator long double () const;
00201 
00203 
00206       
00209       void set(const ColorUnitHue& color_unit_hue);
00210 
00213       const ColorUnitHue& operator = (const ColorUnitHue& color_unit_hue);
00214     
00217       void swap(ColorUnitHue& color_unit_hue);
00218 
00225       void set(const char* value)
00226         throw(Exception::InvalidRange, ColorUnit::NotInHexFormat);
00227 
00234       const ColorUnitHue& operator = (const char* value)
00235         throw(Exception::InvalidRange, ColorUnit::NotInHexFormat);
00236     
00243       void get(char* value) const;
00244 
00250       void set(const String& value)
00251         throw(Exception::InvalidRange, ColorUnit::NotInHexFormat);
00252 
00259       const ColorUnitHue& operator = (const String& value)
00260         throw(Exception::InvalidRange, ColorUnit::NotInHexFormat);
00261     
00266       void get(String& value) const;
00267 
00272       void set(const short value)
00273         throw(Exception::InvalidRange);
00274 
00280       const ColorUnitHue& operator = (const short value)
00281         throw(Exception::InvalidRange);
00282 
00286       void get(short& value) const;
00287 
00292       void set(const unsigned short value)
00293         throw(Exception::InvalidRange);
00294 
00300       const ColorUnitHue& operator = (const unsigned short value)
00301         throw(Exception::InvalidRange);
00302 
00306       void get(unsigned short& value) const;
00307 
00312       void set(const int value)
00313         throw(Exception::InvalidRange);
00314 
00320       const ColorUnitHue& operator = (const int value)
00321         throw(Exception::InvalidRange);
00322 
00326       void get(int& value) const;
00327 
00332       void set(const unsigned int value)
00333         throw(Exception::InvalidRange);
00334 
00340       const ColorUnitHue& operator = (const unsigned int value)
00341         throw(Exception::InvalidRange);
00342 
00346       void get(unsigned int& value) const;
00347 
00352       void set(const long value)
00353         throw(Exception::InvalidRange);
00354 
00360       const ColorUnitHue& operator = (const long value)
00361         throw(Exception::InvalidRange);
00362 
00366       void get(long& value) const;
00367 
00372       void set(const unsigned long value)
00373         throw(Exception::InvalidRange);
00374 
00380       const ColorUnitHue& operator = (const unsigned long value)
00381         throw(Exception::InvalidRange);
00382 
00386       void get(unsigned long& value) const;
00387 
00392       void set(const float value)
00393         throw(Exception::InvalidRange);
00394 
00400       const ColorUnitHue& operator = (const float init)
00401         throw(Exception::InvalidRange);
00402 
00407       void get(float& value) const;
00408 
00413       void set(const double value)
00414         throw(Exception::InvalidRange);
00415 
00421       const ColorUnitHue& operator = (const double value)
00422         throw(Exception::InvalidRange);
00423 
00427       void get(double& value) const;
00428 
00433       void set(const long double value)
00434         throw(Exception::InvalidRange);
00435 
00441       const ColorUnitHue& operator = (const long double value)
00442         throw(Exception::InvalidRange);
00443 
00447       void get(long double& value) const;
00448 
00450 
00453 
00456       bool operator == (const ColorUnitHue& color_unit_hue) const;
00457 
00460       bool operator != (const ColorUnitHue& color_unit_hue) const;
00461       
00464       bool operator < (const ColorUnitHue& color_unit_hue) const;
00465       
00468       bool operator <= (const ColorUnitHue& color_unit_hue) const;
00469       
00472       bool operator > (const ColorUnitHue& color_unit_hue) const;
00473 
00476       bool operator >= (const ColorUnitHue& color_unit_hue) const;
00477 
00479 
00482 
00489       virtual void dump(std::ostream& s = std::cout, Size depth = 0) const;
00490 
00492 
00495 
00503       friend std::istream& operator >> (std::istream& s, ColorUnitHue& color_unit_hue);
00504 
00512       friend std::ostream& operator << (std::ostream& s, const ColorUnitHue& color_unit_hue);
00514 
00515       private:
00516       
00517       float hexToFloat_(const char* string)
00518         throw(Exception::InvalidRange, ColorUnit::NotInHexFormat);
00519       
00520       float value_;
00521     };
00522 
00523 #   ifndef BALL_NO_INLINE_FUNCTIONS
00524 #     include <BALL/VIEW/DATATYPE/colorUnitHue.iC>
00525 #   endif
00526   
00527   } // namspace VIEW
00528 } // namespace BALL
00529 
00530 #endif // BALL_VIEW_DATATYPE_COLORUNITHUE_H