COPASI API
4.16.103
Main Page
Namespaces
Classes
Files
File List
File Members
copasi
layoutUI
NodeSizePanel.cpp
Go to the documentation of this file.
1
// Copyright (C) 2010 - 2013 by Pedro Mendes, Virginia Tech Intellectual
2
// Properties, Inc., University of Heidelberg, and The University
3
// of Manchester.
4
// All rights reserved.
5
6
// Qt headers
7
#include <QtCore/QString>
8
#include <QtGui/QWidget>
9
10
// global headers
11
#include <assert.h>
12
13
// global copasi headers
14
#include "
copasi/copasi.h
"
15
16
// local copasi headers
17
#include "
NodeSizePanel.h
"
18
#include "
CQLayoutMainWindow.h
"
19
20
void
NodeSizePanel::setMinAndMaxValues
()
21
{
22
CQLayoutMainWindow
* tmp =
dynamic_cast<
CQLayoutMainWindow
*
>
(parentWidget());
23
assert(tmp);
24
QString s1 = lineEdit1->text();
25
bool
ok1;
26
C_INT32
val1 = s1.toInt(&ok1, 10);
27
QString s2 = lineEdit2->text();
28
bool
ok2;
29
C_INT32
val2 = s2.toInt(&ok2, 10);
30
31
if
((tmp) && (ok1) && (ok2) && (val1 < val2))
32
tmp->
setMinAndMaxValue
(val1, val2);
33
34
close();
35
}
36
37
void
NodeSizePanel::cancel
()
38
{
39
close();
40
}
41
42
void
NodeSizePanel::setMinValue
()
43
{
44
CQLayoutMainWindow
* tmp =
dynamic_cast<
CQLayoutMainWindow
*
>
(parentWidget());
45
assert(tmp);
46
QString s = lineEdit1->text();
47
bool
ok;
48
C_INT32
val = s.toInt(&ok, 10);
49
50
if
((tmp) && (ok))
51
tmp->
setMinValue
(val);
52
}
53
54
void
NodeSizePanel::setMaxValue
()
55
{
56
CQLayoutMainWindow
* tmp =
dynamic_cast<
CQLayoutMainWindow
*
>
(parentWidget());
57
assert(tmp);
58
QString s = lineEdit1->text();
59
bool
ok;
60
C_INT32
val = s.toInt(&ok, 10);
61
62
if
((tmp) && (ok))
63
tmp->
setMaxValue
(val);
64
}
65
66
NodeSizePanel::NodeSizePanel
(QWidget* parent ,
bool
modal , Qt::WindowFlags
fl
):
67
QDialog(parent, fl)
68
{
69
setupUi(
this
);
70
this->setModal(modal);
71
CQLayoutMainWindow
* tmp =
dynamic_cast<
CQLayoutMainWindow
*
>
(parentWidget());
72
assert(tmp);
73
74
if
(tmp)
75
{
76
C_INT32
minV = (
C_INT32
)(tmp->
getMinNodeSize
());
77
C_INT32
maxV = (
C_INT32
)(tmp->
getMaxNodeSize
());
78
lineEdit1->setText(QString::number(minV));
79
lineEdit2->setText(QString::number(maxV));
80
}
81
}
NodeSizePanel::setMinAndMaxValues
void setMinAndMaxValues()
Definition:
NodeSizePanel.cpp:20
CQLayoutMainWindow
Definition:
CQLayoutMainWindow.h:51
NodeSizePanel.h
CQLayoutMainWindow::getMinNodeSize
C_FLOAT64 getMinNodeSize()
Definition:
CQLayoutMainWindow.cpp:185
NodeSizePanel::NodeSizePanel
NodeSizePanel(QWidget *parent=0, bool modal=false, Qt::WindowFlags fl=0)
Definition:
NodeSizePanel.cpp:66
C_INT32
#define C_INT32
Definition:
copasi.h:90
CQLayoutMainWindow::setMinValue
void setMinValue(C_INT32 minNdSize)
Definition:
CQLayoutMainWindow.cpp:620
NodeSizePanel::cancel
void cancel()
Definition:
NodeSizePanel.cpp:37
copasi.h
NodeSizePanel::setMinValue
void setMinValue()
Definition:
NodeSizePanel.cpp:42
NodeSizePanel::setMaxValue
void setMaxValue()
Definition:
NodeSizePanel.cpp:54
CQLayoutMainWindow::setMaxValue
void setMaxValue(C_INT32 maxNdSize)
Definition:
CQLayoutMainWindow.cpp:628
CQLayoutMainWindow.h
fl
bool fl(const C_FLOAT64 &d1, const C_FLOAT64 &d2)
Definition:
CTrajectoryTask.cpp:48
CQLayoutMainWindow::getMaxNodeSize
C_FLOAT64 getMaxNodeSize()
Definition:
CQLayoutMainWindow.cpp:198
CQLayoutMainWindow::setMinAndMaxValue
void setMinAndMaxValue(C_INT32 minNdSize, C_INT32 maxNdSize)
Definition:
CQLayoutMainWindow.cpp:635
Generated on Thu Jul 2 2015 14:50:44 for COPASI API by
1.8.6