![]() |
ImFusion SDK 4.3
|
#include <ImFusion/Stream/OutStream.h>
Base class for streams which are sent by an OutputConnection through network or other ports. More...
Base class for streams which are sent by an OutputConnection through network or other ports.
Public Member Functions | |
OutStream (OutputConnection &con, const std::string &name) | |
Constructor with an OutputConnection instance and the name which is passed to Data. | |
virtual void | sendStreamData (const StreamData &streamData) const |
Passes the streamData to OutputConnection if the running flag is true. | |
bool | openImpl () override |
Open stream. | |
bool | closeImpl () override |
Close stream. | |
bool | startImpl () override |
Start stream. | |
bool | stopImpl () override |
Stop stream. | |
std::optional< WorkContinuation > | doWork () override |
Stop stream. | |
std::string | uuid () override |
Unique identifier for this stream. | |
![]() | |
Stream (const std::string &name="") | |
Constructor with the name for this stream. | |
virtual ThreadingMode | threadingMode () const |
Configures threading mode of stream. | |
virtual bool | supportsAsyncOperation () |
Returns true if xxxAsync() methods support execution in a background thread. | |
std::shared_future< bool > | openAsync () |
Open stream in an asynchronous fashion (wait on the returned future before taking further actions). Returns whether the operation was successful. | |
std::shared_future< bool > | closeAsync () |
Close stream in an asynchronous fashion (wait on the returned future before taking further actions). Returns whether the operation was successful. | |
std::shared_future< bool > | startAsync () |
Start stream in an asynchronous fashion (wait on the returned future before taking further actions). Returns whether the operation was successful. | |
std::shared_future< bool > | stopAsync () |
Stop stream in an asynchronous fashion (wait on the returned future before taking further actions). Returns whether the operation was successful. | |
std::shared_future< bool > | pauseAsync () |
Pause stream in an asynchronous fashion (wait on the returned future before taking further actions). Returns whether the operation was successful. | |
std::shared_future< bool > | resumeAsync () |
Resume stream in an asynchronous fashion (wait on the returned future before taking further actions). Returns whether the operation was successful. | |
bool | open () |
Open stream and wait for the operation to complete. Returns whether the operation was successful. | |
bool | close () |
Close stream and wait for the operation to complete. Returns whether the operation was successful. | |
bool | start () |
Start stream and wait for the operation to complete. Returns whether the operation was successful. | |
bool | stop () |
Stop stream and wait for the operation to complete. Returns whether the operation was successful. | |
bool | pause () |
Pause stream and wait for the operation to complete. Returns whether the operation was successful. | |
bool | resume () |
Resume stream and wait for the operation to complete. Returns whether the operation was successful. | |
virtual bool | supportsPausing () const |
Override and return true if this stream implements the pausing and resume operations. | |
bool | restart () |
Stops, closes, opens and starts the stream. Returns whether the operation was successful. | |
virtual bool | reset () |
Reverts stream to first frame, if possible. Returns whether the operation was successful. | |
virtual bool | isRunning () const |
Return whether stream is currently running. | |
State | currentState () const |
bool | isStateOneOf (const std::vector< State > &states) const |
Geometry::AlignedBox | bounds () const override |
Per default a Stream has empty/invalid bounds. | |
Pose::TransformationConvention | matrixConvention () const override |
Matrices of streams by default map to the world coordinate system. | |
virtual bool | createDefaultStreamController () |
Indicates whether a StreamController should be created for the stream (by default returns true). | |
double | updateRate () const |
Average update rate in Hz of the signalStreamData . | |
std::string | describe () const override |
Short description of the stream including latest state and update rate information. | |
![]() | |
Data (const std::string &name="") | |
Data (const Data &other) | |
Data & | operator= (const Data &other) |
virtual | ~Data () |
Mandatory virtual destructor. | |
virtual Kind | kind () const =0 |
Return the kind of this data. | |
virtual Modality | modality () const |
Return the modality of this data. | |
const std::string & | name () const |
Return the name of this data. | |
void | setName (const std::string &name) |
Sets the name of this data. | |
virtual bool | isAnnotationType () const |
Return whether this data type is visualized through an annotation (e.g. mesh) | |
const DataComponentList & | components () const |
Returns the list of DataComponents for this data. | |
DataComponentList & | components () |
virtual void | setMatrixFromWorld (const mat4 &m) |
Set matrix mapping from the world coordinate system to the data coordinate system. | |
virtual void | setMatrixToWorld (const mat4 &m) |
Set matrix mapping from the data coordinate system to the world coordinate system. | |
virtual mat4 | matrixFromWorld () const |
Get matrix mapping from the world coordinate system to the data coordinate system. | |
virtual mat4 | matrixToWorld () const |
Get matrix mapping from the data coordinate system to the world coordinate system. | |
virtual mat4 | matrix () const |
Return the transformation matrix. | |
virtual void | setMatrix (const mat4 &m) |
Set the transformation matrix. | |
![]() | |
virtual void | configure (const Properties *p) |
Configure this object instance by de-serializing the given Properties. | |
virtual void | configuration (Properties *p) const |
Serialize the current object configuration into the given Properties object. | |
virtual void | configureDefaults () |
Retrieve the properties of this object, replaces values with their defaults and sets it again. | |
void | registerParameter (ParameterBase *param) |
Register the given Parameter or SubProperty, so that it will be configured during configure()/configuration(). | |
void | unregisterParameter (const ParameterBase *param) |
Remove the given Parameter or SubProperty from the list of registered parameters. | |
Configurable (const Configurable &rhs) | |
Configurable (Configurable &&rhs) noexcept | |
Configurable & | operator= (const Configurable &) |
Configurable & | operator= (Configurable &&) noexcept |
Protected Attributes | |
OutputConnection & | m_connection |
![]() | |
mat4 | m_matrix |
Transformation matrix. | |
std::recursive_mutex * | m_matrixMutex |
Used to internally synchronize access to the matrix of data. | |
DataComponentList | m_dataComponentList |
The list of DataComponents for this data. | |
![]() | |
std::vector< Param > | m_params |
List of all registered Parameter and SubProperty instances. | |
Additional Inherited Members | |
![]() | |
enum class | ThreadingMode { BaseClassRunsWorkerThread , DerivedClassHandlesThreading } |
This flag represents the two supported threading modes of a Stream. More... | |
enum class | State { Closed , Opening , Open , Starting , Running , Pausing , Paused , Resuming , Stopping , Closing } |
![]() | |
enum | Kind { UNKNOWN = 0 , IMAGE = 1 , VOLUME = 2 , IMAGESET = 3 , VOLUMESET = 4 , IMAGESTREAM = 5 , VOLUMESTREAM = 6 , POINTSET = 7 , SURFACE = 8 , TRACKINGSTREAM = 9 , LIVETRACKINGSTREAM = TRACKINGSTREAM , TRACKINGDATA = 10 , TREE = 11 , TENSOR = 12 , POLYDATASTREAM = 13 , STEREOIMAGESET = 14 , STEREOIMAGESTREAM = 15 , VOLUMETRICMESH = 16 } |
Kind of data. More... | |
enum | Modality { NA = 0 , XRAY = 1 , CT = 2 , MRI = 3 , ULTRASOUND = 4 , VIDEO = 5 , NM = 6 , OCT = 7 , LABEL = 8 , DISTANCE = 9 } |
Image modality of the data. More... | |
![]() | |
static std::string | stateToString (State state) |
![]() | |
static std::string | modalityString (Data::Modality m) |
Return the name of an image modality. | |
static Data::Modality | stringToModality (const std::string &s) |
Returns the modality corresponding to a modality string or NA if nothing matches. | |
![]() | |
ProtectedSignal< StateChange > | signalStateChanged |
Emitted after a state change has been completed with the old and new state. | |
ProtectedSignal | signalEnded |
Indicates that the stream reached the end of its data, e.g. when a video stream has played to the end. | |
ProtectedSignal< std::shared_ptr< const StreamData > > | signalStreamData |
Signal that is emitted by the stream when a new StreamData is available. | |
DeprecatedSignal< ProtectedSignal< std::shared_ptr< const StreamData > >, const StreamData & > | signalNewData |
Signal that is emitted by the stream when a new StreamData is available. | |
![]() | |
Signal< const Data * > | signalDeleted |
Signal emitted when this instance is deleted. | |
Signal< const Data * > | signalMatrixChanged |
Signal emitted when the transformation of this Data has changed. | |
Signal< std::string > | signalNameChanged |
Signal emitted when the name changed. | |
![]() | |
Signal | signalParametersChanged |
Emitted whenever one of the registered Parameters' or SubPropertys' signalValueChanged signal was emitted. | |
![]() | |
virtual bool | pauseImpl () |
Pause stream (not required to be supported). | |
virtual bool | resumeImpl () |
Resume stream from pause (only required to be supported when pauseImpl() is supported). | |
virtual bool | workerThreadRequiresOpenGl () const |
Override and return true if worker thread should create a GL::Context. | |
virtual bool | worksWhilePaused () const |
Override if doWork() should be called also in the Paused state. | |
void | changeState (State newState) |
std::shared_future< bool > | attemptStateChange (std::function< bool()> work, State stateWorking, State stateSuccess, State stateError) |
![]() | |
void | swapWith (Data &other) |
Swaps the data and emits a matrix and name changed signal for both. | |
|
virtual |
Passes the streamData
to OutputConnection if the running flag is true.
Reimplemented in IgtlImageOutStream, IgtlPolyDataOutStream, IgtlTrackingOutStream, ROSTopicImageOutStream, and ROSTopicTrackingOutStream.
|
inlineoverridevirtual |
Open stream.
Implements Stream.
Reimplemented in ROSTopicImageOutStream, and ROSTopicTrackingOutStream.
|
inlineoverridevirtual |
Close stream.
Implements Stream.
Reimplemented in ROSTopicImageOutStream, and ROSTopicTrackingOutStream.
|
inlineoverridevirtual |
Start stream.
Implements Stream.
Reimplemented in ROSTopicImageOutStream, and ROSTopicTrackingOutStream.
|
inlineoverridevirtual |
Stop stream.
Implements Stream.
Reimplemented in ROSTopicImageOutStream, and ROSTopicTrackingOutStream.
|
inlineoverridevirtual |
Stop stream.
Implements Stream.
|
overridevirtual |
Unique identifier for this stream.
Implements Stream.
Reimplemented in ROSTopicImageOutStream, and ROSTopicTrackingOutStream.