Changeset View
Changeset View
Standalone View
Standalone View
extern/draco/draco/src/draco/mesh/corner_table_iterators.h
- This file was moved from extern/draco/dracoenc/src/draco/mesh/corner_table_iterators.h.
| Show All 39 Lines | public: | ||||
| // Gets the last visited ring vertex. | // Gets the last visited ring vertex. | ||||
| VertexIndex Vertex() const { | VertexIndex Vertex() const { | ||||
| CornerIndex ring_corner = left_traversal_ ? corner_table_->Previous(corner_) | CornerIndex ring_corner = left_traversal_ ? corner_table_->Previous(corner_) | ||||
| : corner_table_->Next(corner_); | : corner_table_->Next(corner_); | ||||
| return corner_table_->Vertex(ring_corner); | return corner_table_->Vertex(ring_corner); | ||||
| } | } | ||||
| // Returns one of the corners opposite to the edge connecting the currently | |||||
| // iterated ring vertex with the central vertex. | |||||
| CornerIndex EdgeCorner() const { | |||||
| return left_traversal_ ? corner_table_->Next(corner_) | |||||
| : corner_table_->Previous(corner_); | |||||
| } | |||||
| // Returns true when all ring vertices have been visited. | // Returns true when all ring vertices have been visited. | ||||
| bool End() const { return corner_ == kInvalidCornerIndex; } | bool End() const { return corner_ == kInvalidCornerIndex; } | ||||
| // Proceeds to the next ring vertex if possible. | // Proceeds to the next ring vertex if possible. | ||||
| void Next() { | void Next() { | ||||
| if (left_traversal_) { | if (left_traversal_) { | ||||
| corner_ = corner_table_->SwingLeft(corner_); | corner_ = corner_table_->SwingLeft(corner_); | ||||
| if (corner_ == kInvalidCornerIndex) { | if (corner_ == kInvalidCornerIndex) { | ||||
| ▲ Show 20 Lines • Show All 59 Lines • ▼ Show 20 Lines | public: | ||||
| // Create the iterator from the provided corner table and the central vertex. | // Create the iterator from the provided corner table and the central vertex. | ||||
| FaceAdjacencyIterator(const CornerTableT *table, FaceIndex face_id) | FaceAdjacencyIterator(const CornerTableT *table, FaceIndex face_id) | ||||
| : corner_table_(table), | : corner_table_(table), | ||||
| start_corner_(table->FirstCorner(face_id)), | start_corner_(table->FirstCorner(face_id)), | ||||
| corner_(start_corner_) { | corner_(start_corner_) { | ||||
| // We need to start with a corner that has a valid opposite face (if | // We need to start with a corner that has a valid opposite face (if | ||||
| // there is any such corner). | // there is any such corner). | ||||
| if (corner_table_->Opposite(corner_) == kInvalidCornerIndex) | if (corner_table_->Opposite(corner_) == kInvalidCornerIndex) { | ||||
| FindNextFaceNeighbor(); | FindNextFaceNeighbor(); | ||||
| } | } | ||||
| } | |||||
| // Gets the last visited adjacent face. | // Gets the last visited adjacent face. | ||||
| FaceIndex Face() const { | FaceIndex Face() const { | ||||
| return corner_table_->Face(corner_table_->Opposite(corner_)); | return corner_table_->Face(corner_table_->Opposite(corner_)); | ||||
| } | } | ||||
| // Returns true when all adjacent faces have been visited. | // Returns true when all adjacent faces have been visited. | ||||
| bool End() const { return corner_ == kInvalidCornerIndex; } | bool End() const { return corner_ == kInvalidCornerIndex; } | ||||
| ▲ Show 20 Lines • Show All 148 Lines • Show Last 20 Lines | |||||