QCAD Bugtracker

  • Status Closed
  • Percent Complete
    100%
  • Task Type Bug Report
  • Category QCAD (main)
  • Assigned To
    andrew
  • Operating System All
  • Severity Very Low
  • Priority Very Low
  • Reported Version 3.31.1
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: QCAD Bugtracker
Opened by CVH - 24.10.2024
Last edited by andrew - 24.10.2024

FS#2607 - Draw > Circle > 3 Tangents: No or missing auxiliary shapes. Exceptions

Andrew,

In some cases when drawing tangent shapes I see that there are no to some missing auxiliary shapes. The preview was OK but once you are in the ChoosingSolution state some to all auxiliary shapes are missing. However, one can still point near them and a preview is displayed.

In debugger mode an exception is thrown in EAction.prototype.updatePreview
Line 1706 Argument 0 is not of type RShape*

For CT3 I traced it back to solutions added by Apollonius.getSolutionsCCCAlt
After elimination, typically the candidates created by ShapeAlgorithms.getOffsetShapes

From documentation I think I understand that these are of the type QSharedPointer.
The problem is that in debugger mode I can not distinguish the difference in the array previewShapes. All are listed as RCircle(RShape(address: ... and so on.

I also read:
this.getAuxPreview() Implementations must return an array of RShape objects.


Is there a way to spot the difference?
Sometimes it is unclear what to expect.
Got acquainted with a trial and error solution:
If it is not an RShape (RShape*) then let’s clone it....

Regards,
CVH

Closed by  andrew
24.10.2024 13:06
Reason for closing:  Fixed
Admin

I've committed a fix:

https://github.com/qcad/qcad/commit/bd5ff65d4aaf8502a70db299a52d216d57ecf861

You can use getPtr() to strip the shared pointer from a pointer and isFunction(obj.data) to detect a shared pointer.

CVH commented on 24.10.2024 13:41

getPtr()
I know of this addition to library.js
And that it is based on isFunction(obj.data)
Including the route it took to implement it as it is today.

There are also sections of code that do this conversion for themselves.
Without testing for Qt6.
e.g. in Apollonius.getAngleBisectors

The question was: How can we spot the difference in an array in debugger mode?

And then the second question that pops up:
What is the advantage of a QSharedPointer over a common RShape when we constantly have to test and convert them to be usable for the next part of the process?

Regards,
CVH

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing