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 Geom_Transformation;
28 class Graphic3d_Structure;
29 class Graphic3d_DataStructureManager;
30 class Prs3d_Projector;
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;
86 Standard_EXPORT PrsMgr_Presentation (const Handle(PrsMgr_PresentationManager)& thePresentationManager,
87 const Handle(PrsMgr_PresentableObject)& thePresentableObject,
88 const Standard_Integer theMode);
90 //! Displays myStructure.
91 Standard_EXPORT void display (const Standard_Boolean theIsHighlight);
93 Standard_EXPORT virtual Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& theProjector) Standard_OVERRIDE;
95 Standard_EXPORT virtual Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
96 const Handle(Geom_Transformation)& theTrsf) Standard_OVERRIDE;
98 Standard_EXPORT virtual void Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
99 Handle(Graphic3d_Structure)& theGivenStruct) Standard_OVERRIDE;
101 Standard_EXPORT virtual void Compute (const Handle(Graphic3d_DataStructureManager)& theProjector,
102 const Handle(Geom_Transformation)& theTrsf,
103 Handle(Graphic3d_Structure)& theGivenStruct) Standard_OVERRIDE;
105 Standard_EXPORT static Handle(Prs3d_Projector) Projector (const Handle(Graphic3d_DataStructureManager)& theProjector);
109 Handle(PrsMgr_PresentationManager) myPresentationManager;
110 PrsMgr_PresentableObject* myPresentableObject;
111 Standard_Integer myBeforeHighlightState;
112 Standard_Integer myMode;
113 Standard_Boolean myMustBeUpdated;
117 #endif // _PrsMgr_Presentation_HeaderFile