Make the sides, edges and base outline (those the draw mode says), in place of the old.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(PolyhedralCone), | intent(inout) | :: | self |
subroutine make_cone(self) class(PolyhedralCone), intent(inout) :: self real(wp), allocatable :: v(:,:), edges(:,:) integer, allocatable :: idx(:,:) type(c_ptr) :: group integer :: i, n if (.not. c_associated(self%nodes%contents)) return n = size(self%clock) allocate(v(3, n + 1), idx(3, n), edges(3, 2 * n)) v(:, n + 1) = 0.0_wp ! the apex do i = 1, n v(:, i) = self%length_ * [tan(self%cone(i)) * cos(self%clock(i)), tan(self%cone(i)) * sin(self%clock(i)), -1.0_wp] idx(:, i) = [n + 1, i, modulo(i, n) + 1] edges(:, 2*i-1) = 0.0_wp edges(:, 2*i) = v(:, i) end do group = vkf_switch_create() if (iand(self%mode, CONE_SIDES) /= 0) call add(group, surface_node(v, idx, self%cone_color_)) if (iand(self%mode, CONE_EDGES) /= 0) call add(group, line_node(edges, self%line_color_, self%width_, .true.)) if (iand(self%mode, CONE_BASE_OUTLINE) /= 0) & call add(group, line_node(closed_segments(v(:, 1:n)), self%line_color_, self%width_, .true.)) call self%nodes%replace(group) end subroutine make_cone