|
|
|
@ -9,6 +9,7 @@
|
|
|
|
|
#include <QDropEvent>
|
|
|
|
|
#include <QMouseEvent>
|
|
|
|
|
#include <QKeyEvent>
|
|
|
|
|
#include <QApplication>
|
|
|
|
|
|
|
|
|
|
#include <osgGA/TrackballManipulator>
|
|
|
|
|
#include <osgGA/FirstPersonManipulator>
|
|
|
|
@ -394,6 +395,20 @@ osg::ref_ptr<CSVRender::TagBase> CSVRender::WorldspaceWidget::mousePick (QMouseE
|
|
|
|
|
return osg::ref_ptr<CSVRender::TagBase>();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string CSVRender::WorldspaceWidget::mapButton (QMouseEvent *event)
|
|
|
|
|
{
|
|
|
|
|
std::pair<Qt::MouseButton, bool> phyiscal (
|
|
|
|
|
event->button(), QApplication::keyboardModifiers() & Qt::ControlModifier);
|
|
|
|
|
|
|
|
|
|
std::map<std::pair<Qt::MouseButton, bool>, std::string>::const_iterator iter =
|
|
|
|
|
mButtonMapping.find (phyiscal);
|
|
|
|
|
|
|
|
|
|
if (iter!=mButtonMapping.end())
|
|
|
|
|
return iter->second;
|
|
|
|
|
|
|
|
|
|
return "";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CSVRender::WorldspaceWidget::dropEvent (QDropEvent* event)
|
|
|
|
|
{
|
|
|
|
|
const CSMWorld::TableMimeData* mime = dynamic_cast<const CSMWorld::TableMimeData*> (event->mimeData());
|
|
|
|
@ -480,9 +495,14 @@ void CSVRender::WorldspaceWidget::mouseMoveEvent (QMouseEvent *event)
|
|
|
|
|
|
|
|
|
|
void CSVRender::WorldspaceWidget::mousePressEvent (QMouseEvent *event)
|
|
|
|
|
{
|
|
|
|
|
if (event->button() != Qt::RightButton)
|
|
|
|
|
return;
|
|
|
|
|
std::string button = mapButton (event);
|
|
|
|
|
|
|
|
|
|
if (button=="p-navi" || button=="s-navi")
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else if (button=="p-edit" || button=="s-edit" || button=="select")
|
|
|
|
|
{
|
|
|
|
|
osg::ref_ptr<TagBase> tag = mousePick (event);
|
|
|
|
|
|
|
|
|
|
if (tag)
|
|
|
|
@ -495,6 +515,7 @@ void CSVRender::WorldspaceWidget::mousePressEvent (QMouseEvent *event)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CSVRender::WorldspaceWidget::mouseReleaseEvent (QMouseEvent *event)
|
|
|
|
|
{
|
|
|
|
|