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 nextFreePrimitiveType_(1u),
109 lassoSelection_(false),
111 availableObjectTypes_(0u)
115 currentPickMode_ = NO_SELECTION_PICKING;
116 lastPickMode_ = NO_SELECTION_PICKING;
117 currentSelectionMode_ = NO_SELECTION_MODE;
119 currentPrimitiveType_ = 0u;
122 deselection_ =
false;
124 sphere_radius_ = 0.0;
129 void SelectionBasePlugin::initializePlugin() {
132 if (OpenFlipper::Options::nogui())
137 QSize size(300, 300);
141 connect(tool_->loadSelection, SIGNAL(clicked()),
this, SLOT(slotLoadSelectionButton()));
142 connect(tool_->saveSelection, SIGNAL(clicked()),
this, SLOT(slotSaveSelectionButton()));
145 toolIcon_ =
new QIcon(OpenFlipper::Options::iconDirStr()+OpenFlipper::Options::dirSeparator()+
"selection_base.png");
146 emit addToolbox(
"Selections", tool_, toolIcon_ );
149 toolBar_ =
new QToolBar(tr(
"Selection Base"));
150 emit addToolbar(toolBar_);
152 QString iconPath = OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator();
153 QAction* selectionEnvironmentButton =
new QAction(QIcon(iconPath +
"selection_base.png"),
"Selections", toolBar_);
154 toolBar_->addAction(selectionEnvironmentButton);
157 connect(selectionEnvironmentButton, SIGNAL(triggered(
bool)),
this, SLOT(slotSelectionEnvironmentRequested(
bool)));
160 emit registerKey(Qt::Key_Control, Qt::NoModifier, tr(
"Deselection"),
true);
161 emit registerKey(Qt::Key_Control, Qt::ControlModifier, tr(
"Deselection"),
true);
163 emit registerKey(Qt::Key_Shift, Qt::NoModifier, tr(
"Source/Target Selection"),
true);
164 emit registerKey(Qt::Key_Shift, Qt::ShiftModifier, tr(
"Source/Target Selection"),
true);
167 emit addPickMode(SELECTION_PICKING);
169 emit setPickModeMouseTracking(SELECTION_PICKING,
true);
172 tool_->typeTabWidget->setMovable(
true);
175 pickModeToolBar_ =
new QToolBar(
"Selection Picking Toolbar");
176 pickModeToolBar_->setObjectName(
"Selection_Picking_Toolbar");
179 primitivesBarGroup_ =
new QActionGroup(pickModeToolBar_);
180 primitivesBarGroup_->setExclusive(
true);
184 selectionModesGroup_ =
new QActionGroup(pickModeToolBar_);
185 selectionModesGroup_->setExclusive(
true);
186 toggleSelectionAction_ =
new HandleAction(QIcon(iconPath + TOGGLE_IMG), TOGGLE_DESC, selectionModesGroup_);
187 toggleSelectionAction_->setCheckable(
true);
189 connect(toggleSelectionAction_, SIGNAL(triggered(
bool)),
this, SLOT(slotEnterSelectionMode(
bool)));
190 lassoSelectionAction_ =
new HandleAction(QIcon(iconPath + LASSO_IMG), LASSO_DESC, selectionModesGroup_);
191 lassoSelectionAction_->setCheckable(
true);
193 connect(lassoSelectionAction_, SIGNAL(triggered(
bool)),
this, SLOT(slotEnterSelectionMode(
bool)));
194 volumeLassoSelectionAction_ =
new HandleAction(QIcon(iconPath + VOLUME_LASSO_IMG), VOLUME_LASSO_DESC, selectionModesGroup_);
195 volumeLassoSelectionAction_->setCheckable(
true);
197 connect(volumeLassoSelectionAction_, SIGNAL(triggered(
bool)),
this, SLOT(slotEnterSelectionMode(
bool)));
198 surfaceLassoSelectionAction_ =
new HandleAction(QIcon(iconPath + SURFACE_LASSO_IMG), SURFACE_LASSO_DESC, selectionModesGroup_);
199 surfaceLassoSelectionAction_->setCheckable(
true);
201 connect(surfaceLassoSelectionAction_, SIGNAL(triggered(
bool)),
this, SLOT(slotEnterSelectionMode(
bool)));
202 sphereSelectionAction_ =
new HandleAction(QIcon(iconPath + SPHERE_IMG), SPHERE_DESC, selectionModesGroup_);
203 sphereSelectionAction_->setCheckable(
true);
205 connect(sphereSelectionAction_, SIGNAL(triggered(
bool)),
this, SLOT(slotEnterSelectionMode(
bool)));
206 boundarySelectionAction_ =
new HandleAction(QIcon(iconPath + BOUNDARY_IMG), BOUNDARY_DESC, selectionModesGroup_);
207 boundarySelectionAction_->setCheckable(
true);
209 connect(boundarySelectionAction_, SIGNAL(triggered(
bool)),
this, SLOT(slotEnterSelectionMode(
bool)));
210 floodFillSelectionAction_ =
new HandleAction(QIcon(iconPath + FLOODFILL_IMG), FLOODFILL_DESC, selectionModesGroup_);
211 floodFillSelectionAction_->setCheckable(
true);
213 connect(floodFillSelectionAction_, SIGNAL(triggered(
bool)),
this, SLOT(slotEnterSelectionMode(
bool)));
214 componentsSelectionAction_ =
new HandleAction(QIcon(iconPath + COMPONENTS_IMG), COMPONENTS_DESC, selectionModesGroup_);
215 componentsSelectionAction_->setCheckable(
true);
217 connect(componentsSelectionAction_, SIGNAL(triggered(
bool)),
this, SLOT(slotEnterSelectionMode(
bool)));
219 pickModeToolBar_->clear();
220 pickModeToolBar_->addActions(primitivesBarGroup_->actions());
221 pickModeToolBar_->addSeparator();
222 pickModeToolBar_->addActions(selectionModesGroup_->actions());
224 #if defined(ARCH_DARWIN) 228 pickModeToolBar_->setWindowOpacity(0.99);
231 emit setPickModeToolbar(SELECTION_PICKING, pickModeToolBar_);
236 void SelectionBasePlugin::pluginsInitialized() {
243 std::string nodeName = std::string( tr(
"Selection Base Plugin: Selection Sphere Material").toUtf8() );
256 nodeName = std::string( tr(
"Selection Base Plugin: Selection Sphere").toUtf8() );
260 sphere_node_->
hide();
264 nodeName = std::string( tr(
"Selection Base Plugin: Lasso Selection Line").toUtf8() );
282 _env.primitivesBar =
new QHBoxLayout(tab->toolPrimitivesBar);
285 _env.operationsBar =
new QVBoxLayout(tab->toolOperationsWidget);
288 policy.setVerticalPolicy(QSizePolicy::MinimumExpanding);
289 policy.setHorizontalPolicy(QSizePolicy::Preferred);
290 tab->selectionGroup->setSizePolicy(policy);
292 tab->toolPrimitivesBar->setLayout(_env.primitivesBar);
293 tab->toolPrimitivesBar->setMinimumHeight(68);
294 tab->toolOperationsWidget->setLayout(_env.operationsBar);
295 tab->toolOperationsWidget->setMinimumHeight(150);
297 _env.primitiveActions =
new QActionGroup(0);
298 _env.primitiveActions->setExclusive(
true);
305 void SelectionBasePlugin::slotLoadSelectionButton() {
308 QString filename = QFileDialog::getOpenFileName(0, tr(
"Load Selection"),
"selection.ini", tr(
"Selection files ( *.ini )"));
310 if(filename.length() > 0) {
314 if(!file.
connect(filename,
false)) {
315 emit log(
LOGERR, QString(
"Could not read file '%1'!").arg(filename));
320 emit loadSelection(file);
329 void SelectionBasePlugin::slotSaveSelectionButton() {
332 QString filename = QFileDialog::getSaveFileName(0, tr(
"Save Selection"),
"selection.ini", tr(
"Selection files ( *.ini )"));
334 if(filename.length() > 0) {
338 if(!file.
connect(filename,
true)) {
339 emit log(
LOGERR, QString(
"Could not create file '%1'!").arg(filename));
344 emit saveSelection(file);
353 void SelectionBasePlugin::slotKeyEvent(QKeyEvent* _event) {
356 if ((_event->modifiers() & Qt::ControlModifier) || (_event->key() == Qt::Key_Control)) {
358 primitivesBarGroup_->setExclusive(
false);
360 deselection_ =
false;
361 primitivesBarGroup_->setExclusive(
true);
365 if ((_event->modifiers() & Qt::ShiftModifier) || (_event->key() == Qt::Key_Shift))
366 tool_->restrictOnTargets->setChecked(
true);
368 tool_->restrictOnTargets->setChecked(
false);
375 std::set<std::pair<int,Qt::KeyboardModifiers> >::iterator f =
376 registeredKeys_.find(std::pair<int,Qt::KeyboardModifiers>(_event->key(), _event->modifiers()));
378 if(f != registeredKeys_.end()) {
380 emit keyShortcutEvent((*f).first,(*f).second);
386 void SelectionBasePlugin::slotKeyReleaseEvent(QKeyEvent* _event) {
389 if ((_event->modifiers() & Qt::ControlModifier) || (_event->key() == Qt::Key_Control)) {
390 deselection_ =
false;
391 primitivesBarGroup_->setExclusive(
true);
395 if ((_event->modifiers() & Qt::ShiftModifier) || (_event->key() == Qt::Key_Shift))
396 tool_->restrictOnTargets->setChecked(
false);
401 void SelectionBasePlugin::loadIniFileOptionsLast(
INIFile &_ini)
403 emit loadSelection(_ini);
408 void SelectionBasePlugin::slotAddSelectionEnvironment(QString _modeName, QString _description, QString _icon, QString& _handleName) {
415 std::map<QString,SelectionEnvironment>::iterator it =
416 selectionEnvironments_.begin();
418 for(; it != selectionEnvironments_.end(); ++it) {
419 if(_modeName == (*it).second.name) {
420 emit log(
LOGINFO, QString(
"Selection environment %1 already exists.").arg(_modeName));
427 env.name = _modeName;
431 if ( OpenFlipper::Options::gui() ) {
434 int index = tool_->typeTabWidget->addTab(tab, QIcon(_icon), _modeName);
435 env.tabWidget = tool_->typeTabWidget->widget(index);
439 tool_->typeTabWidget->setTabEnabled(index,
false);
440 tool_->typeTabWidget->widget(index)->setEnabled(
false);
448 env.handle = _handleName;
454 selectionEnvironments_.insert(std::pair<QString,SelectionEnvironment>(_handleName, env));
459 void SelectionBasePlugin::slotRegisterType(QString _handleName,
DataType _type) {
470 for(std::vector<DataType>::iterator t_it = env->types.begin();
471 t_it != env->types.end(); ++t_it) {
473 if ((*t_it) == _type)
return;
476 env->types.push_back(_type);
481 tool_->typeTabWidget->setTabEnabled(tool_->typeTabWidget->indexOf(env->tabWidget),
true);
482 env->tabWidget->setEnabled(
true);
486 emit log(
LOGERR,
"The specified selection environment has not been found! The data type could not be registered.");
495 QList<QAction*> primitivesList = primitivesBarGroup_->actions();
497 for(QList<QAction*>::iterator it = primitivesList.begin(); it != primitivesList.end(); ++it) {
498 (*it)->setEnabled(
false);
504 std::map<QString,SelectionEnvironment>::iterator sit =
506 if(sit != selectionEnvironments_.end()) {
508 bool atLeastOne =
false;
509 for(std::vector<DataType>::iterator tit = (*sit).second.types.begin();
510 tit != (*sit).second.types.end(); ++tit) {
517 (*it)->setEnabled(
true);
526 for(std::map<QString,SelectionEnvironment>::iterator it = selectionEnvironments_.begin();
527 it != selectionEnvironments_.end(); ++it) {
530 toggleSelectionAction_->setEnabled(toggleSelectionAction_->isAssociated(currentPrimitiveType_,
true));
531 lassoSelectionAction_->setEnabled(lassoSelectionAction_->isAssociated(currentPrimitiveType_,
true));
532 volumeLassoSelectionAction_->setEnabled(volumeLassoSelectionAction_->isAssociated(currentPrimitiveType_,
true));
533 surfaceLassoSelectionAction_->setEnabled(surfaceLassoSelectionAction_->isAssociated(currentPrimitiveType_,
true));
534 sphereSelectionAction_->setEnabled(sphereSelectionAction_->isAssociated(currentPrimitiveType_,
true));
535 boundarySelectionAction_->setEnabled(boundarySelectionAction_->isAssociated(currentPrimitiveType_,
true));
536 floodFillSelectionAction_->setEnabled(floodFillSelectionAction_->isAssociated(currentPrimitiveType_,
true));
537 componentsSelectionAction_->setEnabled(componentsSelectionAction_->isAssociated(currentPrimitiveType_,
true));
540 for(std::set<HandleAction*>::iterator cit = (*it).second.customSelectionModes.begin();
541 cit != (*it).second.customSelectionModes.end(); ++cit) {
543 (*cit)->setEnabled((availableObjectTypes_ & (*cit)->objectTypeRestriction()) &&
544 (*cit)->isAssociated(currentPrimitiveType_,
true));
551 void SelectionBasePlugin::slotMouseWheelEvent(QWheelEvent* _event,
const std::string& _mode) {
553 if(currentPickMode_ == NO_SELECTION_PICKING)
return;
556 if (currentSelectionMode_ == SB_SPHERE) {
558 float d = -(float)_event->delta() / 120.0 * 0.1;
559 sphere_radius_ *= 1.0 + d;
561 sphere_node_->
set_size(sphere_radius_);
562 sphere_node_->
show();
570 void SelectionBasePlugin::slotMouseEvent(QMouseEvent* _event) {
572 if(currentPickMode_ == NO_SELECTION_PICKING)
return;
575 if(currentSelectionMode_ == SB_TOGGLE) {
576 slotMouseToggleSelection(_event);
577 }
else if (currentSelectionMode_ == SB_LASSO) {
578 slotMouseLassoSelection(_event);
579 }
else if (currentSelectionMode_ == SB_VOLUME_LASSO) {
580 slotMouseVolumeLassoSelection(_event);
581 }
else if (currentSelectionMode_ == SB_SURFACE_LASSO) {
582 slotMouseSurfaceLassoSelection(_event);
583 }
else if (currentSelectionMode_ == SB_SPHERE) {
584 slotMouseSphereSelection(_event);
585 }
else if (currentSelectionMode_ == SB_BOUNDARY) {
586 slotMouseBoundarySelection(_event);
587 }
else if (currentSelectionMode_ == SB_FLOODFILL) {
588 slotMouseFloodFillSelection(_event);
589 }
else if (currentSelectionMode_ == SB_COMPONENTS) {
590 slotMouseComponentsSelection(_event);
593 slotMouseCustomSelection(_event);
599 void SelectionBasePlugin::slotAddPrimitiveType(QString _handleName, QString _name, QString _icon, SelectionInterface::PrimitiveType& _typeHandle) {
601 if ( !OpenFlipper::Options::gui() )
608 emit log(
LOGERR, QString(
"Could not find selection environment width handle '%1'!").arg(_handleName));
614 if(nextFreePrimitiveType_ > nextFreePrimitiveType_ << 1) {
615 emit log(
LOGERR,
"Maximum number of custom primitive types for selection reached!");
620 QList<QAction*>::const_iterator a_it = env->primitiveActions->actions().constBegin();
621 for(; a_it != env->primitiveActions->actions().constEnd(); ++a_it) {
622 if((*a_it)->text() == _name) {
623 emit log(
LOGERR, QString(
"A custom primitive type with name \"%1\" already exists!").arg(_name));
630 action->setCheckable(
true);
632 primitivesBarGroup_->addAction(action);
633 pickModeToolBar_->clear();
634 pickModeToolBar_->addActions(primitivesBarGroup_->actions());
635 pickModeToolBar_->addSeparator();
636 pickModeToolBar_->addActions(selectionModesGroup_->actions());
640 button->setMinimumSize(QSize(32,32));
641 button->setMaximumSize(QSize(64,64));
642 env->primitivesBar->addWidget(button);
644 _typeHandle = nextFreePrimitiveType_;
648 env->primitiveTypes |= _typeHandle;
650 primitiveTypeButtons_.insert(std::pair<PrimitiveType,QAction*>(_typeHandle,action));
653 nextFreePrimitiveType_ <<= 1;
656 connect(action, SIGNAL(toggled(
bool)),
this, SLOT(updateActivePrimitiveTypes(
bool)));
663 void SelectionBasePlugin::updateActivePrimitiveTypes(
bool _checked) {
665 QObject* sender = QObject::sender();
669 if(!clickedAction)
return;
672 clickedAction->setChecked(_checked);
675 currentPrimitiveType_ = 0u;
677 QList<QAction*> actions = primitivesBarGroup_->actions();
678 for(
int i = 0; i < actions.size(); ++i) {
680 if(actions[i]->isChecked()) {
693 slotSelectionEnvironmentRequested(_checked);
698 QList<QAction*> sm_actions = selectionModesGroup_->actions();
699 bool atLeastOneSelectionMode =
false;
700 for(
int i = 0; i < sm_actions.size(); ++i) {
702 if(sm_actions[i]->isChecked()) {
703 atLeastOneSelectionMode =
true;
707 if(!ha->isAssociated(currentPrimitiveType_)) {
708 ha->blockSignals(
true);
709 ha->setChecked(
false);
710 ha->blockSignals(
false);
711 toggleSelectionAction_->trigger();
717 if(!atLeastOneSelectionMode) {
718 toggleSelectionAction_->trigger();
724 tool_->typeTabWidget->setCurrentIndex(tool_->typeTabWidget->indexOf(env->tabWidget));
730 lassoSelection_ =
false;
734 slotShowAndHideOperations();
735 slotShowAndHideParameters();
744 if (_metaphor == SB_TOGGLE)
745 toggleSelectionAction_->trigger();
746 else if (_metaphor == SB_LASSO)
747 lassoSelectionAction_->trigger();
748 else if (_metaphor == SB_VOLUME_LASSO)
749 volumeLassoSelectionAction_->trigger();
750 else if (_metaphor == SB_SURFACE_LASSO)
751 surfaceLassoSelectionAction_->trigger();
752 else if (_metaphor == SB_SPHERE)
753 sphereSelectionAction_->trigger();
754 else if (_metaphor == SB_BOUNDARY)
755 boundarySelectionAction_->trigger();
756 else if (_metaphor == SB_FLOODFILL)
757 floodFillSelectionAction_->trigger();
758 else if (_metaphor == SB_COMPONENTS)
759 componentsSelectionAction_->trigger();
762 std::map<QString,SelectionEnvironment>::iterator it = selectionEnvironments_.begin();
764 for (; it != selectionEnvironments_.end() && !found; ++it) {
765 std::set<HandleAction*>::iterator e = it->second.customSelectionModes.begin();
766 for(; e != it->second.customSelectionModes.end(); ++e) {
768 QString customModeName = QString((*e)->selectionEnvironmentHandle() +
"_" + _metaphor).replace(
" ",
"_");
769 if((*e)->selectionModeHandle().contains(customModeName)) {
782 QList<QAction*>::iterator a_it = primitivesBarGroup_->actions().begin();
783 for(; a_it != primitivesBarGroup_->actions().end(); ++a_it) {
784 if((*a_it)->text() == _primitive) {
793 void SelectionBasePlugin::slotAddSelectionOperations(QString _handleName, QStringList _operationsList, QString _category, PrimitiveType _type) {
798 emit log(
LOGERR, QString(
"Could not find selection environment with handle '%1'!").arg(_handleName));
803 std::map<QString,std::pair<FillingLayout*,QGroupBox*> >::iterator it = env->categories.find(_category);
804 if(it == env->categories.end()) {
807 QGroupBox* group =
new QGroupBox(_category);
808 group->setLayout(fillLayout);
810 std::pair<std::map<QString,std::pair<FillingLayout*,QGroupBox*> >::iterator,
bool> ret;
811 ret = env->categories.insert(std::pair<QString,std::pair<FillingLayout*,QGroupBox*> >(_category,
812 std::pair<FillingLayout*,QGroupBox*>(fillLayout,group)));
815 env->operationsBar->addWidget(group);
819 for(
int i = 0; i < _operationsList.size(); ++i) {
820 QPushButton* button =
new QPushButton(_operationsList[i]);
821 button->setDisabled(
true);
822 button->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed);
823 int width = button->fontMetrics().width(_operationsList[i]);
824 button->setMinimumWidth(width);
825 button->setFixedHeight(26);
827 connect(button, SIGNAL(clicked()),
this, SLOT(slotOperationRequested()));
829 env->operations.insert(std::pair<PrimitiveType,QPushButton*>(_type, button));
831 (*it).second.first->addWidget(button);
834 slotShowAndHideOperations();
839 void SelectionBasePlugin::slotAddSelectionParameters(QString _handleName, QWidget* _widget, QString _category, PrimitiveType _type)
844 emit log(
LOGERR, QString(
"Could not find selection environment with handle '%1'!").arg(_handleName));
849 std::map<QString,std::pair<FillingLayout*,QGroupBox*> >::iterator it = env->categories.find(_category);
850 if(it == env->categories.end()) {
853 QGroupBox* group =
new QGroupBox(_category);
854 group->setLayout(fillLayout);
856 std::pair<std::map<QString,std::pair<FillingLayout*,QGroupBox*> >::iterator,
bool> ret;
857 ret = env->categories.insert(std::pair<QString,std::pair<FillingLayout*,QGroupBox*> >(_category,
858 std::pair<FillingLayout*,QGroupBox*>(fillLayout,group)));
861 env->operationsBar->addWidget(group);
865 env->parameters.insert(std::pair<PrimitiveType,QWidget*>(_type, _widget));
867 (*it).second.first->addWidget(_widget);
870 slotShowAndHideParameters();
875 void SelectionBasePlugin::slotOperationRequested() {
877 QObject* sender = QObject::sender();
878 QPushButton* button = 0;
879 button =
dynamic_cast<QPushButton*
>(sender);
883 emit selectionOperation(button->text());
888 void SelectionBasePlugin::slotShowAndHideOperations() {
890 for(std::map<QString,SelectionEnvironment>::iterator e_it = selectionEnvironments_.begin();
891 e_it != selectionEnvironments_.end(); ++e_it) {
893 for(std::multimap<PrimitiveType,QPushButton*>::iterator it = (*e_it).second.operations.begin();
894 it != (*e_it).second.operations.end(); ++it) {
896 if((currentPrimitiveType_ & (*it).first) || (*it).first == 0u) {
898 (*it).second->setDisabled(
false);
901 (*it).second->setDisabled(
true);
909 void SelectionBasePlugin::slotShowAndHideParameters() {
911 for(std::map<QString,SelectionEnvironment>::iterator e_it = selectionEnvironments_.begin();
912 e_it != selectionEnvironments_.end(); ++e_it) {
914 for(std::multimap<PrimitiveType,QWidget*>::iterator it = (*e_it).second.parameters.begin();
915 it != (*e_it).second.parameters.end(); ++it) {
917 if((currentPrimitiveType_ & (*it).first) || (*it).first == 0u) {
919 (*it).second->setDisabled(
false);
922 (*it).second->setDisabled(
true);
930 void SelectionBasePlugin::slotSelectionEnvironmentRequested(
bool _checked) {
937 currentPickMode_ = SELECTION_PICKING;
942 void SelectionBasePlugin::slotEnterSelectionMode(
bool _checked) {
944 QObject* obj = QObject::sender();
951 act->setChecked(_checked);
961 lassoSelection_ =
false;
963 if(currentSelectionMode_ == SB_SPHERE) {
971 void SelectionBasePlugin::slotPickModeChanged (
const std::string& _pickmode) {
974 bool selectionPicking = (_pickmode ==
"SelectionBasePicking");
977 if(currentSelectionMode_ == SB_SPHERE)
978 sphere_node_->
show();
980 sphere_node_->
hide();
982 if(currentSelectionMode_ == SB_LASSO || currentSelectionMode_ == SB_VOLUME_LASSO)
987 bool resetPickToolBar =
false;
989 if(currentPickMode_ != NO_SELECTION_PICKING) {
993 sphere_node_->
hide();
997 lastPickMode_ = currentPickMode_;
998 currentPickMode_ = NO_SELECTION_PICKING;
1000 }
else if (selectionPicking && currentPickMode_ == NO_SELECTION_PICKING && lastPickMode_ != NO_SELECTION_PICKING) {
1003 currentPickMode_ = lastPickMode_;
1005 }
else if (!selectionPicking && currentPickMode_ == NO_SELECTION_PICKING) {
1009 linePoints_.clear();
1014 currentPickMode_ = NO_SELECTION_PICKING;
1015 currentSelectionMode_ = NO_SELECTION_MODE;
1016 lastPickMode_ = NO_SELECTION_PICKING;
1019 resetPickToolBar =
true;
1025 lastPickMode_ = currentPickMode_ = _pickmode.c_str();
1028 resetPickToolBar =
true;
1031 linePoints_.clear();
1036 toggleSelectionAction_->setChecked(!resetPickToolBar && currentSelectionMode_ == SB_TOGGLE);
1037 lassoSelectionAction_->setChecked(!resetPickToolBar && currentSelectionMode_ == SB_LASSO);
1038 volumeLassoSelectionAction_->setChecked(!resetPickToolBar && currentSelectionMode_ == SB_VOLUME_LASSO);
1039 surfaceLassoSelectionAction_->setChecked(!resetPickToolBar && currentSelectionMode_ == SB_SURFACE_LASSO);
1040 sphereSelectionAction_->setChecked(!resetPickToolBar && currentSelectionMode_ == SB_SPHERE);
1041 boundarySelectionAction_->setChecked(!resetPickToolBar && currentSelectionMode_ == SB_BOUNDARY);
1042 floodFillSelectionAction_->setChecked(!resetPickToolBar && currentSelectionMode_ == SB_FLOODFILL);
1043 componentsSelectionAction_->setChecked(!resetPickToolBar && currentSelectionMode_ == SB_COMPONENTS);
1045 for(std::map<QString,SelectionEnvironment>::iterator it = selectionEnvironments_.begin();
1046 it != selectionEnvironments_.end(); ++it) {
1049 for(std::set<HandleAction*>::iterator csm_it = (*it).second.customSelectionModes.begin();
1050 csm_it != (*it).second.customSelectionModes.end(); ++csm_it) {
1051 (*csm_it)->setChecked(!resetPickToolBar && currentSelectionMode_ == (*csm_it)->selectionModeHandle());
1055 if(selectionPicking)
1062 bool _show, SelectionInterface::PrimitiveType _associatedTypes,
1063 QString& _customIdentifier,
bool _custom,
DataType _objectTypeRestriction) {
1065 if ( !OpenFlipper::Options::gui() )
1074 if(_mode == SB_TOGGLE) {
1076 }
else if (_mode == SB_LASSO) {
1078 }
else if (_mode == SB_VOLUME_LASSO) {
1080 }
else if (_mode == SB_SURFACE_LASSO) {
1082 }
else if (_mode == SB_SPHERE) {
1084 }
else if (_mode == SB_BOUNDARY) {
1086 }
else if (_mode == SB_FLOODFILL) {
1088 }
else if (_mode == SB_COMPONENTS) {
1099 action->setCheckable(
true);
1105 selectionModesGroup_->addAction(action);
1106 pickModeToolBar_->clear();
1107 pickModeToolBar_->addActions(primitivesBarGroup_->actions());
1108 pickModeToolBar_->addSeparator();
1109 pickModeToolBar_->addActions(selectionModesGroup_->actions());
1112 env->customSelectionModes.insert(action);
1114 connect(action, SIGNAL(triggered(
bool)),
this, SLOT(slotEnterSelectionMode(
bool)));
1117 std::set<HandleAction*>::iterator e = env->customSelectionModes.begin();
1118 for(; e != env->customSelectionModes.end(); ++e) {
1119 if((*e)->selectionEnvironmentHandle() == _handleName)
1124 if(e != env->customSelectionModes.end()) {
1125 (*e)->removeAssociatedType(_associatedTypes);
1126 env->customSelectionModes.erase(e);
1134 void SelectionBasePlugin::slotAddCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QString _icon,
1135 SelectionInterface::PrimitiveType _associatedTypes, QString& _customIdentifier) {
1137 showSelectionMode(_modeName, _icon, _description, _handleName,
true, _associatedTypes, _customIdentifier,
true);
1143 void SelectionBasePlugin::slotAddCustomSelectionMode(QString _handleName, QString _modeName, QString _description, QString _icon,
1144 SelectionInterface::PrimitiveType _associatedTypes, QString& _customIdentifier,
1147 showSelectionMode(_modeName, _icon, _description, _handleName,
true, _associatedTypes, _customIdentifier,
true, _objectTypeRestriction);
1153 void SelectionBasePlugin::slotShowToggleSelectionMode(QString _handleName,
bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
1155 QString iconPath = OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator();
1157 showSelectionMode(SB_TOGGLE, iconPath + TOGGLE_IMG, TOGGLE_DESC, _handleName, _show, _associatedTypes, dummy);
1163 void SelectionBasePlugin::slotShowLassoSelectionMode(QString _handleName,
bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
1165 QString iconPath = OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator();
1167 showSelectionMode(SB_LASSO, iconPath + LASSO_IMG, LASSO_DESC, _handleName, _show, _associatedTypes, dummy);
1173 void SelectionBasePlugin::slotShowVolumeLassoSelectionMode(QString _handleName,
bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
1175 QString iconPath = OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator();
1177 showSelectionMode(SB_VOLUME_LASSO, iconPath + VOLUME_LASSO_IMG, VOLUME_LASSO_DESC, _handleName, _show, _associatedTypes, dummy);
1183 void SelectionBasePlugin::slotShowSurfaceLassoSelectionMode(QString _handleName,
bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
1185 QString iconPath = OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator();
1187 showSelectionMode(SB_SURFACE_LASSO, iconPath + SURFACE_LASSO_IMG, SURFACE_LASSO_DESC, _handleName, _show, _associatedTypes, dummy);
1193 void SelectionBasePlugin::slotShowSphereSelectionMode(QString _handleName,
bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
1195 QString iconPath = OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator();
1197 showSelectionMode(SB_SPHERE, iconPath + SPHERE_IMG, SPHERE_DESC, _handleName, _show, _associatedTypes, dummy);
1203 void SelectionBasePlugin::slotShowClosestBoundarySelectionMode(QString _handleName,
bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
1205 QString iconPath = OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator();
1207 showSelectionMode(SB_BOUNDARY, iconPath + BOUNDARY_IMG, BOUNDARY_DESC, _handleName, _show, _associatedTypes, dummy);
1213 void SelectionBasePlugin::slotShowFloodFillSelectionMode(QString _handleName,
bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
1215 QString iconPath = OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator();
1217 showSelectionMode(SB_FLOODFILL, iconPath + FLOODFILL_IMG, FLOODFILL_DESC, _handleName, _show, _associatedTypes, dummy);
1223 void SelectionBasePlugin::slotShowComponentsSelectionMode(QString _handleName,
bool _show, SelectionInterface::PrimitiveType _associatedTypes) {
1225 QString iconPath = OpenFlipper::Options::iconDirStr() + OpenFlipper::Options::dirSeparator();
1227 showSelectionMode(SB_COMPONENTS, iconPath + COMPONENTS_IMG, COMPONENTS_DESC, _handleName, _show, _associatedTypes, dummy);
1233 void SelectionBasePlugin::slotGetActiveDataTypes(TypeList& _types) {
1235 if(currentPickMode_ == NO_SELECTION_PICKING) {
1236 _types = TypeList();
1238 std::map<QString,SelectionEnvironment>::iterator it = selectionEnvironments_.find(currentPickMode_);
1239 if(it == selectionEnvironments_.end()) {
1240 _types = TypeList();
1242 _types = (*it).second.types;
1249 void SelectionBasePlugin::slotGetActivePrimitiveType(SelectionInterface::PrimitiveType& _type) {
1251 _type = currentPrimitiveType_;
1256 void SelectionBasePlugin::slotMouseToggleSelection(QMouseEvent* _event) {
1259 if (_event->type() == QEvent::MouseButtonPress) {
1261 if (_event->button() == Qt::RightButton)
return;
1263 emit toggleSelection(_event, currentPrimitiveType_, deselection_);
1269 void SelectionBasePlugin::slotMouseLassoSelection(QMouseEvent* _event) {
1272 if (_event->button() == Qt::RightButton)
return;
1274 size_t node_idx, target_idx;
1282 if(_event->type() == QEvent::MouseButtonPress && _event->button() == Qt::LeftButton) {
1285 if(!lassoSelection_) {
1287 linePoints_.clear();
1288 lassoSelection_ =
true;
1294 linePoints_.push_back(hit_point);
1297 emit lassoSelection(_event, currentPrimitiveType_, deselection_);
1299 }
else if(_event->type() == QEvent::MouseMove) {
1301 if(!lassoSelection_)
return;
1311 line_node_->
clear();
1312 for (std::vector< ACG::Vec3d >::iterator it = linePoints_.begin(); it != linePoints_.end(); ++it)
1318 if( !linePoints_.empty() )
1321 }
else if(_event->type() == QEvent::MouseButtonDblClick) {
1324 lassoSelection_ =
false;
1325 linePoints_.clear();
1326 line_node_->
clear();
1330 emit lassoSelection(_event, currentPrimitiveType_, deselection_);
1336 void SelectionBasePlugin::slotMouseVolumeLassoSelection(QMouseEvent* _event) {
1339 if (_event->button() == Qt::RightButton)
return;
1341 size_t node_idx, target_idx;
1349 if(_event->type() == QEvent::MouseButtonPress && _event->button() == Qt::LeftButton) {
1352 if(!lassoSelection_) {
1354 linePoints_.clear();
1355 lassoSelection_ =
true;
1362 linePoints_.push_back(hit_point);
1365 emit volumeLassoSelection(_event, currentPrimitiveType_, deselection_);
1367 }
else if(_event->type() == QEvent::MouseMove) {
1369 if(!lassoSelection_)
return;
1379 line_node_->
clear();
1380 for (std::vector< ACG::Vec3d >::iterator it = linePoints_.begin(); it != linePoints_.end(); ++it)
1386 if( !linePoints_.empty() )
1389 }
else if(_event->type() == QEvent::MouseButtonDblClick) {
1392 lassoSelection_ =
false;
1393 linePoints_.clear();
1394 line_node_->
clear();
1398 emit volumeLassoSelection(_event, currentPrimitiveType_, deselection_);
1404 void SelectionBasePlugin::slotMouseSurfaceLassoSelection(QMouseEvent* _event) {
1411 void SelectionBasePlugin::slotMouseSphereSelection(QMouseEvent* _event) {
1414 if (_event->button() == Qt::RightButton)
return;
1417 size_t node_idx, target_idx;
1421 sphere_node_->
hide();
1425 _event->pos(), node_idx, target_idx, &hit_point)) {
1432 sphere_node_->
show();
1434 sphere_node_->
set_size(sphere_radius_);
1437 if( (_event->buttons() & Qt::LeftButton)
1438 ||( (_event->buttons() == Qt::NoButton) && (_event->type() == QEvent::MouseButtonRelease))
1441 emit sphereSelection(_event, sphere_radius_, currentPrimitiveType_, deselection_);
1447 sphere_node_->
hide();
1453 void SelectionBasePlugin::slotMouseBoundarySelection(QMouseEvent* _event) {
1456 if (_event->type() == QEvent::MouseButtonPress) {
1458 if (_event->button() == Qt::RightButton)
return;
1460 emit closestBoundarySelection(_event, currentPrimitiveType_, deselection_);
1466 void SelectionBasePlugin::slotMouseFloodFillSelection(QMouseEvent* _event) {
1469 if (_event->type() == QEvent::MouseButtonPress) {
1471 if (_event->button() == Qt::RightButton)
return;
1473 emit floodFillSelection(_event, currentPrimitiveType_, deselection_);
1479 void SelectionBasePlugin::slotMouseComponentsSelection(QMouseEvent* _event) {
1482 if (_event->type() == QEvent::MouseButtonPress) {
1484 if (_event->button() == Qt::RightButton)
return;
1486 emit componentsSelection(_event, currentPrimitiveType_, deselection_);
1492 void SelectionBasePlugin::slotMouseCustomSelection(QMouseEvent* _event) {
1494 emit customSelection(_event, currentPrimitiveType_, currentSelectionMode_, deselection_);
1499 void SelectionBasePlugin::addedEmptyObject (
int _id) {
1513 availableObjectTypes_ |= obj->
dataType();
1520 if (bObject && !bObject->
isGroup()) {
1521 emit log(
LOGERR,
"Could not retrieve object type! Maybe a selection environment will be missing.");
1528 tool_->typeTabWidget->setTabEnabled(tool_->typeTabWidget->indexOf(env->tabWidget),
true);
1529 env->tabWidget->setEnabled(
true);
1547 void SelectionBasePlugin::objectDeleted (
int _id) {
1560 availableObjectTypes_ = (availableObjectTypes_ & ~obj->
dataType().value());
1562 emit log(
LOGERR,
"Could not retrieve object type!");
1573 bool atLeastOne =
false;
1574 for(std::vector<DataType>::iterator t_it = env->types.begin();
1575 t_it != env->types.end(); ++t_it) {
1584 tool_->typeTabWidget->setTabEnabled(tool_->typeTabWidget->indexOf(env->tabWidget), atLeastOne);
1585 env->tabWidget->setEnabled(atLeastOne);
1595 std::cerr <<
"====== ERROR =======" << std::endl;
1596 std::cerr <<
"Negative counter for type " << obj->
dataType().name().toStdString() << std::endl;
1599 std::cerr <<
"Error: No counter for type " << obj->
dataType().name().toStdString() << std::endl;
1609 void SelectionBasePlugin::updateTabsOrder() {
1611 std::map<int, int> newMappings;
1614 for(
int i = 0; i < tool_->typeTabWidget->count(); ++i) {
1615 if(tool_->typeTabWidget->isTabEnabled(i)) {
1616 tool_->typeTabWidget->insertTab(firstFree, tool_->typeTabWidget->widget(i), tool_->typeTabWidget->tabText(i));
1617 newMappings.insert(std::pair<int,int>(i,firstFree));
1621 newMappings.insert(std::pair<int,int>(i,i));
1626 if(tool_->typeTabWidget->count() > 0) tool_->typeTabWidget->setCurrentIndex(0);
1631 void SelectionBasePlugin::slotTargetObjectsOnly(
bool& _targetsOnly) {
1633 if(OpenFlipper::Options::nogui() || tool_ == 0) {
1634 _targetsOnly =
true;
1636 _targetsOnly = tool_->restrictOnTargets->isChecked();
1651 QString needle = _name;;
1654 needle.append(QString::number(_num));
1658 for(std::map<QString,SelectionEnvironment>::iterator it = selectionEnvironments_.begin();
1659 it != selectionEnvironments_.end(); ++it) {
1663 for(std::set<HandleAction*>::iterator dsm_it = (*it).second.defaultSelectionModes.begin();
1664 dsm_it != (*it).second.defaultSelectionModes.end(); ++dsm_it) {
1666 if((*dsm_it)->selectionModeHandle() == needle) {
1687 QString needle = _name;;
1690 needle.append(QString::number(_num));
1694 for(std::map<QString,SelectionEnvironment>::iterator it = selectionEnvironments_.begin();
1695 it != selectionEnvironments_.end(); ++it) {
1697 if((*it).first == needle) {
1711 QMap<DataType, int>::iterator iterator =
typeCounter_.find(_type);
1716 if ( _excludeId != -1 ) {
1722 if (
object == 0 ) {
1723 std::cerr <<
"Unable to get Object for type exists" << std::endl;
1733 std::cerr <<
"Type exists Error after mismatch exclude: " << _type.
name().toStdString() <<
" negative count" << std::endl;
1745 std::cerr <<
"Type exists Error " << _type.
name().toStdString() <<
" negative count" << std::endl;
1756 std::cerr <<
"Type exists Error " << _type.
name().toStdString() <<
" negative count" << std::endl;
1772 void SelectionBasePlugin::slotRegisterKeyShortcut(
int _key, Qt::KeyboardModifiers _modifiers) {
1774 std::set<std::pair<int,Qt::KeyboardModifiers> >::iterator f =
1775 registeredKeys_.find(std::pair<int,Qt::KeyboardModifiers>(_key,_modifiers));
1777 if(f == registeredKeys_.end()) {
1779 emit registerKey(_key, _modifiers, QString(
"Selection base key %1").arg(_key),
true);
1780 registeredKeys_.insert(std::pair<int,Qt::KeyboardModifiers>(_key,_modifiers));
1789 std::map<QString,SelectionEnvironment>::iterator it = selectionEnvironments_.find(_handleName);
1792 if(it == selectionEnvironments_.end())
return false;
1793 env = &(it->second);
1800 HandleAction* toggleSelectionAction_, PrimitiveType& _associatedTypes)
1803 env->defaultSelectionModes.insert(toggleSelectionAction_);
1806 std::set<HandleAction*>::iterator e = env->defaultSelectionModes.find(toggleSelectionAction_);
1807 if(e != env->defaultSelectionModes.end()) {
1808 env->defaultSelectionModes.erase(e);
1809 toggleSelectionAction_->removeAssociatedType(_associatedTypes);
1818 std::map<QString,SelectionEnvironment>::iterator it = selectionEnvironments_.begin();
1826 for(;it != selectionEnvironments_.end(); ++it) {
1829 for(std::vector<DataType>::iterator t_it = (*it).second.types.begin();
1830 t_it != (*it).second.types.end(); ++t_it) {
DrawMode SOLID_SMOOTH_SHADED
draw smooth shaded (Gouraud shaded) faces (requires halfedge normals)
Execute action on node first and then on its children.
SelectionBasePlugin()
Default constructor.
bool isGroup() const
Check if object is a group.
ACG::SceneGraph::MaterialNode MaterialNode
Materialnode.
void addGlobalNode(ACG::SceneGraph::BaseNode *_node)
Add a global node.
QMap< DataType, int > typeCounter_
Caches the number of available elements of a certain data type for the typeExists function...
bool scenegraphPick(ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, size_t &_nodeIdx, size_t &_targetIdx, ACG::Vec3d *_hitPointPtr=0)
Execute picking operation on scenegraph.
Draw node in second pass.
pick any of the prior targets (should be implemented for all nodes)
void enablePicking(bool _enable)
void hide()
Hide Node: set status to HideNode.
void clear_points()
clear points/lines
bool getSelectionEnvironment(SelectionEnvironment *&env, const QString &_handleName)
Get a selectionEnvironment by a given name.
Primitive & get_primitive(int _idx)
get a primitive
QString getUniqueHandleName(QString _name, int _num=0)
Get a unique handle name.
void set_color(const Vec4f &_c)
set color (base, ambient, diffuse, specular) based on _c
bool getPickedObject(const size_t _node_idx, BaseObjectData *&_object)
Get the picked mesh.
int context_height() const
get gl context height
void updatePickModeToolBar()
Update the pickmode toolbar.
DrawModes::DrawMode drawMode() const
Return the own draw modes of this node.
VectorT< float, 4 > Vec4f
void selectionEnvironmentHandle(QString _handle)
Get/Set selection environment handle name.
void set_size(double _s, int _idx=0)
set size
bool dataType(DataType _type) const
bool connect(const QString &name, const bool create)
Connect INIFile object with given filename.
bool hidden()
Is node not visible (status != Active)?
void add_point(const Vec3d &_v)
add point (for LineMode == PolygonMode)
QString getUniqueIdentifierName(QString _name, int _num=0)
Get a unique pickmode name.
void setSelectionPrimitiveType(QString _primitive)
Enables setting the selection primitive via scripting The default primitives for OpenMesh are: ...
apply material (ambient, diffuse, specular, shininess)
void addAssociatedType(unsigned int _associatedType)
Get/Set associated primitive types.
void primitiveType(unsigned int _type)
Get/Set primitive type.
bool getObject(const int _identifier, BaseObject *&_object)
Get the object which has the given identifier.
bool findObjectType(BaseObjectData *&obj, bool &found, SelectionEnvironment *&env, int _id)
helper function to find a baseObjectData and selection environment given a specific id ...
Viewer::ViewerProperties & viewerProperties(int _id)
Get the viewer properties Use this functions to get basic viewer properties such as backgroundcolor o...
Vec3d unproject(const Vec3d &_winPoint) const
unproject point in window coordinates _winPoint to world coordinates
void setSelectionMetaphor(QString _metaphor)
Enables setting the selection metaphor via scripting The default selection metaphors are: ...
void show()
Show node: set status to Active.
void set_line_width(float _sz)
set line width (default: 1.0)
void setTraverseMode(unsigned int _mode)
Set traverse mode for node.
void selectionModeShowSwitch(bool _show, SelectionEnvironment *&env, HandleAction *toggleSelectionAction_, SelectionInterface::PrimitiveType &_associatedTypes)
helper function for showSelectionMode
void enable_blending(GLenum _p1=GL_SRC_ALPHA, GLenum _p2=GL_ONE_MINUS_SRC_ALPHA)
enable blending with Parameters (_p1, _p2)
QString name() const
Return the name of this type as text.
unsigned int applyProperties() const
get properties that will be applied (OR'ed ApplyProperties)
void clear()
clear points/lines and colors
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 typeExists(DataType _type, int _excludeId=-1)
Test if at least one object of type _type is in the scene graph.
SelectionTypeFrameWidget * createNewTypeFrame(SelectionEnvironment &_env)
Create new type frame for tabs widget.
ACG::GLState & glState()
Get the glState of the Viewer.
picks faces (should be implemented for all nodes)
Viewer::ActionMode actionMode()
Get the current Action mode.
void set_position(const Vec3d &_p, int _idx=0)
set position
void enable_backface_culling()
enable backface culling (not active by default, see applyProperties)
double sceneRadius()
Returns the current scene radius from the active examiner widget.
void showSelectionMode(QString _mode, QString _icon, QString _desc, QString _handleName, bool _show, SelectionInterface::PrimitiveType _associatedTypes, QString &_customIdentifier, bool _custom=false, DataType _objectTypeRestriction=DATA_ALL)
void set_base_color(const Vec4f &_c)
set the base color ( Same as set_emission(const Vec4f& _c) )
void disconnect()
Remove connection of this object to a file.
void disable_alpha_test()
disable alpha test
bool & alwaysOnTop()
get and set always on top
const std::string pickMode()
Get the current Picking mode.
Class for the handling of simple configuration files.
void selectionModeHandle(QString _handle)
Get/Set selection mode handle name.