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
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_CircularGrid_HeaderFile
18 #define _Aspect_CircularGrid_HeaderFile
20 #include <Standard.hxx>
21 #include <Standard_Type.hxx>
23 #include <Standard_Integer.hxx>
24 #include <Standard_Real.hxx>
25 #include <Aspect_Grid.hxx>
27 class Standard_NegativeValue;
28 class Standard_NullValue;
29 class Standard_NumericError;
31 class Aspect_CircularGrid : public Aspect_Grid
33 DEFINE_STANDARD_RTTIEXT(Aspect_CircularGrid, Aspect_Grid)
36 //! creates a new grid. By default this grid is not
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);
40 //! defines the x step of the grid.
41 Standard_EXPORT void SetRadiusStep (const Standard_Real aStep);
43 //! defines the step of the grid.
44 Standard_EXPORT void SetDivisionNumber (const Standard_Integer aNumber);
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);
48 //! returns the point of the grid the closest to the point X,Y
49 Standard_EXPORT virtual void Compute (const Standard_Real X, const Standard_Real Y, Standard_Real& gridX, Standard_Real& gridY) const Standard_OVERRIDE;
51 //! returns the x step of the grid.
52 Standard_EXPORT Standard_Real RadiusStep() const;
54 //! returns the x step of the grid.
55 Standard_EXPORT Standard_Integer DivisionNumber() const;
57 Standard_EXPORT virtual void Init() Standard_OVERRIDE;
59 //! Dumps the content of me into the stream
60 Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
64 Standard_Real myRadiusStep;
65 Standard_Integer myDivisionNumber;
66 Standard_Real myAlpha;
72 DEFINE_STANDARD_HANDLE(Aspect_CircularGrid, Aspect_Grid)
74 #endif // _Aspect_CircularGrid_HeaderFile