Gui Problem Sketcher and TechDraw

Post here for help on using FreeCAD's graphical user interface (GUI).
Forum rules
and Helpful information
IMPORTANT: Please click here and read this first, before asking for help

Also, be nice to others! Read the FreeCAD code of conduct!
Post Reply
ulrich1a
Veteran
Posts: 1957
Joined: Sun Jul 07, 2013 12:08 pm

Gui Problem Sketcher and TechDraw

Post by ulrich1a »

I stumbled recently over a Gui-problem where clicking at a sketch FreeCAD changed the internal windows from full to all view. This is annoying. It seems to be related to having a TechDraw-page in the document.
Is this the same behavior at other systems?

It can be tested with the attached file: just double-click on the sketch in the tree-view.

Ulrich

OS: Debian GNU/Linux 8.8 (jessie)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11225 (Git)
Build type: Release
Branch: Rueck6
Hash: 9ca0f91d6b36953efd9340864abb4bc960d58955
Python version: 2.7.9
Qt version: 4.8.6
Coin version: 4.0.0a
OCC version: 7.1.0

edit: The problem shows also up in a windows-version under wine.
OS: Windows XP
Word size of OS: 32-bit
Word size of FreeCAD: 32-bit
Version: 0.17.11129 (Git)
Build type: Release
Branch: master
Hash: b604b27ad3bbbacfede88e32390b076ef108331f
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.0.0
Attachments
Gui_problem.png
Gui_problem.png (350.4 KiB) Viewed 1408 times
Gui_problem.fcstd
File for test
(25.48 KiB) Downloaded 32 times
User avatar
Boneshaker
Posts: 69
Joined: Sat Feb 20, 2016 2:20 pm
Location: Emden, Germany

Re: Gui Problem Sketcher and TechDraw

Post by Boneshaker »

Hi,
same behaviour here.

OS: Windows 10
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11223 (Git)
Build type: Release
Branch: master
Hash: 88bd341ad2da7399719d350bf9f715297d8d9f33
Python version: 2.7.8
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0
HoWil
Veteran
Posts: 1279
Joined: Sun Jun 14, 2015 7:31 pm
Location: Austria

Re: Gui Problem Sketcher and TechDraw

Post by HoWil »

Same here:
OS: Ubuntu 16.04.2 LTS
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.17.11224 (Git)
Build type: None
Branch: master
Hash: d52f9f5d1a0c38a1a1b669fe694175cbd07d8d06
Python version: 2.7.12
Qt version: 4.8.7
Coin version: 4.0.0a
OCC version: 7.1.0

BR,
HoWil
wmayer
Founder
Posts: 20324
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Gui Problem Sketcher and TechDraw

Post by wmayer »

This behaviour is caused in the preferences by the Sketcher option Hide all objects that depend on the sketch
If this option is active the Python method Show.TempoVis.hide_all_dependent inside ViewProviderSketch::setEdit is called which hides all objects that depend on the sketch object. This includes the Page object.

Now when hiding the Page object its view provider explicitly activates the previous view (the 3d view) which at this point is not maximized and removes the Drawing viewer from the MDI list. That's why afterwards the 3d view is still not maximized.

To partially fix the problem the line to activate the previous view can be removed because Qt's MDI handling does this automatically. When doing so the 3d window is shown normally when editing the sketch.

However, when leaving the edit mode the Page object becomes visible again and activates its Drawing view which will become the active view, then.
Actually there is no need to hide or show any TechDraw items when editing a sketch because they are rendered in a different window and thus don't hide the sketch in a way.
wmayer
Founder
Posts: 20324
Joined: Thu Feb 19, 2009 10:32 am
Contact:

Re: Gui Problem Sketcher and TechDraw

Post by wmayer »

git commit 1d83d17 fixes the problem.
User avatar
DeepSOIC
Veteran
Posts: 7896
Joined: Fri Aug 29, 2014 12:45 am
Location: used to be Saint-Petersburg, Russia

Re: Gui Problem Sketcher and TechDraw

Post by DeepSOIC »

I wonder, how to fix it properly.
First, I didn't quite understand, why was the filtering-out of techdraw objects done in sketcher code, rather than in tempovis code. HideAllDependent is also used by attachment editor, so similar problem is to be expected there.

Second, for a proper fix, TempoVis should probably check, if the object it is dealing with is actually in 3d view or not. I wonder how to do it. Maybe it can be done by checking for the lack of coin subgraph? Or by lack of display modes...
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Gui Problem Sketcher and TechDraw

Post by triplus »

DeepSOIC wrote: Sun Sep 03, 2017 10:00 pm Second, for a proper fix, TempoVis should probably check, if the object it is dealing with is actually in 3d view or not. I wonder how to do it. Maybe it can be done by checking for the lack of coin subgraph? Or by lack of display modes...
Maybe this:

Code: Select all

Gui.ActiveDocument.ActiveView
P.S. After reading it again. I guess you where thinking about a different thing. That is not about trying to determine if 3D View is active or not.
Post Reply