Make the axes' lines and tick marks, in place of the old (nothing before build_contents).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(CoordinateAxes), | intent(inout) | :: | self |
subroutine make_axes(self) class(CoordinateAxes), intent(inout) :: self real(wp), allocatable :: lines(:,:), major(:,:), minor(:,:) real(wp) :: e(3), mark, f type(c_ptr) :: group integer :: k, i if (.not. c_associated(self%nodes%contents)) return allocate(lines(3, 0), major(3, 0), minor(3, 0)) do k = 1, 3 if (iand(self%drawn, 2**(k-1)) == 0) cycle e = 0.0_wp e(k) = 1.0_wp call append(lines, reshape([0.0_wp, 0.0_wp, 0.0_wp, self%length_ * e], [3, 2])) if (self%major > 0.0_wp) then do i = 1, int(self%length_ / self%major + 1.0e-9_wp) call append(major, reshape(i * self%major * e, [3, 1])) end do end if if (self%minor > 0.0_wp) then do i = 1, int(self%length_ / self%minor + 1.0e-9_wp) mark = i * self%minor if (self%major > 0.0_wp) then ! not where a major tick is f = mark / self%major if (abs(f - nint(f)) < 1.0e-6_wp) cycle end if call append(minor, reshape(mark * e, [3, 1])) end do end if end do group = vkf_switch_create() call add(group, line_node(lines, self%color(), self%width_, .true.)) call add(group, marker_node(major, self%color(), self%major_size, self%shape_, self%length_, self%image)) call add(group, marker_node(minor, self%color(), self%minor_size, self%shape_, self%length_, self%image)) call self%nodes%replace(group) end subroutine make_axes