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{
21
25{
26public:
27 DxlibGuiDisplayNodeSwitcher(int window_x, int window_y);
28
32 void SetGraphData(
33 size_t node_num, const std::vector<size_t>& simulation_end_index);
34
37 size_t GetDisplayNodeNum() const;
38
41 constexpr int GetSimulationNum() const { return simulation_num_; }
42
43
44 void Update() override;
45
46 void Draw() const override;
47
48 void InAnimation(const bool in_animation) { in_animation_ = in_animation; }
49 int GetAnimeSpeed() const { return animation_speed_; }
50
51private:
52 static constexpr int kWidth{ 275 };
53 static constexpr int kHeight{ 282 };
54
56 void MoveMostPrevNode();
57
59 void MovePrevNode();
60
62 void MoveMostNextNode();
63
65 void MoveNextNode();
66
68 void MovePrevSimulation();
69
71 void MoveNextSimulation();
72
74 int GetAllSimulationNum() const;
75
76 bool IsInWindow() const;
77
78
79 const int kAnimeSpeedMax{ 120 };
80 const int kAnimeSpeedMin{ 1 };
81
82 const int window_x_;
83 const int window_y_;
84
86 std::vector<size_t> simulation_end_index_;
87
88 size_t all_node_num_;
89 size_t display_node_num_;
90 int simulation_num_;
91 bool do_auto_animation_;
92 int animation_speed_;
93 int counter_{ 0 };
94
95 bool in_animation_{ false };
96};
97
98} // namespace designlab
99
100
101#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に表示するノードの情報を設定する.