mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: consolidate vtk classes into 'Foam::vtk' namespace
- elminate the foamVtkFormatter operator() in favour of xmlAttr. Improves readability and the purpose is clearer.
This commit is contained in:
@ -28,16 +28,16 @@ License
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
const char* Foam::foamVtkOutput::appendRawFormatter::name_ = "append";
|
||||
const char* Foam::foamVtkOutput::appendRawFormatter::encoding_ = "raw";
|
||||
const char* Foam::vtk::appendRawFormatter::name_ = "append";
|
||||
const char* Foam::vtk::appendRawFormatter::encoding_ = "raw";
|
||||
|
||||
const Foam::foamVtkOutput::outputOptions
|
||||
Foam::foamVtkOutput::appendRawFormatter::opts_(formatType::APPEND_BINARY);
|
||||
const Foam::vtk::outputOptions
|
||||
Foam::vtk::appendRawFormatter::opts_(formatType::APPEND_BINARY);
|
||||
|
||||
|
||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||
|
||||
void Foam::foamVtkOutput::appendRawFormatter::write
|
||||
void Foam::vtk::appendRawFormatter::write
|
||||
(
|
||||
const char* s,
|
||||
std::streamsize n
|
||||
@ -49,7 +49,7 @@ void Foam::foamVtkOutput::appendRawFormatter::write
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::foamVtkOutput::appendRawFormatter::appendRawFormatter(std::ostream& os)
|
||||
Foam::vtk::appendRawFormatter::appendRawFormatter(std::ostream& os)
|
||||
:
|
||||
formatter(os)
|
||||
{}
|
||||
@ -57,58 +57,58 @@ Foam::foamVtkOutput::appendRawFormatter::appendRawFormatter(std::ostream& os)
|
||||
|
||||
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||
|
||||
Foam::foamVtkOutput::appendRawFormatter::~appendRawFormatter()
|
||||
Foam::vtk::appendRawFormatter::~appendRawFormatter()
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||
|
||||
const Foam::foamVtkOutput::outputOptions&
|
||||
Foam::foamVtkOutput::appendRawFormatter::opts() const
|
||||
const Foam::vtk::outputOptions&
|
||||
Foam::vtk::appendRawFormatter::opts() const
|
||||
{
|
||||
return opts_;
|
||||
}
|
||||
|
||||
|
||||
const char* Foam::foamVtkOutput::appendRawFormatter::name() const
|
||||
const char* Foam::vtk::appendRawFormatter::name() const
|
||||
{
|
||||
return name_;
|
||||
}
|
||||
|
||||
|
||||
const char* Foam::foamVtkOutput::appendRawFormatter::encoding() const
|
||||
const char* Foam::vtk::appendRawFormatter::encoding() const
|
||||
{
|
||||
return encoding_;
|
||||
}
|
||||
|
||||
|
||||
void Foam::foamVtkOutput::appendRawFormatter::writeSize(const uint64_t nBytes)
|
||||
void Foam::vtk::appendRawFormatter::writeSize(const uint64_t nBytes)
|
||||
{
|
||||
write(reinterpret_cast<const char*>(&nBytes), sizeof(uint64_t));
|
||||
}
|
||||
|
||||
|
||||
void Foam::foamVtkOutput::appendRawFormatter::write(const uint8_t val)
|
||||
void Foam::vtk::appendRawFormatter::write(const uint8_t val)
|
||||
{
|
||||
write(reinterpret_cast<const char*>(&val), sizeof(uint8_t));
|
||||
}
|
||||
|
||||
|
||||
void Foam::foamVtkOutput::appendRawFormatter::write(const label val)
|
||||
void Foam::vtk::appendRawFormatter::write(const label val)
|
||||
{
|
||||
// std::cerr<<"label:" << sizeof(val) << "=" << val << '\n';
|
||||
write(reinterpret_cast<const char*>(&val), sizeof(label));
|
||||
}
|
||||
|
||||
|
||||
void Foam::foamVtkOutput::appendRawFormatter::write(const float val)
|
||||
void Foam::vtk::appendRawFormatter::write(const float val)
|
||||
{
|
||||
// std::cerr<<"float:" << sizeof(val) << "=" << val << '\n';
|
||||
write(reinterpret_cast<const char*>(&val), sizeof(float));
|
||||
}
|
||||
|
||||
|
||||
void Foam::foamVtkOutput::appendRawFormatter::write(const double val)
|
||||
void Foam::vtk::appendRawFormatter::write(const double val)
|
||||
{
|
||||
// std::cerr<<"double as float=" << val << '\n';
|
||||
float copy(val);
|
||||
@ -116,7 +116,7 @@ void Foam::foamVtkOutput::appendRawFormatter::write(const double val)
|
||||
}
|
||||
|
||||
|
||||
void Foam::foamVtkOutput::appendRawFormatter::flush()
|
||||
void Foam::vtk::appendRawFormatter::flush()
|
||||
{/*nop*/}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user