Skip to content
Snippets Groups Projects
duvenhage-inner-recursion-activity-diagram.puml 2.58 KiB
Newer Older
  • Learn to ignore specific revisions
  • Luc Maisonobe's avatar
    Luc Maisonobe committed
    ' Copyright 2013-2022 CS GROUP
    
    ' Licensed to CS GROUP (CS) under one or more
    
    Luc Maisonobe's avatar
    Luc Maisonobe committed
    ' contributor license agreements.  See the NOTICE file distributed with
    ' this work for additional information regarding copyright ownership.
    ' CS licenses this file to You under the Apache License, Version 2.0
    ' (the "License"); you may not use this file except in compliance with
    ' the License.  You may obtain a copy of the License at
    '
    '   http://www.apache.org/licenses/LICENSE-2.0
    '
    ' Unless required by applicable law or agreed to in writing, software
    ' distributed under the License is distributed on an "AS IS" BASIS,
    ' WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    ' See the License for the specific language governing permissions and
    ' limitations under the License.
    
    @startuml
    
      skinparam svek                                true
      skinparam NoteBackgroundColor                 #F3EFEB
      skinparam NoteBorderColor                     #691616
      skinparam NoteFontColor                       #691616
      skinparam ActivityStartColor                  #6A584B
      skinparam ActivityEndColor                    #6A584B
      skinparam ActivityBarColor                    #6A584B
      skinparam ActivityBorderColor                 #691616
      skinparam ActivityBackgroundColor             #F3EFEB/CCC9C5
      skinparam ActivityArrowColor                  #691616
      skinparam ActivityFontSize                    11
    
      start
    
      if (recursion depth > 30?) then (yes)
    
    Luc Maisonobe's avatar
    Luc Maisonobe committed
        : search failed;
        stop
      endif
    
      if (compare start and end point) then (same pixel)
        : intersection ⇦ pixel intersection, with bilinear model;
        : return intersection;
        note left
          this is the nominal return,
          at final recursion level
        end note
    
    Luc Maisonobe's avatar
    Luc Maisonobe committed
        stop
      endif
    
      :compute kd-tree deepest\nlevel sub-tile containing\nboth segment endpoints;
    
    Luc Maisonobe's avatar
    Luc Maisonobe committed
      if (compare segment and sub-tile maximum elevation) then (fully above)
        : return null;
    
        note left
    
    Luc Maisonobe's avatar
    Luc Maisonobe committed
          when the line-of-sight segment is fully above
          Digital Elevation Model, we can safely reject
    
          it and proceed immediately to next segment
    
    Luc Maisonobe's avatar
    Luc Maisonobe committed
        end note
        stop
      endif
    
      :previous ⇦ start;
      : crossings ⇦ line-of-sight segment crossings of next level sub-tiles;
    
    Luc Maisonobe's avatar
    Luc Maisonobe committed
      note right
        crossings can be computed either
        using flat body hypothesis
        or taking curvature into account
      end note
      repeat
    
        :intersection ⇦ recurse(previous, crossing);
    
        if (intersection found?) then (yes)
    
    Luc Maisonobe's avatar
    Luc Maisonobe committed
          : return intersection;
          stop
        endif
    
        :previous ⇦ crossing;
    
    Luc Maisonobe's avatar
    Luc Maisonobe committed
      repeat while (more crossings?)
    
      :intersection ⇦ recurse(previous, end);
    
    Luc Maisonobe's avatar
    Luc Maisonobe committed
      : return intersection;
      stop
    
    @enduml