All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
polyModifyPoint.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) 2011-2019 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::polyModifyPoint
26 
27 Description
28  Class describing modification of a point.
29 
30 \*---------------------------------------------------------------------------*/
31 
32 #ifndef polyModifyPoint_H
33 #define polyModifyPoint_H
34 
35 #include "label.H"
36 #include "point.H"
37 #include "topoAction.H"
38 
39 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
40 
41 namespace Foam
42 {
43 
44 /*---------------------------------------------------------------------------*\
45  Class polyModifyPoint Declaration
46 \*---------------------------------------------------------------------------*/
47 
48 class polyModifyPoint
49 :
50  public topoAction
51 {
52  // Private Data
53 
54  //- Point ID
55  label pointID_;
56 
57  //- New point location
58  point location_;
59 
60  //- Remove from current zone
61  bool removeFromZone_;
62 
63  //- New zone ID
64  label zoneID_;
65 
66  //- Does the point support a cell
67  bool inCell_;
68 
69 
70 public:
71 
72  // Static Data Members
73 
74  //- Runtime type information
75  TypeName("modifyPoint");
76 
77 
78  // Constructors
79 
80  //- Construct null. Used only for list construction
82  :
83  pointID_(-1),
84  location_(Zero),
85  removeFromZone_(false),
86  zoneID_(-1),
87  inCell_(false)
88  {}
89 
90  //- Construct from components
92  (
93  const label pointID,
94  const point& newP,
95  const bool removeFromZone,
96  const label newZoneID,
97  const bool inCell
98  )
99  :
100  pointID_(pointID),
101  location_(newP),
102  removeFromZone_(removeFromZone),
103  zoneID_(newZoneID),
104  inCell_(inCell)
105  {}
106 
107  //- Construct and return a clone
108  virtual autoPtr<topoAction> clone() const
109  {
110  return autoPtr<topoAction>(new polyModifyPoint(*this));
111  }
112 
113 
114  // Default Destructor
115 
116  // Member Functions
117 
118  //- Point ID
119  label pointID() const
120  {
121  return pointID_;
122  }
123 
124  //- New point location
125  const point& newPoint() const
126  {
127  return location_;
128  }
129 
130  //- Does the point belong to a zone?
131  bool isInZone() const
132  {
133  return zoneID_ >= 0;
134  }
135 
136  //- Should the point be removed from current zone
137  bool removeFromZone() const
138  {
139  return removeFromZone_;
140  }
141 
142  //- Point zone ID
143  label zoneID() const
144  {
145  return zoneID_;
146  }
147 
148  //- Does the point support a cell
149  bool inCell() const
150  {
151  return inCell_;
152  }
153 };
154 
155 
156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
157 
158 } // End namespace Foam
159 
160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
161 
162 #endif
163 
164 // ************************************************************************* //
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
Definition: label.H:59
bool removeFromZone() const
Should the point be removed from current zone.
bool inCell() const
Does the point support a cell.
label pointID() const
Point ID.
virtual autoPtr< topoAction > clone() const
Construct and return a clone.
polyModifyPoint()
Construct null. Used only for list construction.
static const zero Zero
Definition: zero.H:97
bool isInZone() const
Does the point belong to a zone?
A virtual base class for topological actions.
Definition: topoAction.H:48
Class describing modification of a point.
label zoneID() const
Point zone ID.
const point & newPoint() const
New point location.
An auto-pointer similar to the STL auto_ptr but with automatic casting to a reference to the type and...
Definition: PtrList.H:52
TypeName("modifyPoint")
Runtime type information.
Namespace for OpenFOAM.