Package algorithm
Class TrackingService
java.lang.Object
algorithm.TrackingService
This class is used to manage the access to the OpenIGTLink-Connection and therefore to the trackers.
It is a singleton in order to provide the same reference to all users.
It should be used to get the reference to the currently active TrackingService, DataService and Timeline.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
changeDataService
(DataService dataService) Sets the reference to the data service.void
changeTimeline
(javafx.animation.Timeline timeline) Sets the reference to the timeline object.void
changeTrackingSource
(AbstractTrackingDataSource trackingDataSource) Sets the reference to the tracking source.Returns the reference to the data servicestatic TrackingService
Returns the instance.javafx.animation.Timeline
Returns the reference to the timelineReturns the reference to the tracking sourcevoid
registerObserver
(TrackingServiceObserver observer) Register an observer.
-
Method Details
-
getInstance
Returns the instance. This class is a singleton, which means that there only is one and the same instance at a time.- Returns:
- The instance
-
registerObserver
Register an observer. Observers are triggered when the references to any attribute are changed.- Parameters:
observer
- The observer that shall be triggered
-
changeTrackingSource
Sets the reference to the tracking source.- Parameters:
trackingDataSource
- The new tracking source
-
changeDataService
Sets the reference to the data service.- Parameters:
dataService
- the new dataservice
-
changeTimeline
public void changeTimeline(javafx.animation.Timeline timeline) Sets the reference to the timeline object.- Parameters:
timeline
- The new timeline
-
getTrackingDataSource
Returns the reference to the tracking source- Returns:
- The currently active tracking source
-
getDataService
Returns the reference to the data service- Returns:
- The currently active data service
-
getTimeline
public javafx.animation.Timeline getTimeline()Returns the reference to the timeline- Returns:
- The currently active timeline
-