Skip to content

Interface: Section ​

Defined in: packages/viewer-core/src/public/managers/Section.ts:21

一组裁剪平面的容器:持有至多 6 个 SectionPlane,按 CuttingBoolean ("intersection" / "union")组合出「保留区域」,激活后才参与裁剪。 典型入口:viewer.section.create() → addPlane(...) → activate()。

Remarks ​

经 viewer.section.create() 创建,不要直接构造。

Implements ​

  • PlaneHost

Properties ​

id ​

readonly id: string

Defined in: packages/viewer-core/src/public/managers/Section.ts:23

section 的不透明 id(manager 分配,形如 section-0)。

Accessors ​

active ​

Get Signature ​

get active(): boolean

Defined in: packages/viewer-core/src/public/managers/Section.ts:37

当前是否处于激活态(激活后平面才参与裁剪)。

Returns ​

boolean


capacity ​

Get Signature ​

get capacity(): number

Defined in: packages/viewer-core/src/public/managers/Section.ts:35

单个 section 可容纳的裁剪平面数上限(6)。

Returns ​

number

Methods ​

activate() ​

activate(): void

Defined in: packages/viewer-core/src/public/managers/Section.ts:73

激活本 section 使其平面参与裁剪;无平面抛 ViewerError(InvalidArgument),并发激活超 4 个由 manager 抛错。

Returns ​

void


addPlane() ​

addPlane(plane, style?): SectionPlane

Defined in: packages/viewer-core/src/public/managers/Section.ts:42

添加一个裁剪平面并返回其 SectionPlane 句柄;超过容量 6 抛 ViewerError(InvalidArgument)。

Parameters ​

plane ​

PlaneSpec

style? ​

CuttingPlaneStyle = {}

Returns ​

SectionPlane


clear() ​

clear(): void

Defined in: packages/viewer-core/src/public/managers/Section.ts:61

移除全部裁剪平面(section 本身保留,可继续 addPlane)。

Returns ​

void


deactivate() ​

deactivate(): void

Defined in: packages/viewer-core/src/public/managers/Section.ts:80

反激活本 section(平面与样式保留,可再次 activate);未激活时静默返回。

Returns ​

void


getBoolean() ​

getBoolean(): CuttingBoolean

Defined in: packages/viewer-core/src/public/managers/Section.ts:71

取当前的多平面布尔组合方式。

Returns ​

CuttingBoolean


getPlanes() ​

getPlanes(): readonly SectionPlane[]

Defined in: packages/viewer-core/src/public/managers/Section.ts:52

取当前全部裁剪平面(返回副本数组)。

Returns ​

readonly SectionPlane[]


removePlane() ​

removePlane(target): void

Defined in: packages/viewer-core/src/public/managers/Section.ts:54

移除一个裁剪平面(接受实例或索引);不存在 / 越界静默返回。

Parameters ​

target ​

number | SectionPlane

Returns ​

void


setBoolean() ​

setBoolean(mode): void

Defined in: packages/viewer-core/src/public/managers/Section.ts:66

设置多平面布尔组合方式("intersection" / "union",语义见 CuttingBoolean)。

Parameters ​

mode ​

CuttingBoolean

Returns ​

void