COPASI API  4.16.103
Public Slots | Public Member Functions | List of all members
CQMatrixDialog Class Reference

#include <CQMatrixDialog.h>

Inheritance diagram for CQMatrixDialog:
Inheritance graph
[legend]
Collaboration diagram for CQMatrixDialog:
Collaboration graph
[legend]

Public Slots

virtual void setArray (const CArrayAnnotation *tmp, bool single)
 

Public Member Functions

 CQMatrixDialog (QWidget *parent=0, const char *name=0, bool modal=false, Qt::WindowFlags fl=0)
 
 ~CQMatrixDialog ()
 

Detailed Description

Definition at line 22 of file CQMatrixDialog.h.

Constructor & Destructor Documentation

CQMatrixDialog::CQMatrixDialog ( QWidget *  parent = 0,
const char *  name = 0,
bool  modal = false,
Qt::WindowFlags  fl = 0 
)

Definition at line 27 of file CQMatrixDialog.cpp.

28  : QDialog(parent, fl)
29 {
30  setObjectName(QString::fromUtf8(name));
31  setModal(modal);
32  setupUi(this);
33 
34 }
bool fl(const C_FLOAT64 &d1, const C_FLOAT64 &d2)
CQMatrixDialog::~CQMatrixDialog ( )

Definition at line 39 of file CQMatrixDialog.cpp.

40 {
41  // no need to delete child widgets, Qt does it all for us
42 }

Member Function Documentation

void CQMatrixDialog::setArray ( const CArrayAnnotation tmp,
bool  single 
)
virtualslot

Definition at line 44 of file CQMatrixDialog.cpp.

References CArrayAnnotation::dimensionality(), FROM_UTF8, CArrayAnnotation::getAnnotationsString(), CArrayAnnotation::getDimensionDescription(), CCopasiObject::getObjectName(), and CArrayAnnotation::size().

Referenced by CCopasiSelectionDialog::chooseCellMatrix().

45 {
46  size_t i;
47 
48  mpLabelRow->setText("Rows : " + FROM_UTF8(tmp->getDimensionDescription(0)));
49  size_t nRows = tmp->size()[0];
50 
51  if (!single)
52  mpCBRow->insertItem(mpCBRow->count(), "ALL");
53 
54  if (FROM_UTF8(tmp->getObjectName()).contains("Eigenvalues"))
55  {
56  for (i = 0; i < nRows; i++)
57  mpCBRow->insertItem(mpCBRow->count(), QString::number(i + 1));
58  }
59  else
60  {
61  for (i = 0; i < nRows; i++)
62  mpCBRow->insertItem(mpCBRow->count(), FROM_UTF8(tmp->getAnnotationsString(0, true)[i]));
63  }
64 
65  mpLabelColumn->hide();
66  mpCBColumn->hide();
67 
68  mpLabelDim3->hide();
69  mpCBDim3->hide();
70 
71  if (tmp->dimensionality() > 1)
72  {
73  mpLabelColumn->show();
74  mpCBColumn->show();
75 
76  mpLabelColumn->setText("Columns : " + FROM_UTF8(tmp->getDimensionDescription(1)));
77  size_t nCols = tmp->size()[1];
78 
79  if (!single)
80  mpCBColumn->insertItem(mpCBColumn->count(), "ALL");
81 
82  if (FROM_UTF8(tmp->getObjectName()).contains("Eigenvalues"))
83  {
84  mpCBColumn->insertItem(mpCBColumn->count(), "Real part");
85  mpCBColumn->insertItem(mpCBColumn->count(), "Imaginary part");
86  }
87  else
88  {
89  for (i = 0; i < nCols; i++)
90  mpCBColumn->insertItem(mpCBColumn->count(), FROM_UTF8(tmp->getAnnotationsString(1, true)[i]));
91  }
92 
93  if (tmp->dimensionality() == 3)
94  {
95  mpLabelDim3->show();
96  mpCBDim3->show();
97 
98  mpLabelDim3->setText("Dimension : " + FROM_UTF8(tmp->getDimensionDescription(2)));
99  size_t nDims = tmp->size()[2];
100 
101  if (!single)
102  mpCBDim3->insertItem(mpCBDim3->count(), "ALL");
103 
104  for (i = 0; i < nDims; i++)
105  mpCBDim3->insertItem(mpCBDim3->count(), FROM_UTF8(tmp->getAnnotationsString(2, true)[i]));
106  }
107  }
108 }
const std::string & getDimensionDescription(size_t d) const
#define FROM_UTF8(__x)
Definition: qtUtilities.h:73
const std::string & getObjectName() const
const std::vector< std::string > & getAnnotationsString(size_t d, bool display=true) const
CCopasiAbstractArray::index_type size() const
size_t dimensionality() const

The documentation for this class was generated from the following files: