1 // Created on: 1991-09-17
2 // Created by: NW,JPB,CAL
3 // Copyright (c) 1991-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 _Visual3d_View_HeaderFile
18 #define _Visual3d_View_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <Visual3d_ViewManagerPtr.hxx>
24 #include <Graphic3d_CView.hxx>
25 #include <Visual3d_ContextView.hxx>
26 #include <Graphic3d_SequenceOfStructure.hxx>
27 #include <Standard_Boolean.hxx>
28 #include <Aspect_Background.hxx>
29 #include <Aspect_GradientBackground.hxx>
30 #include <Graphic3d_MapOfStructure.hxx>
31 #include <Graphic3d_GraduatedTrihedron.hxx>
32 #include <Graphic3d_Camera.hxx>
33 #include <Standard_Real.hxx>
34 #include <Graphic3d_NMapOfTransient.hxx>
35 #include <Graphic3d_DataStructureManager.hxx>
36 #include <Standard_Integer.hxx>
37 #include <Standard_CString.hxx>
38 #include <Aspect_FillMethod.hxx>
39 #include <Aspect_GradientFillMethod.hxx>
40 #include <Visual3d_TypeOfBackfacingModel.hxx>
41 #include <Aspect_RenderingContext.hxx>
42 #include <Aspect_GraphicCallbackProc.hxx>
43 #include <Standard_Address.hxx>
44 #include <Aspect_TypeOfUpdate.hxx>
45 #include <Quantity_NameOfColor.hxx>
46 #include <Aspect_TypeOfTriedronPosition.hxx>
47 #include <Aspect_TypeOfTriedronEcho.hxx>
48 #include <Visual3d_TypeOfAnswer.hxx>
49 #include <Graphic3d_TypeOfStructure.hxx>
50 #include <Graphic3d_ZLayerId.hxx>
51 #include <Graphic3d_ZLayerSettings.hxx>
52 #include <Aspect_TypeOfHighlightMethod.hxx>
53 #include <TColStd_Array2OfReal.hxx>
54 #include <Aspect_Handle.hxx>
55 #include <Aspect_PrintAlgo.hxx>
56 #include <Graphic3d_PtrFrameBuffer.hxx>
57 #include <Image_PixMap.hxx>
58 #include <Graphic3d_BufferType.hxx>
59 #include <Graphic3d_ExportFormat.hxx>
60 #include <Graphic3d_SortType.hxx>
62 class Graphic3d_GraphicDriver;
63 class Visual3d_TransformError;
64 class Visual3d_ViewDefinitionError;
65 class Visual3d_ViewManager;
67 class Aspect_Background;
68 class Aspect_GradientBackground;
69 class Visual3d_ContextView;
71 class Graphic3d_Structure;
75 DEFINE_STANDARD_HANDLE(Visual3d_View, Graphic3d_DataStructureManager)
77 //! Creation and edition of a view in a 3D visualiser.
78 //! A 3D view is composed of an "orientation" part defined
79 //! by the position of the observer, the direction of view,
80 //! and a "mapping" part defined by the type of projection
81 //! (parallel or perspective) and by the window-viewport
82 //! couple which allows passage from the projected coordinate
83 //! space into the screen space.
84 //! Summary of 3D Viewing
85 //! To define a view, you must define:
86 //! - The view orientation transformation
87 //! - The view mapping transformation
88 //! - The view representation.
89 //! To activate a view, you must define:
90 //! - The associated window.
91 class Visual3d_View : public Graphic3d_DataStructureManager
97 //! Creates a view in the viewer <AManager> with a default
98 //! orientation and a default mapping.
99 Standard_EXPORT Visual3d_View(const Handle(Visual3d_ViewManager)& AManager);
101 //! Activates the view <me>.
102 //! Map the associated window on the screen and
103 //! post the view in this window.
104 //! Category: Methods to modify the class definition
105 //! Warning: Raises ViewDefinitionError if the associated
106 //! window isn't defined.
107 Standard_EXPORT void Activate();
109 //! Deactivates the view <me>.
110 //! Unmap the associated window on the screen and
111 //! unpost the view in this window.
112 //! Category: Methods to modify the class definition
113 //! Warning: Raises ViewDefinitionError if the associated
114 //! window isn't defined.
115 Standard_EXPORT void Deactivate();
117 //! Deletes and erases the view <me>.
118 Standard_EXPORT virtual void Destroy() Standard_OVERRIDE;
124 //! Updates screen in all cases.
125 Standard_EXPORT void Redraw();
127 //! Updates layer of immediate presentations.
128 Standard_EXPORT void RedrawImmediate();
130 //! Updates screen area in all cases.
131 //! area is given by his xy min corner and size in pixel coordinates
132 Standard_EXPORT void Redraw (const Standard_Integer x, const Standard_Integer y, const Standard_Integer width, const Standard_Integer height);
134 //! Invalidates view content but does not redraw it.
135 Standard_EXPORT void Invalidate();
137 //! Returns true if cached view content has been invalidated.
138 Standard_EXPORT Standard_Boolean IsInvalidated() const;
140 //! Deletes and erases the view <me>.
141 //! Warning: No more graphic operations in <me> after this call.
142 Standard_EXPORT void Remove();
144 //! Updates the view <me> after the modification
145 //! of the associated window.
146 //! Category: Methods to modify the class definition
147 //! Warning: Raises ViewDefinitionError if the associated
148 //! window isn't defined.
149 Standard_EXPORT void Resized();
151 //! Modifies the default window background.
152 //! Category: Methods to modify the class definition
153 //! Warning: Raises ViewDefinitionError if the associated
154 //! window isn't defined.
155 Standard_EXPORT void SetBackground (const Aspect_Background& ABack);
158 //! Category: Methods to modify the class definition
159 //! Warning: Raises ViewDefinitionError if the associated
160 //! window isn't defined.
161 Standard_EXPORT void SetBackgroundImage (const Standard_CString FileName, const Aspect_FillMethod FillStyle, const Standard_Boolean update);
164 //! Category: Methods to modify the class definition
165 //! Warning: Raises ViewDefinitionError if the associated
166 //! window isn't defined.
167 Standard_EXPORT void SetBgImageStyle (const Aspect_FillMethod FillStyle, const Standard_Boolean update);
169 //! Modifies the gradient window background.
170 //! Category: Methods to modify the class definition
171 //! Warning: Raises ViewDefinitionError if the associated
172 //! window isn't defined.
173 Standard_EXPORT void SetGradientBackground (const Aspect_GradientBackground& ABack, const Standard_Boolean update);
176 //! Category: Methods to modify the class definition
177 //! Warning: Raises ViewDefinitionError if the associated
178 //! window isn't defined.
179 Standard_EXPORT void SetBgGradientStyle (const Aspect_GradientFillMethod FillStyle, const Standard_Boolean update);
181 //! Manages display of the back faces
182 Standard_EXPORT void SetBackFacingModel (const Visual3d_TypeOfBackfacingModel aModel);
184 //! Returns current state of the back faces display
185 Standard_EXPORT Visual3d_TypeOfBackfacingModel BackFacingModel() const;
187 //! Sets the context <CTX> in the view <me>.
188 Standard_EXPORT void SetContext (const Visual3d_ContextView& CTX);
190 //! Saves the current mapping which will be the
191 //! reference value for the reset of the mapping
192 //! done by the ViewmappingReset method.
193 Standard_EXPORT void SetViewMappingDefault();
195 //! Saves the current orientation which will be the
196 //! reference value for the reset of the orientation
197 //! done by the ViewOrientationReset method.
198 Standard_EXPORT void SetViewOrientationDefault();
200 //! Associates the window <AWindow> to the view <me>.
201 //! No new association if the window is already defined.
202 //! Category: Methods to modify the class definition
203 //! Warning: Raises ViewDefinitionError if it is impossible
204 //! to associate a view and a window.
205 //! (association already done or another problem)
206 //! Modifies the viewmapping of the associated view
207 //! when it calls the SetRatio method.
209 //! After this call, each view is mapped in an unique window.
211 //! Programming example :
213 //! An example when we have 1 view and 1 window
214 //! -------------------------------------------
216 //! Handle(Aspect_DisplayConnection) aDisplayConnection;
218 //! // Display connection initialization only needed on Linux platform
219 //! // and on Mac OS X, in cases when you use Xlib for windows drawing.
220 //! aDisplayConnection = new Aspect_DisplayConnection();
222 //! // Graphic driver initialization
223 //! Handle(Graphic3d_GraphicDriver) aGraphicDriver =
224 //! Graphic3d::InitGraphicDriver (aDisplayConnection);
226 //! // Define a view manager
227 //! Handle(Visual3d_ViewManager) aVisualManager = new Visual3d_ViewManager (aGraphicDriver);
230 //! Handle(Visual3d_View) aView = new Visual3d_View (aVisaulManager);
232 //! // Define a window
233 //! Handle(Xw_Window) aWindow = new Xw_Window
234 //! (aDisplayConnection, "Graphic View 1", 0.695, 0.695, 0.600, 0.600, Quantity_NOC_MATRAGRAY);
236 //! // Associate the view and the window
237 //! aView->SetWindow (aWindow);
239 //! // Map the window
242 //! // Activate the view
243 //! aView->Activate ();
244 Standard_EXPORT void SetWindow (const Handle(Aspect_Window)& AWindow);
246 //! Associates the window <AWindow> and context <AContext>
247 //! to the view <me>.
248 //! If <AContext> is not NULL the graphic context is used
249 //! directly to draw something in this view.
250 //! Otherwise an internal context is created.
251 //! If <ADisplayCB> is not NULL then a user display CB is
252 //! call at the end of the OCC graphic traversal and just
253 //! before the swap of buffers. The <aClientData> is pass
254 //! to this call back.
255 //! No new association if the window is already defined.
256 //! Category: Methods to modify the class definition
257 //! Warning: Raises ViewDefinitionError if it is impossible
258 //! to associate a view and a window.
259 //! (association already done or another problem)
260 //! Modifies the viewmapping of the associated view
261 //! when it calls the SetRatio method.
263 //! After this call, each view is mapped in an unique window.
264 Standard_EXPORT void SetWindow (const Handle(Aspect_Window)& AWindow, const Aspect_RenderingContext AContext, const Aspect_GraphicCallbackProc& ADisplayCB, const Standard_Address AClientData);
266 //! Updates screen in function of modifications of
268 Standard_EXPORT void Update (const Aspect_TypeOfUpdate theUpdateMode);
270 //! Updates screen in function of modifications of
272 Standard_EXPORT void Update ();
274 //! Sets the automatic z-fit mode and its parameters.
275 //! The auto z-fit has extra parameters which can controlled from application level
276 //! to ensure that the size of viewing volume will be sufficiently large to cover
277 //! the depth of unmanaged objects, for example, transformation persistent ones.
278 //! @param theScaleFactor [in] the scale factor for Z-range.
279 //! The range between Z-min, Z-max projection volume planes
280 //! evaluated by z fitting method will be scaled using this coefficient.
281 //! Program error exception is thrown if negative or zero value
283 Standard_EXPORT void SetAutoZFitMode (const Standard_Boolean theIsOn, const Standard_Real theScaleFactor = 1.0);
285 //! returns TRUE if automatic z-fit mode is turned on.
286 Standard_EXPORT Standard_Boolean AutoZFitMode() const;
288 //! returns scale factor parameter of automatic z-fit mode.
289 Standard_EXPORT Standard_Real AutoZFitScaleFactor() const;
291 //! If automatic z-range fitting is turned on, adjusts Z-min and Z-max
292 //! projection volume planes with call to ZFitAll.
293 Standard_EXPORT void AutoZFit();
295 //! Change Z-min and Z-max planes of projection volume to match the
296 //! displayed objects.
297 Standard_EXPORT void ZFitAll (const Standard_Real theScaleFactor = 1.0);
299 //! Sets the value of the mapping to be the same as
300 //! the mapping saved by the SetViewMappingDefaut method.
301 Standard_EXPORT void ViewMappingReset();
303 //! Sets the value of the orientation to be the same as the
304 //! orientation saved by the SetViewOrientationDefaut method.
305 Standard_EXPORT void ViewOrientationReset();
307 //! Switches computed HLR mode in the view
308 Standard_EXPORT void SetComputedMode (const Standard_Boolean aMode);
310 //! Returns the computed HLR mode state
311 Standard_EXPORT Standard_Boolean ComputedMode() const;
313 //! Customization of the ZBUFFER Triedron.
314 //! Initializes Colors of X Y and axis
315 //! Scale ratio defines decreasing of trihedron size when
316 //! its position is out of a View
317 Standard_EXPORT void ZBufferTriedronSetup (const Quantity_NameOfColor XColor = Quantity_NOC_RED, const Quantity_NameOfColor YColor = Quantity_NOC_GREEN, const Quantity_NameOfColor ZColor = Quantity_NOC_BLUE1, const Standard_Real SizeRatio = 0.8, const Standard_Real AxisDiametr = 0.05, const Standard_Integer NbFacettes = 12);
319 //! Display of the Triedron.
320 //! Initialize position, color and length of Triedron axes.
321 //! The scale is a percent of the window width.
322 //! If AsWireframe is FALSE triedron is shown in shaded mode
323 //! AColor is not considered for ZBUFFER mode
324 Standard_EXPORT void TriedronDisplay (const Aspect_TypeOfTriedronPosition APosition = Aspect_TOTP_CENTER, const Quantity_NameOfColor AColor = Quantity_NOC_WHITE, const Standard_Real AScale = 0.02, const Standard_Boolean AsWireframe = Standard_True);
326 //! Erases the Triedron.
327 Standard_EXPORT void TriedronErase();
329 //! Highlights the echo zone of the Triedron.
330 Standard_EXPORT void TriedronEcho (const Aspect_TypeOfTriedronEcho AType = Aspect_TOTE_NONE);
332 //! Returns data of a graduated trihedron
333 Standard_EXPORT const Graphic3d_GraduatedTrihedron& GetGraduatedTrihedron() const;
335 //! Displays a graduated trihedron.
336 Standard_EXPORT void GraduatedTrihedronDisplay (const Graphic3d_GraduatedTrihedron& theTrigedronData);
338 //! Erases a graduated trihedron from the view.
339 Standard_EXPORT void GraduatedTrihedronErase();
341 //! Returns the value of the default window background.
342 Standard_EXPORT Aspect_Background Background() const;
344 //! Returns the value of the window background.
345 Standard_EXPORT Aspect_GradientBackground GradientBackground() const;
347 //! Returns Standard_True if one of the structures
348 //! displayed in the view <me> contains Polygons,
349 //! Triangles or Quadrangles.
350 Standard_EXPORT Standard_Boolean ContainsFacet() const;
352 //! Returns Standard_True if one of the structures
353 //! in the set <ASet> contains Polygons, Triangles
355 Standard_EXPORT Standard_Boolean ContainsFacet (const Graphic3d_MapOfStructure& ASet) const;
357 //! Returns the current context of the view <me>.
358 Standard_EXPORT const Visual3d_ContextView& Context() const;
360 //! Returns the set of structures displayed in
362 Standard_EXPORT void DisplayedStructures (Graphic3d_MapOfStructure& SG) const;
364 //! Returns the activity flag of the view <me>.
365 Standard_EXPORT Standard_Boolean IsActive() const;
367 //! Returns True if the window associated to the view
369 Standard_EXPORT Standard_Boolean IsDefined() const;
371 //! Returns Standard_True is the view <me> is deleted.
372 //! <me> is deleted after the call Remove (me).
373 Standard_EXPORT Standard_Boolean IsDeleted() const;
375 //! Returns the coordinates of the boundary box of all
376 //! structures displayed in the view <me>.
377 //! If <theToIgnoreInfiniteFlag> is TRUE, then the boundary box
378 //! also includes minimum and maximum limits of graphical elements
379 //! forming parts of infinite structures.
380 Standard_EXPORT Bnd_Box MinMaxValues (const Standard_Boolean theToIgnoreInfiniteFlag = Standard_False) const;
382 //! Returns the coordinates of the boundary box of all
383 //! structures in the set <theSet>.
384 //! If <theToIgnoreInfiniteFlag> is TRUE, then the boundary box
385 //! also includes minimum and maximum limits of graphical elements
386 //! forming parts of infinite structures.
387 Standard_EXPORT Bnd_Box MinMaxValues (const Graphic3d_MapOfStructure& theSet, const Standard_Boolean theToIgnoreInfiniteFlag = Standard_False) const;
389 //! Returns number of displayed structures in
391 Standard_EXPORT Standard_Integer NumberOfDisplayedStructures() const;
393 //! Returns the coordinates of the projection of the
394 //! 3d coordinates <AX>, <AY>, <AZ>.
395 Standard_EXPORT void Projects (const Standard_Real AX, const Standard_Real AY, const Standard_Real AZ, Standard_Real& APX, Standard_Real& APY, Standard_Real& APZ) const;
397 //! @return the default camera of <me>.
398 Standard_EXPORT const Handle(Graphic3d_Camera)& DefaultCamera() const;
400 //! @return the camera of <me>.
401 Standard_EXPORT const Handle(Graphic3d_Camera)& Camera() const;
403 //! Set camera object to provide orientation and projection matrices
404 //! for graphic driver.
405 Standard_EXPORT void SetCamera (const Handle(Graphic3d_Camera)& theCamera);
407 //! Returns the window associated to the view <me>.
408 //! Warning: Raises ViewDefinitionError if the associated
409 //! window isn't defined.
410 Standard_EXPORT Handle(Aspect_Window) Window() const;
412 //! Returns the MAX number of light associated to the view <me>.
413 Standard_EXPORT Standard_Integer LightLimit() const;
415 //! Returns the MAX number of clipping planes
416 //! associated to the view <me>.
417 Standard_EXPORT Standard_Integer PlaneLimit() const;
419 //! Returns the view manager handle which manage this view
420 Standard_EXPORT Handle(Visual3d_ViewManager) ViewManager() const;
422 //! Computes the new presentation of the
423 //! structure <AStructure> displayed in <me>
424 //! with the type Graphic3d_TOS_COMPUTED.
425 Standard_EXPORT void ReCompute (const Handle(Graphic3d_Structure)& AStructure);
427 //! Returns the identification number of the view <me>.
428 Standard_EXPORT Standard_Integer Identification() const;
430 //! Returns the c structure associated to <me>.
431 Standard_EXPORT Standard_Address CView() const;
433 //! Returns the associated GraphicDriver.
434 Standard_EXPORT const Handle(Graphic3d_GraphicDriver)& GraphicDriver() const;
436 //! print the contents of the view to printer.
437 //! <hPrnDC> : Pass the PrinterDeviceContext (HDC),
438 //! <showBackground> : When set to FALSE then print the view without background color
439 //! (background is white)
440 //! else set to TRUE for printing with current background color.
441 //! <filename>: If != NULL, then the view will be printed to a file.
442 //! <printAlgo>: Select print algorithm: stretch, tile.
443 //! <theScaleFactor>: Scaling coefficient, used internally to scale the
444 //! printings accordingly to the scale factor selected in the printer
445 //! properties dialog.
446 //! Returns Standard_True if the data is passed to the printer, otherwise
447 //! Standard_False if the print operation failed due to printer error
448 //! or insufficient memory.
449 //! Warning: Works only under Windows.
450 Standard_EXPORT Standard_Boolean Print (const Aspect_Handle hPrnDC, const Standard_Boolean showBackground, const Standard_CString filename, const Aspect_PrintAlgo printAlgorithm = Aspect_PA_STRETCH, const Standard_Real theScaleFactor = 1.0) const;
452 //! Reads depths of shown pixels of the given rectangle
453 Standard_EXPORT void ReadDepths (const Standard_Integer x, const Standard_Integer y, const Standard_Integer width, const Standard_Integer height, const Standard_Address buffer) const;
455 //! Generate offscreen FBO in the graphic library
456 Standard_EXPORT Graphic3d_PtrFrameBuffer FBOCreate (const Standard_Integer width, const Standard_Integer height);
458 //! Remove offscreen FBO from the graphic library
459 Standard_EXPORT void FBORelease (Graphic3d_PtrFrameBuffer& fboPtr);
461 //! Read offscreen FBO configuration.
462 Standard_EXPORT void FBOGetDimensions (const Graphic3d_PtrFrameBuffer fboPtr, Standard_Integer& width, Standard_Integer& height, Standard_Integer& widthMax, Standard_Integer& heightMax);
464 //! Change offscreen FBO viewport.
465 Standard_EXPORT void FBOChangeViewport (Graphic3d_PtrFrameBuffer& fboPtr, const Standard_Integer width, const Standard_Integer height);
467 //! Dump active rendering buffer into specified memory buffer.
468 Standard_EXPORT Standard_Boolean BufferDump (Image_PixMap& theImage, const Graphic3d_BufferType& theBufferType);
470 //! turns on/off opengl lighting, currently used in triedron displaying
471 Standard_EXPORT void EnableGLLight (const Standard_Boolean enable) const;
473 //! returns the current state of the gl lighting
474 //! currently used in triedron displaying
475 Standard_EXPORT Standard_Boolean IsGLLightEnabled() const;
478 //! Export scene into the one of the Vector graphics formats (SVG, PS, PDF...).
479 //! In contrast to Bitmaps, Vector graphics is scalable (so you may got quality benefits on printing to laser printer).
480 //! Notice however that results may differ a lot and do not contain some elements.
481 Standard_EXPORT Standard_Boolean Export (const Standard_CString theFileName, const Graphic3d_ExportFormat theFormat, const Graphic3d_SortType theSortType = Graphic3d_ST_BSP_Tree, const Standard_Real thePrecision = 0.005, const Standard_Address theProgressBarFunc = NULL, const Standard_Address theProgressObject = NULL) const;
483 //! Returns map of objects hidden within this specific view (not viewer-wise).
484 Standard_EXPORT const Handle(Graphic3d_NMapOfTransient)& HiddenObjects() const;
486 //! Returns map of objects hidden within this specific view (not viewer-wise).
487 Standard_EXPORT Handle(Graphic3d_NMapOfTransient)& ChangeHiddenObjects();
489 //! Returns Standard_True in case if the structure with the given <theStructId> is
490 //! in list of structures to be computed and stores computed struct to <theComputedStruct>.
491 Standard_EXPORT Standard_Boolean IsComputed (const Standard_Integer theStructId,
492 Handle(Graphic3d_Structure)& theComputedStruct) const;
494 friend class Visual3d_ViewManager;
497 DEFINE_STANDARD_RTTI(Visual3d_View,Graphic3d_DataStructureManager)
507 //! Is it possible to display the structure in the view?
508 Standard_EXPORT Visual3d_TypeOfAnswer acceptDisplay (const Graphic3d_TypeOfStructure theStructType) const;
510 //! Computes the new presentation of the
511 //! Structures displayed in <me> with the type
512 //! Graphic3d_TOS_COMPUTED.
513 Standard_EXPORT void Compute();
515 //! Changes the display priority of the structure <AStructure>.
516 Standard_EXPORT void ChangeDisplayPriority (const Handle(Graphic3d_Structure)& AStructure, const Standard_Integer OldPriority, const Standard_Integer NewPriority);
518 //! Sets the settings for a single Z layer of specified view.
519 Standard_EXPORT void SetZLayerSettings (const Graphic3d_ZLayerId theLayerId, const Graphic3d_ZLayerSettings& theSettings);
521 //! Add a new top-level Z layer to the view with ID
522 //! <theLayerId>. The z layer mechanism allows to display
523 //! structures in higher layers in overlay of structures in lower layers.
524 //! The layers in a particular view should be managed centrally
525 //! by its view manager so to avoid IDs mismatching and provide correct
526 //! display of graphics in all views.
527 Standard_EXPORT void AddZLayer (const Graphic3d_ZLayerId theLayerId);
529 //! Remove z layer from the view by its ID.
530 Standard_EXPORT void RemoveZLayer (const Graphic3d_ZLayerId theLayerId);
532 //! Change Z layer of already displayed structure in the view.
533 Standard_EXPORT void ChangeZLayer (const Handle(Graphic3d_Structure)& theStructure, const Graphic3d_ZLayerId theLayerId);
535 //! Clears the structure <AStructure> to the view <me>.
536 Standard_EXPORT void Clear (const Handle(Graphic3d_Structure)& AStructure, const Standard_Boolean WithDestruction);
538 //! Connects the structures <AMother> and <ADaughter>.
539 Standard_EXPORT void Connect (const Handle(Graphic3d_Structure)& AMother, const Handle(Graphic3d_Structure)& ADaughter);
541 //! Disconnects the structures <AMother> and <ADaughter>.
542 Standard_EXPORT void Disconnect (const Handle(Graphic3d_Structure)& AMother, const Handle(Graphic3d_Structure)& ADaughter);
544 //! Display the structure <AStructure> to the view <me>.
545 Standard_EXPORT void Display (const Handle(Graphic3d_Structure)& AStructure);
547 //! Display the structure <AStructure> to the view <me>.
548 Standard_EXPORT void Display (const Handle(Graphic3d_Structure)& AStructure, const Aspect_TypeOfUpdate AnUpdateMode);
550 //! Erases the structure <AStructure> from the view <me>.
551 Standard_EXPORT void Erase (const Handle(Graphic3d_Structure)& AStructure);
553 //! Erases the structure <AStructure> from the view <me>.
554 Standard_EXPORT void Erase (const Handle(Graphic3d_Structure)& AStructure, const Aspect_TypeOfUpdate AnUpdateMode);
556 //! Highlights the structure <AStructure> in the view <me>.
557 Standard_EXPORT void Highlight (const Handle(Graphic3d_Structure)& AStructure, const Aspect_TypeOfHighlightMethod AMethod);
559 //! Transforms the structure <AStructure> in the view <me>.
560 Standard_EXPORT void SetTransform (const Handle(Graphic3d_Structure)& AStructure, const TColStd_Array2OfReal& ATrsf);
562 //! Suppress the highlighting on the structure <AStructure>
563 //! in the view <me>.
564 Standard_EXPORT void UnHighlight (const Handle(Graphic3d_Structure)& AStructure);
566 //! Returns an index != 0 if the structure <AStructure>
567 //! have another structure computed for the view <me>.
568 Standard_EXPORT Standard_Integer IsComputed (const Handle(Graphic3d_Structure)& AStructure) const;
570 //! Returns true if the structure <AStructure> is
571 //! displayed in the view <me>.
572 Standard_EXPORT Standard_Boolean IsDisplayed (const Handle(Graphic3d_Structure)& AStructure) const;
574 //! Modifies the aspect ratio of the view <me> when the
575 //! associated window is defined or resized.
576 Standard_EXPORT void SetRatio();
578 //! Updates the lights when the associated window is defined
579 //! and when the view is activated.
580 Standard_EXPORT void UpdateLights();
582 //! Updates the planes when the associated window is defined
583 //! and when the view is activated.
584 Standard_EXPORT void UpdatePlanes();
586 //! Updates the associated c structure before a call to the
588 Standard_EXPORT void UpdateView();
590 //! Returns an index != 0 if the structure <AStructure>
591 //! have the same owner than another structure in the
592 //! sequence of the computed structures.
593 Standard_EXPORT Standard_Integer HaveTheSameOwner (const Handle(Graphic3d_Structure)& AStructure) const;
595 Visual3d_ViewManagerPtr myViewManager;
596 Graphic3d_CView MyCView;
597 Visual3d_ContextView MyContext;
598 Handle(Aspect_Window) MyWindow;
599 Graphic3d_SequenceOfStructure myStructsToCompute;
600 Graphic3d_SequenceOfStructure myStructsComputed;
601 Standard_Boolean myIsInComputedMode;
602 Handle(Graphic3d_GraphicDriver) myGraphicDriver;
603 Aspect_Background MyBackground;
604 Aspect_GradientBackground MyGradientBackground;
605 Graphic3d_MapOfStructure myStructsDisplayed;
606 Graphic3d_GraduatedTrihedron myGTrihedron;
607 Handle(Graphic3d_Camera) myDefaultCamera;
608 Standard_Boolean myAutoZFitIsOn;
609 Standard_Real myAutoZFitScaleFactor;
610 Standard_Boolean myStructuresUpdated;
611 Handle(Graphic3d_NMapOfTransient) myHiddenObjects;
622 #endif // _Visual3d_View_HeaderFile