kalzium
kalziumgradienttype.h
Go to the documentation of this file.00001 /*************************************************************************** 00002 * Copyright (C) 2005, 2006 by Pino Toscano, toscano.pino@tiscali.it * 00003 * * 00004 * This program is free software; you can redistribute it and/or modify * 00005 * it under the terms of the GNU General Public License as published by * 00006 * the Free Software Foundation; either version 2 of the License, or * 00007 * (at your option) any later version. * 00008 * * 00009 * This program is distributed in the hope that it will be useful, * 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00012 * GNU General Public License for more details. * 00013 * * 00014 * You should have received a copy of the GNU General Public License * 00015 * along with this program; if not, write to the * 00016 * Free Software Foundation, Inc., * 00017 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * 00018 ***************************************************************************/ 00019 00020 #ifndef KALZIUMGRADIENTTYPE_H 00021 #define KALZIUMGRADIENTTYPE_H 00022 00023 class KalziumGradientType; 00024 00025 #include <QByteArray> 00026 #include <QColor> 00027 00033 class KalziumGradientTypeFactory 00034 { 00035 public: 00039 static KalziumGradientTypeFactory* instance(); 00040 00045 KalziumGradientType* build( int id ) const; 00051 KalziumGradientType* build( const QByteArray& id ) const; 00052 00056 QStringList gradients() const; 00057 00058 private: 00059 KalziumGradientTypeFactory(); 00060 00061 QList<KalziumGradientType*> m_gradients; 00062 }; 00063 00070 class KalziumGradientType 00071 { 00072 public: 00076 static KalziumGradientType* instance(); 00077 00078 virtual ~KalziumGradientType(); 00079 00084 virtual QByteArray name() const = 0; 00089 virtual QString description() const = 0; 00090 00096 virtual double elementCoeff( int el ) const; 00102 virtual double value( int el ) const = 0; 00107 virtual double minValue() const = 0; 00112 virtual double maxValue() const = 0; 00117 virtual bool logarithmicGradient() const = 0; 00121 virtual QColor firstColor() const; 00125 virtual QColor secondColor() const; 00130 virtual QColor notAvailableColor() const; 00131 00138 QColor calculateColor( const double coeff ) const; 00139 00140 protected: 00141 KalziumGradientType(); 00142 }; 00143 00149 class KalziumCovalentRadiusGradientType : public KalziumGradientType 00150 { 00151 public: 00152 static KalziumCovalentRadiusGradientType* instance(); 00153 00154 QByteArray name() const; 00155 QString description() const; 00156 00157 double value( int el ) const; 00158 00159 double minValue() const; 00160 double maxValue() const; 00161 00162 bool logarithmicGradient() const; 00163 00164 private: 00165 KalziumCovalentRadiusGradientType(); 00166 }; 00167 00173 class KalziumVanDerWaalsRadiusGradientType : public KalziumGradientType 00174 { 00175 public: 00176 static KalziumVanDerWaalsRadiusGradientType* instance(); 00177 00178 QByteArray name() const; 00179 QString description() const; 00180 00181 double value( int el ) const; 00182 00183 double minValue() const; 00184 double maxValue() const; 00185 00186 bool logarithmicGradient() const; 00187 00188 private: 00189 KalziumVanDerWaalsRadiusGradientType(); 00190 }; 00191 00197 class KalziumMassGradientType : public KalziumGradientType 00198 { 00199 public: 00200 static KalziumMassGradientType* instance(); 00201 00202 QByteArray name() const; 00203 QString description() const; 00204 00205 double value( int el ) const; 00206 00207 double minValue() const; 00208 double maxValue() const; 00209 00210 bool logarithmicGradient() const; 00211 00212 private: 00213 KalziumMassGradientType(); 00214 }; 00215 00221 class KalziumBoilingPointGradientType : public KalziumGradientType 00222 { 00223 public: 00224 static KalziumBoilingPointGradientType* instance(); 00225 00226 QByteArray name() const; 00227 QString description() const; 00228 00229 double value( int el ) const; 00230 00231 double minValue() const; 00232 double maxValue() const; 00233 00234 bool logarithmicGradient() const; 00235 00236 private: 00237 KalziumBoilingPointGradientType(); 00238 }; 00239 00245 class KalziumMeltingPointGradientType : public KalziumGradientType 00246 { 00247 public: 00248 static KalziumMeltingPointGradientType* instance(); 00249 00250 QByteArray name() const; 00251 QString description() const; 00252 00253 double value( int el ) const; 00254 00255 double minValue() const; 00256 double maxValue() const; 00257 00258 bool logarithmicGradient() const; 00259 00260 private: 00261 KalziumMeltingPointGradientType(); 00262 }; 00263 00269 class KalziumElectronegativityGradientType : public KalziumGradientType 00270 { 00271 public: 00272 static KalziumElectronegativityGradientType* instance(); 00273 00274 QByteArray name() const; 00275 QString description() const; 00276 00277 double value( int el ) const; 00278 00279 double minValue() const; 00280 double maxValue() const; 00281 00282 bool logarithmicGradient() const; 00283 00284 private: 00285 KalziumElectronegativityGradientType(); 00286 }; 00287 00293 class KalziumDiscoverydateGradientType : public KalziumGradientType 00294 { 00295 public: 00296 static KalziumDiscoverydateGradientType* instance(); 00297 00298 QByteArray name() const; 00299 QString description() const; 00300 00301 double value( int el ) const; 00302 00303 double minValue() const; 00304 double maxValue() const; 00305 00306 bool logarithmicGradient() const; 00307 00308 private: 00309 KalziumDiscoverydateGradientType(); 00310 }; 00311 00317 class KalziumElectronaffinityGradientType : public KalziumGradientType 00318 { 00319 public: 00320 static KalziumElectronaffinityGradientType* instance(); 00321 00322 QByteArray name() const; 00323 QString description() const; 00324 00325 double value( int el ) const; 00326 00327 double minValue() const; 00328 double maxValue() const; 00329 00330 bool logarithmicGradient() const; 00331 00332 private: 00333 KalziumElectronaffinityGradientType(); 00334 }; 00335 00341 class KalziumIonizationGradientType : public KalziumGradientType 00342 { 00343 public: 00344 static KalziumIonizationGradientType* instance(); 00345 00346 QByteArray name() const; 00347 QString description() const; 00348 00349 double value( int el ) const; 00350 00351 double minValue() const; 00352 double maxValue() const; 00353 00354 bool logarithmicGradient() const; 00355 00356 private: 00357 KalziumIonizationGradientType(); 00358 }; 00359 00360 #endif // KALZIUMGRADIENTTYPE_H
KDE 4.0 API Reference