Constructor
new SlideShow(itownsView, configSlideShowopt, extent)
It initializes the widget.
Name | Type | Attributes | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
itownsView | itowns. | The itowns view. | |||||||||||||||||||||||||
configSlideShow | object | <optional> | The configuration of the widget. need description Properties
| ||||||||||||||||||||||||
extent | module:itowns~Extent | The extent of the widget. |
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
Members
callbacksHTMLEl :Array.<{event:string, element:HTMLElement, cb:Function}>
List of callbacks to set when the window is created
- Array.<{event:string, element:HTMLElement, cb:Function}>
domElement :HTMLElement
Root html of slideshow view
- HTMLElement
extent :module:itowns~Extent
- module:itowns~Extent
itownsView :module:itowns~PlanarView
- module:itowns~PlanarView
notifyValue :boolean
if true the application update its view3D eachFrame
- boolean
plane :THREE.Mesh
- THREE.
Mesh
textureFiles :Array.<TextureFile>
List of textures with data
- Array.<TextureFile>
Methods
createDefaultTextureFile(index) → {TextureFile}
It creates a new texture file object with the default texture and returns it
Name | Type | Description |
---|---|---|
index | number | The index of the texture file. |
A new texture file object.
- Type:
- TextureFile
createInputVector(labels, vectorName, step) → {Object}
Name | Type | Default | Description |
---|---|---|---|
labels | Array. | List of labels name | |
vectorName | string | Name of the vector | |
step | number | 0.5 | The step of HTMLElement input (type number) |
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
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
Name | Type | Description |
---|---|---|
inputVector | HTMLDivElement | HTMLElement 'div' contains labels and inputs HTMLElements |
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
Name | Type | Description |
---|---|---|
iInput | number | The index of the input element |
value | number | 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
Name | Type | Description |
---|---|---|
slideIndex | number | the index of the slideshow in the config file |
setTexture(iText)
Set this.currentTexture
Name | Type | Description |
---|---|---|
iText | number | The index of the texture to set |
updateVectors()
Update vectors variables with the values contained in inputs elements in DOM