Skip to main content
Version: Next

RulerAnnotationStore

Hierarchy

Index

Constructors

constructor

  • new RulerAnnotationStore(backendService: BackendService, fileId: number, activeFrame: FrameStore, controlPoints: Point2D[], regionType: RegionType, regionId?: number, rotation?: number, name?: string, color?: string, lineWidth?: number, dashLength?: number): RulerAnnotationStore
  • Parameters

    • backendService: BackendService
    • fileId: number
    • activeFrame: FrameStore
    • controlPoints: Point2D[]
    • regionType: RegionType
    • regionId: number = -1
    • rotation: number = 0
    • name: string = ""
    • color: string = Colors.TURQUOISE5
    • lineWidth: number = 2
    • dashLength: number = 0

    Returns RulerAnnotationStore

Properties

activeFrame

activeFrame: FrameStore

auxiliaryLineDashLength

auxiliaryLineDashLength: number = 0

auxiliaryLineVisible

auxiliaryLineVisible: boolean = true

color

color: string

controlPoints

controlPoints: Point2D[]

coordinate

coordinate: CoordinateMode

creating

creating: boolean

dashLength

dashLength: number

editing

editing: boolean

readonlyfileId

fileId: number

font

font: Font = Font.HELVETICA

fontSize

fontSize: number = 13

fontStyle

fontStyle: FontStyle = FontStyle.NORMAL

isSimplePolygon

isSimplePolygon: boolean

lineRegionSampleWidth

lineRegionSampleWidth: number = 3

lineWidth

lineWidth: number

locked

locked: boolean = false

publicmodifiedTimestamp

modifiedTimestamp: number

name

name: string

regionId

regionId: number

regionType

regionType: RegionType

rotation

rotation: number

textOffset

textOffset: Point2D = ...

staticreadonlyAVAILABLE_ANNOTATION_TYPES

AVAILABLE_ANNOTATION_TYPES: Map<RegionType, string> = ...

staticreadonlyAVAILABLE_REGION_TYPES

AVAILABLE_REGION_TYPES: Map<RegionType, string> = ...

staticreadonlyMAX_DASH_LENGTH

MAX_DASH_LENGTH: 50 = 50

staticreadonlyMAX_LINE_WIDTH

MAX_LINE_WIDTH: 10 = 10

staticreadonlyMIN_LINE_WIDTH

MIN_LINE_WIDTH: 0.5 = 0.5

staticreadonlyTARGET_VERTEX_COUNT

TARGET_VERTEX_COUNT: 200 = 200

Accessors

boundingBox

  • Returns Point2D

boundingBoxArea

  • get boundingBoxArea(): number
  • Returns number

center

  • Returns Point2D

isAnnotation

  • get isAnnotation(): boolean
  • Returns boolean

isClosedRegion

  • get isClosedRegion(): boolean
  • Returns boolean

isPreviewCut

  • get isPreviewCut(): boolean
  • Returns boolean

isTemporary

  • get isTemporary(): boolean
  • Returns boolean

isValid

  • get isValid(): boolean
  • Returns boolean

nameString

  • get nameString(): string
  • Returns string

regionProperties

  • get regionProperties(): string
  • Returns string

size

  • Returns the sizes of regions and annotations. For line regions and annotations, vector annotations, and ruler annotations, returns x and y absolute displacements.


    Returns Point2D

    The x and y size components.

wcsSize

  • Returns Point2D

Methods

beginCreating

  • beginCreating(): void
  • Returns void

beginEditing

  • beginEditing(): void
  • Returns void

endCreating

  • endCreating(): Generator<Promise<ISetRegionAck>, void, unknown>
  • Returns Generator<Promise<ISetRegionAck>, void, unknown>

endEditing

  • endEditing(): void
  • Returns void

focusCenter

  • focusCenter(): void
  • Returns void

publicgetAnnotationStyles

  • getAnnotationStyles(): { auxiliaryLineDashLength: number; auxiliaryLineVisible: boolean; font: Font; fontSize: number; fontStyle: FontStyle; textOffset: Point2D }
  • Returns { auxiliaryLineDashLength: number; auxiliaryLineVisible: boolean; font: Font; fontSize: number; fontStyle: FontStyle; textOffset: Point2D }

    • auxiliaryLineDashLength: number
    • auxiliaryLineVisible: boolean
    • font: Font
    • fontSize: number
    • fontStyle: FontStyle
    • textOffset: Point2D

publicgetAnnotationStylesForExport

  • getAnnotationStylesForExport(): { coordinateSystem: string; font: Font; fontSize: number; fontStyle: FontStyle }
  • Returns { coordinateSystem: string; font: Font; fontSize: number; fontStyle: FontStyle }

    • coordinateSystem: string
    • font: Font
    • fontSize: number
    • fontStyle: FontStyle

publicgetCurveApproximation

  • getCurveApproximation(wcsInfo: FrameSet, mapping?: Mapping): { hypotenuseApproximatePoints: number[]; xApproximatePoints: number[]; yApproximatePoints: number[] }
  • Parameters

    • wcsInfo: FrameSet
    • optionalmapping: Mapping

    Returns { hypotenuseApproximatePoints: number[]; xApproximatePoints: number[]; yApproximatePoints: number[] }

    • hypotenuseApproximatePoints: number[]
    • xApproximatePoints: number[]
    • yApproximatePoints: number[]

publicgetRegionApproximation

  • getRegionApproximation(astTransform: Mapping): Point2D[]
  • Parameters

    • astTransform: Mapping

    Returns Point2D[]

publicinitializeStyles

  • initializeStyles(annotationStyles: { auxiliaryLineDashLength: number; auxiliaryLineVisible: boolean; font: Font; fontSize: number; fontStyle: FontStyle; textOffset: Point2D }): void
  • Parameters

    • annotationStyles: { auxiliaryLineDashLength: number; auxiliaryLineVisible: boolean; font: Font; fontSize: number; fontStyle: FontStyle; textOffset: Point2D }

    Returns void

setAuxiliaryLineDashLength

  • setAuxiliaryLineDashLength(length: number): void
  • Parameters

    • length: number

    Returns void

setAuxiliaryLineVisible

  • setAuxiliaryLineVisible(isVisible: boolean): void
  • Parameters

    • isVisible: boolean

    Returns void

setCenter

  • setCenter(p: Point2D, skipUpdate?: boolean): void
  • Parameters

    • p: Point2D
    • skipUpdate: boolean = false

    Returns void

setColor

  • setColor(color: string): void
  • Parameters

    • color: string

    Returns void

setControlPoint

  • setControlPoint(index: number, p: Point2D, skipUpdate?: boolean): void
  • Parameters

    • index: number
    • p: Point2D
    • skipUpdate: boolean = false

    Returns void

setControlPoints

  • setControlPoints(points: Point2D[], skipUpdate?: boolean, shapeChanged?: boolean): void
  • Parameters

    • points: Point2D[]
    • skipUpdate: boolean = false
    • shapeChanged: boolean = true

    Returns void

setCoordinate

  • Parameters

    Returns void

setDashLength

  • setDashLength(dashLength: number): void
  • Parameters

    • dashLength: number

    Returns void

setFont

  • setFont(font: Font): void
  • Parameters

    Returns void

setFontSize

  • setFontSize(fontSize: number): void
  • Parameters

    • fontSize: number

    Returns void

setFontStyle

  • setFontStyle(fontStyle: string): void
  • Parameters

    • fontStyle: string

    Returns void

setLineWidth

  • setLineWidth(lineWidth: number): void
  • Parameters

    • lineWidth: number

    Returns void

setLocked

  • setLocked(locked: boolean): void
  • Parameters

    • locked: boolean

    Returns void

setName

  • setName(name: string): void
  • Parameters

    • name: string

    Returns void

setRegionId

  • setRegionId(id: number): void
  • Parameters

    • id: number

    Returns void

setRotation

  • setRotation(angle: number, skipUpdate?: boolean): void
  • Parameters

    • angle: number
    • skipUpdate: boolean = false

    Returns void

setSize

  • setSize(p: Point2D, skipUpdate?: boolean): void
  • Sets the size for regions and annotations


    Parameters

    • p: Point2D

      Specifies the x and y size components. For line regions and annotations, vector annotations, and ruler annotations, the function sets the new start and end positions while keeping the rotation within the same quadrant.

    • skipUpdate: boolean = false

      Whether to update the changes with the backend.

    Returns void

setTextOffset

  • setTextOffset(offset: number, isX: boolean): void
  • Parameters

    • offset: number
    • isX: boolean

    Returns void

toggleLock

  • toggleLock(): void
  • Returns void

publicstaticGetRegionProperties

  • GetRegionProperties(regionType: RegionType, controlPoints: Point2D[], rotation: number): string
  • Parameters

    • regionType: RegionType
    • controlPoints: Point2D[]
    • rotation: number

    Returns string

publicstaticIsRegionCustomIcon

  • IsRegionCustomIcon(regionType: RegionType): boolean
  • Parameters

    • regionType: RegionType

    Returns boolean

publicstaticIsRegionDashLengthValid

  • IsRegionDashLengthValid(regionDashLength: number): boolean
  • Parameters

    • regionDashLength: number

    Returns boolean

publicstaticIsRegionLineWidthValid

  • IsRegionLineWidthValid(regionLineWidth: number): boolean
  • Parameters

    • regionLineWidth: number

    Returns boolean

publicstaticIsRegionTypeValid

  • IsRegionTypeValid(regionType: RegionType): boolean
  • Parameters

    • regionType: RegionType

    Returns boolean

publicstaticRegionIconString

  • RegionIconString(regionType: RegionType): any
  • Parameters

    • regionType: RegionType

    Returns any

publicstaticRegionTypeString

  • RegionTypeString(regionType: RegionType): string
  • Parameters

    • regionType: RegionType

    Returns string