added instance mode sub-modes

coverity_scan
Marc Zinnschlag 9 years ago
parent e07be2d912
commit c1901069be

@ -9,6 +9,9 @@
#include "../../model/world/idtree.hpp"
#include "../../model/world/commands.hpp"
#include "../widget/scenetoolbar.hpp"
#include "../widget/scenetoolmode.hpp"
#include "elements.hpp"
#include "object.hpp"
#include "worldspacewidget.hpp"
@ -16,9 +19,47 @@
CSVRender::InstanceMode::InstanceMode (WorldspaceWidget *worldspaceWidget, QWidget *parent)
: EditMode (worldspaceWidget, QIcon (":placeholder"), Element_Reference, "Instance editing",
parent)
parent), mSubMode (0)
{
}
void CSVRender::InstanceMode::activate (CSVWidget::SceneToolbar *toolbar)
{
if (!mSubMode)
{
mSubMode = new CSVWidget::SceneToolMode (toolbar, "Edit Sub-Mode");
mSubMode->addButton (":placeholder", "move",
"Move selected instances"
"<ul><li>Use primary edit to move instances around freely</li>"
"<li>Use secondary edit to move instances around within the grid</li>"
"</ul>"
"<font color=Red>Not implemented yet</font color>");
mSubMode->addButton (":placeholder", "rotate",
"Rotate selected instances"
"<ul><li>Use primary edit to rotate instances freely</li>"
"<li>Use secondary edit to rotate instances within the grid</li>"
"</ul>"
"<font color=Red>Not implemented yet</font color>");
mSubMode->addButton (":placeholder", "scale",
"Scale selected instances"
"<ul><li>Use primary edit to scale instances freely</li>"
"<li>Use secondary edit to scale instances along the grid</li>"
"</ul>"
"<font color=Red>Not implemented yet</font color>");
}
EditMode::activate (toolbar);
toolbar->addTool (mSubMode);
}
void CSVRender::InstanceMode::deactivate (CSVWidget::SceneToolbar *toolbar)
{
toolbar->removeTool (mSubMode);
delete mSubMode;
mSubMode = 0;
EditMode::deactivate (toolbar);
}
void CSVRender::InstanceMode::primaryEditPressed (osg::ref_ptr<TagBase> tag)

@ -3,16 +3,26 @@
#include "editmode.hpp"
namespace CSVWidget
{
class SceneToolMode;
}
namespace CSVRender
{
class InstanceMode : public EditMode
{
Q_OBJECT
CSVWidget::SceneToolMode *mSubMode;
public:
InstanceMode (WorldspaceWidget *worldspaceWidget, QWidget *parent = 0);
virtual void activate (CSVWidget::SceneToolbar *toolbar);
virtual void deactivate (CSVWidget::SceneToolbar *toolbar);
virtual void primaryEditPressed (osg::ref_ptr<TagBase> tag);
virtual void secondaryEditPressed (osg::ref_ptr<TagBase> tag);

@ -122,7 +122,7 @@ CSVWidget::SceneToolbar* CSVWorld::SceneSubView::makeToolbar (CSVRender::Worldsp
CSVWidget::SceneToolRun *runTool = widget->makeRunTool (toolbar);
toolbar->addTool (runTool);
toolbar->addTool (widget->makeEditModeSelector (toolbar));
toolbar->addTool (widget->makeEditModeSelector (toolbar), runTool);
return toolbar;
}

Loading…
Cancel
Save