Put new in switch in place of old (a kept handle, deleted).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ReferenceFrame), | intent(in) | :: | self | |||
| type(c_ptr), | intent(in) | :: | switch |
the switch; the new node (may be null) |
||
| type(c_ptr), | intent(inout) | :: | old |
the node replaced (deleted; set to new) |
||
| type(c_ptr), | intent(in) | :: | new |
the switch; the new node (may be null) |
subroutine replace_child(self, switch, old, new) class(ReferenceFrame), intent(in) :: self type(c_ptr), intent(in) :: switch, new !! the switch; the new node (may be null) type(c_ptr), intent(inout) :: old !! the node replaced (deleted; set to new) if (c_associated(old)) then call check_status(vkf_node_remove_child(switch, old)) call vkf_node_delete(old) end if old = new if (.not. c_associated(new)) return if (self%shown_) call check_status(vkf_compile_node(new)) call check_status(vkf_node_add_child(switch, new)) end subroutine replace_child