24 #include "qcombobox.h" 25 #include "qlineedit.h" 26 #include "qmessagebox.h" 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 314 for (
unsigned int i = 0; i<
cutNumber; i++ )
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 ();
virtual unsigned int rows() const
Returns the number of rows.
const std::vector< PlotterBase *> & getDataCutList()
Get all the data cut used by the DataSource.
static DataSourceController * instance()
Returns the pointer to the singleton instance.
virtual void createButtonClicked()
Create a new NTuple.
QListView * m_CutListView
hippodraw::CreateNTuple class interface
virtual void columnListCheckBox_toggled(bool yes)
Select or deselect all in column list.
hippodraw::QtFileDialog class interface
DataSource * createNTuple(const std::string &filename)
Creates and registers an NTuple from data in file filename.
arg(long a, int fieldWidth=0, int base=10) const
static std::string getExportTupleFilename(QWidget *widget)
Returns a filename for exporting a DataSource.
virtual void currentDataSourceChanged(int item)
Current Item in the ComboBox changed.
hippodraw::CanvasWindow class interface.
unsigned int columnNumber
void updateColumnList()
Update column list view.
void setColumnList()
Filter according to the selected column.
A concrete window class that contains the canvas and responds to menu item and tool bar events from t...
std::vector< const TupleCut *> m_cut_list
The list of TupleCut objects.
A Plotter class that plots one-dimensional TupleCut values.
insertItem(const QString &t, int index=-1)
double high() const
Returns the maximum of the range object.
addColumn(const QString &label, int width=-1)
unsigned int columns() const
Returns the number of columns or data arrays available from this DataSource.
static WindowController * instance()
Returns the application instance.
const std::vector< const TupleCut *> & getCutList(const DataRep *rep) const
Returns a list of TupleCut objects that are used by the DataRep.
hippodraw::NTupleController class interface
DataSourceController class interface.
void setCutList()
Filter according to the selected cut.
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.
hippodraw::NTuple class interface.
Base class for DataSource.
void initListViews()
Initiate the list views, set column names.
hippodraw::TupleCut class interface
virtual void cutListCheckBox_toggled(bool yes)
Select or deselect all in cut list.
void updateNTupleIn()
Update the ComboBox.
double low() const
Returns the minimum of the range object.
The base class for the PlotterBase hierarchy.
A DataSource class implemented with std::vector<double> to store the column data. ...
std::vector< std::string > m_column_list
QListView * m_ColumnListView
void getPlotterList(std::vector< PlotterBase * > &)
Get all the plotter used by the canvas window.
hippodraw::WindowController class interface
static FitsController * instance()
Returns the singleton instance of the FitsController.
Expresses a range of values.
A Controller class for FITS files.
This class inherits the QCheckListItem and overrides the compare() function, so that the list can be ...
CreateNTuple(QWidget *parent=0, const char *name=0)
The constructor.
hippodraw::Inspector class interface.
A PlotterBase derived class that serves a base class for cut plotters.
hippodaraw::QtSortedCheckListItem class interface.
static NTupleController * instance()
Returns the pointer to the singleton instance.
critical(QWidget *parent, const QString &caption, const QString &text, int button0, int button1, int button2=0)
A singleton class that handles the application logic for cuts.
static CutController * instance()
Returns the pointer to the singleton instance.
hippodraw::CutController class interface
hippodraw::FitsController class interface.
hippodraw::Cut2DPlotter class interface
A singleton class that is the interface between GUI and the DataSource objects.
void updateCutList()
Update cut list view.
virtual void createFileButtonClicked()
Create a new NTuple and save to a file.
A singleton class that is the interface between GUI and the NTuple objects.