0029570: Visualization, Graphic3d_Aspect - merge Graphic3d_Group aspects
[occt.git] / src / ViewerTest / ViewerTest_AutoUpdater.hxx
1 // Created on: 2014-09-10
2 // Created by: Kirill Gavrilov
3 // Copyright (c) 2014 OPEN CASCADE SAS
4 //
5 // This file is part of Open CASCADE Technology software library.
6 //
7 // This library is free software; you can redistribute it and/or modify it under
8 // the terms of the GNU Lesser General Public License version 2.1 as published
9 // by the Free Software Foundation, with special exception defined in the file
10 // OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT
11 // distribution for complete text of the license and disclaimer of any warranty.
12 //
13 // Alternatively, this file may be used under the terms of Open CASCADE
14 // commercial license or contractual agreement.
15
16 #ifndef _ViewerTest_AutoUpdater_HeaderFile
17 #define _ViewerTest_AutoUpdater_HeaderFile
18
19 #include <AIS_InteractiveContext.hxx>
20 #include <V3d_View.hxx>
21
22 class TCollection_AsciiString;
23
24 //! Auxiliary tool to control view updates.
25 class ViewerTest_AutoUpdater
26 {
27 public:
28
29   //! Enumeration to control auto-update
30   enum RedrawMode
31   {
32     RedrawMode_Auto = -1,
33     RedrawMode_Forced,
34     RedrawMode_Suppressed
35   };
36
37 public:
38
39   //! Constructor
40   Standard_EXPORT ViewerTest_AutoUpdater (const Handle(AIS_InteractiveContext)& theContext,
41                                           const Handle(V3d_View)&               theView);
42
43   //! Destructor to automatically update view
44   Standard_EXPORT ~ViewerTest_AutoUpdater();
45
46   //! Parse redraw mode argument
47   Standard_EXPORT Standard_Boolean parseRedrawMode (const TCollection_AsciiString& theArg);
48
49   //! Disable autoupdate
50   Standard_EXPORT void Invalidate();
51
52   //! Finally update view
53   Standard_EXPORT void Update();
54
55 private:
56
57   Handle(AIS_InteractiveContext)     myContext;
58   Handle(V3d_View)                   myView;
59   ViewerTest_AutoUpdater::RedrawMode myToUpdate;
60   Standard_Boolean                   myWasAutoUpdate;
61
62 };
63
64 #endif // _ViewerTest_AutoUpdater_HeaderFile