15669413 |
1 | // Copyright (c) 2017 OPEN CASCADE SAS |
2 | // |
3 | // This file is part of Open CASCADE Technology software library. |
4 | // |
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. |
10 | // |
11 | // Alternatively, this file may be used under the terms of Open CASCADE |
12 | // commercial license or contractual agreement. |
13 | |
14 | #ifndef _OpenGl_FrameStatsPrs_HeaderFile |
15 | #define _OpenGl_FrameStatsPrs_HeaderFile |
16 | |
17 | #include <OpenGl_FrameStats.hxx> |
18 | #include <OpenGl_Text.hxx> |
19 | |
5e30547b |
20 | class Graphic3d_ArrayOfTriangles; |
15669413 |
21 | class Graphic3d_TransformPers; |
5e30547b |
22 | class OpenGl_IndexBuffer; |
23 | class OpenGl_VertexBuffer; |
15669413 |
24 | |
25 | //! Element rendering frame statistics. |
5e30547b |
26 | class OpenGl_FrameStatsPrs : public OpenGl_Element |
15669413 |
27 | { |
28 | public: |
29 | |
30 | //! Default constructor. |
31 | Standard_EXPORT OpenGl_FrameStatsPrs(); |
32 | |
33 | //! Destructor |
34 | Standard_EXPORT virtual ~OpenGl_FrameStatsPrs(); |
35 | |
36 | //! Render element. |
37 | Standard_EXPORT virtual void Render (const Handle(OpenGl_Workspace)& theWorkspace) const Standard_OVERRIDE; |
38 | |
39 | //! Release OpenGL resources. |
40 | Standard_EXPORT virtual void Release (OpenGl_Context* theCtx) Standard_OVERRIDE; |
41 | |
42 | //! Update text. |
43 | Standard_EXPORT void Update (const Handle(OpenGl_Workspace)& theWorkspace); |
44 | |
45 | //! Assign text aspect. |
46 | void SetTextAspect (const Handle(Graphic3d_AspectText3d)& theAspect) { myTextAspect.SetAspect (theAspect); } |
47 | |
bc73b006 |
48 | //! Dumps the content of me into the stream |
49 | Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE; |
50 | |
15669413 |
51 | protected: |
52 | |
5e30547b |
53 | //! Update chart presentation. |
54 | Standard_EXPORT void updateChart (const Handle(OpenGl_Workspace)& theWorkspace); |
55 | |
56 | protected: |
57 | |
58 | Handle(OpenGl_FrameStats) myStatsPrev; //!< currently displayed stats |
59 | Handle(Graphic3d_TransformPers) myCountersTrsfPers; //!< transformation persistence for counters presentation |
60 | OpenGl_Text myCountersText; //!< counters presentation |
bf5f0ca2 |
61 | OpenGl_Aspects myTextAspect; //!< text aspect |
5e30547b |
62 | Handle(Graphic3d_TransformPers) myChartTrsfPers; //!< transformation persistence for chart presentation |
63 | Handle(Graphic3d_ArrayOfTriangles) myChartArray; //!< array of chart triangles |
64 | Handle(OpenGl_VertexBuffer) myChartVertices; //!< VBO with chart triangles |
65 | Handle(OpenGl_IndexBuffer) myChartIndices; //!< VBO with chart triangle indexes |
66 | Handle(OpenGl_VertexBuffer) myChartLines; //!< array of chart lines |
67 | OpenGl_Text myChartLabels[3]; //!< chart labels |
15669413 |
68 | |
69 | }; |
70 | |
71 | #endif // _OpenGl_FrameStatsPrs_HeaderFile |