0029419: Make V3d_Viewer::PrivilegedPlane() return const reference rather than a...
[occt.git] / src / V3d / V3d_Viewer.hxx
index 148c340..69184a2 100644 (file)
 #include <V3d_TypeOfVisualization.hxx>
 
 #include <Quantity_Color.hxx>
-#include <Quantity_Length.hxx>
-#include <Quantity_Parameter.hxx>
-#include <Quantity_PlaneAngle.hxx>
-#include <Quantity_TypeOfColor.hxx>
 
 class Aspect_Grid;
 class Graphic3d_AspectMarker3d;
@@ -63,7 +59,6 @@ class Graphic3d_Group;
 class Graphic3d_Structure;
 class V3d_BadValue;
 class V3d_CircularGrid;
-class V3d_Light;
 class V3d_RectangularGrid;
 class V3d_View;
 class Quantity_Color;
@@ -75,7 +70,6 @@ class Quantity_Color;
 class V3d_Viewer : public Standard_Transient
 {
   friend class V3d_View;
-  friend class V3d_Light;
   DEFINE_STANDARD_RTTIEXT(V3d_Viewer, Standard_Transient)
 public:
 
@@ -138,27 +132,12 @@ public:
   //! Set default Rendering Parameters.
   void SetDefaultRenderingParams (const Graphic3d_RenderingParams& theParams) { myDefaultRenderingParams = theParams; }
 
-  //! Defines the default background colour of views
-  //! attached to the viewer by supplying the name of the
-  //! colour under the form Quantity_NOC_xxxx .
-  void SetDefaultBackgroundColor (const Quantity_NameOfColor theName) { myBackground.SetColor (Quantity_Color (theName)); }
-
   //! Defines the default background colour of views
   //! attached to the viewer by supplying the color object
   void SetDefaultBackgroundColor (const Quantity_Color& theColor) { myBackground.SetColor (theColor); }
 
   //! Returns the gradient background of the view.
   const Aspect_GradientBackground& GetGradientBackground() const { return myGradientBackground; }
-
-  //! Defines the default gradient background colours of view
-  //! attached to the viewer by supplying the name of the
-  //! colours under the form Quantity_NOC_xxxx .
-  void SetDefaultBgGradientColors (const Quantity_NameOfColor theName1,
-                                   const Quantity_NameOfColor theName2,
-                                   const Aspect_GradientFillMethod theFillStyle = Aspect_GFM_HOR)
-  {
-    myGradientBackground.SetColors (Quantity_Color (theName1), Quantity_Color (theName2), theFillStyle);
-  }
   
   //! Defines the default gradient background colours of views
   //! attached to the viewer by supplying the colour objects
@@ -277,7 +256,10 @@ public: //! @name lights management
   
   //! Deactivate all the Lights defined in this viewer.
   Standard_EXPORT void SetLightOff();
-  
+
+  //! Adds Light in Sequence Of Lights.
+  Standard_EXPORT void AddLight (const Handle(V3d_Light)& theLight);
+
   //! Delete Light in Sequence Of Lights.
   Standard_EXPORT void DelLight (const Handle(V3d_Light)& theLight);
   
@@ -340,11 +322,11 @@ public:
 
 public: //! @name privileged plane management
 
-  Standard_EXPORT gp_Ax3 PrivilegedPlane() const;
+  const gp_Ax3& PrivilegedPlane() const { return myPrivilegedPlane; }
 
   Standard_EXPORT void SetPrivilegedPlane (const gp_Ax3& thePlane);
 
-  Standard_EXPORT void DisplayPrivilegedPlane (const Standard_Boolean theOnOff, const Quantity_Length theSize = 1);
+  Standard_EXPORT void DisplayPrivilegedPlane (const Standard_Boolean theOnOff, const Standard_Real theSize = 1);
 
 public: //! @name grid management
 
@@ -366,59 +348,58 @@ public: //! @name grid management
   //! marker size : 3.0
   Standard_EXPORT void SetGridEcho (const Handle(Graphic3d_AspectMarker3d)& aMarker);
   
-  //! Returns TRUE when grid echo must be displayed
-  //! at hit point.
-  Standard_EXPORT Standard_Boolean GridEcho() const;
+  //! Returns TRUE when grid echo must be displayed at hit point.
+  Standard_Boolean GridEcho() const { return myGridEcho; }
   
   //! Returns Standard_True if a grid is activated in <me>.
   Standard_EXPORT Standard_Boolean IsActive() const;
   
   //! Returns the defined grid in <me>.
   Standard_EXPORT Handle(Aspect_Grid) Grid() const;
-  
+
   //! Returns the current grid type defined in <me>.
-  Standard_EXPORT Aspect_GridType GridType() const;
+  Aspect_GridType GridType() const { return myGridType; }
   
   //! Returns the current grid draw mode defined in <me>.
   Standard_EXPORT Aspect_GridDrawMode GridDrawMode() const;
   
   //! Returns the definition of the rectangular grid.
-  Standard_EXPORT void RectangularGridValues (Quantity_Length& XOrigin, Quantity_Length& YOrigin, Quantity_Length& XStep, Quantity_Length& YStep, Quantity_PlaneAngle& RotationAngle) const;
+  Standard_EXPORT void RectangularGridValues (Standard_Real& XOrigin, Standard_Real& YOrigin, Standard_Real& XStep, Standard_Real& YStep, Standard_Real& RotationAngle) const;
   
   //! Sets the definition of the rectangular grid.
   //! <XOrigin>, <YOrigin> defines the origin of the grid.
   //! <XStep> defines the interval between 2 vertical lines.
   //! <YStep> defines the interval between 2 horizontal lines.
   //! <RotationAngle> defines the rotation angle of the grid.
-  Standard_EXPORT void SetRectangularGridValues (const Quantity_Length XOrigin, const Quantity_Length YOrigin, const Quantity_Length XStep, const Quantity_Length YStep, const Quantity_PlaneAngle RotationAngle);
+  Standard_EXPORT void SetRectangularGridValues (const Standard_Real XOrigin, const Standard_Real YOrigin, const Standard_Real XStep, const Standard_Real YStep, const Standard_Real RotationAngle);
   
   //! Returns the definition of the circular grid.
-  Standard_EXPORT void CircularGridValues (Quantity_Length& XOrigin, Quantity_Length& YOrigin, Quantity_Length& RadiusStep, Standard_Integer& DivisionNumber, Quantity_PlaneAngle& RotationAngle) const;
+  Standard_EXPORT void CircularGridValues (Standard_Real& XOrigin, Standard_Real& YOrigin, Standard_Real& RadiusStep, Standard_Integer& DivisionNumber, Standard_Real& RotationAngle) const;
   
   //! Sets the definition of the circular grid.
   //! <XOrigin>, <YOrigin> defines the origin of the grid.
   //! <RadiusStep> defines the interval between 2 circles.
   //! <DivisionNumber> defines the section number of one half circle.
   //! <RotationAngle> defines the rotation angle of the grid.
-  Standard_EXPORT void SetCircularGridValues (const Quantity_Length XOrigin, const Quantity_Length YOrigin, const Quantity_Length RadiusStep, const Standard_Integer DivisionNumber, const Quantity_PlaneAngle RotationAngle);
+  Standard_EXPORT void SetCircularGridValues (const Standard_Real XOrigin, const Standard_Real YOrigin, const Standard_Real RadiusStep, const Standard_Integer DivisionNumber, const Standard_Real RotationAngle);
   
   //! Returns the location and the size of the grid.
-  Standard_EXPORT void CircularGridGraphicValues (Quantity_Length& Radius, Quantity_Length& OffSet) const;
+  Standard_EXPORT void CircularGridGraphicValues (Standard_Real& Radius, Standard_Real& OffSet) const;
   
   //! Sets the location and the size of the grid.
   //! <XSize> defines the width of the grid.
   //! <YSize> defines the height of the grid.
   //! <OffSet> defines the displacement along the plane normal.
-  Standard_EXPORT void SetCircularGridGraphicValues (const Quantity_Length Radius, const Quantity_Length OffSet);
+  Standard_EXPORT void SetCircularGridGraphicValues (const Standard_Real Radius, const Standard_Real OffSet);
   
   //! Returns the location and the size of the grid.
-  Standard_EXPORT void RectangularGridGraphicValues (Quantity_Length& XSize, Quantity_Length& YSize, Quantity_Length& OffSet) const;
+  Standard_EXPORT void RectangularGridGraphicValues (Standard_Real& XSize, Standard_Real& YSize, Standard_Real& OffSet) const;
   
   //! Sets the location and the size of the grid.
   //! <XSize> defines the width of the grid.
   //! <YSize> defines the height of the grid.
   //! <OffSet> defines the displacement along the plane normal.
-  Standard_EXPORT void SetRectangularGridGraphicValues (const Quantity_Length XSize, const Quantity_Length YSize, const Quantity_Length OffSet);
+  Standard_EXPORT void SetRectangularGridGraphicValues (const Standard_Real XSize, const Standard_Real YSize, const Standard_Real OffSet);
   
   //! Display grid echo at requested point in the view.
   Standard_EXPORT void ShowGridEcho (const Handle(V3d_View)& theView, const Graphic3d_Vertex& thePoint);
@@ -432,9 +413,9 @@ public: //! @name deprecated methods
   Standard_EXPORT V3d_Viewer (const Handle(Graphic3d_GraphicDriver)& theDriver,
                               const Standard_ExtString theName,
                               const Standard_CString theDomain = "",
-                              const Quantity_Length theViewSize = 1000.0,
+                              const Standard_Real theViewSize = 1000.0,
                               const V3d_TypeOfOrientation theViewProj = V3d_XposYnegZpos,
-                              const Quantity_NameOfColor theViewBackground = Quantity_NOC_GRAY30,
+                              const Quantity_Color& theViewBackground = Quantity_NOC_GRAY30,
                               const V3d_TypeOfVisualization theVisualization = V3d_ZBUFFER,
                               const V3d_TypeOfShadingModel theShadingModel = V3d_GOURAUD,
                               const Standard_Boolean theComputedMode = Standard_True,
@@ -445,9 +426,9 @@ public: //! @name deprecated methods
   //! definition and the three component values.
   Standard_DEPRECATED("This method is deprecated - SetDefaultBackgroundColor() taking Quantity_Color should be used instead")
   void SetDefaultBackgroundColor (const Quantity_TypeOfColor theType,
-                                  const Quantity_Parameter theV1,
-                                  const Quantity_Parameter theV2,
-                                  const Quantity_Parameter theV3)
+                                  const Standard_Real theV1,
+                                  const Standard_Real theV2,
+                                  const Standard_Real theV3)
   {
     Standard_Real aV1 = theV1;
     Standard_Real aV2 = theV2;
@@ -459,7 +440,7 @@ public: //! @name deprecated methods
   }
 
   Standard_DEPRECATED("This method is deprecated - DefaultBackgroundColor() without arguments should be used instead")
-  void DefaultBackgroundColor (const Quantity_TypeOfColor theType, Quantity_Parameter& theV1, Quantity_Parameter& theV2, Quantity_Parameter& theV3) const
+  void DefaultBackgroundColor (const Quantity_TypeOfColor theType, Standard_Real& theV1, Standard_Real& theV2, Standard_Real& theV3) const
   {
     Quantity_Color aColor = DefaultBackgroundColor();
     aColor.Values (theV1, theV2, theV3, theType) ;
@@ -476,9 +457,6 @@ private:
   //! Delete View in Sequence Of Views.
   Standard_EXPORT void DelView (const Handle(V3d_View)& theView);
   
-  //! Adds Light in Sequence Of Lights.
-  Standard_EXPORT void AddLight (const Handle(V3d_Light)& theLight);
-  
 private:
 
   Handle(Graphic3d_GraphicDriver) myDriver;
@@ -511,7 +489,7 @@ private:
   gp_Ax3 myPrivilegedPlane;
   Handle(Graphic3d_Structure) myPlaneStructure;
   Standard_Boolean myDisplayPlane;
-  Quantity_Length myDisplayPlaneLength;
+  Standard_Real myDisplayPlaneLength;
 
   Handle(V3d_RectangularGrid) myRGrid;
   Handle(V3d_CircularGrid) myCGrid;