GameApi 28
Library used by GameApi Builder tool
Loading...
Searching...
No Matches
point_cloud_types.h
Go to the documentation of this file.
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_COMPRESSION_POINT_CLOUD_ALGORITHMS_POINT_CLOUD_TYPES_H_
16#define DRACO_COMPRESSION_POINT_CLOUD_ALGORITHMS_POINT_CLOUD_TYPES_H_
17
18#include <inttypes.h>
19
20#include <vector>
21
22#include "draco/core/vector_d.h"
23
24namespace draco {
25
26// Using Eigen as this is favored by project Cartographer.
34
35typedef std::vector<Point3f> PointCloud3f;
36
37template <class PointDT>
39
40template <class CoeffT, int dimension_t>
41struct PointDLess<VectorD<CoeffT, dimension_t>> {
43 const VectorD<CoeffT, dimension_t> &b) const {
44 return a < b;
45 }
46};
47
48template <class PointDT>
49class PointTraits {};
50
51template <class CoordinateTypeT, int dimension_t>
52class PointTraits<VectorD<CoordinateTypeT, dimension_t>> {
53 public:
55 typedef CoordinateTypeT CoordinateType;
56
57 static constexpr uint32_t Dimension() { return dimension_t; }
58 static PointD Origin() {
59 PointD origin;
60 for (uint32_t i = 0; i < dimension_t; i++) {
61 origin(i) = 0;
62 }
63 return origin;
64 }
65 static std::array<uint32_t, dimension_t> ZeroArray() {
66 std::array<uint32_t, dimension_t> zero;
67 for (uint32_t i = 0; i < dimension_t; i++) {
68 zero[i] = 0;
69 }
70 return zero;
71 }
72};
73
74} // namespace draco
75
76#endif // DRACO_COMPRESSION_POINT_CLOUD_ALGORITHMS_POINT_CLOUD_TYPES_H_
static std::array< uint32_t, dimension_t > ZeroArray()
Definition point_cloud_types.h:65
VectorD< CoordinateTypeT, dimension_t > PointD
Definition point_cloud_types.h:54
static constexpr uint32_t Dimension()
Definition point_cloud_types.h:57
CoordinateTypeT CoordinateType
Definition point_cloud_types.h:55
static PointD Origin()
Definition point_cloud_types.h:58
Definition point_cloud_types.h:49
Definition vector_d.h:30
Definition attribute_octahedron_transform.cc:21
Vector4f Point4f
Definition point_cloud_types.h:28
Vector5ui Point5ui
Definition point_cloud_types.h:31
Vector7ui Point7ui
Definition point_cloud_types.h:33
VectorD< uint32_t, 5 > Vector5ui
Definition vector_d.h:349
VectorD< float, 3 > Vector3f
Definition vector_d.h:340
VectorD< uint32_t, 7 > Vector7ui
Definition vector_d.h:351
Vector4ui Point4ui
Definition point_cloud_types.h:30
Vector3ui Point3ui
Definition point_cloud_types.h:29
VectorD< uint32_t, 6 > Vector6ui
Definition vector_d.h:350
VectorD< uint32_t, 3 > Vector3ui
Definition vector_d.h:347
Vector6ui Point6ui
Definition point_cloud_types.h:32
VectorD< uint32_t, 4 > Vector4ui
Definition vector_d.h:348
std::vector< Point3f > PointCloud3f
Definition point_cloud_types.h:35
Vector3f Point3f
Definition point_cloud_types.h:27
VectorD< float, 4 > Vector4f
Definition vector_d.h:341
bool operator()(const VectorD< CoeffT, dimension_t > &a, const VectorD< CoeffT, dimension_t > &b) const
Definition point_cloud_types.h:42
Definition point_cloud_types.h:38