c357e426 |
1 | // Copyright (c) 2015 OPEN CASCADE SAS |
b311480e |
2 | // |
973c2be1 |
3 | // This file is part of Open CASCADE Technology software library. |
b311480e |
4 | // |
d5f74e42 |
5 | // This library is free software; you can redistribute it and/or modify it under |
6 | // the terms of the GNU Lesser General Public License version 2.1 as published |
973c2be1 |
7 | // by the Free Software Foundation, with special exception defined in the file |
8 | // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT |
9 | // distribution for complete text of the license and disclaimer of any warranty. |
b311480e |
10 | // |
973c2be1 |
11 | // Alternatively, this file may be used under the terms of Open CASCADE |
12 | // commercial license or contractual agreement. |
b311480e |
13 | |
7fd59977 |
14 | #ifndef _Graphic3d_CView_HeaderFile |
15 | #define _Graphic3d_CView_HeaderFile |
16 | |
c357e426 |
17 | #include <Aspect_Handle.hxx> |
c357e426 |
18 | #include <Aspect_RenderingContext.hxx> |
c357e426 |
19 | #include <Aspect_Window.hxx> |
20 | #include <Graphic3d_BufferType.hxx> |
b5ac8292 |
21 | #include <Graphic3d_Camera.hxx> |
077a220c |
22 | #include <Graphic3d_CubeMap.hxx> |
12381341 |
23 | #include <Graphic3d_CLight.hxx> |
c357e426 |
24 | #include <Graphic3d_CStructure.hxx> |
25 | #include <Graphic3d_DataStructureManager.hxx> |
26d9c835 |
26 | #include <Graphic3d_DiagnosticInfo.hxx> |
c357e426 |
27 | #include <Graphic3d_GraduatedTrihedron.hxx> |
28 | #include <Graphic3d_MapOfStructure.hxx> |
29 | #include <Graphic3d_NMapOfTransient.hxx> |
c357e426 |
30 | #include <Graphic3d_RenderingParams.hxx> |
51b10cd4 |
31 | #include <Graphic3d_SequenceOfHClipPlane.hxx> |
c357e426 |
32 | #include <Graphic3d_SequenceOfStructure.hxx> |
c357e426 |
33 | #include <Graphic3d_Structure.hxx> |
c357e426 |
34 | #include <Graphic3d_TextureEnv.hxx> |
35 | #include <Graphic3d_TypeOfAnswer.hxx> |
36 | #include <Graphic3d_TypeOfBackfacingModel.hxx> |
37 | #include <Graphic3d_TypeOfShadingModel.hxx> |
c357e426 |
38 | #include <Graphic3d_TypeOfVisualization.hxx> |
39 | #include <Graphic3d_Vec3.hxx> |
40 | #include <Graphic3d_ZLayerId.hxx> |
41 | #include <Graphic3d_ZLayerSettings.hxx> |
42 | #include <Image_PixMap.hxx> |
43 | #include <Quantity_NameOfColor.hxx> |
44 | #include <Standard_Address.hxx> |
45 | #include <Standard_Transient.hxx> |
26d9c835 |
46 | #include <TColStd_IndexedDataMapOfStringString.hxx> |
c357e426 |
47 | |
48 | class Graphic3d_CView; |
49 | class Graphic3d_GraphicDriver; |
1c728f2d |
50 | class Graphic3d_Layer; |
c357e426 |
51 | class Graphic3d_StructureManager; |
52 | |
53 | DEFINE_STANDARD_HANDLE (Graphic3d_CView, Graphic3d_DataStructureManager) |
54 | |
55 | //! Base class of a graphical view that carries out rendering process for a concrete |
56 | //! implementation of graphical driver. Provides virtual interfaces for redrawing its |
57 | //! contents, management of displayed structures and render settings. The source code |
58 | //! of the class itself implements functionality related to management of |
59 | //! computed (HLR or "view-dependent") structures. |
60 | class Graphic3d_CView : public Graphic3d_DataStructureManager |
bf75be98 |
61 | { |
dc89236f |
62 | friend class Graphic3d_StructureManager; |
63 | DEFINE_STANDARD_RTTIEXT(Graphic3d_CView, Graphic3d_DataStructureManager) |
bf75be98 |
64 | public: |
65 | |
c357e426 |
66 | //! Constructor. |
67 | Standard_EXPORT Graphic3d_CView (const Handle(Graphic3d_StructureManager)& theMgr); |
68 | |
69 | //! Destructor. |
70 | Standard_EXPORT virtual ~Graphic3d_CView(); |
71 | |
72 | //! Returns the identification number of the view. |
73 | Standard_Integer Identification() const { return myId; } |
74 | |
46710942 |
75 | //! Activates the view. Maps presentations defined within structure manager onto this view. |
c357e426 |
76 | Standard_EXPORT virtual void Activate(); |
77 | |
46710942 |
78 | //! Deactivates the view. Unmaps presentations defined within structure manager. |
79 | //! The view in deactivated state will ignore actions on structures such as Display(). |
c357e426 |
80 | Standard_EXPORT virtual void Deactivate(); |
81 | |
82 | //! Returns the activity flag of the view. |
83 | Standard_Boolean IsActive() const { return myIsActive; } |
84 | |
85 | //! Erases the view and removes from graphic driver. |
86 | //! No more graphic operations are allowed in this view after the call. |
87 | Standard_EXPORT virtual void Remove(); |
88 | |
89 | //! Returns true if the view was removed. |
90 | Standard_Boolean IsRemoved() const { return myIsRemoved; } |
bf75be98 |
91 | |
d325cb7f |
92 | //! Returns camera object of the view. |
93 | virtual const Handle(Graphic3d_Camera)& Camera() const { return myCamera; } |
94 | |
95 | //! Sets camera used by the view. |
96 | virtual void SetCamera (const Handle(Graphic3d_Camera)& theCamera) { myCamera = theCamera; } |
97 | |
bf75be98 |
98 | public: |
99 | |
dc89236f |
100 | //! Returns default Shading Model of the view; Graphic3d_TOSM_FRAGMENT by default. |
101 | Graphic3d_TypeOfShadingModel ShadingModel() const { return myShadingModel; } |
102 | |
103 | //! Sets default Shading Model of the view. |
104 | //! Will throw an exception on attempt to set Graphic3d_TOSM_DEFAULT. |
105 | Standard_EXPORT void SetShadingModel (Graphic3d_TypeOfShadingModel theModel); |
106 | |
c357e426 |
107 | //! Returns visualization type of the view. |
108 | Graphic3d_TypeOfVisualization VisualizationType() const { return myVisualization; } |
bf75be98 |
109 | |
c357e426 |
110 | //! Sets visualization type of the view. |
111 | void SetVisualizationType (const Graphic3d_TypeOfVisualization theType) { myVisualization = theType; } |
bf75be98 |
112 | |
c357e426 |
113 | //! Switches computed HLR mode in the view |
114 | Standard_EXPORT void SetComputedMode (const Standard_Boolean theMode); |
bf75be98 |
115 | |
c357e426 |
116 | //! Returns the computed HLR mode state |
117 | Standard_Boolean ComputedMode() const { return myIsInComputedMode; } |
bf75be98 |
118 | |
c357e426 |
119 | //! Computes the new presentation of the structure displayed in this view with the type Graphic3d_TOS_COMPUTED. |
120 | Standard_EXPORT void ReCompute (const Handle(Graphic3d_Structure)& theStructure); |
bf75be98 |
121 | |
cfece3ef |
122 | //! Invalidates bounding box of specified ZLayerId. |
123 | Standard_EXPORT void Update (const Graphic3d_ZLayerId theLayerId = Graphic3d_ZLayerId_UNKNOWN); |
124 | |
125 | //! Computes the new presentation of the structures displayed in this view with the type Graphic3d_TOS_COMPUTED. |
126 | Standard_EXPORT void Compute(); |
bf75be98 |
127 | |
c357e426 |
128 | //! Returns Standard_True if one of the structures displayed in the view contains Polygons, Triangles or Quadrangles. |
129 | Standard_EXPORT Standard_Boolean ContainsFacet() const; |
bf75be98 |
130 | |
c357e426 |
131 | //! Returns Standard_True if one of the structures in the set contains Polygons, Triangles or Quadrangles. |
132 | Standard_EXPORT Standard_Boolean ContainsFacet (const Graphic3d_MapOfStructure& theSet) const; |
bf75be98 |
133 | |
c357e426 |
134 | //! Returns the set of structures displayed in this view. |
135 | Standard_EXPORT void DisplayedStructures (Graphic3d_MapOfStructure& theStructures) const; |
b5ac8292 |
136 | |
c357e426 |
137 | //! Returns number of displayed structures in the view. |
91515621 |
138 | virtual Standard_Integer NumberOfDisplayedStructures() const { return myStructsDisplayed.Extent(); } |
bf75be98 |
139 | |
c357e426 |
140 | //! Returns map of objects hidden within this specific view (not viewer-wise). |
141 | const Handle(Graphic3d_NMapOfTransient)& HiddenObjects() const { return myHiddenObjects; } |
142 | |
143 | //! Returns map of objects hidden within this specific view (not viewer-wise). |
144 | Handle(Graphic3d_NMapOfTransient)& ChangeHiddenObjects() { return myHiddenObjects; } |
145 | |
146 | //! Returns Standard_True in case if the structure with the given <theStructId> is |
147 | //! in list of structures to be computed and stores computed struct to <theComputedStruct>. |
148 | Standard_EXPORT Standard_Boolean IsComputed (const Standard_Integer theStructId, |
149 | Handle(Graphic3d_Structure)& theComputedStruct) const; |
150 | |
50d06d8f |
151 | //! Returns the bounding box of all structures displayed in the view. |
3fe9ce0e |
152 | //! If theToIncludeAuxiliary is TRUE, then the boundary box also includes minimum and maximum limits |
153 | //! of graphical elements forming parts of infinite and other auxiliary structures. |
154 | //! @param theToIncludeAuxiliary consider also auxiliary presentations (with infinite flag or with trihedron transformation persistence) |
155 | //! @return computed bounding box |
91515621 |
156 | Standard_EXPORT virtual Bnd_Box MinMaxValues (const Standard_Boolean theToIncludeAuxiliary = Standard_False) const; |
c357e426 |
157 | |
158 | //! Returns the coordinates of the boundary box of all structures in the set <theSet>. |
159 | //! If <theToIgnoreInfiniteFlag> is TRUE, then the boundary box |
160 | //! also includes minimum and maximum limits of graphical elements |
161 | //! forming parts of infinite structures. |
162 | Standard_EXPORT Bnd_Box MinMaxValues (const Graphic3d_MapOfStructure& theSet, |
3fe9ce0e |
163 | const Standard_Boolean theToIncludeAuxiliary = Standard_False) const; |
c357e426 |
164 | |
165 | //! Returns the structure manager handle which manage structures associated with this view. |
166 | const Handle(Graphic3d_StructureManager)& StructureManager() const { return myStructureManager; } |
167 | |
168 | private: |
169 | |
c357e426 |
170 | //! Is it possible to display the structure in the view? |
171 | Standard_EXPORT Graphic3d_TypeOfAnswer acceptDisplay (const Graphic3d_TypeOfStructure theStructType) const; |
172 | |
c357e426 |
173 | //! Clears the structure in this view. |
7dd7c146 |
174 | Standard_EXPORT void Clear (Graphic3d_Structure* theStructure, |
175 | const Standard_Boolean theWithDestruction); |
c357e426 |
176 | |
177 | //! Connects the structures. |
7dd7c146 |
178 | Standard_EXPORT void Connect (const Graphic3d_Structure* theMother, |
179 | const Graphic3d_Structure* theDaughter); |
c357e426 |
180 | |
181 | //! Disconnects the structures. |
7dd7c146 |
182 | Standard_EXPORT void Disconnect (const Graphic3d_Structure* theMother, |
183 | const Graphic3d_Structure* theDaughter); |
c357e426 |
184 | |
185 | //! Displays the structure in the view. |
186 | Standard_EXPORT void Display (const Handle(Graphic3d_Structure)& theStructure); |
187 | |
c357e426 |
188 | //! Erases the structure from the view. |
189 | Standard_EXPORT void Erase (const Handle(Graphic3d_Structure)& theStructure); |
190 | |
c357e426 |
191 | //! Highlights the structure in the view. |
8e5fb5ea |
192 | Standard_EXPORT void Highlight (const Handle(Graphic3d_Structure)& theStructure); |
c357e426 |
193 | |
194 | //! Transforms the structure in the view. |
195 | Standard_EXPORT void SetTransform (const Handle(Graphic3d_Structure)& theStructure, |
1f7f5a90 |
196 | const Handle(Geom_Transformation)& theTrsf); |
c357e426 |
197 | |
198 | //! Suppress the highlighting on the structure <AStructure> |
199 | //! in the view <me>. |
200 | Standard_EXPORT void UnHighlight (const Handle(Graphic3d_Structure)& theStructure); |
201 | |
202 | //! Returns an index != 0 if the structure have another structure computed for the view <me>. |
7dd7c146 |
203 | Standard_EXPORT Standard_Integer IsComputed (const Graphic3d_Structure* theStructure) const; |
204 | |
205 | Standard_Integer IsComputed (const Handle(Graphic3d_Structure)& theStructure) const { return IsComputed (theStructure.get()); } |
c357e426 |
206 | |
207 | //! Returns true if the structure is displayed in the view. |
208 | Standard_EXPORT Standard_Boolean IsDisplayed (const Handle(Graphic3d_Structure)& theStructure) const; |
209 | |
210 | //! Changes the display priority of the structure. |
211 | Standard_EXPORT void ChangePriority (const Handle(Graphic3d_Structure)& theStructure, |
212 | const Standard_Integer theOldPriority, |
213 | const Standard_Integer theNewPriority); |
214 | |
215 | //! Change Z layer of already displayed structure in the view. |
216 | Standard_EXPORT void ChangeZLayer (const Handle(Graphic3d_Structure)& theStructure, |
217 | const Graphic3d_ZLayerId theLayerId); |
218 | |
219 | //! Returns an index != 0 if the structure have the same owner than another structure |
220 | //! in the sequence of the computed structures. |
221 | Standard_EXPORT Standard_Integer HaveTheSameOwner (const Handle(Graphic3d_Structure)& theStructure) const; |
bf75be98 |
222 | |
223 | public: |
224 | |
c357e426 |
225 | //! Redraw content of the view. |
226 | virtual void Redraw() = 0; |
227 | |
228 | //! Redraw immediate content of the view. |
229 | virtual void RedrawImmediate() = 0; |
230 | |
231 | //! Invalidates content of the view but does not redraw it. |
232 | virtual void Invalidate() = 0; |
233 | |
234 | //! Return true if view content cache has been invalidated. |
235 | virtual Standard_Boolean IsInvalidated() = 0; |
236 | |
237 | //! Handle changing size of the rendering window. |
238 | virtual void Resized() = 0; |
239 | |
240 | //! @param theDrawToFrontBuffer Advanced option to modify rendering mode: |
241 | //! 1. TRUE. Drawing immediate mode structures directly to the front buffer over the scene image. |
242 | //! Fast, so preferred for interactive work (used by default). |
243 | //! However these extra drawings will be missed in image dump since it is performed from back buffer. |
244 | //! Notice that since no pre-buffering used the V-Sync will be ignored and rendering could be seen |
245 | //! in run-time (in case of slow hardware) and/or tearing may appear. |
246 | //! So this is strongly recommended to draw only simple (fast) structures. |
247 | //! 2. FALSE. Drawing immediate mode structures to the back buffer. |
248 | //! The complete scene is redrawn first, so this mode is slower if scene contains complex data and/or V-Sync |
249 | //! is turned on. But it works in any case and is especially useful for view dump because the dump image is read |
250 | //! from the back buffer. |
251 | //! @return previous mode. |
252 | virtual Standard_Boolean SetImmediateModeDrawToFront (const Standard_Boolean theDrawToFrontBuffer) = 0; |
253 | |
254 | //! Creates and maps rendering window to the view. |
c357e426 |
255 | //! @param theWindow [in] the window. |
256 | //! @param theContext [in] the rendering context. If NULL the context will be created internally. |
c357e426 |
257 | virtual void SetWindow (const Handle(Aspect_Window)& theWindow, |
a521d90d |
258 | const Aspect_RenderingContext theContext = NULL) = 0; |
c357e426 |
259 | |
260 | //! Returns the window associated to the view. |
261 | virtual Handle(Aspect_Window) Window() const = 0; |
262 | |
263 | //! Returns True if the window associated to the view is defined. |
264 | virtual Standard_Boolean IsDefined() const = 0; |
265 | |
c357e426 |
266 | //! Dump active rendering buffer into specified memory buffer. |
267 | virtual Standard_Boolean BufferDump (Image_PixMap& theImage, const Graphic3d_BufferType& theBufferType) = 0; |
268 | |
c357e426 |
269 | //! Marks BVH tree and the set of BVH primitives of correspondent priority list with id theLayerId as outdated. |
8f138407 |
270 | virtual void InvalidateBVHData (const Graphic3d_ZLayerId theLayerId) = 0; |
c357e426 |
271 | |
1c728f2d |
272 | //! Add a layer to the view. |
273 | //! @param theNewLayerId [in] id of new layer, should be > 0 (negative values are reserved for default layers). |
274 | //! @param theSettings [in] new layer settings |
275 | //! @param theLayerAfter [in] id of layer to append new layer before |
276 | virtual void InsertLayerBefore (const Graphic3d_ZLayerId theNewLayerId, |
277 | const Graphic3d_ZLayerSettings& theSettings, |
278 | const Graphic3d_ZLayerId theLayerAfter) = 0; |
279 | |
280 | //! Add a layer to the view. |
281 | //! @param theNewLayerId [in] id of new layer, should be > 0 (negative values are reserved for default layers). |
282 | //! @param theSettings [in] new layer settings |
283 | //! @param theLayerBefore [in] id of layer to append new layer after |
284 | virtual void InsertLayerAfter (const Graphic3d_ZLayerId theNewLayerId, |
285 | const Graphic3d_ZLayerSettings& theSettings, |
286 | const Graphic3d_ZLayerId theLayerBefore) = 0; |
c357e426 |
287 | |
50d06d8f |
288 | //! Returns the maximum Z layer ID. |
289 | //! First layer ID is Graphic3d_ZLayerId_Default, last ID is ZLayerMax(). |
290 | virtual Standard_Integer ZLayerMax() const = 0; |
291 | |
1c728f2d |
292 | //! Returns the list of layers. |
293 | virtual const NCollection_List<Handle(Graphic3d_Layer)>& Layers() const = 0; |
294 | |
295 | //! Returns layer with given ID or NULL if undefined. |
296 | virtual Handle(Graphic3d_Layer) Layer (const Graphic3d_ZLayerId theLayerId) const = 0; |
50d06d8f |
297 | |
298 | //! Returns the bounding box of all structures displayed in the Z layer. |
1c728f2d |
299 | Standard_EXPORT virtual void InvalidateZLayerBoundingBox (const Graphic3d_ZLayerId theLayerId); |
50d06d8f |
300 | |
c357e426 |
301 | //! Remove Z layer from the specified view. All structures |
302 | //! displayed at the moment in layer will be displayed in default layer |
303 | //! ( the bottom-level z layer ). To unset layer ID from associated |
304 | //! structures use method UnsetZLayer (...). |
305 | virtual void RemoveZLayer (const Graphic3d_ZLayerId theLayerId) = 0; |
306 | |
307 | //! Sets the settings for a single Z layer of specified view. |
308 | virtual void SetZLayerSettings (const Graphic3d_ZLayerId theLayerId, |
309 | const Graphic3d_ZLayerSettings& theSettings) = 0; |
310 | |
50d06d8f |
311 | //! Returns zoom-scale factor. |
312 | Standard_EXPORT Standard_Real ConsiderZoomPersistenceObjects(); |
313 | |
c357e426 |
314 | //! Returns pointer to an assigned framebuffer object. |
b128c892 |
315 | virtual Handle(Standard_Transient) FBO() const = 0; |
c357e426 |
316 | |
317 | //! Sets framebuffer object for offscreen rendering. |
b128c892 |
318 | virtual void SetFBO (const Handle(Standard_Transient)& theFbo) = 0; |
c357e426 |
319 | |
320 | //! Generate offscreen FBO in the graphic library. |
321 | //! If not supported on hardware returns NULL. |
b128c892 |
322 | virtual Handle(Standard_Transient) FBOCreate (const Standard_Integer theWidth, |
323 | const Standard_Integer theHeight) = 0; |
c357e426 |
324 | |
325 | //! Remove offscreen FBO from the graphic library |
b128c892 |
326 | virtual void FBORelease (Handle(Standard_Transient)& theFbo) = 0; |
c357e426 |
327 | |
328 | //! Read offscreen FBO configuration. |
b128c892 |
329 | virtual void FBOGetDimensions (const Handle(Standard_Transient)& theFbo, |
c357e426 |
330 | Standard_Integer& theWidth, |
331 | Standard_Integer& theHeight, |
332 | Standard_Integer& theWidthMax, |
333 | Standard_Integer& theHeightMax) = 0; |
334 | |
335 | //! Change offscreen FBO viewport. |
b128c892 |
336 | virtual void FBOChangeViewport (const Handle(Standard_Transient)& theFbo, |
c357e426 |
337 | const Standard_Integer theWidth, |
338 | const Standard_Integer theHeight) = 0; |
bf75be98 |
339 | |
340 | public: |
341 | |
c357e426 |
342 | //! Copy visualization settings from another view. |
343 | //! Method is used for cloning views in viewer when its required to create view |
344 | //! with same view properties. |
345 | Standard_EXPORT virtual void CopySettings (const Handle(Graphic3d_CView)& theOther); |
346 | |
347 | //! Returns current rendering parameters and effect settings. |
348 | const Graphic3d_RenderingParams& RenderingParams() const { return myRenderParams; } |
349 | |
350 | //! Returns reference to current rendering parameters and effect settings. |
351 | Graphic3d_RenderingParams& ChangeRenderingParams() { return myRenderParams; } |
352 | |
c357e426 |
353 | //! Returns background fill color. |
d325cb7f |
354 | virtual Aspect_Background Background() const { return Aspect_Background (myBgColor.GetRGB()); } |
c357e426 |
355 | |
356 | //! Sets background fill color. |
d325cb7f |
357 | virtual void SetBackground (const Aspect_Background& theBackground) { myBgColor.SetRGB (theBackground.Color()); } |
c357e426 |
358 | |
359 | //! Returns gradient background fill colors. |
360 | virtual Aspect_GradientBackground GradientBackground() const = 0; |
361 | |
362 | //! Sets gradient background fill colors. |
363 | virtual void SetGradientBackground (const Aspect_GradientBackground& theBackground) = 0; |
364 | |
365 | //! Returns background image texture file path. |
366 | virtual TCollection_AsciiString BackgroundImage() = 0; |
367 | |
368 | //! Sets background image texture file path. |
369 | virtual void SetBackgroundImage (const TCollection_AsciiString& theFilePath) = 0; |
370 | |
371 | //! Returns background image fill style. |
372 | virtual Aspect_FillMethod BackgroundImageStyle() const = 0; |
373 | |
374 | //! Sets background image fill style. |
375 | virtual void SetBackgroundImageStyle (const Aspect_FillMethod theFillStyle) = 0; |
376 | |
077a220c |
377 | //! Returns cubemap being setted last time on background. |
378 | virtual Handle(Graphic3d_CubeMap) BackgroundCubeMap() const = 0; |
379 | |
380 | //! Sets environment cubemap as background. |
67312b79 |
381 | //! @param theCubeMap cubemap source to be set as background |
382 | //! @param theToUpdatePBREnv defines whether IBL maps will be generated or not (see 'GeneratePBREnvironment') |
383 | virtual void SetBackgroundCubeMap (const Handle(Graphic3d_CubeMap)& theCubeMap, |
384 | Standard_Boolean theToUpdatePBREnv = Standard_True) = 0; |
385 | |
386 | //! Generates PBR specular probe and irradiance map |
387 | //! in order to provide environment indirect illumination in PBR shading model (Image Based Lighting). |
388 | //! The source of environment data is background cubemap. |
389 | //! If PBR is unavailable it does nothing. |
390 | //! If PBR is available but there is no cubemap being set to background it clears all IBL maps (see 'ClearPBREnvironment'). |
391 | virtual void GeneratePBREnvironment() = 0; |
392 | |
393 | //! Fills PBR specular probe and irradiance map with white color. |
394 | //! So that environment indirect illumination will be constant |
395 | //! and will be fully controlled by ambient light sources. |
396 | //! If PBR is unavailable it does nothing. |
397 | virtual void ClearPBREnvironment() = 0; |
077a220c |
398 | |
c357e426 |
399 | //! Returns environment texture set for the view. |
400 | virtual Handle(Graphic3d_TextureEnv) TextureEnv() const = 0; |
401 | |
402 | //! Sets environment texture for the view. |
403 | virtual void SetTextureEnv (const Handle(Graphic3d_TextureEnv)& theTextureEnv) = 0; |
404 | |
c357e426 |
405 | //! Return backfacing model used for the view. |
406 | virtual Graphic3d_TypeOfBackfacingModel BackfacingModel() const = 0; |
bf75be98 |
407 | |
c357e426 |
408 | //! Sets backfacing model for the view. |
409 | virtual void SetBackfacingModel (const Graphic3d_TypeOfBackfacingModel theModel) = 0; |
bf75be98 |
410 | |
c357e426 |
411 | //! Returns list of lights of the view. |
992ed6b3 |
412 | virtual const Handle(Graphic3d_LightSet)& Lights() const = 0; |
c357e426 |
413 | |
414 | //! Sets list of lights for the view. |
992ed6b3 |
415 | virtual void SetLights (const Handle(Graphic3d_LightSet)& theLights) = 0; |
c357e426 |
416 | |
417 | //! Returns list of clip planes set for the view. |
3202bf1e |
418 | virtual const Handle(Graphic3d_SequenceOfHClipPlane)& ClipPlanes() const = 0; |
c357e426 |
419 | |
420 | //! Sets list of clip planes for the view. |
3202bf1e |
421 | virtual void SetClipPlanes (const Handle(Graphic3d_SequenceOfHClipPlane)& thePlanes) = 0; |
c357e426 |
422 | |
26d9c835 |
423 | //! Fill in the dictionary with diagnostic info. |
424 | //! Should be called within rendering thread. |
425 | //! |
426 | //! This API should be used only for user output or for creating automated reports. |
427 | //! The format of returned information (e.g. key-value layout) |
428 | //! is NOT part of this API and can be changed at any time. |
429 | //! Thus application should not parse returned information to weed out specific parameters. |
430 | virtual void DiagnosticInformation (TColStd_IndexedDataMapOfStringString& theDict, |
431 | Graphic3d_DiagnosticInfo theFlags) const = 0; |
432 | |
79b544e6 |
433 | //! Returns string with statistic performance info. |
434 | virtual TCollection_AsciiString StatisticInformation() const = 0; |
435 | |
436 | //! Fills in the dictionary with statistic performance info. |
437 | virtual void StatisticInformation (TColStd_IndexedDataMapOfStringString& theDict) const = 0; |
438 | |
d325cb7f |
439 | public: //! @name obsolete Graduated Trihedron functionality |
440 | |
441 | //! Returns data of a graduated trihedron |
442 | virtual const Graphic3d_GraduatedTrihedron& GetGraduatedTrihedron() { return myGTrihedronData; } |
443 | |
444 | //! Displays Graduated Trihedron. |
445 | virtual void GraduatedTrihedronDisplay (const Graphic3d_GraduatedTrihedron& theTrihedronData) { (void )theTrihedronData; } |
446 | |
447 | //! Erases Graduated Trihedron. |
448 | virtual void GraduatedTrihedronErase() {} |
449 | |
450 | //! Sets minimum and maximum points of scene bounding box for Graduated Trihedron stored in graphic view object. |
451 | //! @param theMin [in] the minimum point of scene. |
452 | //! @param theMax [in] the maximum point of scene. |
453 | virtual void GraduatedTrihedronMinMaxValues (const Graphic3d_Vec3 theMin, const Graphic3d_Vec3 theMax) |
454 | { |
455 | (void )theMin; |
456 | (void )theMax; |
457 | } |
458 | |
c357e426 |
459 | private: |
460 | |
461 | //! Adds the structure to display lists of the view. |
462 | virtual void displayStructure (const Handle(Graphic3d_CStructure)& theStructure, |
463 | const Standard_Integer thePriority) = 0; |
464 | |
465 | //! Erases the structure from display lists of the view. |
466 | virtual void eraseStructure (const Handle(Graphic3d_CStructure)& theStructure) = 0; |
467 | |
468 | //! Change Z layer of a structure already presented in view. |
469 | virtual void changeZLayer (const Handle(Graphic3d_CStructure)& theCStructure, |
470 | const Graphic3d_ZLayerId theNewLayerId) = 0; |
471 | |
472 | //! Changes the priority of a structure within its Z layer in the specified view. |
473 | virtual void changePriority (const Handle(Graphic3d_CStructure)& theCStructure, |
474 | const Standard_Integer theNewPriority) = 0; |
475 | |
c357e426 |
476 | protected: |
477 | |
478 | Standard_Integer myId; |
479 | Graphic3d_RenderingParams myRenderParams; |
d325cb7f |
480 | Quantity_ColorRGBA myBgColor; |
c357e426 |
481 | Handle(Graphic3d_StructureManager) myStructureManager; |
d325cb7f |
482 | Handle(Graphic3d_Camera) myCamera; |
c357e426 |
483 | Graphic3d_SequenceOfStructure myStructsToCompute; |
484 | Graphic3d_SequenceOfStructure myStructsComputed; |
485 | Graphic3d_MapOfStructure myStructsDisplayed; |
486 | Handle(Graphic3d_NMapOfTransient) myHiddenObjects; |
487 | Standard_Boolean myIsInComputedMode; |
488 | Standard_Boolean myIsActive; |
489 | Standard_Boolean myIsRemoved; |
dc89236f |
490 | Graphic3d_TypeOfShadingModel myShadingModel; |
c357e426 |
491 | Graphic3d_TypeOfVisualization myVisualization; |
c357e426 |
492 | |
d325cb7f |
493 | protected: |
494 | |
495 | Graphic3d_GraduatedTrihedron myGTrihedronData; |
496 | |
bf75be98 |
497 | }; |
498 | |
c357e426 |
499 | #endif // _Graphic3d_CView_HeaderFile |