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_NON_LINEAR_DATA_MAPPING2_
00025 #define _PB_NON_LINEAR_DATA_MAPPING2_
00026
00027 #include <MeshViz/graph/PbDataMapping.h>
00028
00062 class PbNonLinearDataMapping2 : public PbDataMapping {
00063
00064 public:
00065
00069 enum Type {
00070 NON_LINEAR_PER_LEVEL,
00071 LINEAR_PER_LEVEL
00072 } ;
00073
00074
00075
00079 PbNonLinearDataMapping2() ;
00080
00084 PbNonLinearDataMapping2(const PbNonLinearDataMapping2 &nonLinearDataMap2) ;
00085
00089 ~PbNonLinearDataMapping2() ;
00090
00094 PbNonLinearDataMapping2& operator=(const PbNonLinearDataMapping2 &nonLinearDataMap2) ;
00095
00102 void setValues(Type type, int numValues, const float *v, const SbColor *c) ;
00103
00110 void setValues(Type type, int numValues, const float *v, const SbColor *c, const float *t) ;
00111
00118 void setValues(Type type, int numValues, const float *v, const PbHLSColor *c) ;
00119
00126 void setValues(Type type, int numValues, const float *v, const PbHLSColor *c, const float *t) ;
00127
00133 const float* getValuesList(int &numValues) const { numValues = m_nbValues ; return m_valuesList ; }
00134
00140 const SbColor* getRGBColorsList(int &numColors) const { numColors = m_nbColors ; return m_colorsList ;}
00141
00146 const PbHLSColor* getHLSColorsList(int &numColors) ;
00147
00153 const float * getTransparencyList(int &num_transparency) const { num_transparency = m_nbColors ; return m_transparencyList ;}
00154
00158 Type getType() const
00159 { return m_typeMapping ; }
00160
00161
00162 private:
00163 virtual ClassType getClassType() const
00164 { return NON_LINEAR_DATA_MAPPING2 ;}
00165
00166 private:
00167
00168 void copy(const PbNonLinearDataMapping2 &nonLinearDataMap2, SbBool isConstructorPerCopy) ;
00169
00170 const SbColor* computeColor(float value) const;
00171 const SbColor* computeColor(float value, float &transparency) const;
00172
00173 void sortColorsValues() ;
00174 void sortColorsTransparenciesValues();
00175
00176 SbColor *m_colorsList ;
00177 float *m_valuesList ;
00178 float *m_transparencyList;
00179 PbHLSColor *m_hlsList ;
00180 int m_nbColors, m_nbValues ;
00181 Type m_typeMapping ;
00182 } ;
00183
00184
00185
00186 #endif
00187
00188