本文整理汇总了C++中KstVCurvePtr::setPointDensity方法的典型用法代码示例。如果您正苦于以下问题:C++ KstVCurvePtr::setPointDensity方法的具体用法?C++ KstVCurvePtr::setPointDensity怎么用?C++ KstVCurvePtr::setPointDensity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KstVCurvePtr
的用法示例。
在下文中一共展示了KstVCurvePtr::setPointDensity方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setPointDensity
void KstBindCurve::setPointDensity(KJS::ExecState *exec, const KJS::Value& value) {
unsigned i = 0;
if (value.type() != KJS::NumberType || !value.toUInt32(i)) {
KJS::Object eobj = KJS::Error::create(exec, KJS::TypeError);
exec->setException(eobj);
return;
}
KstVCurvePtr d = makeCurve(_d);
if (d) {
KstWriteLocker wl(d);
d->setPointDensity(i);
}
}
示例2: createCurve
bool KstFilterDialogI::createCurve(KstCPluginPtr plugin) {
KstVectorPtr xVector;
KstVectorPtr yVector;
KST::vectorList.lock().readLock();
KstVectorList::Iterator it = KST::vectorList.findTag(_xvector);
if (it != KST::vectorList.end()) {
xVector = *it;
}
KST::vectorList.lock().unlock();
if (plugin->outputVectors().contains(plugin->plugin()->data()._filterOutputVector)) {
yVector = plugin->outputVectors()[plugin->plugin()->data()._filterOutputVector];
}
if (!xVector || !yVector) {
return false;
}
plugin->setDirty();
QString c_name = KST::suggestCurveName(plugin->tag(), true);
QColor color = KstApp::inst()->chooseColorDlg()->getColorForCurve(KstVectorPtr(xVector), KstVectorPtr(yVector));
if (!color.isValid()) {
color = _w->_curveAppearance->color();
}
KstVCurvePtr fit = new KstVCurve(c_name, KstVectorPtr(xVector), KstVectorPtr(yVector), KstVectorPtr(0L), KstVectorPtr(0L), KstVectorPtr(0L), KstVectorPtr(0L), color);
fit->setHasPoints(_w->_curveAppearance->showPoints());
fit->setHasLines(_w->_curveAppearance->showLines());
fit->setHasBars(_w->_curveAppearance->showBars());
fit->setLineWidth(_w->_curveAppearance->lineWidth());
fit->setLineStyle(_w->_curveAppearance->lineStyle());
fit->setPointStyle(_w->_curveAppearance->pointType());
fit->setBarStyle(_w->_curveAppearance->barStyle());
fit->setPointDensity(_w->_curveAppearance->pointDensity());
KstViewWindow *w = dynamic_cast<KstViewWindow*>(KstApp::inst()->findWindow(_window));
if (w && w->view()->findChild(_plotName)) {
Kst2DPlotPtr plot = kst_cast<Kst2DPlot>(w->view()->findChild(_plotName));
if (plot) {
plot->addCurve(fit.data());
}
}
KST::dataObjectList.lock().writeLock();
KST::dataObjectList.append(fit.data());
KST::dataObjectList.lock().unlock();
return true;
}
示例3: newObject
bool KstEqDialogI::newObject() {
QString tag_name = _tagName->text();
QString etext = _w->_equation->text();
etext.remove(QRegExp("[^a-zA-Z0-9\\(\\)\\+\\-\\*/\\%\\^\\|\\&\\!<>=_.]"));
if (etext.length() > 12) {
etext.truncate(12);
etext += "...";
}
if (tag_name == defaultTag) {
tag_name = KST::suggestEQName(etext);
}
/* verify that the curve name is unique */
if (KstData::self()->dataTagNameNotUnique(tag_name)) {
_tagName->setFocus();
return false;
}
if (!checkEntries()) {
return false;
}
KST::vectorList.lock().readLock();
/* find *V */
KstVectorPtr vp = *KST::vectorList.findTag(_w->_xVectors->selectedVector());
if (!vp) {
kstdFatal() << "Bug in kst: the Vector field (Eq) "
<< "refers to a non-existent vector..." << endl;
}
KST::vectorList.lock().unlock();
/** Create the equation here */
vp->readLock();
KstEquationPtr eq = new KstEquation(tag_name, _w->_equation->text(), vp, _w->_doInterpolation->isChecked());
vp->unlock();
if (!eq->isValid()) {
eq = 0L;
QString parseErrors;
for (QStringList::ConstIterator i = Equation::errorStack.begin(); i != Equation::errorStack.end(); ++i) {
parseErrors += *i;
parseErrors += "\n";
}
KMessageBox::detailedSorry(this, i18n("There is an error in the equation you entered."), parseErrors);
return false;
}
KstVCurvePtr vc = new KstVCurve(KST::suggestCurveName(tag_name, true), eq->vX(), eq->vY(), 0L, 0L, 0L, 0L, _w->_curveAppearance->color());
vc->setHasPoints(_w->_curveAppearance->showPoints());
vc->setHasLines(_w->_curveAppearance->showLines());
vc->setHasBars(_w->_curveAppearance->showBars());
vc->setLineWidth(_w->_curveAppearance->lineWidth());
vc->setLineStyle(_w->_curveAppearance->lineStyle());
vc->pointType = _w->_curveAppearance->pointType();
vc->setPointDensity(_w->_curveAppearance->pointDensity());
vc->setBarStyle(_w->_curveAppearance->barStyle());
QString legend_text = _legendText->text();
if (legend_text == defaultTag) {
vc->setLegendText(QString(""));
} else {
vc->setLegendText(legend_text);
}
KstViewWindow *w = dynamic_cast<KstViewWindow*>(KstApp::inst()->findWindow(_w->_curvePlacement->_plotWindow->currentText()));
if (!w) {
QString n = KstApp::inst()->newWindow(KST::suggestWinName());
w = dynamic_cast<KstViewWindow*>(KstApp::inst()->findWindow(n));
}
if (w) {
Kst2DPlotPtr plot;
if (_w->_curvePlacement->existingPlot()) {
/* assign curve to plot */
plot = kst_cast<Kst2DPlot>(w->view()->findChild(_w->_curvePlacement->plotName()));
if (plot) {
plot->addCurve(vc.data());
}
}
if (_w->_curvePlacement->newPlot()) {
/* assign curve to plot */
QString name = w->createObject<Kst2DPlot>(KST::suggestPlotName());
if (_w->_curvePlacement->reGrid()) {
w->view()->cleanup(_w->_curvePlacement->columns());
}
plot = kst_cast<Kst2DPlot>(w->view()->findChild(name));
if (plot) {
_w->_curvePlacement->update();
_w->_curvePlacement->setCurrentPlot(plot->tagName());
plot->addCurve(vc.data());
plot->generateDefaultLabels();
}
}
}
KST::dataObjectList.lock().writeLock();
KST::dataObjectList.append(eq.data());
//.........这里部分代码省略.........