Changeset View
Changeset View
Standalone View
Standalone View
extern/draco/draco/src/draco/mesh/mesh_stripifier.cc
- This file was moved from extern/draco/dracoenc/src/draco/mesh/mesh_stripifier.cc.
| Show All 35 Lines | if (pass == 1) { | ||||
| // / \ / \C / \ / | // / \ / \C / \ / | ||||
| // / \ / \ / \ / | // / \ / \ / \ / | ||||
| // / \ / B\ / \ / | // / \ / B\ / \ / | ||||
| // *-------*-------*-------* | // *-------*-------*-------* | ||||
| // | // | ||||
| // Perform the backward pass only when there is no attribute seam between | // Perform the backward pass only when there is no attribute seam between | ||||
| // the initial face and the first face of the backward traversal. | // the initial face and the first face of the backward traversal. | ||||
| if (GetOppositeCorner(corner_table_->Previous(start_ci)) == | if (GetOppositeCorner(corner_table_->Previous(start_ci)) == | ||||
| kInvalidCornerIndex) | kInvalidCornerIndex) { | ||||
| break; // Attribute seam or a boundary. | break; // Attribute seam or a boundary. | ||||
| } | |||||
| ci = corner_table_->Next(start_ci); | ci = corner_table_->Next(start_ci); | ||||
| ci = corner_table_->SwingLeft(ci); | ci = corner_table_->SwingLeft(ci); | ||||
| if (ci == kInvalidCornerIndex) | if (ci == kInvalidCornerIndex) { | ||||
| break; | break; | ||||
| } | |||||
| fi = corner_table_->Face(ci); | fi = corner_table_->Face(ci); | ||||
| } | } | ||||
| int num_added_faces = 0; | int num_added_faces = 0; | ||||
| while (!is_face_visited_[fi]) { | while (!is_face_visited_[fi]) { | ||||
| is_face_visited_[fi] = true; | is_face_visited_[fi] = true; | ||||
| strip_faces_[local_strip_id].push_back(fi); | strip_faces_[local_strip_id].push_back(fi); | ||||
| ++num_added_faces; | ++num_added_faces; | ||||
| Show All 10 Lines | while (!is_face_visited_[fi]) { | ||||
| // for start of the strip as the strips would start in a wrong | // for start of the strip as the strips would start in a wrong | ||||
| // direction). | // direction). | ||||
| start_ci = ci; | start_ci = ci; | ||||
| } | } | ||||
| ci = corner_table_->Previous(ci); | ci = corner_table_->Previous(ci); | ||||
| } | } | ||||
| } | } | ||||
| ci = GetOppositeCorner(ci); | ci = GetOppositeCorner(ci); | ||||
| if (ci == kInvalidCornerIndex) | if (ci == kInvalidCornerIndex) { | ||||
| break; | break; | ||||
| } | |||||
| fi = corner_table_->Face(ci); | fi = corner_table_->Face(ci); | ||||
| } | } | ||||
| // Strip end reached. | // Strip end reached. | ||||
| if (pass == 1 && (num_added_faces & 1)) { | if (pass == 1 && (num_added_faces & 1)) { | ||||
| // If we processed the backward strip and we add an odd number of faces to | // If we processed the backward strip and we add an odd number of faces to | ||||
| // the strip, we need to remove the last one as it cannot be used to start | // the strip, we need to remove the last one as it cannot be used to start | ||||
| // the strip (the strip would start in a wrong direction from that face). | // the strip (the strip would start in a wrong direction from that face). | ||||
| is_face_visited_[strip_faces_[local_strip_id].back()] = false; | is_face_visited_[strip_faces_[local_strip_id].back()] = false; | ||||
| Show All 13 Lines | |||||