7e1c1e48 |
1 | // Created on: 2020-01-25 |
2 | // Created by: Natalia ERMOLAEVA |
3 | // Copyright (c) 2020 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 View_DisplayPreview_H |
17 | #define View_DisplayPreview_H |
18 | |
19 | #include <inspector/View_DisplayActionType.hxx> |
20 | |
21 | #include <AIS_InteractiveContext.hxx> |
22 | #include <Standard.hxx> |
23 | #include <Standard_Handle.hxx> |
24 | #include <Standard_Macro.hxx> |
25 | |
26 | class AIS_InteractiveObject; |
27 | class View_PreviewParameters; |
28 | |
29 | //! \class View_DisplayPreview |
30 | //! \brief It is responsible for communication with AIS Interactive Context to: |
31 | //! - display/erase presentations; |
32 | //! - change display mode of visualized presentations (Shaded or WireFrame mode) |
33 | //! |
34 | //! It contains containers of visualized presentations to obtain presentations relating only to this displayer. |
35 | //! Displayer is connected to AIS Interactive Context |
36 | class View_DisplayPreview |
37 | { |
38 | public: |
39 | |
40 | //! Constructor |
41 | Standard_EXPORT View_DisplayPreview(); |
42 | |
43 | //! Destructor |
44 | virtual ~View_DisplayPreview() {} |
45 | |
46 | //! Stores the current context where the presentations will be displayed/erased. |
47 | //! Erases previuously displayd presentations if there were some displayed |
48 | //! \param theContext a context instance |
49 | Standard_EXPORT void SetContext (const Handle(AIS_InteractiveContext)& theContext); |
50 | |
51 | //! Returns preview parameters |
52 | View_PreviewParameters* GetPreviewParameters() const { return myPreviewParameters; } |
53 | |
54 | //! Updates visibility of the presentations for the display type |
55 | Standard_EXPORT void UpdatePreview (const View_DisplayActionType theType, |
6b63dc83 |
56 | const NCollection_List<Handle(Standard_Transient)>& thePresentations); |
7e1c1e48 |
57 | |
58 | //! Returns true if preview presentation is shown |
59 | Standard_Boolean HasPreview() const { return !myPreviewPresentation.IsNull(); } |
60 | |
61 | private: |
62 | |
63 | //! Returns the current context |
64 | const Handle(AIS_InteractiveContext)& GetContext() const { return myContext; } |
65 | |
66 | private: |
67 | |
68 | Handle(AIS_InteractiveContext) myContext; //!< context, where the displayer works |
69 | |
70 | View_PreviewParameters* myPreviewParameters; //!< drawer of preview presentation |
71 | Handle(AIS_InteractiveObject) myPreviewPresentation; //!< presentation of preview for a selected object |
72 | NCollection_List<Handle(AIS_InteractiveObject)> myPreviewReadyPresentations; //!< presentation of preview for a selected object |
73 | }; |
74 | |
75 | #endif |