1 // Created on: 1995-01-25
2 // Created by: Jean-Louis Frenkel
3 // Copyright (c) 1995-1999 Matra Datavision
4 // Copyright (c) 1999-2014 OPEN CASCADE SAS
6 // This file is part of Open CASCADE Technology software library.
8 // This library is free software; you can redistribute it and/or modify it under
9 // the terms of the GNU Lesser General Public License version 2.1 as published
10 // by the Free Software Foundation, with special exception defined in the file
11 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
12 // distribution for complete text of the license and disclaimer of any warranty.
14 // Alternatively, this file may be used under the terms of Open CASCADE
15 // commercial license or contractual agreement.
17 #ifndef _PrsMgr_Presentation_HeaderFile
18 #define _PrsMgr_Presentation_HeaderFile
20 #include <Aspect_TypeOfHighlightMethod.hxx>
21 #include <Prs3d_Presentation.hxx>
23 class PrsMgr_PresentationManager;
24 class PrsMgr_PresentableObject;
26 class Graphic3d_Camera;
28 class Graphic3d_Structure;
29 class Graphic3d_DataStructureManager;
31 DEFINE_STANDARD_HANDLE(PrsMgr_Presentation, Graphic3d_Structure)
33 class PrsMgr_Presentation : public Graphic3d_Structure
35 DEFINE_STANDARD_RTTIEXT(PrsMgr_Presentation, Graphic3d_Structure)
36 friend class PrsMgr_PresentationManager;
37 friend class PrsMgr_PresentableObject;
41 Standard_EXPORT ~PrsMgr_Presentation();
43 Standard_DEPRECATED("Dummy to simplify porting - returns self")
44 Prs3d_Presentation* Presentation() { return this; }
46 //! returns the PresentationManager in which the presentation has been created.
47 const Handle(PrsMgr_PresentationManager)& PresentationManager() const { return myPresentationManager; }
49 void SetUpdateStatus (const Standard_Boolean theUpdateStatus) { myMustBeUpdated = theUpdateStatus; }
51 Standard_Boolean MustBeUpdated() const { return myMustBeUpdated; }
53 //! Return display mode index.
54 Standard_Integer Mode() const { return myMode; }
56 //! Display structure.
57 Standard_EXPORT virtual void Display() Standard_OVERRIDE;
60 Standard_EXPORT virtual void Erase() Standard_OVERRIDE;
62 //! Highlight structure.
63 Standard_EXPORT void Highlight (const Handle(Prs3d_Drawer)& theStyle);
65 //! Unhighlight structure.
66 Standard_EXPORT void Unhighlight();
68 //! Return TRUE if structure has been displayed and in no hidden state.
69 virtual Standard_Boolean IsDisplayed() const Standard_OVERRIDE
71 return base_type::IsDisplayed()
72 && base_type::IsVisible();
75 //! removes the whole content of the presentation.
76 //! Does not remove the other connected presentations.
77 Standard_EXPORT virtual void Clear (const Standard_Boolean theWithDestruction = Standard_True) Standard_OVERRIDE;
79 //! Compute structure using presentation manager.
80 Standard_EXPORT virtual void Compute() Standard_OVERRIDE;
82 //! Dumps the content of me into the stream
83 Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
88 Standard_EXPORT PrsMgr_Presentation (const Handle(PrsMgr_PresentationManager)& thePresentationManager,
89 const Handle(PrsMgr_PresentableObject)& thePresentableObject,
90 const Standard_Integer theMode);
92 //! Displays myStructure.
93 Standard_EXPORT void display (const Standard_Boolean theIsHighlight);
95 Standard_EXPORT virtual void computeHLR (const Handle(Graphic3d_Camera)& theProjector,
96 Handle(Graphic3d_Structure)& theGivenStruct) Standard_OVERRIDE;
99 Handle(PrsMgr_PresentationManager) myPresentationManager;
100 PrsMgr_PresentableObject* myPresentableObject;
101 Standard_Integer myBeforeHighlightState;
102 Standard_Integer myMode;
103 Standard_Boolean myMustBeUpdated;
107 #endif // _PrsMgr_Presentation_HeaderFile