diff options
Diffstat (limited to 'src/Authoring/Client/Code/Core/Doc')
-rw-r--r-- | src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp | 23 | ||||
-rw-r--r-- | src/Authoring/Client/Code/Core/Doc/IDocumentEditor.h | 2 |
2 files changed, 25 insertions, 0 deletions
diff --git a/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp b/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp index 0b9b4d8f..3b2b76cc 100644 --- a/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp +++ b/src/Authoring/Client/Code/Core/Doc/DocumentEditor.cpp @@ -4286,6 +4286,29 @@ public: } } + void toggleBoolPropertyOnSelected(TPropertyHandle property) override + { + qt3dsdm::IPropertySystem *propertySystem = m_Doc.GetStudioSystem()->GetPropertySystem(); + qt3dsdm::TInstanceHandleList selectedInstances + = m_Doc.GetSelectedValue().GetSelectedInstances(); + + if (selectedInstances.size() > 0) { + bool boolValue = false; + SValue value; + for (size_t idx = 0, end = selectedInstances.size(); idx < end; ++idx) { + qt3dsdm::Qt3DSDMInstanceHandle handle(selectedInstances[idx]); + if (handle.Valid()) { + if (value.empty()) { + // First valid handle selects if all are hidden/unhidden + propertySystem->GetInstancePropertyValue(handle, property, value); + boolValue = !qt3dsdm::get<bool>(value); + } + propertySystem->SetInstancePropertyValue(handle, property, boolValue); + } + } + } + } + void BuildDAEMap(const TFileModificationList &inList) { for (size_t fileIdx = 0, fileEnd = inList.size(); fileIdx < fileEnd; ++fileIdx) { diff --git a/src/Authoring/Client/Code/Core/Doc/IDocumentEditor.h b/src/Authoring/Client/Code/Core/Doc/IDocumentEditor.h index 824b80ec..468327a6 100644 --- a/src/Authoring/Client/Code/Core/Doc/IDocumentEditor.h +++ b/src/Authoring/Client/Code/Core/Doc/IDocumentEditor.h @@ -420,6 +420,8 @@ public: virtual void ExternalizePath(TInstanceHandle path) = 0; virtual void InternalizePath(TInstanceHandle path) = 0; + virtual void toggleBoolPropertyOnSelected(TPropertyHandle property) = 0; + static std::shared_ptr<IDOMReader> ParseScriptFile(const Q3DStudio::CFilePath &inFullPathToDocument, std::shared_ptr<qt3dsdm::IStringTable> inStringTable, |