QtDisplay.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*- */
2 
14 #ifndef _QtDisplay_H_
15 #define _QtDisplay_H_
16 
17 #include "axes/AxesType.h"
18 
19 #include <vector>
20 #include <map>
21 
22 namespace boost {
23  namespace python {
24  class list;
25  class tuple;
26  }
27 }
28 
29 namespace hippodraw {
30 
31 class DataRep;
32 class Observer;
33 class PyFunctionRep;
34 class PyDataRep;
35 class PyDataSource;
36 class PyFunctionRep;
37 class PlotterBase;
38 #ifndef BOOST_DEFECT
39 class FunctionBase;
40 #endif
41 class RepBase;
42 class DataSource;
43 class NTuple;
44 class PyNTuple;
45 class QtRootNTuple;
46 
71 class QtDisplay
72 {
73 
74 private:
75 
78  mutable std::vector< PyDataRep * > m_pyDataReps;
79 
81  std::map<std::string, std::pair <double, double> > m_ranges;
82 
84  std::map<std::string, double > m_binWidths;
85 
90  void createDisplay ( const std::string & type,
91  const DataSource & nt,
92  const std::vector < std::string > & bindings );
93 
94 protected:
95 
98 
100  QtDisplay ();
101 
102 public:
103 
106  QtDisplay ( const std::string & type );
107 
110  QtDisplay ( PyFunctionRep * rep );
111 
115  QtDisplay ( const std::string & type,
116  const DataSource & nt,
117  const std::vector< std::string > & bindings );
118 
123  QtDisplay ( const std::string & type,
124  const PyDataSource & nt,
125  const std::vector< std::string > & bindings );
126 
131  QtDisplay ( const std::string & type,
132  const QtRootNTuple & nt,
133  const std::vector< std::string > & bindings );
134 
138  QtDisplay ( const std::string & type,
139  const QtRootNTuple & nt,
140  const std::vector< std::string > & bindings,
141  boost::python::list indices );
142 
146  QtDisplay ( const std::string & type,
148  const std::vector < std::string > & bindings );
149 
153  QtDisplay ( const std::string & type,
155  const std::vector < std::string > & bindings );
156 
158  QtDisplay (PlotterBase * plotter);
159 
160  ~QtDisplay();
161 
163  PlotterBase * display();
164 
174  void addDataRep ( const std::string & type,
175  const DataSource * ntuple,
176  const std::vector < std::string > & bindings );
177 
181  void addDataRepStacked ( const std::string & type,
182  const DataSource * ntuple,
183  const std::vector < std::string > & bindings );
184 
186  void addDataRep ( PyDataRep * pyRep );
187 
189  void addDataRep ( PyFunctionRep * pyFuncRep );
190 
191 #ifndef BOOST_DEFECT
192 
193  void addFunction ( FunctionBase * function );
194 #endif
195 
197  PyDataRep * getDataRep ();
198 
200  const std::vector<PyDataRep *> &getDataReps () const;
201 
204  void setTitle ( const std::string & title );
205 
207  const std::string &getTitle() const;
208 
211  void setLabel ( const std::string & axis, const std::string & label );
212 
214  const std::string & getLabel( const std::string &axis) const;
215 
217  void setNumberOfBins ( const std::string & axis, unsigned int number );
218 
220  double getBinWidth ( const std::string & axis ) const;
221 
223  void setBinWidth ( const std::string & axis, double width,
224  bool save=false );
225 
228  void setBinWidth ( const std::string & axis, double width );
229 
231  void setOffset ( const std::string & axis, double offset );
232 
234  void setRange ( const std::string & axis, double low, double high,
235  bool save=false );
236 
239  void setRange ( const std::string & axis, double low, double high );
240 
242  std::vector<double> getRange ( const std::string & axis );
243 
248  int saveView ();
249 
251  void setView ( int index );
252 
258  int nextView ( bool stepForward = true );
259 
261  int numViews ();
262 
264  void deleteView( int index );
265 
267  int currentView ();
268 
270  void setAutoRanging ( const std::string & axis, bool flag );
271 
274  void setLog ( const std::string & axis, int flag );
275 
277  int getLog ( const std::string & axis );
278 
280  void setTransform ( const std::string & name );
281 
284  void setPointRep ( RepBase * rep );
285 
287  void setContourLevels ( const std::vector<double> &levels );
288 
291  void setAspectRatio ( double ratio );
292 
295  void reset();
296 
298  void addValues ( const std::vector < double > & v );
299 
302  PyNTuple * createNTuple () const;
303 
305  double numberOfEntries () const;
306 
309  void resize();
310 
316  int plotterId() const;
317 
319  void setColorMap ( const std::string & name );
320 
326  void update ();
327 
330  void addObserver ( hippodraw::Observer * observer );
331 
334  void setTicks ( const std::string & axis,
335  const std::vector < double > & values,
336  const std::vector < std::string > & labels );
337 
340  void setAutoTicks ( const std::string & axis, bool yes );
341 
343  void unlock();
344 
349  void applyCut ( QtDisplay * cut );
350 
356  void applyCuts ( const std::vector < QtDisplay * > & cuts );
357 
358 
361  PyDataSource * createDataArray() const;
362 
363 };
364 
365 } // namespace hippodraw
366 
367 #endif // _QtDisplay_H_

Generated for HippoDraw Class Library by doxygen