33 const char* Foam::vtk::foamVtkBase64Layer::encoding_ =
"base64";
75 write(reinterpret_cast<const char*>(&numbytes),
sizeof(uint64_t));
89 write(reinterpret_cast<const char*>(&val),
sizeof(label));
96 write(reinterpret_cast<const char*>(&val),
sizeof(
float));
109 else if (val <= std::numeric_limits<float>::lowest())
111 write(std::numeric_limits<float>::lowest());
virtual void flush()
End the encoding sequence (padding the final characters with '=')
An output filter layer to write base-64 encoded content.
virtual ~foamVtkBase64Layer()
Destructor. Closes/flushes the underlying layer.
virtual bool writeSize(const uint64_t numbytes)
Write leading size for binary output.
foamVtkBase64Layer(const foamVtkBase64Layer &)=delete
No copy construct.
label max(const labelHashSet &set, label maxValue=labelMin)
Find the max value in labelHashSet, optionally limited by second argument.
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
void write(const char *s, std::streamsize n)
Encode the character sequence, writing when possible.
bool close()
End the encoding sequence, padding the final characters with '='.
OBJstream os(runTime.globalPath()/outputName)
virtual const char * encoding() const
Name for the XML append encoding ("base64").
void add(char c)
Add a character to the group, outputting when the group is full.
void write(const char *s, std::streamsize n)
Write.
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
static std::size_t encodedLength(std::size_t n)
The encoded length has 4 bytes out for every 3 bytes in.
virtual std::size_t encodedLength(std::size_t n) const
The encoded length for base64 encoded output.