SlideShow

Slideshow Widget class

Constructor

new SlideShow(itownsView, configSlideShowopt, extent)

It initializes the widget.

Parameters:
NameTypeAttributesDescription
itownsViewitowns.PlanarView

The itowns view.

configSlideShowobject<optional>

The configuration of the widget. need description

Properties
NameTypeDescription
slidesArray.<object>

Array of slide Object

Properties
NameTypeDescription
namestring

Name of a slideshow

folderstring

Path of the folder

diapositivesArray.<string>

Array of path of name files

durationLoopInSecnumber

Seconds between two slides

textureRotationnumber

Rotation in degrees of textures

extentmodule:itowns~Extent

The extent of the widget.

Example
Config Example
{
  "slides": [
    {
      "name": "diapo1",
      "folder": "./assets/img/slide",
      "diapositives": ["1.jpeg", "2.jpeg", "3.jpeg"]
    },
    {
      "name": "diapo2",
      "folder": "./assets/img/slide",
      "diapositives": ["11.jpeg", "12.jpeg", "13.jpeg"]
    }
  ],
 "textureRotation": 0,
 "durationLoopInSec":10
}

Classes

SlideShow

Members

callbacksHTMLEl :Array.<{event:string, element:HTMLElement, cb:Function}>

List of callbacks to set when the window is created

Type:
  • Array.<{event:string, element:HTMLElement, cb:Function}>

domElement :HTMLElement

Root html of slideshow view

Type:
  • HTMLElement

extent :module:itowns~Extent

Type:
  • module:itowns~Extent

itownsView :module:itowns~PlanarView

Type:
  • module:itowns~PlanarView

notifyValue :boolean

if true the application update its view3D eachFrame

Type:
  • boolean

plane :THREE.Mesh

Type:
  • THREE.Mesh

textureFiles :Array.<TextureFile>

List of textures with data

Type:

Methods

createDefaultTextureFile(index) → {TextureFile}

It creates a new texture file object with the default texture and returns it

Parameters:
NameTypeDescription
indexnumber

The index of the texture file.

Returns:

A new texture file object.

Type: 
TextureFile

createInputVector(labels, vectorName, step) → {Object}

Parameters:
NameTypeDefaultDescription
labelsArray.String

List of labels name

vectorNamestring

Name of the vector

stepnumber0.5

The step of HTMLElement input (type number)

Returns:

The inputVector 'div' contains labels and inputs HTMLElements

Type: 
Object

createPlane()

It creates a PlaneGeometry and a MeshBasicMaterial, to create the Mesh this.plane

getSizeValues() → {Object}

Get size values contained in inputs elements in DOM

Returns:

sizevalues

Type: 
Object

initCBDrop()

Set the callback function of event 'drop' @warn !event.preventDefault!

initDefaultTexture()

Create a default texture and put in this.defaultTexture

initHtml()

Create all HTMLElements and fill this.domElement

initInputListener()

Add event listeners to input

inputVectorToVector(inputVector) → {THREE.Vector}

Convert inputVector HTMLElement to THREE.Vector

Parameters:
NameTypeDescription
inputVectorHTMLDivElement

HTMLElement 'div' contains labels and inputs HTMLElements

Returns:

vector

Type: 
THREE.Vector

loopSlideShow()

Loop through a slide show of textures

matchExtent()

It sets the size, coordinates and rotation inputs to the values of the extent

matchRatio(iInput, value)

Function called when aspectRatio is checked

Parameters:
NameTypeDescription
iInputnumber

The index of the input element

valuenumber

The value of the input element

modifyPlane()

Modify this.plane {THREE.Mesh}

setSlideshowInConfig(slideIndex)

It loads the textures and videos of the slideshow and stores them in the this.textureFiles array

Parameters:
NameTypeDescription
slideIndexnumber

the index of the slideshow in the config file

setTexture(iText)

Set this.currentTexture

Parameters:
NameTypeDescription
iTextnumber

The index of the texture to set

updateVectors()

Update vectors variables with the values contained in inputs elements in DOM