UnderflowTextRep.cxx
Go to the documentation of this file.
1 
13 #include "UnderflowTextRep.h"
14 
15 #include "graphics/ViewBase.h"
16 #include "pattern/string_convert.h"
18 
19 using std::string;
20 
21 using namespace hippodraw;
22 
24  : TextRepBase ( "Underflow" )
25 {
26 }
27 
29  : TextRepBase( rep )
30 {
31 }
32 
33 /* virtual */
35 {
36  return new UnderflowTextRep ( *this );
37 }
38 
39 void
42  ViewBase & view )
43 {
44  int underflow = proj.getUnderflow ();
45  string text ( "Underflow_entries = " );
46  if ( underflow < 0 ) {
47  text += "meaningless";
48  }
49  else {
50  text += String::convert ( underflow );
51  }
52 
53  view.drawText ( text, 5, 10, m_size, 0, 'l', 't', true, 0, & m_color );
54 }
virtual RepBase * clone()
Returns a copy of the object.
A base class for representations that draws a value as text.
Definition: TextRepBase.h:27
return rep
Definition: Inspector.cxx:3843
The namespace for conversion to string.
A TextRepBase class that draws the number of underflow entries.
UnderflowTextRep class interface.
string convert(int i)
Converts an integer to a string.
Color m_color
The color of the representation.
Definition: RepBase.h:57
float m_size
The size of the representation.
Definition: RepBase.h:63
virtual int getUnderflow() const =0
Returns the number of underflow.
The base class for the Projector hierarchy.
Definition: ProjectorBase.h:56
The abstract base class for views.
Definition: ViewBase.h:62
virtual void drawText(const std::string &s, float x, float y, float fontsize, float angle=0.0, char xp= 'l', char yp= 't', bool resize=false, const FontBase *font=0, const Color *color=0)=0
Draws a text string at a point in the view&#39;s coordinate system.
UnderflowTextRep()
The default constructor.
hippodraw::ViewBase class interface
virtual void drawProjectedValues(ProjectorBase &projector, ViewBase &view)
Draws the values from the projector to the view.
hippodraw::NTupleProjector class interface
The base class for the point representation hierarchy.
Definition: RepBase.h:45

Generated for HippoDraw Class Library by doxygen