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 ()
 Construct null - XML insitu ASCII format with default precision. More...
 
 outputOptions (enum formatType fmtType)
 Construct with specified format and default (ASCII) precision. More...
 
 outputOptions (enum 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...
 
formatType fmt () const
 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
 True if writer uses legacy file format. More...
 
bool xml () const
 True if writer uses XML file format (non-legacy) More...
 
bool append () const
 True if output format uses an append mode. More...
 
bool insitu () const
 True if output format does not use an append mode. More...
 
bool ascii () const
 True if output format is ASCII. More...
 
unsigned precision () const
 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

Construct null - XML insitu ASCII format with default precision.

Definition at line 32 of file foamVtkOutputOptionsI.H.

References Foam::vtk::INLINE_ASCII.

◆ outputOptions() [2/3]

outputOptions ( enum formatType  fmtType)
inline

Construct with specified format and default (ASCII) precision.

Note
This constructor should remain non-explicit.

Definition at line 40 of file foamVtkOutputOptionsI.H.

◆ outputOptions() [3/3]

outputOptions ( enum formatType  fmtType,
unsigned  prec 
)
inline

Construct with specified format and (ASCII) write precision.

Definition at line 50 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 63 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
inline

The output format type.

Definition at line 71 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 77 of file foamVtkOutputOptionsI.H.

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

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

Here is the caller graph for this function:

◆ legacy() [1/2]

bool legacy ( ) const
inline

True if writer uses legacy file format.

Definition at line 88 of file foamVtkOutputOptionsI.H.

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

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

Here is the caller graph for this function:

◆ xml()

bool xml ( ) const
inline

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

Definition at line 98 of file foamVtkOutputOptionsI.H.

◆ append() [1/2]

bool append ( ) const
inline

True if output format uses an append mode.

Definition at line 104 of file foamVtkOutputOptionsI.H.

References Foam::vtk::APPEND_BASE64, and Foam::vtk::APPEND_BINARY.

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

Here is the caller graph for this function:

◆ insitu()

bool insitu ( ) const
inline

True if output format does not use an append mode.

Definition at line 114 of file foamVtkOutputOptionsI.H.

References append().

Here is the call graph for this function:

◆ ascii() [1/2]

bool ascii ( ) const
inline

True if output format is ASCII.

Definition at line 120 of file foamVtkOutputOptionsI.H.

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

Here is the caller graph for this function:

◆ precision() [1/2]

unsigned precision ( ) const
inline

Return the ASCII write precision.

Definition at line 126 of file foamVtkOutputOptionsI.H.

Referenced by VTKsurfaceFormatCore::formatOptions(), VTPsurfaceFormatCore::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: