From 6ec4f48dfc82bce9d5b73df9f6a511cad19bc5b0 Mon Sep 17 00:00:00 2001 From: vsv Date: Thu, 8 May 2008 12:21:19 +0000 Subject: [PATCH] Introduced ViewExtender --- src/CAM/CAM_Module.h | 4 ++++ src/CAM/CAM_ViewExtender.h | 39 ++++++++++++++++++++++++++++++++++++++ src/CAM/Makefile.am | 3 ++- 3 files changed, 45 insertions(+), 1 deletion(-) create mode 100644 src/CAM/CAM_ViewExtender.h diff --git a/src/CAM/CAM_Module.h b/src/CAM/CAM_Module.h index df358c9e6..b8ed8afdf 100755 --- a/src/CAM/CAM_Module.h +++ b/src/CAM/CAM_Module.h @@ -37,6 +37,7 @@ class SUIT_Application; class CAM_Study; class CAM_DataModel; class CAM_Application; +class CAM_ViewExtender; #ifdef WIN32 #pragma warning( disable: 4251 ) @@ -76,6 +77,9 @@ public: void setToolShown( QAction*, const bool ); void setToolShown( const int, const bool ); + //! Returns Module dedicated extension for Viewer. Returns 0 if module has no extension + virtual CAM_ViewExtender* getViewExtender() { return 0; } + public slots: virtual bool activateModule( SUIT_Study* ); virtual bool deactivateModule( SUIT_Study* ); diff --git a/src/CAM/CAM_ViewExtender.h b/src/CAM/CAM_ViewExtender.h new file mode 100644 index 000000000..eae28e51d --- /dev/null +++ b/src/CAM/CAM_ViewExtender.h @@ -0,0 +1,39 @@ +// Copyright (C) 2005 OPEN CASCADE, CEA/DEN, EDF R&D, PRINCIPIA R&D +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License. +// +// This library 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 +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +#ifndef CAM_VIEWEXTENDER_H +#define CAM_VIEWEXTENDER_H + +#include "CAM.h" + +class QtxActionToolMgr; +class QMenu; +/*! + An interface which can be used as a module dedicated extension for Viewer +*/ +class CAM_EXPORT CAM_ViewExtender +{ +public: + //! Creates a New toolbar containing extending actions. Returns New Toolbar Id + virtual int createToolbar(QtxActionToolMgr* ) = 0; + virtual void contextMenuPopup(QMenu* ) = 0; + virtual void activate() = 0; + virtual void deactivate() = 0; +}; + +#endif diff --git a/src/CAM/Makefile.am b/src/CAM/Makefile.am index 8f96c76ca..552e4abc8 100755 --- a/src/CAM/Makefile.am +++ b/src/CAM/Makefile.am @@ -31,7 +31,8 @@ salomeinclude_HEADERS= \ CAM_DataModel.h \ CAM_DataObject.h \ CAM_Module.h \ - CAM_Study.h + CAM_Study.h \ + CAM_ViewExtender.h dist_libCAM_la_SOURCES= \ CAM_Application.cxx \ -- 2.39.2