Class MeshModule

mesh模块

Hierarchy (view full)

Implements

Constructors

Properties

_app?: App
_destroyed: boolean = false
appRenderIndex: number = 0
data: ShallowReactive<{
    [key: string]: any;
}> = ...

Type declaration

  • [key: string]: any
entity: Entity
extData: {
    [key: string]: any;
} = {}

Type declaration

  • [key: string]: any
instanceId: number = ++AppObject._instanceIdCounter
onSetApp: Signal = ...
moduleName: string = "MeshModule"

Accessors

  • get app(): App
  • Returns App

  • set app(value): void
  • Parameters

    Returns void

  • get destroyed(): boolean
  • Whether it has been destroyed.

    Returns boolean

  • get enabled(): boolean
  • Indicates whether the component is enabled.

    Returns boolean

  • set enabled(value): void
  • Parameters

    • value: boolean

    Returns void

  • get material(): any
  • 获取可修改的材质对象

    Returns any

  • get mesh(): Mesh<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap>
  • mesh对象

    Returns Mesh<BufferGeometry<NormalBufferAttributes>, Material | Material[], Object3DEventMap>

Methods

  • 增加模型边框线

    Parameters

    • Optional option: LineBasicMaterialParameters
    • Optional isHideMesh: boolean

      是否隐藏mesh本身(默认false)

    Returns void

  • Parameters

    • toClassInst: any
    • Optional methodNames: string[]
    • Optional addMethods: string[]
    • Optional filterName: string[]

    Returns void

  • 移除模型边框线

    Returns void

  • 清除高亮

    Returns void

  • 触发指定事件名称.

    Parameters

    • event: string

      Event name

    • Rest ...data: any

      Data

    Returns boolean

    • Whether the dispatching is successful
  • Parameters

    • data: Record<string, any>
    • objects: Map<string, Object3D<Object3DEventMap>>

    Returns void

  • 获取模型边框线

    Returns any

  • 确定是否存在事件侦听

    Parameters

    • event: string

      事件名

    Returns boolean

    返回是否存在相应的事件

  • 获取高亮材质

    Returns any

  • 是否高亮

    Returns boolean

  • 返回具有指定事件名称的侦听总数.

    Parameters

    • event: string

      Event name

    Returns number

    The count of listeners

  • 获取透明度材质

    Returns any

  • 获取最开始的原生材质,为空表示没有修改过

    Returns any

  • 通过事件名移除所有监听.

    Parameters

    • Optional event: string

      Event name, delete all events if not passed

    Returns void

  • 替换材质

    Parameters

    • material: Material | Material[]

    Returns void

  • 恢复材质

    Returns void

  • 设置热力图数据分析材质

    Parameters

    • options: {
          MaterialParameters?: ShaderMaterialParameters;
          colorCount?: number;
          colorMap?: [number, number][];
          data: {
              value: number;
              x: number;
              y: number;
              z: number;
          }[];
          dataMax?: number;
          dataMin?: number;
          interpolation?: {
              alpha?: number;
              model?: "circle" | "linear" | "gaussian" | "exponential" | "spherical";
              power?: number;
              sigma2?: number;
              useInvDistWeight?: boolean;
          };
          segmentX?: number;
          segmentY?: number;
          segmentZ?: number;
      }
      • Optional MaterialParameters?: ShaderMaterialParameters

        材质参数

      • Optional colorCount?: number

        颜色表分的总数 默认100

      • Optional colorMap?: [number, number][]

        颜色表[值(0-1),颜色],默认为 [[ 0.0, 0x0000FF ], [ 0.2, 0x00FFFF ], [ 0.5, 0x00FF00 ], [ 0.8, 0xFFFF00 ], [ 1.0, 0xFF0000 ]]

      • data: {
            value: number;
            x: number;
            y: number;
            z: number;
        }[]

        数据

      • Optional dataMax?: number

        数据最大值

      • Optional dataMin?: number

        数据最小值

      • Optional interpolation?: {
            alpha?: number;
            model?: "circle" | "linear" | "gaussian" | "exponential" | "spherical";
            power?: number;
            sigma2?: number;
            useInvDistWeight?: boolean;
        }

        插值选项

        • Optional alpha?: number

          Alpha α对应方差函数的先验值,此参数可能控制钻孔扩散范围,越小范围越大,少量点效果明显,但点多了且分布均匀以后改变该数字即基本无效果了,默认设置为100

        • Optional model?: "circle" | "linear" | "gaussian" | "exponential" | "spherical"

          模型 默认 exponential

        • Optional power?: number

          反距离幂指数,用于控制距离和权重之间的关系 缺省值2

        • Optional sigma2?: number

          sigma2是σ²,对应高斯过程的方差参数,也就是这组数据z的距离,方差参数σ²的似然性反映了高斯过程中的误差,并应手动设置。一般设置为 0 ,其他数值设了可能会出空白图

        • Optional useInvDistWeight?: boolean

          使用反距离权重插值法

      • Optional segmentX?: number

        x轴分段数 默认10

      • Optional segmentY?: number

        y轴分段数 默认10

      • Optional segmentZ?: number

        z轴分段数 默认10

    Returns Promise<{
        lut: Lut;
        material: ShaderMaterial;
        reset: (() => void);
    }>

  • 设置高亮

    Parameters

    • Optional color: ColorRepresentation
    • Optional opacity: number

    Returns void

  • 设置透明度

    Parameters

    • opacity: number

      透明度0(完全透明)-1(不透明)

    • Optional isAccOpacity: boolean

      是否累加透明度(ture和之前透明度相乘,false直接设置透明度)

    Returns void

  • Returns {
        app: App;
        children: ({
            bounds?: undefined;
            getValue: (() => boolean);
            label: string;
            onChange?: undefined;
            setValue: ((v) => void);
            stepSize?: undefined;
            type: string;
            value?: undefined;
        } | {
            bounds: number[];
            getValue?: undefined;
            label: string;
            onChange: ((v) => void);
            setValue?: undefined;
            stepSize: number;
            type: string;
            value: number;
        } | {
            bounds?: undefined;
            getValue?: undefined;
            label: string;
            onChange: ((v) => void);
            setValue?: undefined;
            stepSize?: undefined;
            type: string;
            value: boolean;
        } | {
            bounds?: undefined;
            getValue: (() => number);
            label: string;
            onChange?: undefined;
            setValue: ((v) => void);
            stepSize?: undefined;
            type: string;
            value?: undefined;
        })[];
        expanded: boolean;
        label: string;
        type: string;
    }

    • app: App
    • children: ({
          bounds?: undefined;
          getValue: (() => boolean);
          label: string;
          onChange?: undefined;
          setValue: ((v) => void);
          stepSize?: undefined;
          type: string;
          value?: undefined;
      } | {
          bounds: number[];
          getValue?: undefined;
          label: string;
          onChange: ((v) => void);
          setValue?: undefined;
          stepSize: number;
          type: string;
          value: number;
      } | {
          bounds?: undefined;
          getValue?: undefined;
          label: string;
          onChange: ((v) => void);
          setValue?: undefined;
          stepSize?: undefined;
          type: string;
          value: boolean;
      } | {
          bounds?: undefined;
          getValue: (() => number);
          label: string;
          onChange?: undefined;
          setValue: ((v) => void);
          stepSize?: undefined;
          type: string;
          value?: undefined;
      })[]
    • expanded: boolean
    • label: string
    • type: string
  • Returns {
        mesh: {
            uuid: string;
        };
    }

    • mesh: {
          uuid: string;
      }
      • uuid: string
  • 获取替换后的正使用的材质,为空表示没有修改过

    Returns any