The wrapper widget for RenderWorld. More...
Public Slots | |
bool | isSelfUpdate () |
return true if the self updating is active More... | |
void | setSelfUpdate (bool enable) |
enable/disable the self updating features More... | |
void | updateRenderWorld () |
Triggers an update of the RenderWorld object. More... | |
Public Member Functions | |
RenderWorldWrapperWidget (QWidget *parent=NULL, Qt::WindowFlags flags=0) | |
Constructor. More... | |
virtual | ~RenderWorldWrapperWidget () |
Destructor. More... | |
virtual void | shareResourcesWith (ResourcesUser *buddy) |
Shares resources with the provided instance of ResourcesUser. More... | |
Public Member Functions inherited from ConcurrentResourcesUser | |
void | addUsableResource (QString resource) |
void | addUsableResources (QStringList resources) |
void | declareResource (QString name, T *resource, QString lockBuddy="") |
void | deleteResource (QString name) |
T * | getResource (QString name, bool *resourceExists=NULL) |
bool | hasResource (QString name) const |
void | removeAllUsableResources () |
void | removeUsableResource (QString resource) |
void | removeUsableResources (QStringList resources) |
void | usableResources (QStringList resources) |
bool | usedResourcesExist (QStringList *nonExistingResources=NULL) const |
Protected Member Functions | |
virtual void | customEvent (QEvent *event) |
The function that receives custom events. More... | |
void | lookAtRobot () |
Brings the camera in front of the robot. More... | |
virtual void | resourceChanged (QString resourceName, ResourceChangeType changeType) |
The function called when a resource used here is changed. More... | |
Protected Member Functions inherited from ConcurrentResourcesUser | |
T * | getResource () |
Protected Member Functions inherited from ResourcesUser | |
ResourcesUser (const ResourcesUser &other) | |
virtual void | notifyResourceChange (ResourceHandler *resource, ResourceChangeType changeType)=0 |
ResourcesUser & | operator= (const ResourcesUser &other) |
Protected Attributes | |
QVBoxLayout *const | m_layout |
The layout for this widget. More... | |
RenderWorld *const | m_renderWorld |
The object actually rendering the world. More... | |
wMatrix | m_robotTm |
The transformation matrix of the iCub. More... | |
QTimer * | m_selfUpdateTimer |
Timer used for self update the render world. More... | |
bool | m_setCameraToLookAtRobot |
True if we have to set camera to look at the robot. More... | |
Protected Attributes inherited from ResourcesUser | |
ResourceCollectionHolder | m_resources |
Additional Inherited Members | |
Public Types inherited from ResourcesUser | |
typedef Resource::ResourceChangeType | ResourceChangeType |
Public Types inherited from Resource | |
enum | ResourceChangeType |
Detailed Description
The wrapper widget for RenderWorld.
This widget contains RenderWorld. Renderworld has to be wrapped inside a QWidget, because it is not possible to set the flags as required by Total99 directly on the RenderWorld object. If you try to do this, it will crash on some windows machines :-S
Definition at line 47 of file renderworldwrapperwidget.h.
Constructor & Destructor Documentation
RenderWorldWrapperWidget | ( | QWidget * | parent = NULL , |
Qt::WindowFlags | flags = 0 |
||
) |
Constructor.
- Parameters
-
parent the parent widget flags window flags
Definition at line 57 of file renderworldwrapperwidget.cpp.
References RenderWorldWrapperWidget::m_layout, RenderWorldWrapperWidget::m_renderWorld, RenderWorldWrapperWidget::m_selfUpdateTimer, QGLViewer::setStateFileName(), RenderWorldWrapperWidget::updateRenderWorld(), and ConcurrentResourcesUser::usableResources().
|
virtual |
Destructor.
Definition at line 83 of file renderworldwrapperwidget.cpp.
References RenderWorldWrapperWidget::m_selfUpdateTimer.
Member Function Documentation
|
protectedvirtual |
The function that receives custom events.
This function is used to receive an internal type of event that forces the update of RenderWorld. This is needed because resourceChanged is called in another thread
- Parameters
-
event the received custom event
Definition at line 139 of file renderworldwrapperwidget.cpp.
References RenderWorldWrapperWidget::updateRenderWorld().
|
slot |
return true if the self updating is active
Definition at line 116 of file renderworldwrapperwidget.cpp.
References RenderWorldWrapperWidget::m_selfUpdateTimer.
|
protected |
Brings the camera in front of the robot.
Definition at line 147 of file renderworldwrapperwidget.cpp.
References QGLViewer::camera(), Camera::lookAt(), RenderWorldWrapperWidget::m_renderWorld, RenderWorldWrapperWidget::m_robotTm, Camera::setPosition(), Camera::setUpVector(), and wMatrix::transformVector().
Referenced by RenderWorldWrapperWidget::updateRenderWorld().
|
protectedvirtual |
The function called when a resource used here is changed.
- Parameters
-
resourceName the name of the resource that has changed. chageType the type of change the resource has gone through (whether it was created, modified or deleted)
Reimplemented from ConcurrentResourcesUser.
Definition at line 120 of file renderworldwrapperwidget.cpp.
References Logger::info(), RenderWorldWrapperWidget::m_renderWorld, RenderWorldWrapperWidget::m_robotTm, RenderWorldWrapperWidget::m_setCameraToLookAtRobot, and RenderWorld::viewerStateRestoredFromFile().
|
slot |
enable/disable the self updating features
Definition at line 108 of file renderworldwrapperwidget.cpp.
References RenderWorldWrapperWidget::m_selfUpdateTimer.
|
virtual |
Shares resources with the provided instance of ResourcesUser.
We override this function to share resources with the inner RenderWorld object
- Parameters
-
buddy the instance with which resources will be shared
- Note
- This is NOT thread safe (both this and the other instance should not be being accessed by other threads). Moreover do not call this while holding the lock to resources
Reimplemented from ConcurrentResourcesUser.
Definition at line 88 of file renderworldwrapperwidget.cpp.
References RenderWorldWrapperWidget::m_renderWorld, and ConcurrentResourcesUser::shareResourcesWith().
|
slot |
Triggers an update of the RenderWorld object.
Definition at line 97 of file renderworldwrapperwidget.cpp.
References RenderWorldWrapperWidget::lookAtRobot(), RenderWorldWrapperWidget::m_renderWorld, RenderWorldWrapperWidget::m_setCameraToLookAtRobot, and RenderWorld::viewerStateRestoredFromFile().
Referenced by RenderWorldWrapperWidget::customEvent(), and RenderWorldWrapperWidget::RenderWorldWrapperWidget().
Member Data Documentation
|
protected |
The layout for this widget.
Definition at line 118 of file renderworldwrapperwidget.h.
Referenced by RenderWorldWrapperWidget::RenderWorldWrapperWidget().
|
protected |
The object actually rendering the world.
Definition at line 113 of file renderworldwrapperwidget.h.
Referenced by RenderWorldWrapperWidget::lookAtRobot(), RenderWorldWrapperWidget::RenderWorldWrapperWidget(), RenderWorldWrapperWidget::resourceChanged(), RenderWorldWrapperWidget::shareResourcesWith(), and RenderWorldWrapperWidget::updateRenderWorld().
|
protected |
The transformation matrix of the iCub.
This is used to have the camera look at the robot if needed
Definition at line 130 of file renderworldwrapperwidget.h.
Referenced by RenderWorldWrapperWidget::lookAtRobot(), and RenderWorldWrapperWidget::resourceChanged().
|
protected |
Timer used for self update the render world.
Definition at line 133 of file renderworldwrapperwidget.h.
Referenced by RenderWorldWrapperWidget::isSelfUpdate(), RenderWorldWrapperWidget::RenderWorldWrapperWidget(), RenderWorldWrapperWidget::setSelfUpdate(), and RenderWorldWrapperWidget::~RenderWorldWrapperWidget().
|
protected |
True if we have to set camera to look at the robot.
Definition at line 123 of file renderworldwrapperwidget.h.
Referenced by RenderWorldWrapperWidget::resourceChanged(), and RenderWorldWrapperWidget::updateRenderWorld().
The documentation for this class was generated from the following files:
- experiments/include/renderworldwrapperwidget.h
- experiments/src/renderworldwrapperwidget.cpp