Example #1
0
void KstQuickPSDDialogI::changeColor() {
  QColor c;
  c = curveColor();
  if ((int)KColorDialog::getColor(c) == (int)KColorDialog::Accepted ) {
    setCurveColor(c);
  }
  _curveAppearance->setColor(c);
}
Bspline::Bspline(Graph *_graph, Point_2D *_ctrlPoints, int _numberOfCtrlPoints, int _k, float *_knotValues)
:Curve(_graph, _ctrlPoints, _numberOfCtrlPoints)
{
  k = _k;
  knotValues = new float[_numberOfCtrlPoints + _k];// n+1+k
  memcpy(knotValues, _knotValues, sizeof(float)*(_numberOfCtrlPoints+_k));
  setCurveColor(COLOR_CRIMSON);
  knotValuesCap = _numberOfCtrlPoints +_k;
}
Example #3
0
void KstQuickPSDDialogI::update() {
  unsigned int i, j_v;
  KstRVectorPtr v0;
  int j;

  KstPSDCurveList curves = kstObjectSubList<KstDataObject,KstPSDCurve>(KST::dataObjectList);
  KST::vectorList.lock().readLock();
  j_v = KST::vectorList.count();
  if (j_v > 0) {
    SourceVector->setEnabled(true);
    j_v--;

    /* fill the vectors list */
    Vectors->clear();
    for (i = 0; i <= j_v; i++) {
      Vectors->insertItem(KST::vectorList[i]->tagName());
    }
    Vectors->setCurrentItem(j_v);

    /* update filename list */
    KST::dataSourceList.lock().readLock();
    j = KST::dataSourceList.count() - 1;
    if (j >= 0) {
      FileName->setURL(KST::dataSourceList[j]->fileName());
    }
    KST::dataSourceList.lock().readUnlock();

    /* clear the field entry */
    Field->clear();
  }
  KST::vectorList.lock().readUnlock();

  KstRVectorList rvl = kstObjectSubList<KstVector,KstRVector>(KST::vectorList);
  j_v = rvl.count();
  if (j_v > 0) {
    j_v--;
    /* set the file range defaults to those of the last RVector */
    v0 = rvl[j_v];

    CountFromEnd->setChecked(v0->countFromEOF());
    ReadToEnd->setChecked(v0->readToEOF());

    F0->setValue(v0->reqStartFrame());
    N->setValue(v0->reqNumFrames());
    Skip->setValue(v0->skip());
    DoSkip->setChecked(v0->doSkip());
    DoFilter->setChecked(v0->doAve());
  } else {
    SourceVector->setChecked(false);
    SourceVector->setEnabled(false);
    SourceDataFile->setChecked(true);
    VectorEntry->setEnabled(false);
    DataFileEntry->setEnabled(true);
  }

  /* Fill the plot list with options */
  PlotList->clear();
  if (KST::plotList.count()>0) {
    for (i = 0; i < KST::plotList.count(); i++) {
      PlotList->insertItem(KST::plotList.at(i)->tagName());
    }
    PlotList->setCurrentItem(0);
  }

  PlotCols->setValue(KST::plotList.getPlotCols());

  /* set the color*/
  _curveAppearance->setColor(KstColorSequence::next());
  setCurveColor( _curveAppearance->color() );
}