[Kst] kdeextragear-2/kst/kst

Barth Netterfield netterfield at astro.utoronto.ca
Sun Apr 17 03:05:52 CEST 2005


CVS commit by netterfield: 

Add kstavectors, which are static vectors which can be modified, saved, and loaded.
There is currently no UI for them, but they will be very useful in eg, scripting.

They are saved, embedded in the XML, by 
	fixing endianness using a qdatastream
	compressing
	base64 encoding.
so they should be both reasonably storage efficient, and portable.

There are now 4 kinds of vectors:
RVectors: a field read from a data source, which updates with the data source.
SVectors: a static vectors defined as N equally spaced points from x0 to x1.
AVectors: a static, editable vector of N arbitrary points, which can be saved
		and loaded.
Vectors: a base class vector is always a slave vector which gets its life and
	content from a data object, like the X axis in a psd.


  A            kstavector.cpp   1.1 [GPL (v2+)]
  A            kstavector.h   1.1 [GPL (v2+)]
  M +1 -0      Makefile.am   1.192
  M +6 -2      kstdoc.cpp   1.163
  M +0 -1      kstequation.cpp   1.38
  M +9 -0      main.cpp   1.111


--- kdeextragear-2/kst/kst/Makefile.am  #1.191:1.192
@@ -52,4 +52,5 @@
         kstrvector.cpp \
         kstsvector.cpp \
+        kstavector.cpp \
         enodes.cpp \
         enodefactory.cpp \

--- kdeextragear-2/kst/kst/kstdoc.cpp  #1.162:1.163
@@ -53,4 +53,5 @@
 #include "kstvectordefaults.h"
 #include "kstsvector.h"
+#include "kstavector.h"
 #include "kstviewwindow.h"
 #include "logevents.h"
@@ -210,5 +211,4 @@ bool KstDoc::openDocument(const KURL& ur
   QString activeWindow;
   KstRVectorPtr vector;
-  KstSVectorPtr svector;
   KstApp *app = KstApp::inst();
   QString readingDocument = i18n("Reading Kst file");
@@ -293,6 +293,10 @@ bool KstDoc::openDocument(const KURL& ur
         // Vectors are automatically added to the global list.
       } else if (e.tagName() == "svector") {
-        svector = new KstSVector(e);
+        KstSVectorPtr svector = new KstSVector(e);
         KST::addVectorToList(KstVectorPtr(svector));
+      } else if (e.tagName() == "avector") {
+        KstAVectorPtr avector = new KstAVector(e);
+        avector = new KstAVector(e);
+        KST::addVectorToList(KstVectorPtr(avector));
       } else if (e.tagName() == "plugin") {
         KstDataObjectPtr p = new KstPlugin(e);

--- kdeextragear-2/kst/kst/main.cpp  #1.110:1.111
@@ -37,4 +37,5 @@
 #include "kstrvector.h"
 #include "kstsvector.h"
+#include "kstavector.h"
 #include "kstvcurve.h"
 #include "kstversion.h"
@@ -391,5 +392,13 @@ int main(int argc, char *argv[]) {
     bool print_and_exit = false;
 
+
     // test code
+    //KstAVectorPtr tmpv = new KstAVector(3, "tmpV" );
+    //tmpv->value()[0] = 0;
+    //tmpv->value()[1] = 10;
+    //tmpv->value()[2] = 4;
+
+    //KST::addVectorToList(KstVectorPtr( tmpv ));
+
 #if 0
     KstVectorPtr tmpv;




More information about the Kst mailing list