![]() |
|
00001 /*---------------------------------------------------------------------------*\ 00002 ========= | 00003 \\ / F ield | OpenFOAM: The Open Source CFD Toolbox 00004 \\ / O peration | 00005 \\ / A nd | Copyright (C) 1991-2005 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 the 00013 Free Software Foundation; either version 2 of the License, or (at your 00014 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, write to the Free Software Foundation, 00023 Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00024 00025 Class 00026 polyModifyPoint 00027 00028 Description 00029 Class describing modification of a point. 00030 00031 \*---------------------------------------------------------------------------*/ 00032 00033 #ifndef polyModifyPoint_H 00034 #define polyModifyPoint_H 00035 00036 #include "label.H" 00037 #include "point.H" 00038 #include "topoAction.H" 00039 00040 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00041 00042 namespace Foam 00043 { 00044 00045 /*---------------------------------------------------------------------------*\ 00046 Class polyModifyPoint Declaration 00047 \*---------------------------------------------------------------------------*/ 00048 00049 class polyModifyPoint 00050 : 00051 public topoAction 00052 { 00053 // Private data 00054 00055 //- Point ID 00056 label pointID_; 00057 00058 //- New point location 00059 point location_; 00060 00061 //- Remove from current zone 00062 bool removeFromZone_; 00063 00064 //- New zone ID 00065 label zoneID_; 00066 00067 //- Does the point support a cell 00068 bool inCell_; 00069 00070 00071 public: 00072 00073 // Static data members 00074 00075 //- Runtime type information 00076 TypeName("modifyPoint"); 00077 00078 00079 // Constructors 00080 00081 //- Construct null. Used only for list construction 00082 polyModifyPoint() 00083 : 00084 pointID_(-1), 00085 location_(vector::zero), 00086 removeFromZone_(false), 00087 zoneID_(-1), 00088 inCell_(false) 00089 {} 00090 00091 //- Construct from components 00092 polyModifyPoint 00093 ( 00094 const label pointID, 00095 const point& newP, 00096 const bool removeFromZone, 00097 const label newZoneID, 00098 const bool inCell 00099 ) 00100 : 00101 pointID_(pointID), 00102 location_(newP), 00103 removeFromZone_(removeFromZone), 00104 zoneID_(newZoneID), 00105 inCell_(inCell) 00106 {} 00107 00108 //- Construct and return a clone 00109 virtual autoPtr<topoAction> clone() const 00110 { 00111 return autoPtr<topoAction>(new polyModifyPoint(*this)); 00112 } 00113 00114 00115 // Default Destructor 00116 00117 // Member Functions 00118 00119 //- Point ID 00120 label pointID() const 00121 { 00122 return pointID_; 00123 } 00124 00125 //- New point location 00126 const point& newPoint() const 00127 { 00128 return location_; 00129 } 00130 00131 //- Does the point belong to a zone? 00132 bool isInZone() const 00133 { 00134 return zoneID_ >= 0; 00135 } 00136 00137 //- Should the point be removed from current zone 00138 bool removeFromZone() const 00139 { 00140 return removeFromZone_; 00141 } 00142 00143 //- Point zone ID 00144 label zoneID() const 00145 { 00146 return zoneID_; 00147 } 00148 00149 //- Does the point support a cell 00150 bool inCell() const 00151 { 00152 return inCell_; 00153 } 00154 }; 00155 00156 00157 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00158 00159 } // End namespace Foam 00160 00161 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 00162 00163 #endif 00164 00165 // ************************************************************************* //