# cee::vis::OverlayItem

class `OverlayItem` : public RefCountedObject

  Abstract interface for overlay items.

  Overlay items are visual items presented overlaying the models in the View, for instance a color legend for scalar settings.

  The overlay item can be added to a view using the View::overlay() and Overlay::addItem(). The view manages the layout of the overlay items, so only a desired size can be given in in this class. The position is specified when the overlay item is added to the view.

  An overlay item can be shown in multiple views at the same time.

  An overlay item can be set to invisible for temporary hiding it from the view.

  See also

  OverlayTextBox, OverlayImage, OverlayColorLegend , OverlayAxisCross, OverlayCategoryLegend, OverlayNavigationCube, and OverlayPlot

  Subclassed by OverlayPlot, OverlayColorLegend, OverlayAxisCross, OverlayCategoryLegend, OverlayColorLegendContinuousDomain, OverlayImage, OverlayNavigationCube, OverlayTextBox

  Public Types

  enum `LayoutCorner`

    Enumerator for the different locations/”corners” of the view.

    Values:

    enumerator `TOP_LEFT`

      Top left corner.

    enumerator `TOP_RIGHT`

      Top right corner.

    enumerator `BOTTOM_LEFT`

      Bottom left corner.

    enumerator `BOTTOM_RIGHT`

      Bottom right corner.

    enumerator `CENTER`

      Center of the view.

    enumerator `TOP_CENTER`

      Top centered.

    enumerator `BOTTOM_CENTER`

      Bottom centered.

  enum `LayoutDirection`

    Enumerator for horizontal or vertical orientation of layout items.

    Describes which direction additional items should be positioned if more than one exists in the same corner.

    Values:

    enumerator `HORIZONTAL`

      Horizontal layout direction.

    enumerator `VERTICAL`

      Vertical layout direction.

    enumerator `ABSOLUTE_POSITION`

      Absolute position of the overlay item. Absolute offset from the given LayoutCorner.

      See also

      setAbsolutePosition

  Public Functions

  unsigned int `width`() const

    Returns the width of the overlay item in pixels.

  unsigned int `height`() const

    Returns the height of the overlay item in pixels.

  void `setSize`(unsigned int width, unsigned int height)

    Sets the dimensions of the overlay item in pixels.

  int `priority`() const

    Returns the render priority of the item.

  void `setPriority`(int priority)

    Sets render priority of the overlay item.

    The render priority determines the order in which item get rendered. Items with lower priorities get rendered first.

    These are the default priorities for the different types of overlay items:

    1. OverlayColorLegend: 10
    2. OverlayCategoryLegend: 10
    3. OverlayColorLegendContinuousDomain: 10
    4. OverlayTextBox: 12
    5. OverlayImage: 15
    6. OverlayPlot: 18
    7. OverlayAxisCross: 20
    8. OverlayNavigationCube: 20
  bool `visible`() const

    Returns true if the overlay item is set to be visible.

  void `setVisible`(bool visible)

    Sets if the overlay item should be visible or not.

  int `absolutePositionX`() const

    Returns the x coordinate of the absolute position to use for the OverlayItem if LayoutDirection is specified as ABSOLUTE_POSITION.

    See also

    setAbsolutePosition

  int `absolutePositionY`() const

    Returns the y coordinate of the absolute position to use for the OverlayItem if LayoutDirection is specified as ABSOLUTE_POSITION.

    See also

    setAbsolutePosition

  void `setAbsolutePosition`(int x, int y)

    Sets the absolute position of the bottom left corner of the OverlayItem as an offset from the LayoutCorner of the item.

    Note! This only applies to OverlayItems with LayoutDirection specified as ABSOLUTE_POSITION

    Example: Corner: TOP_RIGHT, offset (400, 700). This will position the bottom left corner of the item 400 pixels from the left side of the screen and 700 pixel from the top of the screen.

Conversation saved
HOOPSY BETA

### Hello! I'm HOOPSY

Your Docs generative AI assistant. Ask me anything about HOOPS Envision for Desktop or choose a sample question below to start a conversation:

What is HOOPS Envision for Desktop?
What are the latest release notes for HOOPS Envision for Desktop?
How do I start evaluating HOOPS Envision for Desktop?
How do I write my first sample application?
How can I get assistance?

HOOPSY may store conversations according to OpenAI's policy. Responses may not always be accurate.

HOOPSY is thinking...