22 #if QT_VERSION < 0x040000 24 #include <qlistview.h> 27 #include <q3listview.h> 30 #include <qlineedit.h> 31 #include <qpushbutton.h> 33 #include <qcheckbox.h> 45 NTuple * ntuple = plotter -> createPickTuple ();
48 const string & name = ntuple -> getName ();
52 const string &
type = rep -> name ();
54 string text =
"Plot type : ";
58 const vector < string > & labels = ntuple -> getLabels ();
61 unsigned int size = ntuple -> columns ();
71 const QString & str ( labels[4].c_str() );
79 #if QT_VERSION < 0x040000 84 connect ( header, SIGNAL ( clicked (
int) ),
101 #if QT_VERSION < 0x040000 106 QString text = item -> text ( 0 );
107 unsigned int selected = text.
toUInt ();
122 unsigned int row =
m_sorter -> rows ();
139 while ( row-- != 0 ) {
141 unsigned int current = static_cast <
unsigned int > ( vec[0] );
142 #if QT_VERSION < 0x040000 145 Q3ListViewItem * item =
new Q3ListViewItem (
m_pick_table );
147 unsigned int size = vec.size();
149 for (
unsigned int i = 0; i <
size; i++ ) {
150 item -> setText ( i,
QString (
"%1" ).arg ( vec[i] ) );
155 if ( select == current ) {
164 #if QT_VERSION < 0x040000 167 indexOf ( Q3ListViewItem * target )
170 unsigned int index = 0;
171 #if QT_VERSION < 0x040000 176 while ( item != target ) {
178 item = item->nextSibling();
179 if ( item == 0 )
break;
187 #if QT_VERSION < 0x040000 193 unsigned int index =
indexOf ( item );
197 unsigned int row = index == 0 ? 0 : index - 1;
206 const string plotTypeStr (
"Scatter Plot" );
208 const vector < string > & labels = ntuple -> getLabels ();
209 vector < string > bindings;
210 bindings.push_back ( labels[1] );
211 bindings.push_back ( labels[2] );
212 if ( labels.size() == 4 ) {
213 if ( labels[3] ==
"Density" ) {
214 bindings[1] =
"Density";
225 rep -> setRepColor ( red );
227 rep -> setRepSize ( 6.0 );
234 #if QT_VERSION < 0x040000 237 Q3ListViewItem * item =
m_pick_table -> selectedItem ();
239 bool yes = item != 0;
256 vector <double> new_entry;
259 new_entry.push_back(3.0);
260 new_entry.push_back(x);
261 new_entry.push_back(y);
265 new_entry.push_back(z);
269 new_entry.push_back(w);
static DisplayController * instance()
Returns the pointer to the singleton instance.
unsigned int indexOf(QListViewItem *target)
Finds the index of the target QListViewItem.
static DataSourceController * instance()
Returns the pointer to the singleton instance.
setColumnText(int column, const QString &label)
virtual void addEntry()
Responds to addEntry button.
unsigned int m_column
The number of columns of the pick table.
void addItem(std::vector< double > &v)
Adds a new point to the pick NTuple and the PickTable's window.
PlotterBase * m_target
The target PlotterBase object.
unsigned int rows() const
Returns the number of rows of the NTuple.
NTupleSorter class interface.
std::string registerNTuple(DataSource *nt)
Register a DataSource.
hippodraw::DataRep class interface.
A singleton class that is the interface between GUI and the displays.
virtual void deleteSelectedItem()
Responds to the 'Delete Selected Item' button click.
setSorting(int column, bool ascending=TRUE)
DataSourceController class interface.
virtual void clear()
Responds to the 'clear' button click.
The base class for data representations.
hippodraw::NTuple class interface.
void clear()
Clears the NTuple.
intp size(numeric::array arr)
PickTable(PlotterBase *plotter)
A constructor.
A Color class for creating the color object following the standard RGB color space.
The base class for the PlotterBase hierarchy.
A DataSource class implemented with std::vector<double> to store the column data. ...
NTupleSorter * m_sorter
The object that maintains the NTuple of picked data points.
PyArray_TYPES type(numeric::array arr)
DisplayController class interface declaration.
setShowSortIndicator(bool show)
virtual void listSorted(int)
Sorts the table.
hippodraw::PlotterBase class interface.
NTuple * getPickTable() const
Gets the pick table as a NTuple.
virtual void eraseRow(unsigned int index)
Erases a row from the NTuple.
QCheckBox * m_pickedCheckBox
void addDataRep()
Add DataRep object, called by constructor or show picked points check box.
virtual void m_pick_table_selectionChanged()
Responds to change of selection in the QListView.
void refreshItems(unsigned int select)
Refreshes the view of all the items.
A helper class to sort and keep sorted an NTuple.
virtual void pickedCheckBoxClicked()
Responds to the 'Show picked points' check box click.
const std::vector< double > & getRow(unsigned int index) const
Returns a reference to the index row of the sorted NTuple.
virtual DataRep * getDataRep(int index) const
Returns the specified DataRep or null pointer if it doesn't exits.
hippodraw::PickTable class interface
DataRep * m_datarep
The DataRep of picked points.
toUInt(bool *ok=0, int base=10) const