00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039 #ifndef VRS_OPENGL_GOOCHSHADINGGL_H_
00040 #define VRS_OPENGL_GOOCHSHADINGGL_H_
00041
00042 #include <vrs/opengl/edgeenhancementgl.h>
00043 #include <vrs/color.h>
00044
00045 namespace VRS {
00046
00048 class VRS_CORE_API GoochShadingGL : public EdgeEnhancementGL {
00049 public:
00050 GoochShadingGL(bool distinguish = false,
00051 const Color& warmColor = Color(0.6, 0.6, 0.0), const Color& coolColor = Color(0.0, 0.0, 0.6),
00052 float kWarm = 0.45f, float kCool = 0.45f
00053 ) : distinguishEdges_(distinguish), warmColor_(warmColor), coolColor_(coolColor), kWarm_(kWarm), kCool_(kCool) { };
00062 bool distinguishEdges() const;
00063 void distinguishEdges(bool );
00066 const Color& getWarmColor() const;
00067 void setWarmColor(const Color&);
00068 const Color& getCoolColor() const;
00069 void setCoolColor(const Color& );
00072 float getWarmCoeffiecient() const;
00073 float getCoolCoeffiecient() const;
00074 void setCoolAndWarmCoeffiecients(float warm, float cool);
00077 VRS_TYPEINFO(GoochShadingGL, EdgeEnhancementGL);
00078 VRS_SERIALIZABLE(GoochShadingGL);
00079
00080 private:
00081 bool distinguishEdges_;
00082 Color warmColor_;
00083 Color coolColor_;
00084 float kWarm_;
00085 float kCool_;
00086 };
00087
00088 inline bool GoochShadingGL::distinguishEdges() const { return distinguishEdges_; }
00089 inline void GoochShadingGL::distinguishEdges(bool d) {
00090 if(d!=distinguishEdges_) {
00091 distinguishEdges_ = d;
00092 modified();
00093 }
00094 };
00095
00096 inline const Color& GoochShadingGL::getWarmColor() const { return warmColor_; }
00097 inline void GoochShadingGL::setWarmColor(const Color& color) {
00098 warmColor_ = color;
00099 modified();
00100 }
00101 inline const Color& GoochShadingGL::getCoolColor() const {return coolColor_; }
00102 inline void GoochShadingGL::setCoolColor(const Color& color) {
00103 coolColor_ = color;
00104 modified();
00105 }
00106
00107 float inline GoochShadingGL::getWarmCoeffiecient() const { return kWarm_; }
00108 float inline GoochShadingGL::getCoolCoeffiecient() const { return kCool_; }
00109 void inline GoochShadingGL::setCoolAndWarmCoeffiecients(float warm, float cool) {
00110 kWarm_ = warm;
00111 kCool_ = cool;
00112 modified();
00113 }
00114
00115 }
00116
00117
00118 #endif // VRS_OPENGL_GOOCHSHADINGGL_H_