vrAnnotationService

class vrAnnotationService

(Inherits vrBaseService)

Functions

vrAnnotationService.createAnnotation(name, parent=vrdNode())

Creates a new annotation. Each annotation is created with a unique name. If the passed name is not unique (e.g. an annotation with that name already exists), it is modified so that it is unique.

Parameters:
  • name (string) – The name for the annotation.
  • parent (vrdNode) – The new annotation node will be attached to this node. The parent node must be a node in the annotation graph. It must be the annotation graph root or one of its child groups. If this parameter is omitted, the annotation graph root will be used.
Returns:

Created annotation node.

Return type:

vrdAnnotationNode

vrAnnotationService.createAnnotationGroup(name, parent=vrdNode())

Creates a new annotation group with a unique name within the annotation graph.

Parameters:
  • name (string) – The name for the new annotation group node.
  • parent (vrdNode) – The new group node will be attached to this node. The parent node must be a node in the annotation graph. It must be the annotation graph root or one of its child groups. If this parameter is omitted, the annotation graph root will be used.
Returns:

The newly created annotation group node.

Return type:

vrdNode

vrAnnotationService.deleteAnnotation(annotation)

Deletes an existing annotation.

Parameters:annotation (vrdAnnotationNode) – The annotation node which should be deleted.
vrAnnotationService.deleteAnnotations(nodes)

Deletes existing annotations and/or annotation groups including all their children.

Parameters:nodes (List[vrdNode]) – The list of annotation/group nodes which should be deleted.
vrAnnotationService.duplicateAnnotation(annotation)

Duplicates an existing annotation.

Parameters:annotation (vrdAnnotationNode) – The annotation node which should be duplicated.
Returns:Duplicated annotation node.
Return type:vrdAnnotationNode
vrAnnotationService.duplicateAnnotations(nodes)

Duplicates existing annotations and/or annotation groups including all their children.

Parameters:nodes (List[vrdNode]) – The list of annotation/group nodes which should be duplicated.
Returns:List of duplicated annotation/group nodes.
Return type:List[vrdNode]
vrAnnotationService.findAnnotation(name)

Searches for an existing annotation via name.

Parameters:name (string) – The name of the annotation.
Returns:Found annotation node.
Return type:vrdAnnotationNode
vrAnnotationService.getAnnotationRoot()

Returns the root node of the annotation hierarchy. Currently, all annotations are children of that root.

Returns:Root node.
Return type:vrdNode
vrAnnotationService.getAnnotations()

Returns a list of all annotations.

Returns:List of annotation nodes.
Return type:List[vrdAnnotationNode]
vrAnnotationService.getDefaultBackgroundColor()

Returns the default label background color of annotations.

Returns:The color.
Return type:QColor
vrAnnotationService.getDefaultFontColor()

Returns the default font color for the displayed text of annotations.

Returns:The color.
Return type:QColor
vrAnnotationService.getDefaultLineColor()

Returns the default line color for borders and leaders of annotations.

Returns:The color.
Return type:QColor
vrAnnotationService.getDefaultScalingMode()

Returns the default scaling mode of annotations.

Returns:The scaling mode.
Return type:vrAnnotationTypes.ScalingMode
vrAnnotationService.getDefaultSize()

Returns the default size of annotations.

Returns:The size.
Return type:float
vrAnnotationService.getDefaultUseSceneNodeVisibility()

Returns the default value for using the linked scene graph node to determine the visibility of annotations.

Returns:True if the linked node determines the visibility, False otherwise.
Return type:bool
vrAnnotationService.getSelection()

Returns the current selection.

Returns:A list of all selected annotations.
Return type:List[vrdAnnotationNode]
vrAnnotationService.getShowAnnotations()

Returns the global visibility of annotations.

Returns:True if annotations are shown, False otherwise.
Return type:bool
vrAnnotationService.loadAnnotations(path)

Loads annotation data from an xml file. The annotations are directly added to the scene.

Parameters:path (string) – The path to an xml file with annotation data.
Returns:A list of annotation nodes.
Return type:List[vrdAnnotationNode]
vrAnnotationService.pickAnnotation(annotation)

Activates the scene node picking functionality of the UI for the passed annotation.

Parameters:annotation (vrdAnnotationNode) – The annotation node for which the picking should be started.
vrAnnotationService.saveAnnotations(annotations, path)

Saves a list of annotations. The annotation data is stored in an xml file.

Parameters:
  • annotations (List[vrdAnnotationNode]) – A list of annotation nodes.
  • path (string) – The path for the xml file.
vrAnnotationService.setDefaultBackgroundColor(color)

Sets the default label background color of annotations. It is used when creating a new annotation.

Parameters:color (QColor) – The color values. They can either be set as integer values (color.setRgb(..)) in range [0 .. 255] or as floating point values (color.setRgbF(..)) in range [0.0 .. 1.0].
vrAnnotationService.setDefaultFontColor(color)

Sets the default font color for the displayed text of annotations. It is used when creating a new annotation.

Parameters:color (QColor) – The color values. They can either be set as integer values (color.setRgb(..)) in range [0 .. 255] or as floating point values (color.setRgbF(..)) in range [0.0 .. 1.0].
vrAnnotationService.setDefaultLineColor(color)

Sets the default line color for borders and leaders of annotations. It is used when creating a new annotation.

Parameters:color (QColor) – The color values. They can either be set as integer values (color.setRgb(..)) in range [0 .. 255] or as floating point values (color.setRgbF(..)) in range [0.0 .. 1.0].
vrAnnotationService.setDefaultScalingMode(mode)

Sets the default scaling mode of annotations. It is used when creating a new annotation.

Parameters:mode (vrAnnotationTypes.ScalingMode) – The scaling mode value. Choose between vrAnnotationTypes::ScalingMode::Off, Near or Far.
vrAnnotationService.setDefaultSize(size)

Sets the default size of annotations. It is used when creating a new annotation.

Parameters:size (float) – The size value. A value of 1.0 will result in a decent predefined size. Use smaller or larger values to size appropriately.
vrAnnotationService.setDefaultUseSceneNodeVisibility(use)

Sets the default value for using the linked scene graph node to determine the visibility of annotations. It is used when creating a new annotation.

Parameters:use (bool) – True if the linked node should determine the visibility, False otherwise.
vrAnnotationService.setSelection(annotations)

Select the given annotations in the annotation module.

Parameters:annotations (List[vrdAnnotationNode]) – Annotations to be selected.
vrAnnotationService.setShowAnnotations(value)

Sets the global visibility of annotations. Individual visibility can be set in vrdAnnotationNode.

Parameters:value (bool) – True to show annotations, False otherwise.

Signals

vrAnnotationService.annotationCreated(annotation)

Triggered when a new annotation was created.

Parameters:annotation (vrdAnnotationNode) – The newly created annotation.
vrAnnotationService.annotationGraphChanged()

Triggered whenever the annotation graph changed. This includes adding and deleting annotations or groups as well as moving annotations or groups.

vrAnnotationService.annotationsAdded()

Triggered when one or more annotations were added to the scene.

vrAnnotationService.annotationsDeleted()

Triggered when one or more annotations were deleted from the scene.

vrAnnotationService.selectionChanged(annotations)

Triggered when the selection has been changed.

Parameters:annotations (List[vrdAnnotationNode]) – The selected annotations.
vrAnnotationService.showAnnotationsChanged(value)

Triggered when the global annotation visibility has changed.

Parameters:value (bool) – True if annotations are shown, False otherwise.