Return a string representation of the half-edge structure
| 381 | |
| 382 | // Return a string representation of the half-edge structure |
| 383 | std::string QHHalfEdgeStructure::to_string() const { |
| 384 | |
| 385 | std::string faces = "Faces{"; |
| 386 | for (const Face* face = mFaces; face != nullptr; face = face->nextFace) { |
| 387 | |
| 388 | faces += "Face =" + face->verticesString(); |
| 389 | |
| 390 | if (face->nextFace != nullptr) { |
| 391 | faces += ","; |
| 392 | } |
| 393 | } |
| 394 | |
| 395 | faces += "}"; |
| 396 | |
| 397 | std::string edges = "Edges{"; |
| 398 | for (const Edge* edge = mHalfEdges; edge != nullptr; edge = edge->nextEdge) { |
| 399 | |
| 400 | edges += "Edge("; |
| 401 | |
| 402 | edges += std::to_string(edge->startVertex->externalIndex) + "," + std::to_string(edge->endVertex->externalIndex) + ")"; |
| 403 | |
| 404 | if (edge->nextEdge != nullptr) { |
| 405 | edges += ","; |
| 406 | } |
| 407 | } |
| 408 | |
| 409 | std::string vertices = "Vertices{"; |
| 410 | for (const Vertex* vertex = mVertices; vertex != nullptr; vertex = vertex->nextVertex) { |
| 411 | |
| 412 | vertices += std::to_string(vertex->externalIndex); |
| 413 | |
| 414 | if (vertex->nextVertex != nullptr) { |
| 415 | vertices += ","; |
| 416 | } |
| 417 | } |
| 418 | return "HalfEdgeStructure(" + faces + ",\n" + edges + ",\n" + vertices + ")"; |
| 419 | } |
nothing calls this directly
no test coverage detected