fortplot_line_styles Module

Line pattern and style rendering algorithms

This module contains line style pattern rendering and segment drawing algorithms following the Single Responsibility Principle.

SOLID: Single responsibility for line style implementation



Functions

public function get_pattern_length(pattern, pattern_size)

Calculate total length of pattern cycle Following KISS principle - simple sum calculation

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: pattern(20)
integer, intent(in) :: pattern_size

Return Value real(kind=wp)

public function should_draw_at_distance(distance, pattern, pattern_size, pattern_length)

Determine if line should be drawn at given distance in pattern Following SRP - handles only pattern position logic

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: distance
real(kind=wp), intent(in) :: pattern(20)
integer, intent(in) :: pattern_size
real(kind=wp), intent(in) :: pattern_length

Return Value logical


Subroutines

public subroutine get_line_pattern(linestyle, pattern, pattern_size)

Get line pattern array for given style Following DRY principle - centralized pattern definitions

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: linestyle
real(kind=wp), intent(out) :: pattern(20)
integer, intent(out) :: pattern_size

public subroutine advance_pattern_state(current_distance, segment_length, pattern, pattern_size, pattern_length, new_distance)

Advance pattern state for continuous rendering Following SRP - handles only state advancement

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: current_distance
real(kind=wp), intent(in) :: segment_length
real(kind=wp), intent(in) :: pattern(20)
integer, intent(in) :: pattern_size
real(kind=wp), intent(in) :: pattern_length
real(kind=wp), intent(out) :: new_distance