Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-24 09:18:14

0001 // Created on: 1992-01-17
0002 // Created by: GG
0003 // Copyright (c) 1992-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _V3d_Viewer_HeaderFile
0018 #define _V3d_Viewer_HeaderFile
0019 
0020 #include <Aspect_GridDrawMode.hxx>
0021 #include <Aspect_GridType.hxx>
0022 #include <Graphic3d_StructureManager.hxx>
0023 #include <Graphic3d_Vertex.hxx>
0024 #include <Graphic3d_ZLayerSettings.hxx>
0025 #include <TColStd_MapOfInteger.hxx>
0026 #include <TColStd_SequenceOfInteger.hxx>
0027 #include <TCollection_ExtendedString.hxx>
0028 #include <V3d_ListOfLight.hxx>
0029 #include <V3d_ListOfView.hxx>
0030 #include <V3d_TypeOfOrientation.hxx>
0031 #include <V3d_TypeOfView.hxx>
0032 #include <V3d_TypeOfVisualization.hxx>
0033 #include <Quantity_Color.hxx>
0034 
0035 class Aspect_Grid;
0036 class Graphic3d_AspectMarker3d;
0037 class Graphic3d_GraphicDriver;
0038 class Graphic3d_Group;
0039 class Graphic3d_Structure;
0040 class V3d_CircularGrid;
0041 class V3d_RectangularGrid;
0042 class V3d_View;
0043 
0044 //! Defines services on Viewer type objects.
0045 //! The methods of this class allow editing and
0046 //! interrogation of the parameters linked to the viewer
0047 //! its friend classes (View,light,plane).
0048 class V3d_Viewer : public Standard_Transient
0049 {
0050   friend class V3d_View;
0051   DEFINE_STANDARD_RTTIEXT(V3d_Viewer, Standard_Transient)
0052 public:
0053   //! Create a Viewer with the given graphic driver and with default parameters:
0054   //! - View orientation: V3d_XposYnegZpos
0055   //! - View background: Quantity_NOC_GRAY30
0056   //! - Shading model: V3d_GOURAUD
0057   Standard_EXPORT V3d_Viewer(const Handle(Graphic3d_GraphicDriver)& theDriver);
0058 
0059   //! Returns True if One View more can be defined in this Viewer.
0060   Standard_EXPORT Standard_Boolean IfMoreViews() const;
0061 
0062   //! Creates a view in the viewer according to its default parameters.
0063   Standard_EXPORT Handle(V3d_View) CreateView();
0064 
0065   //! Activates all of the views of a viewer attached to a window.
0066   Standard_EXPORT void SetViewOn();
0067 
0068   //! Activates a particular view in the Viewer.
0069   //! Must be call if the Window attached to the view has been Deiconified.
0070   Standard_EXPORT void SetViewOn(const Handle(V3d_View)& theView);
0071 
0072   //! Deactivates all the views of a Viewer
0073   //! attached to a window.
0074   Standard_EXPORT void SetViewOff();
0075 
0076   //! Deactivates a particular view in the Viewer.
0077   //! Must be call if the Window attached to the view
0078   //! has been Iconified .
0079   Standard_EXPORT void SetViewOff(const Handle(V3d_View)& theView);
0080 
0081   //! Deprecated, Redraw() should be used instead.
0082   void Update() { Redraw(); }
0083 
0084   //! Redraws all the views of the Viewer even if no
0085   //! modification has taken place. Must be called if
0086   //! all the views of the Viewer are exposed, as for
0087   //! example in a global DeIconification.
0088   Standard_EXPORT void Redraw() const;
0089 
0090   //! Updates layer of immediate presentations.
0091   Standard_EXPORT void RedrawImmediate() const;
0092 
0093   //! Invalidates viewer content but does not redraw it.
0094   Standard_EXPORT void Invalidate() const;
0095 
0096   //! Suppresses the Viewer.
0097   Standard_EXPORT void Remove();
0098 
0099   //! Return Graphic Driver instance.
0100   const Handle(Graphic3d_GraphicDriver)& Driver() const { return myDriver; }
0101 
0102   //! Returns the structure manager associated to this viewer.
0103   Handle(Graphic3d_StructureManager) StructureManager() const { return myStructureManager; }
0104 
0105   //! Return default Rendering Parameters.
0106   //! By default these parameters are set in a new V3d_View.
0107   const Graphic3d_RenderingParams& DefaultRenderingParams() const
0108   {
0109     return myDefaultRenderingParams;
0110   }
0111 
0112   //! Set default Rendering Parameters.
0113   void SetDefaultRenderingParams(const Graphic3d_RenderingParams& theParams)
0114   {
0115     myDefaultRenderingParams = theParams;
0116   }
0117 
0118   //! Defines the default background colour of views
0119   //! attached to the viewer by supplying the color object
0120   void SetDefaultBackgroundColor(const Quantity_Color& theColor)
0121   {
0122     myBackground.SetColor(theColor);
0123   }
0124 
0125   //! Returns the gradient background of the view.
0126   const Aspect_GradientBackground& GetGradientBackground() const { return myGradientBackground; }
0127 
0128   //! Defines the default gradient background colours of views
0129   //! attached to the viewer by supplying the colour objects
0130   void SetDefaultBgGradientColors(
0131     const Quantity_Color&           theColor1,
0132     const Quantity_Color&           theColor2,
0133     const Aspect_GradientFillMethod theFillStyle = Aspect_GradientFillMethod_Horizontal)
0134   {
0135     myGradientBackground.SetColors(theColor1, theColor2, theFillStyle);
0136   }
0137 
0138   //! Returns the default size of the view.
0139   Standard_Real DefaultViewSize() const { return myViewSize; }
0140 
0141   //! Gives a default size for the creation of views of the viewer.
0142   Standard_EXPORT void SetDefaultViewSize(const Standard_Real theSize);
0143 
0144   //! Returns the default Projection.
0145   V3d_TypeOfOrientation DefaultViewProj() const { return myViewProj; }
0146 
0147   //! Sets the default projection for creating views in the viewer.
0148   void SetDefaultViewProj(const V3d_TypeOfOrientation theOrientation)
0149   {
0150     myViewProj = theOrientation;
0151   }
0152 
0153   //! Returns the default type of Visualization.
0154   V3d_TypeOfVisualization DefaultVisualization() const { return myVisualization; }
0155 
0156   //! Gives the default visualization mode.
0157   void SetDefaultVisualization(const V3d_TypeOfVisualization theType) { myVisualization = theType; }
0158 
0159   //! Returns the default type of Shading; Graphic3d_TypeOfShadingModel_Phong by default.
0160   Graphic3d_TypeOfShadingModel DefaultShadingModel() const
0161   {
0162     return myDefaultRenderingParams.ShadingModel;
0163   }
0164 
0165   //! Gives the default type of SHADING.
0166   void SetDefaultShadingModel(const Graphic3d_TypeOfShadingModel theType)
0167   {
0168     myDefaultRenderingParams.ShadingModel = theType;
0169   }
0170 
0171   //! Returns the default type of View (orthographic or perspective projection) to be returned by
0172   //! CreateView() method.
0173   V3d_TypeOfView DefaultTypeOfView() const { return myDefaultTypeOfView; }
0174 
0175   //! Set the default type of View (orthographic or perspective projection) to be returned by
0176   //! CreateView() method.
0177   void SetDefaultTypeOfView(const V3d_TypeOfView theType) { myDefaultTypeOfView = theType; }
0178 
0179   //! Returns the default background colour object.
0180   Quantity_Color DefaultBackgroundColor() const { return myBackground.Color(); }
0181 
0182   //! Returns the gradient background colour objects of the view.
0183   void DefaultBgGradientColors(Quantity_Color& theColor1, Quantity_Color& theColor2) const
0184   {
0185     myGradientBackground.Colors(theColor1, theColor2);
0186   }
0187 
0188   //! Return all Z layer ids in sequence ordered by overlay level from lowest layer to highest (
0189   //! foreground ). The first layer ID in sequence is the default layer that can't be removed.
0190   Standard_EXPORT void GetAllZLayers(TColStd_SequenceOfInteger& theLayerSeq) const;
0191 
0192   //! Add a new top-level Z layer to all managed views and get its ID as <theLayerId> value.
0193   //! The Z layers are controlled entirely by viewer, it is not possible to add a layer to a
0194   //! particular view. Custom layers will be inserted before Graphic3d_ZLayerId_Top (e.g. between
0195   //! Graphic3d_ZLayerId_Default and before Graphic3d_ZLayerId_Top).
0196   //! @param[out] theLayerId  id of created layer
0197   //! @param[in] theSettings  new layer settings
0198   //! @return FALSE if the layer can not be created
0199   Standard_Boolean AddZLayer(
0200     Graphic3d_ZLayerId&             theLayerId,
0201     const Graphic3d_ZLayerSettings& theSettings = Graphic3d_ZLayerSettings())
0202   {
0203     return InsertLayerBefore(theLayerId, theSettings, Graphic3d_ZLayerId_Top);
0204   }
0205 
0206   //! Add a new top-level Z layer to all managed views and get its ID as <theLayerId> value.
0207   //! The Z layers are controlled entirely by viewer, it is not possible to add a layer to a
0208   //! particular view. Layer rendering order is defined by its position in list (altered by
0209   //! theLayerAfter) and IsImmediate() flag (all layers with IsImmediate() flag are drawn
0210   //! afterwards);
0211   //! @param[out] theNewLayerId  id of created layer; layer id is arbitrary and does not depend on
0212   //! layer position in the list
0213   //! @param[in] theSettings     new layer settings
0214   //! @param[in] theLayerAfter   id of layer to append new layer before
0215   //! @return FALSE if the layer can not be created
0216   Standard_EXPORT Standard_Boolean InsertLayerBefore(Graphic3d_ZLayerId&             theNewLayerId,
0217                                                      const Graphic3d_ZLayerSettings& theSettings,
0218                                                      const Graphic3d_ZLayerId        theLayerAfter);
0219 
0220   //! Add a new top-level Z layer to all managed views and get its ID as <theLayerId> value.
0221   //! The Z layers are controlled entirely by viewer, it is not possible to add a layer to a
0222   //! particular view. Layer rendering order is defined by its position in list (altered by
0223   //! theLayerAfter) and IsImmediate() flag (all layers with IsImmediate() flag are drawn
0224   //! afterwards);
0225   //! @param[out] theNewLayerId  id of created layer; layer id is arbitrary and does not depend on
0226   //! layer position in the list
0227   //! @param[in] theSettings     new layer settings
0228   //! @param[in] theLayerBefore  id of layer to append new layer after
0229   //! @return FALSE if the layer can not be created
0230   Standard_EXPORT Standard_Boolean InsertLayerAfter(Graphic3d_ZLayerId&             theNewLayerId,
0231                                                     const Graphic3d_ZLayerSettings& theSettings,
0232                                                     const Graphic3d_ZLayerId        theLayerBefore);
0233 
0234   //! Remove Z layer with ID <theLayerId>.
0235   //! Method returns Standard_False if the layer can not be removed or doesn't exists.
0236   //! By default, there are always default bottom-level layer that can't be removed.
0237   Standard_EXPORT Standard_Boolean RemoveZLayer(const Graphic3d_ZLayerId theLayerId);
0238 
0239   //! Returns the settings of a single Z layer.
0240   Standard_EXPORT const Graphic3d_ZLayerSettings& ZLayerSettings(
0241     const Graphic3d_ZLayerId theLayerId) const;
0242 
0243   //! Sets the settings for a single Z layer.
0244   Standard_EXPORT void SetZLayerSettings(const Graphic3d_ZLayerId        theLayerId,
0245                                          const Graphic3d_ZLayerSettings& theSettings);
0246 
0247 public:
0248   //! Return a list of active views.
0249   const V3d_ListOfView& ActiveViews() const { return myActiveViews; }
0250 
0251   //! Return an iterator for active views.
0252   V3d_ListOfViewIterator ActiveViewIterator() const
0253   {
0254     return V3d_ListOfViewIterator(myActiveViews);
0255   }
0256 
0257   //! returns true if there is only one active view.
0258   Standard_Boolean LastActiveView() const { return myActiveViews.Extent() == 1; }
0259 
0260 public:
0261   //! Return a list of defined views.
0262   const V3d_ListOfView& DefinedViews() const { return myDefinedViews; }
0263 
0264   //! Return an iterator for defined views.
0265   V3d_ListOfViewIterator DefinedViewIterator() const
0266   {
0267     return V3d_ListOfViewIterator(myDefinedViews);
0268   }
0269 
0270 public: //! @name lights management
0271   //! Defines default lights:
0272   //!  positional-light 0.3 0. 0.
0273   //!  directional-light V3d_XnegYposZpos
0274   //!  directional-light V3d_XnegYneg
0275   //!  ambient-light
0276   Standard_EXPORT void SetDefaultLights();
0277 
0278   //! Activates MyLight in the viewer.
0279   Standard_EXPORT void SetLightOn(const Handle(V3d_Light)& theLight);
0280 
0281   //! Activates all the lights defined in this viewer.
0282   Standard_EXPORT void SetLightOn();
0283 
0284   //! Deactivates MyLight in this viewer.
0285   Standard_EXPORT void SetLightOff(const Handle(V3d_Light)& theLight);
0286 
0287   //! Deactivate all the Lights defined in this viewer.
0288   Standard_EXPORT void SetLightOff();
0289 
0290   //! Adds Light in Sequence Of Lights.
0291   Standard_EXPORT void AddLight(const Handle(V3d_Light)& theLight);
0292 
0293   //! Delete Light in Sequence Of Lights.
0294   Standard_EXPORT void DelLight(const Handle(V3d_Light)& theLight);
0295 
0296   //! Updates the lights of all the views of a viewer.
0297   Standard_EXPORT void UpdateLights();
0298 
0299   Standard_EXPORT Standard_Boolean IsGlobalLight(const Handle(V3d_Light)& TheLight) const;
0300 
0301   //! Return a list of active lights.
0302   const V3d_ListOfLight& ActiveLights() const { return myActiveLights; }
0303 
0304   //! Return an iterator for defined lights.
0305   V3d_ListOfLightIterator ActiveLightIterator() const
0306   {
0307     return V3d_ListOfLightIterator(myActiveLights);
0308   }
0309 
0310 public:
0311   //! Return a list of defined lights.
0312   const V3d_ListOfLight& DefinedLights() const { return myDefinedLights; }
0313 
0314   //! Return an iterator for defined lights.
0315   V3d_ListOfLightIterator DefinedLightIterator() const
0316   {
0317     return V3d_ListOfLightIterator(myDefinedLights);
0318   }
0319 
0320 public: //! @name objects management
0321   //! Erase all Objects in All the views.
0322   Standard_EXPORT void Erase() const;
0323 
0324   //! UnHighlight all Objects in All the views.
0325   Standard_EXPORT void UnHighlight() const;
0326 
0327 public:
0328   //! returns true if the computed mode can be used.
0329   Standard_Boolean ComputedMode() const { return myComputedMode; }
0330 
0331   //! Set if the computed mode can be used.
0332   void SetComputedMode(const Standard_Boolean theMode) { myComputedMode = theMode; }
0333 
0334   //! returns true if by default the computed mode must be used.
0335   Standard_Boolean DefaultComputedMode() const { return myDefaultComputedMode; }
0336 
0337   //! Set if by default the computed mode must be used.
0338   void SetDefaultComputedMode(const Standard_Boolean theMode) { myDefaultComputedMode = theMode; }
0339 
0340 public: //! @name privileged plane management
0341   const gp_Ax3& PrivilegedPlane() const { return myPrivilegedPlane; }
0342 
0343   Standard_EXPORT void SetPrivilegedPlane(const gp_Ax3& thePlane);
0344 
0345   Standard_EXPORT void DisplayPrivilegedPlane(const Standard_Boolean theOnOff,
0346                                               const Standard_Real    theSize = 1);
0347 
0348 public: //! @name grid management
0349   //! Activates the grid in all views of <me>.
0350   Standard_EXPORT void ActivateGrid(const Aspect_GridType     aGridType,
0351                                     const Aspect_GridDrawMode aGridDrawMode);
0352 
0353   //! Deactivates the grid in all views of <me>.
0354   Standard_EXPORT void DeactivateGrid();
0355 
0356   //! Show/Don't show grid echo to the hit point.
0357   //! If TRUE,the grid echo will be shown at ConvertToGrid() time.
0358   Standard_EXPORT void SetGridEcho(const Standard_Boolean showGrid = Standard_True);
0359 
0360   //! Show grid echo <aMarker> to the hit point.
0361   //! Warning: When the grid echo marker is not set,
0362   //! a default marker is build with the attributes:
0363   //! marker type : Aspect_TOM_STAR
0364   //! marker color : Quantity_NOC_GRAY90
0365   //! marker size : 3.0
0366   Standard_EXPORT void SetGridEcho(const Handle(Graphic3d_AspectMarker3d)& aMarker);
0367 
0368   //! Returns TRUE when grid echo must be displayed at hit point.
0369   Standard_Boolean GridEcho() const { return myGridEcho; }
0370 
0371   //! Returns Standard_True if a grid is activated in <me>.
0372   Standard_EXPORT Standard_Boolean IsGridActive();
0373 
0374   //! Returns the defined grid in <me>.
0375   Handle(Aspect_Grid) Grid(bool theToCreate = true) { return Grid(myGridType, theToCreate); }
0376 
0377   //! Returns the defined grid in <me>.
0378   Standard_EXPORT Handle(Aspect_Grid) Grid(Aspect_GridType theGridType, bool theToCreate = true);
0379 
0380   //! Returns the current grid type defined in <me>.
0381   Aspect_GridType GridType() const { return myGridType; }
0382 
0383   //! Returns the current grid draw mode defined in <me>.
0384   Standard_EXPORT Aspect_GridDrawMode GridDrawMode();
0385 
0386   //! Returns the definition of the rectangular grid.
0387   Standard_EXPORT void RectangularGridValues(Standard_Real& theXOrigin,
0388                                              Standard_Real& theYOrigin,
0389                                              Standard_Real& theXStep,
0390                                              Standard_Real& theYStep,
0391                                              Standard_Real& theRotationAngle);
0392 
0393   //! Sets the definition of the rectangular grid.
0394   //! <XOrigin>, <YOrigin> defines the origin of the grid.
0395   //! <XStep> defines the interval between 2 vertical lines.
0396   //! <YStep> defines the interval between 2 horizontal lines.
0397   //! <RotationAngle> defines the rotation angle of the grid.
0398   Standard_EXPORT void SetRectangularGridValues(const Standard_Real XOrigin,
0399                                                 const Standard_Real YOrigin,
0400                                                 const Standard_Real XStep,
0401                                                 const Standard_Real YStep,
0402                                                 const Standard_Real RotationAngle);
0403 
0404   //! Returns the definition of the circular grid.
0405   Standard_EXPORT void CircularGridValues(Standard_Real&    theXOrigin,
0406                                           Standard_Real&    theYOrigin,
0407                                           Standard_Real&    theRadiusStep,
0408                                           Standard_Integer& theDivisionNumber,
0409                                           Standard_Real&    theRotationAngle);
0410 
0411   //! Sets the definition of the circular grid.
0412   //! <XOrigin>, <YOrigin> defines the origin of the grid.
0413   //! <RadiusStep> defines the interval between 2 circles.
0414   //! <DivisionNumber> defines the section number of one half circle.
0415   //! <RotationAngle> defines the rotation angle of the grid.
0416   Standard_EXPORT void SetCircularGridValues(const Standard_Real    XOrigin,
0417                                              const Standard_Real    YOrigin,
0418                                              const Standard_Real    RadiusStep,
0419                                              const Standard_Integer DivisionNumber,
0420                                              const Standard_Real    RotationAngle);
0421 
0422   //! Returns the location and the size of the grid.
0423   Standard_EXPORT void CircularGridGraphicValues(Standard_Real& theRadius,
0424                                                  Standard_Real& theOffSet);
0425 
0426   //! Sets the location and the size of the grid.
0427   //! <XSize> defines the width of the grid.
0428   //! <YSize> defines the height of the grid.
0429   //! <OffSet> defines the displacement along the plane normal.
0430   Standard_EXPORT void SetCircularGridGraphicValues(const Standard_Real Radius,
0431                                                     const Standard_Real OffSet);
0432 
0433   //! Returns the location and the size of the grid.
0434   Standard_EXPORT void RectangularGridGraphicValues(Standard_Real& theXSize,
0435                                                     Standard_Real& theYSize,
0436                                                     Standard_Real& theOffSet);
0437 
0438   //! Sets the location and the size of the grid.
0439   //! <XSize> defines the width of the grid.
0440   //! <YSize> defines the height of the grid.
0441   //! <OffSet> defines the displacement along the plane normal.
0442   Standard_EXPORT void SetRectangularGridGraphicValues(const Standard_Real XSize,
0443                                                        const Standard_Real YSize,
0444                                                        const Standard_Real OffSet);
0445 
0446   //! Display grid echo at requested point in the view.
0447   Standard_EXPORT void ShowGridEcho(const Handle(V3d_View)& theView,
0448                                     const Graphic3d_Vertex& thePoint);
0449 
0450   //! Temporarily hide grid echo.
0451   Standard_EXPORT void HideGridEcho(const Handle(V3d_View)& theView);
0452 
0453 public: //! @name deprecated methods
0454   //! Returns Standard_True if a grid is activated in <me>.
0455   Standard_DEPRECATED("Deprecated method - IsGridActive() should be used instead")
0456 
0457   Standard_Boolean IsActive() { return IsGridActive(); }
0458 
0459   //! Initializes an internal iterator on the active views.
0460   Standard_DEPRECATED("Deprecated method - ActiveViews() should be used instead")
0461 
0462   void InitActiveViews() { myActiveViewsIterator.Initialize(myActiveViews); }
0463 
0464   //! Returns true if there are more active view(s) to return.
0465   Standard_DEPRECATED("Deprecated method - ActiveViews() should be used instead")
0466 
0467   Standard_Boolean MoreActiveViews() const { return myActiveViewsIterator.More(); }
0468 
0469   //! Go to the next active view (if there is not, ActiveView will raise an exception)
0470   Standard_DEPRECATED("Deprecated method - ActiveViews() should be used instead")
0471 
0472   void NextActiveViews()
0473   {
0474     if (!myActiveViews.IsEmpty())
0475       myActiveViewsIterator.Next();
0476   }
0477 
0478   Standard_DEPRECATED("Deprecated method - ActiveViews() should be used instead")
0479 
0480   const Handle(V3d_View)& ActiveView() const { return myActiveViewsIterator.Value(); }
0481 
0482   //! Initializes an internal iterator on the Defined views.
0483   Standard_DEPRECATED("Deprecated method - DefinedViews() should be used instead")
0484 
0485   void InitDefinedViews() { myDefinedViewsIterator.Initialize(myDefinedViews); }
0486 
0487   //! returns true if there are more Defined view(s) to return.
0488   Standard_DEPRECATED("Deprecated method - DefinedViews() should be used instead")
0489 
0490   Standard_Boolean MoreDefinedViews() const { return myDefinedViewsIterator.More(); }
0491 
0492   //! Go to the next Defined view (if there is not, DefinedView will raise an exception)
0493   Standard_DEPRECATED("Deprecated method - DefinedViews() should be used instead")
0494 
0495   void NextDefinedViews()
0496   {
0497     if (!myDefinedViews.IsEmpty())
0498       myDefinedViewsIterator.Next();
0499   }
0500 
0501   Standard_DEPRECATED("Deprecated method - DefinedViews() should be used instead")
0502 
0503   const Handle(V3d_View)& DefinedView() const { return myDefinedViewsIterator.Value(); }
0504 
0505   //! Initializes an internal iteratator on the active Lights.
0506   Standard_DEPRECATED("Deprecated method - ActiveLights() should be used instead")
0507 
0508   void InitActiveLights() { myActiveLightsIterator.Initialize(myActiveLights); }
0509 
0510   //! returns true if there are more active Light(s) to return.
0511   Standard_DEPRECATED("Deprecated method - ActiveLights() should be used instead")
0512 
0513   Standard_Boolean MoreActiveLights() const { return myActiveLightsIterator.More(); }
0514 
0515   //! Go to the next active Light (if there is not, ActiveLight() will raise an exception)
0516   Standard_DEPRECATED("Deprecated method - ActiveLights() should be used instead")
0517 
0518   void NextActiveLights() { myActiveLightsIterator.Next(); }
0519 
0520   Standard_DEPRECATED("Deprecated method - ActiveLights() should be used instead")
0521 
0522   const Handle(V3d_Light)& ActiveLight() const { return myActiveLightsIterator.Value(); }
0523 
0524   //! Initializes an internal iterattor on the Defined Lights.
0525   Standard_DEPRECATED("Deprecated method - DefinedLights() should be used instead")
0526 
0527   void InitDefinedLights() { myDefinedLightsIterator.Initialize(myDefinedLights); }
0528 
0529   //! Returns true if there are more Defined Light(s) to return.
0530   Standard_DEPRECATED("Deprecated method - DefinedLights() should be used instead")
0531 
0532   Standard_Boolean MoreDefinedLights() const { return myDefinedLightsIterator.More(); }
0533 
0534   //! Go to the next Defined Light (if there is not, DefinedLight() will raise an exception)
0535   Standard_DEPRECATED("Deprecated method - DefinedLights() should be used instead")
0536 
0537   void NextDefinedLights()
0538   {
0539     if (!myDefinedLights.IsEmpty())
0540       myDefinedLightsIterator.Next();
0541   }
0542 
0543   Standard_DEPRECATED("Deprecated method - DefinedLights() should be used instead")
0544 
0545   const Handle(V3d_Light)& DefinedLight() const { return myDefinedLightsIterator.Value(); }
0546 
0547   //! Dumps the content of me into the stream
0548   Standard_EXPORT void DumpJson(Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
0549 
0550 private:
0551   //! Returns the default background colour.
0552   const Aspect_Background& GetBackgroundColor() const { return myBackground; }
0553 
0554   //! Adds View in Sequence Of Views.
0555   Standard_EXPORT void AddView(const Handle(V3d_View)& theView);
0556 
0557   //! Delete View in Sequence Of Views.
0558   Standard_EXPORT void DelView(const V3d_View* theView);
0559 
0560 private:
0561   Handle(Graphic3d_GraphicDriver)    myDriver;
0562   Handle(Graphic3d_StructureManager) myStructureManager;
0563   TColStd_MapOfInteger               myLayerIds;
0564   Aspect_GenId                       myZLayerGenId;
0565 
0566   V3d_ListOfView  myDefinedViews;
0567   V3d_ListOfView  myActiveViews;
0568   V3d_ListOfLight myDefinedLights;
0569   V3d_ListOfLight myActiveLights;
0570 
0571   Aspect_Background         myBackground;
0572   Aspect_GradientBackground myGradientBackground;
0573   Standard_Real             myViewSize;
0574   V3d_TypeOfOrientation     myViewProj;
0575   V3d_TypeOfVisualization   myVisualization;
0576   V3d_TypeOfView            myDefaultTypeOfView;
0577   Graphic3d_RenderingParams myDefaultRenderingParams;
0578 
0579   V3d_ListOfView::Iterator  myActiveViewsIterator;
0580   V3d_ListOfView::Iterator  myDefinedViewsIterator;
0581   V3d_ListOfLight::Iterator myActiveLightsIterator;
0582   V3d_ListOfLight::Iterator myDefinedLightsIterator;
0583 
0584   Standard_Boolean myComputedMode;
0585   Standard_Boolean myDefaultComputedMode;
0586 
0587   gp_Ax3                      myPrivilegedPlane;
0588   Handle(Graphic3d_Structure) myPlaneStructure;
0589   Standard_Boolean            myDisplayPlane;
0590   Standard_Real               myDisplayPlaneLength;
0591 
0592   Handle(V3d_RectangularGrid)      myRGrid;
0593   Handle(V3d_CircularGrid)         myCGrid;
0594   Aspect_GridType                  myGridType;
0595   Standard_Boolean                 myGridEcho;
0596   Handle(Graphic3d_Structure)      myGridEchoStructure;
0597   Handle(Graphic3d_Group)          myGridEchoGroup;
0598   Handle(Graphic3d_AspectMarker3d) myGridEchoAspect;
0599   Graphic3d_Vertex                 myGridEchoLastVert;
0600 };
0601 
0602 DEFINE_STANDARD_HANDLE(V3d_Viewer, Standard_Transient)
0603 
0604 #endif // _V3d_Viewer_HeaderFile