History

Fade edited objects are now selected with ray picking

Olivier Prat committed 8 years ago

Commit 143a3151 parent 47437c95 files · +137 −62Browse files

Showing the changes to interface/src/scripting/SelectionScriptingInterface.cpp (1 of 5 files). Show all

Unified · Split

interface/src/scripting/SelectionScriptingInterface.cpp+21−1
@@ -110,7 +110,6 @@ bool SelectionScriptingInterface::enableListHighlight(const QString& listName, c · 109 unmodified lines
110110 }
111111
112112 if (!(*highlightStyle).isBoundToList()) {
113− setupHandler(listName);
114113 (*highlightStyle).setBoundToList(true);
115114 }
116115
@@ -172,6 +171,18 @@ render::HighlightStyle SelectionScriptingInterface::getHighlightStyle(const QStr · 55 unmodified lines
172171 }
173172 }
174173
174+bool SelectionScriptingInterface::enableListToScene(const QString& listName) {
175+ setupHandler(listName);
176+
177+ return true;
178+}
179+
180+bool SelectionScriptingInterface::disableListToScene(const QString& listName) {
181+ removeHandler(listName);
182+
183+ return true;
184+}
185+
175186 template <class T> bool SelectionScriptingInterface::addToGameplayObjects(const QString& listName, T idToAdd) {
176187 {
177188 QWriteLocker lock(&_selectionListsLock);
@@ -303,6 +314,15 @@ void SelectionScriptingInterface::setupHandler(const QString& selectionName) { · 125 unmodified lines
303314 (*handler)->initialize(selectionName);
304315 }
305316
317+void SelectionScriptingInterface::removeHandler(const QString& selectionName) {
318+ QWriteLocker lock(&_selectionHandlersLock);
319+ auto handler = _handlerMap.find(selectionName);
320+ if (handler != _handlerMap.end()) {
321+ delete handler.value();
322+ _handlerMap.erase(handler);
323+ }
324+}
325+
306326 void SelectionScriptingInterface::onSelectedItemsListChanged(const QString& listName) {
307327 {
308328 QWriteLocker lock(&_selectionHandlersLock);