Model3DService
in package
Model3DService
Handles 3D model operations including upload, viewing, hotspots, and IIIF 3D manifest generation
Tags
Table of Contents
Methods
- __construct() : mixed
- addHotspot() : int|null
- Add a hotspot to a model
- deleteHotspot() : bool
- Delete a hotspot
- deleteModel() : bool
- Delete a 3D model
- generateIiif3DManifest() : array<string|int, mixed>|null
- Generate IIIF 3D manifest for a model Based on IIIF 3D TSG (Technical Specification Group) draft
- getHotspots() : array<string|int, mixed>
- Get all hotspots for a model
- getModel() : object|null
- Get a single 3D model by ID
- getModelCount() : int
- Get model count for object
- getModelsForObject() : array<string|int, mixed>
- Get all 3D models for an information object
- getModelViewerHtml() : string
- Get HTML for model-viewer component (Google's WebXR viewer)
- getPrimaryModel() : object|null
- Get primary 3D model for an object
- getSetting() : mixed
- getSupportedFormats() : array<string|int, mixed>
- Get all supported formats
- getThreeJsViewerHtml() : string
- Get HTML for Three.js fallback viewer
- hasModels() : bool
- Check if object has any 3D models
- isFormatSupported() : bool
- Check if format is supported
- updateModel() : bool
- Update a 3D model's settings
- updateSetting() : bool
- uploadModel() : int|null
- Upload and save a new 3D model
Methods
__construct()
public
__construct() : mixed
addHotspot()
Add a hotspot to a model
public
addHotspot(int $modelId, array<string|int, mixed> $data, int $userId) : int|null
Parameters
- $modelId : int
- $data : array<string|int, mixed>
- $userId : int
Return values
int|nulldeleteHotspot()
Delete a hotspot
public
deleteHotspot(int $hotspotId, int $userId) : bool
Parameters
- $hotspotId : int
- $userId : int
Return values
booldeleteModel()
Delete a 3D model
public
deleteModel(int $modelId, int $userId) : bool
Parameters
- $modelId : int
- $userId : int
Return values
boolgenerateIiif3DManifest()
Generate IIIF 3D manifest for a model Based on IIIF 3D TSG (Technical Specification Group) draft
public
generateIiif3DManifest(int $modelId, string $baseUrl[, string $culture = 'en' ]) : array<string|int, mixed>|null
Parameters
- $modelId : int
- $baseUrl : string
- $culture : string = 'en'
Return values
array<string|int, mixed>|nullgetHotspots()
Get all hotspots for a model
public
getHotspots(int $modelId[, string $culture = 'en' ]) : array<string|int, mixed>
Parameters
- $modelId : int
- $culture : string = 'en'
Return values
array<string|int, mixed>getModel()
Get a single 3D model by ID
public
getModel(int $modelId[, string $culture = 'en' ]) : object|null
Parameters
- $modelId : int
- $culture : string = 'en'
Return values
object|nullgetModelCount()
Get model count for object
public
getModelCount(int $objectId) : int
Parameters
- $objectId : int
Return values
intgetModelsForObject()
Get all 3D models for an information object
public
getModelsForObject(int $objectId[, string $culture = 'en' ]) : array<string|int, mixed>
Parameters
- $objectId : int
- $culture : string = 'en'
Return values
array<string|int, mixed>getModelViewerHtml()
Get HTML for model-viewer component (Google's WebXR viewer)
public
getModelViewerHtml(int $modelId[, array<string|int, mixed> $options = [] ]) : string
Parameters
- $modelId : int
- $options : array<string|int, mixed> = []
Return values
stringgetPrimaryModel()
Get primary 3D model for an object
public
getPrimaryModel(int $objectId[, string $culture = 'en' ]) : object|null
Parameters
- $objectId : int
- $culture : string = 'en'
Return values
object|nullgetSetting()
public
getSetting(string $key[, mixed $default = null ]) : mixed
Parameters
- $key : string
- $default : mixed = null
getSupportedFormats()
Get all supported formats
public
getSupportedFormats() : array<string|int, mixed>
Return values
array<string|int, mixed>getThreeJsViewerHtml()
Get HTML for Three.js fallback viewer
public
getThreeJsViewerHtml(int $modelId[, array<string|int, mixed> $options = [] ]) : string
Parameters
- $modelId : int
- $options : array<string|int, mixed> = []
Return values
stringhasModels()
Check if object has any 3D models
public
hasModels(int $objectId) : bool
Parameters
- $objectId : int
Return values
boolisFormatSupported()
Check if format is supported
public
isFormatSupported(string $format) : bool
Parameters
- $format : string
Return values
boolupdateModel()
Update a 3D model's settings
public
updateModel(int $modelId, array<string|int, mixed> $data, int $userId) : bool
Parameters
- $modelId : int
- $data : array<string|int, mixed>
- $userId : int
Return values
boolupdateSetting()
public
updateSetting(string $key, mixed $value[, string $type = 'string' ]) : bool
Parameters
- $key : string
- $value : mixed
- $type : string = 'string'
Return values
booluploadModel()
Upload and save a new 3D model
public
uploadModel(array<string|int, mixed> $data, array<string|int, mixed> $file, int $userId) : int|null
Parameters
- $data : array<string|int, mixed>
- $file : array<string|int, mixed>
- $userId : int