DisplayController.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*- */
13 #ifndef _DisplayController_H_
14 #define _DisplayController_H_
15 
16 #include "axes/AxesType.h"
17 
18 #ifdef _MSC_VER
19 #include <msdevstudio/MSconfig.h>
20 #endif
21 
22 #include <list>
23 #include <vector>
24 
25 namespace hippodraw {
26 
27 class AxisModelBase;
28 class DataRep;
29 class DataSource;
30 class LineDataRep;
31 class NTuple;
32 class NTupleProjector;
33 class PlotterBase;
34 class ProjectorBase;
35 class Range;
36 class XYTransform;
37 class ViewBase;
38 class ViewFactory;
39 
40 using std::vector;
41 
64 {
65 
66 private:
67 
70 
74  std::string m_null_string;
75 
78  std::vector< std::string > m_null_vector;
79 
83  PlotterBase * createPlotter ( const hippodraw::DataRep * rep ) const;
84 
90  void fixLogIfBinned ( const PlotterBase *, hippodraw::DataRep * rep ) const;
91 
94  NTupleProjector * getBindingProjector ( const PlotterBase * ) const;
95 
101  getUniqueWithNTupleBindings ( const PlotterBase * plotter );
102 
104  ProjectorBase * getProjector ( const PlotterBase * display ) const;
105 
108  bool isCompatible ( const PlotterBase * plotter,
109  const std::string & type ) const;
110 
117  void setBinner ( const PlotterBase * plotter,
118  DataRep * rep,
119  Axes::Type axis ) const;
120 
122  void setBinner ( PlotterBase * plotter,
123  Axes::Type axis );
124 
129  void setAxisModel ( PlotterBase * plotter,
130  Axes::Type axis,
131  const std::string & type );
132 
134  void setAxisModelWithoutSetBin ( PlotterBase * plotter,
135  Axes::Type axis,
136  const std::string & type );
146  void setBinWidth ( PlotterBase * plotter,
147  Axes::Type axis,
148  double width );
149 
152 
156 
157 public:
158 
160  static DisplayController * instance ();
161 
164 
168  const std::string & getDataSourceName ( const PlotterBase * plotter,
169  int index );
170 
172  const std::vector < std::string > & getDisplayTypes () const;
173 
176  void setValueTransform ( PlotterBase * plotter, const std::string & name );
177 
180  void setValueTransform ( PlotterBase * plotter, int index );
181 
184  void addValueTransform ( const std::string & name,
185  const std::vector < double > & ctrl_points );
186 
192  bool removeValueTransform ( const std::string & name );
193 
198  void saveValueCtrlPts( PlotterBase *plotter,
199  const std::vector <double> & sv);
200 
201 
205  const std::vector <double> & getValueCtrlPts ( const PlotterBase * plotter);
206 
209  void setValueCtrlPts ( PlotterBase * plotter,
210  const std::vector < double > & sv);
211 
212 
216  int getValueTransformIndex ( PlotterBase * plotter );
217 
220  const std::vector < std::string > & getValueTransformTypes () const;
221 
227  bool hasControlPoints ( const PlotterBase * plotter ) const;
228 
231  bool isUserDefinedValueTransform ( const PlotterBase * plotter ) const;
232 
234  const std::vector < std::string > & getTextTypes () const;
235 
242  PlotterBase *
243  createDisplay ( const std::string & name );
244 
251  PlotterBase * createDisplay ( hippodraw::DataRep * rep );
252 
259  PlotterBase *
260  createDisplay ( const std::string & name,
261  const DataSource & tuple,
262  const std::vector< std::string > & bindings ) const;
263 
264  NTuple *
265  createNTupleDiff ( PlotterBase * plotter );
266 
270  PlotterBase * createDifferenceDisplay ( PlotterBase * plotter ) ;
271 
274  const std::string & getType ( const PlotterBase * plotter,
275  int index ) const;
276 
281  int getNumberOfEntries ( const PlotterBase * plotter, int index = 0 ) const;
282 
286  int getUnderflow ( const PlotterBase * plotter, int index = 0 ) const;
287 
291  int getOverflow ( const PlotterBase * plotter, int index = 0 ) const;
292 
298  double getAverage ( const PlotterBase * plotter,
299  const std::string & axis, int index = 0 ) const;
300 
306  double getAverage ( const PlotterBase * plotter,
307  Axes::Type axis, int index = 0 ) const;
308 
312  double getRMS ( const PlotterBase * plotter,
313  const std::string & axis, int index = 0 ) const;
314 
318  double getRMS ( const PlotterBase * plotter,
319  Axes::Type axis, int index = 0 ) const;
320 
329  void setPointRep ( PlotterBase * plotter,
330  const std::string & point_rep );
331 
334  unsigned int getRepStyle ( const PlotterBase * plotter ) const;
335 
338  void addDataRep ( PlotterBase *, hippodraw::DataRep * ) const;
339 
342  void stackDataRep ( PlotterBase *, hippodraw::DataRep * ) const;
343 
352  addDataRep ( PlotterBase * plotter,
353  const std::string & name,
354  const DataSource * source,
355  const std::vector< std::string > & bindings ) const;
356 
365  addDataRepStacked ( PlotterBase * plotter,
366  const std::string & name,
367  const DataSource * source,
368  const std::vector < std::string > & bindings ) const;
369 
372  LineDataRep * addLineRep ( PlotterBase *,
373  const std::string & axis,
374  double value );
375 
378  LineDataRep * addLineRep ( PlotterBase *,
379  Axes::Type,
380  double value );
381 
386  void setErrorDisplayed ( const PlotterBase *,
387  Axes::Type axis, bool state ) const;
388 
392  void addTextViewToList ( std::vector < const ViewBase * > & destination,
393  const std::vector < const ViewBase * > & source );
394 
396  void removeTextObservers ( const std::vector < const ViewBase * > & views );
397 
401  createTextDataRep ( const std::string & type,
402  const std::string & text = std::string() );
403 
409  ViewBase * createTextView ( const ViewFactory * factory,
410  hippodraw::DataRep * rep,
411  const std::string & name,
412  const std::string & text = std::string () );
413 
420  ViewBase * createTextView ( const ViewFactory * factory,
421  PlotterBase * plotter,
422  const std::string & name,
423  const std::string & text = 0);
424 
428  PlotterBase * createTextPlotter ( hippodraw::DataRep * datarep,
429  const std::string & name,
430  const std::string & text = std::string() );
431 
436  int activeDataRepIndex ( const PlotterBase * plotter ) const;
437 
443  hippodraw::DataRep * activeDataRep ( const PlotterBase * plotter ) const;
444 
449  void setActiveDataRepIndex ( PlotterBase * plotter,
450  int index );
451 
454  bool hasNTupleBindings ( const PlotterBase * plotter, int index );
455 
458  bool areDataSourcesSaved ( const PlotterBase * );
459 
464  DataSource * getDataSource ( const PlotterBase * plotter );
465 
470  DataSource * getDataSource ( const PlotterBase *, int index );
471 
474  const std::vector < std::string > &
475  getDataSourceLabels ( const PlotterBase * plotter, int index );
476 
479  void setNTuple ( PlotterBase * , const NTuple * ) const;
480 
483  const std::vector < std::string > &
484  bindingOptions ( const std::string & type );
485 
488  const std::vector < std::string > &
489  bindingOptions ( const PlotterBase * plottter, int index );
490 
494  const std::vector< std::string > &
495  axisBindings ( const PlotterBase * plotter ) const;
496 
500  const std::vector< std::string > &
501  axisBindings ( const PlotterBase * plotter, int index ) const;
502 
506  void setAxisBinding ( PlotterBase *,
507  const std::string & axis,
508  const std::string & label );
509 
511  void setAxisBindings ( PlotterBase * plotter,
512  const std::vector< std::string > & labels ) const;
513 
517  bool isDataValid ( const PlotterBase * ) const;
518 
522  bool isDataValid ( const hippodraw::DataRep * ) const;
523 
526  bool getLog ( const PlotterBase * plotter, const std::string & axis ) const;
527 
530  bool getLog ( const PlotterBase * plotter,
531  Axes::Type axis ) const;
532 
537  void setLog ( PlotterBase * plotter,
538  const std::string & axis,
539  bool flag );
540 
549  void setLog ( PlotterBase * plotter,
550  Axes::Type axis,
551  bool flag );
552 
558  void setLog ( PlotterBase * plotter,
559  Axes::Type axis,
560  bool flag,
561  XYTransform * transform );
562 
566  void setTransformAxis ( PlotterBase * plotter,
567  const std::string & x,
568  const std::string & y);
569 
571  void setTransform ( PlotterBase * plotter,
572  const std::string & name );
573 
575  void setTransform ( PlotterBase * plotter,
576  const std::string & x,
577  const std::string & y );
578 
580  void setTransform ( PlotterBase * plotter,
581  const std::string & x,
582  const std::string & y,
583  const std::string & z );
584 
586  void remove ( PlotterBase * );
587 
589  float pointSize ( const PlotterBase * ) const;
590 
594  bool hasSymbolRep ( const PlotterBase * plotter ) const;
595 
599  bool hasLineRep ( const PlotterBase * plotter ) const;
600 
601 
603  void setRepSize ( PlotterBase * plotter, float size );
604 
607  void setIntervalCount ( const PlotterBase * plotter,
608  unsigned int count );
609 
612  void setIntervalEnabled ( const PlotterBase * plotter, bool yes );
613 
616  void setAllIntervalEnabled ( const PlotterBase * plotter, bool yes );
617 
619  void setRange ( PlotterBase * plotter,
620  Axes::Type axis,
621  const Range & range );
622 
630  void setBinWidth ( PlotterBase * plotter,
631  const std::string & axis,
632  double width );
633 
636  void setBinWidth ( DataRep * datarep,
637  Axes::Type axis,
638  double width );
639 
641  void setOffset ( PlotterBase * plotter,
642  const std::string & axis,
643  int parm,
644  bool dragging );
645 
647  void setOffset ( PlotterBase * plotter,
648  Axes::Type axis,
649  double offset );
650 
654  bool isAxisBinned ( PlotterBase * display, const std::string & axis );
655 
661  void createNTuple ( const PlotterBase * plotter );
662 
663 };
664 
665 } // namespace hippodraw
666 
667 #endif // _DisplayController_H_

Generated for HippoDraw Class Library by doxygen