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