determine if this is a cell that wraps from 360 to 0 (i.e. if it's a cell that wraps from the right side of the domain to the left side)
| 31 | // determine if this is a cell that wraps from 360 to 0 (i.e. if it's |
| 32 | // a cell that wraps from the right side of the domain to the left side) |
| 33 | bool IsCellInverted(double points[4][3]) |
| 34 | { |
| 35 | // We test the normal 3 points at a time. Not all grids are well-behaved |
| 36 | // i.e. consistently use 0 or 360. We've had grid where 3 points on the left |
| 37 | // side, and just 1 on the right. Just checking the first 3 points (which is |
| 38 | // what ComputeNormal() does, we may (and do) miss a few cells. |
| 39 | // See BUG #0014897. |
| 40 | double normal[3]; |
| 41 | vtkPolygon::ComputeNormal(3, points[0], normal); |
| 42 | if (normal[2] > 0) |
| 43 | { |
| 44 | return true; |
| 45 | } |
| 46 | vtkPolygon::ComputeNormal(3, points[1], normal); |
| 47 | return normal[2] > 0; |
| 48 | } |
| 49 | |
| 50 | template <class T> |
| 51 | inline bool IsZero(const T& val) |
no test coverage detected