e04bb1627c02733f809cc2b71fa70d62bdfbd532
[occt.git] / src / PrsMgr / PrsMgr_Presentation.hxx
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
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
22
23 #include <PrsMgr_PresentableObjectPointer.hxx>
24 #include <Standard_Boolean.hxx>
25 #include <Standard_Integer.hxx>
26 #include <MMgt_TShared.hxx>
27 #include <Aspect_TypeOfHighlightMethod.hxx>
28 #include <Quantity_Length.hxx>
29 class PrsMgr_PresentationManager;
30 class PrsMgr_Prs;
31 class PrsMgr_PresentableObject;
32 class Quantity_Color;
33 class Geom_Transformation;
34 class Prs3d_ShadingAspect;
35 class Prs3d_Presentation;
36 class Graphic3d_Structure;
37 class Graphic3d_DataStructureManager;
38 class Prs3d_Projector;
39
40
41 class PrsMgr_Presentation;
42 DEFINE_STANDARD_HANDLE(PrsMgr_Presentation, MMgt_TShared)
43
44
45 class PrsMgr_Presentation : public MMgt_TShared
46 {
47
48 public:
49
50   
51   //! Destructor
52   Standard_EXPORT virtual void Destroy();
53 ~PrsMgr_Presentation()
54 {
55   Destroy();
56 }
57   
58     const Handle(Prs3d_Presentation)& Presentation() const;
59   
60   //! returns the PresentationManager in which the presentation has been created.
61     const Handle(PrsMgr_PresentationManager)& PresentationManager() const;
62   
63     void SetUpdateStatus (const Standard_Boolean theStat);
64   
65     Standard_Boolean MustBeUpdated() const;
66
67 friend class PrsMgr_PresentationManager;
68 friend class PrsMgr_PresentableObject;
69 friend class PrsMgr_Prs;
70
71
72   DEFINE_STANDARD_RTTIEXT(PrsMgr_Presentation,MMgt_TShared)
73
74 protected:
75
76
77
78
79 private:
80
81   
82   Standard_EXPORT PrsMgr_Presentation(const Handle(PrsMgr_PresentationManager)& thePresentationManager, const Handle(PrsMgr_PresentableObject)& thePresentableObject);
83   
84   Standard_EXPORT void Display();
85   
86   //! Displays myStructure.
87   Standard_EXPORT void display (const Standard_Boolean theIsHighlight);
88   
89   Standard_EXPORT void Erase();
90   
91   Standard_EXPORT void SetVisible (const Standard_Boolean theValue);
92   
93   Standard_EXPORT void Highlight (const Aspect_TypeOfHighlightMethod theMethod, const Quantity_Color& theColor);
94   
95   Standard_EXPORT void Unhighlight() const;
96   
97   Standard_EXPORT Standard_Boolean IsHighlighted() const;
98   
99   Standard_EXPORT Standard_Boolean IsDisplayed() const;
100   
101   Standard_EXPORT Standard_Integer DisplayPriority() const;
102   
103   Standard_EXPORT void SetDisplayPriority (const Standard_Integer aNewPrior);
104   
105   //! Set Z layer ID for the presentation
106   Standard_EXPORT void SetZLayer (const Standard_Integer theLayerId);
107   
108   //! Get Z layer ID for the presentation
109   Standard_EXPORT Standard_Integer GetZLayer() const;
110   
111   //! removes the whole content of the presentation.
112   //! Does not remove the other connected presentations.
113   Standard_EXPORT void Clear();
114   
115   Standard_EXPORT void Connect (const Handle(PrsMgr_Presentation)& theOther) const;
116   
117   Standard_EXPORT void Transform (const Handle(Geom_Transformation)& theTrsf) const;
118   
119   Standard_EXPORT void Place (const Quantity_Length theX, const Quantity_Length theY, const Quantity_Length theZ) const;
120   
121   Standard_EXPORT void Multiply (const Handle(Geom_Transformation)& theTrsf) const;
122   
123   Standard_EXPORT void Move (const Quantity_Length theX, const Quantity_Length theY, const Quantity_Length theZ) const;
124   
125   Standard_EXPORT void SetShadingAspect (const Handle(Prs3d_ShadingAspect)& theShadingAspect) const;
126   
127   Standard_EXPORT void Compute (const Handle(Graphic3d_Structure)& theStructure);
128   
129   Standard_EXPORT Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& theProjector);
130   
131   Standard_EXPORT Handle(Graphic3d_Structure) Compute (const Handle(Graphic3d_DataStructureManager)& theProjector, const Handle(Geom_Transformation)& theTrsf);
132   
133   Standard_EXPORT void Compute (const Handle(Graphic3d_DataStructureManager)& theProjector, const Handle(Graphic3d_Structure)& theGivenStruct);
134   
135   Standard_EXPORT void Compute (const Handle(Graphic3d_DataStructureManager)& theProjector, const Handle(Geom_Transformation)& theTrsf, const Handle(Graphic3d_Structure)& theGivenStruct);
136   
137   Standard_EXPORT static Handle(Prs3d_Projector) Projector (const Handle(Graphic3d_DataStructureManager)& theProjector);
138
139   Handle(PrsMgr_PresentationManager) myPresentationManager;
140   Handle(PrsMgr_Prs) myStructure;
141   PrsMgr_PresentableObjectPointer myPresentableObject;
142   Standard_Boolean myMustBeUpdated;
143   Standard_Integer myBeforeHighlightState;
144
145
146 };
147
148
149 #include <PrsMgr_Presentation.lxx>
150
151
152
153
154
155 #endif // _PrsMgr_Presentation_HeaderFile