|
Grip-Reloaded
Grip version visualizaiton interface for DART (DynamicAnimationandRoboticsToolkits)
|
Class which inherits from QWidget and osgViewer::CompositeViewer. This class creates a osgQt::GraphicsWindowQt and puts it inside a composite viewer. More...
#include <ViewerWidget.h>
Public Member Functions | |
| ViewerWidget (osgViewer::ViewerBase::ThreadingModel threadingModel=osgViewer::CompositeViewer::AutomaticSelection) | |
| Constructor for ViewerWidget class. | |
| QWidget * | addViewWidget (osg::Camera *camera, osg::Node *scene) |
| Add a osgQt::GraphicsWindowQt widget to the ViewerWidget. | |
| osg::Camera * | createCamera (int x, int y, int w, int h, const std::string &name="", bool windowDecoration=false) |
| Creates a camera for the viewer. | |
| osg::Matrixd | getViewMatrix () |
| Gets the view matrix. | |
| void | setViewMatrix (uint i, osg::Matrixd m) |
| Sets the viewMatrix of the specified view. | |
| void | setToFrontView () |
| Sets the matrix of the camera manipulator to front view. | |
| void | setToTopView () |
| Sets the matrix of the camera manipulator to top view. | |
| void | setToSideView () |
| Sets the matrix of the camera manipulator to side view. | |
| void | setCameraMatrix (osg::Matrix &newMatrix, uint viewNum=0) |
| Sets the matrix of the specified camera. | |
| void | addNodeToScene (osg::Node *node, uint viewNum=0) |
| Adds an osg node to the scene in the view specified by the user. | |
| void | setBackgroundColor (const osg::Vec4 &color, uint viewNum=0) |
| Sets background color of the view number "viewNum" with the "color". If an invalid view number is provided an error message is printed and no change occurs to any view. | |
| osgGA::CameraManipulator * | getCameraManipulator (uint viewNum=0) |
| Gets the camera manipulator for a certain view, specified by it's view number "viewNum". | |
| void | setCameraToHomePosition (uint viewNum=0) |
| Sets the the camera the in the specified view to its home position. | |
| void | addGrid (uint width, uint depth, uint gridSize) |
| Adds a grid to the viewer. | |
| virtual void | paintEvent (QPaintEvent *event) |
| Renders the scene. | |
Protected Member Functions | |
| bool | viewNumIsValid (uint viewNum) |
| Determines if the input view number is valid, i.e., Does that view exist in the ViewWidget, since the ViewWidget is a CompositeViewer and therefore can hold more than one view. | |
Protected Attributes | |
| QTimer | _timer |
Class which inherits from QWidget and osgViewer::CompositeViewer. This class creates a osgQt::GraphicsWindowQt and puts it inside a composite viewer.
| void ViewerWidget::addGrid | ( | uint | width, |
| uint | depth, | ||
| uint | gridSize | ||
| ) |
Adds a grid to the viewer.
| width | Width of the entire grid in meters |
| depth | Depth of the entire grid in meters |
| gridSize | Length of side of each grid square in meters |
| void ViewerWidget::addNodeToScene | ( | osg::Node * | node, |
| uint | viewNum = 0 |
||
| ) |
Adds an osg node to the scene in the view specified by the user.
| node | osg::Node pointer to add to the scene |
| viewNum | View of which to add the node to |
| QWidget * ViewerWidget::addViewWidget | ( | osg::Camera * | camera, |
| osg::Node * | scene | ||
| ) |
Add a osgQt::GraphicsWindowQt widget to the ViewerWidget.
| camera | An osg::Camera pointer |
| scene | An osg::Node pointer which is the scene to display |
| osg::Camera * ViewerWidget::createCamera | ( | int | x, |
| int | y, | ||
| int | w, | ||
| int | h, | ||
| const std::string & | name = "", |
||
| bool | windowDecoration = false |
||
| ) |
Creates a camera for the viewer.
| x | x-coordinate of the upper-left corner of the window |
| y | y-coordinate of the upper-left corner of the window |
| w | Width of the window |
| h | Height of the window |
| name | Name of the window |
| windowDecoration | Whether or not to add window decoration |
| osgGA::CameraManipulator * ViewerWidget::getCameraManipulator | ( | uint | viewNum = 0 | ) |
Gets the camera manipulator for a certain view, specified by it's view number "viewNum".
| viewNum | Number of the view of which to get the camera manipulator. |
| osg::Matrixd ViewerWidget::getViewMatrix | ( | ) |
Gets the view matrix.
| virtual void ViewerWidget::paintEvent | ( | QPaintEvent * | event | ) | [inline, virtual] |
Renders the scene.
| event | QPaint event |
| void ViewerWidget::setBackgroundColor | ( | const osg::Vec4 & | color, |
| uint | viewNum = 0 |
||
| ) |
Sets background color of the view number "viewNum" with the "color". If an invalid view number is provided an error message is printed and no change occurs to any view.
| color | osg::Vec4 RGBA (red, green blue, alpha) color vector. |
| viewNum | View number to change the background color of. |
| void ViewerWidget::setCameraMatrix | ( | osg::Matrix & | newMatrix, |
| uint | viewNum = 0 |
||
| ) |
Sets the matrix of the specified camera.
| newMatrix | osg::Matrix reference to set the camera to |
| viewNum | The view of which to set the camera matrix |
| void ViewerWidget::setCameraToHomePosition | ( | uint | viewNum = 0 | ) |
Sets the the camera the in the specified view to its home position.
| viewNum | View for which to set the camera to home position |
| void ViewerWidget::setToFrontView | ( | ) |
Sets the matrix of the camera manipulator to front view.
| void ViewerWidget::setToSideView | ( | ) |
Sets the matrix of the camera manipulator to side view.
| void ViewerWidget::setToTopView | ( | ) |
Sets the matrix of the camera manipulator to top view.
| void ViewerWidget::setViewMatrix | ( | uint | i, |
| osg::Matrixd | m | ||
| ) |
Sets the viewMatrix of the specified view.
| i | View to change the view matrix of |
| m | New view matrix |
| bool ViewerWidget::viewNumIsValid | ( | uint | viewNum | ) | [protected] |
Determines if the input view number is valid, i.e., Does that view exist in the ViewWidget, since the ViewWidget is a CompositeViewer and therefore can hold more than one view.
| viewNum | Number of the view to validate |
1.7.6.1