Select to view content in your preferred language

UniqueValueRenderer does not work on DynamicEntityLayer's track line renderer

44
0
9 hours ago
Labels (2)
FatmaAkdemir
Frequent Contributor

 

 

auto* uniqueValue1 = new UniqueValue("Cat 11", "Cat 11", QVariantList() << "Cat 11", new SimpleMarkerSymbol(SimpleMarkerSymbolStyle::X, QColor(Qt::darkYellow), 12.0, this), this);
        auto* uniqueValue2 = new UniqueValue("Cat 20", "Cat 20", QVariantList() << "Cat 20", new SimpleMarkerSymbol(SimpleMarkerSymbolStyle::X, QColor(Qt::darkGreen), 12.0, this), this);
        auto* uniqueValue3 = new UniqueValue("Cat 21", "Cat 21", QVariantList() << "Cat 21", new SimpleMarkerSymbol(SimpleMarkerSymbolStyle::X, QColor(Qt::darkBlue), 12.0, this), this);
        auto* uniqueValue4 = new UniqueValue("Cat 48", "Cat 48", QVariantList() << "Cat 48", new SimpleMarkerSymbol(SimpleMarkerSymbolStyle::X, QColor(Qt::darkMagenta), 12.0, this), this);
        auto* uniqueValue5 = new UniqueValue("Cat 62", "Cat 62", QVariantList() << "Cat 62", new SimpleMarkerSymbol(SimpleMarkerSymbolStyle::X, QColor(Qt::darkCyan), 12.0, this), this);

        auto* history1 = new UniqueValue("Cat 11", "Cat 11", QVariantList() << "Cat 11", new SimpleMarkerSymbol(SimpleMarkerSymbolStyle::Circle, QColor(Qt::darkYellow), 4.0, this), this);
        auto* history2 = new UniqueValue("Cat 20", "Cat 20", QVariantList() << "Cat 20", new SimpleMarkerSymbol(SimpleMarkerSymbolStyle::Circle, QColor(Qt::darkGreen), 4.0, this), this);
        auto* history3 = new UniqueValue("Cat 21", "Cat 21", QVariantList() << "Cat 21", new SimpleMarkerSymbol(SimpleMarkerSymbolStyle::Circle, QColor(Qt::darkBlue), 4.0, this), this);
        auto* history4 = new UniqueValue("Cat 48", "Cat 48", QVariantList() << "Cat 48", new SimpleMarkerSymbol(SimpleMarkerSymbolStyle::Circle, QColor(Qt::darkMagenta), 4.0, this), this);
        auto* history5 = new UniqueValue("Cat 62", "Cat 62", QVariantList() << "Cat 62", new SimpleMarkerSymbol(SimpleMarkerSymbolStyle::Circle, QColor(Qt::darkCyan), 4.0, this), this);

        auto* line1 = new UniqueValue("Cat 11", "Cat 11", QVariantList() << "Cat 11", new SimpleLineSymbol(SimpleLineSymbolStyle::Solid, QColor(Qt::darkYellow), 2.0, this), this);
        auto* line2 = new UniqueValue("Cat 20", "Cat 20", QVariantList() << "Cat 20", new SimpleLineSymbol(SimpleLineSymbolStyle::Solid, QColor(Qt::darkGreen), 2.0, this), this);
        auto* line3 = new UniqueValue("Cat 21", "Cat 21", QVariantList() << "Cat 21", new SimpleLineSymbol(SimpleLineSymbolStyle::Solid, QColor(Qt::darkBlue), 2.0, this), this);
        auto* line4 = new UniqueValue("Cat 48", "Cat 48", QVariantList() << "Cat 48", new SimpleLineSymbol(SimpleLineSymbolStyle::Solid, QColor(Qt::darkMagenta), 2.0, this), this);
        auto* line5 = new UniqueValue("Cat 62", "Cat 62", QVariantList() << "Cat 62", new SimpleLineSymbol(SimpleLineSymbolStyle::Solid, QColor(Qt::darkCyan), 2.0, this), this);

        // Add the unique values to the renderer
        auto* uniqueRenderer = new UniqueValueRenderer("", new SimpleMarkerSymbol(this), QStringList() << "source", QList<UniqueValue*>() << uniqueValue1 << uniqueValue2 << uniqueValue3 << uniqueValue4 << uniqueValue5, this);
        auto* uniqueRendererHistory = new UniqueValueRenderer("", new SimpleMarkerSymbol(this), QStringList() << "source", QList<UniqueValue*>() << history1 << history2 << history3 << history4 << history5, this);
        auto* uniqueRendererTrajectory = new UniqueValueRenderer("", new SimpleLineSymbol(this), QStringList() << "source", QList<UniqueValue*>() << line1 << line2 << line3 << line4 << line5, this);
        mpDynamicEntityLayer->setRenderer(uniqueRenderer);
        mpDynamicEntityLayer->trackDisplayProperties()->setPreviousObservationRenderer(uniqueRendererHistory);
        mpDynamicEntityLayer->trackDisplayProperties()->setTrackLineRenderer(uniqueRendererTrajectory);

At line 25 I'm trying to give different colors to track lines for different categories of tracks, but it does not work. What am I missing?

0 Kudos
0 Replies