00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef OST_COLOR_OPS_GRADIENT_COLOR_OP_HH
00020 #define OST_COLOR_OPS_GRADIENT_COLOR_OP_HH
00021
00022 #include <ost/info/info.hh>
00023 #include <ost/info/info_fw.hh>
00024
00025 #include <ost/gfx/gradient.hh>
00026
00027 #include <ost/gfx/color_ops/color_op.hh>
00028
00029
00030
00031
00032
00033 namespace ost { namespace gfx {
00034
00035 class DLLEXPORT_OST_GFX GradientColorOp: public ColorOp {
00036 public:
00037 GradientColorOp();
00038 GradientColorOp(const String& selection, const String& property, const gfx::Gradient& gradient,
00039 float minv, float maxv);
00040 GradientColorOp(const String& selection, int mask, const String& property, const gfx::Gradient& gradient,
00041 float minv, float maxv);
00042 GradientColorOp(const String& selection, const String& property, const gfx::Gradient& gradient);
00043 GradientColorOp(const String& selection, int mask, const String& property, const gfx::Gradient& gradient);
00044 GradientColorOp(const mol::QueryViewWrapper& query_view, const String& property, const gfx::Gradient& gradient,
00045 float minv, float maxv);
00046 GradientColorOp(const mol::QueryViewWrapper& query_view, int mask, const String& property, const gfx::Gradient& gradient,
00047 float minv, float maxv);
00048 GradientColorOp(const mol::QueryViewWrapper& query_view, const String& property, const gfx::Gradient& gradient);
00049 GradientColorOp(const mol::QueryViewWrapper& query_view, int mask, const String& property, const gfx::Gradient& gradient);
00050
00051 virtual void SetProperty(const String& property);
00052 virtual String GetProperty() const;
00053
00054 virtual void SetGradient(const gfx::Gradient& gradient);
00055 virtual gfx::Gradient GetGradient() const;
00056
00057 virtual bool GetCalculateMinMax() const;
00058 virtual void SetMaxV(float maxv) const;
00059 virtual float GetMaxV() const;
00060
00061 virtual void SetMinV(float minv) const;
00062 virtual float GetMinV() const;
00063
00064 virtual void ToInfo(info::InfoGroup& group) const;
00065 static gfx::GradientColorOp FromInfo(info::InfoGroup& group);
00066
00067
00068 void SetClamp(bool f) {clamp_=f;}
00069 bool GetClamp() const {return clamp_;}
00070
00071 private:
00072 void Init();
00073 String property_;
00074 gfx::Gradient gradient_;
00075 bool clamp_;
00076 bool calculate_;
00077 mutable float minv_;
00078 mutable float maxv_;
00079 };
00080
00081 }}
00082
00083 #endif
00084