- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Views/Qt4/QtHomologyList.cpp
r9bdcc9 re1fe7e 41 41 #include <QtGui/QTreeWidget> 42 42 #include <QtGui/QTabWidget> 43 #include <Qt/qsplitter.h> 44 #include <Qt/qboxlayout.h> 43 #include<Qt/qsplitter.h> 45 44 46 45 #include "CodePatterns/MemDebug.hpp" … … 74 73 potentialregistry_enabled(false) 75 74 { 76 QVBoxLayout* layout = new QVBoxLayout(this);77 75 QSplitter *splitter = new QSplitter (Qt::Horizontal, this ); 78 layout->addWidget(splitter);79 80 // tree widget81 76 treewidget = new QTreeWidget (splitter); 82 treewidget->setSelectionMode( QTreeWidget::SingleSelection );83 treewidget->setColumnCount(COLUMNCOUNT);84 QStringList header;85 for(int i=0; i<COLUMNCOUNT;++i)86 header << COLUMNNAMES[i];87 treewidget->setHeaderLabels(header);88 77 splitter->addWidget(treewidget); 89 78 90 // plot widget91 79 #ifdef HAVE_QWT 92 80 widget = new QSeisPlotPage ("energy", splitter); … … 96 84 #endif 97 85 splitter->addWidget(widget); 86 // splitter->setStretchFactor(10, 1); 87 88 treewidget->setSelectionMode( QTreeWidget::SingleSelection ); 89 90 treewidget->setColumnCount(COLUMNCOUNT); 91 QStringList header; 92 for(int i=0; i<COLUMNCOUNT;++i) 93 header << COLUMNNAMES[i]; 94 treewidget->setHeaderLabels(header); 98 95 99 96 dirty = true; … … 201 198 const EmpiricalPotential &potential = dynamic_cast<const EmpiricalPotential &>(**potiter); 202 199 const std::string potentialname = potential.getName(); 203 const FunctionModel::filter_t filter = potential.getSpecificFilter();204 200 Coordinator::ptr coordinator = potential.getCoordinator(); 205 201 // then we need to sample the potential 206 202 xvalues.clear(); 207 203 for (TrainingData::InputVector_t::const_iterator inputiter = inputs.begin(); 208 inputiter != inputs.end(); ++inputiter) { 209 const FunctionModel::list_of_arguments_t specificargs = filter(*inputiter); 210 double average = 0.; 211 for (FunctionModel::list_of_arguments_t::const_iterator argiter = specificargs.begin(); 212 argiter != specificargs.end(); ++argiter) { 213 const FunctionModel::arguments_t args = *argiter; 214 average += (*coordinator)(args); 215 } 216 if (specificargs.size() > 1) { 217 const size_t index = xvalues.size(); 218 xvalues.push_back(average/(double)specificargs.size()); 219 yvalues[index] *= 1./(double)specificargs.size(); 220 } 221 } 222 223 // We need to sort the xvalues (and associated yvalues also) 204 inputiter != inputs.end(); ++inputiter) 205 xvalues.push_back((*coordinator)(*inputiter)); 206 207 // We need to sort the xvalues (and yvalues also) 224 208 std::vector<double>::const_iterator xiter = xvalues.begin(); 225 209 std::vector<double>::const_iterator yiter = yvalues.begin();
Note:
See TracChangeset
for help on using the changeset viewer.