Workaround function used to get the original OutputSlot connected to the InputSlot of a SubgraphView As working copy SubgraphViews do not have connections on boundary it finds the corresponding InputSlot on the Original SubgraphView and then returns the OutputSlot connected to it. Using this function to test against the simpler API: SubgraphView::GetOriginalInputSlots().
| 2061 | // on the Original SubgraphView and then returns the OutputSlot connected to it. |
| 2062 | // Using this function to test against the simpler API: SubgraphView::GetOriginalInputSlots(). |
| 2063 | const IOutputSlot* GetConnection(IInputSlot* inputSlot, |
| 2064 | const SubgraphView& workingCopy, |
| 2065 | const SubgraphView& original) |
| 2066 | { |
| 2067 | const IOutputSlot* res = inputSlot->GetConnection(); |
| 2068 | if (res) |
| 2069 | { |
| 2070 | return res; |
| 2071 | } |
| 2072 | |
| 2073 | const SubgraphView::IInputSlots& workingCopyInputSlots = workingCopy.GetIInputSlots(); |
| 2074 | const SubgraphView::IInputSlots& originalInputSlots = original.GetIInputSlots(); |
| 2075 | for (SubgraphView::InputSlots::size_type i = 0; i < workingCopyInputSlots.size(); i++) |
| 2076 | { |
| 2077 | if (workingCopyInputSlots[i] == inputSlot) |
| 2078 | { |
| 2079 | return originalInputSlots[i]->GetConnection(); |
| 2080 | } |
| 2081 | } |
| 2082 | return nullptr; |
| 2083 | } |
| 2084 | |
| 2085 | // Workaround function used to get the original InputSlot connected to the OutputSlot of a SubgraphView |
| 2086 | // As working copy SubgraphViews do not have connections on boundary it finds the corresponding OutputSlot |
no test coverage detected