cee::vis::OverlayNavigationCube

class OverlayNavigationCube : public OverlayItem

Overlay navigation cube used for navigation and orientation in a View.

The navigation cube is a navigation tool to be positioned in a corner and aid with model interaction. The navigation cube will always show the orientation of the camera and provides a simple and interactive way of navigating the view.

See also

OverlayItem, Overlay, and View

Public Types

enum NavCubeFace

Enumerator for each of the navigation cube six faces.

Values:

enumerator NCF_X_POS

Positive X navigation cube face.

enumerator NCF_X_NEG

Negative X navigation cube face.

enumerator NCF_Y_POS

Positive Y navigation cube face.

enumerator NCF_Y_NEG

Negative Y navigation cube face.

enumerator NCF_Z_POS

Positive Z navigation cube face.

enumerator NCF_Z_NEG

Negative Z navigation cube face.

Public Functions

OverlayNavigationCube(Camera *camera, Font *font)

Constructs a navigation cube overlay item.

virtual unsigned int width() const

Returns the width of the navigation cube viewport in pixels.

virtual unsigned int height() const

Returns the height of the navigation cube viewport in pixels.

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

Sets the size of the navigation cube, in pixels.

virtual int priority() const

Returns the render priority of the item.

virtual void setPriority(int priority)

Sets render priority of the item.

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

void setFont(Font *font)

Sets the font for the axis labels.

Color3f textColor() const

Returns the text color of the axis labels.

void setTextColor(const Color3f &color)

Sets the text color.

bool updateHighlight(int winCoordX, int winCoordY, const View &view)

Updates the navigation cube highlighting.

Returns true if a redraw of the view is needed (due to changes in the highlighting)

bool processSelection(int winCoordX, int winCoordY, const View &view, Vec3d *viewDir, Vec3d *up)

Finds the new view direction and up vector based on the user clicking at the given winCoordX, winCoordY coordinate.

The method returns true and updates the viewDir and up with the appropriate values if a part of the navigation cube was hit.

void setHome(const Vec3d &viewDirection, const Vec3d &up)

Sets the view direction and up vector for the “home” icon in the navigation cube.

void setAxisLabels(const Str &xLabel, const Str &yLabel, const Str &zLabel)

Sets the axis labels.

void setAxisArrowColors(const Color3f &xAxisColor, const Color3f &yAxisColor, const Color3f &zAxisColor)

Sets the color of the x,y and z axis arrows.

void setFaceTexture(NavCubeFace face, const Image &texture)

Sets the face texture on each navigation face.