14bbbdcb |
1 | // Created on: 2017-06-16 |
2 | // Created by: Natalia ERMOLAEVA |
3 | // Copyright (c) 2017 OPEN CASCADE SAS |
4 | // |
5 | // This file is part of Open CASCADE Technology software library. |
6 | // |
7 | // This library is free software; you can redistribute it and/or modify it under |
8 | // the terms of the GNU Lesser General Public License version 2.1 as published |
9 | // by the Free Software Foundation, with special exception defined in the file |
10 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
11 | // distribution for complete text of the license and disclaimer of any warranty. |
12 | // |
13 | // Alternatively, this file may be used under the terms of Open CASCADE |
14 | // commercial license or contractual agreement. |
15 | |
16 | #ifndef ShapeView_Communicator_H |
17 | #define ShapeView_Communicator_H |
18 | |
0cb512c0 |
19 | #include <inspector/ShapeView_Window.hxx> |
20 | #include <inspector/TInspectorAPI_Communicator.hxx> |
14bbbdcb |
21 | |
22 | //! \class ShapeView_Communicator. |
23 | //! \brief This is a connector from TInspector application to ShapeView window |
24 | class ShapeView_Communicator : public TInspectorAPI_Communicator |
25 | { |
26 | public: |
27 | |
28 | //! Constructor |
6822a3be |
29 | ShapeView_Communicator() : TInspectorAPI_Communicator(), myWindow (new ShapeView_Window (0)) {} |
14bbbdcb |
30 | |
31 | //! Destructor |
7e1c1e48 |
32 | virtual ~ShapeView_Communicator() { myWindow->RemoveAllShapes(); } |
14bbbdcb |
33 | |
34 | //! Provides the container with a parent where this container should be inserted. |
35 | //! If Qt implementation, it should be QWidget with QLayout set inside |
36 | //! \param theParent a parent class |
37 | virtual void SetParent (void* theParent) Standard_OVERRIDE { myWindow->SetParent (theParent); } |
38 | |
39 | //! Sets parameters container, it should be used when the plugin is initialized or in update content |
40 | //! \param theParameters a parameters container |
41 | virtual void SetParameters (const Handle(TInspectorAPI_PluginParameters)& theParameters) Standard_OVERRIDE |
42 | { myWindow->SetParameters (theParameters); } |
43 | |
7e1c1e48 |
44 | //! Provides container for actions available in inspector on general level |
6822a3be |
45 | //! \param theMenu if Qt implementation, it is QMenu object |
7e1c1e48 |
46 | virtual void FillActionsMenu(void* theMenu) Standard_OVERRIDE { myWindow->FillActionsMenu (theMenu); } |
6822a3be |
47 | |
48 | //! Returns plugin preferences, empty implementation by default |
49 | //! \param theItem container of preference elements |
50 | virtual void GetPreferences (TInspectorAPI_PreferencesDataMap& theItem) Standard_OVERRIDE |
51 | { myWindow->GetPreferences (theItem); } |
52 | |
53 | //! Stores plugin preferences, empty implementation by default |
54 | //! \param theItem container of preference elements |
55 | virtual void SetPreferences (const TInspectorAPI_PreferencesDataMap& theItem) Standard_OVERRIDE |
56 | { myWindow->SetPreferences (theItem); } |
57 | |
14bbbdcb |
58 | //! Calls update of the plugin's content |
59 | virtual void UpdateContent() Standard_OVERRIDE { myWindow->UpdateContent(); } |
60 | |
61 | private: |
62 | |
63 | ShapeView_Window* myWindow; //!< current window |
64 | }; |
65 | |
66 | #endif |