summaryrefslogtreecommitdiffstats
path: root/src/datavis3d/utils
diff options
context:
space:
mode:
authorTomi Korpipää <tomi.korpipaa@digia.com>2013-08-14 13:50:52 +0300
committerTomi Korpipää <tomi.korpipaa@digia.com>2013-08-14 13:52:21 +0300
commit3b7fb533df9212df76c7c90a067ae3a3219b003a (patch)
treeeef561dcf6cdf9319a74e78d615bb210620383f3 /src/datavis3d/utils
parent31714127f9ad60bd3f0fc4ea29531f759503241d (diff)
Enums moved to a class to be usable from QML and C++
Task-number: QTRD-2126 Change-Id: I280047cc7101292d17111babb7735c03436a40f4 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Diffstat (limited to 'src/datavis3d/utils')
-rw-r--r--src/datavis3d/utils/camerahelper.cpp50
-rw-r--r--src/datavis3d/utils/camerahelper_p.h2
-rw-r--r--src/datavis3d/utils/utils.cpp10
-rw-r--r--src/datavis3d/utils/utils_p.h2
4 files changed, 32 insertions, 32 deletions
diff --git a/src/datavis3d/utils/camerahelper.cpp b/src/datavis3d/utils/camerahelper.cpp
index 1e7f255c..5ae91adb 100644
--- a/src/datavis3d/utils/camerahelper.cpp
+++ b/src/datavis3d/utils/camerahelper.cpp
@@ -155,125 +155,125 @@ QPointF CameraHelper::getCameraRotations()
return rotations;
}
-void CameraHelper::setCameraPreset(CameraPreset preset)
+void CameraHelper::setCameraPreset(QDataVis::CameraPreset preset)
{
switch (preset) {
- case PresetFrontLow: {
+ case QDataVis::PresetFrontLow: {
qDebug("PresetFrontLow");
CameraHelper::setCameraRotation(QPointF(0.0f, 0.0f));
break;
}
- case PresetFront: {
+ case QDataVis::PresetFront: {
qDebug("PresetFront");
CameraHelper::setCameraRotation(QPointF(0.0f, 22.5f));
break;
}
- case PresetFrontHigh: {
+ case QDataVis::PresetFrontHigh: {
qDebug("PresetFrontHigh");
CameraHelper::setCameraRotation(QPointF(0.0f, 45.0f));
break;
}
- case PresetLeftLow: {
+ case QDataVis::PresetLeftLow: {
qDebug("PresetLeftLow");
CameraHelper::setCameraRotation(QPointF(90.0f, 0.0f));
break;
}
- case PresetLeft: {
+ case QDataVis::PresetLeft: {
qDebug("PresetLeft");
CameraHelper::setCameraRotation(QPointF(90.0f, 22.5f));
break;
}
- case PresetLeftHigh: {
+ case QDataVis::PresetLeftHigh: {
qDebug("PresetLeftHigh");
CameraHelper::setCameraRotation(QPointF(90.0f, 45.0f));
break;
}
- case PresetRightLow: {
+ case QDataVis::PresetRightLow: {
qDebug("PresetRightLow");
CameraHelper::setCameraRotation(QPointF(-90.0f, 0.0f));
break;
}
- case PresetRight: {
+ case QDataVis::PresetRight: {
qDebug("PresetRight");
CameraHelper::setCameraRotation(QPointF(-90.0f, 22.5f));
break;
}
- case PresetRightHigh: {
+ case QDataVis::PresetRightHigh: {
qDebug("PresetRightHigh");
CameraHelper::setCameraRotation(QPointF(-90.0f, 45.0f));
break;
}
- case PresetBehindLow: {
+ case QDataVis::PresetBehindLow: {
qDebug("PresetBehindLow");
CameraHelper::setCameraRotation(QPointF(180.0f, 0.0f));
break;
}
- case PresetBehind: {
+ case QDataVis::PresetBehind: {
qDebug("PresetBehind");
CameraHelper::setCameraRotation(QPointF(180.0f, 22.5f));
break;
}
- case PresetBehindHigh: {
+ case QDataVis::PresetBehindHigh: {
qDebug("PresetBehindHigh");
CameraHelper::setCameraRotation(QPointF(180.0f, 45.0f));
break;
}
- case PresetIsometricLeft: {
+ case QDataVis::PresetIsometricLeft: {
qDebug("PresetIsometricLeft");
CameraHelper::setCameraRotation(QPointF(45.0f, 22.5f));
break;
}
- case PresetIsometricLeftHigh: {
+ case QDataVis::PresetIsometricLeftHigh: {
qDebug("PresetIsometricLeftHigh");
CameraHelper::setCameraRotation(QPointF(45.0f, 45.0f));
break;
}
- case PresetIsometricRight: {
+ case QDataVis::PresetIsometricRight: {
qDebug("PresetIsometricRight");
CameraHelper::setCameraRotation(QPointF(-45.0f, 22.5f));
break;
}
- case PresetIsometricRightHigh: {
+ case QDataVis::PresetIsometricRightHigh: {
qDebug("PresetIsometricRightHigh");
CameraHelper::setCameraRotation(QPointF(-45.0f, 45.0f));
break;
}
- case PresetDirectlyAbove: {
+ case QDataVis::PresetDirectlyAbove: {
qDebug("PresetDirectlyAbove");
CameraHelper::setCameraRotation(QPointF(0.0f, 90.0f));
break;
}
- case PresetDirectlyAboveCW45: {
+ case QDataVis::PresetDirectlyAboveCW45: {
qDebug("PresetDirectlyAboveCW45");
CameraHelper::setCameraRotation(QPointF(-45.0f, 90.0f));
break;
}
- case PresetDirectlyAboveCCW45: {
+ case QDataVis::PresetDirectlyAboveCCW45: {
qDebug("PresetDirectlyAboveCCW45");
CameraHelper::setCameraRotation(QPointF(45.0f, 90.0f));
break;
}
- case PresetFrontBelow: {
+ case QDataVis::PresetFrontBelow: {
qDebug("PresetFrontBelow");
CameraHelper::setCameraRotation(QPointF(0.0f, -45.0f));
break;
}
- case PresetLeftBelow: {
+ case QDataVis::PresetLeftBelow: {
qDebug("PresetLeftBelow");
CameraHelper::setCameraRotation(QPointF(90.0f, -45.0f));
break;
}
- case PresetRightBelow: {
+ case QDataVis::PresetRightBelow: {
qDebug("PresetRightBelow");
CameraHelper::setCameraRotation(QPointF(-90.0f, -45.0f));
break;
}
- case PresetBehindBelow: {
+ case QDataVis::PresetBehindBelow: {
qDebug("PresetBehindBelow");
CameraHelper::setCameraRotation(QPointF(180.0f, -45.0f));
break;
}
- case PresetDirectlyBelow: {
+ case QDataVis::PresetDirectlyBelow: {
qDebug("PresetDirectlyBelow");
CameraHelper::setCameraRotation(QPointF(0.0f, -90.0f));
break;
diff --git a/src/datavis3d/utils/camerahelper_p.h b/src/datavis3d/utils/camerahelper_p.h
index 89eeda9f..3b8c0c9c 100644
--- a/src/datavis3d/utils/camerahelper_p.h
+++ b/src/datavis3d/utils/camerahelper_p.h
@@ -82,7 +82,7 @@ public:
GLfloat fixedRotation = 0.0f,
GLfloat distanceModifier = 0.0f);
void updateMousePos(const QPoint &mousePos);
- void setCameraPreset(CameraPreset preset);
+ void setCameraPreset(QDataVis::CameraPreset preset);
};
QT_DATAVIS3D_END_NAMESPACE
diff --git a/src/datavis3d/utils/utils.cpp b/src/datavis3d/utils/utils.cpp
index 376ce94d..cf6b91f8 100644
--- a/src/datavis3d/utils/utils.cpp
+++ b/src/datavis3d/utils/utils.cpp
@@ -121,7 +121,7 @@ void Utils::printText(QPainter *painter, const QString &text, const QSize &posit
}
QImage Utils::printTextToImage(const QFont &font, const QString &text, const QColor &bgrColor,
- const QColor &txtColor, LabelTransparency transparency)
+ const QColor &txtColor, QDataVis::LabelTransparency transparency)
{
GLuint paddingWidth = 15;
GLuint paddingHeight = 15;
@@ -147,7 +147,7 @@ QImage Utils::printTextToImage(const QFont &font, const QString &text, const QCo
paddingHeight /= 2;
//qDebug() << "label size after padding" << labelSize << paddingWidth << paddingHeight;
#else
- if (TransparencyNoBackground == transparency)
+ if (QDataVis::TransparencyNoBackground == transparency)
labelSize = QSize(valueStrWidth, valueStrHeight);
else
labelSize = QSize(valueStrWidth + paddingWidth * 2, valueStrHeight + paddingHeight * 2);
@@ -164,7 +164,7 @@ QImage Utils::printTextToImage(const QFont &font, const QString &text, const QCo
painter.setCompositionMode(QPainter::CompositionMode_Source);
switch (transparency) {
// TODO: Texture size padding fix for Android f**ks this up for axis labels. Fix or disable for android.
- case TransparencyNoBackground: {
+ case QDataVis::TransparencyNoBackground: {
painter.setFont(valueFont);
painter.setPen(txtColor);
painter.drawText(0, 0,
@@ -173,7 +173,7 @@ QImage Utils::printTextToImage(const QFont &font, const QString &text, const QCo
text);
break;
}
- case TransparencyFromTheme: {
+ case QDataVis::TransparencyFromTheme: {
painter.setBrush(QBrush(bgrColor));
painter.setPen(bgrColor);
painter.drawRoundedRect(0, 0, labelSize.width(), labelSize.height(), 10.0, 10.0f);
@@ -185,7 +185,7 @@ QImage Utils::printTextToImage(const QFont &font, const QString &text, const QCo
text);
break;
}
- case TransparencyNone: {
+ case QDataVis::TransparencyNone: {
painter.setBrush(QBrush(bgrColor));
painter.setPen(bgrColor);
painter.drawRect(0, 0, labelSize.width(), labelSize.height());
diff --git a/src/datavis3d/utils/utils_p.h b/src/datavis3d/utils/utils_p.h
index f6d689ce..fe7d6081 100644
--- a/src/datavis3d/utils/utils_p.h
+++ b/src/datavis3d/utils/utils_p.h
@@ -52,7 +52,7 @@ class Utils
const QString &text,
const QColor &bgrColor,
const QColor &txtColor,
- LabelTransparency transparency);
+ QDataVis::LabelTransparency transparency);
static QVector3D getSelection(QPoint mousepos, int height);
};