Class SoRemoteVizClient
- java.lang.Object
-
- com.openinventor.inventor.Inventor
-
- com.openinventor.inventor.misc.SoBase
-
- com.openinventor.inventor.fields.SoFieldContainer
-
- com.openinventor.inventor.nodes.SoNode
-
- com.openinventor.remoteviz.clients.nodes.SoRemoteVizClient
-
- All Implemented Interfaces:
SafeDisposable
public class SoRemoteVizClient extends SoNode
Client node enables to integrate RemoteViz into Open Inventor applications. This node is a RemoteViz client enabling software developers to easily integrate remote 3D interaction and visualization into their Open Inventor applications. It enables to establish a connection to a RemoteViz service so that display frames into an Open Inventor viewer.
RemoteVizClient
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SoRemoteVizClient.BinaryMessageEventArg
Structure given when a received binary message event is raised.static class
SoRemoteVizClient.DisplayModes
Display mode value.static class
SoRemoteVizClient.FrameEventArg
Structure given when a received and decoded frame event is raised.static class
SoRemoteVizClient.KeyboardEventArg
Structure given when a keyboard event is raised.static class
SoRemoteVizClient.MessageEventArg
Structure given when a received text message event is raised.static class
SoRemoteVizClient.MouseButtonEventArg
Structure given when a mouse button event is raised.static class
SoRemoteVizClient.MouseLocationEventArg
Structure given when a mouse location event is raised.static class
SoRemoteVizClient.MouseWheelEventArg
Structure given when a mouse wheel event is raised.static class
SoRemoteVizClient.RenderAreaSizeEventArg
Structure given when a renderArea resize event is raised.static class
SoRemoteVizClient.SecurityProtocols
Each enumeration represents a security protocol.static class
SoRemoteVizClient.ServiceMessageEventArg
Structure given when a ServiceMessage event is raised.static class
SoRemoteVizClient.StreamingModes
Streaming mode values.static class
SoRemoteVizClient.TouchEventArg
Structure given when a touch event is raised.static class
SoRemoteVizClient.VideoDecoderType
Video decoder values.-
Nested classes/interfaces inherited from class com.openinventor.inventor.nodes.SoNode
SoNode.RenderModes
-
Nested classes/interfaces inherited from class com.openinventor.inventor.Inventor
Inventor.ConstructorCommand
-
-
Field Summary
Fields Modifier and Type Field Description SoSFBool
connect
Opens/Closes a connection between the client and the RemoteViz service.SoMFVec2String
connectionParameters
Connection parameters that will be sent to the RemoteViz service during the connection establishment.SoSFEnum<SoRemoteVizClient.DisplayModes>
displayMode
This setting allows you to specify how to map the renderArea image (server-side) into the container (client-side).SoSFString
ipAddress
Specifies the IP address of the RemoteViz Service to which the client will connect.SbEventHandler<SoRemoteVizClient.FrameEventArg>
onDecodedFrame
Triggered when a frame is decoded and displayed.SbEventHandler<SoRemoteVizClient.KeyboardEventArg>
onKeyboardEvent
Triggered when a keyboard event is fired on the client.SbEventHandler<SoRemoteVizClient.MouseButtonEventArg>
onMouseButtonEvent
Triggered when a mouse button event is fired on the client.SbEventHandler<SoRemoteVizClient.MouseLocationEventArg>
onMouseLocationEvent
Triggered when a mouse location event is fired on the client.SbEventHandler<SoRemoteVizClient.MouseWheelEventArg>
onMouseWheelEvent
Triggered when a mouse wheel event is fired on the client.SbEventHandler<SoRemoteVizClient.BinaryMessageEventArg>
onReceivedBinaryMessage
Triggered when a binary message is received from the RemoteViz service.SbEventHandler<SoRemoteVizClient.FrameEventArg>
onReceivedFrame
Triggered when a frame is received from the RemoteViz service.SbEventHandler<SoRemoteVizClient.MessageEventArg>
onReceivedMessage
Triggered when a text message is received from the RemoteViz service.SbEventHandler<SoRemoteVizClient.RenderAreaSizeEventArg>
onRenderAreaResize
Triggered when the renderArea has been resized.SbEventHandler<SoRemoteVizClient.ServiceMessageEventArg>
onServiceMessage
Triggered when a service message is received from the RemoteViz service.SbEventHandler<SoRemoteVizClient.TouchEventArg>
onTouchEvent
Triggered when a touch event is fired on the client.SoSFUShort
port
Specifies the port of the RemoteViz Service to which the client will connect.SoSFString
renderAreaName
Specifies the renderArea name to which the client will connect.SoMFEnum<SoRemoteVizClient.VideoDecoderType>
videoDecoders
This setting allows you to specify a preference list of video decoders.-
Fields inherited from class com.openinventor.inventor.Inventor
VERBOSE_LEVEL, ZeroHandle
-
-
Constructor Summary
Constructors Constructor Description SoRemoteVizClient()
Default constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
enableSecureConnection(java.lang.String publicCertificateFilePath, java.lang.String privateKeyFilePath)
Calls enableSecureConnection(publicCertificateFilePath, privateKeyFilePath, SoRemoteVizClient.SecurityProtocols.valueOf( SoRemoteVizClient.SecurityProtocols.TLSv1_1.getValue() | SoRemoteVizClient.SecurityProtocols.TLSv1_2.getValue() | SoRemoteVizClient.SecurityProtocols.TLSv1_3.getValue() ), "").void
enableSecureConnection(java.lang.String publicCertificateFilePath, java.lang.String privateKeyFilePath, SoRemoteVizClient.SecurityProtocols enabledSecurityProtocols)
Calls enableSecureConnection(publicCertificateFilePath, privateKeyFilePath, enabledSecurityProtocols, "").void
enableSecureConnection(java.lang.String publicCertificateFilePath, java.lang.String privateKeyFilePath, SoRemoteVizClient.SecurityProtocols enabledSecurityProtocols, java.lang.String privateKeyPassphrase)
Secures the connection between the client and the server.SbVec2s
getContainerSize()
Returns the size of the renderArea container.SoRemoteVizClient.SecurityProtocols
getEnabledSecurityProtocols()
Gets the security procotols used in RemoteViz.SbVec2s
getRenderAreaSize()
Returns the size of the renderArea managed by the RemoteViz service.SoRemoteVizClient.StreamingModes
getStreamingMode()
Returns the type of streaming currently used by the client.SoRemoteVizClient.VideoDecoderType
getVideoDecoder()
Returns the video decoder that has been successfully initialized and currently used by the client to decode video stream.boolean
isImageStreamingSupported()
Checks if the client supports image streaming.boolean
isSecureConnection()
Gets the SSL engine activation.boolean
isVideoStreamingSupported()
Checks if the client supports video streaming.void
requestRenderAreaSize(SbVec2s size)
Sends a request to resize the renderArea associated with the connection.void
sendMessage(SoCpuBufferObject buffer)
Sends a binary message to the server.void
sendMessage(java.lang.String message)
Sends a text message to the server.-
Methods inherited from class com.openinventor.inventor.nodes.SoNode
affectsState, callback, copy, copy, distribute, doAction, getAlternateRep, getBoundingBox, getByName, getMatrix, getPrimitiveCount, getRenderEngineMode, getRenderUnitID, GLRender, GLRenderBelowPath, GLRenderInPath, GLRenderOffPath, grabEventsCleanup, grabEventsSetup, handleEvent, isBoundingBoxIgnoring, isOverride, pick, rayPick, search, setOverride, touch, write
-
Methods inherited from class com.openinventor.inventor.fields.SoFieldContainer
copyFieldValues, copyFieldValues, enableNotify, fieldsAreEqual, get, getAllFields, getEventIn, getEventOut, getField, getFieldName, hasDefaultValues, isNotifyEnabled, set, setToDefaults
-
Methods inherited from class com.openinventor.inventor.misc.SoBase
dispose, getName, isDisposable, isSynchronizable, setName, setSynchronizable
-
Methods inherited from class com.openinventor.inventor.Inventor
getNativeResourceHandle
-
-
-
-
Field Detail
-
connect
public final SoSFBool connect
Opens/Closes a connection between the client and the RemoteViz service.
After being connected, the server-side onPendingCreateRenderArea callback will be triggered if the renderArea does not exist otherwise the server-side onPendingShareRenderArea callback will be triggered.
-
ipAddress
public final SoSFString ipAddress
Specifies the IP address of the RemoteViz Service to which the client will connect.
-
port
public final SoSFUShort port
Specifies the port of the RemoteViz Service to which the client will connect.
-
renderAreaName
public final SoSFString renderAreaName
Specifies the renderArea name to which the client will connect.
-
videoDecoders
public final SoMFEnum<SoRemoteVizClient.VideoDecoderType> videoDecoders
This setting allows you to specify a preference list of video decoders.
The first decoder (among the decoders of the list) successfully initialized will be used to decode the video stream.
If all decoders of the list fail to be initialized, the decoder VideoDecoder.OPENH264 will be used.
. Default is OPENH264.
-
connectionParameters
public final SoMFVec2String connectionParameters
Connection parameters that will be sent to the RemoteViz service during the connection establishment. The container size will be sent to the service as RenderArea requested size. This behavior can be overriden by including the requested height ("requestedHeight") and the requested width ("requestedWidth") in the parameters. If the connection is accepted, a server-side onRequestedSize callback will be triggered.
-
displayMode
public final SoSFEnum<SoRemoteVizClient.DisplayModes> displayMode
This setting allows you to specify how to map the renderArea image (server-side) into the container (client-side).
. Default is FIT.
-
onServiceMessage
public final SbEventHandler<SoRemoteVizClient.ServiceMessageEventArg> onServiceMessage
Triggered when a service message is received from the RemoteViz service.
-
onReceivedMessage
public final SbEventHandler<SoRemoteVizClient.MessageEventArg> onReceivedMessage
Triggered when a text message is received from the RemoteViz service.
-
onReceivedBinaryMessage
public final SbEventHandler<SoRemoteVizClient.BinaryMessageEventArg> onReceivedBinaryMessage
Triggered when a binary message is received from the RemoteViz service.
-
onRenderAreaResize
public final SbEventHandler<SoRemoteVizClient.RenderAreaSizeEventArg> onRenderAreaResize
Triggered when the renderArea has been resized.
-
onReceivedFrame
public final SbEventHandler<SoRemoteVizClient.FrameEventArg> onReceivedFrame
Triggered when a frame is received from the RemoteViz service.
-
onDecodedFrame
public final SbEventHandler<SoRemoteVizClient.FrameEventArg> onDecodedFrame
Triggered when a frame is decoded and displayed.
-
onMouseLocationEvent
public final SbEventHandler<SoRemoteVizClient.MouseLocationEventArg> onMouseLocationEvent
Triggered when a mouse location event is fired on the client.
-
onMouseButtonEvent
public final SbEventHandler<SoRemoteVizClient.MouseButtonEventArg> onMouseButtonEvent
Triggered when a mouse button event is fired on the client.
-
onMouseWheelEvent
public final SbEventHandler<SoRemoteVizClient.MouseWheelEventArg> onMouseWheelEvent
Triggered when a mouse wheel event is fired on the client.
-
onKeyboardEvent
public final SbEventHandler<SoRemoteVizClient.KeyboardEventArg> onKeyboardEvent
Triggered when a keyboard event is fired on the client.
-
onTouchEvent
public final SbEventHandler<SoRemoteVizClient.TouchEventArg> onTouchEvent
Triggered when a touch event is fired on the client.
-
-
Method Detail
-
enableSecureConnection
public void enableSecureConnection(java.lang.String publicCertificateFilePath, java.lang.String privateKeyFilePath)
Calls enableSecureConnection(publicCertificateFilePath, privateKeyFilePath, SoRemoteVizClient.SecurityProtocols.valueOf( SoRemoteVizClient.SecurityProtocols.TLSv1_1.getValue() | SoRemoteVizClient.SecurityProtocols.TLSv1_2.getValue() | SoRemoteVizClient.SecurityProtocols.TLSv1_3.getValue() ), "").
-
enableSecureConnection
public void enableSecureConnection(java.lang.String publicCertificateFilePath, java.lang.String privateKeyFilePath, SoRemoteVizClient.SecurityProtocols enabledSecurityProtocols)
Calls enableSecureConnection(publicCertificateFilePath, privateKeyFilePath, enabledSecurityProtocols, "").
-
sendMessage
public void sendMessage(SoCpuBufferObject buffer)
Sends a binary message to the server. After being sent, the server-side onReceivedMessage callback will be triggered.- Parameters:
buffer
- : buffer to be sent
-
sendMessage
public void sendMessage(java.lang.String message)
Sends a text message to the server. After being sent, the server-side onReceivedMessage callback will be triggered.- Parameters:
message
- : message to be sent
-
enableSecureConnection
public void enableSecureConnection(java.lang.String publicCertificateFilePath, java.lang.String privateKeyFilePath, SoRemoteVizClient.SecurityProtocols enabledSecurityProtocols, java.lang.String privateKeyPassphrase)
Secures the connection between the client and the server.- Parameters:
publicCertificateFilePath
- : Path to a file containing the public certificate used to authenticate the server to the clients. The certificate has to be a PEM ("Privacy Enhanced Mail") encoded certificate.privateKeyFilePath
- : Path to a file containing the private key used to sign the server key exchange between the client and the server.enabledSecurityProtocols
- : Defines the security protocols used to secure the exchange between the client and the server. By default, TLSv1.1, TLSv1.2 and TLSv1.3 protocols are enabled. A bitmask of the security protocols is used. Many security protocols can be enabled by using the logical OR operator.
privateKeyPassphrase
- : The passphrase that protect the private key. Security warning !! DO NOT hard-code the passphrase !!
Read it from a SECURE location on your system.
-
isImageStreamingSupported
public boolean isImageStreamingSupported()
Checks if the client supports image streaming.- Returns:
- true if the client supports image streaming
-
getContainerSize
public SbVec2s getContainerSize()
Returns the size of the renderArea container.- Returns:
- the renderArea container size
-
getVideoDecoder
public SoRemoteVizClient.VideoDecoderType getVideoDecoder()
Returns the video decoder that has been successfully initialized and currently used by the client to decode video stream.
This information is known after receiving the first frame. For instance, you can retrieve this information in the event callback onDecodedFrame.
If this method is called before receiving the first frame, it will return VideoDecoder.NONE. If the streaming mode is not StreamingMode.VIDEO (getStreamingMode
), this method will return VideoDecoder.NONE.- Returns:
- video decoder used by the client.
- See Also:
VideoDecoder
-
isVideoStreamingSupported
public boolean isVideoStreamingSupported()
Checks if the client supports video streaming.- Returns:
- true if the client supports video streaming
-
getRenderAreaSize
public SbVec2s getRenderAreaSize()
Returns the size of the renderArea managed by the RemoteViz service.- Returns:
- the renderArea size
-
getEnabledSecurityProtocols
public SoRemoteVizClient.SecurityProtocols getEnabledSecurityProtocols()
Gets the security procotols used in RemoteViz.
- Returns:
- the bitmask of used security protocols.
-
getStreamingMode
public SoRemoteVizClient.StreamingModes getStreamingMode()
Returns the type of streaming currently used by the client.
This information is known after receiving the first frame. For instance, you can retrieve this information in the event callback onDecodedFrame.
If this method is called before receiving the first frame, it will return StreamingMode.UNKNOWN.- Returns:
- streaming mode used by the client.
- See Also:
StreamingMode
-
requestRenderAreaSize
public void requestRenderAreaSize(SbVec2s size)
Sends a request to resize the renderArea associated with the connection. A server-side onRequestedSize event will be triggered.
If the renderarea size is modified in the server-side onRequestSize callback, the client-side resize event will be triggered.- Parameters:
size
- : renderArea size
-
isSecureConnection
public boolean isSecureConnection()
Gets the SSL engine activation.- Returns:
- true if the secure connection is enabled.
-
-