The wrapper widget for RenderWorld. More...

Inheritance diagram for RenderWorldWrapperWidget:

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
 
ResourcesUseroperator= (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

Destructor.

Definition at line 83 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 139 of file renderworldwrapperwidget.cpp.

References RenderWorldWrapperWidget::updateRenderWorld().

bool isSelfUpdate ( )
slot

return true if the self updating is active

Definition at line 116 of file renderworldwrapperwidget.cpp.

References RenderWorldWrapperWidget::m_selfUpdateTimer.

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 120 of file renderworldwrapperwidget.cpp.

References Logger::info(), RenderWorldWrapperWidget::m_renderWorld, RenderWorldWrapperWidget::m_robotTm, RenderWorldWrapperWidget::m_setCameraToLookAtRobot, and RenderWorld::viewerStateRestoredFromFile().

void setSelfUpdate ( bool  enable)
slot

enable/disable the self updating features

Definition at line 108 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 88 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().

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 130 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 123 of file renderworldwrapperwidget.h.

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


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