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