| 40 | |
| 41 | |
| 42 | int main(int argc, char *argv[]) |
| 43 | { |
| 44 | argList::addNote |
| 45 | ( |
| 46 | "set face normals consistent with a user-provided 'outside' point" |
| 47 | ); |
| 48 | |
| 49 | argList::noParallel(); |
| 50 | argList::validArgs.append("surface file"); |
| 51 | argList::validArgs.append("output surface file"); |
| 52 | argList::validArgs.append("visiblePoint"); |
| 53 | argList::addBoolOption |
| 54 | ( |
| 55 | "inside", |
| 56 | "treat provided point as being inside" |
| 57 | ); |
| 58 | argList::addBoolOption |
| 59 | ( |
| 60 | "usePierceTest", |
| 61 | "determine orientation by counting number of intersections" |
| 62 | ); |
| 63 | |
| 64 | argList args(argc, argv); |
| 65 | |
| 66 | const fileName surfFileName = args[1]; |
| 67 | const fileName outFileName = args[2]; |
| 68 | const point visiblePoint = args.argRead<point>(3); |
| 69 | |
| 70 | const bool orientInside = args.optionFound("inside"); |
| 71 | const bool usePierceTest = args.optionFound("usePierceTest"); |
| 72 | |
| 73 | Info<< "Reading surface from " << surfFileName << nl |
| 74 | << "Orienting surface such that visiblePoint " << visiblePoint |
| 75 | << " is "; |
| 76 | |
| 77 | if (orientInside) |
| 78 | { |
| 79 | Info<< "inside" << endl; |
| 80 | } |
| 81 | else |
| 82 | { |
| 83 | Info<< "outside" << endl; |
| 84 | } |
| 85 | |
| 86 | |
| 87 | |
| 88 | // Load surface |
| 89 | triSurface surf(surfFileName); |
| 90 | |
| 91 | |
| 92 | bool anyFlipped = false; |
| 93 | |
| 94 | if (usePierceTest) |
| 95 | { |
| 96 | triSurfaceSearch surfSearches(surf); |
| 97 | |
| 98 | anyFlipped = orientedSurface::orient |
| 99 | ( |
nothing calls this directly
no test coverage detected