49582f9d |
1 | // Copyright (c) 2019 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 _ViewerTest_V3dView_HeaderFile |
15 | #define _ViewerTest_V3dView_HeaderFile |
16 | |
17 | #include <V3d_View.hxx> |
18 | |
19 | //! Setting additional flag to store 2D mode of the View to avoid scene rotation by mouse/key events |
20 | class ViewerTest_V3dView : public V3d_View |
21 | { |
22 | DEFINE_STANDARD_RTTIEXT(ViewerTest_V3dView, V3d_View) |
23 | public: |
24 | //! Initializes the view. |
25 | Standard_EXPORT ViewerTest_V3dView (const Handle(V3d_Viewer)& theViewer, |
26 | const V3d_TypeOfView theType = V3d_ORTHOGRAPHIC, |
27 | bool theIs2dMode = false); |
28 | |
29 | //! Initializes the view by copying. |
30 | Standard_EXPORT ViewerTest_V3dView (const Handle(V3d_Viewer)& theViewer, |
31 | const Handle(V3d_View)& theView); |
32 | |
33 | //! Returns true if 2D mode is set for the view |
34 | bool IsViewIn2DMode() const { return myIs2dMode; } |
35 | |
36 | //! Sets 2D mode for the view |
37 | void SetView2DMode (bool the2dMode) { myIs2dMode = the2dMode; } |
38 | |
39 | public: |
40 | |
41 | //! Returns true if active view in 2D mode. |
42 | Standard_EXPORT static bool IsCurrentViewIn2DMode(); |
43 | |
44 | //! Set if active view in 2D mode. |
45 | Standard_EXPORT static void SetCurrentView2DMode (bool theIs2d); |
46 | |
47 | private: |
48 | |
49 | Standard_Boolean myIs2dMode; //!< 2D mode flag |
50 | |
51 | }; |
52 | |
53 | #endif // _ViewerTest_V3dView_HeaderFile |