Inspector.h
Go to the documentation of this file.
1 /* -*- mode: c++ -*- */
2 
14 #ifndef _Inspector_H_
15 #define _Inspector_H_
16 
17 //#include <qglobal.h> // for version
18 // #if QT_VERSION < 0x040000
19 #include "qtui/InspectorBase.h"
20 // #else
21 // #include "InspectorUI.h"
22 // //Added by the Qt porting tool:
23 // #endif
24 
25 #include "axes/AxesType.h"
26 #include "axes/Range.h"
27 
28 #include <map>
29 
30 class QCustomEvent;
31 class QVBoxLayout;
32 
33 namespace hippodraw {
34 
35 class CanvasView;
36 class CanvasWindow;
37 class CutPlotter;
38 class DataSourceException;
39 class DataSource;
40 class FunctionRep;
41 class PlotterBase;
42 class RootNTuple;
43 class TupleCut;
44 
230 // #if QT_VERSION < 0x040000
232 {
233 // #else
234 // class MDL_QTHIPPOPLOT_API Inspector : public QDialog, private Ui::InspectorUI
235 // {
236 // Q_OBJECT
237 // #endif
238 
239 private:
240 
241 void static stringTokenize(std::string input, const std::string & delimiters,
242  std::vector<std::string> & tokens, bool clear=true);
243 
244  enum ParameterList { Index, Name, Value, Error, Fixed, Dummy };
245 
249 
253 
257 
261 
264  std::vector < QLabel * > m_new_labels;
265 
268  std::vector < QComboBox * > m_new_combos;
269 
272  std::vector < QLabel * > m_sel_labels;
273 
276  std::vector < QComboBox * > m_sel_combos;
277 
280 #if QT_VERSION < 0x040000
281  std::map < QListViewItem *, FunctionRep * > m_function_lv_map;
282 #else
283  std::map < Q3ListViewItem *, FunctionRep * > m_function_lv_map;
284 #endif
285 
289 #if QT_VERSION < 0x040000
290  std::vector < QListViewItem * > m_func_parm_checked;
291 #else
292  std::vector < Q3ListViewItem * > m_func_parm_checked;
293 #endif
294 
295  std::vector < int > m_functionIndexMap;
297  std::vector < double > m_oldParameters;
298  std::map < const PlotterBase *, bool> m_zoompan;
300 
306 
309  std::map < PlotterBase *, int > m_cut_map;
310 
313  typedef std::vector < const TupleCut * > TupleCutList_t;
314 
318 
321  typedef std::vector < PlotterBase * > PlotterList_t;
322 
326 
332 
336 
339  std::vector < PlotterBase * > m_plotter_list;
340 
343 
346 
349 
352 
357 
362 
364 
369 
374 
375 
378  std::vector < QRadioButton * > m_transform_buttons;
379 
383 
384 
391  int cutRadioId () const;
392 
394  void warningTex ();
395 
398  void invalidOperationError ( const std::string & message );
399 
406  int transformId () const;
407 
409  virtual void diffDataRep ();
412 #if QT_VERSION < 0x040000
413  QListViewItem * getTopParent ( QListViewItem * item );
414 #else
415  Q3ListViewItem * getTopParent ( Q3ListViewItem * item );
416 #endif
417 
421 #if QT_VERSION < 0x040000
422  FunctionRep * getTopFunctionRep ( QListViewItem * item );
423 #else
424  FunctionRep * getTopFunctionRep ( Q3ListViewItem * item );
425 #endif
426 
429 #if QT_VERSION < 0x040000
430  FunctionRep * getFunctionRep ( QListViewItem * item );
431 #else
432  FunctionRep * getFunctionRep ( Q3ListViewItem * item );
433 #endif
434 
439  FunctionRep * getTopFunctionRep ( );
440 
443  FunctionRep * getFunctionRep ();
444 
448  void fillCheckedFunctionRepItems ();
449 
452  void init ();
453 
457  virtual void sel_combo_0_activated ( const QString & );
458 
462  virtual void sel_combo_1_activated ( const QString & );
463 
467  virtual void sel_combo_2_activated ( const QString & );
468 
472  virtual void sel_combo_3_activated ( const QString & );
473 
480  hippodraw::Axes::Type getAxes ( unsigned int index );
481 
482  void loadAllUserModels ();
483 
487  void convertCtrlPts ( std::vector < double > & sv );
488 
491  void clear ( std::vector < QLabel * > & labels,
492  std::vector < QComboBox * > & combos );
493 
494 
498  void updateColorMapCtrls ( const PlotterBase * plotter );
499 
500 
504  void updateSelectedPlotData ( const PlotterBase * plotter );
505 
508  void dataClearSelectedControls ();
509 
512  void updateSelectedPlotDataSource ( const std::string & name );
513 
516  void updateSelectedPlotType ( const PlotterBase * plotter );
517 
523  void updateAutoScaleBox ();
524 
527  void updateLogBox ();
528 
531  void updateReverseBox ();
532 
533  void updateCutsActive ();
534 
537  void updateTupleCuts ( const std::vector < PlotterBase * > & cutlist );
538 
541  void setAppKey ();
542 
545  const std::vector < PlotterBase * > &
546  getDataCutList ( PlotterBase * plotter );
547 
549  void disableCutControls ( bool yes );
550 
554  void fillPlotterList ( std::vector < PlotterBase * > & plot_list );
555 
556  /* Returns the selected cut plotter.
557  */
558  virtual CutPlotter * getSelectedCut ();
559 // /** Clears and fills the @a cut_list with PlotterBase objects that
560 // are cuts whose target is the active DataRep contained by @a
561 // plotter.
562 // */
563 // void fillCutsOn ( const PlotterBase *,
564 // std::vector < PlotterBase * > & cut_list );
565 
570  const std::vector < const TupleCut * > &
571  getCutList ( const PlotterBase * plotter ) const;
572 
575  int findCutIndex ( const QString & label );
576 
580  void setAllCutsActive ( bool yes );
581 
584  void cutOnCutError ();
585 
589  void invalidDataWarning ();
590 
593  void newPlotError ( const std::exception & e );
594 
596  void noNTupleSelectedError ();
597 
599  void invalidRangeError ( const std::string & bad );
600 
603  void incompatibleDataRepError ( const std::string & type );
604 
607  void incompatibleFitterError ( const std::string & type );
608 
611  void badFunctionError ( const std::string & name, const char * what );
612 
615  void fitFailedError ();
616 
619  void incompatibleFunctionError ( const std::string & type );
620 
629  void multipleDataRepError ( const std::string & type );
630 
634  bool multipleDataRepInfo ( const std::string & type );
635 
638  void multiplePlotError ();
639 
642  void functionAddError ();
643 
647 #if QT_VERSION < 0x040000
648  void fillFunctionParameters ( QListViewItem * parent,
649  const FunctionRep * function,
650  unsigned int & index );
651 #else
652  void fillFunctionParameters ( Q3ListViewItem * parent,
653  const FunctionRep * function,
654  unsigned int & index );
655 #endif
656 
659  void statsStripValue ( QRadioButton * box );
660 
663  void updateNewPlotControls ();
664 
668  void setNewPlotNTuple ( const std::string & name );
669 
675  void changeNTupleName ( const QString & );
676 
680  virtual void ntupleChanged ( int );
681 
684  virtual void updatePlotTab ();
685 
688  virtual void errorBars_toggled ( bool );
689 
693  void updateCutVarGroupBox ( const PlotterBase * plotter, int index );
694 
697  void updateCutControls ( const std::vector < PlotterBase * > & cutlist );
698 
701  void updateCutControlValues ( const PlotterBase * cutplotter );
702 
705  void updateCutEnableButton ();
706 
709  virtual void setZRadioButton ( bool enabled );
710 
713  void updateValueCombo ();
714 
718  int validPeriodicTransformRange();
719  bool validPeriodicTransformRange( int miny );
720 
724  void invalidPeriodicTransform ();
725 
726 #if QT_VERSION < 0x040000
727  protected:
728 #else
729  protected slots:
730 #endif
731 
736 
737  /* In the member functions below, all are declared in the base class
738  where they are commented for documentation, except those that are
739  commented here.
740  */
741  virtual PlotterBase * getPlotter();
742 
745  virtual void addDataRepButton_clicked ( );
746 
749  virtual void removeDataRepButton_clicked();
750 
751  virtual void allNtupleComboActivated ( const QString & );
754  virtual void updatePlotTypes ();
755  virtual void availPlotTypesActivated ( const QString & );
756  virtual void dataCreateNTuple ();
757 
761  virtual void dataTupleNameChanged (const QString & );
762  virtual void dataNTupleSelChanged ( int item );
763 
766  virtual void titleText_returnPressed();
767 
770  virtual void axis_button_group_clicked ( int id );
771 
774  virtual void axisZoomPanCheckBox_clicked ();
775 
778  virtual void axisLabelChanged ( int index, const QString & axisName );
779 
780  virtual void highRangeDrag();
781  virtual void lowRangeDrag();
782  virtual void newPlotButton_clicked ( );
783 
786  virtual void setDragOn ();
787 
788  virtual void offsetDrag();
789  virtual void entriesDrag();
790  virtual void symbolTypeButtonGroup_clicked ( int id );
791  virtual void lineStyleButtonGroup_clicked ( int id );
792  virtual void symbolPointSize_returnPressed ( );
793  virtual void intervalStateChanged ( bool state );
794  virtual void intervalTextChanged ( const QString & );
795  virtual void colorSelect_clicked ();
796 
799  virtual void colorSelect_2_clicked ();
800 
803  virtual void setWidthText ();
804 
807  virtual void setOffsetText ();
808 
809  virtual void setBinWidth ( int value );
810 
813  virtual void functionsFitToDataButton_clicked ();
814 
818  virtual void functionsRemoveButton_clicked ();
819 
823  virtual void functionsResetButton_clicked();
824 
825  virtual void setParameters ( int, PlotterBase * );
826  virtual void functionParamsListViewCurrentChanged ();
827  virtual void functionParamsCheckBoxToggled( bool );
830  virtual void ignoreErrorCheckBoxToggled(bool);
831  virtual void functionParamsLineEditReturnPressed();
832  virtual void functionParamsSliderSliderReleased();
833  virtual void functionParamsSliderSliderMoved( int );
834  virtual void functionParamsSliderSliderPressed();
835 
842  virtual void cut_button_group_clicked ();
843 
844  virtual void logScale_clicked();
845 
848  virtual void reverse_clicked();
849 
852  virtual void autoScale_clicked();
853 
856  virtual void m_grid_clicked();
857  virtual void m_boxedge_clicked();
858  virtual void cutLowSlider_sliderMoved ( int value );
859  virtual void cutHighSlider_sliderMoved ( int value );
860  virtual void cutLowSlider_sliderReleased();
861  virtual void cutHighSlider_sliderReleased();
862  virtual void cutZoomPanCheckBox_clicked();
863  virtual void cutInvertPushButton_clicked();
864 
867  virtual void cutAddSelected ();
868 
871  virtual void cutAddAll ();
872 
875  virtual void cutRemovePushButton_clicked ();
876 
879  virtual void cutText_returnPressed();
880 
883  virtual void cutEnablePushButton_toggled ( bool on );
884 
887  virtual void setBinWidth ( int value, bool drag );
888 
891  virtual void axisLabelText ();
892 
893  virtual void setLowRange ( int value );
894 
897  virtual void setLowRange ( int value, bool yes );
898 
899  virtual void setLowText ();
900  virtual void setHighRange ( int value );
901 
904  virtual void setHighRange ( int value, bool yes );
905 
906  virtual void setHighText ();
907  virtual void setOffset ( int value );
908 
911  virtual void rotateX ( int offset );
912  virtual void rotateY ( int offset );
913 
914  virtual void setXRotateText ();
915  virtual void setYRotateText ();
916 
917 
920  virtual void resetRotate ();
921 
924  virtual void setRotate ( int x, int y );
925 
928  virtual void setOffset ( int value, bool yes );
929 
930  virtual void cutNew ();
931  virtual void functionAdd ();
932  virtual void summaryNew ();
933 
940  virtual void transform_button_group_clicked ();
941  virtual void selCutChanged ();
942  virtual void updateDataTab();
943  virtual void pointRepComboBox_activated ( const QString & qstr );
944 
947  virtual void updateCutsTab ();
948 
951  virtual void updateDataCutsTab ();
952 
955  virtual void updateFitCutsTab ();
956 
959  virtual void updateFunctionsTab ();
960 
961  virtual void createResiduals();
962  virtual void fitterNamesActivated ( int );
963  virtual void pushButtonNewErrorPlotClicked ();
964 
967  virtual void updateAxisTab ();
968 
971  virtual void updateTransformTab ();
972 
973  virtual void widthDrag ();
974 
976  void editLabelFontClicked();
977 
979  void editTitleFontClicked();
980 
987  std::string getArrayTupleLabel( const DataSource * rtuple,
988  const std::string & column );
989 
992  virtual void valueChanged ( int );
993 
997  virtual void sliderChanged ( int );
998 
1001  virtual void resetSlider ( );
1002 
1005  virtual void newColorModel ( );
1006 
1009  virtual void editColorModel ( );
1010 
1013  virtual void deleteColorModel ( );
1014 
1017  virtual void combineCheckBox_clicked();
1018 
1021  virtual void setMinEntries ( int increment );
1022 
1025  virtual int getMinEntries ();
1026 
1029  virtual void setMinEntriesText();
1030 public:
1031 
1033 // #if QT_VERSION < 0x040000
1034  Inspector ( QWidget * parent = 0,
1035  const char * name = 0,
1036  bool modal = false,
1037  Qt::WFlags flags = 0 );
1038 // #else
1039 // Inspector ( QWidget * parent = 0 );
1040 // #endif
1041 
1045  std::string getSelectedDataSourceName () const;
1046 
1052  void enableNewPlotBox ( bool yes = true );
1053 
1060 #if QT_VERSION < 0x040000
1061  virtual void customEvent ( QCustomEvent * event );
1062 #else
1063  virtual void customEvent ( QEvent * event );
1064 #endif
1065 
1069  virtual void update ( );
1070 
1071  virtual void selectedCutsRadioButton_toggled ( bool selected );
1072  virtual void allCutsRadioButton_toggled ( bool selected );
1073 
1076  virtual void updateSummaryTab ();
1077 
1078  virtual void statsButtonGroupClicked ( int );
1079 
1080 
1081 protected:
1082 
1083  virtual const std::string convertToString ( hippodraw::Axes::Type );
1084 
1085  virtual void contourSlider_valueChanged ( int val );
1086 
1087  virtual void contourTextBox_returnPressed ();
1088 
1091  virtual void contourRadioButton1_toggled ( bool );
1092 
1095  virtual void contourLevelsTextBox_returnPressed ();
1096 
1099  void contourError ();
1100 
1104  virtual void tabChanged ();
1105 
1106  public:
1107 
1110  void setSelectedFitter ( const std::string & name );
1111 
1114  virtual ~Inspector ();
1115 
1116 
1117 };
1118 
1119 } // namespace hippodraw
1120 
1121 #endif // _Inspector_H_
1122 

Generated for HippoDraw Class Library by doxygen