From 1edb9a0a2547ffd0544711c3ac8e17557ae4e61f Mon Sep 17 00:00:00 2001 From: Pariterre Date: Fri, 23 Feb 2024 14:27:35 -0500 Subject: [PATCH] Added hasMesh --- include/RigidBody/Mesh.h | 5 +++++ src/RigidBody/Mesh.cpp | 3 +++ 2 files changed, 8 insertions(+) diff --git a/include/RigidBody/Mesh.h b/include/RigidBody/Mesh.h index 5138711f..9002e833 100644 --- a/include/RigidBody/Mesh.h +++ b/include/RigidBody/Mesh.h @@ -71,6 +71,11 @@ class BIORBD_API Mesh /// utils::Vector3d& color() const; + /// + /// \brief Return if there is a mesh + /// \return If there is a mesh + bool hasMesh() const; + /// /// \brief Add a point to the mesh /// \param node The point to add diff --git a/src/RigidBody/Mesh.cpp b/src/RigidBody/Mesh.cpp index 7bb6ef55..b86cced6 100644 --- a/src/RigidBody/Mesh.cpp +++ b/src/RigidBody/Mesh.cpp @@ -78,6 +78,9 @@ utils::Vector3d &rigidbody::Mesh::color() const return *m_patchColor; } +bool rigidbody::Mesh::hasMesh() const { + return m_vertex->size() > 0; +} void rigidbody::Mesh::addPoint(const utils::Vector3d &node) { m_vertex->push_back(node);