├── .gitignore ├── Vicon └── CrossMarket │ ├── DataStream │ ├── ViconCGStream │ │ ├── Dummy.cpp │ │ ├── ViconCGStream.ThirdParty.xml │ │ ├── DynamicCameraCalibrationInfo.h │ │ ├── IsEqual.h │ │ ├── CameraWand2dDetail.h │ │ ├── KeepAlive.h │ │ ├── Item.h │ │ ├── CameraWand3dDetail.h │ │ ├── StopMulticastSender.h │ │ ├── RequestNextFrame.h │ │ ├── Ping.h │ │ ├── RequestFrame.h │ │ ├── ApexHaptics.h │ │ ├── FrameRateInfo.h │ │ ├── FrameInfo.h │ │ ├── EdgePairsDetail.h │ │ ├── LatencyInfo.h │ │ ├── StreamInfo.h │ │ ├── SubjectScaleDetail.h │ │ ├── ObjectEnums.h │ │ ├── HardwareFrameInfo.h │ │ ├── LatencyInfoDetail.h │ │ ├── LabeledRecons.h │ │ ├── LabeledReconRayAssignments.h │ │ ├── UnlabeledRecons.h │ │ ├── UnlabeledReconRayAssignments.h │ │ ├── CentroidsDetail.h │ │ ├── GlobalSegments.h │ │ ├── GlobalSegmentsDetail.h │ │ ├── LightweightSegmentsDetail.h │ │ ├── ObjectQuality.h │ │ ├── LightweightSegments.h │ │ ├── LocalSegmentsDetail.h │ │ ├── ScopedWriter.h │ │ ├── GreyscaleSubsampledBlobs.h │ │ ├── SubjectTopologyDetail.h │ │ ├── LocalSegments.h │ │ ├── StartMulticastSender.h │ │ ├── SubjectTopology.h │ │ ├── CentroidTracksDetail.h │ │ ├── EdgePairs.h │ │ ├── UnlabeledReconsDetail.h │ │ ├── CentroidWeights.h │ │ ├── Centroids.h │ │ ├── SubjectScale.h │ │ ├── SubjectHealth.h │ │ ├── CentroidTracks.h │ │ ├── Contents.h │ │ ├── CameraTimingInfo.h │ │ ├── EyeTrackerFrame.h │ │ ├── CameraCalibrationHealth.h │ │ ├── ForceFrame.h │ │ ├── CameraWand3d.h │ │ ├── VoltageFrame.h │ │ ├── MomentFrame.h │ │ ├── CentreOfPressureFrame.h │ │ ├── ApplicationInfo.h │ │ └── ScopedReader.h │ ├── ViconDataStreamSDK_C │ │ ├── resource.h │ │ ├── ViconDataStreamSDK_C.ThirdParty.xml │ │ ├── VersionInfoResource.rc2 │ │ ├── ViconDataStreamSDK_C.rc │ │ └── ViconDataStreamSDK_CVersion.h │ ├── ViconDataStreamSDK_CPP │ │ ├── resource.h │ │ ├── ReadMe.txt │ │ ├── ViconDataStreamSDK_CPP.ThirdParty.xml │ │ ├── VersionInfoResource.rc2 │ │ ├── ViconDataStreamSDK_CPP.rc │ │ ├── ViconDataStreamSDK_CPPVersion.h │ │ └── StringFactory.h │ ├── ViconCGStreamClient │ │ ├── ViconCGStreamClient.ThirdParty.xml │ │ ├── ViconCGStreamBayer.h │ │ ├── CGStreamReaderWriter.h │ │ ├── IViconCGStreamClientCallback.h │ │ └── CGStreamPostalService.h │ ├── ViconCGStreamClientSDK │ │ └── ViconCGStreamClientSDK.ThirdParty.xml │ ├── ViconDataStreamSDKCore │ │ ├── ViconDataStreamSDKCore.ThirdParty.xml │ │ ├── ViconDataStreamSDKCoreVersion.h │ │ ├── WirelessConfiguration.h │ │ ├── SegmentPoseReader.h │ │ └── RetimerUtils.h │ ├── ViconDataStreamSDK_CPPTest │ │ └── ViconDataStreamSDK_CPPTest.ThirdParty.xml │ ├── ViconDataStreamSDK_CTest │ │ └── ViconDataStreamSDK_CTest.ThirdParty.xml │ ├── ViconDataStreamSDKCoreUtils │ │ ├── ViconDataStreamSDKCoreUtils.ThirdParty.xml │ │ ├── ViconDataStreamSDKCoreUtilsVersion.h │ │ └── AxisMapping.h │ └── ViconDataStreamSDK_CPPRetimerTest │ │ └── ViconDataStreamSDK_CPPRetimerTest.ThirdParty.xml │ └── StreamCommon │ ├── StreamCommon.ThirdParty.xml │ └── Type.h ├── Config.cmake.in ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | build/ -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/Dummy.cpp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconDataStreamSDK_C/resource.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconDataStreamSDK_CPP/resource.h: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconDataStreamSDK_CPP/ReadMe.txt: -------------------------------------------------------------------------------- 1 | If you modify Client.h, please modify the copy in ViconDataStreamSDK_CPPPlugins -------------------------------------------------------------------------------- /Vicon/CrossMarket/StreamCommon/StreamCommon.ThirdParty.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/ViconCGStream.ThirdParty.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStreamClient/ViconCGStreamClient.ThirdParty.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconDataStreamSDK_C/ViconDataStreamSDK_C.ThirdParty.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStreamClientSDK/ViconCGStreamClientSDK.ThirdParty.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconDataStreamSDKCore/ViconDataStreamSDKCore.ThirdParty.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconDataStreamSDK_CPP/ViconDataStreamSDK_CPP.ThirdParty.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconDataStreamSDK_CPPTest/ViconDataStreamSDK_CPPTest.ThirdParty.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconDataStreamSDK_CTest/ViconDataStreamSDK_CTest.ThirdParty.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconDataStreamSDKCoreUtils/ViconDataStreamSDKCoreUtils.ThirdParty.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconDataStreamSDK_CPPRetimerTest/ViconDataStreamSDK_CPPRetimerTest.ThirdParty.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /Config.cmake.in: -------------------------------------------------------------------------------- 1 | @PACKAGE_INIT@ 2 | 3 | include(CMakeFindDependencyMacro) 4 | 5 | include("${CMAKE_CURRENT_LIST_DIR}/@PROJECT_NAME@Targets.cmake") 6 | 7 | find_dependency(Boost 1.5 COMPONENTS system thread) 8 | set(THREADS_PREFER_PTHREAD_FLAG ON) 9 | find_dependency(Threads) 10 | 11 | check_required_components(@PROJECT_NAME@) 12 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Vicon Motion Systems Ltd, Wolfgang Hönig 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # vicon-datastream-sdk 2 | inofficial VICON DataStream SDK with cmake support 3 | 4 | Since version 1.8.0, the VICON DataStream SDK is available under an MIT license. This inofficial fork 5 | contains the SDK as well as support for the cmake build system for easy integration in cmake-based projects. 6 | 7 | You can find the latest official version at https://vicon.com/downloads/utilities-and-sdk/datastream-sdk 8 | 9 | ## Building 10 | 11 | ```` 12 | mkdir build 13 | cd build 14 | cmake .. 15 | make 16 | make install # if you want to install the package 17 | ```` 18 | 19 | ## Testing 20 | 21 | Run 22 | 23 | ```` 24 | cd build 25 | ./ViconDataStreamSDK_CPPTest vicon 26 | ```` 27 | 28 | where vicon is the IP/hostname of the vicon machine. 29 | 30 | 31 | ## Use in other projects 32 | 33 | First you need to build and install this package (see above). Then you can use 34 | it in your own CMake-projects like this: 35 | 36 | ```cmake 37 | # CMakeLists.txt 38 | find_package(vicon-datastream-sdk) 39 | 40 | add_executable(foo foo.cpp) 41 | target_link_libraries(foo PRIVATE vicon-datastream-sdk::ViconDataStreamSDK_CPP) 42 | ``` 43 | 44 | ```c++ 45 | // foo.cpp 46 | #include 47 | 48 | // ...your code... 49 | // See ViconDataStreamSDK_CPPTest.cpp for an example how to use the SDK 50 | ``` 51 | 52 | 53 | ## Notes 54 | 55 | Currently this only builds the C++ SDK and associated test application. 56 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconDataStreamSDK_C/VersionInfoResource.rc2: -------------------------------------------------------------------------------- 1 | #include "ViconDataStreamSDK_CVersion.h" 2 | 3 | ///////////////////////////////////////////////////////////////////////////// 4 | // 5 | // Version 6 | // 7 | 8 | VS_VERSION_INFO VERSIONINFO 9 | FILEVERSION VICONDATASTREAMSDK_C_VERSION_MAJOR,VICONDATASTREAMSDK_C_VERSION_MINOR,VICONDATASTREAMSDK_C_VERSION_POINT,VICONDATASTREAMSDK_C_VERSION_REVISION 10 | PRODUCTVERSION VICONDATASTREAMSDK_C_VERSION_MAJOR,VICONDATASTREAMSDK_C_VERSION_MINOR,VICONDATASTREAMSDK_C_VERSION_POINT,VICONDATASTREAMSDK_C_VERSION_REVISION 11 | FILEFLAGSMASK 0x3fL 12 | #ifdef _DEBUG 13 | FILEFLAGS 0x1L 14 | #else 15 | FILEFLAGS 0x0L 16 | #endif 17 | FILEOS 0x4L 18 | FILETYPE 0x1L 19 | FILESUBTYPE 0x0L 20 | BEGIN 21 | BLOCK "StringFileInfo" 22 | BEGIN 23 | BLOCK "040904b0" 24 | BEGIN 25 | VALUE "CompanyName", VICONDATASTREAMSDK_C_COMPANY_L 26 | VALUE "FileDescription", "Vicon DataStream SDK for C" 27 | VALUE "FileVersion", VICONDATASTREAMSDK_C_FULL_VERSION_STRING_L 28 | VALUE "InternalName", "Vicon DataStream SDK for C" 29 | VALUE "LegalCopyright", VICONDATASTREAMSDK_C_COPYRIGHT_L 30 | VALUE "LegalTrademarks", VICONDATASTREAMSDK_C_TRADEMARK_L 31 | VALUE "OriginalFilename", "ViconDataStreamSDK_C.dll" 32 | VALUE "ProductName", "Vicon DataStream SDK" 33 | VALUE "ProductVersion", VICONDATASTREAMSDK_C_FULL_VERSION_STRING_L 34 | END 35 | END 36 | BLOCK "VarFileInfo" 37 | BEGIN 38 | VALUE "Translation", 0x409, 1200 39 | END 40 | END 41 | 42 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconDataStreamSDK_CPP/VersionInfoResource.rc2: -------------------------------------------------------------------------------- 1 | #include "ViconDataStreamSDK_CPPVersion.h" 2 | 3 | ///////////////////////////////////////////////////////////////////////////// 4 | // 5 | // Version 6 | // 7 | 8 | VS_VERSION_INFO VERSIONINFO 9 | FILEVERSION VICONDATASTREAMSDK_CPP_VERSION_MAJOR,VICONDATASTREAMSDK_CPP_VERSION_MINOR,VICONDATASTREAMSDK_CPP_VERSION_POINT,VICONDATASTREAMSDK_CPP_VERSION_REVISION 10 | PRODUCTVERSION VICONDATASTREAMSDK_CPP_VERSION_MAJOR,VICONDATASTREAMSDK_CPP_VERSION_MINOR,VICONDATASTREAMSDK_CPP_VERSION_POINT,VICONDATASTREAMSDK_CPP_VERSION_REVISION 11 | FILEFLAGSMASK 0x3fL 12 | #ifdef _DEBUG 13 | FILEFLAGS 0x1L 14 | #else 15 | FILEFLAGS 0x0L 16 | #endif 17 | FILEOS 0x4L 18 | FILETYPE 0x1L 19 | FILESUBTYPE 0x0L 20 | BEGIN 21 | BLOCK "StringFileInfo" 22 | BEGIN 23 | BLOCK "040904b0" 24 | BEGIN 25 | VALUE "CompanyName", VICONDATASTREAMSDK_CPP_COMPANY_L 26 | VALUE "FileDescription", "Vicon DataStream SDK for C++" 27 | VALUE "FileVersion", VICONDATASTREAMSDK_CPP_FULL_VERSION_STRING_L 28 | VALUE "InternalName", "Vicon DataStream for C++" 29 | VALUE "LegalCopyright", VICONDATASTREAMSDK_CPP_COPYRIGHT_L 30 | VALUE "LegalTrademarks", VICONDATASTREAMSDK_CPP_TRADEMARK_L 31 | VALUE "OriginalFilename", "ViconDataStreamSDK_CPP.dll" 32 | VALUE "ProductName", "Vicon DataStream SDK" 33 | VALUE "ProductVersion", VICONDATASTREAMSDK_CPP_FULL_VERSION_STRING_L 34 | END 35 | END 36 | BLOCK "VarFileInfo" 37 | BEGIN 38 | VALUE "Translation", 0x409, 1200 39 | END 40 | END 41 | 42 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconDataStreamSDK_C/ViconDataStreamSDK_C.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "windows.h" 11 | ///////////////////////////////////////////////////////////////////////////// 12 | #undef APSTUDIO_READONLY_SYMBOLS 13 | 14 | ///////////////////////////////////////////////////////////////////////////// 15 | // English (U.S.) resources 16 | 17 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 18 | #ifdef _WIN32 19 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 20 | #pragma code_page(1252) 21 | #endif //_WIN32 22 | 23 | #ifdef APSTUDIO_INVOKED 24 | ///////////////////////////////////////////////////////////////////////////// 25 | // 26 | // TEXTINCLUDE 27 | // 28 | 29 | 1 TEXTINCLUDE 30 | BEGIN 31 | "resource.h\0" 32 | END 33 | 34 | 2 TEXTINCLUDE 35 | BEGIN 36 | "#include ""windows.h""\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "#include ""VersionInfoResource.rc2""\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | #endif // English (U.S.) resources 48 | ///////////////////////////////////////////////////////////////////////////// 49 | 50 | 51 | 52 | #ifndef APSTUDIO_INVOKED 53 | ///////////////////////////////////////////////////////////////////////////// 54 | // 55 | // Generated from the TEXTINCLUDE 3 resource. 56 | // 57 | #include "VersionInfoResource.rc2" 58 | 59 | ///////////////////////////////////////////////////////////////////////////// 60 | #endif // not APSTUDIO_INVOKED 61 | 62 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconDataStreamSDK_CPP/ViconDataStreamSDK_CPP.rc: -------------------------------------------------------------------------------- 1 | // Microsoft Visual C++ generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "windows.h" 11 | ///////////////////////////////////////////////////////////////////////////// 12 | #undef APSTUDIO_READONLY_SYMBOLS 13 | 14 | ///////////////////////////////////////////////////////////////////////////// 15 | // English (U.S.) resources 16 | 17 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 18 | #ifdef _WIN32 19 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 20 | #pragma code_page(1252) 21 | #endif //_WIN32 22 | 23 | #ifdef APSTUDIO_INVOKED 24 | ///////////////////////////////////////////////////////////////////////////// 25 | // 26 | // TEXTINCLUDE 27 | // 28 | 29 | 1 TEXTINCLUDE 30 | BEGIN 31 | "resource.h\0" 32 | END 33 | 34 | 2 TEXTINCLUDE 35 | BEGIN 36 | "#include ""windows.h""\0" 37 | END 38 | 39 | 3 TEXTINCLUDE 40 | BEGIN 41 | "#include ""VersionInfoResource.rc2""\r\n" 42 | "\0" 43 | END 44 | 45 | #endif // APSTUDIO_INVOKED 46 | 47 | #endif // English (U.S.) resources 48 | ///////////////////////////////////////////////////////////////////////////// 49 | 50 | 51 | 52 | #ifndef APSTUDIO_INVOKED 53 | ///////////////////////////////////////////////////////////////////////////// 54 | // 55 | // Generated from the TEXTINCLUDE 3 resource. 56 | // 57 | #include "VersionInfoResource.rc2" 58 | 59 | ///////////////////////////////////////////////////////////////////////////// 60 | #endif // not APSTUDIO_INVOKED 61 | 62 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconDataStreamSDK_C/ViconDataStreamSDK_CVersion.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define VICONDATASTREAMSDK_C_VERSION_REVISION_CONTROL_SYSTEM "unknown" 4 | #define VICONDATASTREAMSDK_C_VERSION_REVISION 0 5 | #define VICONDATASTREAMSDK_C_VERSION_MONOTONIC_REVISION 0 6 | #define VICONDATASTREAMSDK_C_VERSION_PUBLIC_REVISION_STRING "0" 7 | #define VICONDATASTREAMSDK_C_VERSION_BRANCH "unknown" 8 | #define VICONDATASTREAMSDK_C_VERSION_REPOSITORY "unknown" 9 | #define VICONDATASTREAMSDK_C_VERSION_CHANGESET "0" 10 | #define VICONDATASTREAMSDK_C_VERSION_LOCAL_CHANGESET "0" 11 | #define VICONDATASTREAMSDK_C_VERSION_LOCAL_BRANCH "unknown" 12 | 13 | #define VICONDATASTREAMSDK_C_VERSION_MAJOR 1 14 | #define VICONDATASTREAMSDK_C_VERSION_MINOR 12 15 | #define VICONDATASTREAMSDK_C_VERSION_POINT 0 16 | #define VICONDATASTREAMSDK_C_VERSION_RELEASE "" 17 | #define VICONDATASTREAMSDK_C_VERSION_SUPPLEMENTAL "" 18 | 19 | #define VICONDATASTREAMSDK_C_FULL_VERSION_STRING "1.12.0.0" 20 | #define VICONDATASTREAMSDK_C_VERSION_STRING "1.12" 21 | #define VICONDATASTREAMSDK_C_COMPANY "Vicon Motion Systems Ltd" 22 | #define VICONDATASTREAMSDK_C_COPYRIGHT "Copyright \x00A9 2023 Vicon Motion Systems Ltd. All rights reserved." 23 | #define VICONDATASTREAMSDK_C_TRADEMARK "Vicon\x00AE is a registered trademark of OMG Plc." 24 | #define VICONDATASTREAMSDK_C_PROJECT_NAME "ViconDataStreamSDK_C" 25 | 26 | #define VICONDATASTREAMSDK_C_FULL_VERSION_STRING_L L"1.12.0.0" 27 | #define VICONDATASTREAMSDK_C_VERSION_STRING_L L"1.12" 28 | #define VICONDATASTREAMSDK_C_COMPANY_L L"Vicon Motion Systems Ltd" 29 | #define VICONDATASTREAMSDK_C_COPYRIGHT_L L"Copyright \x00A9 2023 Vicon Motion Systems Ltd. All rights reserved." 30 | #define VICONDATASTREAMSDK_C_TRADEMARK_L L"Vicon\x00AE is a registered trademark of OMG Plc." 31 | #define VICONDATASTREAMSDK_C_PROJECT_NAME_L L"ViconDataStreamSDK_C" 32 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconDataStreamSDKCore/ViconDataStreamSDKCoreVersion.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define VICONDATASTREAMSDKCORE_VERSION_REVISION_CONTROL_SYSTEM "unknown" 4 | #define VICONDATASTREAMSDKCORE_VERSION_REVISION 0 5 | #define VICONDATASTREAMSDKCORE_VERSION_MONOTONIC_REVISION 0 6 | #define VICONDATASTREAMSDKCORE_VERSION_PUBLIC_REVISION_STRING "0" 7 | #define VICONDATASTREAMSDKCORE_VERSION_BRANCH "unknown" 8 | #define VICONDATASTREAMSDKCORE_VERSION_REPOSITORY "unknown" 9 | #define VICONDATASTREAMSDKCORE_VERSION_CHANGESET "0" 10 | #define VICONDATASTREAMSDKCORE_VERSION_LOCAL_CHANGESET "0" 11 | #define VICONDATASTREAMSDKCORE_VERSION_LOCAL_BRANCH "unknown" 12 | 13 | #define VICONDATASTREAMSDKCORE_VERSION_MAJOR 1 14 | #define VICONDATASTREAMSDKCORE_VERSION_MINOR 12 15 | #define VICONDATASTREAMSDKCORE_VERSION_POINT 0 16 | #define VICONDATASTREAMSDKCORE_VERSION_RELEASE "" 17 | #define VICONDATASTREAMSDKCORE_VERSION_SUPPLEMENTAL "" 18 | 19 | #define VICONDATASTREAMSDKCORE_FULL_VERSION_STRING "1.12.0.0" 20 | #define VICONDATASTREAMSDKCORE_VERSION_STRING "1.12" 21 | #define VICONDATASTREAMSDKCORE_COMPANY "Vicon Motion Systems Ltd" 22 | #define VICONDATASTREAMSDKCORE_COPYRIGHT "Copyright \x00A9 2023 Vicon Motion Systems Ltd. All rights reserved." 23 | #define VICONDATASTREAMSDKCORE_TRADEMARK "Vicon\x00AE is a registered trademark of OMG Plc." 24 | #define VICONDATASTREAMSDKCORE_PROJECT_NAME "ViconDataStreamSDKCore" 25 | 26 | #define VICONDATASTREAMSDKCORE_FULL_VERSION_STRING_L L"1.12.0.0" 27 | #define VICONDATASTREAMSDKCORE_VERSION_STRING_L L"1.12" 28 | #define VICONDATASTREAMSDKCORE_COMPANY_L L"Vicon Motion Systems Ltd" 29 | #define VICONDATASTREAMSDKCORE_COPYRIGHT_L L"Copyright \x00A9 2023 Vicon Motion Systems Ltd. All rights reserved." 30 | #define VICONDATASTREAMSDKCORE_TRADEMARK_L L"Vicon\x00AE is a registered trademark of OMG Plc." 31 | #define VICONDATASTREAMSDKCORE_PROJECT_NAME_L L"ViconDataStreamSDKCore" 32 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconDataStreamSDK_CPP/ViconDataStreamSDK_CPPVersion.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define VICONDATASTREAMSDK_CPP_VERSION_REVISION_CONTROL_SYSTEM "unknown" 4 | #define VICONDATASTREAMSDK_CPP_VERSION_REVISION 0 5 | #define VICONDATASTREAMSDK_CPP_VERSION_MONOTONIC_REVISION 0 6 | #define VICONDATASTREAMSDK_CPP_VERSION_PUBLIC_REVISION_STRING "0" 7 | #define VICONDATASTREAMSDK_CPP_VERSION_BRANCH "unknown" 8 | #define VICONDATASTREAMSDK_CPP_VERSION_REPOSITORY "unknown" 9 | #define VICONDATASTREAMSDK_CPP_VERSION_CHANGESET "0" 10 | #define VICONDATASTREAMSDK_CPP_VERSION_LOCAL_CHANGESET "0" 11 | #define VICONDATASTREAMSDK_CPP_VERSION_LOCAL_BRANCH "unknown" 12 | 13 | #define VICONDATASTREAMSDK_CPP_VERSION_MAJOR 1 14 | #define VICONDATASTREAMSDK_CPP_VERSION_MINOR 12 15 | #define VICONDATASTREAMSDK_CPP_VERSION_POINT 0 16 | #define VICONDATASTREAMSDK_CPP_VERSION_RELEASE "" 17 | #define VICONDATASTREAMSDK_CPP_VERSION_SUPPLEMENTAL "" 18 | 19 | #define VICONDATASTREAMSDK_CPP_FULL_VERSION_STRING "1.12.0.0" 20 | #define VICONDATASTREAMSDK_CPP_VERSION_STRING "1.12" 21 | #define VICONDATASTREAMSDK_CPP_COMPANY "Vicon Motion Systems Ltd" 22 | #define VICONDATASTREAMSDK_CPP_COPYRIGHT "Copyright \x00A9 2023 Vicon Motion Systems Ltd. All rights reserved." 23 | #define VICONDATASTREAMSDK_CPP_TRADEMARK "Vicon\x00AE is a registered trademark of OMG Plc." 24 | #define VICONDATASTREAMSDK_CPP_PROJECT_NAME "ViconDataStreamSDK_CPP" 25 | 26 | #define VICONDATASTREAMSDK_CPP_FULL_VERSION_STRING_L L"1.12.0.0" 27 | #define VICONDATASTREAMSDK_CPP_VERSION_STRING_L L"1.12" 28 | #define VICONDATASTREAMSDK_CPP_COMPANY_L L"Vicon Motion Systems Ltd" 29 | #define VICONDATASTREAMSDK_CPP_COPYRIGHT_L L"Copyright \x00A9 2023 Vicon Motion Systems Ltd. All rights reserved." 30 | #define VICONDATASTREAMSDK_CPP_TRADEMARK_L L"Vicon\x00AE is a registered trademark of OMG Plc." 31 | #define VICONDATASTREAMSDK_CPP_PROJECT_NAME_L L"ViconDataStreamSDK_CPP" 32 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStreamClient/ViconCGStreamBayer.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | class VViconCGStreamBayer 28 | { 29 | public: 30 | static void BayerGBToBGR( unsigned int i_Width, unsigned int i_Height, const unsigned char * i_pBayerData, unsigned char * o_pBGRData ); 31 | static void BayerBGToBGR( unsigned int i_Width, unsigned int i_Height, const unsigned char * i_pBayerData, unsigned char * o_pBGRData ); 32 | static void BayerRGToBGR( unsigned int i_Width, unsigned int i_Height, const unsigned char * i_pBayerData, unsigned char * o_pBGRData ); 33 | }; 34 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconDataStreamSDK_CPP/StringFactory.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | namespace ViconDataStreamSDK 28 | { 29 | namespace CPP 30 | { 31 | class VStringFactory : public IStringFactory 32 | { 33 | public: 34 | 35 | virtual char * AllocAndCopyString( const char * i_pSource ) 36 | { 37 | char * pString = new char[ strlen( i_pSource ) + 1 ]; 38 | strcpy( pString, i_pSource ); 39 | return pString; 40 | } 41 | 42 | virtual void FreeString( char * i_pString ) 43 | { 44 | delete[] i_pString; 45 | } 46 | }; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconDataStreamSDKCore/WirelessConfiguration.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | #include 28 | #include 29 | 30 | class VWirelessConfiguration 31 | { 32 | public: 33 | static std::shared_ptr< VWirelessConfiguration > Create( std::string & o_rError ); 34 | virtual ~VWirelessConfiguration(); 35 | 36 | bool BackgroundScan( std::string & o_rError, bool i_Enable ); 37 | bool StreamingMode( std::string & o_rError, bool i_Enable ); 38 | 39 | private: 40 | class VImpl; 41 | VWirelessConfiguration( std::shared_ptr< VImpl > i_pImpl ); 42 | 43 | std::shared_ptr< VImpl > m_pImpl; 44 | }; 45 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconDataStreamSDKCoreUtils/ViconDataStreamSDKCoreUtilsVersion.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define VICONDATASTREAMSDKCOREUTILS_VERSION_REVISION_CONTROL_SYSTEM "unknown" 4 | #define VICONDATASTREAMSDKCOREUTILS_VERSION_REVISION 0 5 | #define VICONDATASTREAMSDKCOREUTILS_VERSION_MONOTONIC_REVISION 0 6 | #define VICONDATASTREAMSDKCOREUTILS_VERSION_PUBLIC_REVISION_STRING "0" 7 | #define VICONDATASTREAMSDKCOREUTILS_VERSION_BRANCH "unknown" 8 | #define VICONDATASTREAMSDKCOREUTILS_VERSION_REPOSITORY "unknown" 9 | #define VICONDATASTREAMSDKCOREUTILS_VERSION_CHANGESET "0" 10 | #define VICONDATASTREAMSDKCOREUTILS_VERSION_LOCAL_CHANGESET "0" 11 | #define VICONDATASTREAMSDKCOREUTILS_VERSION_LOCAL_BRANCH "unknown" 12 | 13 | #define VICONDATASTREAMSDKCOREUTILS_VERSION_MAJOR 1 14 | #define VICONDATASTREAMSDKCOREUTILS_VERSION_MINOR 12 15 | #define VICONDATASTREAMSDKCOREUTILS_VERSION_POINT 0 16 | #define VICONDATASTREAMSDKCOREUTILS_VERSION_RELEASE "" 17 | #define VICONDATASTREAMSDKCOREUTILS_VERSION_SUPPLEMENTAL "" 18 | 19 | #define VICONDATASTREAMSDKCOREUTILS_FULL_VERSION_STRING "1.12.0.0" 20 | #define VICONDATASTREAMSDKCOREUTILS_VERSION_STRING "1.12" 21 | #define VICONDATASTREAMSDKCOREUTILS_COMPANY "Vicon Motion Systems Ltd" 22 | #define VICONDATASTREAMSDKCOREUTILS_COPYRIGHT "Copyright \x00A9 2023 Vicon Motion Systems Ltd. All rights reserved." 23 | #define VICONDATASTREAMSDKCOREUTILS_TRADEMARK "Vicon\x00AE is a registered trademark of OMG Plc." 24 | #define VICONDATASTREAMSDKCOREUTILS_PROJECT_NAME "ViconDataStreamSDKCoreUtils" 25 | 26 | #define VICONDATASTREAMSDKCOREUTILS_FULL_VERSION_STRING_L L"1.12.0.0" 27 | #define VICONDATASTREAMSDKCOREUTILS_VERSION_STRING_L L"1.12" 28 | #define VICONDATASTREAMSDKCOREUTILS_COMPANY_L L"Vicon Motion Systems Ltd" 29 | #define VICONDATASTREAMSDKCOREUTILS_COPYRIGHT_L L"Copyright \x00A9 2023 Vicon Motion Systems Ltd. All rights reserved." 30 | #define VICONDATASTREAMSDKCOREUTILS_TRADEMARK_L L"Vicon\x00AE is a registered trademark of OMG Plc." 31 | #define VICONDATASTREAMSDKCOREUTILS_PROJECT_NAME_L L"ViconDataStreamSDKCoreUtils" 32 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/DynamicCameraCalibrationInfo.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | #include "CameraCalibrationInfo.h" 28 | #include 29 | 30 | namespace ViconCGStream 31 | { 32 | //------------------------------------------------------------------------------------------------- 33 | // Item for dynamic/moving camera 34 | // Contents are the same as CameraCalibrationInfo, only as a separate item so 35 | // that the static/non-moving cameras are not sent every frame. 36 | // Whether items are sent every frame is checked just before sending the data in 37 | // CGServerStream. 38 | class VDynamicCameraCalibrationInfo : public VCameraCalibrationInfo 39 | { 40 | public: 41 | 42 | /// Object type enum. 43 | virtual ViconCGStreamType::Enum TypeID() const 44 | { 45 | return ViconCGStreamEnum::DynamicCameraCalibrationInfo; 46 | } 47 | 48 | }; 49 | 50 | //------------------------------------------------------------------------------------------------- 51 | }; 52 | 53 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/IsEqual.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | namespace ViconCGStreamDetail 28 | { 29 | //------------------------------------------------------------------------------------------------- 30 | 31 | template< unsigned int N > 32 | struct VDetail 33 | { 34 | template< typename T > 35 | static bool IsEqual( const T * i_pLeft, const T * i_pRight ) 36 | { 37 | return *i_pLeft == *i_pRight && VDetail< N - 1 >::IsEqual( i_pLeft + 1, i_pRight + 1 ); 38 | } 39 | }; 40 | 41 | template<> 42 | struct VDetail< 1 > 43 | { 44 | template< typename T > 45 | static bool IsEqual( const T * i_pLeft, const T * i_pRight ) 46 | { 47 | return *i_pLeft == *i_pRight; 48 | } 49 | }; 50 | 51 | template< typename T, unsigned int N > 52 | bool IsEqual( const T ( & i_rpLeft )[ N ], const T ( & i_rpRight )[ N ] ) 53 | { 54 | return VDetail< N >::IsEqual( i_rpLeft, i_rpRight ); 55 | } 56 | 57 | //------------------------------------------------------------------------------------------------- 58 | }; 59 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStreamClient/CGStreamReaderWriter.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | // Class providing asio based socket support for the cg stream 32 | class VCGStreamReaderWriter : public ViconCGStreamIO::VBuffer 33 | { 34 | public: 35 | 36 | VCGStreamReaderWriter( std::shared_ptr< boost::asio::ip::tcp::socket > i_pSocket ); 37 | 38 | VCGStreamReaderWriter( std::shared_ptr< boost::asio::ip::udp::socket > i_pMulticastSocket ); 39 | 40 | // determine if there is data ready to read. Return value indicates if an error occured 41 | bool DataReady( bool & o_rbDataReady ) const; 42 | 43 | // Close the socket 44 | void Close(); 45 | 46 | // Determine if socket is open 47 | bool IsOpen() const; 48 | 49 | // Fill buffer from socket 50 | bool Fill(); 51 | 52 | // Flush buffer to socket 53 | bool Flush(); 54 | 55 | std::shared_ptr< boost::asio::ip::tcp::socket > m_pSocket; 56 | std::shared_ptr< boost::asio::ip::udp::socket > m_pMulticastSocket; 57 | }; 58 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStreamClient/IViconCGStreamClientCallback.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | #include 28 | 29 | class VStaticObjects; 30 | class VDynamicObjects; 31 | 32 | class IViconCGStreamClientCallback 33 | { 34 | public: 35 | virtual void OnConnect(); 36 | virtual void OnStaticObjects( std::shared_ptr< const VStaticObjects > i_pStaticObjects ); 37 | virtual void OnDynamicObjects( std::shared_ptr< const VDynamicObjects > i_pDynamicObjects ); 38 | virtual void OnDisconnect(); 39 | virtual ~IViconCGStreamClientCallback(); 40 | }; 41 | 42 | inline void IViconCGStreamClientCallback::OnConnect() 43 | { 44 | } 45 | 46 | 47 | inline void IViconCGStreamClientCallback::OnStaticObjects( std::shared_ptr< const VStaticObjects > /*i_pStaticObjects*/ ) 48 | { 49 | } 50 | 51 | 52 | inline void IViconCGStreamClientCallback::OnDynamicObjects( std::shared_ptr< const VDynamicObjects > /*i_pDynamicObjects*/ ) 53 | { 54 | } 55 | 56 | inline void IViconCGStreamClientCallback::OnDisconnect() 57 | { 58 | } 59 | 60 | inline IViconCGStreamClientCallback::~IViconCGStreamClientCallback() 61 | { 62 | } 63 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/CameraWand2dDetail.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the Detail of the ViconCGStream::VCameraWand2d class 29 | 30 | #include "Enum.h" 31 | #include 32 | 33 | 34 | namespace ViconCGStreamDetail 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains a wand point 39 | class VCameraWand2d_Point 40 | { 41 | public: 42 | 43 | // Position 44 | ViconCGStreamType::Double m_Position[ 2 ]; 45 | 46 | /// Equality operator 47 | bool operator == ( const VCameraWand2d_Point & i_rOther ) const 48 | { 49 | return m_Position[ 0 ] == i_rOther.m_Position[ 0 ] && 50 | m_Position[ 1 ] == i_rOther.m_Position[ 1 ]; 51 | } 52 | 53 | /// Read function. 54 | bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 55 | { 56 | return i_rBuffer.Read( m_Position ); 57 | } 58 | 59 | /// Write function. 60 | void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 61 | { 62 | i_rBuffer.Write( m_Position ); 63 | } 64 | 65 | }; 66 | 67 | //------------------------------------------------------------------------------------------------- 68 | }; 69 | 70 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/KeepAlive.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VKeepAlive class. 29 | 30 | #include "Item.h" 31 | 32 | namespace ViconCGStream 33 | { 34 | //------------------------------------------------------------------------------------------------- 35 | 36 | /// Keep alive object. 37 | class VKeepAlive : public VItem 38 | { 39 | public: 40 | 41 | /// Equality operator. 42 | bool operator == ( const VKeepAlive & i_rKeepAlive ) const 43 | { 44 | return true; 45 | } 46 | 47 | /// Object type enum. 48 | virtual ViconCGStreamType::Enum TypeID() const 49 | { 50 | return ViconCGStreamEnum::KeepAlive; 51 | } 52 | 53 | /// Filter ID 54 | virtual ViconCGStreamType::UInt32 FilterID() const 55 | { 56 | return FILTER_NA; 57 | } 58 | 59 | /// Read function. 60 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 61 | { 62 | return true; 63 | } 64 | 65 | /// Write function. 66 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 67 | { 68 | } 69 | 70 | }; 71 | 72 | //------------------------------------------------------------------------------------------------- 73 | }; 74 | 75 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/Item.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | #include "Enum.h" 28 | #include 29 | #include "IsEqual.h" 30 | 31 | namespace ViconCGStream 32 | { 33 | //------------------------------------------------------------------------------------------------- 34 | 35 | const ViconCGStreamType::Int32 FILTER_NA = -1; 36 | 37 | /// This is the base class for all top level items 38 | class VItem 39 | { 40 | public: 41 | 42 | /// Type enum 43 | virtual ViconCGStreamType::Enum TypeID() const = 0; 44 | 45 | /// The value used to filter items belonging to a logical group 46 | /// Examples of return values are CameraID, DeviceID, SubjectID, etc. 47 | /// Top-level items that have no affinity with logical children should return FILTER_NA 48 | virtual ViconCGStreamType::UInt32 FilterID() const = 0; 49 | 50 | /// Read function 51 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) = 0; 52 | 53 | // Write function 54 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const = 0; 55 | 56 | // Virtual destructor 57 | virtual ~VItem() 58 | { 59 | } 60 | }; 61 | 62 | //------------------------------------------------------------------------------------------------- 63 | }; 64 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/CameraWand3dDetail.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the Detail of the ViconCGStream::VCameraWand3d class 29 | 30 | #include "Enum.h" 31 | #include 32 | 33 | namespace ViconCGStreamDetail 34 | { 35 | //------------------------------------------------------------------------------------------------- 36 | 37 | /// Contains a wand point 38 | class VCameraWand3d_Point 39 | { 40 | public: 41 | 42 | // Position 43 | ViconCGStreamType::Double m_Position[ 3 ]; 44 | 45 | /// Equality operator 46 | bool operator == ( const VCameraWand3d_Point & i_rOther ) const 47 | { 48 | return m_Position[ 0 ] == i_rOther.m_Position[ 0 ] && 49 | m_Position[ 1 ] == i_rOther.m_Position[ 1 ] && 50 | m_Position[ 2 ] == i_rOther.m_Position[ 2 ]; 51 | } 52 | 53 | /// Read function. 54 | bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 55 | { 56 | return i_rBuffer.Read( m_Position ); 57 | } 58 | 59 | /// Write function. 60 | void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 61 | { 62 | i_rBuffer.Write( m_Position ); 63 | } 64 | 65 | }; 66 | 67 | //------------------------------------------------------------------------------------------------- 68 | }; 69 | 70 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/StopMulticastSender.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VKeepAlive class. 29 | 30 | #include "Item.h" 31 | 32 | namespace ViconCGStream 33 | { 34 | //------------------------------------------------------------------------------------------------- 35 | 36 | /// Stop client multicast session 37 | class VStopMulticastSender : public VItem 38 | { 39 | public: 40 | 41 | /// Equality operator. 42 | bool operator == ( const VStopMulticastSender & /*i_rVStopMulticastSender*/ ) const 43 | { 44 | return true; 45 | } 46 | 47 | /// Object type enum. 48 | virtual ViconCGStreamType::Enum TypeID() const 49 | { 50 | return ViconCGStreamEnum::StopMulticastSender; 51 | } 52 | 53 | /// Filter ID 54 | virtual ViconCGStreamType::UInt32 FilterID() const 55 | { 56 | return FILTER_NA; 57 | } 58 | 59 | /// Read function. 60 | virtual bool Read( const ViconCGStreamIO::VBuffer & /*i_rBuffer*/ ) 61 | { 62 | return true; 63 | } 64 | 65 | /// Write function. 66 | virtual void Write( ViconCGStreamIO::VBuffer & /*i_rBuffer*/ ) const 67 | { 68 | } 69 | 70 | }; 71 | 72 | //------------------------------------------------------------------------------------------------- 73 | }; 74 | 75 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/RequestNextFrame.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | #include "Item.h" 28 | 29 | namespace ViconCGStream 30 | { 31 | //------------------------------------------------------------------------------------------------- 32 | 33 | /// Used by the client to request the next frame of data. 34 | class VRequestNextFrame : public VItem 35 | { 36 | public: 37 | 38 | /// Number of frames to request. 39 | unsigned int m_bNumber = 1; 40 | 41 | /// Equality operator 42 | bool operator == ( const VRequestNextFrame & i_rOther ) const 43 | { 44 | return m_bNumber == i_rOther.m_bNumber; 45 | } 46 | 47 | /// Object type enum. 48 | virtual ViconCGStreamType::Enum TypeID() const 49 | { 50 | return ViconCGStreamEnum::RequestNextFrame; 51 | } 52 | 53 | /// Filter ID 54 | virtual ViconCGStreamType::UInt32 FilterID() const 55 | { 56 | return FILTER_NA; 57 | } 58 | 59 | /// Read function. 60 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 61 | { 62 | return i_rBuffer.Read( m_bNumber ); 63 | } 64 | 65 | /// Write function. 66 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 67 | { 68 | i_rBuffer.Write( m_bNumber ); 69 | } 70 | 71 | }; 72 | 73 | //------------------------------------------------------------------------------------------------- 74 | }; 75 | 76 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/Ping.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VPing class. 29 | 30 | #include "Item.h" 31 | 32 | namespace ViconCGStream 33 | { 34 | //------------------------------------------------------------------------------------------------- 35 | 36 | /// Ping object. 37 | class VPing : public VItem 38 | { 39 | public: 40 | 41 | /// Stream frame number 42 | ViconCGStreamType::UInt64 m_PingID; 43 | 44 | /// Equality operator. 45 | bool operator == ( const VPing & i_rOther ) const 46 | { 47 | return m_PingID == i_rOther.m_PingID; 48 | } 49 | 50 | /// Object type enum. 51 | virtual ViconCGStreamType::Enum TypeID() const 52 | { 53 | return ViconCGStreamEnum::Ping; 54 | } 55 | 56 | /// Filter ID 57 | virtual ViconCGStreamType::UInt32 FilterID() const 58 | { 59 | return FILTER_NA; 60 | } 61 | 62 | /// Read function. 63 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 64 | { 65 | return i_rBuffer.Read( m_PingID ); 66 | } 67 | 68 | /// Write function. 69 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 70 | { 71 | i_rBuffer.Write( m_PingID ); 72 | } 73 | 74 | }; 75 | 76 | //------------------------------------------------------------------------------------------------- 77 | }; 78 | 79 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/RequestFrame.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | #include "Item.h" 28 | #include 29 | 30 | namespace ViconCGStream 31 | { 32 | //------------------------------------------------------------------------------------------------- 33 | 34 | /// Used by the client to request a new frame of data and to control streaming mode 35 | class VRequestFrame : public VItem 36 | { 37 | public: 38 | 39 | /// Streaming mode 40 | bool m_bStreaming; 41 | 42 | /// Equality operator 43 | bool operator == ( const VRequestFrame & i_rOther ) const 44 | { 45 | return m_bStreaming == i_rOther.m_bStreaming; 46 | } 47 | 48 | /// Object type enum. 49 | virtual ViconCGStreamType::Enum TypeID() const 50 | { 51 | return ViconCGStreamEnum::RequestFrame; 52 | } 53 | 54 | /// Filter ID 55 | virtual ViconCGStreamType::UInt32 FilterID() const 56 | { 57 | return FILTER_NA; 58 | } 59 | 60 | /// Read function. 61 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 62 | { 63 | return i_rBuffer.Read( m_bStreaming ); 64 | } 65 | 66 | /// Write function. 67 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 68 | { 69 | i_rBuffer.Write( m_bStreaming ); 70 | } 71 | 72 | }; 73 | 74 | //------------------------------------------------------------------------------------------------- 75 | }; 76 | 77 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/ApexHaptics.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | #include "Item.h" 28 | #include 29 | 30 | namespace ViconCGStream 31 | { 32 | //------------------------------------------------------------------------------------------------- 33 | 34 | /// Used by the client to enable and disable haptics on Apex device. 35 | class VApexHaptics : public VItem 36 | { 37 | public: 38 | 39 | /// List of devices with haptics feedback on 40 | std::set< unsigned int > m_OnDevicesList; 41 | 42 | 43 | /// Equality operator 44 | bool operator == ( const VApexHaptics & i_rOther ) const 45 | { 46 | return m_OnDevicesList == i_rOther.m_OnDevicesList; 47 | } 48 | 49 | /// Object type enum. 50 | virtual ViconCGStreamType::Enum TypeID() const 51 | { 52 | return ViconCGStreamEnum::ApexHaptics; 53 | } 54 | 55 | /// Filter ID 56 | virtual ViconCGStreamType::UInt32 FilterID() const 57 | { 58 | return FILTER_NA; 59 | } 60 | 61 | /// Read function. 62 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 63 | { 64 | return i_rBuffer.Read( m_OnDevicesList ); 65 | } 66 | 67 | /// Write function. 68 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 69 | { 70 | i_rBuffer.Write( m_OnDevicesList ); 71 | } 72 | 73 | }; 74 | 75 | //------------------------------------------------------------------------------------------------- 76 | }; 77 | 78 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/FrameRateInfo.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VLatencyInfo class. 29 | 30 | #include "Item.h" 31 | 32 | namespace ViconCGStream 33 | { 34 | //------------------------------------------------------------------------------------------------- 35 | 36 | /// Contains the latency samples taken 37 | class VFrameRateInfo : public VItem 38 | { 39 | public: 40 | /// Samples 41 | std::map< std::string, double > m_FrameRates; 42 | 43 | /// Equality operator 44 | bool operator == ( const VFrameRateInfo& i_rOther ) const 45 | { 46 | return ( m_FrameRates == i_rOther.m_FrameRates ); 47 | } 48 | 49 | /// Object type enum. 50 | virtual ViconCGStreamType::Enum TypeID() const 51 | { 52 | return ViconCGStreamEnum::FrameRateInfo; 53 | } 54 | 55 | /// Filter ID 56 | virtual ViconCGStreamType::UInt32 FilterID() const 57 | { 58 | return FILTER_NA; 59 | } 60 | 61 | /// Read function. 62 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 63 | { 64 | return i_rBuffer.Read( m_FrameRates ); 65 | } 66 | 67 | /// Write function. 68 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 69 | { 70 | i_rBuffer.Write( m_FrameRates ); 71 | } 72 | 73 | }; 74 | 75 | //------------------------------------------------------------------------------------------------- 76 | }; 77 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/FrameInfo.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VFrameInfo class. 29 | 30 | #include "Item.h" 31 | 32 | namespace ViconCGStream 33 | { 34 | //------------------------------------------------------------------------------------------------- 35 | 36 | /// Contains the master frame number for the current frame of objects. 37 | class VFrameInfo : public VItem 38 | { 39 | public: 40 | 41 | /// Stream frame number 42 | ViconCGStreamType::UInt32 m_FrameID; 43 | 44 | /// Equality operator 45 | bool operator == ( const VFrameInfo & i_rOther ) const 46 | { 47 | return m_FrameID == i_rOther.m_FrameID; 48 | } 49 | 50 | /// Object type enum. 51 | virtual ViconCGStreamType::Enum TypeID() const 52 | { 53 | return ViconCGStreamEnum::FrameInfo; 54 | } 55 | 56 | /// Filter ID 57 | virtual ViconCGStreamType::UInt32 FilterID() const 58 | { 59 | return FILTER_NA; 60 | } 61 | 62 | /// Read function. 63 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 64 | { 65 | return i_rBuffer.Read( m_FrameID ); 66 | } 67 | 68 | /// Write function. 69 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 70 | { 71 | i_rBuffer.Write( m_FrameID ); 72 | } 73 | 74 | }; 75 | 76 | //------------------------------------------------------------------------------------------------- 77 | }; 78 | 79 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/EdgePairsDetail.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the detail declaration of the ViconCGStream::VEdgePairs class. 29 | 30 | #include "Enum.h" 31 | #include 32 | #include "IsEqual.h" 33 | 34 | namespace ViconCGStreamDetail 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains a frame of edge pairs, along with the camera identifier and frame number. 39 | class VEdgePairs_EdgePair 40 | { 41 | public: 42 | 43 | /// 2D position 44 | ViconCGStreamType::Int16 m_Position[ 2 ]; 45 | 46 | /// Number of pixels in the line 47 | ViconCGStreamType::UInt16 m_Length; 48 | 49 | /// Equality operator 50 | bool operator == ( const VEdgePairs_EdgePair & i_rOther ) const 51 | { 52 | return IsEqual( m_Position, i_rOther.m_Position ) && 53 | m_Length == i_rOther.m_Length; 54 | } 55 | 56 | /// Read function. 57 | bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 58 | { 59 | return i_rBuffer.Read( m_Position ) && 60 | i_rBuffer.Read( m_Length ); 61 | } 62 | 63 | /// Write function. 64 | void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 65 | { 66 | i_rBuffer.Write( m_Position ); 67 | i_rBuffer.Write( m_Length ); 68 | } 69 | }; 70 | 71 | //------------------------------------------------------------------------------------------------- 72 | }; 73 | 74 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/LatencyInfo.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VLatencyInfo class. 29 | 30 | #include "Item.h" 31 | #include "LatencyInfoDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains the latency samples taken 39 | class VLatencyInfo : public VItem 40 | { 41 | public: 42 | /// Samples 43 | std::vector< ViconCGStreamDetail::VLatencyInfo_Sample > m_Samples; 44 | 45 | /// Equality operator 46 | bool operator == ( const VLatencyInfo& i_rOther ) const 47 | { 48 | return ( m_Samples == i_rOther.m_Samples ); 49 | } 50 | 51 | /// Object type enum. 52 | virtual ViconCGStreamType::Enum TypeID() const 53 | { 54 | return ViconCGStreamEnum::LatencyInfo; 55 | } 56 | 57 | /// Filter ID 58 | virtual ViconCGStreamType::UInt32 FilterID() const 59 | { 60 | return FILTER_NA; 61 | } 62 | 63 | /// Read function. 64 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 65 | { 66 | return i_rBuffer.Read( m_Samples ); 67 | } 68 | 69 | /// Write function. 70 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 71 | { 72 | i_rBuffer.Write( m_Samples ); 73 | } 74 | 75 | }; 76 | 77 | //------------------------------------------------------------------------------------------------- 78 | }; 79 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/StreamInfo.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VStreamInfo class. 29 | 30 | #include "Item.h" 31 | 32 | namespace ViconCGStream 33 | { 34 | //------------------------------------------------------------------------------------------------- 35 | 36 | /// Contains the master frame period. 37 | class VStreamInfo : public VItem 38 | { 39 | public: 40 | 41 | /// Stream frame period. Defined as the numbers of ticks per frame on a 135Mhz clock. 42 | ViconCGStreamType::Int64 m_FramePeriod; 43 | 44 | /// Equality operator 45 | bool operator == ( const VStreamInfo& i_rOther ) const 46 | { 47 | return m_FramePeriod == i_rOther.m_FramePeriod; 48 | } 49 | 50 | /// Object type enum. 51 | virtual ViconCGStreamType::Enum TypeID() const 52 | { 53 | return ViconCGStreamEnum::StreamInfo; 54 | } 55 | 56 | /// Filter ID 57 | virtual ViconCGStreamType::UInt32 FilterID() const 58 | { 59 | return FILTER_NA; 60 | } 61 | 62 | /// Read function. 63 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 64 | { 65 | return i_rBuffer.Read( m_FramePeriod ); 66 | } 67 | 68 | /// Write function. 69 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 70 | { 71 | i_rBuffer.Write( m_FramePeriod ); 72 | } 73 | 74 | }; 75 | 76 | //------------------------------------------------------------------------------------------------- 77 | }; 78 | 79 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/SubjectScaleDetail.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | namespace ViconCGStreamDetail 32 | { 33 | //------------------------------------------------------------------------------------------------- 34 | 35 | /// (Member of VSubjectScale) Contains scale information 36 | class VSubjectScale_Segment 37 | { 38 | public: 39 | /// Segment identifier 40 | ViconCGStreamType::UInt32 m_SegmentID; 41 | 42 | /// Scale of segment in x,y,z 43 | ViconCGStreamType::Double m_Scale[ 3 ]; 44 | 45 | bool IsEqual( const VSubjectScale_Segment & i_rOther ) const 46 | { 47 | return m_SegmentID == i_rOther.m_SegmentID && 48 | ViconCGStreamDetail::IsEqual(m_Scale, i_rOther.m_Scale); 49 | } 50 | 51 | /// Equality operator 52 | bool operator == ( const VSubjectScale_Segment & i_rOther ) const 53 | { 54 | return IsEqual( i_rOther ); 55 | } 56 | 57 | /// Read function. 58 | bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 59 | { 60 | return i_rBuffer.Read( m_SegmentID ) && 61 | i_rBuffer.Read(m_Scale); 62 | } 63 | 64 | /// Write function. 65 | void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 66 | { 67 | i_rBuffer.Write( m_SegmentID ); 68 | i_rBuffer.Write(m_Scale); 69 | } 70 | }; 71 | 72 | //------------------------------------------------------------------------------------------------- 73 | }; 74 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/ObjectEnums.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VObjectEnums class. 29 | 30 | #include "Item.h" 31 | #include 32 | 33 | namespace ViconCGStream 34 | { 35 | //------------------------------------------------------------------------------------------------- 36 | 37 | /// Used by the server to declare the available object identifiers, and by the client to enable/disable objects. 38 | class VObjectEnums : public VItem 39 | { 40 | public: 41 | 42 | /// Object enums 43 | std::set< ViconCGStreamType::Enum > m_Enums; 44 | 45 | // Equality operator 46 | bool operator == ( const VObjectEnums & i_rOther ) const 47 | { 48 | return m_Enums == i_rOther.m_Enums; 49 | } 50 | 51 | /// Object type enum. 52 | virtual ViconCGStreamType::Enum TypeID() const 53 | { 54 | return ViconCGStreamEnum::ObjectEnums; 55 | } 56 | 57 | /// Filter ID 58 | virtual ViconCGStreamType::UInt32 FilterID() const 59 | { 60 | return FILTER_NA; 61 | } 62 | 63 | /// Read function. 64 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 65 | { 66 | return i_rBuffer.Read( m_Enums ); 67 | } 68 | 69 | /// Write function. 70 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 71 | { 72 | i_rBuffer.Write( m_Enums ); 73 | } 74 | 75 | }; 76 | 77 | //------------------------------------------------------------------------------------------------- 78 | }; 79 | 80 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/StreamCommon/Type.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStreamType namespace. 29 | 30 | /** 31 | * This namespace defines the set of primitive types used by the protocol Readers and Writers, and 32 | * also by the objects defined in the ViconCGStream namespace. 33 | * 34 | * See ViconCGStreamIO::VReader, ViconCGStreamIO::VWriter. 35 | */ 36 | namespace ViconCGStreamType 37 | { 38 | //------------------------------------------------------------------------------------------------- 39 | 40 | /// Single 8-bit character. 41 | typedef char Char; 42 | /// 8-bit signed integer. 43 | typedef char Int8; 44 | /// 16-bit signed integer. 45 | typedef short Int16; 46 | /// 32-bit signed integer. 47 | typedef int Int32; 48 | /// 64-bit signed integer. 49 | typedef long long Int64; 50 | 51 | /// 8-bit unsigned integer. 52 | typedef unsigned char UInt8; 53 | /// 16-bit unsigned integer. 54 | typedef unsigned short UInt16; 55 | /// 32-bit unsigned integer. 56 | typedef unsigned int UInt32; 57 | /// 64-bit unsigned integer. 58 | typedef unsigned long long UInt64; 59 | 60 | /// 32-bit IEEE-format floating-point number. 61 | typedef float Float; 62 | /// 64-bit IEEE-format floating-point number. 63 | typedef double Double; 64 | 65 | /** This is a special type to distinguish members of the ViconCGStreamEnum namespace from other 66 | * primitives in the stream. 67 | */ 68 | typedef UInt32 Enum; 69 | 70 | //------------------------------------------------------------------------------------------------- 71 | }; 72 | 73 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconDataStreamSDKCore/SegmentPoseReader.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | #include 28 | 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | 35 | namespace ViconDataStreamSDK 36 | { 37 | namespace Core 38 | { 39 | class VSegmentPoseReader 40 | { 41 | public: 42 | VSegmentPoseReader(); 43 | 44 | bool Load(const std::string & i_rFile); 45 | bool Read( std::istream & i_rStream ); 46 | void GenerateTestData(unsigned int i_NumFrames, double i_FrameRate, double i_TransmissionLatency, double i_TransmissionJitter, double i_TransmissionSpike, int i_TransmissionSpikeFrequency); 47 | 48 | unsigned int StartFrame() const; 49 | unsigned int EndFrame() const; 50 | unsigned int FrameCount() const; 51 | unsigned int SubjectCount() const; 52 | 53 | bool SubjectName(unsigned int i_Index, std::string & i_rName) const; 54 | 55 | std::shared_ptr< VSubjectPose > PoseAt(unsigned int i_Frame, const std::string & i_rSubject) const; 56 | bool FrameIndexClosestToTime( double i_Time, unsigned int & o_rFrame ) const; 57 | private: 58 | 59 | std::shared_ptr< VSubjectPose > ReadLine(const std::string & i_rLine, const std::vector< std::string > & i_rHeaderItems ) const; 60 | 61 | std::vector< std::string > m_Subjects; 62 | std::map< unsigned int, std::map< std::string, std::shared_ptr< VSubjectPose > > > m_Data; 63 | std::map< double, unsigned int > m_FrameToTime; 64 | }; 65 | } 66 | } 67 | 68 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/HardwareFrameInfo.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VHardwareFrameInfo class. 29 | 30 | #include "Item.h" 31 | 32 | namespace ViconCGStream 33 | { 34 | //------------------------------------------------------------------------------------------------- 35 | 36 | /// Contains the native hardware frame number for the current frame. 37 | /// This is typically for debugging purposes - most users should use VFrameInfo. 38 | class VHardwareFrameInfo : public VItem 39 | { 40 | public: 41 | 42 | /// Stream frame number 43 | ViconCGStreamType::UInt32 m_HardwareFrame; 44 | 45 | /// Equality operator 46 | bool operator == ( const VHardwareFrameInfo & i_rOther ) const 47 | { 48 | return m_HardwareFrame == i_rOther.m_HardwareFrame; 49 | } 50 | 51 | /// Object type enum. 52 | virtual ViconCGStreamType::Enum TypeID() const 53 | { 54 | return ViconCGStreamEnum::HardwareFrameInfo; 55 | } 56 | 57 | /// Filter ID 58 | virtual ViconCGStreamType::UInt32 FilterID() const 59 | { 60 | return FILTER_NA; 61 | } 62 | 63 | /// Read function. 64 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 65 | { 66 | return i_rBuffer.Read( m_HardwareFrame ); 67 | } 68 | 69 | /// Write function. 70 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 71 | { 72 | i_rBuffer.Write( m_HardwareFrame ); 73 | } 74 | 75 | }; 76 | 77 | //------------------------------------------------------------------------------------------------- 78 | }; 79 | 80 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/LatencyInfoDetail.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the details declaration of the ViconCGStream::VLatencyInfo class. 29 | 30 | #include "Enum.h" 31 | #include 32 | #include "IsEqual.h" 33 | 34 | namespace ViconCGStreamDetail 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains a string and a duration in seconds since the previous sample was taken 39 | class VLatencyInfo_Sample 40 | { 41 | public: 42 | /// Sample name 43 | std::string m_Name; 44 | 45 | /// Duration in seconds since the previous sample was taken 46 | ViconCGStreamType::Double m_Latency; 47 | 48 | /// Equality function 49 | bool IsEqual( const VLatencyInfo_Sample & i_rOther ) const 50 | { 51 | return m_Name == i_rOther.m_Name && 52 | m_Latency == i_rOther.m_Latency; 53 | } 54 | 55 | /// Equality operator 56 | bool operator == ( const VLatencyInfo_Sample & i_rOther ) const 57 | { 58 | return IsEqual( i_rOther ); 59 | } 60 | 61 | /// Read function. 62 | bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 63 | { 64 | return i_rBuffer.Read( m_Name ) && 65 | i_rBuffer.Read( m_Latency ); 66 | } 67 | 68 | /// Write function. 69 | void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 70 | { 71 | i_rBuffer.Write( m_Name ); 72 | i_rBuffer.Write( m_Latency ); 73 | } 74 | }; 75 | 76 | //------------------------------------------------------------------------------------------------- 77 | 78 | }; 79 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/LabeledRecons.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VLabeledRecons class. 29 | 30 | #include "Item.h" 31 | #include "LabeledReconsDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains a frame of labeled recons, consisting of subject and marker identifiers, radii, positions and covariances. 39 | class VLabeledRecons : public VItem 40 | { 41 | public: 42 | 43 | /// Labeled recons 44 | std::vector< ViconCGStreamDetail::VLabeledRecons_LabeledRecon > m_LabeledRecons; 45 | 46 | /// Equality operator 47 | bool operator == ( const VLabeledRecons & i_rOther ) const 48 | { 49 | return m_LabeledRecons == i_rOther.m_LabeledRecons; 50 | } 51 | 52 | /// Object type enum. 53 | virtual ViconCGStreamType::Enum TypeID() const 54 | { 55 | return ViconCGStreamEnum::LabeledRecons; 56 | } 57 | 58 | /// Filter ID 59 | virtual ViconCGStreamType::UInt32 FilterID() const 60 | { 61 | return FILTER_NA; 62 | } 63 | 64 | /// Read function. 65 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 66 | { 67 | return i_rBuffer.Read( m_LabeledRecons ); 68 | } 69 | 70 | /// Write function. 71 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 72 | { 73 | i_rBuffer.Write( m_LabeledRecons ); 74 | } 75 | 76 | }; 77 | 78 | //------------------------------------------------------------------------------------------------- 79 | }; 80 | 81 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/LabeledReconRayAssignments.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VLabeledReconRayAssignments class. 29 | 30 | #include "Item.h" 31 | #include "ReconRayAssignmentsDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Labeled ray assignments 39 | class VLabeledReconRayAssignments : public VItem 40 | { 41 | public: 42 | /// Recon ray assignments. 43 | std::vector< ViconCGStreamDetail::VReconRayAssignments > m_ReconRayAssignments; 44 | 45 | /// Equality operator. 46 | bool operator == ( const VLabeledReconRayAssignments & i_rOther ) const 47 | { 48 | return m_ReconRayAssignments == i_rOther.m_ReconRayAssignments; 49 | } 50 | 51 | /// Object type enum. 52 | virtual ViconCGStreamType::Enum TypeID() const { 53 | return ViconCGStreamEnum::LabeledReconRayAssignments; 54 | } 55 | 56 | /// Filter ID 57 | virtual ViconCGStreamType::UInt32 FilterID() const 58 | { 59 | return FILTER_NA; 60 | } 61 | 62 | /// Read function. 63 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 64 | { 65 | return i_rBuffer.Read( m_ReconRayAssignments ); 66 | } 67 | 68 | /// Write function. 69 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 70 | { 71 | i_rBuffer.Write( m_ReconRayAssignments ); 72 | } 73 | 74 | }; 75 | 76 | //------------------------------------------------------------------------------------------------- 77 | } 78 | 79 | 80 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/UnlabeledRecons.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VUnlabeledRecons class. 29 | 30 | #include "Item.h" 31 | #include "UnlabeledReconsDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains a frame of unlabeled recons, consisting of radii, positions and covariances. 39 | class VUnlabeledRecons : public VItem 40 | { 41 | public: 42 | 43 | /// Unlabeled recons 44 | std::vector< ViconCGStreamDetail::VUnlabeledRecons_UnlabeledRecon > m_UnlabeledRecons; 45 | 46 | /// Equality operator 47 | bool operator == ( const VUnlabeledRecons & i_rOther ) const 48 | { 49 | return m_UnlabeledRecons == i_rOther.m_UnlabeledRecons; 50 | } 51 | 52 | /// Object type enum. 53 | virtual ViconCGStreamType::Enum TypeID() const 54 | { 55 | return ViconCGStreamEnum::UnlabeledRecons; 56 | } 57 | 58 | /// Filter ID 59 | virtual ViconCGStreamType::UInt32 FilterID() const 60 | { 61 | return FILTER_NA; 62 | } 63 | 64 | /// Read function. 65 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 66 | { 67 | return i_rBuffer.Read( m_UnlabeledRecons ); 68 | } 69 | 70 | /// Write function. 71 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 72 | { 73 | i_rBuffer.Write( m_UnlabeledRecons ); 74 | } 75 | 76 | }; 77 | 78 | //------------------------------------------------------------------------------------------------- 79 | }; 80 | 81 | 82 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/UnlabeledReconRayAssignments.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VUnlabeledReconRayAssignments class. 29 | 30 | #include "Item.h" 31 | #include "ReconRayAssignmentsDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Unlabeled ray assignments 39 | class VUnlabeledReconRayAssignments : public VItem 40 | { 41 | public: 42 | 43 | /// Recon ray assignments. 44 | std::vector< ViconCGStreamDetail::VReconRayAssignments > m_ReconRayAssignments; 45 | 46 | /// Equality operator. 47 | bool operator == ( const VUnlabeledReconRayAssignments & i_rOther ) 48 | { 49 | return m_ReconRayAssignments == i_rOther.m_ReconRayAssignments; 50 | } 51 | 52 | /// Object type enum. 53 | virtual ViconCGStreamType::Enum TypeID() const { 54 | return ViconCGStreamEnum::UnlabeledReconRayAssignments; 55 | } 56 | 57 | /// Filter ID 58 | virtual ViconCGStreamType::UInt32 FilterID() const 59 | { 60 | return FILTER_NA; 61 | } 62 | 63 | /// Read function. 64 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 65 | { 66 | return i_rBuffer.Read( m_ReconRayAssignments ); 67 | } 68 | 69 | /// Write function. 70 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 71 | { 72 | i_rBuffer.Write( m_ReconRayAssignments ); 73 | } 74 | 75 | }; 76 | 77 | //------------------------------------------------------------------------------------------------- 78 | } 79 | 80 | 81 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStreamClient/CGStreamPostalService.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | 33 | 34 | class VCGStreamPostalService 35 | { 36 | public: 37 | void Post( const std::function< void() >& i_rFunction ) const 38 | { 39 | boost::asio::post( *m_pIOContext, i_rFunction ); 40 | } 41 | 42 | bool StartService() 43 | { 44 | boost::mutex::scoped_lock Lock( m_Mutex ); 45 | if( !m_pIOContext ) 46 | { 47 | m_pIOContext = std::make_shared< boost::asio::io_context >(); 48 | } 49 | 50 | if( !m_pWorkGuard ) 51 | { 52 | m_pWorkGuard = std::make_unique< TWorkGuard >( boost::asio::make_work_guard( *m_pIOContext ) ); 53 | m_Thread = boost::thread( std::bind( &VCGStreamPostalService::ThreadFunction, this ) ); 54 | } 55 | 56 | return true; 57 | } 58 | 59 | bool StopService() 60 | { 61 | boost::mutex::scoped_lock Lock( m_Mutex ); 62 | if( m_pWorkGuard ) 63 | { 64 | m_pWorkGuard.reset(); 65 | m_Thread.join(); 66 | m_pIOContext->restart(); 67 | return true; 68 | } 69 | return false; 70 | } 71 | 72 | void ThreadFunction() 73 | { 74 | m_pIOContext->run(); 75 | } 76 | 77 | private: 78 | using TWorkGuard = decltype( boost::asio::make_work_guard( std::declval< boost::asio::io_context& >() ) ); 79 | mutable boost::mutex m_Mutex; 80 | std::shared_ptr< boost::asio::io_context > m_pIOContext; 81 | std::unique_ptr< TWorkGuard > m_pWorkGuard; 82 | boost::thread m_Thread; 83 | }; 84 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/CentroidsDetail.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the details declaration of the ViconCGStream::VCentroids class. 29 | 30 | #include "Enum.h" 31 | #include 32 | 33 | namespace ViconCGStreamDetail 34 | { 35 | //------------------------------------------------------------------------------------------------- 36 | 37 | /// Contains the circle position, radius and accuracy 38 | class VCentroids_Centroid 39 | { 40 | public: 41 | /// Circle position 42 | ViconCGStreamType::Double m_Position[ 2 ]; 43 | 44 | /// Circle radius 45 | ViconCGStreamType::Double m_Radius; 46 | 47 | /// Circle accuracy 48 | ViconCGStreamType::Double m_Accuracy; 49 | 50 | // Equality operator 51 | bool operator == ( const VCentroids_Centroid & i_rOther ) const 52 | { 53 | return m_Position[ 0 ] == i_rOther.m_Position[ 0 ] && 54 | m_Position[ 1 ] == i_rOther.m_Position[ 1 ] && 55 | m_Radius == i_rOther.m_Radius && 56 | m_Accuracy == i_rOther.m_Accuracy; 57 | } 58 | 59 | /// Read function. 60 | bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 61 | { 62 | return i_rBuffer.Read( m_Position ) && 63 | i_rBuffer.Read( m_Radius ) && 64 | i_rBuffer.Read( m_Accuracy ); 65 | } 66 | 67 | /// Write function. 68 | void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 69 | { 70 | i_rBuffer.Write( m_Position ); 71 | i_rBuffer.Write( m_Radius ); 72 | i_rBuffer.Write( m_Accuracy ); 73 | } 74 | }; 75 | 76 | //------------------------------------------------------------------------------------------------- 77 | }; 78 | 79 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/GlobalSegments.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VGlobalSegments class. 29 | 30 | #include "Item.h" 31 | #include "GlobalSegmentsDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains a vector of segment global poses for a single subject. 39 | class VGlobalSegments : public VItem 40 | { 41 | public: 42 | 43 | /// Subject identifier 44 | ViconCGStreamType::UInt32 m_SubjectID; 45 | 46 | /// Global segments 47 | std::vector< ViconCGStreamDetail::VGlobalSegments_Segment > m_Segments; 48 | 49 | // Equality operator 50 | bool operator == ( const VGlobalSegments & i_rOther ) const 51 | { 52 | return m_Segments == i_rOther.m_Segments; 53 | } 54 | 55 | /// Object type enum. 56 | virtual ViconCGStreamType::Enum TypeID() const 57 | { 58 | return ViconCGStreamEnum::GlobalSegments; 59 | } 60 | 61 | /// Filter ID 62 | virtual ViconCGStreamType::UInt32 FilterID() const 63 | { 64 | return m_SubjectID; 65 | } 66 | 67 | /// Read function. 68 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 69 | { 70 | return i_rBuffer.Read( m_SubjectID ) && 71 | i_rBuffer.Read( m_Segments ); 72 | } 73 | 74 | /// Write function. 75 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 76 | { 77 | i_rBuffer.Write( m_SubjectID ); 78 | i_rBuffer.Write( m_Segments ); 79 | } 80 | 81 | }; 82 | 83 | //------------------------------------------------------------------------------------------------- 84 | }; 85 | 86 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/GlobalSegmentsDetail.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the detail declaration of the ViconCGStream::VGlobalSegments class. 29 | 30 | #include "Enum.h" 31 | #include 32 | #include "IsEqual.h" 33 | 34 | namespace ViconCGStreamDetail 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | class VGlobalSegments_Segment 39 | { 40 | public: 41 | /// Segment identifier 42 | ViconCGStreamType::UInt32 m_SegmentID; 43 | 44 | /// Segment translation from the world origin 45 | ViconCGStreamType::Double m_Translation[ 3 ]; 46 | 47 | /// Segment rotation matrix (row major format) 48 | ViconCGStreamType::Double m_Rotation[ 9 ]; 49 | 50 | // Equality operator 51 | bool operator == ( const VGlobalSegments_Segment & i_rOther ) const 52 | { 53 | return m_SegmentID == i_rOther.m_SegmentID && 54 | ViconCGStreamDetail::IsEqual( m_Translation, i_rOther.m_Translation ) && 55 | ViconCGStreamDetail::IsEqual( m_Rotation, i_rOther.m_Rotation ); 56 | } 57 | 58 | /// Read function. 59 | bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 60 | { 61 | return i_rBuffer.Read( m_SegmentID ) && 62 | i_rBuffer.Read( m_Translation ) && 63 | i_rBuffer.Read( m_Rotation ); 64 | } 65 | 66 | /// Write function. 67 | void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 68 | { 69 | i_rBuffer.Write( m_SegmentID ); 70 | i_rBuffer.Write( m_Translation ); 71 | i_rBuffer.Write( m_Rotation ); 72 | } 73 | }; 74 | 75 | //------------------------------------------------------------------------------------------------- 76 | }; 77 | 78 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/LightweightSegmentsDetail.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the detail declaration of the ViconCGStream::VGlobalSegments class. 29 | 30 | #include "Enum.h" 31 | #include 32 | #include "IsEqual.h" 33 | 34 | namespace ViconCGStreamDetail 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | class VLightweightSegments_Segment 39 | { 40 | public: 41 | /// Segment identifier 42 | ViconCGStreamType::UInt32 m_SegmentID; 43 | 44 | /// Segment translation from the world origin 45 | ViconCGStreamType::Float m_Translation[ 3 ]; 46 | 47 | /// Segment rotation as angle axis 48 | ViconCGStreamType::Float m_Rotation[ 3 ]; 49 | 50 | // Equality operator 51 | bool operator == ( const VLightweightSegments_Segment & i_rOther ) const 52 | { 53 | return m_SegmentID == i_rOther.m_SegmentID && 54 | ViconCGStreamDetail::IsEqual( m_Translation, i_rOther.m_Translation ) && 55 | ViconCGStreamDetail::IsEqual( m_Rotation, i_rOther.m_Rotation ); 56 | } 57 | 58 | /// Read function. 59 | bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 60 | { 61 | return i_rBuffer.Read( m_SegmentID ) && 62 | i_rBuffer.Read( m_Translation ) && 63 | i_rBuffer.Read( m_Rotation ); 64 | } 65 | 66 | /// Write function. 67 | void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 68 | { 69 | i_rBuffer.Write( m_SegmentID ); 70 | i_rBuffer.Write( m_Translation ); 71 | i_rBuffer.Write( m_Rotation ); 72 | } 73 | }; 74 | 75 | //------------------------------------------------------------------------------------------------- 76 | }; 77 | 78 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/ObjectQuality.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VObjectQuality class. 29 | 30 | #include "Item.h" 31 | #include 32 | 33 | namespace ViconCGStream 34 | { 35 | //------------------------------------------------------------------------------------------------- 36 | 37 | /// Contains a quality estimate for a single object. 38 | class VObjectQuality : public VItem 39 | { 40 | public: 41 | 42 | /// Subject identifier 43 | ViconCGStreamType::UInt32 m_SubjectID; 44 | 45 | /// Quality estimate from 0.0 (bad) to 1.0 (excellent). 46 | ViconCGStreamType::Double m_ObjectQuality; 47 | 48 | /// Equality operator 49 | bool operator == ( const VObjectQuality& i_rOther ) const 50 | { 51 | return ( m_SubjectID == i_rOther.m_SubjectID ) && 52 | ( m_ObjectQuality == i_rOther.m_ObjectQuality ); 53 | } 54 | 55 | /// Object type enum. 56 | virtual ViconCGStreamType::Enum TypeID() const 57 | { 58 | return ViconCGStreamEnum::ObjectQuality; 59 | } 60 | 61 | /// Filter ID 62 | virtual ViconCGStreamType::UInt32 FilterID() const 63 | { 64 | return m_SubjectID; 65 | } 66 | 67 | /// Read function. 68 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 69 | { 70 | return i_rBuffer.Read( m_SubjectID ) && 71 | i_rBuffer.Read( m_ObjectQuality ); 72 | } 73 | 74 | /// Write function. 75 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 76 | { 77 | i_rBuffer.Write( m_SubjectID ); 78 | i_rBuffer.Write( m_ObjectQuality ); 79 | } 80 | 81 | }; 82 | 83 | //------------------------------------------------------------------------------------------------- 84 | }; 85 | 86 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/LightweightSegments.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VGlobalSegments class. 29 | 30 | #include "Item.h" 31 | #include "LightweightSegmentsDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains a vector of segment global poses for a single subject, using a more compact representation than VGlobalSegments 39 | class VLightweightSegments : public VItem 40 | { 41 | public: 42 | 43 | /// Subject identifier 44 | ViconCGStreamType::UInt32 m_SubjectID; 45 | 46 | /// Global segments 47 | std::vector< ViconCGStreamDetail::VLightweightSegments_Segment > m_Segments; 48 | 49 | // Equality operator 50 | bool operator == ( const VLightweightSegments & i_rOther ) const 51 | { 52 | return m_Segments == i_rOther.m_Segments; 53 | } 54 | 55 | /// Object type enum. 56 | virtual ViconCGStreamType::Enum TypeID() const 57 | { 58 | return ViconCGStreamEnum::LightweightSegments; 59 | } 60 | 61 | /// Filter ID 62 | virtual ViconCGStreamType::UInt32 FilterID() const 63 | { 64 | return m_SubjectID; 65 | } 66 | 67 | /// Read function. 68 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 69 | { 70 | return i_rBuffer.Read( m_SubjectID ) && 71 | i_rBuffer.Read( m_Segments ); 72 | } 73 | 74 | /// Write function. 75 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 76 | { 77 | i_rBuffer.Write( m_SubjectID ); 78 | i_rBuffer.Write( m_Segments ); 79 | } 80 | 81 | }; 82 | 83 | //------------------------------------------------------------------------------------------------- 84 | }; 85 | 86 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/LocalSegmentsDetail.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the detail declaration of the ViconCGStream::VLocalSegments class. 29 | 30 | #include "Enum.h" 31 | #include 32 | #include "IsEqual.h" 33 | 34 | namespace ViconCGStreamDetail 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /** 39 | * Contains a segment translation from the parent origin, and rotation matrix (row major format). 40 | */ 41 | class VLocalSegments_Segment 42 | { 43 | public: 44 | /// Segment identifier 45 | ViconCGStreamType::UInt32 m_SegmentID; 46 | 47 | /// Segment translation from parent origin 48 | ViconCGStreamType::Double m_Translation[ 3 ]; 49 | 50 | /// Segment rotation matrix (row major format) 51 | ViconCGStreamType::Double m_Rotation[ 9 ]; 52 | 53 | // Equality operator 54 | bool operator == ( const VLocalSegments_Segment & i_rOther ) const 55 | { 56 | return m_SegmentID == i_rOther.m_SegmentID && 57 | IsEqual( m_Translation, i_rOther.m_Translation ) && 58 | IsEqual( m_Rotation, i_rOther.m_Rotation ); 59 | } 60 | 61 | /// Read function. 62 | bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 63 | { 64 | return i_rBuffer.Read( m_SegmentID ) && 65 | i_rBuffer.Read( m_Translation ) && 66 | i_rBuffer.Read( m_Rotation ); 67 | } 68 | 69 | /// Write function. 70 | void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 71 | { 72 | i_rBuffer.Write( m_SegmentID ); 73 | i_rBuffer.Write( m_Translation ); 74 | i_rBuffer.Write( m_Rotation ); 75 | } 76 | }; 77 | 78 | //------------------------------------------------------------------------------------------------- 79 | }; 80 | 81 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/ScopedWriter.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | #include "Item.h" 28 | #include 29 | #include 30 | 31 | namespace ViconCGStreamIO 32 | { 33 | //------------------------------------------------------------------------------------------------- 34 | 35 | /** \class VScopedWriter 36 | This class provides functionality for writing nested blocks of data to a buffer. 37 | Each block has a header which contains a ViconCGStreamEnum identifier, and a block length. 38 | **/ 39 | 40 | class VScopedWriter 41 | { 42 | public: 43 | 44 | /// Constructor taking the underlying buffer to write to and the enum for this block. 45 | VScopedWriter( VBuffer & i_rBuffer, ViconCGStreamType::Enum i_Enum = ViconCGStreamEnum::Objects ) 46 | : m_rBuffer( i_rBuffer ) 47 | { 48 | m_rBuffer.Write( i_Enum ); 49 | m_Start = m_rBuffer.Offset(); 50 | m_rBuffer.SetOffset( m_Start + sizeof( ViconCGStreamType::UInt32 ) ); 51 | } 52 | 53 | /// Destructor that fills out length of block in header. 54 | ~VScopedWriter() 55 | { 56 | ViconCGStreamType::UInt32 Offset = m_rBuffer.Offset(); 57 | ViconCGStreamType::UInt32 Length = ( Offset - m_Start ) - sizeof( ViconCGStreamType::UInt32 ); 58 | 59 | m_rBuffer.SetOffset( m_Start ); 60 | m_rBuffer.Write( Length ); 61 | m_rBuffer.SetOffset( Offset ); 62 | } 63 | 64 | /// Write an item and its enum type to the buffer. 65 | void Write( const ViconCGStream::VItem & i_rItem ) 66 | { 67 | VScopedWriter ScopedWriter( m_rBuffer, i_rItem.TypeID() ); 68 | m_rBuffer.Write( i_rItem ); 69 | } 70 | 71 | private: 72 | VBuffer & m_rBuffer; 73 | ViconCGStreamType::UInt32 m_Start; 74 | }; 75 | 76 | //------------------------------------------------------------------------------------------------- 77 | }; 78 | 79 | 80 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/GreyscaleSubsampledBlobs.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VGreyscaleBlobs class. 29 | 30 | #include "GreyscaleBlobs.h" 31 | #include "GreyscaleBlobsDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Writes additional sensor pixel stride information for a frame of greyscale blobs to the CG stream. 39 | class VGreyscaleSubsampledBlobs: public VGreyscaleBlobs 40 | { 41 | public: 42 | 43 | /// Object type enum. 44 | virtual ViconCGStreamType::Enum TypeID() const 45 | { 46 | return ViconCGStreamEnum::GreyscaleSubsampledBlobs; 47 | } 48 | 49 | 50 | /// Read function. 51 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 52 | { 53 | return i_rBuffer.Read(m_FrameID) && 54 | i_rBuffer.Read(m_CameraID) && 55 | i_rBuffer.Read( m_TwiceOffsetX ) && 56 | i_rBuffer.Read( m_TwiceOffsetY ) && 57 | i_rBuffer.Read( m_SensorPixelsPerImagePixelX ) && 58 | i_rBuffer.Read( m_SensorPixelsPerImagePixelY ) && 59 | i_rBuffer.Read(m_GreyscaleBlobs); 60 | } 61 | 62 | /// Write function. 63 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 64 | { 65 | i_rBuffer.Write(m_FrameID); 66 | i_rBuffer.Write(m_CameraID); 67 | i_rBuffer.Write(m_TwiceOffsetX); 68 | i_rBuffer.Write( m_TwiceOffsetY ); 69 | i_rBuffer.Write( m_SensorPixelsPerImagePixelX ); 70 | i_rBuffer.Write( m_SensorPixelsPerImagePixelY ); 71 | i_rBuffer.Write(m_GreyscaleBlobs); 72 | } 73 | 74 | }; 75 | 76 | //------------------------------------------------------------------------------------------------- 77 | }; 78 | 79 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconDataStreamSDKCore/RetimerUtils.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | #include 28 | 29 | namespace ClientUtils 30 | { 31 | typedef std::array< double, 4 > Quaternion; 32 | typedef std::array< double, 9 > RotationMatrix; 33 | typedef std::array< double, 3 > Axis; 34 | typedef std::array< double, 3 > Displacement; 35 | 36 | // Simple Quaternion and Vector operation, to remove vnl/tmv dependency 37 | Quaternion Conjugate( const Quaternion & i_rInput ); 38 | Quaternion Inverse( const Quaternion & i_rInput ); 39 | 40 | Axis Imaginary( const Quaternion & i_rInput ); 41 | double Magnitude( const Axis & i_rInput ); 42 | void Normalize( Axis & io_rInput ); 43 | 44 | bool ToAxisAngle( const Quaternion & i_rInput, Axis & o_rAxis, double & o_rAngle ); 45 | Quaternion FromAxisAngle( const Axis & i_rAxis, const double & i_rAngle ); 46 | RotationMatrix ToRotationMatrix( const Quaternion & i_rInput ); 47 | 48 | Axis operator*( const Axis & i_rLeft, double i_rVal ); 49 | Axis operator+=( Axis & i_rLeft, const Axis & i_rRight ); 50 | Quaternion operator*( const Quaternion & i_rLeft, const Quaternion & i_rRight ); 51 | 52 | /// Returns a rotation prediction at time t3 from 2 rotation r1 at time t1 and r2 and time t2 53 | /// where t3 > t2 > t1 54 | Quaternion PredictRotation( Quaternion r1, double t1, Quaternion r2, double t2, double t3 ); 55 | 56 | /// Returns a translation prediction at time t3 from 2 translations at time d1, t1; d2, t2 where t3 > t2 > t1 57 | /// Can also be used for linear interpolation where t2 > t3 > t1 58 | Displacement PredictDisplacement( const Displacement & d1, double t1, const Displacement & d2, double t2, double t3 ); 59 | 60 | /// Linear interpolation between doubles 61 | double PredictVal( const double d1, double t1, const double d2, double t2, double t3 ); 62 | } 63 | 64 | 65 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/SubjectTopologyDetail.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | #include 28 | #include 29 | #include 30 | 31 | namespace ViconCGStreamDetail 32 | { 33 | //------------------------------------------------------------------------------------------------- 34 | 35 | /// (Member of VSubjectTopology) Contains neutral pose information 36 | class VSubjectTopology_Segment 37 | { 38 | public: 39 | /// Segment identifier 40 | ViconCGStreamType::UInt32 m_SegmentID; 41 | 42 | /// Translation in parent segment at neutral pose 43 | ViconCGStreamType::Double m_Translation[ 3 ]; 44 | 45 | /// Rotation in parent segment at neutral pose 46 | ViconCGStreamType::Double m_Rotation[ 9 ]; 47 | 48 | bool IsEqual( const VSubjectTopology_Segment & i_rOther ) const 49 | { 50 | return m_SegmentID == i_rOther.m_SegmentID && 51 | ViconCGStreamDetail::IsEqual( m_Translation, i_rOther.m_Translation ) && 52 | ViconCGStreamDetail::IsEqual( m_Rotation, i_rOther.m_Rotation ); 53 | } 54 | 55 | /// Equality operator 56 | bool operator == ( const VSubjectTopology_Segment & i_rOther ) const 57 | { 58 | return IsEqual( i_rOther ); 59 | } 60 | 61 | /// Read function. 62 | bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 63 | { 64 | return i_rBuffer.Read( m_SegmentID ) && 65 | i_rBuffer.Read( m_Translation ) && 66 | i_rBuffer.Read( m_Rotation ); 67 | } 68 | 69 | /// Write function. 70 | void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 71 | { 72 | i_rBuffer.Write( m_SegmentID ); 73 | i_rBuffer.Write( m_Translation ); 74 | i_rBuffer.Write( m_Rotation ); 75 | } 76 | }; 77 | 78 | //------------------------------------------------------------------------------------------------- 79 | }; 80 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/LocalSegments.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VLocalSegments class. 29 | 30 | #include "Item.h" 31 | #include "LocalSegmentsDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains a vector of segment local poses for a single subject. 39 | class VLocalSegments : public VItem 40 | { 41 | public: 42 | 43 | /// Subject identifier 44 | ViconCGStreamType::UInt32 m_SubjectID; 45 | 46 | /// Local segments 47 | std::vector< ViconCGStreamDetail::VLocalSegments_Segment > m_Segments; 48 | 49 | // Equality operator 50 | bool operator == ( const VLocalSegments & i_rOther ) const 51 | { 52 | return m_Segments == i_rOther.m_Segments; 53 | } 54 | 55 | /// Object type enum. 56 | virtual ViconCGStreamType::Enum TypeID() const 57 | { 58 | return ViconCGStreamEnum::LocalSegments; 59 | } 60 | 61 | /// Filter ID 62 | virtual ViconCGStreamType::UInt32 FilterID() const 63 | { 64 | return m_SubjectID; 65 | } 66 | 67 | /// Read function. 68 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 69 | { 70 | if( !i_rBuffer.Read( m_SubjectID ) ) 71 | { 72 | return false; 73 | } 74 | 75 | if( !i_rBuffer.Read( m_Segments ) ) 76 | { 77 | return false; 78 | } 79 | 80 | return true; 81 | } 82 | 83 | /// Write function. 84 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 85 | { 86 | i_rBuffer.Write( m_SubjectID ); 87 | i_rBuffer.Write( m_Segments ); 88 | } 89 | 90 | }; 91 | 92 | //------------------------------------------------------------------------------------------------- 93 | }; 94 | 95 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/StartMulticastSender.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | #include "Item.h" 28 | #include 29 | 30 | namespace ViconCGStream 31 | { 32 | //------------------------------------------------------------------------------------------------- 33 | 34 | /// Start client multicast session 35 | class VStartMulticastSender : public VItem 36 | { 37 | public: 38 | 39 | /// Destination IP address, should be multicast or broadcast 40 | ViconCGStreamType::UInt32 m_MulticastIpAddress; 41 | 42 | // Source IP address 43 | ViconCGStreamType::UInt32 m_SourceIpAddress; 44 | 45 | // Port number 46 | ViconCGStreamType::UInt16 m_Port; 47 | 48 | /// Equality operator 49 | bool operator == ( const VStartMulticastSender & i_rOther ) const 50 | { 51 | return m_MulticastIpAddress == i_rOther.m_MulticastIpAddress 52 | && m_SourceIpAddress == i_rOther.m_SourceIpAddress 53 | && m_Port == i_rOther.m_Port; 54 | } 55 | 56 | /// Object type enum. 57 | virtual ViconCGStreamType::Enum TypeID() const 58 | { 59 | return ViconCGStreamEnum::StartMulticastSender; 60 | } 61 | 62 | /// Filter ID 63 | virtual ViconCGStreamType::UInt32 FilterID() const 64 | { 65 | return FILTER_NA; 66 | } 67 | 68 | /// Read function. 69 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 70 | { 71 | return i_rBuffer.Read( m_MulticastIpAddress ) 72 | && i_rBuffer.Read( m_SourceIpAddress ) 73 | && i_rBuffer.Read( m_Port ); 74 | } 75 | 76 | /// Write function. 77 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 78 | { 79 | i_rBuffer.Write( m_MulticastIpAddress ); 80 | i_rBuffer.Write( m_SourceIpAddress ); 81 | i_rBuffer.Write( m_Port );; 82 | } 83 | 84 | }; 85 | 86 | //------------------------------------------------------------------------------------------------- 87 | }; 88 | 89 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/SubjectTopology.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VSubjectCalibrationInfo class. 29 | 30 | #include 31 | #include "SubjectTopologyDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains the static description of a single subject. 39 | class VSubjectTopology : public VItem 40 | { 41 | public: 42 | 43 | /// Subject identifier 44 | ViconCGStreamType::UInt32 m_SubjectID; 45 | 46 | /// Segments 47 | std::vector< ViconCGStreamDetail::VSubjectTopology_Segment > m_Segments; 48 | 49 | /// Equality function 50 | bool IsEqual( const VSubjectTopology & i_rOther ) const 51 | { 52 | return m_SubjectID == i_rOther.m_SubjectID && 53 | m_Segments == i_rOther.m_Segments; 54 | } 55 | 56 | /// Equality operator 57 | bool operator == ( const VSubjectTopology & i_rOther ) const 58 | { 59 | return IsEqual( i_rOther ); 60 | } 61 | 62 | /// Object type enum. 63 | virtual ViconCGStreamType::Enum TypeID() const 64 | { 65 | return ViconCGStreamEnum::SubjectTopology; 66 | } 67 | 68 | /// Filter ID 69 | virtual ViconCGStreamType::UInt32 FilterID() const 70 | { 71 | return m_SubjectID; 72 | } 73 | 74 | /// Read function. 75 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 76 | { 77 | return i_rBuffer.Read( m_SubjectID ) && 78 | i_rBuffer.Read( m_Segments ); 79 | } 80 | 81 | /// Write function. 82 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 83 | { 84 | i_rBuffer.Write( m_SubjectID ); 85 | i_rBuffer.Write( m_Segments ); 86 | } 87 | 88 | }; 89 | 90 | //------------------------------------------------------------------------------------------------- 91 | }; 92 | 93 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/CentroidTracksDetail.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the details declaration of the ViconCGStream::VCentroidTracks class. 29 | 30 | #include "Enum.h" 31 | #include 32 | 33 | namespace ViconCGStreamDetail 34 | { 35 | //------------------------------------------------------------------------------------------------- 36 | 37 | /// Contains the centroid index, track id, track length and track quality. 38 | class VCentroidTracks_CentroidTrack 39 | { 40 | public: 41 | 42 | /// Centroid index 43 | ViconCGStreamType::UInt32 m_CentroidIndex; 44 | 45 | /// 64 bit track id. 46 | ViconCGStreamType::UInt64 m_TrackId; 47 | 48 | /// Length of track (saturates). 49 | ViconCGStreamType::UInt32 m_TrackLength; 50 | 51 | /// Track quality. 52 | ViconCGStreamType::Float m_TrackQuality; 53 | 54 | // Equality operator 55 | bool operator == ( const VCentroidTracks_CentroidTrack & i_rOther ) const 56 | { 57 | return m_CentroidIndex == i_rOther.m_CentroidIndex && 58 | m_TrackId == i_rOther.m_TrackId && 59 | m_TrackLength == i_rOther.m_TrackLength && 60 | m_TrackQuality == i_rOther.m_TrackQuality; 61 | } 62 | 63 | /// Read function. 64 | bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 65 | { 66 | return i_rBuffer.Read( m_CentroidIndex ) && 67 | i_rBuffer.Read( m_TrackId ) && 68 | i_rBuffer.Read( m_TrackLength ) && 69 | i_rBuffer.Read( m_TrackQuality ); 70 | } 71 | 72 | /// Write function. 73 | void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 74 | { 75 | i_rBuffer.Write( m_CentroidIndex ); 76 | i_rBuffer.Write( m_TrackId ); 77 | i_rBuffer.Write( m_TrackLength ); 78 | i_rBuffer.Write( m_TrackQuality ); 79 | } 80 | }; 81 | 82 | //------------------------------------------------------------------------------------------------- 83 | }; 84 | 85 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/EdgePairs.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VEdgePairs class. 29 | 30 | #include "Item.h" 31 | #include "EdgePairsDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains a frame of edge pairs, along with the camera identifier and frame number. 39 | class VEdgePairs : public VItem 40 | { 41 | public: 42 | 43 | /// Camera frame number 44 | ViconCGStreamType::UInt32 m_FrameID; 45 | 46 | /// Camera identifier 47 | ViconCGStreamType::UInt32 m_CameraID; 48 | 49 | /// Edge pairs 50 | std::vector< ViconCGStreamDetail::VEdgePairs_EdgePair > m_EdgePairs; 51 | 52 | bool operator == ( const VEdgePairs & i_rOther ) const 53 | { 54 | return m_FrameID == i_rOther.m_FrameID && 55 | m_CameraID == i_rOther.m_CameraID && 56 | m_EdgePairs == i_rOther.m_EdgePairs; 57 | } 58 | 59 | /// Object type enum. 60 | virtual ViconCGStreamType::Enum TypeID() const 61 | { 62 | return ViconCGStreamEnum::EdgePairs; 63 | } 64 | 65 | /// Filter ID 66 | virtual ViconCGStreamType::UInt32 FilterID() const 67 | { 68 | return m_CameraID; 69 | } 70 | 71 | /// Read function. 72 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 73 | { 74 | return i_rBuffer.Read( m_FrameID ) && 75 | i_rBuffer.Read( m_CameraID ) && 76 | i_rBuffer.Read( m_EdgePairs ); 77 | } 78 | 79 | /// Write function. 80 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 81 | { 82 | i_rBuffer.Write( m_FrameID ); 83 | i_rBuffer.Write( m_CameraID ); 84 | i_rBuffer.Write( m_EdgePairs ); 85 | } 86 | 87 | }; 88 | 89 | //------------------------------------------------------------------------------------------------- 90 | }; 91 | 92 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/UnlabeledReconsDetail.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the details declaration of the ViconCGStream::VUnlabeledRecons class. 29 | 30 | #include "Enum.h" 31 | #include 32 | #include "IsEqual.h" 33 | 34 | namespace ViconCGStreamDetail 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains a single unlabeled recon. 39 | class VUnlabeledRecons_UnlabeledRecon 40 | { 41 | public: 42 | /// Recon radius 43 | ViconCGStreamType::Double m_Radius; 44 | 45 | /// Recon position 46 | ViconCGStreamType::Double m_Position[ 3 ]; 47 | 48 | /// Recon covariance matrix (row major format) 49 | ViconCGStreamType::Double m_Covariance[ 9 ]; 50 | 51 | /// Trajectory id 52 | ViconCGStreamType::UInt32 m_TrajectoryId; 53 | 54 | /// Equality operator 55 | bool operator == ( const VUnlabeledRecons_UnlabeledRecon & i_rOther ) const 56 | { 57 | return m_Radius == i_rOther.m_Radius && 58 | IsEqual( m_Position, i_rOther.m_Position ) && 59 | IsEqual( m_Covariance, i_rOther.m_Covariance ) && 60 | m_TrajectoryId == i_rOther.m_TrajectoryId; 61 | } 62 | 63 | /// Read function. 64 | bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 65 | { 66 | return i_rBuffer.Read( m_Radius ) && 67 | i_rBuffer.Read( m_Position ) && 68 | i_rBuffer.Read( m_Covariance ) && 69 | i_rBuffer.Read( m_TrajectoryId ); 70 | } 71 | 72 | /// Write function. 73 | void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 74 | { 75 | i_rBuffer.Write( m_Radius ); 76 | i_rBuffer.Write( m_Position ); 77 | i_rBuffer.Write( m_Covariance ); 78 | i_rBuffer.Write( m_TrajectoryId ); 79 | } 80 | }; 81 | 82 | //------------------------------------------------------------------------------------------------- 83 | }; 84 | 85 | 86 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/CentroidWeights.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VCentroids class. 29 | 30 | #include "Item.h" 31 | #include "CentroidsDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains a set of weights corresponding to unlabeled centroids, along with the camera identifier and frame number. 39 | class VCentroidWeights : public VItem 40 | { 41 | public: 42 | 43 | /// Camera frame number 44 | ViconCGStreamType::UInt32 m_FrameID; 45 | 46 | /// Camera identifier 47 | ViconCGStreamType::UInt32 m_CameraID; 48 | 49 | /// Centroids 50 | std::vector< float > m_Weights; 51 | 52 | /// Equality operator 53 | bool operator == ( const VCentroidWeights & i_rOther ) const 54 | { 55 | return m_FrameID == i_rOther.m_FrameID && 56 | m_CameraID == i_rOther.m_CameraID && 57 | m_Weights == i_rOther.m_Weights; 58 | } 59 | 60 | /// Object type enum. 61 | virtual ViconCGStreamType::Enum TypeID() const 62 | { 63 | return ViconCGStreamEnum::CentroidWeights; 64 | } 65 | 66 | /// Filter ID 67 | virtual ViconCGStreamType::UInt32 FilterID() const 68 | { 69 | return m_CameraID; 70 | } 71 | 72 | /// Read function. 73 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 74 | { 75 | return i_rBuffer.Read( m_FrameID ) && 76 | i_rBuffer.Read( m_CameraID ) && 77 | i_rBuffer.Read( m_Weights ); 78 | } 79 | 80 | /// Write function. 81 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 82 | { 83 | i_rBuffer.Write( m_FrameID ); 84 | i_rBuffer.Write( m_CameraID ); 85 | i_rBuffer.Write( m_Weights ); 86 | } 87 | 88 | }; 89 | 90 | //------------------------------------------------------------------------------------------------- 91 | }; 92 | 93 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/Centroids.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VCentroids class. 29 | 30 | #include "Item.h" 31 | #include "CentroidsDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains a frame of unlabeled centroids, along with the camera identifier and frame number. 39 | class VCentroids : public VItem 40 | { 41 | public: 42 | 43 | /// Camera frame number 44 | ViconCGStreamType::UInt32 m_FrameID; 45 | 46 | /// Camera identifier 47 | ViconCGStreamType::UInt32 m_CameraID; 48 | 49 | /// Centroids 50 | std::vector< ViconCGStreamDetail::VCentroids_Centroid > m_Centroids; 51 | 52 | /// Equality operator 53 | bool operator == ( const VCentroids & i_rOther ) const 54 | { 55 | return m_FrameID == i_rOther.m_FrameID && 56 | m_CameraID == i_rOther.m_CameraID && 57 | m_Centroids == i_rOther.m_Centroids; 58 | } 59 | 60 | /// Object type enum. 61 | virtual ViconCGStreamType::Enum TypeID() const 62 | { 63 | return ViconCGStreamEnum::Centroids; 64 | } 65 | 66 | /// Filter ID 67 | virtual ViconCGStreamType::UInt32 FilterID() const 68 | { 69 | return m_CameraID; 70 | } 71 | 72 | /// Read function. 73 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 74 | { 75 | return i_rBuffer.Read( m_FrameID ) && 76 | i_rBuffer.Read( m_CameraID ) && 77 | i_rBuffer.Read( m_Centroids ); 78 | } 79 | 80 | /// Write function. 81 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 82 | { 83 | i_rBuffer.Write( m_FrameID ); 84 | i_rBuffer.Write( m_CameraID ); 85 | i_rBuffer.Write( m_Centroids ); 86 | } 87 | 88 | }; 89 | 90 | //------------------------------------------------------------------------------------------------- 91 | }; 92 | 93 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/SubjectScale.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VSubjectScale class. 29 | 30 | #include 31 | #include "SubjectScaleDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains the scale information for a single subject. 39 | /// Scale is inherited, so if there is no scale information for a segment, it uses the scale of its parent. 40 | class VSubjectScale : public VItem 41 | { 42 | public: 43 | 44 | /// Subject identifier 45 | ViconCGStreamType::UInt32 m_SubjectID; 46 | 47 | /// Segments 48 | std::vector< ViconCGStreamDetail::VSubjectScale_Segment > m_Segments; 49 | 50 | /// Equality function 51 | bool IsEqual( const VSubjectScale & i_rOther ) const 52 | { 53 | return m_SubjectID == i_rOther.m_SubjectID && 54 | m_Segments == i_rOther.m_Segments; 55 | } 56 | 57 | /// Equality operator 58 | bool operator == ( const VSubjectScale & i_rOther ) const 59 | { 60 | return IsEqual( i_rOther ); 61 | } 62 | 63 | /// Object type enum. 64 | virtual ViconCGStreamType::Enum TypeID() const 65 | { 66 | return ViconCGStreamEnum::SubjectScale; 67 | } 68 | 69 | /// Filter ID 70 | virtual ViconCGStreamType::UInt32 FilterID() const 71 | { 72 | return m_SubjectID; 73 | } 74 | 75 | /// Read function. 76 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 77 | { 78 | return i_rBuffer.Read( m_SubjectID ) && 79 | i_rBuffer.Read( m_Segments ); 80 | } 81 | 82 | /// Write function. 83 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 84 | { 85 | i_rBuffer.Write( m_SubjectID ); 86 | i_rBuffer.Write( m_Segments ); 87 | } 88 | 89 | }; 90 | 91 | //------------------------------------------------------------------------------------------------- 92 | }; 93 | 94 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/SubjectHealth.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VSubjectHealth class. 29 | 30 | #include "Item.h" 31 | #include 32 | 33 | namespace ViconCGStream 34 | { 35 | //------------------------------------------------------------------------------------------------- 36 | 37 | /// Contains a health estimate for a single subject. 38 | class VSubjectHealth : public VItem 39 | { 40 | public: 41 | 42 | /// Subject identifier 43 | ViconCGStreamType::UInt32 m_SubjectID; 44 | 45 | /// Residual error computed from reconstructions, in mm. 46 | ViconCGStreamType::Double m_MarkerError; 47 | 48 | /// Health estimate from 0.0 (bad) to 1.0 (excellent). 49 | ViconCGStreamType::Double m_SubjectHealth; 50 | 51 | /// Equality operator 52 | bool operator == ( const VSubjectHealth& i_rOther ) const 53 | { 54 | return ( m_SubjectID == i_rOther.m_SubjectID ) && 55 | ( m_MarkerError == i_rOther.m_MarkerError ) && 56 | ( m_SubjectHealth == i_rOther.m_SubjectHealth ); 57 | } 58 | 59 | /// Object type enum. 60 | virtual ViconCGStreamType::Enum TypeID() const 61 | { 62 | return ViconCGStreamEnum::SubjectHealth; 63 | } 64 | 65 | /// Filter ID 66 | virtual ViconCGStreamType::UInt32 FilterID() const 67 | { 68 | return m_SubjectID; 69 | } 70 | 71 | /// Read function. 72 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 73 | { 74 | return i_rBuffer.Read( m_SubjectID ) && 75 | i_rBuffer.Read( m_MarkerError ) && 76 | i_rBuffer.Read( m_SubjectHealth ); 77 | } 78 | 79 | /// Write function. 80 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 81 | { 82 | i_rBuffer.Write( m_SubjectID ); 83 | i_rBuffer.Write( m_MarkerError ); 84 | i_rBuffer.Write( m_SubjectHealth ); 85 | } 86 | 87 | }; 88 | 89 | //------------------------------------------------------------------------------------------------- 90 | }; 91 | 92 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/CentroidTracks.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VCentroidTracks class. 29 | 30 | #include "Item.h" 31 | #include "CentroidTracksDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains a frame of umlabeled circles, along with the camera identifier and frame number. 39 | class VCentroidTracks : public VItem 40 | { 41 | public: 42 | 43 | /// Camera frame number 44 | ViconCGStreamType::UInt32 m_FrameID; 45 | 46 | /// Camera identifier 47 | ViconCGStreamType::UInt32 m_CameraID; 48 | 49 | /// Centroid tracks 50 | std::vector< ViconCGStreamDetail::VCentroidTracks_CentroidTrack > m_CentroidTracks; 51 | 52 | /// Equality operator 53 | bool operator == ( const VCentroidTracks & i_rOther ) const 54 | { 55 | return m_FrameID == i_rOther.m_FrameID && 56 | m_CameraID == i_rOther.m_CameraID && 57 | m_CentroidTracks == i_rOther.m_CentroidTracks; 58 | } 59 | 60 | /// Object type enum. 61 | virtual ViconCGStreamType::Enum TypeID() const 62 | { 63 | return ViconCGStreamEnum::CentroidTracks; 64 | } 65 | 66 | /// Filter ID 67 | virtual ViconCGStreamType::UInt32 FilterID() const 68 | { 69 | return m_CameraID; 70 | } 71 | 72 | /// Read function. 73 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 74 | { 75 | return i_rBuffer.Read( m_FrameID ) && 76 | i_rBuffer.Read( m_CameraID ) && 77 | i_rBuffer.Read( m_CentroidTracks ); 78 | } 79 | 80 | /// Write function. 81 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 82 | { 83 | i_rBuffer.Write( m_FrameID ); 84 | i_rBuffer.Write( m_CameraID ); 85 | i_rBuffer.Write( m_CentroidTracks ); 86 | } 87 | 88 | }; 89 | 90 | //------------------------------------------------------------------------------------------------- 91 | }; 92 | 93 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/Contents.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VContents class. 29 | 30 | #include "Item.h" 31 | #include 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contents. 39 | class VContents : public VItem 40 | { 41 | public: 42 | 43 | /// Number of objects of each requested type present: 44 | /// The map contains an entry for each object type requested, along 45 | /// with a Size to indicate the number of objects present. 46 | std::map< ViconCGStreamType::Enum, ViconCGStreamType::UInt32 > m_EnumsTable; 47 | 48 | /// Set of requested types that do not contain changes: 49 | /// If all objects of a given type remain unchanged since the last object 50 | /// packet, then the type value will appear in this container. 51 | std::set< ViconCGStreamType::Enum > m_EnumsUnchanged; 52 | 53 | /// Equality operator 54 | bool operator == ( const VContents & i_rOther ) const 55 | { 56 | return m_EnumsTable == i_rOther.m_EnumsTable && m_EnumsUnchanged == i_rOther.m_EnumsUnchanged; 57 | } 58 | 59 | /// Object type enum. 60 | virtual ViconCGStreamType::Enum TypeID() const 61 | { 62 | return ViconCGStreamEnum::Contents; 63 | } 64 | 65 | /// Filter ID 66 | virtual ViconCGStreamType::UInt32 FilterID() const 67 | { 68 | return FILTER_NA; 69 | } 70 | 71 | /// Read function. 72 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 73 | { 74 | return i_rBuffer.Read( m_EnumsTable ) && 75 | i_rBuffer.Read( m_EnumsUnchanged ); 76 | } 77 | 78 | /// Write function. 79 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 80 | { 81 | i_rBuffer.Write( m_EnumsTable ); 82 | i_rBuffer.Write( m_EnumsUnchanged ); 83 | } 84 | 85 | }; 86 | 87 | //------------------------------------------------------------------------------------------------- 88 | }; 89 | 90 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/CameraTimingInfo.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | #include "Item.h" 28 | #include 29 | 30 | namespace ViconCGStream 31 | { 32 | //------------------------------------------------------------------------------------------------- 33 | 34 | /// Contains the camera timing info. 35 | class VCameraTimingInfo : public VItem 36 | { 37 | public: 38 | 39 | /// Camera identifier 40 | ViconCGStreamType::UInt32 m_CameraID; 41 | 42 | /// Camera frame period. Defined as the numbers of ticks per frame on a 135Mhz clock. 43 | ViconCGStreamType::UInt64 m_FramePeriod; 44 | 45 | /// Camera frame offset. Tick offset in time of frame zero. 46 | ViconCGStreamType::Int64 m_FrameOffset; 47 | 48 | /// Equality function 49 | bool IsEqual( const VCameraTimingInfo & i_rOther ) const 50 | { 51 | return m_CameraID == i_rOther.m_CameraID && 52 | m_FramePeriod == i_rOther.m_FramePeriod && 53 | m_FrameOffset == i_rOther.m_FrameOffset; 54 | } 55 | 56 | /// Equality operator 57 | bool operator == ( const VCameraTimingInfo & i_rOther ) const 58 | { 59 | return IsEqual( i_rOther ); 60 | } 61 | 62 | /// Object type enum. 63 | virtual ViconCGStreamType::Enum TypeID() const 64 | { 65 | return ViconCGStreamEnum::CameraTimingInfo; 66 | } 67 | 68 | /// Filter ID 69 | virtual ViconCGStreamType::UInt32 FilterID() const 70 | { 71 | return m_CameraID; 72 | } 73 | 74 | /// Read function. 75 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 76 | { 77 | return i_rBuffer.Read( m_CameraID ) && 78 | i_rBuffer.Read( m_FramePeriod ) && 79 | i_rBuffer.Read( m_FrameOffset ); 80 | } 81 | 82 | /// Write function. 83 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 84 | { 85 | i_rBuffer.Write( m_CameraID ); 86 | i_rBuffer.Write( m_FramePeriod ); 87 | i_rBuffer.Write( m_FrameOffset ); 88 | } 89 | 90 | }; 91 | 92 | //------------------------------------------------------------------------------------------------- 93 | }; 94 | 95 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/EyeTrackerFrame.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VEyeTrackerFrame class. 29 | 30 | #include "Item.h" 31 | #include 32 | 33 | namespace ViconCGStream 34 | { 35 | //------------------------------------------------------------------------------------------------- 36 | 37 | /// Contains a frame number, device identifiers and a frame of eye tracker samples. 38 | class VEyeTrackerFrame : public VItem 39 | { 40 | public: 41 | 42 | /// Device frame number 43 | ViconCGStreamType::UInt32 m_FrameID; 44 | 45 | /// Device identifier 46 | ViconCGStreamType::UInt32 m_DeviceID; 47 | 48 | /// Gaze direction as a unit vector. 49 | /// In the eye coordinate system. 50 | /// See: ViconCGStream::VEyeTrackerInfo. 51 | ViconCGStreamType::Float m_GazeVector[ 3 ]; 52 | 53 | /// Equality operator 54 | bool operator == ( const VEyeTrackerFrame & i_rOther ) const 55 | { 56 | return m_FrameID == i_rOther.m_FrameID && 57 | m_DeviceID == i_rOther.m_DeviceID && 58 | ViconCGStreamDetail::IsEqual( m_GazeVector, i_rOther.m_GazeVector ); 59 | } 60 | 61 | /// Object type enum. 62 | virtual ViconCGStreamType::Enum TypeID() const 63 | { 64 | return ViconCGStreamEnum::EyeTrackerFrame; 65 | } 66 | 67 | /// Filter ID 68 | virtual ViconCGStreamType::UInt32 FilterID() const 69 | { 70 | return m_DeviceID; 71 | } 72 | 73 | /// Read function. 74 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 75 | { 76 | return i_rBuffer.Read( m_FrameID ) && 77 | i_rBuffer.Read( m_DeviceID ) && 78 | i_rBuffer.Read( m_GazeVector ); 79 | } 80 | 81 | /// Write function. 82 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 83 | { 84 | i_rBuffer.Write( m_FrameID ); 85 | i_rBuffer.Write( m_DeviceID ); 86 | i_rBuffer.Write( m_GazeVector ); 87 | } 88 | 89 | }; 90 | 91 | //------------------------------------------------------------------------------------------------- 92 | }; 93 | 94 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/CameraCalibrationHealth.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VCameraCalibrationHealth class. 29 | 30 | #include "Item.h" 31 | #include "CameraCalibrationHealthDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains a overall system Camera calibration health indicator as well as an individual indicator for each camera 39 | /// Camera Health indicators vary from 0.0 (bad) to 1.0 (good) 40 | class VCameraCalibrationHealth : public VItem 41 | { 42 | public: 43 | 44 | /// Calibration Health for entire system 45 | ViconCGStreamType::Double m_SystemHealth; 46 | 47 | /// Individual Calibration Health for cameras 48 | std::vector< ViconCGStreamDetail::VCameraCalibrationHealth_Camera > m_Cameras; 49 | 50 | VCameraCalibrationHealth() 51 | : m_SystemHealth( 0.0 ) 52 | { 53 | } 54 | 55 | /// Equality operator 56 | bool operator == ( const VCameraCalibrationHealth & i_rOther ) const 57 | { 58 | return m_SystemHealth == i_rOther.m_SystemHealth && 59 | m_Cameras == i_rOther.m_Cameras; 60 | } 61 | 62 | /// Object type enum. 63 | virtual ViconCGStreamType::Enum TypeID() const 64 | { 65 | return ViconCGStreamEnum::CameraCalibrationHealth; 66 | } 67 | 68 | /// Filter ID 69 | virtual ViconCGStreamType::UInt32 FilterID() const 70 | { 71 | return FILTER_NA; 72 | } 73 | 74 | /// Read function. 75 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 76 | { 77 | return i_rBuffer.Read( m_SystemHealth ) && 78 | i_rBuffer.Read( m_Cameras ); 79 | } 80 | 81 | /// Write function. 82 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 83 | { 84 | i_rBuffer.Write( m_SystemHealth ); 85 | i_rBuffer.Write( m_Cameras ); 86 | } 87 | 88 | }; 89 | 90 | //------------------------------------------------------------------------------------------------- 91 | }; 92 | 93 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconDataStreamSDKCoreUtils/AxisMapping.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | #include "Constants.h" 28 | #include 29 | 30 | namespace ViconDataStreamSDK 31 | { 32 | namespace Core 33 | { 34 | 35 | class VAxisMapping 36 | { 37 | public: 38 | virtual ~VAxisMapping(); 39 | 40 | // Create a mapper and set the transformation matrix 41 | // Returns a null shared_ptr if there is an error in the axis system 42 | static std::shared_ptr< VAxisMapping > Create( AxisMappingResult::Enum & o_rError, 43 | Direction::Enum i_XAxis, 44 | Direction::Enum i_YAxis, 45 | Direction::Enum i_ZAxis ); 46 | 47 | // Set the transform properties 48 | void GetAxisMapping( Direction::Enum & o_rXAxis, Direction::Enum & o_rYAxis, Direction::Enum & o_rZAxis ) const; 49 | 50 | // Transform world points and rotations 51 | void CopyAndTransformT( const double i_Translation[ 3 ], double ( & io_Translation )[ 3 ] ) const; 52 | void CopyAndTransformR( const double i_Rotation[ 9 ], double ( & io_Rotation )[ 9 ] ) const; 53 | 54 | void CopyAndTransformT( const double i_Translation[3], const double i_Orientation[9], double( &io_Translation )[3] ) const; 55 | void CopyAndTransformR( const double i_Rotation[9], const double i_Orientation[9], double( &io_Rotation )[9] ) const; 56 | 57 | // Get the underlying transformation matrix 58 | void GetTransformationMatrix( double( &o_Rotation )[9] ); 59 | 60 | private: 61 | VAxisMapping(); 62 | 63 | // Set the transform matrix 64 | AxisMappingResult::Enum SetAxisMapping( const Direction::Enum i_XAxis, 65 | const Direction::Enum i_YAxis, 66 | const Direction::Enum i_ZAxis ); 67 | 68 | // Raw axis mappings and equivalent transform matrix 69 | Direction::Enum m_XAxis; 70 | Direction::Enum m_YAxis; 71 | Direction::Enum m_ZAxis; 72 | double m_Transform[ 9 ]; 73 | }; 74 | 75 | } // End of namespace Core 76 | } // End of namespace ViconDataStreamSDK 77 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/ForceFrame.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VForceFrame class. 29 | 30 | #include "Item.h" 31 | #include 32 | 33 | namespace ViconCGStream 34 | { 35 | //------------------------------------------------------------------------------------------------- 36 | 37 | /// Contains a frame number, device and channel identifiers, and a frame of force samples in component order (measured in N). 38 | class VForceFrame : public VItem 39 | { 40 | public: 41 | 42 | /// Device frame number 43 | ViconCGStreamType::UInt32 m_FrameID; 44 | 45 | /// Device identifier 46 | ViconCGStreamType::UInt32 m_DeviceID; 47 | 48 | /// Channel identifier 49 | ViconCGStreamType::UInt32 m_ChannelID; 50 | 51 | /// Force samples (in component order) 52 | std::vector< ViconCGStreamType::Float > m_Samples; 53 | 54 | /// Equality operator 55 | bool operator == ( const VForceFrame & i_rOther ) const 56 | { 57 | return m_FrameID == i_rOther.m_FrameID && 58 | m_DeviceID == i_rOther.m_DeviceID && 59 | m_ChannelID == i_rOther.m_ChannelID && 60 | m_Samples == i_rOther.m_Samples; 61 | } 62 | 63 | /// Object type enum. 64 | virtual ViconCGStreamType::Enum TypeID() const 65 | { 66 | return ViconCGStreamEnum::ForceFrame; 67 | } 68 | 69 | /// Filter ID 70 | virtual ViconCGStreamType::UInt32 FilterID() const 71 | { 72 | return m_DeviceID; 73 | } 74 | 75 | /// Read function. 76 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 77 | { 78 | return i_rBuffer.Read( m_FrameID ) && 79 | i_rBuffer.Read( m_DeviceID ) && 80 | i_rBuffer.Read( m_ChannelID ) && 81 | i_rBuffer.Read( m_Samples ); 82 | } 83 | 84 | /// Write function. 85 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 86 | { 87 | i_rBuffer.Write( m_FrameID ); 88 | i_rBuffer.Write( m_DeviceID ); 89 | i_rBuffer.Write( m_ChannelID ); 90 | i_rBuffer.Write( m_Samples ); 91 | } 92 | 93 | }; 94 | 95 | //------------------------------------------------------------------------------------------------- 96 | }; 97 | 98 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/CameraWand3d.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VCameraWand3d class. 29 | 30 | #include "Item.h" 31 | #include "CameraWand3dDetail.h" 32 | #include 33 | 34 | namespace ViconCGStream 35 | { 36 | //------------------------------------------------------------------------------------------------- 37 | 38 | /// Contains a 3d wand captured in a camera during a wand wave. 39 | class VCameraWand3d : public VItem 40 | { 41 | public: 42 | 43 | /// Wand session 44 | ViconCGStreamType::UInt32 m_WaveSession; 45 | 46 | /// Wand points 47 | std::vector< ViconCGStreamDetail::VCameraWand3d_Point > m_WandPoints; 48 | 49 | /// Cameras with wand 50 | ViconCGStreamType::UInt32 m_CamerasWithWand; 51 | 52 | /// Moving 53 | bool m_bMoving; 54 | 55 | /// Equality operator 56 | bool operator == ( const VCameraWand3d & i_rOther ) const 57 | { 58 | return m_WaveSession == i_rOther.m_WaveSession && 59 | m_WandPoints == i_rOther.m_WandPoints && 60 | m_CamerasWithWand == i_rOther.m_CamerasWithWand && 61 | m_bMoving == i_rOther.m_bMoving; 62 | } 63 | 64 | /// Object type enum. 65 | virtual ViconCGStreamType::Enum TypeID() const 66 | { 67 | return ViconCGStreamEnum::CameraWand3d; 68 | } 69 | 70 | /// Filter ID 71 | virtual ViconCGStreamType::UInt32 FilterID() const 72 | { 73 | return m_WaveSession; 74 | } 75 | 76 | /// Read function. 77 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 78 | { 79 | return i_rBuffer.Read( m_WaveSession ) && 80 | i_rBuffer.Read( m_WandPoints ) && 81 | i_rBuffer.Read( m_CamerasWithWand ) && 82 | i_rBuffer.Read( m_bMoving ); 83 | } 84 | 85 | /// Write function. 86 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 87 | { 88 | i_rBuffer.Write( m_WaveSession ); 89 | i_rBuffer.Write( m_WandPoints ); 90 | i_rBuffer.Write( m_CamerasWithWand ); 91 | i_rBuffer.Write( m_bMoving ); 92 | } 93 | 94 | }; 95 | 96 | //------------------------------------------------------------------------------------------------- 97 | }; 98 | 99 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/VoltageFrame.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VVoltageFrame class. 29 | 30 | #include "Item.h" 31 | #include 32 | 33 | namespace ViconCGStream 34 | { 35 | //------------------------------------------------------------------------------------------------- 36 | 37 | /// Contains a frame number, device and channel identifiers, and a frame of voltages in component order (measured in V). 38 | class VVoltageFrame : public VItem 39 | { 40 | public: 41 | 42 | /// Device frame number 43 | ViconCGStreamType::UInt32 m_FrameID; 44 | 45 | /// Device iedntifier 46 | ViconCGStreamType::UInt32 m_DeviceID; 47 | 48 | /// Channel identifier 49 | ViconCGStreamType::UInt32 m_ChannelID; 50 | 51 | /// Voltage samples (in component order) 52 | std::vector< ViconCGStreamType::Float > m_Samples; 53 | 54 | /// Equality operator 55 | bool operator == ( const VVoltageFrame & i_rOther ) const 56 | { 57 | return m_FrameID == i_rOther.m_FrameID && 58 | m_DeviceID == i_rOther.m_DeviceID && 59 | m_ChannelID == i_rOther.m_ChannelID && 60 | m_Samples == i_rOther.m_Samples; 61 | } 62 | 63 | /// Object type enum. 64 | virtual ViconCGStreamType::Enum TypeID() const 65 | { 66 | return ViconCGStreamEnum::VoltageFrame; 67 | } 68 | 69 | /// Filter ID 70 | virtual ViconCGStreamType::UInt32 FilterID() const 71 | { 72 | return m_DeviceID; 73 | } 74 | 75 | /// Read function. 76 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 77 | { 78 | return i_rBuffer.Read( m_FrameID ) && 79 | i_rBuffer.Read( m_DeviceID ) && 80 | i_rBuffer.Read( m_ChannelID ) && 81 | i_rBuffer.Read( m_Samples ); 82 | } 83 | 84 | /// Write function. 85 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 86 | { 87 | i_rBuffer.Write( m_FrameID ); 88 | i_rBuffer.Write( m_DeviceID ); 89 | i_rBuffer.Write( m_ChannelID ); 90 | i_rBuffer.Write( m_Samples ); 91 | } 92 | 93 | }; 94 | 95 | //------------------------------------------------------------------------------------------------- 96 | }; 97 | 98 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/MomentFrame.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VMomentFrame class. 29 | 30 | #include "Item.h" 31 | #include 32 | 33 | namespace ViconCGStream 34 | { 35 | //------------------------------------------------------------------------------------------------- 36 | 37 | /// Contains a frame number, device and channel identifiers, and a frame of moment samples in component order (measured in N/mm). 38 | class VMomentFrame : public VItem 39 | { 40 | public: 41 | 42 | /// Device frame number 43 | ViconCGStreamType::UInt32 m_FrameID; 44 | 45 | /// Device identigier 46 | ViconCGStreamType::UInt32 m_DeviceID; 47 | 48 | /// Channel identifier 49 | ViconCGStreamType::UInt32 m_ChannelID; 50 | 51 | /// Moment samples (in component order) 52 | std::vector< ViconCGStreamType::Float > m_Samples; 53 | 54 | /// Equality operator 55 | bool operator == ( const VMomentFrame & i_rOther ) const 56 | { 57 | return m_FrameID == i_rOther.m_FrameID && 58 | m_DeviceID == i_rOther.m_DeviceID && 59 | m_ChannelID == i_rOther.m_ChannelID && 60 | m_Samples == i_rOther.m_Samples; 61 | } 62 | 63 | /// Object type enum. 64 | virtual ViconCGStreamType::Enum TypeID() const 65 | { 66 | return ViconCGStreamEnum::MomentFrame; 67 | } 68 | 69 | /// Filter ID 70 | virtual ViconCGStreamType::UInt32 FilterID() const 71 | { 72 | return m_DeviceID; 73 | } 74 | 75 | /// Read function. 76 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 77 | { 78 | return i_rBuffer.Read( m_FrameID ) && 79 | i_rBuffer.Read( m_DeviceID ) && 80 | i_rBuffer.Read( m_ChannelID ) && 81 | i_rBuffer.Read( m_Samples ); 82 | } 83 | 84 | /// Write function. 85 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 86 | { 87 | i_rBuffer.Write( m_FrameID ); 88 | i_rBuffer.Write( m_DeviceID ); 89 | i_rBuffer.Write( m_ChannelID ); 90 | i_rBuffer.Write( m_Samples ); 91 | } 92 | 93 | }; 94 | 95 | //------------------------------------------------------------------------------------------------- 96 | }; 97 | 98 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/CentreOfPressureFrame.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VCentreOfPressureFrame class. 29 | 30 | #include "Item.h" 31 | #include 32 | 33 | namespace ViconCGStream 34 | { 35 | //------------------------------------------------------------------------------------------------- 36 | 37 | /// Contains a frame number, device and channel identifiers, and a frame of pressure centre samples in component order (measured in mm). 38 | class VCentreOfPressureFrame : public VItem 39 | { 40 | public: 41 | 42 | /// Device frame number 43 | ViconCGStreamType::UInt32 m_FrameID; 44 | 45 | /// Device identifier 46 | ViconCGStreamType::UInt32 m_DeviceID; 47 | 48 | /// Channel identifier 49 | ViconCGStreamType::UInt32 m_ChannelID; 50 | 51 | /// Centre of pressure samples (in component order) 52 | std::vector< ViconCGStreamType::Float > m_Samples; 53 | 54 | /// Equality operator 55 | bool operator == ( const VCentreOfPressureFrame & i_rOther ) const 56 | { 57 | return m_FrameID == i_rOther.m_FrameID && 58 | m_DeviceID == i_rOther.m_DeviceID && 59 | m_ChannelID == i_rOther.m_ChannelID && 60 | m_Samples == i_rOther.m_Samples; 61 | } 62 | 63 | /// Object type enum. 64 | virtual ViconCGStreamType::Enum TypeID() const 65 | { 66 | return ViconCGStreamEnum::CentreOfPressureFrame; 67 | } 68 | 69 | /// Filter ID 70 | virtual ViconCGStreamType::UInt32 FilterID() const 71 | { 72 | return m_DeviceID; 73 | } 74 | 75 | /// Read function. 76 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 77 | { 78 | return i_rBuffer.Read( m_FrameID ) && 79 | i_rBuffer.Read( m_DeviceID ) && 80 | i_rBuffer.Read( m_ChannelID ) && 81 | i_rBuffer.Read( m_Samples ); 82 | } 83 | 84 | /// Write function. 85 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 86 | { 87 | i_rBuffer.Write( m_FrameID ); 88 | i_rBuffer.Write( m_DeviceID ); 89 | i_rBuffer.Write( m_ChannelID ); 90 | i_rBuffer.Write( m_Samples ); 91 | } 92 | 93 | }; 94 | 95 | //------------------------------------------------------------------------------------------------- 96 | }; 97 | 98 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/ApplicationInfo.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | /// \file 28 | /// Contains the declaration of the ViconCGStream::VApplicationInfo class. 29 | 30 | #include "Item.h" 31 | 32 | namespace ViconCGStream 33 | { 34 | //------------------------------------------------------------------------------------------------- 35 | 36 | /// Contains information about specific application settings that relate to the datastream 37 | class VApplicationInfo : public VItem 38 | { 39 | public: 40 | 41 | enum EAxisOrientation : ViconCGStreamType::Char 42 | { 43 | EZUp, 44 | EYUp 45 | }; 46 | 47 | /// Default construct this to have Z-up orientation, to maintain back compatibility with old servers 48 | VApplicationInfo() : m_AxisOrientation( EZUp ) {} 49 | 50 | /// A transformation matrix representing the axis orientation of the application 51 | EAxisOrientation m_AxisOrientation; 52 | 53 | /// Equality operator 54 | bool operator == ( const VApplicationInfo& i_rOther ) const 55 | { 56 | return m_AxisOrientation == i_rOther.m_AxisOrientation; 57 | } 58 | 59 | /// Object type enum. 60 | virtual ViconCGStreamType::Enum TypeID() const 61 | { 62 | return ViconCGStreamEnum::ApplicationInfo; 63 | } 64 | 65 | /// Filter ID 66 | virtual ViconCGStreamType::UInt32 FilterID() const 67 | { 68 | return FILTER_NA; 69 | } 70 | 71 | /// Read function. 72 | virtual bool Read( const ViconCGStreamIO::VBuffer & i_rBuffer ) 73 | { 74 | return i_rBuffer.Read( m_AxisOrientation ) ; 75 | } 76 | 77 | /// Write function. 78 | virtual void Write( ViconCGStreamIO::VBuffer & i_rBuffer ) const 79 | { 80 | i_rBuffer.Write( m_AxisOrientation ); 81 | } 82 | 83 | }; 84 | 85 | //------------------------------------------------------------------------------------------------- 86 | }; 87 | 88 | namespace ViconCGStreamIO 89 | { 90 | //------------------------------------------------------------------------------------------------- 91 | 92 | template<> 93 | struct VIsPod< ViconCGStream::VApplicationInfo::EAxisOrientation > 94 | { 95 | enum 96 | { 97 | Answer = 1 98 | }; 99 | }; 100 | 101 | //------------------------------------------------------------------------------------------------- 102 | }; 103 | -------------------------------------------------------------------------------- /Vicon/CrossMarket/DataStream/ViconCGStream/ScopedReader.h: -------------------------------------------------------------------------------- 1 | 2 | ////////////////////////////////////////////////////////////////////////////////// 3 | // MIT License 4 | // 5 | // Copyright (c) 2020 Vicon Motion Systems Ltd 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy 8 | // of this software and associated documentation files (the "Software"), to deal 9 | // in the Software without restriction, including without limitation the rights 10 | // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | // copies of the Software, and to permit persons to whom the Software is 12 | // furnished to do so, subject to the following conditions: 13 | // 14 | // The above copyright notice and this permission notice shall be included in all 15 | // copies or substantial portions of the Software. 16 | // 17 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | // SOFTWARE. 24 | ////////////////////////////////////////////////////////////////////////////////// 25 | #pragma once 26 | 27 | #include 28 | #include "Enum.h" 29 | #include 30 | #include 31 | 32 | namespace ViconCGStream 33 | { 34 | class VItem; 35 | } 36 | 37 | namespace ViconCGStreamIO 38 | { 39 | //------------------------------------------------------------------------------------------------- 40 | 41 | /** \class VScopedReader 42 | This class provides functionality for reading nested blocks of data from a buffer. 43 | Each block has a header which contains a ViconCGStreamEnum identifier, and a block length. 44 | **/ 45 | 46 | class VScopedReader 47 | { 48 | public: 49 | 50 | /// Constructor taking the underlying buffer to read from. 51 | VScopedReader( VBuffer & i_rBuffer ) 52 | : m_rBuffer( i_rBuffer ) 53 | , m_Enum( 0 ) 54 | , m_Start( 0 ) 55 | , m_End( 0 ) 56 | { 57 | ViconCGStreamType::UInt32 Length; 58 | 59 | if( !m_rBuffer.Read( m_Enum ) || !m_rBuffer.Read( Length ) ) 60 | { 61 | return; 62 | } 63 | 64 | m_Start = m_rBuffer.Offset(); 65 | m_End = m_Start + Length; 66 | } 67 | 68 | /// Destructor. 69 | ~VScopedReader() 70 | { 71 | if( m_Start < m_End ) 72 | { 73 | m_rBuffer.SetOffset( m_End ); 74 | } 75 | } 76 | 77 | /// Determine if the current buffer offset is valid. 78 | bool Ok() 79 | { 80 | ViconCGStreamType::UInt32 Offset = m_rBuffer.Offset(); 81 | return Offset >= m_Start && Offset < m_End; 82 | } 83 | 84 | /// Get the Enum read from the block header. 85 | /// This function is used to determine the block type. 86 | /// If the block is valid, then the value returned will be defined in the ViconCGStreamEnum namespace. 87 | ViconCGStreamType::Enum Enum() const 88 | { 89 | return m_Enum; 90 | } 91 | 92 | /// Read a single item from the buffer. 93 | bool Read( ViconCGStream::VItem & o_rItem ) const 94 | { 95 | return m_rBuffer.Read( o_rItem ); 96 | } 97 | 98 | private: 99 | VBuffer& m_rBuffer; 100 | ViconCGStreamType::Enum m_Enum; 101 | ViconCGStreamType::UInt32 m_Start; 102 | ViconCGStreamType::UInt32 m_End; 103 | }; 104 | 105 | //------------------------------------------------------------------------------------------------- 106 | }; 107 | 108 | 109 | --------------------------------------------------------------------------------