Open Inventor Release 2024.2.0
 
Loading...
Searching...
No Matches
SoRemoteVizClient.h
1/*=======================================================================
2*** THE CONTENT OF THIS WORK IS PROPRIETARY TO FEI S.A.S, (FEI S.A.S.), ***
3*** AND IS DISTRIBUTED UNDER A LICENSE AGREEMENT. ***
4*** ***
5*** REPRODUCTION, DISCLOSURE, OR USE, IN WHOLE OR IN PART, OTHER THAN AS ***
6*** SPECIFIED IN THE LICENSE ARE NOT TO BE UNDERTAKEN EXCEPT WITH PRIOR ***
7*** WRITTEN AUTHORIZATION OF FEI S.A.S. ***
8*** ***
9*** RESTRICTED RIGHTS LEGEND ***
10*** USE, DUPLICATION, OR DISCLOSURE BY THE GOVERNMENT OF THE CONTENT OF THIS ***
11*** WORK OR RELATED DOCUMENTATION IS SUBJECT TO RESTRICTIONS AS SET FORTH IN ***
12*** SUBPARAGRAPH (C)(1) OF THE COMMERCIAL COMPUTER SOFTWARE RESTRICTED RIGHT ***
13*** CLAUSE AT FAR 52.227-19 OR SUBPARAGRAPH (C)(1)(II) OF THE RIGHTS IN ***
14*** TECHNICAL DATA AND COMPUTER SOFTWARE CLAUSE AT DFARS 52.227-7013. ***
15*** ***
16*** COPYRIGHT (C) 1996-2020 BY FEI S.A.S, ***
17*** BORDEAUX, FRANCE ***
18*** ALL RIGHTS RESERVED ***
19**=======================================================================*/
20
21#ifndef _SO_REMOTEVIZ_CLIENT_
22#define _SO_REMOTEVIZ_CLIENT_
23
24#include <Inventor/sys/port.h>
25#include <RemoteViz/Clients/nodes/LibHelper.h>
26
27#include <Inventor/SbPImpl.h>
28#include <Inventor/SbString.h>
29#include <Inventor/SbVec.h>
30#include <Inventor/fields/SoSFString.h>
31#include <Inventor/fields/SoSFUShort.h>
32#include <Inventor/fields/SoSFBool.h>
33#include <Inventor/fields/SoMFVec2String.h>
34#include <Inventor/fields/SoSFEnum.h>
35#include <Inventor/fields/SoMFEnum.h>
36#include <Inventor/nodes/SoNode.h>
37#include <Inventor/SbEventHandler.h>
38#include <Inventor/SbEventArg.h>
39#include <Inventor/devices/SoCpuBufferObject.h>
40
44class SoKeyboardEvent;
45class SoTouchEvent;
46
47SO_PIMPL_BASE_PUBLIC_DECLARATION(SoRemoteVizClient);
48
66class RVCLIENT_API SoRemoteVizClient : public SoNode
67{
68
69 SO_NODE_HEADER(SoRemoteVizClient);
70
71 SO_PIMPL_BASE_PUBLIC_HEADER(SoRemoteVizClient);
72
73public:
74
88 FIT
89 };
90
121
124 {
125 /* The streaming mode is not yet known. */
127 /* The client uses image streaming. */
129 /* The client uses video streaming. */
130 VIDEO
131 };
132
137
142
143 // Fields:
144
151
157
163
169
177
186
192
198 void sendMessage(const SbString& message);
199
206
224 void enableSecureConnection(const SbString& publicCertificateFilePath, const SbString& privateKeyFilePath, unsigned int enabledSecurityProtocols = TLSv1_1 | TLSv1_2 | TLSv1_3, const SbString& privateKeyPassphrase = "");
225
230 {
231 SSLv2 = 0x1, // 2^0, bit 0
232 SSLv3 = 0x2, // 2^1, bit 1
233 TLSv1 = 0x4, // 2^2, bit 2
234 TLSv1_1 = 0x8, // 2^3, bit 3
235 TLSv1_2 = 0x10, // 2^4, bit 4
236 TLSv1_3 = 0x20 // 2^5, bit 5
237 };
238
245 unsigned int getEnabledSecurityProtocols() const;
246
252 bool isSecureConnection() const;
253
261
268
275
282
289
299
308
314 struct RVCLIENT_API ServiceMessageEventArg : public SbEventArg
315 {
337
339 ServiceMessageEventArg(SoRemoteVizClient* source, State state, SbVec2s renderAreaSize, const SbString& details)
340 : m_source( source ), m_state( state ), m_renderAreaSize( renderAreaSize ), m_details( &details ) {}
341
343 SoRemoteVizClient* getSource() const { return m_source; }
344
346 State getState() const { return m_state; }
347
349 const SbVec2s& getRenderAreaSize() const { return m_renderAreaSize; }
350
361 const SbString& getDetails() const { return *m_details; }
362
363 private:
364 SoRemoteVizClient* m_source;
365 State m_state;
366 SbVec2s m_renderAreaSize;
367 const SbString* m_details;
368 };
369
375 struct RVCLIENT_API MessageEventArg : public SbEventArg
376 {
379 : m_source(source), m_message(&message) {}
380
382 SoRemoteVizClient* getSource() const { return m_source; }
383
385 const SbString& getMessage() const { return *m_message; }
386
387 private:
388 SoRemoteVizClient* m_source;
389 const SbString* m_message;
390 };
391
397 struct RVCLIENT_API BinaryMessageEventArg : public SbEventArg
398 {
401 : m_source(source), m_buffer(buffer) {}
402
404 SoRemoteVizClient* getSource() const {return m_source;}
405
407 SoCpuBufferObject* getBuffer() const {return m_buffer;}
408
409 private:
410 SoRemoteVizClient* m_source;
411 SoCpuBufferObject* m_buffer;
412 };
413
419 struct RVCLIENT_API RenderAreaSizeEventArg : public SbEventArg
420 {
423 : m_source(source), m_size(size) {}
424
426 SoRemoteVizClient* getSource() const { return m_source; }
427
429 const SbVec2s& getSize() const { return m_size; }
430
431 private:
432 SoRemoteVizClient* m_source;
433 SbVec2s m_size;
434 };
435
441 struct RVCLIENT_API FrameEventArg : public SbEventArg
442 {
444 FrameEventArg(SoRemoteVizClient* source, uint64_t id, uint64_t dataLength, bool isLossless, const SbString& message)
445 : m_source(source), m_id(id), m_dataLength(dataLength), m_isLossless(isLossless), m_message(&message) {}
446
448 SoRemoteVizClient* getSource() const { return m_source; }
449
451 uint64_t getId() const { return m_id; }
452
454 uint64_t getDataLength() const { return m_dataLength; }
455
457 bool isLossless() const { return m_isLossless; }
458
460 const SbString& getMessage() const { return *m_message; }
461
462 private:
463 SoRemoteVizClient* m_source;
464 uint64_t m_id;
465 uint64_t m_dataLength;
466 bool m_isLossless;
467 const SbString* m_message;
468 };
469
475 struct RVCLIENT_API MouseLocationEventArg : public SbEventArg
476 {
479 : m_source(source), m_mouseLocationEvent(mouseLocationEvent) {}
480
482 SoRemoteVizClient* getSource() const { return m_source; }
483
485 SoLocation2Event* getMouseLocationEvent() const { return m_mouseLocationEvent; }
486
487 private:
488 SoRemoteVizClient* m_source;
489 SoLocation2Event* m_mouseLocationEvent;
490 };
491
497 struct RVCLIENT_API MouseButtonEventArg : public SbEventArg
498 {
501 : m_source(source), m_mouseButtonEvent(mouseButtonEvent) {}
502
504 SoRemoteVizClient* getSource() const { return m_source; }
505
507 SoMouseButtonEvent* getMouseButtonEvent() const { return m_mouseButtonEvent; }
508
509 private:
510 SoRemoteVizClient* m_source;
511 SoMouseButtonEvent* m_mouseButtonEvent;
512 };
513
519 struct RVCLIENT_API MouseWheelEventArg : public SbEventArg
520 {
523 : m_source(source), m_mouseWheelEvent(mouseWheelEvent) {}
524
526 SoRemoteVizClient* getSource() const { return m_source; }
527
529 SoMouseWheelEvent* getMouseWheelEvent() const { return m_mouseWheelEvent; }
530
531 private:
532 SoRemoteVizClient* m_source;
533 SoMouseWheelEvent* m_mouseWheelEvent;
534 };
535
541 struct RVCLIENT_API KeyboardEventArg : public SbEventArg
542 {
545 : m_source(source), m_keyboardEvent(keyboardEvent) {}
546
548 SoRemoteVizClient* getSource() const { return m_source; }
549
551 SoKeyboardEvent* getKeyboardEvent() const { return m_keyboardEvent; }
552
553 private:
554 SoRemoteVizClient* m_source;
555 SoKeyboardEvent* m_keyboardEvent;
556 };
557
563 struct RVCLIENT_API TouchEventArg : public SbEventArg
564 {
567 : m_source(source), m_touchEvent(touchEvent) {}
568
570 SoRemoteVizClient* getSource() const { return m_source; }
571
573 SoTouchEvent* getTouchEvent() const { return m_touchEvent; }
574
575 private:
576 SoRemoteVizClient* m_source;
577 SoTouchEvent* m_touchEvent;
578 };
579
584
589
594
599
604
609
614
619
624
629
634
635 private:
636 // Initializes this class
637 static void initClass();
638 static void exitClass();
639
640private:
644 virtual void notify(SoNotList *list);
645
649 virtual void doAction(SoAction *action);
650
654 virtual void GLRender(SoGLRenderAction *action);
655
659 virtual void handleEvent(SoHandleEventAction *action);
660
661
662private:
663
664 void construct();
665};
666
667#endif // _SO_REMOTEVIZ_CLIENT_
668
Base class for all event arguments.
Definition SbEventArg.h:41
Class representing an event.
Class for smart character strings.
Definition SbString.h:202
2D vector class.
Definition SbVec.h:700
Abstract base class for all actions.
Definition SoAction.h:132
<a href="IconLegend.html"><img src="extTGS.gif" alt="VSG extension" border="0"></a> CPU buffer objec...
Renders a scene graph using Open Inventor's Render Engine.
Allows nodes in a graph to receive input events.
Keyboard key press and release events.
2D location events.
Multiple-value field containing any number of enumerated type values.
Definition SoMFEnum.h:95
Multiple-value field containing any number of two-dimensional string vectors.
Mouse button press and release events.
Mouse wheel events.
Abstract base class for all database nodes.
Definition SoNode.h:145
<a href="IconLegend.html"><img src="extRV.gif" alt="RemoteViz" border="0"></a> Client node enables t...
SbEventHandler< KeyboardEventArg & > onKeyboardEvent
Triggered when a keyboard event is fired on the client.
bool isVideoStreamingSupported() const
Checks if the client supports video streaming.
StreamingMode
Streaming mode values.
SecurityProtocols
Each enumeration represents a security protocol.
virtual ~SoRemoteVizClient()
Default destructor.
SbEventHandler< FrameEventArg & > onDecodedFrame
Triggered when a frame is decoded and displayed.
DisplayMode
Display mode value.
@ STRETCH
Stretches the image to fill the container.
@ CROP
The image is cropped more or less (depending on the container size and the renderArea size) to keep t...
void requestRenderAreaSize(const SbVec2s &size)
Sends a request to resize the renderArea associated with the connection.
StreamingMode getStreamingMode() const
Returns the type of streaming currently used by the client.
bool isSecureConnection() const
Gets the SSL engine activation.
void sendMessage(SoCpuBufferObject *buffer)
Sends a binary message to the server.
SbVec2s getRenderAreaSize() const
Returns the size of the renderArea managed by the RemoteViz service.
SoSFBool connect
Opens/Closes a connection between the client and the RemoteViz service.
SbEventHandler< MessageEventArg & > onReceivedMessage
Triggered when a text message is received from the RemoteViz service.
VideoDecoder
Video decoder values.
@ NONE
The video decoder is not yet initialized or the streaming mode is not StreamingMode::VIDEO.
@ NVDECODE
NVIDIA Video Codec enables to use an NVIDIA GPU for H.264 and VP9 hardware accelerated decoding.
@ INTEL_QUICKSYNC
Intel QuickSync enables to use an Intel CPU or GPU for H.264 and VP9 hardware accelerated decoding.
@ OPENH264
OpenH264 is a H.264 software decoding implementation.
SbEventHandler< MouseButtonEventArg & > onMouseButtonEvent
Triggered when a mouse button event is fired on the client.
SbEventHandler< BinaryMessageEventArg & > onReceivedBinaryMessage
Triggered when a binary message is received from the RemoteViz service.
SoSFEnum displayMode
This setting allows you to specify how to map the renderArea image (server-side) into the container (...
void sendMessage(const SbString &message)
Sends a text message to the server.
bool isImageStreamingSupported() const
Checks if the client supports image streaming.
SbEventHandler< TouchEventArg & > onTouchEvent
Triggered when a touch event is fired on the client.
SoSFString renderAreaName
Specifies the renderArea name to which the client will connect.
VideoDecoder getVideoDecoder() const
Returns the video decoder that has been successfully initialized and currently used by the client to ...
SbEventHandler< RenderAreaSizeEventArg & > onRenderAreaResize
Triggered when the renderArea has been resized.
SbEventHandler< ServiceMessageEventArg & > onServiceMessage
Triggered when a service message is received from the RemoteViz service.
SoMFEnum videoDecoders
This setting allows you to specify a preference list of video decoders.
SoSFUShort port
Specifies the port of the RemoteViz Service to which the client will connect.
void enableSecureConnection(const SbString &publicCertificateFilePath, const SbString &privateKeyFilePath, unsigned int enabledSecurityProtocols=TLSv1_1|TLSv1_2|TLSv1_3, const SbString &privateKeyPassphrase="")
Secures the connection between the client and the server.
SbEventHandler< MouseWheelEventArg & > onMouseWheelEvent
Triggered when a mouse wheel event is fired on the client.
SoSFString ipAddress
Specifies the IP address of the RemoteViz Service to which the client will connect.
SbVec2s getContainerSize() const
Returns the size of the renderArea container.
SoRemoteVizClient()
Default constructor.
SoMFVec2String connectionParameters
Connection parameters that will be sent to the RemoteViz service during the connection establishment.
SbEventHandler< FrameEventArg & > onReceivedFrame
Triggered when a frame is received from the RemoteViz service.
SbEventHandler< MouseLocationEventArg & > onMouseLocationEvent
Triggered when a mouse location event is fired on the client.
unsigned int getEnabledSecurityProtocols() const
Gets the security procotols used in RemoteViz.
Field containing a single Boolean value.
Definition SoSFBool.h:79
Field containing an enumerated value.
Definition SoSFEnum.h:89
Field containing a string.
Definition SoSFString.h:117
Field containing an unsigned short integer.
Definition SoSFUShort.h:79
Base class for touch events.
Structure given when a received binary message event is raised.
SoRemoteVizClient * getSource() const
Returns the SoRemoteVizClient node that triggered the event.
BinaryMessageEventArg(SoRemoteVizClient *source, SoCpuBufferObject *buffer)
Default constructor.
SoCpuBufferObject * getBuffer() const
Returns the received message.
Structure given when a received and decoded frame event is raised.
SoRemoteVizClient * getSource() const
Returns the SoRemoteVizClient node that triggered the event.
const SbString & getMessage() const
Returns the attached message.
uint64_t getDataLength() const
Returns the frame data length.
FrameEventArg(SoRemoteVizClient *source, uint64_t id, uint64_t dataLength, bool isLossless, const SbString &message)
Default constructor.
bool isLossless() const
Returns if the frame encoding is lossless.
uint64_t getId() const
Returns the frame ID.
Structure given when a keyboard event is raised.
SoKeyboardEvent * getKeyboardEvent() const
Returns the keyboard event.
KeyboardEventArg(SoRemoteVizClient *source, SoKeyboardEvent *keyboardEvent)
Default constructor.
SoRemoteVizClient * getSource() const
Returns the SoRemoteVizClient node that triggered the event.
Structure given when a received text message event is raised.
MessageEventArg(SoRemoteVizClient *source, const SbString &message)
Default constructor.
SoRemoteVizClient * getSource() const
Returns the SoRemoteVizClient node that triggered the event.
const SbString & getMessage() const
Returns the received message.
Structure given when a mouse button event is raised.
MouseButtonEventArg(SoRemoteVizClient *source, SoMouseButtonEvent *mouseButtonEvent)
Default constructor.
SoRemoteVizClient * getSource() const
Returns the SoRemoteVizClient node that triggered the event.
SoMouseButtonEvent * getMouseButtonEvent() const
Returns the mouse button event.
Structure given when a mouse location event is raised.
SoRemoteVizClient * getSource() const
Returns the SoRemoteVizClient node that triggered the event.
MouseLocationEventArg(SoRemoteVizClient *source, SoLocation2Event *mouseLocationEvent)
Default constructor.
SoLocation2Event * getMouseLocationEvent() const
Returns the mouse location event.
Structure given when a mouse wheel event is raised.
SoMouseWheelEvent * getMouseWheelEvent() const
Returns the mouse wheel event.
SoRemoteVizClient * getSource() const
Returns the SoRemoteVizClient node that triggered the event.
MouseWheelEventArg(SoRemoteVizClient *source, SoMouseWheelEvent *mouseWheelEvent)
Default constructor.
Structure given when a renderArea resize event is raised.
const SbVec2s & getSize() const
Returns the renderArea size.
SoRemoteVizClient * getSource() const
Returns the SoRemoteVizClient node that triggered the event.
RenderAreaSizeEventArg(SoRemoteVizClient *source, SbVec2s size)
Default constructor.
Structure given when a ServiceMessage event is raised.
const SbVec2s & getRenderAreaSize() const
Returns the renderArea size.
State getState() const
Returns the connection state with the service.
@ DISCONNECTED
Disconnected from the service.
@ FINISH_NETWORK_CALIBRATION
The network calibration is finished.
@ FINISH_BANDWIDTH_CALIBRATION
The network bandwidth calibration is finished.
@ START_NETWORK_CALIBRATION
The network calibration is started.
@ START_LATENCY_CALIBRATION
The network latency calibration is started.
@ FINISH_LATENCY_CALIBRATION
The network latency calibration is finished.
@ START_BANDWIDTH_CALIBRATION
The network bandwidth calibration is started.
const SbString & getDetails() const
Returns details of the event.
SoRemoteVizClient * getSource() const
Returns the SoRemoteVizClient node that triggered the event.
ServiceMessageEventArg(SoRemoteVizClient *source, State state, SbVec2s renderAreaSize, const SbString &details)
Default constructor.
Structure given when a touch event is raised.
TouchEventArg(SoRemoteVizClient *source, SoTouchEvent *touchEvent)
Default constructor.
SoRemoteVizClient * getSource() const
Returns the SoRemoteVizClient node that triggered the event.
SoTouchEvent * getTouchEvent() const
Returns the touch event.