|
|
|
@ -1,25 +1,42 @@
|
|
|
|
|
|
|
|
|
|
#include "instancemode.hpp"
|
|
|
|
|
|
|
|
|
|
#include "../../model/settings/usersettings.hpp"
|
|
|
|
|
|
|
|
|
|
#include "elements.hpp"
|
|
|
|
|
#include "object.hpp"
|
|
|
|
|
#include "worldspacewidget.hpp"
|
|
|
|
|
|
|
|
|
|
CSVRender::InstanceMode::InstanceMode (WorldspaceWidget *worldspaceWidget, QWidget *parent)
|
|
|
|
|
: EditMode (worldspaceWidget, QIcon (":placeholder"), Element_Reference, "Instance editing",
|
|
|
|
|
parent)
|
|
|
|
|
parent), mContextSelect (false)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CSVRender::InstanceMode::primaryEditPressed (osg::ref_ptr<TagBase> tag)
|
|
|
|
|
void CSVRender::InstanceMode::activate (CSVWidget::SceneToolbar *toolbar)
|
|
|
|
|
{
|
|
|
|
|
EditMode::activate (toolbar);
|
|
|
|
|
|
|
|
|
|
mContextSelect = CSMSettings::UserSettings::instance().setting ("scene-input/context-select")=="true";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CSVRender::InstanceMode::secondaryEditPressed (osg::ref_ptr<TagBase> tag)
|
|
|
|
|
void CSVRender::InstanceMode::updateUserSetting (const QString& name, const QStringList& value)
|
|
|
|
|
{
|
|
|
|
|
if (name=="scene-input/context-select")
|
|
|
|
|
mContextSelect = value.at (0)=="true";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CSVRender::InstanceMode::primaryEditPressed (osg::ref_ptr<TagBase> tag)
|
|
|
|
|
{
|
|
|
|
|
if (mContextSelect)
|
|
|
|
|
selectPressed (tag);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CSVRender::InstanceMode::secondaryEditPressed (osg::ref_ptr<TagBase> tag)
|
|
|
|
|
{
|
|
|
|
|
if (mContextSelect)
|
|
|
|
|
selectPressed (tag);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CSVRender::InstanceMode::selectPressed (osg::ref_ptr<TagBase> tag)
|
|
|
|
|