compositeBody.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration | Website: https://openfoam.org
5  \\ / A nd | Copyright (C) 2016-2021 OpenFOAM Foundation
6  \\/ M anipulation |
7 -------------------------------------------------------------------------------
8 License
9  This file is part of OpenFOAM.
10 
11  OpenFOAM is free software: you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by
13  the Free Software Foundation, either version 3 of the License, or
14  (at your option) any later version.
15 
16  OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18  FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
19  for more details.
20 
21  You should have received a copy of the GNU General Public License
22  along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  Foam::RBD::compositeBody
26 
27 Description
28  This specialised rigidBody holds the original body after it has been merged
29  into a parent.
30 
31 SourceFiles
32  compositeBodyI.H
33  compositeBody.C
34 
35 \*---------------------------------------------------------------------------*/
36 
37 #ifndef RBD_compositeBody_H
38 #define RBD_compositeBody_H
39 
40 #include "rigidBody.H"
41 
42 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
43 
44 namespace Foam
45 {
46 namespace RBD
47 {
48 
49 /*---------------------------------------------------------------------------*\
50  Class compositeBody Declaration
51 \*---------------------------------------------------------------------------*/
52 
53 class compositeBody
54 :
55  public rigidBody
56 {
57  // Private Data
58 
59  //- Original body from which this composite-body was constructed
60  autoPtr<rigidBody> body_;
61 
62 public:
63 
64  // Constructors
65 
66  //- Construct a merged version of the given rigidBody
67  // providing the ID of the parent body to which this will be merged
68  // and the transform relative to the parent
69  inline compositeBody(const autoPtr<rigidBody>& bodyPtr);
70 
71  //- Return clone of this compositeBody
72  virtual autoPtr<rigidBody> clone() const;
73 
74 
75  //- Destructor
76  virtual ~compositeBody();
77 
78 
79  // Member Functions
80 
81  //- Return the type name of the original body
82  virtual const word& type() const;
83 
84  //- Return the original body from which this composite-body
85  // was constructed
86  inline const rigidBody& body() const;
87 
88  //- Write
89  virtual void write(Ostream&) const;
90 };
91 
92 
93 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
94 
95 } // End namespace RBD
96 } // End namespace Foam
97 
98 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
99 
100 #include "compositeBodyI.H"
101 
102 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
103 
104 #endif
105 
106 // ************************************************************************* //
virtual const word & type() const
Return the type name of the original body.
Definition: compositeBody.C:44
virtual ~compositeBody()
Destructor.
Definition: compositeBody.C:30
compositeBody(const autoPtr< rigidBody > &bodyPtr)
Construct a merged version of the given rigidBody.
A class for handling words, derived from string.
Definition: word.H:59
This specialised rigidBody holds the original body after it has been merged into a parent...
Definition: compositeBody.H:52
An Ostream is an abstract base class for all output systems (streams, files, token lists...
Definition: Ostream.H:54
const rigidBody & body() const
Return the original body from which this composite-body.
virtual void write(Ostream &) const
Write.
Definition: compositeBody.C:50
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
virtual autoPtr< rigidBody > clone() const
Return clone of this compositeBody.
Definition: compositeBody.C:36
Namespace for OpenFOAM.