From 78c6e1f1d734d47173b3a7b3d870ac3f6254515d Mon Sep 17 00:00:00 2001 From: Michael Carroll Date: Thu, 10 Mar 2022 14:05:28 -0600 Subject: [PATCH] Remove explicitly-defined copy constructor/operator (#328) Signed-off-by: Michael Carroll --- tpe/lib/src/Shape.cc | 70 -------------------------------------------- tpe/lib/src/Shape.hh | 34 +-------------------- 2 files changed, 1 insertion(+), 103 deletions(-) diff --git a/tpe/lib/src/Shape.cc b/tpe/lib/src/Shape.cc index 6337aebd3..9d58d0a8b 100644 --- a/tpe/lib/src/Shape.cc +++ b/tpe/lib/src/Shape.cc @@ -56,27 +56,6 @@ BoxShape::BoxShape() : Shape() this->type = ShapeType::BOX; } -////////////////////////////////////////////////// -BoxShape::BoxShape(const BoxShape &_other) - : Shape() -{ - *this = _other; -} - -////////////////////////////////////////////////// -BoxShape::~BoxShape() -{ -} - -////////////////////////////////////////////////// -Shape &BoxShape::operator=(const Shape &_other) -{ - auto other = static_cast(&_other); - this->size = other->size; - this->type = ShapeType::BOX; - return *this; -} - ////////////////////////////////////////////////// void BoxShape::SetSize(const math::Vector3d &_size) { @@ -103,22 +82,6 @@ CylinderShape::CylinderShape() : Shape() this->type = ShapeType::CYLINDER; } -////////////////////////////////////////////////// -CylinderShape::CylinderShape(const CylinderShape &_other) - : Shape() -{ - *this = _other; -} - -////////////////////////////////////////////////// -Shape &CylinderShape::operator=(const Shape &_other) -{ - auto other = static_cast(&_other); - this->radius = other->radius; - this->length = other->length; - return *this; -} - ////////////////////////////////////////////////// double CylinderShape::GetRadius() const { @@ -158,21 +121,6 @@ SphereShape::SphereShape() : Shape() this->type = ShapeType::SPHERE; } -////////////////////////////////////////////////// -SphereShape::SphereShape(const SphereShape &_other) - : Shape() -{ - *this = _other; -} - -////////////////////////////////////////////////// -Shape &SphereShape::operator=(const Shape &_other) -{ - auto other = static_cast(&_other); - this->radius = other->radius; - return *this; -} - ////////////////////////////////////////////////// double SphereShape::GetRadius() const { @@ -199,22 +147,6 @@ MeshShape::MeshShape() : Shape() this->type = ShapeType::MESH; } -////////////////////////////////////////////////// -MeshShape::MeshShape(const MeshShape &_other) - : Shape() -{ - *this = _other; -} - -////////////////////////////////////////////////// -Shape &MeshShape::operator=(const Shape &_other) -{ - auto other = static_cast(&_other); - this->scale = other->scale; - this->meshAABB = other->meshAABB; - return *this; -} - ////////////////////////////////////////////////// math::Vector3d MeshShape::GetScale() const { @@ -245,5 +177,3 @@ void MeshShape::UpdateBoundingBox() this->bbox = math::AxisAlignedBox( this->scale * this->meshAABB.Min(), this->scale * this->meshAABB.Max()); } - - diff --git a/tpe/lib/src/Shape.hh b/tpe/lib/src/Shape.hh index d1d7ddc59..8dc54252e 100644 --- a/tpe/lib/src/Shape.hh +++ b/tpe/lib/src/Shape.hh @@ -92,16 +92,8 @@ class IGNITION_PHYSICS_TPELIB_VISIBLE BoxShape : public Shape /// \brief Constructor public: BoxShape(); - /// \brief Copy Constructor - /// \param[in] _other shape to copy from - public: BoxShape(const BoxShape &_other); - /// \brief Destructor - public: ~BoxShape(); - - /// \brief Assignment operator - /// \param[in] _other shape to copy from - public: Shape &operator=(const Shape &_other); + public: ~BoxShape() = default; /// \brief Set size of box /// \param[in] _size Size of box @@ -126,17 +118,9 @@ class IGNITION_PHYSICS_TPELIB_VISIBLE CylinderShape : public Shape /// \brief Constructor public: CylinderShape(); - /// \brief Copy Constructor - /// \param[in] _other shape to copy from - public: CylinderShape(const CylinderShape &_other); - /// \brief Destructor public: ~CylinderShape() = default; - /// \brief Assignment operator - /// \param[in] _other shape to copy from - public: Shape &operator=(const Shape &_other); - /// \brief Get cylinder radius /// \return cylinder radius public: double GetRadius() const; @@ -169,17 +153,9 @@ class IGNITION_PHYSICS_TPELIB_VISIBLE SphereShape : public Shape /// \brief Constructor public: SphereShape(); - /// \brief Copy Constructor - /// \param[in] _other shape to copy from - public: SphereShape(const SphereShape &_other); - /// \brief Destructor public: ~SphereShape() = default; - /// \brief Assignment operator - /// \param[in] _other shape to copy from - public: Shape &operator=(const Shape &_other); - /// \brief Get sphere radius /// \return Sphere radius public: double GetRadius() const; @@ -201,17 +177,9 @@ class IGNITION_PHYSICS_TPELIB_VISIBLE MeshShape : public Shape /// \brief Constructor public: MeshShape(); - /// \brief Copy Constructor - /// \param[in] _other shape to copy from - public: MeshShape(const MeshShape &_other); - /// \brief Destructor public: ~MeshShape() = default; - /// \brief Assignment operator - /// \param[in] _other shape to copy from - public: Shape &operator=(const Shape &_other); - /// \brief Set mesh /// \param[in] _mesh Mesh object public: void SetMesh(const ignition::common::Mesh &_mesh);