Return the string representation of the shape
| 213 | |
| 214 | // Return the string representation of the shape |
| 215 | std::string ConvexMeshShape::to_string() const { |
| 216 | |
| 217 | std::stringstream ss; |
| 218 | ss << "ConvexMeshShape{" << std::endl; |
| 219 | ss << "nbVertices=" << mConvexMesh->getNbVertices() << std::endl; |
| 220 | ss << "nbFaces=" << mConvexMesh->getNbFaces() << std::endl; |
| 221 | |
| 222 | ss << "vertices=["; |
| 223 | |
| 224 | for (uint32 v=0; v < mConvexMesh->getNbVertices(); v++) { |
| 225 | |
| 226 | const Vector3& vertex = mConvexMesh->getVertex(v); |
| 227 | ss << vertex.to_string(); |
| 228 | if (v != mConvexMesh->getNbVertices() - 1) { |
| 229 | ss << ", "; |
| 230 | } |
| 231 | } |
| 232 | |
| 233 | ss << "], faces=["; |
| 234 | |
| 235 | HalfEdgeStructure halfEdgeStruct = mConvexMesh->getHalfEdgeStructure(); |
| 236 | for (uint32 f=0; f < mConvexMesh->getNbFaces(); f++) { |
| 237 | |
| 238 | const HalfEdgeStructure::Face& face = halfEdgeStruct.getFace(f); |
| 239 | |
| 240 | ss << "["; |
| 241 | |
| 242 | for (uint32 v=0; v < face.faceVertices.size(); v++) { |
| 243 | |
| 244 | ss << face.faceVertices[v]; |
| 245 | if (v != face.faceVertices.size() - 1) { |
| 246 | ss << ","; |
| 247 | } |
| 248 | } |
| 249 | |
| 250 | ss << "]"; |
| 251 | } |
| 252 | |
| 253 | ss << "]}"; |
| 254 | |
| 255 | return ss.str(); |
| 256 | } |
| 257 |
nothing calls this directly
no test coverage detected