delegated editing and selection functions to mode objects
parent
9bf27c7e37
commit
981a8a2cc2
@ -0,0 +1,35 @@
|
||||
|
||||
#include "instancemode.hpp"
|
||||
|
||||
#include "elements.hpp"
|
||||
#include "object.hpp"
|
||||
|
||||
CSVRender::InstanceMode::InstanceMode (WorldspaceWidget *worldspaceWidget, QWidget *parent)
|
||||
: EditMode (worldspaceWidget, QIcon (":placeholder"), Element_Reference, "Instance editing",
|
||||
parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CSVRender::InstanceMode::primaryEditPressed (osg::ref_ptr<TagBase> tag)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CSVRender::InstanceMode::secondaryEditPressed (osg::ref_ptr<TagBase> tag)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void CSVRender::InstanceMode::selectPressed (osg::ref_ptr<TagBase> tag)
|
||||
{
|
||||
if (tag)
|
||||
{
|
||||
if (CSVRender::ObjectTag *objectTag = dynamic_cast<CSVRender::ObjectTag *> (tag.get()))
|
||||
{
|
||||
// hit an Object, toggle its selection state
|
||||
CSVRender::Object* object = objectTag->mObject;
|
||||
object->setSelected (!object->getSelected());
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
#ifndef CSV_RENDER_INSTANCEMODE_H
|
||||
#define CSV_RENDER_INSTANCEMODE_H
|
||||
|
||||
#include "editmode.hpp"
|
||||
|
||||
namespace CSVRender
|
||||
{
|
||||
class InstanceMode : public EditMode
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
|
||||
InstanceMode (WorldspaceWidget *worldspaceWidget, QWidget *parent = 0);
|
||||
|
||||
virtual void primaryEditPressed (osg::ref_ptr<TagBase> tag);
|
||||
|
||||
virtual void secondaryEditPressed (osg::ref_ptr<TagBase> tag);
|
||||
|
||||
virtual void selectPressed (osg::ref_ptr<TagBase> tag);
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue