initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / src / dynamicMesh / polyTopoChange / polyTopoChange / modifyObject / polyModifyPoint.H
blob1a9b70ed6ca8da89bd045ca6bdbebd9fe9fa4883
1 /*---------------------------------------------------------------------------*\
2   =========                 |
3   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
4    \\    /   O peration     |
5     \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
6      \\/     M anipulation  |
7 -------------------------------------------------------------------------------
8 License
9     This file is part of OpenFOAM.
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 the
13     Free Software Foundation; either version 2 of the License, or (at your
14     option) any later version.
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.
21     You should have received a copy of the GNU General Public License
22     along with OpenFOAM; if not, write to the Free Software Foundation,
23     Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 Class
26     Foam::polyModifyPoint
28 Description
29     Class describing modification of a point.
31 \*---------------------------------------------------------------------------*/
33 #ifndef polyModifyPoint_H
34 #define polyModifyPoint_H
36 #include "label.H"
37 #include "point.H"
38 #include "topoAction.H"
40 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
42 namespace Foam
45 /*---------------------------------------------------------------------------*\
46                        Class polyModifyPoint Declaration
47 \*---------------------------------------------------------------------------*/
49 class polyModifyPoint
51     public topoAction
53     // Private data
55         //- Point ID
56         label pointID_;
58         //- New point location
59         point location_;
61         //- Remove from current zone
62         bool removeFromZone_;
64         //- New zone ID
65         label zoneID_;
67         //- Does the point support a cell
68         bool inCell_;
71 public:
73     // Static data members
75         //- Runtime type information
76         TypeName("modifyPoint");
79     // Constructors
81         //- Construct null.  Used only for list construction
82         polyModifyPoint()
83         :
84             pointID_(-1),
85             location_(vector::zero),
86             removeFromZone_(false),
87             zoneID_(-1),
88             inCell_(false)
89         {}
91         //- Construct from components
92         polyModifyPoint
93         (
94             const label pointID,
95             const point& newP,
96             const bool removeFromZone,
97             const label newZoneID,
98             const bool inCell
99         )
100         :
101             pointID_(pointID),
102             location_(newP),
103             removeFromZone_(removeFromZone),
104             zoneID_(newZoneID),
105             inCell_(inCell)
106         {}
108         //- Construct and return a clone
109         virtual autoPtr<topoAction> clone() const
110         {
111             return autoPtr<topoAction>(new polyModifyPoint(*this));
112         }
115     // Default Destructor
117     // Member Functions
119         //- Point ID
120         label pointID() const
121         {
122             return pointID_;
123         }
125         //- New point location
126         const point& newPoint() const
127         {
128             return location_;
129         }
131         //- Does the point belong to a zone?
132         bool isInZone() const
133         {
134             return zoneID_ >= 0;
135         }
137         //- Should the point be removed from current zone
138         bool removeFromZone() const
139         {
140             return removeFromZone_;
141         }
143         //- Point zone ID
144         label zoneID() const
145         {
146             return zoneID_;
147         }
149         //- Does the point support a cell
150         bool inCell() const
151         {
152             return inCell_;
153         }
157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
159 } // End namespace Foam
161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
163 #endif
165 // ************************************************************************* //