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