You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi!
First of all, thanks for your awesome project!
I'm making a map with the ability to build a route.
The following problem occurred:
At high zoom, when moving an element of the route, FPS drops very significantly. Also (sometimes) FPS drops very significantly when changing the zoom, when the zoom is already quite large.
The route itself is a layer (the RouteLayer class which is inherited by QGVLayer), to which I add point and line objects.
Points and lines are inherited from QGVDrawItem.
When I move a point, only the lines that connect to this point are redrawn.
and this is how the logic for changing route lines works:
//i have connect
connect(routePoint, &RoutePoint::posChanged, this, &RouteLayer::onRoutePointPosChanged);
void RouteLayer::onRoutePointPosChanged()
{
redrawLinesForPoint(dynamic_cast<RoutePoint*>(sender()));
}
//and when point move i set new points for line
void RouteLayer::redrawLinesForPoint(const RoutePoint *p)
{
auto index = p->getIndex()-1;
if(index>=1)
{
mLineBetweenPoints.at(index-1)->updatePoints(mRoutePoints.at(index-1)->getCenter(), mRoutePoints.at(index)->getCenter());
}
if(index<mLineBetweenPoints.size())
{
mLineBetweenPoints.at(index)->updatePoints(mRoutePoints.at(index)->getCenter(), mRoutePoints.at(index+1)->getCenter());
}
}
I think this has something to do with lines boundingRect() and what exactly View updates.
I trying change setViewportUpdateMode, but no effect.
And this problem is precisely because of the lines, if don’t draw them everything works quickly
Could you help with any advice?
Hi!
First of all, thanks for your awesome project!
I'm making a map with the ability to build a route.
The following problem occurred:
At high zoom, when moving an element of the route, FPS drops very significantly. Also (sometimes) FPS drops very significantly when changing the zoom, when the zoom is already quite large.
The route itself is a layer (the RouteLayer class which is inherited by QGVLayer), to which I add point and line objects.
Points and lines are inherited from QGVDrawItem.
When I move a point, only the lines that connect to this point are redrawn.
Here is the line code:
and this is how the logic for changing route lines works:
In this video you can see how performance differs at different zoom levels
https://youtu.be/617_31R_3xg
I think this has something to do with lines boundingRect() and what exactly View updates.
I trying change setViewportUpdateMode, but no effect.
And this problem is precisely because of the lines, if don’t draw them everything works quickly
Could you help with any advice?
UPDATE:
If redraw line like this:
Now performance better than before on big zoom, but i don`t completely understand why :)
The text was updated successfully, but these errors were encountered: