M3D / M3D / Reader / AnnotationFactory
Class: AnnotationFactory
Memberof
SView.Reader
Description
批注工厂类
Author
nihy
Date
2022-1-20
Version
1.0
Hierarchy
-
↳
AnnotationFactory
Table of contents
Constructors
Methods
Constructors
constructor
• new AnnotationFactory(): AnnotationFactory
Returns
Inherited from
Methods
createAnnotation
▸ createAnnotation(firstPnt
, secondPnt
, annotationContent
): any
Parameters
Name | Type | Description |
---|---|---|
firstPnt | Vector3 | 第一个点 |
secondPnt | Vector3 | 第二个点 |
annotationContent | string | 批注内容 |
Returns
any
Static
Description
创建批注
▸ createAnnotation(type
, firstShapId
, scene
, firstPoint
, secondPnt
, text
): any
Parameters
Name | Type | Description |
---|---|---|
type | any | 批注类型 |
firstShapId | number | 第一个关联shape对象对应的ID |
scene | Scene | 场景对象 |
firstPoint | Vector3 | 第一个点 |
secondPnt | Vector3 | 第二个点 |
text | string | 批注内容 |
Returns
any
Static
Description
创建批注
▸ createAnnotation(type
, scene
, firstPoint
, secondPnt
, parentModel
, text
, frameColor
, fillColor
, bLenderLine
, bEnvelope
, bStub
, bFixed
, size
, font
, backSrc
): any
Parameters
Name | Type | Description |
---|---|---|
type | number | 批注类型 |
scene | Scene | 场景对象 |
firstPoint | Vector3 | 第一个点 |
secondPnt | Vector3 | 第二个点 |
parentModel | Model | 所属关联实例对象 |
text | string | 批注内容 |
frameColor | Color | 边框色 |
fillColor | Color | 填充色 |
bLenderLine | boolean | 是否显示引线 |
bEnvelope | boolean | 是否有包络 |
bStub | boolean | 是否有引线折弯 |
bFixed | boolean | 是否固定 |
size | Vector2 | 字体大小 |
font | Font | 字体 |
backSrc | string | 背景图片路径 |
Returns
any
Static
Description
创建批注
▸ createAnnotation(firstPnt
, secondPnt
, text
, frameColor
, fillColor
, bLenderLine
, bEnvelope
, bStub
, bFixed
, scene
, type
, parentModel
): any
Parameters
Name | Type | Description |
---|---|---|
firstPnt | Vector3 | 第一个点 |
secondPnt | Vector3 | 第二个点 |
text | string | 批注内容 |
frameColor | Color | 边框色 |
fillColor | Color | 填充色 |
bLenderLine | boolean | 是否显示引线 |
bEnvelope | boolean | 是否有包络 |
bStub | boolean | 是否有引线折弯 |
bFixed | boolean | 是否固定 |
scene | Scene | 场景对象 |
type | AnnotationType | 批注类型 |
parentModel | Model | 所属实例对象 |
Returns
any
Static
Description
创建批注
▸ createAnnotation(annotation
, text
, frameColor
, fillColor
, scene
, type
): any
Parameters
Name | Type | Description |
---|---|---|
annotation | Annotation | 批注对象 |
text | string | 批注内容 |
frameColor | Color | 边框色 |
fillColor | Color | 填充色 |
scene | Scene | 场景对象 |
type | AnnotationType | 批注类型 |
Returns
any
Static
Description
创建批注
▸ createAnnotation(type
, scene
): any
Parameters
Name | Type | Description |
---|---|---|
type | number | 批注类型 |
scene | Scene | 场景对象 |
Returns
any
Static
Description
创建批注
▸ createAnnotation(scene
, annotation
): any
Parameters
Name | Type | Description |
---|---|---|
scene | Scene | 场景对象 |
annotation | Annotation | 批注对象 |
Returns
any
Static
Description
创建批注
createMObject
▸ createMObject<T
>(arg
): T
Type parameters
Name |
---|
T |
Parameters
Name | Type | Description |
---|---|---|
arg | T | 泛型 |
Returns
T
Description
创建对象
Inherited from
fromJson
▸ fromJson(annotationStr
, scene
, version?
): Annotation
Parameters
Name | Type | Description |
---|---|---|
annotationStr | string | 批注内容 |
scene | Scene | 场景 |
version? | string | - |
Returns
批注对象
Static
Description
根据批注内容JSON数据生成批注对象
getMaxObjectId
▸ getMaxObjectId(annotationJsonArray
): number
Parameters
Name | Type | Description |
---|---|---|
annotationJsonArray | any | 批注json数组 |
Returns
number
获取批注ID的最大值
Static
Description
获取最大objectId
toJson
▸ toJson(annotation
): string
Parameters
Name | Type | Description |
---|---|---|
annotation | Annotation | 批注对象 |
Returns
string
批注对象对应的Json串
Static
Description
根据批注对象生成JSON数据
toJsonByAnnotations
▸ toJsonByAnnotations(noteList
): string
Parameters
Name | Type | Description |
---|---|---|
noteList | Annotation [] | 批注数组 |
Returns
string
批注对象对应的Json串
Static
Description
根据批注对象列表生成JSON数据