5pure module function par_get_is_visible(this) result(rst)
6 class(plot_arrow),
intent(in) :: this
12module subroutine par_set_is_visible(this, x)
13 class(plot_arrow),
intent(inout) :: this
14 logical,
intent(in) :: x
19pure module function par_get_tail(this) result(rst)
20 class(plot_arrow),
intent(in) :: this
21 real(real32),
dimension(3) :: rst
26module subroutine par_set_tail_1(this, x)
27 class(plot_arrow),
intent(inout) :: this
28 real(real32),
intent(in) :: x(3)
33module subroutine par_set_tail_2(this, x, y)
34 class(plot_arrow),
intent(inout) :: this
35 real(real32),
intent(in) :: x, y
36 this%m_tail = [x, y, 0.0]
40module subroutine par_set_tail_3(this, x, y, z)
41 class(plot_arrow),
intent(inout) :: this
42 real(real32),
intent(in) :: x, y, z
43 this%m_tail = [x, y, z]
47pure module function par_get_head(this) result(rst)
48 class(plot_arrow),
intent(in) :: this
49 real(real32),
dimension(3) :: rst
54module subroutine par_set_head_1(this, x)
55 class(plot_arrow),
intent(inout) :: this
56 real(real32),
intent(in) :: x(3)
61module subroutine par_set_head_2(this, x, y)
62 class(plot_arrow),
intent(inout) :: this
63 real(real32),
intent(in) :: x, y
64 this%m_head = [x, y, 0.0]
68module subroutine par_set_head_3(this, x, y, z)
69 class(plot_arrow),
intent(inout) :: this
70 real(real32),
intent(in) :: x, y, z
71 this%m_head = [x, y, z]
75pure module function par_get_color(this) result(rst)
76 class(plot_arrow),
intent(in) :: this
82module subroutine par_set_color(this, x)
83 class(plot_arrow),
intent(inout) :: this
84 type(color),
intent(in) :: x
89pure module function par_get_line_style(this) result(rst)
90 class(plot_arrow),
intent(in) :: this
92 rst = this%m_linestyle
96module subroutine par_set_line_style(this, x)
97 class(plot_arrow),
intent(inout) :: this
98 integer(int32),
intent(in) :: x
99 if (x == line_dashed .or. &
100 x == line_dash_dotted .or. &
101 x == line_dash_dot_dot .or. &
102 x == line_dotted .or. &
103 x == line_solid)
then
110pure module function par_get_line_width(this) result(rst)
111 class(plot_arrow),
intent(in) :: this
113 rst = this%m_linewidth
117module subroutine par_set_line_width(this, x)
118 class(plot_arrow),
intent(inout) :: this
119 real(real32),
intent(in) :: x
124pure module function par_get_head_type(this) result(rst)
125 class(plot_arrow),
intent(in) :: this
126 integer(int32) :: rst
127 rst = this%m_head_type
131module subroutine par_set_head_type(this, x)
132 class(plot_arrow),
intent(inout) :: this
133 integer(int32),
intent(in) :: x
134 if (x == arrow_backhead .or. &
135 x == arrow_head .or. &
136 x == arrow_heads .or. &
144pure module function par_get_fill(this) result(rst)
145 class(plot_arrow),
intent(in) :: this
146 integer(int32) :: rst
151module subroutine par_set_fill(this, x)
152 class(plot_arrow),
intent(inout) :: this
153 integer(int32),
intent(in) :: x
154 if (x == arrow_filled .or. &
155 x == arrow_empty .or. &
156 x == arrow_no_border .or. &
164pure module function par_get_move_to_front(this) result(rst)
165 class(plot_arrow),
intent(in) :: this
171module subroutine par_set_move_to_front(this, x)
172 class(plot_arrow),
intent(inout) :: this
173 logical,
intent(in) :: x
178pure module function par_get_head_size(this) result(rst)
179 class(plot_arrow),
intent(in) :: this
185module subroutine par_set_head_size(this, x)
186 class(plot_arrow),
intent(inout) :: this
187 real(real32),
intent(in) :: x
192pure module function par_get_head_angle(this) result(rst)
193 class(plot_arrow),
intent(in) :: this
199module subroutine par_set_head_angle(this, x)
200 class(plot_arrow),
intent(inout) :: this
201 real(real32),
intent(in) :: x
206pure module function par_get_head_back_angle(this) result(rst)
207 class(plot_arrow),
intent(in) :: this
209 rst = this%m_backangle
213module subroutine par_set_head_back_angle(this, x)
214 class(plot_arrow),
intent(inout) :: this
215 real(real32),
intent(in) :: x
220pure module function par_get_use_default_size(this) result(rst)
221 class(plot_arrow),
intent(in) :: this
223 rst = this%m_use_default_size
227module subroutine par_set_use_default_size(this, x)
228 class(plot_arrow),
intent(inout) :: this
229 logical,
intent(in) :: x
230 this%m_use_default_size = x
234module function par_get_cmd(this) result(rst)
236 class(plot_arrow),
intent(in) :: this
237 character(len = :),
allocatable :: rst
240 type(string_builder) :: str
242 real(real32) :: tail(3), head(3)
245 if (.not.this%get_is_visible())
then
251 call str%append(
"set arrow")
254 tail = this%get_tail_location()
255 head = this%get_head_location()
256 call str%append(
" from ")
257 call str%append(to_string(tail(1)))
259 call str%append(to_string(tail(2)))
261 call str%append(to_string(tail(3)))
263 call str%append(
" to ")
264 call str%append(to_string(head(1)))
266 call str%append(to_string(head(2)))
268 call str%append(to_string(head(3)))
271 select case (this%get_head_type())
272 case (arrow_backhead)
273 call str%append(
" backhead")
275 call str%append(
" head")
277 call str%append(
" heads")
279 call str%append(
" nohead")
282 if (this%get_head_type() /= arrow_no_head)
then
284 select case (this%get_head_fill())
286 call str%append(
" filled")
288 call str%append(
" empty")
289 case (arrow_no_border)
290 call str%append(
" noborder")
292 call str%append(
" nofilled")
296 if (.not.this%get_use_default_size())
then
297 call str%append(
" size ")
298 call str%append(to_string(this%get_head_size()))
300 call str%append(to_string(this%get_head_angle()))
302 call str%append(to_string(this%get_head_back_angle()))
307 if (this%get_move_to_front())
then
308 call str%append(
" front")
310 call str%append(
" back")
314 clr = this%get_color()
315 call str%append(
' lc rgb "#')
316 call str%append(clr%to_hex_string())
320 call str%append(
" lw ")
321 call str%append(to_string(this%get_line_width()))
324 call str%append(
" lt ")
325 call str%append(to_string(this%get_line_style()))
326 if (this%get_line_style() /= line_solid)
then
327 call str%append(
" dashtype ")
328 call str%append(to_string(this%get_line_style()))
332 rst = char(str%to_string())
336pure module subroutine par_assign(x, y)
337 type(plot_arrow),
intent(out) :: x
338 class(plot_arrow),
intent(in) :: y
339 x%m_visible = y%m_visible
342 x%m_color = y%m_color
343 x%m_linestyle = y%m_linestyle
344 x%m_linewidth = y%m_linewidth
345 x%m_head_type = y%m_head_type
346 x%m_filling = y%m_filling
347 x%m_front = y%m_front
349 x%m_angle = y%m_angle
350 x%m_backangle = y%m_backangle
351 x%m_use_default_size = y%m_use_default_size