M3D / M3D / Shapes / AnnotationDisplayHelper
Class: AnnotationDisplayHelper
M3D.Shapes.AnnotationDisplayHelper
Memberof
M3D.Shapes
Description
批注展示工具类
Author
ss
Date
2022-1-20
Version
1.0
Copyright
All Rights Reserved. Copyright (C) 2022 HOTEAMSOFT, Ltd
Table of contents
Constructors
Methods
- countChar
- createAnnotation
- createAnnotationEllipseImage
- createAnnotationImage
- createAnnotationImageOld
- createAnnotationRectangleImage
- getAnnotationTextRectInfo
Constructors
constructor
• new AnnotationDisplayHelper(): AnnotationDisplayHelper
Returns
Methods
countChar
▸ countChar(str, rowCount, columnCount): (string | number)[]
Parameters
| Name | Type | Description |
|---|---|---|
str | string | 字符串 |
rowCount | number | 行数 |
columnCount | number | 字段 |
Returns
(string | number)[]
Description
获取批注的行数
createAnnotation
▸ createAnnotation(scene, annotation, imageBoard, annotationNote, fontSize, rows, rectStart, rectEnd, position, fontColor?): void
Parameters
| Name | Type | Description |
|---|---|---|
scene | Scene | 场景 |
annotation | Annotation | 批注 |
imageBoard | Image | 图片 |
annotationNote | string | 批注笔记 |
fontSize | number | 文本大小 |
rows | number | 行数据 |
rectStart | Vector2 | 开始的点 |
rectEnd | Vector2 | 结束的点 |
position | Vector3 | 位置 |
fontColor? | Color | 文本颜色 |
Returns
void
Description
创建批注
createAnnotationEllipseImage
▸ createAnnotationEllipseImage(shape2D, rectStart, rectEnd, lineColor, lineWidth, backColor, fontColor, fontSize, rows, str, fontName): void
Parameters
| Name | Type |
|---|---|
shape2D | Shape2D |
rectStart | Vector2 |
rectEnd | Vector2 |
lineColor | Color |
lineWidth | number |
backColor | Color |
fontColor | Color |
fontSize | number |
rows | number |
str | string |
fontName | string |
Returns
void
Description
创建批注椭圆形图片的参数
createAnnotationImage
▸ createAnnotationImage(scene, annotation, imageBoard, annotationNote, fontSize, rows, rectStart, rectEnd, frameColor, fillColor, position, type, fontColor?): Image
Parameters
| Name | Type |
|---|---|
scene | Scene |
annotation | Annotation |
imageBoard | Image |
annotationNote | string |
fontSize | number |
rows | number |
rectStart | Vector2 |
rectEnd | Vector2 |
frameColor | Color |
fillColor | Color |
position | Vector3 |
type | AnnotationType |
fontColor? | Color |
Returns
Description
创建批注图片
createAnnotationImageOld
▸ createAnnotationImageOld(scene, annotation, imageBoard, annotationNote, fontSize, rows, rectStart, rectEnd, frameColor, fillColor, position, font, backsrc): Image
Parameters
| Name | Type | Description |
|---|---|---|
scene | Scene | 场景 |
annotation | Annotation | 批注 |
imageBoard | Image | 图片 |
annotationNote | string[] | 批注笔记 |
fontSize | number | 文本大小 |
rows | number | 行数据 |
rectStart | Vector2 | 开始的点 |
rectEnd | Vector2 | 结束的点 |
frameColor | Color | 边框颜色 |
fillColor | Color | 填充颜色 |
position | Vector3 | 位置 |
font | Font | 文本 |
backsrc | string | 背景图片路径 |
Returns
Description
创建批注图片
createAnnotationRectangleImage
▸ createAnnotationRectangleImage(shape2D, rectStart, rectEnd, lineColor, lineWidth, backColor, fontColor, fontSize, rows, str, fontName): void
Parameters
| Name | Type |
|---|---|
shape2D | Shape2D |
rectStart | Vector2 |
rectEnd | Vector2 |
lineColor | Color |
lineWidth | number |
backColor | Color |
fontColor | Color |
fontSize | number |
rows | number |
str | string |
fontName | string |
Returns
void
Description
创建批注矩形图片的参数
getAnnotationTextRectInfo
▸ getAnnotationTextRectInfo(scene, textsArray, annoNote, fontSize, rectStart, rectEnd, rows, type): any[]
Parameters
| Name | Type |
|---|---|
scene | Scene |
textsArray | Texts2D[] |
annoNote | string |
fontSize | number |
rectStart | Vector2 |
rectEnd | Vector2 |
rows | number |
type | AnnotationType |
Returns
any[]
Description
获取批注文本信息