MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / to_string

Method to_string

src/utils/quickhull/QHHalfEdgeStructure.cpp:383–419  ·  view source on GitHub ↗

Return a string representation of the half-edge structure

Source from the content-addressed store, hash-verified

381
382// Return a string representation of the half-edge structure
383std::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}

Callers

nothing calls this directly

Calls 1

verticesStringMethod · 0.80

Tested by

no test coverage detected