SVG + DOM overlay widgets that paint world-space measurements
on a View's canvas — diagonal distance with
X/Y/Z decomposition, and three-anchor angle in degrees.
The measurements module ships one tool per measurement type. Each
tool is a long-lived overlay attached to a single
View, owning a keyed collection of measurement
instances. Optional mouse-control helpers turn canvas clicks into
measurements without the caller having to connect pickers.
Both sub-modules share the same tool / measurement / mouse-control
shape:
%%{init:{"theme":"dark"}}%%
classDiagram
direction TB
class Tool {
<<distance or angle>>
+view : View
+measurements : Map
+createMeasurement(params)
+destroyMeasurement(id)
+clear()
+show() / hide() / toggle()
+destroy()
}
class Measurement {
<<one per anchor set>>
}
class MouseControl {
+activate()
+deactivate()
+destroy()
}
class View {
<<viewer>>
}
class PickStrategy {
<<picking>>
}
Tool "1" *-- "*" Measurement : owns
Tool "1" o-- "0..1" MouseControl : lazy
Tool o-- View : paints over
Tool o-- PickStrategy : routes clicks
%%{init:{"theme":"default"}}%%
classDiagram
direction TB
class Tool {
<<distance or angle>>
+view : View
+measurements : Map
+createMeasurement(params)
+destroyMeasurement(id)
+clear()
+show() / hide() / toggle()
+destroy()
}
class Measurement {
<<one per anchor set>>
}
class MouseControl {
+activate()
+deactivate()
+destroy()
}
class View {
<<viewer>>
}
class PickStrategy {
<<picking>>
}
Tool "1" *-- "*" Measurement : owns
Tool "1" o-- "0..1" MouseControl : lazy
Tool o-- View : paints over
Tool o-- PickStrategy : routes clicks
classDiagram
direction TB
class Tool {
<<distance or angle>>
+view : View
+measurements : Map
+createMeasurement(params)
+destroyMeasurement(id)
+clear()
+show() / hide() / toggle()
+destroy()
}
class Measurement {
<<one per anchor set>>
}
class MouseControl {
+activate()
+deactivate()
+destroy()
}
class View {
<<viewer>>
}
class PickStrategy {
<<picking>>
}
Tool "1" *-- "*" Measurement : owns
Tool "1" o-- "0..1" MouseControl : lazy
Tool o-- View : paints over
Tool o-- PickStrategy : routes clicks
Each tool is a per-View singleton — openFor(params) returns the
existing instance for params.view (showing it again if hidden) or
constructs a fresh one. See the sub-module docs for end-to-end
snippets.
xeokit Measurements
SVG + DOM overlay widgets that paint world-space measurements on a View's canvas — diagonal distance with X/Y/Z decomposition, and three-anchor angle in degrees.
The
measurementsmodule ships one tool per measurement type. Each tool is a long-lived overlay attached to a single View, owning a keyed collection of measurement instances. Optional mouse-control helpers turn canvas clicks into measurements without the caller having to connect pickers.Sub-modules
Shape
Both sub-modules share the same tool / measurement / mouse-control shape:
Each tool is a per-View singleton —
openFor(params)returns the existing instance forparams.view(showing it again if hidden) or constructs a fresh one. See the sub-module docs for end-to-end snippets.