# Add ImageTourProcessor
## Issue Tree

``` plantuml
@startuml

skinparam state {
  BackgroundColor<<Release>> Aquamarine
  BackgroundColor<<Active>> NavajoWhite
  BackgroundColor<<Done>> White
  BorderColor<<Done>> Grey
}

'******************************************************************************
'

state ImageTourProcessor {
  DatedImageTourSessions<<Done>> --> EnhanceSessionData
  EnhanceSessionData<<Done>> --> AddImageTourProcessor

  RenderPanoPreviews<<Done>> --> ReOrderRenderOutput
  ReOrderRenderOutput --> AddMissingImageTourFunctions
  AddMissingImageTourFunctions<<Done>> --> AddImageTourProcessor
  AddImageTourProcessor --> AddAImageTourFunctionLibrary
  AddAImageTourFunctionLibrary --> AddDemoMap
}



'-----------------------------------------------------------------------------
'-----------------------------------------------------------------------------

'******************************************************************************

@enduml
```
##### Description
A set of tools that allow the designer to render multiple ImageTour sessions automatically ant upload them to our database.

##### Main Branch
 - Name: `image-tour-processor`
 - ArchInteraction: http://git.pillars.ch:30000/simongloor/ArchInteraction/tree/image-tour-processor
 - RGInteraction: https://git.raumgleiter.com/Raumgleiter/RGInteraction/tree/image-tour-processor


# Issues  

## Issue Text

##### Issue Tree
 - https://git.raumgleiter.com/simongloor/todo/blob/master/IssueTrees/ImageTourSession_Processor.md

---

## Dated ImageTourSessions

##### Project Issues
 - ArchInteraction: http://git.pillars.ch:30000/simongloor/ArchInteraction/issues/281

##### Tasks
 - Refactor the `FString SessionName` to `FString SessionId`
 - Remove the parameter from `StartSession(cSessionName)` and generate a Date-Time string instead.
 - This should now generate cleanly labeled directories on your drive when sessions are created.
 - Ensure that capturing an Image (Module_Image) starts a Session if no active Session exists.

##### Documentation
 - http://git.pillars.ch:30000/simongloor/ArchInteraction/tree/develop/Documentation/PanoTool

##### Clickdummy / Demo
 - http://git.pillars.ch:30000/simongloor/ArchInteraction/blob/develop/Content/Public/Demo/ImageTour/Arin_Demo_Capture_Start.umap

##### Existing Assets/Classes
 - none

---

## Enhance Session Data

##### Project Issues
 - ArchInteraction: http://git.pillars.ch:30000/simongloor/ArchInteraction/issues/282

##### Tasks
 - Implement `FArin_ImageTourSession_Data` (see Documentation)
 - Add `ImageTourMaster_Module_Session.SetActiveSessionData(sessionData)` and `ImageTourMaster_Module_Session.GetActiveSessionData()`
 - Ensure that the SessionData is saved to the disk and loaded when a Session is activated.

##### Documentation
 - http://git.pillars.ch:30000/simongloor/ArchInteraction/tree/develop/Documentation/PanoTool

##### Clickdummy / Demo
 - http://git.pillars.ch:30000/simongloor/ArchInteraction/blob/develop/Content/Public/Demo/ImageTour/Arin_Demo_Capture_Start.umap

##### Existing Assets/Classes
 - none

---

## Add Missing ImageTour Functions

##### Project Issues
 - ArchInteraction: http://git.pillars.ch:30000/simongloor/ArchInteraction/issues/283

##### Tasks
 - Add these missing functions
   - `ImageTourMaster_Module_Session::GetOldestSession()`
   - `ImageTourMaster_Module_Session::GetNewestSession()`
   - `ImageTourMaster_Module_Image::DeleteCapturedImage(int cImageIndex)`

##### Documentation
 - http://git.pillars.ch:30000/simongloor/ArchInteraction/tree/develop/Documentation/PanoTool

##### Clickdummy
 - none

##### Existing Assets/Classes
 - none

---
## Render PanoPreviews

##### Project Issues
 - ArchInteraction: http://git.pillars.ch:30000/simongloor/ArchInteraction/issues/284

##### Tasks
 - Rename `EArin_ImageType::Picture` to `EArin_ImageType::Planar`
 - Rename `CapturePicture` to `CapturePlanar`
 - When capturing a Pano, also take a screenshot in the same manner as CapturePlanar. It should be saved to the same directory with the suffix `_Preview`.

##### Documentation
 - http://git.pillars.ch:30000/simongloor/ArchInteraction/tree/develop/Documentation/PanoTool

##### Clickdummy
 - none

##### Existing Assets/Classes
 - none

---

## Re-Order Render Output

##### Project Issues
 - ArchInteraction: http://git.pillars.ch:30000/simongloor/ArchInteraction/issues/290

##### Tasks
 - Resolve the issue of the (merged) Merge Request:  

> :stop\_sign:  The previews don't get moved when rendering:  
>> .../Rendered/001_LocationName/LocationName_A00B00C00.png  
>> .../Rendered/001_LocationName/LocationName_prev.png

##### Documentation
 - none

##### Clickdummy
 - none

##### Existing Assets/Classes
 - http://git.pillars.ch:30000/simongloor/ArchInteraction/merge_requests/240

---

## Add ImageTourProcessor

##### Project Issues
 - RGInteraction: https://git.raumgleiter.com/Raumgleiter/RGInteraction/issues/5

##### Tasks
Add one or multiple classes that trigger the rendering of a ImageTour Sessions, uploads the result, deletes it locally and goes on to the next Session.

>**Pseudo Code:**
>```c++
>void OnBegin()
>{
>    ImageTourMaster->OnSessionProcessed += OnSessionProcessed_Multi;
>}
>void OnOneSessionProcessed_Multi()
>{
>    UploadTour();
>    //delay
>    RenderAll();
>}
>public void RenderAll()
>{
>    if(!ImageTourMaster->HasUnprocessedTour())
>    {
>        return;
>    }
>    ImageTourMaster->RenderOldestSession();
>}
>```

##### Documentation
 - https://git.raumgleiter.com/Raumgleiter/RGInteraction/blob/develop/Documentation/ImageTourProcessor.md

##### Clickdummy
 - none

##### Existing Assets/Classes
 - @mauriciorodriguez has implemented a web api to upload the files as a zip.  

---

## Add a ImageTourFunctionLibrary

##### Project Issues
 - RGInteraction: https://git.raumgleiter.com/Raumgleiter/RGInteraction/issues/6

##### Tasks
Implement the BlueprintLibrary `Rgin_CodeLib_ImageTours`.  

The purpose of the library is, that Designers can use the functionality without knowing the class hierarchy. Other Plugins such as SteamVR do the same.

##### Documentation
 - https://git.raumgleiter.com/Raumgleiter/RGInteraction/blob/develop/Documentation/ImageTourProcessor.md

##### Clickdummy
 - none

##### Existing Assets/Classes
 - @mauriciorodriguez has implemented a web api to upload the files as a zip.  

---

## Add a Demo Map

##### Project Issues
 - RGInteraction: https://git.raumgleiter.com/Raumgleiter/RGInteraction/issues/7

##### Tasks
 - Add a Demo Map for the ImageTourSessions, showcasing a functional, but not pretty UI.
 - The folder-structure should be similar to the structure of the ArchInteraction Plugin.
 - You should not reference any assets in the private folder of the ArchInteraction plugin. You can copy them though.
 - You need to ensure the naming convention and prevent any duplicate file-names, even in different folders.
 - The goals of this map:
   - If you need a lot of nodes, you might want to implement them as a c++ function.
   - If something doesn't work in the map of the user, but it works in the demo map, it's probably not the developers fault.
   - Allows testing your features after changes.
 - The UI should be labour intensive only when it's in order to fulfill any of those goals (E.g. greying out a button is useful to check functionality).

##### Documentation
 - none

##### Clickdummy
 - See the paper with the UI.
 - Also add a button that opens the Capture-Level and mark it visually as Demo-Tool.

##### Existing Assets/Classes
 - none  

---
