@thatopen/ui. Toolbars provide quick access to common operations and are displayed at the bottom of the viewport.
Toolbar Architecture
Toolbars are structured using<bim-toolbar-section> components within a tabbed interface. Each section groups related tools and actions.
Integration in main.ts
Import Toolbar
Source:src/components/Toolbars/Sections/Import.ts
Provides tools for loading BIM models in various formats.
Structure
Load IFC
Uses pre-built button from@thatopen/ui-obc:
- Automatically converts IFC to Fragments format
- Triggers
FragmentsManager.onFragmentsLoadedevent - Processes properties and relations through
IfcRelationsIndexer
Load Fragments
Loads pre-converted Fragment files from ZIP archives:geometry.frag(required) - Binary geometry dataproperties.json(optional) - IFC propertiesrelations-map.json(optional) - IFC spatial relationships
Load Tiles
Loads streaming BIM Tiles for large models:- Geometry:
*-processed.json - Properties:
*-processed-properties.json
Streamer Configuration
Camera Toolbar
Source:src/components/Toolbars/Sections/Camera.ts
Controls for camera navigation and locking.
Structure
Fit Model
Automatically frames all loaded geometry:Lock/Unlock Camera
Toggles camera controls with dynamic button state:Selection Toolbar
Source:src/components/Toolbars/Sections/Selection.ts
Tools for managing element visibility and focus.
Structure
Show All
Restores visibility to all elements:Toggle Visibility
Inverts visibility state of selected elements:Isolate
Hides all elements except the current selection:Focus Selection
Frames camera to selected elements using bounding sphere:Measurement Toolbar
Source:src/components/Toolbars/Sections/Measurement.ts
Provides dimensional measurement tools.
Structure
Measurement Types
Available Tools:- Edge: Measure edge lengths on model geometry
- Face: Measure face areas on surfaces
- Volume: Calculate volume from selected fragments
- Length: Create custom length dimensions
- Area: Create custom area measurements
Dropdown Selector
Tool Activation
Measurement Interaction
Standard Measurements (Edge, Face, Length, Area):- Double-click to create dimension
- Delete key to remove last dimension
- Automatic calculation on element selection
- Uses highlighter events
Highlighter Integration
Measurement tools temporarily disable element highlighting:Toolbar Common Patterns
Toolbar Section Structure
Button with Tooltip
Active State Toggle
Best Practices
- Pointer Events: Add
style="pointer-events: auto"to toolbar sections for proper event handling - Tool Cleanup: Remove event listeners when tools are disabled
- Streaming Support: Always handle both static and streamed fragments separately
- Validation: Check for valid geometry before camera operations
- Tooltips: Provide clear tooltips explaining button functionality
- Tool Exclusivity: Only enable one measurement tool at a time
See Also
- Panel Components - Information display panels
- Viewport System - Layout and rendering
- LoadIfcFile - IFC file loading and fragments