![]() |
RobWorkProject
24.12.4-
|
interface for viewing a scene graph. More...
#include <SceneViewer.hpp>
Inherited by SceneViewerWidget.
Classes | |
struct | View |
Public Types | |
typedef rw::core::Ptr< SceneViewer > | Ptr |
smart pointer type to this class | |
typedef boost::function< void(const rw::math::Vector3D<> &)> | PositionSelectedListener |
Defines a listener for position change events. More... | |
typedef rw::core::Event< PositionSelectedListener, const rw::math::Vector3D<> & > | PositionSelectedEvent |
Defines event for PositionChanged. | |
Public Member Functions | |
SceneViewer () | |
Constructor. | |
virtual | ~SceneViewer () |
Destructor. | |
virtual SceneGraph::Ptr | getScene ()=0 |
get the current scene graph | |
virtual const std::string & | getLogo () const =0 |
get the logo that is displayed in the 3d scene | |
virtual void | setLogo (const std::string &string)=0 |
set the logo that is displayed in the 3d scene | |
virtual rw::core::PropertyMap & | getPropertyMap ()=0 |
get propertymap | |
virtual void | updateView ()=0 |
Update the view. | |
virtual void | updateState (const rw::kinematics::State &state)=0 |
Set a new state. More... | |
virtual void | setWorldNode (rw::graphics::GroupNode::Ptr wnode)=0 |
Set the world group node. More... | |
virtual void | setWorkCellScene (rw::core::Ptr< class WorkCellScene > wcscene) |
Set the WorkCell scene. More... | |
virtual rw::graphics::GroupNode::Ptr | getWorldNode ()=0 |
Get the world node. More... | |
virtual void | saveBufferToFile (const std::string &filename, const int fillR, const int fillG, const int fillB)=0 |
Saves the current 3D view to disk as either jpg, bmp or png. More... | |
virtual SceneCamera::Ptr | getViewCamera ()=0 |
Get the view camera. More... | |
virtual rw::math::Vector3D | getViewCenter ()=0 |
Get the view center. More... | |
virtual DrawableNode::Ptr | pickDrawable (int x, int y)=0 |
picks the drawable in the scene that intersects with the ray (x,y,-1) in camera coordinates. More... | |
virtual DrawableNode::Ptr | pickDrawable (SceneGraph::RenderInfo &info, int x, int y)=0 |
picks the drawable in the scene that intersects with the ray (x,y,-1) in camera coordinates. More... | |
virtual View::Ptr | createView (const std::string &name, bool enableBackground=false)=0 |
Create a new view. More... | |
virtual View::Ptr | getMainView ()=0 |
Get the main view. More... | |
virtual void | destroyView (View::Ptr view)=0 |
Destroy view. More... | |
virtual void | selectView (View::Ptr view)=0 |
Select a view. More... | |
virtual View::Ptr | getCurrentView ()=0 |
Get the currently selected view. More... | |
virtual std::vector< View::Ptr > | getViews ()=0 |
Get all views. More... | |
virtual void | renderView (View::Ptr view)=0 |
Render a view. More... | |
PositionSelectedEvent & | positionSelectedEvent () |
Returns PositionChangedEvent object needed for subscription to and firing of event. More... | |
virtual void | setTransform (const rw::math::Transform3D<> &t3d) |
set the orientation of the view. The view will look in the positive direction of the z-axis, with x-axis as the width and the y-axis as the height. Origin of view is in the center of the image. More... | |
virtual rw::math::Transform3D | getTransform () |
get the current rotation of the view More... | |
virtual void | zoom (double amount)=0 |
Move the camera along its z-axis. More... | |
virtual void | autoZoom ()=0 |
Automatically fits all frames inside the viewport by moving camera in its z-axis. | |
Protected Attributes | |
PositionSelectedEvent | _positionSelectedEvent |
Event for selection of a position. | |
rw::core::Ptr< class WorkCellScene > | _wcscene |
The WorkCell scene. | |
interface for viewing a scene graph.
The scene graph viewer
typedef boost::function<void(const rw::math::Vector3D<>&)> PositionSelectedListener |
Defines a listener for position change events.
These listeners are called when user has selected a point in the 3D view.
To send an event double clicking left mouse button on the point of interest while pressing shift.
Example use in a plugin: See RobWorkStudio::StateChangedListener
|
pure virtual |
Create a new view.
name | [in] name of view. |
enableBackground | [in] (optional) enable the background. Default is false. |
Implemented in SceneOpenGLViewer.
|
pure virtual |
Destroy view.
view | [in] the view to destroy. |
|
pure virtual |
|
pure virtual |
|
inlinevirtual |
get the current rotation of the view
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
|
pure virtual |
picks the drawable in the scene that intersects with the ray (x,y,-1) in camera coordinates.
x | [in] first camera coordinate. |
y | [in] second camera coordinate. |
Implemented in SceneOpenGLViewer.
|
pure virtual |
picks the drawable in the scene that intersects with the ray (x,y,-1) in camera coordinates.
info | [in] rendering information. |
x | [in] first camera coordinate. |
y | [in] second camera coordinate. |
Implemented in SceneOpenGLViewer.
|
inline |
Returns PositionChangedEvent object needed for subscription to and firing of event.
|
pure virtual |
Render a view.
view | [in] the view to render |
|
pure virtual |
Saves the current 3D view to disk as either jpg, bmp or png.
If failing a std::string is thrown with a detailed description of what when wrong.
filename | [in] Path and name of the file. The filename extension should be either ".jpg", ".bmp" or ".png" to specify which format to use. |
fillR | [in] Fill color if viewport is smaller than image, red component [0,255] |
fillG | [in] Fill color if viewport is smaller than image, green component [0,255] |
fillB | [in] Fill color if viewport is smaller than image, blue component [0,255] |
Implemented in SceneOpenGLViewer.
|
pure virtual |
Select a view.
view | [in] the view to select. |
|
inlinevirtual |
set the orientation of the view. The view will look in the positive direction of the z-axis, with x-axis as the width and the y-axis as the height. Origin of view is in the center of the image.
t3d | [in] transform relative to world |
Reimplemented in SceneOpenGLViewer.
|
inlinevirtual |
Set the WorkCell scene.
wcscene | [in] the workcell scene. |
Reimplemented in SceneOpenGLViewer.
|
pure virtual |
|
pure virtual |
|
pure virtual |
Move the camera along its z-axis.
amount | [in] the amount of zoom. |
Implemented in SceneOpenGLViewer.