Binary output for the VTK legacy format, always written as big-endian and with 32-bit integers. More...
#include <foamVtkLegacyRawFormatter.H>


Public Member Functions | |
| legacyRawFormatter (std::ostream &os) | |
| Construct and attach to an output stream. | |
| virtual | ~legacyRawFormatter ()=default |
| Destructor. | |
| virtual const vtk::outputOptions & | opts () const |
| The output is LEGACY_BINARY. | |
| virtual const char * | name () const |
| Name for the legacy binary output type ("BINARY"). | |
| virtual const char * | encoding () const |
| Name for the XML append encoding (unused). | |
| virtual bool | writeSize (const uint64_t ignored) |
| Write leading size - a no-op for legacy binary output. | |
| virtual void | write (const uint8_t val) |
| virtual void | write (const label val) |
| virtual void | write (const float val) |
| virtual void | write (const double val) |
| virtual void | flush () |
| Write a newline to the output. | |
| virtual formatter & | endTag (vtk::fileTag) |
| An end XML tag with sanity check. | |
| virtual formatter & | endDataArray () |
| End "DataArray" XML section. | |
| virtual formatter & | endFieldData () |
| End "FieldData" XML section. | |
| virtual formatter & | endCellData () |
| End "CellData" XML section. | |
| virtual formatter & | endPointData () |
| End "PointData" XML section. | |
| virtual formatter & | endPiece () |
| End "Piece" XML section. | |
| virtual formatter & | endVTKFile () |
| End "VTKFile" XML section. | |
| Public Member Functions inherited from formatter | |
| virtual | ~formatter ()=default |
| Destructor. | |
| std::ostream & | os () noexcept |
| Access to the underlying output stream. | |
| void | quoting (quoteChar quote) noexcept |
| Change quoting char for XML attributes (default: SINGLE_QUOTE). | |
| virtual uint64_t | offset (const uint64_t numbytes) |
| Increase the append data offset by numbytes and sizeof(uint64_t). | |
| virtual std::size_t | encodedLength (std::size_t n) const |
| The encoded length for binary output is pass-through. | |
| void | indent () |
| Add indenting according to the current XML tag depth. | |
| void | indent (label n) |
| Add indenting of n spaces. | |
| formatter & | xmlHeader () |
| Write XML header. | |
| template<class... Args> | |
| formatter & | xmlComment (const std::string &text, Args &&... args) |
| Write XML comment (at the current indentation level). | |
| template<class... Args> | |
| formatter & | openTag (const word &tagName, Args &&... args) |
| Start an XML tag, optionally with attributes. | |
| template<class... Args> | |
| formatter & | openTag (vtk::fileTag t, Args &&... args) |
| Start an XML tag, optionally with attributes. | |
| formatter & | closeTag (const bool isEmpty=false) |
| Finish an XML tag, optional as an empty container. | |
| formatter & | endTag (const word &tagName=word::null) |
| An end XML tag, optional with sanity check. | |
| template<class... Args> | |
| formatter & | tag (const word &t, Args &&... args) |
| Write XML tag without any attributes. Combines openTag/closeTag. | |
| template<class... Args> | |
| formatter & | tag (vtk::fileTag t, Args &&... args) |
| Write XML tag without any attributes. Combines openTag/closeTag. | |
| formatter & | beginVTKFile (const word &contentType, const word &contentVersion, const bool leaveOpen=false) |
| Add a "VTKFile" XML tag for contentType, followed by a tag for the contentType itself. | |
| formatter & | beginVTKFile (vtk::fileTag contentType, const word &contentVersion, const bool leaveOpen=false) |
| Add a "VTKFile" XML tag for contentType, followed by a tag for the contentType itself. | |
| formatter & | beginVTKFile (vtk::fileTag contentType, const bool leaveOpen=false) |
| Add a "VTKFile" XML tag for contentType, followed by a tag for the contentType itself. | |
| template<vtk::fileTag ContentType> | |
| formatter & | beginVTKFile (bool leaveOpen=false) |
| Add a "VTKFile" XML tag for contentType, followed by a tag for the contentType itself. | |
| formatter & | beginAppendedData () |
| Add a "AppendedData" XML tag with the current encoding and output the requisite '_' prefix. | |
| formatter & | beginBlock (label index, std::string name="") |
| Begin "Block" XML section. | |
| formatter & | endBlock () |
| End "Block" XML section. | |
| formatter & | beginPiece (label index, std::string name="") |
| Begin "Piece" XML section. | |
| formatter & | DataSet (label index, std::string file="", bool autoName=true) |
| Insert a single "DataSet" XML entry tag. | |
| formatter & | DataSet (label index, std::string file, std::string name) |
| Insert a single "DataSet" XML entry tag. | |
| template<class Type, direction nComp = 1, int nTuple = 0> | |
| formatter & | beginDataArray (const word &dataName, uint64_t payLoad=npos, bool leaveOpen=false) |
| Begin "DataArray" XML section. | |
| template<class Type, direction nComp = 1, int nTuple = 0> | |
| formatter & | beginDataArray (const vtk::dataArrayAttr &dataName, uint64_t payLoad=npos, bool leaveOpen=false) |
| Begin "DataArray" XML section. | |
| template<class Type, direction nComp = 1, int nTuple = 0> | |
| formatter & | PDataArray (const word &dataName) |
| Insert a single "PDataArray" XML entry tag. | |
| formatter & | beginFieldData () |
| Begin "FieldData" XML section. | |
| formatter & | beginCellData () |
| Begin "CellData" XML section. | |
| formatter & | beginPointData () |
| Begin "PointData" XML section. | |
| formatter & | endAppendedData () |
| End "AppendedData" XML section. | |
| formatter & | writeTimeValue (scalar timeValue) |
| Emit "TimeValue" for FieldData (name as per Catalyst output). | |
| template<class... Args> | |
| formatter & | xmlAttr (const word &k, const std::string &v, Args &&... args) |
| Pair-wise write of XML key/value attributes. | |
| template<class... Args> | |
| formatter & | xmlAttr (const word &k, const int32_t v, Args &&... args) |
| Pair-wise write of XML key/value attributes. | |
| template<class... Args> | |
| formatter & | xmlAttr (const word &k, const int64_t v, Args &&... args) |
| Pair-wise write of XML key/value attributes. | |
| template<class... Args> | |
| formatter & | xmlAttr (const word &k, const uint64_t v, Args &&... args) |
| Pair-wise write of XML key/value attributes. | |
| template<class... Args> | |
| formatter & | xmlAttr (const word &k, const scalar v, Args &&... args) |
| Pair-wise write of XML key/value attributes. | |
| template<class... Args> | |
| formatter & | xmlAttr (const vtk::fileAttr &k, const std::string &v, Args &&... args) |
| Pair-wise write of XML key/value attributes. | |
| template<class... Args> | |
| formatter & | xmlAttr (const vtk::fileAttr &k, const int32_t v, Args &&... args) |
| Pair-wise write of XML key/value attributes. | |
| template<class... Args> | |
| formatter & | xmlAttr (const vtk::fileAttr &k, const int64_t v, Args &&... args) |
| Pair-wise write of XML key/value attributes. | |
| template<class... Args> | |
| formatter & | xmlAttr (const vtk::fileAttr &k, const uint64_t v, Args &&... args) |
| Pair-wise write of XML key/value attributes. | |
| template<class... Args> | |
| formatter & | xmlAttr (const vtk::fileAttr &k, const scalar v, Args &&... args) |
| Pair-wise write of XML key/value attributes. | |
| template<class Type, direction nComp = 1, int nTuple = 0> | |
| formatter & | openDataArray (const word &dataName) |
| Open "DataArray" XML tag and leave open (requires a closeTag). | |
| template<class Type, direction nComp = 1, int nTuple = 0> | |
| formatter & | openDataArray (const vtk::dataArrayAttr &dataName) |
| Open "DataArray" XML tag and leave open (requires a closeTag). | |
| template<class... Args> | |
| Foam::vtk::formatter & | xmlComment (const std::string &text, Args &&... args) |
| template<class... Args> | |
| Foam::vtk::formatter & | openTag (const word &tagName, Args &&... args) |
| template<class... Args> | |
| Foam::vtk::formatter & | openTag (vtk::fileTag t, Args &&... args) |
| template<class... Args> | |
| Foam::vtk::formatter & | tag (const word &t, Args &&... args) |
| template<class... Args> | |
| Foam::vtk::formatter & | tag (vtk::fileTag t, Args &&... args) |
| template<Foam::vtk::fileTag ContentType> | |
| Foam::vtk::formatter & | beginVTKFile (bool leaveOpen) |
| template<class Type, Foam::direction nComp, int nTuple> | |
| Foam::vtk::formatter & | beginDataArray (const vtk::dataArrayAttr &dataName, uint64_t payLoad, bool leaveOpen) |
| template<class... Args> | |
| Foam::vtk::formatter & | xmlAttr (const word &k, const std::string &v, Args &&... args) |
| template<class... Args> | |
| Foam::vtk::formatter & | xmlAttr (const word &k, const int32_t v, Args &&... args) |
| template<class... Args> | |
| Foam::vtk::formatter & | xmlAttr (const word &k, const int64_t v, Args &&... args) |
| template<class... Args> | |
| Foam::vtk::formatter & | xmlAttr (const word &k, const uint64_t v, Args &&... args) |
| template<class... Args> | |
| Foam::vtk::formatter & | xmlAttr (const word &k, const scalar v, Args &&... args) |
| template<class... Args> | |
| Foam::vtk::formatter & | xmlAttr (const vtk::fileAttr &k, const std::string &v, Args &&... args) |
| template<class... Args> | |
| Foam::vtk::formatter & | xmlAttr (const vtk::fileAttr &k, const int32_t v, Args &&... args) |
| template<class... Args> | |
| Foam::vtk::formatter & | xmlAttr (const vtk::fileAttr &k, const int64_t v, Args &&... args) |
| template<class... Args> | |
| Foam::vtk::formatter & | xmlAttr (const vtk::fileAttr &k, const uint64_t v, Args &&... args) |
| template<class... Args> | |
| Foam::vtk::formatter & | xmlAttr (const vtk::fileAttr &k, const scalar v, Args &&... args) |
Protected Member Functions | |
| void | write (const char *s, std::streamsize n) |
| Write. | |
| legacyRawFormatter (const legacyRawFormatter &)=delete | |
| No copy construct. | |
| void | operator= (const legacyRawFormatter &)=delete |
| No copy assignment. | |
| Protected Member Functions inherited from formatter | |
| bool | canWriteAttr (const word &k) const |
| Can write XML key/value attribute pair when inside a tag. Emit warning and return false if this condition is not met. | |
| bool | canWriteToplevel (const char *what) const |
| Can write tag-like top-level content (eg, comment, ...) when not already inside a tag. Emit warning and return false if this condition is not met. | |
| template<class Type> | |
| void | writeAttr (const word &k, const Type &v) |
| Write XML key/value attribute pair (implementation). | |
| formatter & | xmlAttr () |
| No-op write XML attribute (for templating code). | |
| template<class... Args> | |
| void | xmlCommentLoop (const std::string &text, Args &&... args) |
| Loop/output XML comments. | |
| bool | openTagImpl (const word &tagName) |
| Open XML tag (implementation), checking if not already inside another tag. Emit warning and return false if this condition is not met. | |
| formatter (std::ostream &os) | |
| Construct and attach to an output stream. | |
Additional Inherited Members | |
| Public Types inherited from formatter | |
| enum | quoteChar : char { DOUBLE_QUOTE = '\"' , SINGLE_QUOTE = '\'' } |
| Quoting for XML attributes. More... | |
| typedef uint64_t | headerType |
| The header data is vtk UInt64. | |
| Static Public Attributes inherited from formatter | |
| static constexpr uint64_t | npos = uint64_t(-1) |
| Out of range position or size. | |
| Protected Attributes inherited from formatter | |
| std::ostream & | os_ |
| The output stream for the formatter. | |
| DynamicList< word > | xmlTags_ |
| LIFO stack of current XML tags. | |
| bool | inTag_ |
| Tag open/closed/ended state. | |
| char | quote_ |
| Quoting character for XML attributes. | |
Binary output for the VTK legacy format, always written as big-endian and with 32-bit integers.
This format should never be used for OpenFOAM with 64-bit label sizes.
Definition at line 51 of file foamVtkLegacyRawFormatter.H.
|
protecteddelete |
No copy construct.
References legacyRawFormatter().
Referenced by legacyRawFormatter(), and operator=().


|
explicit |
Construct and attach to an output stream.
References formatter::os().

|
virtualdefault |
Destructor.
|
protected |
|
protecteddelete |
|
virtual |
The output is LEGACY_BINARY.
Implements formatter.
|
virtual |
Name for the legacy binary output type ("BINARY").
Implements formatter.
|
virtual |
|
virtual |
Write leading size - a no-op for legacy binary output.
Implements formatter.
|
virtual |
Implements formatter.
|
virtual |
Implements formatter.
|
virtual |
Implements formatter.
|
virtual |
Implements formatter.
|
virtual |
Write a newline to the output.
Implements formatter.
|
inlinevirtual |
An end XML tag with sanity check.
Always adds a trailing newline.
Reimplemented from formatter.
Definition at line 137 of file foamVtkLegacyRawFormatter.H.
References formatter::formatter().

|
inlinevirtual |
End "DataArray" XML section.
Reimplemented from formatter.
Definition at line 138 of file foamVtkLegacyRawFormatter.H.
References formatter::formatter().

|
inlinevirtual |
End "FieldData" XML section.
Reimplemented from formatter.
Definition at line 139 of file foamVtkLegacyRawFormatter.H.
References formatter::formatter().

|
inlinevirtual |
End "CellData" XML section.
Reimplemented from formatter.
Definition at line 140 of file foamVtkLegacyRawFormatter.H.
References formatter::formatter().

|
inlinevirtual |
End "PointData" XML section.
Reimplemented from formatter.
Definition at line 141 of file foamVtkLegacyRawFormatter.H.
References formatter::formatter().

|
inlinevirtual |
End "Piece" XML section.
Reimplemented from formatter.
Definition at line 142 of file foamVtkLegacyRawFormatter.H.
References formatter::formatter().

|
inlinevirtual |
End "VTKFile" XML section.
Reimplemented from formatter.
Definition at line 143 of file foamVtkLegacyRawFormatter.H.
References formatter::formatter().
