# HG changeset patch # User Alain Mazy # Date 1562676180 -7200 # Node ID aad5ccf1be109f057ac15d44d057cca82d93342e # Parent 30268a0cafca873a1cb504ffd323db8bb59d8d8d cleanup diff -r 30268a0cafca -r aad5ccf1be10 Applications/Generic/Scene2DInteractor.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Applications/Generic/Scene2DInteractor.h Tue Jul 09 14:43:00 2019 +0200 @@ -0,0 +1,52 @@ +/** + * Stone of Orthanc + * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics + * Department, University Hospital of Liege, Belgium + * Copyright (C) 2017-2019 Osimis S.A., Belgium + * + * This program is free software: you can redistribute it and/or + * modify it under the terms of the GNU Affero General Public License + * as published by the Free Software Foundation, either version 3 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see . + **/ +#pragma once + +#include "../../Framework/Scene2D/PointerEvent.h" +#include "../../Framework/Scene2DViewport/ViewportController.h" +#include "../../Framework/Scene2D/Internals/CompositorHelper.h" +#include "GuiAdapter.h" + + +namespace OrthancStone +{ + + class Scene2DInteractor + { + protected: + boost::shared_ptr viewportController_; + boost::shared_ptr compositor_; + + public: + Scene2DInteractor(boost::shared_ptr viewportController) : + viewportController_(viewportController) + {} + + void SetCompositor(boost::shared_ptr compositor) + { + compositor_ = compositor; + } + + virtual bool OnMouseEvent(const GuiAdapterMouseEvent& guiEvent, const PointerEvent& pointerEvent) = 0; // returns true if it has handled the event + virtual bool OnKeyboardEvent(const GuiAdapterKeyboardEvent& guiEvent) = 0; // returns true if it has handled the event + virtual bool OnWheelEvent(const GuiAdapterWheelEvent& guiEvent) = 0; // returns true if it has handled the event + + }; +} diff -r 30268a0cafca -r aad5ccf1be10 Samples/Qt/BasicSceneWindow.cpp --- a/Samples/Qt/BasicSceneWindow.cpp Tue Jul 09 14:34:56 2019 +0200 +++ b/Samples/Qt/BasicSceneWindow.cpp Tue Jul 09 14:43:00 2019 +0200 @@ -34,12 +34,9 @@ BasicSceneWindow::BasicSceneWindow( QWidget *parent) : -// QStoneMainWindow(context, parent), ui_(new Ui::BasicSceneWindow) - //stoneSampleApplication_(stoneSampleApplication) { ui_->setupUi(this); - //SetCentralStoneWidget(*ui_->cairoCentralWidget); } BasicSceneWindow::~BasicSceneWindow() diff -r 30268a0cafca -r aad5ccf1be10 Samples/Qt/QStoneOpenGlWidget.cpp --- a/Samples/Qt/QStoneOpenGlWidget.cpp Tue Jul 09 14:34:56 2019 +0200 +++ b/Samples/Qt/QStoneOpenGlWidget.cpp Tue Jul 09 14:43:00 2019 +0200 @@ -165,4 +165,7 @@ { OrthancStone::GuiAdapterWheelEvent guiEvent; throw Orthanc::OrthancException(Orthanc::ErrorCode_NotImplemented); + + // force redraw of the OpenGL widget + update(); } diff -r 30268a0cafca -r aad5ccf1be10 Samples/Qt/Scene2DInteractor.h --- a/Samples/Qt/Scene2DInteractor.h Tue Jul 09 14:34:56 2019 +0200 +++ b/Samples/Qt/Scene2DInteractor.h Tue Jul 09 14:43:00 2019 +0200 @@ -1,44 +1,12 @@ #pragma once -#include "../../Framework/Scene2D/PointerEvent.h" -#include "../../Framework/Scene2DViewport/ViewportController.h" +#include "../../Applications/Generic/Scene2DInteractor.h" #include "../../Framework/Scene2DViewport/IFlexiblePointerTracker.h" -#include "../../Framework/Scene2D/Internals/CompositorHelper.h" -#include "../../Applications/Generic/GuiAdapter.h" - - -namespace OrthancStone -{ - - class Scene2DInteractor - { - protected: - boost::shared_ptr viewportController_; - boost::shared_ptr currentTracker_; - boost::shared_ptr compositor_; - - public: - Scene2DInteractor(boost::shared_ptr viewportController) : - viewportController_(viewportController) - {} - - void SetCompositor(boost::shared_ptr compositor) - { - compositor_ = compositor; - } - - virtual bool OnMouseEvent(const GuiAdapterMouseEvent& guiEvent, const PointerEvent& pointerEvent) = 0; // returns true if it has handled the event - virtual bool OnKeyboardEvent(const GuiAdapterKeyboardEvent& guiEvent) = 0; // returns true if it has handled the event - virtual bool OnWheelEvent(const GuiAdapterWheelEvent& guiEvent) = 0; // returns true if it has handled the event - - }; -} - - class BasicScene2DInteractor : public OrthancStone::Scene2DInteractor { + boost::shared_ptr currentTracker_; public: BasicScene2DInteractor(boost::shared_ptr viewportController) : Scene2DInteractor(viewportController)