[Kst] branches/work/kst/portto4/kst
Mike Fenton
mike at staikos.net
Tue Oct 2 16:55:19 CEST 2007
SVN commit 720150 by fenton:
Conversion of kstrvector to Kst::DataVector and associated changes.
M +3 -3 src/d2asc/d2asc.cpp
M +3 -3 src/d2d/d2d.cpp
A src/libkst/datavector.cpp src/libkst/kstrvector.cpp#720143 [License: GPL (v2+)]
A src/libkst/datavector.h src/libkst/kstrvector.h#720143 [License: GPL (v2+)]
D src/libkst/kstrvector.cpp
D src/libkst/kstrvector.h
M +2 -2 src/libkst/kstvectordefaults.cpp
M +2 -2 src/libkst/libkst.pro
M +2 -2 src/libkst/vectorfactory.cpp
M +2 -2 src/libkstapp/vectordialog.cpp
M +2 -2 src/libkstmath/kstvcurve.cpp
M +14 -14 tests/testdatasource.cpp
--- branches/work/kst/portto4/kst/src/d2asc/d2asc.cpp #720149:720150
@@ -20,7 +20,7 @@
// hack to make main() a friend of kstdatasource
#define protected public
-#include "kstrvector.h"
+#include "datavector.h"
#include "kstdatacollection.h"
#include "kstdataobjectcollection.h"
#undef protected
@@ -100,7 +100,7 @@
return -2;
}
/** make vectors and fill the list **/
- QList<KstRVector*> vlist;
+ QList<Kst::DataVector*> vlist;
for (i=0; i<n_field; i++) {
if (!file->isValidField(field_list[i])) {
@@ -108,7 +108,7 @@
field_list[i], filename);
return -3;
}
- KstRVectorPtr v = new KstRVector(file, field_list[i], KstObjectTag("tag", KstObjectTag::globalTagContext), start_frame, n_frames, n_skip, n_skip>0, do_ave);
+ Kst::DataVectorPtr v = new Kst::DataVector(file, field_list[i], KstObjectTag("tag", KstObjectTag::globalTagContext), start_frame, n_frames, n_skip, n_skip>0, do_ave);
vlist.append(v);
}
--- branches/work/kst/portto4/kst/src/d2d/d2d.cpp #720149:720150
@@ -20,7 +20,7 @@
// hack to make main() a friend of kstdatasource
#define protected public
-#include "kstrvector.h"
+#include "datavector.h"
#include "kstdatacollection.h"
#include "kstdataobjectcollection.h"
#undef protected
@@ -98,7 +98,7 @@
}
/** make vectors and fill the list **/
- QList<KstRVector*> vlist;
+ QList<Kst::DataVector*> vlist;
for (int i = 0; i < n_field; i++) {
if (!file->isValidField(field_list[i])) {
@@ -106,7 +106,7 @@
field_list[i], in_filename);
return -3;
}
- KstRVectorPtr v = new KstRVector(file, field_list[i], KstObjectTag(field_list[i], file->tag()), start_frame, n_frames, n_skip, n_skip>0, do_ave);
+ Kst::DataVectorPtr v = new Kst::DataVector(file, field_list[i], KstObjectTag(field_list[i], file->tag()), start_frame, n_frames, n_skip, n_skip>0, do_ave);
vlist.append(v);
}
--- branches/work/kst/portto4/kst/src/libkst/kstvectordefaults.cpp #720149:720150
@@ -16,7 +16,7 @@
***************************************************************************/
#include "kstvectordefaults.h"
-#include "kstrvector.h"
+#include "datavector.h"
#include "kstdatacollection.h"
#include "stdinsource.h"
@@ -81,7 +81,7 @@
void KstVectorDefaults::sync() {
KST::vectorList.lock().readLock();
- KstRVectorList vl = kstObjectSubList<KstVector,KstRVector>(KST::vectorList);
+ Kst::DataVectorList vl = kstObjectSubList<KstVector,Kst::DataVector>(KST::vectorList);
KST::vectorList.lock().unlock();
int j = vl.count() - 1;
--- branches/work/kst/portto4/kst/src/libkst/libkst.pro #720149:720150
@@ -36,7 +36,7 @@
kstvector.cpp \
kstsvector.cpp \
editablevector.cpp \
- kstrvector.cpp \
+ datavector.cpp \
kstvectordefaults.cpp \
kstmatrixdefaults.cpp \
kstprimitive.cpp \
@@ -75,7 +75,7 @@
kstprimitive.h \
kstrevision.h \
datamatrix.h \
- kstrvector.h \
+ datavector.h \
kstscalar.h \
kstsharedptr.h \
kstsmatrix.h \
--- branches/work/kst/portto4/kst/src/libkst/vectorfactory.cpp #720149:720150
@@ -15,7 +15,7 @@
#include "kstvector.h"
#include "kstsvector.h"
#include "editablevector.h"
-#include "kstrvector.h"
+#include "datavector.h"
#include "kstdatacollection.h"
namespace Kst {
@@ -231,7 +231,7 @@
return 0;
}
- KstVectorPtr vector = new KstRVector(tag, data, provider, file, field, start, count, skip, doAve);
+ KstVectorPtr vector = new Kst::DataVector(tag, data, provider, file, field, start, count, skip, doAve);
return vector.data();
}
--- branches/work/kst/portto4/kst/src/libkstapp/vectordialog.cpp #720149:720150
@@ -14,7 +14,7 @@
#include "dialogpage.h"
#include "datasourcedialog.h"
-#include "kstrvector.h"
+#include "datavector.h"
#include "kstsvector.h"
#include "kstdatacollection.h"
@@ -249,7 +249,7 @@
// << "\n\tdoFilter:" << (dataRange->doFilter() ? "true" : "false")
// << endl;
- KstRVectorPtr vector = new KstRVector(
+ Kst::DataVectorPtr vector = new Kst::DataVector(
dataSource, field, tag,
dataRange->countFromEnd() ? -1 : int(dataRange->start()),
dataRange->readToEnd() ? -1 : int(dataRange->range()),
--- branches/work/kst/portto4/kst/src/libkstmath/kstvcurve.cpp #720149:720150
@@ -28,7 +28,7 @@
#include "kstdebug.h"
#include "kstlinestyle.h"
#include "kstmath.h"
-#include "kstrvector.h"
+#include "datavector.h"
#include "kstvcurve.h"
#include "ksttimers.h"
@@ -605,7 +605,7 @@
int KstVCurve::samplesPerFrame() const {
- const KstRVector *rvp = dynamic_cast<const KstRVector*>(_inputVectors[COLOR_YVECTOR].data());
+ const Kst::DataVector *rvp = dynamic_cast<const Kst::DataVector*>(_inputVectors[COLOR_YVECTOR].data());
return rvp ? rvp->samplesPerFrame() : 1;
}
--- branches/work/kst/portto4/kst/tests/testdatasource.cpp #720149:720150
@@ -19,7 +19,7 @@
#include <QTemporaryFile>
#include <kstmath.h>
-#include <kstrvector.h>
+#include <datavector.h>
#include <kstdatacollection.h>
#include <kstdataobjectcollection.h>
@@ -77,7 +77,7 @@
QVERIFY(dsp->fieldListIsComplete());
QVERIFY(!dsp->isEmpty());
- KstRVectorPtr rvp = new KstRVector(dsp, "1", KstObjectTag::fromString("RVTestAscii1"), 0, -1, 0, false, false);
+ Kst::DataVectorPtr rvp = new Kst::DataVector(dsp, "1", KstObjectTag::fromString("RVTestAscii1"), 0, -1, 0, false, false);
rvp->writeLock();
rvp->update(0);
rvp->unlock();
@@ -86,7 +86,7 @@
QCOMPARE(rvp->value()[0], 2.0);
QCOMPARE(rvp->value()[1], 1.0);
QCOMPARE(rvp->value()[2], 0.2);
- rvp = new KstRVector(dsp, "INDEX", KstObjectTag::fromString("RVTestAscii2"), 0, -1, 0, false, false);
+ rvp = new Kst::DataVector(dsp, "INDEX", KstObjectTag::fromString("RVTestAscii2"), 0, -1, 0, false, false);
rvp->writeLock();
rvp->update(0);
rvp->unlock();
@@ -130,7 +130,7 @@
QCOMPARE(dsp->fieldList().count(), 3);
QVERIFY(!dsp->isEmpty());
- KstRVectorPtr rvp = new KstRVector(dsp, "1", KstObjectTag::fromString("RVTestAscii1"), 0, -1, 0, false, false);
+ Kst::DataVectorPtr rvp = new Kst::DataVector(dsp, "1", KstObjectTag::fromString("RVTestAscii1"), 0, -1, 0, false, false);
rvp->writeLock();
rvp->update(0);
rvp->unlock();
@@ -142,7 +142,7 @@
QVERIFY(rvp->value()[2] == INF);
QCOMPARE(rvp->value()[3], 0.0);
- rvp = new KstRVector(dsp, "2", KstObjectTag::fromString("RVTestAscii2"), 0, -1, 0, false, false);
+ rvp = new Kst::DataVector(dsp, "2", KstObjectTag::fromString("RVTestAscii2"), 0, -1, 0, false, false);
rvp->writeLock();
rvp->update(0);
rvp->unlock();
@@ -184,14 +184,14 @@
QCOMPARE(dsp->fieldList().count(), 3);
QVERIFY(!dsp->isEmpty());
- KstRVectorPtr rvp = new KstRVector(dsp, "1", KstObjectTag::fromString("RVTestAscii1"), 0, -1, 0, false, false);
+ Kst::DataVectorPtr rvp = new Kst::DataVector(dsp, "1", KstObjectTag::fromString("RVTestAscii1"), 0, -1, 0, false, false);
rvp->writeLock();
rvp->update(0);
rvp->unlock();
QVERIFY(rvp->isValid());
QCOMPARE(rvp->length(), 1); // Are we allowed to have vectors of 1?
QCOMPARE(rvp->value()[0], 2.0);
- rvp = new KstRVector(dsp, "2", KstObjectTag::fromString("RVTestAscii2"), 0, -1, 0, false, false);
+ rvp = new Kst::DataVector(dsp, "2", KstObjectTag::fromString("RVTestAscii2"), 0, -1, 0, false, false);
rvp->writeLock();
rvp->update(0);
rvp->unlock();
@@ -239,13 +239,13 @@
QCOMPARE(dsp->fieldList().count(), 4);
QVERIFY(!dsp->isEmpty());
- KstRVectorPtr rvp = new KstRVector(dsp, "1", KstObjectTag::fromString("RVTestAscii1"), 0, -1, 0, false, false);
+ Kst::DataVectorPtr rvp = new Kst::DataVector(dsp, "1", KstObjectTag::fromString("RVTestAscii1"), 0, -1, 0, false, false);
rvp->writeLock();
rvp->update(0);
rvp->unlock();
QVERIFY(rvp->isValid());
QCOMPARE(rvp->length(), 39000);
- rvp = new KstRVector(dsp, "2", KstObjectTag::fromString("RVTestAscii2"), 0, -1, 10, true, false);
+ rvp = new Kst::DataVector(dsp, "2", KstObjectTag::fromString("RVTestAscii2"), 0, -1, 10, true, false);
rvp->writeLock();
rvp->update(0);
rvp->unlock();
@@ -256,7 +256,7 @@
QCOMPARE(rvp->value()[2], 120.0);
QCOMPARE(rvp->value()[3898], 39080.0);
- rvp = new KstRVector(dsp, "3", KstObjectTag::fromString("RVTestAscii2"), 0, -1, 10, true, true);
+ rvp = new Kst::DataVector(dsp, "3", KstObjectTag::fromString("RVTestAscii2"), 0, -1, 10, true, true);
rvp->writeLock();
rvp->update(0);
rvp->unlock();
@@ -318,7 +318,7 @@
{
//Skip FIVE frames...
- KstRVectorPtr rvp = new KstRVector(dsp, "INDEX", KstObjectTag::fromString("RVTestDirfile"), 0, -1, 5, true, false);
+ Kst::DataVectorPtr rvp = new Kst::DataVector(dsp, "INDEX", KstObjectTag::fromString("RVTestDirfile"), 0, -1, 5, true, false);
rvp->writeLock();
rvp->update(0);
rvp->unlock();
@@ -346,7 +346,7 @@
}
{
//Skip FIVE frames...
- KstRVectorPtr rvp = new KstRVector(dsp, "INDEX", KstObjectTag::fromString("RVTestDirfile"), 3, -1, 5, true, false);
+ Kst::DataVectorPtr rvp = new Kst::DataVector(dsp, "INDEX", KstObjectTag::fromString("RVTestDirfile"), 3, -1, 5, true, false);
rvp->writeLock();
rvp->update(0);
rvp->unlock();
@@ -373,7 +373,7 @@
}
{
//Skip FIVE frames...
- KstRVectorPtr rvp = new KstRVector(dsp, "INDEX", KstObjectTag::fromString("RVTestDirfile"), 0, 11, 5, true, false);
+ Kst::DataVectorPtr rvp = new Kst::DataVector(dsp, "INDEX", KstObjectTag::fromString("RVTestDirfile"), 0, 11, 5, true, false);
rvp->writeLock();
rvp->update(0);
rvp->unlock();
@@ -400,7 +400,7 @@
}
{
//Skip FIVE frames and countFromEOF()...
- KstRVectorPtr rvp = new KstRVector(dsp, "INDEX", KstObjectTag::fromString("RVTestDirfile"), -1, 10, 5, true, false);
+ Kst::DataVectorPtr rvp = new Kst::DataVector(dsp, "INDEX", KstObjectTag::fromString("RVTestDirfile"), -1, 10, 5, true, false);
rvp->writeLock();
rvp->update(0);
rvp->unlock();
More information about the Kst
mailing list