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_FrameStats_HeaderFile
15 #define _OpenGl_FrameStats_HeaderFile
17 #include <Graphic3d_FrameStats.hxx>
18 #include <NCollection_IndexedMap.hxx>
20 class OpenGl_Workspace;
21 class OpenGl_Structure;
22 typedef NCollection_IndexedMap<const OpenGl_Structure*> OpenGl_IndexedMapOfStructure;
24 //! Class storing the frame statistics.
25 class OpenGl_FrameStats : public Graphic3d_FrameStats
27 DEFINE_STANDARD_RTTIEXT(OpenGl_FrameStats, Graphic3d_FrameStats)
30 //! Default constructor.
31 Standard_EXPORT OpenGl_FrameStats();
34 Standard_EXPORT virtual ~OpenGl_FrameStats();
38 //! Copy stats values into another instance (create new instance, if not exists).
39 //! The main use of this method is to track changes in statistics (e.g. in conjunction with IsEqual() method).
40 //! @return TRUE if frame data has been changed so that the presentation should be updated
41 Standard_EXPORT virtual bool IsFrameUpdated (Handle(OpenGl_FrameStats)& thePrev) const;
45 //! Method to collect statistics from the View; called by FrameEnd().
46 Standard_EXPORT virtual void updateStatistics (const Handle(Graphic3d_CView)& theView,
47 bool theIsImmediateOnly) Standard_OVERRIDE;
49 //! Updates counters for structures.
50 Standard_EXPORT virtual void updateStructures (Standard_Integer theViewId,
51 const OpenGl_IndexedMapOfStructure& theStructures,
52 Standard_Boolean theToCountElems,
53 Standard_Boolean theToCountTris,
54 Standard_Boolean theToCountMem);
58 DEFINE_STANDARD_HANDLE(OpenGl_FrameStats, Graphic3d_FrameStats)
60 #endif // _OpenGl_FrameStats_HeaderFile