18 #include <QtCore/QString>
19 #include <QtGui/QIntValidator>
27 mpLineEditSizeX->setValidator(
new QIntValidator(1, 10000,
this));
28 mpLineEditSizeY->setValidator(
new QIntValidator(1, 10000,
this));
46 for (i = 0; i < imax; ++i)
48 QTreeWidgetItem * pItem =
new QTreeWidgetItem((QTreeWidget*)NULL, 1000);
50 pItem->setCheckState(0, Qt::Unchecked);
52 mpTreeWidget->addTopLevelItem(pItem);
55 connect(mpTreeWidget, SIGNAL(itemChanged(QTreeWidgetItem*,
int)),
this, SLOT(
slotCompartmentActivated(QTreeWidgetItem*,
int)));
57 connect(mpRadioButtonLin, SIGNAL(toggled(
bool)),
this, SLOT(
slotMode()));
58 connect(mpRadioButtonRec, SIGNAL(toggled(
bool)),
this, SLOT(
slotMode()));
68 std::map<QTreeWidgetItem*, const CCompartment*>::const_iterator it =
mItemCompartmentMap.find(pItem);
77 if (pItem->checkState(0) == Qt::Checked)
81 for (i = 0; i < imax; ++i)
83 QTreeWidgetItem * pChild =
new QTreeWidgetItem(pItem, 1001);
85 pChild->setCheckState(1, Qt::Unchecked);
89 pItem->setExpanded(
true);
93 if (pItem->checkState(0) == Qt::Unchecked)
96 size_t i, imax = pItem->childCount();
98 for (i = 0; i < imax; ++i)
100 pItem->removeChild(pItem->child(0));
108 std::set<std::string> metabkeys;
110 std::map<QTreeWidgetItem*, const CCompartment*>::const_iterator it;
114 if (it->first->checkState(0) == Qt::Checked)
122 for (i = 0; i < it->first->childCount(); ++i)
124 if (it->first->child(i)->checkState(1) == Qt::Checked)
126 std::map<QTreeWidgetItem*, const CMetab*>::const_iterator itMetab =
mItemMetabMap.find(it->first->child(i));
130 metabkeys.insert(itMetab->second->getKey());
140 multx = mpLineEditSizeX->text().toInt();
141 multy = mpLineEditSizeY->text().toInt();
143 if (mpRadioButtonLin->isChecked())
145 else if (mpRadioButtonRec->isChecked())
160 if (mpRadioButtonLin->isChecked())
162 mpLabelCross->setEnabled(
false);
163 mpLineEditSizeY->setEnabled(
false);
165 else if (mpRadioButtonRec->isChecked())
167 mpLabelCross->setEnabled(
true);
168 mpLineEditSizeY->setEnabled(
true);
CCopasiVectorNS< CMetab > & getMetabolites()
const std::string & getObjectName() const
virtual size_t size() const
void slotMode()
handles change of linear/rectangular mode
void slotCompartmentActivated(QTreeWidgetItem *pItem, int col)
handles activation or deactivation of a compartment
void createRectangularArray(const SetOfModelElements &source, size_t nx, size_t ny, const std::set< std::string > &setOfMetabolites)
std::map< QTreeWidgetItem *, const CMetab * > mItemMetabMap
static CCopasiVector< CCopasiDataModel > * getDatamodelList()
void createLinearArray(const SetOfModelElements &source, size_t n, const std::set< std::string > &setOfMetabolites)
void fillDependencies(const CModel *pModel)
CCopasiVectorNS< CCompartment > & getCompartments()
void addCompartment(const CCompartment *x)
bool fl(const C_FLOAT64 &d1, const C_FLOAT64 &d2)
std::map< QTreeWidgetItem *, const CCompartment * > mItemCompartmentMap
CQExpandModelData(QWidget *parent=0, Qt::WindowFlags fl=0)