summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/datavis3d/engine/q3dbars.h70
-rw-r--r--src/datavis3d/engine/q3dmaps.h44
-rw-r--r--src/datavis3d/engine/qdataset.h12
-rw-r--r--src/datavis3dqml2/datavis3dqml2.pro4
-rw-r--r--src/datavis3dqml2/datavis3dqml2_plugin.cpp8
-rw-r--r--src/src.pro4
6 files changed, 73 insertions, 69 deletions
diff --git a/src/datavis3d/engine/q3dbars.h b/src/datavis3d/engine/q3dbars.h
index 4425c568..8101b940 100644
--- a/src/datavis3d/engine/q3dbars.h
+++ b/src/datavis3d/engine/q3dbars.h
@@ -68,85 +68,87 @@ public:
// Add a row of data. Each new row is added to the front of the sample space, moving previous
// rows back (if sample space is more than one row deep)
- void addDataRow(const QVector<GLfloat> &dataRow,
- const QString &labelRow = QString(),
- const QVector<QString> &labelsColumn = QVector<QString>());
+ Q_INVOKABLE void addDataRow(const QVector<GLfloat> &dataRow,
+ const QString &labelRow = QString(),
+ const QVector<QString> &labelsColumn = QVector<QString>());
// ownership of dataItems is transferred
- void addDataRow(const QVector<QDataItem*> &dataRow,
- const QString &labelRow = QString(),
- const QVector<QString> &labelsColumn = QVector<QString>());
+ Q_INVOKABLE void addDataRow(const QVector<QDataItem*> &dataRow,
+ const QString &labelRow = QString(),
+ const QVector<QString> &labelsColumn = QVector<QString>());
// ownership of dataRow is transferred
- void addDataRow(QDataRow *dataRow);
+ Q_INVOKABLE void addDataRow(QDataRow *dataRow);
// Add complete data set at a time, as a vector of data rows
- void addDataSet(const QVector< QVector<GLfloat> > &data,
- const QVector<QString> &labelsRow = QVector<QString>(),
- const QVector<QString> &labelsColumn = QVector<QString>());
+ Q_INVOKABLE void addDataSet(const QVector< QVector<GLfloat> > &data,
+ const QVector<QString> &labelsRow = QVector<QString>(),
+ const QVector<QString> &labelsColumn = QVector<QString>());
// ownership of dataItems is transferred
- void addDataSet(const QVector< QVector<QDataItem*> > &data,
- const QVector<QString> &labelsRow = QVector<QString>(),
- const QVector<QString> &labelsColumn = QVector<QString>());
+ Q_INVOKABLE void addDataSet(const QVector< QVector<QDataItem*> > &data,
+ const QVector<QString> &labelsRow = QVector<QString>(),
+ const QVector<QString> &labelsColumn = QVector<QString>());
// ownership of dataSet is transferred
- void addDataSet(QDataSet* dataSet);
+ Q_INVOKABLE void addDataSet(QDataSet* dataSet);
// bar thickness, spacing between bars, and is spacing relative to thickness or absolute
// y -component sets the thickness/spacing of z -direction
// With relative 0.0f means side-to-side, 1.0f = one thickness in between
- void setBarSpecs(QSizeF thickness = QSizeF(1.0f, 1.0f),
- QSizeF spacing = QSizeF(1.0f, 1.0f),
- bool relative = true);
+ Q_INVOKABLE void setBarSpecs(QSizeF thickness = QSizeF(1.0f, 1.0f),
+ QSizeF spacing = QSizeF(1.0f, 1.0f),
+ bool relative = true);
// bar type; bars (=cubes), pyramids, cones, cylinders, etc.
- void setBarType(BarStyle style, bool smooth = false);
+ Q_INVOKABLE void setBarType(BarStyle style, bool smooth = false);
// override bar type with own mesh
- void setMeshFileName(const QString &objFileName);
+ Q_INVOKABLE void setMeshFileName(const QString &objFileName);
// how many samples per row and column, and names for axes
- void setupSampleSpace(int samplesRow, int samplesColumn, const QString &labelRow = QString(),
- const QString &labelColumn = QString(),
- const QString &labelHeight = QString());
+ Q_INVOKABLE void setupSampleSpace(int samplesRow, int samplesColumn,
+ const QString &labelRow = QString(),
+ const QString &labelColumn = QString(),
+ const QString &labelHeight = QString());
// Select preset camera placement
- void setCameraPreset(CameraPreset preset);
+ Q_INVOKABLE void setCameraPreset(CameraPreset preset);
// Set camera rotation if you don't want to use the presets (in horizontal (-180...180) and
// vertical (0...90) angles and distance in percentage (10...500))
- void setCameraPosition(GLfloat horizontal, GLfloat vertical, GLint distance = 100);
+ Q_INVOKABLE void setCameraPosition(GLfloat horizontal, GLfloat vertical, GLint distance = 100);
// Set theme (bar colors, shaders, window color, background colors, light intensity and text colors are affected)
- void setTheme(ColorTheme theme);
+ Q_INVOKABLE void setTheme(ColorTheme theme);
// Set color if you don't want to use themes. Set uniform to false if you want the (height) color to change from bottom to top
- void setBarColor(QColor baseColor, QColor heightColor, QColor depthColor, bool uniform = true);
+ Q_INVOKABLE void setBarColor(QColor baseColor, QColor heightColor, QColor depthColor,
+ bool uniform = true);
// TODO: valon siirto / asetus
// Change selection mode; single bar, bar and row, bar and column, or all
- void setSelectionMode(SelectionMode mode);
+ Q_INVOKABLE void setSelectionMode(SelectionMode mode);
// Set window title
- void setWindowTitle(const QString &title);
+ Q_INVOKABLE void setWindowTitle(const QString &title);
// Font size adjustment (should it be in enum (smallest, smaller, small, normal, large, larger, largest), or just GLfloat?
- void setFontSize(GLfloat fontsize);
+ Q_INVOKABLE void setFontSize(GLfloat fontsize);
// Set font
- void setFont(const QFont &font);
+ Q_INVOKABLE void setFont(const QFont &font);
// Label transparency adjustment
- void setLabelTransparency(LabelTransparency transparency);
+ Q_INVOKABLE void setLabelTransparency(LabelTransparency transparency);
// Enable or disable background grid
- void setGridEnabled(bool enable);
+ Q_INVOKABLE void setGridEnabled(bool enable);
// Adjust shadow quality
- void setShadowQuality(ShadowQuality quality);
+ Q_INVOKABLE void setShadowQuality(ShadowQuality quality);
// Set tick count and step. Note; tickCount * step should be the maximum possible value of data set.
// Minimum is the absolute minimum possible value a bar can have. This is especially important to
// set if values can be negative.
- void setTickCount(GLint tickCount, GLfloat step, GLfloat minimum = 0.0f);
+ Q_INVOKABLE void setTickCount(GLint tickCount, GLfloat step, GLfloat minimum = 0.0f);
protected:
#if defined(Q_OS_ANDROID)
diff --git a/src/datavis3d/engine/q3dmaps.h b/src/datavis3d/engine/q3dmaps.h
index 61373b7a..de59f27e 100644
--- a/src/datavis3d/engine/q3dmaps.h
+++ b/src/datavis3d/engine/q3dmaps.h
@@ -80,73 +80,73 @@ public:
// Add data item. New data item is appended to old data.
// ownership of data is transferred
- bool addDataItem(QDataItem *dataItem);
+ Q_INVOKABLE bool addDataItem(QDataItem *dataItem);
// Add data set. New data is appended to old data.
// ownership of data is transferred
- bool addData(const QVector<QDataItem*> &data);
+ Q_INVOKABLE bool addData(const QVector<QDataItem*> &data);
// ownership of data is transferred
- bool addData(const QDataRow &data);
+ Q_INVOKABLE bool addData(const QDataRow &data);
// Add data set. Old data is deleted.
// ownership of data is transferred
- bool setData(const QVector<QDataItem*> &data);
+ Q_INVOKABLE bool setData(const QVector<QDataItem*> &data);
// ownership of data is transferred
- bool setData(QDataRow *data);
+ Q_INVOKABLE bool setData(QDataRow *data);
// bar specifications; base thickness in x, y and z, enum to indicate which direction is increased with value
// TODO: Start using thickness also in adjustment direction; use it as a relative value.
// For example, in AdjustAll mode setting thickness to (0.1f, 1.0f, 0.5f) would apply value to
// x at 10%, y at 100% and z at 50%. If a dimension is not included, given thickness states its absolute value.
- void setBarSpecs(const QVector3D &thickness = QVector3D(1.0f, 1.0f, 1.0f),
- AdjustmentDirection direction = AdjustHeight);
+ Q_INVOKABLE void setBarSpecs(const QVector3D &thickness = QVector3D(1.0f, 1.0f, 1.0f),
+ AdjustmentDirection direction = AdjustHeight);
// bar type; bars (=cubes), pyramids, cones, cylinders, balls, etc.
- void setBarType(BarStyle style, bool smooth = false);
+ Q_INVOKABLE void setBarType(BarStyle style, bool smooth = false);
// override bar type with own mesh
- void setMeshFileName(const QString &objFileName);
+ Q_INVOKABLE void setMeshFileName(const QString &objFileName);
// Select preset camera placement
- void setCameraPreset(CameraPreset preset);
+ Q_INVOKABLE void setCameraPreset(CameraPreset preset);
// Set camera rotation if you don't want to use the presets (in horizontal (-180...180) and
// vertical (0...90) angles and distance in percentage (10...500))
- void setCameraPosition(GLfloat horizontal, GLfloat vertical, GLint distance = 100);
+ Q_INVOKABLE void setCameraPosition(GLfloat horizontal, GLfloat vertical, GLint distance = 100);
// Set theme (bar colors, shaders, window color, background colors, light intensity and text colors are affected)
- void setTheme(ColorTheme theme);
+ Q_INVOKABLE void setTheme(ColorTheme theme);
// Set color if you don't want to use themes. Set uniform to false if you want the (height) color to change from bottom to top
- void setBarColor(QColor baseColor, QColor heightColor, bool uniform = true);
+ Q_INVOKABLE void setBarColor(QColor baseColor, QColor heightColor, bool uniform = true);
// TODO: valon siirto / asetus
// Change selection mode; single bar, bar and row, bar and column, or all
- void setSelectionMode(SelectionMode mode);
+ Q_INVOKABLE void setSelectionMode(SelectionMode mode);
// Set window title
- void setWindowTitle(const QString &title);
+ Q_INVOKABLE void setWindowTitle(const QString &title);
// Font size adjustment (should it be in enum (smallest, smaller, small, normal, large, larger, largest), or just GLfloat?
- void setFontSize(GLfloat fontsize);
+ Q_INVOKABLE void setFontSize(GLfloat fontsize);
// Set font
- void setFont(const QFont &font);
+ Q_INVOKABLE void setFont(const QFont &font);
// Label transparency adjustment
- void setLabelTransparency(LabelTransparency transparency);
+ Q_INVOKABLE void setLabelTransparency(LabelTransparency transparency);
// Enable or disable background grid
- void setGridEnabled(bool enable);
+ Q_INVOKABLE void setGridEnabled(bool enable);
// Set area specs
- void setAreaSpecs(const QRect &areaRect, const QImage &image);
+ Q_INVOKABLE void setAreaSpecs(const QRect &areaRect, const QImage &image);
// Set area image
- void setImage(const QImage &image);
+ Q_INVOKABLE void setImage(const QImage &image);
// Adjust shadow quality
- void setShadowQuality(ShadowQuality quality);
+ Q_INVOKABLE void setShadowQuality(ShadowQuality quality);
protected:
#if defined(Q_OS_ANDROID)
diff --git a/src/datavis3d/engine/qdataset.h b/src/datavis3d/engine/qdataset.h
index 02269a27..f0061ad8 100644
--- a/src/datavis3d/engine/qdataset.h
+++ b/src/datavis3d/engine/qdataset.h
@@ -62,12 +62,12 @@ public:
explicit QDataSet();
~QDataSet();
- void setLabels(const QString &xAxis = QString(),
- const QString &zAxis = QString(),
- const QString &yAxis = QString(),
- const QVector<QString> &labelsRow = QVector<QString>(),
- const QVector<QString> &labelsColumn = QVector<QString>());
- void addRow(QDataRow *row);
+ Q_INVOKABLE void setLabels(const QString &xAxis = QString(),
+ const QString &zAxis = QString(),
+ const QString &yAxis = QString(),
+ const QVector<QString> &labelsRow = QVector<QString>(),
+ const QVector<QString> &labelsColumn = QVector<QString>());
+ Q_INVOKABLE void addRow(QDataRow *row);
private:
QScopedPointer<QDataSetPrivate> d_ptr;
diff --git a/src/datavis3dqml2/datavis3dqml2.pro b/src/datavis3dqml2/datavis3dqml2.pro
index 7f42e45d..07a20fc4 100644
--- a/src/datavis3dqml2/datavis3dqml2.pro
+++ b/src/datavis3dqml2/datavis3dqml2.pro
@@ -1,11 +1,13 @@
TEMPLATE = lib
TARGET = datavis3dqml2
-QT += qml quick
+QT += qml quick datavis3d
CONFIG += qt plugin
TARGET = $$qtLibraryTarget($$TARGET)
uri = com.digia.QtDataVis3D
+staticlib:DEFINES+=QTENTERPRISE_DATAVIS3D_STATICLIB
+
# Input
INCLUDEPATH += ../datavis3d/engine
diff --git a/src/datavis3dqml2/datavis3dqml2_plugin.cpp b/src/datavis3dqml2/datavis3dqml2_plugin.cpp
index 12f6f3f1..3376f360 100644
--- a/src/datavis3dqml2/datavis3dqml2_plugin.cpp
+++ b/src/datavis3dqml2/datavis3dqml2_plugin.cpp
@@ -50,14 +50,14 @@ void Datavis3dqml2Plugin::registerTypes(const char *uri)
{
// @uri com.digia.QtDataVis3D
qmlRegisterType<DataVisView>(uri, 1, 0, "DataVisView");
-// qmlRegisterType<Q3DBars>(uri, 1, 0, "3DBars");
-// qmlRegisterType<Q3DMaps>(uri, 1, 0, "3DMaps");
+ qmlRegisterType<Q3DBars>(uri, 1, 0, "3DBars");
+ qmlRegisterType<Q3DMaps>(uri, 1, 0, "3DMaps");
qmlRegisterType<QDataItem>(uri, 1, 0, "DataItem");
qmlRegisterType<QDataRow>(uri, 1, 0, "DataRow");
-// qmlRegisterType<QDataSet>(uri, 1, 0, "DataSet");
+ qmlRegisterType<QDataSet>(uri, 1, 0, "DataSet");
}
-#include "moc_datavis3dqml2_plugin.cpp"
+//#include "moc_datavis3dqml2_plugin.cpp"
QTENTERPRISE_DATAVIS3D_END_NAMESPACE
diff --git a/src/src.pro b/src/src.pro
index d6bef647..d25722eb 100644
--- a/src/src.pro
+++ b/src/src.pro
@@ -1,3 +1,3 @@
TEMPLATE = subdirs
-SUBDIRS += datavis3d #\
- #datavis3dqml2
+SUBDIRS += datavis3d \
+ datavis3dqml2