diff options
author | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2018-06-01 13:20:43 +0300 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@qt.io> | 2018-06-01 11:37:33 +0000 |
commit | b13294bc39a1759e55e057e0e73f998bf1347450 (patch) | |
tree | b26d8cf06561c0f5ccd44f3a3ddbb2792f612123 /src | |
parent | 52e69f91b631d4fa0aae135dea8bc7bad277cbd7 (diff) |
Handle trivial timeline TODOs
Went through timeline TODOs and removed ones that are no longer valid
and did trivial ones.
Task-number: QT3DS-1828
Change-Id: I717c4fae21bd2d95136c0cec63e4b304bbb3d24d
Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
Reviewed-by: Kaj Grönholm <kaj.gronholm@qt.io>
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src')
13 files changed, 6 insertions, 339 deletions
diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/KeyframeManager.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/KeyframeManager.cpp index d0f234e9..e234e99e 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/KeyframeManager.cpp +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/KeyframeManager.cpp @@ -61,15 +61,6 @@ using namespace qt3dsdm; -// Mahmmoud_TODO: This function is copied from old timeline code. It should be removed after the -// new timeline is done (during cleanup of old timeline) -// legacy stuff that we have to support for animation tracks in the old data model to work -inline void PostExecuteCommand(IDoc *inDoc) -{ - CDoc *theDoc = dynamic_cast<CDoc *>(inDoc); - theDoc->GetCore()->CommitCurrentCommand(); -} - KeyframeManager::KeyframeManager(TimelineGraphicsScene *scene) : m_scene(scene) , m_pasteKeyframeCommandHelper(nullptr) @@ -263,7 +254,6 @@ bool KeyframeManager::deleteSelectedKeyframes() m_selectedKeyframesMasterRows.clear(); g_StudioApp.GetCore()->ExecuteCommand(cmd); - PostExecuteCommand(theDoc); return true; } @@ -377,20 +367,6 @@ void KeyframeManager::pasteKeyframes() } } -// Mahmoud_TODO: this method is not used anymore, will be removed by finishing the new timeline -QList<Keyframe *> KeyframeManager::filterKeyframesForRow(RowTimeline *row, - const QList<Keyframe *> &keyframes) -{ - QList<Keyframe *> result; - - for (auto keyframe : keyframes) { - if (SUPPORTED_ROW_PROPS[row->rowTree()->rowType()].contains(keyframe->propertyType)) - result.append(keyframe); - } - - return result; -} - void KeyframeManager::moveSelectedKeyframes(double dx) { double dt = m_scene->ruler()->distanceToTime(dx); @@ -621,85 +597,3 @@ void KeyframeManager::SetChangedKeyframes() } } } - -// Mahmoud_TODO: this Map is not used anymore, will be removed by finishing the new timeline -const QHash<int, QList<QString>> KeyframeManager::SUPPORTED_ROW_PROPS = { - { OBJTYPE_LAYER, { - "Left", - "Width", - "Top", - "Height", - "Ambient Occulusion", - "AO Distance", - "AO Softness", - "AO Threshold", - "AO Sampling Rate", - "IBL Brightness", - "IBL Horizon Cutoff", - "IBL FOV Angle" } - }, - { OBJTYPE_CAMERA, { - "Position", - "Rotation", - "Scale", - "Pivot", - "FieldOfView", - "ClippingStart", - "ClippingEnd" } - }, - { OBJTYPE_LIGHT, { - "Position", - "Rotation", - "Scale", - "Pivot", - "LightColor", - "SpecularColor", - "AmbientColor", - "Brightness", - "ShadowDarkness", - "ShadowSoftness", - "ShadowDepthBias", - "ShadowFarClip", - "ShadowFOV" } - }, - { OBJTYPE_MODEL, { - "Position", - "Rotation", - "Scale", - "Pivot", - "Opacity", - "EdgeTessellation", - "InnerTessellation" } - }, - { OBJTYPE_TEXT, { - "Position", - "Rotation", - "Scale", - "Pivot", - "Opacity", - "TextColor", - "Leading", - "Tracking" } - }, - { OBJTYPE_ALIAS, { - "Position", - "Rotation", - "Scale", - "Pivot", - "Opacity" } - }, - { OBJTYPE_GROUP, { - "Position", - "Rotation", - "Scale", - "Pivot", - "Opacity" } - }, - { OBJTYPE_COMPONENT, { - "Position", - "Rotation", - "Scale", - "Pivot", - "Opacity" } - } -}; diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/KeyframeManager.h b/src/Authoring/Studio/Palettes/TimelineGraphicsView/KeyframeManager.h index e08f1483..05626726 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/KeyframeManager.h +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/KeyframeManager.h @@ -93,9 +93,6 @@ public: void SetChangedKeyframes() override; private: - static const QHash<int, QList<QString>> SUPPORTED_ROW_PROPS; - - QList<Keyframe *> filterKeyframesForRow(RowTimeline *row, const QList<Keyframe *> &keyframes); qt3dsdm::SGetOrSetKeyframeInfo setKeyframeInfo(qt3dsdm::Qt3DSDMKeyframeHandle inKeyframe, qt3dsdm::IAnimationCore &inCore); CPasteKeyframeCommandHelper *m_pasteKeyframeCommandHelper; diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp index cdb2ab41..44c01622 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowMover.cpp @@ -329,7 +329,7 @@ void RowMover::updateTargetRow(const QPointF &scenePos, EStudioObjectType rowTyp updateTargetRowLater = std::bind(&RowMover::updateTargetRow, this, scenePos, rowType); m_rowAutoExpand = rowInsert1; - m_autoExpandTimer.start(TimelineConstants::AUTO_EXPAND_Time); + m_autoExpandTimer.start(TimelineConstants::AUTO_EXPAND_TIME); } else { m_rowAutoExpand = nullptr; m_autoExpandTimer.stop(); diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowTypes.h b/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowTypes.h index 36f59fc8..94c5a7f0 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowTypes.h +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/RowTypes.h @@ -31,46 +31,6 @@ #include <qglobal.h> -// Mahmoud_TODO: to be removed -enum class PropertyType { - None = 200, - Position, - Rotation, - Scale, - Pivot, - Opacity, - EdgeTessellation, - InnerTessellation, - TextColor, // Text - Leading, // Text - Tracking, // Text - LightColor, // Light - SpecularColor, // Light - AmbientColor, // Light - Brightness, // Light - ShadowDarkness, // Light - ShadowSoftness, // Light - ShadowDepthBias, // Light - ShadowFarClip, // Light - ShadowFOV, // Light - FieldOfView, // Camera - ClippingStart, // Camera - ClippingEnd, // Camera - Left, // Layer - Top, // Layer - Width, // Layer - Height, // Layer - AO, // Layer - AODistance, // Layer - AOSoftness, // Layer - AOThreshold, // Layer - AOSamplingRate, // Layer - IBLBrightness, // Layer - IBLHorizonCutoff, // Layer - IBLFOVAngle, // Layer - ProbeCrossfade, // Layer -}; - enum class TimelineControlType { None = 300, KeyFrame, diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineConstants.h b/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineConstants.h index 7a619e90..e680aaf0 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineConstants.h +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineConstants.h @@ -89,9 +89,9 @@ namespace TimelineConstants const int AUTO_SCROLL_PERIOD = 50; // time steps (millis) while auto scrolling const int AUTO_SCROLL_DELTA = 8; // increment in scroll at each time step const int AUTO_SCROLL_TRIGGER = 500; // time after which auto scroll starts (millis) - const int AUTO_EXPAND_Time = 500; // auto expand a hovered row (while DnD-ing) + const int AUTO_EXPAND_TIME = 500; // auto expand a hovered row (while DnD-ing) - // TODO: move the colors (and maybe dimensions) to StudioPreferences. + // TODO: move the colors and dimensions to StudioPreferences. } #endif // TIMELINECONSTANTS_H diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineGraphicsScene.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineGraphicsScene.cpp index 9cc82328..c1ca8e9b 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineGraphicsScene.cpp +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineGraphicsScene.cpp @@ -191,25 +191,6 @@ TimelineGraphicsScene::TimelineGraphicsScene(TimelineWidget *timelineWidget) action->setShortcutContext(Qt::ApplicationShortcut); connect(action, &QAction::triggered, this, &TimelineGraphicsScene::handleLockSelected); timelineWidget->addAction(action); - - // TODO: Shortcuts for these to be determined -// action = new QAction(this); -// action->setShortcut(QKeySequence(TBD)); -// action->setShortcutContext(Qt::ApplicationShortcut); -// connect(action, &QAction::triggered, m_treeHeader, &TreeHeader::toggleFilterShy); -// timelineWidget->addAction(action); - -// action = new QAction(this); -// action->setShortcut(QKeySequence(TBD)); -// action->setShortcutContext(Qt::ApplicationShortcut); -// connect(action, &QAction::triggered, m_treeHeader, &TreeHeader::toggleFilterVisible); -// timelineWidget->addAction(action); - -// action = new QAction(this); -// action->setShortcut(QKeySequence(TBD)); -// action->setShortcutContext(Qt::ApplicationShortcut); -// connect(action, &QAction::triggered, m_treeHeader, &TreeHeader::toggleFilterLock); -// timelineWidget->addAction(action); } TimelineGraphicsScene::~TimelineGraphicsScene() @@ -236,40 +217,6 @@ void TimelineGraphicsScene::updateTimelineLayoutWidth() m_layoutTimeline->setMinimumWidth(timelineWidth); m_layoutTimeline->setMaximumWidth(timelineWidth); - // Mahmoud_TODO: could be requested by UX. else will be removed -// m_widgetTimeline->viewTimelineContent()->horizontalScrollBar()->setValue( -// m_widgetTimeline->viewTimelineContent()->horizontalScrollBar()->maximum()); - -// if (m_editedTimelineRow) -// m_widgetTimeline->viewTimelineContent()->ensureVisible(m_editedTimelineRow); -} - -// TODO: test function, to be removed -void debugPrintRows(RowTree *row) -{ - qDebug().noquote().nospace() << "|" << QString("-").repeated(row->depth()) << row->label(); - - if (!row->empty()) { - for (auto child : row->childRows()) - debugPrintRows(child); - } -} - -// Mahmoud_TODO: debug func, remove -void printAsset(Q3DStudio::TIdentifier asset, QString padding = " ") -{ - TAssetGraphPtr assetGraph = g_StudioApp.GetCore()->GetDoc()->GetAssetGraph(); - padding = padding.append("-"); - - for (int i = 0; i < assetGraph.get()->GetChildCount(asset); i++) { - qDebug().noquote().nospace() - << "\x1b[42m \x1b[1m" << __FUNCTION__ - << padding - << assetGraph.get()->GetChild(asset, i) - << "\x1b[m"; - - printAsset(assetGraph.get()->GetChild(asset, i), padding); - } } void TimelineGraphicsScene::commitMoveRows() diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineUtils.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineUtils.cpp deleted file mode 100644 index 4c9a0bf8..00000000 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineUtils.cpp +++ /dev/null @@ -1,34 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt 3D Studio. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "TimelineUtils.h" - -TimelineUtils::TimelineUtils() -{ - // TODO: delete if not needed by the end of the timeline task -} diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineUtils.h b/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineUtils.h deleted file mode 100644 index fd5889a1..00000000 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineUtils.h +++ /dev/null @@ -1,39 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2018 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt 3D Studio. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef TIMELINEUTILS_H -#define TIMELINEUTILS_H - - -class TimelineUtils -{ -public: - TimelineUtils(); -}; - -#endif // TIMELINEUTILS_H diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineWidget.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineWidget.cpp index e60d7ddd..a320599c 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineWidget.cpp +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/TimelineWidget.cpp @@ -66,53 +66,6 @@ #include <QtWidgets/qlabel.h> #include <QtWidgets/qcolordialog.h> -// Mahmoud_TODO: debug func, to be removed -void printBinding(ITimelineItemBinding *binding, QString padding = " ") -{ - qDebug().noquote().nospace() - << "\x1b[42m \x1b[1m" << __FUNCTION__ - << padding - << binding->GetTimelineItem()->GetName().toQString() - << " (" << static_cast<Qt3DSDMTimelineItemBinding *>(binding)->GetInstance() << ")" - << "\x1b[m"; - - for (int i = 0; i < binding->GetPropertyCount(); i++) { - ITimelineItemProperty *property = binding->GetProperty(i); - qDebug().noquote().nospace() - << "\x1b[42m \x1b[1m" << __FUNCTION__ - << padding - << "[" << property->GetName().toQString() << "]" - << " (" << static_cast<Qt3DSDMTimelineItemProperty*>(property)->getPropertyHandle() << ")" - << "\x1b[m"; - - for (int j = 0; j < property->GetKeyframeCount(); j++) { - IKeyframe *kf = property->GetKeyframeByIndex(j); - qDebug().noquote().nospace() - << "\x1b[42m \x1b[1m" << __FUNCTION__ - << padding - << " {KF: " << kf->GetTime() << ", selected: " << kf->IsSelected() << "}" - << "\x1b[m"; - } - } - padding = padding.append("-"); - - // create child rows recursively - const QList<ITimelineItemBinding *> children = binding->GetChildren(); - for (auto child : children) - printBinding(child, padding); -} - -// Mahmoud_TODO: debug func, to be removed -void printHandlesMap(std::map<qt3dsdm::Qt3DSDMInstanceHandle, RowTree *> theBindingMap) -{ - for (auto& kv : theBindingMap) - qDebug().noquote().nospace() - << "\x1b[42m \x1b[1m" << __FUNCTION__ - << ", k=" << kv.first - << ", v=" << (kv.second == nullptr ? "--" : kv.second->label()) - << "\x1b[m"; -} - class Eventfilter : public QObject { public: @@ -506,8 +459,6 @@ void TimelineWidget::onSelectionChange(Q3DStudio::SSelectedValue inNewSelectable } } } - - // Mahmoud_TODO: Expand the tree so the selection is visible } void TimelineWidget::onAssetCreated(qt3dsdm::Qt3DSDMInstanceHandle inInstance) @@ -777,7 +728,7 @@ void TimelineWidget::onActionEvent(qt3dsdm::Qt3DSDMActionHandle inAction, Q_UNUSED(inSlide) Q_UNUSED(inOwner) - // Mahmoud_TODO: implement? + // TODO: Likely needed for QT3DS-1850 } void TimelineWidget::onPropertyLinked(qt3dsdm::Qt3DSDMInstanceHandle inInstance, diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTimeline.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTimeline.cpp index 3384a1b0..cb86d434 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTimeline.cpp +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTimeline.cpp @@ -162,7 +162,7 @@ void RowTimeline::paint(QPainter *painter, const QStyleOptionGraphicsItem *optio const int keyFrameY = (TimelineConstants::ROW_H / 2) - (keyFrameH / 2); // Don't access binding when we are in inconsistent state - // TODO: Refactor so we don't need to access binding during paint + // TODO: Refactor so we don't need to access binding during paint (QT3DS-1850) if (m_rowTree->m_scene->widgetTimeline()->isFullReconstructPending()) return; diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.cpp b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.cpp index d6af8295..73b92ec5 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.cpp +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.cpp @@ -321,7 +321,7 @@ void RowTree::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, Q if (!isProperty()) { // Don't access binding when we are in inconsistent state - // TODO: Refactor so we don't need to access binding during paint + // TODO: Refactor so we don't need to access binding during paint (QT3DS-1850) if (m_scene->widgetTimeline()->isFullReconstructPending()) return; @@ -605,12 +605,6 @@ RowTree *RowTree::getChildAt(int index) const return m_childRows.at(index); } -// TODO: so far not used, delete if end up not used -void RowTree::moveChild(int from, int to) -{ - m_childRows.move(from, to); -} - // this does not destroy the row, just remove it from the layout and parenting hierarchy void RowTree::removeChild(RowTree *child) { diff --git a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.h b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.h index 547d8cc1..b05fa55c 100644 --- a/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.h +++ b/src/Authoring/Studio/Palettes/TimelineGraphicsView/ui/RowTree.h @@ -77,7 +77,6 @@ public: void setParent(RowTree *parent); void addChild(RowTree *child); void addChildAt(RowTree *child, int index); - void moveChild(int from, int to); // NOT USED void removeChild(RowTree *child); void setDnDState(DnDState state, DnDState onlyIfState = DnDState::Any, bool recursive = false); void setTreeWidth(double w); diff --git a/src/Authoring/Studio/Qt3DStudio.pro b/src/Authoring/Studio/Qt3DStudio.pro index a64f81bb..76a94f44 100644 --- a/src/Authoring/Studio/Qt3DStudio.pro +++ b/src/Authoring/Studio/Qt3DStudio.pro @@ -171,7 +171,6 @@ HEADERS += \ Palettes/TimelineGraphicsView/TimelineControl.h \ Palettes/TimelineGraphicsView/TimelineGraphicsScene.h \ Palettes/TimelineGraphicsView/TimelineSplitter.h \ - Palettes/TimelineGraphicsView/TimelineUtils.h \ Palettes/TimelineGraphicsView/TimelineWidget.h \ Palettes/TimelineGraphicsView/ui/InteractiveTimelineItem.h \ Palettes/TimelineGraphicsView/ui/NavigationBar.h \ @@ -324,7 +323,6 @@ SOURCES += \ Palettes/TimelineGraphicsView/TimelineControl.cpp \ Palettes/TimelineGraphicsView/TimelineGraphicsScene.cpp \ Palettes/TimelineGraphicsView/TimelineSplitter.cpp \ - Palettes/TimelineGraphicsView/TimelineUtils.cpp \ Palettes/TimelineGraphicsView/TimelineWidget.cpp \ Palettes/TimelineGraphicsView/ui/InteractiveTimelineItem.cpp \ Palettes/TimelineGraphicsView/ui/NavigationBar.cpp \ |