Commit ee000a8a authored by Pierre Fernbach's avatar Pierre Fernbach
Browse files

Rename ContactType enum: prefix CONTACT_ to all values

parent 6140805e
......@@ -20,10 +20,10 @@ struct ContactModelTpl : public serialization::Serializable<ContactModelTpl<_Sca
typedef _Scalar Scalar;
/// \brief Default constructor.
ContactModelTpl() : m_mu(-1.), m_contact_type(ContactType::UNDEFINED) {}
ContactModelTpl() : m_mu(-1.), m_contact_type(ContactType::CONTACT_UNDEFINED) {}
/// \brief Constructor with friction
ContactModelTpl(const Scalar mu) : m_mu(mu), m_contact_type(ContactType::UNDEFINED) {}
ContactModelTpl(const Scalar mu) : m_mu(mu), m_contact_type(ContactType::CONTACT_UNDEFINED) {}
/// \brief Full constructor
ContactModelTpl(const Scalar mu, const ContactType contact_type) : m_mu(mu), m_contact_type(contact_type) {}
......
......@@ -29,7 +29,7 @@ template <typename Scalar>
struct ContactModelTpl;
typedef ContactModelTpl<double> ContactModel;
enum ContactType { UNDEFINED, PLANAR, POINT };
enum ContactType { CONTACT_UNDEFINED, CONTACT_PLANAR, CONTACT_POINT };
enum ConicType { CONIC_SOWC, CONIC_DOUBLE_DESCRIPTION, CONIC_UNDEFINED };
} // namespace scenario
......
......@@ -342,24 +342,24 @@ BOOST_AUTO_TEST_SUITE(BOOST_TEST_MODULE)
BOOST_AUTO_TEST_CASE(contact_model) {
ContactModel mp;
BOOST_CHECK(mp.m_mu == -1.);
BOOST_CHECK(mp.m_contact_type == ContactType::UNDEFINED);
BOOST_CHECK(mp.m_contact_type == ContactType::CONTACT_UNDEFINED);
const double mu = 0.3;
ContactModel mp_mu(mu);
BOOST_CHECK(mp_mu.m_mu == mu);
BOOST_CHECK(mp_mu.m_contact_type == ContactType::UNDEFINED);
BOOST_CHECK(mp_mu.m_contact_type == ContactType::CONTACT_UNDEFINED);
ContactModel mp1(mu, ContactType::PLANAR);
ContactModel mp1(mu, ContactType::CONTACT_PLANAR);
ContactModel mp2(mp1);
BOOST_CHECK(mp1.m_mu == mu);
BOOST_CHECK(mp1.m_contact_type == ContactType::PLANAR);
BOOST_CHECK(mp1.m_contact_type == ContactType::CONTACT_PLANAR);
BOOST_CHECK(mp1 == mp2);
mp1.m_mu = 0.5;
BOOST_CHECK(mp1 != mp2);
ContactModel mp3(mp1);
BOOST_CHECK(mp1 == mp3);
mp3.m_contact_type = ContactType::POINT;
mp3.m_contact_type = ContactType::CONTACT_POINT;
BOOST_CHECK(mp1 != mp3);
std::string fileName("fileTest_contactModel");
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment