1 // Created on: 1995-03-02
2 // Created by: Jean-Louis Frenkel
3 // Copyright (c) 1995-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 _Aspect_RectangularGrid_HeaderFile
18 #define _Aspect_RectangularGrid_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <Quantity_Length.hxx>
24 #include <Quantity_PlaneAngle.hxx>
25 #include <Standard_Real.hxx>
26 #include <Aspect_Grid.hxx>
27 #include <Standard_Boolean.hxx>
28 class Standard_NegativeValue;
29 class Standard_NullValue;
30 class Standard_NumericError;
33 class Aspect_RectangularGrid;
34 DEFINE_STANDARD_HANDLE(Aspect_RectangularGrid, Aspect_Grid)
37 class Aspect_RectangularGrid : public Aspect_Grid
43 //! creates a new grid. By default this grid is not
45 //! The first angle is given relatively to the horizontal.
46 //! The second angle is given relatively to the vertical.
47 Standard_EXPORT Aspect_RectangularGrid(const Quantity_Length aXStep, const Quantity_Length aYStep, const Quantity_Length anXOrigin = 0, const Quantity_Length anYOrigin = 0, const Quantity_PlaneAngle aFirstAngle = 0, const Quantity_PlaneAngle aSecondAngle = 0, const Quantity_PlaneAngle aRotationAngle = 0);
49 //! defines the x step of the grid.
50 Standard_EXPORT void SetXStep (const Quantity_Length aStep);
52 //! defines the y step of the grid.
53 Standard_EXPORT void SetYStep (const Quantity_Length aStep);
55 //! defines the angle of the second network
56 //! the fist angle is given relatively to the horizontal.
57 //! the second angle is given relatively to the vertical.
58 Standard_EXPORT void SetAngle (const Quantity_PlaneAngle anAngle1, const Quantity_PlaneAngle anAngle2);
60 Standard_EXPORT void SetGridValues (const Quantity_Length XOrigin, const Quantity_Length YOrigin, const Quantity_Length XStep, const Quantity_Length YStep, const Quantity_PlaneAngle RotationAngle);
62 //! returns the point of the grid the closest to the point X,Y
63 Standard_EXPORT void Compute (const Quantity_Length X, const Quantity_Length Y, Quantity_Length& gridX, Quantity_Length& gridY) const Standard_OVERRIDE;
65 //! returns the x step of the grid.
66 Standard_EXPORT Quantity_Length XStep() const;
68 //! returns the x step of the grid.
69 Standard_EXPORT Quantity_Length YStep() const;
71 //! returns the x Angle of the grid, relatively to the horizontal.
72 Standard_EXPORT Quantity_PlaneAngle FirstAngle() const;
74 //! returns the y Angle of the grid, relatively to the vertical.
75 Standard_EXPORT Quantity_PlaneAngle SecondAngle() const;
77 Standard_EXPORT void Init() Standard_OVERRIDE;
82 DEFINE_STANDARD_RTTIEXT(Aspect_RectangularGrid,Aspect_Grid)
92 Standard_EXPORT Standard_Boolean CheckAngle (const Quantity_PlaneAngle alpha, const Quantity_PlaneAngle beta) const;
94 Quantity_Length myXStep;
95 Quantity_Length myYStep;
96 Quantity_PlaneAngle myFirstAngle;
97 Quantity_PlaneAngle mySecondAngle;
114 #endif // _Aspect_RectangularGrid_HeaderFile