Skip to content
Snippets Groups Projects
Commit 48c44715 authored by Timothée Couble's avatar Timothée Couble
Browse files

[feat] Update python decorator getLidar and getReader to take an index

parent 6d379d7b
No related branches found
No related tags found
1 merge request!360[feat] Update python decorator getSensor and getReader to take an index
Pipeline #296941 passed
Pipeline: LidarView

#296942

    ......@@ -416,6 +416,17 @@ pqPipelineSource* lqSensorListWidget::getActiveLidarSource()
    return nullptr;
    }
    //-----------------------------------------------------------------------------
    pqPipelineSource* lqSensorListWidget::getLidarSource(int index)
    {
    if (index < 0 || index >= this->sensorWidgets.size())
    {
    return nullptr;
    }
    lqSensorWidget* sw = this->sensorWidgets[index];
    return sw->GetLidarSource();
    }
    //-----------------------------------------------------------------------------
    pqPipelineSource* lqSensorListWidget::getActiveSourceToDisplay()
    {
    ......@@ -452,27 +463,36 @@ bool lqSensorListWidget::isInLiveSensorMode()
    }
    //-----------------------------------------------------------------------------
    vtkSMProxy* lqSensorListWidget::getLidar()
    vtkSMProxy* lqSensorListWidget::getLidar(int idx)
    {
    return this->getActiveLidarSource() ? this->getActiveLidarSource()->getProxy() : nullptr;
    pqPipelineSource* source = nullptr;
    if (idx == -1)
    {
    source = this->getActiveLidarSource();
    }
    else
    {
    source = this->getLidarSource(idx);
    }
    return source ? source->getProxy() : nullptr;
    }
    vtkSMProxy* lqSensorListWidget::getReader()
    vtkSMProxy* lqSensorListWidget::getReader(int idx)
    {
    auto proxy = this->getLidar();
    auto proxy = this->getLidar(idx);
    return IsLidarReaderProxy(proxy) ? proxy : nullptr;
    }
    vtkSMProxy* lqSensorListWidget::getSensor()
    vtkSMProxy* lqSensorListWidget::getSensor(int idx)
    {
    auto proxy = this->getLidar();
    auto proxy = this->getLidar(idx);
    return IsLidarStreamProxy(proxy) ? proxy : nullptr;
    }
    vtkSMProxy* lqSensorListWidget::getTrailingFrame()
    vtkSMProxy* lqSensorListWidget::getTrailingFrame(int idx)
    {
    // Find First TrailingFrame filter that is connected to ActiveLidarSource
    auto lidar = this->getActiveLidarSource();
    auto lidar = idx == -1 ? this->getActiveLidarSource() : this->getLidarSource(idx);
    if (!lidar)
    {
    return nullptr;
    ......@@ -491,10 +511,10 @@ vtkSMProxy* lqSensorListWidget::getTrailingFrame()
    return nullptr;
    }
    vtkSMProxy* lqSensorListWidget::getPosOrSource()
    vtkSMProxy* lqSensorListWidget::getPosOrSource(int idx)
    {
    // Find First PosOr filter that is connected to ActiveLidarSource
    auto lidar = this->getActiveLidarSource();
    auto lidar = idx == -1 ? this->getActiveLidarSource() : this->getLidarSource(idx);
    if (!lidar)
    {
    return nullptr;
    ......
    ......@@ -58,6 +58,14 @@ public:
    */
    pqPipelineSource* getActiveLidarSource();
    /**
    * @brief getLidarSource
    * Get the Lidar Source associated with the specified index.
    * If the index is out of bound, nullptr is returned.
    * @return The LidarSource associated with the index
    */
    pqPipelineSource* getLidarSource(int index);
    /**
    * @brief getActiveSourceToDisplay
    * Get the Source To Display associated to the selected pqPipelineSource
    ......@@ -80,11 +88,11 @@ public:
    bool isInLiveSensorMode();
    // WIP Intended to replace Applogic getReader() / getSensor() / getLidar()
    vtkSMProxy* getLidar();
    vtkSMProxy* getReader();
    vtkSMProxy* getSensor();
    vtkSMProxy* getTrailingFrame();
    vtkSMProxy* getPosOrSource();
    vtkSMProxy* getLidar(int index = -1);
    vtkSMProxy* getReader(int index = -1);
    vtkSMProxy* getSensor(int index = -1);
    vtkSMProxy* getTrailingFrame(int index = -1);
    vtkSMProxy* getPosOrSource(int index = -1);
    protected Q_SLOTS:
    void onSourceAdded(pqPipelineSource* src);
    ......
    ......@@ -97,25 +97,25 @@ public slots:
    return lqSensorListWidget::instance()->getActiveLidarSource();
    }
    vtkSMProxy* static_lqSensorListWidget_getLidar()
    vtkSMProxy* static_lqSensorListWidget_getLidar(int index)
    {
    return lqSensorListWidget::instance()->getLidar();
    return lqSensorListWidget::instance()->getLidar(index);
    }
    vtkSMProxy* static_lqSensorListWidget_getReader()
    vtkSMProxy* static_lqSensorListWidget_getReader(int index)
    {
    return lqSensorListWidget::instance()->getReader();
    return lqSensorListWidget::instance()->getReader(index);
    }
    vtkSMProxy* static_lqSensorListWidget_getSensor()
    vtkSMProxy* static_lqSensorListWidget_getSensor(int index)
    {
    return lqSensorListWidget::instance()->getSensor();
    return lqSensorListWidget::instance()->getSensor(index);
    }
    vtkSMProxy* static_lqSensorListWidget_getTrailingFrame()
    vtkSMProxy* static_lqSensorListWidget_getTrailingFrame(int index)
    {
    return lqSensorListWidget::instance()->getTrailingFrame();
    return lqSensorListWidget::instance()->getTrailingFrame(index);
    }
    vtkSMProxy* static_lqSensorListWidget_getPosOrSource()
    vtkSMProxy* static_lqSensorListWidget_getPosOrSource(int index)
    {
    return lqSensorListWidget::instance()->getPosOrSource();
    return lqSensorListWidget::instance()->getPosOrSource(index);
    }
    };
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Finish editing this message first!
    Please register or to comment