12 #pragma warning (disable : 4251) 17 #define DLL_EXPORT __declspec(dllexport) 23 #define DEFAULT_AUTO_DESCOVER_PORT 22226 24 #define WAIT_FOR_DATA_TIMEOUT 5000000 // 5 s 31 static const unsigned int cComponent3d = 0x000001;
32 static const unsigned int cComponent3dNoLabels = 0x000002;
33 static const unsigned int cComponentAnalog = 0x000004;
34 static const unsigned int cComponentForce = 0x000008;
35 static const unsigned int cComponent6d = 0x000010;
36 static const unsigned int cComponent6dEuler = 0x000020;
37 static const unsigned int cComponent2d = 0x000040;
38 static const unsigned int cComponent2dLin = 0x000080;
39 static const unsigned int cComponent3dRes = 0x000100;
40 static const unsigned int cComponent3dNoLabelsRes = 0x000200;
41 static const unsigned int cComponent6dRes = 0x000400;
42 static const unsigned int cComponent6dEulerRes = 0x000800;
43 static const unsigned int cComponentAnalogSingle = 0x001000;
44 static const unsigned int cComponentImage = 0x002000;
45 static const unsigned int cComponentForceSingle = 0x004000;
46 static const unsigned int cComponentGazeVector = 0x008000;
47 static const unsigned int cComponentTimecode = 0x010000;
48 static const unsigned int cComponentSkeleton = 0x020000;
53 mAnalogChannels(nullptr),
54 mSkeletonGlobalData(false)
66 RateFrequencyDivisor = 3
72 ModelProReflex120 = 1,
73 ModelProReflex240 = 2,
74 ModelProReflex500 = 3,
75 ModelProReflex1000 = 4,
82 ModelOqus500Plus = 11,
84 ModelOqus700Plus = 13,
85 ModelOqus600Plus = 14,
89 ModelMiqusSyncUnit = 18,
91 ModelMiqusVideoColor = 20
104 ModeMarkerIntensity = 1,
110 VideoResolution1080p = 0,
111 VideoResolution720p = 1,
112 VideoResolution540p = 2,
113 VideoResolution480p = 3,
114 VideoResolutionNone = 4
119 VideoAspectRatio16x9 = 0,
120 VideoAspectRatio4x3 = 1,
121 VideoAspectRatio1x1 = 2,
122 VideoAspectRatioNone = 3
137 SourceControlPort = 0,
138 SourceIRReceiver = 1,
156 ProcessingNone = 0x0000,
157 ProcessingTracking2D = 0x0001,
158 ProcessingTracking3D = 0x0002,
159 ProcessingTwinSystemMerge = 0x0004,
160 ProcessingSplineFill = 0x0008,
161 ProcessingAIM = 0x0010,
162 Processing6DOFTracking = 0x0020,
163 ProcessingForceData = 0x0040,
164 ProcessingGazeVector = 0x0080,
165 ProcessingExportTSV = 0x0100,
166 ProcessingExportC3D = 0x0200,
167 ProcessingExportMatlabFile = 0x0800,
168 ProcessingExportAviFile = 0x1000,
169 ProcessingPreProcess2D = 0x2000
188 struct SSettingsGeneralCamera
193 bool bSupportsHwSync;
194 unsigned int nSerial;
198 unsigned int nVideoFrequency;
199 unsigned int nVideoExposure;
200 unsigned int nVideoExposureMin;
201 unsigned int nVideoExposureMax;
202 unsigned int nVideoFlashTime;
203 unsigned int nVideoFlashTimeMin;
204 unsigned int nVideoFlashTimeMax;
205 unsigned int nMarkerExposure;
206 unsigned int nMarkerExposureMin;
207 unsigned int nMarkerExposureMax;
208 unsigned int nMarkerThreshold;
209 unsigned int nMarkerThresholdMin;
210 unsigned int nMarkerThresholdMax;
214 float fPositionRotMatrix[3][3];
215 unsigned int nOrientation;
216 unsigned int nMarkerResolutionWidth;
217 unsigned int nMarkerResolutionHeight;
218 unsigned int nVideoResolutionWidth;
219 unsigned int nVideoResolutionHeight;
220 unsigned int nMarkerFOVLeft;
221 unsigned int nMarkerFOVTop;
222 unsigned int nMarkerFOVRight;
223 unsigned int nMarkerFOVBottom;
224 unsigned int nVideoFOVLeft;
225 unsigned int nVideoFOVTop;
226 unsigned int nVideoFOVRight;
227 unsigned int nVideoFOVBottom;
229 unsigned int nSyncOutValue[2];
230 float fSyncOutDutyCycle[2];
231 bool bSyncOutNegativePolarity[3];
234 bool autoExposureEnabled;
235 float autoExposureCompensation;
236 int autoWhiteBalance;
239 struct SSettingsGeneralCameraSystem
244 struct SSettingsGeneralExternalTimebase
246 SSettingsGeneralExternalTimebase():
248 eSignalSource(SourceControlPort),
249 bSignalModePeriodic(
false),
253 fNominalFrequency(0.0f),
254 bNegativeEdge(
false),
255 nSignalShutterDelay(0),
256 fNonPeriodicTimeout(0.0f)
262 bool bSignalModePeriodic;
263 unsigned int nFreqMultiplier;
264 unsigned int nFreqDivisor;
265 unsigned int nFreqTolerance;
266 float fNominalFrequency;
268 unsigned int nSignalShutterDelay;
269 float fNonPeriodicTimeout;
272 struct SSettingsGeneral
275 nCaptureFrequency(0),
277 bStartOnExternalTrigger(
false),
278 bStartOnTrigNO(
false),
279 bStartOnTrigNC(
false),
280 bStartOnTrigSoftware(
false),
281 eProcessingActions(EProcessingActions::ProcessingNone),
282 eRtProcessingActions(EProcessingActions::ProcessingNone),
283 eReprocessingActions(EProcessingActions::ProcessingNone)
285 sExternalTimebase = { };
286 sCameraSystem = { Unknown };
289 unsigned int nCaptureFrequency;
291 bool bStartOnExternalTrigger;
294 bool bStartOnTrigSoftware;
295 SSettingsGeneralCameraSystem sCameraSystem;
296 SSettingsGeneralExternalTimebase sExternalTimebase;
300 std::vector< SSettingsGeneralCamera > vsCameras;
303 struct SSettings3DLabel
306 unsigned int nRGBColor;
311 std::string fromName;
319 char pCalibrationTime[32];
320 std::vector< SSettings3DLabel > s3DLabels;
321 std::vector< SSettingsBone > sBones;
324 struct SSettings6DOFBody
327 unsigned int nRGBColor;
328 std::vector< SPoint > vsPoints;
333 std::vector<SSettings6DOFBody> bodySettings;
334 std::string eulerFirst;
335 std::string eulerSecond;
336 std::string eulerThird;
347 unsigned int nDeviceID;
348 unsigned int nChannels;
350 std::vector< std::string > voLabels;
351 unsigned int nFrequency;
355 std::vector< std::string > voUnits;
360 unsigned int nChannelNumber;
361 float fConversionFactor;
367 unsigned int nAnalogDeviceID;
370 unsigned int nFrequency;
375 std::vector< SForceChannel > vChannels;
376 bool bValidCalibrationMatrix;
377 float afCalibrationMatrix[12][12];
378 unsigned int nCalibrationMatrixRows;
379 unsigned int nCalibrationMatrixColumns;
382 struct SSettingsForce
384 std::string oUnitLength;
385 std::string oUnitForce;
386 std::vector< SForcePlate > vsForcePlates;
395 unsigned int nHeight;
421 bool Connect(
const char* pServerAddr,
unsigned short nPort,
unsigned short* pnUDPServerPort =
nullptr,
int nMajorVersion =
MAJOR_VERSION,
int nMinorVersion =
MINOR_VERSION,
bool bBigEndian =
false);
422 unsigned short GetUdpServerPort();
424 bool Connected()
const;
425 bool SetVersion(
int nMajorVersion,
int nMinorVersion);
426 bool GetVersion(
unsigned int &nMajorVersion,
unsigned int &nMinorVersion);
427 bool GetQTMVersion(
char* pVersion,
unsigned int nVersionLen);
428 bool GetByteOrder(
bool &bBigEndian);
429 bool CheckLicense(
const char* pLicenseCode);
430 bool DiscoverRTServer(
unsigned short nServerPort,
bool bNoLocalResponses,
unsigned short nDiscoverPort =
DEFAULT_AUTO_DESCOVER_PORT);
431 int GetNumberOfDiscoverResponses();
432 bool GetDiscoverResponse(
unsigned int nIndex,
unsigned int &nAddr,
unsigned short &nBasePort, std::string& message);
434 bool GetCurrentFrame(
unsigned int nComponentType,
const SComponentOptions& componentOptions = { });
435 bool StreamFrames(
EStreamRate eRate,
unsigned int nRateArg,
unsigned short nUDPPort,
const char* pUDPAddr,
437 bool StreamFramesStop();
439 bool GetCapture(
const char* pFileName,
bool bC3D);
441 bool SetQTMEvent(
const char* pLabel);
442 bool TakeControl(
const char* pPassword =
nullptr);
443 bool ReleaseControl();
444 bool IsControlling();
445 bool NewMeasurement();
446 bool CloseMeasurement();
448 bool StartRTOnFile();
450 bool LoadCapture(
const char* pFileName);
451 bool SaveCapture(
const char* pFileName,
bool bOverwrite,
char* pNewFileName =
nullptr,
int nSizeOfNewFileName = 0);
452 bool LoadProject(
const char* pFileName);
456 static bool ConvertRateString(
const char* pRate,
EStreamRate &eRate,
unsigned int &nRateArg);
457 static unsigned int ConvertComponentString(
const char* pComponentType);
463 bool ReadXmlBool(
CMarkup* xml,
const std::string& element,
bool& value)
const;
464 bool ReadCameraSystemSettings();
465 bool Read3DSettings(
bool &bDataAvailable);
466 bool Read6DOFSettings(
bool &bDataAvailable);
467 bool ReadGazeVectorSettings(
bool &bDataAvailable);
468 bool ReadAnalogSettings(
bool &bDataAvailable);
469 bool ReadForceSettings(
bool &bDataAvailable);
470 bool ReadImageSettings(
bool &bDataAvailable);
471 bool ReadSkeletonSettings(
bool &bDataAvailable,
bool skeletonGlobalData =
false);
473 void GetSystemSettings(
474 unsigned int &nCaptureFrequency,
float &fCaptureTime,
475 bool& bStartOnExtTrig,
bool& trigNO,
bool& trigNC,
bool& trigSoftware,
478 void GetExtTimeBaseSettings(
480 bool &bSignalModePeriodic,
unsigned int &nFreqMultiplier,
481 unsigned int &nFreqDivisor,
unsigned int &nFreqTolerance,
482 float &fNominalFrequency,
bool &bNegativeEdge,
483 unsigned int &nSignalShutterDelay,
float &fNonPeriodicTimeout)
const;
485 unsigned int GetCameraCount()
const;
487 bool GetCameraSettings(
488 unsigned int nCameraIndex,
unsigned int &nID,
ECameraModel &eModel,
489 bool &bUnderwater,
bool &bSupportsHwSync,
unsigned int &nSerial,
ECameraMode &eMode)
const;
491 bool GetCameraMarkerSettings(
492 unsigned int nCameraIndex,
unsigned int &nCurrentExposure,
493 unsigned int &nMinExposure,
unsigned int &nMaxExposure,
494 unsigned int &nCurrentThreshold,
unsigned int &nMinThreshold,
495 unsigned int &nMaxThreshold)
const;
497 bool GetCameraVideoSettings(
500 unsigned int &nCurrentExposure,
unsigned int &nMinExposure,
501 unsigned int &nMaxExposure,
unsigned int &nCurrentFlashTime,
502 unsigned int &nMinFlashTime,
unsigned int &nMaxFlashTime)
const;
504 bool GetCameraSyncOutSettings(
505 unsigned int nCameraIndex,
unsigned int portNumber,
ESyncOutFreqMode &eSyncOutMode,
506 unsigned int &nSyncOutValue,
float &fSyncOutDutyCycle,
507 bool &bSyncOutNegativePolarity)
const;
509 bool GetCameraPosition(
510 unsigned int nCameraIndex,
SPoint &sPoint,
float fvRotationMatrix[3][3])
const;
512 bool GetCameraOrientation(
513 unsigned int nCameraIndex,
int &nOrientation)
const;
515 bool GetCameraResolution(
516 unsigned int nCameraIndex,
unsigned int &nMarkerWidth,
517 unsigned int &nMarkerHeight,
unsigned int &nVideoWidth,
518 unsigned int &nVideoHeight)
const;
521 unsigned int nCameraIndex,
unsigned int &nMarkerLeft,
unsigned int &nMarkerTop,
522 unsigned int &nMarkerRight,
unsigned int &nMarkerBottom,
523 unsigned int &nVideoLeft,
unsigned int &nVideoTop,
524 unsigned int &nVideoRight,
unsigned int &nVideoBottom)
const;
526 bool GetCameraLensControlSettings(
const unsigned int nCameraIndex,
float* focus,
float* aperture)
const;
527 bool GetCameraAutoExposureSettings(
const unsigned int nCameraIndex,
bool* autoExposureEnabled,
float* autoExposureCompensation)
const;
528 bool GetCameraAutoWhiteBalance(
const unsigned int nCameraIndex,
bool* autoWhiteBalanceEnabled)
const;
530 EAxis Get3DUpwardAxis()
const;
531 const char* Get3DCalibrated()
const;
532 unsigned int Get3DLabeledMarkerCount()
const;
533 const char* Get3DLabelName(
unsigned int nMarkerIndex)
const;
534 unsigned int Get3DLabelColor(
unsigned int nMarkerIndex)
const;
536 unsigned int Get3DBoneCount()
const;
537 const char* Get3DBoneFromName(
unsigned int boneIndex)
const;
538 const char* Get3DBoneToName(
unsigned int boneIndex)
const;
540 void Get6DOFEulerNames(std::string &first, std::string &second, std::string &third)
const;
541 unsigned int Get6DOFBodyCount()
const;
542 const char* Get6DOFBodyName(
unsigned int nBodyIndex)
const;
543 unsigned int Get6DOFBodyColor(
unsigned int nBodyIndex)
const;
544 unsigned int Get6DOFBodyPointCount(
unsigned int nBodyIndex)
const;
545 bool Get6DOFBodyPoint(
unsigned int nBodyIndex,
unsigned int nMarkerIndex,
SPoint &sPoint)
const;
547 unsigned int GetGazeVectorCount()
const;
548 const char* GetGazeVectorName(
unsigned int nGazeVectorIndex)
const;
549 float GetGazeVectorFrequency(
unsigned int nGazeVectorIndex)
const;
551 unsigned int GetAnalogDeviceCount()
const;
552 bool GetAnalogDevice(
unsigned int nDeviceIndex,
unsigned int &nDeviceID,
unsigned int &nChannels,
553 char* &pName,
unsigned int &nFrequency,
char* &pUnit,
554 float &fMinRange,
float &fMaxRange)
const;
555 const char* GetAnalogLabel(
unsigned int nDeviceIndex,
unsigned int nChannelIndex)
const;
556 const char* GetAnalogUnit(
unsigned int nDeviceIndex,
unsigned int nChannelIndex)
const;
558 void GetForceUnits(
char* &pLength,
char* &pForce)
const;
559 unsigned int GetForcePlateCount()
const;
560 bool GetForcePlate(
unsigned int nPlateIndex,
unsigned int &nID,
unsigned int &nAnalogDeviceID,
561 unsigned int &nFrequency,
char* &pType,
char* &pName,
float &fLength,
float &fWidth)
const;
562 bool GetForcePlateLocation(
unsigned int nPlateIndex,
SPoint sCorner[4])
const;
563 bool GetForcePlateOrigin(
unsigned int nPlateIndex,
SPoint &sOrigin)
const;
564 unsigned int GetForcePlateChannelCount(
unsigned int nPlateIndex)
const;
565 bool GetForcePlateChannel(
unsigned int nPlateIndex,
unsigned int nChannelIndex,
566 unsigned int &nChannelNumber,
float &fConversionFactor)
const;
567 bool GetForcePlateCalibrationMatrix(
unsigned int nPlateIndex,
float fvCalMatrix[12][12],
unsigned int* rows,
unsigned int* columns)
const;
569 unsigned int GetImageCameraCount()
const;
570 bool GetImageCamera(
unsigned int nCameraIndex,
unsigned int &nCameraID,
bool &bEnabled,
572 float &fCropLeft,
float &fCropTop,
float &fCropRight,
float &fCropBottom)
const;
574 unsigned int GetSkeletonCount()
const;
575 const char* GetSkeletonName(
unsigned int skeletonIndex);
576 unsigned int GetSkeletonSegmentCount(
unsigned int skeletonIndex);
583 bool SetSystemSettings(
584 const unsigned int* pnCaptureFrequency,
const float* pfCaptureTime,
585 const bool* pbStartOnExtTrig,
const bool* trigNO,
const bool* trigNC,
const bool* trigSoftware,
588 bool SetExtTimeBaseSettings(
590 const bool* pbSignalModePeriodic,
const unsigned int* pnFreqMultiplier,
591 const unsigned int* pnFreqDivisor,
const unsigned int* pnFreqTolerance,
592 const float* pfNominalFrequency,
const bool* pbNegativeEdge,
593 const unsigned int* pnSignalShutterDelay,
const float* pfNonPeriodicTimeout);
595 bool SetCameraSettings(
596 const unsigned int nCameraID,
const ECameraMode* peMode,
597 const float* pfMarkerExposure,
const float* pfMarkerThreshold,
598 const int* pnOrientation);
600 bool SetCameraVideoSettings(
602 const EVideoAspectRatio* eVideoAspectRatio,
const unsigned int* pnVideoFrequency,
603 const float* pfVideoExposure,
const float* pfVideoFlashTime);
605 bool SetCameraSyncOutSettings(
606 const unsigned int nCameraID,
const unsigned int portNumber,
const ESyncOutFreqMode* peSyncOutMode,
607 const unsigned int* pnSyncOutValue,
const float* pfSyncOutDutyCycle,
608 const bool* pbSyncOutNegativePolarity);
610 bool SetCameraLensControlSettings(
const unsigned int nCameraID,
const float focus,
const float aperture);
611 bool SetCameraAutoExposureSettings(
const unsigned int nCameraID,
const bool autoExposure,
const float compensation);
612 bool SetCameraAutoWhiteBalance(
const unsigned int nCameraID,
const bool enable);
614 bool SetImageSettings(
616 const unsigned int* pnWidth,
const unsigned int* pnHeight,
const float* pfLeftCrop,
617 const float* pfTopCrop,
const float* pfRightCrop,
const float* pfBottomCrop);
619 bool SetForceSettings(
620 const unsigned int nPlateID,
const SPoint* psCorner1,
const SPoint* psCorner2,
623 char* GetErrorString();
627 bool SendString(
const char* pCmdStr,
int nType);
628 bool SendCommand(
const char* pCmdStr);
629 bool SendCommand(
const char* pCmdStr,
char* pCommandResponseStr,
unsigned int timeout =
WAIT_FOR_DATA_TIMEOUT);
630 bool SendXML(
const char* pCmdStr);
631 void AddXMLElementBool(
CMarkup* oXML,
const char* tTag,
const bool* pbValue,
const char* tTrue =
"True",
const char* tFalse =
"False");
632 void AddXMLElementBool(
CMarkup* oXML,
const char* tTag,
const bool bValue,
const char* tTrue =
"True",
const char* tFalse =
"False");
633 void AddXMLElementInt(
CMarkup* oXML,
const char* tTag,
const int* pnValue);
634 void AddXMLElementUnsignedInt(
CMarkup* oXML,
const char* tTag,
const unsigned int* pnValue);
635 void AddXMLElementFloat(
CMarkup* oXML,
const char* tTag,
const float* pfValue,
unsigned int pnDecimals = 6);
636 bool CompareNoCase(std::string tStr1,
const char* tStr2)
const;
642 unsigned int mDataBuffSize;
649 SSettingsGeneral msGeneralSettings;
650 SSettings3D ms3DSettings;
651 SSettings6DOF mvs6DOFSettings;
652 std::vector<SGazeVector> mvsGazeVectorSettings;
653 std::vector<SAnalogDevice> mvsAnalogDeviceSettings;
654 SSettingsForce msForceSettings;
655 std::vector<SImageCamera> mvsImageSettings;
656 std::vector<SSettingsSkeleton> mSkeletonSettings;
657 char maErrorStr[1024];
658 unsigned short mnBroadcastPort;
660 std::vector< SDiscoverResponse > mvsDiscoverResponseList;
664 #endif // RTPROTOCOL_H
std::vector< SSettingsSkeletonSegment > segments
#define DEFAULT_AUTO_DESCOVER_PORT
#define WAIT_FOR_DATA_TIMEOUT