00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef polyAddPoint_H
00034 #define polyAddPoint_H
00035
00036 #include "label.H"
00037 #include "point.H"
00038 #include "topoAction.H"
00039
00040
00041
00042 namespace Foam
00043 {
00044
00045
00046
00047
00048
00049 class polyAddPoint
00050 :
00051 public topoAction
00052 {
00053
00054
00055
00056 point p_;
00057
00058
00059 label masterPointID_;
00060
00061
00062 label zoneID_;
00063
00064
00065 bool inCell_;
00066
00067
00068 public:
00069
00070
00071
00072
00073 TypeName("addPoint");
00074
00075
00076
00077
00078
00079 polyAddPoint()
00080 :
00081 p_(vector::zero),
00082 masterPointID_(-1),
00083 zoneID_(-1),
00084 inCell_(false)
00085 {}
00086
00087
00088 polyAddPoint
00089 (
00090 const point& p,
00091 const label masterPointID,
00092 const label zoneID,
00093 const bool inCell
00094 )
00095 :
00096 p_(p),
00097 masterPointID_(masterPointID),
00098 zoneID_(zoneID),
00099 inCell_(inCell)
00100 {
00101 if (zoneID_ < 0 && !inCell)
00102 {
00103 FatalErrorIn
00104 (
00105 "polyAddPoint\n"
00106 "(\n"
00107 " const point& p,\n"
00108 " const label masterPointID,\n"
00109 " const label zoneID,\n"
00110 " const bool inCell\n"
00111 ")"
00112 ) << "Point is not in a cell and not in a zone. "
00113 << "This is not allowed.\n"
00114 << "point: " << p
00115 << " master: " << masterPointID_
00116 << " zone: " << zoneID_
00117 << abort(FatalError);
00118 }
00119
00120 }
00121
00122
00123 virtual autoPtr<topoAction> clone() const
00124 {
00125 return autoPtr<topoAction>(new polyAddPoint(*this));
00126 }
00127
00128
00129
00130
00131
00132
00133
00134
00135 const point& newPoint() const
00136 {
00137 return p_;
00138 }
00139
00140
00141 label masterPointID() const
00142 {
00143 return masterPointID_;
00144 }
00145
00146
00147 bool appended() const
00148 {
00149 return masterPointID_ < 0;
00150 }
00151
00152
00153 bool isInZone() const
00154 {
00155 return zoneID_ >= 0;
00156 }
00157
00158
00159 label zoneID() const
00160 {
00161 return zoneID_;
00162 }
00163
00164
00165 bool inCell() const
00166 {
00167 return inCell_;
00168 }
00169 };
00170
00171
00172
00173
00174 }
00175
00176
00177
00178 #endif
00179
00180