42cf5bc1 |
1 | // Created on: 1995-03-17 |
2 | // Created by: Mister rmi |
3 | // Copyright (c) 1995-1999 Matra Datavision |
4 | // Copyright (c) 1999-2014 OPEN CASCADE SAS |
5 | // |
6 | // This file is part of Open CASCADE Technology software library. |
7 | // |
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. |
13 | // |
14 | // Alternatively, this file may be used under the terms of Open CASCADE |
15 | // commercial license or contractual agreement. |
16 | |
17 | #ifndef _Aspect_CircularGrid_HeaderFile |
18 | #define _Aspect_CircularGrid_HeaderFile |
19 | |
20 | #include <Standard.hxx> |
21 | #include <Standard_Type.hxx> |
22 | |
42cf5bc1 |
23 | #include <Standard_Integer.hxx> |
24 | #include <Standard_Real.hxx> |
25 | #include <Aspect_Grid.hxx> |
ee2be2a8 |
26 | |
42cf5bc1 |
27 | class Standard_NegativeValue; |
28 | class Standard_NullValue; |
29 | class Standard_NumericError; |
30 | |
42cf5bc1 |
31 | class Aspect_CircularGrid : public Aspect_Grid |
32 | { |
475c2302 |
33 | DEFINE_STANDARD_RTTIEXT(Aspect_CircularGrid, Aspect_Grid) |
42cf5bc1 |
34 | public: |
35 | |
42cf5bc1 |
36 | //! creates a new grid. By default this grid is not |
37 | //! active. |
ee2be2a8 |
38 | Standard_EXPORT Aspect_CircularGrid(const Standard_Real aRadiusStep, const Standard_Integer aDivisionNumber, const Standard_Real XOrigin = 0, const Standard_Real anYOrigin = 0, const Standard_Real aRotationAngle = 0); |
42cf5bc1 |
39 | |
40 | //! defines the x step of the grid. |
ee2be2a8 |
41 | Standard_EXPORT void SetRadiusStep (const Standard_Real aStep); |
42cf5bc1 |
42 | |
43 | //! defines the step of the grid. |
44 | Standard_EXPORT void SetDivisionNumber (const Standard_Integer aNumber); |
45 | |
ee2be2a8 |
46 | Standard_EXPORT void SetGridValues (const Standard_Real XOrigin, const Standard_Real YOrigin, const Standard_Real RadiusStep, const Standard_Integer DivisionNumber, const Standard_Real RotationAngle); |
42cf5bc1 |
47 | |
48 | //! returns the point of the grid the closest to the point X,Y |
475c2302 |
49 | Standard_EXPORT virtual void Compute (const Standard_Real X, const Standard_Real Y, Standard_Real& gridX, Standard_Real& gridY) const Standard_OVERRIDE; |
42cf5bc1 |
50 | |
51 | //! returns the x step of the grid. |
ee2be2a8 |
52 | Standard_EXPORT Standard_Real RadiusStep() const; |
42cf5bc1 |
53 | |
54 | //! returns the x step of the grid. |
55 | Standard_EXPORT Standard_Integer DivisionNumber() const; |
56 | |
475c2302 |
57 | Standard_EXPORT virtual void Init() Standard_OVERRIDE; |
42cf5bc1 |
58 | |
42cf5bc1 |
59 | private: |
60 | |
ee2be2a8 |
61 | Standard_Real myRadiusStep; |
42cf5bc1 |
62 | Standard_Integer myDivisionNumber; |
63 | Standard_Real myAlpha; |
64 | Standard_Real myA1; |
65 | Standard_Real myB1; |
66 | |
42cf5bc1 |
67 | }; |
68 | |
475c2302 |
69 | DEFINE_STANDARD_HANDLE(Aspect_CircularGrid, Aspect_Grid) |
70 | |
42cf5bc1 |
71 | #endif // _Aspect_CircularGrid_HeaderFile |