20 const int window_x,
const int window_y) :
27 do_auto_animation_(false) {
28 const int button_interval = 10;
29 const int button_width = 40;
31 const int kButtonTopY =
35 button_.push_back(std::make_unique<SimpleButton>(
36 "<<", kButtonLeftX, kButtonTopY, button_width, button_width));
37 button_.back()->SetActivateFunction([
this]() { MoveMostPrevNode(); });
39 button_.push_back(std::make_unique<SimpleButton>(
40 "<", kButtonLeftX + (button_interval + button_width) * 1, kButtonTopY,
41 button_width, button_width));
42 button_.back()->SetActivateFunction([
this]() { MovePrevNode(); });
44 button_.push_back(std::make_unique<SimpleButton>(
46 kButtonLeftX + (button_interval + button_width) * 2,
48 button_width, button_width));
49 button_.back()->SetActivateFunction(
50 [
this]() { do_auto_animation_ = !do_auto_animation_; });
52 button_.push_back(std::make_unique<SimpleButton>(
53 ">", kButtonLeftX + (button_interval + button_width) * 3, kButtonTopY,
54 button_width, button_width));
55 button_.back()->SetActivateFunction([
this]() { MoveNextNode(); });
57 button_.push_back(std::make_unique<SimpleButton>(
58 ">>", kButtonLeftX + (button_interval + button_width) * 4, kButtonTopY,
59 button_width, button_width));
60 button_.back()->SetActivateFunction([
this]() { MoveMostNextNode(); });
62 button_.push_back(std::make_unique<SimpleButton>(
63 "↓", kButtonLeftX + (button_interval + button_width) * 3,
64 kButtonTopY + (button_interval + button_width),
65 button_width, button_width));
66 button_.back()->SetActivateFunction([
this]() {
67 if (animation_speed_ > kAnimeSpeedMin) {
72 button_.push_back(std::make_unique<SimpleButton>(
73 "↑", kButtonLeftX + (button_interval + button_width) * 4,
74 kButtonTopY + (button_interval + button_width),
75 button_width, button_width));
76 button_.back()->SetActivateFunction([
this]() {
77 if (animation_speed_ < kAnimeSpeedMax) {
82 button_.push_back(std::make_unique<SimpleButton>(
84 kButtonLeftX + (button_interval + button_width) * 1,
85 kButtonTopY + (button_interval + button_width) * 2,
86 button_width * 2, button_width));
87 button_.back()->SetActivateFunction([
this]() { MovePrevSimulation(); });
89 button_.push_back(std::make_unique<SimpleButton>(
91 kButtonLeftX + (button_interval + button_width) * 3,
92 kButtonTopY + (button_interval + button_width) * 2,
93 button_width * 2, button_width));
94 button_.back()->SetActivateFunction([
this]() { MoveNextSimulation(); });
96 const int close_button_size = 28;
97 const int close_button_x =
gui_left_pos_x_ + kWidth - close_button_size / 2 - 2;
98 const int close_button_y =
gui_top_pos_y_ + close_button_size / 2 + 2;
100 button_.push_back(std::make_unique<SimpleButton>(
101 "×", close_button_x, close_button_y,
102 close_button_size, close_button_size));
150 for (
const auto& i :
button_) {
157 const unsigned int text_color = GetColor(0, 0, 0);
159 DrawFormatStringToHandle(
164 "[シミュレーション%d回目(全%d回)]",
166 GetAllSimulationNum(),
170 int start_node_num = 0;
171 int end_node_num = 0;
173 if (simulation_num_ == 0) {
176 if (!simulation_end_index_.empty()) {
177 end_node_num =
static_cast<int>(simulation_end_index_[0]);
180 end_node_num =
static_cast<int>(all_node_num_ - 1);
183 else if (simulation_num_ ==
static_cast<int>(simulation_end_index_.size())) {
184 start_node_num =
static_cast<int>(
185 simulation_end_index_[simulation_num_ - 1] + 1);
186 end_node_num =
static_cast<int>(all_node_num_ - 1);
189 start_node_num =
static_cast<int>(
190 simulation_end_index_[simulation_num_ - 1] + 1);
191 end_node_num =
static_cast<int>(simulation_end_index_[simulation_num_]);
194 DrawFormatStringToHandle(
199 "表示ノード : %d (%d~%d)",
200 display_node_num_, start_node_num, end_node_num, all_node_num_ - 1);
202 DrawFormatStringToHandle(
207 "全ノード : %d ", all_node_num_ - 1);
209 DrawFormatStringToHandle(
214 do_auto_animation_ ==
true ?
215 "自動再生 : 再生/速度%d" :
"自動再生 : 停止/速度%d",
218 DrawFormatStringToHandle(