0028316: Coding Rules - Elimilate confusing aliases of Standard_Real type in V3d_View
[occt.git] / samples / java / jniviewer / jni / OcctJni_Window.hxx
CommitLineData
7f2debb2 1// Copyright (c) 2014 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 OcctJni_Window_H
15#define OcctJni_Window_H
16
17#include <Aspect_Window.hxx>
18
19//! This class defines dummy window
20class OcctJni_Window : public Aspect_Window
21{
22
23public:
24
25 //! Creates a wrapper over existing Window handle
26 OcctJni_Window (const int theWidth, const int theHeight)
27 : myWidth (theWidth), myHeight(theHeight) {}
28
29 //! Returns native Window handle
6435b9c7 30 virtual Aspect_Drawable NativeHandle() const Standard_OVERRIDE { return 0; }
7f2debb2 31
32 //! Returns parent of native Window handle
6435b9c7 33 virtual Aspect_Drawable NativeParentHandle() const Standard_OVERRIDE { return 0; }
34
35 //! Returns nothing on Android
36 virtual Aspect_FBConfig NativeFBConfig() const Standard_OVERRIDE { return 0; }
7f2debb2 37
38 virtual void Destroy() {}
39
40 //! Opens the window <me>
6435b9c7 41 virtual void Map() const Standard_OVERRIDE {}
7f2debb2 42
43 //! Closes the window <me>
6435b9c7 44 virtual void Unmap() const Standard_OVERRIDE {}
7f2debb2 45
46 //! Applies the resizing to the window <me>
6435b9c7 47 virtual Aspect_TypeOfResize DoResize() const Standard_OVERRIDE { return Aspect_TOR_UNKNOWN; }
7f2debb2 48
49 //! Apply the mapping change to the window <me>
6435b9c7 50 virtual Standard_Boolean DoMapping() const Standard_OVERRIDE { return Standard_True; }
7f2debb2 51
52 //! Returns True if the window <me> is opened
6435b9c7 53 virtual Standard_Boolean IsMapped() const Standard_OVERRIDE { return Standard_True; }
7f2debb2 54
55 //! Returns The Window RATIO equal to the physical WIDTH/HEIGHT dimensions
ee2be2a8 56 virtual Standard_Real Ratio() const Standard_OVERRIDE { return 1.0; }
7f2debb2 57
58 //! Returns The Window POSITION in PIXEL
59 virtual void Position (Standard_Integer& theX1,
60 Standard_Integer& theY1,
61 Standard_Integer& theX2,
6435b9c7 62 Standard_Integer& theY2) const Standard_OVERRIDE
7f2debb2 63 {
64 theX1 = 0;
65 theX2 = myWidth;
66 theY1 = 0;
67 theY2 = myHeight;
68 }
69
70 //! Set The Window POSITION in PIXEL
6435b9c7 71 void SetPosition (const Standard_Integer theX1,
72 const Standard_Integer theY1,
73 const Standard_Integer theX2,
74 const Standard_Integer theY2)
7f2debb2 75 {
76 myWidth = theX2 - theX1;
77 myHeight = theY2 - theY1;
78 }
79
80 //! Returns The Window SIZE in PIXEL
81 virtual void Size (Standard_Integer& theWidth,
6435b9c7 82 Standard_Integer& theHeight) const Standard_OVERRIDE
7f2debb2 83 {
84 theWidth = myWidth;
85 theHeight = myHeight;
86 }
87
88 //! Set The Window SIZE in PIXEL
6435b9c7 89 void SetSize (const Standard_Integer theWidth,
90 const Standard_Integer theHeight)
7f2debb2 91 {
92 myWidth = theWidth;
93 myHeight = theHeight;
94 }
95
96private:
97
98 int myWidth;
99 int myHeight;
100
101public:
102
92efcf78 103 DEFINE_STANDARD_RTTIEXT(OcctJni_Window,Aspect_Window)
7f2debb2 104
105};
106
107DEFINE_STANDARD_HANDLE(OcctJni_Window, Aspect_Window)
108
109#endif // OcctJni_Window_H