Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:02:58

0001 // Created on: 1995-03-02
0002 // Created by: Jean-Louis Frenkel
0003 // Copyright (c) 1995-1999 Matra Datavision
0004 // Copyright (c) 1999-2014 OPEN CASCADE SAS
0005 //
0006 // This file is part of Open CASCADE Technology software library.
0007 //
0008 // This library is free software; you can redistribute it and/or modify it under
0009 // the terms of the GNU Lesser General Public License version 2.1 as published
0010 // by the Free Software Foundation, with special exception defined in the file
0011 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0012 // distribution for complete text of the license and disclaimer of any warranty.
0013 //
0014 // Alternatively, this file may be used under the terms of Open CASCADE
0015 // commercial license or contractual agreement.
0016 
0017 #ifndef _Aspect_RectangularGrid_HeaderFile
0018 #define _Aspect_RectangularGrid_HeaderFile
0019 
0020 #include <Standard.hxx>
0021 
0022 #include <Aspect_Grid.hxx>
0023 
0024 class Aspect_RectangularGrid : public Aspect_Grid
0025 {
0026   DEFINE_STANDARD_RTTIEXT(Aspect_RectangularGrid, Aspect_Grid)
0027 public:
0028 
0029   //! creates a new grid. By default this grid is not
0030   //! active.
0031   //! The first angle is given relatively to the horizontal.
0032   //! The second angle is given relatively to the vertical.
0033   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);
0034   
0035   //! defines the x step of the grid.
0036   Standard_EXPORT void SetXStep (const Standard_Real aStep);
0037   
0038   //! defines the y step of the grid.
0039   Standard_EXPORT void SetYStep (const Standard_Real aStep);
0040   
0041   //! defines the angle of the second network
0042   //! the fist angle is given relatively to the horizontal.
0043   //! the second angle is given relatively to the vertical.
0044   Standard_EXPORT void SetAngle (const Standard_Real anAngle1, const Standard_Real anAngle2);
0045   
0046   Standard_EXPORT void SetGridValues (const Standard_Real XOrigin, const Standard_Real YOrigin, const Standard_Real XStep, const Standard_Real YStep, const Standard_Real RotationAngle);
0047   
0048   //! returns the point of the grid the closest to the point X,Y
0049   Standard_EXPORT virtual void Compute (const Standard_Real X, const Standard_Real Y, Standard_Real& gridX, Standard_Real& gridY) const Standard_OVERRIDE;
0050   
0051   //! returns the x step of the grid.
0052   Standard_EXPORT Standard_Real XStep() const;
0053   
0054   //! returns the x step of the grid.
0055   Standard_EXPORT Standard_Real YStep() const;
0056   
0057   //! returns the x Angle of the grid, relatively to the horizontal.
0058   Standard_EXPORT Standard_Real FirstAngle() const;
0059   
0060   //! returns the y Angle of the grid, relatively to the vertical.
0061   Standard_EXPORT Standard_Real SecondAngle() const;
0062   
0063   Standard_EXPORT virtual void Init() Standard_OVERRIDE;
0064   
0065   //! Dumps the content of me into the stream
0066   Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0067 
0068 private:
0069 
0070   Standard_EXPORT Standard_Boolean CheckAngle (const Standard_Real alpha, const Standard_Real beta) const;
0071 
0072 private:
0073 
0074   Standard_Real myXStep;
0075   Standard_Real myYStep;
0076   Standard_Real myFirstAngle;
0077   Standard_Real mySecondAngle;
0078   Standard_Real a1;
0079   Standard_Real b1;
0080   Standard_Real c1;
0081   Standard_Real a2;
0082   Standard_Real b2;
0083   Standard_Real c2;
0084 
0085 };
0086 
0087 DEFINE_STANDARD_HANDLE(Aspect_RectangularGrid, Aspect_Grid)
0088 
0089 #endif // _Aspect_RectangularGrid_HeaderFile