/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see .
Class
Foam::surfaceWriters::x3dWriter
Description
A surfaceWriter for X3D files.
The formatOptions for x3d:
\table
Property | Description | Required | Default
compression | Use file compression | no | false
range | The min/max range for colour table | no | automatic
colourMap | The colour map for rendering | no | coolToWarm
\endtable
\heading Output file locations
The \c rootdir normally corresponds to something like
\c postProcessing/\
\subheading Geometry
\verbatim
rootdir
`-- timeName
`-- surfaceName.x3d
\endverbatim
\subheading Fields
\verbatim
rootdir
`-- timeName
|-- _surfaceName.x3d
`-- _surfaceName.x3d
\endverbatim
SourceFiles
x3dSurfaceWriter.C
\*---------------------------------------------------------------------------*/
#ifndef x3dSurfaceWriter_H
#define x3dSurfaceWriter_H
#include "surfaceWriter.H"
#include "X3DsurfaceFormatCore.H"
#include "colourTable.H"
#include "MinMax.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace surfaceWriters
{
/*---------------------------------------------------------------------------*\
Class x3dWriter Declaration
\*---------------------------------------------------------------------------*/
class x3dWriter
:
public surfaceWriter,
protected fileFormats::X3DsurfaceFormatCore
{
// Private Data
//- Output stream option
IOstreamOption streamOpt_;
//- Range of values
// The lower/upper limits for the colour table output
// Undefined means calculate from the data
scalarMinMax range_;
//- Selected colour table
const colourTable* colourTablePtr_;
// Private Member Functions
//- Templated write operation
template
fileName writeTemplate
(
const word& fieldName, //!< Name of field
const Field& localValues //!< Local field values to write
);
public:
//- Declare type-name, virtual type (without debug switch)
TypeNameNoDebug("x3d");
// Constructors
//- Default construct
x3dWriter();
//- Construct with some output options
explicit x3dWriter(const dictionary& options);
//- Construct from components
x3dWriter
(
const meshedSurf& surf,
const fileName& outputPath,
bool parallel = Pstream::parRun(),
const dictionary& options = dictionary()
);
//- Construct from components
x3dWriter
(
const pointField& points,
const faceList& faces,
const fileName& outputPath,
bool parallel = Pstream::parRun(),
const dictionary& options = dictionary()
);
//- Destructor
virtual ~x3dWriter() = default;
// Member Functions
//- Write surface geometry to file.
virtual fileName write(); // override
declareSurfaceWriterWriteMethod(label);
declareSurfaceWriterWriteMethod(scalar);
declareSurfaceWriterWriteMethod(vector);
declareSurfaceWriterWriteMethod(sphericalTensor);
declareSurfaceWriterWriteMethod(symmTensor);
declareSurfaceWriterWriteMethod(tensor);
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace surfaceWriters
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //