00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd. 00006 \\/ M anipulation | 00007 ------------------------------------------------------------------------------- 00008 License 00009 This file is part of OpenFOAM. 00010 00011 OpenFOAM is free software: you can redistribute it and/or modify it 00012 under the terms of the GNU General Public License as published by 00013 the Free Software Foundation, either version 3 of the License, or 00014 (at your option) any later version. 00015 00016 OpenFOAM is distributed in the hope that it will be useful, but WITHOUT 00017 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00018 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 00019 for more details. 00020 00021 You should have received a copy of the GNU General Public License 00022 along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. 00023 00024 Class 00025 Foam::polyModifyPoint 00026 00027 Description 00028 Class describing modification of a point. 00029 00030 \*---------------------------------------------------------------------------*/ 00031 00032 #ifndef polyModifyPoint_H 00033 #define polyModifyPoint_H 00034 00035 #include <OpenFOAM/label.H> 00036 #include <OpenFOAM/point.H> 00037 #include <dynamicMesh/topoAction.H> 00038 00039 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00040 00041 namespace Foam 00042 { 00043 00044 /*---------------------------------------------------------------------------*\ 00045 Class polyModifyPoint Declaration 00046 \*---------------------------------------------------------------------------*/ 00047 00048 class polyModifyPoint 00049 : 00050 public topoAction 00051 { 00052 // Private data 00053 00054 //- Point ID 00055 label pointID_; 00056 00057 //- New point location 00058 point location_; 00059 00060 //- Remove from current zone 00061 bool removeFromZone_; 00062 00063 //- New zone ID 00064 label zoneID_; 00065 00066 //- Does the point support a cell 00067 bool inCell_; 00068 00069 00070 public: 00071 00072 // Static data members 00073 00074 //- Runtime type information 00075 TypeName("modifyPoint"); 00076 00077 00078 // Constructors 00079 00080 //- Construct null. Used only for list construction 00081 polyModifyPoint() 00082 : 00083 pointID_(-1), 00084 location_(vector::zero), 00085 removeFromZone_(false), 00086 zoneID_(-1), 00087 inCell_(false) 00088 {} 00089 00090 //- Construct from components 00091 polyModifyPoint 00092 ( 00093 const label pointID, 00094 const point& newP, 00095 const bool removeFromZone, 00096 const label newZoneID, 00097 const bool inCell 00098 ) 00099 : 00100 pointID_(pointID), 00101 location_(newP), 00102 removeFromZone_(removeFromZone), 00103 zoneID_(newZoneID), 00104 inCell_(inCell) 00105 {} 00106 00107 //- Construct and return a clone 00108 virtual autoPtr<topoAction> clone() const 00109 { 00110 return autoPtr<topoAction>(new polyModifyPoint(*this)); 00111 } 00112 00113 00114 // Default Destructor 00115 00116 // Member Functions 00117 00118 //- Point ID 00119 label pointID() const 00120 { 00121 return pointID_; 00122 } 00123 00124 //- New point location 00125 const point& newPoint() const 00126 { 00127 return location_; 00128 } 00129 00130 //- Does the point belong to a zone? 00131 bool isInZone() const 00132 { 00133 return zoneID_ >= 0; 00134 } 00135 00136 //- Should the point be removed from current zone 00137 bool removeFromZone() const 00138 { 00139 return removeFromZone_; 00140 } 00141 00142 //- Point zone ID 00143 label zoneID() const 00144 { 00145 return zoneID_; 00146 } 00147 00148 //- Does the point support a cell 00149 bool inCell() const 00150 { 00151 return inCell_; 00152 } 00153 }; 00154 00155 00156 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00157 00158 } // End namespace Foam 00159 00160 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00161 00162 #endif 00163 00164 // ************************ vim: set sw=4 sts=4 et: ************************ //