Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix QgsDualEdgeTriangulation #38867

Merged
merged 3 commits into from
Sep 20, 2020
Merged

Conversation

vcloarec
Copy link
Member

Another issue in the dual edge triangulation (described here : #30549 (comment)), and still present with recent fix.
This PR fixes it.

@vcloarec vcloarec added Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption labels Sep 19, 2020
@github-actions github-actions bot added this to the 3.16.0 milestone Sep 19, 2020
@@ -204,7 +205,22 @@ int QgsDualEdgeTriangulation::addPoint( const QgsPoint &p )
int point1 = mHalfEdge[mEdgeOutside]->getPoint();
int point2 = mHalfEdge[mHalfEdge[mEdgeOutside]->getDual()]->getPoint();
double distance1 = p.distance( *mPointVector[point1] );
if ( distance1 <= leftOfTresh ) // point1 == new point
{
QgsPoint *pt = mPointVector.last();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
QgsPoint *pt = mPointVector.last();
delete mPointVector.takeLast();

Etc

@nyalldawson
Copy link
Collaborator

Any chance of a test for this too?

@vcloarec
Copy link
Member Author

yes... this could be a good think, I was thinking about...

@vcloarec
Copy link
Member Author

new tests added, and another issue fixed...

@nyalldawson nyalldawson merged commit 9305e22 into qgis:master Sep 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants