new Display(container, options)
Create Display
Parameters:
Name | Type | Description |
---|---|---|
container |
DOMElement | the DOM element, e.g. div, that should contain the Display |
options |
display options |
- Source:
Members
showAnglePanel
Show or hide the angle measurement panel
- Source:
showDistancePanel
Show or hide the distance measurement panel
- Source:
showMeasureTools
Show or hides measurement tools, measurement tools needs a backend to be used.
- Source:
showPropertiesPanel
Show or hide the properties measurement panel
- Source:
Methods
_getElement(name) → {DOMElement}
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Name of the DOM element |
- Source:
Returns:
- Type
- DOMElement
addCadTree(cadTree)
Add the Cad tree and other UI elements like Clipping
Parameters:
Name | Type | Description |
---|---|---|
cadTree |
DOMElement | the DOM element that contains the cadTree |
- Source:
addCadView(cadView)
Add the Cad View (the canvas for threejs)
Parameters:
Name | Type | Description |
---|---|---|
cadView |
DOMElement | the DOM element that contains the cadView |
- Source:
animationChange(e)
Handler for the animation slider
Parameters:
Name | Type | Description |
---|---|---|
e |
Event | a DOM click event |
- Source:
autoCollapse(flag)
Auto collapse tree nodes, when cad width < 600
Parameters:
Name | Type | Description |
---|---|---|
flag |
boolean | whether to enable/disable glass mode |
- Source:
checkElement(name, flag)
Check or uncheck a checkbox
Parameters:
Name | Type | Description |
---|---|---|
name |
string | name of the check box, see getElement |
flag |
boolean | whether to check or uncheck |
- Source:
clearCadTree()
Clear the Cad tree
- Source:
clearHighlights()
Clear all highlights of navigation tree entries
- Source:
collapseNodes(value)
Collapse nodes handler
Parameters:
Name | Type | Description |
---|---|---|
value |
string | 1: collapse all leaf nodes, "R": expand root level only, "C": collapse all nodes, "E": expand all nodes |
- Source:
controlAnimation(e)
Handler for the animation control
Parameters:
Name | Type | Description |
---|---|---|
e |
Event | a DOM click event |
- Source:
controlAnimationByName(btn)
Handle animation control
Parameters:
Name | Type | Description |
---|---|---|
btn |
string | animation control button name |
- Source:
getCanvas()
Get the DOM canvas element
- Source:
glassMode(flag)
Enable/disable glass mode
Parameters:
Name | Type | Description |
---|---|---|
flag |
boolean | whether to enable/disable glass mode |
- Source:
handleCollapseNodes(e)
Collapse nodes handler
Parameters:
Name | Type | Description |
---|---|---|
e |
Event | a DOM click event |
- Source:
handleMaterialReset(e)
Reset material values to original values
Parameters:
Name | Type | Description |
---|---|---|
e |
Event | a DOM click event |
- Source:
handleMoreButton(fullWidth)
Use More fropdown if overall width < 970px else just check boxes
Parameters:
Name | Type | Description |
---|---|---|
fullWidth |
number | overall width of tree and cad view (taking glass mode into account) |
- Source:
highlightButton(name)
Highlight the selected button
Parameters:
Name | Type | Description |
---|---|---|
name |
string | A CAD object id (path) |
- Source:
pinAsPng(e)
Pin screenshot of canvas as PNG
Parameters:
Name | Type | Description |
---|---|---|
e |
Event | a DOM click event |
- Source:
refreshPlane(index, value)
Refresh clipping plane
Parameters:
Name | Type | Description |
---|---|---|
index |
number | index of the plane: 0,1,2 |
value |
number | distance on the clipping normal from the center |
- Source:
reset()
Handler to reset position, zoom and up of the camera
- Source:
resetAnimationSlider()
Reset animation slider to 0
- Source:
resize()
Handler to reset zoom of the camera
- Source:
selectTab(e)
Handler to activate a UI tab (tree / clipping)
Parameters:
Name | Type | Description |
---|---|---|
e |
Event | a DOM click event |
- Source:
selectTabByName(tab)
Activate the UI tab given the name of the tab
Parameters:
Name | Type | Description |
---|---|---|
tab |
string | name of the tab "tree" or "clip" |
- Source:
setAmbientLight(val)
Set the ambient light intensity in the UI
Parameters:
Name | Type | Description |
---|---|---|
val |
number | a float between 0 and 4 |
- Source:
setAnimationLabel(label)
Set label text of animation control
Parameters:
Name | Type | Description |
---|---|---|
label |
string | "A" for animation and "E" for Explode control |
- Source:
setAxes(flag)
Parameters:
Name | Type | Description |
---|---|---|
flag |
boolean | to set or not |
- Source:
setAxes0(flag)
Checkbox Handler for setting the axes0 parameter
Parameters:
Name | Type | Description |
---|---|---|
flag |
boolean | to set or not |
- Source:
setAxes0Check(flag)
Check/uncheck the Axes0 checkbox
Parameters:
Name | Type | Description |
---|---|---|
flag |
boolean | whether to check or uncheck the Axes0 checkbox |
- Source:
setAxesCheck(flag)
Check/uncheck the axes checkbox
Parameters:
Name | Type | Description |
---|---|---|
flag |
boolean | whether to check or uncheck the axes checkbox |
- Source:
setBlackEdges(flag)
Checkbox Handler for setting the black edges parameter
Parameters:
Name | Type | Description |
---|---|---|
flag |
boolean | to set or not |
- Source:
setBlackEdgesCheck(flag)
Check or uncheck the Black Edges checkbox
Parameters:
Name | Type | Description |
---|---|---|
flag |
boolean | whether to check or uncheck the Black Edges checkbox |
- Source:
setClipIntersection(e)
Checkbox Handler for setting the clip intersection parameter
Parameters:
Name | Type | Description |
---|---|---|
e |
* |
- Source:
setClipIntersectionCheck(flag)
Check or uncheck the Intersection checkbox
Parameters:
Name | Type | Description |
---|---|---|
flag |
boolean | whether to check or uncheck the Intersection checkbox |
- Source:
setClipNormalFromPosition(e)
Set the normal at index to the current viewing direction
Parameters:
Name | Type | Description |
---|---|---|
e |
Event | a DOM click event |
- Source:
setClipObjectColorsCheck(flag)
Check or uncheck the Intersection checkbox
Parameters:
Name | Type | Description |
---|---|---|
flag |
boolean | whether to check or uncheck the object colors checkbox |
- Source:
setClipPlaneHelpers(e)
Checkbox Handler for setting the clip planes parameter
Parameters:
Name | Type | Description |
---|---|---|
e |
Event | a DOM click event |
- Source:
setClipPlaneHelpersCheck(flag)
Check or uncheck the Plane Helpers checkbox
Parameters:
Name | Type | Description |
---|---|---|
flag |
boolean | whether to check or uncheck the Plane Helpers checkbox |
- Source:
setDirectLight(val)
Set the direct light intensity in the UI
Parameters:
Name | Type | Description |
---|---|---|
val |
number | a float between 0 and 4 |
- Source:
setExplode(flag)
Checkbox Handler for setting the explode mode
Parameters:
Name | Type | Description |
---|---|---|
flag |
boolean | to set or not |
- Source:
setExplodeCheck(flag)
Check or uncheck the Explode checkbox
Parameters:
Name | Type | Description |
---|---|---|
flag |
boolean | whether to check or uncheck the Black Edges checkbox |
- Source:
setGrid(flag)
Checkbox Handler for setting the grid parameter
Parameters:
Name | Type | Description |
---|---|---|
flag |
boolean | to set or not |
- Source:
setGridCheck(flag)
Check/uncheck the main grid UI element
Parameters:
Name | Type | Description |
---|---|---|
flag |
boolean | whether to check or uncheck the main grid checkbox |
- Source:
setMetalness(val)
Set material metalness in the UI
Parameters:
Name | Type | Description |
---|---|---|
val |
number | a float between 0 and 1 |
- Source:
setNormalLabel(index, normal)
Handler to set the label of a clipping normal widget
Parameters:
Name | Type | Description |
---|---|---|
index |
number | index of the normal widget |
normal |
Vector3 | the normal |
- Source:
setObjectColorCaps(e)
Checkbox Handler for toggling the clip caps
Parameters:
Name | Type | Description |
---|---|---|
e |
* |
- Source:
setOrtho(flag)
Checkbox Handler for setting the ortho parameter
Parameters:
Name | Type | Description |
---|---|---|
flag |
boolean | to set or not |
- Source:
setOrthoCheck(flag)
Check or uncheck the Ortho checkbox
Parameters:
Name | Type | Description |
---|---|---|
flag |
boolean | whether to check or uncheck the ortho checkbox |
- Source:
setRoughness(val)
Set material roughness in the UI
Parameters:
Name | Type | Description |
---|---|---|
val |
number | a float between 0 and 1 |
- Source:
setSizes(options)
Set the width and height of the different UI elements (tree, canvas and info box)
Parameters:
Name | Type | Description |
---|---|---|
options |
DisplayOptions |
- Source:
setSliderLimits(index, limit)
Set minimum and maximum of the sliders
Parameters:
Name | Type | Description |
---|---|---|
index |
number | index of the plane: 0,1,2 |
limit |
number | the value for both minimum and maximum value of the slider |
- Source:
setTool(flag)
Checkbox Handler for setting the tools mode
Parameters:
Name | Type | Description |
---|---|---|
flag |
boolean | whether to start or stop measure context |
- Source:
setTransparent(flag)
Checkbox Handler for setting the transparent parameter
Parameters:
Name | Type | Description |
---|---|---|
flag |
boolean | to set or not |
- Source:
setTransparentCheck(flag)
Check or uncheck the Transparent checkbox
Parameters:
Name | Type | Description |
---|---|---|
flag |
boolean | whether to check or uncheck the Transparent checkbox |
- Source:
setView(e)
Handler to set camera to a predefined position
Parameters:
Name | Type | Description |
---|---|---|
e |
Event | a DOM click event |
- Source:
setupUI(viewer)
Set up the UI
Parameters:
Name | Type | Description |
---|---|---|
viewer |
Viewer | the viewer for this UI |
- Source:
showAnimationControl(flag)
Show or hide the Animation control widget
Parameters:
Name | Type | Description |
---|---|---|
flag |
boolean | whether to show or hide the Animation control widget |
- Source:
showExplode(flag)
Show or hide the Explode checkbox
Parameters:
Name | Type | Description |
---|---|---|
flag |
boolean | whether to check or uncheck the Black Edges checkbox |
- Source:
showHelp(flag)
Show or hide help dialog
Parameters:
Name | Type | Description |
---|---|---|
flag |
boolean | whether to show or hide help dialog |
- Source:
showInfo(flag)
Show or hide info dialog
Parameters:
Name | Type | Description |
---|---|---|
flag |
boolean | whether to show or hide info dialog |
- Source:
showPinning(flag)
Show/hide pinning button
Parameters:
Name | Type | Description |
---|---|---|
flag |
boolean | Whether to show/hide the pinning button |
- Source:
showTools(flag)
Show or hide the CAD tools
Parameters:
Name | Type | Description |
---|---|---|
flag |
boolean | whether to show or hide the CAD tools |
- Source:
toggleClippingTab()
Toggle visibility of the clipping tab
- Source:
toggleHelp()
Show help dialog
- Source:
toggleInfo()
Show info dialog
- Source:
updateUI()
Check or uncheck a checkbox
Properties:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
axes |
boolean |
<optional> |
false | show X-, Y-, Z-axes. |
axes0 |
boolean |
<optional> |
false | show axes at [0,0,0] ot at object center (target). |
ortho |
boolean |
<optional> |
true | use an orthographic (true) or perspective camera (false) |
transparent |
boolean |
<optional> |
false | show CAD object transparent. |
blackEdges |
boolean |
<optional> |
false | show edges in black and not in edgeColor. |
tools |
boolean |
<optional> |
true | show CAD tools. |
glass |
boolean |
<optional> |
false | use glass mode, i.e. CAD navigation as overlay. |
- Source: