0027818: Visualization - provide an interface to define highlight presentation properties
[occt.git] / src / Graphic3d / Graphic3d_CView.hxx
CommitLineData
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>
19#include <Aspect_TypeOfTriedronEcho.hxx>
20#include <Aspect_TypeOfTriedronPosition.hxx>
21#include <Aspect_TypeOfUpdate.hxx>
22#include <Aspect_Window.hxx>
23#include <Graphic3d_BufferType.hxx>
b5ac8292 24#include <Graphic3d_Camera.hxx>
12381341 25#include <Graphic3d_CLight.hxx>
c357e426 26#include <Graphic3d_CStructure.hxx>
27#include <Graphic3d_DataStructureManager.hxx>
26d9c835 28#include <Graphic3d_DiagnosticInfo.hxx>
c357e426 29#include <Graphic3d_ExportFormat.hxx>
30#include <Graphic3d_GraduatedTrihedron.hxx>
31#include <Graphic3d_MapOfStructure.hxx>
32#include <Graphic3d_NMapOfTransient.hxx>
c357e426 33#include <Graphic3d_RenderingParams.hxx>
51b10cd4 34#include <Graphic3d_SequenceOfHClipPlane.hxx>
c357e426 35#include <Graphic3d_SequenceOfStructure.hxx>
36#include <Graphic3d_SortType.hxx>
37#include <Graphic3d_Structure.hxx>
c357e426 38#include <Graphic3d_TextureEnv.hxx>
39#include <Graphic3d_TypeOfAnswer.hxx>
40#include <Graphic3d_TypeOfBackfacingModel.hxx>
41#include <Graphic3d_TypeOfShadingModel.hxx>
c357e426 42#include <Graphic3d_TypeOfVisualization.hxx>
43#include <Graphic3d_Vec3.hxx>
44#include <Graphic3d_ZLayerId.hxx>
45#include <Graphic3d_ZLayerSettings.hxx>
46#include <Image_PixMap.hxx>
47#include <Quantity_NameOfColor.hxx>
48#include <Standard_Address.hxx>
49#include <Standard_Transient.hxx>
26d9c835 50#include <TColStd_IndexedDataMapOfStringString.hxx>
c357e426 51
52class Graphic3d_CView;
53class Graphic3d_GraphicDriver;
54class Graphic3d_StructureManager;
55
56DEFINE_STANDARD_HANDLE (Graphic3d_CView, Graphic3d_DataStructureManager)
57
58//! Base class of a graphical view that carries out rendering process for a concrete
59//! implementation of graphical driver. Provides virtual interfaces for redrawing its
60//! contents, management of displayed structures and render settings. The source code
61//! of the class itself implements functionality related to management of
62//! computed (HLR or "view-dependent") structures.
63class Graphic3d_CView : public Graphic3d_DataStructureManager
bf75be98 64{
bf75be98 65public:
66
c357e426 67 //! Constructor.
68 Standard_EXPORT Graphic3d_CView (const Handle(Graphic3d_StructureManager)& theMgr);
69
70 //! Destructor.
71 Standard_EXPORT virtual ~Graphic3d_CView();
72
73 //! Returns the identification number of the view.
74 Standard_Integer Identification() const { return myId; }
75
76 //! Activates the view. Map the associated window on the screen and post the view in this window.
77 //! Warning: Raises ViewDefinitionError if the associated window isn't defined.
78 Standard_EXPORT virtual void Activate();
79
80 //! Deactivates the view. Unmap the associated window on the screen and unpost the view in this window.
81 //! Warning: Raises ViewDefinitionError if the associated window isn't defined.
82 Standard_EXPORT virtual void Deactivate();
83
84 //! Returns the activity flag of the view.
85 Standard_Boolean IsActive() const { return myIsActive; }
86
87 //! Erases the view and removes from graphic driver.
88 //! No more graphic operations are allowed in this view after the call.
89 Standard_EXPORT virtual void Remove();
90
91 //! Returns true if the view was removed.
92 Standard_Boolean IsRemoved() const { return myIsRemoved; }
bf75be98 93
94public:
95
c357e426 96 //! Returns visualization type of the view.
97 Graphic3d_TypeOfVisualization VisualizationType() const { return myVisualization; }
bf75be98 98
c357e426 99 //! Sets visualization type of the view.
100 void SetVisualizationType (const Graphic3d_TypeOfVisualization theType) { myVisualization = theType; }
bf75be98 101
c357e426 102 //! Switches computed HLR mode in the view
103 Standard_EXPORT void SetComputedMode (const Standard_Boolean theMode);
bf75be98 104
c357e426 105 //! Returns the computed HLR mode state
106 Standard_Boolean ComputedMode() const { return myIsInComputedMode; }
bf75be98 107
c357e426 108 //! Computes the new presentation of the structure displayed in this view with the type Graphic3d_TOS_COMPUTED.
109 Standard_EXPORT void ReCompute (const Handle(Graphic3d_Structure)& theStructure);
bf75be98 110
50d06d8f 111 //! Updates screen in function of modifications of the structures
112 //! and invalidates bounding box of specified ZLayerId.
113 Standard_EXPORT void Update (const Aspect_TypeOfUpdate theUpdateMode,
114 const Graphic3d_ZLayerId theLayerId = Graphic3d_ZLayerId_UNKNOWN);
bf75be98 115
c357e426 116 //! Returns Standard_True if one of the structures displayed in the view contains Polygons, Triangles or Quadrangles.
117 Standard_EXPORT Standard_Boolean ContainsFacet() const;
bf75be98 118
c357e426 119 //! Returns Standard_True if one of the structures in the set contains Polygons, Triangles or Quadrangles.
120 Standard_EXPORT Standard_Boolean ContainsFacet (const Graphic3d_MapOfStructure& theSet) const;
bf75be98 121
c357e426 122 //! Returns the set of structures displayed in this view.
123 Standard_EXPORT void DisplayedStructures (Graphic3d_MapOfStructure& theStructures) const;
b5ac8292 124
c357e426 125 //! Returns number of displayed structures in the view.
126 Standard_Integer NumberOfDisplayedStructures() const { return myStructsDisplayed.Extent(); }
bf75be98 127
c357e426 128 //! Returns map of objects hidden within this specific view (not viewer-wise).
129 const Handle(Graphic3d_NMapOfTransient)& HiddenObjects() const { return myHiddenObjects; }
130
131 //! Returns map of objects hidden within this specific view (not viewer-wise).
132 Handle(Graphic3d_NMapOfTransient)& ChangeHiddenObjects() { return myHiddenObjects; }
133
134 //! Returns Standard_True in case if the structure with the given <theStructId> is
135 //! in list of structures to be computed and stores computed struct to <theComputedStruct>.
136 Standard_EXPORT Standard_Boolean IsComputed (const Standard_Integer theStructId,
137 Handle(Graphic3d_Structure)& theComputedStruct) const;
138
50d06d8f 139 //! Returns the bounding box of all structures displayed in the view.
3fe9ce0e 140 //! If theToIncludeAuxiliary is TRUE, then the boundary box also includes minimum and maximum limits
141 //! of graphical elements forming parts of infinite and other auxiliary structures.
142 //! @param theToIncludeAuxiliary consider also auxiliary presentations (with infinite flag or with trihedron transformation persistence)
143 //! @return computed bounding box
144 Standard_EXPORT Bnd_Box MinMaxValues (const Standard_Boolean theToIncludeAuxiliary = Standard_False) const;
c357e426 145
146 //! Returns the coordinates of the boundary box of all structures in the set <theSet>.
147 //! If <theToIgnoreInfiniteFlag> is TRUE, then the boundary box
148 //! also includes minimum and maximum limits of graphical elements
149 //! forming parts of infinite structures.
150 Standard_EXPORT Bnd_Box MinMaxValues (const Graphic3d_MapOfStructure& theSet,
3fe9ce0e 151 const Standard_Boolean theToIncludeAuxiliary = Standard_False) const;
c357e426 152
153 //! Returns the structure manager handle which manage structures associated with this view.
154 const Handle(Graphic3d_StructureManager)& StructureManager() const { return myStructureManager; }
155
156private:
157
158 friend class Graphic3d_StructureManager;
159
160 //! Is it possible to display the structure in the view?
161 Standard_EXPORT Graphic3d_TypeOfAnswer acceptDisplay (const Graphic3d_TypeOfStructure theStructType) const;
162
163 //! Computes the new presentation of the structures displayed in this view with the type Graphic3d_TOS_COMPUTED.
164 Standard_EXPORT void Compute();
165
166 //! Clears the structure in this view.
167 Standard_EXPORT void Clear (const Handle(Graphic3d_Structure)& theStructure, const Standard_Boolean theWithDestruction);
168
169 //! Connects the structures.
170 Standard_EXPORT void Connect (const Handle(Graphic3d_Structure)& theMother,
171 const Handle(Graphic3d_Structure)& theDaughter);
172
173 //! Disconnects the structures.
174 Standard_EXPORT void Disconnect (const Handle(Graphic3d_Structure)& theMother,
175 const Handle(Graphic3d_Structure)& theDaughter);
176
177 //! Displays the structure in the view.
178 Standard_EXPORT void Display (const Handle(Graphic3d_Structure)& theStructure);
179
180 //! Display the structure in the view.
181 Standard_EXPORT void Display (const Handle(Graphic3d_Structure)& theStructure,
182 const Aspect_TypeOfUpdate theUpdateMode);
183
184 //! Erases the structure from the view.
185 Standard_EXPORT void Erase (const Handle(Graphic3d_Structure)& theStructure);
186
187 //! Erases the structure from the view.
188 Standard_EXPORT void Erase (const Handle(Graphic3d_Structure)& theStructure,
189 const Aspect_TypeOfUpdate theUpdateMode);
190
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>.
203 Standard_EXPORT Standard_Integer IsComputed (const Handle(Graphic3d_Structure)& theStructure) const;
204
205 //! Returns true if the structure is displayed in the view.
206 Standard_EXPORT Standard_Boolean IsDisplayed (const Handle(Graphic3d_Structure)& theStructure) const;
207
208 //! Changes the display priority of the structure.
209 Standard_EXPORT void ChangePriority (const Handle(Graphic3d_Structure)& theStructure,
210 const Standard_Integer theOldPriority,
211 const Standard_Integer theNewPriority);
212
213 //! Change Z layer of already displayed structure in the view.
214 Standard_EXPORT void ChangeZLayer (const Handle(Graphic3d_Structure)& theStructure,
215 const Graphic3d_ZLayerId theLayerId);
216
217 //! Returns an index != 0 if the structure have the same owner than another structure
218 //! in the sequence of the computed structures.
219 Standard_EXPORT Standard_Integer HaveTheSameOwner (const Handle(Graphic3d_Structure)& theStructure) const;
bf75be98 220
221public:
222
c357e426 223 //! Redraw content of the view.
224 virtual void Redraw() = 0;
225
226 //! Redraw immediate content of the view.
227 virtual void RedrawImmediate() = 0;
228
229 //! Invalidates content of the view but does not redraw it.
230 virtual void Invalidate() = 0;
231
232 //! Return true if view content cache has been invalidated.
233 virtual Standard_Boolean IsInvalidated() = 0;
234
235 //! Handle changing size of the rendering window.
236 virtual void Resized() = 0;
237
238 //! @param theDrawToFrontBuffer Advanced option to modify rendering mode:
239 //! 1. TRUE. Drawing immediate mode structures directly to the front buffer over the scene image.
240 //! Fast, so preferred for interactive work (used by default).
241 //! However these extra drawings will be missed in image dump since it is performed from back buffer.
242 //! Notice that since no pre-buffering used the V-Sync will be ignored and rendering could be seen
243 //! in run-time (in case of slow hardware) and/or tearing may appear.
244 //! So this is strongly recommended to draw only simple (fast) structures.
245 //! 2. FALSE. Drawing immediate mode structures to the back buffer.
246 //! The complete scene is redrawn first, so this mode is slower if scene contains complex data and/or V-Sync
247 //! is turned on. But it works in any case and is especially useful for view dump because the dump image is read
248 //! from the back buffer.
249 //! @return previous mode.
250 virtual Standard_Boolean SetImmediateModeDrawToFront (const Standard_Boolean theDrawToFrontBuffer) = 0;
251
252 //! Creates and maps rendering window to the view.
c357e426 253 //! @param theWindow [in] the window.
254 //! @param theContext [in] the rendering context. If NULL the context will be created internally.
c357e426 255 virtual void SetWindow (const Handle(Aspect_Window)& theWindow,
a521d90d 256 const Aspect_RenderingContext theContext = NULL) = 0;
c357e426 257
258 //! Returns the window associated to the view.
259 virtual Handle(Aspect_Window) Window() const = 0;
260
261 //! Returns True if the window associated to the view is defined.
262 virtual Standard_Boolean IsDefined() const = 0;
263
264 //! Displays z-buffer trihedron.
265 virtual void TriedronDisplay (const Aspect_TypeOfTriedronPosition thePosition = Aspect_TOTP_CENTER,
266 const Quantity_NameOfColor theColor = Quantity_NOC_WHITE,
267 const Standard_Real theScale = 0.02,
268 const Standard_Boolean theAsWireframe = Standard_True) = 0;
269
270 //! Erases z-buffer trihedron.
271 virtual void TriedronErase() = 0;
272
273 //! Setup parameters of z-buffer trihedron.
274 virtual void ZBufferTriedronSetup (const Quantity_NameOfColor theXColor = Quantity_NOC_RED,
275 const Quantity_NameOfColor theYColor = Quantity_NOC_GREEN,
276 const Quantity_NameOfColor theZColor = Quantity_NOC_BLUE1,
277 const Standard_Real theSizeRatio = 0.8,
278 const Standard_Real theAxisDiametr = 0.05,
279 const Standard_Integer theNbFacettes = 12) = 0;
280
281 //! Displays trihedron echo.
282 virtual void TriedronEcho (const Aspect_TypeOfTriedronEcho theType = Aspect_TOTE_NONE) = 0;
283
284 //! Returns data of a graduated trihedron
285 virtual const Graphic3d_GraduatedTrihedron& GetGraduatedTrihedron() = 0;
286
287 //! Displays Graduated Trihedron.
288 virtual void GraduatedTrihedronDisplay (const Graphic3d_GraduatedTrihedron& theTrihedronData) = 0;
289
290 //! Erases Graduated Trihedron.
291 virtual void GraduatedTrihedronErase() = 0;
292
293 //! Sets minimum and maximum points of scene bounding box for Graduated Trihedron stored in graphic view object.
294 //! @param theMin [in] the minimum point of scene.
295 //! @param theMax [in] the maximum point of scene.
296 virtual void GraduatedTrihedronMinMaxValues (const Graphic3d_Vec3 theMin, const Graphic3d_Vec3 theMax) = 0;
297
c357e426 298 //! Dump active rendering buffer into specified memory buffer.
299 virtual Standard_Boolean BufferDump (Image_PixMap& theImage, const Graphic3d_BufferType& theBufferType) = 0;
300
c357e426 301 //! Export scene into the one of the Vector graphics formats (SVG, PS, PDF...).
302 //! In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits
303 //! on printing to laser printer). Notice however that results may differ a lot and
304 //! do not contain some elements.
305 virtual Standard_Boolean Export (const Standard_CString theFileName,
306 const Graphic3d_ExportFormat theFormat,
307 const Graphic3d_SortType theSortType = Graphic3d_ST_BSP_Tree) = 0;
308
309 //! Marks BVH tree and the set of BVH primitives of correspondent priority list with id theLayerId as outdated.
310 virtual void InvalidateBVHData (const Standard_Integer theLayerId) = 0;
311
312 //! Add a new top-level z layer with ID <theLayerId> for
313 //! the view. Z layers allow drawing structures in higher layers
314 //! in foreground of structures in lower layers. To add a structure
315 //! to desired layer on display it is necessary to set the layer
316 //! ID for the structure.
317 virtual void AddZLayer (const Graphic3d_ZLayerId theLayerId) = 0;
318
50d06d8f 319 //! Returns the maximum Z layer ID.
320 //! First layer ID is Graphic3d_ZLayerId_Default, last ID is ZLayerMax().
321 virtual Standard_Integer ZLayerMax() const = 0;
322
323 //! Returns the bounding box of all structures displayed in the Z layer.
324 virtual void InvalidateZLayerBoundingBox (const Graphic3d_ZLayerId theLayerId) const = 0;
325
326 //! Returns the bounding box of all structures displayed in the Z layer.
3fe9ce0e 327 //! @param theLayerId layer identifier
328 //! @param theCamera camera definition
329 //! @param theWindowWidth viewport width (for applying transformation-persistence)
330 //! @param theWindowHeight viewport height (for applying transformation-persistence)
331 //! @param theToIncludeAuxiliary consider also auxiliary presentations (with infinite flag or with trihedron transformation persistence)
332 //! @return computed bounding box
50d06d8f 333 virtual Graphic3d_BndBox4f ZLayerBoundingBox (const Graphic3d_ZLayerId theLayerId,
334 const Handle(Graphic3d_Camera)& theCamera,
335 const Standard_Integer theWindowWidth,
336 const Standard_Integer theWindowHeight,
3fe9ce0e 337 const Standard_Boolean theToIncludeAuxiliary) const = 0;
50d06d8f 338
c357e426 339 //! Remove Z layer from the specified view. All structures
340 //! displayed at the moment in layer will be displayed in default layer
341 //! ( the bottom-level z layer ). To unset layer ID from associated
342 //! structures use method UnsetZLayer (...).
343 virtual void RemoveZLayer (const Graphic3d_ZLayerId theLayerId) = 0;
344
345 //! Sets the settings for a single Z layer of specified view.
346 virtual void SetZLayerSettings (const Graphic3d_ZLayerId theLayerId,
347 const Graphic3d_ZLayerSettings& theSettings) = 0;
348
50d06d8f 349 //! Returns zoom-scale factor.
350 Standard_EXPORT Standard_Real ConsiderZoomPersistenceObjects();
351
c357e426 352 //! Returns pointer to an assigned framebuffer object.
b128c892 353 virtual Handle(Standard_Transient) FBO() const = 0;
c357e426 354
355 //! Sets framebuffer object for offscreen rendering.
b128c892 356 virtual void SetFBO (const Handle(Standard_Transient)& theFbo) = 0;
c357e426 357
358 //! Generate offscreen FBO in the graphic library.
359 //! If not supported on hardware returns NULL.
b128c892 360 virtual Handle(Standard_Transient) FBOCreate (const Standard_Integer theWidth,
361 const Standard_Integer theHeight) = 0;
c357e426 362
363 //! Remove offscreen FBO from the graphic library
b128c892 364 virtual void FBORelease (Handle(Standard_Transient)& theFbo) = 0;
c357e426 365
366 //! Read offscreen FBO configuration.
b128c892 367 virtual void FBOGetDimensions (const Handle(Standard_Transient)& theFbo,
c357e426 368 Standard_Integer& theWidth,
369 Standard_Integer& theHeight,
370 Standard_Integer& theWidthMax,
371 Standard_Integer& theHeightMax) = 0;
372
373 //! Change offscreen FBO viewport.
b128c892 374 virtual void FBOChangeViewport (const Handle(Standard_Transient)& theFbo,
c357e426 375 const Standard_Integer theWidth,
376 const Standard_Integer theHeight) = 0;
bf75be98 377
378public:
379
c357e426 380 //! Copy visualization settings from another view.
381 //! Method is used for cloning views in viewer when its required to create view
382 //! with same view properties.
383 Standard_EXPORT virtual void CopySettings (const Handle(Graphic3d_CView)& theOther);
384
385 //! Returns current rendering parameters and effect settings.
386 const Graphic3d_RenderingParams& RenderingParams() const { return myRenderParams; }
387
388 //! Returns reference to current rendering parameters and effect settings.
389 Graphic3d_RenderingParams& ChangeRenderingParams() { return myRenderParams; }
390
c357e426 391 //! Returns background fill color.
392 virtual Aspect_Background Background() const = 0;
393
394 //! Sets background fill color.
395 virtual void SetBackground (const Aspect_Background& theBackground) = 0;
396
397 //! Returns gradient background fill colors.
398 virtual Aspect_GradientBackground GradientBackground() const = 0;
399
400 //! Sets gradient background fill colors.
401 virtual void SetGradientBackground (const Aspect_GradientBackground& theBackground) = 0;
402
403 //! Returns background image texture file path.
404 virtual TCollection_AsciiString BackgroundImage() = 0;
405
406 //! Sets background image texture file path.
407 virtual void SetBackgroundImage (const TCollection_AsciiString& theFilePath) = 0;
408
409 //! Returns background image fill style.
410 virtual Aspect_FillMethod BackgroundImageStyle() const = 0;
411
412 //! Sets background image fill style.
413 virtual void SetBackgroundImageStyle (const Aspect_FillMethod theFillStyle) = 0;
414
415 //! Returns environment texture set for the view.
416 virtual Handle(Graphic3d_TextureEnv) TextureEnv() const = 0;
417
418 //! Sets environment texture for the view.
419 virtual void SetTextureEnv (const Handle(Graphic3d_TextureEnv)& theTextureEnv) = 0;
420
421 //! Returns the state of frustum culling optimization.
422 virtual Standard_Boolean IsCullingEnabled() const = 0;
423
424 //! Enables or disables frustum culling optimization.
425 virtual void SetCullingEnabled (const Standard_Boolean theIsEnabled) = 0;
426
427 //! Returns shading model of the view.
428 virtual Graphic3d_TypeOfShadingModel ShadingModel() const = 0;
429
430 //! Sets shading model of the view.
431 virtual void SetShadingModel (const Graphic3d_TypeOfShadingModel theModel) = 0;
432
c357e426 433 //! Return backfacing model used for the view.
434 virtual Graphic3d_TypeOfBackfacingModel BackfacingModel() const = 0;
bf75be98 435
c357e426 436 //! Sets backfacing model for the view.
437 virtual void SetBackfacingModel (const Graphic3d_TypeOfBackfacingModel theModel) = 0;
bf75be98 438
c357e426 439 //! Returns camera object of the view.
440 virtual const Handle(Graphic3d_Camera)& Camera() const = 0;
bf75be98 441
c357e426 442 //! Sets camera used by the view.
443 virtual void SetCamera (const Handle(Graphic3d_Camera)& theCamera) = 0;
bf75be98 444
c357e426 445 //! Returns true if GL lighting is enabled.
446 virtual Standard_Boolean IsGLLightEnabled() const = 0;
447
448 //! Sets GL lighting enabled or disable state.
449 virtual void SetGLLightEnabled (const Standard_Boolean theIsEnabled) = 0;
450
451 //! Returns list of lights of the view.
452 virtual const Graphic3d_ListOfCLight& Lights() const = 0;
453
454 //! Sets list of lights for the view.
455 virtual void SetLights (const Graphic3d_ListOfCLight& theLights) = 0;
456
457 //! Returns list of clip planes set for the view.
3202bf1e 458 virtual const Handle(Graphic3d_SequenceOfHClipPlane)& ClipPlanes() const = 0;
c357e426 459
460 //! Sets list of clip planes for the view.
3202bf1e 461 virtual void SetClipPlanes (const Handle(Graphic3d_SequenceOfHClipPlane)& thePlanes) = 0;
c357e426 462
26d9c835 463 //! Fill in the dictionary with diagnostic info.
464 //! Should be called within rendering thread.
465 //!
466 //! This API should be used only for user output or for creating automated reports.
467 //! The format of returned information (e.g. key-value layout)
468 //! is NOT part of this API and can be changed at any time.
469 //! Thus application should not parse returned information to weed out specific parameters.
470 virtual void DiagnosticInformation (TColStd_IndexedDataMapOfStringString& theDict,
471 Graphic3d_DiagnosticInfo theFlags) const = 0;
472
c357e426 473private:
474
475 //! Adds the structure to display lists of the view.
476 virtual void displayStructure (const Handle(Graphic3d_CStructure)& theStructure,
477 const Standard_Integer thePriority) = 0;
478
479 //! Erases the structure from display lists of the view.
480 virtual void eraseStructure (const Handle(Graphic3d_CStructure)& theStructure) = 0;
481
482 //! Change Z layer of a structure already presented in view.
483 virtual void changeZLayer (const Handle(Graphic3d_CStructure)& theCStructure,
484 const Graphic3d_ZLayerId theNewLayerId) = 0;
485
486 //! Changes the priority of a structure within its Z layer in the specified view.
487 virtual void changePriority (const Handle(Graphic3d_CStructure)& theCStructure,
488 const Standard_Integer theNewPriority) = 0;
489
50d06d8f 490 //! Returns zoom-scale factor.
491 virtual Standard_Real considerZoomPersistenceObjects (const Graphic3d_ZLayerId theLayerId,
492 const Handle(Graphic3d_Camera)& theCamera,
493 const Standard_Integer theWindowWidth,
3fe9ce0e 494 const Standard_Integer theWindowHeight) const = 0;
c357e426 495
496protected:
497
498 Standard_Integer myId;
499 Graphic3d_RenderingParams myRenderParams;
500 Handle(Graphic3d_StructureManager) myStructureManager;
501 Graphic3d_SequenceOfStructure myStructsToCompute;
502 Graphic3d_SequenceOfStructure myStructsComputed;
503 Graphic3d_MapOfStructure myStructsDisplayed;
504 Handle(Graphic3d_NMapOfTransient) myHiddenObjects;
505 Standard_Boolean myIsInComputedMode;
506 Standard_Boolean myIsActive;
507 Standard_Boolean myIsRemoved;
508 Graphic3d_TypeOfVisualization myVisualization;
c357e426 509
510private:
511
92efcf78 512 DEFINE_STANDARD_RTTIEXT(Graphic3d_CView,Graphic3d_DataStructureManager)
bf75be98 513};
514
c357e426 515#endif // _Graphic3d_CView_HeaderFile