FS#2607Draw > Circle > 3 Tangents: No or missing auxiliary shapes. Exceptions
- Type
- Bug
- Status
- Closed
- Resolution
- Fixed
- Category
- QCAD (main)
- Severity
- Very Low
- Priority
- Low
- Reported version
- 3.31.1
- Operating system
- All
- Reported
- 2024-10-24 by CVH
- Closed
- 2024-10-24 by andrew
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
Comments (2)
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.
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