DCMTK Version 3.7.0 OFFIS DICOM Toolkit

Public Member Functions | Private Member Functions | Private Attributes | List of all members
DVPSTextObject Class Reference

an item of the text object sequence in a presentation state (internal use only). More...

## Public Member Functions
| DVPSTextObject ()
| default constructor
| DVPSTextObject (const DVPSTextObject &copy)
| copy constructor
DVPSTextObject * | clone ()
| clone method. More...
virtual | ~DVPSTextObject ()
| destructor
OFCondition | read (DcmItem &dset)
| reads a text object from a DICOM dataset. More...
OFCondition | write (DcmItem &dset)
| writes the text object managed by this object to a DICOM dataset. More...
OFBool | haveAnchorPoint ()
| checks if this text object contains an anchor point. More...
OFBool | haveBoundingBox ()
| checks if this text object contains bounding box. More...
OFCondition | setAnchorPoint (double x, double y, DVPSannotationUnit unit, OFBool isVisible)
| sets an anchor point for this text object. More...
OFCondition | setBoundingBox (double TLHC_x, double TLHC_y, double BRHC_x, double BRHC_y, DVPSannotationUnit unit, DVPSTextJustification justification)
| sets bounding box for this text object. More...
OFCondition | setText (const char *text)
| assigns a new "unformatted text value" for this text object. More...
void | removeAnchorPoint ()
| removes any anchor point from the text object. More...
void | removeBoundingBox ()
| removes any bounding box from the text object. More...
const char * | getText ()
| gets the unformatted text value for this text object. More...
double | getBoundingBoxTLHC_x ()
| gets the bounding box TLHC x value. More...
double | getBoundingBoxTLHC_y ()
| gets the bounding box TLHC y value. More...
double | getBoundingBoxBRHC_x ()
| gets the bounding box BRHC x value. More...
double | getBoundingBoxBRHC_y ()
| gets the bounding box BRHC y value. More...
DVPSannotationUnit | getBoundingBoxAnnotationUnits ()
| gets the bounding box annotation units. More...
DVPSTextJustification | getBoundingBoxHorizontalJustification ()
| gets the bounding box horizontal justification. More...
double | getAnchorPoint_x ()
| gets the anchor point x value. More...
double | getAnchorPoint_y ()
| gets the anchor point y value. More...
OFBool | anchorPointIsVisible ()
| gets the anchor point visibility May only be called when an anchor point is present (haveAnchorPoint()==OFTrue) More...
DVPSannotationUnit | getAnchorPointAnnotationUnits ()
| gets the anchor point annotation units. More...

## Private Member Functions
DVPSTextObject & | operator= (const DVPSTextObject &)
| private undefined assignment operator

## Private Attributes
DcmCodeString | boundingBoxAnnotationUnits
| VR=CS, VM=1, Type 1c.
DcmCodeString | anchorPointAnnotationUnits
| VR=CS, VM=1, Type 1c.
DcmShortText | unformattedTextValue
| VR=ST, VM=1, Type 1.
DcmFloatingPointSingle | boundingBoxTLHC
| VR=FL, VM=2, Type 1c.
DcmFloatingPointSingle | boundingBoxBRHC
| VR=FL, VM=2, Type 1c.
DcmCodeString | boundingBoxTextHorizontalJustification
| VR=CS, VM=1, Type 1c.
DcmFloatingPointSingle | anchorPoint
| VR=FL, VM=2, Type 1c.
DcmCodeString | anchorPointVisibility
| VR=CS, VM=1, Type 1c.

## Detailed Description

an item of the text object sequence in a presentation state (internal use only).

This class manages the data structures comprising one item of the Text Object Sequence which is contained in the Graphic Annotation Sequence in a Presentation State object.

## Member Function Documentation

## ◆ anchorPointIsVisible()

OFBool DVPSTextObject::anchorPointIsVisible | ( |  | ) |

gets the anchor point visibility May only be called when an anchor point is present (haveAnchorPoint()==OFTrue)

Returns
  OFTrue if anchor point is visible

## ◆ clone()

DVPSTextObject* DVPSTextObject::clone | ( |  | ) |
| inline

clone method.

Returns
  a pointer to a new DVPSTextObject object containing a copy of this object.

## ◆ getAnchorPoint_x()

double DVPSTextObject::getAnchorPoint_x | ( |  | ) |

gets the anchor point x value.

May only be called when an anchor point is present (haveAnchorPoint()==OFTrue)

Returns
  anchor point x value

## ◆ getAnchorPoint_y()

double DVPSTextObject::getAnchorPoint_y | ( |  | ) |

gets the anchor point y value.

May only be called when an anchor point is present (haveAnchorPoint()==OFTrue)

Returns
  anchor point y value

## ◆ getAnchorPointAnnotationUnits()

DVPSannotationUnit DVPSTextObject::getAnchorPointAnnotationUnits | ( |  | ) |

gets the anchor point annotation units.

May only be called when an anchor point is present (haveAnchorPoint()==OFTrue)

Returns
  anchor point annotation units

## ◆ getBoundingBoxAnnotationUnits()

DVPSannotationUnit DVPSTextObject::getBoundingBoxAnnotationUnits | ( |  | ) |

gets the bounding box annotation units.

May only be called when a bounding box is present (haveBoundingBox()==OFTrue)

Returns
  bounding box annotation units

## ◆ getBoundingBoxBRHC_x()

double DVPSTextObject::getBoundingBoxBRHC_x | ( |  | ) |

gets the bounding box BRHC x value.

May only be called when a bounding box is present (haveBoundingBox()==OFTrue)

Returns
  bounding box BRHC x value

## ◆ getBoundingBoxBRHC_y()

double DVPSTextObject::getBoundingBoxBRHC_y | ( |  | ) |

gets the bounding box BRHC y value.

May only be called when a bounding box is present (haveBoundingBox()==OFTrue)

Returns
  bounding box BRHC y value

## ◆ getBoundingBoxHorizontalJustification()

DVPSTextJustification DVPSTextObject::getBoundingBoxHorizontalJustification | ( |  | ) |

gets the bounding box horizontal justification.

May only be called when a bounding box is present (haveBoundingBox()==OFTrue)

Returns
  bounding box horizontal justification

## ◆ getBoundingBoxTLHC_x()

double DVPSTextObject::getBoundingBoxTLHC_x | ( |  | ) |

gets the bounding box TLHC x value.

May only be called when a bounding box is present (haveBoundingBox()==OFTrue)

Returns
  bounding box TLHC x value

## ◆ getBoundingBoxTLHC_y()

double DVPSTextObject::getBoundingBoxTLHC_y | ( |  | ) |

gets the bounding box TLHC y value.

May only be called when a bounding box is present (haveBoundingBox()==OFTrue)

Returns
  bounding box TLHC y value

## ◆ getText()

const char* DVPSTextObject::getText | ( |  | ) |

gets the unformatted text value for this text object.

Returns
  unformatted text value

## ◆ haveAnchorPoint()

OFBool DVPSTextObject::haveAnchorPoint | ( |  | ) |

checks if this text object contains an anchor point.

Returns
  OFTrue if anchor point present

## ◆ haveBoundingBox()

OFBool DVPSTextObject::haveBoundingBox | ( |  | ) |

checks if this text object contains bounding box.

Returns
  OFTrue if bounding box present

## ◆ read()

OFCondition DVPSTextObject::read | ( | DcmItem & | dset | ) |

reads a text object from a DICOM dataset.

The DICOM elements of the Text Object item are copied from the dataset to this object. The completeness of the item (presence of all required elements, value multiplicity) is checked. If this method returns an error code, the object is in undefined state afterwards.

Parameters

  dset | the item of the TextObjectSequence from which the data is to be read

Returns
  EC_Normal if successful, an error code otherwise.

## ◆ removeAnchorPoint()

void DVPSTextObject::removeAnchorPoint | ( |  | ) |

removes any anchor point from the text object.

Attention: A text object must always contain either anchor point, bounding box or both. This property is not asserted by the text object itself.

## ◆ removeBoundingBox()

void DVPSTextObject::removeBoundingBox | ( |  | ) |

removes any bounding box from the text object.

Attention: A text object must always contain either anchor point, bounding box or both. This property is not asserted by the text object itself.

## ◆ setAnchorPoint()

OFCondition DVPSTextObject::setAnchorPoint | ( | double | x,
|  | double | y,
|  | DVPSannotationUnit | unit,
|  | OFBool | isVisible
| ) |  |

sets an anchor point for this text object.

Parameters

  x | anchor point X value
  y | anchor point Y value
  unit | anchor point annotation units (pixel/display)
  isVisible | anchor point visibility

Returns
  EC_Normal if successful, an error code otherwise.

## ◆ setBoundingBox()

OFCondition DVPSTextObject::setBoundingBox | ( | double | TLHC_x,
|  | double | TLHC_y,
|  | double | BRHC_x,
|  | double | BRHC_y,
|  | DVPSannotationUnit | unit,
|  | DVPSTextJustification | justification
| ) |  |

sets bounding box for this text object.

Parameters

  TLHC_x | bounding box top-lefthand corner X value
  TLHC_y | bounding box top-lefthand corner Y value
  BRHC_x | bounding box bottom-righthand corner X value
  BRHC_y | bounding box bottom-righthand corner Y value
  unit | bounding box annotation units (pixel/display)
  justification | bounding box horizontal justification (left/right/center)

Returns
  EC_Normal if successful, an error code otherwise.

## ◆ setText()

OFCondition DVPSTextObject::setText | ( | const char * | text | ) |

assigns a new "unformatted text value" for this text object.

Parameters

  text | unformatted text value. Must not be NULL or empty string.

Returns
  EC_Normal if successful, an error code otherwise.

## ◆ write()

OFCondition DVPSTextObject::write | ( | DcmItem & | dset | ) |

writes the text object managed by this object to a DICOM dataset.

Copies of the DICOM element managed by this object are inserted into the DICOM dataset.

Parameters

  dset | the the item of the TextObjectSequence to which the data is written

Returns
  EC_Normal if successful, an error code otherwise.

The documentation for this class was generated from the following file:

- dcmpstat/include/dcmtk/dcmpstat/dvpstx.h

Generated on Mon Dec 15 2025 for DCMTK Version 3.7.0 by Doxygen 1.9.1