dracox 0.0.1__cp39-cp39-win_amd64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. bin/draco_decoder.exe +0 -0
  2. bin/draco_encoder.exe +0 -0
  3. dracox/__init__.py +252 -0
  4. dracox/dracox_ext.cp39-win_amd64.pyd +0 -0
  5. dracox-0.0.1.dist-info/METADATA +14 -0
  6. dracox-0.0.1.dist-info/RECORD +214 -0
  7. dracox-0.0.1.dist-info/WHEEL +5 -0
  8. include/draco/animation/keyframe_animation.h +107 -0
  9. include/draco/animation/keyframe_animation_decoder.h +34 -0
  10. include/draco/animation/keyframe_animation_encoder.h +39 -0
  11. include/draco/attributes/attribute_octahedron_transform.h +81 -0
  12. include/draco/attributes/attribute_quantization_transform.h +102 -0
  13. include/draco/attributes/attribute_transform.h +76 -0
  14. include/draco/attributes/attribute_transform_data.h +71 -0
  15. include/draco/attributes/attribute_transform_type.h +30 -0
  16. include/draco/attributes/geometry_attribute.h +541 -0
  17. include/draco/attributes/geometry_indices.h +54 -0
  18. include/draco/attributes/point_attribute.h +196 -0
  19. include/draco/compression/attributes/attributes_decoder.h +97 -0
  20. include/draco/compression/attributes/attributes_decoder_interface.h +62 -0
  21. include/draco/compression/attributes/attributes_encoder.h +154 -0
  22. include/draco/compression/attributes/kd_tree_attributes_decoder.h +50 -0
  23. include/draco/compression/attributes/kd_tree_attributes_encoder.h +51 -0
  24. include/draco/compression/attributes/kd_tree_attributes_shared.h +28 -0
  25. include/draco/compression/attributes/linear_sequencer.h +51 -0
  26. include/draco/compression/attributes/mesh_attribute_indices_encoding_data.h +58 -0
  27. include/draco/compression/attributes/normal_compression_utils.h +372 -0
  28. include/draco/compression/attributes/point_d_vector.h +288 -0
  29. include/draco/compression/attributes/points_sequencer.h +63 -0
  30. include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_constrained_multi_parallelogram_decoder.h +236 -0
  31. include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_constrained_multi_parallelogram_encoder.h +413 -0
  32. include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_constrained_multi_parallelogram_shared.h +34 -0
  33. include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_data.h +72 -0
  34. include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_decoder.h +46 -0
  35. include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_encoder.h +46 -0
  36. include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_geometric_normal_decoder.h +176 -0
  37. include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_geometric_normal_encoder.h +180 -0
  38. include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_geometric_normal_predictor_area.h +117 -0
  39. include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_geometric_normal_predictor_base.h +96 -0
  40. include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_multi_parallelogram_decoder.h +128 -0
  41. include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_multi_parallelogram_encoder.h +133 -0
  42. include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_parallelogram_encoder.h +111 -0
  43. include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_parallelogram_shared.h +78 -0
  44. include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_tex_coords_decoder.h +372 -0
  45. include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_tex_coords_encoder.h +318 -0
  46. include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_tex_coords_portable_decoder.h +143 -0
  47. include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_tex_coords_portable_encoder.h +136 -0
  48. include/draco/compression/attributes/prediction_schemes/mesh_prediction_scheme_tex_coords_portable_predictor.h +282 -0
  49. include/draco/compression/attributes/prediction_schemes/prediction_scheme_decoder.h +90 -0
  50. include/draco/compression/attributes/prediction_schemes/prediction_scheme_decoder_factory.h +194 -0
  51. include/draco/compression/attributes/prediction_schemes/prediction_scheme_decoder_interface.h +53 -0
  52. include/draco/compression/attributes/prediction_schemes/prediction_scheme_decoding_transform.h +65 -0
  53. include/draco/compression/attributes/prediction_schemes/prediction_scheme_delta_decoder.h +65 -0
  54. include/draco/compression/attributes/prediction_schemes/prediction_scheme_delta_encoder.h +69 -0
  55. include/draco/compression/attributes/prediction_schemes/prediction_scheme_encoder.h +90 -0
  56. include/draco/compression/attributes/prediction_schemes/prediction_scheme_encoder_factory.h +134 -0
  57. include/draco/compression/attributes/prediction_schemes/prediction_scheme_encoder_interface.h +55 -0
  58. include/draco/compression/attributes/prediction_schemes/prediction_scheme_encoding_transform.h +77 -0
  59. include/draco/compression/attributes/prediction_schemes/prediction_scheme_factory.h +85 -0
  60. include/draco/compression/attributes/prediction_schemes/prediction_scheme_interface.h +60 -0
  61. include/draco/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_canonicalized_decoding_transform.h +118 -0
  62. include/draco/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_canonicalized_encoding_transform.h +116 -0
  63. include/draco/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_canonicalized_transform_base.h +102 -0
  64. include/draco/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_decoding_transform.h +115 -0
  65. include/draco/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_encoding_transform.h +105 -0
  66. include/draco/compression/attributes/prediction_schemes/prediction_scheme_normal_octahedron_transform_base.h +90 -0
  67. include/draco/compression/attributes/prediction_schemes/prediction_scheme_wrap_decoding_transform.h +88 -0
  68. include/draco/compression/attributes/prediction_schemes/prediction_scheme_wrap_encoding_transform.h +81 -0
  69. include/draco/compression/attributes/prediction_schemes/prediction_scheme_wrap_transform_base.h +120 -0
  70. include/draco/compression/attributes/sequential_attribute_decoder.h +86 -0
  71. include/draco/compression/attributes/sequential_attribute_decoders_controller.h +61 -0
  72. include/draco/compression/attributes/sequential_attribute_encoder.h +134 -0
  73. include/draco/compression/attributes/sequential_attribute_encoders_controller.h +115 -0
  74. include/draco/compression/attributes/sequential_integer_attribute_decoder.h +76 -0
  75. include/draco/compression/attributes/sequential_integer_attribute_encoder.h +67 -0
  76. include/draco/compression/attributes/sequential_normal_attribute_decoder.h +83 -0
  77. include/draco/compression/attributes/sequential_normal_attribute_encoder.h +82 -0
  78. include/draco/compression/attributes/sequential_quantization_attribute_decoder.h +52 -0
  79. include/draco/compression/attributes/sequential_quantization_attribute_encoder.h +52 -0
  80. include/draco/compression/bit_coders/adaptive_rans_bit_coding_shared.h +43 -0
  81. include/draco/compression/bit_coders/adaptive_rans_bit_decoder.h +54 -0
  82. include/draco/compression/bit_coders/adaptive_rans_bit_encoder.h +61 -0
  83. include/draco/compression/bit_coders/direct_bit_decoder.h +89 -0
  84. include/draco/compression/bit_coders/direct_bit_encoder.h +89 -0
  85. include/draco/compression/bit_coders/folded_integer_bit_decoder.h +77 -0
  86. include/draco/compression/bit_coders/folded_integer_bit_encoder.h +82 -0
  87. include/draco/compression/bit_coders/rans_bit_decoder.h +55 -0
  88. include/draco/compression/bit_coders/rans_bit_encoder.h +57 -0
  89. include/draco/compression/bit_coders/symbol_bit_decoder.h +36 -0
  90. include/draco/compression/bit_coders/symbol_bit_encoder.h +36 -0
  91. include/draco/compression/config/compression_shared.h +155 -0
  92. include/draco/compression/config/decoder_options.h +34 -0
  93. include/draco/compression/config/draco_options.h +249 -0
  94. include/draco/compression/config/encoder_options.h +101 -0
  95. include/draco/compression/config/encoding_features.h +39 -0
  96. include/draco/compression/decode.h +80 -0
  97. include/draco/compression/draco_compression_options.h +141 -0
  98. include/draco/compression/encode.h +139 -0
  99. include/draco/compression/encode_base.h +131 -0
  100. include/draco/compression/entropy/ans.h +526 -0
  101. include/draco/compression/entropy/rans_symbol_coding.h +53 -0
  102. include/draco/compression/entropy/rans_symbol_decoder.h +171 -0
  103. include/draco/compression/entropy/rans_symbol_encoder.h +290 -0
  104. include/draco/compression/entropy/shannon_entropy.h +110 -0
  105. include/draco/compression/entropy/symbol_decoding.h +29 -0
  106. include/draco/compression/entropy/symbol_encoding.h +47 -0
  107. include/draco/compression/expert_encode.h +160 -0
  108. include/draco/compression/mesh/mesh_decoder.h +68 -0
  109. include/draco/compression/mesh/mesh_edgebreaker_decoder.h +54 -0
  110. include/draco/compression/mesh/mesh_edgebreaker_decoder_impl.h +228 -0
  111. include/draco/compression/mesh/mesh_edgebreaker_decoder_impl_interface.h +47 -0
  112. include/draco/compression/mesh/mesh_edgebreaker_encoder.h +73 -0
  113. include/draco/compression/mesh/mesh_edgebreaker_encoder_impl.h +209 -0
  114. include/draco/compression/mesh/mesh_edgebreaker_encoder_impl_interface.h +57 -0
  115. include/draco/compression/mesh/mesh_edgebreaker_shared.h +129 -0
  116. include/draco/compression/mesh/mesh_edgebreaker_traversal_decoder.h +201 -0
  117. include/draco/compression/mesh/mesh_edgebreaker_traversal_encoder.h +139 -0
  118. include/draco/compression/mesh/mesh_edgebreaker_traversal_predictive_decoder.h +134 -0
  119. include/draco/compression/mesh/mesh_edgebreaker_traversal_predictive_encoder.h +172 -0
  120. include/draco/compression/mesh/mesh_edgebreaker_traversal_valence_decoder.h +219 -0
  121. include/draco/compression/mesh/mesh_edgebreaker_traversal_valence_encoder.h +226 -0
  122. include/draco/compression/mesh/mesh_encoder.h +84 -0
  123. include/draco/compression/mesh/mesh_sequential_decoder.h +39 -0
  124. include/draco/compression/mesh/mesh_sequential_encoder.h +56 -0
  125. include/draco/compression/mesh/traverser/depth_first_traverser.h +172 -0
  126. include/draco/compression/mesh/traverser/max_prediction_degree_traverser.h +226 -0
  127. include/draco/compression/mesh/traverser/mesh_attribute_indices_encoding_observer.h +76 -0
  128. include/draco/compression/mesh/traverser/mesh_traversal_sequencer.h +113 -0
  129. include/draco/compression/mesh/traverser/traverser_base.h +87 -0
  130. include/draco/compression/point_cloud/algorithms/dynamic_integer_points_kd_tree_decoder.h +369 -0
  131. include/draco/compression/point_cloud/algorithms/dynamic_integer_points_kd_tree_encoder.h +372 -0
  132. include/draco/compression/point_cloud/algorithms/float_points_tree_decoder.h +141 -0
  133. include/draco/compression/point_cloud/algorithms/float_points_tree_encoder.h +126 -0
  134. include/draco/compression/point_cloud/algorithms/point_cloud_compression_method.h +34 -0
  135. include/draco/compression/point_cloud/algorithms/point_cloud_types.h +76 -0
  136. include/draco/compression/point_cloud/algorithms/quantize_points_3.h +84 -0
  137. include/draco/compression/point_cloud/algorithms/queuing_policy.h +75 -0
  138. include/draco/compression/point_cloud/point_cloud_decoder.h +118 -0
  139. include/draco/compression/point_cloud/point_cloud_encoder.h +158 -0
  140. include/draco/compression/point_cloud/point_cloud_kd_tree_decoder.h +31 -0
  141. include/draco/compression/point_cloud/point_cloud_kd_tree_encoder.h +45 -0
  142. include/draco/compression/point_cloud/point_cloud_sequential_decoder.h +33 -0
  143. include/draco/compression/point_cloud/point_cloud_sequential_encoder.h +43 -0
  144. include/draco/core/bit_utils.h +127 -0
  145. include/draco/core/bounding_box.h +77 -0
  146. include/draco/core/constants.h +6 -0
  147. include/draco/core/cycle_timer.h +51 -0
  148. include/draco/core/data_buffer.h +82 -0
  149. include/draco/core/decoder_buffer.h +216 -0
  150. include/draco/core/divide.h +42 -0
  151. include/draco/core/draco_index_type.h +184 -0
  152. include/draco/core/draco_index_type_vector.h +90 -0
  153. include/draco/core/draco_types.h +52 -0
  154. include/draco/core/draco_version.h +25 -0
  155. include/draco/core/encoder_buffer.h +152 -0
  156. include/draco/core/hash_utils.h +64 -0
  157. include/draco/core/macros.h +124 -0
  158. include/draco/core/math_utils.h +79 -0
  159. include/draco/core/options.h +151 -0
  160. include/draco/core/quantization_utils.h +82 -0
  161. include/draco/core/status.h +83 -0
  162. include/draco/core/status_or.h +81 -0
  163. include/draco/core/varint_decoding.h +81 -0
  164. include/draco/core/varint_encoding.h +61 -0
  165. include/draco/core/vector_d.h +355 -0
  166. include/draco/draco_features.h +25 -0
  167. include/draco/io/file_reader_factory.h +34 -0
  168. include/draco/io/file_reader_interface.h +32 -0
  169. include/draco/io/file_utils.h +86 -0
  170. include/draco/io/file_writer_factory.h +34 -0
  171. include/draco/io/file_writer_interface.h +26 -0
  172. include/draco/io/file_writer_utils.h +38 -0
  173. include/draco/io/mesh_io.h +107 -0
  174. include/draco/io/obj_decoder.h +147 -0
  175. include/draco/io/obj_encoder.h +107 -0
  176. include/draco/io/parser_utils.h +66 -0
  177. include/draco/io/ply_decoder.h +69 -0
  178. include/draco/io/ply_encoder.h +54 -0
  179. include/draco/io/ply_property_reader.h +96 -0
  180. include/draco/io/ply_property_writer.h +94 -0
  181. include/draco/io/ply_reader.h +155 -0
  182. include/draco/io/point_cloud_io.h +89 -0
  183. include/draco/io/stdio_file_reader.h +48 -0
  184. include/draco/io/stdio_file_writer.h +42 -0
  185. include/draco/io/stl_decoder.h +38 -0
  186. include/draco/io/stl_encoder.h +52 -0
  187. include/draco/mesh/corner_table.h +397 -0
  188. include/draco/mesh/corner_table_iterators.h +309 -0
  189. include/draco/mesh/mesh.h +378 -0
  190. include/draco/mesh/mesh_are_equivalent.h +71 -0
  191. include/draco/mesh/mesh_attribute_corner_table.h +202 -0
  192. include/draco/mesh/mesh_cleanup.h +61 -0
  193. include/draco/mesh/mesh_features.h +93 -0
  194. include/draco/mesh/mesh_indices.h +37 -0
  195. include/draco/mesh/mesh_misc_functions.h +105 -0
  196. include/draco/mesh/mesh_stripifier.h +258 -0
  197. include/draco/mesh/triangle_soup_mesh_builder.h +134 -0
  198. include/draco/mesh/valence_cache.h +142 -0
  199. include/draco/metadata/geometry_metadata.h +142 -0
  200. include/draco/metadata/metadata.h +209 -0
  201. include/draco/metadata/metadata_decoder.h +42 -0
  202. include/draco/metadata/metadata_encoder.h +41 -0
  203. include/draco/metadata/property_attribute.h +107 -0
  204. include/draco/metadata/property_table.h +222 -0
  205. include/draco/metadata/structural_metadata.h +78 -0
  206. include/draco/metadata/structural_metadata_schema.h +118 -0
  207. include/draco/point_cloud/point_cloud.h +289 -0
  208. include/draco/point_cloud/point_cloud_builder.h +101 -0
  209. lib/draco.lib +0 -0
  210. lib/pkgconfig/draco.pc +6 -0
  211. share/cmake/draco/draco-config-version.cmake +43 -0
  212. share/cmake/draco/draco-config.cmake +27 -0
  213. share/cmake/draco/draco-targets-release.cmake +19 -0
  214. share/cmake/draco/draco-targets.cmake +107 -0
@@ -0,0 +1,289 @@
1
+ // Copyright 2016 The Draco Authors.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ //
15
+ #ifndef DRACO_POINT_CLOUD_POINT_CLOUD_H_
16
+ #define DRACO_POINT_CLOUD_POINT_CLOUD_H_
17
+
18
+ #include "draco/attributes/point_attribute.h"
19
+ #include "draco/core/bounding_box.h"
20
+ #include "draco/core/vector_d.h"
21
+ #include "draco/draco_features.h"
22
+ #include "draco/metadata/geometry_metadata.h"
23
+
24
+ #ifdef DRACO_TRANSCODER_SUPPORTED
25
+ #include "draco/compression/draco_compression_options.h"
26
+ #endif
27
+
28
+ namespace draco {
29
+
30
+ // PointCloud is a collection of n-dimensional points that are described by a
31
+ // set of PointAttributes that can represent data such as positions or colors
32
+ // of individual points (see point_attribute.h).
33
+ class PointCloud {
34
+ public:
35
+ PointCloud();
36
+ virtual ~PointCloud() = default;
37
+
38
+ #ifdef DRACO_TRANSCODER_SUPPORTED
39
+ // Copies all data from the |src| point cloud.
40
+ void Copy(const PointCloud &src);
41
+ #endif
42
+
43
+ // Returns the number of named attributes of a given type.
44
+ int32_t NumNamedAttributes(GeometryAttribute::Type type) const;
45
+
46
+ // Returns attribute id of the first named attribute with a given type or -1
47
+ // when the attribute is not used by the point cloud.
48
+ int32_t GetNamedAttributeId(GeometryAttribute::Type type) const;
49
+
50
+ // Returns the id of the i-th named attribute of a given type.
51
+ int32_t GetNamedAttributeId(GeometryAttribute::Type type, int i) const;
52
+
53
+ // Returns the first named attribute of a given type or nullptr if the
54
+ // attribute is not used by the point cloud.
55
+ const PointAttribute *GetNamedAttribute(GeometryAttribute::Type type) const;
56
+
57
+ // Returns the i-th named attribute of a given type.
58
+ const PointAttribute *GetNamedAttribute(GeometryAttribute::Type type,
59
+ int i) const;
60
+
61
+ // Returns the named attribute of a given unique id.
62
+ const PointAttribute *GetNamedAttributeByUniqueId(
63
+ GeometryAttribute::Type type, uint32_t id) const;
64
+
65
+ // Returns the attribute of a given unique id.
66
+ const PointAttribute *GetAttributeByUniqueId(uint32_t id) const;
67
+ int32_t GetAttributeIdByUniqueId(uint32_t unique_id) const;
68
+
69
+ #ifdef DRACO_TRANSCODER_SUPPORTED
70
+ // Returns the named attribute with a given name.
71
+ const PointAttribute *GetNamedAttributeByName(GeometryAttribute::Type type,
72
+ const std::string &name) const;
73
+ #endif // DRACO_TRANSCODER_SUPPORTED
74
+
75
+ int32_t num_attributes() const {
76
+ return static_cast<int32_t>(attributes_.size());
77
+ }
78
+ const PointAttribute *attribute(int32_t att_id) const {
79
+ DRACO_DCHECK_LE(0, att_id);
80
+ DRACO_DCHECK_LT(att_id, static_cast<int32_t>(attributes_.size()));
81
+ return attributes_[att_id].get();
82
+ }
83
+
84
+ // Returned attribute can be modified, but it's caller's responsibility to
85
+ // maintain the attribute's consistency with draco::PointCloud.
86
+ PointAttribute *attribute(int32_t att_id) {
87
+ DRACO_DCHECK_LE(0, att_id);
88
+ DRACO_DCHECK_LT(att_id, static_cast<int32_t>(attributes_.size()));
89
+ return attributes_[att_id].get();
90
+ }
91
+
92
+ // Adds a new attribute to the point cloud.
93
+ // Returns the attribute id.
94
+ int AddAttribute(std::unique_ptr<PointAttribute> pa);
95
+
96
+ // Creates and adds a new attribute to the point cloud. The attribute has
97
+ // properties derived from the provided GeometryAttribute |att|.
98
+ // If |identity_mapping| is set to true, the attribute will use identity
99
+ // mapping between point indices and attribute value indices (i.e., each
100
+ // point has a unique attribute value). If |identity_mapping| is false, the
101
+ // mapping between point indices and attribute value indices is set to
102
+ // explicit, and it needs to be initialized manually using the
103
+ // PointAttribute::SetPointMapEntry() method. |num_attribute_values| can be
104
+ // used to specify the number of attribute values that are going to be
105
+ // stored in the newly created attribute. Returns attribute id of the newly
106
+ // created attribute or -1 in case of failure.
107
+ int AddAttribute(const GeometryAttribute &att, bool identity_mapping,
108
+ AttributeValueIndex::ValueType num_attribute_values);
109
+
110
+ // Creates and returns a new attribute or nullptr in case of failure. This
111
+ // method is similar to AddAttribute(), except that it returns the new
112
+ // attribute instead of adding it to the point cloud.
113
+ std::unique_ptr<PointAttribute> CreateAttribute(
114
+ const GeometryAttribute &att, bool identity_mapping,
115
+ AttributeValueIndex::ValueType num_attribute_values) const;
116
+
117
+ // Assigns an attribute id to a given PointAttribute. If an attribute with
118
+ // the same attribute id already exists, it is deleted.
119
+ virtual void SetAttribute(int att_id, std::unique_ptr<PointAttribute> pa);
120
+
121
+ // Deletes an attribute with specified attribute id. Note that this changes
122
+ // attribute ids of all subsequent attributes.
123
+ virtual void DeleteAttribute(int att_id);
124
+
125
+ #ifdef DRACO_ATTRIBUTE_VALUES_DEDUPLICATION_SUPPORTED
126
+ // Deduplicates all attribute values (all attribute entries with the same
127
+ // value are merged into a single entry).
128
+ virtual bool DeduplicateAttributeValues();
129
+ #endif
130
+
131
+ #ifdef DRACO_ATTRIBUTE_INDICES_DEDUPLICATION_SUPPORTED
132
+ // Removes duplicate point ids (two point ids are duplicate when all of their
133
+ // attributes are mapped to the same entry ids).
134
+ virtual void DeduplicatePointIds();
135
+ #endif
136
+
137
+ // Get bounding box.
138
+ BoundingBox ComputeBoundingBox() const;
139
+
140
+ // Add metadata.
141
+ void AddMetadata(std::unique_ptr<GeometryMetadata> metadata) {
142
+ metadata_ = std::move(metadata);
143
+ }
144
+
145
+ // Add metadata for an attribute.
146
+ void AddAttributeMetadata(int32_t att_id,
147
+ std::unique_ptr<AttributeMetadata> metadata) {
148
+ if (!metadata_) {
149
+ metadata_ = std::unique_ptr<GeometryMetadata>(new GeometryMetadata());
150
+ }
151
+ const int32_t att_unique_id = attribute(att_id)->unique_id();
152
+ metadata->set_att_unique_id(att_unique_id);
153
+ metadata_->AddAttributeMetadata(std::move(metadata));
154
+ }
155
+
156
+ const AttributeMetadata *GetAttributeMetadataByAttributeId(
157
+ int32_t att_id) const {
158
+ if (metadata_ == nullptr) {
159
+ return nullptr;
160
+ }
161
+ const uint32_t unique_id = attribute(att_id)->unique_id();
162
+ return metadata_->GetAttributeMetadataByUniqueId(unique_id);
163
+ }
164
+
165
+ // Returns the attribute metadata that has the requested metadata entry.
166
+ const AttributeMetadata *GetAttributeMetadataByStringEntry(
167
+ const std::string &name, const std::string &value) const {
168
+ if (metadata_ == nullptr) {
169
+ return nullptr;
170
+ }
171
+ return metadata_->GetAttributeMetadataByStringEntry(name, value);
172
+ }
173
+
174
+ // Returns the first attribute that has the requested metadata entry.
175
+ int GetAttributeIdByMetadataEntry(const std::string &name,
176
+ const std::string &value) const {
177
+ if (metadata_ == nullptr) {
178
+ return -1;
179
+ }
180
+ const AttributeMetadata *att_metadata =
181
+ metadata_->GetAttributeMetadataByStringEntry(name, value);
182
+ if (!att_metadata) {
183
+ return -1;
184
+ }
185
+ return GetAttributeIdByUniqueId(att_metadata->att_unique_id());
186
+ }
187
+
188
+ // Get a const pointer of the metadata of the point cloud.
189
+ const GeometryMetadata *GetMetadata() const { return metadata_.get(); }
190
+
191
+ // Get a pointer to the metadata of the point cloud.
192
+ GeometryMetadata *metadata() { return metadata_.get(); }
193
+
194
+ // Returns the number of n-dimensional points stored within the point cloud.
195
+ PointIndex::ValueType num_points() const { return num_points_; }
196
+
197
+ // Sets the number of points. It's the caller's responsibility to ensure the
198
+ // new number is valid with respect to the PointAttributes stored in the point
199
+ // cloud.
200
+ void set_num_points(PointIndex::ValueType num) { num_points_ = num; }
201
+
202
+ #ifdef DRACO_TRANSCODER_SUPPORTED
203
+ // Enables or disables Draco geometry compression for this mesh.
204
+ void SetCompressionEnabled(bool enabled) { compression_enabled_ = enabled; }
205
+ bool IsCompressionEnabled() const { return compression_enabled_; }
206
+
207
+ // Sets |options| that configure Draco geometry compression. This does not
208
+ // enable or disable compression.
209
+ void SetCompressionOptions(const DracoCompressionOptions &options) {
210
+ compression_options_ = options;
211
+ }
212
+ const DracoCompressionOptions &GetCompressionOptions() const {
213
+ return compression_options_;
214
+ }
215
+ DracoCompressionOptions &GetCompressionOptions() {
216
+ return compression_options_;
217
+ }
218
+ #endif // DRACO_TRANSCODER_SUPPORTED
219
+
220
+ protected:
221
+ #ifdef DRACO_TRANSCODER_SUPPORTED
222
+ // Copies metadata from the |src| point cloud.
223
+ void CopyMetadata(const PointCloud &src);
224
+ #endif
225
+
226
+ #ifdef DRACO_ATTRIBUTE_INDICES_DEDUPLICATION_SUPPORTED
227
+ // Applies id mapping of deduplicated points (called by DeduplicatePointIds).
228
+ virtual void ApplyPointIdDeduplication(
229
+ const IndexTypeVector<PointIndex, PointIndex> &id_map,
230
+ const std::vector<PointIndex> &unique_point_ids);
231
+ #endif
232
+
233
+ private:
234
+ // Metadata for the point cloud.
235
+ std::unique_ptr<GeometryMetadata> metadata_;
236
+
237
+ // Attributes describing the point cloud.
238
+ std::vector<std::unique_ptr<PointAttribute>> attributes_;
239
+
240
+ // Ids of named attributes of the given type.
241
+ std::vector<int32_t>
242
+ named_attribute_index_[GeometryAttribute::NAMED_ATTRIBUTES_COUNT];
243
+
244
+ // The number of n-dimensional points. All point attribute values are stored
245
+ // in corresponding PointAttribute instances in the |attributes_| array.
246
+ PointIndex::ValueType num_points_;
247
+
248
+ #ifdef DRACO_TRANSCODER_SUPPORTED
249
+ // Compression options for this geometry.
250
+ // TODO(vytyaz): Store encoded bitstream that this geometry compresses into.
251
+ bool compression_enabled_ = false;
252
+ DracoCompressionOptions compression_options_;
253
+ #endif // DRACO_TRANSCODER_SUPPORTED
254
+
255
+ friend struct PointCloudHasher;
256
+ };
257
+
258
+ // Functor for computing a hash from data stored within a point cloud.
259
+ // Note that this can be quite slow. Two point clouds will have the same hash
260
+ // only when all points have the same order and when all attribute values are
261
+ // exactly the same.
262
+ struct PointCloudHasher {
263
+ size_t operator()(const PointCloud &pc) const {
264
+ size_t hash = pc.num_points_;
265
+ hash = HashCombine(pc.attributes_.size(), hash);
266
+ for (int i = 0; i < GeometryAttribute::NAMED_ATTRIBUTES_COUNT; ++i) {
267
+ hash = HashCombine(pc.named_attribute_index_[i].size(), hash);
268
+ for (int j = 0; j < static_cast<int>(pc.named_attribute_index_[i].size());
269
+ ++j) {
270
+ hash = HashCombine(pc.named_attribute_index_[i][j], hash);
271
+ }
272
+ }
273
+ // Hash attributes.
274
+ for (int i = 0; i < static_cast<int>(pc.attributes_.size()); ++i) {
275
+ PointAttributeHasher att_hasher;
276
+ hash = HashCombine(att_hasher(*pc.attributes_[i]), hash);
277
+ }
278
+ // Hash metadata.
279
+ GeometryMetadataHasher metadata_hasher;
280
+ if (pc.metadata_) {
281
+ hash = HashCombine(metadata_hasher(*pc.metadata_), hash);
282
+ }
283
+ return hash;
284
+ }
285
+ };
286
+
287
+ } // namespace draco
288
+
289
+ #endif // DRACO_POINT_CLOUD_POINT_CLOUD_H_
@@ -0,0 +1,101 @@
1
+ // Copyright 2016 The Draco Authors.
2
+ //
3
+ // Licensed under the Apache License, Version 2.0 (the "License");
4
+ // you may not use this file except in compliance with the License.
5
+ // You may obtain a copy of the License at
6
+ //
7
+ // http://www.apache.org/licenses/LICENSE-2.0
8
+ //
9
+ // Unless required by applicable law or agreed to in writing, software
10
+ // distributed under the License is distributed on an "AS IS" BASIS,
11
+ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ // See the License for the specific language governing permissions and
13
+ // limitations under the License.
14
+ //
15
+ #ifndef DRACO_POINT_CLOUD_POINT_CLOUD_BUILDER_H_
16
+ #define DRACO_POINT_CLOUD_POINT_CLOUD_BUILDER_H_
17
+
18
+ #include <utility>
19
+
20
+ #include "draco/point_cloud/point_cloud.h"
21
+
22
+ namespace draco {
23
+
24
+ // A helper class for constructing PointCloud instances from other data sources.
25
+ // Usage:
26
+ // PointCloudBuilder builder;
27
+ // // Initialize the builder for a given number of points (required).
28
+ // builder.Start(num_points);
29
+ // // Specify desired attributes.
30
+ // int pos_att_id =
31
+ // builder.AddAttribute(GeometryAttribute::POSITION, 3, DT_FLOAT32);
32
+ // // Add attribute values.
33
+ // for (PointIndex i(0); i < num_points; ++i) {
34
+ // builder.SetAttributeValueForPoint(pos_att_id, i, input_pos[i.value()]);
35
+ // }
36
+ // // Get the final PointCloud.
37
+ // constexpr bool deduplicate_points = false;
38
+ // std::unique_ptr<PointCloud> pc = builder.Finalize(deduplicate_points);
39
+
40
+ class PointCloudBuilder {
41
+ public:
42
+ // Index type of the inserted element.
43
+ typedef PointIndex ElementIndex;
44
+
45
+ PointCloudBuilder();
46
+
47
+ // Starts collecting point cloud data.
48
+ // The behavior of other functions is undefined before this method is called.
49
+ void Start(PointIndex::ValueType num_points);
50
+
51
+ int AddAttribute(GeometryAttribute::Type attribute_type,
52
+ int8_t num_components, DataType data_type);
53
+ int AddAttribute(GeometryAttribute::Type attribute_type,
54
+ int8_t num_components, DataType data_type, bool normalized);
55
+
56
+ // Sets attribute value for a specific point.
57
+ // |attribute_value| must contain data in the format specified by the
58
+ // AddAttribute method.
59
+ void SetAttributeValueForPoint(int att_id, PointIndex point_index,
60
+ const void *attribute_value);
61
+
62
+ // Sets attribute values for all points. All the values must be stored in the
63
+ // input |attribute_values| buffer. |stride| can be used to define the byte
64
+ // offset between two consecutive attribute values. If |stride| is set to 0,
65
+ // the stride is automatically computed based on the format of the given
66
+ // attribute.
67
+ void SetAttributeValuesForAllPoints(int att_id, const void *attribute_values,
68
+ int stride);
69
+
70
+ // Sets the unique ID for an attribute created with AddAttribute().
71
+ void SetAttributeUniqueId(int att_id, uint32_t unique_id);
72
+
73
+ #ifdef DRACO_TRANSCODER_SUPPORTED
74
+ // Sets attribute name.
75
+ void SetAttributeName(int att_id, const std::string &name);
76
+ #endif // DRACO_TRANSCODER_SUPPORTED
77
+
78
+ // Finalizes the PointCloud or returns nullptr on error.
79
+ // If |deduplicate_points| is set to true, the following happens:
80
+ // 1. Attribute values with duplicate entries are deduplicated.
81
+ // 2. Point ids that are mapped to the same attribute values are
82
+ // deduplicated.
83
+ // Therefore, if |deduplicate_points| is true the final PointCloud can have
84
+ // a different number of point from the value specified in the Start method.
85
+ // Once this function is called, the builder becomes invalid and cannot be
86
+ // used until the method Start() is called again.
87
+ std::unique_ptr<PointCloud> Finalize(bool deduplicate_points);
88
+
89
+ // Add metadata for an attribute.
90
+ void AddAttributeMetadata(int32_t att_id,
91
+ std::unique_ptr<AttributeMetadata> metadata) {
92
+ point_cloud_->AddAttributeMetadata(att_id, std::move(metadata));
93
+ }
94
+
95
+ private:
96
+ std::unique_ptr<PointCloud> point_cloud_;
97
+ };
98
+
99
+ } // namespace draco
100
+
101
+ #endif // DRACO_POINT_CLOUD_POINT_CLOUD_BUILDER_H_
lib/draco.lib ADDED
Binary file
lib/pkgconfig/draco.pc ADDED
@@ -0,0 +1,6 @@
1
+ Name: draco
2
+ Description: Draco geometry de(com)pression library.
3
+ Version: 1.5.7
4
+ Cflags: -Iinclude
5
+ Libs: -Llib -ldraco
6
+ Libs.private:
@@ -0,0 +1,43 @@
1
+ # This is a basic version file for the Config-mode of find_package().
2
+ # It is used by write_basic_package_version_file() as input file for configure_file()
3
+ # to create a version-file which can be installed along a config.cmake file.
4
+ #
5
+ # The created file sets PACKAGE_VERSION_EXACT if the current version string and
6
+ # the requested version string are exactly the same and it sets
7
+ # PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version.
8
+ # The variable CVF_VERSION must be set before calling configure_file().
9
+
10
+ set(PACKAGE_VERSION "1.5.7")
11
+
12
+ if (PACKAGE_FIND_VERSION_RANGE)
13
+ # Package version must be in the requested version range
14
+ if ((PACKAGE_FIND_VERSION_RANGE_MIN STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MIN)
15
+ OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_GREATER PACKAGE_FIND_VERSION_MAX)
16
+ OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_GREATER_EQUAL PACKAGE_FIND_VERSION_MAX)))
17
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
18
+ else()
19
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
20
+ endif()
21
+ else()
22
+ if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
23
+ set(PACKAGE_VERSION_COMPATIBLE FALSE)
24
+ else()
25
+ set(PACKAGE_VERSION_COMPATIBLE TRUE)
26
+ if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
27
+ set(PACKAGE_VERSION_EXACT TRUE)
28
+ endif()
29
+ endif()
30
+ endif()
31
+
32
+
33
+ # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it:
34
+ if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "")
35
+ return()
36
+ endif()
37
+
38
+ # check that the installed version has the same 32/64bit-ness as the one which is currently searching:
39
+ if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8")
40
+ math(EXPR installedBits "8 * 8")
41
+ set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)")
42
+ set(PACKAGE_VERSION_UNSUITABLE TRUE)
43
+ endif()
@@ -0,0 +1,27 @@
1
+
2
+ ####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() #######
3
+ ####### Any changes to this file will be overwritten by the next CMake run ####
4
+ ####### The input file was draco-config.cmake.template ########
5
+
6
+ get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE)
7
+
8
+ macro(set_and_check _var _file)
9
+ set(${_var} "${_file}")
10
+ if(NOT EXISTS "${_file}")
11
+ message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !")
12
+ endif()
13
+ endmacro()
14
+
15
+ macro(check_required_components _NAME)
16
+ foreach(comp ${${_NAME}_FIND_COMPONENTS})
17
+ if(NOT ${_NAME}_${comp}_FOUND)
18
+ if(${_NAME}_FIND_REQUIRED_${comp})
19
+ set(${_NAME}_FOUND FALSE)
20
+ endif()
21
+ endif()
22
+ endforeach()
23
+ endmacro()
24
+
25
+ ####################################################################################
26
+
27
+ include("${CMAKE_CURRENT_LIST_DIR}/draco-targets.cmake")
@@ -0,0 +1,19 @@
1
+ #----------------------------------------------------------------
2
+ # Generated CMake target import file for configuration "Release".
3
+ #----------------------------------------------------------------
4
+
5
+ # Commands may need to know the format version.
6
+ set(CMAKE_IMPORT_FILE_VERSION 1)
7
+
8
+ # Import target "draco::draco" for configuration "Release"
9
+ set_property(TARGET draco::draco APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
10
+ set_target_properties(draco::draco PROPERTIES
11
+ IMPORTED_LINK_INTERFACE_LANGUAGES_RELEASE "CXX"
12
+ IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib/draco.lib"
13
+ )
14
+
15
+ list(APPEND _cmake_import_check_targets draco::draco )
16
+ list(APPEND _cmake_import_check_files_for_draco::draco "${_IMPORT_PREFIX}/lib/draco.lib" )
17
+
18
+ # Commands beyond this point should not need to know the version.
19
+ set(CMAKE_IMPORT_FILE_VERSION)
@@ -0,0 +1,107 @@
1
+ # Generated by CMake
2
+
3
+ if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8)
4
+ message(FATAL_ERROR "CMake >= 2.8.3 required")
5
+ endif()
6
+ if(CMAKE_VERSION VERSION_LESS "2.8.3")
7
+ message(FATAL_ERROR "CMake >= 2.8.3 required")
8
+ endif()
9
+ cmake_policy(PUSH)
10
+ cmake_policy(VERSION 2.8.3...3.29)
11
+ #----------------------------------------------------------------
12
+ # Generated CMake target import file.
13
+ #----------------------------------------------------------------
14
+
15
+ # Commands may need to know the format version.
16
+ set(CMAKE_IMPORT_FILE_VERSION 1)
17
+
18
+ # Protect against multiple inclusion, which would fail when already imported targets are added once more.
19
+ set(_cmake_targets_defined "")
20
+ set(_cmake_targets_not_defined "")
21
+ set(_cmake_expected_targets "")
22
+ foreach(_cmake_expected_target IN ITEMS draco::draco)
23
+ list(APPEND _cmake_expected_targets "${_cmake_expected_target}")
24
+ if(TARGET "${_cmake_expected_target}")
25
+ list(APPEND _cmake_targets_defined "${_cmake_expected_target}")
26
+ else()
27
+ list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}")
28
+ endif()
29
+ endforeach()
30
+ unset(_cmake_expected_target)
31
+ if(_cmake_targets_defined STREQUAL _cmake_expected_targets)
32
+ unset(_cmake_targets_defined)
33
+ unset(_cmake_targets_not_defined)
34
+ unset(_cmake_expected_targets)
35
+ unset(CMAKE_IMPORT_FILE_VERSION)
36
+ cmake_policy(POP)
37
+ return()
38
+ endif()
39
+ if(NOT _cmake_targets_defined STREQUAL "")
40
+ string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}")
41
+ string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}")
42
+ message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n")
43
+ endif()
44
+ unset(_cmake_targets_defined)
45
+ unset(_cmake_targets_not_defined)
46
+ unset(_cmake_expected_targets)
47
+
48
+
49
+ # Compute the installation prefix relative to this file.
50
+ get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
51
+ get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
52
+ get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
53
+ get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH)
54
+ if(_IMPORT_PREFIX STREQUAL "/")
55
+ set(_IMPORT_PREFIX "")
56
+ endif()
57
+
58
+ # Create imported target draco::draco
59
+ add_library(draco::draco STATIC IMPORTED)
60
+
61
+ set_target_properties(draco::draco PROPERTIES
62
+ INTERFACE_COMPILE_FEATURES "cxx_std_11"
63
+ INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
64
+ )
65
+
66
+ # Load information for each installed configuration.
67
+ file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/draco-targets-*.cmake")
68
+ foreach(_cmake_config_file IN LISTS _cmake_config_files)
69
+ include("${_cmake_config_file}")
70
+ endforeach()
71
+ unset(_cmake_config_file)
72
+ unset(_cmake_config_files)
73
+
74
+ # Cleanup temporary variables.
75
+ set(_IMPORT_PREFIX)
76
+
77
+ # Loop over all imported files and verify that they actually exist
78
+ foreach(_cmake_target IN LISTS _cmake_import_check_targets)
79
+ if(CMAKE_VERSION VERSION_LESS "3.28"
80
+ OR NOT DEFINED _cmake_import_check_xcframework_for_${_cmake_target}
81
+ OR NOT IS_DIRECTORY "${_cmake_import_check_xcframework_for_${_cmake_target}}")
82
+ foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}")
83
+ if(NOT EXISTS "${_cmake_file}")
84
+ message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file
85
+ \"${_cmake_file}\"
86
+ but this file does not exist. Possible reasons include:
87
+ * The file was deleted, renamed, or moved to another location.
88
+ * An install or uninstall procedure did not complete successfully.
89
+ * The installation package was faulty and contained
90
+ \"${CMAKE_CURRENT_LIST_FILE}\"
91
+ but not all the files it references.
92
+ ")
93
+ endif()
94
+ endforeach()
95
+ endif()
96
+ unset(_cmake_file)
97
+ unset("_cmake_import_check_files_for_${_cmake_target}")
98
+ endforeach()
99
+ unset(_cmake_target)
100
+ unset(_cmake_import_check_targets)
101
+
102
+ # This file does not depend on other imported targets which have
103
+ # been exported from the same project but in a separate export set.
104
+
105
+ # Commands beyond this point should not need to know the version.
106
+ set(CMAKE_IMPORT_FILE_VERSION)
107
+ cmake_policy(POP)