Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:04:21

0001 // Copyright (c) 2017 OPEN CASCADE SAS
0002 //
0003 // This file is part of Open CASCADE Technology software library.
0004 //
0005 // This library is free software; you can redistribute it and/or modify it under
0006 // the terms of the GNU Lesser General Public License version 2.1 as published
0007 // by the Free Software Foundation, with special exception defined in the file
0008 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
0009 // distribution for complete text of the license and disclaimer of any warranty.
0010 //
0011 // Alternatively, this file may be used under the terms of Open CASCADE
0012 // commercial license or contractual agreement.
0013 
0014 #ifndef _OpenGl_FrameStatsPrs_HeaderFile
0015 #define _OpenGl_FrameStatsPrs_HeaderFile
0016 
0017 #include <OpenGl_Aspects.hxx>
0018 #include <OpenGl_FrameStats.hxx>
0019 #include <OpenGl_Text.hxx>
0020 
0021 class Graphic3d_ArrayOfTriangles;
0022 class Graphic3d_TransformPers;
0023 class OpenGl_IndexBuffer;
0024 class OpenGl_VertexBuffer;
0025 
0026 //! Element rendering frame statistics.
0027 class OpenGl_FrameStatsPrs : public OpenGl_Element
0028 {
0029 public:
0030 
0031   //! Default constructor.
0032   Standard_EXPORT OpenGl_FrameStatsPrs();
0033 
0034   //! Destructor
0035   Standard_EXPORT virtual ~OpenGl_FrameStatsPrs();
0036 
0037   //! Render element.
0038   Standard_EXPORT virtual void Render (const Handle(OpenGl_Workspace)& theWorkspace) const Standard_OVERRIDE;
0039 
0040   //! Release OpenGL resources.
0041   Standard_EXPORT virtual void Release (OpenGl_Context* theCtx) Standard_OVERRIDE;
0042 
0043   //! Update text.
0044   Standard_EXPORT void Update (const Handle(OpenGl_Workspace)& theWorkspace);
0045 
0046   //! Assign text aspect.
0047   void SetTextAspect (const Handle(Graphic3d_AspectText3d)& theAspect) { myTextAspect.SetAspect (theAspect); }
0048 
0049   //! Dumps the content of me into the stream
0050   Standard_EXPORT virtual void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const Standard_OVERRIDE;
0051 
0052 protected:
0053 
0054   //! Update chart presentation.
0055   Standard_EXPORT void updateChart (const Handle(OpenGl_Workspace)& theWorkspace);
0056 
0057 protected:
0058 
0059   Handle(OpenGl_FrameStats)          myStatsPrev;         //!< currently displayed stats
0060   Handle(Graphic3d_TransformPers)    myCountersTrsfPers;  //!< transformation persistence for counters presentation
0061   OpenGl_Text                        myCountersText;      //!< counters presentation
0062   OpenGl_Aspects                     myTextAspect;        //!< text aspect
0063   Handle(Graphic3d_TransformPers)    myChartTrsfPers;     //!< transformation persistence for chart presentation
0064   Handle(Graphic3d_ArrayOfTriangles) myChartArray;        //!< array of chart triangles
0065   Handle(OpenGl_VertexBuffer)        myChartVertices;     //!< VBO with chart triangles
0066   Handle(OpenGl_IndexBuffer)         myChartIndices;      //!< VBO with chart triangle indexes
0067   Handle(OpenGl_VertexBuffer)        myChartLines;        //!< array of chart lines
0068   OpenGl_Text                        myChartLabels[3];    //!< chart labels
0069 
0070 };
0071 
0072 #endif // _OpenGl_FrameStatsPrs_HeaderFile