COPASI API  4.16.103
CQMathMatrixWidget.cpp
Go to the documentation of this file.
1 // Begin CVS Header
2 // $Source: /Volumes/Home/Users/shoops/cvs/copasi_dev/copasi/UI/CQMathMatrixWidget.cpp,v $
3 // $Revision: 1.10 $
4 // $Name: $
5 // $Author: shoops $
6 // $Date: 2011/10/14 15:25:16 $
7 // End CVS Header
8 
9 // Copyright (C) 2011 by Pedro Mendes, Virginia Tech Intellectual
10 // Properties, Inc., University of Heidelberg, and The University
11 // of Manchester.
12 // All rights reserved.
13 
14 // Copyright (C) 2008 by Pedro Mendes, Virginia Tech Intellectual
15 // Properties, Inc., EML Research, gGmbH, University of Heidelberg,
16 // and The University of Manchester.
17 // All rights reserved.
18 
19 // Copyright (C) 2001 - 2007 by Pedro Mendes, Virginia Tech Intellectual
20 // Properties, Inc. and EML Research, gGmbH.
21 // All rights reserved.
22 
23 #include "CQMathMatrixWidget.h"
24 
25 #include "copasi.h"
26 
27 #include "qtUtilities.h"
28 
31 #include "model/CModel.h"
32 
33 /**
34  * Constructs a CQMathMatrixWidget which is a child of 'parent', with the
35  * name 'name' and widget flags set to 'f'.
36  */
38  : CopasiWidget(parent)
39 {
40  setupUi(this);
41 
43  mpArrayWidget1->setColorCoding(tcs);
44  tcs->setMinMax(-1.5, 1.5);
45  mpArrayWidget1->setColorScalingAutomatic(false);
46 
47  tcs = new CColorScaleSimple();
48  mpArrayWidget2->setColorCoding(tcs);
49  tcs->setMinMax(-1.5, 1.5);
50  mpArrayWidget2->setColorScalingAutomatic(false);
51 
52  tcs = new CColorScaleSimple();
53  mpArrayWidget3->setColorCoding(tcs);
54  tcs->setMinMax(-1.5, 1.5);
55  mpArrayWidget3->setColorScalingAutomatic(false);
56 }
57 
58 /*
59  * Destroys the object and frees any allocated resources
60  */
62 {}
63 
65 {
66 
67  assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
68  const CModel* pModel = (*CCopasiRootContainer::getDatamodelList())[0]->getModel();
69 
70  const CArrayAnnotation * tmp;
71 
72  tmp = dynamic_cast<const CArrayAnnotation *>
73  (pModel->getObject(CCopasiObjectName("Array=Stoichiometry(ann)")));
74  mpArrayWidget1->setArrayAnnotation(tmp);
75 
76  tmp = dynamic_cast<const CArrayAnnotation *>
77  (pModel->getObject(CCopasiObjectName("Array=Reduced stoichiometry(ann)")));
78  mpArrayWidget2->setArrayAnnotation(tmp);
79 
80  tmp = dynamic_cast<const CArrayAnnotation *>
81  (pModel->getObject(CCopasiObjectName("Array=Link matrix(ann)")));
82  mpArrayWidget3->setArrayAnnotation(tmp);
83 }
84 
86 {
87  mpArrayWidget1->setArrayAnnotation(NULL);
88  mpArrayWidget2->setArrayAnnotation(NULL);
89  mpArrayWidget3->setArrayAnnotation(NULL);
90 }
91 
92 //*************************************
93 
95  C_UNUSED(action), const std::string & C_UNUSED(key))
96 {
97  clearArrays();
98  return true;
99 }
100 
102 {
103  return true;
104 }
105 
107 {
108  loadMatrices();
109 
110  return true;
111 }
objectType
CQMathMatrixWidget(QWidget *parent=0)
void setMinMax(const C_FLOAT64 &min, const C_FLOAT64 &max)
Definition: CColorScale.h:108
#define C_UNUSED(p)
Definition: copasi.h:220
virtual bool enterProtected()
static CCopasiVector< CCopasiDataModel > * getDatamodelList()
virtual bool update(ListViews::ObjectType objectType, ListViews::Action action, const std::string &key)
Definition: CModel.h:50
virtual const CObjectInterface * getObject(const CCopasiObjectName &cn) const