forked from c-koi/libboard
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_arrow.cpp
39 lines (35 loc) · 1.42 KB
/
test_arrow.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
* @file test_arrow.cpp
* @author Sebastien Fourey (GREYC)
*
* @brief Illustrate the rough shape filter
*
* This source code is part of the Board project, a C++ library whose
* purpose is to allow simple drawings in EPS, FIG or SVG files.
* Copyright (C) 2007 Sebastien Fourey <https://fourey.users.greyc.fr>
*/
#include <Board.h>
#include <ctime>
using namespace LibBoard;
int main(int, char *[])
{
Tools::initBoardRand(static_cast<unsigned int>(time(nullptr)));
Board board;
Board::disableLineWidthScaling();
board.setLineWidth(1.0);
board.setPenColor(Color::Blue);
board.setFillColor(Color::Red);
Style::setDefaultPenColor(Color::Red);
Style::setDefaultFillColor(Color::Green);
Style::setDefaultLineWidth(1.0);
board << Arrow(Point(0, 0), Point(100, 0), Arrow::ExtremityType::Stick);
board << board.last<Arrow>().rotated(180 * Board::Degree).translated(-30, 10);
board << Arrow(Point(0, 50), Point(100, 50), Arrow::ExtremityType::Closed);
board << board.last<Arrow>().rotated(180 * Board::Degree).translated(-30, 10);
board << Arrow(Point(0, 100), Point(100, 100), Arrow::ExtremityType::Plain);
board << board.last<Arrow>().rotated(180 * Board::Degree).translated(-30, 10);
board.saveSVG("test_arrow.svg", PageSize::BoundingBox);
// board.saveEPS("test_arrow.eps", PageSize::BoundingBox);
// board.saveFIG("test_arrow.fig", PageSize::BoundingBox);
// system("svgviewer test_arrow.svg");
}