Go to the documentation of this file.
1 #pragma once
2 #define _SC_STORE_H
3 
4 #include <cstdint>
5 #include <memory>
6 #include <cstring>
7 #include <stdexcept>
8 #include <vector>
9 
10 #include "communicator_version.h"
11 
12 namespace TC {
13 namespace Store {
14 class CacheImpl;
15 class ModelImpl;
16 } // namespace Store
17 namespace IO {
18 class MemoryFilesystem;
19 class AbstractFile;
20 } // namespace IO
21 } // namespace TC
22 
23 namespace SC { namespace Store {
24 
27 class Logger {
28 public:
29  virtual ~Logger() {}
30 
35  virtual void Message(char const* utf8_message) const = 0;
36 };
37 
39 class Exception: public std::runtime_error {
40 public:
41  Exception(std::string const& message)
42  : std::runtime_error(message)
43  {}
44 };
45 
47 template<typename T>
48 struct KeyHasher;
49 
50 template<>
51 struct KeyHasher<uint32_t> {
52  inline uint64_t
53  operator()(uint32_t key) const
54  {
55  uint64_t hash = (uint64_t)key;
56  hash = (hash ^ 61) ^ (hash >> 16);
57  hash = hash + (hash << 3);
58  hash = hash ^ (hash >> 4);
59  hash = hash * 0x27d4eb2d;
60  hash = hash ^ (hash >> 15);
61  return hash;
62  }
63 };
64 
65 template<typename T>
66 struct KeyHasher: public KeyHasher<uint32_t> {
67  inline uint64_t
68  operator()(const T& key) const
69  {
70  return KeyHasher<uint32_t>()(key._key);
71  }
72 };
73 
75 template<typename T>
76 struct IdHasher {
77  inline uint64_t
78  operator()(const T& id) const
79  {
80  KeyHasher<decltype(id.first)> first_hasher;
81  KeyHasher<decltype(id.second)> second_hasher;
82  return first_hasher(id.first) ^ second_hasher(id.second);
83  }
84 };
85 
87 class ModelKey {
88 public:
90  : _key(0)
91  {}
92  constexpr explicit ModelKey(uint32_t key)
93  : _key(key)
94  {}
95  ModelKey&
96  operator=(uint32_t key)
97  {
98  _key = key;
99  return *this;
100  }
101  bool
102  operator==(ModelKey const& that)
103  {
104  return (_key == that._key);
105  }
106  operator uint32_t() const
107  {
108  return _key;
109  }
110  uint32_t _key;
111 };
112 
114 class MeshKey {
115 public:
117  : _key(0)
118  {}
119  explicit MeshKey(uint32_t key)
120  : _key(key)
121  {}
122  MeshKey&
123  operator=(uint32_t key)
124  {
125  _key = key;
126  return *this;
127  }
128  bool
129  operator==(MeshKey const& that)
130  {
131  return (_key == that._key);
132  }
133  operator uint32_t() const
134  {
135  return _key;
136  }
137  uint32_t _key;
138 };
139 
141 class InstanceKey {
142 public:
144  : _key(0)
145  {}
146  explicit InstanceKey(uint32_t key)
147  : _key(key)
148  {}
149  InstanceKey&
150  operator=(uint32_t key)
151  {
152  _key = key;
153  return *this;
154  }
155  bool
156  operator==(InstanceKey const& that)
157  {
158  return (_key == that._key);
159  }
160  operator uint32_t() const
161  {
162  return _key;
163  }
164  uint32_t _key;
165 };
166 
169 public:
171  : _key(0)
172  {}
173  explicit PolyPolygonKey(uint32_t key)
174  : _key(key)
175  {}
177  operator=(uint32_t key)
178  {
179  _key = key;
180  return *this;
181  }
182  bool
184  {
185  return (_key == that._key);
186  }
187  operator uint32_t() const
188  {
189  return _key;
190  }
191  uint32_t _key;
192 };
193 
200 public:
202  : _key(0)
203  {}
204  explicit ClipRegionKey(uint32_t key)
205  : _key(key)
206  {}
208  operator=(uint32_t key)
209  {
210  _key = key;
211  return *this;
212  }
213  bool
215  {
216  return (_key == that._key);
217  }
218  operator uint32_t() const
219  {
220  return _key;
221  }
222  uint32_t _key;
223 };
224 
227 public:
229  : _key(0)
230  {}
231  explicit InclusionKey(uint32_t key)
232  : _key(key)
233  {}
234  InclusionKey&
235  operator=(uint32_t key)
236  {
237  _key = key;
238  return *this;
239  }
240  bool
242  {
243  return (_key == that._key);
244  }
245  operator uint32_t() const
246  {
247  return _key;
248  }
249  uint32_t _key;
250 };
251 
253 class MaterialKey {
254 public:
256  : _key(0)
257  {}
258  explicit MaterialKey(uint32_t key)
259  : _key(key)
260  {}
261  MaterialKey&
262  operator=(uint32_t key)
263  {
264  _key = key;
265  return *this;
266  }
267  bool
268  operator==(MaterialKey const& that)
269  {
270  return (_key == that._key);
271  }
272  operator uint32_t() const
273  {
274  return _key;
275  }
276  uint32_t _key;
277  inline static MaterialKey
279  {
280  return MaterialKey(~(uint32_t)0);
281  }
282 };
283 
284 /* A key used to uniquely identify a line pattern in a given model. */
286 public:
288  : _key(0)
289  {}
290 
291  explicit LinePatternKey(uint32_t key)
292  : _key(key)
293  {}
295  operator=(uint32_t key)
296  {
297  _key = key;
298  return *this;
299  }
300  bool
302  {
303  return (_key == that._key);
304  }
305  operator uint32_t() const
306  {
307  return _key;
308  }
309  uint32_t _key;
310  inline static LinePatternKey
312  {
313  return LinePatternKey(~(uint32_t)0);
314  }
315 };
316 
318 class MatrixKey {
319 public:
321  : _key(0)
322  {}
323  explicit MatrixKey(uint32_t key)
324  : _key(key)
325  {}
326  MatrixKey&
327  operator=(uint32_t key)
328  {
329  _key = key;
330  return *this;
331  }
332  bool
333  operator==(MatrixKey const& that)
334  {
335  return (_key == that._key);
336  }
337  operator uint32_t() const
338  {
339  return _key;
340  }
341  uint32_t _key;
342 };
343 
345 class ViewKey {
346 public:
348  : _key(0)
349  {}
350  explicit ViewKey(uint32_t key)
351  : _key(key)
352  {}
353  ViewKey&
354  operator=(uint32_t key)
355  {
356  _key = key;
357  return *this;
358  }
359  bool
360  operator==(ViewKey const& that)
361  {
362  return (_key == that._key);
363  }
364  operator uint32_t() const
365  {
366  return _key;
367  }
368  uint32_t _key;
369 };
370 
372 class ImageKey {
373 public:
375  : _key(0)
376  {}
377  explicit ImageKey(uint32_t key)
378  : _key(key)
379  {}
380  ImageKey&
381  operator=(uint32_t key)
382  {
383  _key = key;
384  return *this;
385  }
386  bool
387  operator==(ImageKey const& that)
388  {
389  return (_key == that._key);
390  }
391  operator uint32_t() const
392  {
393  return _key;
394  }
395  uint32_t _key;
396 };
397 
399 class DataKey {
400 public:
402  : _key(0)
403  {}
404  explicit DataKey(uint32_t key)
405  : _key(key)
406  {}
407  DataKey&
408  operator=(uint32_t key)
409  {
410  _key = key;
411  return *this;
412  }
413  bool
414  operator==(DataKey const& that)
415  {
416  return (_key == that._key);
417  }
418  operator uint32_t() const
419  {
420  return _key;
421  }
422  uint32_t _key;
423 };
424 
426 class GroupKey {
427 public:
429  : _key(0)
430  {}
431  explicit GroupKey(uint32_t key)
432  : _key(key)
433  {}
434  GroupKey&
435  operator=(uint32_t key)
436  {
437  _key = key;
438  return *this;
439  }
440  bool
441  operator==(GroupKey const& that)
442  {
443  return (_key == that._key);
444  }
445  operator uint32_t() const
446  {
447  return _key;
448  }
449  uint32_t _key;
450 };
451 
454 public:
456  : _key(0)
457  {}
458  explicit MaterialMapKey(uint32_t key)
459  : _key(key)
460  {}
462  operator=(uint32_t key)
463  {
464  _key = key;
465  return *this;
466  }
467  bool
469  {
470  return (_key == that._key);
471  }
472  operator uint32_t() const
473  {
474  return _key;
475  }
476  uint32_t _key;
477 };
478 
479 typedef std::pair<ModelKey, DataKey>
481 typedef std::vector<DataId> DataIds;
482 typedef std::vector<DataKey> DataKeys;
483 
484 typedef std::pair<ModelKey, PolyPolygonKey>
486 typedef std::vector<PolyPolygonId> PolyPolygonIds;
487 typedef std::vector<PolyPolygonKey> PolyPolygonKeys;
488 
489 typedef std::pair<ModelKey, ClipRegionKey>
491 typedef std::vector<ClipRegionId> ClipRegionIds;
492 typedef std::vector<ClipRegionKey> ClipRegionKeys;
493 
494 typedef std::pair<ModelKey, ImageKey>
496 typedef std::vector<ImageId> ImageIds;
497 typedef std::vector<ImageKey> ImageKeys;
498 
499 typedef std::pair<ModelKey, MeshKey>
501 typedef std::vector<MeshId> MeshIds;
502 typedef std::vector<MeshKey> MeshKeys;
503 
504 typedef std::pair<ModelKey, MaterialKey>
506 typedef std::vector<MaterialId> MaterialIds;
507 typedef std::vector<MaterialKey> MaterialKeys;
508 
509 typedef std::pair<ModelKey, LinePatternKey>
511 typedef std::vector<LinePatternId> LinePatternIds;
512 typedef std::vector<LinePatternKey> LinePatternKeys;
513 
514 typedef std::pair<ModelKey, MatrixKey>
516 typedef std::vector<MatrixId> MatrixIds;
517 typedef std::vector<MatrixKey> MatrixKeys;
518 
519 typedef std::vector<InclusionKey> InclusionKeys;
520 typedef std::pair<InclusionKey, InstanceKey>
522 typedef std::vector<InstanceInc> InstanceIncs;
523 typedef std::pair<ModelKey, InstanceKey>
525 typedef std::vector<InstanceId> InstanceIds;
526 typedef std::vector<InstanceKey> InstanceKeys;
527 
528 typedef std::pair<InclusionKey, GroupKey>
530 typedef std::vector<GroupInc> GroupIncs;
531 typedef std::pair<ModelKey, GroupKey>
533 typedef std::vector<GroupId> GroupIds;
534 typedef std::vector<GroupKey> GroupKeys;
535 
536 typedef std::pair<ModelKey, MaterialMapKey>
538 typedef std::vector<MaterialMapId> MaterialMapIds;
539 typedef std::vector<MaterialMapKey> MaterialMapKeys;
540 
543 
545 class Visibility {
546 public:
548  enum Bits : uint32_t {
549  None = 0x00000000,
550  Face = 0x00000001,
551  Line = 0x00000002,
552  Point = 0x00000004,
553  Unspecified = 0xFFFFFFFF,
555  };
556 
558  : _value(Bits::Default)
559  {}
560  explicit Visibility(uint32_t value)
561  : _value(value)
562  {}
563  Visibility&
564  operator=(uint32_t value)
565  {
566  _value = value;
567  return *this;
568  }
569  bool
570  operator==(Visibility const& that)
571  {
572  return (_value == that._value);
573  }
574  operator uint32_t() const
575  {
576  return _value;
577  }
578  uint32_t _value;
579 };
580 
582 class Modifiers {
583 public:
585  enum Bits : uint32_t {
586  None = 0x00000000,
588  DoNotCut = 0x00000001,
590  DoNotCap = 0x00000002,
595  AlwaysDraw = 0x00000004,
601  ScreenOriented = 0x00000008,
606  SuppressCameraScale = 0x00000010,
608  DoNotExplode = 0x00000020,
610  DoNotSelect = 0x00000040,
621  ScreenSpace = 0x00000100,
631  ScreenSpaceStretched = 0x00000200,
635  OutlineClipRegion = 0x00000400,
636 
638  DoNotLight = 0x00000800,
642  DoNotOutlineHighlight = 0x00002000,
644  ExcludeBounding = 0x00004000,
646  DoNotUseVertexColors = 0x00008000,
651  AlwaysStream = 0x00010000,
652 
654  };
655 
657  : _value(Bits::Default)
658  {}
659  explicit Modifiers(uint32_t value)
660  : _value(value)
661  {}
662  Modifiers&
663  operator=(uint32_t value)
664  {
665  _value = value;
666  return *this;
667  }
668  bool
669  operator==(Modifiers const& that)
670  {
671  return (_value == that._value);
672  }
673  operator uint32_t() const
674  {
675  return _value;
676  }
677  uint32_t _value;
678 };
679 
680 class LinePattern {
681 public:
682  void
683  setLength(double const& a_length)
684  {
685  length = a_length;
686  }
687  void
688  setValues(std::vector<uint8_t> const& a_values)
689  {
690  values = a_values;
691  }
692  void
693  setValues(std::vector<uint8_t>&& a_values)
694  {
695  values = std::move(a_values);
696  }
697 
698  double length;
699  std::vector<uint8_t> values;
700 };
701 
703 struct Color {
704  Color() = default;
705  Color(float red, float green, float blue, float alpha)
706  : red(red)
707  , green(green)
708  , blue(blue)
709  , alpha(alpha)
710  {}
711  bool
714  operator==(Color const& that) const
715  {
716  return (red == that.red && green == that.green && blue == that.blue && alpha == that.alpha);
717  }
718  bool
719  operator!=(Color const& that) const
720  {
721  return !(operator==(that));
722  }
723  float red;
724  float green;
725  float blue;
726  float alpha;
727 };
729 
731 struct RGBA32 {
732  RGBA32() = default;
733  RGBA32(uint8_t r, uint8_t g, uint8_t b, uint8_t a)
734  : r(r)
735  , g(g)
736  , b(b)
737  , a(a)
738  {}
739  bool
740  operator==(RGBA32 const& that) const
741  {
742  return (r == that.r && g == that.g && b == that.b && a == that.a);
743  }
744  bool
745  operator!=(RGBA32 const& that) const
746  {
747  return !(operator==(that));
748  }
749  uint8_t r;
750  uint8_t g;
751  uint8_t b;
752  uint8_t a;
753 };
754 
756 struct RGB24 {
757  RGB24() = default;
758  RGB24(uint8_t r, uint8_t g, uint8_t b)
759  : r(r)
760  , g(g)
761  , b(b)
762  {}
763  bool
764  operator==(RGB24 const& that) const
765  {
766  return (r == that.r && g == that.g && b == that.b);
767  }
768  bool
769  operator!=(RGB24 const& that) const
770  {
771  return !(operator==(that));
772  }
773  uint8_t r;
774  uint8_t g;
775  uint8_t b;
776 };
777 
779 struct Gray8 {
780  Gray8() = default;
781  explicit Gray8(uint8_t gray)
782  : gray(gray)
783  {}
784  bool
785  operator==(Gray8 const& that) const
786  {
787  return (gray == that.gray);
788  }
789  bool
790  operator!=(Gray8 const& that) const
791  {
792  return !(operator==(that));
793  }
794  uint8_t gray;
795 };
796 
798 struct GrayAlpha16 {
799  GrayAlpha16() = default;
800  GrayAlpha16(uint8_t gray, uint8_t alpha)
801  : gray(gray)
802  , alpha(alpha)
803  {}
804  bool
805  operator==(GrayAlpha16 const& that) const
806  {
807  return (gray == that.gray && alpha == that.alpha);
808  }
809  bool
810  operator!=(GrayAlpha16 const& that) const
811  {
812  return !(operator==(that));
813  }
814  uint8_t gray;
815  uint8_t alpha;
816 };
817 
829 struct Matrix3d {
830  float m[12];
831  bool
832  operator==(Matrix3d const& that) const
833  {
834  return m == that.m;
835  }
836  bool
837  operator!=(Matrix3d const& that) const
838  {
839  return !(operator==(that));
840  }
841 
842  void
844  {
845  float const identity[] = {
846  1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f,
847  };
848  memcpy(m, identity, sizeof(m));
849  }
850 
851  void
852  SetTranslation(float x, float y, float z)
853  {
854  m[9] = x;
855  m[10] = y;
856  m[11] = z;
857  }
858 
859  void
860  Translate(float x, float y, float z)
861  {
862  m[9] += x;
863  m[10] += y;
864  m[11] += z;
865  }
866 };
867 
879 struct DMatrix3d {
880  double m[12];
881  bool
882  operator==(DMatrix3d const& that) const
883  {
884  return m == that.m;
885  }
886  bool
887  operator!=(DMatrix3d const& that) const
888  {
889  return !(operator==(that));
890  }
891 
892  void
894  {
895  double const identity[] = {
896  1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f,
897  };
898  memcpy(m, identity, sizeof(m));
899  }
900 
901  void
902  SetTranslation(double x, double y, double z)
903  {
904  m[9] = x;
905  m[10] = y;
906  m[11] = z;
907  }
908 
909  void
910  Translate(double x, double y, double z)
911  {
912  m[9] += x;
913  m[10] += y;
914  m[11] += z;
915  }
916 
917  static DMatrix3d
918  fromMatrix3d(Matrix3d const& matrix)
919  {
920  DMatrix3d result;
921 
922  for (int i = 0; i < 12; i++)
923  result.m[i] = static_cast<double>(matrix.m[i]);
924 
925  return result;
926  }
927 };
928 
930 struct Point {
931  Point() = default;
932  Point(float x, float y, float z)
933  : x(x)
934  , y(y)
935  , z(z)
936  {}
937  bool
938  operator==(Point const& that) const
939  {
940  return (x == that.x && y == that.y && z == that.z);
941  }
942  bool
943  operator!=(Point const& that) const
944  {
945  return !(operator==(that));
946  }
947  float x;
948  float y;
949  float z;
950 };
951 
953 struct DPoint {
954  DPoint() = default;
955  DPoint(double x, double y, double z)
956  : x(x)
957  , y(y)
958  , z(z)
959  {}
960  bool
961  operator==(DPoint const& that) const
962  {
963  return (x == that.x && y == that.y && z == that.z);
964  }
965  bool
966  operator!=(DPoint const& that) const
967  {
968  return !(operator==(that));
969  }
970  double x;
971  double y;
972  double z;
973 
974  Point
976  {
977  Point ret;
978  ret.x = static_cast<float>(x);
979  ret.y = static_cast<float>(y);
980  ret.z = static_cast<float>(z);
981  return ret;
982  }
983 
984  static DPoint
985  fromPoint(Point const& point)
986  {
987  DPoint ret;
988  ret.x = static_cast<double>(point.x);
989  ret.y = static_cast<double>(point.y);
990  ret.z = static_cast<double>(point.z);
991  return ret;
992  }
993 };
994 
996 struct Vector {
997  Vector() = default;
998  Vector(float x, float y, float z)
999  : x(x)
1000  , y(y)
1001  , z(z)
1002  {}
1003  bool
1004  operator==(Vector const& that) const
1005  {
1006  return (x == that.x && y == that.y && z == that.z);
1007  }
1008  bool
1009  operator!=(Vector const& that) const
1010  {
1011  return !(operator==(that));
1012  }
1013  float x;
1014  float y;
1015  float z;
1016 };
1017 
1019 struct DVector {
1020  DVector() = default;
1021  DVector(double x, double y, double z)
1022  : x(x)
1023  , y(y)
1024  , z(z)
1025  {}
1026  bool
1027  operator==(DVector const& that) const
1028  {
1029  return (x == that.x && y == that.y && z == that.z);
1030  }
1031  bool
1032  operator!=(DVector const& that) const
1033  {
1034  return !(operator==(that));
1035  }
1036  double x;
1037  double y;
1038  double z;
1039 };
1040 
1043 struct Normal {
1044  Normal() = default;
1045  Normal(float x, float y, float z)
1046  : x(x)
1047  , y(y)
1048  , z(z)
1049  {}
1050  bool
1051  operator==(Normal const& that) const
1052  {
1053  return (x == that.x && y == that.y && z == that.z);
1054  }
1055  bool
1056  operator!=(Normal const& that) const
1057  {
1058  return !(operator==(that));
1059  }
1060  float x;
1061  float y;
1062  float z;
1063 };
1064 
1066 struct UV {
1067  UV() = default;
1068  UV(float u, float v)
1069  : u(u)
1070  , v(v)
1071  {}
1072  bool
1073  operator==(UV const& that) const
1074  {
1075  return (u == that.u && v == that.v);
1076  }
1077  bool
1078  operator!=(UV const& that) const
1079  {
1080  return !(operator==(that));
1081  }
1082  float u;
1083  float v;
1084 };
1085 
1099 class BaseMesh {
1100 public:
1101  ~BaseMesh() = default;
1102 
1105  : points(nullptr)
1106  , normals(nullptr)
1107  , uvs(nullptr)
1108  , rgba32s(nullptr)
1109  , point_count(0)
1110  , normal_count(0)
1111  , uv_count(0)
1112  , rgba32_count(0)
1113  {}
1114 
1115  // No copying
1116  BaseMesh(const BaseMesh& other) = delete;
1117  BaseMesh& operator=(const BaseMesh& other) = delete;
1118 
1119  // Default move is appropriate
1120  BaseMesh(BaseMesh&& other) = default;
1121  BaseMesh& operator=(BaseMesh&& other) = default;
1122 
1123  Point const* points;
1124  Normal const* normals;
1128  UV const*
1133  RGBA32 const*
1137 
1141  uint32_t
1143  uint32_t
1147  uint32_t uv_count;
1150  uint32_t rgba32_count;
1153 };
1157 
1182 public:
1184  : indices()
1185  {}
1186 
1187  MeshElement(MeshElement const&) = default;
1188 
1190  : indices(std::move(that.indices))
1191  {}
1192 
1193  MeshElement& operator=(MeshElement const&) = default;
1194 
1195  MeshElement&
1197  {
1198  indices = std::move(that.indices);
1199  return *this;
1200  }
1201 
1202  bool
1203  operator==(MeshElement const& that) const
1204  {
1205  return (indices == that.indices);
1206  }
1207  bool
1208  operator!=(MeshElement const& that) const
1209  {
1210  return !(operator==(that));
1211  }
1212 
1222  std::vector<uint32_t> indices;
1223 };
1224 
1237 class Mesh: public BaseMesh {
1238 public:
1239  enum Bits : uint32_t {
1240 
1241  None = 0x00000000,
1242 
1244  ClockwiseWinding = 0x00000001,
1246 
1247  TwoSided = 0x00000004,
1248 
1249  FaceNormals = 0x00000010,
1250  FaceUVs = 0x00000020,
1251  FaceRGBA32s = 0x00000040,
1252 
1253  LineNormals = 0x00000100,
1254  LineUVs = 0x00000200,
1255  LineRGBA32s = 0x00000400,
1256 
1257  PointNormals = 0x00001000,
1258  PointUVs = 0x00002000,
1259  PointRGBA32s = 0x00004000,
1260 
1261  Manifold = 0x00010000,
1262 
1264  RandomizedPoints = 0x00020000,
1265 
1269  | PointRGBA32s),
1270  };
1271 
1272  ~Mesh() = default;
1273  Mesh() = default;
1274 
1275  // No copying
1276  Mesh(const Mesh& other) = delete;
1277  Mesh& operator=(const Mesh& other) = delete;
1278 
1279  // Default move is appropriate
1280  Mesh(Mesh&& other) = default;
1281  Mesh& operator=(Mesh&& other) = default;
1282 
1283  bool
1284  operator==(Mesh const& that) const
1285  {
1286  return (
1288  && point_elements == that.point_elements
1298  && flags == that.flags);
1299  }
1300  bool
1301  operator!=(Mesh const& that) const
1302  {
1303  return !(operator==(that));
1304  }
1305 
1306  std::vector<MeshElement> face_elements;
1307  std::vector<MeshElement> polyline_elements;
1308  std::vector<MeshElement> point_elements;
1309 
1316  std::vector<uint8_t>
1318  std::vector<uint8_t>
1320  std::vector<uint8_t>
1322 
1332 
1335 };
1336 
1350 class Camera {
1351  uint32_t pad;
1352 
1353 public:
1355  enum Projection : uint32_t {
1356  Invalid = 0,
1357  Perspective,
1359  Orthographic,
1361  Stretched,
1363  };
1366 
1368  {
1369  memset(this, 0, sizeof(*this));
1370  }
1371 
1374  DPoint const& position,
1375  DPoint const& target,
1376  DVector const& up_vector,
1377  double field_width,
1378  double field_height)
1379  : pad(0)
1381  , position(position)
1382  , target(target)
1383  , up_vector(up_vector)
1386  {
1387  (void)pad;
1388  }
1389 
1390  bool
1391  operator==(Camera const& that) const
1392  {
1393  return (
1394  projection == that.projection && position == that.position && target == that.target
1395  && up_vector == that.up_vector && field_width == that.field_width
1396  && field_height == that.field_height);
1397  }
1398  bool
1399  operator!=(Camera const& that) const
1400  {
1401  return !(operator==(that));
1402  }
1403 
1408  double field_width;
1409  double field_height;
1410 };
1411 
1413 enum class ImageFormat : uint32_t {
1414  PNG,
1415  JPEG,
1416  BMP,
1417 };
1418 
1420 class Texture {
1421 public:
1422  enum Tiling : uint32_t {
1424  0,
1426  Trim
1428  };
1431 
1432  enum Interpolation : uint32_t {
1434  0,
1436  };
1438 
1439  enum MipMapping : uint32_t {
1441  MipMappingOff,
1444  };
1445 
1446  enum Parameterization : uint32_t {
1447  UV = 0,
1448  };
1450 
1451  enum Modifiers : uint32_t {
1452  None = 0,
1454  };
1456 
1459  static uint32_t
1461  Tiling tiling,
1462  Interpolation interpolation,
1463  MipMapping mipmapping,
1464  Parameterization parameterization,
1465  Modifiers modifiers)
1466  {
1467  uint32_t flags = tiling;
1468  flags |= (interpolation << 4);
1469  flags |= (mipmapping << 8);
1470  flags |= (parameterization << 12);
1471  flags |= (modifiers << 16);
1472  return flags;
1473  }
1474 
1476  : image_key()
1477  , matrix()
1478  , flags(0)
1479  {}
1480 
1482  : image_key(image_key)
1483  , matrix(matrix)
1484  , flags(flags)
1485  {}
1486  bool
1487  operator==(Texture const& that) const
1488  {
1489  return (image_key == that.image_key && matrix == that.matrix && flags == that.flags);
1490  }
1491  bool
1492  operator!=(Texture const& that) const
1493  {
1494  return !(operator==(that));
1495  }
1496 
1497  ImageKey
1500  uint32_t flags;
1501 };
1503 
1506 public:
1508  : environment()
1509  , mirror(-1)
1510  , specular(-1)
1511  , gloss(-1)
1512  {}
1514  : mirror(mirror)
1515  , specular(specular)
1516  , gloss(gloss)
1517  {}
1518 
1519  bool
1520  operator==(MaterialProperties const& that) const
1521  {
1522  return (
1523  environment == that.environment && mirror == that.mirror && specular == that.specular
1524  && gloss == that.gloss);
1525  }
1526  bool
1527  operator!=(MaterialProperties const& that) const
1528  {
1529  return !(operator==(that));
1530  }
1531 
1532  bool
1533  empty() const
1534  {
1535  return environment.empty() && mirror == -1 && specular == -1 && gloss == -1;
1536  }
1537 
1539 
1542  float mirror;
1543  float specular;
1544  float gloss;
1545 };
1546 
1548 class Material {
1549 public:
1551  : diffuse_textures()
1552  , diffuse_color(Color(1, 1, 1, 1))
1553  , properties()
1554  , line_pattern_key(LinePatternKey::Unspecified())
1555  {}
1556 
1557  explicit Material(Color const& diffuse_color)
1558  : diffuse_textures()
1560  , properties()
1561  , line_pattern_key(LinePatternKey::Unspecified())
1562  {}
1563 
1564  bool
1565  operator==(Material const& that) const
1566  {
1567  return (
1569  && properties == that.properties && line_pattern_key == that.line_pattern_key);
1570  }
1571  bool
1572  operator!=(Material const& that) const
1573  {
1574  return !(operator==(that));
1575  }
1576 
1577  std::vector<Texture> diffuse_textures;
1579 
1581 
1583 };
1584 
1587 public:
1588  enum ChannelMapping : uint32_t {
1589  Red = 0,
1593  };
1594 
1595  enum AlphaMode : uint32_t { Blend, Mask, Opaque };
1596 
1598  : base_color_map()
1599  , normal_map()
1600  , emissive_map()
1601  , metalness_map()
1602  , roughness_map()
1603  , occlusion_map()
1607  , base_color_factor(Color(1, 1, 1, 1))
1608  , emissive_factor(Color(0, 0, 0, 1))
1609  , normal_factor(1)
1610  , metalness_factor(1)
1611  , roughness_factor(1)
1612  , occlusion_factor(1)
1613  , alpha_cutoff(1)
1615  {}
1616 
1617  bool
1618  operator==(PBRMaterial const& that) const
1619  {
1620  return (
1632  && alpha_mode == that.alpha_mode);
1633  }
1634  bool
1635  operator!=(PBRMaterial const& that) const
1636  {
1637  return !(operator==(that));
1638  }
1639 
1642  Texture emissive_map; // !< Stored in sRGB color space.
1646 
1650 
1659 };
1660 
1663 public:
1665  : index(0)
1666  , length(0)
1667  , material(0)
1668  {}
1669 
1671  : index(index)
1672  , length(length)
1673  , material(material)
1674  {}
1675 
1676  bool
1677  operator==(MaterialMapElement const& that) const
1678  {
1679  return (index == that.index && length == that.length && material == that.material);
1680  }
1681  bool
1682  operator!=(MaterialMapElement const& that) const
1683  {
1684  return !(operator==(that));
1685  }
1686 
1687  uint32_t index;
1688  uint32_t length;
1690 };
1691 
1692 typedef std::vector<MaterialMapElement>
1694 
1697 public:
1698  enum Operation : uint32_t {
1700  Remove,
1702  };
1704 
1705  enum Space : uint32_t {
1708  };
1709 
1711  : polypolygons()
1712  , matrix(MatrixKey())
1713  , operation(Keep)
1714  , space(World)
1715  {}
1716 
1718  : polypolygons()
1719  , matrix(matrix)
1720  , operation(operation)
1721  , space(space)
1722  {}
1723 
1724  bool
1725  operator==(ClipSubRegion const& that) const
1726  {
1727  return (
1728  polypolygons == that.polypolygons && matrix == that.matrix
1729  && operation == that.operation && space == that.space);
1730  }
1731  bool
1732  operator!=(ClipSubRegion const& that) const
1733  {
1734  return !(operator==(that));
1735  }
1736 
1738  MatrixKey matrix;
1740  Operation
1743  Space space;
1745 };
1748 
1749 typedef std::vector<ClipSubRegion> ClipSubRegions;
1750 
1753 public:
1754  enum Space : uint32_t {
1758  };
1759 
1761  : vector(Vector(0.0f, 0.0f, 0.0f))
1762  , tolerance(0.0f)
1763  , space(None)
1764  {}
1765 
1767  : vector(vector)
1768  , tolerance(tolerance)
1769  , space(space)
1770  {}
1771 
1773  float tolerance;
1775 };
1776 
1783 public:
1785  MemoryDeviceFile();
1787 
1789  MemoryDeviceFile(MemoryDeviceFile&& source) = default;
1790 
1792  MemoryDeviceFile& operator=(MemoryDeviceFile&& source) = default;
1793 
1798  bool
1799  IsValid() const
1800  {
1801  return _impl != nullptr;
1802  }
1803 
1806  size_t Size() const;
1807 
1810  size_t Read(uint8_t* buffer, size_t num_bytes);
1811 
1813  void SeekToBeginning();
1814 
1815 private:
1816  MemoryDeviceFile(std::unique_ptr<TC::IO::AbstractFile>);
1817 
1818  std::unique_ptr<TC::IO::AbstractFile> _impl;
1819  friend class MemoryDevice;
1820 };
1821 
1827 public:
1832  bool Exists(char const* utf8_path);
1833 
1838  bool IsDirectory(char const* utf8_path);
1839 
1844  bool CreateDirectories(char const* utf8_directory_path);
1845 
1851  bool RemoveAll(char const* utf8_path);
1852 
1861  MemoryDeviceFile OpenFileForReading(char const* utf8_path);
1862 
1870  char const* ToAbsolutePath(char const* utf8_path);
1871 
1872 private:
1873  MemoryDevice() = default;
1874  MemoryDevice(MemoryDevice const&) = delete;
1875  MemoryDevice& operator=(const MemoryDevice&) = delete;
1876  MemoryDevice(MemoryDevice&&) = delete;
1877  MemoryDevice& operator=(MemoryDevice&&) = delete;
1878 
1879  MemoryDevice(std::unique_ptr<TC::IO::MemoryFilesystem> impl);
1880  std::unique_ptr<TC::IO::MemoryFilesystem> _impl;
1881  friend class Database;
1882  friend class ::TC::IO::MemoryFilesystem;
1883 };
1884 
1904 class Model {
1905 public:
1906  ~Model();
1907  Model(Model&& that);
1908 
1914  MeshKey Insert(Mesh const& mesh);
1915 
1922  MeshKey Insert(MeshKeys const& meshes);
1923 
1929  MaterialKey Insert(Color const& color);
1930 
1936  MaterialKey Insert(Material const& material);
1937 
1939 
1944  MaterialKey Insert(PBRMaterial const& pbr_material);
1946 
1952  LinePatternKey Insert(LinePattern const& line_pattern);
1953 
1959  MatrixKey Insert(Matrix3d const& matrix);
1960 
1966  MatrixKey Insert(DMatrix3d const& matrix);
1967 
1975  ImageKey Insert(uint32_t byte_count, uint8_t const* byte_data, ImageFormat format);
1976 
1984  ImageKey Insert(uint32_t width, uint32_t height, RGBA32 const* data);
1985 
1993  ImageKey Insert(uint32_t width, uint32_t height, RGB24 const* data);
1994 
2002  ImageKey Insert(uint32_t width, uint32_t height, Gray8 const* data);
2003 
2011  ImageKey Insert(uint32_t width, uint32_t height, GrayAlpha16 const* data);
2012 
2021  DataKey Insert(uint32_t byte_count, uint8_t const* byte_data, uint32_t priority = 0);
2022 
2029  GroupKey Insert(InstanceIncs const& instance_incs, GroupIncs const& group_incs);
2030 
2037  MaterialMapKey Insert(MaterialKeys const& material_keys); // fully enumerated material map
2038 
2045  MaterialMapKey Insert(MaterialMapElements const& material_map_elements);
2046 
2054  PolyPolygonKey Insert(uint32_t loop_count, uint32_t const* loop_counts, Point const* points);
2055 
2061  ClipRegionKey Insert(ClipSubRegions const& clip_subregions);
2062 
2070  MaterialKey FindOrInsert(Color const& color);
2071 
2079  MaterialKey FindOrInsert(Material const& material);
2080 
2082 
2089  MaterialKey FindOrInsert(PBRMaterial const& pbr_material);
2091 
2099  MatrixKey FindOrInsert(Matrix3d const& matrix);
2100 
2108  MatrixKey FindOrInsert(DMatrix3d const& matrix);
2109 
2118  MaterialMapKey FindOrInsert(MaterialKeys const& material_keys);
2119 
2128  MaterialMapKey FindOrInsert(MaterialMapElements const& material_map_elements);
2129 
2140  FindOrInsert(uint32_t loop_count, uint32_t const* loop_counts, Point const* points);
2141 
2149  ClipRegionKey FindOrInsert(ClipSubRegions const& clip_subregions);
2150 
2156  void Set(MeshKey key, Mesh const& mesh);
2157 
2164  void Set(MeshKey key, MeshKeys const& meshes);
2165 
2171  void Set(MaterialKey key, Color const& color);
2172 
2178  void Set(MaterialKey key, Material const& material);
2179 
2181 
2186  void Set(MaterialKey key, PBRMaterial const& pbr_material);
2188 
2194  void Set(MatrixKey key, Matrix3d const& matrix);
2195 
2201  void Set(MatrixKey key, DMatrix3d const& matrix);
2202 
2210  void Set(ImageKey key, uint32_t byte_count, uint8_t const* byte_data, ImageFormat format);
2211 
2218  void Set(ImageKey key, uint32_t width, uint32_t height, RGBA32 const* data);
2219 
2227  void Set(ImageKey key, uint32_t width, uint32_t height, RGB24 const* data);
2228 
2236  void Set(ImageKey key, uint32_t width, uint32_t height, Gray8 const* data);
2237 
2245  void Set(ImageKey key, uint32_t width, uint32_t height, GrayAlpha16 const* data);
2246 
2253  void Set(DataKey key, uint32_t byte_count, uint8_t const* byte_data);
2254 
2263  void Set(DataKey key, uint32_t byte_count, uint8_t const* byte_data, uint32_t priority);
2264 
2271  void Set(GroupKey key, InstanceIncs const& instance_incs, GroupIncs const& group_incs);
2272 
2279  void Set(MaterialMapKey key, MaterialKeys const& material_keys);
2280 
2287  void Set(MaterialMapKey key, MaterialMapElements const& material_map_elements);
2288 
2296  void
2297  Set(PolyPolygonKey key, uint32_t loop_count, uint32_t const* loop_counts, Point const* points);
2298 
2304  void Set(ClipRegionKey key, ClipSubRegions const& clip_subregions);
2305 
2331  MeshKey mesh,
2332  MatrixKey matrix = MatrixKey(),
2333  MaterialKey face_material = MaterialKey::Unspecified(),
2334  MaterialKey line_material = MaterialKey::Unspecified(),
2335  MaterialKey point_material = MaterialKey::Unspecified(),
2336  MaterialMapKey face_material_map = MaterialMapKey(),
2337  MaterialMapKey line_material_map = MaterialMapKey(),
2338  MaterialMapKey point_material_map = MaterialMapKey(),
2339  Visibility visibility = Visibility(),
2340  Modifiers modifiers = Modifiers(),
2341  ClipRegionKey clip_region = ClipRegionKey(),
2342  VectorCulling const& vector_culling = VectorCulling());
2343 
2352  InclusionKey Include(Model const& model, MatrixKey matrix = MatrixKey());
2353 
2359  void Set(InstanceKey key, MeshKey mesh);
2360 
2366  void Set(InstanceKey key, MatrixKey matrix);
2367 
2373  void Set(InstanceKey key, VectorCulling const& vector_culling);
2374 
2385  void
2386  Set(InstanceKey key,
2387  MaterialKey face_material,
2388  MaterialKey line_material,
2389  MaterialKey point_material);
2390 
2401  void
2402  Set(InstanceKey key,
2403  MaterialMapKey face_material_map,
2404  MaterialMapKey line_material_map,
2405  MaterialMapKey point_material_map);
2406 
2412  void Set(InstanceKey key, Visibility visibility);
2413 
2419  void Set(InstanceKey key, Modifiers modifiers);
2420 
2426  void Set(InstanceKey key, ClipRegionKey clip_region);
2427 
2438  void
2439  Set(InstanceInc const& inc,
2440  MaterialKey face_material,
2441  MaterialKey line_material,
2442  MaterialKey point_material);
2443 
2454  void
2455  Set(InstanceInc const& inc,
2456  MaterialMapKey face_material_map,
2457  MaterialMapKey line_material_map,
2458  MaterialMapKey point_material_map);
2459 
2465  void Set(InstanceInc const& inc, Visibility visibility);
2466 
2472  void Set(InstanceInc const& inc, Modifiers modifiers_to_add);
2473 
2479  void Set(InstanceInc const& inc, ClipRegionKey clip_region);
2480 
2485  void Delete(InclusionKey inclusion_key);
2486 
2491  void Delete(InstanceKey instance_key);
2492 
2497  void Delete(ViewKey view_key);
2498 
2503  ModelKey GetKey() const;
2504 
2511  const char* GetName() const;
2512 
2518  const char* GetPath() const;
2519 
2524  void GetInstanceIncs(InstanceIncs& instance_incs) const;
2525 
2530  void GetMeshIds(MeshIds& mesh_ids) const;
2531 
2537  void GetMaterialIds(MaterialIds& material_ids) const;
2538 
2544  void GetMatrixIds(MatrixIds& matrix_ids) const;
2545 
2551  void GetInstanceIds(InstanceIds& instance_ids) const;
2552 
2558  void GetImageIds(ImageIds& image_ids) const;
2559 
2564  void GetDataIds(DataIds& data_ids) const;
2565 
2571  void GetGroupIds(GroupIds& group_ids) const;
2572 
2578  void GetMaterialMapIds(MaterialMapIds& material_map_ids) const;
2579 
2585  void GetPolyPolygonIds(PolyPolygonIds& polypolygon_ids) const;
2586 
2592  void GetClipRegionIds(ClipRegionIds& clip_region_ids) const;
2593 
2598  void GetMeshKeys(MeshKeys& mesh_keys) const;
2599 
2604  void GetMaterialKeys(MaterialKeys& material_keys) const;
2605 
2610  void GetMatrixKeys(MatrixKeys& matrix_keys) const;
2611 
2616  void GetInstanceKeys(InstanceKeys& instance_keys) const;
2617 
2622  void GetImageKeys(ImageKeys& image_keys) const;
2623 
2628  void GetDataKeys(DataKeys& data_keys) const;
2629 
2634  void GetGroupKeys(GroupKeys& group_keys) const;
2635 
2640  void GetMaterialMapKeys(MaterialMapKeys& material_map_keys) const;
2641 
2646  void GetPolyPolygonKeys(PolyPolygonKeys& polypolygon_keys) const;
2647 
2652  void GetClipRegionKeys(ClipRegionKeys& clip_region_keys) const;
2653 
2659  void Get(DataKey key, std::vector<uint8_t>& byte_data) const;
2660 
2666  void Set(Camera const& camera, ViewKey view = ViewKey());
2667 
2674  bool Get(Camera& camera, ViewKey view = ViewKey());
2675 
2682  void Set(MaterialProperties const& material_properties, ViewKey view = ViewKey());
2683 
2691  bool Get(MaterialProperties& material_properties, ViewKey view = ViewKey());
2692 
2697  void Set(ViewKey view);
2698 
2705  bool Get(ViewKey& view);
2706 
2711  ViewKey View();
2712 
2718  void PrepareStream(CompressionStrategy compression_strategy = CompressionStrategy::Default);
2719 
2724  void ComputeBounding(Point& min, Point& max);
2725 
2731  double GetRootMeasurementUnit();
2732 
2740  const char* GenerateSCSFile(const char* utf8_scs_file_path = nullptr);
2741 
2757  const char* GenerateSCZFile(
2758  const char* utf8_scz_file_path = nullptr,
2759  bool include_derived = true,
2760  bool include_editable = true,
2761  bool create_bundled = false);
2762 
2763 private:
2764  friend class TC::Store::CacheImpl;
2765  friend class TC::Store::ModelImpl;
2766 
2767  Model();
2768  Model(Model const& that) = delete;
2769  Model operator=(Model const& that) = delete;
2770 
2771  void Init(void* opaque_abstract_device);
2772 
2773  std::shared_ptr<TC::Store::ModelImpl> _impl;
2774 };
2775 
2785 class Cache {
2786 
2787 public:
2788  ~Cache();
2789  Cache(Cache&& that);
2790 
2797  Model Open(const char* utf8_model_path, bool read_only = false);
2798 
2804  void Close(Model& model);
2805 
2812  void SetSearchPath(const char* utf8_search_path);
2813 
2820  void AppendSearchPath(const char* utf8_search_path);
2821 
2830  void SetWorkspacePath(const char* utf8_directory_path);
2831 
2839  const char* Exists(const char* utf8_model_path);
2840 
2847  const char* const* GetModelPaths(size_t& out_count);
2848 
2853  void RemoveTemporaryFiles();
2854 
2855 private:
2856  friend class Database;
2857 
2858  Cache() = delete;
2859  Cache(Cache const& that) = delete;
2860  Cache operator=(Cache const& that) = delete;
2861 
2862  Cache(Logger const& logger, void* opaque_abstract_device);
2863 
2864  std::unique_ptr<TC::Store::CacheImpl> _impl;
2865 };
2866 
2871 class Database {
2872 public:
2877  static void SetLicense(const char* encoded_license);
2878 
2884  static Cache Open(Logger const& logger, MemoryDevice* memory_device = nullptr);
2885 
2891  static void Close(Cache& cache);
2892 
2897  static uint32_t Version();
2898 
2907  static bool DecompressSCZ(
2908  char const* utf8_path_to_scz_file,
2909  char const* utf8_output_model_path,
2910  Logger const& logger,
2911  MemoryDevice* memory_device = nullptr);
2912 
2923  static char const* QuerySCZ(
2924  char const* utf8_path_to_scz_file,
2925  Logger const& logger,
2926  MemoryDevice* memory_device = nullptr);
2927 
2937  static bool CreateMemoryDevice(char const* memory_device_name);
2938 
2944  static bool DestroyMemoryDevice(char const* memory_device_name);
2945 
2958  static MemoryDevice* GetMemoryDevice(char const* memory_device_name);
2959 
2969  static size_t GetMemoryDeviceNames(char const** memory_device_name_buffer, size_t capacity);
2970 
2971 private:
2972  Database() = delete;
2973 };
2974 
2975 }} // namespace SC::Store
static size_t GetMemoryDeviceNames(char const **memory_device_name_buffer, size_t capacity)
Definition: sc_store.h:1261
std::vector< MaterialMapElement > MaterialMapElements
A std::vector of MaterialMapElement.
Definition: sc_store.h:1693
Definition: sc_store.h:731
The PBRMaterial class is used to define a MaterialKey.
Definition: sc_store.h:1586
DVector(double x, double y, double z)
Definition: sc_store.h:1021
Set if normals are present in the BaseMesh.
Definition: sc_store.h:1257
DVector up_vector
Defines the vertical up vector of the camera.
Definition: sc_store.h:1407
bool operator==(ImageKey const &that)
Definition: sc_store.h:387
Definition: sc_store.h:1019
InclusionKey & operator=(uint32_t key)
Definition: sc_store.h:235
Set if UVs are present in the BaseMesh.
Definition: sc_store.h:1254
double z
Definition: sc_store.h:972
std::pair< ModelKey, GroupKey > GroupId
This is an ID that is completely unique throughout an entire cache.
Definition: sc_store.h:532
float roughness_factor
Definition: sc_store.h:1655
bool operator==(MeshKey const &that)
Definition: sc_store.h:129
Bits flags
Bits that specify this mesh&#39;s details.
Definition: sc_store.h:1334
void ComputeBounding(Point &min, Point &max)
size_t Read(uint8_t *buffer, size_t num_bytes)
Definition: sc_store.h:1440
The VectorCulling class is used to define vector culling on an instance.
Definition: sc_store.h:1752
bool operator!=(Mesh const &that) const
Definition: sc_store.h:1301
double y
Definition: sc_store.h:971
The Material class is used to define a MaterialKey.
Definition: sc_store.h:1548
static bool DecompressSCZ(char const *utf8_path_to_scz_file, char const *utf8_output_model_path, Logger const &logger, MemoryDevice *memory_device=nullptr)
bool operator==(MaterialKey const &that)
Definition: sc_store.h:268
Enable interpolation of texel colors (also known as linear filtering).
Definition: sc_store.h:1433
void GetMeshKeys(MeshKeys &mesh_keys) const
ImageKey(uint32_t key)
Definition: sc_store.h:377
void RemoveTemporaryFiles()
bool operator!=(MaterialProperties const &that) const
Definition: sc_store.h:1527
Definition: sc_store.h:1427
bool operator==(Color const &that) const
Definition: sc_store.h:714
uint32_t _key
Definition: sc_store.h:276
Definition: sc_store.h:554
MaterialKey mesh_face_material
Optional material that applies to the Mesh faces.
Definition: sc_store.h:1323
MaterialMapElement()
Definition: sc_store.h:1664
Bits
Definition: sc_store.h:1239
void setValues(std::vector< uint8_t > const &a_values)
Definition: sc_store.h:688
Definition: sc_store.h:1904
float z
Definition: sc_store.h:1015
float gloss
Clamp value with 0 minimum and 1 maximum; value -1 is unset.
Definition: sc_store.h:1544
bool operator==(Gray8 const &that) const
Definition: sc_store.h:785
Texture metalness_map
Definition: sc_store.h:1643
MaterialKey material
Definition: sc_store.h:1689
Tiling
Definition: sc_store.h:1422
static bool CreateMemoryDevice(char const *memory_device_name)
uint32_t point_count
The number of Point elements in the points array.
Definition: sc_store.h:1142
uint32_t _key
Definition: sc_store.h:191
const char *const * GetModelPaths(size_t &out_count)
bool operator==(Vector const &that) const
Definition: sc_store.h:1004
const char * Exists(const char *utf8_model_path)
The vector is specified in object coordinates.
Definition: sc_store.h:1757
uint32_t index
Definition: sc_store.h:1687
void Delete(InclusionKey inclusion_key)
The clip region is specified in world coordinates.
Definition: sc_store.h:1706
bool operator!=(Gray8 const &that) const
Definition: sc_store.h:790
Definition: sc_store.h:653
const char * GetPath() const
uint8_t b
Definition: sc_store.h:751
MaterialMapElement(uint32_t index, uint32_t length, MaterialKey material)
Definition: sc_store.h:1670
const char * GenerateSCZFile(const char *utf8_scz_file_path=nullptr, bool include_derived=true, bool include_editable=true, bool create_bundled=false)
bool operator==(MeshElement const &that) const
Definition: sc_store.h:1203
Definition: sc_store.h:2871
std::pair< ModelKey, PolyPolygonKey > PolyPolygonId
This is an ID that is completely unique throughout an entire cache.
Definition: sc_store.h:485
std::pair< ModelKey, DataKey > DataId
This is an ID that is completely unique throughout an entire cache.
Definition: sc_store.h:480
uint64_t operator()(const T &key) const
Definition: sc_store.h:68
std::vector< uint8_t > point_elements_bits
Optional bits for filtering selections on the mesh element.
Definition: sc_store.h:1321
Set if RGBA32s are present in the BaseMesh.
Definition: sc_store.h:1251
const char * GetName() const
float y
Definition: sc_store.h:948
Definition: sc_store.h:1782
DPoint position
The location of the camera.
Definition: sc_store.h:1405
static char const * QuerySCZ(char const *utf8_path_to_scz_file, Logger const &logger, MemoryDevice *memory_device=nullptr)
bool operator==(Mesh const &that) const
Definition: sc_store.h:1284
Definition: sc_store.h:586
Space space
Definition: sc_store.h:1774
double x
Definition: sc_store.h:1036
bool operator==(Visibility const &that)
Definition: sc_store.h:570
MeshKey(uint32_t key)
Definition: sc_store.h:119
std::vector< ClipRegionId > ClipRegionIds
A std::vector of ClipRegionId.
Definition: sc_store.h:491
std::vector< MeshElement > face_elements
These define the mesh&#39;s faces.
Definition: sc_store.h:1306
static DMatrix3d fromMatrix3d(Matrix3d const &matrix)
Definition: sc_store.h:918
void AppendSearchPath(const char *utf8_search_path)
static MaterialKey Unspecified()
Definition: sc_store.h:278
uint8_t r
Definition: sc_store.h:749
Definition: sc_store.h:1591
bool operator==(DMatrix3d const &that) const
Definition: sc_store.h:882
std::pair< ModelKey, ClipRegionKey > ClipRegionId
This is an ID that is completely unique throughout an entire cache.
Definition: sc_store.h:490
Definition: sc_store.h:453
Definition: sc_store.h:1592
void GetPolyPolygonIds(PolyPolygonIds &polypolygon_ids) const
Texture()
Definition: sc_store.h:1475
bool operator==(DataKey const &that)
Definition: sc_store.h:414
void GetMaterialIds(MaterialIds &material_ids) const
Projection
Definition: sc_store.h:1355
std::pair< ModelKey, MatrixKey > MatrixId
This is an ID that is completely unique throughout an entire cache.
Definition: sc_store.h:515
float z
Definition: sc_store.h:1062
std::vector< InstanceInc > InstanceIncs
A std::vector of InstanceInc.
Definition: sc_store.h:522
float x
Definition: sc_store.h:947
void GetInstanceIds(InstanceIds &instance_ids) const
bool operator==(InstanceKey const &that)
Definition: sc_store.h:156
std::vector< GroupInc > GroupIncs
A std::vector of GroupInc.
Definition: sc_store.h:530
uint32_t normal_count
The number of Normal elements in the normals array.
Definition: sc_store.h:1146
uint32_t uv_count
The number of UV elements in the uvs array.
Definition: sc_store.h:1149
GrayAlpha16(uint8_t gray, uint8_t alpha)
Definition: sc_store.h:800
Operation
Definition: sc_store.h:1698
bool operator==(ClipSubRegion const &that) const
Definition: sc_store.h:1725
uint32_t _value
Definition: sc_store.h:677
std::pair< ModelKey, LinePatternKey > LinePatternId
This is an ID that is completely unique throughout an entire cache.
Definition: sc_store.h:510
Model Open(const char *utf8_model_path, bool read_only=false)
Definition: sc_store.h:1181
Definition: sc_store.h:601
BaseMesh & operator=(const BaseMesh &other)=delete
void setValues(std::vector< uint8_t > &&a_values)
Definition: sc_store.h:693
UV(float u, float v)
Definition: sc_store.h:1068
uint32_t rgba32_count
The number of RGBA32 elements in the rgba32s array.
Definition: sc_store.h:1152
bool operator!=(DMatrix3d const &that) const
Definition: sc_store.h:887
MeshElement(MeshElement &&that)
Definition: sc_store.h:1189
std::vector< MaterialKey > MaterialKeys
A std::vector of MaterialKey.
Definition: sc_store.h:507
std::vector< MaterialMapKey > MaterialMapKeys
A std::vector of MaterialMapKey.
Definition: sc_store.h:539
void GetImageKeys(ImageKeys &image_keys) const
Definition: sc_store.h:1360
const char * GenerateSCSFile(const char *utf8_scs_file_path=nullptr)
Repeat the texture image when UV coordinates go outside the [0.0, 1.0] range.
Definition: sc_store.h:1423
std::vector< ImageId > ImageIds
A std::vector of ImageId.
Definition: sc_store.h:496
bool operator!=(Matrix3d const &that) const
Definition: sc_store.h:837
MaterialMapKey(uint32_t key)
Definition: sc_store.h:458
bool IsValid() const
Definition: sc_store.h:1799
std::pair< ModelKey, ImageKey > ImageId
This is an ID that is completely unique throughout an entire cache.
Definition: sc_store.h:495
MaterialKey mesh_point_material
Optional material that applies to the Mesh points.
Definition: sc_store.h:1325
float z
Definition: sc_store.h:949
Definition: sc_store.h:635
Definition: sc_store.h:1245
Definition: sc_store.h:1267
uint32_t flags
Definition: sc_store.h:1500
MaterialKey & operator=(uint32_t key)
Definition: sc_store.h:262
bool operator!=(Point const &that) const
Definition: sc_store.h:943
The clip region is specified in window coordinates. -1 to 1.
Definition: sc_store.h:1707
The MaterialProperties class is used to define a Material or specify the defaults for a View...
Definition: sc_store.h:1505
uint8_t g
Definition: sc_store.h:774
UV()=default
Definition: sc_store.h:1590
bool operator==(ViewKey const &that)
Definition: sc_store.h:360
Modifiers(uint32_t value)
Definition: sc_store.h:659
uint32_t _value
Definition: sc_store.h:578
Definition: sc_store.h:953
RGBA32 const * rgba32s
An array of RGBA32 color values.
Definition: sc_store.h:1136
Definition: sc_store.h:1699
Texture normal_map
Definition: sc_store.h:1641
double m[12]
Definition: sc_store.h:880
static Cache Open(Logger const &logger, MemoryDevice *memory_device=nullptr)
double GetRootMeasurementUnit()
std::vector< MeshElement > polyline_elements
These define the mesh&#39;s lines.
Definition: sc_store.h:1307
LinePatternKey line_pattern_key
Definition: sc_store.h:1582
ImageKey()
Definition: sc_store.h:374
InstanceKey Instance(MeshKey mesh, MatrixKey matrix=MatrixKey(), MaterialKey face_material=MaterialKey::Unspecified(), MaterialKey line_material=MaterialKey::Unspecified(), MaterialKey point_material=MaterialKey::Unspecified(), MaterialMapKey face_material_map=MaterialMapKey(), MaterialMapKey line_material_map=MaterialMapKey(), MaterialMapKey point_material_map=MaterialMapKey(), Visibility visibility=Visibility(), Modifiers modifiers=Modifiers(), ClipRegionKey clip_region=ClipRegionKey(), VectorCulling const &vector_culling=VectorCulling())
Definition: sc_store.h:798
DataKey()
Definition: sc_store.h:401
AlphaMode alpha_mode
Definition: sc_store.h:1658
bool operator==(MaterialMapElement const &that) const
Definition: sc_store.h:1677
ChannelMapping metalness_map_channel
Definition: sc_store.h:1647
ClipRegionKey & operator=(uint32_t key)
Definition: sc_store.h:208
Color emissive_factor
Stored in linear color space.
Definition: sc_store.h:1652
GroupKey()
Definition: sc_store.h:428
Definition: sc_store.h:372
InclusionKey()
Definition: sc_store.h:228
Color diffuse_color
Definition: sc_store.h:1578
Material()
Definition: sc_store.h:1550
Used internally for InstanceInc properties; do not use.
Definition: sc_store.h:553
Definition: sc_store.h:588
bool operator!=(ClipSubRegion const &that) const
Definition: sc_store.h:1732
ChannelMapping
Definition: sc_store.h:1588
Definition: sc_store.h:638
ImageKeys environment
Definition: sc_store.h:1538
void GetClipRegionKeys(ClipRegionKeys &clip_region_keys) const
Definition: sc_store.h:651
ImageFormat
The ImageFormat enum class is used to define an ImageKey from the byte data of an image file...
Definition: sc_store.h:1413
float normal_factor
Definition: sc_store.h:1653
Point const * points
An array of points.
Definition: sc_store.h:1123
ModelKey GetKey() const
Definition: sc_store.h:610
void GetGroupKeys(GroupKeys &group_keys) const
std::vector< MeshElement > point_elements
These define the mesh&#39;s points.
Definition: sc_store.h:1308
uint32_t _key
Definition: sc_store.h:476
void GetMatrixIds(MatrixIds &matrix_ids) const
bool operator!=(RGBA32 const &that) const
Definition: sc_store.h:745
Projection projection
Enum that specifies the projection type.
Definition: sc_store.h:1404
bool operator==(ModelKey const &that)
Definition: sc_store.h:102
Space
Definition: sc_store.h:1754
Definition: sc_store.h:1425
bool operator!=(Material const &that) const
Definition: sc_store.h:1572
void PrepareStream(CompressionStrategy compression_strategy=CompressionStrategy::Default)
Definition: sc_store.h:39
Definition: sc_store.h:621
Space
Definition: sc_store.h:1705
PolyPolygonKey(uint32_t key)
Definition: sc_store.h:173
MaterialKey()
Definition: sc_store.h:255
bool operator==(MaterialProperties const &that) const
Definition: sc_store.h:1520
Definition: sc_store.h:1595
Definition: sc_store.h:608
DataKey & operator=(uint32_t key)
Definition: sc_store.h:408
std::vector< uint32_t > indices
Definition: sc_store.h:1222
MatrixKey matrix
The matrix to use for transforming the texture coordinates.
Definition: sc_store.h:1499
uint8_t a
Definition: sc_store.h:752
DPoint target
Sets the location where the camera is pointing.
Definition: sc_store.h:1406
VectorCulling()
Definition: sc_store.h:1760
double z
Definition: sc_store.h:1038
uint8_t gray
Definition: sc_store.h:794
uint32_t _key
Definition: sc_store.h:222
float u
Definition: sc_store.h:1082
std::pair< ModelKey, MeshKey > MeshId
This is an ID that is completely unique throughout an entire cache.
Definition: sc_store.h:500
InclusionKey(uint32_t key)
Definition: sc_store.h:231
Definition: sc_store.h:1066
InstanceKey()
Definition: sc_store.h:143
PolyPolygonKey & operator=(uint32_t key)
Definition: sc_store.h:177
float m[12]
Definition: sc_store.h:830
MaterialMapKey()
Definition: sc_store.h:455
MaterialProperties(float mirror, float specular, float gloss)
Definition: sc_store.h:1513
double length
Definition: sc_store.h:698
Mesh()=default
Definition: sc_store.h:1826
MaterialMapKey mesh_point_element_material_map
Definition: sc_store.h:1331
bool operator!=(DVector const &that) const
Definition: sc_store.h:1032
Camera()
Definition: sc_store.h:1367
static DPoint fromPoint(Point const &point)
Definition: sc_store.h:985
ImageKey image_key
A key used to uniquely identify an image in this model for this texture.
Definition: sc_store.h:1498
bool operator!=(Camera const &that) const
Definition: sc_store.h:1399
Definition: sc_store.h:87
ClipRegionKey(uint32_t key)
Definition: sc_store.h:204
MeshKey()
Definition: sc_store.h:116
MeshKey & operator=(uint32_t key)
Definition: sc_store.h:123
void GetDataKeys(DataKeys &data_keys) const
ViewKey()
Definition: sc_store.h:347
void Translate(float x, float y, float z)
Definition: sc_store.h:860
Definition: sc_store.h:2785
MaterialKey mesh_line_material
Optional material that applies to the Mesh lines.
Definition: sc_store.h:1324
void SetSearchPath(const char *utf8_search_path)
The MaterialMapElement class is used to define a MaterialMapKey with a sparse material map...
Definition: sc_store.h:1662
std::vector< MeshKey > MeshKeys
A std::vector of MeshKey.
Definition: sc_store.h:502
ViewKey(uint32_t key)
Definition: sc_store.h:350
float v
Definition: sc_store.h:1083
MatrixKey & operator=(uint32_t key)
Definition: sc_store.h:327
LinePatternKey()
Definition: sc_store.h:287
void Get(DataKey key, std::vector< uint8_t > &byte_data) const
The Texture class is used to define a Material.
Definition: sc_store.h:1420
float red
Red component of this color object, from 0.0 to 1.0.
Definition: sc_store.h:723
float x
Definition: sc_store.h:1060
virtual ~Logger()
Definition: sc_store.h:29
bool operator!=(Vector const &that) const
Definition: sc_store.h:1009
uint32_t length
Definition: sc_store.h:1688
Vector(float x, float y, float z)
Definition: sc_store.h:998
void GetInstanceIncs(InstanceIncs &instance_incs) const
Point(float x, float y, float z)
Definition: sc_store.h:932
GroupKey & operator=(uint32_t key)
Definition: sc_store.h:435
Texture roughness_map
Definition: sc_store.h:1644
Set if normals are present in the BaseMesh.
Definition: sc_store.h:1249
uint8_t alpha
Definition: sc_store.h:815
uint32_t _key
Definition: sc_store.h:395
bool operator==(PolyPolygonKey const &that)
Definition: sc_store.h:183
GroupKey(uint32_t key)
Definition: sc_store.h:431
Definition: sc_store.h:199
uint8_t b
Definition: sc_store.h:775
std::vector< MatrixKey > MatrixKeys
A std::vector of MatrixKey.
Definition: sc_store.h:517
bool RemoveAll(char const *utf8_path)
MatrixKey matrix
Definition: sc_store.h:1739
std::pair< ModelKey, InstanceKey > InstanceId
This is an ID that is completely unique throughout an entire cache.
Definition: sc_store.h:524
MaterialKey FindOrInsert(Color const &color)
MeshElement & operator=(MeshElement &&that)
Definition: sc_store.h:1196
std::vector< ClipRegionKey > ClipRegionKeys
A std::vector of ClipRegionKey.
Definition: sc_store.h:492
Set if UVs are present in the BaseMesh.
Definition: sc_store.h:1258
static void Close(Cache &cache)
Definition: sc_store.h:779
bool operator==(Camera const &that) const
Definition: sc_store.h:1391
RGBA32(uint8_t r, uint8_t g, uint8_t b, uint8_t a)
Definition: sc_store.h:733
bool operator!=(MaterialMapElement const &that) const
Definition: sc_store.h:1682
Definition: sc_store.h:930
void SetIdentity()
Definition: sc_store.h:893
Definition: sc_store.h:1452
MemoryDeviceFile OpenFileForReading(char const *utf8_path)
Definition: sc_store.h:1701
RGB24(uint8_t r, uint8_t g, uint8_t b)
Definition: sc_store.h:758
float x
Definition: sc_store.h:1013
std::vector< uint8_t > face_elements_bits
Optional bits for filtering selections on the mesh element.
Definition: sc_store.h:1317
Definition: sc_store.h:285
bool operator==(MaterialMapKey const &that)
Definition: sc_store.h:468
std::vector< Texture > diffuse_textures
This supports 0 or 1 or 2 diffuse textures.
Definition: sc_store.h:1577
MaterialMapKey & operator=(uint32_t key)
Definition: sc_store.h:462
Material(Color const &diffuse_color)
Definition: sc_store.h:1557
ModelKey & operator=(uint32_t key)
Definition: sc_store.h:96
void SetTranslation(float x, float y, float z)
Definition: sc_store.h:852
ClipRegionKey()
Definition: sc_store.h:201
uint32_t _key
Definition: sc_store.h:449
bool operator!=(MeshElement const &that) const
Definition: sc_store.h:1208
uint64_t operator()(const T &id) const
Definition: sc_store.h:78
DPoint(double x, double y, double z)
Definition: sc_store.h:955
Normal(float x, float y, float z)
Definition: sc_store.h:1045
std::vector< uint8_t > polyline_elements_bits
Optional bits for filtering selections on the mesh element.
Definition: sc_store.h:1319
std::vector< DataId > DataIds
A std::vector of DataId.
Definition: sc_store.h:481
static uint32_t Version()
float mirror
Clamp value with 0 minimum and 1 maximum; value -1 is unset.
Definition: sc_store.h:1542
PolyPolygonKey()
Definition: sc_store.h:170
void GetImageIds(ImageIds &image_ids) const
std::vector< PolyPolygonKey > PolyPolygonKeys
A std::vector of PolyPolygonKey.
Definition: sc_store.h:487
static MemoryDevice * GetMemoryDevice(char const *memory_device_name)
Definition: sc_store.h:1595
bool CreateDirectories(char const *utf8_directory_path)
Operation operation
Definition: sc_store.h:1742
Definition: sc_store.h:1358
Set if PointRGBA32s are present in the BaseMesh.
Definition: sc_store.h:1259
ClipSubRegion(MatrixKey matrix, Operation operation, Space space)
Definition: sc_store.h:1717
uint32_t _key
Definition: sc_store.h:164
bool operator==(GrayAlpha16 const &that) const
Definition: sc_store.h:805
bool operator!=(Normal const &that) const
Definition: sc_store.h:1056
float y
Definition: sc_store.h:1061
Parameterization
Definition: sc_store.h:1446
bool operator!=(PBRMaterial const &that) const
Definition: sc_store.h:1635
The vector is specified in world coordinates.
Definition: sc_store.h:1756
std::vector< DataKey > DataKeys
A std::vector of DataKey.
Definition: sc_store.h:482
Definition: sc_store.h:1356
uint8_t g
Definition: sc_store.h:750
uint32_t _key
Definition: sc_store.h:368
Definition: sc_store.h:996
static LinePatternKey Unspecified()
Definition: sc_store.h:311
PolyPolygonKeys polypolygons
Definition: sc_store.h:1737
void Close(Model &model)
uint32_t _key
Definition: sc_store.h:249
std::pair< ModelKey, MaterialKey > MaterialId
This is an ID that is completely unique throughout an entire cache.
Definition: sc_store.h:505
std::vector< ImageKey > ImageKeys
A std::vector of ImageKey.
Definition: sc_store.h:497
BaseMesh()
Definition: sc_store.h:1104
static bool DestroyMemoryDevice(char const *memory_device_name)
char const * ToAbsolutePath(char const *utf8_path)
MaterialMapKey mesh_face_element_material_map
Definition: sc_store.h:1326
~Mesh()=default
ModelKey()
Definition: sc_store.h:89
Texture occlusion_map
Definition: sc_store.h:1645
Exception(std::string const &message)
Definition: sc_store.h:41
std::pair< InclusionKey, GroupKey > GroupInc
This is an instance through a specific include.
Definition: sc_store.h:529
ViewKey & operator=(uint32_t key)
Definition: sc_store.h:354
MatrixKey()
Definition: sc_store.h:320
bool operator==(DVector const &that) const
Definition: sc_store.h:1027
bool operator==(ClipRegionKey const &that)
Definition: sc_store.h:214
float green
Green component of this color object, from 0.0 to 1.0.
Definition: sc_store.h:724
Texture emissive_map
Definition: sc_store.h:1642
Definition: sc_store.h:756
If set nothing will be visible.
Definition: sc_store.h:549
bool operator!=(RGB24 const &that) const
Definition: sc_store.h:769
bool operator==(Material const &that) const
Definition: sc_store.h:1565
void GetDataIds(DataIds &data_ids) const
Definition: sc_store.h:1435
void GetInstanceKeys(InstanceKeys &instance_keys) const
bool operator!=(DPoint const &that) const
Definition: sc_store.h:966
Modifiers
Definition: sc_store.h:1451
MeshKey Insert(Mesh const &mesh)
If set points will be visible.
Definition: sc_store.h:552
If set, the mesh will not be back-face culled.
Definition: sc_store.h:1247
uint32_t _key
Definition: sc_store.h:309
MemoryDeviceFile & operator=(MemoryDeviceFile &&source)=default
Texture(ImageKey image_key, MatrixKey matrix=MatrixKey(), uint32_t flags=0)
Definition: sc_store.h:1481
Definition: sc_store.h:879
bool operator==(GroupKey const &that)
Definition: sc_store.h:441
void Set(MeshKey key, Mesh const &mesh)
ClipSubRegion()
Definition: sc_store.h:1710
Definition: sc_store.h:545
Definition: sc_store.h:345
Definition: sc_store.h:1099
Definition: sc_store.h:595
uint32_t _key
Definition: sc_store.h:422
Texture base_color_map
Stored in sRGB color space.
Definition: sc_store.h:1640
Mesh & operator=(const Mesh &other)=delete
Color base_color_factor
Stored in linear color space.
Definition: sc_store.h:1651
Definition: sc_store.h:168
bool IsDirectory(char const *utf8_path)
LinePatternKey & operator=(uint32_t key)
Definition: sc_store.h:295
bool operator==(UV const &that) const
Definition: sc_store.h:1073
Definition: sc_store.h:1362
Bits
Definition: sc_store.h:585
Definition: sc_store.h:1043
Set if RGBA32s are present in the BaseMesh.
Definition: sc_store.h:1255
Interpolation
Definition: sc_store.h:1432
uint32_t _key
Definition: sc_store.h:110
bool empty() const
Definition: sc_store.h:1533
LinePatternKey(uint32_t key)
Definition: sc_store.h:291
void GetMeshIds(MeshIds &mesh_ids) const
Definition: sc_store.h:226
Definition: sc_store.h:582
uint64_t operator()(uint32_t key) const
Definition: sc_store.h:53
float tolerance
Definition: sc_store.h:1773
virtual void Message(char const *utf8_message) const =0
Definition: sc_store.h:318
The 1 bit and RLE formats are not supported.
std::vector< GroupKey > GroupKeys
A std::vector of GroupKey.
Definition: sc_store.h:534
float specular
Clamp value with 0 minimum and 1 maximum; value -1 is unset.
Definition: sc_store.h:1543
InclusionKey Include(Model const &model, MatrixKey matrix=MatrixKey())
Definition: sc_store.h:48
PBRMaterial()
Definition: sc_store.h:1597
void GetClipRegionIds(ClipRegionIds &clip_region_ids) const
void SetWorkspacePath(const char *utf8_directory_path)
ImageKey & operator=(uint32_t key)
Definition: sc_store.h:381
Visibility()
Definition: sc_store.h:557
static uint32_t PackFlags(Tiling tiling, Interpolation interpolation, MipMapping mipmapping, Parameterization parameterization, Modifiers modifiers)
Definition: sc_store.h:1460
constexpr ModelKey(uint32_t key)
Definition: sc_store.h:92
If set lines will be visible.
Definition: sc_store.h:551
Modifiers()
Definition: sc_store.h:656
std::vector< InstanceId > InstanceIds
A std::vector of InstanceId.
Definition: sc_store.h:525
Set if UVs are present in the BaseMesh.
Definition: sc_store.h:1250
std::vector< LinePatternKey > LinePatternKeys
A std::vector of LinePatternKey.
Definition: sc_store.h:512
bool operator==(Matrix3d const &that) const
Definition: sc_store.h:832
std::vector< LinePatternId > LinePatternIds
A std::vector of LinePatternId.
Definition: sc_store.h:511
Definition: sc_store.h:253
Definition: sc_store.h:23
Definition: sc_store.h:141
ChannelMapping roughness_map_channel
Definition: sc_store.h:1648
Definition: sc_store.h:1595
float y
Definition: sc_store.h:1014
Definition: sc_store.h:680
void GetMatrixKeys(MatrixKeys &matrix_keys) const
Gray8(uint8_t gray)
Definition: sc_store.h:781
bool operator==(Normal const &that) const
Definition: sc_store.h:1051
The vector is not specified.
Definition: sc_store.h:1755
Modifiers & operator=(uint32_t value)
Definition: sc_store.h:663
void GetGroupIds(GroupIds &group_ids) const
void GetMaterialKeys(MaterialKeys &material_keys) const
ChannelMapping occlusion_map_channel
Definition: sc_store.h:1649
MeshElement & operator=(MeshElement const &)=default
MaterialKey(uint32_t key)
Definition: sc_store.h:258
bool operator==(PBRMaterial const &that) const
Definition: sc_store.h:1618
Color(float red, float green, float blue, float alpha)
Definition: sc_store.h:705
bool operator==(Modifiers const &that)
Definition: sc_store.h:669
bool operator==(DPoint const &that) const
Definition: sc_store.h:961
std::vector< ClipSubRegion > ClipSubRegions
A std::vector of ClipSubRegion.
Definition: sc_store.h:1749
std::vector< PolyPolygonId > PolyPolygonIds
A std::vector of PolyPolygonId.
Definition: sc_store.h:486
double field_width
Sets the width of the camera field in world space units.
Definition: sc_store.h:1408
MeshElement()
Definition: sc_store.h:1183
Definition: sc_store.h:51
MatrixKey(uint32_t key)
Definition: sc_store.h:323
Definition: sc_store.h:426
MaterialProperties properties
Definition: sc_store.h:1580
float occlusion_factor
Definition: sc_store.h:1656
Bits
Definition: sc_store.h:548
uint8_t r
Definition: sc_store.h:773
bool operator!=(Texture const &that) const
Definition: sc_store.h:1492
VectorCulling(Vector const &vector, float tolerance, Space space)
Definition: sc_store.h:1766
DataKey(uint32_t key)
Definition: sc_store.h:404
Definition: sc_store.h:114
static void SetLicense(const char *encoded_license)
std::vector< uint8_t > values
Definition: sc_store.h:699
bool operator==(InclusionKey const &that)
Definition: sc_store.h:241
bool operator==(MatrixKey const &that)
Definition: sc_store.h:333
bool operator==(RGB24 const &that) const
Definition: sc_store.h:764
Space space
Definition: sc_store.h:1744
Set if normals are present in the BaseMesh.
Definition: sc_store.h:1253
void setLength(double const &a_length)
Definition: sc_store.h:683
std::vector< MatrixId > MatrixIds
A std::vector of MatrixId.
Definition: sc_store.h:516
std::vector< MaterialMapId > MaterialMapIds
A std::vector of MaterialMapId.
Definition: sc_store.h:538
double field_height
Sets the height of the camera field in world space units.
Definition: sc_store.h:1409
Definition: sc_store.h:1589
Point toPoint()
Definition: sc_store.h:975
If set faces will be visible.
Definition: sc_store.h:550
Definition: sc_store.h:590
Camera(Projection projection, DPoint const &position, DPoint const &target, DVector const &up_vector, double field_width, double field_height)
Definition: sc_store.h:1372
bool operator!=(GrayAlpha16 const &that) const
Definition: sc_store.h:810
std::vector< MeshId > MeshIds
A std::vector of MeshId.
Definition: sc_store.h:501
double y
Definition: sc_store.h:1037
bool operator==(LinePatternKey const &that)
Definition: sc_store.h:301
bool operator!=(Color const &that) const
Definition: sc_store.h:719
float alpha_cutoff
Definition: sc_store.h:1657
float alpha
Definition: sc_store.h:726
void SetTranslation(double x, double y, double z)
Definition: sc_store.h:902
Visibility & operator=(uint32_t value)
Definition: sc_store.h:564
bool operator==(RGBA32 const &that) const
Definition: sc_store.h:740
Definition: sc_store.h:1237
std::pair< ModelKey, MaterialMapKey > MaterialMapId
This is an ID that is completely unique throughout an entire cache.
Definition: sc_store.h:537
void GetPolyPolygonKeys(PolyPolygonKeys &polypolygon_keys) const
Definition: sc_store.h:703
Definition: sc_store.h:399
Set a winding if known.
Definition: sc_store.h:1244
Definition: sc_store.h:76
MipMapping
Definition: sc_store.h:1439
std::vector< InstanceKey > InstanceKeys
A std::vector of InstanceKey.
Definition: sc_store.h:526
AlphaMode
Definition: sc_store.h:1595
MaterialProperties()
Definition: sc_store.h:1507
Definition: sc_store.h:1241
InstanceKey & operator=(uint32_t key)
Definition: sc_store.h:150
float metalness_factor
Definition: sc_store.h:1654
bool Exists(char const *utf8_path)
void GetMaterialMapKeys(MaterialMapKeys &material_map_keys) const
void Translate(double x, double y, double z)
Definition: sc_store.h:910
The ClipSubRegion class is used to define a ClipRegionKey.
Definition: sc_store.h:1696
Definition: sc_store.h:644
InstanceKey(uint32_t key)
Definition: sc_store.h:146
CompressionStrategy
Definition: sc_store.h:542
void SetIdentity()
Definition: sc_store.h:843
uint8_t gray
Definition: sc_store.h:814
UV const * uvs
An array of UV points.
Definition: sc_store.h:1132
Normal const * normals
An array of normals.
Definition: sc_store.h:1127
Vector vector
Definition: sc_store.h:1772
MaterialMapKey mesh_line_element_material_map
Definition: sc_store.h:1328
std::vector< GroupId > GroupIds
A std::vector of MeshId.
Definition: sc_store.h:533
bool operator!=(UV const &that) const
Definition: sc_store.h:1078
double x
Definition: sc_store.h:970
std::vector< InclusionKey > InclusionKeys
A std::vector of InclusionKey.
Definition: sc_store.h:519
Definition: sc_store.h:27
Visibility(uint32_t value)
Definition: sc_store.h:560
Definition: sc_store.h:829
bool operator==(Texture const &that) const
Definition: sc_store.h:1487
Definition: sc_store.h:1264
Definition: sc_store.h:12
uint32_t _key
Definition: sc_store.h:341
void GetMaterialMapIds(MaterialMapIds &material_map_ids) const
Definition: sc_store.h:1453
bool operator==(Point const &that) const
Definition: sc_store.h:938
uint32_t _key
Definition: sc_store.h:137
Definition: sc_store.h:1350
Disable mipmapping. Textures may appear noisy when reduced in size.
Definition: sc_store.h:1443
std::vector< MaterialId > MaterialIds
A std::vector of MaterialId.
Definition: sc_store.h:506
float blue
Blue component of this color object, from 0.0 to 1.0.
Definition: sc_store.h:725
std::pair< InclusionKey, InstanceKey > InstanceInc
This is an instance through a specific include.
Definition: sc_store.h:521