cee::vis::OverlayNavigationCube Class Reference

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

Public Types

enum  NavCubeFace {
  NCF_X_POS, NCF_X_NEG, NCF_Y_POS, NCF_Y_NEG,
  NCF_Z_POS, NCF_Z_NEG
}
 Enumerator for each of the navigation cube six faces. More...
 
- Public Types inherited from cee::vis::OverlayItem
enum  LayoutCorner {
  TOP_LEFT, TOP_RIGHT, BOTTOM_LEFT, BOTTOM_RIGHT,
  CENTER, TOP_CENTER, BOTTOM_CENTER
}
 Enumerator for the different locations/"corners" of the view. More...
 
enum  LayoutDirection { HORIZONTAL, VERTICAL, ABSOLUTE_POSITION }
 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. More...
 

Public Member Functions

 OverlayNavigationCube (Camera *camera, Font *font)
 Constructs a navigation cube overlay item. More...
 
virtual unsigned int width () const
 Returns the width of the navigation cube viewport in pixels. More...
 
virtual unsigned int height () const
 Returns the height of the navigation cube viewport in pixels. More...
 
void setSize (unsigned int width, unsigned int height)
 Sets the size of the navigation cube, in pixels. More...
 
virtual int priority () const
 Returns the render priority of the item. More...
 
virtual void setPriority (int priority)
 Sets render priority of the item. More...
 
void setFont (Font *font)
 Sets the font for the axis labels. More...
 
Color3f textColor () const
 Returns the text color of the axis labels. More...
 
void setTextColor (const Color3f &color)
 Sets the text color. More...
 
bool updateHighlight (int winCoordX, int winCoordY, const View &view)
 Updates the navigation cube highlighting. More...
 
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. More...
 
void setHome (const Vec3d &viewDirection, const Vec3d &up)
 Sets the view direction and up vector for the "home" icon in the navigation cube. More...
 
void setAxisLabels (const Str &xLabel, const Str &yLabel, const Str &zLabel)
 Sets the axis labels. More...
 
void setAxisArrowColors (const Color3f &xAxisColor, const Color3f &yAxisColor, const Color3f &zAxisColor)
 Sets the color of the x,y and z axis arrows. More...
 
void setFaceTexture (NavCubeFace face, const Image &texture)
 Sets the face texture on each navigation face. More...
 
- Public Member Functions inherited from cee::vis::OverlayItem
bool visible () const
 Returns true if the overlay item is set to be visible. More...
 
void setVisible (bool visible)
 Sets if the overlay item should be visible or not. More...
 
int absolutePositionX () const
 Returns the x coordinate of the absolute position to use for the OverlayItem if LayoutDirection is specified as ABSOLUTE_POSITION. More...
 
int absolutePositionY () const
 Returns the y coordinate of the absolute position to use for the OverlayItem if LayoutDirection is specified as ABSOLUTE_POSITION. More...
 
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. More...
 
- Public Member Functions inherited from cee::RefCountedObject
void addRef () const
 Increments the reference count for this object. More...
 
void release () const
 Decrements the reference count for this object. More...
 
int refCount () const
 Returns the reference count for this object. More...
 
void setRefCountZero () const
 Sets the ref count to zero, but DOES NOT delete the object. More...
 
Inheritance diagram for cee::vis::OverlayNavigationCube:
cee::vis::OverlayItem cee::RefCountedObject

Detailed Description

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
View

Member Enumeration Documentation

Enumerator for each of the navigation cube six faces.

Enumerator
NCF_X_POS 

Positive X navigation cube face.

NCF_X_NEG 

Negative X navigation cube face.

NCF_Y_POS 

Positive Y navigation cube face.

NCF_Y_NEG 

Negative Y navigation cube face.

NCF_Z_POS 

Positive Z navigation cube face.

NCF_Z_NEG 

Negative Z navigation cube face.

Constructor & Destructor Documentation

cee::vis::OverlayNavigationCube::OverlayNavigationCube ( Camera camera,
Font font 
)

Constructs a navigation cube overlay item.

Member Function Documentation

unsigned int cee::vis::OverlayNavigationCube::height ( ) const
virtual

Returns the height of the navigation cube viewport in pixels.

Implements cee::vis::OverlayItem.

int cee::vis::OverlayNavigationCube::priority ( ) const
virtual

Returns the render priority of the item.

Implements cee::vis::OverlayItem.

bool cee::vis::OverlayNavigationCube::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 cee::vis::OverlayNavigationCube::setAxisArrowColors ( const Color3f xAxisColor,
const Color3f yAxisColor,
const Color3f zAxisColor 
)

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

void cee::vis::OverlayNavigationCube::setAxisLabels ( const Str xLabel,
const Str yLabel,
const Str zLabel 
)

Sets the axis labels.

void cee::vis::OverlayNavigationCube::setFaceTexture ( NavCubeFace  face,
const Image texture 
)

Sets the face texture on each navigation face.

void cee::vis::OverlayNavigationCube::setFont ( Font font)

Sets the font for the axis labels.

void cee::vis::OverlayNavigationCube::setHome ( const Vec3d viewDirection,
const Vec3d up 
)

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

void cee::vis::OverlayNavigationCube::setPriority ( int  priority)
virtual

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.

Implements cee::vis::OverlayItem.

void cee::vis::OverlayNavigationCube::setSize ( unsigned int  width,
unsigned int  height 
)
virtual

Sets the size of the navigation cube, in pixels.

Implements cee::vis::OverlayItem.

void cee::vis::OverlayNavigationCube::setTextColor ( const Color3f color)

Sets the text color.

cee::Color3f cee::vis::OverlayNavigationCube::textColor ( ) const

Returns the text color of the axis labels.

bool cee::vis::OverlayNavigationCube::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)

unsigned int cee::vis::OverlayNavigationCube::width ( ) const
virtual

Returns the width of the navigation cube viewport in pixels.

Implements cee::vis::OverlayItem.