Go to the documentation of this file.
55 && std::toupper(header[
pos+0]) ==
'S'
56 && std::toupper(header[
pos+1]) ==
'O'
57 && std::toupper(header[
pos+2]) ==
'L'
58 && std::toupper(header[
pos+3]) ==
'I'
59 && std::toupper(header[
pos+4]) ==
'D'
74 format == STLFormat::UNKNOWN
76 :
format == STLFormat::BINARY
101 <<
"Cannot read file " << filename
102 <<
" or file " << filename +
".gz"
120 is.read(
reinterpret_cast<char*
>(&nTris),
sizeof(int32_t));
125 bool bad = (!is || nTris < 0);
127 if (!bad && unCompressed)
142 return (bad ? 0 : nTris);
146 std::unique_ptr<std::istream>
150 label& nTrisEstimated
155 std::unique_ptr<std::istream> streamPtr;
156 bool unCompressed(
true);
164 streamPtr.reset(isPtr.
release());
166 auto& is = *streamPtr;
171 <<
"Cannot read file " << filename
172 <<
" or file " << filename +
".gz"
185 <<
"problem reading header, perhaps file is not binary "
192 is.read(
reinterpret_cast<char*
>(&nTris),
sizeof(int32_t));
197 bool bad = (!is || nTris < 0);
199 if (!bad && unCompressed)
216 <<
"problem reading number of triangles, perhaps file is not binary"
220 nTrisEstimated = nTris;
234 sprintf(header,
"STL binary file %u facets", nTris);
243 os.write(
reinterpret_cast<char*
>(&nTris),
sizeof(uint32_t));
@ UNCOMPRESSED
compression = false
Functions used by OpenFOAM that are specific to POSIX compliant operating systems and need to be repl...
A class for handling file names.
bool isspace(char c) noexcept
std::istream * release() noexcept
IOstreamOption::compressionType whichCompression() const
word format(conversionProperties.get< word >("format"))
static constexpr const unsigned STLHeaderSize
off_t fileSize(const fileName &name, const bool followLink=true)
static bool startsWithSolid(const char header[STLHeaderSize])
OBJstream os(runTime.globalPath()/outputName)
errorManipArg< error, int > exit(error &err, const int errNo=1)
#define FatalErrorInFunction
A wrapped std::ifstream with possible compression handling (igzstream) that behaves much like a std::...
dimensionedScalar pos(const dimensionedScalar &ds)