HoopsServiceRegistryElement

class wvc.HoopsServiceRegistryElement()

HoopsServiceRegistryElement is a LitElement-based web component that provides centralized service registration and management for the Hoops web viewer application.

This component acts as a dependency injection container, automatically registering all core services when connected to the DOM. It provides a convenient way to bootstrap the entire service ecosystem with sensible defaults while allowing for easy customization.

Features:

  • Automatic registration of all core services
  • Service customization through properties
  • Type-safe service retrieval methods
  • Zero-configuration setup with sensible defaults
  • Service locator pattern implementation

Examples

<hoops-service-registry></hoops-service-registry>

<script>
  const measurementService = document.getElementsByTagName('hoops-service-registry')[0].getService('MeasurementService');
</script>

Custom Element

hoops-service-registry

Since

2025.8.0

Constructors

wvc.HoopsServiceRegistryElement.constructor()
HoopsServiceRegistryElement(): HoopsServiceRegistryElement

Returns: HoopsServiceRegistryElement

Properties

wvc.HoopsServiceRegistryElement.cameraService
cameraService: ICameraService

Service for controlling camera movement and positioning. Manages camera animations, transitions, and view manipulations.

Default

```ts new CameraService() ```

wvc.HoopsServiceRegistryElement.cuttingService
cuttingService: ICuttingService

Service for providing cutting plane functionality. Enables sectioning of 3D models with interactive cutting planes.

Default

```ts new CuttingService() ```

wvc.HoopsServiceRegistryElement.explodeService
explodeService: IExplodeService

Service for providing assembly explosion functionality. Enables visual separation of assembly components for better understanding.

Default

```ts new ExplodeService() ```

wvc.HoopsServiceRegistryElement.floorplanService
floorplanService: IFloorplanService

Service for managing floorplan functionality and 2D representations. Provides tools for working with architectural floor plans and layouts.

Default

```ts new FloorplanService() ```

wvc.HoopsServiceRegistryElement.ifcRelationshipsService
ifcRelationshipsService: IIFCRelationshipsService

Service for managing IFC (Industry Foundation Classes) model relationships. Handles building information modeling data and relationships between elements.

Default

```ts new IFCRelationshipsService() ```

wvc.HoopsServiceRegistryElement.logService
logService: ILogService

Service for logging messages, warnings, and errors. Provides a centralized logging mechanism for debugging and monitoring.

Default

```ts new LogService() ```

wvc.HoopsServiceRegistryElement.materialService
materialService: IMaterialService

Service for managing custom shaders. Provides support for custom shaders.

Default

```ts new MaterialService() ```

wvc.HoopsServiceRegistryElement.measurementService
measurementService: IMeasurementService

Service for handling measurement tools and calculations. Supports distance, angle, area, and volume measurements.

Default

```ts new MeasurementService() ```

wvc.HoopsServiceRegistryElement.noteTextService
noteTextService: INoteTextService

Service for managing text notes and comments. Provides functionality for adding, editing, and organizing textual annotations.

Default

```ts new NoteTextService() ```

wvc.HoopsServiceRegistryElement.pmiService
pmiService: IPmiService

Service for handling Product Manufacturing Information (PMI). Manages annotations, dimensions, tolerances, and other manufacturing data.

Default

```ts new PmiService() ```

wvc.HoopsServiceRegistryElement.redlineService
redlineService: IRedlineService

Service for managing redline markup and annotations. Handles creation, editing, and persistence of redline elements.

Default

```ts new RedlineService() ```

wvc.HoopsServiceRegistryElement.renderOptionsService
renderOptionsService: IRenderOptionsService

Service for controlling rendering settings and visual options. Manages display modes, lighting, materials, and other rendering parameters.

Default

```ts new RenderOptionsService() ```

wvc.HoopsServiceRegistryElement.selectionService
selectionService: ISelectionService

Service for managing object selection and highlighting. Handles single and multi-selection, selection events, and highlight visualization.

Default

```ts new SelectionService() ```

wvc.HoopsServiceRegistryElement.sheetService
sheetService: ISheetService

Service for managing drawing sheets and layouts. Handles 2D technical drawings, sheet navigation, and layout management.

Default

```ts new SheetService() ```

wvc.HoopsServiceRegistryElement.spaceMouseService
spaceMouseService: ISpaceMouseService

Service for integrating 3D SpaceMouse navigation devices. Provides support for professional 3D input devices for enhanced navigation.

Default

```ts new SpaceMouseService() ```

wvc.HoopsServiceRegistryElement.viewService
viewService: IViewService

Service for handling view management and navigation. Controls camera positions, view states, and navigation modes.

Default

```ts new ViewService() ```

wvc.HoopsServiceRegistryElement.walkOperatorService
walkOperatorService: IWalkOperatorService

Service for handling walk-through navigation mode. Provides first-person navigation experience for architectural models.

Default

```ts new WalkOperatorService() ```

Methods

wvc.HoopsServiceRegistryElement.connectedCallback()
connectedCallback(): void

Lifecycle callback invoked when the element is connected to the DOM. Automatically registers all configured services in the global service registry, making them available throughout the application.

Services are registered in a specific order to handle any potential dependencies. If a service with the same name already exists, it will be overwritten with a warning.

Returns: void

wvc.HoopsServiceRegistryElement.getService()
getService(serviceName: ServiceName): T

Retrieves a service from the global service registry by its name. This is a type-safe wrapper around the global getService function.

Parameters

serviceName: ServiceName

The unique name of the service to retrieve

Returns: T

The requested service instance

Examples

const measurementService = registry.getService<IMeasurementService>('MeasurementService');
measurementService.startMeasurement();

Throws

If the service with the given name is not registered

wvc.HoopsServiceRegistryElement.tryGetService()
tryGetService(serviceName: ServiceName): (undefined | T)

Attempts to retrieve a service from the global service registry by its name. Returns undefined if the service is not found, making it safe for optional services.

Parameters

serviceName: ServiceName

The unique name of the service to retrieve

Returns: (undefined | T)

The service instance if found, undefined otherwise

Examples

const customService = registry.tryGetService<ICustomService>('CustomService');
if (customService) {
  customService.performCustomAction();
}