triFace.H
Go to the documentation of this file.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
00034
00035
00036 #ifndef triFace_H
00037 #define triFace_H
00038
00039 #include "FixedList.H"
00040 #include "edgeList.H"
00041 #include "pointHit.H"
00042 #include "intersection.H"
00043 #include "pointField.H"
00044 #include "triPointRef.H"
00045
00046
00047
00048 namespace Foam
00049 {
00050
00051 class face;
00052
00053
00054
00055 class triFace;
00056 inline bool operator==(const triFace&, const triFace&);
00057 inline bool operator!=(const triFace&, const triFace&);
00058
00059
00060
00061
00062
00063
00064 class triFace
00065 :
00066 public FixedList<label, 3>
00067 {
00068
00069 public:
00070
00071
00072
00073
00074 inline triFace();
00075
00076
00077 inline triFace
00078 (
00079 const label a,
00080 const label b,
00081 const label c
00082 );
00083
00084
00085 explicit inline triFace(const UList<label>&);
00086
00087
00088 inline triFace(Istream&);
00089
00090
00091
00092
00093
00094
00095 inline label collapse();
00096
00097
00098
00099
00100
00101 inline int edgeDirection(const edge&) const;
00102
00103
00104
00105
00106
00107 inline pointField points(const pointField& points) const;
00108
00109
00110 inline face triFaceFace() const;
00111
00112
00113 inline label nEdges() const;
00114
00115
00116 inline edgeList edges() const;
00117
00118
00119 inline point centre(const pointField&) const;
00120
00121
00122 inline scalar mag(const pointField&) const;
00123
00124
00125 inline vector normal(const pointField&) const;
00126
00127
00128 inline label nTriangles() const;
00129
00130
00131 inline triFace reverseFace() const;
00132
00133
00134 inline scalar sweptVol
00135 (
00136 const pointField& oldPoints,
00137 const pointField& newPoints
00138 ) const;
00139
00140
00141
00142 inline pointHit ray
00143 (
00144 const point& p,
00145 const vector& q,
00146 const pointField& points,
00147 const intersection::algorithm = intersection::FULL_RAY,
00148 const intersection::direction dir = intersection::VECTOR
00149 ) const;
00150
00151
00152 inline triPointRef tri(const pointField&) const;
00153
00154
00155
00156
00157
00158 static inline int compare(const triFace&, const triFace&);
00159
00160
00161
00162 friend bool operator==(const triFace&, const triFace&);
00163 friend bool operator!=(const triFace&, const triFace&);
00164 };
00165
00166
00167
00168
00169 template<>
00170 inline unsigned Hash<triFace>::operator()(const triFace& t, unsigned seed) const
00171 {
00172
00173 const uLabel t0(t[0]);
00174 const uLabel t1(t[1]);
00175 const uLabel t2(t[2]);
00176
00177 const uLabel val = (t0*t1*t2 + t0+t1+t2);
00178
00179 return Hash<uLabel>()(val, seed);
00180 }
00181
00182
00183
00184
00185 template<>
00186 inline unsigned Hash<triFace>::operator()(const triFace& t) const
00187 {
00188 return Hash<triFace>::operator()(t, 0);
00189 }
00190
00191
00192 template<>
00193 inline bool contiguous<triFace>() {return true;}
00194
00195
00196
00197
00198 }
00199
00200
00201
00202 #include "triFaceI.H"
00203
00204
00205
00206 #endif
00207
00208
Copyright © 2000-2009 OpenCFD Ltd