[Kst] branches/work/kst/1.5/kst/src
Duncan Hanson
duncan.hanson at gmail.com
Wed May 16 20:51:02 CEST 2007
SVN commit 665377 by dhanson:
full constructor.
M +15 -2 libkstapp/kstvvdialog_i.cpp
M +20 -10 libkstmath/kstvectorview.cpp
M +6 -4 libkstmath/kstvectorview.h
--- branches/work/kst/1.5/kst/src/libkstapp/kstvvdialog_i.cpp #665376:665377
@@ -70,7 +70,7 @@
connect(_w->_yMaxScalar, SIGNAL(newScalarCreated()), this, SIGNAL(modified()));
_w->_FlagVector->provideNoneVector(true);
- _w->_FlagVector->allowNewVectors(false);
+ _w->_FlagVector->allowNewVectors(true);
connect(_w->_xMinCheckbox, SIGNAL(clicked()), this, SLOT(updateButtons()));
connect(_w->_xMaxCheckbox, SIGNAL(clicked()), this, SLOT(updateButtons()));
@@ -226,6 +226,7 @@
KST::vectorList.lock().readLock();
KstVectorPtr vx = *KST::vectorList.findTag(_w->_xVector->selectedVector());
KstVectorPtr vy = *KST::vectorList.findTag(_w->_yVector->selectedVector());
+ KstVectorPtr flag = *KST::vectorList.findTag(_w->_FlagVector->selectedVector());
KST::vectorList.lock().unlock();
if (!vx) {
kstdFatal() << "Bug in kst: the Vector field (Vx) refers to "
@@ -238,9 +239,21 @@
vx->readLock();
vy->readLock();
- vv = new KstVectorView(tag_name, vx, vy);
+ if (flag) {flag->readLock();}
+ vv = new KstVectorView(tag_name, vx, vy,
+ KstVectorView::InterpType(_w->_interp->currentItem()),
+ _w->_xMinCheckbox->isChecked(),
+ _w->_xMinScalar->selectedScalarPtr(),
+ _w->_xMaxCheckbox->isChecked(),
+ _w->_xMaxScalar->selectedScalarPtr(),
+ _w->_yMinCheckbox->isChecked(),
+ _w->_yMinScalar->selectedScalarPtr(),
+ _w->_yMaxCheckbox->isChecked(),
+ _w->_yMaxScalar->selectedScalarPtr(),
+ flag );
vx->unlock();
vy->unlock();
+ if (flag) {flag->unlock();}
KstVCurvePtr vc = new KstVCurve(KST::suggestCurveName(vv->tag(), true), vv->vX(), vv->vY(), 0L, 0L, 0L, 0L, _w->_curveAppearance->color());
--- branches/work/kst/1.5/kst/src/libkstmath/kstvectorview.cpp #665376:665377
@@ -39,18 +39,25 @@
static const QString& OUT_XVECTOR = KGlobal::staticQString("OUT_XVECTOR");
static const QString& OUT_YVECTOR = KGlobal::staticQString("OUT_YVECTOR");
-KstVectorView::KstVectorView(const QString &in_tag, KstVectorPtr in_X, KstVectorPtr in_Y)
+KstVectorView::KstVectorView(const QString &in_tag, KstVectorPtr in_X, KstVectorPtr in_Y, KstVectorView::InterpType itype, bool useXmin, KstScalarPtr xmin, bool useXmax, KstScalarPtr xmax, bool useYmin, KstScalarPtr ymin, bool useYmax, KstScalarPtr ymax, KstVectorPtr flag )
: KstDataObject() {
_inputVectors[IN_XVECTOR] = in_X;
_inputVectors[IN_YVECTOR] = in_Y;
- _useXmin = false; //defaults
- _useXmax = false;
- _useYmin = false;
- _useYmax = false;
+ setInterp(itype);
- setInterp(KstVectorView::InterpType(0));
+ setUseXmin(useXmin);
+ setUseXmax(useXmax);
+ setUseYmin(useYmin);
+ setUseYmax(useYmax);
+ setXminScalar(xmin);
+ setXmaxScalar(xmax);
+ setYminScalar(ymin);
+ setYmaxScalar(ymax);
+
+ setFlagVector(flag);
+
commonConstructor(in_tag);
}
@@ -61,13 +68,16 @@
QString xmintag, xmaxtag, ymintag, ymaxtag;
QString in_tag;
- _useXmin = false; //defaults.
+ _interp = (KstVectorView::InterpType(0)); //defaults. shouldn't be necessary.
+ _useXmin = false;
_useXmax = false;
_useYmin = false;
_useYmax = false;
+ _xmin = NULL;
+ _xmax = NULL;
+ _ymin = NULL;
+ _ymax = NULL;
- setInterp(KstVectorView::InterpType(0));
-
QDomNode n = e.firstChild();
while( !n.isNull() ) {
QDomElement e = n.toElement(); // try to convert the node to an element.
@@ -437,7 +447,7 @@
while (KstData::self()->dataTagNameNotUnique(name, false)) {
name += '\'';
}
- KstVectorViewPtr vectorview = new KstVectorView(name, _inputVectors[IN_XVECTOR], _inputVectors[IN_YVECTOR]);
+ KstVectorViewPtr vectorview = new KstVectorView(name, _inputVectors[IN_XVECTOR], _inputVectors[IN_YVECTOR], interp(), _useXmin, xMinScalar(), _useXmax, xMaxScalar(), _useYmin, yMinScalar(), _useYmax, yMaxScalar(), _inputVectors[IN_FLAGVECTOR]);
duplicatedMap.insert(this, KstDataObjectPtr(vectorview));
return KstDataObjectPtr(vectorview);
}
--- branches/work/kst/1.5/kst/src/libkstmath/kstvectorview.h #665376:665377
@@ -36,7 +36,12 @@
// vectorviewdialogwidget.ui
enum AxesType {XYAxes=0, XAxis=1, YAxis=2};
- KstVectorView(const QString &in_tag, KstVectorPtr in_X, KstVectorPtr in_Y);
+ KstVectorView(const QString &in_tag, KstVectorPtr in_X, KstVectorPtr in_Y,
+ KstVectorView::InterpType itype,
+ bool useXmin, KstScalarPtr xmin,
+ bool useXmax, KstScalarPtr xmax,
+ bool useYmin, KstScalarPtr ymin,
+ bool useYmax, KstScalarPtr ymax, KstVectorPtr flag);
KstVectorView(const QDomElement &e);
virtual ~KstVectorView();
@@ -105,13 +110,10 @@
KstVectorMap::Iterator _cxVector;
KstVectorMap::Iterator _cyVector;
- AxesType _plotaxes;
InterpType _interp;
bool _useXmin, _useXmax, _useYmin, _useYmax;
KstScalarPtr _xmin, _xmax, _ymin, _ymax;
- bool _useFlag;
-
void commonConstructor(const QString &in_tag);
};
More information about the Kst
mailing list