Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/Views/Qt4/QtHomologyList.cpp

    r9bdcc9 re1fe7e  
    4141#include <QtGui/QTreeWidget>
    4242#include <QtGui/QTabWidget>
    43 #include <Qt/qsplitter.h>
    44 #include <Qt/qboxlayout.h>
     43#include<Qt/qsplitter.h>
    4544
    4645#include "CodePatterns/MemDebug.hpp"
     
    7473    potentialregistry_enabled(false)
    7574{
    76   QVBoxLayout* layout = new QVBoxLayout(this);
    7775  QSplitter *splitter = new QSplitter (Qt::Horizontal, this );
    78   layout->addWidget(splitter);
    79 
    80   // tree widget
    8176  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);
    8877  splitter->addWidget(treewidget);
    8978
    90   // plot widget
    9179#ifdef HAVE_QWT
    9280  widget = new QSeisPlotPage ("energy", splitter);
     
    9684#endif
    9785  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);
    9895
    9996        dirty = true;
     
    201198        const EmpiricalPotential &potential = dynamic_cast<const EmpiricalPotential &>(**potiter);
    202199        const std::string potentialname = potential.getName();
    203         const FunctionModel::filter_t filter = potential.getSpecificFilter();
    204200        Coordinator::ptr coordinator = potential.getCoordinator();
    205201        // then we need to sample the potential
    206202        xvalues.clear();
    207203        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)
    224208        std::vector<double>::const_iterator xiter = xvalues.begin();
    225209        std::vector<double>::const_iterator yiter = yvalues.begin();
Note: See TracChangeset for help on using the changeset viewer.