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 | #include <ViewerTest_V3dView.hxx> |
15 | |
16 | #include <ViewerTest.hxx> |
17 | |
18 | IMPLEMENT_STANDARD_RTTIEXT(ViewerTest_V3dView, V3d_View) |
19 | |
20 | // ======================================================================= |
21 | // function : ViewerTest_V3dView |
22 | // purpose : |
23 | // ======================================================================= |
24 | ViewerTest_V3dView::ViewerTest_V3dView (const Handle(V3d_Viewer)& theViewer, |
25 | const V3d_TypeOfView theType, |
26 | bool theIs2dMode) |
27 | : V3d_View (theViewer, theType), |
28 | myIs2dMode (theIs2dMode) |
29 | { |
30 | // |
31 | } |
32 | |
33 | // ======================================================================= |
34 | // function : ViewerTest_V3dView |
35 | // purpose : |
36 | // ======================================================================= |
37 | ViewerTest_V3dView::ViewerTest_V3dView (const Handle(V3d_Viewer)& theViewer, |
38 | const Handle(V3d_View)& theView) |
39 | : V3d_View (theViewer, theView), |
40 | myIs2dMode (false) |
41 | { |
42 | if (Handle(ViewerTest_V3dView) aV3dView = Handle(ViewerTest_V3dView)::DownCast (theView)) |
43 | { |
44 | myIs2dMode = aV3dView->IsViewIn2DMode(); |
45 | } |
46 | } |
47 | |
48 | // ======================================================================= |
49 | // function : IsCurrentViewIn2DMode |
50 | // purpose : |
51 | // ======================================================================= |
52 | bool ViewerTest_V3dView::IsCurrentViewIn2DMode() |
53 | { |
54 | if (Handle(ViewerTest_V3dView) aV3dView = Handle(ViewerTest_V3dView)::DownCast (ViewerTest::CurrentView())) |
55 | { |
56 | return aV3dView->IsViewIn2DMode(); |
57 | } |
58 | return false; |
59 | } |
60 | |
61 | // ======================================================================= |
62 | // function : SetCurrentView2DMode |
63 | // purpose : |
64 | // ======================================================================= |
65 | void ViewerTest_V3dView::SetCurrentView2DMode (bool theIs2d) |
66 | { |
67 | if (Handle(ViewerTest_V3dView) aV3dView = Handle(ViewerTest_V3dView)::DownCast (ViewerTest::CurrentView())) |
68 | { |
69 | aV3dView->SetView2DMode (theIs2d); |
70 | } |
71 | } |