1 // Copyright (c) 2014 OPEN CASCADE SAS
3 // This file is part of Open CASCADE Technology software library.
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.
11 // Alternatively, this file may be used under the terms of Open CASCADE
12 // commercial license or contractual agreement.
14 #include <AIS_InteractiveContext.hxx>
15 #include <AIS_ViewController.hxx>
16 #include <TopoDS_Shape.hxx>
17 #include <V3d_Viewer.hxx>
18 #include <V3d_View.hxx>
22 //! Main C++ back-end for activity.
23 class OcctJni_Viewer : public AIS_ViewController
29 OcctJni_Viewer (float theDispDensity);
31 //! Initialize the viewer
34 //! Release the viewer
38 void resize (int theWidth,
42 bool open (const TCollection_AsciiString& thePath);
45 bool saveSnapshot (const TCollection_AsciiString& thePath,
50 //! Returns TRUE if more frames should be requested.
54 void setProj (V3d_TypeOfOrientation theProj)
61 myView->SetProj (theProj);
70 //! Reset viewer content.
73 //! Print information about OpenGL ES context.
74 void dumpGlInfo (bool theIsBasic);
77 virtual void handleViewRedraw (const Handle(AIS_InteractiveContext)& theCtx,
78 const Handle(V3d_View)& theView) override;
82 Handle(V3d_Viewer) myViewer;
83 Handle(V3d_View) myView;
84 Handle(AIS_InteractiveContext) myContext;
85 Handle(Prs3d_TextAspect) myTextStyle; //!< text style for OSD elements
86 Handle(AIS_ViewCube) myViewCube; //!< view cube object
88 float myDevicePixelRatio; //!< device pixel ratio for handling high DPI displays
89 bool myIsJniMoreFrames; //!< need more frame flag