🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
AggBackend.hpp
浏览该文件的文档.
1
21
22#pragma once
23
24#include "AstGlobal.h"
25
26#if defined(AST_WITH_AGG) && defined(AST_WITH_MATPLOT)
27A_SUPPRESS_WARNINGS_BEGIN
28#include <matplot/backend/backend_interface.h>
29A_SUPPRESS_WARNINGS_END
30
31#include <memory>
32#include <string>
33
34AST_NAMESPACE_BEGIN
35
45class AST_PLOT_API AggBackend : public matplot::backend::backend_interface {
46public:
47 AggBackend();
48 virtual ~AggBackend() override;
49
50 // ---- backend_interface 实现 ----
51
52 bool consumes_gnuplot_commands() override; // false
53 bool is_interactive() override; // false
54
55 const std::string& output() override;
56 const std::string& output_format() override;
57 bool output(const std::string& filename) override;
58 bool output(const std::string& filename,
59 const std::string& file_format) override;
60
61 unsigned int width() override;
62 unsigned int height() override;
63 void width(unsigned int new_width) override;
64 void height(unsigned int new_height) override;
65
66 unsigned int position_x() override;
67 unsigned int position_y() override;
68 void position_x(unsigned int new_position_x) override;
69 void position_y(unsigned int new_position_y) override;
70
71 void window_title(const std::string& title) override;
72 std::string window_title() override;
73
74 bool new_frame() override;
75 bool render_data() override;
76 void show(matplot::figure_type* f) override;
77 bool should_close() override;
78 bool supports_fonts() override;
79
80 void draw(matplot::figure_type* f) override;
81
82private:
83 struct Impl;
84 std::unique_ptr<Impl> impl_;
85};
86
89AST_NAMESPACE_END
90
91#endif // AST_WITH_AGG && AST_WITH_MATPLOT