OverflowTextRep.cxx
Go to the documentation of this file.
1 
12 #include "OverflowTextRep.h"
13 
14 #include "graphics/ViewBase.h"
15 #include "pattern/string_convert.h"
17 
18 using std::string;
19 
20 using namespace hippodraw;
21 
23  : TextRepBase ( "Overflow" )
24 {
25 }
26 
28  : TextRepBase( rep )
29 {
30 }
31 
33 {
34  return new OverflowTextRep ( *this );
35 }
36 
37 void
40  ViewBase & view )
41 {
42  int overflow = proj.getOverflow ();
43  string text ( "Overflow_entries = " );
44  if ( overflow < 0 ) {
45  text += "meaningless";
46  }
47  else {
48  text += String::convert ( overflow );
49  }
50 
51  view.drawText ( text, 5, 10, m_size, 0, 'l', 't', true, 0, & m_color );
52 }
virtual void drawProjectedValues(ProjectorBase &projector, ViewBase &view)
Draws the values from the projector to the view.
A TextRepBase class that draws the number of overflow entries.
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.
virtual int getOverflow() const =0
Returns the number of overflow.
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
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.
OverflowTextRep class interface.
OverflowTextRep()
The default constructor.
virtual RepBase * clone()
Returns a copy of the object.
hippodraw::ViewBase class interface
hippodraw::NTupleProjector class interface
The base class for the point representation hierarchy.
Definition: RepBase.h:45

Generated for HippoDraw Class Library by doxygen