about the new detail view dialog

Discussions about the development of the TechDraw workbench
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

about the new detail view dialog

Post by uwestoehr »

Hello Wandererfan, I had a look at the new detail dialog and have the following questions:

- I would like to add more setting to the dialog. Am I allowed to do this?

- how does the "Drag Highlight" button work? When Creating a new detail dialog i would like to click on the position in the view where i want to have the detail centered.
When clicking on "Drag Highlight", nothing happens visible for me. Also when i click this button on existing details, nothing happens and the button stays disabled the whole time after it has been clicked.
Last edited by uwestoehr on Tue Jun 09, 2020 6:00 pm, edited 1 time in total.
User avatar
wandererfan
Veteran
Posts: 6326
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: about the new detail view dialog

Post by wandererfan »

uwestoehr wrote: Tue Apr 14, 2020 12:56 am - I would like to add more setting to the dialog. Am I allowed to do this?
Please wait a day or two. See next answer.
- how does the "Drag Highlight" button work? When Creating a new detail dialog i would like to click on the position in the view where i want to have the detail centered.
When clicking on "Drag Highlight", nothing happens visible for me. Also when i click this button on existing details, nothing happens and the button stays disabled the whole time after it has been clicked.
The dragger is broken. What is supposed to happen is an overlay appears at the current anchor position and then you LMB drag it to the new position.
After you click Drag Highlight, press View All. You'll see the draggable symbol somewhere, but it is the wrong size and in the wrong place. :oops:
User avatar
wandererfan
Veteran
Posts: 6326
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: about the new detail view dialog

Post by wandererfan »

The dragger should be fixed by git commit 2d29ac5fc1.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: about the new detail view dialog

Post by uwestoehr »

wandererfan wrote: Tue Apr 14, 2020 1:02 am The dragger is broken. What is supposed to happen is an overlay appears at the current anchor position and then you LMB drag it to the new position.
This works now. Many thanks.

However, there are some issues:

1. We have the preferences setting "Detail View Outline Shape" but no property to change this later.

2. The detail view has the 3 highlight properties, but they have no effect. Only in the base view they have an effect. Therefore they should not appear in the Detail View properties.

3. The highlight adjust property does not work correctly. Take for example this file:
ttt.FCStd
testfile
(23.51 KiB) Downloaded 34 times
Here is how this file looks on my PC:
look of example file
look of example file
FreeCAD_5AhMpIsXVB.png (31.52 KiB) Viewed 2124 times
3.1 You can see that the detail is rotated in the base view but not in the actual detail view.
3.2 Also the detail dialog must now state what the size of the view is. "Radius" is not useful, since the outline is a square the dialog must state "Edge length". -> Since I want to add new features to the dialog I can take care of this.
3.3 The scaling is incorrect. Both, the base view and the detail view have the same scaling, but the detail view is smaller.
3.4 Go to the preferences and change the outline shape for details to Circle. Note that the preferences dialog states, that this setting only affects new objects. Now change e.g. the Radius property of the detail view -> Result: now the outline shape of the existing detail view gets round.
User avatar
wandererfan
Veteran
Posts: 6326
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: about the new detail view dialog

Post by wandererfan »

uwestoehr wrote: Wed Apr 15, 2020 12:50 am 1. We have the preferences setting "Detail View Outline Shape" but no property to change this later.
Are both shapes typically used in a drawing? I thought this was a "shop standard" and a given drawing office used circles or squares, but not both. If you feel it is important, go ahead and add a property on the Gui side. IIRC, the geometry generation on the App side always uses a circle. This depends on how we handle 3.4.
2. The detail view has the 3 highlight properties, but they have no effect. Only in the base view they have an effect. Therefore they should not appear in the Detail View properties.
Yes, they should be set to App::Property::Hidden in the section ctor.
3. The highlight adjust property does not work correctly. Take for example this file:
3.1 You can see that the detail is rotated in the base view but not in the actual detail view.
This property was a hack to circumvent errors in the highlight positioning. It was never meant to rotate anything.
Those errors have been fixed, so this property can be removed.
3.2 Also the detail dialog must now state what the size of the view is. "Radius" is not useful, since the outline is a square the dialog must state "Edge length". -> Since I want to add new features to the dialog I can take care of this.
Just changing the ui will not be enough, unless we use something generic like "highlight size". As is, the square is constructed to just fit inside a circle with the specified radius.
3.3 The scaling is incorrect. Both, the base view and the detail view have the same scaling, but the detail view is smaller.
looks the same here at 1:1 and 2:1.
BaseVsDetail_1.png
BaseVsDetail_1.png (7.74 KiB) Viewed 2068 times
BaseVsDetail_2.png
BaseVsDetail_2.png (10.09 KiB) Viewed 2068 times
3.4 Go to the preferences and change the outline shape for details to Circle. Note that the preferences dialog states, that this setting only affects new objects. Now change e.g. the Radius property of the detail view -> Result: now the outline shape of the existing detail view gets round.
We should change the literal in the preferences ui to match the behaviour of the code.
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: about the new detail view dialog

Post by uwestoehr »

wandererfan wrote: Wed Apr 15, 2020 2:56 pm looks the same here at 1:1 and 2:1.
Sorry, the scale is correct but not the position:
size incorrect
size incorrect
FreeCAD_iIMfMJTL0k.png (26.55 KiB) Viewed 2038 times

Look where the circle border is and what is in the Detail view.
User avatar
wandererfan
Veteran
Posts: 6326
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: about the new detail view dialog

Post by wandererfan »

uwestoehr wrote: Wed Apr 15, 2020 7:35 pm Look where the circle border is and what is in the Detail view.
Need your file. Not getting the same results.
ViewVsDetail.png
ViewVsDetail.png (28.94 KiB) Viewed 2013 times
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: about the new detail view dialog

Post by uwestoehr »

wandererfan wrote: Thu Apr 16, 2020 2:09 am Need your file. Not getting the same results.
I see now the bug is because of the property "Highlight Adjust" since its rotation is not performed at the center of the circle.

Take this testfile:
ttt.FCStd
testfile
(23.51 KiB) Downloaded 37 times
User avatar
uwestoehr
Veteran
Posts: 4961
Joined: Sun Jan 27, 2019 3:21 am
Location: Germany
Contact:

Re: about the new detail view dialog

Post by uwestoehr »

This PR fixes the following Detail issues: https://github.com/FreeCAD/FreeCAD/pull/3365

- when the user sets the ScaleType "Page" only the page scale can be used - this is already the case in the other views
- there is no class DrawDetail but DrawViewDetail
- the detail outline shape affects existing views, therefore it must be upright in the preferences
- set keyboardTracking to false in the dialog, see also https://doc.qt.io/qt-5/qabstractspinbox ... cking-prop

The latter is important because a dialog in which I can change something but don't see any effect is useless. The detail dialog is there to be able to find the right location and size. This involves fine-tuning, so a millimeter more or less. If I would need to close the dialog just to see the effect, then open it again, then changing another mm, then close etc. as it is now, having a dialog is no help.

I also think that we have a phantom discussion in this respect because of course as user I always want to see the effect immediately. If I e.g. drag a complex 3D model in FC, of course this involves a lot of computations, but this is CAD. Nobody will use a netbook for CAD because he knows it might become dog slow.
Besides this, could you please provide a sample file where you thin the user is lost when a dialog makes e.g. 10 recomputes in a row? I still cannot see any problem because moving a 3D model recomputes much more and e.g. in the Detail dialog the user clicks just a few times.

- This PR does not fix the issue that the property "HighlightLineColor" should be hidden in the DetailView beaus there is no "ViewProviderDetail" yet and I don't know the reason.
User avatar
wandererfan
Veteran
Posts: 6326
Joined: Tue Nov 06, 2012 5:42 pm
Contact:

Re: about the new detail view dialog

Post by wandererfan »

uwestoehr wrote: Sat Apr 18, 2020 12:55 pm - set keyboardTracking to false in the dialog, see also https://doc.qt.io/qt-5/qabstractspinbox ... cking-prop
this is a good "discovery". Sounds like it makes "valueChanged" behave more like "editingFinished".
The latter is important because a dialog in which I can change something but don't see any effect is useless. The detail dialog is there to be able to find the right location and size. This involves fine-tuning, so a millimeter more or less. If I would need to close the dialog just to see the effect, then open it again, then changing another mm, then close etc. as it is now, having a dialog is no help.
Yes, I understand this. But in the current configuration, there is no need to close the dialog to see the update. The tab key will trigger an update, as will changing focus to another widget. The enter key should do it also, but that is trapped somewhere and never delivered to the widget in the dialog.

The issue was that the recompute was being triggered by the dialog for every keystroke in the changed field. So if you wanted to change the X position of the highlight from 350 mm to 500 mm the recalculation would be done approximately 6 times - 3 backspaces to remove the old value, then 3 keys to enter the new value.

A similar condition occurs when a recompute is triggered by the onChanged method. The changed signal occurs for every digit changed. onChanged should only call recompute if the execute method is very light - as in Annotation, say.
I also think that we have a phantom discussion in this respect because of course as user I always want to see the effect immediately. If I e.g. drag a complex 3D model in FC, of course this involves a lot of computations, but this is CAD. Nobody will use a netbook for CAD because he knows it might become dog slow.
Not an expert in Coin, but I don't believe a drag in the 3D window involves a lot of calculation for FC, just a tweak or two to the existing scene graph.
In TD also, a drag should not recompute geometry as the position on the page is not relevant to the projection.
Besides this, could you please provide a sample file where you thin the user is lost when a dialog makes e.g. 10 recomputes in a row? I still cannot see any problem because moving a 3D model recomputes much more and e.g. in the Detail dialog the user clicks just a few times.
I believe I was using "screwjack_assembly.fcstd". The initial section origin point is too far to the right, and trying to move the position back to the origin triggered the loop/slow response.
- This PR does not fix the issue that the property "HighlightLineColor" should be hidden in the DetailView beaus there is no "ViewProviderDetail" yet and I don't know the reason.
The drawing process for the detail view is the same as for the regular view (except for the "matting" overlay), so it uses the same view provider as the regular view.
The "HighlightLineColor" property can be selectively hidden by testing if the feature is a DrawViewDetail, and setting App::Property::Hidden appropriately.
Attachments
screwjack_assmbly.FCStd
(104.25 KiB) Downloaded 32 times
Post Reply