| 79 | } |
| 80 | |
| 81 | point_count_t ObjReader::read(PointViewPtr view, point_count_t cnt) |
| 82 | { |
| 83 | m_mesh = view->createMesh("obj"); |
| 84 | if (!m_mesh) |
| 85 | { |
| 86 | throwError("Failed to create mesh"); |
| 87 | } |
| 88 | |
| 89 | while (true) |
| 90 | { |
| 91 | FACE face; |
| 92 | if (!readFace(face, view)) |
| 93 | break; |
| 94 | |
| 95 | auto triangles = triangulate(face); |
| 96 | for(const auto& tri : triangles) { |
| 97 | newTriangle(view, tri); |
| 98 | } |
| 99 | } |
| 100 | return m_index; |
| 101 | } |
| 102 | |
| 103 | void ObjReader::newTriangle(PointViewPtr view, TRI tri) |
| 104 | { |
nothing calls this directly
no test coverage detected