1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-16 10:08:36 +03:00

0027031: Samples - fix compilation issues in java/jniviewer sample

Add -std=c++11 compiler flag to Android.mk.
OcctJni_Viewer - drop removed arguments within V3d_View::SetWindow() usage.
OcctJni_Window - add missing NativeFBConfig() method declared in the interface.
This commit is contained in:
kgv 2015-12-22 18:04:29 +03:00 committed by bugmaster
parent 54f91e0332
commit 6435b9c7fa
3 changed files with 23 additions and 20 deletions

View File

@ -200,7 +200,7 @@ include $(CLEAR_VARS)
LOCAL_MODULE := libTKJniSample LOCAL_MODULE := libTKJniSample
LOCAL_C_INCLUDES := $(STL_INC) LOCAL_C_INCLUDES := $(STL_INC)
#LOCAL_STATIC_LIBRARIES := $(STL_LIB) does not work #LOCAL_STATIC_LIBRARIES := $(STL_LIB) does not work
LOCAL_CFLAGS := -Wall LOCAL_CFLAGS := -Wall -std=c++11
LOCAL_CPP_EXTENSION := .cxx .cpp LOCAL_CPP_EXTENSION := .cxx .cpp
LOCAL_CPP_FEATURES := rtti exceptions LOCAL_CPP_FEATURES := rtti exceptions
LOCAL_SRC_FILES := OcctJni_Viewer.cxx OcctJni_Window.cxx OcctJni_MsgPrinter.cxx LOCAL_SRC_FILES := OcctJni_Viewer.cxx OcctJni_Window.cxx OcctJni_MsgPrinter.cxx

View File

@ -179,7 +179,7 @@ bool OcctJni_Viewer::init()
} }
aWindow->SetSize (aWidth, aHeight); aWindow->SetSize (aWidth, aHeight);
myView->SetWindow (aWindow, (Aspect_RenderingContext )anEglContext, NULL, NULL); myView->SetWindow (aWindow, (Aspect_RenderingContext )anEglContext);
return true; return true;
} }
@ -208,7 +208,7 @@ bool OcctJni_Viewer::init()
Handle(OcctJni_Window) aWindow = new OcctJni_Window (aWidth, aHeight); Handle(OcctJni_Window) aWindow = new OcctJni_Window (aWidth, aHeight);
myView = myViewer->CreateView(); myView = myViewer->CreateView();
myView->SetWindow (aWindow, (Aspect_RenderingContext )anEglContext, NULL, NULL); myView->SetWindow (aWindow, (Aspect_RenderingContext )anEglContext);
myView->TriedronDisplay (Aspect_TOTP_RIGHT_LOWER, Quantity_NOC_WHITE, 0.08, V3d_ZBUFFER); myView->TriedronDisplay (Aspect_TOTP_RIGHT_LOWER, Quantity_NOC_WHITE, 0.08, V3d_ZBUFFER);
initContent(); initContent();
@ -245,7 +245,7 @@ void OcctJni_Viewer::resize (int theWidth,
//myView->MustBeResized(); // can be used instead of SetWindow() when EGLsurface has not been changed //myView->MustBeResized(); // can be used instead of SetWindow() when EGLsurface has not been changed
EGLContext anEglContext = eglGetCurrentContext(); EGLContext anEglContext = eglGetCurrentContext();
myView->SetWindow (aWindow, (Aspect_RenderingContext )anEglContext, NULL, NULL); myView->SetWindow (aWindow, (Aspect_RenderingContext )anEglContext);
//saveSnapshot ("/sdcard/Download/tt.png", theWidth, theHeight); //saveSnapshot ("/sdcard/Download/tt.png", theWidth, theHeight);
} }

View File

@ -27,36 +27,39 @@ public:
: myWidth (theWidth), myHeight(theHeight) {} : myWidth (theWidth), myHeight(theHeight) {}
//! Returns native Window handle //! Returns native Window handle
virtual Aspect_Drawable NativeHandle() const { return 0; } virtual Aspect_Drawable NativeHandle() const Standard_OVERRIDE { return 0; }
//! Returns parent of native Window handle //! Returns parent of native Window handle
virtual Aspect_Drawable NativeParentHandle() const { return 0; } virtual Aspect_Drawable NativeParentHandle() const Standard_OVERRIDE { return 0; }
//! Returns nothing on Android
virtual Aspect_FBConfig NativeFBConfig() const Standard_OVERRIDE { return 0; }
virtual void Destroy() {} virtual void Destroy() {}
//! Opens the window <me> //! Opens the window <me>
virtual void Map() const {} virtual void Map() const Standard_OVERRIDE {}
//! Closes the window <me> //! Closes the window <me>
virtual void Unmap() const {} virtual void Unmap() const Standard_OVERRIDE {}
//! Applies the resizing to the window <me> //! Applies the resizing to the window <me>
virtual Aspect_TypeOfResize DoResize() const { return Aspect_TOR_UNKNOWN; } virtual Aspect_TypeOfResize DoResize() const Standard_OVERRIDE { return Aspect_TOR_UNKNOWN; }
//! Apply the mapping change to the window <me> //! Apply the mapping change to the window <me>
virtual Standard_Boolean DoMapping() const { return Standard_True; } virtual Standard_Boolean DoMapping() const Standard_OVERRIDE { return Standard_True; }
//! Returns True if the window <me> is opened //! Returns True if the window <me> is opened
virtual Standard_Boolean IsMapped() const { return Standard_True; } virtual Standard_Boolean IsMapped() const Standard_OVERRIDE { return Standard_True; }
//! Returns The Window RATIO equal to the physical WIDTH/HEIGHT dimensions //! Returns The Window RATIO equal to the physical WIDTH/HEIGHT dimensions
virtual Quantity_Ratio Ratio() const { return 1.0; } virtual Quantity_Ratio Ratio() const Standard_OVERRIDE { return 1.0; }
//! Returns The Window POSITION in PIXEL //! Returns The Window POSITION in PIXEL
virtual void Position (Standard_Integer& theX1, virtual void Position (Standard_Integer& theX1,
Standard_Integer& theY1, Standard_Integer& theY1,
Standard_Integer& theX2, Standard_Integer& theX2,
Standard_Integer& theY2) const Standard_Integer& theY2) const Standard_OVERRIDE
{ {
theX1 = 0; theX1 = 0;
theX2 = myWidth; theX2 = myWidth;
@ -65,7 +68,7 @@ public:
} }
//! Set The Window POSITION in PIXEL //! Set The Window POSITION in PIXEL
virtual void SetPosition (const Standard_Integer theX1, void SetPosition (const Standard_Integer theX1,
const Standard_Integer theY1, const Standard_Integer theY1,
const Standard_Integer theX2, const Standard_Integer theX2,
const Standard_Integer theY2) const Standard_Integer theY2)
@ -76,14 +79,14 @@ public:
//! Returns The Window SIZE in PIXEL //! Returns The Window SIZE in PIXEL
virtual void Size (Standard_Integer& theWidth, virtual void Size (Standard_Integer& theWidth,
Standard_Integer& theHeight) const Standard_Integer& theHeight) const Standard_OVERRIDE
{ {
theWidth = myWidth; theWidth = myWidth;
theHeight = myHeight; theHeight = myHeight;
} }
//! Set The Window SIZE in PIXEL //! Set The Window SIZE in PIXEL
virtual void SetSize (const Standard_Integer theWidth, void SetSize (const Standard_Integer theWidth,
const Standard_Integer theHeight) const Standard_Integer theHeight)
{ {
myWidth = theWidth; myWidth = theWidth;