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

M3D / M3D / Reader / AnnotationFactory

Class: AnnotationFactory

M3D.Reader.AnnotationFactory

Memberof

SView.Reader

Description

批注工厂类

Author

nihy

Date

2022-1-20

Version

1.0

Hierarchy

Table of contents

Constructors

Methods

Constructors

constructor

new AnnotationFactory(): AnnotationFactory

Returns

AnnotationFactory

Inherited from

MObjectFactory.constructor

Methods

createAnnotation

createAnnotation(firstPnt, secondPnt, annotationContent): any

Parameters

NameTypeDescription
firstPntVector3第一个点
secondPntVector3第二个点
annotationContentstring批注内容

Returns

any

Static

Description

创建批注

createAnnotation(type, firstShapId, scene, firstPoint, secondPnt, text): any

Parameters

NameTypeDescription
typeany批注类型
firstShapIdnumber第一个关联shape对象对应的ID
sceneScene场景对象
firstPointVector3第一个点
secondPntVector3第二个点
textstring批注内容

Returns

any

Static

Description

创建批注

createAnnotation(type, scene, firstPoint, secondPnt, parentModel, text, frameColor, fillColor, bLenderLine, bEnvelope, bStub, bFixed, size, font, backSrc): any

Parameters

NameTypeDescription
typenumber批注类型
sceneScene场景对象
firstPointVector3第一个点
secondPntVector3第二个点
parentModelModel所属关联实例对象
textstring批注内容
frameColorColor边框色
fillColorColor填充色
bLenderLineboolean是否显示引线
bEnvelopeboolean是否有包络
bStubboolean是否有引线折弯
bFixedboolean是否固定
sizeVector2字体大小
fontFont字体
backSrcstring背景图片路径

Returns

any

Static

Description

创建批注

createAnnotation(firstPnt, secondPnt, text, frameColor, fillColor, bLenderLine, bEnvelope, bStub, bFixed, scene, type, parentModel): any

Parameters

NameTypeDescription
firstPntVector3第一个点
secondPntVector3第二个点
textstring批注内容
frameColorColor边框色
fillColorColor填充色
bLenderLineboolean是否显示引线
bEnvelopeboolean是否有包络
bStubboolean是否有引线折弯
bFixedboolean是否固定
sceneScene场景对象
typeAnnotationType批注类型
parentModelModel所属实例对象

Returns

any

Static

Description

创建批注

createAnnotation(annotation, text, frameColor, fillColor, scene, type): any

Parameters

NameTypeDescription
annotationAnnotation批注对象
textstring批注内容
frameColorColor边框色
fillColorColor填充色
sceneScene场景对象
typeAnnotationType批注类型

Returns

any

Static

Description

创建批注

createAnnotation(type, scene): any

Parameters

NameTypeDescription
typenumber批注类型
sceneScene场景对象

Returns

any

Static

Description

创建批注

createAnnotation(scene, annotation): any

Parameters

NameTypeDescription
sceneScene场景对象
annotationAnnotation批注对象

Returns

any

Static

Description

创建批注


createMObject

createMObject<T>(arg): T

Type parameters

Name
T

Parameters

NameTypeDescription
argT泛型

Returns

T

Description

创建对象

Inherited from

MObjectFactory.createMObject


fromJson

fromJson(annotationStr, scene, version?): Annotation

Parameters

NameTypeDescription
annotationStrstring批注内容
sceneScene场景
version?string-

Returns

Annotation

批注对象

Static

Description

根据批注内容JSON数据生成批注对象


getMaxObjectId

getMaxObjectId(annotationJsonArray): number

Parameters

NameTypeDescription
annotationJsonArrayany批注json数组

Returns

number

获取批注ID的最大值

Static

Description

获取最大objectId


toJson

toJson(annotation): string

Parameters

NameTypeDescription
annotationAnnotation批注对象

Returns

string

批注对象对应的Json串

Static

Description

根据批注对象生成JSON数据


toJsonByAnnotations

toJsonByAnnotations(noteList): string

Parameters

NameTypeDescription
noteListAnnotation[]批注数组

Returns

string

批注对象对应的Json串

Static

Description

根据批注对象列表生成JSON数据