How to get parent/child pqPipelineSource objects in the Pipeline Broswer in c++?

    pqApplicationCore* core = pqApplicationCore::instance();
    pqServerManagerModel* smmodel = core->getServerManagerModel();
    QList<pqPipelineSource*> items = smmodel->findChildren<pqPipelineSource*>();
    for (int i = 0; i < items .length(); ++i)
    {
      auto source = items.at(i);
      char* XMLName = source->getProxy()->GetXMLName();
      if (strcmp(XMLName, "Transform") == 0)
      {
        // found the transform filter here
        // but how to find its input in the tree (which is either the cube or cone)? 
      }
    }

image

child is easy, use getConsumer. Getting the parent is not as easy and needs to use

getProxy()->GetProducerProxy()

1 Like