GaitGeneration by Graph Search
読み取り中…
検索中…
一致する文字列を見つけられません
dxlib_gui_display_node_switcher.h
[詳解]
1
3
4// Copyright(c) 2023-2025 Design Engineering Laboratory, Saitama University
5// Released under the MIT license
6// https://opensource.org/licenses/mit-license.php
7
8#ifndef DESIGNLAB_DXLIB_GUI_DISPLAY_NODE_SWITCHER_H_
9#define DESIGNLAB_DXLIB_GUI_DISPLAY_NODE_SWITCHER_H_
10
11#include <memory>
12#include <string>
13#include <vector>
14
15#include "abstract_dxlib_gui.h"
16#include "simple_button.h"
17
18
19namespace designlab {
20
24public:
25 DxlibGuiDisplayNodeSwitcher(int window_x, int window_y);
26
30 void SetGraphData(
31 size_t node_num, const std::vector<size_t>& simulation_end_index);
32
35 size_t GetDisplayNodeNum() const;
36
39 constexpr int GetSimulationNum() const { return simulation_num_; }
40
41
42 void Update() override;
43
44 void Draw() const override;
45
46 void InAnimation(const bool in_animation) { in_animation_ = in_animation; }
47 int GetAnimeSpeed() const { return animation_speed_; }
48
49private:
50 static constexpr int kWidth{ 275 };
51 static constexpr int kHeight{ 282 };
52
54 void MoveMostPrevNode();
55
57 void MovePrevNode();
58
60 void MoveMostNextNode();
61
63 void MoveNextNode();
64
66 void MovePrevSimulation();
67
69 void MoveNextSimulation();
70
72 int GetAllSimulationNum() const;
73
74 bool IsInWindow() const;
75
76
77 const int kAnimeSpeedMax{ 120 };
78 const int kAnimeSpeedMin{ 1 };
79
80 const int window_x_;
81 const int window_y_;
82
84 std::vector<size_t> simulation_end_index_;
85
86 size_t all_node_num_;
87 size_t display_node_num_;
88 int simulation_num_;
89 bool do_auto_animation_;
90 int animation_speed_{ (kAnimeSpeedMax + kAnimeSpeedMin) / 2 };
91 int counter_{ 0 };
92
93 bool in_animation_{ false };
94};
95
96} // namespace designlab
97
98
99#endif // DESIGNLAB_DXLIB_GUI_DISPLAY_NODE_SWITCHER_H_
Dxlibを使ったGUIの抽象クラス.
ノードの表示・切り替えを行うGUIのクラス.
void Update() override
GUIの更新,毎フレーム実行すること.
size_t GetDisplayNodeNum() const
現在表示するノードの番号を取得する.
constexpr int GetSimulationNum() const
現在表示するシミュレーションの番号を取得する.
void SetGraphData(size_t node_num, const std::vector< size_t > &simulation_end_index)
GUIに表示するノードの情報を設定する.