From eeedf4a35d7099e0c93673623aed80c9c2578647 Mon Sep 17 00:00:00 2001 From: Mark Olesen <Mark.Olesen@Germany> Date: Sat, 12 Nov 2016 23:30:44 +0100 Subject: [PATCH] DEFEATURE: remove VRML/97 output - superseded long ago by x3d (issue #294) --- src/surfMesh/Make/files | 2 - .../surfaceFormats/wrl/WRLsurfaceFormat.C | 139 ------------------ .../surfaceFormats/wrl/WRLsurfaceFormat.H | 111 -------------- .../surfaceFormats/wrl/WRLsurfaceFormatCore.C | 73 --------- .../surfaceFormats/wrl/WRLsurfaceFormatCore.H | 83 ----------- .../wrl/WRLsurfaceFormatRunTime.C | 61 -------- 6 files changed, 469 deletions(-) delete mode 100644 src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormat.C delete mode 100644 src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormat.H delete mode 100644 src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormatCore.C delete mode 100644 src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormatCore.H delete mode 100644 src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormatRunTime.C diff --git a/src/surfMesh/Make/files b/src/surfMesh/Make/files index 40182bbb29e..7b23b07ac62 100644 --- a/src/surfMesh/Make/files +++ b/src/surfMesh/Make/files @@ -40,8 +40,6 @@ $(surfaceFormats)/tri/TRIsurfaceFormatCore.C $(surfaceFormats)/tri/TRIsurfaceFormatRunTime.C $(surfaceFormats)/vtk/VTKsurfaceFormatCore.C $(surfaceFormats)/vtk/VTKsurfaceFormatRunTime.C -$(surfaceFormats)/wrl/WRLsurfaceFormatCore.C -$(surfaceFormats)/wrl/WRLsurfaceFormatRunTime.C $(surfaceFormats)/x3d/X3DsurfaceFormatCore.C $(surfaceFormats)/x3d/X3DsurfaceFormatRunTime.C diff --git a/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormat.C b/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormat.C deleted file mode 100644 index ad67a0a3e26..00000000000 --- a/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormat.C +++ /dev/null @@ -1,139 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2016 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 <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "WRLsurfaceFormat.H" - -#include "Ostream.H" -#include "OFstream.H" -#include "ListOps.H" - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -template<class Face> -Foam::fileFormats::WRLsurfaceFormat<Face>::WRLsurfaceFormat() -{} - - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template<class Face> -void Foam::fileFormats::WRLsurfaceFormat<Face>::write -( - const fileName& filename, - const MeshedSurfaceProxy<Face>& surf -) -{ - const pointField& pointLst = surf.points(); - const List<Face>& faceLst = surf.surfFaces(); - const List<label>& faceMap = surf.faceMap(); - - // for no zones, suppress the group name - const List<surfZone>& zones = - ( - surf.surfZones().empty() - ? surfaceFormatsCore::oneZone(faceLst, "") - : surf.surfZones() - ); - - const bool useFaceMap = (surf.useFaceMap() && zones.size() > 1); - - OFstream os(filename); - if (!os.good()) - { - FatalErrorInFunction - << "Cannot open file for writing " << filename - << exit(FatalError); - } - - writeHeader(os, pointLst, faceLst.size(), zones); - - os << "\n" - "Group {\n" - " children [\n" - " Shape {\n"; - - writeAppearance(os); - - os << - " geometry IndexedFaceSet {\n" - " coord Coordinate {\n" - " point [\n"; - - // Write vertex coords - forAll(pointLst, ptI) - { - const point& pt = pointLst[ptI]; - - os << pt.x() << ' ' << pt.y() << ' ' << pt.z() << nl; - } - - os << - " ]\n" // end point - " }\n" // end coord Coordinate - " coordIndex [\n"; - - label faceIndex = 0; - forAll(zones, zoneI) - { - const surfZone& zone = zones[zoneI]; - - if (useFaceMap) - { - forAll(zone, localFacei) - { - const Face& f = faceLst[faceMap[faceIndex++]]; - - forAll(f, fp) - { - os << f[fp] << ' '; - } - os << "-1,\n"; - } - } - else - { - forAll(zone, localFacei) - { - const Face& f = faceLst[faceIndex++]; - - forAll(f, fp) - { - os << ' ' << f[fp]; - } - os << " -1,\n"; - } - } - } - - os << - " ]\n" // end coordIndex - " }\n" // end geometry IndexedFaceSet - " }\n" // end Shape - " ]\n" // end children - "}\n"; // end Group -} - - -// ************************************************************************* // diff --git a/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormat.H b/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormat.H deleted file mode 100644 index 191da073860..00000000000 --- a/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormat.H +++ /dev/null @@ -1,111 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ 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 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 <http://www.gnu.org/licenses/>. - -Class - Foam::fileFormats::WRLsurfaceFormat - -Description - Provide a means of writing VRML97 (wrl) format. - -SourceFiles - WRLsurfaceFormat.C - -\*---------------------------------------------------------------------------*/ - -#ifndef WRLsurfaceFormat_H -#define WRLsurfaceFormat_H - -#include "MeshedSurface.H" -#include "MeshedSurfaceProxy.H" -#include "UnsortedMeshedSurface.H" -#include "WRLsurfaceFormatCore.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace fileFormats -{ - -/*---------------------------------------------------------------------------*\ - Class WRLsurfaceFormat Declaration -\*---------------------------------------------------------------------------*/ - -template<class Face> -class WRLsurfaceFormat -: - public MeshedSurface<Face>, - public WRLsurfaceFormatCore - -{ - // Private Member Functions - - //- Disallow default bitwise copy construct - WRLsurfaceFormat(const WRLsurfaceFormat<Face>&); - - //- Disallow default bitwise assignment - void operator=(const WRLsurfaceFormat<Face>&); - -public: - - // Constructors - - //- Construct null - WRLsurfaceFormat(); - - - //- Destructor - virtual ~WRLsurfaceFormat() - {} - - - // Member Functions - - //- Write surface mesh components by proxy - static void write(const fileName&, const MeshedSurfaceProxy<Face>&); - - //- Write object file - virtual void write(const fileName& name) const - { - write(name, MeshedSurfaceProxy<Face>(*this)); - } - -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace fileFormats -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#ifdef NoRepository - #include "WRLsurfaceFormat.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormatCore.C b/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormatCore.C deleted file mode 100644 index b7c33c9e9a7..00000000000 --- a/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormatCore.C +++ /dev/null @@ -1,73 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ 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 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 <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "WRLsurfaceFormatCore.H" -#include "clock.H" - -// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * // - -void Foam::fileFormats::WRLsurfaceFormatCore::writeHeader -( - Ostream& os, - const pointField& pointLst, - const label nFaces, - const UList<surfZone>& zoneLst -) -{ - os << "#VRML V2.0 utf8" << nl - << nl - << "# written " << clock::dateTime().c_str() << nl - << "# points : " << pointLst.size() << nl - << "# faces : " << nFaces << nl - << "# zones : " << zoneLst.size() << nl; - - // Print zone names as comment - forAll(zoneLst, zoneI) - { - os << "# " << zoneI << " " << zoneLst[zoneI].name() - << " (nFaces: " << zoneLst[zoneI].size() << ")" << nl; - } -} - - -void Foam::fileFormats::WRLsurfaceFormatCore::writeAppearance -( - Ostream& os -) -{ - os << - " appearance Appearance {\n" - " material Material {\n" - " diffuseColor 0.8 0.8 0.8\n" - " specularColor 1.0 1.0 1.0\n" - " shininess 0.5\n" - " transparency 0.0\n" - " }\n" // end material - " }\n"; // end appearance - -} - - -// ************************************************************************* // diff --git a/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormatCore.H b/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormatCore.H deleted file mode 100644 index dd37ca049c1..00000000000 --- a/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormatCore.H +++ /dev/null @@ -1,83 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ 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 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 <http://www.gnu.org/licenses/>. - -Class - Foam::fileFormats::WRLsurfaceFormatCore - -Description - Internal class used by the WRLsurfaceFormat - -SourceFiles - WRLsurfaceFormatCore.C - -\*---------------------------------------------------------------------------*/ - -#ifndef WRLsurfaceFormatCore_H -#define WRLsurfaceFormatCore_H - -#include "Ostream.H" -#include "OFstream.H" -#include "MeshedSurface.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace fileFormats -{ - -/*---------------------------------------------------------------------------*\ - Class WRLsurfaceFormatCore Declaration -\*---------------------------------------------------------------------------*/ - -class WRLsurfaceFormatCore -{ -protected: - // Protected Member Functions - - //- Write file header - static void writeHeader - ( - Ostream&, - const pointField&, - const label nFaces, - const UList<surfZone>& - ); - - - //- Write appearance node - static void writeAppearance(Ostream&); - -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace fileFormats -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormatRunTime.C b/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormatRunTime.C deleted file mode 100644 index 737cb11053d..00000000000 --- a/src/surfMesh/surfaceFormats/wrl/WRLsurfaceFormatRunTime.C +++ /dev/null @@ -1,61 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation - \\/ 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 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 <http://www.gnu.org/licenses/>. - -\*---------------------------------------------------------------------------*/ - -#include "WRLsurfaceFormat.H" - -#include "addToRunTimeSelectionTable.H" -#include "addToMemberFunctionSelectionTable.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ -namespace fileFormats -{ - -// write MeshedSurfaceProxy -addNamedTemplatedToMemberFunctionSelectionTable -( - MeshedSurfaceProxy, - WRLsurfaceFormat, - face, - write, - fileExtension, - wrl -); -addNamedTemplatedToMemberFunctionSelectionTable -( - MeshedSurfaceProxy, - WRLsurfaceFormat, - triFace, - write, - fileExtension, - wrl -); - -} -} - -// ************************************************************************* // -- GitLab