Editing Section Box Process
Below we will consider the process that allows to create and edit the section box.
The detailed information about the section box itself can be found here.
Features
EditSectionPlaneProcess type (TypeScript):
export type EditSectionBoxProcess = {
name: "EditSectionBox"
id?: number
options: EditSectionBoxOptions
events: {
onRun?: (params: C3DSectionOBB) => void
onUpdate?: (params: C3DSectionOBB) => void
}
}
In addition to the options
, this process has an optional property id
.
If specified, it allows editing the section box already added by the command.
Note
For now, only one box can be added to a scene.
Note
It’s possible to create a section box by running the process with an empty id parameter.
Interactive Transforming
The process also gives an opportunity to interactively transform the placement of section box by using the so-called controller (created automatically after the process is run). This represents some kind of a Vision object which is added to a scene. The controller provides the following types of transformation:
linear movement along the X, Y, and Z axes;
planar movement along the XY, XZ, and YZ planes;
rotation along the X, Y, and Z axes;
scaling (resizing) along the X, Y, and Z axes.
The controller appearance depends on which type of transformation you need:
linear and planar movement
rotation
scaling
Options
Section Box Options type (Typescript):
export type EditSectionBoxOptions = {
box: C3DSectionAABB | C3DSectionOBB
transform?: SectionBoxTransform
colors?: {
lines: C3DViewRGB
rect: C3DViewRGB
// 0.0 - 1.0
transparent: number
}
}
Name |
Description |
---|---|
|
Placement of section box (more details) |
|
Enumerated type of box controller transformation. The default is |
|
RGB outline plane color. The default is |
|
RGB plane filling color. The default is |
|
Transparency of section box sides. The default is |
Note
All options can be changed while the process is run via the updating command.
Callbacks
Available events:
onRun(params): emitted when the process is run (via the run process command);
onUpdate(params): emitted when a box is changed (via the update process command).
Running
Example of running the process (TypeScript):
view.runCommand({
name: "RunProcessCommand",
process: {
name: "EditSectionBox",
id: 1,
options: {
box: {
min: {
x: 0,
y: 0,
z: 0
},
max: {
x: 10,
y: 10,
z: 10
}
}
},
events: {}
}
})
Updating
Any changes in the section box available only via the updating command.
Common type of the updating command (TypeScript):
type UpdateProcess = {
name: "UpdateProcessCommand"
options: {
name: "EditSectionBox"
box: C3DSectionAABB | C3DSectionOBB
transform?: SectionBoxTransform
colors?: {
lines: C3DViewRGB
rect: C3DViewRGB
// 0.0 - 1.0
transparent: number
}
}
}
Example of the command to update a box definition (TypeScript):
view.runCommand({
name: "UpdateProcessCommand",
options: {
name: "EditSectionBox",
box: {
min: {
x: 0,
y: 0,
z: 0
},
max: {
x: 10,
y: 10,
z: 10
}
}
}
})