rigidBodyDynamics/bodies: Complete set of clone functions to support copy construction and assignment

This commit is contained in:
Henry Weller
2016-04-07 23:04:17 +01:00
parent 6d7eb1ac4d
commit b701ec9f3d
7 changed files with 35 additions and 1 deletions

View File

@ -31,6 +31,14 @@ Foam::RBD::compositeBody::~compositeBody()
{}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::RBD::rigidBody> Foam::RBD::compositeBody::clone() const
{
return autoPtr<rigidBody>(new compositeBody(*this));
}
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
const Foam::word& Foam::RBD::compositeBody::type() const

View File

@ -68,6 +68,9 @@ public:
// and the transform relative to the parent
inline compositeBody(const autoPtr<rigidBody>& bodyPtr);
//- Return clone of this compositeBody
virtual autoPtr<rigidBody> clone() const;
//- Destructor
virtual ~compositeBody();

View File

@ -44,6 +44,14 @@ namespace RBD
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::RBD::rigidBody> Foam::RBD::masslessBody::clone() const
{
return autoPtr<rigidBody>(new masslessBody(*this));
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::RBD::masslessBody::~masslessBody()

View File

@ -74,6 +74,9 @@ public:
const dictionary& dict
);
//- Return clone of this masslessBody
virtual autoPtr<rigidBody> clone() const;
//- Destructor
virtual ~masslessBody();

View File

@ -44,6 +44,14 @@ namespace RBD
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::RBD::rigidBody> Foam::RBD::sphere::clone() const
{
return autoPtr<rigidBody>(new sphere(*this));
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::RBD::sphere::~sphere()

View File

@ -77,6 +77,9 @@ public:
const dictionary& dict
);
//- Return clone of this sphere
virtual autoPtr<rigidBody> clone() const;
//- Destructor
virtual ~sphere();