File indexing completed on 2025-01-18 10:02:58
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017 #ifndef _Aspect_Grid_HeaderFile
0018 #define _Aspect_Grid_HeaderFile
0019
0020 #include <Standard.hxx>
0021
0022 #include <Quantity_Color.hxx>
0023 #include <Aspect_GridDrawMode.hxx>
0024 #include <Standard_Transient.hxx>
0025
0026 class Aspect_Grid : public Standard_Transient
0027 {
0028 DEFINE_STANDARD_RTTIEXT(Aspect_Grid, Standard_Transient)
0029 public:
0030
0031
0032 Standard_EXPORT void SetXOrigin (const Standard_Real anOrigin);
0033
0034
0035 Standard_EXPORT void SetYOrigin (const Standard_Real anOrigin);
0036
0037
0038 Standard_EXPORT void SetRotationAngle (const Standard_Real anAngle);
0039
0040
0041 Standard_EXPORT void Rotate (const Standard_Real anAngle);
0042
0043
0044 Standard_EXPORT void Translate (const Standard_Real aDx, const Standard_Real aDy);
0045
0046
0047 Standard_EXPORT virtual void SetColors (const Quantity_Color& aColor, const Quantity_Color& aTenthColor);
0048
0049
0050
0051
0052 Standard_EXPORT void Hit (const Standard_Real X, const Standard_Real Y, Standard_Real& gridX, Standard_Real& gridY) const;
0053
0054
0055 Standard_EXPORT virtual void Compute (const Standard_Real X, const Standard_Real Y, Standard_Real& gridX, Standard_Real& gridY) const = 0;
0056
0057
0058
0059
0060 void Activate() { myIsActive = Standard_True; }
0061
0062
0063
0064 void Deactivate() { myIsActive = Standard_False; }
0065
0066
0067 Standard_Real XOrigin() const { return myXOrigin; }
0068
0069
0070 Standard_Real YOrigin() const { return myYOrigin; }
0071
0072
0073 Standard_Real RotationAngle() const { return myRotationAngle; }
0074
0075
0076 Standard_Boolean IsActive() const { return myIsActive; }
0077
0078
0079 Standard_EXPORT void Colors (Quantity_Color& aColor, Quantity_Color& aTenthColor) const;
0080
0081
0082 Standard_EXPORT void SetDrawMode (const Aspect_GridDrawMode aDrawMode);
0083
0084
0085 Aspect_GridDrawMode DrawMode() const { return myDrawMode; }
0086
0087
0088 Standard_EXPORT virtual void Display() = 0;
0089
0090
0091 Standard_EXPORT virtual void Erase() const = 0;
0092
0093
0094 Standard_EXPORT virtual Standard_Boolean IsDisplayed() const = 0;
0095
0096 Standard_EXPORT virtual void Init() = 0;
0097
0098
0099 Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
0100
0101 protected:
0102
0103
0104 Standard_EXPORT Aspect_Grid (const Standard_Real theXOrigin = 0.0,
0105 const Standard_Real theYOrigin = 0.0,
0106 const Standard_Real theRotationAngle = 0,
0107 const Quantity_Color& theColor = Quantity_NOC_GRAY50,
0108 const Quantity_Color& theTenthColor = Quantity_NOC_GRAY70);
0109
0110
0111 Standard_EXPORT virtual void UpdateDisplay() = 0;
0112
0113 protected:
0114
0115 Standard_Real myRotationAngle;
0116 Standard_Real myXOrigin;
0117 Standard_Real myYOrigin;
0118 Quantity_Color myColor;
0119 Quantity_Color myTenthColor;
0120 Standard_Boolean myIsActive;
0121 Aspect_GridDrawMode myDrawMode;
0122
0123 };
0124
0125 DEFINE_STANDARD_HANDLE(Aspect_Grid, Standard_Transient)
0126
0127 #endif