ZColorScalePal.hpp
1 #pragma once
2 
3 #include <vector>
4 #include "opals/config.hpp"
5 
6 namespace opals {
7 
8  /// Class describing different scaling methods for palette entries
9  class OPALS_API ZColorScalePal
10  {
11  public:
13  virtual ~ZColorScalePal();
14 
15  /// scaling of palette nodes
16  struct TypeScalePal {
17  enum Type {
18  autoScale = 0, ///< automatic scaling of palette nodes
19  scaleByFactor, ///< single scaling factor
20  scaleByRange ///< scaling range
21  };
22  };
23 
24  bool isAutoScale() const { return type == TypeScalePal::autoScale; };
25  bool isScaleByFactor() const { return type == TypeScalePal::scaleByFactor; };
26  bool isScaleByRange() const { return type == TypeScalePal::scaleByRange; };
27 
28  void setAutoScale();
29  void setScaleFactor( const float& scalefac );
30  void setScaleRange( const std::vector<float>& range );
31 
32  float getScaleFactor() const { return isScaleByFactor() ? scale.front() : 0.f; };
33  float getScaleMin() const { return scale.front(); };
34  float getScaleMax() const { return scale.back(); };
35  const std::vector<float>& getScaleRange() const { return scale; }
36 
37  private:
38  TypeScalePal::Type type;
39  std::vector<float> scale;
40  };
41 }
@ scale
scanner range scale (opalsStripAdjust)
scaling of palette nodes
Definition: ZColorScalePal.hpp:16
Type
Definition: ZColorScalePal.hpp:17
Contains the public interface of OPALS.
Definition: AbsValueOrQuantile.hpp:8
Class describing different scaling methods for palette entries.
Definition: ZColorScalePal.hpp:9
@ scaleByFactor
single scaling factor
Definition: ZColorScalePal.hpp:19