FilledColumnPointRep.cxx
Go to the documentation of this file.
1 
12 // For truncation warning
13 #ifdef _MSC_VER
14 #include "msdevstudio/MSconfig.h"
15 #endif
16 
17 #include "FilledColumnPointRep.h"
18 
19 #include "axes/Range.h"
20 #include "graphics/ViewBase.h"
21 
22 using std::vector;
23 
24 using namespace hippodraw;
25 
28  : ColumnPointRep ( ),
29  m_fill_color ( Color::red )
30 {
31  m_name = "FilledColumn";
32 }
33 
36  : ColumnPointRep ( point_rep ),
37  m_fill_color ( point_rep.m_fill_color )
38 {
39 }
40 
43 {
44  // Does nothing
45 }
46 
47 RepBase *
50 {
51  return new FilledColumnPointRep ( *this );
52 }
53 
54 
55 void
57 setColor ( const Color & color )
58 {
60 }
61 
62 void
64 drawValues ( ViewBase * view ) const
65 {
66  int red = m_fill_color.getRed ();
67  int green = m_fill_color.getGreen ();
68  int blue = m_fill_color.getBlue ();
69 
70  const Range & range = view -> getRange ( Axes::Y );
71 
72  unsigned int size = m_x.size () -1;
73  for ( unsigned int i = 1; i < size; i += 2 ) {
74  double y2 = m_y [ i+1 ];
75  double y1 = range.low ();
76  double x1 = m_x [ i ];
77  double x2 = m_x [ i+1 ];
78 
79  view -> drawSquare ( x1, y1, x2, y2, red, green, blue );
80  }
81 
83 }
FilledColumnPointRep()
The default constructor.
unsigned int i
virtual void setColor(const Color &color)
Sets the color fill.
A PointRep class that draws a filled column to represent the value.
hippodraw::FilledColumnPointRep class interface
int getRed() const
Definition: Color.cxx:164
std::string m_name
The name of the representation.
Definition: RepBase.h:51
A Color class for creating the color object following the standard RGB color space.
Definition: Color.h:37
int getGreen() const
Definition: Color.cxx:169
virtual void drawValues(ViewBase *view) const
Does the drawing based on the accumulated polyline.
virtual const Color & color() const
Returns the representation&#39;s color.
Definition: RepBase.cxx:63
std::vector< double > m_y
A cache of the points to be drawn along the Y axis.
The abstract base class for views.
Definition: ViewBase.h:62
virtual void drawValues(ViewBase *view) const
Does the drawing based on the accumulated polyline.
hippodraw::Range class interface
double low() const
Returns the minimum of the range object.
Definition: Range.cxx:87
Expresses a range of values.
Definition: Range.h:33
A PointRep class that draws a column to represent the value.
hippodraw::ViewBase class interface
Color m_fill_color
The color to use for the fill.
int getBlue() const
Definition: Color.cxx:174
float size() const
Returns the size of the representation.
Definition: RepBase.cxx:91
virtual RepBase * clone()
The clone function returns an object of its own kind which is a copy of this object at this moment...
The base class for the point representation hierarchy.
Definition: RepBase.h:45
std::vector< double > m_x
A cache of the points to be drawn along the X axis.

Generated for HippoDraw Class Library by doxygen