GameApi 28
Library used by GameApi Builder tool
Loading...
Searching...
No Matches
linear_sequencer.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_LINEAR_SEQUENCER_H_
16#define DRACO_COMPRESSION_ATTRIBUTES_LINEAR_SEQUENCER_H_
17
19
20namespace draco {
21
22// A simple sequencer that generates a linear sequence [0, num_points - 1].
23// I.e., the order of the points is preserved for the input data.
25 public:
26 explicit LinearSequencer(int32_t num_points) : num_points_(num_points) {}
27
29 attribute->SetIdentityMapping();
30 return true;
31 }
32
33 protected:
34 bool GenerateSequenceInternal() override {
35 if (num_points_ < 0) {
36 return false;
37 }
38 out_point_ids()->resize(num_points_);
39 for (int i = 0; i < num_points_; ++i) {
40 out_point_ids()->at(i) = PointIndex(i);
41 }
42 return true;
43 }
44
45 private:
46 int32_t num_points_;
47};
48
49} // namespace draco
50
51#endif // DRACO_COMPRESSION_ATTRIBUTES_LINEAR_SEQUENCER_H_
bool UpdatePointToAttributeIndexMapping(PointAttribute *attribute) override
Definition linear_sequencer.h:28
bool GenerateSequenceInternal() override
Definition linear_sequencer.h:34
LinearSequencer(int32_t num_points)
Definition linear_sequencer.h:26
Definition point_attribute.h:33
void SetIdentityMapping()
Definition point_attribute.h:88
std::vector< PointIndex > * out_point_ids() const
Definition points_sequencer.h:55
PointsSequencer()
Definition points_sequencer.h:29
Definition attribute_octahedron_transform.cc:21
Definition GameApi_pl.cc:29382