0028316: Coding Rules - Elimilate confusing aliases of Standard_Real type in V3d_View
[occt.git] / src / Aspect / Aspect_RectangularGrid.hxx
CommitLineData
42cf5bc1 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
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_RectangularGrid_HeaderFile
18#define _Aspect_RectangularGrid_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_Type.hxx>
22
42cf5bc1 23#include <Standard_Real.hxx>
24#include <Aspect_Grid.hxx>
25#include <Standard_Boolean.hxx>
26class Standard_NegativeValue;
27class Standard_NullValue;
28class Standard_NumericError;
29
42cf5bc1 30class Aspect_RectangularGrid;
31DEFINE_STANDARD_HANDLE(Aspect_RectangularGrid, Aspect_Grid)
32
42cf5bc1 33class Aspect_RectangularGrid : public Aspect_Grid
34{
35
36public:
37
38
39 //! creates a new grid. By default this grid is not
40 //! active.
41 //! The first angle is given relatively to the horizontal.
42 //! The second angle is given relatively to the vertical.
ee2be2a8 43 Standard_EXPORT Aspect_RectangularGrid(const Standard_Real aXStep, const Standard_Real aYStep, const Standard_Real anXOrigin = 0, const Standard_Real anYOrigin = 0, const Standard_Real aFirstAngle = 0, const Standard_Real aSecondAngle = 0, const Standard_Real aRotationAngle = 0);
42cf5bc1 44
45 //! defines the x step of the grid.
ee2be2a8 46 Standard_EXPORT void SetXStep (const Standard_Real aStep);
42cf5bc1 47
48 //! defines the y step of the grid.
ee2be2a8 49 Standard_EXPORT void SetYStep (const Standard_Real aStep);
42cf5bc1 50
51 //! defines the angle of the second network
52 //! the fist angle is given relatively to the horizontal.
53 //! the second angle is given relatively to the vertical.
ee2be2a8 54 Standard_EXPORT void SetAngle (const Standard_Real anAngle1, const Standard_Real anAngle2);
42cf5bc1 55
ee2be2a8 56 Standard_EXPORT void SetGridValues (const Standard_Real XOrigin, const Standard_Real YOrigin, const Standard_Real XStep, const Standard_Real YStep, const Standard_Real RotationAngle);
42cf5bc1 57
58 //! returns the point of the grid the closest to the point X,Y
ee2be2a8 59 Standard_EXPORT void Compute (const Standard_Real X, const Standard_Real Y, Standard_Real& gridX, Standard_Real& gridY) const Standard_OVERRIDE;
42cf5bc1 60
61 //! returns the x step of the grid.
ee2be2a8 62 Standard_EXPORT Standard_Real XStep() const;
42cf5bc1 63
64 //! returns the x step of the grid.
ee2be2a8 65 Standard_EXPORT Standard_Real YStep() const;
42cf5bc1 66
67 //! returns the x Angle of the grid, relatively to the horizontal.
ee2be2a8 68 Standard_EXPORT Standard_Real FirstAngle() const;
42cf5bc1 69
70 //! returns the y Angle of the grid, relatively to the vertical.
ee2be2a8 71 Standard_EXPORT Standard_Real SecondAngle() const;
42cf5bc1 72
73 Standard_EXPORT void Init() Standard_OVERRIDE;
74
92efcf78 75 DEFINE_STANDARD_RTTIEXT(Aspect_RectangularGrid,Aspect_Grid)
42cf5bc1 76
42cf5bc1 77private:
78
ee2be2a8 79 Standard_EXPORT Standard_Boolean CheckAngle (const Standard_Real alpha, const Standard_Real beta) const;
42cf5bc1 80
ee2be2a8 81 Standard_Real myXStep;
82 Standard_Real myYStep;
83 Standard_Real myFirstAngle;
84 Standard_Real mySecondAngle;
42cf5bc1 85 Standard_Real a1;
86 Standard_Real b1;
87 Standard_Real c1;
88 Standard_Real a2;
89 Standard_Real b2;
90 Standard_Real c2;
91
42cf5bc1 92};
93
42cf5bc1 94#endif // _Aspect_RectangularGrid_HeaderFile