outputOptions Class Reference

Encapsulated combinations of output format options. This is primarily useful when defining the output type based on some command-line arguments or dictionary contents. However, it can also be a useful alternative to using the underlying enumeration directly, since this class provides additional methods not possible with an enum. More...

Public Member Functions

 outputOptions ()
 Default construct - XML insitu ASCII format with default precision. More...
 
 outputOptions (enum vtk::formatType fmtType)
 Construct with specified format and default (ASCII) precision. More...
 
 outputOptions (enum vtk::formatType fmtType, unsigned prec)
 Construct with specified format and (ASCII) write precision. More...
 
autoPtr< formatternewFormatter (std::ostream &os) const
 Return new formatter based on the selected output options. More...
 
vtk::formatType fmt () const noexcept
 The output format type. More...
 
word ext (vtk::fileTag contentType) const
 The file extension (legacy or xml) for the given content-type. More...
 
bool legacy () const noexcept
 True if writer uses legacy file format. More...
 
bool xml () const noexcept
 True if writer uses XML file format (non-legacy) More...
 
bool append () const noexcept
 True if output format uses an append mode. More...
 
bool insitu () const noexcept
 True if output format does not use an append mode. More...
 
bool ascii () const noexcept
 True if output format is ASCII. More...
 
unsigned precision () const noexcept
 Return the ASCII write precision. More...
 
outputOptionsascii (bool on)
 Toggle ASCII mode on/off. More...
 
outputOptionsappend (bool on)
 Toggle append mode on/off. More...
 
outputOptionslegacy (bool on)
 Toggle legacy mode on/off. More...
 
outputOptionsprecision (unsigned prec)
 Set the write precision to be used for new ASCII formatters. More...
 
string description () const
 A text description about the output option selected. More...
 

Detailed Description

Encapsulated combinations of output format options. This is primarily useful when defining the output type based on some command-line arguments or dictionary contents. However, it can also be a useful alternative to using the underlying enumeration directly, since this class provides additional methods not possible with an enum.

Source files

Definition at line 59 of file foamVtkOutputOptions.H.

Constructor & Destructor Documentation

◆ outputOptions() [1/3]

outputOptions ( )
inline

Default construct - XML insitu ASCII format with default precision.

Definition at line 30 of file foamVtkOutputOptionsI.H.

References Foam::vtk::INLINE_ASCII.

◆ outputOptions() [2/3]

outputOptions ( enum vtk::formatType  fmtType)
inline

Construct with specified format and default (ASCII) precision.

Note
This constructor should remain non-explicit.

Definition at line 37 of file foamVtkOutputOptionsI.H.

◆ outputOptions() [3/3]

outputOptions ( enum vtk::formatType  fmtType,
unsigned  prec 
)
inline

Construct with specified format and (ASCII) write precision.

Definition at line 47 of file foamVtkOutputOptionsI.H.

Member Function Documentation

◆ newFormatter()

Foam::autoPtr< Foam::vtk::formatter > newFormatter ( std::ostream &  os) const
inline

Return new formatter based on the selected output options.

Definition at line 61 of file foamVtkOutputOptionsI.H.

References Foam::vtk::newFormatter(), and os().

Referenced by VTKsurfaceFormat< Face >::write(), VTPsurfaceFormat< Face >::write(), and Foam::vtk::writePointSet().

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

◆ fmt()

Foam::vtk::formatType fmt ( ) const
inlinenoexcept

The output format type.

Definition at line 69 of file foamVtkOutputOptionsI.H.

Referenced by vtkWriter::vtkWriter().

Here is the caller graph for this function:

◆ ext()

Foam::word ext ( vtk::fileTag  contentType) const
inline

The file extension (legacy or xml) for the given content-type.

Definition at line 75 of file foamVtkOutputOptionsI.H.

References Foam::vtk::fileExtension, and Foam::vtk::legacy::fileExtension.

Referenced by polyWriter::ext(), internalMeshWriter::ext(), and patchMeshWriter::ext().

Here is the caller graph for this function:

◆ legacy() [1/2]

bool legacy ( ) const
inlinenoexcept

True if writer uses legacy file format.

Definition at line 86 of file foamVtkOutputOptionsI.H.

References Foam::vtk::LEGACY_ASCII, and Foam::vtk::LEGACY_BINARY.

Referenced by VTPsurfaceFormatCore::formatOptions(), VTKsurfaceFormatCore::formatOptions(), lagrangianWriter::lagrangianWriter(), surfaceFieldWriter::surfaceFieldWriter(), vtkWriter::vtkWriter(), and Foam::vtk::writePointSet().

Here is the caller graph for this function:

◆ xml()

bool xml ( ) const
inlinenoexcept

True if writer uses XML file format (non-legacy)

Definition at line 96 of file foamVtkOutputOptionsI.H.

◆ append() [1/2]

◆ insitu()

bool insitu ( ) const
inlinenoexcept

True if output format does not use an append mode.

Definition at line 112 of file foamVtkOutputOptionsI.H.

References append().

Here is the call graph for this function:

◆ ascii() [1/2]

bool ascii ( ) const
inlinenoexcept

True if output format is ASCII.

Definition at line 118 of file foamVtkOutputOptionsI.H.

Referenced by VTPsurfaceFormatCore::formatOptions(), VTKsurfaceFormatCore::formatOptions(), and vtkWriter::vtkWriter().

Here is the caller graph for this function:

◆ precision() [1/2]

unsigned precision ( ) const
inlinenoexcept

Return the ASCII write precision.

Definition at line 124 of file foamVtkOutputOptionsI.H.

Referenced by VTPsurfaceFormatCore::formatOptions(), VTKsurfaceFormatCore::formatOptions(), and VTKedgeFormat::write().

Here is the caller graph for this function:

◆ ascii() [2/2]

Foam::vtk::outputOptions & ascii ( bool  on)

Toggle ASCII mode on/off.

In XML append mode, this switches between base64 and raw binary. In XML inline mode, this switches between ASCII and base64. In legacy mode, this switches between ASCII and binary.

Returns
outputOptions for chaining

Definition at line 33 of file foamVtkOutputOptions.C.

References Foam::vtk::APPEND_BASE64, Foam::vtk::APPEND_BINARY, Foam::vtk::INLINE_ASCII, Foam::vtk::INLINE_BASE64, Foam::vtk::LEGACY_ASCII, and Foam::vtk::LEGACY_BINARY.

◆ append() [2/2]

◆ legacy() [2/2]

◆ precision() [2/2]

Foam::vtk::outputOptions & precision ( unsigned  prec)

Set the write precision to be used for new ASCII formatters.

Returns
outputOptions for chaining

Definition at line 165 of file foamVtkOutputOptions.C.

◆ description()

Foam::string description ( ) const

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