0029395: Visualization, V3d_View - Grid disappears forever after enabling RayTracing
[occt.git] / src / V3d / V3d_RectangularGrid.hxx
CommitLineData
42cf5bc1 1// Created on: 1998-07-16
2// Created by: CAL
3// Copyright (c) 1998-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 _V3d_RectangularGrid_HeaderFile
18#define _V3d_RectangularGrid_HeaderFile
19
20#include <Standard.hxx>
21#include <Standard_Type.hxx>
22
23#include <gp_Ax3.hxx>
24#include <V3d_ViewerPointer.hxx>
25#include <Standard_Boolean.hxx>
26#include <Aspect_GridDrawMode.hxx>
27#include <Standard_Real.hxx>
28#include <Aspect_RectangularGrid.hxx>
29class Graphic3d_Structure;
30class Graphic3d_Group;
42cf5bc1 31
32class V3d_RectangularGrid : public Aspect_RectangularGrid
33{
475c2302 34 DEFINE_STANDARD_RTTIEXT(V3d_RectangularGrid, Aspect_RectangularGrid)
42cf5bc1 35public:
36
42cf5bc1 37 Standard_EXPORT V3d_RectangularGrid(const V3d_ViewerPointer& aViewer, const Quantity_Color& aColor, const Quantity_Color& aTenthColor);
475c2302 38
39 Standard_EXPORT virtual ~V3d_RectangularGrid();
42cf5bc1 40
475c2302 41 Standard_EXPORT virtual void SetColors (const Quantity_Color& aColor, const Quantity_Color& aTenthColor) Standard_OVERRIDE;
42cf5bc1 42
475c2302 43 Standard_EXPORT virtual void Display() Standard_OVERRIDE;
42cf5bc1 44
475c2302 45 Standard_EXPORT virtual void Erase() const Standard_OVERRIDE;
42cf5bc1 46
475c2302 47 Standard_EXPORT virtual Standard_Boolean IsDisplayed() const Standard_OVERRIDE;
42cf5bc1 48
49 Standard_EXPORT void GraphicValues (Standard_Real& XSize, Standard_Real& YSize, Standard_Real& OffSet) const;
50
51 Standard_EXPORT void SetGraphicValues (const Standard_Real XSize, const Standard_Real YSize, const Standard_Real OffSet);
52
42cf5bc1 53protected:
42cf5bc1 54
475c2302 55 Standard_EXPORT virtual void UpdateDisplay() Standard_OVERRIDE;
42cf5bc1 56
57private:
58
42cf5bc1 59 Standard_EXPORT void DefineLines();
60
61 Standard_EXPORT void DefinePoints();
62
475c2302 63private:
64
5f6e3a07 65 //! Custom Graphic3d_Structure implementation.
66 class RectangularGridStructure;
67
68private:
69
42cf5bc1 70 Handle(Graphic3d_Structure) myStructure;
71 Handle(Graphic3d_Group) myGroup;
72 gp_Ax3 myCurViewPlane;
73 V3d_ViewerPointer myViewer;
74 Standard_Boolean myCurAreDefined;
5f6e3a07 75 Standard_Boolean myToComputePrs;
42cf5bc1 76 Aspect_GridDrawMode myCurDrawMode;
77 Standard_Real myCurXo;
78 Standard_Real myCurYo;
79 Standard_Real myCurAngle;
80 Standard_Real myCurXStep;
81 Standard_Real myCurYStep;
82 Standard_Real myXSize;
83 Standard_Real myYSize;
84 Standard_Real myOffSet;
85
42cf5bc1 86};
87
475c2302 88DEFINE_STANDARD_HANDLE(V3d_RectangularGrid, Aspect_RectangularGrid)
42cf5bc1 89
90#endif // _V3d_RectangularGrid_HeaderFile