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