QuadAnnotation class

四边形注释类,用于存储和操作四个顶点坐标 替代List<Offset>以提高代码严谨性,防止意外增删顶点

Constructors

QuadAnnotation({required Point<double> topLeft, required Point<double> topRight, required Point<double> bottomLeft, required Point<double> bottomRight})
构造函数
QuadAnnotation.defaultRectangle({required Size containerSize, double padding = 10.0})
创建默认矩形(基于给定尺寸和内边距)
factory
QuadAnnotation.fromRectangleFeature(RectangleFeature rect)
从RectangleFeature创建QuadAnnotation
factory
QuadAnnotation.fromVertices(List<Point<double>> vertices)
从顶点列表创建四边形注释 顶点顺序:左上, 右上, 右下, 左下
factory

Properties

bottomLeft Point<double>
左下角顶点
getter/setter pair
bottomRight Point<double>
右下角顶点
getter/setter pair
bounds Rect
获取边界矩形
no setter
hasError bool
获取当前错误状态
no setter
hashCode int
The hash code for this object.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
topLeft Point<double>
左上角顶点
getter/setter pair
topRight Point<double>
右上角顶点
getter/setter pair
vertices List<Point<double>>
转换为顶点列表 返回顺序:左上, 右上, 右下, 左下
no setter

Methods

copy() QuadAnnotation
复制当前矩形特征
getVertex(int index) Point<double>
根据索引获取顶点
insetBy({required double dx, required double dy}) QuadAnnotation
生成一个扩大/缩小边距的矩形框 dx > 0, dy > 0 表示向内缩小 dx < 0, dy < 0 表示向外扩大
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
offsetBy({required double dx, required double dy}) QuadAnnotation
矩形偏移
setVertex(int index, Point<double> vertex) → void
根据索引设置顶点
toRectangleFeature() → RectangleFeature
转换为RectangleFeature
toString() String
A string representation of this object.
override
validateQuadrilateral() bool
检查四边形是否正确 (convex/concave/complex quadrilateral) 更新内部错误状态并返回是否正确

Operators

operator ==(Object other) bool
相等性比较
override