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;
27 class Geom_Transformation;
29 class Graphic3d_Structure;
30 class Graphic3d_DataStructureManager;
32 DEFINE_STANDARD_HANDLE(PrsMgr_Presentation, Graphic3d_Structure)
34 class PrsMgr_Presentation : public Graphic3d_Structure
36 DEFINE_STANDARD_RTTIEXT(PrsMgr_Presentation, Graphic3d_Structure)
37 friend class PrsMgr_PresentationManager;
38 friend class PrsMgr_PresentableObject;
42 Standard_EXPORT ~PrsMgr_Presentation();
44 Standard_DEPRECATED("Dummy to simplify porting - returns self")
45 Prs3d_Presentation* Presentation() { return this; }
47 //! returns the PresentationManager in which the presentation has been created.
48 const Handle(PrsMgr_PresentationManager)& PresentationManager() const { return myPresentationManager; }
50 void SetUpdateStatus (const Standard_Boolean theUpdateStatus) { myMustBeUpdated = theUpdateStatus; }
52 Standard_Boolean MustBeUpdated() const { return myMustBeUpdated; }
54 //! Return display mode index.
55 Standard_Integer Mode() const { return myMode; }
57 //! Display structure.
58 Standard_EXPORT virtual void Display() Standard_OVERRIDE;
61 Standard_EXPORT virtual void Erase() Standard_OVERRIDE;
63 //! Highlight structure.
64 Standard_EXPORT void Highlight (const Handle(Prs3d_Drawer)& theStyle);
66 //! Unhighlight structure.
67 Standard_EXPORT void Unhighlight();
69 //! Return TRUE if structure has been displayed and in no hidden state.
70 virtual Standard_Boolean IsDisplayed() const Standard_OVERRIDE
72 return base_type::IsDisplayed()
73 && base_type::IsVisible();
76 //! removes the whole content of the presentation.
77 //! Does not remove the other connected presentations.
78 Standard_EXPORT virtual void Clear (const Standard_Boolean theWithDestruction = Standard_True) Standard_OVERRIDE;
80 //! Compute structure using presentation manager.
81 Standard_EXPORT virtual void Compute() Standard_OVERRIDE;
83 //! Dumps the content of me into the stream
84 Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
89 Standard_EXPORT PrsMgr_Presentation (const Handle(PrsMgr_PresentationManager)& thePresentationManager,
90 const Handle(PrsMgr_PresentableObject)& thePresentableObject,
91 const Standard_Integer theMode);
93 //! Displays myStructure.
94 Standard_EXPORT void display (const Standard_Boolean theIsHighlight);
96 Standard_EXPORT virtual void computeHLR (const Handle(Graphic3d_Camera)& theProjector,
97 Handle(Graphic3d_Structure)& theGivenStruct) Standard_OVERRIDE;
100 Handle(PrsMgr_PresentationManager) myPresentationManager;
101 PrsMgr_PresentableObject* myPresentableObject;
102 Standard_Integer myBeforeHighlightState;
103 Standard_Integer myMode;
104 Standard_Boolean myMustBeUpdated;
108 #endif // _PrsMgr_Presentation_HeaderFile