PST SDK  6.0.0.0-272350a
pstsdk_cpp.h
Go to the documentation of this file.
1 // Copyright PS-Tech B.V. All Rights Reserved.
2 
3 #pragma once
4 
5 #include "PstBase.h"
6 #include "PstString.h"
7 #include "PstVector.h"
8 #include "PstArray.h"
9 #include "PstTypes.h"
10 
11 namespace PSTech
12 {
13 namespace pstsdk
14 {
35  class Listener
36  {
37  public:
47  virtual void OnTrackerData(const TrackerData& data) { }
48 
59  virtual void OnTrackerMode(const TrackerMode mode) { }
60  virtual ~Listener() { }
61  };
62 
71 
79  PST_EXPORT const char* GetSdkVersion();
80 
88  {
89  public:
110  Tracker(const Utils::PstString& path = "", const Utils::PstString& config_file = "server.cfg",
111  const Utils::PstString& db_file = "models.db", const Utils::PstString& grabber_name = "default");
112  ~Tracker();
113 
128  void LoadCalibrationFromLocalPath(const Utils::PstString& path);
129 
142  TrackerData GetSingleMeasurement() const;
143 
152  Utils::PstVector<Utils::PstString> GetConnectedCameraUrls(bool silent = false) const;
153 
164  Utils::PstVector<Utils::PstString> GetUncalibratedCameraUrls(bool silent = false);
165 
175  Utils::PstString GetVersionInfo() const;
176 
185  Utils::PstString GetConfigPath() const;
186 
187 
200  void AddTrackerListener(Listener* listener);
201 
212  void RemoveTrackerListener(Listener* listener);
213 
221  void Start();
222 
231  void Pause();
232 
244  static void Shutdown();
245 
257  StatusMessage Systemcheck() const;
258 
259 
272  void SetFramerate(double fps);
273 
284  double GetFramerate() const;
285 
299  Utils::PstVector<float> GetSupportedFramerates() const;
300 
315  void SetExposure(double time);
316 
326  double GetExposure() const;
327 
344  void GetExposureRange(double& min, double& max) const;
345 
362  void EnableFiltering();
363 
372  void DisableFiltering();
373 
385  void SetPositionFilter(double value);
386 
398  void SetOrientationFilter(double value);
399 
414  void EnableTremorFilter();
415 
424  void DisableTremorFilter();
425 
426 
439  void EnableImageTransfer();
440 
449  void DisableImageTransfer();
450 
464  bool GetImage(Image& image) const;
465 
466 
479  TargetStatuses GetTargetList() const;
480 
493  Target GetTargetInfo(const Utils::PstString& name) const;
494 
509  void SetTargetStatus(const Utils::PstString& name, bool active);
510 
525  bool GetTargetStatus(const Utils::PstString& name) const;
526 
541  MarkerList GetTargetMarkers(const Utils::PstString& name) const;
542 
555  void SetTargetId(const Utils::PstString& name, int id);
556 
575  void SetReference(const Utils::PstArray<float, 16>& reference, bool relative = false);
576 
587  void SetDefaultReference();
588 
602  Utils::PstArray<float, 16> GetReference() const;
603 
629  static void EnableSharedMemory();
630 
638  static void DisableSharedMemory();
639 
660  static void EnableRestServer(const Utils::PstString& server_address, const Utils::PstString& server_port, int eventStream_retry_timeout_ms = 3000);
661 
670  static void DisableRestServer();
671 
687  void ImportJSONModel(const Utils::PstString& json_model);
688 
703  Utils::PstString ExportJSONModel(const Utils::PstString& model_name) const;
704 
717  void RemoveTargetModel(const Utils::PstString& model_name);
718  };
720 }
721 }
PSTech::pstsdk::Tracker
Main PST SDK class implementing tracker communication.
Definition: pstsdk_cpp.h:87
PSTech::Utils::PstVector
Basic vector class, cloning std::vector<T>.
Definition: PstVector.h:29
PstArray.h
PSTech::Utils::PstArray< float, 16 >
PstTypes.h
PSTech::pstsdk::TrackerData
Tracking information retrieved from tracker.
Definition: PstTypes.h:157
PSTech::pstsdk::Listener
Abstract listener class for receiving tracking information and tracking mode updates.
Definition: pstsdk_cpp.h:35
PstBase.h
PST_EXPORT
#define PST_EXPORT
Definition: PstBase.h:12
PstString.h
PSTech::pstsdk::Listener::OnTrackerMode
virtual void OnTrackerMode(const TrackerMode mode)
Callback function receiving tracking mode updates from the the tracker.
Definition: pstsdk_cpp.h:59
PSTech::pstsdk::EnableLogging
void EnableLogging()
Write plug-in status information to the standard C output stream stderr.
PSTech::pstsdk::GetSdkVersion
const char * GetSdkVersion()
Retrieve the SDK version string.
PSTech::pstsdk::StatusMessage
StatusMessage
Tracker status messages enum class.
Definition: PstTypes.h:172
PSTech::pstsdk::Image
Images retrieved from the tracker.
Definition: PstTypes.h:27
PSTech::pstsdk::TrackerMode
TrackerMode
Tracker mode enum class.
Definition: PstTypes.h:193
PSTech::pstsdk::Listener::OnTrackerData
virtual void OnTrackerData(const TrackerData &data)
Callback function receiving tracking information from the tracker.
Definition: pstsdk_cpp.h:47
PSTech::pstsdk::Target
Tracking target information.
Definition: PstTypes.h:41
PSTech::Utils::PstString
Definition: PstString.h:17
PSTech
Definition: ExportedTypeConversions.h:8
PstVector.h
PSTech::pstsdk::Listener::~Listener
virtual ~Listener()
Definition: pstsdk_cpp.h:60