DataRep.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*- */
2 
14 #ifndef _DataRep_H_
15 #define _DataRep_H_
16 
17 #include "pattern/Observable.h"
18 #include "pattern/Observer.h"
19 
20 #include "axes/AxesType.h"
21 #include "axes/Range.h"
22 
23 #ifdef _MSC_VER
24 #include "datasrcs/TupleCut.h"
25 #endif
26 
27 #include "graphics/Color.h"
28 
29 namespace hippodraw {
30 
31  class AxisModelBase;
32  class Color;
33  class CutRangeRep;
34  class DataSource;
35  class NTuple;
36  class ProjectorBase;
37  class RepBase;
38  class TransformBase;
39  class TupleCut;
40  class ViewBase;
41 
69  : public Observable, public Observer
70 {
71 
72 protected:
73 
76  std::string m_name;
77 
82  std::string m_title;
83 
91 
95 
100 
104 
106  DataRep ( );
107 
109  DataRep ( const DataRep & );
110 
113  void drawCuts ( TransformBase * transform, ViewBase * view );
114 
117  void throwRangeException ();
118 
119  public:
120 
122  virtual ~DataRep();
123 
126  virtual DataRep * clone () = 0;
127 
129  const std::string & name () const;
130 
138  virtual bool hasAxis ( Axes::Type axis ) const;
139 
146  void setTitle ( const std::string & title );
147 
150  const std::string & getTitle () const;
151 
153  virtual void update ( const Observable * );
154 
161  virtual bool hasErrorDisplay ( ) const;
162 
165  virtual bool hasNTupleBindings () const;
166 
173  virtual void setAxisBinding ( const std::string & axis,
174  const std::string & label );
175 
182  virtual
183  void setAxisBindings ( const std::vector < std::string > & bindings );
184 
192  virtual void matrixTranspose ( bool yes );
193 
202  virtual void drawProjectedValues ( TransformBase * transform,
203  ViewBase * view );
204 
207  double getPosRange ( Axes::Type axis );
208 
210  RepBase * getRepresentation () const;
211 
213  const Color & getRepColor () const;
214 
217  bool isDirty () const;
218 
220  bool isErrorDisplayed ( Axes::Type ) const;
221 
228  Range preferredRange ( Axes::Type axis ) const;
229 
231  void setAxisModel ( Axes::Type axis, AxisModelBase * );
232 
235  void setErrorDisplay ( Axes::Type axis, bool );
236 
242  virtual void setPointRep ( RepBase * pointrep );
243 
245  void setRepColor ( const Color & );
246 
248  void setRepSize ( double size );
249 
252  void setRepStyle ( int style );
253 
254 
257  virtual void setDirty ( bool yes = true );
258 
262  void setRange ( Axes::Type axis, bool const_width = true );
263 
264 
266  virtual ProjectorBase * getProjector ( ) const;
267 
272  virtual void setSelected ( bool yes = true );
273 
277  virtual bool isSelected ( ) const;
278 
284  virtual bool acceptFunction ( int number );
285 
288  virtual bool hasZeroRows ( );
289 
292  virtual bool hasZoomY () const;
293 
294 
300  virtual void addValues ( const std::vector < double > & v );
301 
304  virtual const DataSource * getProjectedValues () const;
305 
308  virtual NTuple * getNTupleAfterCuts () const;
309 
313  virtual void fillColumnAfterCuts(const std::string & column,
314  std::vector<double> & columnData) const;
315 
319  NTuple * createNTupleUnderRegion () const;
320 
324  virtual double getMean ( const std::string & axis );
325 
329  virtual double getRMS ( const std::string & axis );
330 
334  bool isAxisBinned ( Axes::Type axis ) const;
335 
337  virtual DataRep * getParentDataRep() const;
338 
340  virtual void setParentDataRep( DataRep * parent_datarep );
341 
347  virtual void update ();
348 
351  virtual void normalizeTo ( const DataRep * target );
352 
356  const Range & setBinWidth ( Axes::Type axis, double width );
357 
360  int getNumberOfEntries () const;
361 
369  virtual bool isTargetable () const;
370 
374  NTuple * createNTuple () const;
375 
379  virtual bool needColorRep() const;
380 
384  bool hasCut () const;
385 
388  void addCut ( const TupleCut & cut );
389 
392  void addCut ();
393 
396  void removeCut ();
397 
400  const std::vector < TupleCut > & getCuts () const;
401 
404  RepBase * getCutRep ();
405 
408  void set ( Color::Value value );
409 
412  void setCutRangeAt ( const Range & range, unsigned int i );
413 
417  void toggleInverted ( unsigned int i );
418 
421  void setEnabled ( unsigned int i, bool yes = true );
422 
428  virtual bool needsMatrixSet () const;
429 
435  virtual bool isImageConvertable () const;
436 
437 };
438 
439 } // namespace hippodraw
440 
441 #endif // _DataRep_H_

Generated for HippoDraw Class Library by doxygen