Board  0.9.4
examples/example1.cpp
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <cmath>
#include "Board.h"
using namespace LibBoard;
int main( int, char *[] )
{
Board board;
board.setLineWidth( 0.1 );
board.setPenColorRGBi( 0, 0, 255 );
std::vector<Point> points;
for ( double x = -1.0; x <= 1.0; x += 0.01 ) {
points.push_back( 100 * Point( x, sin(2*x*M_PI) ) );
}
board.setPenColorRGBi( 0, 0, 255 );
board.setLineWidth(0.1);
board.drawPolyline( points );
board.setPenColor(Color::Black);
board.drawArrow( board.center(), board.boundingBox(Board::UseLineWidth).topRight(), true );
board.fillGouraudTriangle( -50, 0, Color( 255, 0, 0 ),
0, 0, Color( 0, 255, 0 ),
-30, 30, Color( 0, 0, 255 ) );
board.setPenColorRGBi( 255, 0, 0 );
board.fillGouraudTriangle( 100, 0, 0.1f,
50, 0, 0.8f,
75, -30, 0.1f );
board.setPenColorRGBi( 255, 255, 255 );
board.fillGouraudTriangle( 100, 0, 0.1f,
50, 0, 0.8f,
75, 50, 0.1f );
board.saveEPS( "example1.eps" );
board.saveFIG( "example1.fig" );
board.saveSVG( "example1.svg" );
board.saveEPS( "example1_Letter.eps", Board::Letter );
board.saveFIG( "example1_Letter.fig", Board::Letter );
board.saveSVG( "example1_Letter.svg", Board::Letter );
}