17 #include "msdevstudio/MSconfig.h"
29 #include <qapplication.h>
31 #if QT_VERSION < 0x040000
32 #include "qlistview.h"
33 #include "qbuttongroup.h"
34 #include "qgroupbox.h"
35 #include "qwidgetstack.h"
38 #include <QtCore/QCustomEvent>
39 #include <QtGui/QHBoxLayout>
40 #include <QtGui/QVBoxLayout>
42 #include "q3listview.h"
43 #include "q3buttongroup.h"
44 #include "q3groupbox.h"
45 #include "q3widgetstack.h"
49 #include "qcheckbox.h"
50 #include "qcolordialog.h"
51 #include "qcombobox.h"
52 #include "qlineedit.h"
53 #include "qmessagebox.h"
54 #include "qpushbutton.h"
55 #include "qradiobutton.h"
58 #include "qinputdialog.h"
59 #include "qfontdialog.h"
60 #include "qtabwidget.h"
61 #include "qsettings.h"
62 #include "qstringlist.h"
63 #include "qtextstream.h"
89 #include "boost/tokenizer.hpp"
90 #include "boost/lexical_cast.hpp"
103 using std::runtime_error;
107 using namespace hippodraw;
113 std::vector<std::string> & tokens,
bool clear )
118 std::string::size_type j;
119 while ( (j = input.find_first_of(delimiters)) != std::string::npos ) {
121 tokens.push_back(input.substr(0, j));
123 input = input.substr(j+1);
125 tokens.push_back(input);
126 if (tokens.back() ==
"") {
139 m_is_updating ( false ),
140 m_user_models_loaded ( false )
144 const vector < string > & names = controller -> getFitterNames ();
145 for (
unsigned int i = 0;
i < names.size();
i++ ) {
149 #if QT_VERSION < 0x040000
150 #else // correct code generated by uic3 with release 4.1.1
177 connect (
m_all_ntuples, SIGNAL ( currentIndexChanged (
int ) ),
182 connect (
axisWidget1, SIGNAL ( lowTextReturnPressed() ),
185 connect (
axisWidget2, SIGNAL ( lowTextReturnPressed() ),
188 connect (
axisWidget1, SIGNAL ( highTextReturnPressed() ),
191 connect (
axisWidget2, SIGNAL ( highTextReturnPressed() ),
194 connect (
axisWidget1, SIGNAL ( lowSliderReleased() ),
197 connect (
axisWidget2, SIGNAL ( lowSliderReleased() ),
200 connect (
axisWidget1, SIGNAL ( lowSliderPressed() ),
203 connect (
axisWidget1, SIGNAL ( highSliderPressed() ),
206 connect (
axisWidget1, SIGNAL ( lowSliderValueChanged (
int ) ),
209 connect (
axisWidget2, SIGNAL ( lowSliderValueChanged (
int ) ),
212 connect (
axisWidget1, SIGNAL ( highSliderReleased() ),
215 connect (
axisWidget2, SIGNAL ( highSliderReleased() ),
218 connect (
axisWidget1, SIGNAL ( highSliderValueChanged (
int ) ),
221 connect (
axisWidget2, SIGNAL ( highSliderValueChanged (
int ) ),
224 connect (
axisWidget1, SIGNAL ( zoomPanCheckBoxClicked () ),
227 connect (
axisWidget2, SIGNAL ( zoomPanCheckBoxClicked () ),
283 setFixedSize ( cur_size );
336 const vector < string > & names = controller -> getValueTransformTypes ();
338 unsigned int size = names.size ();
339 for (
unsigned int i = 0;
i <
size;
i++ ) {
352 #if QT_VERSION < 0x040000
360 m_plotter = pev -> plotter ();
367 m_plotter_list = ev -> getPlotters ();
368 if ( m_plotter_list.size () == 1 ) {
369 m_plotter = m_plotter_list.front ();
391 #if QT_VERSION < 0x040000
397 button -> setChecked (
true );
402 #if QT_VERSION < 0x040000
408 button -> setEnabled ( enabled );
422 if ( isHidden() ==
true )
return;
470 if ( plotter == 0 ) {
474 vector < PlotterBase * > cutlist;
476 controller -> fillCutList ( plotter, cutlist );
478 if ( cutlist.empty () ) {
484 vector < PlotterBase * >::iterator first = cutlist.begin();
485 while ( first != cutlist.end () ) {
489 cutter -> setActive (
true );
500 const vector < string > & names
504 names.empty () == false ) {
515 const vector < string > & nt_vector
519 if ( nt_vector.empty () ) {
526 if ( count == nt_vector.size () )
return;
528 #ifdef ITERATOR_MEMBER_DEFECT
533 vector < string > ::const_iterator first = nt_vector.begin();
534 while ( first != nt_vector.end() ) {
535 const string & name = *first++;
540 const string & name = nt_vector.back ();
558 const vector < string > & nt_vector
561 for (
unsigned int i = 0;
i < nt_vector.size();
i++ ) {
562 if ( nt_vector[
i] == name ) {
564 if ( current !=
i ) {
591 vector < DataSource * > nt_vector;
592 controller -> getDataSources ( nt_vector );
594 if ( ds == 0 )
return;
596 const string new_name = text.
latin1();
598 ds -> setName ( new_name );
606 controller -> setCurrentIndex ( item );
634 controller -> setCurrentIndex( index );
677 if ( !plotter ) return ;
680 const std::string strAxisName ( axisName.
latin1() );
681 const std::string strLabel( label.
latin1() );
684 controller -> setAxisBinding ( plotter, strAxisName, strLabel );
686 bool valid = controller -> isDataValid ( plotter );
687 if ( valid ==
false ) {
696 const vector < string > & dataRepNames
698 if ( dataRepNames.empty () )
return;
701 if ( dataRepNames.size() !=
size ) {
704 vector < string > ::const_iterator first = dataRepNames.begin ();
705 while ( first != dataRepNames.end() ) {
706 const string & name = *first++;
707 if ( name.find (
"Static" ) != string::npos )
continue;
718 clear ( std::vector < QLabel * > & labels,
719 std::vector < QComboBox * > & combos )
721 unsigned int size = combos.size ();
722 for (
unsigned int i = 0;
i <
size;
i++ ) {
725 box -> setEnabled (
false );
727 label -> setEnabled (
false );
736 vector < DataSource * > nt_vector;
740 int size = static_cast <
int > ( nt_vector.size() );
747 if ( ! (index < size ) ) {
754 const vector < string > & bindingOptions
755 = controller -> bindingOptions ( plotTypeStr );
757 if ( bindingOptions.empty () )
return;
763 vector < int > indices;
765 for (
unsigned int i = 0;
i < s;
i++ ) {
773 const vector < string > & cols = nt->
getLabels();
776 if (
i < bindingOptions.size () ) {
777 const string & axisName = bindingOptions[
i];
779 qs1 = ( axisName.c_str() );
783 for (std::vector<string>::size_type j = 0; j < cols.size(); j++){
787 if ( axisName.find (
"optional" ) != string::npos ) {
800 if ( indices[
i] >= 0 &&
825 if ( plotter != 0 ) {
828 bool yes = plotter -> isTargetable ();
829 if ( yes ==
false )
return;
858 const vector < string > & nt_vector
861 unsigned int size = nt_vector.size ();
863 bool refresh = count !=
size;
866 for ( std::size_t
i = 0;
i <
size;
i++ ) {
867 const string & ntname = nt_vector[
i];
868 if ( ntname == name ) jndex =
i;
891 bool yes = plotter != 0;
893 yes = plotter -> isTargetable ();
895 DataRep * datarep = plotter -> getTarget ();
898 int index = plotter -> indexOf ( datarep );
900 const string & dataRepName
901 = controller -> getType ( plotter, index );
902 QString qst2 ( dataRepName.c_str() );
922 while ( hit.current() != 0 )
927 if ( hwidget )
delete ( hwidget );
940 DataRep * datarep = plotter -> getTarget ();
941 int index = plotter -> indexOf ( datarep );
942 assert ( datarep != 0 );
944 bool ntuple_bindings = datarep -> hasNTupleBindings ( );
947 if ( ntuple_bindings ) {
948 name = controller -> getDataSourceName ( plotter, index );
960 const vector < string > & bindings
961 = controller -> axisBindings ( plotter, index );
962 const vector < string > & bindingOptions
963 = controller -> bindingOptions ( plotter, index );
964 unsigned int listSize;
966 if ( bindings.size() < bindingOptions.size() )
968 listSize = bindings.size();
972 listSize = bindingOptions.size();
975 bool yes = plotter -> isTargetable ();
976 if ( ntuple_bindings ==
false ||
977 yes ==
false )
return;
983 const vector < string > & cols
984 = controller -> getDataSourceLabels ( plotter, index );
986 if ( cols.empty () )
return;
992 if (
i == listSize )
break;
993 const string & axisLabel = bindings[
i];
994 const string & axisName = bindingOptions[
i];
996 qs1 = ( axisName.c_str() );
1000 qs2 = ( axisLabel.c_str() );
1006 for (std::vector<string>::size_type j = 0; j < cols.size(); j++ )
1010 if ( axisName.find (
"optional" ) != string::npos )
1023 "One or more columns of the bound data source\n"
1024 "contains invalid data.";
1038 "No n-tuple selected error\n"
1039 "Need to load n-tuple to create a plot";
1041 "No n-tuple selected error",
1052 QString message (
"Plot of type " );
1053 message += type.c_str();
1054 message +=
" can not be added\n"
1055 "to selected plot\n\n"
1056 "It might be incompatible. For example, \n"
1057 "requiring a Z axis display while selected\n"
1058 "does not have one.";
1060 "Add to plot error",
1070 QString message (
"Fitter of type " );
1071 message += type.c_str();
1072 message +=
" can not be used\n"
1073 "with selected plot\n\n"
1074 "It might be incompatible. For example, \n"
1075 "Maximum Likelihood fitting requires binned\n"
1076 "data representation.";
1089 QString message =
"Function`";
1090 message += name.c_str();
1091 message +=
"' could not be used because ...\n";
1093 message +=
"\nMaybe the copy constructor or clone function is bad.";
1107 QString message (
"Funtion of type " );
1108 message += type.c_str();
1109 message +=
" can not be used\n"
1110 "with selected fitter\n\n"
1111 "It might be incompatible. For example, \n"
1112 "the fitter requires derivatives\n"
1113 "that the function can not supply.";
1126 QString message (
"Attempt to apply invalid range:\n\n" );
1127 message += bad.c_str();
1128 message +=
"\n\n Low end of range must be less than high end.";
1142 QString message (
"Multiple data representations are active.\n"
1143 "Can not apply a " );
1144 message += type.c_str();
1147 "Use Command-click to select only one data representation.";
1150 "Use Control-click to select only one data representation.";
1153 "Multiple data representation error",
1165 QString message (
"Multiple data representations are active.\n"
1167 message += type.c_str();
1168 message +=
" to each?\n\n";
1171 message +=
"One can use Control-click to apply a ";
1173 message +=
"One can use Command-click to apply a ";
1175 message += type.c_str();
1176 message +=
" to a selected data representation.";
1180 "Multiple data representation error",
1184 QMessageBox::NoButton );
1186 ok = result == QMessageBox::Ok;
1195 const QString message (
"Attempt to add cut to itself\n"
1196 "The request was ignorned" );
1198 "Applying cut error",
1210 "Multiple plots are selected.\n"
1211 "Can not apply change until only one is selected\n\n"
1212 "Use shift-click to deselect a selected plot" );
1214 "Multiple plot error",
1224 "Functions are not supported on the selected data reaxisWitation.";
1240 QString message (
"New plot could not be created because:\n" );
1241 message += e.what ();
1256 vector < int > dimSize;
1257 controller -> fillDimSize ( dimSize, rtuple, column );
1260 QString caption(
"MultiDimensional data in rows of the column ");
1264 std::ostringstream ost;
1265 ost <<
" Rows of this column are of size ";
1268 for( i = 0; i < dimSize.size() - 1; i++ )
1269 ost << dimSize[i] <<
" x ";
1272 ost <<
"\n Enter C-style index of a single element of this";
1273 ost <<
"\n multidimentional data which you wish to analyse.";
1274 ost <<
"\n Index should be a comma separated list of ";
1275 ost << dimSize.size() <<
" integers.";
1277 ost <<
"\n For e.g. ";
1278 for( i = 0; i < dimSize.size() - 1; i++ )
1282 string label( ost.str() );
1287 QString::null, &ok,
this );
1290 std::ostringstream labelstream;
1295 vector< unsigned int >
index;
1296 string s( text.
ascii() );
1300 boost::char_separator< char > sep(
"," );
1303 typedef boost::tokenizer< boost::char_separator< char > > tokenizer;
1304 tokenizer tok( s, sep );
1307 for( tokenizer::iterator tok_iter = tok.begin();
1308 tok_iter != tok.end();
1311 unsigned int idx = boost::lexical_cast<
unsigned int >( *tok_iter );
1312 index.push_back( idx );
1313 labelstream <<
"[" << idx <<
"]";
1317 return labelstream.str();
1327 vector < DataSource * > nt_vector;
1330 if ( nt_vector.empty() )
1344 vector < string > bindings;
1354 if(
column !=
"nil" && ds -> isMultiDimensional(
column ) ) {
1356 if ( yes ==
false ) {
1358 message (
"This column is not useable because it contains\n"
1359 "a multidimension array that varies is size or is\n"
1360 "an unsupported data type." );
1365 QMessageBox::NoButton,
1366 QMessageBox::NoButton );
1372 rcontroller -> smartExpandRootNTuple ( ds,
column );
1375 bindings.push_back ( label );
1382 controller -> createDisplay ( plotTypeStr, * ds, bindings );
1386 bool valid = controller -> isDataValid ( newDisplay );
1387 if ( valid ==
false ) {
1392 catch (
const std::exception & e ) {
1405 if ( !plotter )
return;
1410 vector < DataSource * > nt_vector;
1418 vector < string > bindings;
1427 if (
column !=
"nil" && ds -> isMultiDimensional (
column ) ) {
1430 rcontroller -> smartExpandRootNTuple ( ds,
column );
1433 bindings.push_back ( label );
1439 DataRep *
rep = controller -> addDataRep ( plotter, plotTypeStr, ds,
1451 plotter -> autoScale ();
1452 bool valid = controller -> isDataValid ( rep );
1453 if ( valid ==
false ) {
1465 if ( !plotter )
return;
1468 int num_rep = plotter -> getNumDataReps();
1472 if (( num_active < 0) || ( num_rep <= 1 ))
1475 "You must have more than one DataReps \n"
1476 "in this view AND only one DataRep \n"
1477 "selected to be removed.";
1480 "Unable to remove DataRep",
1488 DataRep *
rep = plotter -> getDataRep( num_active );
1491 plotter -> removeDataRep ( rep );
1492 plotter -> autoScale ();
1504 if ( plotter == 0 )
return;
1506 NTuple * ntuple = fc -> createNTuple ( plotter, 0 );
1517 plotterlist.clear();
1520 if ( canvaz != 0 ) {
1535 if ( size == 0 )
return;
1538 vector < PlotterBase * > web;
1542 for (
unsigned int i = 0;
i <
size;
i++ ) {
1544 bool yes = plotter != 0;
1545 if ( yes ) yes = plotter -> isTargetable ();
1546 if ( yes ==
false )
continue;
1549 yes = rep -> hasNTupleBindings ();
1550 if ( yes ==
false )
continue;
1553 const vector < string > & names = ds_controller -> getNTupleNames ();
1554 const string & ds_name = names [
index ];
1555 const DataSource * source = ds_controller -> getDataSource ( ds_name );
1559 dr_controller -> changeDataSource ( rep, source );
1561 catch (
const runtime_error & e ) {
1562 QString message (
"Could not change binding because\n" );
1563 message += e.what ();
1565 "Data source error",
1580 const vector < double > & sv =
1581 controller -> getValueCtrlPts ( plotter );
1582 unsigned int size = sv.size ();
1584 brk_pt -> setEnabled (
true );
1586 brk_pt -> setValue ( static_cast <int> ( sv[0] *
brk_pt -> maxValue() ));
1607 brk_pt -> setEnabled (
false );
1630 int number = plotter -> getNumDataReps ();
1631 int index = plotter -> activePlotIndex ();
1632 yes = ( number < 2 ) || index >= 0;
1641 m_grid -> setEnabled ( yes );
1644 if ( yes ==
false ) {
1656 DataRep * datarep = controller -> activeDataRep ( plotter );
1658 assert ( datarep != 0 );
1660 yes = datarep -> hasErrorDisplay ();
1666 const vector <string> & pointreps = proj -> getPointReps();
1669 if ( pointreps.empty () == false ) {
1670 for (std::vector<string>::size_type
i = 0;
i < pointreps.size();
i++ ) {
1678 const string & curRep = rep->
name();
1682 if ( plotter -> hasAxis (
Axes::Z ) == false ) {
1688 int jndex = controller -> getValueTransformIndex ( plotter );
1700 const BinToColor * repp=plotter -> getValueRep ();
1703 bool yess = repp -> acceptChangeColor ();
1709 bool yes = controller -> hasControlPoints ( plotter );
1711 yes = controller -> isUserDefinedValueTransform ( plotter );
1718 const DataSource * nt = controller -> getDataSource ( plotter, 0 );
1720 if ( nt && nt -> empty () ) {
1729 const std::string & st = plotter->
getTitle();
1739 yes = controller -> hasSymbolRep ( plotter );
1749 yes = controller -> hasLineRep ( plotter );
1753 unsigned int style = controller -> getRepStyle ( plotter );
1754 #if QT_VERSION < 0x040000
1757 QAbstractButton * button =
m_line_group -> find ( style );
1760 rb -> setChecked (
true );
1763 float ptsize = controller -> pointSize ( plotter );
1777 const NTuple * ntuple = dynamic_cast <
const NTuple * > ( nt );
1778 yes = ntuple != 0 && ntuple -> isIntervalEnabled ();
1793 if ( plotter != 0 ) {
1796 controller -> setValueTransform ( plotter, index );
1801 yes = rep -> acceptChangeColor ();
1806 yes = controller -> hasControlPoints ( plotter );
1808 bool y = rep -> isUserDefined ();
1823 if ( canvas != 0 ) {
1844 = settings.
entryList ( model_name_key );
1846 QStringList::size_type
size = model_list.size ();
1847 for ( QStringList::size_type
i = 0;
i <
size ;
i++ )
1851 = settings.
readEntry ( model_name_key + number );
1860 string mname ( name.
latin1() );
1861 vector < double > cpts;
1862 cpts.push_back ( brk_pt );
1863 cpts.push_back ( flat_width );
1864 cpts.push_back ( color_scale );
1867 controller -> addValueTransform ( mname, cpts );
1880 vector < double > sv;
1882 double m =
brk_pt -> maxValue ();
1884 sv.push_back ( (
brk_pt -> value()) / m + 0.001);
1888 sv.push_back ( (
flat_width -> value()) / w + 0.001);
1892 sv.push_back ( ( ( (
color_scale -> value()) / c ) ) * 1.5 );
1895 if ( plotter != 0 ) {
1897 controller -> setValueCtrlPts (plotter,sv );
1908 brk_pt -> setValue ( 50 );
1921 int ibp =
brk_pt -> value ();
1925 double bp = static_cast <
double > ( ibp) /
1926 static_cast <double>(
brk_pt -> maxValue () );
1928 double fw = static_cast <
double > ( ifw ) /
1929 static_cast <double>(
flat_width -> maxValue () );
1931 double cs = static_cast <
double > ( ics ) /
1932 static_cast <double>(
color_scale -> maxValue () );
1934 sv.push_back ( bp );
1935 sv.push_back ( fw );
1936 sv.push_back ( cs );
1954 const string name ( text.
latin1() );
1955 vector < double > sv;
1958 controller -> addValueTransform ( name, sv );
1963 controller -> setValueTransform ( plotter, name );
1964 int index = controller -> getValueTransformIndex ( plotter );
1972 = settings.
entryList ( model_name_key );
1977 if ( index == -1 )
break;
1995 bool isFirstVR =
true;
1998 vector < double > sv;
2005 controller -> saveValueCtrlPts ( plotter, sv );
2012 = settings.
entryList ( model_name_key );
2014 #if QT_VERSION < 0x040000
2015 for (
unsigned int i = 0;
i < model_list.size();
i++ ) {
2017 for (
int i = 0;
i < model_list.size();
i++ ) {
2020 QString name_key ( model_name_key + at );
2022 if ( name == item ) {
2037 if ( index == -1 )
break;
2054 const string name ( item.
latin1() );
2057 bool yes = controller -> removeValueTransform ( name );
2061 controller -> setValueTransform ( plotter,
"Rainbow" );
2067 = settings.
entryList ( model_name_key );
2068 QStringList::size_type
size = model_list.size ();
2070 for (QStringList::size_type
i = 0;
i <
size;
i++ ) {
2072 QString name_key ( model_name_key + at );
2074 if ( name == item ) {
2091 if ( !plotter )
return;
2096 controller -> setErrorDisplayed ( plotter,
Axes::Y, checked );
2101 const QString message (
"HippoDraw was not built with TeX support on "
2118 for (
unsigned int i = 0;
i <
size;
i++ ) {
2127 #ifdef HAVE_TEX_UTILS
2128 plotter -> setTopMargin ( needMargin?10.0:0.0 );
2129 plotter -> setNeedUpdate(
true);
2130 plotter -> notifyObservers ();
2147 if ( !plotter ) return ;
2150 DataRep *
rep = controller -> activeDataRep ( plotter );
2156 rep -> setRepStyle (
id );
2164 if ( !plotter ) return ;
2167 DataRep *
rep = controller -> activeDataRep ( plotter );
2173 rep -> setRepStyle (
id );
2180 if ( !plotter )
return;
2183 DataRep *
rep = controller -> activeDataRep ( plotter );
2199 if ( plotter == 0 )
return;
2211 if ( plotter == 0 )
return;
2215 unsigned int interval = text.
toUInt ();
2224 if ( !plotter )
return;
2238 if ( color.isValid() == false )
return;
2242 Color c ( color.red(), color.green(), color.blue() );
2252 if ( plotter != 0 ) {
2256 controller -> setPointRep ( plotter,
rep );
2258 if ( plotter -> hasAxis (
Axes::Z ) ==
true ) {
2261 controller -> setValueTransform ( plotter, index );
2285 if ( !plotter )
return;
2298 std::map < const PlotterBase *, bool >::const_iterator
it
2364 if ( !plotter )
return;
2367 int index = controller -> activeDataRepIndex ( plotter );
2368 bool yes = controller -> hasNTupleBindings ( plotter, index );
2374 if ( width == 0 )
return;
2400 if ( !plotter )
return;
2412 if ( !plotter )
return;
2415 int index = controller -> activeDataRepIndex ( plotter );
2416 bool yes = controller -> hasNTupleBindings ( plotter, index );
2422 int value = static_cast <
int > ( 50.0 * offset ) + 49;
2445 if ( !plotter )
return;
2457 if ( plotter != 0 ) {
2459 string ltext = text.
latin1();
2468 #ifdef HAVE_TEX_UTILS
2470 plotter -> setBottomMargin ( needMargin?8.0:0.0 );
2472 plotter -> setLeftMargin ( needMargin?0.0:0.0 );
2474 plotter -> setZMargin ( needMargin?7.0:0.0 );
2475 plotter -> setNeedUpdate(
true);
2476 plotter -> notifyObservers ();
2479 ltext.erase( 0, 4 );
2482 plotter -> setLabel (
m_axis, ltext );
2494 if ( !plotter )
return;
2523 if ( !plotter )
return;
2533 double low = r.
low();
2562 if ( !plotter )
return;
2572 double high = r.
high();
2589 double offset(0.0), incr(0.0);
2630 if ( !plotter )
return;
2654 if ( !plotter )
return;
2666 const std::vector < PlotterBase * > &
2670 vector < PlotterBase * > plotterlist;
2675 const DataSource * tuple = controller -> getDataSource ( plotter );
2677 return cutcontroller->
getCutList ( plotterlist, tuple );
2687 bool fit_cut =
id == 2;
2693 if ( fit_cut ==
false ) {
2695 const Range & fullRange = plotter -> getRange ( cut_axis,
false );
2700 const Range & fullRange = plotter -> getRange (
Axes::X,
false );
2718 while ( number-- > 0 ) {
2732 unsigned int size = cutlist.size ();
2734 for (
unsigned int i = 0;
i <
size;
i++ ) {
2737 plotter -> fillCutList ( cuts );
2739 for (
unsigned int j = 0; j < cuts.size (); j++ ) {
2753 while ( numberItems-- > 0 ) {
2769 for (
unsigned int i = 0;
i <
size;
i++ ) {
2771 const string &
label = cut -> getLabel ();
2772 QString item = label.c_str ();
2774 if ( item == old_current ) index =
i;
2780 map < PlotterBase *, int > ::iterator first
2788 index = first -> second;
2791 if ( index >= count ) {
2811 assert ( cut != 0 );
2812 bool yes = cut -> isEnabled ();
2826 for (
unsigned int i = 0;
i <
size;
i++ ) {
2848 bool fit_cut =
id == 2;
2849 if ( fit_cut ==
false ) {
2852 const Range & fullRange = cplotter->
getRange ( cut_axis,
false );
2858 = controller -> isZoomPan ( cplotter, cut_axis );
2880 const std::vector < const TupleCut * > &
2885 int index = controller -> activeDataRepIndex ( plotter );
2887 string what (
"Inspector::getCutList: " );
2888 what +=
"no active DataRep in PlotterBase object.";
2889 throw std::logic_error ( what );
2891 const DataRep * datarep = plotter -> getDataRep ( index );
2894 return cut_controller ->
getCutList ( datarep );
2906 bool yes = plotter != 0;
2907 if ( yes ) yes = plotter -> isTargetable ();
2909 if ( yes ==
false )
return;
2911 vector < PlotterBase * > cutlist;
2915 controller -> fillCutList ( plotter, cutlist );
2919 if ( cutlist.empty () ) {
2926 cutlist.push_back ( plotter );
2964 if ( !plotter ) return ;
2968 controller -> addCut ( cp, plotter );
2977 if ( plotter == 0 )
return;
2980 const vector < PlotterBase * > & cut_list =
getDataCutList ( plotter );
2982 controller -> addCuts ( cut_list, plotter );
2984 unsigned int size = cut_list.size ();
2985 for (
unsigned int i = 0;
i <
size;
i++ ) {
2988 if ( cut_plotter == plotter ) {
3002 if ( !plotter ) return ;
3005 if ( is_fit_radio ) {
3008 DataRep *
rep = plotter -> getDataRep ( index );
3032 bool yes = plotter != 0;
3033 if ( yes ) yes = plotter -> isTargetable ();
3036 if ( yes ==
false )
return;
3038 const vector < PlotterBase * > & cutlist =
getDataCutList ( plotter );
3044 if ( cutlist.empty () ) {
3058 const PlotterBase * cut_plotter = cutlist.back ();
3080 if ( plotter == 0 )
return 0;
3106 bool yes = plotter != 0;
3108 if ( yes ) yes = plotter -> isTargetable ();
3109 if ( yes ==
false ) {
3110 int index = plotter -> activePlotIndex ();
3115 const QString message (
"Can not apply cut to a function" );
3117 "Cut application error",
3128 assert ( index >= 0 );
3130 const DataRep *
rep = plotter -> getDataRep ( index );
3131 if ( rep -> hasNTupleBindings () ==
false ) {
3132 const QString message (
"Can not apply cut to a static histogram" );
3134 "Cut application error",
3142 vector < string > bindings;
3145 #if QT_VERSION < 0x030100 // 3.1.0
3150 string label1 = text1.
latin1();
3152 string label2 = text2.
latin1();
3157 bindings.push_back( label1 );
3160 bindings.push_back( label1 );
3161 bindings.push_back( label2 );
3165 PlotterBase * cutplotter = cutcontroller -> addCut ( plotter, index, bindings );
3167 if ( canvas == 0 )
return;
3169 canvas -> addPlotDisplay ( cutplotter,
false );
3172 DataRep * datarep = plotter -> getDataRep ( index );
3174 controller -> setTupleCut ( plotter, datarep );
3189 for (
int i = 0;
i <
size;
i++ ) {
3191 if ( text == label ) {
3206 bool yes = plotter != 0;
3209 if ( yes ) yes = plotter -> isTargetable ();
3214 bool is_fit_radio =
id == 2;
3218 if ( is_fit_radio ==
false ) {
3260 const vector < PlotterBase * > & cuts =
getDataCutList ( plotter );
3261 if ( cuts.empty() ) {
3276 vector < PlotterBase * > plotters;
3279 if ( plotters.empty () == false ) {
3281 vector < CutPlotter * > cutters;
3282 controller -> fillCutList ( plotters, cutters );
3283 vector < CutPlotter * > ::iterator first = cutters.begin ();
3285 while ( first != cutters.end () ) {
3287 cutter -> setActive ( yes );
3311 const vector < string > & cols = tuple->
getLabels();
3312 #ifdef ITERATOR_MEMBER_DEFECT
3315 vector < string > ::const_iterator first = cols.begin ();
3316 while ( first != cols.end() ) {
3317 const string & str = *first++;
3328 if ( index1 >= 0 ) {
3331 if ( index2 >= 0 ) {
3382 const vector < string > & fitters = controller -> getFitterNames ();
3383 for (
unsigned int i = 0;
i < fitters.size();
i++ ) {
3384 if ( name == fitters[
i] )
3397 const vector < string > & names = controller -> getFunctionNames ();
3401 static_cast < int > ( names.size () ) ) {
3404 for (
unsigned int i = 0;
i < names.size();
i++) {
3405 if ( names[
i] !=
"Linear Sum" ) {
3412 bool yes = plotter != 0;
3415 if ( yes ) yes = plotter -> isTargetable ();
3421 if ( yes ==
false ) {
3428 if ( nt && nt -> empty () )
3443 if ( current >= 0 ) {
3450 bool to_enable =
false;
3452 int index = d_controller -> activeDataRepIndex ( plotter );
3458 if ( f_controller -> hasFunction ( plotter, datarep ) ) {
3460 const vector < string > & fnames
3461 = f_controller -> functionNames ( plotter, datarep );
3463 if ( fnames.size() != 0 )
3468 for (
unsigned i = 0;
i < fnames.size();
i++)
3470 if ( fnames[
i].find (
"Linear Sum" ) == string::npos )
3483 if ( to_enable ==
false ) {
3489 Fitter * fitter = f_controller -> getFitter ( plotter );
3490 string name =
"none";
3491 if ( fitter != 0 ) {
3492 name = f_controller -> getFitterName ( plotter );
3497 m_resid->setEnabled ( to_enable );
3517 if ( !plotter ) return ;
3521 controller -> removeFunction ( plotter, frep );
3536 if ( !plotter ) return ;
3539 int index = dcontroller -> activeDataRepIndex ( plotter );
3540 if ( index < 0 )
return;
3541 DataRep * datarep = plotter -> getDataRep ( index );
3544 if ( ! ( fcontroller -> hasFunction ( plotter, datarep ) ) ) {
3548 fcontroller -> restoreParameters ( plotter );
3562 DataRep * datarep = plotter -> getDataRep ( index );
3563 assert ( datarep != 0 );
3566 if ( ! ( controller -> hasFunction ( plotter, datarep ) ) )
3571 const vector < string > & fnames
3572 = controller -> functionNames ( plotter, datarep );
3574 if ( fnames.empty () ) {
3579 vector < FunctionRep * > freps;
3580 controller -> fillTopLevelFunctionReps ( freps, plotter, datarep );
3581 for (
unsigned int i = 0;
i < freps.size ();
i++ ) {
3583 const string & func_name = frep -> functionName ();
3585 #if QT_VERSION < 0x040000
3589 Q3ListViewItem * parent
3592 parent -> setOpen (
true );
3593 parent -> setText (
Index,
QString ( func_name.c_str() ) );
3597 bool ignoreFlag =
true;
3599 Fitter * fitter = frep -> getFitter ();
3600 if ( fitter != 0 ) {
3602 ignoreFlag = frep -> getIgnoreErrors ();
3604 const vector < double > & parms = frep -> parameters ();
3605 unsigned int start_index = parms.size();
3609 #if QT_VERSION < 0x040000
3612 Q3ListViewItem * firstItem = parent -> firstChild ();
3616 if ( firstItem != 0 ) {
3630 #if QT_VERSION < 0x040000
3633 unsigned int &
index )
3637 unsigned int & index )
3643 if ( composite != 0 ) {
3644 const vector < FunctionRep * > & freps
3645 = composite -> getFunctionReps ();
3646 unsigned int size = freps.size();
3650 for (
int i = size -1;
i >= 0;
i-- ) {
3652 const string & func_name = rep -> functionName ();
3653 #if QT_VERSION < 0x040000
3657 Q3ListViewItem * child
3658 =
new Q3ListViewItem ( parent );
3660 child -> setOpen (
true );
3661 child -> setText (
Index,
QString ( func_name.c_str() ) );
3668 vector < FunctionParameter > function_parameters;
3676 unsigned int size = function_parameters.size ();
3678 for (
int pindex = size-1; pindex >= 0; pindex-- ) {
3681 #if QT_VERSION < 0x040000
3684 QCheckListItem::CheckBox );
3686 Q3CheckListItem * item
3687 =
new Q3CheckListItem ( parent, dummy,
3688 Q3CheckListItem::CheckBox );
3690 item -> setText(
Index,
QString(
"%1" ).arg( index-- ) );
3692 const string & name = fp.
name ();
3695 fixedFlag = fp.
isFixed () ? qyes : qno;
3697 item -> setText(
Name,
QString(
"%1" ).arg( pname ) );
3700 item -> setText(
Fixed,
QString(
"%1" ).arg( fixedFlag ) );
3701 item -> setText(
Dummy,
QString(
"%1" ).arg( pindex ) );
3714 if ( !plotter ) return ;
3716 bool yes = plotter -> isTargetable ();
3717 if ( yes ==
false ) {
3724 DataRep * datarep = dc -> activeDataRep ( plotter );
3725 assert ( datarep != 0 );
3735 std::string fun_name = qstr.
latin1();
3740 const string fit_name = s.
latin1();
3743 yes = fc -> isCompatible ( fun_name, fit_name );
3745 if ( yes ==
false ) {
3752 #if QT_VERSION < 0x040000
3759 if ( is_selected ) {
3763 new_rep = fc->
addFunction ( plotter, fun_name, frep, datarep );
3765 catch ( std::exception & e ) {
3779 if ( new_rep != 0 ) {
3780 ok = fc -> tryFitFunction ( plotter, new_rep );
3795 const vector < string > & names = controller -> getFitterNames ();
3796 const string & def_fitter = names [
index ];
3797 controller -> setDefaultFitter ( def_fitter );
3800 if ( plotter != 0 ) {
3801 const DataRep * datarep = plotter -> getTarget ();
3802 bool yes = controller -> hasFunction ( plotter, datarep );
3804 bool ok = controller -> changeFitter ( plotter, datarep,
3806 if ( ok ==
false ) {
3821 const QString message (
"The Fit failed to converge" );
3832 #if QT_VERSION < 0x040000
3848 #if QT_VERSION < 0x040000
3865 #if QT_VERSION < 0x040000
3878 #if QT_VERSION < 0x040000
3884 if ( item -> childCount() == 0 ) {
3885 item = item -> parent ();
3896 if ( !plotter ) return ;
3899 if ( ! ( fcnt -> hasFunction ( plotter, 0 ) ) ) {
3903 fcnt -> saveParameters ( plotter );
3907 bool ok = fcnt -> fitFunction ( plotter, fun_rep );
3914 int index = dcontroller -> activeDataRepIndex ( plotter );
3923 QString text_str = box -> text ();
3924 int i = text_str.
find (
"=" );
3925 text_str.
remove ( i + 1, 1024 );
3926 box -> setText ( text_str );
3934 bool yes = plotter == 0;
3935 if ( yes ==
false ) {
3939 bool enable = !
yes;
3942 if ( enable ==
false )
return;
3945 const DataSource * nt = dcontroller -> getDataSource ( plotter, 0 );
3947 if ( nt && nt -> empty () ) {
3953 int index = dcontroller -> activeDataRepIndex ( plotter );
3955 DataRep * datarep = plotter -> getDataRep ( index );
3958 enable = controller->
hasFunction ( plotter, datarep );
3960 if ( enable ==
false ) {
3988 int number = dcontroller -> getNumberOfEntries ( plotter, index );
3996 int underflow = dcontroller -> getUnderflow ( plotter, index );
3998 if ( underflow == -1 ) str =
"meaningless";
3999 else str.
setNum ( underflow );
4004 int overflow = dcontroller -> getOverflow ( plotter, index );
4006 if ( overflow == -1 ) str =
"meaningless";
4007 else str.
setNum ( overflow );
4012 double average = dcontroller -> getAverage ( plotter,
Axes::X, index );
4019 average = dcontroller -> getAverage ( plotter,
Axes::Y, index );
4042 if ( !plotter )
return;
4053 string nullstring (
"");
4057 const string s (
"Total Entries");
4063 const string s (
"Underflow");
4069 const string s (
"Overflow");
4075 const string s (
"averagex");
4081 const string s (
"averagey");
4087 const string s (
"Function Parameters");
4089 assert ( controller -> hasFunction ( plotter, 0 ) );
4096 const string s (
"Chi-squared");
4098 assert ( controller -> hasFunction ( plotter, 0 ) );
4107 const string t = qtext.
latin1();
4110 #ifdef HAVE_TEX_UTILS
4116 string text (qtext.
latin1());
4117 const string s (
"Text From Box");
4127 if ( plotter == 0 )
return;
4132 = controller -> createResidualsDisplay ( plotter, func_rep );
4133 const Range & range = plotter -> getRange (
Axes::X,
false );
4134 res_plotter -> setRange (
Axes::X, range,
false );
4138 canvas -> addPlotDisplay ( res_plotter,
true );
4146 #if QT_VERSION < 0x040000
4151 while ( it.current () ) {
4152 #if QT_VERSION < 0x040000
4156 Q3ListViewItem * item = it.current ();
4157 Q3CheckListItem * check_item = dynamic_cast < Q3CheckListItem * > (
item );
4159 if ( check_item != 0 ) {
4160 bool yes = check_item -> isOn ();
4178 if ( plotter == 0 )
return;
4185 message (
"Two and only two function parameters should be\n"
4186 "checked to create error contour display.\n" );
4188 "Invalid parameter pair selection",
4196 #if QT_VERSION < 0x040000
4205 "Both checked function parameters must\n"
4206 "have same parent function.";
4208 "Invalid parameter pair selection",
4217 int index = text.
toInt ( & ok ) - 1;
4218 fcontroller -> setEllpsoidParamIndex (
Axes::X , index );
4220 text = second -> text (
Index );
4222 index = text.
toInt ( & ok ) -1 ;
4223 fcontroller -> setEllpsoidParamIndex (
Axes::Y , index );
4229 #if QT_VERSION < 0x040000
4235 if( stat ==
QString(
"Change Error Plot" ) )
4237 fcontroller -> refreshEllipsoidDisplay ( plotter, frep );
4244 fcontroller -> createNewEllipsoidDisplay ( plotter, frep );
4245 assert( err_plotter != 0);
4252 assert( canvas != 0 );
4256 canvas -> addPlotDisplay ( err_plotter,
false );
4264 if ( axis ==
Axes::X )
return "X";
4265 else if ( axis ==
Axes::Y )
return "Y";
4266 else if ( axis ==
Axes::Z )
return "Z";
4293 bool scaled = plotter -> isAutoRanging (
m_axis );
4308 bool reversed = plotter -> isReverse ();
4328 bool yes = plotter == 0;
4329 if ( yes ==
false ) {
4339 if ( plotter -> isTargetable () ) {
4348 if ( nt && nt -> empty () )
return;
4352 bool enabled = plotter -> hasAxis (
Axes::Z );
4355 const string &
label = plotter -> getLabel (
m_axis );
4356 const QString ltext = label.c_str();
4360 bool axis_bined = controller -> isAxisBinned ( plotter, s_axis );
4362 double low = r.
low();
4363 double high = r.
high();
4366 axis_bined ==
true &&
4367 has_ntuple ==
false );
4369 axis_bined ==
true &&
4370 has_ntuple ==
false );
4407 if ( axis_bined ==
false )
4439 bool disable_log = has_ntuple ==
false && axis_bined ==
true;
4440 logScale -> setDisabled ( disable_log );
4463 bool isZoomPan =
false;
4465 std::map < const PlotterBase *, bool >::const_iterator
it
4468 isZoomPan = it->second;
4489 const DataRep * datarep = plotter -> getDataRep ( index );
4490 RepBase * rep = datarep -> getRepresentation ();
4492 yes = contourRep != 0;
4508 #if QT_VERSION < 0x040000
4514 #if QT_VERSION < 0x040000
4520 bool is_parm = item -> childCount () == 0;
4521 bool enable = is_selected && is_parm;
4531 setChecked(( fixedFlag == qyes ) ?
true :
false );
4535 enable = is_selected && (! is_parm);
4539 #if QT_VERSION < 0x040000
4547 if ( t == 0 )
break;
4555 Q3ListViewItem * parent =
item;
4557 Q3ListViewItem * t = parent -> parent ();
4558 if ( t == 0 )
break;
4572 if ( !plotter )
return;
4575 if ( ! ( fcontroller -> hasFunction ( plotter, 0 ) ) ) {
4579 fcontroller -> saveParameters ( plotter );
4581 #if QT_VERSION < 0x040000
4590 vector < int > fixed = frep -> getFixedFlags ();
4593 int paramindex = pidx.
toUInt() - 1;
4598 fixed[ paramindex ] = flag ==
true ? 1 : 0;
4599 frep -> setFixedFlags( fixed );
4601 if ( item -> childCount () == 0 ) {
4604 QString fixedFlag = ( flag == true ) ? qyes : qno;
4605 item -> setText (
Fixed, fixedFlag );
4618 if ( !plotter )
return;
4622 if ( ! ( fcontroller -> hasFunction ( plotter, 0 ) ) )
4626 fcontroller -> saveParameters ( plotter );
4629 #if QT_VERSION < 0x040000
4637 int paramindex = pidx.
toUInt() -1;
4640 vector < double > parameters = frep-> parameters();
4644 parameters[ paramindex ] = text.
toDouble();
4649 item -> setText (
Value,
QString (
"%1" ).arg ( parameters[ paramindex ] ) );
4661 if ( !plotter )
return;
4664 if ( ! ( fcontroller -> hasFunction ( plotter, 0 ) ) )
4668 fcontroller -> saveParameters ( plotter );
4686 if ( !plotter )
return;
4689 if ( ! ( fcontroller -> hasFunction ( plotter, 0 ) ) )
4692 #if QT_VERSION < 0x040000
4701 int paramindex = pidx.
toUInt() - 1;
4708 newParameters[ paramindex ]
4710 pow ( 2.0, static_cast<double>( (sliderValue - 50) * sign) / 50.0 );
4715 item -> setText(
Value,
QString (
"%1" ).arg ( newParameters[ paramindex ]));
4717 setText (
QString (
"%1" ).arg ( newParameters[ paramindex ] ) );
4746 bool log =
logScale -> isChecked();
4749 vector < PlotterBase * > ::iterator first =
m_plotter_list.begin ();
4755 plotter -> setAutoRanging (
m_axis, auto_scale );
4757 catch (
const runtime_error & e ) {
4767 bool reverse =
m_reverse -> isChecked();
4769 vector < PlotterBase * > ::iterator first =
m_plotter_list.begin ();
4773 plotter -> setReverse ( reverse );
4782 vector < PlotterBase * > ::iterator first =
m_plotter_list.begin ();
4786 plotter -> setAutoRanging (
m_axis, scale );
4807 bool fit_cut =
id == 2;
4809 if ( fit_cut ==
false ) {
4812 const Range & fullRange = plotter -> getRange ( axis,
false );
4813 axisWidget2 -> processHighSliderMoved ( value, currentRange, fullRange );
4814 plotter -> setCutRangeAt ( currentRange, axis );
4818 const Range & fullRange = plotter -> getRange (
Axes::X,
false );
4819 axisWidget2 -> processHighSliderMoved ( value, currentRange, fullRange );
4820 plotter -> setCutRangeAt ( currentRange, index );
4833 if ( fit_cut ==
false ) {
4836 const Range & fullRange = plotter -> getRange ( axis,
false );
4837 axisWidget2 -> processLowSliderMoved ( value, currentRange, fullRange );
4838 plotter -> setCutRangeAt ( currentRange, axis );
4842 const Range & fullRange = plotter -> getRange (
Axes::X,
false );
4843 axisWidget2 -> processLowSliderMoved ( value, currentRange, fullRange );
4844 plotter -> setCutRangeAt ( currentRange, index );
4852 if ( cd == 0 )
return;
4862 if ( cd == 0 )
return;
4875 bool fit_cut =
id ==2;
4878 if ( fit_cut ==
false ) {
4883 controller -> setZoomPan ( plotter, axis, yes );
4886 const Range & fullRange = plotter -> getRange ( axis,
false );
4888 axisWidget2 -> processZoomPanCheckBoxClicked ( currentRange, fullRange ) ;
4895 bool fit_cut =
id == 2;
4897 if ( fit_cut ==
false ) {
4900 cp -> toggleInverted ();
4907 xyplotter -> setCutInverted ( index, state );
4919 if ( fit_cut ==
false ) {
4922 cut_plotter -> setEnabled ( ! on );
4928 xyplotter -> setCutEnabled ( index, ! on );
4937 bool fit_cut =
id == 2;
4944 const Color & rep_color = cp -> getCutColor ();
4945 QColor color ( rep_color.getRed(),
4946 rep_color.getGreen(),
4947 rep_color.getBlue () );
4951 if ( color.isValid() == true ) {
4952 Color c( color.red(), color.green(), color.blue() );
4953 cp -> setCutColor ( c );
4964 if ( !plotter )
return;
4972 if ( !contourRep )
return;
4988 if ( !plotter )
return;
4996 if ( !contourRep )
return;
4999 int val = text.
toInt();
5001 if ( val < 1 || val > 100 ) {
5021 if ( !plotter )
return;
5022 if ( plotter -> isTargetable () ==
false )
return;
5024 DataRep * datarep = plotter -> getTarget ( );
5029 if ( !contourRep )
return;
5068 "Invalid Input String.\n"
5069 "Please check that the string contains only numbers,\n"
5070 "separated by commas or white space.\n";
5072 "Invalid Input String",
5086 if ( !plotter )
return;
5094 if ( !contourRep )
return;
5097 if ( qstr1.
isEmpty () )
return;
5101 vector < double > values;
5104 #if QT_VERSION < 0x040000
5105 std::string contourLevels(qstr2.
ascii());
5107 std::string contourLevels(qstr2.toAscii());
5111 std::vector<std::string> tokens;
5113 for (
size_t i = 0;
i < tokens.size();
i++) {
5114 QString strval(tokens.at(
i).c_str() );
5116 double value(strval.toDouble(&ok));
5121 values.push_back(value);
5125 std::stable_sort(values.begin(), values.end());
5126 vector<double>::iterator leftover =
5127 std::unique(values.begin(), values.end());
5128 values.erase(leftover, values.end());
5137 if ( !plotter ) return ;
5143 assert ( xyplotter != 0 );
5150 const QtFont * qtfont = dynamic_cast <
const QtFont * > ( fb );
5151 const QFont & qfont = qtfont -> font ();
5158 font -> setFont( labelFont );
5159 xyplotter -> setLabelFont( font,
m_axis );
5164 xyplotter -> setNeedUpdate(
true);
5165 xyplotter -> notifyObservers ();
5172 if ( plotter == 0 ) return ;
5175 assert( xyplotter != 0 );
5180 const FontBase * fb = xyplotter -> titleFont ();
5187 const QtFont * qtfont = dynamic_cast <
const QtFont * > ( fb );
5188 const QFont & qfont = qtfont -> font ();
5195 font -> setFont( titleFont );
5196 xyplotter -> setTitleFont( font );
5201 xyplotter -> setNeedUpdate(
true);
5202 xyplotter -> notifyObservers ();
5211 if ( !plotter )
return;
5215 if ( ! ( fcontroller -> hasFunction ( plotter, 0 ) ) ) {
5220 Fitter * fitter = frep -> getFitter ();
5224 if ( fitter != 0 ) {
5225 frep -> setIgnoreError ( flag );
5236 bool yes = plotter == 0;
5237 if ( yes ==
false ) {
5250 bool hasZ = plotter -> hasAxis (
Axes::Z );
5253 m_Car -> setEnabled ( hasZ );
5254 m_Mer -> setEnabled ( hasZ );
5255 m_Gls -> setEnabled ( hasZ );
5256 m_Arc -> setEnabled ( hasZ );
5257 m_Tan -> setEnabled ( hasZ );
5258 m_Sin -> setEnabled ( hasZ );
5259 m_Stg -> setEnabled ( hasZ );
5260 m_Air -> setEnabled ( hasZ );
5265 bool xlog = d_controller -> getLog ( plotter,
Axes::X );
5266 bool ylog = d_controller -> getLog ( plotter,
Axes::Y );
5269 if ( ( !xlog ) && ( !ylog ) ){
5274 if (( t -> name () ==
"HammerAito" ) || ( t->
name() ==
"HammerAito2")){
5278 else if (( t -> name() ==
"Lambert" ) || ( t->
name() ==
"Lambert2")) {
5282 else if (( t -> name() ==
"Cartesian" ) || ( t->
name() ==
"Cartesian2")){
5283 m_Car -> setChecked (
true );
5286 else if (( t -> name() ==
"Mercator" ) || ( t->
name() ==
"Mecator2")){
5287 m_Mer -> setChecked (
true );
5290 else if (( t -> name() ==
"GlobalSinusoidal" ) || ( t->
name() ==
"GlobalSinusoidal2")) {
5291 m_Gls -> setChecked (
true );
5294 else if (( t -> name() ==
"ARC" ) || (t->
name()==
"ARC2")){
5295 m_Arc -> setChecked (
true );
5298 else if (( t -> name() ==
"TAN" ) || (t->
name()==
"TAN2")){
5299 m_Tan -> setChecked (
true );
5302 else if (( t -> name() ==
"SIN" ) || (t->
name()==
"SIN2")){
5303 m_Sin -> setChecked (
true );
5306 else if (( t -> name() ==
"STG" ) || (t->
name()==
"STG2")){
5307 m_Stg -> setChecked (
true );
5310 else if (( t -> name() ==
"AIR" ) || (t->
name()==
"AIR2")){
5311 m_Air -> setChecked (
true );
5325 int xoffset = (int) tp->
xOffset();
5326 int yoffset = (int) tp->
yOffset();
5336 else if ( ( !xlog ) && ( ylog ) ){
5337 m_logy -> setChecked (
true );
5340 else if ( ( xlog ) && ( !ylog ) ){
5341 m_logx -> setChecked (
true );
5344 else if ( ( xlog ) && ( ylog ) ){
5345 m_logxy -> setChecked (
true );
5355 "A transform of this type can not be used because\n"
5356 "this application was not compiled with WCSLIB support." );
5359 "Invalid transform",
5388 if ( !plotter )
return;
5402 bool valid2 =
false;
5406 d_controller -> setTransformAxis ( plotter,
"Linear",
"Linear" );
5407 d_controller -> setTransform ( plotter,
"Linear Linear" );
5412 d_controller -> setTransformAxis ( plotter,
"Linear",
"Log" );
5413 d_controller -> setTransform ( plotter,
"Linear Log");
5418 d_controller -> setTransformAxis ( plotter,
"Log",
"Linear" );
5419 d_controller -> setTransform ( plotter,
"Log Linear" );
5424 d_controller -> setTransformAxis ( plotter,
"Log",
"Log" );
5425 d_controller -> setTransform ( plotter,
"Log Log" );
5430 if ( max_x == 180 ) {
5431 d_controller -> setTransformAxis ( plotter,
"Linear",
"Linear" );
5432 d_controller -> setTransform ( plotter,
"HammerAito" );
5435 else if ( max_x == 360 ) {
5436 d_controller -> setTransformAxis ( plotter,
"Linear",
"Linear" );
5437 d_controller -> setTransform ( plotter,
"HammerAito2" );
5442 "The range of current plotter is not valid for.\n"
5443 "HammerAito transform.\n\n"
5444 "A valid range should be within: \n"
5445 "X axis [-180, 180] or [0, 360]\n"
5446 "Y axis [ -90, 90]\n" );
5457 if ( max_x == 180 ) {
5458 d_controller -> setTransformAxis ( plotter,
"Linear",
"Linear" );
5459 d_controller -> setTransform ( plotter,
"Lambert" );
5462 else if ( max_x == 360 ) {
5463 d_controller -> setTransformAxis ( plotter,
"Linear",
"Linear" );
5464 d_controller -> setTransform ( plotter,
"Lambert2" );
5469 "The range of current plotter is not valid for.\n"
5470 "Lambert transform.\n\n"
5471 "A valid range should be within: \n"
5472 "X axis [-180, 180] or [0, 360]\n"
5473 "Y axis [ -90, 90]\n" );
5485 d_controller -> setTransformAxis ( plotter,
"Linear",
"Linear" );
5486 d_controller -> setTransform ( plotter,
"Cartesian" );
5489 else if ( max_x==360 ) {
5490 d_controller -> setTransformAxis ( plotter,
"Linear",
"Linear" );
5491 d_controller -> setTransform ( plotter,
"Cartesian2" );
5496 "The range of current plotter is not valid for.\n"
5497 "Cartesian transform.\n\n"
5498 "A valid range should be within: \n"
5499 "X axis [-180, 180]\n"
5500 "Y axis [ -90, 90]\n" );
5511 if ( max_x == 180 ) {
5512 d_controller -> setTransformAxis ( plotter,
"Linear",
"Linear" );
5513 d_controller -> setTransform ( plotter,
"Mercator" );
5516 else if ( max_x == 360 ) {
5517 d_controller -> setTransformAxis ( plotter,
"Linear",
"Linear" );
5518 d_controller -> setTransform ( plotter,
"Mercator2" );
5523 "The range of current plotter is not valid for.\n"
5524 "Mercator transform.\n\n"
5525 "A valid range should be within: \n"
5526 "X axis [-180, 180] or [0, 360]\n"
5527 "Y axis [ -90, 90]\n" );
5538 if ( max_x == 180 ) {
5539 d_controller -> setTransformAxis ( plotter,
"Linear",
"Linear" );
5540 d_controller -> setTransform ( plotter,
"GlobalSinusoidal" );
5543 else if ( max_x == 360 ) {
5544 d_controller -> setTransformAxis ( plotter,
"Linear",
"Linear" );
5545 d_controller -> setTransform ( plotter,
"GlobalSinusoidal2" );
5550 "The range of current plotter is not valid for.\n"
5551 "GlobalSinusoidal transform.\n\n"
5552 "A valid range should be within: \n"
5553 "X axis [-180, 180] or [0, 360]\n"
5554 "Y axis [ -90, 90]\n" );
5565 if ( max_x == 180 ) {
5566 d_controller -> setTransformAxis ( plotter,
"Linear",
"Linear" );
5567 d_controller -> setTransform ( plotter,
"ARC" );
5570 else if ( max_x == 360 ) {
5571 d_controller -> setTransformAxis ( plotter,
"Linear",
"Linear" );
5572 d_controller -> setTransform ( plotter,
"ARC" );
5577 "The range of current plotter is not valid for.\n"
5578 "ARC transform.\n\n"
5579 "A valid range should be within: \n"
5580 "X axis [-180, 180] or [0, 360]\n"
5581 "Y axis [ -90, 90]\n" );
5593 if ( max_x == 180 && valid2 ) {
5594 d_controller -> setTransformAxis ( plotter,
"Linear",
"Linear" );
5595 d_controller -> setTransform ( plotter,
"TAN" );
5598 else if ( max_x == 360 && valid2 ) {
5599 d_controller -> setTransformAxis ( plotter,
"Linear",
"Linear" );
5600 d_controller -> setTransform ( plotter,
"TAN2" );
5605 "The range of current plotter is not valid for.\n"
5606 "TAN transform.\n\n"
5607 "A valid range should be within: \n"
5608 "X axis [-180, 180] or [0, 360]\n"
5609 "Y axis ( 0, 90]\n" );
5621 if ( max_x==180 && valid2 ) {
5622 d_controller -> setTransformAxis ( plotter,
"Linear",
"Linear" );
5623 d_controller -> setTransform ( plotter,
"SIN" );
5626 if ( max_x==360 && valid2 ) {
5627 d_controller -> setTransformAxis ( plotter,
"Linear",
"Linear" );
5628 d_controller -> setTransform ( plotter,
"SIN2" );
5633 "The range of current plotter is not valid for.\n"
5634 "SIN transform.\n\n"
5635 "A valid range should be within: \n"
5636 "X axis [-180, 180] or [0, 360]\n"
5637 "Y axis ( 0, 90]\n" );
5649 if ( max_x==180 && valid2 ) {
5650 d_controller -> setTransformAxis ( plotter,
"Linear",
"Linear" );
5651 d_controller -> setTransform ( plotter,
"STG" );
5654 if ( max_x==360 && valid2 ) {
5655 d_controller -> setTransformAxis ( plotter,
"Linear",
"Linear" );
5656 d_controller -> setTransform ( plotter,
"STG2" );
5661 "The range of current plotter is not valid for.\n"
5662 "STG transform.\n\n"
5663 "A valid range should be within: \n"
5664 "X axis [-180, 180] or [0, 360]\n"
5665 "Y axis ( -90, 90]\n" );
5677 if ( max_x==180 && valid2 ) {
5678 d_controller -> setTransformAxis ( plotter,
"Linear",
"Linear" );
5679 d_controller -> setTransform ( plotter,
"AIR" );
5682 if ( max_x==360 && valid2 ) {
5683 d_controller -> setTransformAxis ( plotter,
"Linear",
"Linear" );
5684 d_controller -> setTransform ( plotter,
"AIR2" );
5689 "The range of current plotter is not valid for.\n"
5690 "AIR transform.\n\n"
5691 "A valid range should be within: \n"
5692 "X axis [-180, 180] or [0, 360]\n"
5693 "Y axis ( -90, 90]\n" );
5705 catch (
const std::runtime_error & e ) {
5718 const Range & rx = plotter -> getDataRange (
Axes::X );
5719 const Range & ry = plotter -> getDataRange (
Axes::Y );
5721 if ( ( rx.
low() > -181 ) && ( rx.
high() < 181 ) &&
5722 ( ry.
low() > -91 ) && ( ry.
high() < 91 )) {
5726 if ( ( rx.
low() > -1 ) && ( rx.
high() < 361 ) &&
5727 ( ry.
low() > -91 ) && ( ry.
high() < 91 )) {
5741 const Range & rx = plotter -> getRange (
Axes::X,
false );
5742 const Range & ry = plotter -> getRange (
Axes::Y,
false );
5744 if ( ( rx.
low() < -180 ) || ( rx.
high() > 180 ) ||
5745 ( ry.
low() <= miny ) || ( ry.
high() > 90 ) ) {
5762 if (offset>180) offset = offset-360 ;
5763 if (offset< -180) offset = offset+360;
5766 if ( !plotter )
return;
5796 if (offset>180) offset = offset-360 ;
5797 if (offset< -180) offset = offset+360;
5800 if ( !plotter )
return;
5849 if ( !plotter )
return;
5859 if ( !plotter )
return;
5869 if ( !plotter )
return;
5884 if ( minEntries < 0 ) minEntries = 0;
5887 if ( !plotter )
return;
5905 if ( !plotter )
return -1;
5915 if ( !plotter )
return;
5928 if ( !plotter )
return;
5935 if (offset>180) offset = offset-360 ;
5936 if (offset< -180) offset = offset+360;
5965 if ( !plotter )
return;
5972 if (offset>180) offset = offset-360 ;
5973 if (offset< -180) offset = offset+360;
6005 if ( !plotter )
return;
6007 int num_rep = plotter -> getNumDataReps();
6014 "You must have two DataReps in this view.";
6017 "Unable to compare DataRep",
6030 = controller -> createDifferenceDisplay ( plotter );
6031 const Range & range = plotter -> getRange (
Axes::X,
false );
6032 res_plotter -> setRange (
Axes::X, range,
false );
6036 canvas -> addPlotDisplay ( res_plotter,
true );
static Color::Value getColor()
Instead of getting a random color, this static method loop over the 5 common colors: red...
std::string getSelectedDataSourceName() const
Returns the name of the currently selected DataSource in Data tabbed panel.
bool multipleDataRepInfo(const std::string &type)
Raises a multiple DataRep info dialog.
QButtonGroup * axis_button_group
virtual void lowRangeDrag()
FunctionRep * getFunctionRep()
Returns the FunctionRep directly coresponding to the selected item.
virtual void functionsResetButton_clicked()
Reset the function parameters from the parameters saved before the last fit.
hippodraw::AxisWidget * axisWidget1
virtual void cutInvertPushButton_clicked()
void setRepSize(double size)
Sets the size of the representation.
QScrollBar * m_width_range
A Plotter class that plots points in 2 dimensions and option a third dimension in color...
A PointRep class that draws a contour lines.
virtual void updateFitCutsTab()
Update the cut tabbed panel when in fit cut mode.
QRadioButton * m_stats_avg_y
QComboBox * m_availPlotTypes
hippodraw::CanvasWindow class interface.
virtual void dataTupleNameChanged(const QString &)
Respond to change of DataSource name change.
virtual void axisLabelChanged(int index, const QString &axisName)
Responds to change in axis binding on existing plotter.
QGroupBox * m_cut_selected_box
void invalidRangeError(const std::string &bad)
Raises invalid range error dialog.
virtual void updateDataTab()
QPushButton * colorSelect_2
int m_lowslider1_last_val
The value of the low slider in Axis Widget 1 as last recorded.
A singleton class that is the interface between GUI and the displays.
double high() const
Returns the maximum of the range object.
find(QChar c, int index=0, bool cs=TRUE) const
PlotterBase * m_plotter
The currently selected PlotterBase object.
void processZoomPanCheckBoxClicked(const Range ¤tRange, const Range &fullRange)
Called by InspectorBase in response to the zoomPanCheckBoxClicked signal.
virtual void notifyObservers() const
Notifies Observer objects of a change.
QRadioButton * m_cut_fit_radio
int cutRadioId() const
Returns the Id of the cut radio button group.
virtual void resetSlider()
Resets sliders to default position.
void updateColorMapCtrls(const PlotterBase *plotter)
Updates the controls for the color map if applicable, othewise disables them.
std::vector< QLabel * > m_new_labels
Binding labels for new plot group box.
virtual void setHighRange(int value)
QRadioButton * contourRadioButton2
QComboBox * m_value_combo
std::vector< QComboBox * > m_new_combos
Binding combo boxes for new plot group box.
void init()
Initializes the Inspector.
QListViewItem * getTopParent(QListViewItem *item)
Help function to find the top level object in a QListViewItem tree.
setCurrentText(const QString &)
setNum(short n, int base=10)
hippodraw::RootController class interface.
QPushButton * m_selectedColor
virtual void selectedCutsRadioButton_toggled(bool selected)
QLineEdit * m_statsTextField
static CutController * instance()
Returns the pointer to the singleton instance.
QCheckBox * m_FunctionParamsCheckBox
QListView * m_FunctionParamsListView
void updateNewPlotControls()
Updates the controls in the new plot group box.
virtual void updatePlotTypes()
Updates the available plot types combo box.
int activeDataRepIndex(const PlotterBase *plotter) const
Returns the active DataRep index for the DataRep objects contained in the plotter.
void processLowSliderMoved(int value, Range ¤tRange, const Range &fullRange)
Called by InspectorBase in response to the lowSliderMoved signal.
virtual void logScale_clicked()
The Qt slot which responds to the toggle in state of the logScale checkbox.
virtual void createResiduals()
Creates a display showing the residuals of the function.
QComboBox * m_selCutComboBox
virtual void setLowRange(Axes::Type axis, int parm, bool dragging)
Sets the low end of the Range of data displayed.
QComboBox * m_fitter_names
virtual void contourRadioButton1_toggled(bool)
Responds to change in 1st contour radio button.
void setZoomPan(bool check, bool disables=false)
Checks zoomPanCheckBox if check is true, else un-checks it.
bool getUsingUserValues() const
Get the m_usingUserValues boolean.
QString m_model_name
The color model name settings key.
QRadioButton * m_stats_underflow
FunctionRep * getTopFunctionRep()
Returns the FunctionRep corresponding to top of selected function chain (the composite function if an...
virtual void autoScale_clicked()
Slot which responds to the toggle in state of the autoScale check box.
The base class for the value to the color transformation.
void noNTupleSelectedError()
Raises no NTuple selected error dialog.
virtual void sel_combo_1_activated(const QString &)
Responds to combo box of selected plot be activated by changing the binding.
virtual const std::string convertToString(hippodraw::Axes::Type)
QRadioButton * m_stats_fparms
virtual void contourLevelsTextBox_returnPressed()
Responds to change in contour levels text box.
QRadioButton * m_stats_text
size_t ci_find(const string &str1, const string &str2)
Case insensitive find.
QGroupBox * m_new_cut_box
void cutOnCutError()
Raises information dialog to say applying a cut to itself was not done.
entryList(const QString &key) const
virtual void cutHighSlider_sliderMoved(int value)
An implementation of FontBase that uses a Qt QFont as implementation.
double moduloAddX(double x1, double x2) const
Modulo Addition along X axis.
virtual void axisZoomPanCheckBox_clicked()
Responds to change in zoom/pan check box.
void newPlotError(const std::exception &e)
Raises a dialog for new plot error.
virtual void colorSelect_2_clicked()
Sets the Color of the cut plotter.
QPushButton * functionsRemoveButton
virtual void cutLowSlider_sliderMoved(int value)
virtual void setDragOn()
Called when any slider is pressed.
hippodraw::WindowController class interface
QButtonGroup * cut_button_group
TupleCutList_t m_tuple_cuts
The list of TupleCut objects currently selected.
QPushButton * m_PushButtonNewErrorPlot
static FunctionController * instance()
Returns the pointer to the singleton instance.
CompositeFunctionRep class interface.
QString m_app_key
The QSettings application key for searching for setting.
virtual double getOffset(Axes::Type axis) const
Returns the offset on designated axis, similarly to getBinWidth.
virtual void updateTransformTab()
Update the transform tabbed panel's widgets.
double moduloAddY(double y1, double y2) const
Modulo Addition along Y axis.
simplifyWhiteSpace() const
virtual void setLowRange(int value)
hippodraw::PeriodicBinaryTransform class interface
virtual bool getShowGrid()
Gets the show-grid status to update the inspector.
virtual void statsButtonGroupClicked(int)
virtual int activePlotIndex() const
Returns the index of the active plotter.
bool hasFunction(const PlotterBase *plotter, const DataRep *rep)
Returns true if rep contained by plotter has a function attached.
virtual void cutAddSelected()
Adds selected cut to the DataRep.
double yOffset() const
Returns the yOffset of the (periodic) transform.
void incompatibleFunctionError(const std::string &type)
Raises the incompatible function error dialog.
virtual void titleText_returnPressed()
Responds to title text return.
virtual void setRepColor(const Color &)=0
Sets the representation's color.
std::vector< const TupleCut * > TupleCutList_t
The type of container for current TupleCut objects.
TextPlotter class interface.
virtual void cutRemovePushButton_clicked()
Responds to the button that removes a cut.
virtual void axis_button_group_clicked(int id)
Responds to change in axis tabbed panel's axis radio button group.
readDoubleEntry(const QString &key, double def=0, bool *ok=0) const
virtual bool errorDisplay(Axes::Type axis) const =0
Returns the state of error bar display on specified axis.
void setTitle(const std::string &title)
Sets the title to be displayed.
remove(uint index, uint len)
const std::vector< const TupleCut * > & getCutList(const DataRep *rep) const
Returns a list of TupleCut objects that are used by the DataRep.
double xOffset() const
Returns the xOffset of the (periodic) transform.
hippodraw::FunctionController class interface
void incompatibleDataRepError(const std::string &type)
Raises incompatible DataRep error dialog.
Inspector(QWidget *parent=0, const char *name=0, bool modal=false, Qt::WFlags flags=0)
The constructor.
QString m_flat_width
The color model flat width settings key.
virtual void contourSlider_valueChanged(int val)
virtual void cutAddAll()
Adds all the cuts to the DataRep.
toDouble(bool *ok=0) const
A singleton class is the interface between an application and the list of FunctionRep objects contain...
column
The column indices for 2 dimension data point tuple.
virtual void colorSelect_clicked()
virtual void errorBars_toggled(bool)
Responds to error bars check box.
insertSearchPath(System s, const QString &path)
const std::string & name() const
Returns the name of the parameter.
QPushButton * m_cutAddAll
virtual void pointRepComboBox_activated(const QString &qstr)
readEntry(const QString &key, const QString &def=QString::null, bool *ok=0) const
insertItem(const QString &t, int index=-1)
std::map< const PlotterBase *, bool > m_zoompan
FunctionParameter class interface.
virtual void setYRotateText()
int getNumContours() const
Returns the number of contours.
QVBoxLayout * m_newVLayout
A derived class of DataRep which is a base class for displaying a function.
void dataClearSelectedControls()
Clears the previous binding controls.
virtual void removeDataRepButton_clicked()
Responds to click on the remove Data Rep button.
virtual void highRangeDrag()
QLineEdit * m_dataRepNameText
QComboBox * m_pointRepComboBox
virtual void setHighRange(Axes::Type axis, int parm, bool dragging)
Sets the high end of the Range of data displayed.
A class to collect function parameters from a FunctionBase object but also the constraints and errors...
int validPeriodicTransformRange()
Return true if the range is valid for HammerAito or Lambert transform.
QPushButton * functionsResetButton
void statsStripValue(QRadioButton *box)
Strips the value part of the text field.
The class expresses a cut on a DataSource, i.e.
std::vector< QListViewItem * > m_func_parm_checked
The list of functions parameters that are checked for use by the error contour display.
void setXOffset(double x_offset)
Sets the xOffset of the (periodic) transform.
A derived class of QCustomEvent with which the CanvasView notifiies clients of changes in selections ...
QPushButton * cutInvertPushButton
QCheckBox * m_interval_cb
void setNumContours(int i)
Set number of contours.
QLineEdit * m_contourLevelsTextBox
void updateReverseBox()
Update the status of the reverse check box.
void updateCutControlValues(const Range ¤tRange, const Range &fullRange)
Set the textboxes and sliders to the values given by the arguments.
static void stringTokenize(std::string input, const std::string &delimiters, std::vector< std::string > &tokens, bool clear=true)
void addTextDisplay(PlotterBase *plotter, const std::string &type)
Adds a textual display to the canvas of type type.
number(long n, int base=10)
postEvent(QObject *receiver, QEvent *event)
virtual void functionsFitToDataButton_clicked()
Fits the selected function to the data.
virtual void dataCreateNTuple()
std::vector< QComboBox * > m_sel_combos
Binding combo boxes for selected plot group box.
void updateCutEnableButton()
Updates the cut enabled push button control.
QPushButton * m_cutAddSelected
virtual void availPlotTypesActivated(const QString &)
void setAppKey()
Ensures that the application's key value has been set.
virtual double getBinWidth(Axes::Type axis) const
Returns the bin width.
void editTitleFontClicked()
Edit the title font, ( if user wants to overwrite he default )
The namespace for conversion to string.
hippodraw::AxisWidget class interface
void invalidOperationError(const std::string &message)
Raises operatonal error messge ox with messge.
static QString s_registry
The QSettings Windows registry key.
virtual void cutEnablePushButton_toggled(bool on)
Responds to the cut enable push button.
virtual void sel_combo_2_activated(const QString &)
Responds to combo box of selected plot be activated by changing the binding.
virtual void ntupleChanged(int)
Responds to combo box that shows the NTuple name of the selected plot.
const std::string & getTitle() const
Gets the title to be displayed.
QRadioButton * contourRadioButton1
bool m_is_updating
Set to true if updating is being processed.
void fitFailedError()
Raises failed fit error dialog.
virtual void cutZoomPanCheckBox_clicked()
QButtonGroup * m_symbol_group
A abstract base class for font handling.
virtual PlotterBase * getPlotter()
virtual void updateDataCutsTab()
Updates the cut tabbed panel when in data cut mode.
A Color class for creating the color object following the standard RGB color space.
QLineEdit * m_y_offset_text
QLabel * m_numContoursLabel
virtual void fitterNamesActivated(int)
The base class for fitters.
hippodraw::NTuple class interface.
void addFuncDisplay(PlotterBase *plotter, const std::string &name)
Adds function textual display to the canvas.
The base class for the PlotterBase hierarchy.
hippodraw::Inspector class interface.
virtual void m_grid_clicked()
Responds to the toggle in state of the show grid check box.
QPushButton * m_plot_color
virtual void update()
The Update Method.
A Periodic transform that transforms coordinates from one 2D coordinate system to another...
hippodraw::Axes::Type m_axis
double error() const
Returns the error on the value of the parameter.
QPushButton * cutRemovePushButton
toInt(bool *ok=0, int base=10) const
virtual void updateCutsTab()
Updates the cut tabbed panel's widgets' state and values.
virtual void updateSummaryTab()
Updates the Stats tabbed panel's widgets.
void updateCutControlValues(const PlotterBase *cutplotter)
Updates the Cut control values with those of the designated cut Plotter.
void warningTex()
Raises warning if TeX not supported.
void setContourValues(std::vector< double > &values, ProjectorBase *proj)
Set user defined contour values.
PyArray_TYPES type(numeric::array arr)
bool m_cut_enable_updating
Set to true when hippodraw::Inspector::cutEnablePushButton is being updated.
The base class for data representations.
CanvasSelectionEvent class interface.
virtual void setXRotateText()
void disableCutControls(bool yes)
Disables all the control widgets for a cut.
virtual const std::vector< std::string > & getLabels() const
Returns the list of available labels.
setCurrentItem(int index)
QPushButton * cutEnablePushButton
virtual void m_boxedge_clicked()
QLineEdit * min_entries_text
void updateCutVarGroupBox(const PlotterBase *plotter, int index)
Updates the QGroupBox that displays to controller for creating a new cut.
std::vector< PlotterBase * > m_plotter_list
The currently selected plotters.
virtual void setActivePlot(int index, bool redraw)
Sets the active plot.
static WindowController * instance()
Returns the application instance.
void enableNewPlotBox(bool yes=true)
Enables the new plot box.
virtual void axisLabelText()
Responds to return in axis label text box.
bool isZoomPanChecked()
Returns whether zoomPanCheckBox is checked.
void clear(std::vector< QLabel * > &labels, std::vector< QComboBox * > &combos)
Clears the labels and combo boxes.
A PlotterBase derived class that serves a base class for cut plotters.
void processHighSliderReleased(const Range &fullRange)
Called by InspectorBase in response to the highSliderReleased signal.
virtual CutPlotter * getSelectedCut()
hippodraw::ContourPointRep class interface
void processTextBoxReturnPressed(Range ¤tRange, const Range &fullRange)
Called by InspectorBase in response to the lowTextReturnPressed and highTextReturnPressed signals...
virtual void cut_button_group_clicked()
Responds to change of the cut panel's radio group.
QLineEdit * m_interval_le
A Derived class of FunctionRep which hold a composite function.
DataRepController class interface.
virtual void sel_combo_3_activated(const QString &)
Responds to combo box of selected plot be activated by changing the binding.
int m_last_cut_index
The index of the last selected cut.
QSlider * m_numContourSlider
QPushButton * newPlotButton
unsigned int getIntervalCount() const
Returns the current interval count.
hippodraw::BinToColor class interface
virtual int getMinEntries()
Get the minimum entries number of the plot.
void updateSelectedPlotDataSource(const std::string &name)
Updates the selected plot data source combo box.
int getHighSliderValue()
Get the high slider value.
virtual void sliderChanged(int)
Responds to change in the sliders of one of the value to color sliders.
intp size(numeric::array arr)
virtual void functionAdd()
void fillCheckedFunctionRepItems()
Clears and fills m_func_parm_checked vector with the function parameters that have their check box on...
virtual void deleteColorModel()
Deletes an existing Value to Color Model.
void updateTupleCuts(const std::vector< PlotterBase * > &cutlist)
Updates the list of TupleCut objects and their corresponding Plotter.
virtual void addDataRepButton_clicked()
Responds to click on the add Data Rep button.
virtual void combineCheckBox_clicked()
Responds to the combined bins checkbox clicked.
QPushButton * newFunctionsAddButton
virtual void allNtupleComboActivated(const QString &)
std::map< QListViewItem *, FunctionRep * > m_function_lv_map
Map between a function's QListViewItem and its FunctionRep pointer.
A derived class of QCustomEvent to handle updates from PlotterBase.
A singleton class that is the interface between GUI and the DataRep.
virtual void functionParamsListViewCurrentChanged()
Slot which recieves the signal if Current item changes in the List View of the function Params...
QRadioButton * m_cut_data2
getText(const QString &caption, const QString &label, QLineEdit::EchoMode mode=QLineEdit::Normal, const QString &text=QString::null, bool *ok=0, QWidget *parent=0, const char *name=0)
virtual void functionParamsLineEditReturnPressed()
Slot which recieves the signal if enter is pressed in the line edit in the the function Params tab...
virtual void functionParamsCheckBoxToggled(bool)
Slot which recieves the signal if state of the checkbox changes in the the function Params tab...
writeEntry(const QString &key, bool value)
void invalidDataWarning()
Raises a dialog to warn user that bound DataSource has invalid data.
QGroupBox * m_slider_control
FunctionBase * addFunction(PlotterBase *plotter, const std::string &name)
Adds a function to the first DataRep object of the plotter.
virtual void intervalStateChanged(bool state)
virtual bool getBoxEdge()
Get the box-edge status to update the inspector.
double length() const
Returns the length of the range object.
virtual void functionsRemoveButton_clicked()
Removing the selected function and updating appropriate tabbed panels.
virtual void editColorModel()
Brings up dialog to edit an existing Value to Color model.
virtual void sel_combo_0_activated(const QString &)
Responds to combo box of selected plot be activated by changing the binding.
QScrollBar * min_entries_slider
QRadioButton * m_stats_number
void setIntervalEnabled(const PlotterBase *plotter, bool yes)
Sets the interval counting to yes on the NTuple of the active DataRep of the plotter.
virtual void setParameters(int, PlotterBase *)
std::vector< QRadioButton * > m_transform_buttons
The list of transform radio buttons.
QRadioButton * m_stats_avg_x
getColor(const QColor &initial=white, QWidget *parent=0, const char *name=0)
std::vector< double > m_oldParameters
QGroupBox * m_plot_symbols
int findCutIndex(const QString &label)
Returns the index of the cut selections with label label.
A singleton class that is the interface between GUI and the DataSource objects.
void contourError()
Raises message box on contour input error.
void saveParameters(PlotterBase *plotter)
Saves the parameters so they can be restored.
virtual void lineStyleButtonGroup_clicked(int id)
static DisplayController * instance()
Returns the pointer to the singleton instance.
virtual void newColorModel()
Brings up dialog to create a new Value to Color model.
void setRange(double low, double high, double pos)
Changes the current Range.
QScrollBar * m_offset_range
QButtonGroup * m_contourBox
double value() const
Returns the value of the parameter.
QRadioButton * m_stats_chi
virtual bool acceptFunction(int number)
Returns true if the DataRep accepts functions on number variables.
QCheckBox * m_combine_checkbox
virtual void dataNTupleSelChanged(int item)
QSlider * m_FunctionParamsSlider
void updateCutControls(const std::vector< PlotterBase * > &cutlist)
Updates the Cut controls in the Cut tabbed panel.
QGroupBox * rotateGroupBox
QString m_break_point
The color model break point settings key.
void changeNTupleName(const QString &)
Changes the name NTuple.
virtual void cutHighSlider_sliderReleased()
virtual void contourTextBox_returnPressed()
virtual void setShowGrid(bool flag)
Sets the show-grid status to flag.
virtual DataRep * getDataRep(int index) const
Returns the specified DataRep or null pointer if it doesn't exits.
virtual void symbolPointSize_returnPressed()
virtual void setRotate(int x, int y)
Reset the rotation slider and text, from the plotter.
bool hasNTupleBindings(const PlotterBase *plotter, int index)
Returns true if the DataRep contained by the plotter at index index has NTuple bindings.
QComboBox * m_sel_ntuple_name
A DataSource class implemented with std::vector<double> to store the column data. ...
hippodraw::PlotterEvent class interface
int m_highslider1_last_val
The value of the high slider in Axis Widget 1 as last recorded.
QCheckBox * m_IgnoreErrorCheckBox
int transformId() const
Returns the Id of the transform radio button that is selected.
virtual void valueChanged(int)
Responds to change of the value to color combo box.
const std::vector< PlotterBase * > & getDataCutList(PlotterBase *plotter)
Returns the list of data cut plotter objects that target plotter.
The base class for the Projector hierarchy.
virtual void setBinWidth(int value)
void setNewPlotNTuple(const std::string &name)
Sets the current item in the available NTuple selection box to one that matches name.
QLineEdit * m_offset_text
QButtonGroup * transform_button_group
static DataRepController * instance()
Returns the pointer to the singleton instance.
virtual const Color & repColor() const =0
Returns the color used for the representation.
const std::string & name() const
Returns the name of the Transform.
virtual void diffDataRep()
Create display with differenece between two DataRep objects in Plotter.
QWidgetStack * m_point_stack
virtual void setWidthText()
Responds to return in bin width text field.
void incompatibleFitterError(const std::string &type)
Raises incompatible Fitter error dialog.
virtual void updateFunctionsTab()
Updates the functions tabbed panel's widgets.
A Plotter class that draws text.
void functionAddError()
Raises a function add error QMessageBox when the selected DataRep does not support the selected funct...
void setYOffset(double y_offset)
Sets the yOffset of the (periodic) transform.
hippodraw::TupleCut class interface
virtual void setOffsetText()
Responds to return in bin offset text field.
virtual void updateAxisTab()
Updates the axis tabbed panel's widgets.
hippodraw::CutController class interface
unsigned int getRepStyle(const PlotterBase *plotter) const
Returns the style of the point representation.
void fillFunctionParameters(QListViewItem *parent, const FunctionRep *function, unsigned int &index)
Fills the QListView with items for each function parameter or function as a child of parent...
void updateAutoScaleBox()
Updates the active and inactive cuts.
void addPlotDisplay(PlotterBase *plotter, bool select)
Adds a new plot display to the canvas.
QLineEdit * m_x_offset_text
CanvasWindow * currentCanvas()
Returns a pointer to the current CanvasWindow.
virtual void setRange(Axes::Type axis, const Range &range, bool scaled=false, bool adjust_width=true)
Sets the range on the specified axis.
toFloat(bool *ok=0) const
QButtonGroup * m_line_group
A transform that transforms coordinates from one 2D coordinate system to another. ...
void updateLogBox()
Update the status of the log scale check box.
DataSource * getDataSource(const PlotterBase *plotter)
Returns the Datasource for the plotter's selected DataRep or the DataSource used by all the DataRep o...
virtual void setZRadioButton(bool enabled)
Sets the Z axis radio button to proper state.
const std::vector< const TupleCut * > & getCutList(const PlotterBase *plotter) const
Clears and fills the @a cut_list with PlotterBase objects that are cuts whose target is the act...
int m_last_ntuple_edited
The m_all_ntuples item that was lasted edited.
QRadioButton * allCutsRadioButton
virtual TransformBase * getTransform() const
Returns the transform object used by the plotter.
void multiplePlotError()
Raises a multiple plot error message box.
critical(QWidget *parent, const QString &caption, const QString &text, int button0, int button1, int button2=0)
void setLowSliderValue(int value)
Set the low slider value.
virtual void setHighText()
double low() const
Returns the minimum of the range object.
QRadioButton * m_selectedPlotRadioButton
static RootController * instance()
Returns the singleton instance of the RootController.
virtual void pushButtonNewErrorPlotClicked()
The slot that recieves the signal when the PushButtonNewErrorPlot is clicked.
virtual bool hasZeroRows()
Returns true if this DataRep has zero rows in its DataSource.
virtual void selCutChanged()
std::string getArrayTupleLabel(const DataSource *rtuple, const std::string &column)
In case we are dealing with multidimensional data in rows of this column in the given DataSource we w...
hippodraw::Axes::Type getAxes(unsigned int index)
Populates the three vectors(usr_models,brk_points,flat_widths) with details about the user defined Co...
virtual void functionParamsSliderSliderPressed()
Slot which recieves signal when params slider is presssed.
const std::string & name() const
Returns the name of the representation.
int m_min_entries
The min_entries when draging starts.
std::map< PlotterBase *, int > m_cut_map
A map of the last cut item selected for each plotter.
warning(QWidget *parent, const QString &caption, const QString &text, int button0, int button1, int button2=0)
void editLabelFontClicked()
Edit label font, ( if user wants to overwrite he default )
virtual void setLowText()
Expresses a range of values.
std::vector< QLabel * > m_sel_labels
Binding labels for selected plot group box.
QComboBox * m_CutVariableComboBox2
virtual void setBoxEdge(bool flag)
Set the box-edge status to flag.
virtual const Range & getRange(Axes::Type axis, bool scaled) const
Returns the range on the specified axis.
virtual void cutText_returnPressed()
Responds to entry in one of the cut text fields.
virtual void rotateY(int offset)
PlotterList_t m_tuple_cut_plotters
The PlotterBase object associated with each TupleCut object.
virtual void newPlotButton_clicked()
void processHighSliderMoved(int value, Range ¤tRange, const Range &fullRange)
Called by InspectorBase in response to the highSliderMoved signal.
QString m_color_scale
The color model color scale settings key.
QComboBox * m_CutVariableComboBox1
void setUsingUserValues(bool flag)
Set the m_usingUserValues boolean.
void setSelectedFitter(const std::string &name)
Sets the selected Fitter.
QRadioButton * m_cut_data1
virtual void customEvent(QCustomEvent *event)
The method to receive update events from the application queue.
bool m_user_models_loaded
Set to true after the user defined value to color transforms have been loaded.
Type convert(const std::string &axis)
Converts from string representation ot Axes::Type representation.
virtual void setCutRangeAt(const Range &range, unsigned int i)
Sets the Range of a TupleCut object.
void processLowSliderReleased(const Range &fullRange)
Called by InspectorBase in response to the lowSliderReleased signal.
The base class for the Inspector class.
virtual void reverse_clicked()
Slot which respons to the toggle in state of the reverse check box.
A singleton class that handles the application logic for cuts.
DataSourceController class interface.
virtual void tabChanged()
Receives the signal that the tabbed panel changed and invokes the update method.
void setHighSliderValue(int value)
Set the high slider value.
virtual int getMinEntries()
Get the minimum entries/bin.
virtual void summaryNew()
void updateValueCombo()
Updates the value to color transform combo box.
virtual void offsetDrag()
A Controller class for ROOT files.
bool m_rotate_enable
When changing current plot, set to false so that Inspector don't update the rotation repeatedly...
virtual void functionParamsSliderSliderReleased()
Slot which set the slider to mid point after it has been release.
void badFunctionError(const std::string &name, const char *what)
Raise bad function error dialog.
QRadioButton * m_stats_overflow
QWidget * m_newLayoutWidget
void multipleDataRepError(const std::string &type)
Raises a multiple DataRep error QMessageBox.
QComboBox * newFunctionsComboBox
void updateSelectedPlotType(const PlotterBase *plotter)
Updates the selected plot DataRep type.
QGroupBox * m_new_plot_box
virtual void setMinEntries(int increment)
Responds to minimum entries slider.
QPushButton * functionsFitToDataButton
virtual void updatePlotTab()
Updates the Plot tabbed panel's widgets.
bool isPeriodic() const
Sets whether this transform is periodic.
void setAllCutsActive(bool yes)
Sets all CutPlotter objects to active state if yes is true, otherwise sets them inactive.
int getLowSliderValue()
Get the low slider value.
A concrete window class that contains the canvas and responds to menu item and tool bar events from t...
virtual void allCutsRadioButton_toggled(bool selected)
virtual void setAutoRanging(const std::string &axis, bool flag)
Sets the auto-ranging.
virtual void setMinEntriesText()
Responds to the user input of minimum entries number.
virtual ProjectorBase * getProjector() const
Returns the Projector object controlling the data.
std::vector< int > m_functionIndexMap
void convertCtrlPts(std::vector< double > &sv)
Converts the value to color control points from int slider values to float values.
virtual void ignoreErrorCheckBoxToggled(bool)
Slot which responds to the ignoreError check box.
void fillPlotterList(std::vector< PlotterBase * > &plot_list)
Clears and Fills plot_list with the PlotterBase objects on the current canvas.
DisplayController class interface declaration.
void setAllDisabled(bool flag)
Enable all controls if flag = false, disable if true.
bool isFixed() const
Returns the fixed flag.
virtual void entriesDrag()
hippodraw::NTupleProjector class interface
list< QAction * >::iterator it
QComboBox * m_all_ntuples
virtual void transform_button_group_clicked()
Responds to change in transform tabbed panel's radio button group.
A derived class of InspectorBase class which is generated by the Qt designer.
void invalidPeriodicTransform()
Displays a warning message that application was not compiled with WCSLIB support. ...
QLineEdit * m_numContoursTextBox
virtual void setOffset(int value)
virtual void setMinEntries(int entries)
Set the minimum entries/bin.
virtual void symbolTypeButtonGroup_clicked(int id)
virtual void resetRotate()
Reset to zero.
virtual void rotateX(int offset)
Rotation for periodic transform.
virtual void functionParamsSliderSliderMoved(int)
Slot which alters the parameter values as the function Params slider is moved.
virtual void intervalTextChanged(const QString &)
The base class for the point representation hierarchy.
void set(Color::Value value)
Sets the Color of the PointRepBase object.
RepBase * getRepresentation() const
Returns the representation used to draw the data points.
double pos() const
Returns the first positive element in range.
void updateSelectedPlotData(const PlotterBase *plotter)
Updates the controls in the selected plot QGroupBox of the data inspector.
QLineEdit * m_symbolPointSize
QLineEdit * m_FunctionParamsLineEdit
removeEntry(const QString &key)
hippodraw::AxisWidget * axisWidget2
getFont(bool *ok, const QFont &initial, QWidget *parent=0, const char *name=0)
virtual void cutLowSlider_sliderReleased()
toUInt(bool *ok=0, int base=10) const
static DataSourceController * instance()
Returns the pointer to the singleton instance.
Base class for DataSource.
void setIntervalCount(const PlotterBase *plotter, unsigned int count)
Sets the interval count on the the NTuple of the active DataRep of the plotter.
virtual ~Inspector()
The virtual destructor.
hippodraw::CutPlotter class interface