Hello!
What is the difference between the two ways to get the dataset on the client side?
auto sourceProxy = pqActiveObjects::instance().activeSource()->getProxy();
auto algorithm = sourceProxy ? vtkAlgorithm::SafeDownCast(sourceProxy->GetClientSideObject()) : nullptr;
auto dataset = algorithm ? vtkDataSet::SafeDownCast(algorithm->GetOutputDataObject(0)) : nullptr;
And
using vtkSrcPrxyPtr = vtkSmartPointer<vtkSMSourceProxy>;
vtkSrcPrxyPtr filter{};
vtkSmartPointer<vtkDataSet> dataSet{};
auto proxyManager = vtkSMProxyManager::GetProxyManager()->GetActiveSessionProxyManager();
int sourcePortNumber = 0;
if (source && (filter = vtkSrcPrxyPtr::Take(vtkSMSourceProxy::SafeDownCast(proxyManager->NewProxy("filters", "ClientServerMoveData")))))
{
if (auto inputProperty = vtkSMInputProperty::SafeDownCast(filter->GetProperty("Input")))
{
inputProperty->RemoveAllProxies();
inputProperty->AddInputConnection(source, sourcePortNumber);
}
vtkSMPropertyHelper{ filter, "OutputDataType" }.Set(VTK_POLY_DATA);
filter->UpdateVTKObjects();
//source = filter;
sourcePortNumber = 0;
}
if (filter)
{
filter->UpdatePipeline();
dataSet = vtkDataSet::SafeDownCast(vtkAlgorithm::SafeDownCast(filter->GetClientSideObject())->GetOutputDataObject(sourcePortNumber));
}