24 #include "qcombobox.h"
25 #include "qlineedit.h"
26 #include "qmessagebox.h"
43 using namespace hippodraw;
59 const vector < string > & nt_vector
61 if ( nt_vector.empty () ) {
67 if ( count == nt_vector.size () )
return;
70 vector < string > ::const_iterator first = nt_vector.begin();
71 while ( first != nt_vector.end() ) {
72 const string & name = *first++;
91 const std::string & s = current_ds -> getLabelAt (
i );
92 const QString label = s.c_str();
95 item->setText( 1,
QString (
"%1").arg(label));
107 std::vector < PlotterBase * >::const_iterator
it = cutlist.begin();
111 for ( ; it != cutlist.end(); ++
it )
117 Range cutrange = cp -> getCutRange();
119 const std::string & label = cp -> getLabel(
Axes::X);
120 double min = cutrange.
low();
121 double max = cutrange.
high();
122 const std::string & inversion = (cp -> getCutInversion())?
"Inverted":
"";
126 item->setText( 1,
QString(
"%1").arg ( label.c_str() ) );
127 item->setText( 2,
QString(
"%1").arg(min));
128 item->setText( 3,
QString(
"%1").arg(max));
129 item->setText( 5,
QString(
"%1").arg( inversion.c_str() ) );
134 item->setText( 4,
QString(
"2D-X"));
138 Range cutrange = cp2 -> getCutRangeY();
140 const std::string & label = cp2-> getLabel(
Axes::Y);
141 double min = cutrange.
low();
142 double max = cutrange.
high();
146 item->setText( 1,
QString(
"%1").arg ( label.c_str() ) );
147 item->setText( 2,
QString(
"%1").arg(min));
148 item->setText( 3,
QString(
"%1").arg(max));
149 item->setText( 4,
QString(
"2D-Y"));
150 item->setText( 5,
QString(
"%1").arg(inversion.c_str()));
155 item->setText( 4,
QString (
"1D"));
185 controller -> setCurrentIndex ( item );
202 canvaz -> fillPlotterList ( plotterlist );
206 const std::vector < PlotterBase * > &
210 vector < PlotterBase * > plotterlist;
217 return cutcontroller->
getCutList ( plotterlist, current_ds );
227 DataSource * ds = ds_controller -> getCurrent();
231 if ( name.size()==0 ) name =
"<no name>";
242 ntc-> registerNTuple ( name, nt );
256 if (filename.empty()==
true)
return;
260 string::size_type pos = filename.find_last_of (
'.' );
261 const string suffix = filename.substr (pos);
264 DataSource * ds = ds_controller -> getCurrent();
268 if ( name.size()==0 ) name =
"<no name>";
273 if ( suffix ==
".fits" || suffix ==
".gz" )
281 QString message (
"Sorry, can not create FITS file.\n"
282 "The application was not built with\n"
283 "optional FITS support." );
308 #if QT_VERSION < 0x040000
319 item2 -> setOn ( yes );
320 item = item->nextSibling();
328 #if QT_VERSION < 0x040000
338 item2 -> setOn ( yes );
339 item = item->nextSibling();
350 #if QT_VERSION < 0x040000
363 std::string name( (item->text(1)).latin1() );
367 item = item->nextSibling();
378 #if QT_VERSION < 0x040000
383 vector < const TupleCut * >::iterator first =
m_cut_list.begin ();
387 if ( item2 -> isOn () == false ) {
393 item = item -> nextSibling ();
hippodraw::QtFileDialog class interface
std::vector< std::string > m_column_list
QListView * m_ColumnListView
hippodraw::CanvasWindow class interface.
static FitsController * instance()
Returns the singleton instance of the FitsController.
void setCutList()
Filter according to the selected cut.
double high() const
Returns the maximum of the range object.
A Plotter class that plots one-dimensional TupleCut values.
CreateNTuple(QWidget *parent=0, const char *name=0)
The constructor.
void getPlotterList(std::vector< PlotterBase * > &)
Get all the plotter used by the canvas window.
static CutController * instance()
Returns the pointer to the singleton instance.
std::vector< const TupleCut * > m_cut_list
The list of TupleCut objects.
int createNTupleToFile(const std::vector< std::string > &column_list, const std::vector< const TupleCut * > &cut_list, DataSource *ds, const std::string &filename, const std::string &dsname)
Create NTuple with column list and cut list and save to a file.
arg(long a, int fieldWidth=0, int base=10) const
virtual void cutListCheckBox_toggled(bool yes)
Select or deselect all in cut list.
hippodraw::WindowController class interface
void updateCutList()
Update cut list view.
const std::vector< const TupleCut * > & getCutList(const DataRep *rep) const
Returns a list of TupleCut objects that are used by the DataRep.
virtual void columnListCheckBox_toggled(bool yes)
Select or deselect all in column list.
hippodraw::Cut2DPlotter class interface
insertItem(const QString &t, int index=-1)
void initListViews()
Initiate the list views, set column names.
virtual unsigned int rows() const
Returns the number of rows.
addColumn(const QString &label, int width=-1)
DataSource * createNTuple(const std::string &filename)
Creates and registers an NTuple from data in file filename.
void updateNTupleIn()
Update the ComboBox.
hippodraw::NTuple class interface.
virtual void currentDataSourceChanged(int item)
Current Item in the ComboBox changed.
The base class for the PlotterBase hierarchy.
hippodraw::Inspector class interface.
hippodraw::CreateNTuple class interface
virtual void createButtonClicked()
Create a new NTuple.
static WindowController * instance()
Returns the application instance.
A PlotterBase derived class that serves a base class for cut plotters.
hippodraw::FitsController class interface.
A singleton class that is the interface between GUI and the NTuple objects.
hippodaraw::QtSortedCheckListItem class interface.
A singleton class that is the interface between GUI and the DataSource objects.
virtual void createFileButtonClicked()
Create a new NTuple and save to a file.
static NTupleController * instance()
Returns the pointer to the singleton instance.
A DataSource class implemented with std::vector<double> to store the column data. ...
hippodraw::TupleCut class interface
hippodraw::CutController class interface
A Controller class for FITS files.
QListView * m_CutListView
void updateColumnList()
Update column list view.
unsigned int columns() const
Returns the number of columns or data arrays available from this DataSource.
critical(QWidget *parent, const QString &caption, const QString &text, int button0, int button1, int button2=0)
static std::string getExportTupleFilename(QWidget *widget)
Returns a filename for exporting a DataSource.
double low() const
Returns the minimum of the range object.
Expresses a range of values.
This class inherits the QCheckListItem and overrides the compare() function, so that the list can be ...
hippodraw::NTupleController class interface
A singleton class that handles the application logic for cuts.
DataSourceController class interface.
void setColumnList()
Filter according to the selected column.
const std::vector< PlotterBase * > & getDataCutList()
Get all the data cut used by the DataSource.
A concrete window class that contains the canvas and responds to menu item and tool bar events from t...
list< QAction * >::iterator it
static DataSourceController * instance()
Returns the pointer to the singleton instance.
Base class for DataSource.
unsigned int columnNumber