50 #include "SelectionBasePlugin.hh" 55 #define TOGGLE_IMG "selection_toggle.png" 56 #define LASSO_IMG "selection_lasso.png" 57 #define VOLUME_LASSO_IMG "selection_lasso2.png" 58 #define SURFACE_LASSO_IMG "surface-lasso.png" 59 #define SPHERE_IMG "selection_paintSphere.png" 60 #define BOUNDARY_IMG "selection_boundary.png" 61 #define FLOODFILL_IMG "selection_floodFill.png" 62 #define COMPONENTS_IMG "selection_connected.png" 65 #define TOGGLE_DESC "Toggle Selection" 66 #define LASSO_DESC "Lasso Selection" 67 #define VOLUME_LASSO_DESC "Volume Lasso Selection" 68 #define SURFACE_LASSO_DESC "Surface Lasso Selection" 69 #define SPHERE_DESC "Sphere Selection" 70 #define BOUNDARY_DESC "Boundary Selection" 71 #define FLOODFILL_DESC "Floodfill Selection" 72 #define COMPONENTS_DESC "Selected Components Selection" 75 #define SB_TOGGLE "sb_toggle" 76 #define SB_LASSO "sb_lasso" 77 #define SB_VOLUME_LASSO "sb_volumelasso" 78 #define SB_SURFACE_LASSO "sb_surfacelasso" 79 #define SB_SPHERE "sb_sphere" 80 #define SB_BOUNDARY "sb_closestboundary" 81 #define SB_FLOODFILL "sb_floodfill" 82 #define SB_COMPONENTS "sb_components" 85 #define NO_SELECTION_PICKING "No_Selection_Picking" 86 #define NO_SELECTION_MODE "No_Selection_Mode" 88 #define SELECTION_PICKING "SelectionBasePicking" 94 primitivesBarGroup_(0),
96 selectionModesGroup_(0),
97 toggleSelectionAction_(0),
98 lassoSelectionAction_(0),
99 volumeLassoSelectionAction_(0),
100 surfaceLassoSelectionAction_(0),
101 sphereSelectionAction_(0),
102 boundarySelectionAction_(0),
103 floodFillSelectionAction_(0),
104 componentsSelectionAction_(0),
105 currentPickMode_(NO_SELECTION_PICKING),
106 lastPickMode_(NO_SELECTION_PICKING),
107 currentSelectionMode_(NO_SELECTION_MODE),
108 currentPrimitiveType_(0u),
109 nextFreePrimitiveType_(1u),
115 lassoSelection_(false),
117 availableObjectTypes_(0u)
124 void SelectionBasePlugin::initializePlugin() {
127 if (OpenFlipper::Options::nogui())
132 QSize size(300, 300);
136 connect(tool_->loadSelection, SIGNAL(clicked()),
this, SLOT(slotLoadSelectionButton()));
137 connect(tool_->saveSelection, SIGNAL(clicked()),
this, SLOT(slotSaveSelectionButton()));
140 toolIcon_ =
new QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+
"selection_base.png");
141 emit addToolbox(
"Selections", tool_, toolIcon_ );
144 toolBar_ =
new QToolBar(tr(
"Selection Base"));
145 emit addToolbar(toolBar_);
147 QString iconPath = OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator();
148 QAction* selectionEnvironmentButton =
new QAction(QIcon(iconPath +
"selection_base.png"),
"Selections", toolBar_);
149 toolBar_->addAction(selectionEnvironmentButton);
152 connect(selectionEnvironmentButton, SIGNAL(triggered(
bool)),
this, SLOT(slotSelectionEnvironmentRequested(
bool)));
155 emit registerKey(Qt::Key_Control, Qt::NoModifier, tr(
"Deselection"),
true);
156 emit registerKey(Qt::Key_Control, Qt::ControlModifier, tr(
"Deselection"),
true);
158 emit registerKey(Qt::Key_Shift, Qt::NoModifier, tr(
"Source/Target Selection"),
true);
159 emit registerKey(Qt::Key_Shift, Qt::ShiftModifier, tr(
"Source/Target Selection"),
true);
162 emit addPickMode(SELECTION_PICKING);
164 emit setPickModeMouseTracking(SELECTION_PICKING,
true);
167 tool_->typeTabWidget->setMovable(
true);
170 pickModeToolBar_ =
new QToolBar(
"Selection Picking Toolbar");
171 pickModeToolBar_->setObjectName(
"Selection_Picking_Toolbar");
174 primitivesBarGroup_ =
new QActionGroup(pickModeToolBar_);
175 primitivesBarGroup_->setExclusive(
true);
179 selectionModesGroup_ =
new QActionGroup(pickModeToolBar_);
180 selectionModesGroup_->setExclusive(
true);
181 toggleSelectionAction_ =
new HandleAction(QIcon(iconPath + TOGGLE_IMG), TOGGLE_DESC, selectionModesGroup_);
182 toggleSelectionAction_->setCheckable(
true);
184 connect(toggleSelectionAction_, SIGNAL(triggered(
bool)),
this, SLOT(slotEnterSelectionMode(
bool)));
185 lassoSelectionAction_ =
new HandleAction(QIcon(iconPath + LASSO_IMG), LASSO_DESC, selectionModesGroup_);
186 lassoSelectionAction_->setCheckable(
true);
188 connect(lassoSelectionAction_, SIGNAL(triggered(
bool)),
this, SLOT(slotEnterSelectionMode(
bool)));
189 volumeLassoSelectionAction_ =
new HandleAction(QIcon(iconPath + VOLUME_LASSO_IMG), VOLUME_LASSO_DESC, selectionModesGroup_);
190 volumeLassoSelectionAction_->setCheckable(
true);
192 connect(volumeLassoSelectionAction_, SIGNAL(triggered(
bool)),
this, SLOT(slotEnterSelectionMode(
bool)));
193 surfaceLassoSelectionAction_ =
new HandleAction(QIcon(iconPath + SURFACE_LASSO_IMG), SURFACE_LASSO_DESC, selectionModesGroup_);
194 surfaceLassoSelectionAction_->setCheckable(
true);
196 connect(surfaceLassoSelectionAction_, SIGNAL(triggered(
bool)),
this, SLOT(slotEnterSelectionMode(
bool)));
197 sphereSelectionAction_ =
new HandleAction(QIcon(iconPath + SPHERE_IMG), SPHERE_DESC, selectionModesGroup_);
198 sphereSelectionAction_->setCheckable(
true);
200 connect(sphereSelectionAction_, SIGNAL(triggered(
bool)),
this, SLOT(slotEnterSelectionMode(
bool)));
201 boundarySelectionAction_ =
new HandleAction(QIcon(iconPath + BOUNDARY_IMG), BOUNDARY_DESC, selectionModesGroup_);
202 boundarySelectionAction_->setCheckable(
true);
204 connect(boundarySelectionAction_, SIGNAL(triggered(
bool)),
this, SLOT(slotEnterSelectionMode(
bool)));
205 floodFillSelectionAction_ =
new HandleAction(QIcon(iconPath + FLOODFILL_IMG), FLOODFILL_DESC, selectionModesGroup_);
206 floodFillSelectionAction_->setCheckable(
true);
208 connect(floodFillSelectionAction_, SIGNAL(triggered(
bool)),
this, SLOT(slotEnterSelectionMode(
bool)));
209 componentsSelectionAction_ =
new HandleAction(QIcon(iconPath + COMPONENTS_IMG), COMPONENTS_DESC, selectionModesGroup_);
210 componentsSelectionAction_->setCheckable(
true);
212 connect(componentsSelectionAction_, SIGNAL(triggered(
bool)),
this, SLOT(slotEnterSelectionMode(
bool)));
214 pickModeToolBar_->clear();
215 pickModeToolBar_->addActions(primitivesBarGroup_->actions());
216 pickModeToolBar_->addSeparator();
217 pickModeToolBar_->addActions(selectionModesGroup_->actions());
219 #if defined(ARCH_DARWIN) 223 pickModeToolBar_->setWindowOpacity(0.99);
226 emit setPickModeToolbar(SELECTION_PICKING, pickModeToolBar_);
231 void SelectionBasePlugin::pluginsInitialized() {
238 std::string nodeName = std::string( tr(
"Selection Base Plugin: Selection Sphere Material").toUtf8() );
251 nodeName = std::string( tr(
"Selection Base Plugin: Selection Sphere").toUtf8() );
255 sphere_node_->
hide();
259 nodeName = std::string( tr(
"Selection Base Plugin: Lasso Selection Line").toUtf8() );
277 _env.primitivesBar =
new QHBoxLayout(tab->toolPrimitivesBar);
280 _env.operationsBar =
new QVBoxLayout(tab->toolOperationsWidget);
283 policy.setVerticalPolicy(QSizePolicy::MinimumExpanding);
284 policy.setHorizontalPolicy(QSizePolicy::Preferred);
285 tab->selectionGroup->setSizePolicy(policy);
287 tab->toolPrimitivesBar->setLayout(_env.primitivesBar);
288 tab->toolPrimitivesBar->setMinimumHeight(68);
289 tab->toolOperationsWidget->setLayout(_env.operationsBar);
290 tab->toolOperationsWidget->setMinimumHeight(150);
292 _env.primitiveActions =
new QActionGroup(0);
293 _env.primitiveActions->setExclusive(
true);
300 void SelectionBasePlugin::slotLoadSelectionButton() {
303 QString filename = QFileDialog::getOpenFileName(0, tr(
"Load Selection"),
"selection.ini", tr(
"Selection files ( *.ini )"));
305 if(filename.length() > 0) {
309 if(!file.
connect(filename,
false)) {
310 emit log(
LOGERR, QString(
"Could not read file '%1'!").arg(filename));
315 emit loadSelection(file);
324 void SelectionBasePlugin::slotSaveSelectionButton() {
327 QString filename = QFileDialog::getSaveFileName(0, tr(
"Save Selection"),
"selection.ini", tr(
"Selection files ( *.ini )"));
329 if(filename.length() > 0) {
333 if(!file.
connect(filename,
true)) {
334 emit log(
LOGERR, QString(
"Could not create file '%1'!").arg(filename));
339 emit saveSelection(file);
348 void SelectionBasePlugin::slotKeyEvent(QKeyEvent* _event) {
351 if ((_event->modifiers() & Qt::ControlModifier) || (_event->key() == Qt::Key_Control)) {
353 primitivesBarGroup_->setExclusive(
false);
355 deselection_ =
false;
356 primitivesBarGroup_->setExclusive(
true);
360 if ((_event->modifiers() & Qt::ShiftModifier) || (_event->key() == Qt::Key_Shift))
361 tool_->restrictOnTargets->setChecked(
true);
363 tool_->restrictOnTargets->setChecked(
false);
370 std::set<std::pair<int,Qt::KeyboardModifiers> >::iterator f =
371 registeredKeys_.find(std::pair<int,Qt::KeyboardModifiers>(_event->key(), _event->modifiers()));
373 if(f != registeredKeys_.end()) {
375 emit keyShortcutEvent((*f).first,(*f).second);
381 void SelectionBasePlugin::slotKeyReleaseEvent(QKeyEvent* _event) {
384 if ((_event->modifiers() & Qt::ControlModifier) || (_event->key() == Qt::Key_Control)) {
385 deselection_ =
false;
386 primitivesBarGroup_->setExclusive(
true);
390 if ((_event->modifiers() & Qt::ShiftModifier) || (_event->key() == Qt::Key_Shift))
391 tool_->restrictOnTargets->setChecked(
false);
396 void SelectionBasePlugin::loadIniFileOptionsLast(
INIFile &_ini)
398 emit loadSelection(_ini);
403 void SelectionBasePlugin::slotAddSelectionEnvironment(QString _modeName, QString _description, QString _icon, QString& _handleName) {
410 std::map<QString,SelectionEnvironment>::iterator it =
411 selectionEnvironments_.begin();
413 for(; it != selectionEnvironments_.end(); ++it) {
414 if(_modeName == (*it).second.name) {
415 emit log(
LOGINFO, QString(
"Selection environment %1 already exists.").arg(_modeName));
422 env.name = _modeName;
426 if ( OpenFlipper::Options::gui() ) {
429 int index = tool_->typeTabWidget->addTab(tab, QIcon(_icon), _modeName);
430 env.tabWidget = tool_->typeTabWidget->widget(index);
434 tool_->typeTabWidget->setTabEnabled(index,
false);
435 tool_->typeTabWidget->widget(index)->setEnabled(
false);
443 env.handle = _handleName;
449 selectionEnvironments_.insert(std::pair<QString,SelectionEnvironment>(_handleName, env));
454 void SelectionBasePlugin::slotRegisterType(QString _handleName,
DataType _type) {
465 for(std::vector<DataType>::iterator t_it = env->types.begin();
466 t_it != env->types.end(); ++t_it) {
468 if ((*t_it) == _type)
return;
471 env->types.push_back(_type);
476 tool_->typeTabWidget->setTabEnabled(tool_->typeTabWidget->indexOf(env->tabWidget),
true);
477 env->tabWidget->setEnabled(
true);
481 emit log(
LOGERR,
"The specified selection environment has not been found! The data type could not be registered.");
490 QList<QAction*> primitivesList = primitivesBarGroup_->actions();
492 for(QList<QAction*>::iterator it = primitivesList.begin(); it != primitivesList.end(); ++it) {
493 (*it)->setEnabled(
false);
499 std::map<QString,SelectionEnvironment>::iterator sit =
501 if(sit != selectionEnvironments_.end()) {
503 bool atLeastOne =
false;
504 for(std::vector<DataType>::iterator tit = (*sit).second.types.begin();
505 tit != (*sit).second.types.end(); ++tit) {
512 (*it)->setEnabled(
true);
521 for(std::map<QString,SelectionEnvironment>::iterator it = selectionEnvironments_.begin();
522 it != selectionEnvironments_.end(); ++it) {
525 toggleSelectionAction_->setEnabled(toggleSelectionAction_->isAssociated(currentPrimitiveType_,
true));
526 lassoSelectionAction_->setEnabled(lassoSelectionAction_->isAssociated(currentPrimitiveType_,
true));
527 volumeLassoSelectionAction_->setEnabled(volumeLassoSelectionAction_->isAssociated(currentPrimitiveType_,
true));
528 surfaceLassoSelectionAction_->setEnabled(surfaceLassoSelectionAction_->isAssociated(currentPrimitiveType_,
true));
529 sphereSelectionAction_->setEnabled(sphereSelectionAction_->isAssociated(currentPrimitiveType_,
true));
530 boundarySelectionAction_->setEnabled(boundarySelectionAction_->isAssociated(currentPrimitiveType_,
true));
531 floodFillSelectionAction_->setEnabled(floodFillSelectionAction_->isAssociated(currentPrimitiveType_,
true));
532 componentsSelectionAction_->setEnabled(componentsSelectionAction_->isAssociated(currentPrimitiveType_,
true));
535 for(std::set<HandleAction*>::iterator cit = (*it).second.customSelectionModes.begin();
536 cit != (*it).second.customSelectionModes.end(); ++cit) {
538 (*cit)->setEnabled((availableObjectTypes_ & (*cit)->objectTypeRestriction()) &&
539 (*cit)->isAssociated(currentPrimitiveType_,
true));
546 void SelectionBasePlugin::slotMouseWheelEvent(QWheelEvent* _event,
const std::string& _mode) {
548 if(currentPickMode_ == NO_SELECTION_PICKING)
return;
551 if (currentSelectionMode_ == SB_SPHERE) {
553 float d = -(float)_event->angleDelta().y() / 120.0 * 0.1;
554 sphere_radius_ *= 1.0 + d;
556 sphere_node_->
set_size(sphere_radius_);
557 sphere_node_->
show();
565 void SelectionBasePlugin::slotMouseEvent(QMouseEvent* _event) {
567 if(currentPickMode_ == NO_SELECTION_PICKING)
return;
570 if(currentSelectionMode_ == SB_TOGGLE) {
571 slotMouseToggleSelection(_event);
572 }
else if (currentSelectionMode_ == SB_LASSO) {
573 slotMouseLassoSelection(_event);
574 }
else if (currentSelectionMode_ == SB_VOLUME_LASSO) {
575 slotMouseVolumeLassoSelection(_event);
576 }
else if (currentSelectionMode_ == SB_SURFACE_LASSO) {
577 slotMouseSurfaceLassoSelection(_event);
578 }
else if (currentSelectionMode_ == SB_SPHERE) {
579 slotMouseSphereSelection(_event);
580 }
else if (currentSelectionMode_ == SB_BOUNDARY) {
581 slotMouseBoundarySelection(_event);
582 }
else if (currentSelectionMode_ == SB_FLOODFILL) {
583 slotMouseFloodFillSelection(_event);
584 }
else if (currentSelectionMode_ == SB_COMPONENTS) {
585 slotMouseComponentsSelection(_event);
588 slotMouseCustomSelection(_event);
594 void SelectionBasePlugin::slotAddPrimitiveType(QString _handleName, QString _name, QString _icon, SelectionInterface::PrimitiveType& _typeHandle) {
596 if ( !OpenFlipper::Options::gui() )
603 emit log(
LOGERR, QString(
"Could not find selection environment width handle '%1'!").arg(_handleName));
609 if(nextFreePrimitiveType_ > nextFreePrimitiveType_ << 1) {
610 emit log(
LOGERR,
"Maximum number of custom primitive types for selection reached!");
615 QList<QAction*>::const_iterator a_it = env->primitiveActions->actions().constBegin();
616 for(; a_it != env->primitiveActions->actions().constEnd(); ++a_it) {
617 if((*a_it)->text() == _name) {
618 emit log(
LOGERR, QString(
"A custom primitive type with name \"%1\" already exists!").arg(_name));
625 action->setCheckable(
true);
627 primitivesBarGroup_->addAction(action);
628 pickModeToolBar_->clear();
629 pickModeToolBar_->addActions(primitivesBarGroup_->actions());
630 pickModeToolBar_->addSeparator();
631 pickModeToolBar_->addActions(selectionModesGroup_->actions());
635 button->setMinimumSize(QSize(32,32));
636 button->setMaximumSize(QSize(64,64));
637 env->primitivesBar->addWidget(button);
639 _typeHandle = nextFreePrimitiveType_;
643 env->primitiveTypes |= _typeHandle;
645 primitiveTypeButtons_.insert(std::pair<PrimitiveType,QAction*>(_typeHandle,action));
648 nextFreePrimitiveType_ <<= 1;
651 connect(action, SIGNAL(toggled(
bool)),
this, SLOT(updateActivePrimitiveTypes(
bool)));
658 void SelectionBasePlugin::updateActivePrimitiveTypes(
bool _checked) {
660 QObject* sender = QObject::sender();
664 if(!clickedAction)
return;
667 clickedAction->setChecked(_checked);
670 currentPrimitiveType_ = 0u;
672 QList<QAction*> actions = primitivesBarGroup_->actions();
673 for(
int i = 0; i < actions.size(); ++i) {
675 if(actions[i]->isChecked()) {
688 slotSelectionEnvironmentRequested(_checked);
693 QList<QAction*> sm_actions = selectionModesGroup_->actions();
694 bool atLeastOneSelectionMode =
false;
695 for(
int i = 0; i < sm_actions.size(); ++i) {
697 if(sm_actions[i]->isChecked()) {
698 atLeastOneSelectionMode =
true;
702 if(!ha->isAssociated(currentPrimitiveType_)) {
703 ha->blockSignals(
true);
704 ha->setChecked(
false);
705 ha->blockSignals(
false);
706 toggleSelectionAction_->trigger();
712 if(!atLeastOneSelectionMode) {
713 toggleSelectionAction_->trigger();
719 tool_->typeTabWidget->setCurrentIndex(tool_->typeTabWidget->indexOf(env->tabWidget));
725 lassoSelection_ =
false;
729 slotShowAndHideOperations();
730 slotShowAndHideParameters();
739 if (_metaphor == SB_TOGGLE)
740 toggleSelectionAction_->trigger();
741 else if (_metaphor == SB_LASSO)
742 lassoSelectionAction_->trigger();
743 else if (_metaphor == SB_VOLUME_LASSO)
744 volumeLassoSelectionAction_->trigger();
745 else if (_metaphor == SB_SURFACE_LASSO)
746 surfaceLassoSelectionAction_->trigger();
747 else if (_metaphor == SB_SPHERE)
748 sphereSelectionAction_->trigger();
749 else if (_metaphor == SB_BOUNDARY)
750 boundarySelectionAction_->trigger();
751 else if (_metaphor == SB_FLOODFILL)
752 floodFillSelectionAction_->trigger();
753 else if (_metaphor == SB_COMPONENTS)
754 componentsSelectionAction_->trigger();
757 std::map<QString,SelectionEnvironment>::iterator it = selectionEnvironments_.begin();
759 for (; it != selectionEnvironments_.end() && !found; ++it) {
760 std::set<HandleAction*>::iterator e = it->second.customSelectionModes.begin();
761 for(; e != it->second.customSelectionModes.end(); ++e) {
763 QString customModeName = QString((*e)->selectionEnvironmentHandle() +
"_" + _metaphor).replace(
" ",
"_");
764 if((*e)->selectionModeHandle().contains(customModeName)) {
777 QList<QAction*>::iterator a_it = primitivesBarGroup_->actions().begin();
778 for(; a_it != primitivesBarGroup_->actions().end(); ++a_it) {
779 if((*a_it)->text() == _primitive) {
788 void SelectionBasePlugin::slotAddSelectionOperations(QString _handleName, QStringList _operationsList, QString _category, PrimitiveType _type) {
793 emit log(
LOGERR, QString(
"Could not find selection environment with handle '%1'!").arg(_handleName));
798 std::map<QString,std::pair<FillingLayout*,QGroupBox*> >::iterator it = env->categories.find(_category);
799 if(it == env->categories.end()) {
802 QGroupBox* group =
new QGroupBox(_category);
803 group->setLayout(fillLayout);
805 std::pair<std::map<QString,std::pair<FillingLayout*,QGroupBox*> >::iterator,
bool> ret;
806 ret = env->categories.insert(std::pair<QString,std::pair<FillingLayout*,QGroupBox*> >(_category,
807 std::pair<FillingLayout*,QGroupBox*>(fillLayout,group)));
810 env->operationsBar->addWidget(group);
814 for(
int i = 0; i < _operationsList.size(); ++i) {
815 QPushButton* button =
new QPushButton(_operationsList[i]);
816 button->setDisabled(
true);
817 button->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
818 int width = button->fontMetrics().horizontalAdvance(_operationsList[i]);
819 button->setMinimumWidth(width);
820 button->setFixedHeight(26);
822 connect(button, SIGNAL(clicked()),
this, SLOT(slotOperationRequested()));
824 env->operations.insert(std::pair<PrimitiveType,QPushButton*>(_type, button));
826 (*it).second.first->addWidget(button);
829 slotShowAndHideOperations();
834 void SelectionBasePlugin::slotAddSelectionParameters(QString _handleName, QWidget* _widget, QString _category, PrimitiveType _type)
839 emit log(
LOGERR, QString(
"Could not find selection environment with handle '%1'!").arg(_handleName));
844 std::map<QString,std::pair<FillingLayout*,QGroupBox*> >::iterator it = env->categories.find(_category);
845 if(it == env->categories.end()) {
848 QGroupBox* group =
new QGroupBox(_category);
849 group->setLayout(fillLayout);
851 std::pair<std::map<QString,std::pair<FillingLayout*,QGroupBox*> >::iterator,
bool> ret;
852 ret = env->categories.insert(std::pair<QString,std::pair<FillingLayout*,QGroupBox*> >(_category,
853 std::pair<FillingLayout*,QGroupBox*>(fillLayout,group)));
856 env->operationsBar->addWidget(group);
860 env->parameters.insert(std::pair<PrimitiveType,QWidget*>(_type, _widget));
862 (*it).second.first->addWidget(_widget);
865 slotShowAndHideParameters();
870 void SelectionBasePlugin::slotOperationRequested() {
872 QObject* sender = QObject::sender();
873 QPushButton* button = 0;
874 button =
dynamic_cast<QPushButton*
>(sender);
878 emit selectionOperation(button->text());
883 void SelectionBasePlugin::slotShowAndHideOperations() {
885 for(std::map<QString,SelectionEnvironment>::iterator e_it = selectionEnvironments_.begin();
886 e_it != selectionEnvironments_.end(); ++e_it) {
888 for(std::multimap<PrimitiveType,QPushButton*>::iterator it = (*e_it).second.operations.begin();
889 it != (*e_it).second.operations.end(); ++it) {
891 if((currentPrimitiveType_ & (*it).first) || (*it).first == 0u) {
893 (*it).second->setDisabled(
false);
896 (*it).second->setDisabled(
true);
904 void SelectionBasePlugin::slotShowAndHideParameters() {
906 for(std::map<QString,SelectionEnvironment>::iterator e_it = selectionEnvironments_.begin();
907 e_it != selectionEnvironments_.end(); ++e_it) {
909 for(std::multimap<PrimitiveType,QWidget*>::iterator it = (*e_it).second.parameters.begin();
910 it != (*e_it).second.parameters.end(); ++it) {
912 if((currentPrimitiveType_ & (*it).first) || (*it).first == 0u) {
914 (*it).second->setDisabled(
false);
917 (*it).second->setDisabled(
true);
925 void SelectionBasePlugin::slotSelectionEnvironmentRequested(
bool _checked) {
932 currentPickMode_ = SELECTION_PICKING;
937 void SelectionBasePlugin::slotEnterSelectionMode(
bool _checked) {
939 QObject* obj = QObject::sender();
946 act->setChecked(_checked);
956 lassoSelection_ =
false;
958 if(currentSelectionMode_ == SB_SPHERE) {
966 void SelectionBasePlugin::slotPickModeChanged (
const std::string& _pickmode) {
969 bool selectionPicking = (_pickmode ==
"SelectionBasePicking");
972 if(currentSelectionMode_ == SB_SPHERE)
973 sphere_node_->
show();
975 sphere_node_->
hide();
977 if(currentSelectionMode_ == SB_LASSO || currentSelectionMode_ == SB_VOLUME_LASSO)
982 bool resetPickToolBar =
false;
984 if(currentPickMode_ != NO_SELECTION_PICKING) {
988 sphere_node_->
hide();
992 lastPickMode_ = currentPickMode_;
993 currentPickMode_ = NO_SELECTION_PICKING;
995 }
else if (selectionPicking && currentPickMode_ == NO_SELECTION_PICKING && lastPickMode_ != NO_SELECTION_PICKING) {
998 currentPickMode_ = lastPickMode_;
1000 }
else if (!selectionPicking && currentPickMode_ == NO_SELECTION_PICKING) {
1004 linePoints_.clear();
1009 currentPickMode_ = NO_SELECTION_PICKING;
1010 currentSelectionMode_ = NO_SELECTION_MODE;
1011 lastPickMode_ = NO_SELECTION_PICKING;
1014 resetPickToolBar =
true;
1020 lastPickMode_ = currentPickMode_ = _pickmode.c_str();
1023 resetPickToolBar =
true;
1026 linePoints_.clear();
1031 toggleSelectionAction_->setChecked(!resetPickToolBar && currentSelectionMode_ == SB_TOGGLE);
1032 lassoSelectionAction_->setChecked(!resetPickToolBar && currentSelectionMode_ == SB_LASSO);
1033 volumeLassoSelectionAction_->setChecked(!resetPickToolBar && currentSelectionMode_ == SB_VOLUME_LASSO);
1034 surfaceLassoSelectionAction_->setChecked(!resetPickToolBar && currentSelectionMode_ == SB_SURFACE_LASSO);
1035 sphereSelectionAction_->setChecked(!resetPickToolBar && currentSelectionMode_ == SB_SPHERE);
1036 boundarySelectionAction_->setChecked(!resetPickToolBar && currentSelectionMode_ == SB_BOUNDARY);
1037 floodFillSelectionAction_->setChecked(!resetPickToolBar && currentSelectionMode_ == SB_FLOODFILL);
1038 componentsSelectionAction_->setChecked(!resetPickToolBar && currentSelectionMode_ == SB_COMPONENTS);
1040 for(std::map<QString,SelectionEnvironment>::iterator it = selectionEnvironments_.begin();
1041 it != selectionEnvironments_.end(); ++it) {
1044 for(std::set<HandleAction*>::iterator csm_it = (*it).second.customSelectionModes.begin();
1045 csm_it != (*it).second.customSelectionModes.end(); ++csm_it) {
1046 (*csm_it)->setChecked(!resetPickToolBar && currentSelectionMode_ == (*csm_it)->selectionModeHandle());
1050 if(selectionPicking)
1057 bool _show, SelectionInterface::PrimitiveType _associatedTypes,
1058 QString& _customIdentifier,
bool _custom,
DataType _objectTypeRestriction) {
1060 if ( !OpenFlipper::Options::gui() )
1069 if(_mode == SB_TOGGLE) {
1071 }
else if (_mode == SB_LASSO) {
1073 }
else if (_mode == SB_VOLUME_LASSO) {
1075 }
else if (_mode == SB_SURFACE_LASSO) {
1077 }
else if (_mode == SB_SPHERE) {
1079 }
else if (_mode == SB_BOUNDARY) {
1081 }
else if (_mode == SB_FLOODFILL) {
1083 }
else if (_mode == SB_COMPONENTS) {
1094 action->setCheckable(
true);
1100 selectionModesGroup_->addAction(action);
1101 pickModeToolBar_->clear();
1102 pickModeToolBar_->addActions(primitivesBarGroup_->actions());
1103 pickModeToolBar_->addSeparator();
1104 pickModeToolBar_->addActions(selectionModesGroup_->actions());
1107 env->customSelectionModes.insert(action);
1109 connect(action, SIGNAL(triggered(
bool)),
this, SLOT(slotEnterSelectionMode(
bool)));
1112 std::set<HandleAction*>::iterator e = env->customSelectionModes.begin();
1113 for(; e != env->customSelectionModes.end(); ++e) {
1114 if((*e)->selectionEnvironmentHandle() == _handleName)
1119 if(e != env->customSelectionModes.end()) {
1120 (*e)->removeAssociatedType(_associatedTypes);
1121 env->customSelectionModes.erase(e);
1129 void SelectionBasePlugin::slotAddCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QString _icon,
1130 SelectionInterface::PrimitiveType _associatedTypes, QString& _customIdentifier) {
1132 showSelectionMode(_modeName, _icon, _description, _handleName,
true, _associatedTypes, _customIdentifier,
true);
1138 void SelectionBasePlugin::slotAddCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QString _icon,
1139 SelectionInterface::PrimitiveType _associatedTypes, QString& _customIdentifier,
1142 showSelectionMode(_modeName, _icon, _description, _handleName,
true, _associatedTypes, _customIdentifier,
true, _objectTypeRestriction);
1148 void SelectionBasePlugin::slotShowToggleSelectionMode(QString _handleName,
bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
1150 QString iconPath = OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator();
1152 showSelectionMode(SB_TOGGLE, iconPath + TOGGLE_IMG, TOGGLE_DESC, _handleName, _show, _associatedTypes, dummy);
1158 void SelectionBasePlugin::slotShowLassoSelectionMode(QString _handleName,
bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
1160 QString iconPath = OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator();
1162 showSelectionMode(SB_LASSO, iconPath + LASSO_IMG, LASSO_DESC, _handleName, _show, _associatedTypes, dummy);
1168 void SelectionBasePlugin::slotShowVolumeLassoSelectionMode(QString _handleName,
bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
1170 QString iconPath = OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator();
1172 showSelectionMode(SB_VOLUME_LASSO, iconPath + VOLUME_LASSO_IMG, VOLUME_LASSO_DESC, _handleName, _show, _associatedTypes, dummy);
1178 void SelectionBasePlugin::slotShowSurfaceLassoSelectionMode(QString _handleName,
bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
1180 QString iconPath = OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator();
1182 showSelectionMode(SB_SURFACE_LASSO, iconPath + SURFACE_LASSO_IMG, SURFACE_LASSO_DESC, _handleName, _show, _associatedTypes, dummy);
1188 void SelectionBasePlugin::slotShowSphereSelectionMode(QString _handleName,
bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
1190 QString iconPath = OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator();
1192 showSelectionMode(SB_SPHERE, iconPath + SPHERE_IMG, SPHERE_DESC, _handleName, _show, _associatedTypes, dummy);
1198 void SelectionBasePlugin::slotShowClosestBoundarySelectionMode(QString _handleName,
bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
1200 QString iconPath = OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator();
1202 showSelectionMode(SB_BOUNDARY, iconPath + BOUNDARY_IMG, BOUNDARY_DESC, _handleName, _show, _associatedTypes, dummy);
1208 void SelectionBasePlugin::slotShowFloodFillSelectionMode(QString _handleName,
bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
1210 QString iconPath = OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator();
1212 showSelectionMode(SB_FLOODFILL, iconPath + FLOODFILL_IMG, FLOODFILL_DESC, _handleName, _show, _associatedTypes, dummy);
1218 void SelectionBasePlugin::slotShowComponentsSelectionMode(QString _handleName,
bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
1220 QString iconPath = OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator();
1222 showSelectionMode(SB_COMPONENTS, iconPath + COMPONENTS_IMG, COMPONENTS_DESC, _handleName, _show, _associatedTypes, dummy);
1228 void SelectionBasePlugin::slotGetActiveDataTypes(TypeList& _types) {
1230 if(currentPickMode_ == NO_SELECTION_PICKING) {
1231 _types = TypeList();
1233 std::map<QString,SelectionEnvironment>::iterator it = selectionEnvironments_.find(currentPickMode_);
1234 if(it == selectionEnvironments_.end()) {
1235 _types = TypeList();
1237 _types = (*it).second.types;
1244 void SelectionBasePlugin::slotGetActivePrimitiveType(SelectionInterface::PrimitiveType& _type) {
1246 _type = currentPrimitiveType_;
1251 void SelectionBasePlugin::slotMouseToggleSelection(QMouseEvent* _event) {
1254 if (_event->type() == QEvent::MouseButtonPress) {
1256 if (_event->button() == Qt::RightButton)
return;
1258 emit toggleSelection(_event, currentPrimitiveType_, deselection_);
1264 void SelectionBasePlugin::slotMouseLassoSelection(QMouseEvent* _event) {
1267 if (_event->button() == Qt::RightButton)
return;
1269 size_t node_idx, target_idx;
1277 if(_event->type() == QEvent::MouseButtonPress && _event->button() == Qt::LeftButton) {
1280 if(!lassoSelection_) {
1282 linePoints_.clear();
1283 lassoSelection_ =
true;
1289 linePoints_.push_back(hit_point);
1292 emit lassoSelection(_event, currentPrimitiveType_, deselection_);
1294 }
else if(_event->type() == QEvent::MouseMove) {
1296 if(!lassoSelection_)
return;
1306 line_node_->
clear();
1307 for (std::vector< ACG::Vec3d >::iterator it = linePoints_.begin(); it != linePoints_.end(); ++it)
1313 if( !linePoints_.empty() )
1316 }
else if(_event->type() == QEvent::MouseButtonDblClick) {
1319 lassoSelection_ =
false;
1320 linePoints_.clear();
1321 line_node_->
clear();
1325 emit lassoSelection(_event, currentPrimitiveType_, deselection_);
1331 void SelectionBasePlugin::slotMouseVolumeLassoSelection(QMouseEvent* _event) {
1334 if (_event->button() == Qt::RightButton)
return;
1336 size_t node_idx, target_idx;
1344 if(_event->type() == QEvent::MouseButtonPress && _event->button() == Qt::LeftButton) {
1347 if(!lassoSelection_) {
1349 linePoints_.clear();
1350 lassoSelection_ =
true;
1357 linePoints_.push_back(hit_point);
1360 emit volumeLassoSelection(_event, currentPrimitiveType_, deselection_);
1362 }
else if(_event->type() == QEvent::MouseMove) {
1364 if(!lassoSelection_)
return;
1374 line_node_->
clear();
1375 for (std::vector< ACG::Vec3d >::iterator it = linePoints_.begin(); it != linePoints_.end(); ++it)
1381 if( !linePoints_.empty() )
1384 }
else if(_event->type() == QEvent::MouseButtonDblClick) {
1387 lassoSelection_ =
false;
1388 linePoints_.clear();
1389 line_node_->
clear();
1393 emit volumeLassoSelection(_event, currentPrimitiveType_, deselection_);
1399 void SelectionBasePlugin::slotMouseSurfaceLassoSelection(QMouseEvent* _event) {
1406 void SelectionBasePlugin::slotMouseSphereSelection(QMouseEvent* _event) {
1409 if (_event->button() == Qt::RightButton)
return;
1412 size_t node_idx, target_idx;
1416 sphere_node_->
hide();
1420 _event->pos(), node_idx, target_idx, &hit_point)) {
1427 sphere_node_->
show();
1429 sphere_node_->
set_size(sphere_radius_);
1432 if( (_event->buttons() & Qt::LeftButton)
1433 ||( (_event->buttons() == Qt::NoButton) && (_event->type() == QEvent::MouseButtonRelease))
1436 emit sphereSelection(_event, sphere_radius_, currentPrimitiveType_, deselection_);
1442 sphere_node_->
hide();
1448 void SelectionBasePlugin::slotMouseBoundarySelection(QMouseEvent* _event) {
1451 if (_event->type() == QEvent::MouseButtonPress) {
1453 if (_event->button() == Qt::RightButton)
return;
1455 emit closestBoundarySelection(_event, currentPrimitiveType_, deselection_);
1461 void SelectionBasePlugin::slotMouseFloodFillSelection(QMouseEvent* _event) {
1464 if (_event->type() == QEvent::MouseButtonPress) {
1466 if (_event->button() == Qt::RightButton)
return;
1468 emit floodFillSelection(_event, currentPrimitiveType_, deselection_);
1474 void SelectionBasePlugin::slotMouseComponentsSelection(QMouseEvent* _event) {
1477 if (_event->type() == QEvent::MouseButtonPress) {
1479 if (_event->button() == Qt::RightButton)
return;
1481 emit componentsSelection(_event, currentPrimitiveType_, deselection_);
1487 void SelectionBasePlugin::slotMouseCustomSelection(QMouseEvent* _event) {
1489 emit customSelection(_event, currentPrimitiveType_, currentSelectionMode_, deselection_);
1494 void SelectionBasePlugin::addedEmptyObject (
int _id) {
1508 availableObjectTypes_ |= obj->
dataType();
1515 if (bObject && !bObject->
isGroup()) {
1516 emit log(
LOGERR,
"Could not retrieve object type! Maybe a selection environment will be missing.");
1523 tool_->typeTabWidget->setTabEnabled(tool_->typeTabWidget->indexOf(env->tabWidget),
true);
1524 env->tabWidget->setEnabled(
true);
1542 void SelectionBasePlugin::objectDeleted (
int _id) {
1555 availableObjectTypes_ = (availableObjectTypes_ & ~obj->
dataType().value());
1557 emit log(
LOGERR,
"Could not retrieve object type!");
1568 bool atLeastOne =
false;
1569 for(std::vector<DataType>::iterator t_it = env->types.begin();
1570 t_it != env->types.end(); ++t_it) {
1579 tool_->typeTabWidget->setTabEnabled(tool_->typeTabWidget->indexOf(env->tabWidget), atLeastOne);
1580 env->tabWidget->setEnabled(atLeastOne);
1590 std::cerr <<
"====== ERROR =======" << std::endl;
1591 std::cerr <<
"Negative counter for type " << obj->
dataType().name().toStdString() << std::endl;
1594 std::cerr <<
"Error: No counter for type " << obj->
dataType().name().toStdString() << std::endl;
1604 void SelectionBasePlugin::updateTabsOrder() {
1606 std::map<int, int> newMappings;
1609 for(
int i = 0; i < tool_->typeTabWidget->count(); ++i) {
1610 if(tool_->typeTabWidget->isTabEnabled(i)) {
1611 tool_->typeTabWidget->insertTab(firstFree, tool_->typeTabWidget->widget(i), tool_->typeTabWidget->tabText(i));
1612 newMappings.insert(std::pair<int,int>(i,firstFree));
1616 newMappings.insert(std::pair<int,int>(i,i));
1621 if(tool_->typeTabWidget->count() > 0) tool_->typeTabWidget->setCurrentIndex(0);
1626 void SelectionBasePlugin::slotTargetObjectsOnly(
bool& _targetsOnly) {
1628 if(OpenFlipper::Options::nogui() || tool_ == 0) {
1629 _targetsOnly =
true;
1631 _targetsOnly = tool_->restrictOnTargets->isChecked();
1646 QString needle = _name;;
1649 needle.append(QString::number(_num));
1653 for(std::map<QString,SelectionEnvironment>::iterator it = selectionEnvironments_.begin();
1654 it != selectionEnvironments_.end(); ++it) {
1658 for(std::set<HandleAction*>::iterator dsm_it = (*it).second.defaultSelectionModes.begin();
1659 dsm_it != (*it).second.defaultSelectionModes.end(); ++dsm_it) {
1661 if((*dsm_it)->selectionModeHandle() == needle) {
1682 QString needle = _name;;
1685 needle.append(QString::number(_num));
1689 for(std::map<QString,SelectionEnvironment>::iterator it = selectionEnvironments_.begin();
1690 it != selectionEnvironments_.end(); ++it) {
1692 if((*it).first == needle) {
1706 QMap<DataType, int>::iterator iterator =
typeCounter_.find(_type);
1711 if ( _excludeId != -1 ) {
1717 if (
object == 0 ) {
1718 std::cerr <<
"Unable to get Object for type exists" << std::endl;
1728 std::cerr <<
"Type exists Error after mismatch exclude: " << _type.
name().toStdString() <<
" negative count" << std::endl;
1740 std::cerr <<
"Type exists Error " << _type.
name().toStdString() <<
" negative count" << std::endl;
1751 std::cerr <<
"Type exists Error " << _type.
name().toStdString() <<
" negative count" << std::endl;
1767 void SelectionBasePlugin::slotRegisterKeyShortcut(
int _key, Qt::KeyboardModifiers _modifiers) {
1769 std::set<std::pair<int,Qt::KeyboardModifiers> >::iterator f =
1770 registeredKeys_.find(std::pair<int,Qt::KeyboardModifiers>(_key,_modifiers));
1772 if(f == registeredKeys_.end()) {
1774 emit registerKey(_key, _modifiers, QString(
"Selection base key %1").arg(_key),
true);
1775 registeredKeys_.insert(std::pair<int,Qt::KeyboardModifiers>(_key,_modifiers));
1784 std::map<QString,SelectionEnvironment>::iterator it = selectionEnvironments_.find(_handleName);
1787 if(it == selectionEnvironments_.end())
return false;
1788 env = &(it->second);
1795 HandleAction* toggleSelectionAction_, PrimitiveType& _associatedTypes)
1798 env->defaultSelectionModes.insert(toggleSelectionAction_);
1801 std::set<HandleAction*>::iterator e = env->defaultSelectionModes.find(toggleSelectionAction_);
1802 if(e != env->defaultSelectionModes.end()) {
1803 env->defaultSelectionModes.erase(e);
1804 toggleSelectionAction_->removeAssociatedType(_associatedTypes);
1813 std::map<QString,SelectionEnvironment>::iterator it = selectionEnvironments_.begin();
1821 for(;it != selectionEnvironments_.end(); ++it) {
1824 for(std::vector<DataType>::iterator t_it = (*it).second.types.begin();
1825 t_it != (*it).second.types.end(); ++t_it) {
bool scenegraphPick(ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, size_t &_nodeIdx, size_t &_targetIdx, ACG::Vec3d *_hitPointPtr=0)
Execute picking operation on scenegraph.
void selectionEnvironmentHandle(const QString _handle)
Get/Set associated selection environment handle.
void set_color(const Vec4f &_c)
Override material node's set color function in order to locally add color.
bool findObjectType(BaseObjectData *&obj, bool &found, SelectionEnvironment *&env, int _id)
helper function to find a baseObjectData and selection environment given a specific id ...
void disconnect()
Remove connection of this object to a file.
SelectionBasePlugin()
Default constructor.
picks faces (should be implemented for all nodes)
DrawModes::DrawMode drawMode() const
Return the own draw modes of this node.
QString name() const
Return the name of this type as text.
VectorT< float, 4 > Vec4f
bool getObject(const int _identifier, BaseObject *&_object)
Get the object which has the given identifier.
void show()
Show node: set status to Active.
Draw node in second pass.
void clear()
clear points/lines and colors
void set_line_width(float _sz)
set line width (default: 1.0)
void enablePicking(bool _enable)
bool typeExists(DataType _type, int _excludeId=-1)
Test if at least one object of type _type is in the scene graph.
void add_point(const Vec3d &_v)
add point (for LineMode == PolygonMode)
void enable_blending(GLenum _p1=GL_SRC_ALPHA, GLenum _p2=GL_ONE_MINUS_SRC_ALPHA)
enable blending with Parameters (_p1, _p2)
QString getUniqueIdentifierName(QString _name, int _num=0)
Get a unique pickmode name.
void setTraverseMode(unsigned int _mode)
Set traverse mode for node.
void clear_points()
clear points/lines
DrawMode SOLID_SMOOTH_SHADED
draw smooth shaded (Gouraud shaded) faces (requires halfedge normals)
void disable_alpha_test()
disable alpha test
void setSelectionMetaphor(QString _metaphor)
Enables setting the selection metaphor via scripting The default selection metaphors are: ...
QString getUniqueHandleName(QString _name, int _num=0)
Get a unique handle name.
bool dataType(DataType _type) const
Vec3d unproject(const Vec3d &_winPoint) const
unproject point in window coordinates _winPoint to world coordinates
void set_position(const Vec3d &_p, int _idx=0)
set position
Viewer::ActionMode actionMode()
Get the current Action mode.
pick any of the prior targets (should be implemented for all nodes)
double sceneRadius()
Returns the current scene radius from the active examiner widget.
void hide()
Hide Node: set status to HideNode.
void selectionModeShowSwitch(bool _show, SelectionEnvironment *&env, HandleAction *toggleSelectionAction_, SelectionInterface::PrimitiveType &_associatedTypes)
helper function for showSelectionMode
const std::string pickMode()
Get the current Picking mode.
void addAssociatedType(unsigned int _associatedType)
Get/Set associated primitive types.
unsigned int applyProperties() const
get properties that will be applied (OR'ed ApplyProperties)
Primitive & get_primitive(int _idx)
get a primitive
void primitiveType(unsigned int _type)
Get/Set primitive type.
bool & alwaysOnTop()
get and set always on top
bool isGroup() const
Check if object is a group.
Execute action on node first and then on its children.
void enable_backface_culling()
enable backface culling (not active by default, see applyProperties)
Class for the handling of simple configuration files.
void addGlobalNode(ACG::SceneGraph::BaseNode *_node)
Add a global node.
void set_base_color(const Vec4f &_c)
set the base color ( Same as set_emission(const Vec4f& _c) )
QMap< DataType, int > typeCounter_
Caches the number of available elements of a certain data type for the typeExists function...
bool connect(const QString &name, const bool create)
Connect INIFile object with given filename.
Viewer::ViewerProperties & viewerProperties(int _id)
Get the viewer properties Use this functions to get basic viewer properties such as backgroundcolor o...
ACG::SceneGraph::MaterialNode MaterialNode
Materialnode.
bool getSelectionEnvironment(SelectionEnvironment *&env, const QString &_handleName)
Get a selectionEnvironment by a given name.
bool hidden()
Is node not visible (status != Active)?
int context_height() const
get gl context height
SelectionTypeFrameWidget * createNewTypeFrame(SelectionEnvironment &_env)
Create new type frame for tabs widget.
void set_size(double _s, int _idx=0)
set size
bool getPickedObject(const size_t _node_idx, BaseObjectData *&_object)
Get the picked mesh.
void setSelectionPrimitiveType(QString _primitive)
Enables setting the selection primitive via scripting The default primitives for OpenMesh are: ...
apply material (ambient, diffuse, specular, shininess)
void selectionEnvironmentHandle(QString _handle)
Get/Set selection environment handle name.
void updatePickModeToolBar()
Update the pickmode toolbar.
void selectionModeHandle(QString _handle)
Get/Set selection mode handle name.
ACG::GLState & glState()
Get the glState of the Viewer.
void set_color(const Vec4f &_c)
set color (base, ambient, diffuse, specular) based on _c
void showSelectionMode(QString _mode, QString _icon, QString _desc, QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes, QString &_customIdentifier, bool _custom=false, DataType _objectTypeRestriction=DATA_ALL)