24#include "camerafieldoption.h"
25#include "preferencemanager.h"
29enum class CameraMoveType {
52 ToolType type()
override {
return ToolType::CAMERA; }
56 void loadSettings()
override;
57 void saveSettings()
override;
63 void setShowCameraPath(
const bool showCameraPath)
override;
64 void resetCameraPath()
override;
65 void setPathDotColorType(
const DotColorType pathDotColor)
override;
66 void resetTransform(CameraFieldOption option);
68 void transformView(
LayerCamera* layerCamera, CameraMoveType mode,
const QPointF& point,
const QPointF& offset, qreal angle,
int frameNumber)
const;
72 QPointF localRotationHandlePoint(
const QPoint& origin,
const QTransform& localT,
const qreal objectScale,
float worldScale)
const;
75 void paintHandles(
QPainter& painter,
const QTransform& worldTransform,
const QTransform& camTransform,
const QRect& cameraRect,
const QPointF translation,
const qreal scale,
const qreal rotation,
bool hollowHandles)
const;
76 void paintInterpolations(
QPainter& painter,
const QTransform& worldTransform,
int currentFrame,
const LayerCamera* cameraLayer,
const Camera* keyframe,
bool isPlaying)
const;
77 void paintControlPoint(
QPainter& painter,
const QTransform& worldTransform,
const LayerCamera* cameraLayer,
const int frameIndex,
const QPointF& pathPoint,
bool hollowHandle)
const;
79 void updateMoveMode(
const QPointF& pos);
81 void transformCameraPath(
const QPointF& pos);
82 void updateSettings(
const SETTING setting);
83 int constrainedRotation(
const qreal rotatedAngle,
const int rotationIncrement)
const;
85 void updateProperties();
86 void updateUIAssists(
const Layer* layer);
88 qreal getAngleBetween(
const QPointF& pos1,
const QPointF& pos2)
const;
90 CameraMoveType getCameraMoveMode(
const QPointF& point, qreal tolerance)
const;
91 CameraMoveType getPathMoveMode(
const LayerCamera* layerCamera,
int frameNumber,
const QPointF& point, qreal tolerance)
const;
94 CameraMoveType mCamMoveMode = CameraMoveType::NONE;
95 int mDragPathFrame = 1;
96 int mRotationIncrement = 0;
102 qreal mStartAngle = 0;
103 qreal mCurrentAngle = 0;
105 const int mDotWidth = 6;
106 const int mHandleWidth = 12;
107 const qreal mRotationHandleOffsetPercentage = 0.05;
111 QColor mHandleDisabledColor;
virtual bool event(QEvent *e)
typedef KeyboardModifiers