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 | www.openfoam.com
6 \\/ M anipulation |
7-------------------------------------------------------------------------------
8 Copyright (C) 2011-2016 OpenFOAM Foundation
9-------------------------------------------------------------------------------
10License
11 This file is part of OpenFOAM.
12
13 OpenFOAM is free software: you can redistribute it and/or modify it
14 under the terms of the GNU General Public License as published by
15 the Free Software Foundation, either version 3 of the License, or
16 (at your option) any later version.
17
18 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
20 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 for more details.
22
23 You should have received a copy of the GNU General Public License
24 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
25
26Class
27 Foam::polyModifyPoint
28
29Description
30 Class describing modification of a point.
31
32\*---------------------------------------------------------------------------*/
33
34#ifndef polyModifyPoint_H
35#define polyModifyPoint_H
36
37#include "label.H"
38#include "point.H"
39#include "topoAction.H"
40
41// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42
43namespace Foam
44{
45
46/*---------------------------------------------------------------------------*\
47 Class polyModifyPoint Declaration
48\*---------------------------------------------------------------------------*/
51:
52 public topoAction
53{
54 // Private data
55
56 //- Point ID
57 label pointID_;
58
59 //- New point location
60 point location_;
61
62 //- Remove from current zone
63 bool removeFromZone_;
64
65 //- New zone ID
66 label zoneID_;
67
68 //- Does the point support a cell
69 bool inCell_;
70
71
72public:
73
74 // Static data members
75
76 //- Runtime type information
77 TypeName("modifyPoint");
78
79
80 // Constructors
81
82 //- Construct null. Used only for list construction
84 :
85 pointID_(-1),
86 location_(Zero),
87 removeFromZone_(false),
88 zoneID_(-1),
89 inCell_(false)
90 {}
91
92 //- Construct from components
94 (
95 const label pointID,
96 const point& newP,
97 const bool removeFromZone,
98 const label newZoneID,
99 const bool inCell
100 )
101 :
102 pointID_(pointID),
103 location_(newP),
104 removeFromZone_(removeFromZone),
105 zoneID_(newZoneID),
106 inCell_(inCell)
107 {}
108
109 //- Construct and return a clone
110 virtual autoPtr<topoAction> clone() const
111 {
112 return autoPtr<topoAction>(new polyModifyPoint(*this));
113 }
114
115
116 // Default Destructor
117
118 // Member Functions
119
120 //- Point ID
121 label pointID() const
122 {
123 return pointID_;
124 }
125
126 //- New point location
127 const point& newPoint() const
128 {
129 return location_;
130 }
131
132 //- Does the point belong to a zone?
133 bool isInZone() const
134 {
135 return zoneID_ >= 0;
136 }
137
138 //- Should the point be removed from current zone
139 bool removeFromZone() const
140 {
141 return removeFromZone_;
142 }
143
144 //- Point zone ID
145 label zoneID() const
146 {
147 return zoneID_;
148 }
149
150 //- Does the point support a cell
151 bool inCell() const
152 {
153 return inCell_;
154 }
155};
156
157
158// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159
160} // End namespace Foam
161
162// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163
164#endif
165
166// ************************************************************************* //
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
Definition: autoPtr.H:66
Class describing modification of a point.
bool removeFromZone() const
Should the point be removed from current zone.
label zoneID() const
Point zone ID.
TypeName("modifyPoint")
Runtime type information.
polyModifyPoint()
Construct null. Used only for list construction.
const point & newPoint() const
New point location.
polyModifyPoint(const label pointID, const point &newP, const bool removeFromZone, const label newZoneID, const bool inCell)
Construct from components.
bool inCell() const
Does the point support a cell.
virtual autoPtr< topoAction > clone() const
Construct and return a clone.
bool isInZone() const
Does the point belong to a zone?
label pointID() const
Point ID.
A virtual base class for topological actions.
Definition: topoAction.H:52
Namespace for OpenFOAM.
static constexpr const zero Zero
Global zero (0)
Definition: zero.H:131
#define TypeName(TypeNameString)
Declare a ClassName() with extra virtual type info.
Definition: typeInfo.H:73