Base class from which all file writers must inherit.
#include <Mesh/FileIO/Writers/basewriter.h>
◆ BaseWriter() [1/2]
- Parameters
-
fName | Defines the base file name for the writer. The file name extension can be omitted if it matches the return value of GetFormatExtension(). |
The constructor initially sets the baseNameSuffix data member to an empty string. This suffix is easily changed through a call to SetBaseNameSuffix(). The final file name is constructed as the base file name (fName), followed by the base filename suffix (set with SetBaseNameSuffix()) and then the filename extension if necessary.
◆ BaseWriter() [2/2]
◆ ~BaseWriter()
◆ Close()
Close the file previously opened for writing. It is not usually necessary to call this function directly, since the Write() function will handle opening and closing of files.
◆ Flush()
◆ GetBaseName()
std::string GetBaseName |
( |
| ) |
const |
|
inline |
- Returns
- The name of the file without path. The filename extension will also typically be omitted.
◆ GetBaseNameSuffix()
std::string GetBaseNameSuffix |
( |
| ) |
const |
|
inline |
◆ GetFileName()
std::string GetFileName |
( |
| ) |
const |
- Returns
- The name of the file without path. The filename suffix and extension will be included.
◆ GetFormatExtension()
virtual std::string GetFormatExtension |
( |
| ) |
const |
|
pure virtual |
- Returns
- The default file name extension for this format.
Implemented in NastranWriter.
◆ GetFormatName()
virtual std::string GetFormatName |
( |
| ) |
const |
|
pure virtual |
- Returns
- The name of the format this reader expects.
Implemented in NastranWriter.
◆ GetScaleFactor()
double GetScaleFactor |
( |
| ) |
const |
|
inline |
- Returns
- The scale factor being applied to the node positions.
◆ IsReady()
- Returns
- True if the file is open and ready for writing.
◆ Open()
Open the output file with the current name settings. It is not usually necessary to call this function directly, since the Write() function will handle opening and closing of files.
- Returns
- The name of the output file including all suffixes and file extensions. If a file could not be opened, an empty string is returned.
◆ SetBaseName()
void SetBaseName |
( |
const std::string & |
base | ) |
|
|
inline |
- Parameters
-
base | The name of the file to write, typically without the filename extension. |
◆ SetBaseNameSuffix() [1/4]
void SetBaseNameSuffix |
( |
const std::string & |
suffix | ) |
|
|
inline |
◆ SetBaseNameSuffix() [2/4]
void SetBaseNameSuffix |
( |
double |
caseNum, |
|
|
const std::string & |
caseLabel = "_" |
|
) |
| |
|
inline |
◆ SetBaseNameSuffix() [3/4]
void SetBaseNameSuffix |
( |
int |
caseNum, |
|
|
const std::string & |
caseLabel = "_" |
|
) |
| |
|
inline |
◆ SetBaseNameSuffix() [4/4]
void SetBaseNameSuffix |
( |
T |
caseNum, |
|
|
const std::string & |
caseLabel = "_" |
|
) |
| |
|
inline |
◆ SetFileName()
void SetFileName |
( |
const std::string & |
fileName | ) |
|
- Parameters
-
fileName | The name of the file to write. The extension is optional, but if both compressed and uncompressed files exist, the extension should be explicitly included to ensure the right one is selected. |
If the writer currently has a file open, it will be closed by this call. Note that this also checks for .gz as part of the file name extension to support writing to compressed files.
- Note
- Any base name suffix will be included as part of the base name by this call, so if you really want to use the suffix functionality, don't use this function. The suffix functionality will be removed in a future version anyway.
◆ SetProgress()
void SetProgress |
( |
int |
progress | ) |
|
|
virtual |
◆ SetScaleFactor()
void SetScaleFactor |
( |
double |
scale | ) |
|
|
inline |
- Parameters
-
scale | The node positions will be scaled by this amount when output to file. |
◆ SetUseCompressionOff()
void SetUseCompressionOff |
( |
| ) |
|
|
inline |
◆ SetUseCompressionOn()
void SetUseCompressionOn |
( |
| ) |
|
|
inline |
◆ UsingCompression()
bool UsingCompression |
( |
| ) |
const |
|
inline |
- Returns
- True if on-the-fly compression is being used when writing to file.
◆ baseName_
◆ baseNameSuffix_
std::string baseNameSuffix_ |
|
protected |
◆ outFile_
◆ progress_
◆ scaleFactor_
◆ useCompression_