24#include "camerafieldoption.h"
25#include "preferencemanager.h"
29enum class CameraMoveType {
52 ToolType type()
override {
return ToolType::CAMERA; }
56 void loadSettings()
override;
62 void setShowCameraPath(
const bool showCameraPath)
override;
63 void resetCameraPath()
override;
64 void setPathDotColorType(
const DotColorType pathDotColor)
override;
65 void resetTransform(CameraFieldOption option);
67 void transformView(
LayerCamera* layerCamera, CameraMoveType mode,
const QPointF& point,
const QPointF& offset, qreal angle,
int frameNumber)
const;
71 QPointF localRotationHandlePoint(
const QPoint& origin,
const QTransform& localT,
const qreal objectScale,
float worldScale)
const;
74 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;
75 void paintInterpolations(
QPainter& painter,
const QTransform& worldTransform,
int currentFrame,
const LayerCamera* cameraLayer,
const Camera* keyframe,
bool isPlaying)
const;
76 void paintControlPoint(
QPainter& painter,
const QTransform& worldTransform,
const LayerCamera* cameraLayer,
const int frameIndex,
const QPointF& pathPoint,
bool hollowHandle)
const;
78 void updateMoveMode(
const QPointF& pos);
80 void transformCameraPath(
const QPointF& pos);
81 void updateSettings(
const SETTING setting);
82 int constrainedRotation(
const qreal rotatedAngle,
const int rotationIncrement)
const;
84 void updateProperties();
85 void updateUIAssists(
const Layer* layer);
87 qreal getAngleBetween(
const QPointF& pos1,
const QPointF& pos2)
const;
89 CameraMoveType getCameraMoveMode(
const QPointF& point, qreal tolerance)
const;
90 CameraMoveType getPathMoveMode(
const LayerCamera* layerCamera,
int frameNumber,
const QPointF& point, qreal tolerance)
const;
93 CameraMoveType mCamMoveMode = CameraMoveType::NONE;
94 int mDragPathFrame = 1;
95 int mRotationIncrement = 0;
101 qreal mStartAngle = 0;
102 qreal mCurrentAngle = 0;
104 const int mDotWidth = 6;
105 const int mHandleWidth = 12;
106 const qreal mRotationHandleOffsetPercentage = 0.05;
110 QColor mHandleDisabledColor;
virtual bool event(QEvent *e)
typedef KeyboardModifiers