0030434: Visualization, TKV3d - add "NoUpdate" state of frustum culling optimization
[occt.git] / src / OpenGl / OpenGl_FrameStats.hxx
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 OpenGl_Workspace;
21 class OpenGl_Structure;
22 typedef NCollection_IndexedMap<const OpenGl_Structure*> OpenGl_IndexedMapOfStructure;
23
24 //! Class storing the frame statistics.
25 class OpenGl_FrameStats : public Graphic3d_FrameStats
26 {
27   DEFINE_STANDARD_RTTIEXT(OpenGl_FrameStats, Graphic3d_FrameStats)
28 public:
29
30   //! Default constructor.
31   Standard_EXPORT OpenGl_FrameStats();
32
33   //! Destructor.
34   Standard_EXPORT virtual ~OpenGl_FrameStats();
35
36 public:
37
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;
42
43 protected:
44
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;
48
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);
55
56 };
57
58 DEFINE_STANDARD_HANDLE(OpenGl_FrameStats, Graphic3d_FrameStats)
59
60 #endif // _OpenGl_FrameStats_HeaderFile