1 // Copyright (c) 1999-2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
5 // This library is free software; you can redistribute it and/or modify it under
6 // the terms of the GNU Lesser General Public License version 2.1 as published
7 // by the Free Software Foundation, with special exception defined in the file
8 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
9 // distribution for complete text of the license and disclaimer of any warranty.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 #include <Aspect_Grid.hxx>
16 IMPLEMENT_STANDARD_RTTIEXT(Aspect_Grid,Standard_Transient)
18 Aspect_Grid::Aspect_Grid (const Standard_Real theXOrigin,
19 const Standard_Real theYOrigin,
20 const Standard_Real theAngle,
21 const Quantity_Color& theColor,
22 const Quantity_Color& theTenthColor)
23 : myRotationAngle (theAngle),
24 myXOrigin (theXOrigin),
25 myYOrigin (theYOrigin),
27 myTenthColor (theTenthColor),
28 myIsActive (Standard_False),
29 myDrawMode (Aspect_GDM_Lines)
34 void Aspect_Grid::SetXOrigin (const Standard_Real theOrigin)
36 myXOrigin = theOrigin;
41 void Aspect_Grid::SetYOrigin (const Standard_Real theOrigin)
43 myYOrigin = theOrigin;
48 void Aspect_Grid::SetRotationAngle (const Standard_Real theAngle)
50 myRotationAngle = theAngle;
55 void Aspect_Grid::Rotate (const Standard_Real theAngle)
57 myRotationAngle += theAngle;
62 void Aspect_Grid::Translate (const Standard_Real theDx,
63 const Standard_Real theDy)
71 void Aspect_Grid::SetColors (const Quantity_Color& theColor,
72 const Quantity_Color& theTenthColor)
75 myTenthColor = theTenthColor;
79 void Aspect_Grid::Colors (Quantity_Color& theColor,
80 Quantity_Color& theTenthColor) const
83 theTenthColor = myTenthColor;
86 void Aspect_Grid::Hit (const Standard_Real theX,
87 const Standard_Real theY,
88 Standard_Real& theGridX,
89 Standard_Real& theGridY) const
93 Compute (theX, theY, theGridX, theGridY);
102 void Aspect_Grid::SetDrawMode (const Aspect_GridDrawMode theDrawMode)
104 myDrawMode = theDrawMode;