当前位置: 首页>>代码示例>>C++>>正文


C++ Kst2DPlotList::end方法代码示例

本文整理汇总了C++中Kst2DPlotList::end方法的典型用法代码示例。如果您正苦于以下问题:C++ Kst2DPlotList::end方法的具体用法?C++ Kst2DPlotList::end怎么用?C++ Kst2DPlotList::end使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Kst2DPlotList的用法示例。


在下文中一共展示了Kst2DPlotList::end方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setPlotAxes

bool KstIfaceImpl::setPlotAxes(const QString& plotName,
    int XLower,
    int XUpper,
    int YLower,
    int YUpper) {
  //find the plot
  KstApp *app = KstApp::inst();
  KMdiIterator<KMdiChildView*> *iter = app->createIterator();
  while (iter->currentItem()) {
    KMdiChildView *childview = iter->currentItem();
    KstViewWindow *viewwindow = dynamic_cast<KstViewWindow*>(childview);
    if (viewwindow) {
      Kst2DPlotList plotlist = viewwindow->view()->findChildrenType<Kst2DPlot>(false);
      Kst2DPlotList::Iterator plot_iter=plotlist.findTag(plotName);
      if (plot_iter != plotlist.end()) {
        app->deleteIterator(iter);
      
        (*plot_iter)->setXScaleMode(FIXED);
        (*plot_iter)->setYScaleMode(FIXED);
        (*plot_iter)->setScale(XLower, YLower,
                              XUpper, YUpper);  //set the scale
        
        // repaint the plot 
        (*plot_iter)->setDirty();
        viewwindow->view()->paint(KstPainter::P_PLOT);
        return true;
      }
    }
    iter->next();
  }
  app->deleteIterator(iter);
  return false;
}
开发者ID:,项目名称:,代码行数:33,代码来源:

示例2: cycleWindow

void KstCurveDifferentiateI::cycleWindow(KstViewWindow *window) {
  KstTopLevelViewPtr tlv = kst_cast<KstTopLevelView>(window->view());
  if (tlv) {         
    Kst2DPlotList plotList = tlv->findChildrenType<Kst2DPlot>(false);
    for (Kst2DPlotList::Iterator it = plotList.begin(); it != plotList.end(); ++it ) {
      if (_repeatAcross == 0) {
        _seqVect[0]->reset();
      }
      
      KstVCurveList vcurves = kstObjectSubList<KstBaseCurve,KstVCurve>((*it)->Curves);
      for (KstVCurveList::Iterator i = vcurves.begin(); i != vcurves.end(); ++i) {
        if (_lineColorOrder > -1) {
          (*i)->setColor(KstColorSequence::entry(_lineColorSeq.current()));
        }
        if (_pointStyleOrder > -1) {
          (*i)->Point.setType(_pointStyleSeq.current());
          (*i)->setHasPoints(true);
          (*i)->setPointDensity(_pointDensity);
        }
        if (_lineStyleOrder > -1) {
          (*i)->setLineStyle(_lineStyleSeq.current());
        }
        if (_lineWidthOrder > -1) {
          (*i)->setLineWidth(_lineWidthSeq.current());
        }

        (_seqVect[0])->next();        
      }
    }
  }
}
开发者ID:,项目名称:,代码行数:31,代码来源:

示例3: tiedZoom

bool KstTopLevelView::tiedZoom(bool x, double xmin, double xmax, bool y, double ymin, double ymax, const QString& plotName) {
  Kst2DPlotList pl = findChildrenType<Kst2DPlot>(true);
  bool repaint = false;
  for (Kst2DPlotList::Iterator i = pl.begin(); i != pl.end(); ++i) {
    Kst2DPlotPtr p = *i;
    if (p->isTied() && p->tagName() != plotName) {
      p->tiedZoom(x, xmin, xmax, y, ymin, ymax);
      repaint = true;
    }
  }
  return repaint;
}
开发者ID:,项目名称:,代码行数:12,代码来源:

示例4: tiedZoomMode

bool KstTopLevelView::tiedZoomMode(int zoom, bool flag, double center, int mode, int modeExtra, const QString& plotName) {
  Kst2DPlotList pl = findChildrenType<Kst2DPlot>(true);
  bool repaint = false;
  for (Kst2DPlotList::Iterator i = pl.begin(); i != pl.end(); ++i) {
    Kst2DPlotPtr p = *i;
    if (p->isTied() && p->tagName() != plotName) {
      p->tiedZoomMode((ZoomType)zoom, flag, center, (KstScaleModeType)mode, (KstScaleModeType)modeExtra);
      repaint = true;
    }
  }
  return repaint;
}
开发者ID:,项目名称:,代码行数:12,代码来源:

示例5: tiedZoomPrev

bool KstTopLevelView::tiedZoomPrev(const QString& plotName) {
  Kst2DPlotList pl = findChildrenType<Kst2DPlot>(true);
  bool repaint = false;
  for (Kst2DPlotList::Iterator i = pl.begin(); i != pl.end(); ++i) {
    Kst2DPlotPtr p = *i;
    if (p->isTied() && p->tagName() != plotName) {
      if (p->tiedZoomPrev(widget())) {
        repaint = true;
      }
    }
  }
  return repaint;
}
开发者ID:,项目名称:,代码行数:13,代码来源:

示例6: plotList

QStringList KstIfaceImpl::plotList(const QString& window) {
  QStringList rc;
  KstApp *app = KstApp::inst();
  KMdiChildView *c = app->findWindow(window);
  KstViewWindow *v = dynamic_cast<KstViewWindow*>(c);
  if (v) {
    Kst2DPlotList l = v->view()->findChildrenType<Kst2DPlot>(false);
    for (Kst2DPlotList::Iterator i = l.begin(); i != l.end(); ++i) {
      rc += (*i)->tagName();
    }
  }
  return rc;
}
开发者ID:,项目名称:,代码行数:13,代码来源:

示例7: plotContents

QStringList KstIfaceImpl::plotContents(const QString& name) {
  //iterate through the windows until plot is found
  KstApp *app = KstApp::inst();
  KMdiIterator<KMdiChildView*> *iter = app->createIterator();
  while (iter->currentItem()) {
    KMdiChildView *childview = iter->currentItem();
    KstViewWindow *viewwindow = dynamic_cast<KstViewWindow*>(childview);
    if (viewwindow) {
      Kst2DPlotList plotlist = viewwindow->view()->findChildrenType<Kst2DPlot>(false);
      Kst2DPlotList::Iterator plot_iter=plotlist.findTag(name);
      if (plot_iter != plotlist.end()) {
        app->deleteIterator(iter);
        return (*plot_iter)->Curves.tagNames();
      }
    }
    iter->next();
  }
  app->deleteIterator(iter);
  return QStringList();
}
开发者ID:,项目名称:,代码行数:20,代码来源:

示例8: toggleMaximizePlot

bool KstIfaceImpl::toggleMaximizePlot(const QString& plotName) {
  KstApp *app = KstApp::inst();
  KMdiIterator<KMdiChildView*> *iter = app->createIterator();
  while (iter->currentItem()) {
    KMdiChildView *childview = iter->currentItem();
    KstViewWindow *viewwindow = dynamic_cast<KstViewWindow*>(childview);
    if (viewwindow) {
      Kst2DPlotList plotlist = viewwindow->view()->findChildrenType<Kst2DPlot>(false);
      Kst2DPlotList::Iterator plot_iter = plotlist.findTag(plotName);
      if (plot_iter != plotlist.end()) {
        app->deleteIterator(iter);
        (*plot_iter)->zoomToggle();
        return true;
      }
    }
    iter->next();
  }
  app->deleteIterator(iter);
  return false;
}
开发者ID:,项目名称:,代码行数:20,代码来源:

示例9: removeCurveFromPlot

bool KstIfaceImpl::removeCurveFromPlot(KMdiChildView *win, const QString& plot, const QString& curve) {
  KstViewWindow *w = dynamic_cast<KstViewWindow*>(win);

  if (w) {
    KstTopLevelViewPtr view = kst_cast<KstTopLevelView>(w->view());
    if (view) {
      Kst2DPlotList plots = view->findChildrenType<Kst2DPlot>(true);
      if (plots.findTag(plot) != plots.end()) {
        Kst2DPlotPtr p = *(plots.findTag(plot));
        KstBaseCurveList bcl = kstObjectSubList<KstDataObject,KstBaseCurve>(KST::dataObjectList);
        KstBaseCurveList::Iterator ci = bcl.findTag(curve);
        if (p && ci != bcl.end()) {
          p->removeCurve(*ci);
          _doc->forceUpdate();
          return true;
        }
      }
    }
  }

  return false;
}
开发者ID:,项目名称:,代码行数:22,代码来源:

示例10: addPlotMarker

bool KstIfaceImpl::addPlotMarker(const QString &plotName, double markerValue) {
  //find the plot
  KstApp *app = KstApp::inst();
  KMdiIterator<KMdiChildView*> *iter = app->createIterator();
  while (iter->currentItem()) {
    KMdiChildView *childview = iter->currentItem();
    KstViewWindow *viewwindow = dynamic_cast<KstViewWindow*>(childview);
    if (viewwindow) {
      Kst2DPlotList plotlist = viewwindow->view()->findChildrenType<Kst2DPlot>(false);
      Kst2DPlotList::Iterator plot_iter=plotlist.findTag(plotName);
      if (plot_iter != plotlist.end() && (*plot_iter)->setPlotMarker(markerValue)) {
        app->deleteIterator(iter);
        // repaint the plot 
        (*plot_iter)->setDirty();
        viewwindow->view()->paint(KstPainter::P_PLOT);
        return true;
      }
    }
    iter->next();
  }
  app->deleteIterator(iter);
  return false;
}
开发者ID:,项目名称:,代码行数:23,代码来源:

示例11: applyFileChange

bool KstChangeFileDialog::applyFileChange() {
  KstDataSourcePtr file;
  KST::dataSourceList.lock().writeLock();
  KstDataSourceList::Iterator it = KST::dataSourceList.findReusableFileName(_dataFile->url());
  QString invalidSources;
  int invalid = 0;

  if (it == KST::dataSourceList.end()) {
    file = KstDataSource::loadSource(_dataFile->url());
    if (!file || !file->isValid()) {
      KST::dataSourceList.lock().unlock();
      QMessageBox::warning(this, tr("Kst"), tr("The file could not be loaded."));
      return false;
    }
    if (file->isEmpty()) {
      KST::dataSourceList.lock().unlock();
      QMessageBox::warning(this, tr("Kst"), tr("The file does not contain data."));
      return false;
    }
    KST::dataSourceList.append(file);
  } else {
    file = *it;
  }
  KST::dataSourceList.lock().unlock();

  KstApp *app = KstApp::inst();
  KstRVectorList rvl = kstObjectSubList<KstVector,KstRVector>(KST::vectorList);
  KstRMatrixList rml = kstObjectSubList<KstMatrix,KstRMatrix>(KST::matrixList);
  int selected = 0;
  int handled = 0;

  int count = (int)ChangeFileCurveList->count();
  for (int i = 0; i < count; i++) {
    if (ChangeFileCurveList->isSelected(i)) {
      ++selected;
    }
  }

  // a map to keep track of which objects have been duplicated, and mapping
  // old object -> new object
  KstDataObjectDataObjectMap duplicatedMap;
  QMap<KstVectorPtr, KstVectorPtr> duplicatedVectors;
  QMap<KstMatrixPtr, KstMatrixPtr> duplicatedMatrices;

  KstDataSourceList oldSources;

  // go through the vectors
  for (int i = 0; i < (int)rvl.count(); i++) {
    if (ChangeFileCurveList->isSelected(i)) {
      KstRVectorPtr vector = rvl[i];
      vector->writeLock();
      file->readLock();
      bool valid = file->isValidField(vector->field());
      file->unlock();
      if (!valid) {
        if (invalid > 0) {
          invalidSources = tr("%1, %2").arg(invalidSources).arg(vector->field());
        } else {
          invalidSources = vector->field();
        }
        ++invalid;
      } else {
        if (_duplicateSelected->isChecked()) {
          // block vector updates until vector is setup properly
          KST::vectorList.lock().writeLock();

          // create a new vector
          KstRVectorPtr newVector = vector->makeDuplicate();
          if (!oldSources.contains(newVector->dataSource())) {
            oldSources << newVector->dataSource();
          }
          newVector->changeFile(file);

          KST::vectorList.lock().unlock();

          // duplicate dependents
          if (_duplicateDependents->isChecked()) {
            duplicatedVectors.insert(KstVectorPtr(vector), KstVectorPtr(newVector));
            KST::duplicateDependents(KstVectorPtr(vector), duplicatedMap, duplicatedVectors);
          }
        } else {
          if (!oldSources.contains(vector->dataSource())) {
            oldSources << vector->dataSource();
          }
          vector->changeFile(file);
        }
      }
      vector->unlock();
      app->slotUpdateProgress(selected, ++handled, tr("Updating vectors..."));
    }
  }

  // go through the matrices
  for (int i = (int)rvl.count(); i < (int)ChangeFileCurveList->count(); i++) {
    if (ChangeFileCurveList->isSelected(i)) {
      KstRMatrixPtr matrix = rml[i-rvl.count()];
      matrix->writeLock();
      file->readLock();
      bool valid = file->isValidMatrix(matrix->field());
      file->unlock();
//.........这里部分代码省略.........
开发者ID:,项目名称:,代码行数:101,代码来源:

示例12: applyFileChange

bool KstChangeFileDialogI::applyFileChange() {
  KstDataSourcePtr file;
  KST::dataSourceList.lock().writeLock();
  KstDataSourceList::Iterator it = KST::dataSourceList.findReusableFileName(_dataFile->url());
  QString invalidSources;
  int invalid = 0;

  if (it == KST::dataSourceList.end()) {
    file = KstDataSource::loadSource(_dataFile->url());
    if (!file || !file->isValid()) {
      KST::dataSourceList.lock().unlock();
      KMessageBox::sorry(this, i18n("The file could not be loaded."));
      return false;
    }
    if (file->isEmpty()) {
      KST::dataSourceList.lock().unlock();
      KMessageBox::sorry(this, i18n("The file does not contain data."));
      return false;
    }
    KST::dataSourceList.append(file);
  } else {
    file = *it;
  }
  KST::dataSourceList.lock().unlock();

  KstApp *app = KstApp::inst();
  KstRVectorList rvl = kstObjectSubList<KstVector,KstRVector>(KST::vectorList);
  KstRMatrixList rml = kstObjectSubList<KstMatrix,KstRMatrix>(KST::matrixList);
  int selected = 0;
  int handled = 0;

  int count = (int)ChangeFileCurveList->count();
  for (int i = 0; i < count; i++) {
    if (ChangeFileCurveList->isSelected(i)) {
      ++selected;
    }
  }

  // a map to keep track of which objects have been duplicated, and mapping
  // old object -> new object
  KstDataObjectDataObjectMap duplicatedMap;
  QMap<KstVectorPtr, KstVectorPtr> duplicatedVectors;
  QMap<KstMatrixPtr, KstMatrixPtr> duplicatedMatrices;

  KstDataSourceList oldSources;
  
  // go through the vectors
  for (int i = 0; i < (int)rvl.count(); i++) {
    if (ChangeFileCurveList->isSelected(i)) {
      KstRVectorPtr vector = rvl[i];
      vector->writeLock();
      file->readLock();
      bool valid = file->isValidField(vector->field());
      file->unlock();
      if (!valid) {
        if (invalid > 0) {
          // FIXME: invalid list construction for i18n
          invalidSources = i18n("%1, %2").arg(invalidSources).arg(vector->field());
        } else {
          invalidSources = vector->field();
        }
        ++invalid;
      } else {
        if (_duplicateSelected->isChecked()) {
          // block vector updates until vector is setup properly
          KST::vectorList.lock().writeLock();

          // create a new vector
          KstRVectorPtr newVector = vector->makeDuplicate();
          if (!oldSources.contains(newVector->dataSource())) {
            oldSources << newVector->dataSource();
          }
          newVector->changeFile(file);

          KST::vectorList.lock().unlock();

          // duplicate dependents
          if (_duplicateDependents->isChecked()) {
            duplicatedVectors.insert(KstVectorPtr(vector), KstVectorPtr(newVector));
            KST::duplicateDependents(KstVectorPtr(vector), duplicatedMap, duplicatedVectors);
          }
        } else {
          if (!oldSources.contains(vector->dataSource())) {
            oldSources << vector->dataSource();
          }
          vector->changeFile(file);
        }
      }
      vector->unlock();
      app->slotUpdateProgress(selected, ++handled, i18n("Updating vectors..."));
    }
  }
  
  // go through the matrices
  for (int i = (int)rvl.count(); i < (int)ChangeFileCurveList->count(); i++) {
    if (ChangeFileCurveList->isSelected(i)) {
      KstRMatrixPtr matrix = rml[i-rvl.count()];
      matrix->writeLock();
      file->readLock();
      bool valid = file->isValidMatrix(matrix->field());
//.........这里部分代码省略.........
开发者ID:Kst-plot,项目名称:kst-subversion-archive,代码行数:101,代码来源:kstchangefiledialog_i.cpp

示例13: removeCurveFromPlots

void KST::removeCurveFromPlots(KstBaseCurve *c) {
  Kst2DPlotList pl = Kst2DPlot::globalPlotList();
  for (Kst2DPlotList::Iterator i = pl.begin(); i != pl.end(); ++i) {
    (*i)->removeCurve(c);
  }
}
开发者ID:,项目名称:,代码行数:6,代码来源:

示例14: plotEquation

bool KstIfaceImpl::plotEquation(const QString& xvector, const QString& equation, const QString& plotName, const QColor& color) {
  KstVectorPtr v;
  Kst2DPlotPtr plot;
  QString etag, ptag;
  KST::vectorList.lock().readLock();
  KstVectorList::Iterator it = KST::vectorList.findTag(xvector);
  KST::vectorList.lock().unlock();
  KstApp *app = KstApp::inst();

  if (equation.isEmpty() || it == KST::vectorList.end()) {
    return false;
  }

  v = *it;

  etag = KST::suggestEQName(QString(equation).replace(QRegExp("[\\[\\]\\s]"), "_"));
  ptag = "P-" + plotName;

  if (!plotName.isEmpty()) {
    //find the plot, or P-plotName
    KMdiIterator<KMdiChildView*> *iter = app->createIterator();
    bool found = false;
    while (iter->currentItem() && !found) {
      KMdiChildView *childview = iter->currentItem();
      KstViewWindow *viewwindow = dynamic_cast<KstViewWindow*>(childview);
      if (viewwindow && !found) {
        Kst2DPlotList plotlist = viewwindow->view()->findChildrenType<Kst2DPlot>(false);
        Kst2DPlotList::Iterator plot_iter = plotlist.findTag(plotName);
        if (plot_iter != plotlist.end()) {
          plot = *plot_iter;
          found = true;
        }
        else {
          Kst2DPlotList::Iterator plot_iter = plotlist.findTag(ptag);
          if (plot_iter != plotlist.end()) {
            plot = *plot_iter;
            found = true;
          }
        }
      }
      iter->next();
    }
    app->deleteIterator(iter);
  }

  //if the plot does not exist, create it
  if (!plot) {
    //put the plot in the active window
    KMdiChildView *activewin = app->activeWindow();
    if (!activewin) {
      QString windowname = app->newWindow("W1");
      activewin = app->findWindow(windowname);
    }
    KstViewWindow *viewwindow = dynamic_cast<KstViewWindow*>(activewin);
    if (viewwindow) {
      KstTopLevelViewPtr pTLV = viewwindow->view();
      plot = pTLV->createObject<Kst2DPlot>(ptag);
    }
  }


  KstEquationPtr eq = new KstEquation(etag, equation, v, true);

  if (!eq->isValid()) {
    return false;
  }

  KstVCurveList vcurves = kstObjectSubList<KstBaseCurve,KstVCurve>(plot->Curves);
  
  KstVCurvePtr vc = new KstVCurve(KST::suggestCurveName(etag, true), eq->vX(), eq->vY(), 0L, 0L, 0L, 0L, color.isValid() ? color : KstColorSequence::next(vcurves,plot->backgroundColor()));
  KST::dataObjectList.lock().writeLock();
  KST::dataObjectList.append(KstDataObjectPtr(eq));
  KST::dataObjectList.append(KstDataObjectPtr(vc));
  KST::dataObjectList.lock().unlock();

  plot->addCurve(KstBaseCurvePtr(vc));

  _doc->forceUpdate();
  _doc->setModified();

  return true;
}
开发者ID:,项目名称:,代码行数:82,代码来源:


注:本文中的Kst2DPlotList::end方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。