Skip to content
Snippets Groups Projects
duvenhage-top-loop-activity-diagram.puml 2.54 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
    
      : gp₀ ⇦ point at altitude 0;
    
    Luc Maisonobe's avatar
    Luc Maisonobe committed
      : select tile containing gp₀;
    
      : current point ⇦ null;
      : hmax ⇦ tile maximum elevation;
    
    Luc Maisonobe's avatar
    Luc Maisonobe committed
      while (current point is null)
    
        : current ⇦ point at altitude hmax;
        if (locate current point) then (in selected tile)
    
    Luc Maisonobe's avatar
    Luc Maisonobe committed
        else (outside of selected tile)
    
          : select tile containing current point;
    
          : hmax ⇦ max(hmax, tile maximum elevation);
          : current point ⇦ null;
    
    Luc Maisonobe's avatar
    Luc Maisonobe committed
        endif
      endwhile
      repeat
    
        : exit ⇦ line-of-sight exit point from tile;
        : intersection ⇦ Duvenhage(current, exit);
    
        if (intersection found?) then (yes)
    
    Luc Maisonobe's avatar
    Luc Maisonobe committed
          : return intersection;
          stop
        endif
    
        if (tile exit) then (bottom)
    
          : searching ⇦ false;
    
        else (side)
    
          : forward point ⇦ point slightly after exit point;
    
    Luc Maisonobe's avatar
    Luc Maisonobe committed
          : select tile containing forward point;
    
          if (DEM traversed between\ncurrent and forward points?) then (yes)
    
    Luc Maisonobe's avatar
    Luc Maisonobe committed
            : return current point;
            note right
             extremely rare case!
            end note
            stop
          endif
    
          : current point ⇦ forward point;
    
    Luc Maisonobe's avatar
    Luc Maisonobe committed
        endif
      repeat while (searching ?)
      :search failed;
      note left
        this should never happen
      end note
    
    @enduml