Go to the documentation of this file.
82 static bool hasReadWriteTypes(
const word& readType,
const word& writeType)
84 volatile bool good =
true;
102 int main(
int argc,
char *argv[])
106 "Convert between surface formats, using triSurface library components"
116 "Perform some surface checking/cleanup on the input surface"
121 "Reorder faces into groups; one per region"
127 "The input format (default: use file extension)"
133 "The output format (default: use file extension)"
139 "Input geometry scaling factor"
145 "The output precision"
155 Info<<
"Output write precision set to " << prec <<
endl;
165 if (importName == exportName)
168 <<
"Output file would overwrite input file." <<
nl
172 const word readFileType
177 const word writeFileType
184 if (!hasReadWriteTypes(readFileType, writeFileType))
187 <<
"Unsupported file format(s)" <<
nl
192 scalar scaleFactor(0);
194 Info<<
"Reading : " << importName <<
endl;
195 triSurface surf(importName, readFileType, scaleFactor);
199 Info<<
"scale input " << scaleFactor <<
nl;
200 surf.scalePoints(scaleFactor);
205 surf.writeStats(
Info);
210 Info<<
"Cleaning up surface" <<
endl;
213 Info<<
"After cleaning up surface:" <<
endl;
214 surf.writeStats(
Info);
218 const bool sortByRegion =
args.
found(
"group");
221 Info<<
"Reordering faces into groups; one per region." <<
endl;
225 Info<<
"Maintaining face ordering" <<
endl;
228 Info<<
"writing " << exportName <<
endl;
230 surf.
write(exportName, writeFileType, sortByRegion);
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
A class for handling words, derived from Foam::string.
A class for handling file names.
T getOrDefault(const word &optName, const T &deflt) const
static void addNote(const string ¬e)
static void addOptionCompat(const word &optName, std::pair< const char *, int > compat)
Extract command arguments and options from the supplied argc and argv parameters.
Ostream & endl(Ostream &os)
static bool canReadType(const word &fileType, bool verbose=false)
T get(const label index) const
bool readIfPresent(const word &optName, T &val) const
static void addArgument(const string &argName, const string &usage="")
Triangulated surface description with patch information.
virtual bool write(const token &tok)=0
static bool canWriteType(const word &fileType, bool verbose=false)
errorManipArg< error, int > exit(error &err, const int errNo=1)
virtual int precision() const
static void addBoolOption(const word &optName, const string &usage="", bool advanced=false)
static unsigned int defaultPrecision() noexcept
word name(const expressions::valueTypeCode typeCode)
static void addOption(const word &optName, const string ¶m="", const string &usage="", bool advanced=false)
Foam::argList args(argc, argv)
bool found(const word &optName) const