diff --git a/dart/dynamics/BallJoint.h b/dart/dynamics/BallJoint.h index c40cb00ce2a79..f238903fe0bf2 100644 --- a/dart/dynamics/BallJoint.h +++ b/dart/dynamics/BallJoint.h @@ -65,7 +65,7 @@ class BallJoint : public MultiDofJoint<3> virtual ~BallJoint(); // Documentation inherited - const std::string& getType() const override; + virtual const std::string& getType() const override; /// Get joint type for this class static const std::string& getStaticType(); diff --git a/dart/dynamics/EulerJoint.h b/dart/dynamics/EulerJoint.h index 3859a109fb78b..a9df7c704d5b1 100644 --- a/dart/dynamics/EulerJoint.h +++ b/dart/dynamics/EulerJoint.h @@ -103,7 +103,7 @@ class EulerJoint : public MultiDofJoint<3> EulerJoint& operator=(const EulerJoint& _otherJoint); // Documentation inherited - const std::string& getType() const override; + virtual const std::string& getType() const override; /// Get joint type for this class static const std::string& getStaticType(); diff --git a/dart/dynamics/FreeJoint.h b/dart/dynamics/FreeJoint.h index 0590edfc4c886..119e2d1946a53 100644 --- a/dart/dynamics/FreeJoint.h +++ b/dart/dynamics/FreeJoint.h @@ -70,7 +70,7 @@ class FreeJoint : public MultiDofJoint<6> Properties getFreeJointProperties() const; // Documentation inherited - const std::string& getType() const override; + virtual const std::string& getType() const override; /// Get joint type for this class static const std::string& getStaticType(); diff --git a/dart/dynamics/Joint.h b/dart/dynamics/Joint.h index 04fa197794a8f..26f4f8f59059d 100644 --- a/dart/dynamics/Joint.h +++ b/dart/dynamics/Joint.h @@ -184,6 +184,9 @@ class Joint : public virtual common::Subject /// Get joint name const std::string& getName() const; + /// Gets a string representing the joint type + virtual const std::string& getType() const = 0; + /// Set actuator type void setActuatorType(ActuatorType _actuatorType); diff --git a/dart/dynamics/MultiDofJoint.h b/dart/dynamics/MultiDofJoint.h index 56e5911614a0a..f5c1d9c1d7de2 100644 --- a/dart/dynamics/MultiDofJoint.h +++ b/dart/dynamics/MultiDofJoint.h @@ -945,21 +945,6 @@ MultiDofJoint& MultiDofJoint::operator=( return *this; } -//============================================================================== -template -const std::string& MultiDofJoint::getType() const -{ - return getStaticType(); -} - -template -const std::string& MultiDofJoint::getStaticType() -{ - static const std::string name = "MultiDofJoint<" + std::to_string(DOF) + ">"; - - return name; -} - //============================================================================== template DegreeOfFreedom* MultiDofJoint::getDof(size_t _index) diff --git a/dart/dynamics/PlanarJoint.h b/dart/dynamics/PlanarJoint.h index b11476c34d5fc..783b68f4aa69f 100644 --- a/dart/dynamics/PlanarJoint.h +++ b/dart/dynamics/PlanarJoint.h @@ -143,7 +143,7 @@ class PlanarJoint : public MultiDofJoint<3> PlanarJoint& operator=(const PlanarJoint& _otherJoint); // Documentation inherited - const std::string& getType() const override; + virtual const std::string& getType() const override; /// Get joint type for this class static const std::string& getStaticType(); diff --git a/dart/dynamics/PrismaticJoint.h b/dart/dynamics/PrismaticJoint.h index 6ea5cdb521945..67a6bb8aa01d3 100644 --- a/dart/dynamics/PrismaticJoint.h +++ b/dart/dynamics/PrismaticJoint.h @@ -97,7 +97,7 @@ class PrismaticJoint : public SingleDofJoint PrismaticJoint& operator=(const PrismaticJoint& _otherJoint); // Documentation inherited - const std::string& getType() const override; + virtual const std::string& getType() const override; /// Get joint type for this class static const std::string& getStaticType(); diff --git a/dart/dynamics/RevoluteJoint.h b/dart/dynamics/RevoluteJoint.h index 3245eec492ecf..3458cedb03829 100644 --- a/dart/dynamics/RevoluteJoint.h +++ b/dart/dynamics/RevoluteJoint.h @@ -97,7 +97,7 @@ class RevoluteJoint : public SingleDofJoint RevoluteJoint& operator=(const RevoluteJoint& _otherJoint); // Documentation inherited - const std::string& getType() const override; + virtual const std::string& getType() const override; /// Get joint type for this class static const std::string& getStaticType(); diff --git a/dart/dynamics/ScrewJoint.h b/dart/dynamics/ScrewJoint.h index 929d2027392dc..f76736fe7a000 100644 --- a/dart/dynamics/ScrewJoint.h +++ b/dart/dynamics/ScrewJoint.h @@ -103,7 +103,7 @@ class ScrewJoint : public SingleDofJoint ScrewJoint& operator=(const ScrewJoint& _otherJoint); // Documentation inherited - const std::string& getType() const override; + virtual const std::string& getType() const override; /// Get joint type for this class static const std::string& getStaticType(); diff --git a/dart/dynamics/TranslationalJoint.h b/dart/dynamics/TranslationalJoint.h index 05a1f1d5dd7c0..55b30894c1c3f 100644 --- a/dart/dynamics/TranslationalJoint.h +++ b/dart/dynamics/TranslationalJoint.h @@ -68,7 +68,7 @@ class TranslationalJoint : public MultiDofJoint<3> Properties getTranslationalJointProperties() const; // Documentation inherited - const std::string& getType() const override; + virtual const std::string& getType() const override; /// Get joint type for this class static const std::string& getStaticType(); diff --git a/dart/dynamics/UniversalJoint.h b/dart/dynamics/UniversalJoint.h index 278381a31d3f4..f5a4993d802c4 100644 --- a/dart/dynamics/UniversalJoint.h +++ b/dart/dynamics/UniversalJoint.h @@ -98,7 +98,7 @@ class UniversalJoint : public MultiDofJoint<2> UniversalJoint& operator=(const UniversalJoint& _otherJoint); // Documentation inherited - const std::string& getType() const override; + virtual const std::string& getType() const override; /// Get joint type for this class static const std::string& getStaticType(); diff --git a/dart/dynamics/WeldJoint.h b/dart/dynamics/WeldJoint.h index a43c6ba25a86e..168b1d1dd345b 100644 --- a/dart/dynamics/WeldJoint.h +++ b/dart/dynamics/WeldJoint.h @@ -69,7 +69,7 @@ class WeldJoint : public ZeroDofJoint Properties getWeldJointProperties() const; // Documentation inherited - const std::string& getType() const override; + virtual const std::string& getType() const override; /// Get joint type for this class static const std::string& getStaticType();