0031682: Visualization - Prs3d_ShadingAspect::SetTransparency() has no effect with...
[occt.git] / src / PrsMgr / PrsMgr_Presentation.hxx
CommitLineData
42cf5bc1 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
5//
6// This file is part of Open CASCADE Technology software library.
7//
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.
13//
14// Alternatively, this file may be used under the terms of Open CASCADE
15// commercial license or contractual agreement.
16
17#ifndef _PrsMgr_Presentation_HeaderFile
18#define _PrsMgr_Presentation_HeaderFile
19
42cf5bc1 20#include <Aspect_TypeOfHighlightMethod.hxx>
7dd7c146 21#include <Prs3d_Presentation.hxx>
f838dac4 22
42cf5bc1 23class PrsMgr_PresentationManager;
42cf5bc1 24class PrsMgr_PresentableObject;
25class Quantity_Color;
b5163d2f 26class Graphic3d_Camera;
f838dac4 27class Prs3d_Drawer;
42cf5bc1 28class Graphic3d_Structure;
29class Graphic3d_DataStructureManager;
42cf5bc1 30
7dd7c146 31DEFINE_STANDARD_HANDLE(PrsMgr_Presentation, Graphic3d_Structure)
42cf5bc1 32
7dd7c146 33class PrsMgr_Presentation : public Graphic3d_Structure
42cf5bc1 34{
7dd7c146 35 DEFINE_STANDARD_RTTIEXT(PrsMgr_Presentation, Graphic3d_Structure)
f838dac4 36 friend class PrsMgr_PresentationManager;
37 friend class PrsMgr_PresentableObject;
42cf5bc1 38public:
39
42cf5bc1 40 //! Destructor
e6f550da 41 Standard_EXPORT ~PrsMgr_Presentation();
42cf5bc1 42
7dd7c146 43 Standard_DEPRECATED("Dummy to simplify porting - returns self")
44 Prs3d_Presentation* Presentation() { return this; }
42cf5bc1 45
f838dac4 46 //! returns the PresentationManager in which the presentation has been created.
47 const Handle(PrsMgr_PresentationManager)& PresentationManager() const { return myPresentationManager; }
42cf5bc1 48
f838dac4 49 void SetUpdateStatus (const Standard_Boolean theUpdateStatus) { myMustBeUpdated = theUpdateStatus; }
42cf5bc1 50
f838dac4 51 Standard_Boolean MustBeUpdated() const { return myMustBeUpdated; }
42cf5bc1 52
7dd7c146 53 //! Return display mode index.
54 Standard_Integer Mode() const { return myMode; }
42cf5bc1 55
7dd7c146 56 //! Display structure.
57 Standard_EXPORT virtual void Display() Standard_OVERRIDE;
58
59 //! Remove structure.
60 Standard_EXPORT virtual void Erase() Standard_OVERRIDE;
61
62 //! Highlight structure.
f838dac4 63 Standard_EXPORT void Highlight (const Handle(Prs3d_Drawer)& theStyle);
7dd7c146 64
65 //! Unhighlight structure.
66 Standard_EXPORT void Unhighlight();
67
68 //! Return TRUE if structure has been displayed and in no hidden state.
69 virtual Standard_Boolean IsDisplayed() const Standard_OVERRIDE
70 {
71 return base_type::IsDisplayed()
72 && base_type::IsVisible();
73 }
74
42cf5bc1 75 //! removes the whole content of the presentation.
76 //! Does not remove the other connected presentations.
7dd7c146 77 Standard_EXPORT virtual void Clear (const Standard_Boolean theWithDestruction = Standard_True) Standard_OVERRIDE;
78
79 //! Compute structure using presentation manager.
80 Standard_EXPORT virtual void Compute() Standard_OVERRIDE;
81
bc73b006 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;
84
7dd7c146 85protected:
86
87 //! Main constructor.
88 Standard_EXPORT PrsMgr_Presentation (const Handle(PrsMgr_PresentationManager)& thePresentationManager,
89 const Handle(PrsMgr_PresentableObject)& thePresentableObject,
90 const Standard_Integer theMode);
91
92 //! Displays myStructure.
93 Standard_EXPORT void display (const Standard_Boolean theIsHighlight);
94
b5163d2f 95 Standard_EXPORT virtual void computeHLR (const Handle(Graphic3d_Camera)& theProjector,
96 Handle(Graphic3d_Structure)& theGivenStruct) Standard_OVERRIDE;
2831708b 97protected:
98
42cf5bc1 99 Handle(PrsMgr_PresentationManager) myPresentationManager;
2b886265 100 PrsMgr_PresentableObject* myPresentableObject;
42cf5bc1 101 Standard_Integer myBeforeHighlightState;
7dd7c146 102 Standard_Integer myMode;
103 Standard_Boolean myMustBeUpdated;
42cf5bc1 104
42cf5bc1 105};
106
42cf5bc1 107#endif // _PrsMgr_Presentation_HeaderFile