0030434: Visualization, TKV3d - add "NoUpdate" state of frustum culling optimization
[occt.git] / src / OpenGl / OpenGl_FrameStats.hxx
CommitLineData
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
20class OpenGl_Workspace;
21class OpenGl_Structure;
22typedef NCollection_IndexedMap<const OpenGl_Structure*> OpenGl_IndexedMapOfStructure;
23
24//! Class storing the frame statistics.
5e30547b 25class OpenGl_FrameStats : public Graphic3d_FrameStats
15669413 26{
5e30547b 27 DEFINE_STANDARD_RTTIEXT(OpenGl_FrameStats, Graphic3d_FrameStats)
15669413 28public:
29
30 //! Default constructor.
31 Standard_EXPORT OpenGl_FrameStats();
32
33 //! Destructor.
34 Standard_EXPORT virtual ~OpenGl_FrameStats();
35
15669413 36public:
37
5e30547b 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;
15669413 42
43protected:
44
5e30547b 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
15669413 49 //! Updates counters for structures.
5dc0517d 50 Standard_EXPORT virtual void updateStructures (Standard_Integer theViewId,
51 const OpenGl_IndexedMapOfStructure& theStructures,
15669413 52 Standard_Boolean theToCountElems,
53 Standard_Boolean theToCountTris,
54 Standard_Boolean theToCountMem);
55
15669413 56};
57
5e30547b 58DEFINE_STANDARD_HANDLE(OpenGl_FrameStats, Graphic3d_FrameStats)
15669413 59
60#endif // _OpenGl_FrameStats_HeaderFile