1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-03 14:10:33 +03:00

0032433: Visualization, TKService - introduce Wasm_Window implementing Aspect_Window interface using Emscripten SDK

Introduced Wasm_Window implementing Aspect_Window interface.

Aspect_WindowInputListener has been extended by touch input callbacks (moved from AIS_ViewController),
which now implements redirection of single taps to UpdateMouseClick().

AIS_ViewController::FetchNavigationKeys() now requests more frames even if Delta is zero,
but navigation keys are pressed - indicated by a new flag AIS_WalkDelta::IsDefined().

Fixed missing implementation of Xw_Window::DisplayConnection() getter.
The property has been moved to the base class Aspect_Window.

Removed unused Aspect_Convert.hxx.

DRAWEXE targeting Wasm:
- added exposing of FS interface so that it is possible uploading/downloading files to/from emulated file system on JavaScript level;
- added printer redirecting messages to Module.printMessage callback accepting message gravity;
- Run_Appli() now skips std::cin when Module.noExitRuntime is set.
This commit is contained in:
kgv
2021-04-25 17:51:49 +03:00
committed by bugmaster
parent 7b3a032f1e
commit f9ab9f7f1c
28 changed files with 1743 additions and 775 deletions

View File

@@ -24,6 +24,7 @@
#include <Aspect_GradientFillMethod.hxx>
#include <Aspect_TypeOfResize.hxx>
#include <Aspect_Drawable.hxx>
#include <Graphic3d_Vec2.hxx>
#include <Standard.hxx>
#include <Standard_Transient.hxx>
#include <Standard_Type.hxx>
@@ -36,7 +37,7 @@ DEFINE_STANDARD_HANDLE(Aspect_Window, Standard_Transient)
//! Defines a window.
class Aspect_Window : public Standard_Transient
{
DEFINE_STANDARD_RTTIEXT(Aspect_Window, Standard_Transient)
public:
//! Modifies the window background.
@@ -102,6 +103,9 @@ public:
//! Returns native Window FB config (GLXFBConfig on Xlib)
Standard_EXPORT virtual Aspect_FBConfig NativeFBConfig() const = 0;
//! Returns connection to Display or NULL.
const Handle(Aspect_DisplayConnection)& DisplayConnection() const { return myDisplay; }
//! Sets window title.
virtual void SetTitle (const TCollection_AsciiString& theTitle) { (void )theTitle; }
@@ -114,12 +118,29 @@ public:
//! on platforms implementing thread-unsafe connections to display.
//! NULL can be passed instead otherwise.
virtual void InvalidateContent (const Handle(Aspect_DisplayConnection)& theDisp) { (void )theDisp; }
public:
//! Return device pixel ratio (logical to backing store scale factor).
virtual Standard_Real DevicePixelRatio() const { return 1.0; }
//! Convert point from logical units into backing store units.
virtual Graphic3d_Vec2d ConvertPointToBacking (const Graphic3d_Vec2d& thePnt) const
{
return thePnt * DevicePixelRatio();
}
//! Convert point from backing store units to logical units.
virtual Graphic3d_Vec2d ConvertPointFromBacking (const Graphic3d_Vec2d& thePnt) const
{
return thePnt / DevicePixelRatio();
}
public:
//! Dumps the content of me into the stream
Standard_EXPORT void DumpJson (Standard_OStream& theOStream, Standard_Integer theDepth = -1) const;
DEFINE_STANDARD_RTTIEXT(Aspect_Window,Standard_Transient)
protected:
//! Initializes the data of a Window.
@@ -127,6 +148,7 @@ protected:
protected:
Handle(Aspect_DisplayConnection) myDisplay; //!< Display connection
Aspect_Background MyBackground;
Aspect_GradientBackground MyGradientBackground;
Aspect_FillMethod MyBackgroundFillMethod;