0027031: Samples - fix compilation issues in java/jniviewer sample
authorkgv <kgv@opencascade.com>
Tue, 22 Dec 2015 15:04:29 +0000 (18:04 +0300)
committerbugmaster <bugmaster@opencascade.com>
Tue, 22 Dec 2015 15:12:36 +0000 (18:12 +0300)
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.

samples/java/jniviewer/jni/Android.mk
samples/java/jniviewer/jni/OcctJni_Viewer.cxx
samples/java/jniviewer/jni/OcctJni_Window.hxx

index 912d5e3..c944ec8 100644 (file)
@@ -200,7 +200,7 @@ include $(CLEAR_VARS)
 LOCAL_MODULE           := libTKJniSample
 LOCAL_C_INCLUDES       := $(STL_INC)
 #LOCAL_STATIC_LIBRARIES := $(STL_LIB) does not work
-LOCAL_CFLAGS           := -Wall
+LOCAL_CFLAGS           := -Wall -std=c++11
 LOCAL_CPP_EXTENSION    := .cxx .cpp
 LOCAL_CPP_FEATURES     := rtti exceptions
 LOCAL_SRC_FILES        := OcctJni_Viewer.cxx OcctJni_Window.cxx OcctJni_MsgPrinter.cxx
index 750f030..5098513 100644 (file)
@@ -179,7 +179,7 @@ bool OcctJni_Viewer::init()
     }
 
     aWindow->SetSize (aWidth, aHeight);
-    myView->SetWindow (aWindow, (Aspect_RenderingContext )anEglContext, NULL, NULL);
+    myView->SetWindow (aWindow, (Aspect_RenderingContext )anEglContext);
     return true;
   }
 
@@ -208,7 +208,7 @@ bool OcctJni_Viewer::init()
   Handle(OcctJni_Window) aWindow = new OcctJni_Window (aWidth, aHeight);
   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);
 
   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
 
   EGLContext anEglContext = eglGetCurrentContext();
-  myView->SetWindow (aWindow, (Aspect_RenderingContext )anEglContext, NULL, NULL);
+  myView->SetWindow (aWindow, (Aspect_RenderingContext )anEglContext);
   //saveSnapshot ("/sdcard/Download/tt.png", theWidth, theHeight);
 }
 
index a8e38c9..f8cd2da 100644 (file)
@@ -27,36 +27,39 @@ public:
   : myWidth (theWidth), myHeight(theHeight) {}
 
   //! 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
-  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() {}
 
   //! Opens the window <me>
-  virtual void Map() const {}
+  virtual void Map() const Standard_OVERRIDE {}
 
   //! Closes the window <me>
-  virtual void Unmap() const {}
+  virtual void Unmap() const Standard_OVERRIDE {}
 
   //! 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>
-  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
-  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
-  virtual Quantity_Ratio Ratio() const { return 1.0; }
+  virtual Quantity_Ratio Ratio() const Standard_OVERRIDE { return 1.0; }
 
   //! Returns The Window POSITION in PIXEL
   virtual void Position (Standard_Integer& theX1,
                          Standard_Integer& theY1,
                          Standard_Integer& theX2,
-                         Standard_Integer& theY2) const
+                         Standard_Integer& theY2) const Standard_OVERRIDE
   {
     theX1 = 0;
     theX2 = myWidth;
@@ -65,10 +68,10 @@ public:
   }
 
   //! Set The Window POSITION in PIXEL
-  virtual void SetPosition (const Standard_Integer theX1,
-                            const Standard_Integer theY1,
-                            const Standard_Integer theX2,
-                            const Standard_Integer theY2)
+  void SetPosition (const Standard_Integer theX1,
+                    const Standard_Integer theY1,
+                    const Standard_Integer theX2,
+                    const Standard_Integer theY2)
   {
     myWidth  = theX2 - theX1;
     myHeight = theY2 - theY1;
@@ -76,15 +79,15 @@ public:
 
   //! Returns The Window SIZE in PIXEL
   virtual void Size (Standard_Integer& theWidth,
-                     Standard_Integer& theHeight) const
+                     Standard_Integer& theHeight) const Standard_OVERRIDE
   {
     theWidth  = myWidth;
     theHeight = myHeight;
   }
 
   //! Set The Window SIZE in PIXEL
-  virtual void SetSize (const Standard_Integer theWidth,
-                        const Standard_Integer theHeight)
+  void SetSize (const Standard_Integer theWidth,
+                const Standard_Integer theHeight)
   {
     myWidth  = theWidth;
     myHeight = theHeight;