本文整理汇总了C++中KstVCurvePtr::setLineStyle方法的典型用法代码示例。如果您正苦于以下问题:C++ KstVCurvePtr::setLineStyle方法的具体用法?C++ KstVCurvePtr::setLineStyle怎么用?C++ KstVCurvePtr::setLineStyle使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类KstVCurvePtr
的用法示例。
在下文中一共展示了KstVCurvePtr::setLineStyle方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: edit_I
void KstCurveDialogI::edit_I() {
int index;
KstVCurvePtr curve;
KstVCurveList curves = kstObjectSubList<KstDataObject, KstVCurve>(KST::dataObjectList);
index = Select->currentItem();
if (index < 0 || unsigned(index) >= curves.count()) {
new_I();
return;
}
QString tag_name = Select->currentText();
/* verify that the curve name is unique */
if (tag_name != curves[index]->tagName()) {
if (KST::dataTagNameNotUnique(tag_name)) {
Select->setFocus();
return;
}
}
curve = curves[index];
curve->setTagName(tag_name);
{ // leave this scope here to destroy the iterator
KstReadLocker ml(&KST::vectorList.lock());
KstVectorList::Iterator i = KST::vectorList.findTag(_xVector->selectedVector());
if (i != KST::vectorList.end())
curve->setXVector(*i);
i = KST::vectorList.findTag(_yVector->selectedVector());
if (i != KST::vectorList.end())
curve->setYVector(*i);
i = KST::vectorList.findTag(_xError->selectedVector());
curve->setXError(*i);
i = KST::vectorList.findTag(_yError->selectedVector());
curve->setYError(*i);
}
curve->setColor(_curveAppearance->color());
curve->setHasPoints(_curveAppearance->showPoints());
curve->setHasLines(_curveAppearance->showLines());
curve->setLineWidth(_curveAppearance->lineWidth());
curve->setLineStyle(_curveAppearance->lineStyle());
curve->Point.setType(_curveAppearance->pointType());
curve->update(-1);
curve = 0L;
curves.clear();
emit modified();
}
示例2: setLineStyle
void KstBindCurve::setLineStyle(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->setLineStyle(i);
}
}
示例3: 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;
}
示例4: 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());
//.........这里部分代码省略.........
示例5: new_I
void KstCurveDialogI::new_I() {
KstWriteLocker ml(&KST::vectorList.lock());
KstVectorList::Iterator VX, VY;
KstVectorList::Iterator EX, EY;
KstVCurvePtr curve;
KstPlot *plot;
if (_xVector->selectedVector().isEmpty()) {
KMessageBox::sorry(0L, i18n("New curve not made: define vectors first."));
return;
}
/* find VX and VY */
VX = KST::vectorList.findTag(_xVector->selectedVector());
VY = KST::vectorList.findTag(_yVector->selectedVector());
EX = KST::vectorList.findTag(_xError->selectedVector());
EY = KST::vectorList.findTag(_yError->selectedVector());
if (VX == KST::vectorList.end() || VY == KST::vectorList.end()) {
kdFatal() << "Bug in kst: the XVector field in plotDialog refers to "
<< "a non existant vector...." << endl;
}
KstReadLocker rl1(*VX), rl2(*VY);
QString tag_name = Select->currentText();
tag_name.replace(i18n("<New_Curve>"), (*VY)->tagName());
/* verify that the curve name is unique */
if (KST::dataTagNameNotUnique(tag_name)) {
Select->setFocus();
return;
}
/* create the curve */
curve = new KstVCurve(tag_name, *VX, *VY,
EX != KST::vectorList.end() ? *EX : KstVectorPtr(0L),
EY != KST::vectorList.end() ? *EY : KstVectorPtr(0L),
_curveAppearance->color());
curve->setHasPoints(_curveAppearance->showPoints());
curve->setHasLines(_curveAppearance->showLines());
curve->setLineWidth(_curveAppearance->lineWidth());
curve->setLineStyle(_curveAppearance->lineStyle());
curve->Point.setType(_curveAppearance->pointType());
if (_curvePlacement->existingPlot()) {
/* assign curve to plot */
plot = KST::plotList.FindKstPlot(_curvePlacement->plotName());
plot->addCurve(curve);
}
if (_curvePlacement->newPlot()) {
/* assign curve to plot */
plot = KST::plotList.addPlot(QString::null, _curvePlacement->columns());
_curvePlacement->appendPlot(plot->tagName(), true);
plot->addCurve(curve);
plot->GenerateDefaultLabels();
}
KST::dataObjectList.lock().writeLock();
KST::dataObjectList.append(curve.data());
KST::dataObjectList.lock().writeUnlock();
curve = 0L;
emit modified();
}