openfoam/applications/test/Gstream/GsTest.C
Mark Olesen 4b60453cf1 use while (runTime.loop() { .. } where possible in solvers
- change system/controlDict to use functions {..} instead of functions (..);
  * This is internally more efficient
- fixed formatting of system/controlDict functions entry

- pedantic change: use 'return 0' instead of 'return(0)' in the applications,
  since return is a C/C++ keyword, not a function.
2009-02-18 08:57:10 +01:00

48 lines
1.1 KiB
C

#include "Xstream.H"
#include "GLstream.H"
#include "PSstream.H"
#include "shapes2D.H"
#include "IStringStream.H"
using namespace Foam;
int main()
{
colour mauve("mauve", 1, 0, 1);
lineStyle solid("Solid", 2.0, 2.0, IStringStream("1(1.0)")());
lineStyle broken("Broken", 2.0, 10.0, IStringStream("4(1 1 4 1)")());
//Xstream wind
GLstream wind
//PSstream wind
(
"GsTest",
primary("Black"),
primary("White"),
0.5, 0.5, 0.5, 0.5, 500, 500
);
do
{
wind << rectangle2D(point2D(0.0, 0.0), point2D(100.0, 100.0));
wind.setColour(mauve);
wind.setLineStyle(solid);
wind << line2D(point2D(0.0, 0.0), point2D(0.0, 200.0));
wind << line2D(point2D(0.0, 200.0), point2D(200.0, 200.0));
//wind.setLineStyle(broken);
wind << line2D(point2D(200.0, 200.0), point2D(200.0, 0.0));
wind << line2D(point2D(200.0, 0.0), point2D(0.0, 0.0));
wind << string2D(point2D(200.0, 0.0), "Hi there");
} while (wind.waitForEvent());
return 0;
}