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
174 Q3ListViewItem * item = m_pick_table -> firstChild ();
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.
A derived class of PickTableBase class which is generated by the Qt designer.
The base class for the PlotterBase hierarchy.
void addDataRep()
Add DataRep object, called by constructor or show picked points check box.
virtual void pickedCheckBoxClicked()
Responds to the 'Show picked points' check box click.
setColumnText(int column, const QString &label)
virtual void addEntry()
Responds to addEntry button.
virtual void clear()
Responds to the 'clear' button click.
hippodraw::PickTable class interface
A singleton class that is the interface between GUI and the displays.
PlotterBase * m_target
The target PlotterBase object.
virtual void deleteSelectedItem()
Responds to the 'Delete Selected Item' button click.
NTupleSorter * m_sorter
The object that maintains the NTuple of picked data points.
hippodraw::PlotterBase class interface.
void addItem(std::vector< double > &v)
Adds a new point to the pick NTuple and the PickTable's window.
NTupleSorter class interface.
std::string registerNTuple(DataSource *nt)
Register a DataSource.
unsigned int indexOf(QListViewItem *target)
Finds the index of the target QListViewItem.
setSorting(int column, bool ascending=TRUE)
A DataSource class implemented with std::vector to store the column data. ...
DisplayController class interface declaration.
intp size(numeric::array arr)
hippodraw::NTuple class interface.
PyArray_TYPES type(numeric::array arr)
A helper class to sort and keep sorted an NTuple.
A Color class for creating the color object following the standard RGB color space.
void clear()
Clears the NTuple.
setShowSortIndicator(bool show)
NTuple * getPickTable() const
Gets the pick table as a NTuple.
static DataSourceController * instance()
Returns the pointer to the singleton instance.
PickTable(PlotterBase *plotter)
A constructor.
DataRep * m_datarep
The DataRep of picked points.
virtual void eraseRow(unsigned int index)
Erases a row from the NTuple.
virtual DataRep * getDataRep(int index) const
Returns the specified DataRep or null pointer if it doesn't exits.
The base class for data representations.
hippodraw::DataRep class interface.
virtual void listSorted(int)
Sorts the table.
virtual void m_pick_table_selectionChanged()
Responds to change of selection in the QListView.
unsigned int m_column
The number of columns of the pick table.
DataSourceController class interface.
unsigned int rows() const
Returns the number of rows of the NTuple.
void refreshItems(unsigned int select)
Refreshes the view of all the items.
toUInt(bool *ok=0, int base=10) const
const std::vector< double > & getRow(unsigned int index) const
Returns a reference to the index row of the sorted NTuple.
QCheckBox * m_pickedCheckBox