-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.cpp
37 lines (32 loc) · 1.07 KB
/
main.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
#include "graphic/draw.hpp"
#include <chrono>
#include <iostream>
#include <thread>
int main()
{
using namespace Graphic;
initialize();
std::vector<Eigen::Vector2d> points1;
std::vector<Eigen::Vector2d> points2;
for (int i = 0; i < 10; i++) {
points1.push_back(Eigen::Vector2d::Random());
points2.push_back(Eigen::Vector2d::Random());
}
while (1) {
if (not isRunning())
break;
drawArrow(points1[0], points1[1], Color::YELLOW);
drawArrow(points1[2], points1[3], Color::YELLOW);
drawArrow(points1[4], points1[5], Color::YELLOW);
drawArrow(points1[6], points1[7], Color::YELLOW);
draw(points2, Form::POINTS, Color::RED);
std::this_thread::sleep_for(std::chrono::milliseconds(500));
clear();
draw(Eigen::Vector2d(0.5, 0.5), Form::POINT, Color::GREEN);
draw(points1, Form::CURVE, Color::PURPLE);
draw(points2, Form::RECTANGLE, Color::PURPLE);
std::this_thread::sleep_for(std::chrono::milliseconds(500));
clear();
}
finalize();
}