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.

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.

Public Functions

virtual unsigned int width() const = 0

Returns the width of the overlay item.

virtual unsigned int height() const = 0

Returns the height of the overlay item.

virtual void setSize(unsigned int width, unsigned int height) = 0

Sets the dimensions of the OverlayItem in pixels.

virtual int priority() const = 0

Returns the render priority of the item.

virtual void setPriority(int priority) = 0

Sets render priority of the item.

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.

int absolutePositionY() const

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

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.