parent
66ac0b3b7f
commit
846270fa80
|
@ -390,6 +390,10 @@ Tips:
|
||||||
<source>&Help</source>
|
<source>&Help</source>
|
||||||
<translation>帮助(&H)</translation>
|
<translation>帮助(&H)</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>Toggle Rotation</source>
|
||||||
|
<translation>打开/关闭自动旋转</translation>
|
||||||
|
</message>
|
||||||
</context>
|
</context>
|
||||||
<context>
|
<context>
|
||||||
<name>ExportPreviewWidget</name>
|
<name>ExportPreviewWidget</name>
|
||||||
|
@ -736,10 +740,6 @@ Tips:
|
||||||
<source>Paste Color</source>
|
<source>Paste Color</source>
|
||||||
<translation>粘贴颜色</translation>
|
<translation>粘贴颜色</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
|
||||||
<source>Remeshed</source>
|
|
||||||
<translation type="vanished">重新网格化</translation>
|
|
||||||
</message>
|
|
||||||
<message>
|
<message>
|
||||||
<source>Poly</source>
|
<source>Poly</source>
|
||||||
<translation>面数</translation>
|
<translation>面数</translation>
|
||||||
|
|
|
@ -727,6 +727,12 @@ DocumentWindow::DocumentWindow() :
|
||||||
});
|
});
|
||||||
m_viewMenu->addAction(m_toggleWireframeAction);
|
m_viewMenu->addAction(m_toggleWireframeAction);
|
||||||
|
|
||||||
|
m_toggleRotationAction = new QAction(tr("Toggle Rotation"), this);
|
||||||
|
connect(m_toggleRotationAction, &QAction::triggered, [=]() {
|
||||||
|
m_modelRenderWidget->toggleRotation();
|
||||||
|
});
|
||||||
|
m_viewMenu->addAction(m_toggleRotationAction);
|
||||||
|
|
||||||
m_toggleUvCheckAction = new QAction(tr("Toggle UV Check"), this);
|
m_toggleUvCheckAction = new QAction(tr("Toggle UV Check"), this);
|
||||||
connect(m_toggleUvCheckAction, &QAction::triggered, [=]() {
|
connect(m_toggleUvCheckAction, &QAction::triggered, [=]() {
|
||||||
m_modelRenderWidget->toggleUvCheck();
|
m_modelRenderWidget->toggleUvCheck();
|
||||||
|
|
|
@ -168,7 +168,7 @@ private:
|
||||||
QAction *m_resetModelWidgetPosAction;
|
QAction *m_resetModelWidgetPosAction;
|
||||||
QAction *m_toggleWireframeAction;
|
QAction *m_toggleWireframeAction;
|
||||||
QAction *m_toggleUvCheckAction;
|
QAction *m_toggleUvCheckAction;
|
||||||
QAction *m_showMotionsListAction;
|
QAction *m_toggleRotationAction;
|
||||||
|
|
||||||
QMenu *m_windowMenu;
|
QMenu *m_windowMenu;
|
||||||
QAction *m_showPartsListAction;
|
QAction *m_showPartsListAction;
|
||||||
|
|
|
@ -211,6 +211,22 @@ void ModelWidget::toggleWireframe()
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void ModelWidget::toggleRotation()
|
||||||
|
{
|
||||||
|
if (nullptr != m_rotationTimer) {
|
||||||
|
delete m_rotationTimer;
|
||||||
|
m_rotationTimer = nullptr;
|
||||||
|
} else {
|
||||||
|
m_rotationTimer = new QTimer(this);
|
||||||
|
m_rotationTimer->setInterval(42);
|
||||||
|
m_rotationTimer->setSingleShot(false);
|
||||||
|
connect(m_rotationTimer, &QTimer::timeout, this, [&]() {
|
||||||
|
setYRotation(m_yRot - 8);
|
||||||
|
});
|
||||||
|
m_rotationTimer->start();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void ModelWidget::toggleUvCheck()
|
void ModelWidget::toggleUvCheck()
|
||||||
{
|
{
|
||||||
if (m_meshBinder.isCheckUvEnabled())
|
if (m_meshBinder.isCheckUvEnabled())
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include <QMutex>
|
#include <QMutex>
|
||||||
#include <QRubberBand>
|
#include <QRubberBand>
|
||||||
#include <QVector2D>
|
#include <QVector2D>
|
||||||
|
#include <QTimer>
|
||||||
#include "meshloader.h"
|
#include "meshloader.h"
|
||||||
#include "modelshaderprogram.h"
|
#include "modelshaderprogram.h"
|
||||||
#include "modelmeshbinder.h"
|
#include "modelmeshbinder.h"
|
||||||
|
@ -36,6 +37,7 @@ public:
|
||||||
void updateMesh(MeshLoader *mesh);
|
void updateMesh(MeshLoader *mesh);
|
||||||
void setGraphicsFunctions(SkeletonGraphicsFunctions *graphicsFunctions);
|
void setGraphicsFunctions(SkeletonGraphicsFunctions *graphicsFunctions);
|
||||||
void toggleWireframe();
|
void toggleWireframe();
|
||||||
|
void toggleRotation();
|
||||||
void toggleUvCheck();
|
void toggleUvCheck();
|
||||||
void enableMove(bool enabled);
|
void enableMove(bool enabled);
|
||||||
void enableZoom(bool enabled);
|
void enableZoom(bool enabled);
|
||||||
|
@ -93,6 +95,7 @@ private:
|
||||||
QPoint m_moveStartPos;
|
QPoint m_moveStartPos;
|
||||||
QRect m_moveStartGeometry;
|
QRect m_moveStartGeometry;
|
||||||
int m_modelInitialHeight = 0;
|
int m_modelInitialHeight = 0;
|
||||||
|
QTimer *m_rotationTimer = nullptr;
|
||||||
std::pair<QVector3D, QVector3D> screenPositionToMouseRay(const QPoint &screenPosition);
|
std::pair<QVector3D, QVector3D> screenPositionToMouseRay(const QPoint &screenPosition);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue