The wrapper widget for RenderWorld. More...

Inheritance diagram for RenderWorldWrapperWidget:

Public Slots

bool isSelfUpdate ()
 return true if the self updating is active
void setSelfUpdate (bool enable)
 enable/disable the self updating features
void updateRenderWorld ()
 Triggers an update of the RenderWorld object.

Public Member Functions

 RenderWorldWrapperWidget (QWidget *parent=NULL, Qt::WindowFlags flags=0)
 Constructor.
virtual ~RenderWorldWrapperWidget ()
 Destructor.
virtual void shareResourcesWith (ResourcesUser *buddy)
 Shares resources with the provided instance of ResourcesUser.
- 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.
void lookAtRobot ()
 Brings the camera in front of the robot.
virtual void resourceChanged (QString resourceName, ResourceChangeType changeType)
 The function called when a resource used here is changed.
- Protected Member Functions inherited from ConcurrentResourcesUser
T * getResource ()
virtual void notifyResourceChange (ResourceHandler *resource, ResourceChangeType changeType)=0
ResourcesUseroperator= (const ResourcesUser &other)
 ResourcesUser ()
 ResourcesUser (const ResourcesUser &other)

Protected Attributes

QVBoxLayout *const m_layout
 The layout for this widget.
RenderWorld *const m_renderWorld
 The object actually rendering the world.
bool m_renderWorldStateRestored
 True if the state of RenderWorld was restored.
wMatrix m_robotTm
 The transformation matrix of the iCub.
QTimer * m_selfUpdateTimer
 Timer used for self update the render world.
bool m_setCameraToLookAtRobot
 True if we have to set camera to look at the robot.
- Protected Attributes inherited from ConcurrentResourcesUser
ResourceCollectionHolder m_resources
- Protected Attributes inherited from ResourcesUser
ResourceCollectionHolder m_resources

Additional Inherited Members

- Public Types inherited from ConcurrentResourcesUser
typedef
Resource::ResourceChangeType 
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

Destructor.

Definition at line 88 of file renderworldwrapperwidget.cpp.

References RenderWorldWrapperWidget::m_selfUpdateTimer.

Member Function Documentation

void customEvent ( QEvent *  event)
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
eventthe received custom event

Definition at line 146 of file renderworldwrapperwidget.cpp.

References RenderWorldWrapperWidget::updateRenderWorld().

bool isSelfUpdate ( )
slot

return true if the self updating is active

Definition at line 123 of file renderworldwrapperwidget.cpp.

References RenderWorldWrapperWidget::m_selfUpdateTimer.

void lookAtRobot ( )
protected
void resourceChanged ( QString  resourceName,
ResourceChangeType  changeType 
)
protectedvirtual

The function called when a resource used here is changed.

Parameters
resourceNamethe name of the resource that has changed.
chageTypethe type of change the resource has gone through (whether it was created, modified or deleted)

Reimplemented from ConcurrentResourcesUser.

Definition at line 127 of file renderworldwrapperwidget.cpp.

References Logger::info(), RenderWorldWrapperWidget::m_renderWorldStateRestored, RenderWorldWrapperWidget::m_robotTm, and RenderWorldWrapperWidget::m_setCameraToLookAtRobot.

void setSelfUpdate ( bool  enable)
slot

enable/disable the self updating features

Definition at line 115 of file renderworldwrapperwidget.cpp.

References RenderWorldWrapperWidget::m_selfUpdateTimer.

void shareResourcesWith ( ResourcesUser buddy)
virtual

Shares resources with the provided instance of ResourcesUser.

We override this function to share resources with the inner RenderWorld object

Parameters
buddythe 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 93 of file renderworldwrapperwidget.cpp.

References RenderWorldWrapperWidget::m_renderWorld, and ConcurrentResourcesUser::shareResourcesWith().

Member Data Documentation

QVBoxLayout* const m_layout
protected

The layout for this widget.

Definition at line 118 of file renderworldwrapperwidget.h.

Referenced by RenderWorldWrapperWidget::RenderWorldWrapperWidget().

bool m_renderWorldStateRestored
protected

True if the state of RenderWorld was restored.

If the state of RenderWorld was not restored when we get the robot transformation matrix, we try to put the camera in front of the robot

Definition at line 126 of file renderworldwrapperwidget.h.

Referenced by RenderWorldWrapperWidget::RenderWorldWrapperWidget(), RenderWorldWrapperWidget::resourceChanged(), and RenderWorldWrapperWidget::updateRenderWorld().

wMatrix m_robotTm
protected

The transformation matrix of the iCub.

This is used to have the camera look at the robot if needed

Definition at line 138 of file renderworldwrapperwidget.h.

Referenced by RenderWorldWrapperWidget::lookAtRobot(), and RenderWorldWrapperWidget::resourceChanged().

bool m_setCameraToLookAtRobot
protected

True if we have to set camera to look at the robot.

Definition at line 131 of file renderworldwrapperwidget.h.

Referenced by RenderWorldWrapperWidget::resourceChanged(), and RenderWorldWrapperWidget::updateRenderWorld().


The documentation for this class was generated from the following files: