diff --git a/modules/gui/pymod/export_gosty.cc b/modules/gui/pymod/export_gosty.cc index 88bb732874744cec1e379365cece71efc413b166..9cd97b7fdabdc80c208a521c47e50b136d5babb1 100644 --- a/modules/gui/pymod/export_gosty.cc +++ b/modules/gui/pymod/export_gosty.cc @@ -96,6 +96,10 @@ void export_Gosty() return_value_policy<reference_existing_object>()) .add_property("seq_viewer", make_function(&GostyApp::GetSequenceViewer, return_value_policy<reference_existing_object>())) + .def("GetSequenceViewerV2", &GostyApp::GetSequenceViewerV2, + return_value_policy<reference_existing_object>()) + .add_property("seq_viewer_v2", make_function(&GostyApp::GetSequenceViewerV2, + return_value_policy<reference_existing_object>())) .def("GetToolOptionsWin", &GostyApp::GetToolOptionsWin, return_value_policy<reference_existing_object>()) .add_property("tool_options_win", make_function(&GostyApp::GetToolOptionsWin, diff --git a/modules/gui/src/gosty_app.cc b/modules/gui/src/gosty_app.cc index 8eed58bea578fe8bed58d89d65f30ef264138248..bf4398b3870c73158b179435fc1ef9fb034b257d 100644 --- a/modules/gui/src/gosty_app.cc +++ b/modules/gui/src/gosty_app.cc @@ -46,7 +46,7 @@ GostyApp* GostyApp::app_=NULL; GostyApp::GostyApp(): py_shell_(NULL), w_py_shell_(NULL), gl_win_(NULL), w_gl_win_(NULL), - scene_win_(NULL), w_scene_win_(NULL), seq_viewer_(NULL), tool_options_win_(NULL), + scene_win_(NULL), w_scene_win_(NULL), seq_viewer_(NULL), seq_viewer_v2_(NULL), tool_options_win_(NULL), w_tool_options_(NULL), main_(new GostyMainWindow), perspective_(NULL), external_widgets_(QMap<QString,WidgetGeomHandler *>()) { @@ -104,6 +104,15 @@ SequenceViewer* GostyApp::GetSequenceViewer() return seq_viewer_; } +SequenceViewerV2* GostyApp::GetSequenceViewerV2() +{ + if (seq_viewer_v2_==NULL) { + seq_viewer_v2_=new SequenceViewerV2; + seq_viewer_v2_->SetDestroyOnClose(false); + } + return seq_viewer_v2_; +} + #if OST_IMG_ENABLED ost::img::gui::DataViewer* GostyApp::CreateDataViewer(const ost::img::Data& d, const QString& name) { diff --git a/modules/gui/src/gosty_app.hh b/modules/gui/src/gosty_app.hh index 2bf1e2eee3f5a5b14b22d8835a48cb97597e512a..46381ff1662237a5b60525407d7936eb05bd3eb4 100644 --- a/modules/gui/src/gosty_app.hh +++ b/modules/gui/src/gosty_app.hh @@ -31,6 +31,7 @@ #include <ost/gui/module_config.hh> #include <ost/gui/scene_win/scene_win.hh> #include <ost/gui/sequence_viewer/sequence_viewer.hh> +#include <ost/gui/sequence/sequence_viewer.hh> #include <ost/gui/main.hh> #include <ost/gui/widget_geom_handler.hh> #if OST_IMG_ENABLED @@ -92,6 +93,7 @@ public: /// The sequence viewer is initialized when this method is first called. All /// subsequent calls will return the same SequenceViewer instance. SequenceViewer* GetSequenceViewer(); + SequenceViewerV2* GetSequenceViewerV2(); /// \brief get tool options window /// @@ -155,6 +157,7 @@ private: QWidget* w_scene_win_; SequenceViewer* seq_viewer_; + SequenceViewerV2* seq_viewer_v2_; ToolOptionsWin* tool_options_win_; QWidget* w_tool_options_; diff --git a/modules/gui/src/sequence/sequence_viewer.cc b/modules/gui/src/sequence/sequence_viewer.cc index 269590dfce8414f258093787f9b44992dec085d7..fd6a3cf2bcecfcb040758d1f80bb1b624f71b4c6 100644 --- a/modules/gui/src/sequence/sequence_viewer.cc +++ b/modules/gui/src/sequence/sequence_viewer.cc @@ -36,14 +36,27 @@ #include <ost/gfx/scene.hh> #include <ost/gfx/gfx_node_visitor.hh> -#include "sequence_model.hh" +#include <ost/gui/widget_registry.hh> +#include <ost/gui/gosty_app.hh> +#include "sequence_model.hh" #include "sequence_viewer.hh" -#include "sequence_delegate.hh" - namespace ost { namespace gui { +class SequenceViewerV2Factory: public WidgetFactory { +public: + SequenceViewerV2Factory() : + WidgetFactory("ost::gui::SequenceViewerV2", "Sequence Viewer V2") { + } + + virtual Widget* Create(QWidget* parent) { + return GostyApp::Instance()->GetSequenceViewerV2(); + } +}; + +OST_REGISTER_WIDGET(SequenceViewerV2, SequenceViewerV2Factory); + struct GetNodesVisitor: public gfx::GfxNodeVisitor { GetNodesVisitor(): nodes_() {} virtual void VisitObject(gfx::GfxObj* o, const Stack& st) { @@ -59,6 +72,8 @@ SequenceViewerV2::SequenceViewerV2(QWidget* parent): Widget(NULL,parent) model_ = new SequenceModel(this); QVBoxLayout* layout = new QVBoxLayout(this); + layout->setMargin(0); + layout->setSpacing(0); seq_table_view_ = new SequenceTableView(model_); layout->addWidget(seq_table_view_); diff --git a/scripts/init.py b/scripts/init.py index 6df88ea013347837d43e8b155141325da09f6fb2..020a660797852353077ff6c36a8f10834c1dd05a 100644 --- a/scripts/init.py +++ b/scripts/init.py @@ -36,6 +36,7 @@ def _InitPanels(app): panels.AddWidgetToPool('ost.gui.RemoteLoader', -1) panels.AddWidgetToPool('ost.gui.SceneWin', 1) panels.AddWidgetToPool('ost.gui.SequenceViewer', 1) + panels.AddWidgetToPool('ost.gui.SequenceViewerV2', 1) if not panels.Restore("ui/perspective/panels"): panels.AddWidget(gui.PanelPosition.LEFT_PANEL, app.scene_win) panels.AddWidgetByName(gui.PanelPosition.LEFT_PANEL,