Class GraphicObject

This class is container to hold single graphic data, and contains functionalities to manage them Graphic objects fetched from the root tag Graphic Object Sequence Attribute (0070,0009)

Hierarchy

  • GraphicObject

Index

Constructors

constructor

  • new GraphicObject(graphicData?: Array<Point>, graphicType?: GraphicType, graphicFilled?: boolean, graphicAnnotationUnits?: string, graphicDimensions?: number): GraphicObject
  • description

    constructs the GraphicObject object;

    Parameters

    • Default value graphicData: Array<Point> = []

      graphic data

    • Default value graphicType: GraphicType = Fovia.GraphicType.none

      graphic type

    • Default value graphicFilled: boolean = false

      graphic filled

    • Default value graphicAnnotationUnits: string = ""

      graphic annotation units

    • Default value graphicDimensions: number = 0

      graphic dimensions

    Returns GraphicObject

    Returns the newly created instance GraphicObject

Properties

graphicAnnotationUnits

graphicAnnotationUnits: string

graphicData

graphicData: Array<Point> = []

graphicDimensions

graphicDimensions: number

graphicFilled

graphicFilled: boolean

graphicType

graphicType: GraphicType = Fovia.GraphicType.none

Private highlightColor

highlightColor: string

Private hotSpots

hotSpots: Array<Point> = []

Private isSelected

isSelected: boolean = false

Private lastPoint

lastPoint: Point = new Fovia.Util.Point(0, 0)

numberOfGraphicPoints

numberOfGraphicPoints: number

Private selectedHotspotIndex

selectedHotspotIndex: number = -1

Private threshold

threshold: number = 5

Methods

addGraphicData

  • addGraphicData(point: Point): void
  • description

    Add points into this graphic object

    Parameters

    • point: Point

      Point to be added

    Returns void

addHotspot

  • addHotspot(currentPoint: Point): void
  • description

    Add a point to hot spot to be highlighted while editing. The given point will be validated against the threshold value and last point. Only if it satisfies, it will added, otherwise skipped

    Parameters

    • currentPoint: Point

      A Fovia.Util.Point object

    Returns void

clone

  • description

    Clone this graphic object

    Returns GraphicObject

    Returns the new instance created

constructHotspots

  • constructHotspots(): void
  • description

    Construct hotspots from graphic data

    Returns void

getEndPoint

  • description

    Get end point. It returns last point from graphic data

    Returns Point

    a point

getGraphicData

  • getGraphicData(index?: number): Point
  • description

    Get graphic data at specified index

    Parameters

    • Default value index: number = 0

      The index at which the data is requested

    Returns Point

    A Fovia.Util.Point object, if index is valid otherwise null

getHighlightColor

  • getHighlightColor(): string
  • description

    get the highlighted color

    Returns string

    highlighted color will be returned

getHotspots

  • getHotspots(): Array<Point>
  • description

    Get all hotspots

    Returns Array<Point>

    Returns array of hot spot points it holds

getIsSelected

  • getIsSelected(): boolean
  • description

    Check whether the graphic object is selected or not

    Returns boolean

    True will be returned in success case, false on failure case

getSelectedHotspotIndex

  • getSelectedHotspotIndex(): number
  • description

    Get the selected hot spot index

    description

    Returns selected index in success case, -1 on failure case

    Returns number

getStartPoint

  • description

    Get start point. It returns first point from graphic data

    Returns Point

    a point

isFreeLine

  • isFreeLine(): boolean
  • description

    Check if freeLine or not. If number of graphic data is more than two and first and last graphic data are equal, then it's free line

    Returns boolean

    true/false

isHotspotSelected

  • isHotspotSelected(): boolean
  • description

    Check whether any hot spot selected or not

    Returns boolean

    Return true if any of the hotspot selected. otherwise false

isLargerObject

  • isLargerObject(): boolean
  • description

    Check whether the graphic data has large points If graphic data length is more than 10, it's considered to be larger object

    Returns boolean

    true will be returned in success case, false will be returned in failure case

moveHotspot

  • moveHotspot(currentPoint: Point): void
  • description

    Move selected hotspots to the new point

    Parameters

    • currentPoint: Point

      current point where the selected hotspot to be moved

    Returns void

setHighlightColor

  • setHighlightColor(highlightColor: string): void
  • description

    Set highlight color

    Parameters

    • highlightColor: string

      The highlight color

    Returns void

setIsSelected

  • setIsSelected(flag: boolean): void
  • description

    Updated whether the graphic data is selected or not

    Parameters

    • flag: boolean

      true for selected, false for not

    Returns void

setSelectedHotspotIndex

  • setSelectedHotspotIndex(index: number): void
  • description

    Set selected hot spot index

    Parameters

    • index: number

      The index to be set

    Returns void

updateNoOfGraphicPoints

  • updateNoOfGraphicPoints(): void
  • description

    Update the Number Of graphicPoints

    Returns void