[Kst] branches/work/kst/portto4/kst/src/libkst

Peter Kümmel syntheticpp at gmx.net
Wed Jan 19 16:09:40 CET 2011


SVN commit 1215763 by kuemmel:

return metas for Matrix

 M  +16 -0     matrix.cpp  
 M  +4 -1      matrix.h  
 M  +2 -2      primitive.h  
 M  +7 -1      scalar.h  
 M  +6 -1      string_kst.h  
 M  +2 -2      vector.cpp  


--- branches/work/kst/portto4/kst/src/libkst/matrix.cpp #1215762:1215763
@@ -653,6 +653,22 @@
   return primitive_list;
 }
 
+PrimitiveMap Matrix::metas() const
+{
+  PrimitiveMap meta;
+  for (QHash<QString, StringPtr>::ConstIterator it = _strings.begin(); it != _strings.end(); ++it) {
+    meta[it.key()] = it.value();
+  }
+  for (QHash<QString, ScalarPtr>::ConstIterator it = _scalars.begin(); it != _scalars.end(); ++it) {
+    meta[it.key()] = it.value();
+  }
+  for (QHash<QString, VectorPtr>::ConstIterator it = _vectors.begin(); it != _vectors.end(); ++it) {
+    meta[it.key()] = it.value();
+  }
+  return meta;
+}
 
+
+
 }
 // vim: ts=2 sw=2 et
--- branches/work/kst/portto4/kst/src/libkst/matrix.h #1215762:1215763
@@ -26,7 +26,8 @@
 class Matrix;
 typedef SharedPtr<Matrix> MatrixPtr;
 
-class KSTCORE_EXPORT Matrix : public Primitive {
+class KSTCORE_EXPORT Matrix : public Primitive
+{
   Q_OBJECT
 
   public:
@@ -144,6 +145,8 @@
     ScalarMap scalars() const {return _scalars;}
     StringMap strings() const {return _strings;}
 
+    virtual PrimitiveMap metas() const;
+
     virtual ObjectList<Primitive> outputPrimitives() const;
 
   protected:
--- branches/work/kst/portto4/kst/src/libkst/primitive.h #1215762:1215763
@@ -53,9 +53,9 @@
 
     virtual bool used() const;
 
-    virtual ObjectList<Primitive> outputPrimitives() const {return ObjectList<Primitive>();}
+    virtual ObjectList<Primitive> outputPrimitives() const = 0;
 
-    virtual PrimitiveMap metas() const { return PrimitiveMap(); }
+    virtual PrimitiveMap metas() const = 0;
 
 
   protected:
--- branches/work/kst/portto4/kst/src/libkst/scalar.h #1215762:1215763
@@ -25,7 +25,8 @@
 namespace Kst {
 
 /** The base class for all scalars. */
-class KSTCORE_EXPORT Scalar : public Primitive {
+class KSTCORE_EXPORT Scalar : public Primitive
+{
   Q_OBJECT
   Q_PROPERTY(bool orphan READ orphan WRITE setOrphan)
   Q_PROPERTY(double value READ value WRITE setValue)
@@ -39,6 +40,7 @@
     virtual QString _automaticDescriptiveName() const;
 
     virtual void _initializeShortName();
+
   public:
     virtual ~Scalar();
 
@@ -61,6 +63,10 @@
 
     virtual QString propertyString() const;
     virtual QString sizeString() const;
+
+    virtual ObjectList<Primitive> outputPrimitives() const { return ObjectList<Primitive>(); }
+    virtual PrimitiveMap metas() const { return PrimitiveMap(); }
+
   public slots:
     double value() const;
 
--- branches/work/kst/portto4/kst/src/libkst/string_kst.h #1215762:1215763
@@ -24,7 +24,8 @@
 
 namespace Kst {
 
-class KSTCORE_EXPORT String : public Primitive {
+class KSTCORE_EXPORT String : public Primitive
+{
   Q_OBJECT
   Q_PROPERTY(bool orphan READ orphan WRITE setOrphan)
 
@@ -36,6 +37,7 @@
     virtual QString descriptionTip() const;
     virtual QString sizeString() const;
     virtual QString propertyString() const;
+
   protected:
     String(ObjectStore *store);
 
@@ -54,6 +56,9 @@
     String& operator=(const QString& v);
     String& operator=(const char *v);
 
+    virtual ObjectList<Primitive> outputPrimitives() const { return ObjectList<Primitive>(); }
+    virtual PrimitiveMap metas() const { return PrimitiveMap(); }
+
   public slots:
     /* return the value of the string */
     const QString& value() const { return _value; }
--- branches/work/kst/portto4/kst/src/libkst/vector.cpp #1215762:1215763
@@ -632,10 +632,10 @@
 PrimitiveMap Vector::metas() const
 {
   PrimitiveMap meta;
-  for (QHash<QString, ScalarPtr>::ConstIterator it = _scalars.begin(); it != _scalars.end(); ++it) {
+  for (QHash<QString, StringPtr>::ConstIterator it = _strings.begin(); it != _strings.end(); ++it) {
     meta[it.key()] = it.value();
   }
-  for (QHash<QString, StringPtr>::ConstIterator it = _strings.begin(); it != _strings.end(); ++it) {
+  for (QHash<QString, ScalarPtr>::ConstIterator it = _scalars.begin(); it != _scalars.end(); ++it) {
     meta[it.key()] = it.value();
   }
   return meta;


More information about the Kst mailing list