BoxTextRep.cxx
Go to the documentation of this file.
1 
12 #ifdef _MSC_VER
13 // include max() and min() missing from MicroSoft Visual C++
14 #include "msdevstudio/MSconfig.h"
15 #endif //_MSC_VER
16 
17 #include "BoxTextRep.h"
18 
19 #include "pattern/string_convert.h"
20 #include "graphics/ViewBase.h"
22 
23 using std::string;
24 
25 using namespace hippodraw;
26 
28  : TextRepBase ( "Text From Box" )
29 {
30 }
31 
33  : TextRepBase( rep )
34 {
35 }
36 
38 {
39  return new BoxTextRep ( *this );
40 }
41 
44 void
47  ViewBase & view )
48 
49 {
50  if (String::ci_find(m_text, "tex:")==0) {
51  string tex_snippet = m_text.substr(4);
52  view.drawLatex ( tex_snippet );
53  }
54 
55  else {
56  view.drawText ( m_text, 5, 10, m_size, 0, 'l', 't', true, 0, & m_color );
57  }
58 }
virtual RepBase * clone()
Returns a copy of the object.
Definition: BoxTextRep.cxx:37
virtual void drawLatex(const std::string &eq, int position=0)
Draws a Latex equation.
Definition: ViewBase.cxx:119
size_t ci_find(const string &str1, const string &str2)
Case insensitive find.
A TextRepBase class that draws a user defined string.
Definition: BoxTextRep.h:27
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.
BoxTextRep()
The default constructor.
Definition: BoxTextRep.cxx:27
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 void drawProjectedValues(ProjectorBase &projector, ViewBase &view)
Definition: BoxTextRep.cxx:46
The base class for the Projector hierarchy.
Definition: ProjectorBase.h:56
std::string m_text
The text to be displayed before the statistics.
Definition: RepBase.h:54
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's coordinate system.
hippodraw::BoxTextRep class interface
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