[Kst] branches/work/kst/portto4/kst/src/libkstapp
Peter Kümmel
syntheticpp at gmx.net
Wed Jan 19 15:08:08 CET 2011
SVN commit 1215746 by kuemmel:
cleanup: make header more readable
M +32 -17 primitivemodel.h
--- branches/work/kst/portto4/kst/src/libkstapp/primitivemodel.h #1215745:1215746
@@ -62,7 +62,34 @@
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
template<class T>
- void createTree() {
+ void createTree();
+
+ template<class T>
+ void addMeta(T* m, PrimitiveTreeItem* parent = 0);
+
+ template<class T>
+ void addMetas(const PrimitiveMap& metarMap, PrimitiveTreeItem* parent);
+
+ template<class T>
+ void addPrimitivesMetas(const PrimitivePtr& prim, PrimitiveTreeItem* parent = 0);
+
+ template<class T>
+ void addDataObjectsMetas(DataObjectPtr dataObject, PrimitiveTreeItem* parent = 0);
+
+ virtual void addDataSourcesMetas(DataSourcePtr dataSource, PrimitiveTreeItem* parent = 0) = 0;
+
+protected:
+ PrimitiveTreeItem* addPrimitiveTreeItem(const QList<QVariant>& data, PrimitiveTreeItem* parent);
+
+private:
+ ObjectStore *_store;
+ PrimitiveTreeItem *_rootItem;
+};
+
+
+
+template<class T>
+void PrimitiveModel::createTree() {
QList<ObjectPtr> objects = _store->objectList();
foreach(const ObjectPtr& obj, objects) {
if (kst_cast<Primitive>(obj)) {
@@ -80,12 +107,12 @@
template<class T>
- void addMeta(T* m, PrimitiveTreeItem* parent = 0) {
+void PrimitiveModel::addMeta(T* m, PrimitiveTreeItem* parent) {
addPrimitiveTreeItem(QList<QVariant>() << m->Name() << m->value(), parent);
}
template<class T>
- void addMetas(const PrimitiveMap& metarMap, PrimitiveTreeItem* parent) {
+void PrimitiveModel::addMetas(const PrimitiveMap& metarMap, PrimitiveTreeItem* parent) {
foreach(const PrimitivePtr& m, metarMap) {
if(kst_cast<T>(m)) {
addMeta<T>(kst_cast<T>(m), parent);
@@ -94,13 +121,13 @@
}
template<class T>
- void addPrimitivesMetas(const PrimitivePtr& prim, PrimitiveTreeItem* parent = 0) {
+void PrimitiveModel::addPrimitivesMetas(const PrimitivePtr& prim, PrimitiveTreeItem* parent) {
PrimitiveTreeItem* item = addPrimitiveTreeItem(QList<QVariant>() << prim->Name(), parent);
addMetas<T>(prim->metas(), item);
}
template<class T>
- void addDataObjectsMetas(DataObjectPtr dataObject, PrimitiveTreeItem* parent = 0) {
+void PrimitiveModel::addDataObjectsMetas(DataObjectPtr dataObject, PrimitiveTreeItem* parent) {
PrimitiveTreeItem* item = addPrimitiveTreeItem(QList<QVariant>() << dataObject->Name(), parent);
ObjectList<Primitive> primitives = dataObject->outputPrimitives();
@@ -111,21 +138,9 @@
}
}
- virtual void addDataSourcesMetas(DataSourcePtr dataSource, PrimitiveTreeItem* parent = 0) = 0;
-protected:
- PrimitiveTreeItem* addPrimitiveTreeItem(const QList<QVariant>& data, PrimitiveTreeItem* parent);
-private:
- ObjectStore *_store;
- PrimitiveTreeItem *_rootItem;
-};
-
-
-
-
-
}
#endif
More information about the Kst
mailing list