🛰️航天仿真算法库 SpaceAST 0.0.1
载入中...
搜索中...
未找到
LineStyle.hpp
1#pragma once
2
3#include <vector>
4
5#if defined(AST_WITH_AGG)
6
7#include "agg/agg_color_rgba.h"
8#include "agg/agg_math_stroke.h"
9#include "path_converters.h" // e_snap_mode
10
11
12AST_NAMESPACE_BEGIN
13
14
16struct LineStyle {
17 double linewidth = 1.5; // pt
18 agg::rgba color{0.122, 0.467, 0.706, 1.0}; // C0 blue
19 agg::line_cap_e cap = agg::square_cap; // "projecting"
20 agg::line_join_e join = agg::round_join;
21 bool antialiased = true;
22 e_snap_mode snap = SNAP_AUTO;
23
24 double dash_offset = 0.0;
25 std::vector<double> dash_pattern; // 空 = 实线, 单位 pt (已按 lw 缩放)
26
27 bool simplify = true;
28 double simplify_threshold = 0.111111; // M_SQRT2/9 ≈ matplot default
29
30 double sketch_scale = 0.0;
31 double sketch_length = 0.0;
32 double sketch_randomness = 0.0;
33
34 bool is_dashed() const { return !dash_pattern.empty(); }
35 double linewidth_px(double dpi) const { return linewidth * dpi / 72.0; }
36};
37
38
39AST_NAMESPACE_END
40
41#endif // AST_WITH_AGG