SectionPlane
Class in @bimworks/viewer3d.
API catalogue · @bimworks/viewer3d · Class
class SectionPlaneMembers#
| Member | Kind | Description |
|---|---|---|
| constructor | Method | |
| enabled | Method | Whether the plane currently cuts the model |
| disable | Method | Disable this section plane, it removed the visualization of the plane and makes it inactive. Its slot is free for the next plane. On a face of an active Sect… |
| getAnnotationMode | Method | |
| getAnnotationReach | Method | |
| getName | Method | The name a list of the planes shows (SectionPlanes.getPlanes): "Top", "Bottom", ... for a standard plane and a face of a box, "Plane 1", "Plane 2", ... for a… |
| getStandard | Method | The standard plane this is: of SectionPlanes.startStandardPlane, or the face of a box it is; null for a plane through a point. A standard plane stays one whe… |
| isVisible | Method | Whether the plane is drawn (setVisible); true for a plane just started |
| setAnnotationMode | Method | Set what this plane does with the annotations on the side it cuts away, see SectionPlaneAnnotationMode. Every start of a plane (startTopPlane(), startPlaneAt… |
| setAnnotationReach | Method | Set how far past this plane, in mm along its normal, its annotation mode reaches: an annotation further on the side the plane cuts away is hidden, whatever t… |
| setHighlighted | Method | Show the plane as hovered, as when the pointer is on its icon, or stop showing it so: for a list of the planes whose row the pointer is on. Has no effect on … |
| setName | Method | Rename the plane, for a user who tells their planes apart by name; fires SectionPlanes.onPlanesChange |
| setVisible | Method | Draw the plane or not, while it keeps cutting: a hidden plane cuts the model and closes the cut with end caps as before, but its face, wireframe, drag icon a… |
constructor#
constructor()enabled#
enabled(): booleanWhether the plane currently cuts the model
disable#
disable(): voidDisable this section plane, it removed the visualization of the plane and makes it inactive. Its slot is free for the next plane. On a face of an active SectionBox, the box's other faces stay, as planes of their own
getAnnotationMode#
getAnnotationMode(): SectionPlaneAnnotationModeReturns#
The current annotation mode of this plane
getAnnotationReach#
getAnnotationReach(): numberReturns#
The annotation reach of this plane in mm, Infinity for no limit
getName#
getName(): stringThe name a list of the planes shows (SectionPlanes.getPlanes): "Top", "Bottom", ... for a standard plane
and a face of a box, "Plane 1", "Plane 2", ... for a plane through a point, or the name setName gave.
Every start of a plane in this slot names it anew; a standard plane put back keeps its name
getStandard#
getStandard(): StandardSectionPlane | nullThe standard plane this is: of SectionPlanes.startStandardPlane, or the face of a box it is; null for a
plane through a point. A standard plane stays one when it is dragged or renamed
isVisible#
isVisible(): booleanWhether the plane is drawn (setVisible); true for a plane just started
setAnnotationMode#
setAnnotationMode(mode: SectionPlaneAnnotationMode): voidSet what this plane does with the annotations on the side it cuts away, see
SectionPlaneAnnotationMode. Every start of a plane (startTopPlane(), startPlaneAt(),
Ctrl + drag, ...) begins with the mode of SectionPlanes.annotationDefaults: "hide" by default,
the behaviour before this setting existed.
Parameters#
| Name | Type | Description |
|---|---|---|
mode |
SectionPlaneAnnotationMode |
Exceptions#
- Error for an unknown mode
setAnnotationReach#
setAnnotationReach(reach: number): voidSet how far past this plane, in mm along its normal, its annotation mode reaches: an annotation further
on the side the plane cuts away is hidden, whatever the mode. Measured from the annotation's own
position, before a "project" plane moves it. With a top plane in "project" and a reach of one storey
height, the storey above lands on the cut and the storeys above that are hidden. The reach follows the
plane when it is dragged. Every start of a plane begins with the reach of
SectionPlanes.annotationDefaults: no limit by default.
Parameters#
| Name | Type | Description |
|---|---|---|
reach |
number |
mm, 0 or more; Infinity for no limit |
Exceptions#
- Error for a negative distance, NaN or a value that is not a number
setHighlighted#
setHighlighted(highlighted: boolean): voidShow the plane as hovered, as when the pointer is on its icon, or stop showing it so: for a list of the planes
whose row the pointer is on. Has no effect on a plane that does not cut or is hidden (setVisible); a plane
stops being highlighted when it is disabled or hidden
Parameters#
| Name | Type | Description |
|---|---|---|
highlighted |
boolean |
setName#
setName(name: string): voidRename the plane, for a user who tells their planes apart by name; fires SectionPlanes.onPlanesChange
Parameters#
| Name | Type | Description |
|---|---|---|
name |
string |
Trimmed; a name another plane has is allowed |
Exceptions#
- Error when the name is not a string, or nothing but white space
setVisible#
setVisible(visible: boolean): voidDraw the plane or not, while it keeps cutting: a hidden plane cuts the model and closes the cut with end caps as
before, but its face, wireframe, drag icon and arrow are not drawn, and it is not hovered, highlighted or grabbed
with Ctrl + left drag; it stays in SectionPlanes.getPlanes, and code can still move it. Fires
SectionPlanes.onPlanesChange on a plane that cuts. Every start of a plane in this slot draws it again; a
standard plane put back (SectionPlanes.startStandardPlane) keeps whether it is drawn, and
SectionPlanes.getState keeps it too.
Parameters#
| Name | Type | Description |
|---|---|---|
visible |
boolean |
Exceptions#
- Error when visible is not a boolean