Example #1
0
Plot::Plot( QWidget *parent ):
    QwtPlot( parent)
{
    setAutoReplot( false );

    setTitle( "Animated Curves" );

    // hide all axes
    for ( int axis = 0; axis < QwtPlot::axisCnt; axis++ )
        enableAxis( axis, false );

    plotLayout()->setCanvasMargin( 10 );

    d_curves[0] = new Curve1();
    d_curves[1] = new Curve2();
    d_curves[2] = new Curve3();
    d_curves[3] = new Curve4();

    updateCurves();

    for ( int i = 0; i < CurveCount; i++ )
        d_curves[i]->attach( this );

    d_time.start();
    ( void )startTimer( 40 );
}
Example #2
0
void C2M::buildRings(){

	_rings.clear();
	updateCurves();
	for (list<Curve*>::iterator it = _spines.begin(); it != _spines.end(); it++)
		buildRings(*it);
}
Example #3
0
void C2M::buildRings(){

	_rings.clear();
	updateCurves();
	for (list<CurvePtr>::iterator it = _spines.begin(); it != _spines.end(); it++)
		buildRings(*it);
	cout<<"bokye...."<<_rings.size()<<endl;
}
Example #4
0
AssociationsDialog::AssociationsDialog(Graph *g, Qt::WFlags fl)
    : QDialog(g, fl) {
  setObjectName("AssociationsDialog");
  setWindowTitle(tr("MantidPlot - Plot Associations"));
  setModal(true);
  setSizeGripEnabled(true);
  setFocus();

  QVBoxLayout *vl = new QVBoxLayout();

  QHBoxLayout *hbox1 = new QHBoxLayout();
  hbox1->addWidget(new QLabel(tr("Spreadsheet: ")));

  tableCaptionLabel = new QLabel();
  hbox1->addWidget(tableCaptionLabel);
  vl->addLayout(hbox1);

  table = new QTableWidget(3, 5);
  table->horizontalHeader()->setClickable(false);
  table->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
  table->verticalHeader()->hide();
  table->verticalHeader()->setResizeMode(QHeaderView::ResizeToContents);
  table->setMaximumHeight(8 * table->rowHeight(0));
  table->setHorizontalHeaderLabels(
      {tr("Column"), tr("X"), tr("Y"), tr("xErr"), tr("yErr")});
  vl->addWidget(table);

  connect(table, SIGNAL(itemClicked(QTableWidgetItem *)), this,
          SLOT(processStateChange(QTableWidgetItem *)));

  associations = new QListWidget();
  associations->setSelectionMode(QListWidget::SingleSelection);
  vl->addWidget(associations);

  btnApply = new QPushButton(tr("&Update curves"));
  btnOK = new QPushButton(tr("&OK"));
  btnOK->setDefault(true);
  btnCancel = new QPushButton(tr("&Cancel"));

  QHBoxLayout *hbox2 = new QHBoxLayout();
  hbox2->addStretch();
  hbox2->addWidget(btnApply);
  hbox2->addWidget(btnOK);
  hbox2->addWidget(btnCancel);
  vl->addStretch();
  vl->addLayout(hbox2);
  setLayout(vl);

  active_table = 0;

  connect(associations, SIGNAL(currentRowChanged(int)), this,
          SLOT(updateTable(int)));
  connect(btnOK, SIGNAL(clicked()), this, SLOT(accept()));
  connect(btnCancel, SIGNAL(clicked()), this, SLOT(close()));
  connect(btnApply, SIGNAL(clicked()), this, SLOT(updateCurves()));

  setGraph(g);
}
void GraphicsScene::updateAfterCommand (CmdMediator &cmdMediator)
{
  LOG4CPP_INFO_S ((*mainCat)) << "GraphicsScene::updateAfterCommand";

  updateCurves (cmdMediator);

  // Update the points
  updatePointMembership (cmdMediator);
}
Example #6
0
void ABSymCurve::ABSymCurve::ABSymCurve::recalculate()
{
    pullCurrent();
    updateCurves();
    
    if (++cullCount > maxCache) {
        cullPast();
        cullCount = 0;
    }

    dataState = DIRTY;
}
Example #7
0
void GraphicsScene::updateAfterCommand (CmdMediator &cmdMediator,
                                        double highlightOpacity,
                                        GeometryWindow *geometryWindow)
{
  LOG4CPP_INFO_S ((*mainCat)) << "GraphicsScene::updateAfterCommand";

  m_graphicsLinesForCurves.updateHighlightOpacity (highlightOpacity);

  updateCurves (cmdMediator);

  // Update the points
  updatePointMembership (cmdMediator,
                         geometryWindow);
}
Example #8
0
// virtual
void CopasiPlot::replot()
{
  if (mNextPlotTime < CCopasiTimeVariable::getCurrentWallTime())
    {
      CCopasiTimeVariable Delta = CCopasiTimeVariable::getCurrentWallTime();

      {
        QMutexLocker Locker(&mMutex);
        updateCurves(C_INVALID_INDEX);
      }

      QwtPlot::replot();

      Delta = CCopasiTimeVariable::getCurrentWallTime() - Delta;
      mNextPlotTime = CCopasiTimeVariable::getCurrentWallTime() + 3 * Delta.getMicroSeconds();
    }

  mReplotFinished = true;
}
Example #9
0
void CopasiPlot::updateCurves(const size_t & activity)
{
  if (activity == C_INVALID_INDEX)
    {
      C_INT32 ItemActivity;

      for (ItemActivity = 0; ItemActivity < ActivitySize; ItemActivity++)
        updateCurves(ItemActivity);

      return;
    }

  size_t k = 0;
  C2DPlotCurve ** itCurves = mCurves.array();
  C2DPlotCurve ** endCurves = itCurves + mCurves.size();

  for (; itCurves != endCurves; ++itCurves, ++k)
    if ((size_t)(*itCurves)->getActivity() == activity)
      {
        (*itCurves)->setDataSize(mDataSize[activity]);
      }
}
Example #10
0
void Plot::timerEvent( QTimerEvent * )
{
    updateCurves();
    replot();
}
Example #11
0
void AssociationsDialog::accept()
{
	updateCurves();
	close();
}