OpenMW
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Types | Protected Slots | Protected Member Functions | Private Slots | Private Member Functions | Private Attributes | Friends | List of all members
CSVRender::WorldspaceWidget Class Referenceabstract

#include <worldspacewidget.hpp>

Inheritance diagram for CSVRender::WorldspaceWidget:
Collaboration diagram for CSVRender::WorldspaceWidget:

Public Types

enum  DropType { Type_CellsInterior, Type_CellsExterior, Type_Other, Type_DebugProfile }
 
enum  dropRequirments { canHandle, needPaged, needUnpaged, ignored }
 
enum  InteractionType {
  InteractionType_PrimaryEdit, InteractionType_PrimarySelect, InteractionType_SecondaryEdit, InteractionType_SecondarySelect,
  InteractionType_None
}
 

Public Slots

void abortDrag ()
 
- Public Slots inherited from CSVRender::SceneWidget
void update (double dt)
 

Signals

void closeRequest ()
 
void dataDropped (const std::vector< CSMWorld::UniversalId > &data)
 
- Signals inherited from CSVRender::SceneWidget
void focusToolbarRequest ()
 

Public Member Functions

 WorldspaceWidget (CSMDoc::Document &document, QWidget *parent=0)
 
 ~WorldspaceWidget ()
 
CSVWidget::SceneToolModemakeNavigationSelector (CSVWidget::SceneToolbar *parent)
 
CSVWidget::SceneToolToggle2makeSceneVisibilitySelector (CSVWidget::SceneToolbar *parent)
 
CSVWidget::SceneToolRunmakeRunTool (CSVWidget::SceneToolbar *parent)
 
CSVWidget::SceneToolModemakeEditModeSelector (CSVWidget::SceneToolbar *parent)
 
void selectDefaultNavigationMode ()
 
void centerOrbitCameraOnSelection ()
 
virtual dropRequirments getDropRequirements (DropType type) const
 
virtual void useViewHint (const std::string &hint)
 Default-implementation: ignored. More...
 
virtual bool handleDrop (const std::vector< CSMWorld::UniversalId > &data, DropType type)
 
virtual unsigned int getVisibilityMask () const
 
virtual void setInteractionMask (unsigned int mask)
 
unsigned int getInteractionMask () const
 
virtual void setEditLock (bool locked)
 
CSMDoc::DocumentgetDocument ()
 
virtual void clearSelection (int elementMask)=0
 
virtual void invertSelection (int elementMask)=0
 
virtual void selectAll (int elementMask)=0
 
virtual void selectAllWithSameParentId (int elementMask)=0
 
WorldspaceHitResult mousePick (const QPoint &localPos, unsigned int interactionMask) const
 
virtual std::string getCellId (const osg::Vec3f &point) const =0
 
virtual CellgetCell (const osg::Vec3d &point) const =0
 
virtual std::vector
< osg::ref_ptr< TagBase > > 
getSelection (unsigned int elementMask) const =0
 
virtual std::vector
< osg::ref_ptr< TagBase > > 
getEdited (unsigned int elementMask) const =0
 
virtual void setSubMode (int subMode, unsigned int elementMask)=0
 
virtual void reset (unsigned int elementMask)=0
 Erase all overrides and restore the visual representation to its true state. More...
 
- Public Member Functions inherited from CSVRender::SceneWidget
 SceneWidget (std::shared_ptr< Resource::ResourceSystem > resourceSystem, QWidget *parent=0, Qt::WindowFlags f=0, bool retrieveInput=true)
 
virtual ~SceneWidget ()
 
CSVWidget::SceneToolModemakeLightingSelector (CSVWidget::SceneToolbar *parent)
 
void setDefaultAmbient (const osg::Vec4f &colour)
 
- Public Member Functions inherited from CSVRender::RenderWidget
 RenderWidget (QWidget *parent=0, Qt::WindowFlags f=0)
 
virtual ~RenderWidget ()
 
void flagAsModified ()
 Initiates a request to redraw the view. More...
 
void setVisibilityMask (int mask)
 
osg::Camera * getCamera ()
 

Static Public Member Functions

static DropType getDropType (const std::vector< CSMWorld::UniversalId > &data)
 

Protected Types

enum  ButtonId {
  Button_Reference = 0x1, Button_Pathgrid = 0x2, Button_Water = 0x4, Button_Fog = 0x8,
  Button_Terrain = 0x10
}
 

Protected Slots

void elementSelectionChanged ()
 
- Protected Slots inherited from CSVRender::SceneWidget
void selectNavigationMode (const std::string &mode)
 
- Protected Slots inherited from CSVRender::RenderWidget
void toggleRenderStats ()
 

Protected Member Functions

virtual void addVisibilitySelectorButtons (CSVWidget::SceneToolToggle2 *tool)
 
virtual void addEditModeSelectorButtons (CSVWidget::SceneToolMode *tool)
 
virtual void updateOverlay ()
 
virtual void mouseMoveEvent (QMouseEvent *event)
 
virtual void wheelEvent (QWheelEvent *event)
 
virtual void handleInteractionPress (const WorldspaceHitResult &hit, InteractionType type)
 
virtual void settingChanged (const CSMPrefs::Setting *setting)
 
EditModegetEditMode ()
 
bool getSpeedMode ()
 
- Protected Member Functions inherited from CSVRender::SceneWidget
void setLighting (Lighting *lighting)
 
void setAmbient (const osg::Vec4f &ambient)
 
- Protected Member Functions inherited from CSVRender::RenderWidget
void updateCameraParameters (double overrideAspect=-1.0)
 

Private Slots

virtual void referenceableDataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)=0
 
virtual void referenceableAboutToBeRemoved (const QModelIndex &parent, int start, int end)=0
 
virtual void referenceableAdded (const QModelIndex &index, int start, int end)=0
 
virtual void referenceDataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)=0
 
virtual void referenceAboutToBeRemoved (const QModelIndex &parent, int start, int end)=0
 
virtual void referenceAdded (const QModelIndex &index, int start, int end)=0
 
virtual void pathgridDataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)=0
 
virtual void pathgridAboutToBeRemoved (const QModelIndex &parent, int start, int end)=0
 
virtual void pathgridAdded (const QModelIndex &parent, int start, int end)=0
 
virtual void runRequest (const std::string &profile)
 
void debugProfileDataChanged (const QModelIndex &topLeft, const QModelIndex &bottomRight)
 
void debugProfileAboutToBeRemoved (const QModelIndex &parent, int start, int end)
 
void editModeChanged (const std::string &id)
 
void showToolTip ()
 
void primaryEdit (bool activate)
 
void secondaryEdit (bool activate)
 
void primarySelect (bool activate)
 
void secondarySelect (bool activate)
 
void speedMode (bool activate)
 

Private Member Functions

void dragEnterEvent (QDragEnterEvent *event)
 
void dropEvent (QDropEvent *event)
 
void dragMoveEvent (QDragMoveEvent *event)
 
virtual std::string getStartupInstruction ()=0
 
void handleInteraction (InteractionType type, bool activate)
 

Private Attributes

CSVWidget::SceneToolToggle2mSceneElements
 
CSVWidget::SceneToolRunmRun
 
CSMDoc::DocumentmDocument
 
unsigned int mInteractionMask
 
CSVWidget::SceneToolModemEditMode
 
bool mLocked
 
int mDragMode
 
bool mDragging
 
int mDragX
 
int mDragY
 
bool mSpeedMode
 
double mDragFactor
 
double mDragWheelFactor
 
double mDragShiftFactor
 
QTimer mToolTipDelayTimer
 
QPoint mToolTipPos
 
bool mShowToolTips
 
int mToolTipDelay
 
bool mInConstructor
 

Friends

class MouseState
 

Additional Inherited Members

- Protected Attributes inherited from CSVRender::SceneWidget
std::shared_ptr
< Resource::ResourceSystem
mResourceSystem
 
LightingmLighting
 
osg::Vec4f mDefaultAmbient
 
bool mHasDefaultAmbient
 
LightingDay mLightingDay
 
LightingNight mLightingNight
 
LightingBright mLightingBright
 
int mPrevMouseX
 
int mPrevMouseY
 
bool mCamPositionSet
 Tells update that camera isn't set. More...
 
FreeCameraControllermFreeCamControl
 
OrbitCameraControllermOrbitCamControl
 
CameraControllermCurrentCamControl
 
- Protected Attributes inherited from CSVRender::RenderWidget
osg::ref_ptr< osgViewer::View > mView
 
osg::ref_ptr< osg::Group > mRootNode
 
QTimer mTimer
 

Member Enumeration Documentation

Visual elements in a scene

Note
do not change the enumeration values, they are used in pre-existing button file names!
Enumerator
Button_Reference 
Button_Pathgrid 
Button_Water 
Button_Fog 
Button_Terrain 
Enumerator
canHandle 
needPaged 
needUnpaged 
ignored 
Enumerator
Type_CellsInterior 
Type_CellsExterior 
Type_Other 
Type_DebugProfile 
Enumerator
InteractionType_PrimaryEdit 
InteractionType_PrimarySelect 
InteractionType_SecondaryEdit 
InteractionType_SecondarySelect 
InteractionType_None 

Constructor & Destructor Documentation

CSVRender::WorldspaceWidget::WorldspaceWidget ( CSMDoc::Document document,
QWidget parent = 0 
)

Here is the call graph for this function:

CSVRender::WorldspaceWidget::~WorldspaceWidget ( )

Member Function Documentation

void CSVRender::WorldspaceWidget::abortDrag ( )
slot
Note
Drags will be automatically aborted when the aborting is triggered (either explicitly or implicitly) from within this class. This function only needs to be called, when the drag abort is triggered externally (e.g. from an edit mode).

Here is the call graph for this function:

Here is the caller graph for this function:

void CSVRender::WorldspaceWidget::addEditModeSelectorButtons ( CSVWidget::SceneToolMode tool)
protectedvirtual
Todo:
replace EditMode with suitable subclasses

Reimplemented in CSVRender::PagedWorldspaceWidget.

Here is the call graph for this function:

Here is the caller graph for this function:

void CSVRender::WorldspaceWidget::addVisibilitySelectorButtons ( CSVWidget::SceneToolToggle2 tool)
protectedvirtual

Reimplemented in CSVRender::PagedWorldspaceWidget, and CSVRender::UnpagedWorldspaceWidget.

Here is the call graph for this function:

Here is the caller graph for this function:

void CSVRender::WorldspaceWidget::centerOrbitCameraOnSelection ( )

Here is the caller graph for this function:

virtual void CSVRender::WorldspaceWidget::clearSelection ( int  elementMask)
pure virtual
Parameters
elementMaskElements to be affected by the clear operation

Implemented in CSVRender::PagedWorldspaceWidget, and CSVRender::UnpagedWorldspaceWidget.

Here is the caller graph for this function:

void CSVRender::WorldspaceWidget::closeRequest ( )
signal
void CSVRender::WorldspaceWidget::dataDropped ( const std::vector< CSMWorld::UniversalId > &  data)
signal
void CSVRender::WorldspaceWidget::debugProfileAboutToBeRemoved ( const QModelIndex &  parent,
int  start,
int  end 
)
privateslot

Here is the call graph for this function:

Here is the caller graph for this function:

void CSVRender::WorldspaceWidget::debugProfileDataChanged ( const QModelIndex &  topLeft,
const QModelIndex &  bottomRight 
)
privateslot

Here is the call graph for this function:

Here is the caller graph for this function:

void CSVRender::WorldspaceWidget::dragEnterEvent ( QDragEnterEvent *  event)
private

Here is the call graph for this function:

void CSVRender::WorldspaceWidget::dragMoveEvent ( QDragMoveEvent *  event)
private

Here is the call graph for this function:

void CSVRender::WorldspaceWidget::dropEvent ( QDropEvent *  event)
private

Here is the call graph for this function:

void CSVRender::WorldspaceWidget::editModeChanged ( const std::string &  id)
privateslot
void CSVRender::WorldspaceWidget::elementSelectionChanged ( )
protectedslot
virtual Cell* CSVRender::WorldspaceWidget::getCell ( const osg::Vec3d &  point) const
pure virtual
Note
Returns the cell if it exists, otherwise a null pointer

Implemented in CSVRender::PagedWorldspaceWidget, and CSVRender::UnpagedWorldspaceWidget.

Here is the caller graph for this function:

virtual std::string CSVRender::WorldspaceWidget::getCellId ( const osg::Vec3f &  point) const
pure virtual
CSMDoc::Document & CSVRender::WorldspaceWidget::getDocument ( )

Here is the caller graph for this function:

CSVRender::WorldspaceWidget::dropRequirments CSVRender::WorldspaceWidget::getDropRequirements ( DropType  type) const
virtual

Reimplemented in CSVRender::PagedWorldspaceWidget, and CSVRender::UnpagedWorldspaceWidget.

Here is the caller graph for this function:

CSVRender::WorldspaceWidget::DropType CSVRender::WorldspaceWidget::getDropType ( const std::vector< CSMWorld::UniversalId > &  data)
static

Here is the caller graph for this function:

virtual std::vector<osg::ref_ptr<TagBase> > CSVRender::WorldspaceWidget::getEdited ( unsigned int  elementMask) const
pure virtual
CSVRender::EditMode * CSVRender::WorldspaceWidget::getEditMode ( )
protected
unsigned int CSVRender::WorldspaceWidget::getInteractionMask ( ) const
Note
This function will only return those elements that are both visible and marked for interaction.
virtual std::vector<osg::ref_ptr<TagBase> > CSVRender::WorldspaceWidget::getSelection ( unsigned int  elementMask) const
pure virtual

Implemented in CSVRender::PagedWorldspaceWidget, and CSVRender::UnpagedWorldspaceWidget.

Here is the caller graph for this function:

bool CSVRender::WorldspaceWidget::getSpeedMode ( )
protected
virtual std::string CSVRender::WorldspaceWidget::getStartupInstruction ( )
privatepure virtual
unsigned int CSVRender::WorldspaceWidget::getVisibilityMask ( ) const
virtual

Reimplemented in CSVRender::PagedWorldspaceWidget.

Here is the caller graph for this function:

bool CSVRender::WorldspaceWidget::handleDrop ( const std::vector< CSMWorld::UniversalId > &  data,
DropType  type 
)
virtual
Returns
Drop handled?

Reimplemented in CSVRender::PagedWorldspaceWidget, and CSVRender::UnpagedWorldspaceWidget.

Here is the caller graph for this function:

void CSVRender::WorldspaceWidget::handleInteraction ( InteractionType  type,
bool  activate 
)
private

Here is the call graph for this function:

void CSVRender::WorldspaceWidget::handleInteractionPress ( const WorldspaceHitResult hit,
InteractionType  type 
)
protectedvirtual

Reimplemented in CSVRender::PagedWorldspaceWidget.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void CSVRender::WorldspaceWidget::invertSelection ( int  elementMask)
pure virtual
Parameters
elementMaskElements to be affected by the select operation

Implemented in CSVRender::PagedWorldspaceWidget, and CSVRender::UnpagedWorldspaceWidget.

Here is the caller graph for this function:

CSVWidget::SceneToolMode * CSVRender::WorldspaceWidget::makeEditModeSelector ( CSVWidget::SceneToolbar parent)
Attention
The created tool is not added to the toolbar (via addTool). Doing that is the responsibility of the calling function.

Here is the caller graph for this function:

CSVWidget::SceneToolMode * CSVRender::WorldspaceWidget::makeNavigationSelector ( CSVWidget::SceneToolbar parent)
Attention
The created tool is not added to the toolbar (via addTool). Doing that is the responsibility of the calling function.
Todo:
replace icons
Todo:
consider user-defined button-mapping

Here is the call graph for this function:

Here is the caller graph for this function:

CSVWidget::SceneToolRun * CSVRender::WorldspaceWidget::makeRunTool ( CSVWidget::SceneToolbar parent)
Attention
The created tool is not added to the toolbar (via addTool). Doing that is the responsibility of the calling function.

Here is the call graph for this function:

Here is the caller graph for this function:

CSVWidget::SceneToolToggle2 * CSVRender::WorldspaceWidget::makeSceneVisibilitySelector ( CSVWidget::SceneToolbar parent)
Attention
The created tool is not added to the toolbar (via addTool). Doing that is the responsibility of the calling function.

Here is the caller graph for this function:

void CSVRender::WorldspaceWidget::mouseMoveEvent ( QMouseEvent *  event)
protectedvirtual

Reimplemented from CSVRender::SceneWidget.

Here is the call graph for this function:

CSVRender::WorldspaceHitResult CSVRender::WorldspaceWidget::mousePick ( const QPoint &  localPos,
unsigned int  interactionMask 
) const

Return the next intersection with scene elements matched by interactionMask based on localPos and the camera vector. If there is no such intersection, instead a point "in front" of localPos will be returned.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual void CSVRender::WorldspaceWidget::pathgridAboutToBeRemoved ( const QModelIndex &  parent,
int  start,
int  end 
)
privatepure virtualslot

Implemented in CSVRender::UnpagedWorldspaceWidget, and CSVRender::PagedWorldspaceWidget.

Here is the caller graph for this function:

virtual void CSVRender::WorldspaceWidget::pathgridAdded ( const QModelIndex &  parent,
int  start,
int  end 
)
privatepure virtualslot

Implemented in CSVRender::UnpagedWorldspaceWidget, and CSVRender::PagedWorldspaceWidget.

Here is the caller graph for this function:

virtual void CSVRender::WorldspaceWidget::pathgridDataChanged ( const QModelIndex &  topLeft,
const QModelIndex &  bottomRight 
)
privatepure virtualslot

Implemented in CSVRender::UnpagedWorldspaceWidget, and CSVRender::PagedWorldspaceWidget.

Here is the caller graph for this function:

void CSVRender::WorldspaceWidget::primaryEdit ( bool  activate)
privateslot

Here is the caller graph for this function:

void CSVRender::WorldspaceWidget::primarySelect ( bool  activate)
privateslot

Here is the caller graph for this function:

virtual void CSVRender::WorldspaceWidget::referenceableAboutToBeRemoved ( const QModelIndex &  parent,
int  start,
int  end 
)
privatepure virtualslot

Implemented in CSVRender::UnpagedWorldspaceWidget, and CSVRender::PagedWorldspaceWidget.

Here is the caller graph for this function:

virtual void CSVRender::WorldspaceWidget::referenceableAdded ( const QModelIndex &  index,
int  start,
int  end 
)
privatepure virtualslot

Implemented in CSVRender::UnpagedWorldspaceWidget, and CSVRender::PagedWorldspaceWidget.

Here is the caller graph for this function:

virtual void CSVRender::WorldspaceWidget::referenceableDataChanged ( const QModelIndex &  topLeft,
const QModelIndex &  bottomRight 
)
privatepure virtualslot

Implemented in CSVRender::UnpagedWorldspaceWidget, and CSVRender::PagedWorldspaceWidget.

Here is the caller graph for this function:

virtual void CSVRender::WorldspaceWidget::referenceAboutToBeRemoved ( const QModelIndex &  parent,
int  start,
int  end 
)
privatepure virtualslot

Implemented in CSVRender::UnpagedWorldspaceWidget, and CSVRender::PagedWorldspaceWidget.

Here is the caller graph for this function:

virtual void CSVRender::WorldspaceWidget::referenceAdded ( const QModelIndex &  index,
int  start,
int  end 
)
privatepure virtualslot

Implemented in CSVRender::UnpagedWorldspaceWidget, and CSVRender::PagedWorldspaceWidget.

Here is the caller graph for this function:

virtual void CSVRender::WorldspaceWidget::referenceDataChanged ( const QModelIndex &  topLeft,
const QModelIndex &  bottomRight 
)
privatepure virtualslot

Implemented in CSVRender::UnpagedWorldspaceWidget, and CSVRender::PagedWorldspaceWidget.

Here is the caller graph for this function:

virtual void CSVRender::WorldspaceWidget::reset ( unsigned int  elementMask)
pure virtual

Erase all overrides and restore the visual representation to its true state.

Implemented in CSVRender::PagedWorldspaceWidget, and CSVRender::UnpagedWorldspaceWidget.

Here is the caller graph for this function:

void CSVRender::WorldspaceWidget::runRequest ( const std::string &  profile)
privatevirtualslot
void CSVRender::WorldspaceWidget::secondaryEdit ( bool  activate)
privateslot

Here is the caller graph for this function:

void CSVRender::WorldspaceWidget::secondarySelect ( bool  activate)
privateslot

Here is the caller graph for this function:

virtual void CSVRender::WorldspaceWidget::selectAll ( int  elementMask)
pure virtual
Parameters
elementMaskElements to be affected by the select operation

Implemented in CSVRender::PagedWorldspaceWidget, and CSVRender::UnpagedWorldspaceWidget.

Here is the caller graph for this function:

virtual void CSVRender::WorldspaceWidget::selectAllWithSameParentId ( int  elementMask)
pure virtual
Parameters
elementMaskElements to be affected by the select operation

Implemented in CSVRender::PagedWorldspaceWidget, and CSVRender::UnpagedWorldspaceWidget.

Here is the caller graph for this function:

void CSVRender::WorldspaceWidget::selectDefaultNavigationMode ( )
void CSVRender::WorldspaceWidget::setEditLock ( bool  locked)
virtual
void CSVRender::WorldspaceWidget::setInteractionMask ( unsigned int  mask)
virtual
Note
This function will implicitly add elements that are independent of the selected edit mode.
virtual void CSVRender::WorldspaceWidget::setSubMode ( int  subMode,
unsigned int  elementMask 
)
pure virtual
void CSVRender::WorldspaceWidget::settingChanged ( const CSMPrefs::Setting setting)
protectedvirtual

Reimplemented from CSVRender::SceneWidget.

Here is the call graph for this function:

void CSVRender::WorldspaceWidget::showToolTip ( )
privateslot

Here is the call graph for this function:

Here is the caller graph for this function:

void CSVRender::WorldspaceWidget::speedMode ( bool  activate)
privateslot

Here is the caller graph for this function:

void CSVRender::WorldspaceWidget::updateOverlay ( )
protectedvirtual
void CSVRender::WorldspaceWidget::useViewHint ( const std::string &  hint)
virtual

Default-implementation: ignored.

Reimplemented in CSVRender::PagedWorldspaceWidget.

void CSVRender::WorldspaceWidget::wheelEvent ( QWheelEvent *  event)
protectedvirtual

Reimplemented from CSVRender::SceneWidget.

Here is the call graph for this function:

Friends And Related Function Documentation

friend class MouseState
friend

Member Data Documentation

CSMDoc::Document& CSVRender::WorldspaceWidget::mDocument
private
double CSVRender::WorldspaceWidget::mDragFactor
private
bool CSVRender::WorldspaceWidget::mDragging
private
int CSVRender::WorldspaceWidget::mDragMode
private
double CSVRender::WorldspaceWidget::mDragShiftFactor
private
double CSVRender::WorldspaceWidget::mDragWheelFactor
private
int CSVRender::WorldspaceWidget::mDragX
private
int CSVRender::WorldspaceWidget::mDragY
private
CSVWidget::SceneToolMode* CSVRender::WorldspaceWidget::mEditMode
private
bool CSVRender::WorldspaceWidget::mInConstructor
private
unsigned int CSVRender::WorldspaceWidget::mInteractionMask
private
bool CSVRender::WorldspaceWidget::mLocked
private
CSVWidget::SceneToolRun* CSVRender::WorldspaceWidget::mRun
private
CSVWidget::SceneToolToggle2* CSVRender::WorldspaceWidget::mSceneElements
private
bool CSVRender::WorldspaceWidget::mShowToolTips
private
bool CSVRender::WorldspaceWidget::mSpeedMode
private
int CSVRender::WorldspaceWidget::mToolTipDelay
private
QTimer CSVRender::WorldspaceWidget::mToolTipDelayTimer
private
QPoint CSVRender::WorldspaceWidget::mToolTipPos
private

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