跳到主要内容
版本:v10.0

M3D / M3D / Reader / WorkerReader

Class: WorkerReader

M3D.Reader.WorkerReader

Description

解析子线程返回数据的Reader类

Memberof

SView.Reader

Author

YW

Date

2022-1-17

Version

1.0

Hierarchy

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new WorkerReader(options?): WorkerReader

Parameters

NameTypeDescription
options?any选项

Returns

WorkerReader

Description

构造函数

Inherited from

LocalSvlxReader.constructor

Properties

center

center: M3DMessageCenter

Inherited from

LocalSvlxReader.center


id

id: number

Inherited from

LocalSvlxReader.id


parseMap

parseMap: Map<any, any>

Inherited from

LocalSvlxReader.parseMap


count

Static count: number

Inherited from

LocalSvlxReader.count


parseWorker1

Static parseWorker1: any

Methods

addFile

addFile(file): void

Parameters

NameTypeDescription
fileany文件

Returns

void

Description

添加文件

Inherited from

LocalSvlxReader.addFile


cancel

cancel(): void

Returns

void

Description

取消接口

Inherited from

LocalSvlxReader.cancel


cancle

cancle(): void

Returns

void

Description

设置取消

Inherited from

LocalSvlxReader.cancle


getAnimation

getAnimation(): Promise<Map<string, string>>

Returns

Promise<Map<string, string>>

动画数据字符串

Description

获取动画数据,数据格式为xml字符串

Inherited from

LocalSvlxReader.getAnimation


getAnimationRes

getAnimationRes(): Promise<Map<string, ArrayBuffer>>

Returns

Promise<Map<string, ArrayBuffer>>

动画关联资源数据ArrayBuffer

Description

获取动画关联资源数据

Inherited from

LocalSvlxReader.getAnimationRes


getAnnotation

getAnnotation(annotationId): Promise<Annotation>

Parameters

NameTypeDescription
annotationIdnumber批注Id

Returns

Promise<Annotation>

Annotation 批注对象

Description

根据id获取单个批注对象

Inherited from

LocalSvlxReader.getAnnotation


getAnnotations

getAnnotations(): Promise<Map<number, Annotation>>

Returns

Promise<Map<number, Annotation>>

批注对象 Map

Description

获取所有批注对象的Map

Inherited from

LocalSvlxReader.getAnnotations


getAttribute

getAttribute(model): Promise<Map<string, Object>>

Parameters

NameTypeDescription
modelModel模型

Returns

Promise<Map<string, Object>>

属性集(异步)

Description

获取指定model对应的属性

Inherited from

LocalSvlxReader.getAttribute


getCenter

getCenter(): M3DMessageCenter

Returns

M3DMessageCenter

Description

获得消息中心

Inherited from

LocalSvlxReader.getCenter


getDecals

getDecals(): Promise<Map<number, Decal>>

Returns

Promise<Map<number, Decal>>

贴图map

Description

获取所有贴图

Inherited from

LocalSvlxReader.getDecals


getEdges

getEdges(proto, shapeType, geoType, meshArray?): Promise<Map<number, []>>

Parameters

NameTypeDescription
protoModel模型
shapeTypeShapeType-
geoTypeGeoFeatureEnum模型 未使用
meshArray?ArrayBuffermesh数据 可选参数

Returns

Promise<Map<number, []>>

Description

获取原型下当前等级LOD所有边对象

Inherited from

LocalSvlxReader.getEdges


getEntities

getEntities(propertyType): Promise<Map<number, M3DObject>>

Parameters

NameTypeDescription
propertyTypeEntityType数据类型

Returns

Promise<Map<number, M3DObject>>

Description

获取所有指定类型的数据对象, 如:info、material、modelview

Inherited from

LocalSvlxReader.getEntities


getEntitiesFile

getEntitiesFile(propertyType): string

Parameters

NameTypeDescription
propertyTypeEntityType实体类型

Returns

string

数据文件字符串

Description

获取所有指定类型的数据文件

Inherited from

LocalSvlxReader.getEntitiesFile


getEvents

getEvents(): M3DEvent[]

Returns

M3DEvent[]

Description

获得事件列表

Inherited from

LocalSvlxReader.getEvents


getFaces

getFaces(proto, meshArray?): Promise<any>

Parameters

NameTypeDescription
protoModel模型
meshArray?ArrayBuffer可选参数

Returns

Promise<any>

Description

获取原型下当前等级LOD所有面对象

Inherited from

LocalSvlxReader.getFaces


getFile

getFile(): File

Returns

File

Description

获取模型文件

Inherited from

LocalSvlxReader.getFile


getFileId

getFileId(): string

Returns

string

Description

获取模型对应的唯一标识

Inherited from

LocalSvlxReader.getFileId


getGeometries

getGeometries(): Promise<Map<number, Shape>>

Returns

Promise<Map<number, Shape>>

Description

获取所有的几何数据

Inherited from

LocalSvlxReader.getGeometries


getGeometryFeature

getGeometryFeature(shape): GeometryFeature | Map<number, GeometryFeature>[]

Parameters

NameTypeDescription
shapeShape可见对象

Returns

GeometryFeature | Map<number, GeometryFeature>[]

几何特征对象或几何特征Map数组

Description

获取几何特征

Inherited from

LocalSvlxReader.getGeometryFeature


getGeometryFeatures

getGeometryFeatures(): Promise<Map<number, Map<number, GeometryFeature>[]>>

Returns

Promise<Map<number, Map<number, GeometryFeature>[]>>

Description

获取所有几何属性

Inherited from

LocalSvlxReader.getGeometryFeatures


getGroups

getGroups(): Promise<Map<number, Group>>

Returns

Promise<Map<number, Group>>

Description

获取所有组的数组

Inherited from

LocalSvlxReader.getGroups


getHotSpot

getHotSpot(hotSpotId): Promise<HotSpot>

Parameters

NameTypeDescription
hotSpotIdnumber热点Id

Returns

Promise<HotSpot>

热点对象

Description

通过热点Id获取热点对象

Inherited from

LocalSvlxReader.getHotSpot


getHotSpots

getHotSpots(): Promise<Map<number, HotSpot>>

Returns

Promise<Map<number, HotSpot>>

热点Map

Description

获取所有热点对象的Map

Inherited from

LocalSvlxReader.getHotSpots


getHotspotRes

getHotspotRes(): Promise<Map<string, ArrayBuffer>>

Returns

Promise<Map<string, ArrayBuffer>>

热点关联资源数据ArrayBuffer

Description

获取热点关联资源数据

Inherited from

LocalSvlxReader.getHotspotRes


getId

getId(): number

Returns

number

Description

获取id

Inherited from

LocalSvlxReader.getId


getImages

getImages(): Promise<Map<number, Image>>

Returns

Promise<Map<number, Image>>

视图对象图章Map

Description

获取所有图章对象的Map

Inherited from

LocalSvlxReader.getImages


getIsRequesting

getIsRequesting(): boolean

Returns

boolean

Description

是否在请求

Inherited from

LocalSvlxReader.getIsRequesting


getLocalModelViewContent

getLocalModelViewContent(modelViewId): Promise<ModelView>

Parameters

NameTypeDescription
modelViewIdnumber视图id

Returns

Promise<ModelView>

视图对象 包含视图播放所需所有数据

Description

根据视图id获取本地视图详细数据

Inherited from

LocalSvlxReader.getLocalModelViewContent


getMaterialById

getMaterialById(materialId): BaseMaterial

Parameters

NameTypeDescription
materialIdnumber材质id

Returns

BaseMaterial

基本材质类

Description

通过材质id获取材质对象

Inherited from

LocalSvlxReader.getMaterialById


getMaterials

getMaterials(): Promise<Map<number, BaseMaterial>>

Returns

Promise<Map<number, BaseMaterial>>

材质对象Map

Description

获取所有材质对象的Map

Inherited from

LocalSvlxReader.getMaterials


getMaxObjectId

getMaxObjectId(): number

Returns

number

Description

获取最大的id

Inherited from

LocalSvlxReader.getMaxObjectId


getMeasure

getMeasure(measureId): Promise<Measure>

Parameters

NameTypeDescription
measureIdnumber测量Id

Returns

Promise<Measure>

Measure 测量对象

Description

根据id获取单个测量对象

Inherited from

LocalSvlxReader.getMeasure


getMeasures

getMeasures(): Promise<Map<number, Measure>>

Returns

Promise<Map<number, Measure>>

测量对象Map

Description

获取所有测量对象的Map

Inherited from

LocalSvlxReader.getMeasures


getMesh

getMesh(model?): Promise<boolean>

Parameters

NameTypeDescription
model?Modelmodel对象 可选参数

Returns

Promise<boolean>

异步返回是否加载成功

Description

获取mesh数据

Overrides

LocalSvlxReader.getMesh


getMesh_1

getMesh_1(model?, offset?): Promise<boolean>

Parameters

NameTypeDefault valueDescription
model?Modelundefined
offsetnumber0未使用 可选参数,默认值为0

Returns

Promise<boolean>

异步返回是否加载成功

Description

获取mesh数据

Inherited from

LocalSvlxReader.getMesh_1


getModelBoard

getModelBoard(modelBoardId): Promise<ModelBoard>

Parameters

NameType
modelBoardIdnumber

Returns

Promise<ModelBoard>

Description

根据id获取单个看板对象

Inherited from

LocalSvlxReader.getModelBoard


getModelBoards

getModelBoards(): Promise<Map<number, ModelBoard>>

Returns

Promise<Map<number, ModelBoard>>

看板对象的Map

Description

获取所有看板对象的Map

Inherited from

LocalSvlxReader.getModelBoards


getModelProperties

getModelProperties(): Promise<Map<string, Object>>

Returns

Promise<Map<string, Object>>

字符串Map

Description

获取.model文件中的instances属性

Inherited from

LocalSvlxReader.getModelProperties

getModelProperties(insID): Promise<Map<string, Object>>

Parameters

NameType
insIDnumber

Returns

Promise<Map<string, Object>>

Description

获取模型属性

Inherited from

LocalSvlxReader.getModelProperties


getModelViewContent

getModelViewContent(modelView): Promise<ModelView>

Parameters

NameType
modelViewModelView

Returns

Promise<ModelView>

Description

获取指定视图的详细内容

Inherited from

LocalSvlxReader.getModelViewContent


getModelViewList

getModelViewList(): Promise<Map<number, ModelView>>

Returns

Promise<Map<number, ModelView>>

视图对象仅包含列表显示数据

Description

获取所有视图列表数组

Inherited from

LocalSvlxReader.getModelViewList


getModels

getModels(): Promise<Map<number, Model>>

Returns

Promise<Map<number, Model>>

模型Map

Description

获取模型接口

Overrides

LocalSvlxReader.getModels


getPMIs

getPMIs(): Promise<Map<number, PMI>>

Returns

Promise<Map<number, PMI>>

Description

获取PMI

Inherited from

LocalSvlxReader.getPMIs


getParentModel

getParentModel(): Model

Returns

Model

Description

获取父级模型

Inherited from

LocalSvlxReader.getParentModel


getProtoProperties

getProtoProperties(): Promise<Map<string, Object>>

Returns

Promise<Map<string, Object>>

字符串Map

Description

读取.model文件中的models属性

Inherited from

LocalSvlxReader.getProtoProperties

getProtoProperties(protoID): Promise<Map<string, Object>>

Parameters

NameType
protoIDnumber

Returns

Promise<Map<string, Object>>

Description

获取原始属性

Inherited from

LocalSvlxReader.getProtoProperties


getProtos

getProtos(): Promise<Map<number, Model>>

Returns

Promise<Map<number, Model>>

模型Map

Description

获取所有原型对象,M3D.Proto的Map,key:protoId

Inherited from

LocalSvlxReader.getProtos


getScene

getScene(): Scene

Returns

Scene

Description

获取场景

Inherited from

LocalSvlxReader.getScene


getSection

getSection(sectionId): Promise<Section>

Parameters

NameTypeDescription
sectionIdnumber剖切面id

Returns

Promise<Section>

剖切面对象

Description

通过剖切面id剖切面对象

Inherited from

LocalSvlxReader.getSection


getSections

getSections(): Promise<Map<number, Section>>

Returns

Promise<Map<number, Section>>

key:剖切面的Id;value:剖切面对象

Description

获取所有剖切面的Map

Inherited from

LocalSvlxReader.getSections


getServerModelViewContent

getServerModelViewContent(modelView): Promise<ModelView>

Parameters

NameTypeDescription
modelViewModelView视图对象

Returns

Promise<ModelView>

视图对象

Description

获取在线视图内容

Inherited from

LocalSvlxReader.getServerModelViewContent


getServerModelViewList

getServerModelViewList(): Promise<Map<number, ModelView>>

Returns

Promise<Map<number, ModelView>>

Description

获取在线视图列表

Inherited from

LocalSvlxReader.getServerModelViewList


getShapes

getShapes(shapeType): Promise<Map<number, Shape>>

Parameters

NameTypeDescription
shapeTypeShapeTypeShape对象类型

Returns

Promise<Map<number, Shape>>

Description

获取指定类型的Shape对象的集合

Inherited from

LocalSvlxReader.getShapes


getShapesFile

getShapesFile(shapeType): string

Parameters

NameTypeDescription
shapeTypeShapeTypeShape对象类型

Returns

string

数据字符串

Description

获取所有指定类型的Shape对象的数据,如pmi/measure/modelboard/annotation等

Inherited from

LocalSvlxReader.getShapesFile


getSignRes

getSignRes(): Promise<Map<string, ArrayBuffer>>

Returns

Promise<Map<string, ArrayBuffer>>

图章关联数据ArrayBuffer

Description

获取图章关联资源数据

Inherited from

LocalSvlxReader.getSignRes


getThreeDGesture

getThreeDGesture(threeDGesturesId): Promise<ThreeDGesturesNote>

Parameters

NameTypeDescription
threeDGesturesIdnumber手绘批注Id

Returns

Promise<ThreeDGesturesNote>

手绘批注对象

Description

根据id获取单个手绘批注对象(手绘批注来源:.measure文件)

Inherited from

LocalSvlxReader.getThreeDGesture


getThreeDGestures

getThreeDGestures(): Promise<Map<number, ThreeDGesturesNote>>

Returns

Promise<Map<number, ThreeDGesturesNote>>

手绘批注对象Map

Description

获取所有手绘批注对象的Map

Inherited from

LocalSvlxReader.getThreeDGestures


getTopModel

getTopModel(): Promise<Model>

Returns

Promise<Model>

模型

Description

获取顶级装配

Inherited from

LocalSvlxReader.getTopModel

getTopModel(needParseData): Model

Parameters

NameTypeDescription
needParseDataboolean是否解析数据,不需要解析时直接返回当前topModel对象;

Returns

Model

模型

Description

获取顶级装配

Inherited from

LocalSvlxReader.getTopModel


getUrl

getUrl(): string

Returns

string

Description

获取模型路径

Inherited from

LocalSvlxReader.getUrl


isCancle

isCancle(): boolean

Returns

boolean

Description

获取是否取消

Inherited from

LocalSvlxReader.isCancle


isJson

isJson(name, content): string | [boolean, any]

Parameters

NameTypeDescription
namestring文件名
contentany文件内容

Returns

string | [boolean, any]

是否是JSON 1.是JSON数据,返回对应数组[true , JSON对象];2.出错则返回出错信息 ;3.返回null

Description

判断数据是否为json

Inherited from

LocalSvlxReader.isJson


load

load(): Promise<Reader>

Returns

Promise<Reader>

异步获取读取类

Description

加载模型

Inherited from

LocalSvlxReader.load

load(fileDownloadUrl): Promise<Reader>

Parameters

NameTypeDescription
fileDownloadUrlstring文件下载路径

Returns

Promise<Reader>

异步获取读取类

Description

加载模型

Inherited from

LocalSvlxReader.load

load(fileBuffer): Promise<Reader>

Parameters

NameTypeDescription
fileBufferArrayBuffer模型二进制文件

Returns

Promise<Reader>

异步获取读取类

Description

加载接口

Inherited from

LocalSvlxReader.load


onBegin

onBegin(sign, fun): void

Parameters

NameTypeDescription
signstring标识,svlx路径或fileid
funstring开始的过程或方法

Returns

void

Description

读取开始事件

Inherited from

LocalSvlxReader.onBegin


onCancel

onCancel(sign): void

Parameters

NameTypeDescription
signstring标识,svlx路径或fileid

Returns

void

Description

读取取消事件

Inherited from

LocalSvlxReader.onCancel


onEnd

onEnd(sign, fun): void

Parameters

NameTypeDescription
signstring标识,svlx路径或fileid
funstring结束过程或方法

Returns

void

Description

读取结束事件

Inherited from

LocalSvlxReader.onEnd


onException

onException(sign, fun, error): void

Parameters

NameTypeDescription
signstring标识,svlx路径或fileid
funstring发生异常的过程或方法
errorException异常信息

Returns

void

Description

读取发生异常事件

Inherited from

LocalSvlxReader.onException


onProgress

onProgress(sign, fun, progress): void

Parameters

NameTypeDescription
signstring标识,svlx路径或fileid
funstring进度发生变化的过程或方法
progressnumber进度

Returns

void

Description

读取进度变化事件

Inherited from

LocalSvlxReader.onProgress


onUpdata

onUpdata(sign, fun, dataType): void

Parameters

NameType
signstring
funstring
dataTypestring

Returns

void

Description

读取更新事件

Inherited from

LocalSvlxReader.onUpdata


post

post(msg): void

Parameters

NameTypeDescription
msgM3DMessage消息内容

Returns

void

Description

消息发送者必须实现方法

Inherited from

LocalSvlxReader.post


registerEvent

registerEvent(event): void

Parameters

NameTypeDescription
eventM3DEventM3D事件

Returns

void

Description

注册事件

Inherited from

LocalSvlxReader.registerEvent


registerReaderEvent

registerReaderEvent(): ReaderEvent

Returns

ReaderEvent

读取事件

Description

注册监听

Inherited from

LocalSvlxReader.registerReaderEvent


removeEvent

removeEvent(): void

Returns

void

Description

删除事件

Inherited from

LocalSvlxReader.removeEvent


send

send(msg): void

Parameters

NameTypeDescription
msgM3DMessage消息内容

Returns

void

Description

消息发送者必须实现方法

Inherited from

LocalSvlxReader.send


setFile

setFile(file): Promise<SvlxReader>

Parameters

NameTypeDescription
fileSvlxFileSvlxFile对象

Returns

Promise<SvlxReader>

Svlx读取类

Description

设置svlx文件

Inherited from

LocalSvlxReader.setFile

setFile(file, sign?): Promise<SvlxReader>

Parameters

NameTypeDescription
fileArrayBuffersvlx文件的二进制数据
sign?string可选参数

Returns

Promise<SvlxReader>

Svlx读取类

Description

设置svlx文件

Inherited from

LocalSvlxReader.setFile


setFileId

setFileId(fileId): void

Parameters

NameTypeDescription
fileIdstring唯一标识

Returns

void

Description

设置模型对应的唯一标识

Inherited from

LocalSvlxReader.setFileId


setId

setId(v): void

Parameters

NameTypeDescription
vnumberShapeId

Returns

void

Description

设置id

Inherited from

LocalSvlxReader.setId


setIsParseInfo

setIsParseInfo(value): void

Parameters

NameType
valueboolean

Returns

void

Description

设置当前Reader是否需要解析Info数据

Inherited from

LocalSvlxReader.setIsParseInfo


setIsReferenceReader

setIsReferenceReader(value): void

Parameters

NameType
valueboolean

Returns

void

Description

设置是否为分散文件

Inherited from

LocalSvlxReader.setIsReferenceReader


setParentModel

setParentModel(parentModel): void

Parameters

NameTypeDescription
parentModelModel父级模型

Returns

void

Description

设置父级模型,即Reaader读取出的顶级模型在哪个模型下

Inherited from

LocalSvlxReader.setParentModel


setScene

setScene(scene): void

Parameters

NameType
sceneScene

Returns

void

Description

设置场景

Inherited from

LocalSvlxReader.setScene


setSvlxFile

setSvlxFile(svlxFile): void

Parameters

NameTypeDescription
svlxFileSvlxFile对象

Returns

void

Description

设置SvlxReader中的File

Inherited from

LocalSvlxReader.setSvlxFile


setTopModel

setTopModel(topModel): void

Parameters

NameType
topModelModel

Returns

void

Description

设置顶级模型

Inherited from

LocalSvlxReader.setTopModel


setUrl

setUrl(url): void

Parameters

NameTypeDescription
urlstring模型路径URL

Returns

void

Description

设置模型路径

Inherited from

LocalSvlxReader.setUrl


updata

updata(fun, dataType): void

Parameters

NameType
funstring
dataTypestring

Returns

void

Description

更新

Inherited from

LocalSvlxReader.updata


getMaxSvlxVersion

getMaxSvlxVersion(): string

Returns

string

Static

Description

获取svlx文件的最高版本

Inherited from

LocalSvlxReader.getMaxSvlxVersion


getMinSvlxVersion

getMinSvlxVersion(): string

Returns

string

Static

Description

获取svlx文件的最低版本

Inherited from

LocalSvlxReader.getMinSvlxVersion


parseData

parseData(data): void

Parameters

NameType
dataany

Returns

void

Static

Description

解析子线程返回数据