From 976bfc1f0c97c6ad4f4defc96f9c1e768a3638be Mon Sep 17 00:00:00 2001 From: Luc Maisonobe <luc@orekit.org> Date: Thu, 22 May 2014 17:48:35 +0200 Subject: [PATCH] Improved activity diagrams. --- ...hage-inner-recursion-activity-diagram.puml | 19 ++++++++++++------- .../duvenhage-top-loop-activity-diagram.puml | 14 +++++++------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/design/duvenhage-inner-recursion-activity-diagram.puml b/design/duvenhage-inner-recursion-activity-diagram.puml index 04efd176..e16ec8da 100644 --- a/design/duvenhage-inner-recursion-activity-diagram.puml +++ b/design/duvenhage-inner-recursion-activity-diagram.puml @@ -29,21 +29,26 @@ skinparam ActivityFontSize 11 start - if (recursion depth > 30) then (yes) + if (recursion depth > 30?) then (yes) : search failed; stop endif - if (start and end point on same pixel) then (yes) - : return pixel intersection; + 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 stop endif - : compute kd-tree deepest level\ncontaining both start and end points; + :compute kd-tree deepest\nlevel sub-tile containing\nboth segment endpoints; if (compare segment and sub-tile maximum elevation) then (fully above) : return null; - note right + note left when the line-of-sight segment is fully above Digital Elevation Model, we can safely reject - it and proceed to next segment + it and proceed immediately to next segment end note stop endif @@ -56,7 +61,7 @@ end note repeat :intersection ⇦ recurse(previous, crossing); - if (found intersection?) then (yes) + if (intersection found?) then (yes) : return intersection; stop endif diff --git a/design/duvenhage-top-loop-activity-diagram.puml b/design/duvenhage-top-loop-activity-diagram.puml index 773abc72..f311395f 100644 --- a/design/duvenhage-top-loop-activity-diagram.puml +++ b/design/duvenhage-top-loop-activity-diagram.puml @@ -34,10 +34,10 @@ : current point ⇦ null; : hmax ⇦ tile maximum elevation; while (current point is null) - : entry ⇦ point at altitude hmax; - if (locate entry point) then (in selected tile) + : current ⇦ point at altitude hmax; + if (locate current point) then (in selected tile) else (outside of selected tile) - : select tile containing entry point; + : select tile containing current point; : hmax ⇦ max(hmax, tile maximum elevation); : current point ⇦ null; endif @@ -45,16 +45,16 @@ repeat : exit ⇦ line-of-sight exit point from tile; : intersection ⇦ Duvenhage(current, exit); - if (found intersection?) then (yes) + if (intersection found?) then (yes) : return intersection; stop endif - if (tile exited at side?) then (no) + if (tile exit) then (bottom) : searching ⇦ false; - else (yes) + else (side) : forward point ⇦ point slightly after exit point; : select tile containing forward point; - if (DEM traversed between\ncurrent and forward points) then (yes) + if (DEM traversed between\ncurrent and forward points?) then (yes) : return current point; note right extremely rare case! -- GitLab