PlotterBaseXML.cxx
Go to the documentation of this file.
1 
12 // for iterator member defect
13 #ifdef _MSC_VER
14 #include "msdevstudio/MSconfig.h"
15 #endif
16 
17 #include "PlotterBaseXML.h"
18 
19 #include "AxisModelXML.h"
20 #include "DataRepXML.h"
21 #include "FontXML.h"
22 #include "PointRepXML.h"
23 #include "TransformXML.h"
24 #include "TupleCutXML.h"
25 #include "XmlController.h"
26 #include "XmlDocument.h"
27 #include "XmlElement.h"
28 
29 #include "axes/AxisModelLog.h"
33 #include "datareps/FunctionRep.h"
34 #include "datasrcs/TupleCut.h"
35 
36 #include "plotters/Cut1DPlotter.h"
37 #include "plotters/Cut2DPlotter.h"
39 #include "plotters/TextPlotter.h"
40 #include "plotters/XyPlotter.h"
41 
43 
44 #include "pattern/string_convert.h"
45 
46 #include <typeinfo>
47 
48 #include <cassert>
49 
50 using std::list;
51 using std::string;
52 
53 using namespace hippodraw;
54 
56  : BaseXML ( "PlotterBase", controller ),
57  m_axis ( "axis" ),
58  m_title ( "title" ),
59  m_x_label ( "xlabel" ),
60  m_y_label ( "ylabel" ),
61  m_z_label ( "zlabel" ),
62  m_pindex ( "pindex" )
63 {
64  m_axismodel = new AxisModelXML ( controller );
65  m_datarep = new DataRepXML ( controller );
66  m_font = new FontXML ( controller );
67  m_pointrep = new PointRepXML ( controller );
68  m_transform_xml = new TransformXML ( controller );
69  m_tuple_cut_xml = new TupleCutXML ( controller );
70 }
71 
73 PlotterBaseXML ( const std::string & name,
74  XmlController * controller )
75  : BaseXML ( name, controller ),
76  m_axis ( "axis" )
77 {
78  m_axismodel = new AxisModelXML ( controller );
79  m_datarep = new DataRepXML ( controller );
80  m_font = new FontXML ( controller );
81 }
82 
85 {
86  delete m_axismodel;
87  delete m_datarep;
88  delete m_font;
89  delete m_pointrep;
90  delete m_transform_xml;
91  delete m_tuple_cut_xml;
92 }
93 
95 {
97 
98  return controller->areDataSourcesSaved ( & plotter );
99 }
100 
102  const PlotterBase & plotter )
103 {
104  createAxisModel ( tag, plotter, Axes::X );
105  createAxisModel ( tag, plotter, Axes::Y );
106  if ( plotter.hasAxis ( Axes::Z ) ) createAxisModel ( tag, plotter, Axes::Z );
107 
108  try {
109  const XyPlotter & xyplotter
110  = dynamic_cast < const XyPlotter & > ( plotter );
111  createFontElements ( tag, xyplotter );
112  }
113  catch ( ... ) {
114  // do nothing
115  }
116 
117  TransformBase * transform = plotter.getTransform ();
118  if ( transform != 0 ) {
119  XmlElement * element = m_transform_xml->createElement ( *transform );
120  tag.appendChild ( *element );
121  delete element;
122  }
123 
124  int number = plotter.getNumDataReps ();
125  for ( int i = 0; i < number; i++ ) {
126  DataRep * rep = plotter.getDataRep ( i );
127 
128  XmlElement * element = m_datarep->createElement ( *rep );
129 
130  tag.appendChild ( *element );
131  delete element;
132  }
133 
134  if ( typeid ( plotter ) == typeid ( Cut1DPlotter ) ||
135  typeid ( plotter ) == typeid ( Cut2DPlotter ) ) {
136  try {
137  const CutPlotter & cut_plotter
138  = dynamic_cast < const CutPlotter & > ( plotter );
139 
140  createCutChildren ( tag, cut_plotter );
141  }
142  catch ( ... ) {
143  // not a cut, so do nothing
144  }
145  }
146 
147  if ( plotter.name() == "TextPlotter" ) {
148  try {
149  const TextPlotter & text_plotter
150  = dynamic_cast < const TextPlotter & > ( plotter );
151  createTextChildren ( tag, text_plotter );
152  }
153  catch ( ... ) {
154  // not a text plotter, so do nothing
155  }
156  }
157  return;
158 }
159 
161  const CutPlotter & plotter )
162 {
163  const vector < TupleCut > & cuts = plotter.getCuts ();
164  for ( unsigned int i = 0; i < cuts.size (); i++ ) {
165  XmlElement * element = m_tuple_cut_xml -> createElement ( i, cuts[i] );
166  tag.appendChild ( *element ); // cut properties
167  delete element;
168  }
169 
170  const list < DataRep * > & targets = plotter.getCutTargets ();
171 #ifdef ITERATOR_MEMBER_DEFECT
172  std::
173 #endif
174  list < DataRep * >::const_iterator first = targets.begin();
175 
176  for ( ; first != targets.end(); ++first ) {
177  DataRep * rep = *first;
178  const void * addr = reinterpret_cast < const void * > ( rep );
179  int id = m_controller -> getId ( addr );
180  XmlElement * element
181  = XmlController::m_xml_doc->createElement ( "CutTarget" );
182  element->setAttribute ( "id", id );
183  tag.appendChild ( *element );
184  delete element;
185  }
186 }
187 
188 void
191  const TextPlotter & plotter )
192 {
193  const DataRep * rep = plotter.getParentDataRep ();
194 
195  const void * addr = reinterpret_cast < const void * > ( rep );
196  int id = m_controller -> getId ( addr );
197  XmlElement * element
198  = XmlController::m_xml_doc->createElement ( "TextTarget" );
199  element->setAttribute ( "id", id );
200 
201  tag.appendChild ( *element );
202  delete element;
203 }
204 
205 void
208  const XyPlotter & plotter )
209 {
210  const FontBase * font = plotter.titleFont ();
211  if ( font != 0 ) {
212  XmlElement * element = m_font -> createElement ();
213  const string t ( "t" );
214  element -> setAttribute ( m_axis, t );
215  m_font -> setAttributes ( *element, *font );
216  tag.appendChild ( *element );
217  delete element;
218  }
219 
220  for ( unsigned int i = 0; i < 3; i++ ) {
221  Axes::Type type = Axes::convert ( i );
222  createFontElement ( tag, plotter, type );
223  }
224 }
225 
226 void
229  const XyPlotter & plotter,
230  hippodraw::Axes::Type axis )
231 {
232  const FontBase * font = plotter.labelFont ( axis );
233  if ( font != 0 ) {
234  XmlElement * element = m_font -> createElement ();
235  string s;
236  switch ( axis )
237  {
238  case Axes::X :
239  s = "x";
240  break;
241  case Axes::Y :
242  s = "y";
243  break;
244  case Axes::Z :
245  s = "z";
246  break;
247  default:
248  assert ( false );
249  break;
250  }
251  element -> setAttribute ( m_axis, s );
252  m_font -> setAttributes ( *element, *font );
253 
254  tag.appendChild ( *element );
255  delete element;
256  }
257 }
258 
259 void
262  const PlotterBase & plotter,
263  hippodraw::Axes::Type axis )
264 {
265  const AxisModelBase * model = plotter.getAxisModel ( axis );
266  if ( model == 0 ) return;
267 
268  XmlElement * element = m_axismodel->createElement ();
269  string tmp;
270  if ( axis == Axes::X ) {
271  tmp = "x";
272  }
273  else if ( axis == Axes::Y ) {
274  tmp = "y";
275  }
276  else if ( axis == Axes::Z ) {
277  tmp = "z";
278  }
279  element -> setAttribute ( m_axis, tmp );
280  m_axismodel->setAttributes ( *element, *model );
281  tag.appendChild ( *element );
282  delete element;
283 }
284 
286 {
288  const void * addr = reinterpret_cast < const void * > ( & plotter );
289  int id = m_controller -> getId ( addr );
290  setId ( *tag, id );
291 
292  tag->setAttribute ( m_type, plotter.name () );
293 
294  const string & title = plotter.getInternalTitle ();
295  const string & x_label = plotter.getInternalLabel ( Axes::X );
296  const string & y_label = plotter.getInternalLabel ( Axes::Y );
297  const string & z_label = plotter.getInternalLabel ( Axes::Z );
298 
299  tag -> setAttribute ( m_title, title );
300  tag -> setAttribute ( m_x_label, x_label );
301  tag -> setAttribute ( m_y_label, y_label );
302  tag -> setAttribute ( m_z_label, z_label );
303 
304  PlotterBase * parent = plotter.getParentPlotter ();
305  if ( parent != 0 ) {
306  const void * addr = reinterpret_cast < const void * > ( parent );
307  int ref = m_controller -> getId ( addr );
308  tag -> setAttribute ( "ref", ref );
309  int index = plotter.getParentDataRepIndex ( );
310  tag -> setAttribute ( m_pindex, index );
311  }
312 
313  createChildren ( *tag, plotter );
314 
315  return tag;
316 }
317 
319 {
320  PlotterBase * plotter = createPlotter ( plot_element );
321 
322  if ( plotter == 0 ) return 0;
323 
324  const XmlElement * element = m_transform_xml->getNode ( plot_element );
325  if ( element != 0 ) {
326  TransformBase * transform = m_transform_xml->createObject ( element );
327  plotter->setTransform ( transform );
328  }
329 
330  createAxisModels ( plot_element, plotter );
331  createFontObjects ( plot_element, plotter );
332 
333  list < XmlElement * > nodelist;
334  m_datarep->fillNodeList ( plot_element, nodelist );
335 
337  DataRep * rep = 0;
338 
339 #ifdef ITERATOR_MEMBER_DEFECT
340  std::
341 #endif
342  list < XmlElement * > ::const_iterator first = nodelist.begin ();
343  for ( ; first != nodelist.end(); ++first ) {
344  XmlElement * element = *first;
345  int id = element->getID ();
346  rep = m_controller->getDataRep ( id );
347  if ( rep == 0 ) {
348  string what ( "Unable to find data representation" );
349  throw DataRepException ( what );
350  }
351 
352  assert ( rep );
353  handleFunction ( element, rep );
354  controller->addDataRep ( plotter, rep );
355  }
356 
357  CutPlotter * cutplotter = dynamic_cast < CutPlotter * > ( plotter );
358  if ( cutplotter != 0 ) {
359  cutplotter -> addTupleCut ( rep );
360  handleCutPlotter ( plot_element, cutplotter );
361  }
362 
363  TextPlotter * textplotter = dynamic_cast < TextPlotter * > ( plotter );
364  if ( textplotter != 0 ) {
365  if ( ! ( handleTextPlotter ( plot_element, textplotter ) ) ){
366  return 0;
367  }
368  }
369 
370  return plotter;
371 }
372 
373 void
375 createFontObjects ( const XmlElement * plot_element, PlotterBase * plotter )
376 {
377  list < XmlElement * > nodelist;
378  m_font -> fillNodeList ( plot_element, nodelist );
379  if ( nodelist.empty () == false ) {
380  XyPlotter * xypl = dynamic_cast < XyPlotter * > ( plotter );
381  assert ( xypl );
382 
383  list < XmlElement * > ::const_iterator first = nodelist.begin ();
384 
385  while ( first != nodelist.end () ) {
386  XmlElement * element = *first++;
387  FontBase * font = m_controller -> createFont ();
388  m_font -> setAttributes ( element, font );
389  Axes::Type axis = m_font -> getAxis ( element, m_axis );
390  if ( axis == Axes::T ) {
391  xypl -> setTitleFont ( font );
392  }
393  else {
394  xypl -> setLabelFont ( font, axis );
395  }
396  }
397  }
398 }
399 
400 void
402 createAxisModels ( const XmlElement * pl_element, PlotterBase * plotter )
403 {
404  list < XmlElement * > nodelist;
405  m_axismodel->fillNodeList ( pl_element, nodelist );
406  if ( nodelist.empty () == false ) {
407 
408 #ifdef ITERATOR_MEMBER_DEFECT
409  std::
410 #endif
411  list < XmlElement * > :: const_iterator first = nodelist.begin();
412  for ( ; first != nodelist.end (); ++first ) {
413  XmlElement * element = *first;
414  Axes::Type axis = m_axismodel->getAxis ( element, m_axis );
415  if ( axis == Axes::Z ) plotter -> setEnableZ ( true );
416  AxisModelBase * model = plotter->getAxisModel ( axis );
417 
418  if ( m_axismodel->isLog ( element ) == true ) {
419  AxisLoc label = model->getLabelLocation();
420  AxisLoc scale = model->getScaleLocation ();
421  AxisModelBase * tmp = new AxisModelLog ( label, scale );
422  std::swap ( tmp, model );
423  delete tmp;
424  plotter->setAxisModel ( model, axis );
425  } // log case
426 
427  m_axismodel->setAttributes ( model, element );
428  }
429  }
430 }
431 
433 {
434  string type;
435  bool ok = element->attribute ( m_type, type );
436  assert ( ok );
437 
438  bool has_Z = type == "XYColorPlotter";
439  if ( type == "XYPlotter" ||
440  type == "XYColorPlotter" ) { // old names of current class
441  type = "XyPlotter";
442  }
443  PlotterBase * plotter = 0;
445  try {
446  plotter = factory->create ( type );
447  if ( has_Z ) plotter ->setEnableZ ();
448  int id = element -> getID ();
449  m_controller -> registerPlotter ( id, plotter );
450 
451  string value;
452  bool needMargin;
453 
454  ok = element -> attribute ( m_title, value );
455  plotter -> setTitle ( value );
456  needMargin = String::ci_find(value, "tex:")==0;
457  plotter->setTopMargin(needMargin?10.0:0.0);
458 
459  ok = element -> attribute ( m_x_label, value );
460  plotter -> setLabel ( Axes::X, value );
461  needMargin = String::ci_find(value, "tex:")==0;
462  plotter->setBottomMargin(needMargin?8.0:0.0);
463 
464  ok = element -> attribute ( m_y_label, value );
465  plotter -> setLabel ( Axes::Y, value );
466  needMargin = String::ci_find(value, "tex:")==0;
467  plotter->setLeftMargin(needMargin?0.0:0.0);
468 
469  ok = element -> attribute ( m_z_label, value );
470  plotter -> setLabel ( Axes::Z, value );
471  needMargin = String::ci_find(value, "tex:")==0;
472  plotter->setZMargin(needMargin?7.0:0.0);
473 
474  int index;
475  ok = element -> attribute ( m_pindex, index );
476  if ( ok ) {
477  plotter -> setParentDataRepIndex ( index );
478  }
479  }
480  catch ( const FactoryException & ) {
481  assert ( false );
482  }
483 
484  return plotter;
485 }
486 
487 void
489 getCutTargets ( const XmlElement * plot_element, CutPlotter * plotter )
490 {
491  list < XmlElement * > nodelist;
492  plot_element->fillNodeList ( "CutTarget", nodelist );
493  if ( nodelist.empty() ) return;
494 
495 #ifdef ITERATOR_MEMBER_DEFECT
496  std::
497 #endif
498  list < XmlElement * > :: const_iterator first = nodelist.begin();
499  for ( ; first != nodelist.end(); ++first ) {
500  XmlElement * element = *first;
501  int ref = element->getID ();
502  DataRep * target = m_controller->getDataRep ( ref );
503  if ( target != 0 ) { // may not be part of copy/paste
504  ProjectorBase * pb = target -> getProjector ();
505  NTupleProjector * projector
506  = dynamic_cast < NTupleProjector * > ( pb );
507 
508  const vector < TupleCut > & cuts = plotter -> getCuts ();
509  for ( unsigned int i = 0; i < cuts.size(); i++ ) {
510  projector -> addCut ( &cuts[i] );
511  }
512  target -> setDirty ( true );
513  plotter->addCutTarget ( target );
514  }
515  }
516 }
517 
520 void PlotterBaseXML::handleFunction ( const XmlElement * dr_element,
521  DataRep * rep )
522 {
523  FunctionRep * frep = dynamic_cast < FunctionRep * > ( rep );
524  if ( frep == 0 ) return;
525 
526  XmlElement * element = dr_element->getNode ( "FunctionTarget" );
527  int id = element->getID ();
528  DataRep * target = m_controller->getDataRep ( id );
529  assert ( target );
530  frep->setTarget ( target );
531 }
532 
536 void
538 handleCutPlotter ( const XmlElement * plot_element, CutPlotter * plotter )
539 {
540  vector < const TupleCut * > cuts;
541 // const XmlElement * element = m_tuple_cut_xml->getNode ( plot_element );
542 
543  list < XmlElement * > node_list;
544  m_tuple_cut_xml -> fillNodeList ( plot_element, node_list );
545  list < XmlElement * >::const_iterator first = node_list.begin();
546 
547  while ( first != node_list.end() ) {
548  const XmlElement * element = *first++;
549  unsigned int a = 0;
550  // bool ok =
551  element -> attribute ( "axis", a );
552  Axes::Type axis = Axes::convert ( a );
553  const string & label = plotter -> getLabel ( axis );
554 
555  int id = element->getID ();
556  const TupleCut * tuplecut = m_controller->getTupleCut ( id );
557  TupleCut * tc = const_cast < TupleCut * > ( tuplecut );
558  tc -> setLabel ( label );
559  cuts.push_back ( tuplecut );
560  tuplecut = m_controller -> getTupleCut ( -id ); // old multiDim
561  if ( tuplecut != 0 ) {
562  cuts.push_back ( tuplecut );
563  }
564  }
565  plotter->setCuts ( cuts );
566 
567  getCutTargets ( plot_element, plotter );
568 }
569 
570 int
572 handleTextPlotter ( const XmlElement * plot_element, TextPlotter * plotter )
573 {
574 
575  XmlElement * element = plot_element->getNode ( "TextTarget" );
576  int id = element->getID ();
577  DataRep * target = m_controller->getDataRep ( id );
578 
579  if ( !target ){
580  return 0;
581  }
582 
583  assert ( target );
584  plotter->setParentDataRep ( target );
585 
586  return 1;
587 }
virtual bool attribute(const std::string &name, bool &value) const =0
Sets value to the attribute name&#39;s value.
TupleCutXML class interface.
static DisplayController * instance()
Returns the pointer to the singleton instance.
virtual PlotterBase * getParentPlotter() const
Returns the parent plotter.
XmlController * m_controller
The singleton XML controller object.
Definition: BaseXML.h:60
A Plotter class that plots one-dimensional TupleCut values.
Definition: Cut1DPlotter.h:34
Given a range, calculates a model for an axis with a log scale.
Definition: AxisModelLog.h:27
void fillNodeList(const XmlElement *element, std::list< XmlElement * > &nodelist)
Fills the nodelist with immediate child nodes of element with nodes that can be handled by this objec...
Definition: BaseXML.cxx:58
A abstract base class for font handling.
Definition: FontBase.h:32
Cut1DPlotter class interface.
hippodraw::NTupleProjector class interface
A base class that is the interface between GUI and the XML serialization and deserialization.
Definition: XmlController.h:53
void handleCutPlotter(const XmlElement *element, CutPlotter *plotter)
Handles the Cut attributes from the XML element.
TransformXML class interface.
void createFontObjects(const XmlElement *, PlotterBase *plotter)
Creates the FontBase objects, if any.
static XmlDocument * m_xml_doc
The current document being generated or read.
AxisModelXML class interface.
hippodraw::XyPlotter class interface
int handleTextPlotter(const XmlElement *element, TextPlotter *plotter)
Handles the TextPlotter special attributes from the XML element.
virtual PlotterBase * getObject(const XmlElement *element)
Returns the PlotterBase object represented by the element.
void handleFunction(const XmlElement *element, hippodraw::DataRep *rep)
Handles the DataRep object if it is FunctionRep.
std::string m_title
The attribute name for the plot title.
Type
Axes constants.
Definition: AxesType.h:31
virtual void setBottomMargin(double bottom)
const TupleCut * getTupleCut(int ref_id)
Returns pointer to the TupleCut from the xml reference Id.
std::string m_z_label
The attribute name for Z axis label.
A base class of XML element controllers.
Definition: BaseXML.h:35
TupleCutXML * m_tuple_cut_xml
The TupleCutXML instance used by this object.
const std::vector< TupleCut > & getCuts() const
Returns the list of TupleCut objects used by this plotter.
Definition: CutPlotter.cxx:191
A Plotter class that plots one-dimensional TupleCut values.
Definition: Cut2DPlotter.h:40
const XmlElement * getNode(const XmlElement *element) const
Returns the single child node of element of the type that can be handled by this object.
Definition: BaseXML.cxx:53
const std::string m_type
The attribute name for the type of object.
Definition: BaseXML.h:54
TextPlotter class interface.
virtual void setAxisModel(AxisModelBase *, Axes::Type)=0
Sets the AxisModel on the specified axis.
void addDataRep(PlotterBase *plotter, DataRep *rep)
Adds DataRep rep to the PlotterBase plotter.
AxisModelLog class interface.
virtual int getNumDataReps() const
Returns the number of DataRep objects contained in the plot.
XmlElement * createElement(const hippodraw::DataRep &rep)
Returns a newly created XML element with its attributes set.
Definition: DataRepXML.cxx:73
virtual const std::string & getInternalTitle() const
Returns the internal title.
A singleton class that is the interface between GUI and the displays.
virtual void setLeftMargin(double left)
DataRep * getDataRep(int ref)
Returns a pointer to the DataRep from the xml reference Id.
PointRepXML class interface.
void setCuts(const std::vector< const TupleCut * > &cuts)
Sets the TupleCut objects to be used by this plotter.
Definition: CutPlotter.cxx:197
void setAttributes(XmlElement &tag, const AxisModelBase &plotter)
Sets the attributes of the XmlElement tag from information in the AxisModel object plotter...
A Plotter class that draws text.
Definition: TextPlotter.h:38
std::string m_pindex
The attribute name used to save and restore index of parent DataRep.
Namespace for HippoDraw.
Definition: AxesType.cxx:21
const std::string & name() const
Returns the name of the plotter.
Definition: PlotterBase.cxx:83
void createFontElements(XmlElement &tag, const XyPlotter &plotter)
Creates all the font elements, if needed.
hippodraw::FunctionRep class interface
DataRepXML * m_datarep
The DataRepXML instance used by this object.
FontXML * m_font
The FontXML instance used by this object.
The base class for data representations.
Definition: DataRep.h:68
The namespace for conversion to string.
PlotterBaseXML class interface.
hippodraw::TupleCut class interface
void createCutChildren(XmlElement &, const CutPlotter &plotter)
Creates the child elements for the special case when the plotter is a derived class of CutPlotter...
A class that is does XML serialization and deserialization of derived classes of FontBase.
Definition: FontXML.h:30
bool areDataSourcesSaved(const PlotterBase *)
Returns true if all the NTuple Objects used by the plotter are save to or read from a file...
virtual int getParentDataRepIndex() const
Returns the index of the parent DataRep.
void createChildren(XmlElement &, const PlotterBase &)
Creates the children elements.
hippodraw::FunctionController class interface
Type * create(const std::string &name)
Creates a new object from a prototype named name.
Definition: Factory.h:160
void createAxisModels(const XmlElement *element, PlotterBase *plotter)
Re-creates AxisModelBase objects from the XML element.
virtual void setAttribute(const std::string &name, bool value)=0
Sets attribute named name to the int value value.
Type convert(const std::string &axis)
Converts from string representation ot Axes::Type representation.
Definition: AxesType.cxx:32
static FunctionController * instance()
Returns the pointer to the singleton instance.
bool areDataSourcesSaved(const PlotterBase &plotter)
Returns true if all the NTuple objects used by the plotter are save to or read from a file...
A class XML creation and parsing of XmlElement for Transform class.
Definition: TransformXML.h:28
The base class for the PlotterBase hierarchy.
Definition: PlotterBase.h:55
virtual FontBase * labelFont(Axes::Type axes) const
What font is being used to override the default while drawing axis label.
Definition: XyPlotter.cxx:243
TransformXML * m_transform_xml
The TransfromXML instance used by this object.
virtual void setTopMargin(double top)
Set and get additional margin on top,bottom,left of the plotter.
virtual void setEnableZ(bool yes=true)
Enables the Z axis, if plotter has one.
AxisLoc
The base class for the binner hierarchy.
Definition: AxisLoc.h:17
STL namespace.
PyArray_TYPES type(numeric::array arr)
Definition: num_util.cpp:249
DisplayController class interface declaration.
void addCutTarget(DataRep *rep)
Adds a DataRep to the list of targets.
Definition: CutPlotter.cxx:223
static PlotterFactory * instance()
Returns the pointer to the singleton instance.
virtual void setTransform(TransformBase *)
Sets the transform object.
void setTarget(DataRep *rep)
Sets the target for the FunctionRep.
The base class for the Projector hierarchy.
Definition: ProjectorBase.h:56
virtual const FontBase * titleFont() const
What font is being used to override the default while drawing title of plot.
Definition: XyPlotter.cxx:266
A pure virtual base class of XML element wrapper.
Definition: XmlElement.h:30
XmlDocument class interface.
AxisLoc getScaleLocation() const
void createFontElement(XmlElement &tag, const XyPlotter &plotter, hippodraw::Axes::Type axis)
Creates an element for label font.
An NTupleProjector is a projector that projects data from an DataSource object.
An exception class that is thrown when the factory fails to find the request class by its name...
A transform that transforms coordinates from one coordinate system to another.
Definition: TransformBase.h:35
This Singleton class maintains a list of plotters.
A PlotterBase derived class that serves a base class for cut plotters.
Definition: CutPlotter.h:43
FontXML class interface.
A class that is does XML serialization and de-serialization of derived classes of AxisModelBase with ...
Definition: AxisModelXML.h:31
virtual XmlElement * createElement(const std::string &tagName)=0
Creates a new DOM element wrapper object and returns a pointer to it.
const std::list< DataRep *> & getCutTargets() const
Get the list of targets.
Definition: CutPlotter.cxx:231
void getCutTargets(const XmlElement *element, CutPlotter *plotter)
Searches for and connects up the target DataRep objects of the plotter.
const hippodraw::DataRep * getParentDataRep() const
Returns the target DataRep of its own TextDataRep object.
A singleton class is the interface between an application and the list of FunctionRep objects contain...
XmlController class interface.
virtual XmlElement * getNode(const std::string &tagName) const =0
Returns the single direct child element node with name tagName.
A class that is does XML serialization and de-serialization of derived classes of DataRep...
Definition: DataRepXML.h:46
PlotterBase * createPlotter(const XmlElement *element)
Creates the plotter object from the XML element.
void createAxisModel(XmlElement &, const PlotterBase &, hippodraw::Axes::Type axis)
Creates an axis model child element for the specified axis.
XmlElement * createElement(const TransformBase &view)
Returns a newly created XmlElement with attributes set for view.
A Plotter class that plots points in 2 dimensions and option a third dimension in color...
Definition: XyPlotter.h:44
AxisLoc getLabelLocation() const
bool isLog(const XmlElement *element)
Returns true if the element represents an axis model that is on a logarithmic scale.
hippodraw::DataRepXML class interface
PlotterBaseXML(const PlotterBaseXML &)
A private copy constructor in order to avoid copying.
hippodraw::Axes::Type getAxis(const XmlElement *element, const std::string &tagname)
Returns the Axis attribute value.
void setParentDataRep(hippodraw::DataRep *)
Sets the target DataRep of its own TextDataRep object.
void createTextChildren(XmlElement &, const TextPlotter &plotter)
Creates the child elements for the special case when the plotter is a TextPlotter.
hippodraw::Cut2DPlotter class interface
PointRepXML * m_pointrep
The PointRepXML instance used by this object.
An xception class that is thrown when attempting to bind a DataRep to a NTuple with a column name tha...
A singleton class that is does XML serialization and de-serialization of derived classes of RepBase...
Definition: PointRepXML.h:30
virtual TransformBase * getTransform() const
Returns the transform object used by the plotter.
size_t ci_find(const string &str1, const string &str2)
Case insensitive find.
void setId(XmlElement &tag, int id)
Sets the unique identification of the object.
Definition: BaseXML.cxx:64
virtual const std::string & getInternalLabel(Axes::Type axis) const
Returns the internal label.
std::string m_axis
The attribute name of labeling an axis for the AxisModelBase elements.
virtual DataRep * getDataRep(int index) const
Returns the specified DataRep or null pointer if it doesn&#39;t exits.
virtual int getID() const =0
Returns the ID of the element, if it has one.
virtual AxisModelBase * getAxisModel(Axes::Type axis) const
Returns the AxisModelBase derived class for the specified axis.
virtual bool hasAxis(Axes::Type axis) const
Returns true if the plotter has an axis of specified type.
std::string m_x_label
The attribute name for X axis label.
XmlElement class interface.
XmlElement * createElement()
Creates a new element node.
Definition: BaseXML.cxx:43
std::string m_y_label
The attribute name for Y axis label.
~PlotterBaseXML()
The destructor.
A derived class of DataRep which is a base class for displaying a function.
Definition: FunctionRep.h:34
The AxisModelBase class maintains the Range and scaling of an axis.
Definition: AxisModelBase.h:33
virtual void appendChild(const XmlNode &child)=0
Appends a child element to the element.
virtual TransformBase * createObject(const XmlElement *element)
Creates an object derived from TransformBase.
The class expresses a cut on a DataSource, i.e.
Definition: TupleCut.h:43
AxisModelXML * m_axismodel
The AxisModelXML instance used by this object.
A class that is does XML serialization and de-serialization of derived classes of TupleCut...
Definition: TupleCutXML.h:32
virtual void fillNodeList(const std::string &tagName, std::list< XmlElement * > &nodeList) const =0
Fills the nodeList with elements with tag name tagName.
virtual void setZMargin(double z)

Generated for HippoDraw Class Library by doxygen