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 }

Generated for HippoDraw Class Library by doxygen