formatter Class Referenceabstract

Abstract class for a VTK output stream formatter. More...

Inheritance diagram for formatter:
[legend]
Collaboration diagram for formatter:
[legend]

Public Types

enum  quoteChar : char { DOUBLE_QUOTE = '\"' , SINGLE_QUOTE = '\'' }
 Quoting for XML attributes. More...
 
typedef uint64_t headerType
 The header data is vtk UInt64. More...
 

Public Member Functions

virtual ~formatter ()=default
 Destructor. More...
 
std::ostream & os () noexcept
 Access to the underlying output stream. More...
 
virtual const vtk::outputOptionsopts () const =0
 The format-type / output options. More...
 
virtual const char * name () const =0
 Name for the XML output type or the legacy output type. More...
 
virtual const char * encoding () const =0
 Name for the XML append encoding. More...
 
void quoting (const quoteChar quote)
 Change quoting char for XML attributes (default: SINGLE_QUOTE) More...
 
virtual uint64_t offset (const uint64_t numbytes)
 Increase the append data offset by numbytes and sizeof(uint64_t). More...
 
virtual std::size_t encodedLength (std::size_t n) const
 The encoded length for binary output is pass-through. More...
 
virtual bool writeSize (const uint64_t numbytes)=0
 Write leading size for binary output. More...
 
virtual void write (const uint8_t val)=0
 
virtual void write (const label val)=0
 
virtual void write (const float val)=0
 
virtual void write (const double val)=0
 
virtual void flush ()=0
 Flush encoding, write newline etc. More...
 
void indent ()
 Add indenting according to the current XML tag depth. More...
 
void indent (label n)
 Add indenting of n spaces. More...
 
formatterxmlHeader ()
 Write XML header. More...
 
template<class... Args>
formatterxmlComment (const std::string &text, Args &&... args)
 Write XML comment (at the current indentation level) More...
 
template<class... Args>
formatteropenTag (const word &tagName, Args &&... args)
 Start an XML tag, optionally with attributes. More...
 
template<class... Args>
formatteropenTag (vtk::fileTag t, Args &&... args)
 Start an XML tag, optionally with attributes. More...
 
formattercloseTag (const bool isEmpty=false)
 Finish an XML tag, optional as an empty container. More...
 
formatterendTag (const word &tagName=word::null)
 An end XML tag, optional with sanity check. More...
 
virtual formatterendTag (vtk::fileTag t)
 An end XML tag with sanity check. More...
 
template<class... Args>
formattertag (const word &t, Args &&... args)
 Write XML tag without any attributes. Combines openTag/closeTag. More...
 
template<class... Args>
formattertag (vtk::fileTag t, Args &&... args)
 Write XML tag without any attributes. Combines openTag/closeTag. More...
 
formatterbeginVTKFile (const word &contentType, const word &contentVersion, const bool leaveOpen=false)
 
formatterbeginVTKFile (vtk::fileTag contentType, const word &contentVersion, const bool leaveOpen=false)
 
formatterbeginVTKFile (vtk::fileTag contentType, const bool leaveOpen=false)
 
template<vtk::fileTag ContentType>
formatterbeginVTKFile (bool leaveOpen=false)
 
formatterbeginAppendedData ()
 
formatterbeginBlock (label index, std::string name="")
 Begin "Block" XML section. More...
 
formatterendBlock ()
 End "Block" XML section. More...
 
formatterbeginPiece (label index, std::string name="")
 Begin "Piece" XML section. More...
 
virtual formatterendPiece ()
 End "Piece" XML section. More...
 
formatterDataSet (label index, std::string file="", bool autoName=true)
 Insert a single "DataSet" XML entry tag. More...
 
formatterDataSet (label index, std::string file, std::string name)
 Insert a single "DataSet" XML entry tag. More...
 
template<class Type , direction nComp = 1, int nTuple = 0>
formatterbeginDataArray (const word &dataName, uint64_t payLoad=npos, bool leaveOpen=false)
 Begin "DataArray" XML section. More...
 
template<class Type , direction nComp = 1, int nTuple = 0>
formatterbeginDataArray (const vtk::dataArrayAttr &dataName, uint64_t payLoad=npos, bool leaveOpen=false)
 Begin "DataArray" XML section. More...
 
virtual formatterendDataArray ()
 End "DataArray" XML section. More...
 
template<class Type , direction nComp = 1, int nTuple = 0>
formatterPDataArray (const word &dataName)
 Insert a single "PDataArray" XML entry tag. More...
 
formatterbeginFieldData ()
 Begin "FieldData" XML section. More...
 
formatterbeginCellData ()
 Begin "CellData" XML section. More...
 
formatterbeginPointData ()
 Begin "PointData" XML section. More...
 
virtual formatterendFieldData ()
 End "FieldData" XML section. More...
 
virtual formatterendCellData ()
 End "CellData" XML section. More...
 
virtual formatterendPointData ()
 End "PointData" XML section. More...
 
formatterendAppendedData ()
 End "AppendedData" XML section. More...
 
virtual formatterendVTKFile ()
 End "VTKFile" XML section. More...
 
formatterwriteTimeValue (scalar timeValue)
 Emit "TimeValue" for FieldData (name as per Catalyst output) More...
 
template<class... Args>
formatterxmlAttr (const word &k, const std::string &v, Args &&... args)
 Pair-wise write of XML key/value attributes. More...
 
template<class... Args>
formatterxmlAttr (const word &k, const int32_t v, Args &&... args)
 Pair-wise write of XML key/value attributes. More...
 
template<class... Args>
formatterxmlAttr (const word &k, const int64_t v, Args &&... args)
 Pair-wise write of XML key/value attributes. More...
 
template<class... Args>
formatterxmlAttr (const word &k, const uint64_t v, Args &&... args)
 Pair-wise write of XML key/value attributes. More...
 
template<class... Args>
formatterxmlAttr (const word &k, const scalar v, Args &&... args)
 Pair-wise write of XML key/value attributes. More...
 
template<class... Args>
formatterxmlAttr (const vtk::fileAttr &k, const std::string &v, Args &&... args)
 Pair-wise write of XML key/value attributes. More...
 
template<class... Args>
formatterxmlAttr (const vtk::fileAttr &k, const int32_t v, Args &&... args)
 Pair-wise write of XML key/value attributes. More...
 
template<class... Args>
formatterxmlAttr (const vtk::fileAttr &k, const int64_t v, Args &&... args)
 Pair-wise write of XML key/value attributes. More...
 
template<class... Args>
formatterxmlAttr (const vtk::fileAttr &k, const uint64_t v, Args &&... args)
 Pair-wise write of XML key/value attributes. More...
 
template<class... Args>
formatterxmlAttr (const vtk::fileAttr &k, const scalar v, Args &&... args)
 Pair-wise write of XML key/value attributes. More...
 
template<class Type , direction nComp = 1, int nTuple = 0>
formatteropenDataArray (const word &dataName)
 Open "DataArray" XML tag and leave open (requires a closeTag). More...
 
template<class Type , direction nComp = 1, int nTuple = 0>
formatteropenDataArray (const vtk::dataArrayAttr &dataName)
 Open "DataArray" XML tag and leave open (requires a closeTag). More...
 
template<class... Args>
Foam::vtk::formatterxmlComment (const std::string &text, Args &&... args)
 
template<class... Args>
Foam::vtk::formatteropenTag (const word &tagName, Args &&... args)
 
template<class... Args>
Foam::vtk::formatteropenTag (vtk::fileTag t, Args &&... args)
 
template<class... Args>
Foam::vtk::formattertag (const word &t, Args &&... args)
 
template<class... Args>
Foam::vtk::formattertag (vtk::fileTag t, Args &&... args)
 
template<Foam::vtk::fileTag ContentType>
Foam::vtk::formatterbeginVTKFile (bool leaveOpen)
 
template<class Type , Foam::direction nComp, int nTuple>
Foam::vtk::formatterbeginDataArray (const vtk::dataArrayAttr &dataName, uint64_t payLoad, bool leaveOpen)
 
template<class... Args>
Foam::vtk::formatterxmlAttr (const word &k, const std::string &v, Args &&... args)
 
template<class... Args>
Foam::vtk::formatterxmlAttr (const word &k, const int32_t v, Args &&... args)
 
template<class... Args>
Foam::vtk::formatterxmlAttr (const word &k, const int64_t v, Args &&... args)
 
template<class... Args>
Foam::vtk::formatterxmlAttr (const word &k, const uint64_t v, Args &&... args)
 
template<class... Args>
Foam::vtk::formatterxmlAttr (const word &k, const scalar v, Args &&... args)
 
template<class... Args>
Foam::vtk::formatterxmlAttr (const vtk::fileAttr &k, const std::string &v, Args &&... args)
 
template<class... Args>
Foam::vtk::formatterxmlAttr (const vtk::fileAttr &k, const int32_t v, Args &&... args)
 
template<class... Args>
Foam::vtk::formatterxmlAttr (const vtk::fileAttr &k, const int64_t v, Args &&... args)
 
template<class... Args>
Foam::vtk::formatterxmlAttr (const vtk::fileAttr &k, const uint64_t v, Args &&... args)
 
template<class... Args>
Foam::vtk::formatterxmlAttr (const vtk::fileAttr &k, const scalar v, Args &&... args)
 
template<class Type , Foam::direction nComp, int nTuple>
Foam::vtk::formatterbeginDataArray (const word &dataName, uint64_t payLoad, bool leaveOpen)
 
template<class Type , Foam::direction nComp, int nTuple>
Foam::vtk::formatterPDataArray (const word &dataName)
 

Static Public Attributes

static constexpr uint64_t npos = uint64_t(-1)
 Out of range position or size. More...
 

Protected Member Functions

bool canWriteAttr (const word &k) const
 
bool canWriteToplevel (const char *what) const
 
template<class Type >
void writeAttr (const word &k, const Type &v)
 Write XML key/value attribute pair (implementation). More...
 
formatterxmlAttr ()
 No-op write XML attribute (for templating code). More...
 
void xmlCommentLoop ()
 No-op XML comment loop (for templating code). More...
 
template<class... Args>
void xmlCommentLoop (const std::string &text, Args &&... args)
 Loop/output XML comments. More...
 
bool openTagImpl (const word &tagName)
 
 formatter (std::ostream &os)
 Construct and attach to an output stream. More...
 

Protected Attributes

std::ostream & os_
 The output stream for the formatter. More...
 
DynamicList< wordxmlTags_
 LIFO stack of current XML tags. More...
 
bool inTag_
 Tag open/closed/ended state. More...
 
char quote_
 Quoting character for XML attributes. More...
 

Detailed Description

Abstract class for a VTK output stream formatter.

Includes simple support for writing XML elements. By default uses single-quoting for XML attributes.

Source files

Definition at line 68 of file foamVtkFormatter.H.

Member Typedef Documentation

◆ headerType

typedef uint64_t headerType

The header data is vtk UInt64.

Definition at line 142 of file foamVtkFormatter.H.

Member Enumeration Documentation

◆ quoteChar

enum quoteChar : char

Quoting for XML attributes.

Enumerator
DOUBLE_QUOTE 

Double-quote XML attributes.

SINGLE_QUOTE 

Single-quote XML attributes.

Definition at line 73 of file foamVtkFormatter.H.

Constructor & Destructor Documentation

◆ formatter()

formatter ( std::ostream &  os)
inlineexplicitprotected

Construct and attach to an output stream.

Definition at line 59 of file foamVtkFormatterI.H.

◆ ~formatter()

virtual ~formatter ( )
virtualdefault

Destructor.

Member Function Documentation

◆ canWriteAttr()

bool canWriteAttr ( const word k) const
protected

Can write XML key/value attribute pair when inside a tag. Emit warning and return false if this condition is not met.

Definition at line 31 of file foamVtkFormatter.C.

References Foam::endl(), formatter::inTag_, k, and WarningInFunction.

Here is the call graph for this function:

◆ canWriteToplevel()

bool canWriteToplevel ( const char *  what) const
protected

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.

Definition at line 43 of file foamVtkFormatter.C.

References Foam::endl(), and WarningInFunction.

Here is the call graph for this function:

◆ writeAttr()

void writeAttr ( const word k,
const Type &  v 
)
inlineprotected

Write XML key/value attribute pair (implementation).

Definition at line 321 of file foamVtkFormatterI.H.

References k.

◆ xmlAttr() [1/21]

Foam::vtk::formatter & xmlAttr ( )
inlineprotected

No-op write XML attribute (for templating code).

Returns
formatter for chaining

Definition at line 30 of file foamVtkFormatterI.H.

Referenced by formatter::beginDataArray().

Here is the caller graph for this function:

◆ xmlCommentLoop() [1/2]

void xmlCommentLoop ( )
inlineprotected

No-op XML comment loop (for templating code).

Definition at line 36 of file foamVtkFormatterI.H.

◆ xmlCommentLoop() [2/2]

void xmlCommentLoop ( const std::string &  text,
Args &&...  args 
)
inlineprotected

Loop/output XML comments.

Definition at line 41 of file foamVtkFormatterI.H.

References args, Foam::indent(), and Foam::nl.

Here is the call graph for this function:

◆ openTagImpl()

bool openTagImpl ( const word tagName)
protected

Open XML tag (implementation), checking if not already inside another tag. Emit warning and return false if this condition is not met.

Definition at line 76 of file foamVtkFormatter.C.

References Foam::endl(), Foam::indent(), and WarningInFunction.

Here is the call graph for this function:

◆ os()

std::ostream & os ( )
inlinenoexcept

Access to the underlying output stream.

Definition at line 70 of file foamVtkFormatterI.H.

Referenced by asciiFormatter::asciiFormatter(), Foam::vtk::legacy::beginCellData(), Foam::vtk::legacy::beginPointData(), Foam::vtk::legacy::doubleField(), Foam::vtk::legacy::fieldData(), Foam::vtk::legacy::fileHeader(), Foam::vtk::legacy::floatField(), Foam::vtk::legacy::intField(), appendRawFormatter::write(), and legacyRawFormatter::write().

Here is the caller graph for this function:

◆ opts()

virtual const vtk::outputOptions & opts ( ) const
pure virtual

◆ name()

virtual const char * name ( ) const
pure virtual

Name for the XML output type or the legacy output type.

Implemented in appendBase64Formatter, appendRawFormatter, asciiFormatter, base64Formatter, legacyAsciiFormatter, and legacyRawFormatter.

Referenced by formatter::beginDataArray().

Here is the caller graph for this function:

◆ encoding()

virtual const char * encoding ( ) const
pure virtual

Name for the XML append encoding.

Implemented in appendRawFormatter, asciiFormatter, foamVtkBase64Layer, legacyAsciiFormatter, and legacyRawFormatter.

◆ quoting()

void quoting ( const quoteChar  quote)

Change quoting char for XML attributes (default: SINGLE_QUOTE)

Definition at line 58 of file foamVtkFormatter.C.

◆ offset()

uint64_t offset ( const uint64_t  numbytes)
virtual

Increase the append data offset by numbytes and sizeof(uint64_t).

The additional (uint64_t) size information is consistent with writeSize()

Returns
The previous data offset or formatter::npos for formats that do not support appending data.

Reimplemented in appendBase64Formatter, and appendRawFormatter.

Definition at line 64 of file foamVtkFormatter.C.

References formatter::npos.

Referenced by formatter::beginDataArray().

Here is the caller graph for this function:

◆ encodedLength()

std::size_t encodedLength ( std::size_t  n) const
virtual

The encoded length for binary output is pass-through.

Reimplemented in asciiFormatter, and foamVtkBase64Layer.

Definition at line 70 of file foamVtkFormatter.C.

References n.

◆ writeSize()

virtual bool writeSize ( const uint64_t  numbytes)
pure virtual

Write leading size for binary output.

Returns
True if used by the formatter.

Implemented in asciiFormatter, legacyRawFormatter, appendRawFormatter, and foamVtkBase64Layer.

Referenced by fileWriter::beginDataArray().

Here is the caller graph for this function:

◆ write() [1/4]

virtual void write ( const uint8_t  val)
pure virtual

Implemented in appendRawFormatter, asciiFormatter, foamVtkBase64Layer, and legacyRawFormatter.

Referenced by Foam::vtk::write(), Foam::vtk::write< double >(), Foam::vtk::write< float >(), Foam::vtk::write< label >(), Foam::vtk::writeIdentity(), Foam::vtk::writeList(), and Foam::vtk::legacy::writeTimeValue().

Here is the caller graph for this function:

◆ write() [2/4]

virtual void write ( const label  val)
pure virtual

◆ write() [3/4]

virtual void write ( const float  val)
pure virtual

◆ write() [4/4]

virtual void write ( const double  val)
pure virtual

◆ flush()

virtual void flush ( )
pure virtual

Flush encoding, write newline etc.

Implemented in appendRawFormatter, asciiFormatter, base64Formatter, foamVtkBase64Layer, and legacyRawFormatter.

Referenced by Foam::vtk::legacy::writeTimeValue().

Here is the caller graph for this function:

◆ indent() [1/2]

void indent ( )
inline

Add indenting according to the current XML tag depth.

Two spaces per depth.

Definition at line 76 of file foamVtkFormatterI.H.

References Foam::indent().

Here is the call graph for this function:

◆ indent() [2/2]

void indent ( label  n)
inline

Add indenting of n spaces.

Definition at line 82 of file foamVtkFormatterI.H.

References n.

◆ xmlHeader()

Foam::vtk::formatter & xmlHeader ( )
inline

Write XML header.

Returns
formatter for chaining

Definition at line 91 of file foamVtkFormatterI.H.

References Foam::nl.

◆ xmlComment() [1/2]

formatter & xmlComment ( const std::string &  text,
Args &&...  args 
)
inline

Write XML comment (at the current indentation level)

Returns
formatter for chaining

◆ openTag() [1/4]

formatter & openTag ( const word tagName,
Args &&...  args 
)
inline

Start an XML tag, optionally with attributes.

Returns
formatter for chaining

Referenced by formatter::beginDataArray().

Here is the caller graph for this function:

◆ openTag() [2/4]

formatter & openTag ( vtk::fileTag  t,
Args &&...  args 
)
inline

Start an XML tag, optionally with attributes.

Returns
formatter for chaining

◆ closeTag()

Foam::vtk::formatter & closeTag ( const bool  isEmpty = false)

Finish an XML tag, optional as an empty container.

Always adds a trailing newline.

Returns
formatter for chaining

Definition at line 99 of file foamVtkFormatter.C.

References Foam::endl(), and WarningInFunction.

Referenced by formatter::beginDataArray().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ endTag() [1/2]

Foam::vtk::formatter & endTag ( const word tagName = word::null)

An end XML tag, optional with sanity check.

Always adds a trailing newline.

Returns
formatter for chaining

Definition at line 125 of file foamVtkFormatter.C.

◆ endTag() [2/2]

Foam::vtk::formatter & endTag ( vtk::fileTag  t)
inlinevirtual

An end XML tag with sanity check.

Always adds a trailing newline.

Returns
formatter for chaining

Reimplemented in legacyAsciiFormatter, and legacyRawFormatter.

Definition at line 270 of file foamVtkFormatterI.H.

References Foam::vtk::fileTagNames.

◆ tag() [1/4]

formatter & tag ( const word t,
Args &&...  args 
)
inline

Write XML tag without any attributes. Combines openTag/closeTag.

Returns
formatter for chaining

Referenced by patchMeshWriter::beginPiece().

Here is the caller graph for this function:

◆ tag() [2/4]

formatter & tag ( vtk::fileTag  t,
Args &&...  args 
)
inline

Write XML tag without any attributes. Combines openTag/closeTag.

Returns
formatter for chaining

◆ beginVTKFile() [1/5]

Foam::vtk::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.

Parameters
leaveOpenLeave tag open for additional attributes.
Returns
formatter for chaining

Definition at line 157 of file foamVtkFormatter.C.

◆ beginVTKFile() [2/5]

Foam::vtk::formatter & beginVTKFile ( vtk::fileTag  contentType,
const word contentVersion,
const bool  leaveOpen = false 
)
inline

Add a "VTKFile" XML tag for contentType, followed by a tag for the contentType itself.

Parameters
leaveOpenLeave tag open for additional attributes.
Returns
formatter for chaining

Definition at line 189 of file foamVtkFormatterI.H.

References Foam::vtk::fileTagNames.

◆ beginVTKFile() [3/5]

Foam::vtk::formatter & beginVTKFile ( vtk::fileTag  contentType,
const bool  leaveOpen = false 
)
inline

Add a "VTKFile" XML tag for contentType, followed by a tag for the contentType itself.

Parameters
leaveOpenLeave tag open for additional attributes.
Returns
formatter for chaining

Definition at line 205 of file foamVtkFormatterI.H.

References Foam::vtk::fileContentVersions, and Foam::vtk::fileTagNames.

◆ beginVTKFile() [4/5]

formatter & beginVTKFile ( bool  leaveOpen = false)
inline

Add a "VTKFile" XML tag for contentType, followed by a tag for the contentType itself.

Parameters
leaveOpenLeave tag open for additional attributes.
Returns
formatter for chaining

◆ beginAppendedData()

Foam::vtk::formatter & beginAppendedData ( )

Add a "AppendedData" XML tag with the current encoding and output the requisite '_' prefix.

Returns
formatter for chaining

Definition at line 181 of file foamVtkFormatter.C.

◆ beginBlock()

Foam::vtk::formatter & beginBlock ( label  index,
std::string  name = "" 
)

Begin "Block" XML section.

Parameters
indexThe index of the block
nameThe name of the block (ignored if empty)
Returns
formatter for chaining

Definition at line 200 of file foamVtkFormatter.C.

◆ endBlock()

Foam::vtk::formatter & endBlock ( )
inline

End "Block" XML section.

Returns
formatter for chaining

Definition at line 300 of file foamVtkFormatterI.H.

References Foam::vtk::BLOCK.

◆ beginPiece()

Foam::vtk::formatter & beginPiece ( label  index,
std::string  name = "" 
)

Begin "Piece" XML section.

Parameters
indexThe index of the piece
nameThe name of the piece (ignored if empty)
Returns
formatter for chaining

Definition at line 221 of file foamVtkFormatter.C.

◆ endPiece()

Foam::vtk::formatter & endPiece ( )
inlinevirtual

End "Piece" XML section.

Returns
formatter for chaining

Reimplemented in legacyAsciiFormatter, and legacyRawFormatter.

Definition at line 306 of file foamVtkFormatterI.H.

References Foam::vtk::PIECE.

◆ DataSet() [1/2]

Foam::vtk::formatter & DataSet ( label  index,
std::string  file = "",
bool  autoName = true 
)

Insert a single "DataSet" XML entry tag.

Parameters
indexThe index of the DataSet
fileThe file name for the data (ignored if empty)
autoNameThe name for the data extracted from the file name (without extension)
Returns
formatter for chaining

Definition at line 242 of file foamVtkFormatter.C.

◆ DataSet() [2/2]

Foam::vtk::formatter & DataSet ( label  index,
std::string  file,
std::string  name 
)

Insert a single "DataSet" XML entry tag.

Parameters
indexThe index of the DataSet
fileThe file name for the data (ignored if empty)
nameThe name for the dataset
Returns
formatter for chaining

Definition at line 269 of file foamVtkFormatter.C.

◆ beginDataArray() [1/4]

formatter & beginDataArray ( const word dataName,
uint64_t  payLoad = npos,
bool  leaveOpen = false 
)

Begin "DataArray" XML section.

Parameters
dataNameThe name of the DataArray
payLoadAdditional payLoad information to increment the offset for an append formatter and add the "offset" attribute accordingly.
leaveOpenLeave tag open for additional attributes.
Returns
formatter for chaining

Referenced by fileWriter::beginDataArray().

Here is the caller graph for this function:

◆ beginDataArray() [2/4]

formatter & beginDataArray ( const vtk::dataArrayAttr dataName,
uint64_t  payLoad = npos,
bool  leaveOpen = false 
)
inline

Begin "DataArray" XML section.

Parameters
dataNameThe name of the DataArray as an enumeration
payLoadAdditional payLoad information to increment the offset for an append formatter and add the "offset" attribute accordingly.
leaveOpenLeave tag open for additional attributes.
Returns
formatter for chaining

◆ endDataArray()

Foam::vtk::formatter & endDataArray ( )
inlinevirtual

End "DataArray" XML section.

Returns
formatter for chaining

Reimplemented in legacyAsciiFormatter, and legacyRawFormatter.

Definition at line 294 of file foamVtkFormatterI.H.

References Foam::vtk::DATA_ARRAY.

◆ PDataArray() [1/2]

formatter & PDataArray ( const word dataName)

Insert a single "PDataArray" XML entry tag.

For some entries, the name is optional.

Returns
formatter for chaining

◆ beginFieldData()

Foam::vtk::formatter & beginFieldData ( )
inline

Begin "FieldData" XML section.

Definition at line 262 of file foamVtkFormatterI.H.

References Foam::vtk::FIELD_DATA.

◆ beginCellData()

Foam::vtk::formatter & beginCellData ( )
inline

Begin "CellData" XML section.

Definition at line 250 of file foamVtkFormatterI.H.

References Foam::vtk::CELL_DATA.

◆ beginPointData()

Foam::vtk::formatter & beginPointData ( )
inline

Begin "PointData" XML section.

Definition at line 256 of file foamVtkFormatterI.H.

References Foam::vtk::POINT_DATA.

◆ endFieldData()

Foam::vtk::formatter & endFieldData ( )
inlinevirtual

End "FieldData" XML section.

Reimplemented in legacyAsciiFormatter, and legacyRawFormatter.

Definition at line 288 of file foamVtkFormatterI.H.

References Foam::vtk::FIELD_DATA.

◆ endCellData()

Foam::vtk::formatter & endCellData ( )
inlinevirtual

End "CellData" XML section.

Reimplemented in legacyAsciiFormatter, and legacyRawFormatter.

Definition at line 276 of file foamVtkFormatterI.H.

References Foam::vtk::CELL_DATA.

◆ endPointData()

Foam::vtk::formatter & endPointData ( )
inlinevirtual

End "PointData" XML section.

Reimplemented in legacyAsciiFormatter, and legacyRawFormatter.

Definition at line 282 of file foamVtkFormatterI.H.

References Foam::vtk::POINT_DATA.

◆ endAppendedData()

Foam::vtk::formatter & endAppendedData ( )

End "AppendedData" XML section.

Returns
formatter for chaining

Definition at line 192 of file foamVtkFormatter.C.

◆ endVTKFile()

Foam::vtk::formatter & endVTKFile ( )
inlinevirtual

End "VTKFile" XML section.

Returns
formatter for chaining

Reimplemented in legacyAsciiFormatter, and legacyRawFormatter.

Definition at line 312 of file foamVtkFormatterI.H.

References Foam::vtk::VTK_FILE.

◆ writeTimeValue()

Foam::vtk::formatter & writeTimeValue ( scalar  timeValue)

Emit "TimeValue" for FieldData (name as per Catalyst output)

Definition at line 296 of file foamVtkFormatter.C.

◆ xmlAttr() [2/21]

formatter & xmlAttr ( const word k,
const std::string &  v,
Args &&...  args 
)
inline

Pair-wise write of XML key/value attributes.

Returns
formatter for chaining

◆ xmlAttr() [3/21]

formatter & xmlAttr ( const word k,
const int32_t  v,
Args &&...  args 
)
inline

Pair-wise write of XML key/value attributes.

Returns
formatter for chaining

◆ xmlAttr() [4/21]

formatter & xmlAttr ( const word k,
const int64_t  v,
Args &&...  args 
)
inline

Pair-wise write of XML key/value attributes.

Returns
formatter for chaining

◆ xmlAttr() [5/21]

formatter & xmlAttr ( const word k,
const uint64_t  v,
Args &&...  args 
)
inline

Pair-wise write of XML key/value attributes.

Returns
formatter for chaining

◆ xmlAttr() [6/21]

formatter & xmlAttr ( const word k,
const scalar  v,
Args &&...  args 
)
inline

Pair-wise write of XML key/value attributes.

Returns
formatter for chaining

◆ xmlAttr() [7/21]

formatter & xmlAttr ( const vtk::fileAttr k,
const std::string &  v,
Args &&...  args 
)
inline

Pair-wise write of XML key/value attributes.

Returns
formatter for chaining

◆ xmlAttr() [8/21]

formatter & xmlAttr ( const vtk::fileAttr k,
const int32_t  v,
Args &&...  args 
)
inline

Pair-wise write of XML key/value attributes.

Returns
formatter for chaining

◆ xmlAttr() [9/21]

formatter & xmlAttr ( const vtk::fileAttr k,
const int64_t  v,
Args &&...  args 
)
inline

Pair-wise write of XML key/value attributes.

Returns
formatter for chaining

◆ xmlAttr() [10/21]

formatter & xmlAttr ( const vtk::fileAttr k,
const uint64_t  v,
Args &&...  args 
)
inline

Pair-wise write of XML key/value attributes.

Returns
formatter for chaining

◆ xmlAttr() [11/21]

formatter & xmlAttr ( const vtk::fileAttr k,
const scalar  v,
Args &&...  args 
)
inline

Pair-wise write of XML key/value attributes.

Returns
formatter for chaining

◆ openDataArray() [1/2]

formatter & openDataArray ( const word dataName)
inline

Open "DataArray" XML tag and leave open (requires a closeTag).

Deprecated:
Use beginDataArray instead (SEPT-2018)

Definition at line 524 of file foamVtkFormatter.H.

References formatter::npos.

◆ openDataArray() [2/2]

formatter & openDataArray ( const vtk::dataArrayAttr dataName)
inline

Open "DataArray" XML tag and leave open (requires a closeTag).

Deprecated:
Use beginDataArray instead (SEPT-2018)

Definition at line 535 of file foamVtkFormatter.H.

References formatter::npos.

◆ xmlComment() [2/2]

Foam::vtk::formatter & xmlComment ( const std::string &  text,
Args &&...  args 
)
inline

Definition at line 103 of file foamVtkFormatterI.H.

References args, Foam::indent(), and Foam::nl.

Here is the call graph for this function:

◆ openTag() [3/4]

Foam::vtk::formatter & openTag ( const word tagName,
Args &&...  args 
)
inline

Definition at line 135 of file foamVtkFormatterI.H.

References args.

◆ openTag() [4/4]

Foam::vtk::formatter & openTag ( vtk::fileTag  t,
Args &&...  args 
)
inline

Definition at line 151 of file foamVtkFormatterI.H.

References args, and Foam::vtk::fileTagNames.

◆ tag() [3/4]

Foam::vtk::formatter & tag ( const word t,
Args &&...  args 
)
inline

Definition at line 162 of file foamVtkFormatterI.H.

References args.

◆ tag() [4/4]

Foam::vtk::formatter & tag ( vtk::fileTag  t,
Args &&...  args 
)
inline

Definition at line 177 of file foamVtkFormatterI.H.

References args, and Foam::vtk::fileTagNames.

◆ beginVTKFile() [5/5]

Foam::vtk::formatter & beginVTKFile ( bool  leaveOpen)
inline

Definition at line 221 of file foamVtkFormatterI.H.

References Foam::vtk::fileContentVersions, and Foam::vtk::fileTagNames.

◆ beginDataArray() [3/4]

Foam::vtk::formatter & beginDataArray ( const vtk::dataArrayAttr dataName,
uint64_t  payLoad,
bool  leaveOpen 
)
inline

Definition at line 233 of file foamVtkFormatterI.H.

References Foam::vtk::dataArrayAttrNames.

◆ xmlAttr() [12/21]

Foam::vtk::formatter & xmlAttr ( const word k,
const std::string &  v,
Args &&...  args 
)
inline

Definition at line 328 of file foamVtkFormatterI.H.

References args, and k.

◆ xmlAttr() [13/21]

Foam::vtk::formatter & xmlAttr ( const word k,
const int32_t  v,
Args &&...  args 
)
inline

Definition at line 343 of file foamVtkFormatterI.H.

References args, and k.

◆ xmlAttr() [14/21]

Foam::vtk::formatter & xmlAttr ( const word k,
const int64_t  v,
Args &&...  args 
)
inline

Definition at line 358 of file foamVtkFormatterI.H.

References args, and k.

◆ xmlAttr() [15/21]

Foam::vtk::formatter & xmlAttr ( const word k,
const uint64_t  v,
Args &&...  args 
)
inline

Definition at line 373 of file foamVtkFormatterI.H.

References args, and k.

◆ xmlAttr() [16/21]

Foam::vtk::formatter & xmlAttr ( const word k,
const scalar  v,
Args &&...  args 
)
inline

Definition at line 388 of file foamVtkFormatterI.H.

References args, and k.

◆ xmlAttr() [17/21]

Foam::vtk::formatter & xmlAttr ( const vtk::fileAttr k,
const std::string &  v,
Args &&...  args 
)
inline

Definition at line 403 of file foamVtkFormatterI.H.

References args, Foam::vtk::fileAttrNames, and k.

◆ xmlAttr() [18/21]

Foam::vtk::formatter & xmlAttr ( const vtk::fileAttr k,
const int32_t  v,
Args &&...  args 
)
inline

Definition at line 418 of file foamVtkFormatterI.H.

References args, Foam::vtk::fileAttrNames, and k.

◆ xmlAttr() [19/21]

Foam::vtk::formatter & xmlAttr ( const vtk::fileAttr k,
const int64_t  v,
Args &&...  args 
)
inline

Definition at line 433 of file foamVtkFormatterI.H.

References args, Foam::vtk::fileAttrNames, and k.

◆ xmlAttr() [20/21]

Foam::vtk::formatter & xmlAttr ( const vtk::fileAttr k,
const uint64_t  v,
Args &&...  args 
)
inline

Definition at line 448 of file foamVtkFormatterI.H.

References args, Foam::vtk::fileAttrNames, and k.

◆ xmlAttr() [21/21]

Foam::vtk::formatter & xmlAttr ( const vtk::fileAttr k,
const scalar  v,
Args &&...  args 
)
inline

Definition at line 463 of file foamVtkFormatterI.H.

References args, Foam::vtk::fileAttrNames, and k.

◆ beginDataArray() [4/4]

Foam::vtk::formatter & beginDataArray ( const word dataName,
uint64_t  payLoad,
bool  leaveOpen 
)

Definition at line 32 of file foamVtkFormatterTemplates.C.

References formatter::closeTag(), Foam::vtk::DATA_ARRAY, formatter::name(), formatter::npos, Foam::vtk::NUMBER_OF_COMPONENTS, Foam::vtk::NUMBER_OF_TUPLES, formatter::offset(), formatter::openTag(), and formatter::xmlAttr().

Here is the call graph for this function:

◆ PDataArray() [2/2]

Foam::vtk::formatter & PDataArray ( const word dataName)

Member Data Documentation

◆ os_

std::ostream& os_
protected

The output stream for the formatter.

Definition at line 85 of file foamVtkFormatter.H.

◆ xmlTags_

DynamicList<word> xmlTags_
protected

LIFO stack of current XML tags.

Definition at line 88 of file foamVtkFormatter.H.

◆ inTag_

bool inTag_
mutableprotected

Tag open/closed/ended state.

Definition at line 91 of file foamVtkFormatter.H.

Referenced by formatter::canWriteAttr().

◆ quote_

char quote_
protected

Quoting character for XML attributes.

Definition at line 94 of file foamVtkFormatter.H.

◆ npos


The documentation for this class was generated from the following files: