GameApi 28
Library used by GameApi Builder tool
Loading...
Searching...
No Matches
mesh_prediction_scheme_data.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_ATTRIBUTES_PREDICTION_SCHEMES_MESH_PREDICTION_SCHEME_DATA_H_
16#define DRACO_COMPRESSION_ATTRIBUTES_PREDICTION_SCHEMES_MESH_PREDICTION_SCHEME_DATA_H_
17
19#include "draco/mesh/mesh.h"
20
21namespace draco {
22
23// Class stores data about the connectivity data of the mesh and information
24// about how the connectivity was encoded/decoded.
25template <class CornerTableT>
27 public:
28 typedef CornerTableT CornerTable;
30 : mesh_(nullptr),
31 corner_table_(nullptr),
32 vertex_to_data_map_(nullptr),
33 data_to_corner_map_(nullptr) {}
34
35 void Set(const Mesh *mesh, const CornerTable *table,
36 const std::vector<CornerIndex> *data_to_corner_map,
37 const std::vector<int32_t> *vertex_to_data_map) {
38 mesh_ = mesh;
39 corner_table_ = table;
40 data_to_corner_map_ = data_to_corner_map;
41 vertex_to_data_map_ = vertex_to_data_map;
42 }
43
44 const Mesh *mesh() const { return mesh_; }
45 const CornerTable *corner_table() const { return corner_table_; }
46 const std::vector<int32_t> *vertex_to_data_map() const {
47 return vertex_to_data_map_;
48 }
49 const std::vector<CornerIndex> *data_to_corner_map() const {
50 return data_to_corner_map_;
51 }
52 bool IsInitialized() const {
53 return mesh_ != nullptr && corner_table_ != nullptr &&
54 vertex_to_data_map_ != nullptr && data_to_corner_map_ != nullptr;
55 }
56
57 private:
58 const Mesh *mesh_;
59 const CornerTable *corner_table_;
60
61 // Mapping between vertices and their encoding order. I.e. when an attribute
62 // entry on a given vertex was encoded.
63 const std::vector<int32_t> *vertex_to_data_map_;
64
65 // Array that stores which corner was processed when a given attribute entry
66 // was encoded or decoded.
67 const std::vector<CornerIndex> *data_to_corner_map_;
68};
69
70} // namespace draco
71
72#endif // DRACO_COMPRESSION_ATTRIBUTES_PREDICTION_SCHEMES_MESH_PREDICTION_SCHEME_DATA_H_
Definition corner_table.h:53
MeshPredictionSchemeData()
Definition mesh_prediction_scheme_data.h:29
const CornerTable * corner_table() const
Definition mesh_prediction_scheme_data.h:45
const Mesh * mesh() const
Definition mesh_prediction_scheme_data.h:44
const std::vector< CornerIndex > * data_to_corner_map() const
Definition mesh_prediction_scheme_data.h:49
CornerTableT CornerTable
Definition mesh_prediction_scheme_data.h:28
void Set(const Mesh *mesh, const CornerTable *table, const std::vector< CornerIndex > *data_to_corner_map, const std::vector< int32_t > *vertex_to_data_map)
Definition mesh_prediction_scheme_data.h:35
bool IsInitialized() const
Definition mesh_prediction_scheme_data.h:52
const std::vector< int32_t > * vertex_to_data_map() const
Definition mesh_prediction_scheme_data.h:46
Definition mesh.h:52
Definition attribute_octahedron_transform.cc:21