App::Document:Tip what is the intension of the property?

Discussion about the development of the Assembly workbench.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
Fat-Zer
Posts: 176
Joined: Thu Oct 30, 2014 10:38 pm

App::Document:Tip what is the intension of the property?

Post by Fat-Zer »

What is the intension of Tip property in App::Document?
I don't really see why it may be needed in a multi-body document...
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: App::Document:Tip what is the intension of the property?

Post by ickby »

I think it has the same purpose than the tip for the part: to have allow a reference to it which is independent of changes in the model, to always get the latest document object. Multi document assemblies may still be far away, but keeping the tip working even now seems reasonable.
Fat-Zer
Posts: 176
Joined: Thu Oct 30, 2014 10:38 pm

Re: App::Document:Tip what is the intension of the property?

Post by Fat-Zer »

ickby wrote:I think it has the same purpose than the tip for the part: to have allow a reference to it which is independent of changes in the model, to always get the latest document object.
Parts don't have tips, only bodies, just a slip of the tongue?
ickby wrote: Multi document assemblies may still be far away, but keeping the tip working even now seems reasonable.
Hmm... as variant... But in case of multi document assembly wouldn't it be better to import/link all top-level assembly & parts objects to/from the higher level document, rather than getting only one part? Or even better, make user to decide?
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: App::Document:Tip what is the intension of the property?

Post by ickby »

well true. I can only suspect that it was intended to be like I described, but your arguments are valid. So I don't know, we would need to ask jriegel for his intentions. Maybe it is a relict of some older intended scheme, maybe it is needed for something...
Fat-Zer
Posts: 176
Joined: Thu Oct 30, 2014 10:38 pm

Re: App::Document:Tip what is the intension of the property?

Post by Fat-Zer »

Thanks, so I won't be too gentle with code that sets it and checks in the Workbench.cpp
Fat-Zer
Posts: 176
Joined: Thu Oct 30, 2014 10:38 pm

Re: App::Document:Tip what is the intension of the property?

Post by Fat-Zer »

Seems I finally got what's that property was used for:
It determined the active Part of the document before the getActiveObject() interface come into use. I suppose it may be safely removed in favor of the last one...
User avatar
jriegel
Founder
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: App::Document:Tip what is the intension of the property?

Post by jriegel »

If you see a document as a DAG, it can have more then one root objects, which are in no way easy to determine. Tip was introduced for a multi-document environment. A pure PartDesign document will have the Tip pointing to a Part. A Assembly document to the root Assembly/View. A FEM document to the Analysis object.

At the moment all our objects are in one document. That will not sustain far into the future. We have to deal with large assemblies and complicated configurations. There fore splitting designs into handleable parts is important. And the Tip properties is the first link into an document from the outside. Kind of interface from other documents referencing onto it.

At the moment it can be used to determine the (standard) Part of an Part document. In case the user opens a part document into the assembly workbench I will create a simple product structure and replace the Tip with the Assembly and put the Part into the simple Product structure.

More tricky will be the way back. There I would plan to open the PartWorkbench when the user double click on the Part and set this Part as active. But the Tip of document is still the Assembly. But Part Design works on the double clicked Part...
Stop whining - start coding!
Fat-Zer
Posts: 176
Joined: Thu Oct 30, 2014 10:38 pm

Re: App::Document:Tip what is the intension of the property?

Post by Fat-Zer »

jriegel wrote:If you see a document as a DAG, it can have more then one root objects, which are in no way easy to determine. Tip was introduced for a multi-document environment. A pure PartDesign document will have the Tip pointing to a Part. A Assembly document to the root Assembly/View. A FEM document to the Analysis object.
Hmm... I still don't really see the benefits of the Tip in document here:
In your terms (focusing on interaction of the Assembly and PartDesign documents):
- If a PartDesign document contains only one Parts — no need in the Tip the only toplevel part will be Imported into the Assembly document.
- If a PartDesign document contain several Parts, doesn't it better to pass all of them into Assembly or let the user decide which of them to use on the side of the assembly document?
- If it's an Assembly document which contains one Product, again Tip is excess, when importing into the next level Assembly
- If Assembly document have several top levels import all and/or let the user decide...
User avatar
jriegel
Founder
Posts: 3369
Joined: Sun Feb 15, 2009 5:29 pm
Location: Ulm, Germany
Contact:

Re: App::Document:Tip what is the intension of the property?

Post by jriegel »

Sure, but you have to do always do some DAG processing (searching) which one is you tip. Or you just save a pointer to it.
Stop whining - start coding!
Post Reply