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_FrameStats_HeaderFile |
15 | #define _OpenGl_FrameStats_HeaderFile |
16 | |
5e30547b |
17 | #include <Graphic3d_FrameStats.hxx> |
15669413 |
18 | #include <NCollection_IndexedMap.hxx> |
15669413 |
19 | |
d325cb7f |
20 | class Graphic3d_CStructure; |
15669413 |
21 | |
22 | //! Class storing the frame statistics. |
5e30547b |
23 | class OpenGl_FrameStats : public Graphic3d_FrameStats |
15669413 |
24 | { |
5e30547b |
25 | DEFINE_STANDARD_RTTIEXT(OpenGl_FrameStats, Graphic3d_FrameStats) |
15669413 |
26 | public: |
27 | |
28 | //! Default constructor. |
29 | Standard_EXPORT OpenGl_FrameStats(); |
30 | |
31 | //! Destructor. |
32 | Standard_EXPORT virtual ~OpenGl_FrameStats(); |
33 | |
15669413 |
34 | public: |
35 | |
5e30547b |
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; |
15669413 |
40 | |
41 | protected: |
42 | |
5e30547b |
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 | |
15669413 |
47 | //! Updates counters for structures. |
5dc0517d |
48 | Standard_EXPORT virtual void updateStructures (Standard_Integer theViewId, |
d325cb7f |
49 | const NCollection_IndexedMap<const Graphic3d_CStructure*>& theStructures, |
15669413 |
50 | Standard_Boolean theToCountElems, |
51 | Standard_Boolean theToCountTris, |
52 | Standard_Boolean theToCountMem); |
53 | |
15669413 |
54 | }; |
55 | |
5e30547b |
56 | DEFINE_STANDARD_HANDLE(OpenGl_FrameStats, Graphic3d_FrameStats) |
15669413 |
57 | |
58 | #endif // _OpenGl_FrameStats_HeaderFile |