MCPcopy Create free account
hub / github.com/alandefreitas/matplotplusplus / set_variables_string

Method set_variables_string

source/matplot/axes_objects/surface.cpp:58–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56 }
57
58 std::string surface::set_variables_string() {
59 maybe_update_line_spec();
60 std::stringstream ss;
61 ss.precision(10);
62 ss << std::fixed;
63
64 if (surface_in_2d_) {
65 ss << " set view map\n";
66 }
67
68 // We used to create a line style for the surface
69 // We now create the line style directly in the plot command
70 // size_t line_index = create_line_index();
71 // Line style for the surface
72 // if (line_spec_.user_color()) {
73 // ss << " set style line " << line_index << " " <<
74 // line_spec_.plot_string(line_spec::style_to_plot::plot_line_only,
75 // false) << "\n";
76 // } else {
77 // ss << " set style line " << line_index << " linecolor
78 // rgb \"black\" dashtype 1 linewidth 0.5 linetype -1\n";
79 // }
80
81 // If there is any kind of palette surface being plotted besides the
82 // lines if there is a pm3d surface, set the options
83 const bool palette_map_3d = palette_map_at_bottom_ ||
84 palette_map_at_surface_ ||
85 palette_map_at_top_;
86 if (palette_map_3d) {
87 ss << " set pm3d";
88 ss << " noborder";
89 // explicit: only show surface if we use with 3dpm
90 ss << " explicit";
91
92 // simple lighting
93 if (lighting_) {
94 ss << " lighting";
95 if (primary_ >= 0) {
96 ss << " primary " << std::clamp(primary_, 0.f, 1.f);
97 }
98 if (specular_ >= 0) {
99 ss << " specular " << std::clamp(specular_, 0.f, 1.f);
100 }
101 }
102
103 if (depthorder_) {
104 // depthorder:
105 ss << " depthorder base";
106 }
107 // hidden3d hides what's behind / makes the surface solid
108 // - this makes the surface easier to visualize
109 // - 1 is the linestyle for pm3d lines
110 if (!fences_) {
111 // We used to create a line style for the surface
112 // We now create the line style directly in the plot command
113 // ss << " hidden3d " << line_index;
114 ss << " hidden3d ";
115 }

Callers

nothing calls this directly

Calls 13

sizeFunction · 0.85
iequalsFunction · 0.85
escapeFunction · 0.85
to_stringFunction · 0.85
emptyMethod · 0.80
beginMethod · 0.80
endMethod · 0.80
line_styleMethod · 0.80
user_colorMethod · 0.80
sizeMethod · 0.45
colorMethod · 0.45

Tested by

no test coverage detected