FreeFOAM The Cross-Platform CFD Toolkit
Hosted by SourceForge:
Get FreeFOAM at SourceForge.net.
            Fast, secure and Free Open Source software downloads

WRLsurfaceFormatCore.C

Go to the documentation of this file.
00001 /*---------------------------------------------------------------------------*\
00002   =========                 |
00003   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
00004    \\    /   O peration     |
00005     \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
00006      \\/     M anipulation  |
00007 -------------------------------------------------------------------------------
00008 License
00009     This file is part of OpenFOAM.
00010 
00011     OpenFOAM is free software: you can redistribute it and/or modify it
00012     under the terms of the GNU General Public License as published by
00013     the Free Software Foundation, either version 3 of the License, or
00014     (at your option) any later version.
00015 
00016     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
00017     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
00018     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
00019     for more details.
00020 
00021     You should have received a copy of the GNU General Public License
00022     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
00023 
00024 \*---------------------------------------------------------------------------*/
00025 
00026 #include "WRLsurfaceFormatCore.H"
00027 #include <OpenFOAM/clock.H>
00028 
00029 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
00030 
00031 void Foam::fileFormats::WRLsurfaceFormatCore::writeHeader
00032 (
00033     Ostream& os,
00034     const pointField& pointLst,
00035     const label nFaces,
00036     const UList<surfZone>& zoneLst
00037 )
00038 {
00039     os  << "#VRML V2.0 utf8" << nl
00040         << nl
00041         << "# written " << clock::dateTime().c_str() << nl
00042         << "# points : " << pointLst.size() << nl
00043         << "# faces  : " << nFaces << nl
00044         << "# zones  : " << zoneLst.size() << nl;
00045 
00046     // Print zone names as comment
00047     forAll(zoneLst, zoneI)
00048     {
00049         os  << "#   " << zoneI << "  " << zoneLst[zoneI].name()
00050             << "  (nFaces: " << zoneLst[zoneI].size() << ")" << nl;
00051     }
00052 }
00053 
00054 
00055 void Foam::fileFormats::WRLsurfaceFormatCore::writeAppearance
00056 (
00057     Ostream& os
00058 )
00059 {
00060     os  <<
00061         "   appearance Appearance {\n"
00062         "    material Material {\n"
00063         "     diffuseColor   0.8 0.8 0.8\n"
00064         "     specularColor  1.0 1.0 1.0\n"
00065         "     shininess      0.5\n"
00066         "     transparency   0.0\n"
00067         "    }\n"                      // end material
00068         "   }\n";                      // end appearance
00069 
00070 }
00071 
00072 
00073 // ************************ vim: set sw=4 sts=4 et: ************************ //
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines