1 // Copyright (c) 2017 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 #ifndef _OpenGl_FrameStatsPrs_HeaderFile
15 #define _OpenGl_FrameStatsPrs_HeaderFile
17 #include <OpenGl_FrameStats.hxx>
18 #include <OpenGl_Text.hxx>
20 class Graphic3d_ArrayOfTriangles;
21 class Graphic3d_TransformPers;
22 class OpenGl_IndexBuffer;
23 class OpenGl_VertexBuffer;
25 //! Element rendering frame statistics.
26 class OpenGl_FrameStatsPrs : public OpenGl_Element
30 //! Default constructor.
31 Standard_EXPORT OpenGl_FrameStatsPrs();
34 Standard_EXPORT virtual ~OpenGl_FrameStatsPrs();
37 Standard_EXPORT virtual void Render (const Handle(OpenGl_Workspace)& theWorkspace) const Standard_OVERRIDE;
39 //! Release OpenGL resources.
40 Standard_EXPORT virtual void Release (OpenGl_Context* theCtx) Standard_OVERRIDE;
43 Standard_EXPORT void Update (const Handle(OpenGl_Workspace)& theWorkspace);
45 //! Assign text aspect.
46 void SetTextAspect (const Handle(Graphic3d_AspectText3d)& theAspect) { myTextAspect.SetAspect (theAspect); }
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;
53 //! Update chart presentation.
54 Standard_EXPORT void updateChart (const Handle(OpenGl_Workspace)& theWorkspace);
58 Handle(OpenGl_FrameStats) myStatsPrev; //!< currently displayed stats
59 Handle(Graphic3d_TransformPers) myCountersTrsfPers; //!< transformation persistence for counters presentation
60 OpenGl_Text myCountersText; //!< counters presentation
61 OpenGl_Aspects myTextAspect; //!< text aspect
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
71 #endif // _OpenGl_FrameStatsPrs_HeaderFile