Back to Aurora Vision Library website

You are here: Start » Function Reference » Debug Preview » SetViewPrimitive

SetViewPrimitive


Header: AVL.h
Namespace: avl::DebugPreview
Module: FoundationLite

Sets a 2D primitive into an image debug preview window.

Description

This function adds/sets a 2D primitive to the image preview window to be displayed on top of the image. Up to 100 primitives distinguished by a slot index can be added to a single preview window.

In order to see a primitive in the view an image first needs to be set using the SetViewImage function.

The following function overloads for various primitive types are available:

bool SetViewPrimitive(ViewHandle view, int primitiveIndex, const avl::Box& box, Color color = AutoColor, float lineWidth = DefaultLineWidth)
bool SetViewPrimitive(ViewHandle view, int primitiveIndex, const atl::Array<avl::Box>& boxArray, Color color = AutoColor, float lineWidth = DefaultLineWidth)
bool SetViewPrimitive(ViewHandle view, int primitiveIndex, const avl::Circle2D& circle, Color color = AutoColor, float lineWidth = DefaultLineWidth)
bool SetViewPrimitive(ViewHandle view, int primitiveIndex, const atl::Array<avl::Circle2D>& circleArray, Color color = AutoColor, float lineWidth = DefaultLineWidth)
bool SetViewPrimitive(ViewHandle view, int primitiveIndex, const avl::Arc2D& arc, Color color = AutoColor, float lineWidth = DefaultLineWidth)
bool SetViewPrimitive(ViewHandle view, int primitiveIndex, const atl::Array<avl::Arc2D>& arcArray, Color color = AutoColor, float lineWidth = DefaultLineWidth)
bool SetViewPrimitive(ViewHandle view, int primitiveIndex, const avl::Rectangle2D& rect, Color color = AutoColor, float lineWidth = DefaultLineWidth)
bool SetViewPrimitive(ViewHandle view, int primitiveIndex, const atl::Array<avl::Rectangle2D>& rectArray, Color color = AutoColor, float lineWidth = DefaultLineWidth)
bool SetViewPrimitive(ViewHandle view, int primitiveIndex, const avl::Segment2D& segment, Color color = AutoColor, bool showArrow = true, float lineWidth = DefaultLineWidth)
bool SetViewPrimitive(ViewHandle view, int primitiveIndex, const atl::Array<avl::Segment2D>& segmentArray, Color color = AutoColor, bool showArrow = true, float lineWidth = DefaultLineWidth)
bool SetViewPrimitive(ViewHandle view, int primitiveIndex, const avl::Point2D& point, Color color = AutoColor)
bool SetViewPrimitive(ViewHandle view, int primitiveIndex, const atl::Array<avl::Point2D>& pointArray, Color color = AutoColor)
bool SetViewPrimitive(ViewHandle view, int primitiveIndex, const avl::Line2D& line, Color color = AutoColor, float lineWidth = DefaultLineWidth)
bool SetViewPrimitive(ViewHandle view, int primitiveIndex, const atl::Array<avl::Line2D>& lineArray, Color color = AutoColor, float lineWidth = DefaultLineWidth)
bool SetViewPrimitive(ViewHandle view, int primitiveIndex, const avl::Path& path, Color color = AutoColor, float lineWidth = DefaultLineWidth)
bool SetViewPrimitive(ViewHandle view, int primitiveIndex, const atl::Array<avl::Path>& pathArray, Color color = AutoColor, float lineWidth = DefaultLineWidth)
bool SetViewPrimitive(ViewHandle view, int primitiveIndex, const avl::Region& region, Color color = AutoColor)
bool SetViewPrimitive(ViewHandle view, int primitiveIndex, const atl::Array<avl::Region>& regionArray, Color color = AutoColor)
bool SetViewPrimitive(ViewHandle view, int primitiveIndex, const avl::CoordinateSystem2D& coord, Color color = AutoColor)
bool SetViewPrimitive(ViewHandle view, int primitiveIndex, const atl::Array<avl::CoordinateSystem2D>& coordArray, Color color = AutoColor)
bool SetViewPrimitive(ViewHandle view, int primitiveIndex, const avl::StringLabel& label, Color color = AutoColor)
bool SetViewPrimitive(ViewHandle view, int primitiveIndex, const atl::Array<avl::StringLabel>& labelArray, Color color = AutoColor)
bool SetViewPrimitive(ViewHandle view, int primitiveIndex, const avl::Ellipse2D& ellipse, Color color = AutoColor, float lineWidth = DefaultLineWidth)
bool SetViewPrimitive(ViewHandle view, int primitiveIndex, const atl::Array<avl::Ellipse2D>& ellipseArray, Color color = AutoColor, float lineWidth = DefaultLineWidth)
bool SetViewPrimitive(ViewHandle view, int primitiveIndex, const avl::Ring2D& ring, Color color = AutoColor)
bool SetViewPrimitive(ViewHandle view, int primitiveIndex, const atl::Array<avl::Ring2D>& ringArray, Color color = AutoColor)
bool SetViewPrimitive(ViewHandle view, int primitiveIndex, const avl::Heatmap& heatmap, Color color = AutoColor)
bool SetViewPrimitive(ViewHandle view, int primitiveIndex, const avl::ShapeRegion& region, Color color = AutoColor, float LineWidth = DefaultLineWidth)
bool SetViewPrimitive(ViewHandle view, int primitiveIndex, const avl::OcrResult& result, Color color = AutoColor, float LineWidth = DefaultLineWidth)
bool SetViewPrimitive(ViewHandle view, int primitiveIndex, const atl::Array<avl::OcrResult>& resultArray, Color color = AutoColor, float LineWidth = DefaultLineWidth)
bool SetViewPrimitive(ViewHandle view, int primitiveIndex, const avl::Rectangle2D& rect, const atl::String& label, Color color = AutoColor, float LineWidth = DefaultLineWidth)

The view argument must provide a handle to the preview created with the CreateView function.

The primitiveIndex arguments specifies the slot index to set the primitive into (in the range 0...99). Setting the primitive into a slot for the first time initializes the given primitive. Setting the primitive again into the same slot overrides the previous primitive data and type. The slot indexes does not have to be used in consecutive order. Slot indexes determine the z-order of primitives in the preview.

The color argument determines the color the primitive is displayed as a 32bit ARGB value (e.g. 0xFFFF0000 for red, or 0xFF0000FF for blue). This parameter is optional and can be omitted or set to AutoColor constant to automatically associate the primitive color based on its index.

Return value

The function returns true when the specified preview window is still active and the new image is displayed in the preview. The function will return false when the preview window associated with the handle has been manually closed by the user and the window is not active anymore.

See Also

  • CreateView – Creates a new floating window for a 2D image based data preview.
  • SetViewImage – Sets an image to be previewed in the debug preview window.