BinToColor.cxx
Go to the documentation of this file.
1 
12 #include "BinToColor.h"
13 using std :: string;
14 
15 namespace hippodraw {
16 
17 BinToColor::BinToColor ( const char * name )
18  : m_name ( name )
19 {
20 }
21 
22 // BinToColor::
23 // BinToColor ( const std::string & name )
24 // : m_name ( name )
25 // {
26 // }
27 
28 BinToColor::BinToColor( const BinToColor & bin_to_color )
29  : m_name ( bin_to_color.m_name ),
30  m_dv ( bin_to_color.m_dv ),
31  m_vmin ( bin_to_color.m_vmin )
32 {
33  m_control_points = bin_to_color.m_control_points;
34 }
35 
37 {
38 }
39 
40 const std::string &
42 name () const
43 {
44  return m_name;
45 }
46 
47 void BinToColor::setRange( const Range & r )
48 {
49  m_dv = r.length();
50  m_vmin = r.low ();
51 }
52 
53 Range
55 getRange () const
56 {
57  Range range ( m_vmin, m_vmin + m_dv );
58 
59  return range;
60 }
61 
62 bool
65 {
66  return false;
67 }
68 
69 const std::vector < double > &
72 {
73  return m_control_points;
74 }
75 
76 void
78 setControlPoints ( const std::vector < double > & points )
79 {
80  m_control_points = points;
81 }
82 
83 bool
85 isUserDefined () const
86 {
87  return false;
88 }
89 
90 // added by Tao Aug 10,2006
91 // return False in the base class BinToColor, reimplemented in BinToBlack and BinToGreyScale
92 bool
95 {
96  return false;
97 }
98 
99 } // namespace hippodraw
100 
virtual void setControlPoints(const std::vector< double > &points)
Set the value of the control points.
Definition: BinToColor.cxx:78
virtual bool acceptChangeColor() const
Returns true if object can accept changing color,i.e.
Definition: BinToColor.cxx:94
The base class for the value to the color transformation.
Definition: BinToColor.h:30
const std::vector< double > & getControlPoints() const
Returns a list of control points.
Definition: BinToColor.cxx:71
Range getRange() const
Get the Range of expected values.
Definition: BinToColor.cxx:55
double m_vmin
The minimum value expected.
Definition: BinToColor.h:54
virtual bool isUserDefined() const
Returns true if object can be user defined.
Definition: BinToColor.cxx:85
std::vector< double > m_control_points
A set of control points that might be used for the value to color transform.
Definition: BinToColor.h:46
virtual bool hasControlPoints() const
Returns true if class has control points by which the value to color transform can be varied...
Definition: BinToColor.cxx:64
hippodraw::BinToColor class interface
double length() const
Returns the length of the range object.
Definition: Range.h:156
std::string m_name
The name of this value transform.
Definition: BinToColor.h:36
virtual ~BinToColor()
The destructor.
Definition: BinToColor.cxx:36
BinToColor(const char *name)
The constructor.
Definition: BinToColor.cxx:17
double m_dv
The distance of the expected values, i.e.
Definition: BinToColor.h:50
double low() const
Returns the minimum of the range object.
Definition: Range.cxx:87
Expresses a range of values.
Definition: Range.h:33
const std::string & name() const
Returns the name of the value to color transform.
Definition: BinToColor.cxx:42
void setRange(const Range &r)
Sets the range of the values passed.
Definition: BinToColor.cxx:47

Generated for HippoDraw Class Library by doxygen