LeaderLine and WeldSymbol: bugs and improvements

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
bensay
Posts: 202
Joined: Wed Dec 22, 2021 8:14 pm
Location: Danmark
Contact:

LeaderLine and WeldSymbol: bugs and improvements

Post by bensay »

Are the WeldSymbol meant not to be under the LeaderLine in the hierarchy? Currently it is even outside the page.
image_2022-08-03_203023636.png
image_2022-08-03_203023636.png (62.7 KiB) Viewed 480 times
If a WeldSymbol object is tried deleted, an error about dependency stop it. The tiles inside the WeldSymbol object have to be deleted manually first. I suggest that this should happen by default: if a WeldSymbol object is tried deleted, no dependency error should be thrown, instead the tile dependencies should be deleted as well by default.
Screenshot from 2022-08-03 20-32-22.png
Screenshot from 2022-08-03 20-32-22.png (14.09 KiB) Viewed 480 times
Screenshot from 2022-08-03 20-32-13.png
Screenshot from 2022-08-03 20-32-13.png (20.77 KiB) Viewed 480 times
If 1) LeaderLine is created, 2) it is placed under a view hierarchically, 3) then deleted, and 4) an undo operation is made, then it is no longer under the view hierarchically.

If 1) LeaderLineTask is started, 2) pick points button is pressed, 3) save points button is pressed (without having added any points), and 4) pick points button is pressed an exception is thrown in the console and the point picker doesn't work anymore.

Code: Select all

20:38:53  Unhandled Base::Exception caught in GUIApplication::notify.
The error message is: TechDrawNewLeader - tracker already active
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: LeaderLine and WeldSymbol: bugs and improvements

Post by wandererfan »

bensay wrote: Wed Aug 03, 2022 6:44 pm Are the WeldSymbol meant not to be under the LeaderLine in the hierarchy? Currently it is even outside the page.
The WeldSymbol should be under the LeaderLine. ViewProviderLeader should claim it as a child, but sometimes claimChildren is deferred. This happens with other objects too. I'm not sure what actually triggers claimChildren.
bensay wrote: If a WeldSymbol object is tried deleted, an error about dependency stop it. The tiles inside the WeldSymbol object have to be deleted manually first. I suggest that this should happen by default.
This is standard DocumentObject deletion handling. If there are dependencies, you get a warning. There are methods that might be overridden (onBeforeDelete? unsetupObject?) to change this. The tiles aren't much use without the WeldSymbol so this makes sense to do.
bensay wrote: If 1) LeaderLine is created, 2) it is placed under a view hierarchically, 3) then deleted, and 4) an undo operation is made, then it is no longer under the view hierarchically.
This is probably also related to claimChildren not running at the right time. There must be something in DocumentObject or Document that we aren't handling correctly.
bensay wrote: If 1) LeaderLineTask is started, 2) pick points button is pressed, 3) save points button is pressed (without having added any points), and 4) pick points button is pressed an exception is thrown in the console and the point picker doesn't work anymore.
Missing a call to removeTracker in onTrackerClicked I guess.
User avatar
wandererfan
Veteran
Posts: 6268
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: LeaderLine and WeldSymbol: bugs and improvements

Post by wandererfan »

Code: Select all

//! remove features that are useless without this DVP
//! hatches, geomhatches, dimensions,...
void DrawViewPart::unsetupObject()
Post Reply