Zivid C++ API 2.18.0+1b44dbef-1
CameraExtrinsics.h
Go to the documentation of this file.
1/*******************************************************************************
2 * This file is part of the Zivid API
3 *
4 * Copyright 2015-2026 (C) Zivid AS
5 * All rights reserved.
6 *
7 * Zivid Software License, v1.0
8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions are met:
11 *
12 * 1. Redistributions of source code must retain the above copyright notice,
13 * this list of conditions and the following disclaimer.
14 *
15 * 2. Redistributions in binary form must reproduce the above copyright notice,
16 * this list of conditions and the following disclaimer in the documentation
17 * and/or other materials provided with the distribution.
18 *
19 * 3. Neither the name of Zivid AS nor the names of its contributors may be used
20 * to endorse or promote products derived from this software without specific
21 * prior written permission.
22 *
23 * 4. This software, with or without modification, must not be used with any
24 * other 3D camera than from Zivid AS.
25 *
26 * 5. Any software provided in binary form under this license must not be
27 * reverse engineered, decompiled, modified and/or disassembled.
28 *
29 * THIS SOFTWARE IS PROVIDED BY ZIVID AS "AS IS" AND ANY EXPRESS OR IMPLIED
30 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
31 * MERCHANTABILITY, NONINFRINGEMENT, AND FITNESS FOR A PARTICULAR PURPOSE ARE
32 * DISCLAIMED. IN NO EVENT SHALL ZIVID AS OR CONTRIBUTORS BE LIABLE FOR ANY
33 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
34 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
35 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
36 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
38 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 *
40 * Contact: Zivid Customer Success Team <customersuccess@zivid.com>
41 * Info: http://www.zivid.com
42 ******************************************************************************/
43
44#pragma once
45
46#include <array>
47#include <chrono>
48#include <cmath>
49#include <ctime>
50#include <iomanip>
51#include <memory>
52#include <set>
53#include <sstream>
54#include <string>
55#include <tuple>
56#include <utility>
57#include <vector>
58
64#include "Zivid/Range.h"
65
66#ifdef _MSC_VER
67# pragma warning(push)
68# pragma warning(disable : 4251) // "X needs to have dll-interface to be used by clients of class Y."
69#endif
70
71namespace Zivid
72{
73
76
77 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
79 {
80 public:
83
85 static constexpr const char *path{ "" };
86
88 static constexpr const char *name{ "CameraExtrinsics" };
89
91 static constexpr const char *description{
92 R"description(Extrinsic parameters describing the pose of a camera in 3D space, expressed as a rotation quaternion and a translation vector.
93)description"
94 };
95
96 static constexpr size_t version{ 1 };
97
98#ifndef NO_DOC
99 template<size_t>
100 struct Version;
101
102 using LatestVersion = Zivid::CameraExtrinsics;
103
104 // Short identifier. This value is not guaranteed to be universally unique
105 // Todo(ZIVID-2808): Move this to internal DataModelExt header
106 static constexpr std::array<uint8_t, 3> binaryId{ 'c', 'e', 'x' };
107
108#endif
109
111
112 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
114 {
115 public:
118
120 static constexpr const char *path{ "Rw" };
121
123 static constexpr const char *name{ "Rw" };
124
126 static constexpr const char *description{
127 R"description(Unit quaternion representing the rotational component of the camera pose)description"
128 };
129
131
132 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
134 {
135 public:
138
140 static constexpr const char *path{ "Rw/W" };
141
143 static constexpr const char *name{ "W" };
144
146 static constexpr const char *description{
147 R"description(Scalar part of the unit quaternion)description"
148 };
149
151 using ValueType = double;
152
154 static constexpr Range<double> validRange()
155 {
156 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
157 }
158
160 W() = default;
161
163 explicit constexpr W(double value)
164 : m_value{ value }
165 {}
166
168 double value() const;
169
171 std::string toString() const;
172
174 bool operator==(const W &other) const
175 {
176 return m_value == other.m_value;
177 }
178
180 bool operator!=(const W &other) const
181 {
182 return m_value != other.m_value;
183 }
184
186 bool operator<(const W &other) const
187 {
188 return m_value < other.m_value;
189 }
190
192 bool operator>(const W &other) const
193 {
194 return m_value > other.m_value;
195 }
196
198 bool operator<=(const W &other) const
199 {
200 return m_value <= other.m_value;
201 }
202
204 bool operator>=(const W &other) const
205 {
206 return m_value >= other.m_value;
207 }
208
210 friend std::ostream &operator<<(std::ostream &stream, const W &value)
211 {
212 return stream << value.toString();
213 }
214
215 private:
216 void setFromString(const std::string &value);
217
218 double m_value{ 1.0 };
219
220 friend struct DataModel::Detail::Befriend<W>;
221 };
222
224
225 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
227 {
228 public:
231
233 static constexpr const char *path{ "Rw/X" };
234
236 static constexpr const char *name{ "X" };
237
239 static constexpr const char *description{
240 R"description(X component of the quaternion vector)description"
241 };
242
244 using ValueType = double;
245
247 static constexpr Range<double> validRange()
248 {
249 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
250 }
251
253 X() = default;
254
256 explicit constexpr X(double value)
257 : m_value{ value }
258 {}
259
261 double value() const;
262
264 std::string toString() const;
265
267 bool operator==(const X &other) const
268 {
269 return m_value == other.m_value;
270 }
271
273 bool operator!=(const X &other) const
274 {
275 return m_value != other.m_value;
276 }
277
279 bool operator<(const X &other) const
280 {
281 return m_value < other.m_value;
282 }
283
285 bool operator>(const X &other) const
286 {
287 return m_value > other.m_value;
288 }
289
291 bool operator<=(const X &other) const
292 {
293 return m_value <= other.m_value;
294 }
295
297 bool operator>=(const X &other) const
298 {
299 return m_value >= other.m_value;
300 }
301
303 friend std::ostream &operator<<(std::ostream &stream, const X &value)
304 {
305 return stream << value.toString();
306 }
307
308 private:
309 void setFromString(const std::string &value);
310
311 double m_value{ 0.0 };
312
313 friend struct DataModel::Detail::Befriend<X>;
314 };
315
317
318 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
320 {
321 public:
324
326 static constexpr const char *path{ "Rw/Y" };
327
329 static constexpr const char *name{ "Y" };
330
332 static constexpr const char *description{
333 R"description(Y component of the quaternion vector)description"
334 };
335
337 using ValueType = double;
338
340 static constexpr Range<double> validRange()
341 {
342 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
343 }
344
346 Y() = default;
347
349 explicit constexpr Y(double value)
350 : m_value{ value }
351 {}
352
354 double value() const;
355
357 std::string toString() const;
358
360 bool operator==(const Y &other) const
361 {
362 return m_value == other.m_value;
363 }
364
366 bool operator!=(const Y &other) const
367 {
368 return m_value != other.m_value;
369 }
370
372 bool operator<(const Y &other) const
373 {
374 return m_value < other.m_value;
375 }
376
378 bool operator>(const Y &other) const
379 {
380 return m_value > other.m_value;
381 }
382
384 bool operator<=(const Y &other) const
385 {
386 return m_value <= other.m_value;
387 }
388
390 bool operator>=(const Y &other) const
391 {
392 return m_value >= other.m_value;
393 }
394
396 friend std::ostream &operator<<(std::ostream &stream, const Y &value)
397 {
398 return stream << value.toString();
399 }
400
401 private:
402 void setFromString(const std::string &value);
403
404 double m_value{ 0.0 };
405
406 friend struct DataModel::Detail::Befriend<Y>;
407 };
408
410
411 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
413 {
414 public:
417
419 static constexpr const char *path{ "Rw/Z" };
420
422 static constexpr const char *name{ "Z" };
423
425 static constexpr const char *description{
426 R"description(Z component of the quaternion vector)description"
427 };
428
430 using ValueType = double;
431
433 static constexpr Range<double> validRange()
434 {
435 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
436 }
437
439 Z() = default;
440
442 explicit constexpr Z(double value)
443 : m_value{ value }
444 {}
445
447 double value() const;
448
450 std::string toString() const;
451
453 bool operator==(const Z &other) const
454 {
455 return m_value == other.m_value;
456 }
457
459 bool operator!=(const Z &other) const
460 {
461 return m_value != other.m_value;
462 }
463
465 bool operator<(const Z &other) const
466 {
467 return m_value < other.m_value;
468 }
469
471 bool operator>(const Z &other) const
472 {
473 return m_value > other.m_value;
474 }
475
477 bool operator<=(const Z &other) const
478 {
479 return m_value <= other.m_value;
480 }
481
483 bool operator>=(const Z &other) const
484 {
485 return m_value >= other.m_value;
486 }
487
489 friend std::ostream &operator<<(std::ostream &stream, const Z &value)
490 {
491 return stream << value.toString();
492 }
493
494 private:
495 void setFromString(const std::string &value);
496
497 double m_value{ 0.0 };
498
499 friend struct DataModel::Detail::Befriend<Z>;
500 };
501
502 using Descendants = std::tuple<
507
509 Rw();
510
525#ifndef NO_DOC
526 template<
527 typename... Args,
528 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
529 typename std::enable_if<
530 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
531 value,
532 int>::type = 0>
533#else
534 template<typename... Args>
535#endif
536 explicit Rw(Args &&...args)
537 {
538 using namespace Zivid::Detail::TypeTraits;
539
540 static_assert(
541 AllArgsDecayedAreUnique<Args...>::value,
542 "Found duplicate types among the arguments passed to Rw(...). "
543 "Types should be listed at most once.");
544
545 set(std::forward<Args>(args)...);
546 }
547
561#ifndef NO_DOC
562 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
563#else
564 template<typename... Args>
565#endif
566 void set(Args &&...args)
567 {
568 using namespace Zivid::Detail::TypeTraits;
569
570 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
571 static_assert(
572 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
573
574 static_assert(
575 AllArgsDecayedAreUnique<Args...>::value,
576 "Found duplicate types among the arguments passed to set(...). "
577 "Types should be listed at most once.");
578
579 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
580 }
581
596#ifndef NO_DOC
597 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
598#else
599 template<typename... Args>
600#endif
601 Rw copyWith(Args &&...args) const
602 {
603 using namespace Zivid::Detail::TypeTraits;
604
605 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
606 static_assert(
607 AllArgsAreDescendantNodes::value,
608 "All arguments passed to copyWith(...) must be descendant nodes.");
609
610 static_assert(
611 AllArgsDecayedAreUnique<Args...>::value,
612 "Found duplicate types among the arguments passed to copyWith(...). "
613 "Types should be listed at most once.");
614
615 auto copy{ *this };
616 copy.set(std::forward<Args>(args)...);
617 return copy;
618 }
619
621 const W &w() const
622 {
623 return m_w;
624 }
625
627 W &w()
628 {
629 return m_w;
630 }
631
633 Rw &set(const W &value)
634 {
635 m_w = value;
636 return *this;
637 }
638
640 const X &x() const
641 {
642 return m_x;
643 }
644
646 X &x()
647 {
648 return m_x;
649 }
650
652 Rw &set(const X &value)
653 {
654 m_x = value;
655 return *this;
656 }
657
659 const Y &y() const
660 {
661 return m_y;
662 }
663
665 Y &y()
666 {
667 return m_y;
668 }
669
671 Rw &set(const Y &value)
672 {
673 m_y = value;
674 return *this;
675 }
676
678 const Z &z() const
679 {
680 return m_z;
681 }
682
684 Z &z()
685 {
686 return m_z;
687 }
688
690 Rw &set(const Z &value)
691 {
692 m_z = value;
693 return *this;
694 }
695
696 template<
697 typename T,
698 typename std::enable_if<std::is_same<T, CameraExtrinsics::Rw::W>::value, int>::type = 0>
700 {
701 return m_w;
702 }
703
704 template<
705 typename T,
706 typename std::enable_if<std::is_same<T, CameraExtrinsics::Rw::X>::value, int>::type = 0>
708 {
709 return m_x;
710 }
711
712 template<
713 typename T,
714 typename std::enable_if<std::is_same<T, CameraExtrinsics::Rw::Y>::value, int>::type = 0>
716 {
717 return m_y;
718 }
719
720 template<
721 typename T,
722 typename std::enable_if<std::is_same<T, CameraExtrinsics::Rw::Z>::value, int>::type = 0>
724 {
725 return m_z;
726 }
727
728 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
730 {
731 return m_w;
732 }
733
734 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
736 {
737 return m_x;
738 }
739
740 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
742 {
743 return m_y;
744 }
745
746 template<size_t i, typename std::enable_if<i == 3, int>::type = 0>
748 {
749 return m_z;
750 }
751
753 template<typename F>
754 void forEach(const F &f) const
755 {
756 f(m_w);
757 f(m_x);
758 f(m_y);
759 f(m_z);
760 }
761
763 template<typename F>
764 void forEach(const F &f)
765 {
766 f(m_w);
767 f(m_x);
768 f(m_y);
769 f(m_z);
770 }
771
773 bool operator==(const Rw &other) const;
774
776 bool operator!=(const Rw &other) const;
777
779 std::string toString() const;
780
782 friend std::ostream &operator<<(std::ostream &stream, const Rw &value)
783 {
784 return stream << value.toString();
785 }
786
787 private:
788 void setFromString(const std::string &value);
789
790 void setFromString(const std::string &fullPath, const std::string &value);
791
792 std::string getString(const std::string &fullPath) const;
793
794 W m_w;
795 X m_x;
796 Y m_y;
797 Z m_z;
798
799 friend struct DataModel::Detail::Befriend<Rw>;
800 };
801
803
804 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
806 {
807 public:
810
812 static constexpr const char *path{ "Tw" };
813
815 static constexpr const char *name{ "Tw" };
816
818 static constexpr const char *description{
819 R"description(Translation vector representing the translational component of the camera pose)description"
820 };
821
823
824 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
826 {
827 public:
830
832 static constexpr const char *path{ "Tw/X" };
833
835 static constexpr const char *name{ "X" };
836
838 static constexpr const char *description{
839 R"description(X component of the translation vector)description"
840 };
841
843 using ValueType = double;
844
846 static constexpr Range<double> validRange()
847 {
848 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
849 }
850
852 X() = default;
853
855 explicit constexpr X(double value)
856 : m_value{ value }
857 {}
858
860 double value() const;
861
863 std::string toString() const;
864
866 bool operator==(const X &other) const
867 {
868 return m_value == other.m_value;
869 }
870
872 bool operator!=(const X &other) const
873 {
874 return m_value != other.m_value;
875 }
876
878 bool operator<(const X &other) const
879 {
880 return m_value < other.m_value;
881 }
882
884 bool operator>(const X &other) const
885 {
886 return m_value > other.m_value;
887 }
888
890 bool operator<=(const X &other) const
891 {
892 return m_value <= other.m_value;
893 }
894
896 bool operator>=(const X &other) const
897 {
898 return m_value >= other.m_value;
899 }
900
902 friend std::ostream &operator<<(std::ostream &stream, const X &value)
903 {
904 return stream << value.toString();
905 }
906
907 private:
908 void setFromString(const std::string &value);
909
910 double m_value{ 0.0 };
911
912 friend struct DataModel::Detail::Befriend<X>;
913 };
914
916
917 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
919 {
920 public:
923
925 static constexpr const char *path{ "Tw/Y" };
926
928 static constexpr const char *name{ "Y" };
929
931 static constexpr const char *description{
932 R"description(Y component of the translation vector)description"
933 };
934
936 using ValueType = double;
937
939 static constexpr Range<double> validRange()
940 {
941 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
942 }
943
945 Y() = default;
946
948 explicit constexpr Y(double value)
949 : m_value{ value }
950 {}
951
953 double value() const;
954
956 std::string toString() const;
957
959 bool operator==(const Y &other) const
960 {
961 return m_value == other.m_value;
962 }
963
965 bool operator!=(const Y &other) const
966 {
967 return m_value != other.m_value;
968 }
969
971 bool operator<(const Y &other) const
972 {
973 return m_value < other.m_value;
974 }
975
977 bool operator>(const Y &other) const
978 {
979 return m_value > other.m_value;
980 }
981
983 bool operator<=(const Y &other) const
984 {
985 return m_value <= other.m_value;
986 }
987
989 bool operator>=(const Y &other) const
990 {
991 return m_value >= other.m_value;
992 }
993
995 friend std::ostream &operator<<(std::ostream &stream, const Y &value)
996 {
997 return stream << value.toString();
998 }
999
1000 private:
1001 void setFromString(const std::string &value);
1002
1003 double m_value{ 0.0 };
1004
1005 friend struct DataModel::Detail::Befriend<Y>;
1006 };
1007
1009
1010 // NOLINTNEXTLINE(clang-analyzer-optin.performance.Padding)
1012 {
1013 public:
1016
1018 static constexpr const char *path{ "Tw/Z" };
1019
1021 static constexpr const char *name{ "Z" };
1022
1024 static constexpr const char *description{
1025 R"description(Z component of the translation vector)description"
1026 };
1027
1029 using ValueType = double;
1030
1032 static constexpr Range<double> validRange()
1033 {
1034 return { std::numeric_limits<double>::lowest(), std::numeric_limits<double>::max() };
1035 }
1036
1038 Z() = default;
1039
1041 explicit constexpr Z(double value)
1042 : m_value{ value }
1043 {}
1044
1046 double value() const;
1047
1049 std::string toString() const;
1050
1052 bool operator==(const Z &other) const
1053 {
1054 return m_value == other.m_value;
1055 }
1056
1058 bool operator!=(const Z &other) const
1059 {
1060 return m_value != other.m_value;
1061 }
1062
1064 bool operator<(const Z &other) const
1065 {
1066 return m_value < other.m_value;
1067 }
1068
1070 bool operator>(const Z &other) const
1071 {
1072 return m_value > other.m_value;
1073 }
1074
1076 bool operator<=(const Z &other) const
1077 {
1078 return m_value <= other.m_value;
1079 }
1080
1082 bool operator>=(const Z &other) const
1083 {
1084 return m_value >= other.m_value;
1085 }
1086
1088 friend std::ostream &operator<<(std::ostream &stream, const Z &value)
1089 {
1090 return stream << value.toString();
1091 }
1092
1093 private:
1094 void setFromString(const std::string &value);
1095
1096 double m_value{ 0.0 };
1097
1098 friend struct DataModel::Detail::Befriend<Z>;
1099 };
1100
1101 using Descendants = std::tuple<CameraExtrinsics::Tw::X, CameraExtrinsics::Tw::Y, CameraExtrinsics::Tw::Z>;
1102
1105
1119#ifndef NO_DOC
1120 template<
1121 typename... Args,
1122 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1123 typename std::enable_if<
1124 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::
1125 value,
1126 int>::type = 0>
1127#else
1128 template<typename... Args>
1129#endif
1130 explicit Tw(Args &&...args)
1131 {
1132 using namespace Zivid::Detail::TypeTraits;
1133
1134 static_assert(
1135 AllArgsDecayedAreUnique<Args...>::value,
1136 "Found duplicate types among the arguments passed to Tw(...). "
1137 "Types should be listed at most once.");
1138
1139 set(std::forward<Args>(args)...);
1140 }
1141
1154#ifndef NO_DOC
1155 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1156#else
1157 template<typename... Args>
1158#endif
1159 void set(Args &&...args)
1160 {
1161 using namespace Zivid::Detail::TypeTraits;
1162
1163 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1164 static_assert(
1165 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1166
1167 static_assert(
1168 AllArgsDecayedAreUnique<Args...>::value,
1169 "Found duplicate types among the arguments passed to set(...). "
1170 "Types should be listed at most once.");
1171
1172 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1173 }
1174
1188#ifndef NO_DOC
1189 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1190#else
1191 template<typename... Args>
1192#endif
1193 Tw copyWith(Args &&...args) const
1194 {
1195 using namespace Zivid::Detail::TypeTraits;
1196
1197 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1198 static_assert(
1199 AllArgsAreDescendantNodes::value,
1200 "All arguments passed to copyWith(...) must be descendant nodes.");
1201
1202 static_assert(
1203 AllArgsDecayedAreUnique<Args...>::value,
1204 "Found duplicate types among the arguments passed to copyWith(...). "
1205 "Types should be listed at most once.");
1206
1207 auto copy{ *this };
1208 copy.set(std::forward<Args>(args)...);
1209 return copy;
1210 }
1211
1213 const X &x() const
1214 {
1215 return m_x;
1216 }
1217
1219 X &x()
1220 {
1221 return m_x;
1222 }
1223
1225 Tw &set(const X &value)
1226 {
1227 m_x = value;
1228 return *this;
1229 }
1230
1232 const Y &y() const
1233 {
1234 return m_y;
1235 }
1236
1238 Y &y()
1239 {
1240 return m_y;
1241 }
1242
1244 Tw &set(const Y &value)
1245 {
1246 m_y = value;
1247 return *this;
1248 }
1249
1251 const Z &z() const
1252 {
1253 return m_z;
1254 }
1255
1257 Z &z()
1258 {
1259 return m_z;
1260 }
1261
1263 Tw &set(const Z &value)
1264 {
1265 m_z = value;
1266 return *this;
1267 }
1268
1269 template<
1270 typename T,
1271 typename std::enable_if<std::is_same<T, CameraExtrinsics::Tw::X>::value, int>::type = 0>
1273 {
1274 return m_x;
1275 }
1276
1277 template<
1278 typename T,
1279 typename std::enable_if<std::is_same<T, CameraExtrinsics::Tw::Y>::value, int>::type = 0>
1281 {
1282 return m_y;
1283 }
1284
1285 template<
1286 typename T,
1287 typename std::enable_if<std::is_same<T, CameraExtrinsics::Tw::Z>::value, int>::type = 0>
1289 {
1290 return m_z;
1291 }
1292
1293 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1295 {
1296 return m_x;
1297 }
1298
1299 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1301 {
1302 return m_y;
1303 }
1304
1305 template<size_t i, typename std::enable_if<i == 2, int>::type = 0>
1307 {
1308 return m_z;
1309 }
1310
1312 template<typename F>
1313 void forEach(const F &f) const
1314 {
1315 f(m_x);
1316 f(m_y);
1317 f(m_z);
1318 }
1319
1321 template<typename F>
1322 void forEach(const F &f)
1323 {
1324 f(m_x);
1325 f(m_y);
1326 f(m_z);
1327 }
1328
1330 bool operator==(const Tw &other) const;
1331
1333 bool operator!=(const Tw &other) const;
1334
1336 std::string toString() const;
1337
1339 friend std::ostream &operator<<(std::ostream &stream, const Tw &value)
1340 {
1341 return stream << value.toString();
1342 }
1343
1344 private:
1345 void setFromString(const std::string &value);
1346
1347 void setFromString(const std::string &fullPath, const std::string &value);
1348
1349 std::string getString(const std::string &fullPath) const;
1350
1351 X m_x;
1352 Y m_y;
1353 Z m_z;
1354
1355 friend struct DataModel::Detail::Befriend<Tw>;
1356 };
1357
1358 using Descendants = std::tuple<
1368
1371
1373 explicit CameraExtrinsics(const std::string &fileName);
1374
1380 [[nodiscard]] static CameraExtrinsics fromSerialized(const std::string &value);
1381
1387 std::string serialize() const;
1388
1408#ifndef NO_DOC
1409 template<
1410 typename... Args,
1411 typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0,
1412 typename std::enable_if<
1413 Zivid::Detail::TypeTraits::AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>::value,
1414 int>::type = 0>
1415#else
1416 template<typename... Args>
1417#endif
1418 explicit CameraExtrinsics(Args &&...args)
1419 {
1420 using namespace Zivid::Detail::TypeTraits;
1421
1422 static_assert(
1423 AllArgsDecayedAreUnique<Args...>::value,
1424 "Found duplicate types among the arguments passed to CameraExtrinsics(...). "
1425 "Types should be listed at most once.");
1426
1427 set(std::forward<Args>(args)...);
1428 }
1429
1448#ifndef NO_DOC
1449 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 2, int>::type = 0>
1450#else
1451 template<typename... Args>
1452#endif
1453 void set(Args &&...args)
1454 {
1455 using namespace Zivid::Detail::TypeTraits;
1456
1457 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1458 static_assert(
1459 AllArgsAreDescendantNodes::value, "All arguments passed to set(...) must be descendant nodes.");
1460
1461 static_assert(
1462 AllArgsDecayedAreUnique<Args...>::value,
1463 "Found duplicate types among the arguments passed to set(...). "
1464 "Types should be listed at most once.");
1465
1466 Zivid::DataModel::Detail::invokeSetWithEachArgument(*this, std::forward<Args>(args)...);
1467 }
1468
1488#ifndef NO_DOC
1489 template<typename... Args, typename std::enable_if<sizeof...(Args) >= 1, int>::type = 0>
1490#else
1491 template<typename... Args>
1492#endif
1493 CameraExtrinsics copyWith(Args &&...args) const
1494 {
1495 using namespace Zivid::Detail::TypeTraits;
1496
1497 using AllArgsAreDescendantNodes = AllArgsAreInTuple<Descendants, typename std::decay<Args>::type...>;
1498 static_assert(
1499 AllArgsAreDescendantNodes::value, "All arguments passed to copyWith(...) must be descendant nodes.");
1500
1501 static_assert(
1502 AllArgsDecayedAreUnique<Args...>::value,
1503 "Found duplicate types among the arguments passed to copyWith(...). "
1504 "Types should be listed at most once.");
1505
1506 auto copy{ *this };
1507 copy.set(std::forward<Args>(args)...);
1508 return copy;
1509 }
1510
1512 const Rw &rw() const
1513 {
1514 return m_rw;
1515 }
1516
1519 {
1520 return m_rw;
1521 }
1522
1524 CameraExtrinsics &set(const Rw &value)
1525 {
1526 m_rw = value;
1527 return *this;
1528 }
1529
1532 {
1533 m_rw.set(value);
1534 return *this;
1535 }
1536
1539 {
1540 m_rw.set(value);
1541 return *this;
1542 }
1543
1546 {
1547 m_rw.set(value);
1548 return *this;
1549 }
1550
1553 {
1554 m_rw.set(value);
1555 return *this;
1556 }
1557
1559 const Tw &tw() const
1560 {
1561 return m_tw;
1562 }
1563
1566 {
1567 return m_tw;
1568 }
1569
1571 CameraExtrinsics &set(const Tw &value)
1572 {
1573 m_tw = value;
1574 return *this;
1575 }
1576
1579 {
1580 m_tw.set(value);
1581 return *this;
1582 }
1583
1586 {
1587 m_tw.set(value);
1588 return *this;
1589 }
1590
1593 {
1594 m_tw.set(value);
1595 return *this;
1596 }
1597
1598 template<typename T, typename std::enable_if<std::is_same<T, CameraExtrinsics::Rw>::value, int>::type = 0>
1600 {
1601 return m_rw;
1602 }
1603
1604 template<typename T, typename std::enable_if<std::is_same<T, CameraExtrinsics::Rw::W>::value, int>::type = 0>
1606 {
1607 return m_rw.get<CameraExtrinsics::Rw::W>();
1608 }
1609
1610 template<typename T, typename std::enable_if<std::is_same<T, CameraExtrinsics::Rw::X>::value, int>::type = 0>
1612 {
1613 return m_rw.get<CameraExtrinsics::Rw::X>();
1614 }
1615
1616 template<typename T, typename std::enable_if<std::is_same<T, CameraExtrinsics::Rw::Y>::value, int>::type = 0>
1618 {
1619 return m_rw.get<CameraExtrinsics::Rw::Y>();
1620 }
1621
1622 template<typename T, typename std::enable_if<std::is_same<T, CameraExtrinsics::Rw::Z>::value, int>::type = 0>
1624 {
1625 return m_rw.get<CameraExtrinsics::Rw::Z>();
1626 }
1627
1628 template<typename T, typename std::enable_if<std::is_same<T, CameraExtrinsics::Tw>::value, int>::type = 0>
1630 {
1631 return m_tw;
1632 }
1633
1634 template<typename T, typename std::enable_if<std::is_same<T, CameraExtrinsics::Tw::X>::value, int>::type = 0>
1636 {
1637 return m_tw.get<CameraExtrinsics::Tw::X>();
1638 }
1639
1640 template<typename T, typename std::enable_if<std::is_same<T, CameraExtrinsics::Tw::Y>::value, int>::type = 0>
1642 {
1643 return m_tw.get<CameraExtrinsics::Tw::Y>();
1644 }
1645
1646 template<typename T, typename std::enable_if<std::is_same<T, CameraExtrinsics::Tw::Z>::value, int>::type = 0>
1648 {
1649 return m_tw.get<CameraExtrinsics::Tw::Z>();
1650 }
1651
1652 template<size_t i, typename std::enable_if<i == 0, int>::type = 0>
1654 {
1655 return m_rw;
1656 }
1657
1658 template<size_t i, typename std::enable_if<i == 1, int>::type = 0>
1660 {
1661 return m_tw;
1662 }
1663
1665 template<typename F>
1666 void forEach(const F &f) const
1667 {
1668 f(m_rw);
1669 f(m_tw);
1670 }
1671
1673 template<typename F>
1674 void forEach(const F &f)
1675 {
1676 f(m_rw);
1677 f(m_tw);
1678 }
1679
1681 bool operator==(const CameraExtrinsics &other) const;
1682
1684 bool operator!=(const CameraExtrinsics &other) const;
1685
1687 std::string toString() const;
1688
1690 friend std::ostream &operator<<(std::ostream &stream, const CameraExtrinsics &value)
1691 {
1692 return stream << value.toString();
1693 }
1694
1696 void save(const std::string &fileName) const;
1697
1699 void load(const std::string &fileName);
1700
1701 private:
1702 void setFromString(const std::string &value);
1703
1704 void setFromString(const std::string &fullPath, const std::string &value);
1705
1706 std::string getString(const std::string &fullPath) const;
1707
1708 Rw m_rw;
1709 Tw m_tw;
1710
1711 friend struct DataModel::Detail::Befriend<CameraExtrinsics>;
1712 };
1713
1714#ifndef NO_DOC
1715 template<>
1716 struct CameraExtrinsics::Version<1>
1717 {
1718 using Type = CameraExtrinsics;
1719 };
1720#endif
1721
1722} // namespace Zivid
1723
1724#ifndef NO_DOC
1726namespace Zivid::Detail
1727{
1728
1729 ZIVID_CORE_EXPORT void save(const Zivid::CameraExtrinsics &dataModel, std::ostream &ostream);
1730 ZIVID_CORE_EXPORT void load(Zivid::CameraExtrinsics &dataModel, std::istream &istream);
1731
1732} // namespace Zivid::Detail
1733#endif
1734
1735#ifdef _MSC_VER
1736# pragma warning(pop)
1737#endif
1738
1739#ifndef NO_DOC
1740# if !(defined(_MSC_VER) && (_MSC_VER <= 1900))
1741namespace std // NOLINT
1742{
1743
1744 template<>
1745 struct tuple_size<Zivid::CameraExtrinsics::Rw> : integral_constant<size_t, 4>
1746 {};
1747
1748 template<size_t i>
1749 struct tuple_element<i, Zivid::CameraExtrinsics::Rw>
1750 {
1751 static_assert(i < tuple_size<Zivid::CameraExtrinsics::Rw>::value, "Index must be less than 4");
1752
1753 using type // NOLINT
1754 = decltype(declval<Zivid::CameraExtrinsics::Rw>().get<i>());
1755 };
1756
1757 template<>
1758 struct tuple_size<Zivid::CameraExtrinsics::Tw> : integral_constant<size_t, 3>
1759 {};
1760
1761 template<size_t i>
1762 struct tuple_element<i, Zivid::CameraExtrinsics::Tw>
1763 {
1764 static_assert(i < tuple_size<Zivid::CameraExtrinsics::Tw>::value, "Index must be less than 3");
1765
1766 using type // NOLINT
1767 = decltype(declval<Zivid::CameraExtrinsics::Tw>().get<i>());
1768 };
1769
1770 template<>
1771 struct tuple_size<Zivid::CameraExtrinsics> : integral_constant<size_t, 2>
1772 {};
1773
1774 template<size_t i>
1775 struct tuple_element<i, Zivid::CameraExtrinsics>
1776 {
1777 static_assert(i < tuple_size<Zivid::CameraExtrinsics>::value, "Index must be less than 2");
1778
1779 using type // NOLINT
1780 = decltype(declval<Zivid::CameraExtrinsics>().get<i>());
1781 };
1782
1783} // namespace std
1784# endif
1785#endif
1786
1787// If we have access to the DataModel library, automatically include internal DataModel
1788// header. This header is necessary for serialization and deserialization.
1789#if defined(__has_include) && !defined(NO_DOC)
1790# if __has_include("Zivid/CameraExtrinsicsInternal.h") && __has_include("Zivid/DataModelNodeMetaData.h")
1791# include "Zivid/CameraExtrinsicsInternal.h"
1792# endif
1793#endif
#define ZIVID_CORE_EXPORT
Definition CoreExport.h:56
Scalar part of the unit quaternion.
Definition CameraExtrinsics.h:134
double value() const
Get the value.
friend std::ostream & operator<<(std::ostream &stream, const W &value)
Operator to serialize the value to a stream.
Definition CameraExtrinsics.h:210
static constexpr const char * name
The name of this value.
Definition CameraExtrinsics.h:143
bool operator!=(const W &other) const
Comparison operator.
Definition CameraExtrinsics.h:180
std::string toString() const
Get the value as string.
static constexpr const char * description
The description for this value.
Definition CameraExtrinsics.h:146
bool operator<(const W &other) const
Comparison operator.
Definition CameraExtrinsics.h:186
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraExtrinsics.h:137
W()=default
Default constructor.
bool operator==(const W &other) const
Comparison operator.
Definition CameraExtrinsics.h:174
constexpr W(double value)
Constructor.
Definition CameraExtrinsics.h:163
bool operator>=(const W &other) const
Comparison operator.
Definition CameraExtrinsics.h:204
double ValueType
The type of the underlying value.
Definition CameraExtrinsics.h:151
bool operator>(const W &other) const
Comparison operator.
Definition CameraExtrinsics.h:192
bool operator<=(const W &other) const
Comparison operator.
Definition CameraExtrinsics.h:198
static constexpr const char * path
The full path for this value.
Definition CameraExtrinsics.h:140
static constexpr Range< double > validRange()
The range of valid values for W.
Definition CameraExtrinsics.h:154
X component of the quaternion vector.
Definition CameraExtrinsics.h:227
bool operator>=(const X &other) const
Comparison operator.
Definition CameraExtrinsics.h:297
bool operator!=(const X &other) const
Comparison operator.
Definition CameraExtrinsics.h:273
std::string toString() const
Get the value as string.
X()=default
Default constructor.
double value() const
Get the value.
static constexpr const char * description
The description for this value.
Definition CameraExtrinsics.h:239
bool operator>(const X &other) const
Comparison operator.
Definition CameraExtrinsics.h:285
double ValueType
The type of the underlying value.
Definition CameraExtrinsics.h:244
constexpr X(double value)
Constructor.
Definition CameraExtrinsics.h:256
static constexpr const char * name
The name of this value.
Definition CameraExtrinsics.h:236
bool operator<=(const X &other) const
Comparison operator.
Definition CameraExtrinsics.h:291
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraExtrinsics.h:230
static constexpr Range< double > validRange()
The range of valid values for X.
Definition CameraExtrinsics.h:247
friend std::ostream & operator<<(std::ostream &stream, const X &value)
Operator to serialize the value to a stream.
Definition CameraExtrinsics.h:303
bool operator==(const X &other) const
Comparison operator.
Definition CameraExtrinsics.h:267
static constexpr const char * path
The full path for this value.
Definition CameraExtrinsics.h:233
bool operator<(const X &other) const
Comparison operator.
Definition CameraExtrinsics.h:279
Y component of the quaternion vector.
Definition CameraExtrinsics.h:320
static constexpr const char * description
The description for this value.
Definition CameraExtrinsics.h:332
Y()=default
Default constructor.
static constexpr Range< double > validRange()
The range of valid values for Y.
Definition CameraExtrinsics.h:340
bool operator>(const Y &other) const
Comparison operator.
Definition CameraExtrinsics.h:378
bool operator>=(const Y &other) const
Comparison operator.
Definition CameraExtrinsics.h:390
std::string toString() const
Get the value as string.
bool operator!=(const Y &other) const
Comparison operator.
Definition CameraExtrinsics.h:366
static constexpr const char * path
The full path for this value.
Definition CameraExtrinsics.h:326
static constexpr const char * name
The name of this value.
Definition CameraExtrinsics.h:329
bool operator==(const Y &other) const
Comparison operator.
Definition CameraExtrinsics.h:360
constexpr Y(double value)
Constructor.
Definition CameraExtrinsics.h:349
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraExtrinsics.h:323
bool operator<(const Y &other) const
Comparison operator.
Definition CameraExtrinsics.h:372
double value() const
Get the value.
friend std::ostream & operator<<(std::ostream &stream, const Y &value)
Operator to serialize the value to a stream.
Definition CameraExtrinsics.h:396
double ValueType
The type of the underlying value.
Definition CameraExtrinsics.h:337
bool operator<=(const Y &other) const
Comparison operator.
Definition CameraExtrinsics.h:384
Z component of the quaternion vector.
Definition CameraExtrinsics.h:413
std::string toString() const
Get the value as string.
bool operator!=(const Z &other) const
Comparison operator.
Definition CameraExtrinsics.h:459
Z()=default
Default constructor.
bool operator<(const Z &other) const
Comparison operator.
Definition CameraExtrinsics.h:465
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraExtrinsics.h:416
static constexpr const char * name
The name of this value.
Definition CameraExtrinsics.h:422
constexpr Z(double value)
Constructor.
Definition CameraExtrinsics.h:442
bool operator>(const Z &other) const
Comparison operator.
Definition CameraExtrinsics.h:471
static constexpr Range< double > validRange()
The range of valid values for Z.
Definition CameraExtrinsics.h:433
static constexpr const char * description
The description for this value.
Definition CameraExtrinsics.h:425
bool operator<=(const Z &other) const
Comparison operator.
Definition CameraExtrinsics.h:477
bool operator>=(const Z &other) const
Comparison operator.
Definition CameraExtrinsics.h:483
static constexpr const char * path
The full path for this value.
Definition CameraExtrinsics.h:419
bool operator==(const Z &other) const
Comparison operator.
Definition CameraExtrinsics.h:453
double ValueType
The type of the underlying value.
Definition CameraExtrinsics.h:430
friend std::ostream & operator<<(std::ostream &stream, const Z &value)
Operator to serialize the value to a stream.
Definition CameraExtrinsics.h:489
double value() const
Get the value.
Unit quaternion representing the rotational component of the camera pose.
Definition CameraExtrinsics.h:114
const W & w() const
Get W.
Definition CameraExtrinsics.h:621
Rw & set(const W &value)
Set W.
Definition CameraExtrinsics.h:633
const CameraExtrinsics::Rw::W & get() const
Definition CameraExtrinsics.h:699
W & w()
Get W.
Definition CameraExtrinsics.h:627
void set(Args &&...args)
Set multiple arguments.
Definition CameraExtrinsics.h:566
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraExtrinsics.h:764
const Z & z() const
Get Z.
Definition CameraExtrinsics.h:678
friend std::ostream & operator<<(std::ostream &stream, const Rw &value)
Operator to send the value as string to a stream.
Definition CameraExtrinsics.h:782
Z & z()
Get Z.
Definition CameraExtrinsics.h:684
static constexpr const char * path
The full path for this value.
Definition CameraExtrinsics.h:120
Rw copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition CameraExtrinsics.h:601
Rw()
Default constructor.
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter.
Definition CameraExtrinsics.h:754
const CameraExtrinsics::Rw::X & get() const
Definition CameraExtrinsics.h:707
static constexpr const char * name
The name of this value.
Definition CameraExtrinsics.h:123
Rw & set(const Y &value)
Set Y.
Definition CameraExtrinsics.h:671
bool operator==(const Rw &other) const
Equality operator.
Y & y()
Get Y.
Definition CameraExtrinsics.h:665
const Y & y() const
Get Y.
Definition CameraExtrinsics.h:659
Rw & set(const X &value)
Set X.
Definition CameraExtrinsics.h:652
std::string toString() const
Get the value as string.
Rw & set(const Z &value)
Set Z.
Definition CameraExtrinsics.h:690
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraExtrinsics.h:117
const X & x() const
Get X.
Definition CameraExtrinsics.h:640
X & x()
Get X.
Definition CameraExtrinsics.h:646
const CameraExtrinsics::Rw::Z & get() const
Definition CameraExtrinsics.h:723
static constexpr const char * description
The description for this value.
Definition CameraExtrinsics.h:126
const CameraExtrinsics::Rw::Y & get() const
Definition CameraExtrinsics.h:715
std::tuple< CameraExtrinsics::Rw::W, CameraExtrinsics::Rw::X, CameraExtrinsics::Rw::Y, CameraExtrinsics::Rw::Z > Descendants
Definition CameraExtrinsics.h:502
bool operator!=(const Rw &other) const
Inequality operator.
X component of the translation vector.
Definition CameraExtrinsics.h:826
static constexpr const char * description
The description for this value.
Definition CameraExtrinsics.h:838
static constexpr const char * name
The name of this value.
Definition CameraExtrinsics.h:835
std::string toString() const
Get the value as string.
bool operator>(const X &other) const
Comparison operator.
Definition CameraExtrinsics.h:884
X()=default
Default constructor.
bool operator>=(const X &other) const
Comparison operator.
Definition CameraExtrinsics.h:896
bool operator==(const X &other) const
Comparison operator.
Definition CameraExtrinsics.h:866
bool operator<(const X &other) const
Comparison operator.
Definition CameraExtrinsics.h:878
static constexpr const char * path
The full path for this value.
Definition CameraExtrinsics.h:832
double value() const
Get the value.
bool operator<=(const X &other) const
Comparison operator.
Definition CameraExtrinsics.h:890
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraExtrinsics.h:829
double ValueType
The type of the underlying value.
Definition CameraExtrinsics.h:843
friend std::ostream & operator<<(std::ostream &stream, const X &value)
Operator to serialize the value to a stream.
Definition CameraExtrinsics.h:902
static constexpr Range< double > validRange()
The range of valid values for X.
Definition CameraExtrinsics.h:846
constexpr X(double value)
Constructor.
Definition CameraExtrinsics.h:855
bool operator!=(const X &other) const
Comparison operator.
Definition CameraExtrinsics.h:872
Y component of the translation vector.
Definition CameraExtrinsics.h:919
bool operator<=(const Y &other) const
Comparison operator.
Definition CameraExtrinsics.h:983
bool operator<(const Y &other) const
Comparison operator.
Definition CameraExtrinsics.h:971
std::string toString() const
Get the value as string.
static constexpr Range< double > validRange()
The range of valid values for Y.
Definition CameraExtrinsics.h:939
bool operator==(const Y &other) const
Comparison operator.
Definition CameraExtrinsics.h:959
double ValueType
The type of the underlying value.
Definition CameraExtrinsics.h:936
double value() const
Get the value.
bool operator>=(const Y &other) const
Comparison operator.
Definition CameraExtrinsics.h:989
static constexpr const char * description
The description for this value.
Definition CameraExtrinsics.h:931
static constexpr const char * name
The name of this value.
Definition CameraExtrinsics.h:928
bool operator>(const Y &other) const
Comparison operator.
Definition CameraExtrinsics.h:977
static constexpr const char * path
The full path for this value.
Definition CameraExtrinsics.h:925
Y()=default
Default constructor.
bool operator!=(const Y &other) const
Comparison operator.
Definition CameraExtrinsics.h:965
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraExtrinsics.h:922
friend std::ostream & operator<<(std::ostream &stream, const Y &value)
Operator to serialize the value to a stream.
Definition CameraExtrinsics.h:995
constexpr Y(double value)
Constructor.
Definition CameraExtrinsics.h:948
Z component of the translation vector.
Definition CameraExtrinsics.h:1012
double value() const
Get the value.
bool operator>=(const Z &other) const
Comparison operator.
Definition CameraExtrinsics.h:1082
static constexpr const char * path
The full path for this value.
Definition CameraExtrinsics.h:1018
static constexpr const char * description
The description for this value.
Definition CameraExtrinsics.h:1024
bool operator!=(const Z &other) const
Comparison operator.
Definition CameraExtrinsics.h:1058
bool operator<=(const Z &other) const
Comparison operator.
Definition CameraExtrinsics.h:1076
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraExtrinsics.h:1015
bool operator>(const Z &other) const
Comparison operator.
Definition CameraExtrinsics.h:1070
std::string toString() const
Get the value as string.
static constexpr const char * name
The name of this value.
Definition CameraExtrinsics.h:1021
bool operator<(const Z &other) const
Comparison operator.
Definition CameraExtrinsics.h:1064
static constexpr Range< double > validRange()
The range of valid values for Z.
Definition CameraExtrinsics.h:1032
friend std::ostream & operator<<(std::ostream &stream, const Z &value)
Operator to serialize the value to a stream.
Definition CameraExtrinsics.h:1088
Z()=default
Default constructor.
bool operator==(const Z &other) const
Comparison operator.
Definition CameraExtrinsics.h:1052
constexpr Z(double value)
Constructor.
Definition CameraExtrinsics.h:1041
double ValueType
The type of the underlying value.
Definition CameraExtrinsics.h:1029
Translation vector representing the translational component of the camera pose.
Definition CameraExtrinsics.h:806
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter.
Definition CameraExtrinsics.h:1313
friend std::ostream & operator<<(std::ostream &stream, const Tw &value)
Operator to send the value as string to a stream.
Definition CameraExtrinsics.h:1339
Z & z()
Get Z.
Definition CameraExtrinsics.h:1257
const Z & z() const
Get Z.
Definition CameraExtrinsics.h:1251
Tw & set(const Z &value)
Set Z.
Definition CameraExtrinsics.h:1263
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraExtrinsics.h:809
static constexpr const char * description
The description for this value.
Definition CameraExtrinsics.h:818
Tw copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition CameraExtrinsics.h:1193
bool operator==(const Tw &other) const
Equality operator.
const X & x() const
Get X.
Definition CameraExtrinsics.h:1213
Tw & set(const X &value)
Set X.
Definition CameraExtrinsics.h:1225
Tw & set(const Y &value)
Set Y.
Definition CameraExtrinsics.h:1244
const Y & y() const
Get Y.
Definition CameraExtrinsics.h:1232
std::string toString() const
Get the value as string.
static constexpr const char * name
The name of this value.
Definition CameraExtrinsics.h:815
const CameraExtrinsics::Tw::Z & get() const
Definition CameraExtrinsics.h:1288
Tw()
Default constructor.
void set(Args &&...args)
Set multiple arguments.
Definition CameraExtrinsics.h:1159
X & x()
Get X.
Definition CameraExtrinsics.h:1219
bool operator!=(const Tw &other) const
Inequality operator.
const CameraExtrinsics::Tw::Y & get() const
Definition CameraExtrinsics.h:1280
const CameraExtrinsics::Tw::X & get() const
Definition CameraExtrinsics.h:1272
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraExtrinsics.h:1322
std::tuple< CameraExtrinsics::Tw::X, CameraExtrinsics::Tw::Y, CameraExtrinsics::Tw::Z > Descendants
Definition CameraExtrinsics.h:1101
Y & y()
Get Y.
Definition CameraExtrinsics.h:1238
static constexpr const char * path
The full path for this value.
Definition CameraExtrinsics.h:812
Extrinsic parameters describing the pose of a camera in 3D space, expressed as a rotation quaternion ...
Definition CameraExtrinsics.h:79
static constexpr const char * description
The description for this value.
Definition CameraExtrinsics.h:91
CameraExtrinsics & set(const Tw::Z &value)
Set Tw::Z.
Definition CameraExtrinsics.h:1592
CameraExtrinsics & set(const Rw::X &value)
Set Rw::X.
Definition CameraExtrinsics.h:1538
CameraExtrinsics & set(const Rw::Z &value)
Set Rw::Z.
Definition CameraExtrinsics.h:1552
CameraExtrinsics & set(const Rw &value)
Set Rw.
Definition CameraExtrinsics.h:1524
bool operator!=(const CameraExtrinsics &other) const
Inequality operator.
const Tw & tw() const
Get Tw.
Definition CameraExtrinsics.h:1559
static CameraExtrinsics fromSerialized(const std::string &value)
Construct a new CameraExtrinsics instance from a previously serialized string.
CameraExtrinsics()
Default constructor.
CameraExtrinsics & set(const Tw::X &value)
Set Tw::X.
Definition CameraExtrinsics.h:1578
static constexpr const char * path
The full path for this value.
Definition CameraExtrinsics.h:85
CameraExtrinsics & set(const Tw &value)
Set Tw.
Definition CameraExtrinsics.h:1571
std::string serialize() const
Serialize to a string.
const CameraExtrinsics::Rw & get() const
Definition CameraExtrinsics.h:1599
const CameraExtrinsics::Tw::X & get() const
Definition CameraExtrinsics.h:1635
static constexpr DataModel::NodeType nodeType
The type of this node.
Definition CameraExtrinsics.h:82
CameraExtrinsics(Args &&...args)
Constructor taking variadic number of arguments.
Definition CameraExtrinsics.h:1418
std::tuple< CameraExtrinsics::Rw, CameraExtrinsics::Rw::W, CameraExtrinsics::Rw::X, CameraExtrinsics::Rw::Y, CameraExtrinsics::Rw::Z, CameraExtrinsics::Tw, CameraExtrinsics::Tw::X, CameraExtrinsics::Tw::Y, CameraExtrinsics::Tw::Z > Descendants
Definition CameraExtrinsics.h:1358
CameraExtrinsics & set(const Rw::Y &value)
Set Rw::Y.
Definition CameraExtrinsics.h:1545
const CameraExtrinsics::Rw::Y & get() const
Definition CameraExtrinsics.h:1617
const CameraExtrinsics::Rw::W & get() const
Definition CameraExtrinsics.h:1605
Rw & rw()
Get Rw.
Definition CameraExtrinsics.h:1518
const CameraExtrinsics::Tw & get() const
Definition CameraExtrinsics.h:1629
void load(const std::string &fileName)
Load from the given file.
Tw & tw()
Get Tw.
Definition CameraExtrinsics.h:1565
std::string toString() const
Get the value as string.
static constexpr const char * name
The name of this value.
Definition CameraExtrinsics.h:88
void set(Args &&...args)
Set multiple arguments.
Definition CameraExtrinsics.h:1453
friend std::ostream & operator<<(std::ostream &stream, const CameraExtrinsics &value)
Operator to send the value as string to a stream.
Definition CameraExtrinsics.h:1690
const CameraExtrinsics::Tw::Y & get() const
Definition CameraExtrinsics.h:1641
const CameraExtrinsics::Tw::Z & get() const
Definition CameraExtrinsics.h:1647
void forEach(const F &f) const
Run the given function on each direct member with the value of the member as parameter.
Definition CameraExtrinsics.h:1666
static constexpr size_t version
Definition CameraExtrinsics.h:96
const CameraExtrinsics::Rw::Z & get() const
Definition CameraExtrinsics.h:1623
CameraExtrinsics(const std::string &fileName)
Construct CameraExtrinsics by loading from file.
const CameraExtrinsics::Rw::X & get() const
Definition CameraExtrinsics.h:1611
void save(const std::string &fileName) const
Save to the given file.
void forEach(const F &f)
Run the given function on each direct member with the value of the member as parameter.
Definition CameraExtrinsics.h:1674
CameraExtrinsics copyWith(Args &&...args) const
Returns a copy of this object with the given argument(s) set to the new value(s)
Definition CameraExtrinsics.h:1493
const Rw & rw() const
Get Rw.
Definition CameraExtrinsics.h:1512
bool operator==(const CameraExtrinsics &other) const
Equality operator.
CameraExtrinsics & set(const Tw::Y &value)
Set Tw::Y.
Definition CameraExtrinsics.h:1585
CameraExtrinsics & set(const Rw::W &value)
Set Rw::W.
Definition CameraExtrinsics.h:1531
Class describing a range of values for a given type T.
Definition Range.h:75
NodeType
Definition NodeType.h:49
@ leafValue
Definition NodeType.h:52
@ group
Definition NodeType.h:50
Definition EnvironmentInfo.h:74
Get version information for the library.
Definition Version.h:58
The main Zivid namespace. All Zivid code is found here.
Definition Application.h:85