Communicator.CuttingManager

 CuttingManager

Main interface into the cutting functionality of the viewer. The object manages a number of individual CuttingSections which can be activated individually.

Methods

activateCuttingSections

  • activateCuttingSections(): Promise<void>
  • Activates all cutting sections, and restores any planes contained to the scene.

    Returns Promise<void>

createReferenceGeometryFromAxis

  • createReferenceGeometryFromAxis(axis: Axis, modelBounding: Box): Point3[]
  • generates reference geometry for a cutting plane.

    Parameters

    • axis: Axis

      axis for reference geometry.

    • modelBounding: Box

      modelBounding for geometry size.

    Returns Point3[]

createReferenceGeometryFromFaceNormal

  • createReferenceGeometryFromFaceNormal(normal: Point3, position: Point3, modelBounding: Box): Point3[]
  • Uses a selection normal and position to create reference geometry for a cutting plane.

    Parameters

    • normal: Point3

      face normal.

    • position: Point3

      face position.

    • modelBounding: Box

      model bounding for geometry size.

    Returns Point3[]

deactivateCuttingSections

  • deactivateCuttingSections(clearSections?: boolean): Promise<void>
  • Removes all cutting planes and cutting plane geometry from the scene.

    Parameters

    • Optional clearSections: boolean

      if true, removes all cutting planes contained in cutting sections.

    Returns Promise<void>

delayCapping

  • delayCapping(): void
  • Delays capping processing by a fixed time interval.

    Returns void

enableCappingIdleCallback

  • enableCappingIdleCallback(enable: boolean): Promise<boolean>
  • Enables or disables activation of "cappingIdle" callback event.

    Parameters

    • enable: boolean

      Enables or disables activation of "cappingIdle" callback event.

    Returns Promise<boolean>

    A promise returning whether or not capping generation was idle when this call resolves.

forJson    [deprecated]

  • forJson(): Object
  • deprecated

    Use toJson instead.

    Returns Object

fromJson

  • fromJson(json: any): Promise<void>
  • Removes any cutting planes in the scene, and restores cutting planes from a json object.

    Parameters

    • json: any

    Returns Promise<void>

getActiveCuttingSectionCount

  • getActiveCuttingSectionCount(): number
  • Returns number

    the number of active cutting sections.

getCappingFaceColor

  • getCappingFaceColor(): Color | null
  • Gets the color used for capping geometry faces.

    Returns Color | null

    color used for capping geometry faces.

getCappingGeometryVisibility

  • getCappingGeometryVisibility(): boolean
  • Gets whether capping geometry will show

    Returns boolean

    boolean value indicating whether capping geometry will show

getCappingLineColor

  • getCappingLineColor(): Color | null
  • Gets the color used for capping geometry lines.

    Returns Color | null

    color used for capping geometry lines.

getCuttingSection

  • Gets a cutting section by index. Cutting sections are created automatically by the system and may be queried at any point during or after the sceneReady callback has been triggered.

    Parameters

    • index: number

    Returns CuttingSection | null

    the cutting section for the given index.

getCuttingSectionCapacity

  • getCuttingSectionCapacity(): number
  • Gets the total number of planes supported by each cutting section. Cutting planes contained in the same cutting section will work together (an object is only cut if all cutting planes in a section would cut it). Cutting planes in separate cutting sections do not work together when cutting (an object is cut if any one of the cutting sections would cut it).

    Returns number

    the number of planes each cutting section may contain.

getCuttingSectionCount

  • getCuttingSectionCount(): number
  • Gets the total number of cutting sections supported by the system.

    Returns number

    the number of cutting sections supported by the system.

getCuttingSectionFromNodeId

  • Gets the cutting section containing the cutting plane with the given node ID. If the supplied node ID is not contained by any cutting section null will be returned.

    Parameters

    • nodeId: NodeId | null

      a node ID for cutting plane stand-in geometry.

    Returns CuttingSection | null

    the CuttingSection that contains the plane with the given node id or null if none contain it.

getStandinGeometryPickable

  • getStandinGeometryPickable(): boolean
  • Gets whether stand-in geometry for cutting sections is pickable.

    Returns boolean

    boolean value indicating whether stand-in geometry for cutting sections is pickable.

hasActiveCuttingSection

  • hasActiveCuttingSection(): boolean
  • Returns boolean

    true if there is an active cutting section.

refreshPlaneGeometry

  • refreshPlaneGeometry(): Promise<void>
  • Updates all cutting plane geometry.

    Returns Promise<void>

setCappingDelay

  • setCappingDelay(delayInMilliseconds: number): void
  • Sets the delay used by delayCapping() in milliseconds.

    Parameters

    • delayInMilliseconds: number

      The delay amount.

    Returns void

setCappingFaceColor

  • Sets the color to be used for capping geometry faces. If null is passed in as the color object, no capping face will be shown.

    Parameters

    • color: Color | null

      color to use for capping geometry faces.

    Returns DeprecatedPromise

setCappingGeometryVisibility

  • setCappingGeometryVisibility(cappingGeometryVisibility: boolean): DeprecatedPromise
  • Sets whether capping geometry will show. The default value is true.

    Parameters

    • cappingGeometryVisibility: boolean

    Returns DeprecatedPromise

setCappingLineColor

  • Sets the color to be used for capping geometry lines. If null is passed in as the color object, no capping line will be shown.

    Parameters

    • color: Color | null

      color to use for capping geometry lines.

    Returns DeprecatedPromise

setCuttingPlaneColor

setStandinGeometryPickable

  • Sets whether stand-in geometry for cutting sections should be pickable. If this option is set to false, picking rays will pass though stand-in geometry for cutting planes. The default value is not pickable.

    Parameters

    • pickable: boolean

      boolean value indicating whether stand-in geometry should be pickable in the scene.

    Returns DeprecatedPromise

toJson

  • toJson(): Object
  • Creates an object ready for JSON serialization.

    Returns Object

    The prepared object.

waitForCappingIdle

  • waitForCappingIdle(): Promise<void>
  • Returns Promise<void>