void ezQtNodeScene::RemoveSelectedNodesAction() { ezDeque<ezQtNode*> selection; GetSelectedNodes(selection); if (selection.IsEmpty()) return; ezCommandHistory* history = GetDocumentNodeManager()->GetDocument()->GetCommandHistory(); history->StartTransaction("Remove Nodes"); for (ezQtNode* pNode : selection) { ezStatus res = RemoveNode(pNode); if (res.m_Result.Failed()) { history->CancelTransaction(); ezQtUiServices::GetSingleton()->MessageBoxStatus(res, "Failed to remove node"); return; } } history->FinishTransaction(); }
void FSoundCueEditor::CopySelectedNodes() { // Export the selected nodes and place the text on the clipboard const FGraphPanelSelectionSet SelectedNodes = GetSelectedNodes(); FString ExportedText; for (FGraphPanelSelectionSet::TConstIterator SelectedIter(SelectedNodes); SelectedIter; ++SelectedIter) { if(USoundCueGraphNode* Node = Cast<USoundCueGraphNode>(*SelectedIter)) { Node->PrepareForCopying(); } } FEdGraphUtilities::ExportNodesToText(SelectedNodes, /*out*/ ExportedText); FPlatformMisc::ClipboardCopy(*ExportedText); // Make sure SoundCue remains the owner of the copied nodes for (FGraphPanelSelectionSet::TConstIterator SelectedIter(SelectedNodes); SelectedIter; ++SelectedIter) { if (USoundCueGraphNode* Node = Cast<USoundCueGraphNode>(*SelectedIter)) { Node->PostCopyNode(); } } }
void __fastcall TfrmOpenFTPDialog::menuSearchFileClick(TObject *Sender) { if(tvFolder->Selected == NULL) return; frmSearchFile->chkSearchChildDir->Checked = Recursion; if(frmSearchFile->ShowModal() != mrOk) return; Recursion = frmSearchFile->chkSearchChildDir->Checked; Screen->Cursor = crHourGlass; lvFiles->Items->Clear(); lvFiles->Hide(); TList * NodeList = new TList; TStringList * PathList = new TStringList; GetSelectedNodes(tvFolder->Items->GetFirstNode(),NodeList); for(int n = 0;n < NodeList->Count;n++) { CreateListPaths((TTreeNode *)NodeList->Items[n],PathList,Recursion); } for(int n = 0;n < PathList->Count;n++) { SearchFile(PathList->Strings[n],"",0); } delete PathList; delete NodeList; lvFiles->Show(); Screen->Cursor = crDefault; }
void FSoundCueEditor::SyncInBrowser() { TArray<UObject*> ObjectsToSync; const FGraphPanelSelectionSet SelectedNodes = GetSelectedNodes(); for (FGraphPanelSelectionSet::TConstIterator NodeIt(SelectedNodes); NodeIt; ++NodeIt) { USoundCueGraphNode* SelectedNode = Cast<USoundCueGraphNode>(*NodeIt); if (SelectedNode) { USoundNodeWavePlayer* SelectedWave = Cast<USoundNodeWavePlayer>(SelectedNode->SoundNode); if (SelectedWave && SelectedWave->GetSoundWave()) { ObjectsToSync.AddUnique(SelectedWave->GetSoundWave()); } //ObjectsToSync.AddUnique(SelectedNode->SoundNode); } } if (ObjectsToSync.Num() > 0) { GEditor->SyncBrowserToObjects(ObjectsToSync); } }
void SBehaviorTreeDiff::FBehaviorTreeDiffPanel::CopySelectedNodes() { // Export the selected nodes and place the text on the clipboard const FGraphPanelSelectionSet SelectedNodes = GetSelectedNodes(); FString ExportedText; FEdGraphUtilities::ExportNodesToText(SelectedNodes, ExportedText); FPlatformMisc::ClipboardCopy(*ExportedText); }
void FSoundCueEditor::PlayNode() { // already checked that only one node is selected const FGraphPanelSelectionSet SelectedNodes = GetSelectedNodes(); for (FGraphPanelSelectionSet::TConstIterator NodeIt(SelectedNodes); NodeIt; ++NodeIt) { PlaySingleNode(CastChecked<UEdGraphNode>(*NodeIt)); } }
void __fastcall TfrmOpenFTPDialog::GetSelectedNodes(TTreeNode * ParentNode,TList * NodeList) { if(ParentNode->Selected) { NodeList->Add((TObject *)ParentNode); } for(int n = 0;n < ParentNode->Count;n++) { GetSelectedNodes(ParentNode->Item[n],NodeList); } }
bool FSoundCueEditor::CanCopyNodes() const { // If any of the nodes can be duplicated then we should allow copying const FGraphPanelSelectionSet SelectedNodes = GetSelectedNodes(); for (FGraphPanelSelectionSet::TConstIterator SelectedIter(SelectedNodes); SelectedIter; ++SelectedIter) { UEdGraphNode* Node = Cast<UEdGraphNode>(*SelectedIter); if ((Node != NULL) && Node->CanDuplicateNode()) { return true; } } return false; }
void FSoundCueEditor::AddInput() { const FGraphPanelSelectionSet SelectedNodes = GetSelectedNodes(); // Iterator used but should only contain one node for (FGraphPanelSelectionSet::TConstIterator NodeIt(SelectedNodes); NodeIt; ++NodeIt) { USoundCueGraphNode* SelectedNode = Cast<USoundCueGraphNode>(*NodeIt); if (SelectedNode) { SelectedNode->AddInputPin(); break; } } }
void QmitkDataNodeReinitAction::OnActionTriggered(bool /*checked*/) { if (m_WorkbenchPartSite.Expired()) { return; } if (m_DataStorage.IsExpired()) { return; } mitk::BaseRenderer::Pointer baseRenderer = GetBaseRenderer(); auto selectedNodes = GetSelectedNodes(); ReinitAction::Run(m_WorkbenchPartSite.Lock(), m_DataStorage.Lock(), selectedNodes, baseRenderer); }
bool FSoundCueEditor::CanDeleteNodes() const { const FGraphPanelSelectionSet SelectedNodes = GetSelectedNodes(); if (SelectedNodes.Num() == 1) { for (FGraphPanelSelectionSet::TConstIterator NodeIt(SelectedNodes); NodeIt; ++NodeIt) { if (Cast<USoundCueGraphNode_Root>(*NodeIt)) { // Return false if only root node is selected, as it can't be deleted return false; } } } return SelectedNodes.Num() > 0; }
bool FSoundCueEditor::CanSyncInBrowser() const { const FGraphPanelSelectionSet SelectedNodes = GetSelectedNodes(); for (FGraphPanelSelectionSet::TConstIterator NodeIt(SelectedNodes); NodeIt; ++NodeIt) { USoundCueGraphNode* SelectedNode = Cast<USoundCueGraphNode>(*NodeIt); if (SelectedNode) { USoundNodeWavePlayer* WavePlayer = Cast<USoundNodeWavePlayer>(SelectedNode->SoundNode); if (WavePlayer && WavePlayer->GetSoundWave()) { return true; } } } return false; }
void FSoundCueEditor::DeleteSelectedDuplicatableNodes() { // Cache off the old selection const FGraphPanelSelectionSet OldSelectedNodes = GetSelectedNodes(); // Clear the selection and only select the nodes that can be duplicated FGraphPanelSelectionSet RemainingNodes; SoundCueGraphEditor->ClearSelectionSet(); for (FGraphPanelSelectionSet::TConstIterator SelectedIter(OldSelectedNodes); SelectedIter; ++SelectedIter) { UEdGraphNode* Node = Cast<UEdGraphNode>(*SelectedIter); if ((Node != NULL) && Node->CanDuplicateNode()) { SoundCueGraphEditor->SetNodeSelection(Node, true); } else { RemainingNodes.Add(Node); } } // Delete the duplicatable nodes DeleteSelectedNodes(); // Reselect whatever's left from the original selection after the deletion SoundCueGraphEditor->ClearSelectionSet(); for (FGraphPanelSelectionSet::TConstIterator SelectedIter(RemainingNodes); SelectedIter; ++SelectedIter) { if (UEdGraphNode* Node = Cast<UEdGraphNode>(*SelectedIter)) { SoundCueGraphEditor->SetNodeSelection(Node, true); } } }
void FSoundCueEditor::DeleteSelectedNodes() { const FScopedTransaction Transaction( NSLOCTEXT("UnrealEd", "SoundCueEditorDeleteSelectedNode", "Delete Selected Sound Cue Node") ); SoundCueGraphEditor->GetCurrentGraph()->Modify(); const FGraphPanelSelectionSet SelectedNodes = GetSelectedNodes(); SoundCueGraphEditor->ClearSelectionSet(); for (FGraphPanelSelectionSet::TConstIterator NodeIt(SelectedNodes); NodeIt; ++NodeIt) { UEdGraphNode* Node = CastChecked<UEdGraphNode>(*NodeIt); if (Node->CanUserDeleteNode()) { if (USoundCueGraphNode* SoundGraphNode = Cast<USoundCueGraphNode>(Node)) { USoundNode* DelNode = SoundGraphNode->SoundNode; FBlueprintEditorUtils::RemoveNode(NULL, SoundGraphNode, true); // Make sure SoundCue is updated to match graph SoundCue->CompileSoundNodesFromGraphNodes(); // Remove this node from the SoundCue's list of all SoundNodes SoundCue->AllNodes.Remove(DelNode); SoundCue->MarkPackageDirty(); } else { FBlueprintEditorUtils::RemoveNode(NULL, Node, true); } } } }
bool FSoundCueEditor::CanAddInput() const { return GetSelectedNodes().Num() == 1; }
bool FSoundCueEditor::CanPlayNode() const { return GetSelectedNodes().Num() == 1; }