Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
dev:viewer:actions:add_view [2023/02/13 14:53]
pieter
dev:viewer:actions:add_view [2023/02/14 14:21]
jeroen removed
Line 1: Line 1:
-====== Add View ======+====== Add, Move, Change View ====== 
 + 
 +===== View Modes ===== 
 + 
 +The available View Modes depend on the loaded Resources: 
 + 
 +  * 3D View 
 +  * Streetlevel Spherical View 
 +  * Streetlevel Planar View 
 +  * Aerial Planar View 
 +  * Aerial Oblique Planar View 
 + 
 +===== Add View ======
  
 Click on the '+' icon and view mode on the left sidebar to open a new view. Next, click on the [[dev:viewer:viewmodes:reference|Reference View]] or an existing View on the location where a new View should be opened. \\ Click on the '+' icon and view mode on the left sidebar to open a new view. Next, click on the [[dev:viewer:viewmodes:reference|Reference View]] or an existing View on the location where a new View should be opened. \\
Line 5: Line 17:
 The different View modes are described [[dev:viewer:viewmodes:3d|here]]. The different View modes are described [[dev:viewer:viewmodes:3d|here]].
  
-===== Find Best Photo ======+===== Move View ===== 
 + 
 +Move an existing View to a new location 
 + 
 +Hover over the ID of the View on top, click 'move' and choose another location in one of the Views or Reference View. For image Views, it's possible to choose a specific image by clicking on the footprint of the photo position itself. 
 + 
 +To move all views at once, hold Shift in move mode and choose a new location. While holding Shift, 'move' in the View Action Fly-out will change to 'move all' to indicate this.
  
-==== Input Parameters ====+===== Switch View Mode =====
  
-FIXME Add find photo algorithm information+Change the View Mode of a View.
  
-Inputs:  +Hover over the eye-icon on top of the view to open the 'View Mode Fly-out' and choose the desired View mode to change the type of the existing View.
-  * resources +
-  * focusPosition : The position we want to observe. +
-  * viewPosition : The position we are observing the observed position from. +
-  * minPhotos : The minimum amount of photos to return. Ignored if not positive. +
-  * relevantPhotosMax : The maximum number of photos to return. +
-  * searchDistances2D : The array of search distance steps to use. +
-  * findCloserPhotoAlgorithm : The algorithm used to sort photo positions. +
-    * ''PIXEL_DISTANCE'' : Identifies the technique of using the pixel distance from the focus position projected on the photo, to the photo center. +
-    * ''SPATIAL_DISTANCE'' : Identifies the technique using spatial distance between photo position and view position (fallback on focus position). +
-  * requireFocusVisible : Require the projection of the focus position on the photo to be inside the photo bounds.  Applies to planars only. +
-  * isStreetlevel : If this parameter is true, the 'requireFocusVisible' parameter changes to an algorithm more suited to streetlevel planars.  The photo pan angle is compared to the (photo,focusPosition) angle and needs to be inside 85% of the horizontal FOV of the photo. +
-  * searchCenter : The center position to use when retrieving photo positions. +
-    * ''FOCUS'' : Retrieve photo positions around the focusPosition.  When ''findCloserPhotoAlgorithm'' is ''SPATIAL_DISTANCE'', the spatial distance to the focus position will be used. +
-    * ''FOCUS_AND_VIEW'' : Retrieve photo positions around the focusPosition.  When ''findCloserPhotoAlgorithm'' is ''SPATIAL_DISTANCE'', the spatial distance to the viewPosition will be used, with a fallback on the focusPosition when not available. +
-    * ''VIEW'' : Retrieve photo positions around the view position (fallback on focusPosition).  When ''findCloserPhotoAlgorithm'' is SPATIAL_DISTANCE, the spatial distance to the viewPosition will be used, with a fallback on the focusPosition.+
  
-=== Input Parameters per renderMode ====+===== Focus other Views =====
  
-^ ^ Streetlevel Spherical ^ Streetlevel Planar ^ UAV Planar ^ Oblique Planar ^  
-| focusPosition       | <required> | <required> | <required> | <required> | 
-| viewPosition        | <optional> | <optional> | <optional> | <optional> | 
-| minPhotos           | 0 | 0 | 3 | 0 | 
-| relevantPhotosMax   | 10 | 10 | 10 | 10 | 
-| searchDistances2D   | ''StreetlevelDistances'' | ''StreetlevelDistances'' | ''AerialDistances''  | ''AerialDistances'' | 
-| findCloserPhotoAlgorithm | ''SPATIAL_DISTANCE''  | ''SPATIAL_DISTANCE''<sup>1</sup> | ''SPATIAL_DISTANCE''<sup>1</sup> | PIXEL_DISTANCE<sup>1</sup> | 
-| requireFocusVisible | false | true | true | true | 
-| isStreetlevel       | true | true | false | false | 
-| searchCenter        | ''FOCUS_AND_VIEW''<sup>2</sup> | ''FOCUS_AND_VIEW''<sup>2</sup> | ''FOCUS_AND_VIEW''<sup>2</sup> | ''FOCUS'' | 
  
-<sup>1</sup> This is the default.  User-configurable via ''Views -> (Type) Image View -> Open best planar photo by''\\  +===== Search & Open best photo =====
-<sup>2</sup> This is the default. User-configurable via ''Views -> Image Views -> Open image from 3D View''+
  
-Some constants :  +Add, Move and Focus Views trigger the request to Search and Open the "best" image. \\ 
-  * AerialDistances = ''25,50,100,200,400,800,1600,3200,6400,12800'' +Depending on the use case and data-type other methods or configurations can be used.  \\ 
-  * StreetlevelDistances = ''3,9,27,81,243,729''+Anywaythe action consists of 2 consecutive steps 
 +  - Get Candidates 
 +  - Sort Photos
  
-==== Algorithm ====+==== Get Candidates ====
  
-FindClosestPhoto+Find relevant photos around the requested Focus Coordinate. \\ 
 +Any photo becomes a candidate if  
 +  * Focus Coordinate is nearby the Photo Coordinate (Search Radius)  
 +  * Focus Coordinate is in the field of View of the Photo.
  
-<code javascript> +Searching for candidates is done by incrementally increasing the search radius and ends when 
-function(resource,searchDistances2D,viewPosition,focusPosition,parameters) +  10 or more candidates are found, or 
-+  * the maximum search radius is reached.
-  for(searchDistance in searchDistances2D)  +
-  { +
-    let searchCenterPosition = (searchCenter = VIEW) ? viewPosition : focusPosition; +
-    let photoList = resource.findPhotosInCircle(searchCenterPosition,searchDistance); +
-    if (requireFocusVisible) +
-    { +
-      if (parameters.isStreetlevel) +
-      { +
-        photoList = keepPhotosWithProjectionInsidePan(photoList,85%); +
-      } +
-      else +
-      { +
-        photoList = keepPhotosWithProjectionInsideMargin(photoList,20%); // projection is inside photo bounds, reduced by a 20% margin? +
-      } +
-      if (photoList.length<10) +
-      { +
-        photoList = keepPhotosWithProjectionInsideMargin(photoList,5%); // projection is inside photo bounds, reduced by a 5% margin? +
-      } +
-    } +
-    if (photoList.length<minPhotos) +
-    { +
-      continue; +
-    } +
-    photoList = sortPhotos(photoList, parameters) +
-    return { +
-      photo: photoList[0], +
-      relevantPhotos: photoList.slice(1,relevantPhotosMax) +
-    } +
-  } +
-+
-</code>+
  
-<code javascript> +==== Sort Photos ====
-function sortPhotos(photoList) +
-+
-  for(photo in photoList) +
-  { +
-    if (parameters.findCloserPhotoAlgorithm PIXEL_DISTANCE) +
-    { +
-      photo.distance getDistanceToProjectionCenter(photo,focusPosition) +
-    } +
-    if (parameters.findCloserPhotoAlgorithm  SPATIAL_DISTANCE) +
-    { +
-      if (viewPosition!=null) +
-      { +
-        photo.distance  getDistanceToPosition(photo,viewPosition) +
-      } +
-      else +
-      { +
-        photo.distance getDistanceToPosition(photo,focusPosition) +
-      } +
-    } +
-  } +
-  sortByDistance(photoList); +
-  return photoList; +
-+
-</code> +
-      +
  
 +Sort candidates by relevance, to get the best image and order alternative images. \\
 +The best image has the smallest value for the selected option
  
 +Options:
 +  * By Direction offset \\ Offset between the Candidate Direction (Candidate to Focus Coordinate) and Request Direction (3D View Position to Focus Coordinate).
 +  * By Pixel offset \\ Pixel offset of the Focus Coordinate projected on the Candidate Image to the Candidate Image Center.
 +  * By Spatial distance \\ Spatial distance of the Focus Coordinate to the Candidate Coordinate.
  
-distanceToProjectionCenter(): projects the focus position on the photo and returns the pixel distance from that position to the photo center.