COPASI API  4.16.103
Public Slots | Public Member Functions | Static Public Attributes | Private Slots | Private Member Functions | Private Attributes | List of all members
CQLayoutMainWindow Class Reference

#include <CQLayoutMainWindow.h>

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

Public Slots

void changeFontSize ()
 
void changeMinMaxNodeSizes ()
 
void changeStepValue (int i)
 
void endOfAnimationReached ()
 
void loadData ()
 
void mapLabelsToCircles ()
 
void mapLabelsToRectangles ()
 
void saveImage ()
 
double slotFitToScreen ()
 
void slotLoopActivated (bool checked)
 
void slotParameterTableToggled (bool checked)
 
void slotPlayerControlToggled (bool checked)
 
void slotResetView ()
 
void slotToolbarToggled (bool checked)
 
void slotValueTableToggled (bool checked)
 

Public Member Functions

void addItemInAnimation (std::string s)
 
 CQLayoutMainWindow (QWidget *pParent)
 
bool getAnimationRunning ()
 
CQPlayerControlWidgetgetControlWidget ()
 
size_t getCurrentStep ()
 
C_INT16 getFontSize ()
 
CVisParameters::MAPPING_MODE getMappingMode ()
 
C_FLOAT64 getMaxNodeSize ()
 
C_FLOAT64 getMinNodeSize ()
 
CVisParameters::SCALING_MODE getScalingMode ()
 
C_INT32 getStepsPerSecond ()
 
void insertValueTable (CDataEntity dataSet)
 
void removeItemInAnimation (std::string s)
 
void setAnimationRunning (bool animationRunningP)
 
void setColorMode ()
 
void setFontSizeForLabels (C_INT32 size)
 
void setGlobalScaling ()
 
void setIndividualScaling ()
 
void setLayout (CLayout *pLayout)
 
void setMaxNodeSize (C_FLOAT64 minNdSize)
 
void setMaxValue (C_INT32 maxNdSize)
 
void setMinAndMaxValue (C_INT32 minNdSize, C_INT32 maxNdSize)
 
void setMinNodeSize (C_FLOAT64 minNdSize)
 
void setMinValue (C_INT32 minNdSize)
 
void setSizeMode ()
 
void setStepsPerSecond (C_INT16 val)
 
void setValueOnSlider (C_INT32)
 
void setZoomFactor (QString s)
 
void setZoomFactor (double zoom)
 
void updateValueTable (CDataEntity dataSet)
 

Static Public Attributes

static const char *const ZOOM_FACTOR_STRINGS [] = {"1%", "2%", "3%", "4%", "5%", "10%", "20%", "25%", "30%", "40%", "50%", "75%", "100%", "150%", "200%", "300%", "400%", "500%", "1000%"}
 
static const double ZOOM_FACTORS [] = {0.01, 0.02, 0.03, 0.04, 0.05, 0.1, 0.2, 0.25, 0.3, 0.4, 0.5, 0.75, 1.0, 1.5, 2.0, 3.0, 4.0, 5.0, 10.0}
 

Private Slots

void backwardAnimation ()
 
void forwardAnimation ()
 
void loadSBMLFile ()
 
void parameterTableValueChanged (int row)
 
void pauseAnimation ()
 
void showAnimation ()
 
void showStep (int i)
 
void startAnimation ()
 
void stepBackwardAnimation ()
 
void stepForwardAnimation ()
 
void stopAnimation ()
 

Private Member Functions

QIcon createStartIcon ()
 
QIcon createStopIcon ()
 
bool maybeSave ()
 

Private Attributes

QString mCurrentPlace
 
bool mDataPresent
 
bool mLooping
 
QAction * mpCircularShape
 
QAction * mpCloseAction
 
CQPlayerControlWidgetmpControlWidget
 
QAction * mpCreatePicture
 
QMenu * mpFileMenu
 
QFrame * mpFrame
 
CQGLViewportmpGLViewport
 
QFrame * mpInfoBox
 
QMenu * mpLabelShapeMenu
 
CLayoutmpLayout
 
QAction * mpLoadDataAction
 
QAction * mpLoopItemAction
 
QFrame * mpMainBox
 
QAction * mpMimaNodeSizes
 
QAction * mpOpenSBMLFile
 
QMenu * mpOptionsMenu
 
QAction * mpParameterTableAction
 
CQParaPanelmpParaPanel
 
QMenu * mpPlayMenu
 
QAction * mpRectangularShape
 
QAction * mpSFontSize
 
QSplitter * mpSplitter
 
QSlider * mpTimeSlider
 
QToolBar * mpToolbar
 
CQCurrentValueTablempValTable
 
QAction * mpValueTableAction
 
QMenu * mpViewMenu
 
CVisParametersmpVisParameters
 
QActionGroup * mpZoomActionGroup
 
QComboBox * mpZoomComboBox
 
QMenu * mpZoomMenu
 

Detailed Description

Definition at line 51 of file CQLayoutMainWindow.h.

Constructor & Destructor Documentation

CQLayoutMainWindow::CQLayoutMainWindow ( QWidget *  pParent)

Definition at line 64 of file CQLayoutMainWindow.cpp.

References backwardAnimation(), CQIconResource::copasi, CQGLViewport::createGraph(), forwardAnimation(), CQIconResource::icon(), mLooping, mpControlWidget, mpFrame, mpGLViewport, mpInfoBox, mpLayout, mpMainBox, mpParaPanel, mpSplitter, mpTimeSlider, mpToolbar, mpValTable, parameterTableValueChanged(), pauseAnimation(), showStep(), startAnimation(), stepBackwardAnimation(), stepForwardAnimation(), and stopAnimation().

64  :
65  QFrame(pParent)
67  , mpParaPanel(new CQParaPanel)
69  , mpMainBox(new QFrame(this))
70  , mpSplitter(new QSplitter(Qt::Horizontal, this->mpMainBox))
71  , mpGLViewport(NULL)
72  , mpTimeSlider(new QSlider(Qt::Horizontal))
73  , mpFrame(new QFrame)
74  , mpInfoBox(new QFrame)
76  , mDataPresent(false)
77  , mCurrentPlace(QString::null)
78  , mpZoomActionGroup(new QActionGroup(this))
79  , mpLayout(NULL)
80 {
81 
82 #ifndef Darwin
84 #endif // not Darwin
85 
86  QVBoxLayout* mainLayout = new QVBoxLayout(mpMainBox);
87  QVBoxLayout* infoLayout = new QVBoxLayout(mpInfoBox);
88  mpSplitter->addWidget(this->mpInfoBox);
89 
90  // create split window with parameter panel and graph panel
91  mainLayout->addWidget(this->mpSplitter);
92 
93  infoLayout->addWidget(this->mpParaPanel);
94  infoLayout->addWidget(this->mpValTable);
95  this->mpInfoBox->setLayout(infoLayout);
96 
97  // Create OpenGL widget
98  // we initialize it here because the parent has to be present
99  this->mpGLViewport = new CQGLViewport(this->mpSplitter);
100  this->mpGLViewport->setWindowTitle("Network layout");
101  this->mpSplitter->addWidget(this->mpGLViewport);
102 
103  if (this->mpLayout != NULL)
104  {
105  this->mpGLViewport->createGraph(this->mpLayout); // create local data structures
106  }
107 
108  this->mpSplitter->setStretchFactor(this->mpSplitter->indexOf(this->mpInfoBox), 0);
109  this->mpSplitter->setStretchFactor(this->mpSplitter->indexOf(this->mpGLViewport), 1);
110 
111  connect(this->mpControlWidget, SIGNAL(play()), this, SLOT(startAnimation()));
112  connect(this->mpControlWidget, SIGNAL(pause()), this, SLOT(pauseAnimation()));
113  connect(this->mpControlWidget, SIGNAL(stop()), this, SLOT(stopAnimation()));
114  connect(this->mpControlWidget, SIGNAL(forward()), this, SLOT(forwardAnimation()));
115  connect(this->mpControlWidget, SIGNAL(backward()), this, SLOT(backwardAnimation()));
116  connect(this->mpControlWidget, SIGNAL(step_backward()), this, SLOT(stepBackwardAnimation()));
117  connect(this->mpControlWidget, SIGNAL(step_forward()), this, SLOT(stepForwardAnimation()));
118 
119  this->mpTimeSlider->setRange(0, 100);
120  this->mpTimeSlider->setValue(0);
121  this->mpTimeSlider->setEnabled(false);
122 
123  this->mpTimeSlider->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
124  connect(this->mpTimeSlider, SIGNAL(valueChanged(int)), this, SLOT(showStep(int)));
125 
126  QHBoxLayout* pGridLayout = new QHBoxLayout(mpFrame);
127  pGridLayout->addWidget(this->mpControlWidget);
128  pGridLayout->addWidget(this->mpTimeSlider);
129  this->mpFrame->setLayout(pGridLayout);
130 
131  mainLayout->addWidget(this->mpFrame);
132 
133  this->mpMainBox->setLayout(mainLayout);
134 
135  this->QFrame::setLayout(new QVBoxLayout);
136  this->layout()->addWidget(this->mpMainBox);
137 
138  connect(this->mpValTable , SIGNAL(valueChanged(int)), this, SLOT(parameterTableValueChanged(int)));
139  this->mLooping = false;
140 
141  this->setTabOrder(this->mpGLViewport, this->mpToolbar);
142  this->setTabOrder(this->mpParaPanel, this->mpValTable);
143  this->setTabOrder(this->mpValTable, this->mpControlWidget);
144 }
CQParaPanel * mpParaPanel
CVisParameters * mpVisParameters
void createGraph(CLayout *lP)
static const QIcon & icon(const IconID &id)
CQGLViewport * mpGLViewport
CQPlayerControlWidget * mpControlWidget
void parameterTableValueChanged(int row)
QActionGroup * mpZoomActionGroup
CQCurrentValueTable * mpValTable

Member Function Documentation

void CQLayoutMainWindow::addItemInAnimation ( std::string  s)

Definition at line 411 of file CQLayoutMainWindow.cpp.

References CQGLViewport::getPainter(), mpGLViewport, and CQGLNetworkPainter::setItemAnimated().

Referenced by parameterTableValueChanged(), and CQCurrentValueTable::setAllBoxesChecked().

412 {
413  mpGLViewport->getPainter()->setItemAnimated(key, true);
414 }
const CQGLNetworkPainter * getPainter() const
CQGLViewport * mpGLViewport
void setItemAnimated(std::string key, bool animatedP)
void CQLayoutMainWindow::backwardAnimation ( )
privateslot

Definition at line 814 of file CQLayoutMainWindow.cpp.

References CQGLViewport::getPainter(), CQPlayerControlWidget::isPlaying(), mpControlWidget, mpGLViewport, mpParaPanel, mpTimeSlider, pauseAnimation(), showStep(), CQGLNetworkPainter::showStep(), and startAnimation().

Referenced by CQLayoutMainWindow(), forwardAnimation(), and stopAnimation().

815 {
816  // go to step 0 and redisplay
817  this->pauseAnimation();
818  this->mpGLViewport->getPainter()->showStep(0);
819  // update the slider
820  disconnect(mpTimeSlider, SIGNAL(valueChanged(double)), this, SLOT(showStep(double)));
821  this->mpTimeSlider->setValue(0.0);
822  this->mpParaPanel->setStepNumber(0);
823  connect(mpTimeSlider, SIGNAL(valueChanged(double)), this, SLOT(showStep(double)));
824 
825  if (this->mpControlWidget->isPlaying())
826  {
827  this->startAnimation();
828  }
829 }
CQParaPanel * mpParaPanel
const CQGLNetworkPainter * getPainter() const
CQGLViewport * mpGLViewport
CQPlayerControlWidget * mpControlWidget
void CQLayoutMainWindow::changeFontSize ( )
slot

Definition at line 322 of file CQLayoutMainWindow.cpp.

323 {
324  // choose new font size (setting of size will be invoked from FontChooser panel
325  FontChooser *fCh = new FontChooser(this);
326  fCh->exec();
327 }
void CQLayoutMainWindow::changeMinMaxNodeSizes ( )
slot

Definition at line 316 of file CQLayoutMainWindow.cpp.

317 {
318  NodeSizePanel *panel = new NodeSizePanel(this);
319  panel->exec();
320 }
void CQLayoutMainWindow::changeStepValue ( int  i)
slot

Definition at line 579 of file CQLayoutMainWindow.cpp.

References mpTimeSlider.

580 {
581  mpTimeSlider->setValue(i);
582 }
QIcon CQLayoutMainWindow::createStartIcon ( )
private

Definition at line 648 of file CQLayoutMainWindow.cpp.

References C_INT16, and C_INT32.

649 {
650  C_INT32 w = 19;
651  C_INT32 h = 19;
652  QImage img = QImage(w, h, QImage::Format_Indexed8);
653  img.setNumColors(2);
654  img.setColor(0, qRgb(0, 0, 200));
655  C_INT16 x, y;
656 
657  for (x = 0; x < w; x++)
658  {
659  for (y = 0; y < h; y++)
660  {
661  img.setPixel(x, y, 0);
662  }
663  }
664 
665  C_INT32 delta = 0;
666  img.setColor(1, qRgb(255, 0, 0));
667 
668  for (x = 3; x < w - 3; x++)
669  {
670  for (y = 3 + delta; y < h - 3 - delta; y++)
671  {
672  img.setPixel(x, y, 1);
673  }
674 
675  if (fmod((double) x, 2.0) == 0)
676  delta++;
677  }
678 
679  QPixmap *pixmap = new QPixmap();
680  pixmap->fromImage(img);
681  QIcon iconset = QIcon(*pixmap);
682  delete pixmap;
683  return iconset;
684 }
#define C_INT32
Definition: copasi.h:90
#define C_INT16
Definition: copasi.h:91
QIcon CQLayoutMainWindow::createStopIcon ( )
private

Definition at line 686 of file CQLayoutMainWindow.cpp.

References C_INT16, and C_INT32.

687 {
688  C_INT32 w = 20;
689  C_INT32 h = 20;
690  QImage img = QImage(w, h, QImage::Format_Indexed8);
691  img.setNumColors(2);
692  img.setColor(0, qRgb(0, 0, 200));
693  C_INT16 x, y;
694 
695  for (x = 0; x < w; x++)
696  {
697  for (y = 0; y < h; y++)
698  {
699  img.setPixel(x, y, 0);
700  }
701  }
702 
703  C_INT32 delta = 4;
704  img.setColor(1, qRgb(255, 0, 0));
705 
706  for (x = (delta - 1); x <= (w - delta); x++)
707  {
708  for (y = (delta - 1); y <= (h - delta); y++)
709  {
710  img.setPixel(x, y, 1);
711  }
712  }
713 
714  QPixmap *pixmap = new QPixmap();
715  pixmap->fromImage(img);
716  QIcon iconset = QIcon(*pixmap);
717  delete pixmap;
718  return iconset;
719 }
#define C_INT32
Definition: copasi.h:90
#define C_INT16
Definition: copasi.h:91
void CQLayoutMainWindow::endOfAnimationReached ( )
slot

Definition at line 553 of file CQLayoutMainWindow.cpp.

References CQPlayerControlWidget::getBackwardAction(), CQPlayerControlWidget::getPauseAction(), mLooping, and mpControlWidget.

554 {
555  if (this->mLooping)
556  {
557  this->mpControlWidget->getBackwardAction()->activate(QAction::Trigger);
558  }
559  else
560  {
561  this->mpControlWidget->getPauseAction()->activate(QAction::Trigger);
562  }
563 }
CQPlayerControlWidget * mpControlWidget
void CQLayoutMainWindow::forwardAnimation ( )
privateslot

Definition at line 795 of file CQLayoutMainWindow.cpp.

References backwardAnimation(), CQGLNetworkPainter::getNumberOfSteps(), CQGLViewport::getPainter(), mLooping, mpGLViewport, mpTimeSlider, pauseAnimation(), and showStep().

Referenced by CQLayoutMainWindow().

796 {
797  // go to last step and redisplay
798  if (!this->mLooping)
799  {
800  this->pauseAnimation();
801  double stepNumber = (double)(this->mpGLViewport->getPainter()->getNumberOfSteps() - 1);
802  this->showStep(stepNumber);
803  // update the slider
804  disconnect(mpTimeSlider, SIGNAL(valueChanged(double)), this, SLOT(showStep(double)));
805  this->mpTimeSlider->setValue(stepNumber);
806  connect(mpTimeSlider, SIGNAL(valueChanged(double)), this, SLOT(showStep(double)));
807  }
808  else
809  {
810  this->backwardAnimation();
811  }
812 }
const CQGLNetworkPainter * getPainter() const
size_t getNumberOfSteps() const
CQGLViewport * mpGLViewport
bool CQLayoutMainWindow::getAnimationRunning ( )

Definition at line 167 of file CQLayoutMainWindow.cpp.

References CVisParameters::mAnimationRunning, and mpVisParameters.

Referenced by CQGLNetworkPainter::triggerAnimationStep().

168 {
169  if (mpVisParameters != NULL)
170  {
172  }
173  else
174  return false;
175 }
CVisParameters * mpVisParameters
CQPlayerControlWidget * CQLayoutMainWindow::getControlWidget ( )

Definition at line 783 of file CQLayoutMainWindow.cpp.

References mpControlWidget.

Referenced by CQNewMainWindow::createMenus().

784 {
785  return this->mpControlWidget;
786 }
CQPlayerControlWidget * mpControlWidget
size_t CQLayoutMainWindow::getCurrentStep ( )

Definition at line 245 of file CQLayoutMainWindow.cpp.

References mpTimeSlider.

Referenced by CQGLNetworkPainter::setItemAnimated(), stepBackwardAnimation(), and stepForwardAnimation().

246 {
247  return (size_t) this->mpTimeSlider->value();
248 }
C_INT16 CQLayoutMainWindow::getFontSize ( )

Definition at line 222 of file CQLayoutMainWindow.cpp.

References CQGLNetworkPainter::getFontSize(), CQGLViewport::getPainter(), and mpGLViewport.

Referenced by FontChooser::FontChooser().

223 {
224  return mpGLViewport->getPainter()->getFontSize();
225 }
const CQGLNetworkPainter * getPainter() const
CQGLViewport * mpGLViewport
CVisParameters::MAPPING_MODE CQLayoutMainWindow::getMappingMode ( )
C_FLOAT64 CQLayoutMainWindow::getMaxNodeSize ( )
C_FLOAT64 CQLayoutMainWindow::getMinNodeSize ( )
CVisParameters::SCALING_MODE CQLayoutMainWindow::getScalingMode ( )
C_INT32 CQLayoutMainWindow::getStepsPerSecond ( )

Definition at line 227 of file CQLayoutMainWindow.cpp.

References mpVisParameters, and CVisParameters::mStepsPerSecond.

Referenced by CQGLNetworkPainter::runAnimation().

228 {
229  if (mpVisParameters != NULL)
230  {
232  }
233  else
234  return 2;
235 }
CVisParameters * mpVisParameters
void CQLayoutMainWindow::insertValueTable ( CDataEntity  dataSet)

Definition at line 367 of file CQLayoutMainWindow.cpp.

References C_FLOAT64, CQGLNetworkPainter::getNameForNodeKey(), CQGLNetworkPainter::getNodeNameEntry(), CDataEntity::getNumberOfElements(), CDataEntity::getOrigValueForSpecies(), CQGLViewport::getPainter(), mpGLViewport, mpValTable, parameterTableValueChanged(), CQCurrentValueTable::setNumCols(), CQCurrentValueTable::setNumRows(), and CQCurrentValueTable::setRowInTable().

Referenced by CQGLNetworkPainter::createDataSets().

368 {
369  int i = 0;
370  std::string key, name;
371  C_FLOAT64 val;
372  mpValTable->setNumRows((int) dataSet.getNumberOfElements());
374  disconnect(this->mpValTable , SIGNAL(valueChanged(int)), this, SLOT(parameterTableValueChanged(int)));
375 
376  while ((key = mpGLViewport->getPainter()->getNodeNameEntry(i)) != "")
377  {
378  name = this->mpGLViewport->getPainter()->getNameForNodeKey(key);
379  val = dataSet.getOrigValueForSpecies(key); // would be (- std::numeric_limits< C_FLOAT64 >::max()) if key not present
380  mpValTable->setRowInTable(i, key, name, val);
381  i++;
382  }
383 
384  connect(this->mpValTable , SIGNAL(valueChanged(int)), this, SLOT(parameterTableValueChanged(int)));
385 }
C_FLOAT64 getOrigValueForSpecies(std::string nodeKey)
Definition: CDataEntity.cpp:70
const CQGLNetworkPainter * getPainter() const
CQGLViewport * mpGLViewport
void setRowInTable(int row, std::string key, std::string s, C_FLOAT64 val)
std::string getNameForNodeKey(std::string key)
#define C_FLOAT64
Definition: copasi.h:92
void parameterTableValueChanged(int row)
std::string getNodeNameEntry(int i)
size_t getNumberOfElements()
Definition: CDataEntity.h:48
CQCurrentValueTable * mpValTable
void setNumCols(int columns)
void CQLayoutMainWindow::loadData ( )
slot

Definition at line 329 of file CQLayoutMainWindow.cpp.

References CQGLNetworkPainter::createDataSets(), CQGLNetworkPainter::getNumberOfSteps(), CQGLViewport::getPainter(), CQGLNetworkPainter::isCircleMode(), mDataPresent, mpControlWidget, mpGLViewport, mpParaPanel, mpTimeSlider, CQPlayerControlWidget::setCurrentStep(), CQPlayerControlWidget::setNumSteps(), and showStep().

Referenced by setLayout(), and startAnimation().

330 {
331  bool successfulP = mpGLViewport->getPainter()->createDataSets();
332 
333  if (successfulP)
334  {
335  // set the number of steps in the control widget and place the current
336  // step at 0
338  this->mpTimeSlider->setEnabled(true);
339  this->mDataPresent = true;
340  mpParaPanel->enableStepNumberChoice();
341  size_t maxVal = mpGLViewport->getPainter()->getNumberOfSteps();
342  this->mpTimeSlider->setRange(0, maxVal - 1);
343  this->mpControlWidget->setNumSteps(maxVal);
344  mpGLViewport->getPainter()->updateGL();
345  CQGLNetworkPainter* pPainter = this->mpGLViewport->getPainter();
346 
347  if (pPainter->getNumberOfSteps() > 1)
348  {
349  this->mpParaPanel->enableParameterChoice();
350  this->mpParaPanel->enableStepNumberChoice();
351  this->mpParaPanel->enableModeChoice();
352 
353  if (pPainter->isCircleMode())
354  {
355  showStep(this->mpTimeSlider->value());
356  }
357  }
358  else
359  {
360  this->mpParaPanel->disableParameterChoice();
361  this->mpParaPanel->disableStepNumberChoice();
362  this->mpParaPanel->disableModeChoice();
363  }
364  }
365 }
CQParaPanel * mpParaPanel
void setNumSteps(size_t numSteps)
const CQGLNetworkPainter * getPainter() const
void setCurrentStep(size_t currentStep)
size_t getNumberOfSteps() const
CQGLViewport * mpGLViewport
CQPlayerControlWidget * mpControlWidget
void CQLayoutMainWindow::loadSBMLFile ( )
privateslot

Definition at line 270 of file CQLayoutMainWindow.cpp.

References CQGLViewport::createGraph(), CCopasiRootContainer::getDatamodelList(), mpGLViewport, mpSplitter, and CCopasiVector< T >::size().

271 {
272  CListOfLayouts *pLayoutList;
273  assert(CCopasiRootContainer::getDatamodelList()->size() > 0);
274 
275  if ((*CCopasiRootContainer::getDatamodelList())[0] != NULL)
276  {
277  pLayoutList = (*CCopasiRootContainer::getDatamodelList())[0]->getListOfLayouts();
278  }
279  else
280  pLayoutList = NULL;
281 
283 
284  if (pLayoutList != NULL)
285  {
286  CLayout * pLayout;
287 
288  if (pLayoutList->size() > 0)
289  {
290  pLayout = (*pLayoutList)[0];
291  mpGLViewport->createGraph(pLayout); // create local data structures
292  }
293  }
294 }
virtual size_t size() const
void createGraph(CLayout *lP)
CQGLViewport * mpGLViewport
static CCopasiVector< CCopasiDataModel > * getDatamodelList()
void CQLayoutMainWindow::mapLabelsToCircles ( )
slot

Definition at line 296 of file CQLayoutMainWindow.cpp.

References CQGLNetworkPainter::getNumberOfSteps(), CQGLViewport::getPainter(), CQGLNetworkPainter::mapLabelsToCircles(), mpGLViewport, mpTimeSlider, and showStep().

297 {
298  if (mpGLViewport->getPainter() != NULL)
299  {
301 
303  showStep(this->mpTimeSlider->value());
304  }
305 }
const CQGLNetworkPainter * getPainter() const
size_t getNumberOfSteps() const
CQGLViewport * mpGLViewport
void CQLayoutMainWindow::mapLabelsToRectangles ( )
slot

Definition at line 307 of file CQLayoutMainWindow.cpp.

References CQGLViewport::getPainter(), CQGLNetworkPainter::mapLabelsToRectangles(), and mpGLViewport.

Referenced by stopAnimation().

308 {
309  if (mpGLViewport->getPainter() != NULL)
310  {
312  mpGLViewport->getPainter()->updateGL();
313  }
314 }
const CQGLNetworkPainter * getPainter() const
CQGLViewport * mpGLViewport
bool CQLayoutMainWindow::maybeSave ( )
private

Definition at line 722 of file CQLayoutMainWindow.cpp.

723 {
724  // int ret = CQMessageBox::warning(this, "SimWiz",
725  // "Do you really want to quit?",
726  // // tr("Do you really want to quit?\n"
727  // // "XXXXXXXX"),
728  // QMessageBox::Yes | QMessageBox::Default,
729  // QMessageBox::No,
730  // QMessageBox::Cancel | QMessageBox::Escape);
731  // if (ret == QMessageBox::Yes)
732  // return true;
733  // else if (ret == QMessageBox::Cancel)
734  // return false;
735 
736  return true;
737 }
void CQLayoutMainWindow::parameterTableValueChanged ( int  row)
privateslot

Definition at line 146 of file CQLayoutMainWindow.cpp.

References addItemInAnimation(), CQCurrentValueTable::getKeyForRow(), CQCurrentValueTable::getValueForRow(), CQGLViewport::isCircleMode(), mpGLViewport, mpValTable, removeItemInAnimation(), and CQGLViewport::updateWidget().

Referenced by CQLayoutMainWindow(), insertValueTable(), and updateValueTable().

147 {
148  std::string key = this->mpValTable->getKeyForRow(row);
149  bool value = this->mpValTable->getValueForRow(row);
150 
151  if (value == true)
152  {
153  this->addItemInAnimation(key);
154  }
155  else
156  {
157  this->removeItemInAnimation(key);
158  }
159 
160  // redraw the layout if we are in animation mode
161  if (this->mpGLViewport->isCircleMode())
162  {
163  this->mpGLViewport->updateWidget();
164  }
165 }
std::string getKeyForRow(int row) const
void updateWidget()
bool getValueForRow(int row) const
void removeItemInAnimation(std::string s)
CQGLViewport * mpGLViewport
void addItemInAnimation(std::string s)
bool isCircleMode() const
CQCurrentValueTable * mpValTable
void CQLayoutMainWindow::pauseAnimation ( )
privateslot

Definition at line 543 of file CQLayoutMainWindow.cpp.

References CQGLViewport::getPainter(), CVisParameters::mAnimationRunning, mpGLViewport, mpParaPanel, mpTimeSlider, mpVisParameters, and CQGLNetworkPainter::pauseAnimation().

Referenced by backwardAnimation(), CQLayoutMainWindow(), forwardAnimation(), stepBackwardAnimation(), and stepForwardAnimation().

544 {
545  // tell the painter that the anmation is paused
547  this->mpVisParameters->mAnimationRunning = false;
548  this->mpTimeSlider->setEnabled(true);
549  mpParaPanel->enableParameterChoice();
550  mpParaPanel->enableStepNumberChoice();
551 }
CQParaPanel * mpParaPanel
CVisParameters * mpVisParameters
const CQGLNetworkPainter * getPainter() const
CQGLViewport * mpGLViewport
void CQLayoutMainWindow::removeItemInAnimation ( std::string  s)

Definition at line 417 of file CQLayoutMainWindow.cpp.

References CQGLViewport::getPainter(), mpGLViewport, and CQGLNetworkPainter::setItemAnimated().

Referenced by parameterTableValueChanged(), and CQCurrentValueTable::setAllBoxesChecked().

418 {
419  mpGLViewport->getPainter()->setItemAnimated(key, false);
420 }
const CQGLNetworkPainter * getPainter() const
CQGLViewport * mpGLViewport
void setItemAnimated(std::string key, bool animatedP)
void CQLayoutMainWindow::saveImage ( )
slot

Definition at line 450 of file CQLayoutMainWindow.cpp.

References CQScreenshotOptionsDialog::ALL_FRAMES, CQGLNetworkPainter::export_bitmap(), CQGLNetworkPainter::getCurrentPositionX(), CQGLNetworkPainter::getCurrentPositionY(), CQGLNetworkPainter::getCurrentStep(), CQScreenshotOptionsDialog::getFrameOption(), CQScreenshotOptionsDialog::getFrameSet(), CQGLNetworkPainter::getGraphMax(), CQGLNetworkPainter::getGraphMin(), CQScreenshotOptionsDialog::getHeight(), CQScreenshotOptionsDialog::getImageHeight(), CQScreenshotOptionsDialog::getImageWidth(), CQGLNetworkPainter::getNumberOfSteps(), CQGLViewport::getPainter(), CopasiFileDialog::getSaveFileName(), CQScreenshotOptionsDialog::getWidth(), CLPoint::getX(), CQScreenshotOptionsDialog::getX(), CLPoint::getY(), CQScreenshotOptionsDialog::getY(), CQGLNetworkPainter::getZoomFactor(), mpGLViewport, CQScreenshotOptionsDialog::USER_DEFINED_FRAMES, and CQMessageBox::warning().

451 {
452 #ifdef DEBUG_UI
453 // qDebug() << "mCurrentPlace = " << mCurrentPlace;
454 #endif
455 
456  // get the parameters
457  CQGLNetworkPainter* pPainter = this->mpGLViewport->getPainter();
458  assert(pPainter != NULL);
459 
460  if (pPainter != NULL)
461  {
462  size_t step = pPainter->getCurrentStep();
463  size_t lastFrame = pPainter->getNumberOfSteps();
464  double x = pPainter->getCurrentPositionX();
465  double y = pPainter->getCurrentPositionY();
466  double layoutX = pPainter->getGraphMin().getX();
467  double layoutY = pPainter->getGraphMin().getY();
468  double layoutWidth = pPainter->getGraphMax().getX() - layoutX;
469  double layoutHeight = pPainter->getGraphMax().getY() - layoutY;
470  unsigned int imageWidth = pPainter->width();
471  unsigned int imageHeight = pPainter->height();
472  double zoomFactor = pPainter->getZoomFactor();
473  double width = (double)imageWidth / zoomFactor;
474  double height = (double)imageHeight / zoomFactor;
475  // use more sophisticated dialog
476  CQScreenshotOptionsDialog* pDialog = new CQScreenshotOptionsDialog(layoutX, layoutY, layoutWidth, layoutHeight,
477  x, y, width, height, pPainter->width() , pPainter->height(), lastFrame, this);
478 
479  if (pDialog->exec() == QDialog::Accepted)
480  {
481  // ask for the filename
482  // TODO use a nicer default filename
483  QString fileName = CopasiFileDialog::getSaveFileName(this, "Save Image Dialog", QString("untitled.png"), QString("PNG (*.png);;All files (*)"), QString("Choose a filename to save the image(s) under"));
484 
485  if (!fileName.isEmpty() && !fileName.isNull())
486  {
487  // get the frames
488  std::vector<size_t> v;
489 
490  switch (pDialog->getFrameOption())
491  {
493 
494  // add all frames from 1 to lastFrame
495  if (lastFrame != 0)
496  {
497  for (size_t i = 1; i <= lastFrame; ++i)
498  {
499  v.push_back(i);
500  }
501  }
502  else
503  {
504  v.push_back(step);
505  }
506 
507  break;
508 
510  v.insert(v.begin(), pDialog->getFrameSet().begin(), pDialog->getFrameSet().end());
511 
512  if (v.empty())
513  {
514  CQMessageBox::warning(this, "No frames selected",
515  "The frame selection was invalid.\nExporting current frame.",
516  QMessageBox::Ok, QMessageBox::Ok);
517  v.push_back(step);
518  }
519 
520  break;
521 
522  default:
523  v.push_back(step);
524  break;
525  }
526 
527  bool result = pPainter->export_bitmap(pDialog->getX(), pDialog->getY(), pDialog->getWidth(), pDialog->getHeight(), pDialog->getImageWidth(), pDialog->getImageHeight(), fileName, v);
528 
529  if (result == false)
530  {
531  CQMessageBox::warning(this, "Error creating image",
532  "The image could not be created.",
533  QMessageBox::Ok, QMessageBox::Ok);
534  return;
535  }
536  }
537  }
538 
539  delete pDialog;
540  }
541 }
const CQGLNetworkPainter * getPainter() const
size_t getCurrentStep() const
static StandardButton warning(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
const C_FLOAT64 & getX() const
Definition: CLBase.h:83
size_t getNumberOfSteps() const
CQGLViewport * mpGLViewport
C_FLOAT64 getCurrentPositionY() const
const C_FLOAT64 & getY() const
Definition: CLBase.h:84
bool export_bitmap(double x, double y, double width, double height, unsigned int imageWidth, unsigned int imageHeight, const QString &filename, const std::vector< size_t > frames)
const CLPoint & getGraphMax()
C_FLOAT64 getCurrentPositionX() const
C_FLOAT64 getZoomFactor() const
const CLPoint & getGraphMin()
static QString getSaveFileName(QWidget *parent=0, const char *name=0, const QString &startWith=QString::null, const QString &filter=QString::null, const QString &caption=QString::null, QString *pSelectedFilter=NULL, QFileDialog::Options options=0)
const std::set< size_t > & getFrameSet() const
void CQLayoutMainWindow::setAnimationRunning ( bool  animationRunningP)

Definition at line 177 of file CQLayoutMainWindow.cpp.

References CVisParameters::mAnimationRunning, and mpVisParameters.

Referenced by CQGLNetworkPainter::runAnimation().

178 {
179  if (mpVisParameters != NULL)
180  {
181  mpVisParameters->mAnimationRunning = animationRunningP;
182  }
183 }
CVisParameters * mpVisParameters
void CQLayoutMainWindow::setColorMode ( )

Definition at line 607 of file CQLayoutMainWindow.cpp.

References CVisParameters::COLOR_MODE, getMaxNodeSize(), getMinNodeSize(), CQGLViewport::getPainter(), CVisParameters::mMappingMode, mpGLViewport, mpTimeSlider, mpVisParameters, CVisParameters::mScalingMode, CQGLNetworkPainter::rescaleDataSetsWithNewMinMax(), and showStep().

608 {
610  mpGLViewport->getPainter()->rescaleDataSetsWithNewMinMax(getMinNodeSize(), getMaxNodeSize(), 0.0, 1.0, mpVisParameters->mScalingMode); // rescaling, because min and max node size changed (interpretation as color value takes place elsewhere),only [0.240] of possible HSV values (not fill circle in order to get good color range)
611  showStep(this->mpTimeSlider->value());
612 }
MAPPING_MODE mMappingMode
SCALING_MODE mScalingMode
CVisParameters * mpVisParameters
const CQGLNetworkPainter * getPainter() const
CQGLViewport * mpGLViewport
void rescaleDataSetsWithNewMinMax(C_FLOAT64 oldMin, C_FLOAT64 oldMax, C_FLOAT64 newMin, C_FLOAT64 newMax, CVisParameters::SCALING_MODE scaleMode)
void CQLayoutMainWindow::setFontSizeForLabels ( C_INT32  size)

Definition at line 643 of file CQLayoutMainWindow.cpp.

References CQGLViewport::getPainter(), mpGLViewport, and CQGLNetworkPainter::setFontSizeForLabels().

Referenced by FontChooser::changeFontSize().

644 {
645  mpGLViewport->getPainter()->setFontSizeForLabels((unsigned int) size);
646 }
const CQGLNetworkPainter * getPainter() const
CQGLViewport * mpGLViewport
void setFontSizeForLabels(unsigned int fs)
void CQLayoutMainWindow::setGlobalScaling ( )
void CQLayoutMainWindow::setIndividualScaling ( )
void CQLayoutMainWindow::setLayout ( CLayout pLayout)

Definition at line 768 of file CQLayoutMainWindow.cpp.

References CQGLViewport::createGraph(), loadData(), mpGLViewport, and mpLayout.

Referenced by CQNewMainWindow::switchMode(), and CQNewMainWindow::updateRenderer().

769 {
770  if (this->mpLayout == pLayout) return;
771 
772  this->mpLayout = pLayout;
773 
774  if (this->mpLayout != NULL)
775  {
776  this->mpGLViewport->createGraph(this->mpLayout); // create local data structures
777  this->loadData();
778  }
779 
780  this->update();
781 }
void createGraph(CLayout *lP)
CQGLViewport * mpGLViewport
void CQLayoutMainWindow::setMaxNodeSize ( C_FLOAT64  minNdSize)

Definition at line 216 of file CQLayoutMainWindow.cpp.

References CVisParameters::mMaxNodeSize, and mpVisParameters.

Referenced by setMaxValue(), setMinAndMaxValue(), and CQGLNetworkPainter::zoom().

217 {
218  if (mpVisParameters != NULL)
219  mpVisParameters->mMaxNodeSize = maxNdSize;
220 }
CVisParameters * mpVisParameters
void CQLayoutMainWindow::setMaxValue ( C_INT32  maxNdSize)

Definition at line 628 of file CQLayoutMainWindow.cpp.

References getMaxNodeSize(), getMinNodeSize(), CQGLViewport::getPainter(), mpGLViewport, mpTimeSlider, mpVisParameters, CVisParameters::mScalingMode, CQGLNetworkPainter::rescaleDataSetsWithNewMinMax(), setMaxNodeSize(), and showStep().

Referenced by NodeSizePanel::setMaxValue().

629 {
631  setMaxNodeSize(maxNdSize);
632  showStep(this->mpTimeSlider->value());
633 }
void setMaxNodeSize(C_FLOAT64 minNdSize)
SCALING_MODE mScalingMode
CVisParameters * mpVisParameters
const CQGLNetworkPainter * getPainter() const
CQGLViewport * mpGLViewport
void rescaleDataSetsWithNewMinMax(C_FLOAT64 oldMin, C_FLOAT64 oldMax, C_FLOAT64 newMin, C_FLOAT64 newMax, CVisParameters::SCALING_MODE scaleMode)
void CQLayoutMainWindow::setMinAndMaxValue ( C_INT32  minNdSize,
C_INT32  maxNdSize 
)

Definition at line 635 of file CQLayoutMainWindow.cpp.

References getMaxNodeSize(), getMinNodeSize(), CQGLViewport::getPainter(), mpGLViewport, mpTimeSlider, mpVisParameters, CVisParameters::mScalingMode, CQGLNetworkPainter::rescaleDataSetsWithNewMinMax(), setMaxNodeSize(), setMinNodeSize(), and showStep().

Referenced by NodeSizePanel::setMinAndMaxValues().

636 {
638  setMinNodeSize(minNdSize);
639  setMaxNodeSize(maxNdSize);
640  showStep(this->mpTimeSlider->value());
641 }
void setMaxNodeSize(C_FLOAT64 minNdSize)
SCALING_MODE mScalingMode
CVisParameters * mpVisParameters
const CQGLNetworkPainter * getPainter() const
CQGLViewport * mpGLViewport
void setMinNodeSize(C_FLOAT64 minNdSize)
void rescaleDataSetsWithNewMinMax(C_FLOAT64 oldMin, C_FLOAT64 oldMax, C_FLOAT64 newMin, C_FLOAT64 newMax, CVisParameters::SCALING_MODE scaleMode)
void CQLayoutMainWindow::setMinNodeSize ( C_FLOAT64  minNdSize)

Definition at line 210 of file CQLayoutMainWindow.cpp.

References CVisParameters::mMinNodeSize, and mpVisParameters.

Referenced by setMinAndMaxValue(), setMinValue(), and CQGLNetworkPainter::zoom().

211 {
212  if (mpVisParameters != NULL)
213  mpVisParameters->mMinNodeSize = minNdSize;
214 }
CVisParameters * mpVisParameters
void CQLayoutMainWindow::setMinValue ( C_INT32  minNdSize)

Definition at line 620 of file CQLayoutMainWindow.cpp.

References getMaxNodeSize(), getMinNodeSize(), CQGLViewport::getPainter(), mpGLViewport, mpTimeSlider, mpVisParameters, CVisParameters::mScalingMode, CQGLNetworkPainter::rescaleDataSetsWithNewMinMax(), setMinNodeSize(), and showStep().

Referenced by NodeSizePanel::setMinValue().

621 {
623  setMinNodeSize(minNdSize);
624  showStep(this->mpTimeSlider->value());
625 }
SCALING_MODE mScalingMode
CVisParameters * mpVisParameters
const CQGLNetworkPainter * getPainter() const
CQGLViewport * mpGLViewport
void setMinNodeSize(C_FLOAT64 minNdSize)
void rescaleDataSetsWithNewMinMax(C_FLOAT64 oldMin, C_FLOAT64 oldMax, C_FLOAT64 newMin, C_FLOAT64 newMax, CVisParameters::SCALING_MODE scaleMode)
void CQLayoutMainWindow::setSizeMode ( )

Definition at line 600 of file CQLayoutMainWindow.cpp.

References getMaxNodeSize(), getMinNodeSize(), CQGLViewport::getPainter(), CVisParameters::mMappingMode, mpGLViewport, mpTimeSlider, mpVisParameters, CVisParameters::mScalingMode, CQGLNetworkPainter::rescaleDataSetsWithNewMinMax(), showStep(), and CVisParameters::SIZE_DIAMETER_MODE.

601 {
603  mpGLViewport->getPainter()->rescaleDataSetsWithNewMinMax(0.0, 1.0, getMinNodeSize(), getMaxNodeSize(), mpVisParameters->mScalingMode); // only [0.240] of possible HSV values (not fill circle in order to get good color range)
604  showStep(this->mpTimeSlider->value());
605 }
MAPPING_MODE mMappingMode
SCALING_MODE mScalingMode
CVisParameters * mpVisParameters
const CQGLNetworkPainter * getPainter() const
CQGLViewport * mpGLViewport
void rescaleDataSetsWithNewMinMax(C_FLOAT64 oldMin, C_FLOAT64 oldMax, C_FLOAT64 newMin, C_FLOAT64 newMax, CVisParameters::SCALING_MODE scaleMode)
void CQLayoutMainWindow::setStepsPerSecond ( C_INT16  val)

Definition at line 237 of file CQLayoutMainWindow.cpp.

References mpVisParameters, and CVisParameters::mStepsPerSecond.

238 {
239  if (mpVisParameters != NULL)
240  {
242  }
243 }
CVisParameters * mpVisParameters
void CQLayoutMainWindow::setValueOnSlider ( C_INT32  val)

Definition at line 614 of file CQLayoutMainWindow.cpp.

References mpTimeSlider.

615 {
616  mpTimeSlider->setValue(val);
617 }
void CQLayoutMainWindow::setZoomFactor ( QString  s)

Definition at line 759 of file CQLayoutMainWindow.cpp.

Referenced by CQNewMainWindow::slotFitToScreen(), CQNewMainWindow::slotZoomChanged(), and CQNewMainWindow::slotZoomMenuItemActivated().

760 {
761  s.remove(s.size() - 1, 1);
762  // create a number from the text
763  double n = s.toDouble();
764  n /= 100.0;
765  this->setZoomFactor(n);
766 }
void setZoomFactor(QString s)
void CQLayoutMainWindow::setZoomFactor ( double  zoom)

Definition at line 754 of file CQLayoutMainWindow.cpp.

References mpGLViewport, and CQGLViewport::setZoomFactor().

755 {
756  this->mpGLViewport->setZoomFactor(zoom);
757 }
void setZoomFactor(double zoom)
CQGLViewport * mpGLViewport
void CQLayoutMainWindow::showAnimation ( )
privateslot

Definition at line 422 of file CQLayoutMainWindow.cpp.

References startAnimation().

423 {
424  startAnimation();
425 }
void CQLayoutMainWindow::showStep ( int  i)
privateslot

Definition at line 565 of file CQLayoutMainWindow.cpp.

References CQGLNetworkPainter::getDataSetAt(), CQGLViewport::getPainter(), mpControlWidget, mpGLViewport, mpParaPanel, CQPlayerControlWidget::setCurrentStep(), CQGLNetworkPainter::showStep(), and updateValueTable().

Referenced by backwardAnimation(), CQLayoutMainWindow(), forwardAnimation(), loadData(), mapLabelsToCircles(), setColorMode(), setGlobalScaling(), setIndividualScaling(), setMaxValue(), setMinAndMaxValue(), setMinValue(), setSizeMode(), stepBackwardAnimation(), and stepForwardAnimation().

566 {
567  this->mpControlWidget->setCurrentStep(static_cast<int>(i));
568  mpGLViewport->getPainter()->showStep(static_cast<int>(i));
569  mpGLViewport->getPainter()->updateGL();
570  mpParaPanel->setStepNumber(static_cast<int>(i));
571  CDataEntity* srcData = mpGLViewport->getPainter()->getDataSetAt(static_cast<int>(i));
572 
573  if (srcData)
574  {
575  updateValueTable(*srcData);
576  }
577 }
CQParaPanel * mpParaPanel
const CQGLNetworkPainter * getPainter() const
CDataEntity * getDataSetAt(size_t stepNumber)
void setCurrentStep(size_t currentStep)
CQGLViewport * mpGLViewport
CQPlayerControlWidget * mpControlWidget
void updateValueTable(CDataEntity dataSet)
double CQLayoutMainWindow::slotFitToScreen ( )
slot

Make the layout fit the screen.

Make the layout fit the screen. Return the new zoom factor.

Definition at line 743 of file CQLayoutMainWindow.cpp.

References CQGLViewport::fitToScreen(), and mpGLViewport.

Referenced by CQNewMainWindow::slotFitToScreen().

744 {
745  double zoom = this->mpGLViewport->fitToScreen();
746  return zoom;
747 }
double fitToScreen()
CQGLViewport * mpGLViewport
void CQLayoutMainWindow::slotLoopActivated ( bool  checked)
slot

Definition at line 906 of file CQLayoutMainWindow.cpp.

References mLooping.

907 {
908  this->mLooping = checked;
909 }
void CQLayoutMainWindow::slotParameterTableToggled ( bool  checked)
slot

Definition at line 866 of file CQLayoutMainWindow.cpp.

References mpInfoBox, mpParaPanel, and mpValueTableAction.

867 {
868  (checked == true) ? this->mpParaPanel->show() : this->mpParaPanel->hide();
869 
870  // if all object in the info box are hidden, we hide the info box
871  if (!checked && !this->mpValueTableAction->isChecked())
872  {
873  this->mpInfoBox->hide();
874  }
875  else
876  {
877  this->mpInfoBox->show();
878  }
879 }
CQParaPanel * mpParaPanel
void CQLayoutMainWindow::slotPlayerControlToggled ( bool  checked)
slot

Definition at line 901 of file CQLayoutMainWindow.cpp.

References mpFrame.

902 {
903  (checked == true) ? this->mpFrame->show() : this->mpFrame->hide();
904 }
void CQLayoutMainWindow::slotResetView ( )
slot

Definition at line 749 of file CQLayoutMainWindow.cpp.

References mpGLViewport, and CQGLViewport::resetView().

Referenced by CQNewMainWindow::slotResetView().

750 {
751  this->mpGLViewport->resetView();
752 }
CQGLViewport * mpGLViewport
void CQLayoutMainWindow::slotToolbarToggled ( bool  checked)
slot

Definition at line 896 of file CQLayoutMainWindow.cpp.

References mpToolbar.

897 {
898  (checked == true) ? this->mpToolbar->show() : this->mpToolbar->hide();
899 }
void CQLayoutMainWindow::slotValueTableToggled ( bool  checked)
slot

Definition at line 881 of file CQLayoutMainWindow.cpp.

References mpInfoBox, mpParameterTableAction, and mpValTable.

882 {
883  (checked == true) ? this->mpValTable->show() : this->mpValTable->hide();
884 
885  // if all object in the info box are hidden, we hide the info box
886  if (!checked && !this->mpParameterTableAction->isChecked())
887  {
888  this->mpInfoBox->hide();
889  }
890  else
891  {
892  this->mpInfoBox->show();
893  }
894 }
QAction * mpParameterTableAction
CQCurrentValueTable * mpValTable
void CQLayoutMainWindow::startAnimation ( )
privateslot

Definition at line 427 of file CQLayoutMainWindow.cpp.

References CQGLNetworkPainter::getNumberOfSteps(), CQGLViewport::getPainter(), loadData(), CVisParameters::mAnimationRunning, mDataPresent, mpControlWidget, mpGLViewport, mpParaPanel, mpTimeSlider, mpVisParameters, CQGLNetworkPainter::runAnimation(), CQPlayerControlWidget::setNumSteps(), and CQMessageBox::warning().

Referenced by backwardAnimation(), CQLayoutMainWindow(), and showAnimation().

428 {
429  if (!this->mDataPresent)
430  this->loadData(); // look for data
431 
432  if (this->mDataPresent)
433  {
434  // only if time series data present
435  this->mpVisParameters->mAnimationRunning = true;
436  this->mpTimeSlider->setEnabled(false);
439  this->mpParaPanel->disableParameterChoice();
440  this->mpParaPanel->disableStepNumberChoice();
441  }
442  else
443  {
444  CQMessageBox::warning(this, "Missing Data",
445  "No data found: \nYou first have to create a time course.",
446  QMessageBox::Ok, QMessageBox::Ok);
447  }
448 }
CQParaPanel * mpParaPanel
void setNumSteps(size_t numSteps)
CVisParameters * mpVisParameters
const CQGLNetworkPainter * getPainter() const
static StandardButton warning(QWidget *parent, const QString &title, const QString &text, StandardButtons buttons=Ok, StandardButton defaultButton=NoButton)
size_t getNumberOfSteps() const
CQGLViewport * mpGLViewport
CQPlayerControlWidget * mpControlWidget
void CQLayoutMainWindow::stepBackwardAnimation ( )
privateslot

Definition at line 849 of file CQLayoutMainWindow.cpp.

References getCurrentStep(), mpTimeSlider, pauseAnimation(), and showStep().

Referenced by CQLayoutMainWindow().

850 {
851  // lower step by one if possible and redisplay
852  size_t currentStep = this->getCurrentStep();
853 
854  if (currentStep > 0)
855  {
856  --currentStep;
857  this->pauseAnimation();
858  this->showStep((double)currentStep);
859  // update the slider
860  disconnect(mpTimeSlider, SIGNAL(valueChanged(double)), this, SLOT(showStep(double)));
861  this->mpTimeSlider->setValue((double)currentStep);
862  connect(mpTimeSlider, SIGNAL(valueChanged(double)), this, SLOT(showStep(double)));
863  }
864 }
void CQLayoutMainWindow::stepForwardAnimation ( )
privateslot

Definition at line 831 of file CQLayoutMainWindow.cpp.

References getCurrentStep(), CQGLNetworkPainter::getNumberOfSteps(), CQGLViewport::getPainter(), mpGLViewport, mpTimeSlider, pauseAnimation(), and showStep().

Referenced by CQLayoutMainWindow().

832 {
833  // raise step by one if possible and continue animation
834  // go to last step and redisplay
835  size_t currentStep = this->getCurrentStep();
836  ++currentStep;
837 
838  if (currentStep < this->mpGLViewport->getPainter()->getNumberOfSteps())
839  {
840  this->pauseAnimation();
841  this->showStep((double)currentStep);
842  // update the slider
843  disconnect(mpTimeSlider, SIGNAL(valueChanged(double)), this, SLOT(showStep(double)));
844  this->mpTimeSlider->setValue((double)currentStep);
845  connect(mpTimeSlider, SIGNAL(valueChanged(double)), this, SLOT(showStep(double)));
846  }
847 }
const CQGLNetworkPainter * getPainter() const
size_t getNumberOfSteps() const
CQGLViewport * mpGLViewport
void CQLayoutMainWindow::stopAnimation ( )
privateslot

Definition at line 788 of file CQLayoutMainWindow.cpp.

References backwardAnimation(), and mapLabelsToRectangles().

Referenced by CQLayoutMainWindow().

789 {
790  // go to step 0 and stop
791  this->backwardAnimation();
792  this->mapLabelsToRectangles();
793 }
void CQLayoutMainWindow::updateValueTable ( CDataEntity  dataSet)

Definition at line 387 of file CQLayoutMainWindow.cpp.

References C_FLOAT64, CQGLNetworkPainter::getNameForNodeKey(), CQGLNetworkPainter::getNodeNameEntry(), CDataEntity::getOrigValueForSpecies(), CQGLViewport::getPainter(), mpGLViewport, mpValTable, CQCurrentValueTable::numRows(), parameterTableValueChanged(), and CQCurrentValueTable::updateRowInTable().

Referenced by showStep().

388 {
389  int i = 0;
390  std::string key, name;
391  C_FLOAT64 val;
392  disconnect(this->mpValTable , SIGNAL(valueChanged(int)), this, SLOT(parameterTableValueChanged(int)));
393 
394  while ((key = mpGLViewport->getPainter()->getNodeNameEntry(i)) != "")
395  {
396  name = mpGLViewport->getPainter()->getNameForNodeKey(key);
397  val = dataSet.getOrigValueForSpecies(key); // would be (- std::numeric_limits< C_FLOAT64 >::max()) if key not present
398 
399  if (mpValTable->numRows() > i)
400  {
401  mpValTable->updateRowInTable(i, val);
402  }
403 
404  i++;
405  }
406 
407  connect(this->mpValTable , SIGNAL(valueChanged(int)), this, SLOT(parameterTableValueChanged(int)));
408 }
C_FLOAT64 getOrigValueForSpecies(std::string nodeKey)
Definition: CDataEntity.cpp:70
const CQGLNetworkPainter * getPainter() const
CQGLViewport * mpGLViewport
std::string getNameForNodeKey(std::string key)
#define C_FLOAT64
Definition: copasi.h:92
void parameterTableValueChanged(int row)
std::string getNodeNameEntry(int i)
CQCurrentValueTable * mpValTable
void updateRowInTable(int row, C_FLOAT64 val)

Member Data Documentation

QString CQLayoutMainWindow::mCurrentPlace
private

Definition at line 169 of file CQLayoutMainWindow.h.

bool CQLayoutMainWindow::mDataPresent
private

Definition at line 168 of file CQLayoutMainWindow.h.

Referenced by loadData(), and startAnimation().

bool CQLayoutMainWindow::mLooping
private
QAction* CQLayoutMainWindow::mpCircularShape
private

Definition at line 150 of file CQLayoutMainWindow.h.

QAction* CQLayoutMainWindow::mpCloseAction
private

Definition at line 148 of file CQLayoutMainWindow.h.

CQPlayerControlWidget* CQLayoutMainWindow::mpControlWidget
private
QAction* CQLayoutMainWindow::mpCreatePicture
private

Definition at line 146 of file CQLayoutMainWindow.h.

QMenu* CQLayoutMainWindow::mpFileMenu
private

Definition at line 139 of file CQLayoutMainWindow.h.

QFrame* CQLayoutMainWindow::mpFrame
private

Definition at line 162 of file CQLayoutMainWindow.h.

Referenced by CQLayoutMainWindow(), and slotPlayerControlToggled().

CQGLViewport* CQLayoutMainWindow::mpGLViewport
private
QFrame* CQLayoutMainWindow::mpInfoBox
private
QMenu* CQLayoutMainWindow::mpLabelShapeMenu
private

Definition at line 141 of file CQLayoutMainWindow.h.

CLayout* CQLayoutMainWindow::mpLayout
private

Definition at line 177 of file CQLayoutMainWindow.h.

Referenced by CQLayoutMainWindow(), and setLayout().

QAction* CQLayoutMainWindow::mpLoadDataAction
private

Definition at line 153 of file CQLayoutMainWindow.h.

QAction* CQLayoutMainWindow::mpLoopItemAction
private

Definition at line 173 of file CQLayoutMainWindow.h.

QFrame* CQLayoutMainWindow::mpMainBox
private

Definition at line 157 of file CQLayoutMainWindow.h.

Referenced by CQLayoutMainWindow().

QAction* CQLayoutMainWindow::mpMimaNodeSizes
private

Definition at line 151 of file CQLayoutMainWindow.h.

QAction* CQLayoutMainWindow::mpOpenSBMLFile
private

Definition at line 147 of file CQLayoutMainWindow.h.

QMenu* CQLayoutMainWindow::mpOptionsMenu
private

Definition at line 140 of file CQLayoutMainWindow.h.

QAction* CQLayoutMainWindow::mpParameterTableAction
private

Definition at line 175 of file CQLayoutMainWindow.h.

Referenced by slotValueTableToggled().

CQParaPanel* CQLayoutMainWindow::mpParaPanel
private
QMenu* CQLayoutMainWindow::mpPlayMenu
private

Definition at line 144 of file CQLayoutMainWindow.h.

QAction* CQLayoutMainWindow::mpRectangularShape
private

Definition at line 149 of file CQLayoutMainWindow.h.

QAction* CQLayoutMainWindow::mpSFontSize
private

Definition at line 152 of file CQLayoutMainWindow.h.

QSplitter* CQLayoutMainWindow::mpSplitter
private

Definition at line 158 of file CQLayoutMainWindow.h.

Referenced by CQLayoutMainWindow(), and loadSBMLFile().

QSlider* CQLayoutMainWindow::mpTimeSlider
private
QToolBar* CQLayoutMainWindow::mpToolbar
private

Definition at line 170 of file CQLayoutMainWindow.h.

Referenced by CQLayoutMainWindow(), and slotToolbarToggled().

CQCurrentValueTable* CQLayoutMainWindow::mpValTable
private
QAction* CQLayoutMainWindow::mpValueTableAction
private

Definition at line 174 of file CQLayoutMainWindow.h.

Referenced by slotParameterTableToggled().

QMenu* CQLayoutMainWindow::mpViewMenu
private

Definition at line 142 of file CQLayoutMainWindow.h.

CVisParameters* CQLayoutMainWindow::mpVisParameters
private
QActionGroup* CQLayoutMainWindow::mpZoomActionGroup
private

Definition at line 176 of file CQLayoutMainWindow.h.

QComboBox* CQLayoutMainWindow::mpZoomComboBox
private

Definition at line 171 of file CQLayoutMainWindow.h.

QMenu* CQLayoutMainWindow::mpZoomMenu
private

Definition at line 143 of file CQLayoutMainWindow.h.

const char *const CQLayoutMainWindow::ZOOM_FACTOR_STRINGS = {"1%", "2%", "3%", "4%", "5%", "10%", "20%", "25%", "30%", "40%", "50%", "75%", "100%", "150%", "200%", "300%", "400%", "500%", "1000%"}
static

Definition at line 86 of file CQLayoutMainWindow.h.

const double CQLayoutMainWindow::ZOOM_FACTORS = {0.01, 0.02, 0.03, 0.04, 0.05, 0.1, 0.2, 0.25, 0.3, 0.4, 0.5, 0.75, 1.0, 1.5, 2.0, 3.0, 4.0, 5.0, 10.0}
static

Definition at line 87 of file CQLayoutMainWindow.h.


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