mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-12-28 03:37:59 +00:00
- keyedSurface is similar to triSurface, but uses faces - meshedSurface is sorted in regions and should be more memory efficient - surfMesh is the placeholder name for an OpenFOAM native surface format
147 lines
3.9 KiB
C++
147 lines
3.9 KiB
C++
/*---------------------------------------------------------------------------*\
|
|
========= |
|
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
\\ / O peration |
|
|
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
|
\\/ M anipulation |
|
|
-------------------------------------------------------------------------------
|
|
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 2 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, write to the Free Software Foundation,
|
|
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
|
|
Class
|
|
Foam::fileFormats::OFFfileFormat
|
|
|
|
Description
|
|
Provide a means of reading/writing Geomview OFF polyList format.
|
|
|
|
|
|
See Also
|
|
The <a href="http://www.geoview.org">Geoview</a>
|
|
file format information:
|
|
http://www.geomview.org/docs/html/OFF.html#OFF
|
|
|
|
Note
|
|
When reading, the optional @a colorspec is ignored.
|
|
When writing, it is set to the region number (integer).
|
|
|
|
SourceFiles
|
|
OFFfileFormat.C
|
|
|
|
\*---------------------------------------------------------------------------*/
|
|
|
|
#ifndef OFFfileFormat_H
|
|
#define OFFfileFormat_H
|
|
|
|
#include "Ostream.H"
|
|
#include "OFstream.H"
|
|
#include "keyedSurface.H"
|
|
#include "meshedSurface.H"
|
|
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
namespace Foam
|
|
{
|
|
namespace fileFormats
|
|
{
|
|
|
|
/*---------------------------------------------------------------------------*\
|
|
Class OFFfileFormat Declaration
|
|
\*---------------------------------------------------------------------------*/
|
|
|
|
class OFFfileFormat
|
|
:
|
|
public keyedSurface
|
|
{
|
|
// Private Member Functions
|
|
|
|
//- Disallow default bitwise copy construct
|
|
OFFfileFormat(const OFFfileFormat&);
|
|
|
|
//- Disallow default bitwise assignment
|
|
void operator=(const OFFfileFormat&);
|
|
|
|
public:
|
|
|
|
// Constructors
|
|
|
|
//- Construct null
|
|
OFFfileFormat();
|
|
|
|
//- Construct from file name
|
|
OFFfileFormat(const fileName&, const bool triangulate=false);
|
|
|
|
// Selectors
|
|
|
|
//- Read file and return keyedSurface
|
|
static autoPtr<keyedSurface> New
|
|
(
|
|
const fileName& fName,
|
|
const bool triangulate=false
|
|
)
|
|
{
|
|
return autoPtr<keyedSurface>
|
|
(
|
|
new OFFfileFormat(fName,triangulate)
|
|
);
|
|
}
|
|
|
|
// Destructor
|
|
|
|
// Member Functions
|
|
|
|
// Write
|
|
|
|
//- Write keyedSurface
|
|
static void write(Ostream&, const keyedSurface&);
|
|
|
|
//- Write keyedSurface
|
|
static void write(const fileName& fName, const keyedSurface& surf)
|
|
{
|
|
write(OFstream(fName)(), surf);
|
|
}
|
|
|
|
//- Write meshedSurface
|
|
static void write(Ostream&, const meshedSurface&);
|
|
|
|
//- Write meshedSurface
|
|
static void write(const fileName& fName, const meshedSurface& surf)
|
|
{
|
|
write(OFstream(fName)(), surf);
|
|
}
|
|
|
|
//- Write object
|
|
virtual void write(Ostream& os) const
|
|
{
|
|
write(os, *this);
|
|
}
|
|
|
|
};
|
|
|
|
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
} // End namespace fileFormats
|
|
} // End namespace Foam
|
|
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
|
|
#endif
|
|
|
|
// ************************************************************************* //
|