Skip to content

@simversus/yjvisDocs


@simversus/yjvis / ModelData

Class: ModelData

Extends

  • BaseModelData

Constructors

new ModelData()

new ModelData(__namedParameters): ModelData

Parameters

__namedParameters = {}

__namedParameters.faceData: NumberArray = ...

__namedParameters.lineData: NumberArray = ...

__namedParameters.normalData: NumberArray = ...

__namedParameters.positionData: NumberArray = ...

__namedParameters.uvData: NumberArray = ...

Returns

ModelData

Overrides

BaseModelData.constructor

Defined in

data/modelData.ts:68

Properties

attributes

readonly attributes: AttributeData[] = []

Inherited from

BaseModelData.attributes

Defined in

data/DataSet.ts:5


classHierarchy

classHierarchy: ClassEnum[]

Deprecated

Inherited from

BaseModelData.classHierarchy

Defined in

core/baseObject.ts:96


color

readonly color: AttributeData

Defined in

data/modelData.ts:41


faces

readonly faces: PrimitiveData

Defined in

data/modelData.ts:33


fields

fields: Partial<Record<FieldType, AttributeData>> = {}

Inherited from

BaseModelData.fields

Defined in

data/DataSet.ts:7


label

label: string

自定义标识

Inherited from

BaseModelData.label

Defined in

core/baseObject.ts:104


lines

readonly lines: PrimitiveData

线

Defined in

data/modelData.ts:32


normal

readonly normal: AttributeData

三角形索引

Overrides

BaseModelData.normal

Defined in

data/modelData.ts:39


points

readonly points: PrimitiveData

Defined in

data/modelData.ts:28


positions

readonly positions: DataArray

坐标

Overrides

BaseModelData.positions

Defined in

data/modelData.ts:23


userData

userData: any

用户自定义数据

Inherited from

BaseModelData.userData

Defined in

core/baseObject.ts:100


uuid

uuid: number

唯一标识符

Inherited from

BaseModelData.uuid

Defined in

core/baseObject.ts:92


uv

readonly uv: AttributeData

Defined in

data/modelData.ts:40


fromBoundingBox()

static fromBoundingBox: (box) => ModelData

Parameters

box: Box

Returns

ModelData

Defined in

data/modelData.ts:14


fromJSON()

static fromJSON: (data, md) => ModelData

Parameters

data: Partial<Record<AttributeName | "indices", TypedArray | number[]>>

md: ModelData = ...

Returns

ModelData

Defined in

data/modelData.ts:12


fromVTKPolyData()

static fromVTKPolyData: (polyData) => ModelData

Parameters

polyData: any

Returns

ModelData

Defined in

data/modelData.ts:16


merge()

static merge: (mdT, md1, md2) => void

Parameters

mdT: ModelData

md1: ModelData

md2: ModelData

Returns

void

Defined in

data/modelData.ts:18

Accessors

boundingBox

get boundingBox(): Box

set boundingBox(box): void

Parameters

box: Box

Returns

Box

Inherited from

BaseModelData.boundingBox

Defined in

data/baseModelData.ts:16


mtime

get mtime(): number

Returns

number

Overrides

BaseModelData.mtime

Defined in

data/modelData.ts:50

Methods

addAttibutes()

addAttibutes(...attrs): void

Parameters

• ...attrs: AttributeData[]

Returns

void

Defined in

data/modelData.ts:225


applyMatrix4()

applyMatrix4(matrix): void

对模型数据应用矩阵

Parameters

matrix: Mat4

Returns

void

Inherited from

BaseModelData.applyMatrix4

Defined in

data/baseModelData.ts:33


buildCellMap()

buildCellMap(): void

构建单元信息,cellId->type,cellId->某cells中的index

Returns

void

Defined in

data/modelData.ts:174


changed()

changed(): void

标记对象为已修改

Returns

void

Inherited from

BaseModelData.changed

Defined in

core/baseObject.ts:128


clear()

clear(): void

清空数据

Returns

void

Defined in

data/modelData.ts:237


computeNormal()

computeNormal(cells): Float32Array

计算表面法线,不区分正反面

Parameters

cells: PrimitiveData

Returns

Float32Array

Defined in

data/modelData.ts:313


getAttributeByIndex()

getAttributeByIndex(index): AttributeData

根据序号获取属性数据

Parameters

index: number = 0

属性序号

Returns

AttributeData

Defined in

data/modelData.ts:221


getAttributeByNameAndType()

getAttributeByNameAndType(name, type): AttributeData

Parameters

name: string

type: AttributeType

Returns

AttributeData

Defined in

data/modelData.ts:212


getCellInfo()

getCellInfo(cid): object

获取该单元的信息

Parameters

cid: number

Returns

object

positionIds

positionIds: number[]

type

type: Topology = topology

Defined in

data/modelData.ts:162


getCellOffset()

getCellOffset(type): number

获取拓扑的单元偏移

Parameters

type: Topology

Returns

number

Defined in

data/modelData.ts:333


getCellPositionIds()

getCellPositionIds(cid): number[]

获取单元的顶点索引

Parameters

cid: number

单元ID

Returns

number[]

Defined in

data/modelData.ts:134


getPositionsByPids()

getPositionsByPids(pids): Number3[]

根据坐标id获取坐标

Parameters

pids: number[]

Returns

Number3[]

Defined in

data/modelData.ts:254


getPrimitiveByTopology()

getPrimitiveByTopology(topology): PrimitiveData

根据图元类型获取指定图元

Parameters

topology: Topology

Returns

PrimitiveData

Defined in

data/modelData.ts:118


is()

is(t): boolean

Parameters

t: ClassEnum

Returns

boolean

Inherited from

BaseModelData.is

Defined in

core/baseObject.ts:122


merge()

merge(md): void

Parameters

md: ModelData

Returns

void

Defined in

data/modelData.ts:230


release()

release(): void

销毁该对象

Returns

void

Inherited from

BaseModelData.release

Defined in

core/baseObject.ts:134


setFromActiveCell()

setFromActiveCell(cids, md): ModelData

从另一个模型数据的高亮单元中获取数据, cids中的单元类型需要一致

Parameters

cids: number[]

md: ModelData

Returns

ModelData

Defined in

data/modelData.ts:268


setScalar()

setScalar(data): void

Parameters

data: AttributeData

Returns

void

Inherited from

BaseModelData.setScalar

Defined in

data/DataSet.ts:9