coordinateModification.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | cfMesh: A library for mesh generation
4  \\ / O peration |
5  \\ / A nd | Author: Franjo Juretic (franjo.juretic@c-fields.com)
6  \\/ M anipulation | Copyright (C) Creative Fields, Ltd.
7 -------------------------------------------------------------------------------
8 License
9  This file is part of cfMesh.
10 
11  cfMesh is free software; you can redistribute it and/or modify it
12  under the terms of the GNU General Public License as published by the
13  Free Software Foundation; either version 3 of the License, or (at your
14  option) any later version.
15 
16  cfMesh 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 cfMesh. If not, see <http://www.gnu.org/licenses/>.
23 
24 Class
25  coordinateModification
26 
27 Description
28  Base class for modifiers of point coordinates.
29 
30 SourceFiles
31  coordinateModification.C
32 
33 \*---------------------------------------------------------------------------*/
34 
35 #ifndef coordinateModification_H
36 #define coordinateModification_H
37 
38 #include "word.H"
39 #include "point.H"
40 #include "dictionary.H"
41 #include "PtrList.H"
42 
43 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
44 
45 namespace Foam
46 {
47 
48 // Forward declarations
49 class boundBox;
50 class plane;
51 
52 /*---------------------------------------------------------------------------*\
53  Class coordinateModification Declaration
54 \*---------------------------------------------------------------------------*/
55 
57 {
58  // Private data
59 
60  //- Modification name
61  word name_;
62 
63 public:
64 
65  // Runtime type information
66  TypeName("coordinateModification");
67 
68 
69  // Constructors
70 
71  //- Null construct
73 
74  //- Construct from dictionary
76 
77  // Declare run-time constructor selection table
78 
80  (
81  autoPtr,
83  dictionary,
84  (
85  const word& name,
86  const dictionary& dict
87  ),
88  (name, dict)
89  );
90 
91 
92  // Selectors
93 
94  //- Select constructed from dictionary
96  (
97  const word& name,
98  const dictionary& dict
99  );
100 
101  // Destructor
102 
103  virtual ~coordinateModification();
104 
105 
106  // Member Functions
107 
108  //- return the origin point of the modification object
109  virtual point origin() const = 0;
110 
111  //- translate the object for backward transformation
112  virtual void translateAndModifyObject(const vector&) = 0;
113 
114  //- calculate the displacement vector for this modification
115  virtual vector displacement(const point&) const = 0;
116 
117  //- calculate the displacement vector for the backward modification
118  virtual vector backwardDisplacement(const point&) const = 0;
119 
120  //- can this modification object be combined with other ones
121  virtual bool combiningPossible() const = 0;
122 
123  //- return that "bounding planes" of the scaling region for
124  //- the given object
125  virtual void boundingPlanes(PtrList<plane>&) const = 0;
126 
127 
128  // Access
129 
130  //- Return name
131  const word& name() const
132  {
133  return name_;
134  }
135 
136  //- set the name
137  void setName(const word& name)
138  {
139  name_ = name;
140  }
141 
142  //- Return as dictionary of entries
143  virtual dictionary dict(bool ignoreType = false) const = 0;
144 
145  // Write
146 
147  //- Write
148  virtual void write(Ostream&) const = 0;
149 
150  //- Write dictionary
151  virtual void writeDict(Ostream&, bool subDict = true) const = 0;
152 
153  // Member Operators
154 
155  //- assign from dictionary
156  virtual void operator=(const dictionary&) = 0;
157 
158  // IOstream Operators
159 
161 };
162 
163 
164 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
165 
166 } // End namespace Foam
167 
168 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
169 
170 #endif
171 
172 // ************************************************************************* //
Foam::word
A class for handling words, derived from string.
Definition: word.H:59
point.H
Foam::coordinateModification::New
static autoPtr< coordinateModification > New(const word &name, const dictionary &dict)
Select constructed from dictionary.
Definition: newCoordinateModification.C:38
Foam::coordinateModification::TypeName
TypeName("coordinateModification")
Foam::coordinateModification::setName
void setName(const word &name)
set the name
Definition: coordinateModification.H:136
Foam::coordinateModification::boundingPlanes
virtual void boundingPlanes(PtrList< plane > &) const =0
Foam::coordinateModification::writeDict
virtual void writeDict(Ostream &, bool subDict=true) const =0
Write dictionary.
Foam::coordinateModification::~coordinateModification
virtual ~coordinateModification()
Definition: coordinateModification.C:57
Foam::PtrList
A templated 1D list of pointers to objects of type <T>, where the size of the array is known and used...
Definition: List.H:61
Foam::coordinateModification::backwardDisplacement
virtual vector backwardDisplacement(const point &) const =0
calculate the displacement vector for the backward modification
Foam::coordinateModification::origin
virtual point origin() const =0
return the origin point of the modification object
Foam::dictionary
A list of keyword definitions, which are a keyword followed by any number of values (e....
Definition: dictionary.H:137
Foam::coordinateModification::combiningPossible
virtual bool combiningPossible() const =0
can this modification object be combined with other ones
Foam::coordinateModification::operator=
virtual void operator=(const dictionary &)=0
assign from dictionary
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::autoPtr
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:117
Foam::coordinateModification::dict
virtual dictionary dict(bool ignoreType=false) const =0
Return as dictionary of entries.
Foam::Vector< scalar >
Foam::coordinateModification::name
const word & name() const
Return name.
Definition: coordinateModification.H:130
dictionary.H
Foam::coordinateModification
Definition: coordinateModification.H:55
Foam::coordinateModification::name_
word name_
Modification name.
Definition: coordinateModification.H:60
PtrList.H
Foam::coordinateModification::operator<<
friend Ostream & operator<<(Ostream &, const coordinateModification &)
Definition: coordinateModification.C:63
Foam::coordinateModification::declareRunTimeSelectionTable
declareRunTimeSelectionTable(autoPtr, coordinateModification, dictionary,(const word &name, const dictionary &dict),(name, dict))
Foam::Ostream
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Definition: Ostream.H:53
word.H
Foam::coordinateModification::coordinateModification
coordinateModification()
Null construct.
Definition: coordinateModification.C:40
Foam::coordinateModification::displacement
virtual vector displacement(const point &) const =0
calculate the displacement vector for this modification
Foam::coordinateModification::write
virtual void write(Ostream &) const =0
Write.
Foam::coordinateModification::translateAndModifyObject
virtual void translateAndModifyObject(const vector &)=0
translate the object for backward transformation