#include "instanceselectionmode.hpp" #include #include #include "worldspacewidget.hpp" bool CSVRender::InstanceSelectionMode::createContextMenu (QMenu *menu) { if (menu) { menu->addAction (mSelectAll); menu->addAction (mDeselectAll); } return true; } CSVRender::InstanceSelectionMode::InstanceSelectionMode (CSVWidget::SceneToolbar *parent, WorldspaceWidget& worldspaceWidget) : CSVWidget::SceneToolMode (parent, "Selection Mode"), mWorldspaceWidget (worldspaceWidget) { addButton (":placeholder", "cube-centre", "Centred cube" "" "Not implemented yet"); addButton (":placeholder", "cube-corner", "Cube corner to corner" "" "Not implemented yet"); addButton (":placeholder", "sphere", "Centred sphere" "" "Not implemented yet"); mSelectAll = new QAction ("Select all Instances", this); mDeselectAll = new QAction ("Clear selection", this); connect (mSelectAll, SIGNAL (triggered ()), this, SLOT (selectAll())); connect (mDeselectAll, SIGNAL (triggered ()), this, SLOT (clearSelection())); } void CSVRender::InstanceSelectionMode::selectAll() { mWorldspaceWidget.selectAll (Mask_Reference); } void CSVRender::InstanceSelectionMode::clearSelection() { mWorldspaceWidget.clearSelection (Mask_Reference); }