17#include "cameraoptionswidget.h"
18#include "ui_cameraoptionswidget.h"
21#include "toolmanager.h"
22#include "layermanager.h"
24#include "cameratool.h"
26CameraOptionsWidget::CameraOptionsWidget(
Editor* editor,
QWidget *parent) :
32 auto toolMan = mEditor->tools();
33 connect(ui->showCameraPathCheckBox, &
QCheckBox::clicked, toolMan, &ToolManager::setShowCameraPath);
38 toolMan->resetCameraTransform(CameraFieldOption::RESET_FIELD);
41 toolMan->resetCameraTransform(CameraFieldOption::RESET_TRANSLATION);
44 toolMan->resetCameraTransform(CameraFieldOption::RESET_ROTATION);
47 toolMan->resetCameraTransform(CameraFieldOption::RESET_SCALING);
50 connect(toolMan, &ToolManager::toolPropertyChanged,
this, &CameraOptionsWidget::onToolPropertyChanged);
52 connect(mEditor->layers(), &LayerManager::currentLayerChanged,
this, &CameraOptionsWidget::updateUI);
53 connect(mEditor->tools(), &ToolManager::toolChanged,
this, &CameraOptionsWidget::updateUI);
55 mCameraTool =
static_cast<CameraTool*
>(mEditor->tools()->getTool(CAMERA));
58CameraOptionsWidget::~CameraOptionsWidget()
63void CameraOptionsWidget::updateUI()
66 Q_ASSERT(mCameraTool->type() == CAMERA);
70 setShowCameraPath(p.cameraShowPath);
71 setPathDotColorType(p.cameraPathDotColorType);
74void CameraOptionsWidget::onToolPropertyChanged(ToolType, ToolPropertyType ePropertyType)
78 switch (ePropertyType)
80 case CAMERAPATH: { setShowCameraPath(p.cameraShowPath);
break; }
86void CameraOptionsWidget::setShowCameraPath(
bool showCameraPath)
89 ui->showCameraPathCheckBox->setChecked(showCameraPath);
92void CameraOptionsWidget::setPathDotColorType(DotColorType index)
95 ui->pathColorComboBox->setCurrentIndex(
static_cast<int>(index));
void currentIndexChanged(int index)