Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Inspector.h

Go to the documentation of this file.
00001 /* -*- mode: c++ -*- */
00002 
00014 #ifndef _Inspector_H_
00015 #define _Inspector_H_
00016 
00017 #ifdef HAVE_CONFIG_H
00018 #include "config.h"
00019 #endif
00020 
00021 #include <qglobal.h> // for version
00022 #if QT_VERSION < 0x040000
00023 #include "InspectorBase.h"
00024 #else
00025 #include "InspectorUI.h"
00026 //Added by the Qt porting tool:
00027 #endif
00028 
00029 #include "axes/AxesType.h"
00030 #include "axes/Range.h"
00031 
00032 #include <map>
00033 
00034 class CanvasView;
00035 class CanvasWindow;
00036 class DataSourceException;
00037 class DataSource;
00038 class FunctionRep;
00039 class PlotterBase;
00040 class RootNTuple;
00041 class TupleCut;
00042 
00043 class QCustomEvent;
00044 class QVBoxLayout;
00045 
00165 #if QT_VERSION < 0x040000
00166 class MDL_QTHIPPOPLOT_API Inspector : public InspectorBase
00167 {
00168 #else
00169 class MDL_QTHIPPOPLOT_API Inspector : public QDialog, private Ui::InspectorUI
00170 {
00171   Q_OBJECT
00172 #endif
00173 
00174 private:
00175 
00178   std::vector < QLabel * > m_new_labels;
00179 
00182   std::vector  < QComboBox * > m_new_combos;
00183 
00186   std::vector < QLabel * > m_sel_labels;
00187 
00190   std::vector  < QComboBox * > m_sel_combos;
00191 
00192   std::vector < int > m_functionIndexMap;
00193   hippodraw::Axes::Type m_axis;
00194   std::vector < double > m_oldParameters;
00195   std::map < const PlotterBase *, bool> m_zoompan;
00196   Range m_range;
00197 
00198   QWidget * m_newLayoutWidget;
00199   CanvasWindow * m_cur_window;
00200   QWidget * m_layoutWidget;
00201   QVBoxLayout * m_vLayout;
00202   QVBoxLayout * m_newVLayout;
00203 
00206    std::vector < std :: string > usr_models;
00207  
00210    std::vector < double > brk_points;
00211  
00214   std::vector < double > flat_widths;
00215 
00218    std::vector < double > color_scales;
00219 
00220 
00223   std::map < PlotterBase *, int > m_cut_map;
00224 
00227   typedef std::vector < const TupleCut * > TupleCutList_t;
00228 
00231   TupleCutList_t m_tuple_cuts;
00232 
00235   typedef std::vector < PlotterBase * > PlotterList_t;
00236 
00239   PlotterList_t m_tuple_cut_plotters;
00240 
00245   PlotterBase * m_plotter;
00246 
00249   std::vector < PlotterBase * > m_plotter_list;
00250 
00253   FunctionRep * m_functionRep;
00254 
00256   int m_last_ntuple_edited;
00257 
00259   int m_last_cut_index;
00260 
00262   int m_lowslider1_last_val;
00263 
00265   int m_highslider1_last_val;
00266   
00270   bool m_is_updating;
00271 
00274   bool m_cut_enable_updating;
00275 
00276   bool m_dragging;
00277 
00280   void init ();
00281 
00285   virtual void on_sel_combo_0_activated ( const QString & );
00286 
00290   virtual void on_sel_combo_1_activated ( const QString & );
00291 
00295   virtual void on_sel_combo_2_activated ( const QString & );
00296 
00300   virtual void on_sel_combo_3_activated ( const QString & );
00301 
00308   hippodraw::Axes::Type getAxes ( unsigned int index );
00309 
00310   void loadAllUsrModels ();
00311 
00314   void clearNewBindings ();             
00315 
00320   void updateSelectedPlotData ( const PlotterBase * plotter );
00321 
00324    void dataClearSelectedControls ();
00325 
00328   void updateSelectedPlotDataSource ( const std::string & name );
00329 
00332   void updateSelectedPlotType ( const PlotterBase * plotter );
00333 
00339   void updateAutoScaleBox ();
00340 
00343   void updateLogBox ();
00344 
00345   void updateCutsActive ();
00346 
00349   void updateTupleCuts ( const std::vector < PlotterBase * > & cutlist );
00350 
00353   const std::vector < PlotterBase * > & 
00354   getDataCutList ( PlotterBase * plotter );
00355 
00357   void disableCutControls ( bool yes );
00358 
00362   void fillPlotterList ( std::vector < PlotterBase * > & plot_list );
00363 
00368   void fillCutsOn ( const PlotterBase *, 
00369                     std::vector < PlotterBase * > & cut_list );
00370 
00375   const std::vector < const TupleCut * > & 
00376   getCutList ( const PlotterBase * plotter ) const;
00377 
00380   int findCutIndex ( const QString & label );
00381 
00385   void setAllCutsActive ( bool yes );
00386 
00390   void invalidDataWarning ();
00391 
00394   void newPlotError ( const DataSourceException & e );
00395 
00397   void noNTupleSelectedError ();
00398 
00400   void invalidRangeError ( const std::string & bad );
00401 
00404   void incompatibleDataRepError ( const std::string & type );
00405 
00408   void incompatibleFitterError ( const std::string & type );
00409 
00412   void incompatibleFunctionError ( const std::string & type );
00413 
00422   void multipleDataRepError ( const std::string & type );
00423 
00426   void multiplePlotError ();
00427 
00430   void functionAddError ();
00431 
00434   void statsStripValue ( QRadioButton * box );
00435 
00438   void updateNewPlotControls ();
00439 
00443   void setNewPlotNTuple ( const std::string & name );
00444 
00450   void changeNTupleName ( const QString & );
00451 
00455   virtual void ntupleChanged ( int );
00456 
00459   virtual void updatePlotTab ();
00460 
00463   virtual void errorBars_toggled ( bool );
00464 
00468   void updateCutVarGroupBox ( const PlotterBase * plotter, int index );
00469 
00472   void updateCutControls ( const std::vector < PlotterBase * > & cutlist );
00473 
00476   void updateCutControlValues ( const PlotterBase * cutplotter );
00477 
00480   void updateCutEnableButton ();
00481 
00484   virtual void updateErrorEllipseTab ();
00485 
00488   virtual void setZRadioButton ( bool enabled );
00489 
00490 #if QT_VERSION < 0x040000
00491   protected:
00492 #else
00493   protected slots:
00494 #endif
00495 
00499   static QString  s_app_key;
00500 
00504   static QString s_registry;
00505  
00506  /* In the member functions below, all are declared in the base class
00507      where they are commented for documentation, except those that are
00508      commented here. 
00509   */
00510   virtual PlotterBase * getPlotter();
00511 
00514   virtual void addDataRepButton_clicked ( );
00515 
00516   virtual void allNtupleComboActivated ( const QString & );
00519   virtual void updatePlotTypes ();
00520   virtual void availPlotTypesActivated ( const QString & );
00521   virtual void dataCreateNTuple ();
00522   virtual void dataTupleNameChanged (const QString & );
00523   virtual void dataNTupleSelChanged ( int item );
00524 
00527   virtual void titleText_returnPressed();
00528 
00531   virtual void on_axis_button_group_clicked ( int id );
00532 
00535   virtual void axisZoomPanCheckBox_clicked ();
00536 
00539   virtual void axisLabelChanged ( int index, const QString & axisName );
00540 
00541   virtual void highRangeDrag();
00542   virtual void lowRangeDrag();
00543   virtual void newPlotButton_clicked ( );
00544 
00547   virtual void setDragOn ();
00548 
00549   virtual void offsetDrag();
00550   virtual void symbolTypeButtonGroup_clicked ( int id );
00551   virtual void lineStyleButtonGroup_clicked ( int id );
00552   virtual void symbolPointSize_returnPressed ( );
00553   virtual void intervalStateChanged ( bool state );
00554   virtual void intervalTextChanged ( const QString & );
00555   virtual void colorSelect_clicked ();
00556 
00559   virtual void colorSelect_2_clicked ();
00560 
00563   virtual void setWidthText ();
00564 
00567   virtual void setOffsetText ();
00568 
00569   virtual void setBinWidth ( int value );
00570 
00573   virtual void functionsFitToDataButton_clicked ();
00574 
00578   virtual void functionsRemoveButton_clicked ();
00579 
00583   virtual void functionsResetButton_clicked();
00584 
00585   virtual void setParameters ( int, PlotterBase * );
00586 #if QT_VERSION < 0x040000
00587   virtual void functionParamsListViewCurrentChanged( QListViewItem * );
00588 #else
00589   virtual void functionParamsListViewCurrentChanged( Q3ListViewItem * );
00590 #endif
00591   virtual void functionParamsCheckBoxToggled( bool );
00592   virtual void functionParamsLineEditReturnPressed();
00593   virtual void functionParamsSliderSliderReleased();
00594   virtual void functionParamsSliderSliderMoved( int );
00595   virtual void functionParamsSliderSliderPressed();
00596 
00599   virtual void on_cut_button_group_clicked ( int id );
00600 
00601   virtual void logScale_clicked();
00602 
00605   virtual void autoScale_clicked();
00606 
00607   virtual void cutLowSlider_sliderMoved ( int value );
00608   virtual void cutHighSlider_sliderMoved ( int value );
00609   virtual void cutLowSlider_sliderReleased();
00610   virtual void cutHighSlider_sliderReleased();
00611   virtual void cutZoomPanCheckBox_clicked();
00612   virtual void cutInvertPushButton_clicked();
00613 
00616   virtual void cutAddSelected ();
00617 
00620   virtual void cutAddAll ();
00621 
00624   virtual void cutRemovePushButton_clicked ();
00625 
00628   virtual void cutText_returnPressed();
00629 
00632   virtual void cutEnablePushButton_toggled ( bool on );
00633   
00636   virtual void setBinWidth ( int value, bool drag );
00637 
00640   virtual void axisLabelText ();
00641 
00642   virtual void setLowRange ( int value );
00643 
00646   virtual void setLowRange ( int value, bool yes );
00647 
00648   virtual void setLowText ();
00649   virtual void setHighRange ( int value );
00650 
00653   virtual void setHighRange ( int value, bool yes );
00654 
00655   virtual void setHighText ();
00656   virtual void setOffset ( int value  );
00657 
00660   virtual void setOffset ( int value, bool yes  );
00661   
00662   virtual void cutNew ();
00663   virtual void functionAdd ();
00664   virtual void summaryNew ();
00665   virtual void selCutChanged ();
00666   virtual void updateDataTab();
00667   virtual void pointRepComboBox_activated ( const QString & qstr );
00668 
00671   virtual void updateCutsTab ();
00672 
00675   virtual void updateDataCutsTab ();
00676 
00679   virtual void updateFitCutsTab ();
00680 
00683   virtual void updateFunctionsTab ();
00684 
00685   virtual void createResiduals();
00686   virtual void fitterNamesActivated ( int );
00687   virtual void comboBoxEllipsoidParamXHighlighted ( int );
00688   virtual void comboBoxEllipsoidParamYHighlighted ( int );
00689   virtual void pushButtonNewErrorPlotClicked ();
00690 
00693   virtual void updateAxisTab ();
00694 
00695   virtual void widthDrag ();
00696 
00698   void editLabelFontClicked();
00699 
00701   void editTitleFontClicked();
00702   
00703 #ifdef HAVE_ROOT
00704 
00708   std::string getArrayTupleLabel( const DataSource * rtuple,
00709                                   const std::string & column );
00710 #endif
00711 
00714   virtual void valueChanged ( int );
00715 
00718   virtual void sliderChanged ( int );
00719   
00722   virtual void resetSlider ( );
00723 
00726   virtual  void newColorModel ( );
00727  
00730   virtual  void editColorModel ( );
00731 
00734   virtual void deleteColorModel ( );
00735 
00736 public:
00737 
00739 #if QT_VERSION < 0x040000
00740   Inspector ( QWidget * parent = 0,
00741               const char * name = 0,
00742               bool modal = false,
00743               Qt::WFlags flags = 0 );
00744 #else
00745   Inspector ( QWidget * parent = 0 );
00746 #endif
00747 
00751   std::string getSelectedDataSourceName () const;
00752 
00758   void enableNewPlotBox ( bool yes = true );
00759 
00766   virtual void customEvent ( QCustomEvent * event );
00767 
00771   virtual void update ( );
00772 
00773   /* Returns the selected cut plotter */
00774   virtual PlotterBase *  getSelectedCut ();
00775   virtual void selectedCutsRadioButton_toggled ( bool selected );
00776   virtual void allCutsRadioButton_toggled ( bool selected );
00777 
00780   virtual void updateSummaryTab ();
00781 
00782   virtual void statsButtonGroupClicked ( int );
00783 
00784 protected:
00785 
00786   virtual const std::string convertToString ( hippodraw::Axes::Type );
00787 
00788   virtual void contourSlider_valueChanged ( int val );
00789 
00790   virtual void contourTextBox_returnPressed ();
00791 
00794   virtual void contourRadioButton1_toggled ( bool );
00795 
00798   virtual void contourLevelsTextBox_returnPressed ();
00799 
00802   void contourError ();
00803 
00807   virtual void tabChanged ();
00808 
00809   public:
00810 
00813   virtual ~Inspector ();
00814 
00815 };
00816 
00817 #endif // _Inspector_H_

Generated for HippoDraw-1.14.8.5 by doxygen 1.4.3