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 
233 // #if QT_VERSION < 0x040000
235 {
236 // #else
237 // class MDL_QTHIPPOPLOT_API Inspector : public QDialog, private Ui::InspectorUI
238 // {
239 // Q_OBJECT
240 // #endif
241 
242 private:
243 
244 void static stringTokenize(std::string input, const std::string & delimiters,
245  std::vector<std::string> & tokens, bool clear=true);
246 
247  enum ParameterList { Index, Name, Value, Error, Fixed, Dummy };
248 
252 
256 
260 
264 
267  std::vector < QLabel * > m_new_labels;
268 
271  std::vector < QComboBox * > m_new_combos;
272 
275  std::vector < QLabel * > m_sel_labels;
276 
279  std::vector < QComboBox * > m_sel_combos;
280 
283 #if QT_VERSION < 0x040000
284  std::map < QListViewItem *, FunctionRep * > m_function_lv_map;
285 #else
286  std::map < Q3ListViewItem *, FunctionRep * > m_function_lv_map;
287 #endif
288 
292 #if QT_VERSION < 0x040000
293  std::vector < QListViewItem * > m_func_parm_checked;
294 #else
295  std::vector < Q3ListViewItem * > m_func_parm_checked;
296 #endif
297 
298  std::vector < int > m_functionIndexMap;
300  std::vector < double > m_oldParameters;
301  std::map < const PlotterBase *, bool> m_zoompan;
303 
309 
312  std::map < PlotterBase *, int > m_cut_map;
313 
316  typedef std::vector < const TupleCut * > TupleCutList_t;
317 
321 
324  typedef std::vector < PlotterBase * > PlotterList_t;
325 
329 
335 
339 
342  std::vector < PlotterBase * > m_plotter_list;
343 
346 
349 
352 
355 
360 
365 
367 
372 
377 
378 
381  std::vector < QRadioButton * > m_transform_buttons;
382 
386 
387 
394  int cutRadioId () const;
395 
397  void warningTex ();
398 
401  void invalidOperationError ( const std::string & message );
402 
409  int transformId () const;
410 
412  virtual void diffDataRep ();
415 #if QT_VERSION < 0x040000
416  QListViewItem * getTopParent ( QListViewItem * item );
417 #else
418  Q3ListViewItem * getTopParent ( Q3ListViewItem * item );
419 #endif
420 
424 #if QT_VERSION < 0x040000
425  FunctionRep * getTopFunctionRep ( QListViewItem * item );
426 #else
427  FunctionRep * getTopFunctionRep ( Q3ListViewItem * item );
428 #endif
429 
432 #if QT_VERSION < 0x040000
433  FunctionRep * getFunctionRep ( QListViewItem * item );
434 #else
435  FunctionRep * getFunctionRep ( Q3ListViewItem * item );
436 #endif
437 
442  FunctionRep * getTopFunctionRep ( );
443 
446  FunctionRep * getFunctionRep ();
447 
451  void fillCheckedFunctionRepItems ();
452 
455  void init ();
456 
460  virtual void sel_combo_0_activated ( const QString & );
461 
465  virtual void sel_combo_1_activated ( const QString & );
466 
470  virtual void sel_combo_2_activated ( const QString & );
471 
475  virtual void sel_combo_3_activated ( const QString & );
476 
483  hippodraw::Axes::Type getAxes ( unsigned int index );
484 
485  void loadAllUserModels ();
486 
490  void convertCtrlPts ( std::vector < double > & sv );
491 
494  void clear ( std::vector < QLabel * > & labels,
495  std::vector < QComboBox * > & combos );
496 
497 
501  void updateColorMapCtrls ( const PlotterBase * plotter );
502 
503 
507  void updateSelectedPlotData ( const PlotterBase * plotter );
508 
511  void dataClearSelectedControls ();
512 
515  void updateSelectedPlotDataSource ( const std::string & name );
516 
519  void updateSelectedPlotType ( const PlotterBase * plotter );
520 
526  void updateAutoScaleBox ();
527 
530  void updateLogBox ();
531 
534  void updateReverseBox ();
535 
536  void updateCutsActive ();
537 
540  void updateTupleCuts ( const std::vector < PlotterBase * > & cutlist );
541 
544  void setAppKey ();
545 
548  const std::vector < PlotterBase * > &
549  getDataCutList ( PlotterBase * plotter );
550 
552  void disableCutControls ( bool yes );
553 
557  void fillPlotterList ( std::vector < PlotterBase * > & plot_list );
558 
559  /* Returns the selected cut plotter.
560  */
561  virtual CutPlotter * getSelectedCut ();
562 // /** Clears and fills the @a cut_list with PlotterBase objects that
563 // are cuts whose target is the active DataRep contained by @a
564 // plotter.
565 // */
566 // void fillCutsOn ( const PlotterBase *,
567 // std::vector < PlotterBase * > & cut_list );
568 
573  const std::vector < const TupleCut * > &
574  getCutList ( const PlotterBase * plotter ) const;
575 
578  int findCutIndex ( const QString & label );
579 
583  void setAllCutsActive ( bool yes );
584 
587  void cutOnCutError ();
588 
592  void invalidDataWarning ();
593 
596  void newPlotError ( const std::exception & e );
597 
599  void noNTupleSelectedError ();
600 
602  void invalidRangeError ( const std::string & bad );
603 
606  void incompatibleDataRepError ( const std::string & type );
607 
610  void incompatibleFitterError ( const std::string & type );
611 
614  void badFunctionError ( const std::string & name, const char * what );
615 
618  void fitFailedError ();
619 
622  void incompatibleFunctionError ( const std::string & type );
623 
632  void multipleDataRepError ( const std::string & type );
633 
637  bool multipleDataRepInfo ( const std::string & type );
638 
641  void multiplePlotError ();
642 
645  void functionAddError ();
646 
650 #if QT_VERSION < 0x040000
651  void fillFunctionParameters ( QListViewItem * parent,
652  const FunctionRep * function,
653  unsigned int & index );
654 #else
655  void fillFunctionParameters ( Q3ListViewItem * parent,
656  const FunctionRep * function,
657  unsigned int & index );
658 #endif
659 
662  void statsStripValue ( QRadioButton * box );
663 
666  void updateNewPlotControls ();
667 
671  void setNewPlotNTuple ( const std::string & name );
672 
678  void changeNTupleName ( const QString & );
679 
683  virtual void ntupleChanged ( int );
684 
687  virtual void updatePlotTab ();
688 
691  virtual void errorBars_toggled ( bool );
692 
696  void updateCutVarGroupBox ( const PlotterBase * plotter, int index );
697 
700  void updateCutControls ( const std::vector < PlotterBase * > & cutlist );
701 
704  void updateCutControlValues ( const PlotterBase * cutplotter );
705 
708  void updateCutEnableButton ();
709 
712  virtual void setZRadioButton ( bool enabled );
713 
716  void updateValueCombo ();
717 
721  int validPeriodicTransformRange();
722  bool validPeriodicTransformRange( int miny );
723 
727  void invalidPeriodicTransform ();
728 
729 #if QT_VERSION < 0x040000
730  protected:
731 #else
732  protected slots:
733 #endif
734 
739 
740  /* In the member functions below, all are declared in the base class
741  where they are commented for documentation, except those that are
742  commented here.
743  */
744  virtual PlotterBase * getPlotter();
745 
748  virtual void addDataRepButton_clicked ( );
749 
752  virtual void removeDataRepButton_clicked();
753 
754  virtual void allNtupleComboActivated ( const QString & );
757  virtual void updatePlotTypes ();
758  virtual void availPlotTypesActivated ( const QString & );
759  virtual void dataCreateNTuple ();
760 
764  virtual void dataTupleNameChanged (const QString & );
765  virtual void dataNTupleSelChanged ( int item );
766 
769  virtual void titleText_returnPressed();
770 
773  virtual void axis_button_group_clicked ( int id );
774 
777  virtual void axisZoomPanCheckBox_clicked ();
778 
781  virtual void axisLabelChanged ( int index, const QString & axisName );
782 
783  virtual void highRangeDrag();
784  virtual void lowRangeDrag();
785  virtual void newPlotButton_clicked ( );
786 
789  virtual void setDragOn ();
790 
791  virtual void offsetDrag();
792  virtual void entriesDrag();
793  virtual void symbolTypeButtonGroup_clicked ( int id );
794  virtual void lineStyleButtonGroup_clicked ( int id );
795  virtual void symbolPointSize_returnPressed ( );
796  virtual void intervalStateChanged ( bool state );
797  virtual void intervalTextChanged ( const QString & );
798  virtual void colorSelect_clicked ();
799 
802  virtual void colorSelect_2_clicked ();
803 
806  virtual void setWidthText ();
807 
810  virtual void setOffsetText ();
811 
812  virtual void setBinWidth ( int value );
813 
816  virtual void functionsFitToDataButton_clicked ();
817 
821  virtual void functionsRemoveButton_clicked ();
822 
826  virtual void functionsResetButton_clicked();
827 
828  virtual void setParameters ( int, PlotterBase * );
829  virtual void functionParamsListViewCurrentChanged ();
830  virtual void functionParamsCheckBoxToggled( bool );
833  virtual void ignoreErrorCheckBoxToggled(bool);
834  virtual void functionParamsLineEditReturnPressed();
835  virtual void functionParamsSliderSliderReleased();
836  virtual void functionParamsSliderSliderMoved( int );
837  virtual void functionParamsSliderSliderPressed();
838 
845  virtual void cut_button_group_clicked ();
846 
847  virtual void logScale_clicked();
848 
851  virtual void reverse_clicked();
852 
855  virtual void autoScale_clicked();
856 
859  virtual void m_grid_clicked();
860  virtual void m_boxedge_clicked();
861  virtual void cutLowSlider_sliderMoved ( int value );
862  virtual void cutHighSlider_sliderMoved ( int value );
863  virtual void cutLowSlider_sliderReleased();
864  virtual void cutHighSlider_sliderReleased();
865  virtual void cutZoomPanCheckBox_clicked();
866  virtual void cutInvertPushButton_clicked();
867 
870  virtual void cutAddSelected ();
871 
874  virtual void cutAddAll ();
875 
878  virtual void cutRemovePushButton_clicked ();
879 
882  virtual void cutText_returnPressed();
883 
886  virtual void cutEnablePushButton_toggled ( bool on );
887 
890  virtual void setBinWidth ( int value, bool drag );
891 
894  virtual void axisLabelText ();
895 
896  virtual void setLowRange ( int value );
897 
900  virtual void setLowRange ( int value, bool yes );
901 
902  virtual void setLowText ();
903  virtual void setHighRange ( int value );
904 
907  virtual void setHighRange ( int value, bool yes );
908 
909  virtual void setHighText ();
910  virtual void setOffset ( int value );
911 
914  virtual void rotateX ( int offset );
915  virtual void rotateY ( int offset );
916 
917  virtual void setXRotateText ();
918  virtual void setYRotateText ();
919 
920 
923  virtual void resetRotate ();
924 
927  virtual void setRotate ( int x, int y );
928 
931  virtual void setOffset ( int value, bool yes );
932 
933  virtual void cutNew ();
934  virtual void functionAdd ();
935  virtual void summaryNew ();
936 
943  virtual void transform_button_group_clicked ();
944  virtual void selCutChanged ();
945  virtual void updateDataTab();
946  virtual void pointRepComboBox_activated ( const QString & qstr );
947 
950  virtual void updateCutsTab ();
951 
954  virtual void updateDataCutsTab ();
955 
958  virtual void updateFitCutsTab ();
959 
962  virtual void updateFunctionsTab ();
963 
964  virtual void createResiduals();
965  virtual void fitterNamesActivated ( int );
966  virtual void pushButtonNewErrorPlotClicked ();
967 
970  virtual void updateAxisTab ();
971 
974  virtual void updateTransformTab ();
975 
976  virtual void widthDrag ();
977 
979  void editLabelFontClicked();
980 
982  void editTitleFontClicked();
983 
990  std::string getArrayTupleLabel( const DataSource * rtuple,
991  const std::string & column );
992 
995  virtual void valueChanged ( int );
996 
1000  virtual void sliderChanged ( int );
1001 
1004  virtual void resetSlider ( );
1005 
1008  virtual void newColorModel ( );
1009 
1012  virtual void editColorModel ( );
1013 
1016  virtual void deleteColorModel ( );
1017 
1020  virtual void combineCheckBox_clicked();
1021 
1024  virtual void setMinEntries ( int increment );
1025 
1028  virtual int getMinEntries ();
1029 
1032  virtual void setMinEntriesText();
1033 public:
1034 
1036 // #if QT_VERSION < 0x040000
1037  Inspector ( QWidget * parent = 0,
1038  const char * name = 0,
1039  bool modal = false,
1040  Qt::WFlags flags = 0 );
1041 // #else
1042 // Inspector ( QWidget * parent = 0 );
1043 // #endif
1044 
1048  std::string getSelectedDataSourceName () const;
1049 
1055  void enableNewPlotBox ( bool yes = true );
1056 
1063 #if QT_VERSION < 0x040000
1064  virtual void customEvent ( QCustomEvent * event );
1065 #else
1066  virtual void customEvent ( QEvent * event );
1067 #endif
1068 
1072  virtual void update ( );
1073 
1074  virtual void selectedCutsRadioButton_toggled ( bool selected );
1075  virtual void allCutsRadioButton_toggled ( bool selected );
1076 
1079  virtual void updateSummaryTab ();
1080 
1081  virtual void statsButtonGroupClicked ( int );
1082 
1083 
1084 protected:
1085 
1086  virtual const std::string convertToString ( hippodraw::Axes::Type );
1087 
1088  virtual void contourSlider_valueChanged ( int val );
1089 
1090  virtual void contourTextBox_returnPressed ();
1091 
1094  virtual void contourRadioButton1_toggled ( bool );
1095 
1098  virtual void contourLevelsTextBox_returnPressed ();
1099 
1102  void contourError ();
1103 
1107  virtual void tabChanged ();
1108 
1109  public:
1110 
1113  void setSelectedFitter ( const std::string & name );
1114 
1117  virtual ~Inspector ();
1118 
1119 
1120 };
1121 
1122 } // namespace hippodraw
1123 
1124 #endif // _Inspector_H_
1125 
int m_lowslider1_last_val
The value of the low slider in Axis Widget 1 as last recorded.
Definition: Inspector.h:351
PlotterBase * m_plotter
The currently selected PlotterBase object.
Definition: Inspector.h:334
std::vector< QLabel * > m_new_labels
Binding labels for new plot group box.
Definition: Inspector.h:267
std::vector< QComboBox * > m_new_combos
Binding combo boxes for new plot group box.
Definition: Inspector.h:271
QListViewItem * item
Definition: PickTable.cxx:172
QString m_model_name
The color model name settings key.
Definition: Inspector.h:251
#define MDL_QTHIPPOPLOT_API
Definition: libqthippo.h:36
TupleCutList_t m_tuple_cuts
The list of TupleCut objects currently selected.
Definition: Inspector.h:320
QString m_app_key
The QSettings application key for searching for setting.
Definition: Inspector.h:338
std::vector< const TupleCut * > TupleCutList_t
The type of container for current TupleCut objects.
Definition: Inspector.h:316
QString m_flat_width
The color model flat width settings key.
Definition: Inspector.h:259
column
The column indices for 2 dimension data point tuple.
std::map< const PlotterBase *, bool > m_zoompan
Definition: Inspector.h:301
QVBoxLayout * m_newVLayout
Definition: Inspector.h:308
A derived class of DataRep which is a base class for displaying a function.
Definition: FunctionRep.h:34
std::vector< QListViewItem * > m_func_parm_checked
The list of functions parameters that are checked for use by the error contour display.
Definition: Inspector.h:293
std::vector< QComboBox * > m_sel_combos
Binding combo boxes for selected plot group box.
Definition: Inspector.h:279
static QString s_registry
The QSettings Windows registry key.
Definition: Inspector.h:738
return yes
Definition: CanvasView.cxx:883
bool m_is_updating
Set to true if updating is being processed.
Definition: Inspector.h:359
The base class for the PlotterBase hierarchy.
Definition: PlotterBase.h:55
hippodraw::Axes::Type m_axis
Definition: Inspector.h:299
PyArray_TYPES type(numeric::array arr)
Definition: num_util.cpp:249
bool m_cut_enable_updating
Set to true when hippodraw::Inspector::cutEnablePushButton is being updated.
Definition: Inspector.h:364
std::vector< PlotterBase * > m_plotter_list
The currently selected plotters.
Definition: Inspector.h:342
A PlotterBase derived class that serves a base class for cut plotters.
Definition: CutPlotter.h:43
int m_last_cut_index
The index of the last selected cut.
Definition: Inspector.h:348
std::map< QListViewItem *, FunctionRep * > m_function_lv_map
Map between a function&#39;s QListViewItem and its FunctionRep pointer.
Definition: Inspector.h:284
std::vector< QRadioButton * > m_transform_buttons
The list of transform radio buttons.
Definition: Inspector.h:381
std::vector< double > m_oldParameters
Definition: Inspector.h:300
The namespace for axes.
QString m_break_point
The color model break point settings key.
Definition: Inspector.h:255
int m_highslider1_last_val
The value of the high slider in Axis Widget 1 as last recorded.
Definition: Inspector.h:354
std::vector< PlotterBase * > PlotterList_t
The type of container for PlotterBase objects.
Definition: Inspector.h:324
hippodraw::Range class interface
int m_last_ntuple_edited
The m_all_ntuples item that was lasted edited.
Definition: Inspector.h:345
int m_min_entries
The min_entries when draging starts.
Definition: Inspector.h:385
std::map< PlotterBase *, int > m_cut_map
A map of the last cut item selected for each plotter.
Definition: Inspector.h:312
Expresses a range of values.
Definition: Range.h:33
return index
Definition: PickTable.cxx:182
std::vector< QLabel * > m_sel_labels
Binding labels for selected plot group box.
Definition: Inspector.h:275
PlotterList_t m_tuple_cut_plotters
The PlotterBase object associated with each TupleCut object.
Definition: Inspector.h:328
QString m_color_scale
The color model color scale settings key.
Definition: Inspector.h:263
bool m_user_models_loaded
Set to true after the user defined value to color transforms have been loaded.
Definition: Inspector.h:371
The base class for the Inspector class.
Definition: InspectorBase.h:41
CanvasWindow * m_cur_window
Definition: Inspector.h:305
The file created from InspectorBase.ui with the Qt uic tool.
bool m_rotate_enable
When changing current plot, set to false so that Inspector don&#39;t update the rotation repeatedly...
Definition: Inspector.h:376
QWidget * m_newLayoutWidget
Definition: Inspector.h:304
A concrete window class that contains the canvas and responds to menu item and tool bar events from t...
Definition: CanvasWindow.h:106
std::vector< int > m_functionIndexMap
Definition: Inspector.h:298
A derived class of InspectorBase class which is generated by the Qt designer.
Definition: Inspector.h:234
Type
Axes constants.
Definition: AxesType.h:31
QVBoxLayout * m_vLayout
Definition: Inspector.h:307
QWidget * m_layoutWidget
Definition: Inspector.h:306
Base class for DataSource.
Definition: DataSource.h:55

Generated for HippoDraw Class Library by doxygen