polyModifyPoint.H
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  ========= |
3  \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4  \\ / O peration |
5  \\ / A nd | Copyright (C) 2011 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
56 
57  //- New 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),
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),
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 // ************************************************************************* //
Foam::polyModifyPoint::pointID
label pointID() const
Point ID.
Definition: polyModifyPoint.H:118
Foam::polyModifyPoint::polyModifyPoint
polyModifyPoint()
Construct null. Used only for list construction.
Definition: polyModifyPoint.H:80
point.H
Foam::polyModifyPoint
Class describing modification of a point.
Definition: polyModifyPoint.H:47
topoAction.H
Foam::polyModifyPoint::clone
virtual autoPtr< topoAction > clone() const
Construct and return a clone.
Definition: polyModifyPoint.H:107
Foam::polyModifyPoint::removeFromZone
bool removeFromZone() const
Should the point be removed from current zone.
Definition: polyModifyPoint.H:136
Foam::label
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
Foam::polyModifyPoint::removeFromZone_
bool removeFromZone_
Remove from current zone.
Definition: polyModifyPoint.H:60
Foam::polyModifyPoint::zoneID
label zoneID() const
Point zone ID.
Definition: polyModifyPoint.H:142
Foam::polyModifyPoint::inCell_
bool inCell_
Does the point support a cell.
Definition: polyModifyPoint.H:66
Foam::polyModifyPoint::isInZone
bool isInZone() const
Does the point belong to a zone?
Definition: polyModifyPoint.H:130
Foam
Namespace for OpenFOAM.
Definition: combustionModel.C:30
Foam::polyModifyPoint::location_
point location_
New point location.
Definition: polyModifyPoint.H:57
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::polyModifyPoint::pointID_
label pointID_
Point ID.
Definition: polyModifyPoint.H:54
Foam::Vector< scalar >
label.H
Foam::polyModifyPoint::inCell
bool inCell() const
Does the point support a cell.
Definition: polyModifyPoint.H:148
Foam::polyModifyPoint::TypeName
TypeName("modifyPoint")
Runtime type information.
Foam::polyModifyPoint::zoneID_
label zoneID_
New zone ID.
Definition: polyModifyPoint.H:63
Foam::topoAction
A virtual base class for topological actions.
Definition: topoAction.H:48
Foam::polyModifyPoint::newPoint
const point & newPoint() const
New point location.
Definition: polyModifyPoint.H:124
Foam::zero
A class representing the concept of 0 used to avoid unnecessary manipulations for objects that are kn...
Definition: zero.H:47