mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Transfering from dev copy constructors and clones for coordinateRotation classes
This commit is contained in:
@ -274,6 +274,16 @@ Foam::EulerCoordinateRotation::EulerCoordinateRotation
|
||||
}
|
||||
|
||||
|
||||
Foam::EulerCoordinateRotation::EulerCoordinateRotation
|
||||
(
|
||||
const EulerCoordinateRotation& r
|
||||
)
|
||||
:
|
||||
R_(r.R_),
|
||||
Rtr_(r.Rtr_)
|
||||
{}
|
||||
|
||||
|
||||
void Foam::EulerCoordinateRotation::write(Ostream& os) const
|
||||
{
|
||||
os.writeKeyword("e1") << e1() << token::END_STATEMENT << nl;
|
||||
|
||||
@ -120,6 +120,21 @@ public:
|
||||
//- Construct from dictionary and mesh
|
||||
EulerCoordinateRotation(const dictionary&, const objectRegistry&);
|
||||
|
||||
//- Construct as copy
|
||||
EulerCoordinateRotation(const EulerCoordinateRotation&);
|
||||
|
||||
//- Return clone
|
||||
autoPtr<coordinateRotation> clone() const
|
||||
{
|
||||
return autoPtr<coordinateRotation>
|
||||
(
|
||||
new EulerCoordinateRotation
|
||||
(
|
||||
*this
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
|
||||
@ -271,6 +271,16 @@ Foam::STARCDCoordinateRotation::STARCDCoordinateRotation
|
||||
}
|
||||
|
||||
|
||||
Foam::STARCDCoordinateRotation::STARCDCoordinateRotation
|
||||
(
|
||||
const STARCDCoordinateRotation& r
|
||||
)
|
||||
:
|
||||
R_(r.R_),
|
||||
Rtr_(r.Rtr_)
|
||||
{}
|
||||
|
||||
|
||||
void Foam::STARCDCoordinateRotation::write(Ostream& os) const
|
||||
{
|
||||
os.writeKeyword("e1") << e1() << token::END_STATEMENT << nl;
|
||||
|
||||
@ -117,7 +117,23 @@ public:
|
||||
//- Construct from dictionary and mesh
|
||||
STARCDCoordinateRotation(const dictionary&, const objectRegistry&);
|
||||
|
||||
// Member Functions
|
||||
//- Construct as copy
|
||||
STARCDCoordinateRotation(const STARCDCoordinateRotation&);
|
||||
|
||||
//- Return clone
|
||||
autoPtr<coordinateRotation> clone() const
|
||||
{
|
||||
return autoPtr<coordinateRotation>
|
||||
(
|
||||
new STARCDCoordinateRotation
|
||||
(
|
||||
*this
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Reset rotation to an identity rotation
|
||||
virtual void clear()
|
||||
|
||||
@ -157,6 +157,14 @@ Foam::axesRotation::axesRotation(const tensor& R)
|
||||
{}
|
||||
|
||||
|
||||
Foam::axesRotation::axesRotation(const axesRotation& r)
|
||||
:
|
||||
R_(r.R_),
|
||||
Rtr_(r.Rtr_)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
const Foam::tensorField& Foam::axesRotation::Tr() const
|
||||
|
||||
@ -111,10 +111,13 @@ public:
|
||||
//- Construct from dictionary and mesh
|
||||
axesRotation(const dictionary&, const objectRegistry&);
|
||||
|
||||
//- Construct as copy
|
||||
axesRotation(const axesRotation&);
|
||||
|
||||
//- Return clone
|
||||
autoPtr<axesRotation> clone() const
|
||||
autoPtr<coordinateRotation> clone() const
|
||||
{
|
||||
return autoPtr<axesRotation>(new axesRotation(*this));
|
||||
return autoPtr<coordinateRotation>(new axesRotation(*this));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -110,6 +110,11 @@ public:
|
||||
(dict)
|
||||
);
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct and return a clone
|
||||
virtual autoPtr<coordinateRotation> clone() const = 0;
|
||||
|
||||
|
||||
// Selectors
|
||||
|
||||
|
||||
@ -172,6 +172,15 @@ Foam::cylindrical::cylindrical(const tensorField& R)
|
||||
}
|
||||
|
||||
|
||||
Foam::cylindrical::cylindrical(const cylindrical& r)
|
||||
:
|
||||
Rptr_(r.Rptr_, false), // clone
|
||||
origin_(r.origin_),
|
||||
e3_(r.e3_)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::cylindrical::clear()
|
||||
|
||||
@ -120,10 +120,13 @@ public:
|
||||
//- Construct from tensor Field
|
||||
cylindrical(const tensorField&);
|
||||
|
||||
//- Construct as copy
|
||||
cylindrical(const cylindrical&);
|
||||
|
||||
//- Return clone
|
||||
autoPtr<cylindrical> clone() const
|
||||
autoPtr<coordinateRotation> clone() const
|
||||
{
|
||||
return autoPtr<cylindrical>(new cylindrical(*this));
|
||||
return autoPtr<coordinateRotation>(new cylindrical(*this));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@ Foam::coordinateSystem::coordinateSystem
|
||||
name_(name),
|
||||
note_(),
|
||||
origin_(cs.origin_),
|
||||
R_(const_cast<coordinateRotation*>(&cs.R()))
|
||||
R_(cs.R().clone())
|
||||
{}
|
||||
|
||||
|
||||
@ -71,7 +71,7 @@ Foam::coordinateSystem::coordinateSystem
|
||||
name_(name),
|
||||
note_(),
|
||||
origin_(origin),
|
||||
R_(const_cast<coordinateRotation*>(&cr))
|
||||
R_(cr.clone())
|
||||
{}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user