cee::vis::Overlay
-
class Overlay : public RefCountedObject
Overlay items are visual item presented overlaying the models in the View, for instance a color legend for scalar settings.
Available overlay item types are:
Overlay items are added to a corner and direction of your choosing using addItem().
You can specify the layout of the model items (e.g. OverlayColorLegend) by using the setModelItemsLayout() method.
See also
Public Functions
-
size_t itemCount()
Returns the number of overlay items in the model.
-
size_t itemIndex(const OverlayItem *overlayItem) const
Returns the index of the given overlay item.
cee::UNDEFINED_SIZE_T is returned if the item was not found.
-
OverlayItem *item(size_t itemIndex)
Returns the overlay item at the given index.
-
OverlayItem::LayoutCorner itemCorner(size_t itemIndex) const
Returns layout corner of overlay item at index itemIndex.
-
OverlayItem::LayoutDirection itemDirection(size_t itemIndex) const
Returns layout direction of overlay item at index itemIndex.
-
void itemPosition(size_t itemIndex, int *x, int *y)
Returns the position of the given overlay item.
-
void addItem(OverlayItem *overlayItem, OverlayItem::LayoutCorner corner, OverlayItem::LayoutDirection direction)
Adds an overlay item to the specified corner.
Overlay items can be, for instance, a color legend or a user defined logo. The direction tells which direction to lay out the added items if there are multiple items in the same location.
-
void removeItem(OverlayItem *overlayItem)
Removes the given overlay item from the view.
Note! The overlay item must be in the current collection. Use the method itemIndex() to check if needed.
-
void removeAllItems()
Removes all overlay items in the view.
-
void setOverlayItemOverrideSize(OverlayItem *overlayItem, unsigned int width, unsigned int height)
Overrides the size of the overlay item with the specified size in this view.
Useful for overlay items that are shared between multiple views with different view sizes
-
void clearOverlayItemOverrideSize(OverlayItem *overlayItem)
Removes the override size of the overlay item in this view.
-
OverlayItem *itemFromWindowCoordinates(int x, int y)
Returns the overlay item (if any) at the given cursor position.
The input (window) coordinates must be specified in OpenGL style coordinates, which means a right handed coordinate system with the origin in the lower left corner of the window.
-
bool automaticLayoutOfModelItems() const
Returns true if the color legends should be automatically sized to fit in the view.
See also
-
void setAutomaticLayoutOfModelItems(bool autoLayout)
Sets if the color legends should be automatically sized to fit in the view or not.
If true, the heights of the color legends are adjusted so all legends will be visible in the view
-
unsigned int maximumHeightAutomaticLayout() const
Returns the maximum height the ug color legends will have if automaticLayoutOfModelItems is on.
See also
-
void setMaximumHeightAutomaticLayout(unsigned int heightInPixels)
Sets the maximum height a color legend from the unstruct grid model will have if automaticLayoutOfModelItems is enabled.
-
bool disableModelItems() const
Returns true if the overlay items produced from the models in the view should hidden.
-
void setDisableModelItems(bool disable)
Specifies if the overlay items produced from the models in the view should be shown or not.
If set to false, only the overlay items added to this class will be shown.
-
OverlayItem::LayoutCorner modelItemsLayoutCorner() const
Returns the corner the model items (e.g. Color Legends from UnstructGrid) will be positioned in.
-
OverlayItem::LayoutDirection modelItemsLayoutDirection() const
Returns the direction the model items (e.g. Color Legends from UnstructGrid) will be positioned in.
-
void setModelItemsLayout(OverlayItem::LayoutCorner corner, OverlayItem::LayoutDirection direction)
Specifies the layout of the model items (e.g.
Color Legends from UnstructGrid)
The default is BOTTOM_LEFT and VERTICAL. Use this method if you would like the color legends from the UnstructGrid model to be placed in another corner.
-
void setShowDebugInfo(bool show)
Turns on/off the display of debug info in the view.
-
bool showDebugInfo() const
Returns true if debug info is displayed in the view. False if not.