00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef _PB_LINEAR_DATA_MAPPING_
00025 #define _PB_LINEAR_DATA_MAPPING_
00026
00027 #include <MeshViz/graph/PbDataMapping.h>
00028
00050 class PbLinearDataMapping : public PbDataMapping {
00051
00052 public:
00053
00057 PbLinearDataMapping() ;
00058
00062 PbLinearDataMapping(const PbLinearDataMapping &linearDataMap) ;
00063
00067 PbLinearDataMapping& operator=(const PbLinearDataMapping &linearDataMap) ;
00068
00072 void setValues(float v1, const SbColor &c1, float v2, const SbColor &c2) ;
00073
00077 void setValues(float v1, const SbColor &c1, float t1, float v2, const SbColor &c2, float t2) ;
00078
00083 void setValues(float v1, const PbHLSColor c1, float v2, const PbHLSColor c2) ;
00084
00089 void setValues(float v1, const PbHLSColor c1, float t1, float v2, const PbHLSColor c2, float t2) ;
00090
00095 void getValues(float &v1, SbColor &c1, float &v2, SbColor &c2) const ;
00096
00101 void getValues(float &v1, SbColor &c1, float &t1, float &v2, SbColor &c2, float &t2) const ;
00102
00108 void getValues(float &v1, PbHLSColor c1, float &v2, PbHLSColor c2) const ;
00109
00115 void getValues(float &v1, PbHLSColor c1, float &t1, float &v2, PbHLSColor c2, float &t2) const ;
00116
00117
00118 private:
00119 virtual ClassType getClassType() const
00120 { return LINEAR_DATA_MAPPING ;}
00121
00122 private:
00123
00124 void copy(const PbLinearDataMapping &linearDataMap, SbBool isConstructorPerCopy) ;
00125
00126 const SbColor* computeColor(float value) const;
00127 const SbColor* computeColor(float value, float &transparency) const;
00128
00129 float m_val1, m_val2, m_transparency1, m_transparency2;
00130 SbColor m_color1, m_color2 ;
00131 } ;
00132
00133
00134 #endif
00135
00136