Merge branch 'master' into marker
This commit is contained in:
@@ -39,6 +39,18 @@ public:
|
||||
virtual void DeselectAll() override;
|
||||
|
||||
public slots:
|
||||
void SetNode(Node *node)
|
||||
{
|
||||
// Convert single pointer to either an empty vector or a vector of one
|
||||
QVector<Node *> nodes;
|
||||
|
||||
if (node) {
|
||||
nodes.append(node);
|
||||
}
|
||||
|
||||
SetNodes(nodes);
|
||||
}
|
||||
|
||||
void SetNodes(const QVector<Node *> &nodes);
|
||||
|
||||
virtual void IncreaseTrackHeight() override;
|
||||
|
||||
@@ -29,8 +29,7 @@ FootageViewerPanel::FootageViewerPanel(QWidget *parent) :
|
||||
{
|
||||
// Set ViewerWidget as the central widget
|
||||
FootageViewerWidget* fvw = new FootageViewerWidget();
|
||||
connect(fvw, &FootageViewerWidget::RequestScopePanel, this, &FootageViewerPanel::CreateScopePanel);
|
||||
SetTimeBasedWidget(fvw);
|
||||
SetViewerWidget(fvw);
|
||||
|
||||
// Set strings
|
||||
Retranslate();
|
||||
|
||||
+7
-25
@@ -20,39 +20,21 @@
|
||||
|
||||
#include "node.h"
|
||||
|
||||
#include <QVBoxLayout>
|
||||
|
||||
namespace olive {
|
||||
|
||||
NodePanel::NodePanel(QWidget *parent) :
|
||||
PanelWidget(QStringLiteral("NodePanel"), parent)
|
||||
{
|
||||
QWidget *outer_widget = new QWidget(this);
|
||||
node_widget_ = new NodeWidget();
|
||||
connect(this, &NodePanel::visibilityChanged, node_widget_->view(), &NodeView::CenterOnItemsBoundingRect);
|
||||
|
||||
QVBoxLayout *outer_layout = new QVBoxLayout(outer_widget);
|
||||
outer_layout->setMargin(0);
|
||||
|
||||
toolbar_ = new NodeViewToolBar();
|
||||
outer_layout->addWidget(toolbar_);
|
||||
|
||||
// Create NodeView widget
|
||||
node_view_ = new NodeView(this);
|
||||
outer_layout->addWidget(node_view_);
|
||||
|
||||
// Connect toolbar to NodeView
|
||||
connect(toolbar_, &NodeViewToolBar::MiniMapEnabledToggled, node_view_, &NodeView::SetMiniMapEnabled);
|
||||
connect(toolbar_, &NodeViewToolBar::AddNodeClicked, node_view_, &NodeView::ShowAddMenu);
|
||||
|
||||
// Set defaults
|
||||
toolbar_->SetMiniMapEnabled(true);
|
||||
node_view_->SetMiniMapEnabled(true);
|
||||
|
||||
// Connect node view signals to this panel
|
||||
connect(node_view_, &NodeView::NodesSelected, this, &NodePanel::NodesSelected);
|
||||
connect(node_view_, &NodeView::NodesDeselected, this, &NodePanel::NodesDeselected);
|
||||
// Connect node view signals to this panel - MAY REMOVE
|
||||
connect(node_widget_->view(), &NodeView::NodesSelected, this, &NodePanel::NodesSelected);
|
||||
connect(node_widget_->view(), &NodeView::NodesDeselected, this, &NodePanel::NodesDeselected);
|
||||
connect(node_widget_->view(), &NodeView::NodeGroupOpenRequested, this, &NodePanel::NodeGroupOpenRequested);
|
||||
|
||||
// Set it as the main widget of this panel
|
||||
SetWidgetWithPadding(outer_widget);
|
||||
SetWidgetWithPadding(node_widget_);
|
||||
|
||||
// Set strings
|
||||
Retranslate();
|
||||
|
||||
+28
-29
@@ -21,8 +21,7 @@
|
||||
#ifndef NODEPANEL_H
|
||||
#define NODEPANEL_H
|
||||
|
||||
#include "widget/nodeview/nodeview.h"
|
||||
#include "widget/nodeview/nodeviewtoolbar.h"
|
||||
#include "widget/nodeview/nodewidget.h"
|
||||
#include "widget/panel/panel.h"
|
||||
|
||||
namespace olive {
|
||||
@@ -36,86 +35,86 @@ class NodePanel : public PanelWidget
|
||||
public:
|
||||
NodePanel(QWidget* parent);
|
||||
|
||||
NodeGraph* GetGraph() const
|
||||
NodeWidget *GetNodeWidget() const
|
||||
{
|
||||
return node_view_->GetGraph();
|
||||
return node_widget_;
|
||||
}
|
||||
|
||||
void SetGraph(NodeGraph *graph, const QVector<Node*> &nodes)
|
||||
const QVector<Node*> &GetContexts() const
|
||||
{
|
||||
node_view_->SetGraph(graph, nodes);
|
||||
toolbar_->setEnabled(graph);
|
||||
return node_widget_->view()->GetContexts();
|
||||
}
|
||||
|
||||
void ClearGraph()
|
||||
void SetContexts(const QVector<Node*> &nodes)
|
||||
{
|
||||
node_view_->ClearGraph();
|
||||
node_widget_->SetContexts(nodes);
|
||||
}
|
||||
|
||||
void CloseContextsBelongingToProject(Project *project)
|
||||
{
|
||||
node_widget_->view()->CloseContextsBelongingToProject(project);
|
||||
}
|
||||
|
||||
const QVector<Node*> &GetCurrentContexts() const
|
||||
{
|
||||
return node_view_->GetCurrentContexts();
|
||||
return node_widget_->view()->GetCurrentContexts();
|
||||
}
|
||||
|
||||
virtual void SelectAll() override
|
||||
{
|
||||
node_view_->SelectAll();
|
||||
node_widget_->view()->SelectAll();
|
||||
}
|
||||
|
||||
virtual void DeselectAll() override
|
||||
{
|
||||
node_view_->DeselectAll();
|
||||
node_widget_->view()->DeselectAll();
|
||||
}
|
||||
|
||||
virtual void DeleteSelected() override
|
||||
{
|
||||
node_view_->DeleteSelected();
|
||||
node_widget_->view()->DeleteSelected();
|
||||
}
|
||||
|
||||
virtual void CutSelected() override
|
||||
{
|
||||
node_view_->CopySelected(true);
|
||||
node_widget_->view()->CopySelected(true);
|
||||
}
|
||||
|
||||
virtual void CopySelected() override
|
||||
{
|
||||
node_view_->CopySelected(false);
|
||||
node_widget_->view()->CopySelected(false);
|
||||
}
|
||||
|
||||
virtual void Paste() override
|
||||
{
|
||||
node_view_->Paste();
|
||||
node_widget_->view()->Paste();
|
||||
}
|
||||
|
||||
virtual void Duplicate() override
|
||||
{
|
||||
node_view_->Duplicate();
|
||||
node_widget_->view()->Duplicate();
|
||||
}
|
||||
|
||||
virtual void SetColorLabel(int index) override
|
||||
{
|
||||
node_view_->SetColorLabel(index);
|
||||
node_widget_->view()->SetColorLabel(index);
|
||||
}
|
||||
|
||||
virtual void ZoomIn() override
|
||||
{
|
||||
node_view_->ZoomIn();
|
||||
node_widget_->view()->ZoomIn();
|
||||
}
|
||||
|
||||
virtual void ZoomOut() override
|
||||
{
|
||||
node_view_->ZoomOut();
|
||||
node_widget_->view()->ZoomOut();
|
||||
}
|
||||
|
||||
public slots:
|
||||
void Select(const QVector<Node*>& nodes, bool center_view_on_item)
|
||||
{
|
||||
node_view_->Select(nodes, center_view_on_item);
|
||||
}
|
||||
|
||||
void SelectWithDependencies(const QVector<Node*>& nodes, bool center_view_on_item)
|
||||
{
|
||||
node_view_->SelectWithDependencies(nodes, center_view_on_item);
|
||||
node_widget_->view()->Select(nodes, center_view_on_item);
|
||||
this->raise();
|
||||
}
|
||||
|
||||
signals:
|
||||
@@ -123,15 +122,15 @@ signals:
|
||||
|
||||
void NodesDeselected(const QVector<Node*>& nodes);
|
||||
|
||||
void NodeGroupOpenRequested(NodeGroup *group);
|
||||
|
||||
private:
|
||||
virtual void Retranslate() override
|
||||
{
|
||||
SetTitle(tr("Node Editor"));
|
||||
}
|
||||
|
||||
NodeView* node_view_;
|
||||
|
||||
NodeViewToolBar *toolbar_;
|
||||
NodeWidget *node_widget_;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -95,6 +95,40 @@ PanelManager *PanelManager::instance()
|
||||
return instance_;
|
||||
}
|
||||
|
||||
void PanelManager::RegisterPanel(PanelWidget *panel)
|
||||
{
|
||||
// Add panel to the bottom of the focus history
|
||||
focus_history_.append(panel);
|
||||
|
||||
panel->SetMovementLocked(locked_);
|
||||
|
||||
// Get panel parent (it's assumed it has one)
|
||||
QWidget *parent = panel->parentWidget();
|
||||
|
||||
// Sane default for panel size
|
||||
panel->resize(parent->size() / 3);
|
||||
|
||||
// We're about to center the panel relative to the parent (usually the main window), but for some
|
||||
// reason this requires the panel to be shown first.
|
||||
panel->show();
|
||||
|
||||
// Center the panel relative to the parent
|
||||
QPoint parent_center = panel->mapFromGlobal(parent->mapToGlobal(parent->rect().center()));
|
||||
QPoint panel_center = panel->rect().center();
|
||||
panel->move(parent_center - panel_center);
|
||||
|
||||
if (focus_history_.size() == 1) {
|
||||
// This is the first panel, focus it
|
||||
panel->SetBorderVisible(true);
|
||||
emit FocusedPanelChanged(panel);
|
||||
}
|
||||
}
|
||||
|
||||
void PanelManager::UnregisterPanel(PanelWidget *panel)
|
||||
{
|
||||
focus_history_.removeOne(panel);
|
||||
}
|
||||
|
||||
void PanelManager::FocusChanged(QWidget *old, QWidget *now)
|
||||
{
|
||||
Q_UNUSED(old)
|
||||
@@ -151,11 +185,4 @@ void PanelManager::SetPanelsLocked(bool locked)
|
||||
locked_ = locked;
|
||||
}
|
||||
|
||||
void PanelManager::PanelDestroyed()
|
||||
{
|
||||
PanelWidget* panel = static_cast<PanelWidget*>(sender());
|
||||
|
||||
focus_history_.removeOne(panel);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+10
-46
@@ -84,12 +84,6 @@ public:
|
||||
*/
|
||||
T* MostRecentlyFocused();
|
||||
|
||||
template<class T>
|
||||
/**
|
||||
* @brief Create a panel
|
||||
*/
|
||||
T* CreatePanel(QWidget* parent);
|
||||
|
||||
/**
|
||||
* @brief Get whether panels are currently prevented from moving
|
||||
*/
|
||||
@@ -118,6 +112,16 @@ public:
|
||||
*/
|
||||
QList<T*> GetPanelsOfType();
|
||||
|
||||
/**
|
||||
* @brief Panel should call this upon construction so it can be kept track of
|
||||
*/
|
||||
void RegisterPanel(PanelWidget *panel);
|
||||
|
||||
/**
|
||||
* @brief Panel should call this upon destruction so no invalid pointers will be kept for it
|
||||
*/
|
||||
void UnregisterPanel(PanelWidget *panel);
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* @brief Connect this to a QApplication's SIGNAL(focusChanged())
|
||||
@@ -153,48 +157,8 @@ private:
|
||||
*/
|
||||
static PanelManager* instance_;
|
||||
|
||||
private slots:
|
||||
/**
|
||||
* @brief Processing if a panel gets deleted
|
||||
*/
|
||||
void PanelDestroyed();
|
||||
|
||||
};
|
||||
|
||||
template<class T>
|
||||
T *PanelManager::CreatePanel(QWidget *parent)
|
||||
{
|
||||
T* panel = new T(parent);
|
||||
|
||||
// Add panel to the bottom of the focus history
|
||||
focus_history_.append(panel);
|
||||
|
||||
panel->SetMovementLocked(locked_);
|
||||
|
||||
// Sane default for panel size
|
||||
panel->resize(parent->size() / 3);
|
||||
|
||||
// We're about to center the panel relative to the parent (usually the main window), but for some
|
||||
// reason this requires the panel to be shown first.
|
||||
panel->show();
|
||||
|
||||
// Center the panel relative to the parent
|
||||
QPoint parent_center = panel->mapFromGlobal(parent->mapToGlobal(parent->rect().center()));
|
||||
QPoint panel_center = panel->rect().center();
|
||||
panel->move(parent_center - panel_center);
|
||||
|
||||
// Connect destroy signal so we can remove it from focus history
|
||||
connect(panel, &PanelWidget::destroyed, this, &PanelManager::PanelDestroyed, Qt::DirectConnection);
|
||||
|
||||
if (focus_history_.size() == 1) {
|
||||
// This is the first panel, focus it
|
||||
panel->SetBorderVisible(true);
|
||||
emit FocusedPanelChanged(panel);
|
||||
}
|
||||
|
||||
return panel;
|
||||
}
|
||||
|
||||
template<class T>
|
||||
T* PanelManager::MostRecentlyFocused()
|
||||
{
|
||||
|
||||
@@ -29,8 +29,8 @@ ParamPanel::ParamPanel(QWidget* parent) :
|
||||
{
|
||||
NodeParamView* view = new NodeParamView();
|
||||
connect(view, &NodeParamView::RequestSelectNode, this, &ParamPanel::RequestSelectNode);
|
||||
connect(view, &NodeParamView::NodeOrderChanged, this, &ParamPanel::NodeOrderChanged);
|
||||
connect(view, &NodeParamView::FocusedNodeChanged, this, &ParamPanel::FocusedNodeChanged);
|
||||
connect(this, &ParamPanel::visibilityChanged, view, &NodeParamView::UpdateElementY);
|
||||
SetTimeBasedWidget(view);
|
||||
|
||||
Retranslate();
|
||||
@@ -39,15 +39,11 @@ ParamPanel::ParamPanel(QWidget* parent) :
|
||||
void ParamPanel::SelectNodes(const QVector<Node *> &nodes)
|
||||
{
|
||||
static_cast<NodeParamView*>(GetTimeBasedWidget())->SelectNodes(nodes);
|
||||
|
||||
Retranslate();
|
||||
}
|
||||
|
||||
void ParamPanel::DeselectNodes(const QVector<Node *> &nodes)
|
||||
{
|
||||
static_cast<NodeParamView*>(GetTimeBasedWidget())->DeselectNodes(nodes);
|
||||
|
||||
Retranslate();
|
||||
}
|
||||
|
||||
void ParamPanel::DeleteSelected()
|
||||
@@ -65,19 +61,14 @@ void ParamPanel::DeselectAll()
|
||||
static_cast<NodeParamView*>(GetTimeBasedWidget())->DeselectAll();
|
||||
}
|
||||
|
||||
void ParamPanel::SetContexts(const QVector<Node *> &contexts)
|
||||
{
|
||||
static_cast<NodeParamView*>(GetTimeBasedWidget())->SetContexts(contexts);
|
||||
}
|
||||
|
||||
void ParamPanel::Retranslate()
|
||||
{
|
||||
SetTitle(tr("Parameter Editor"));
|
||||
|
||||
NodeParamView* view = static_cast<NodeParamView*>(GetTimeBasedWidget());
|
||||
|
||||
if (view->GetItemMap().isEmpty()) {
|
||||
SetSubtitle(tr("(none)"));
|
||||
} else if (view->GetItemMap().size() == 1) {
|
||||
SetSubtitle(view->GetItemMap().firstKey()->Name());
|
||||
} else {
|
||||
SetSubtitle(tr("(multiple)"));
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+27
-2
@@ -33,6 +33,31 @@ class ParamPanel : public TimeBasedPanel
|
||||
public:
|
||||
ParamPanel(QWidget* parent);
|
||||
|
||||
NodeParamView *GetParamView() const
|
||||
{
|
||||
return static_cast<NodeParamView *>(GetTimeBasedWidget());
|
||||
}
|
||||
|
||||
const QVector<Node*> &GetContexts() const
|
||||
{
|
||||
return GetParamView()->GetContexts();
|
||||
}
|
||||
|
||||
void SetCreateCheckBoxes(NodeParamViewCheckBoxBehavior e)
|
||||
{
|
||||
GetParamView()->SetCreateCheckBoxes(e);
|
||||
}
|
||||
|
||||
void SetIgnoreNodeFlags(bool e)
|
||||
{
|
||||
GetParamView()->SetIgnoreNodeFlags(e);
|
||||
}
|
||||
|
||||
void CloseContextsBelongingToProject(Project *p)
|
||||
{
|
||||
GetParamView()->CloseContextsBelongingToProject(p);
|
||||
}
|
||||
|
||||
public slots:
|
||||
void SelectNodes(const QVector<Node*>& nodes);
|
||||
void DeselectNodes(const QVector<Node*>& nodes);
|
||||
@@ -43,11 +68,11 @@ public slots:
|
||||
|
||||
virtual void DeselectAll() override;
|
||||
|
||||
void SetContexts(const QVector<Node*> &contexts);
|
||||
|
||||
signals:
|
||||
void RequestSelectNode(const QVector<Node*>& target);
|
||||
|
||||
void NodeOrderChanged(const QVector<Node*>& nodes);
|
||||
|
||||
void FocusedNodeChanged(Node* n);
|
||||
|
||||
protected:
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
namespace olive {
|
||||
|
||||
PixelSamplerPanel::PixelSamplerPanel(QWidget *parent) :
|
||||
PanelWidget(QStringLiteral("ProjectPanel"), parent)
|
||||
PanelWidget(QStringLiteral("PixelSamplerPanel"), parent)
|
||||
{
|
||||
sampler_widget_ = new ManagedPixelSamplerWidget();
|
||||
SetWidgetWithPadding(sampler_widget_);
|
||||
|
||||
@@ -27,7 +27,8 @@
|
||||
namespace olive {
|
||||
|
||||
ScopePanel::ScopePanel(QWidget* parent) :
|
||||
PanelWidget(QStringLiteral("ScopePanel"), parent)
|
||||
PanelWidget(QStringLiteral("ScopePanel"), parent),
|
||||
viewer_(nullptr)
|
||||
{
|
||||
QWidget* central = new QWidget();
|
||||
setWidget(central);
|
||||
@@ -84,6 +85,33 @@ QString ScopePanel::TypeToName(ScopePanel::Type t)
|
||||
return QString();
|
||||
}
|
||||
|
||||
void ScopePanel::SetViewerPanel(ViewerPanelBase *vp)
|
||||
{
|
||||
if (viewer_ == vp) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (viewer_) {
|
||||
disconnect(viewer_, &ViewerPanelBase::TextureChanged, this, &ScopePanel::SetReferenceBuffer);
|
||||
disconnect(viewer_, &ViewerPanelBase::ColorManagerChanged, this, &ScopePanel::SetColorManager);
|
||||
}
|
||||
|
||||
viewer_ = vp;
|
||||
|
||||
if (viewer_) {
|
||||
// Connect viewer widget texture drawing to scope panel
|
||||
connect(viewer_, &ViewerPanelBase::TextureChanged, this, &ScopePanel::SetReferenceBuffer);
|
||||
connect(viewer_, &ViewerPanelBase::ColorManagerChanged, this, &ScopePanel::SetColorManager);
|
||||
|
||||
SetColorManager(viewer_->GetColorManager());
|
||||
|
||||
viewer_->UpdateTextureFromNode();
|
||||
} else {
|
||||
SetReferenceBuffer(nullptr);
|
||||
SetColorManager(nullptr);
|
||||
}
|
||||
}
|
||||
|
||||
void ScopePanel::SetReferenceBuffer(TexturePtr frame)
|
||||
{
|
||||
histogram_->SetBuffer(frame);
|
||||
@@ -98,7 +126,7 @@ void ScopePanel::SetColorManager(ColorManager *manager)
|
||||
|
||||
void ScopePanel::Retranslate()
|
||||
{
|
||||
SetTitle(tr("Scope"));
|
||||
SetTitle(tr("Scopes"));
|
||||
|
||||
for (int i=0;i<ScopePanel::kTypeCount;i++) {
|
||||
scope_type_combobox_->setItemText(i, TypeToName(static_cast<Type>(i)));
|
||||
|
||||
+10
-2
@@ -24,14 +24,13 @@
|
||||
#include <QComboBox>
|
||||
#include <QStackedWidget>
|
||||
|
||||
#include "panel/viewer/viewerbase.h"
|
||||
#include "widget/panel/panel.h"
|
||||
#include "widget/scope/histogram/histogram.h"
|
||||
#include "widget/scope/waveform/waveform.h"
|
||||
|
||||
namespace olive {
|
||||
|
||||
class ViewerPanel;
|
||||
|
||||
class ScopePanel : public PanelWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -49,6 +48,13 @@ public:
|
||||
|
||||
static QString TypeToName(Type t);
|
||||
|
||||
void SetViewerPanel(ViewerPanelBase *vp);
|
||||
|
||||
ViewerPanelBase *GetConnectedViewerPanel() const
|
||||
{
|
||||
return viewer_;
|
||||
}
|
||||
|
||||
public slots:
|
||||
void SetReferenceBuffer(TexturePtr frame);
|
||||
|
||||
@@ -68,6 +74,8 @@ private:
|
||||
|
||||
HistogramScope* histogram_;
|
||||
|
||||
ViewerPanelBase *viewer_;
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -25,13 +25,12 @@ namespace olive {
|
||||
ViewerPanel::ViewerPanel(const QString &object_name, QWidget *parent) :
|
||||
ViewerPanelBase(object_name, parent)
|
||||
{
|
||||
Init();
|
||||
}
|
||||
// Set ViewerWidget as the central widget
|
||||
ViewerWidget* vw = new ViewerWidget();
|
||||
SetViewerWidget(vw);
|
||||
|
||||
ViewerPanel::ViewerPanel(QWidget *parent) :
|
||||
ViewerPanelBase(QStringLiteral("ViewerPanel"), parent)
|
||||
{
|
||||
Init();
|
||||
// Set strings
|
||||
Retranslate();
|
||||
}
|
||||
|
||||
void ViewerPanel::Retranslate()
|
||||
@@ -41,15 +40,4 @@ void ViewerPanel::Retranslate()
|
||||
SetTitle(tr("Viewer"));
|
||||
}
|
||||
|
||||
void ViewerPanel::Init()
|
||||
{
|
||||
// Set ViewerWidget as the central widget
|
||||
ViewerWidget* vw = new ViewerWidget();
|
||||
connect(vw, &ViewerWidget::RequestScopePanel, this, &ViewerPanel::CreateScopePanel);
|
||||
SetTimeBasedWidget(vw);
|
||||
|
||||
// Set strings
|
||||
Retranslate();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -34,14 +34,14 @@ class ViewerPanel : public ViewerPanelBase {
|
||||
Q_OBJECT
|
||||
public:
|
||||
ViewerPanel(const QString& object_name, QWidget* parent);
|
||||
ViewerPanel(QWidget* parent);
|
||||
ViewerPanel(QWidget *parent) :
|
||||
ViewerPanel(QStringLiteral("ViewerPanel"), parent)
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
virtual void Retranslate() override;
|
||||
|
||||
private:
|
||||
void Init();
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -92,27 +92,13 @@ void ViewerPanelBase::CacheSequenceInOut()
|
||||
static_cast<ViewerWidget*>(GetTimeBasedWidget())->CacheSequenceInOut();
|
||||
}
|
||||
|
||||
void ViewerPanelBase::CreateScopePanel(ScopePanel::Type type)
|
||||
void ViewerPanelBase::SetViewerWidget(ViewerWidget *vw)
|
||||
{
|
||||
ViewerWidget* vw = static_cast<ViewerWidget*>(GetTimeBasedWidget());
|
||||
ScopePanel* p = Core::instance()->main_window()->AppendScopePanel();
|
||||
connect(vw, &ViewerWidget::TextureChanged, this, &ViewerPanelBase::TextureChanged);
|
||||
connect(vw, &ViewerWidget::ColorProcessorChanged, this, &ViewerPanelBase::ColorProcessorChanged);
|
||||
connect(vw, &ViewerWidget::ColorManagerChanged, this, &ViewerPanelBase::ColorManagerChanged);
|
||||
|
||||
p->SetType(type);
|
||||
|
||||
// Connect viewer widget texture drawing to scope panel
|
||||
connect(vw, &ViewerWidget::TextureChanged, p, &ScopePanel::SetReferenceBuffer);
|
||||
connect(vw, &ViewerWidget::ColorManagerChanged, p, &ScopePanel::SetColorManager);
|
||||
|
||||
p->SetColorManager(vw->color_manager());
|
||||
|
||||
vw->UpdateTextureFromNode();
|
||||
}
|
||||
|
||||
void ViewerPanelBase::closeEvent(QCloseEvent *e)
|
||||
{
|
||||
static_cast<ViewerWidget*>(GetTimeBasedWidget())->Pause();
|
||||
|
||||
TimeBasedPanel::closeEvent(e);
|
||||
SetTimeBasedWidget(vw);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -52,6 +52,16 @@ public:
|
||||
*/
|
||||
void SetFullScreen(QScreen* screen = nullptr);
|
||||
|
||||
ColorManager *GetColorManager()
|
||||
{
|
||||
return static_cast<ViewerWidget*>(GetTimeBasedWidget())->color_manager();
|
||||
}
|
||||
|
||||
void UpdateTextureFromNode()
|
||||
{
|
||||
static_cast<ViewerWidget*>(GetTimeBasedWidget())->UpdateTextureFromNode();
|
||||
}
|
||||
|
||||
public slots:
|
||||
void SetGizmos(Node* node);
|
||||
|
||||
@@ -59,10 +69,24 @@ public slots:
|
||||
|
||||
void CacheSequenceInOut();
|
||||
|
||||
protected:
|
||||
void CreateScopePanel(ScopePanel::Type type);
|
||||
signals:
|
||||
/**
|
||||
* @brief Signal emitted when a new frame is loaded
|
||||
*/
|
||||
void TextureChanged(TexturePtr t);
|
||||
|
||||
virtual void closeEvent(QCloseEvent* e) override;
|
||||
/**
|
||||
* @brief Wrapper for ViewerGLWidget::ColorProcessorChanged()
|
||||
*/
|
||||
void ColorProcessorChanged(ColorProcessorPtr processor);
|
||||
|
||||
/**
|
||||
* @brief Wrapper for ViewerGLWidget::ColorManagerChanged()
|
||||
*/
|
||||
void ColorManagerChanged(ColorManager* color_manager);
|
||||
|
||||
protected:
|
||||
void SetViewerWidget(ViewerWidget *vw);
|
||||
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user