15#ifndef DRACO_COMPRESSION_MESH_TRAVERSER_MESH_TRAVERSAL_SEQUENCER_H_
16#define DRACO_COMPRESSION_MESH_TRAVERSER_MESH_TRAVERSAL_SEQUENCER_H_
29template <
class TraverserT>
34 : mesh_(mesh), encoding_data_(encoding_data), corner_order_(nullptr) {}
45 corner_order_ = &corner_order;
49 const auto *corner_table = traverser_.corner_table();
51 const size_t num_faces = mesh_->num_faces();
52 const size_t num_points = mesh_->num_points();
54 const auto &face = mesh_->face(
f);
55 for (
int p = 0; p < 3; ++p) {
59 if (vert_id == kInvalidVertexIndex) {
62 const AttributeValueIndex att_entry_id(
64 ->vertex_to_encoded_attribute_value_index_map[vert_id.value()]);
65 if (point_id >= num_points || att_entry_id.value() >= num_points) {
79 out_point_ids()->reserve(traverser_.corner_table()->num_vertices());
81 traverser_.OnTraversalStart();
83 for (uint32_t i = 0; i < corner_order_->size(); ++i) {
84 if (!ProcessCorner(corner_order_->at(i))) {
89 const int32_t num_faces = traverser_.corner_table()->num_faces();
90 for (
int i = 0; i < num_faces; ++i) {
96 traverser_.OnTraversalEnd();
102 return traverser_.TraverseFromCorner(corner_id);
105 TraverserT traverser_;
107 const MeshAttributeIndicesEncodingData *encoding_data_;
108 const std::vector<CornerIndex> *corner_order_;
Definition Effect.hh:11256
void SetCornerOrder(const std::vector< CornerIndex > &corner_order)
Definition mesh_traversal_sequencer.h:44
bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override
Definition mesh_traversal_sequencer.h:48
void SetTraverser(const TraverserT &t)
Definition mesh_traversal_sequencer.h:35
bool GenerateSequenceInternal() override
Definition mesh_traversal_sequencer.h:76
MeshTraversalSequencer(const Mesh *mesh, const MeshAttributeIndicesEncodingData *encoding_data)
Definition mesh_traversal_sequencer.h:32
Definition point_attribute.h:33
void SetPointMapEntry(PointIndex point_index, AttributeValueIndex entry_index)
Definition point_attribute.h:100
void SetExplicitMapping(size_t num_points)
Definition point_attribute.h:94
std::vector< PointIndex > * out_point_ids() const
Definition points_sequencer.h:55
PointsSequencer()
Definition points_sequencer.h:29
Definition attribute_octahedron_transform.cc:21
VertexIndex VertexIndex
Definition mesh_edgebreaker_encoder_impl.cc:37
CornerIndex CornerIndex
Definition mesh_edgebreaker_encoder_impl.cc:35
FaceIndex FaceIndex
Definition mesh_edgebreaker_encoder_impl.cc:36
double f(const std::string &, double, bool) noexcept
Definition profile_cpp_calls_2.cpp:4
Definition GameApi_pl.cc:29382
Definition mesh_attribute_indices_encoding_data.h:27