Commit b701ec9f authored by Henry Weller's avatar Henry Weller
Browse files

rigidBodyDynamics/bodies: Complete set of clone functions to support copy...

rigidBodyDynamics/bodies: Complete set of clone functions to support copy construction and assignment
parent 6d7eb1ac
......@@ -81,7 +81,8 @@ int main(int argc, char *argv[])
*/
// Create the pendulum model from dictionary
rigidBodyModel pendulum(dictionary(IFstream("pendulum")()));
rigidBodyModel pendulum1(dictionary(IFstream("pendulum")()));
rigidBodyModel pendulum = pendulum1;
pendulum.write(Info);
......
......@@ -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
......
......@@ -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();
......
......@@ -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()
......
......@@ -74,6 +74,9 @@ public:
const dictionary& dict
);
//- Return clone of this masslessBody
virtual autoPtr<rigidBody> clone() const;
//- Destructor
virtual ~masslessBody();
......
......@@ -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()
......
......@@ -77,6 +77,9 @@ public:
const dictionary& dict
);
//- Return clone of this sphere
virtual autoPtr<rigidBody> clone() const;
//- Destructor
virtual ~sphere();
......
Supports Markdown
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