[Merged] Subdivision of Base ViewObject properties

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

[Merged] Subdivision of Base ViewObject properties

Post by carlopav »

Hello, I was asking myself if anybody ever considered splitting the Base View properties in different groups to make easier to identify the searched Property.
Here you have a rough subdivision proposal, just to let you evaluate better the idea:

Display Options
Angular Deflection
BoundingBox
Lighting
Deviation
DisplayMode
ShowInTree
Visibility

Object Style
DrawStyle
PointColor
PointSize
LineColor
LineWidth
ShapeColor
Transparency

Selection
OnTopWhenSelected
Selectable
SelectionStyle
Last edited by carlopav on Sat Aug 22, 2020 8:08 am, edited 1 time in total.
follow my experiments on BIM modelling for architecture design
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: [Proposal] Subdivision of Base ViewObject properties

Post by vocx »

carlopav wrote: Wed May 27, 2020 8:21 pm Hello, I was asking myself if anybody ever considered splitting the Base View properties in different groups to make easier to identify the searched Property.
Yes, it would be nice. Please see the information on Part Feature. There are hidden properties which should be considered as well.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: [Proposal] Subdivision of Base ViewObject properties

Post by carlopav »

Yes, indeed hidden properties should be categorized in this scenario.
Does anybody else have thoughts on this subject before I waste time on preparing a PR?
follow my experiments on BIM modelling for architecture design
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: [Proposal] Subdivision of Base ViewObject properties

Post by carlopav »

Those properties of the document object are indeed already commented to be Display properties, so it seems logical to have them grouped in the GUI as well...

Code: Select all

// Display properties
App::PropertyEnumeration DisplayMode;
App::PropertyBool Visibility;
App::PropertyBool ShowInTree;
App::PropertyEnumeration OnTopWhenSelected;
App::PropertyEnumeration SelectionStyle;
follow my experiments on BIM modelling for architecture design
User avatar
Pauvres_honteux
Posts: 728
Joined: Sun Feb 16, 2014 12:05 am
Location: Far side of the moon

Re: [Proposal] Subdivision of Base ViewObject properties

Post by Pauvres_honteux »

Will this have an effect on the GUI ?
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: [Proposal] Subdivision of Base ViewObject properties

Post by carlopav »

Pauvres_honteux wrote: Sun May 31, 2020 8:00 am Will this have an effect on the GUI ?
That's the purpouse, I always struggle to find what I search between the 17 properties of the View Base group.

Does anybody have a hint on the c++ function to assign a property to a group? I'm a python guy... :roll:
follow my experiments on BIM modelling for architecture design
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: [Proposal] Subdivision of Base ViewObject properties

Post by vocx »

carlopav wrote: Sun May 31, 2020 5:11 pm ...
Does anybody have a hint on the c++ function to assign a property to a group? I'm a python guy... :roll:
You can ask realthunder. Currently he has a branch where he's improving the property editor, #3535.

It seems the bits that you need to modify are in src/Gui/propertyeditor/, PropertyEditor, PropertyItem, PropertyModel, etc.

Realthunder is introducing collapsible groups, which is a nice thing.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: [Proposal] Subdivision of Base ViewObject properties

Post by carlopav »

@vocx, thanks, I was not aware of that work of @realthunder... indeed he is involved in kinda every aspect of FC!

I'll try to ping Wandererfan, cause I saw many of his c++ objects have properties subdivided. :)
wandererfan wrote: ping
Can you point me out an example where you set a property to be inside a property group in c++ techdraw?
follow my experiments on BIM modelling for architecture design
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: [Proposal] Subdivision of Base ViewObject properties

Post by vocx »

carlopav wrote: Sun May 31, 2020 9:56 pm @vocx, thanks, I was not aware of that work of @realthunder... indeed he is involved in kinda every aspect of FC!
...
If you know C++ you can destroy the world and recreate it as you wish! It's that powerful. So, hit the books and try to learn it.

https://github.com/FreeCAD/FreeCAD/blob ... #L129-L169

Setting the groups is not very complicated, you just set it like in Python, using the ADD_PROPERTY_TYPE macro.

Code: Select all

DrawViewPart::DrawViewPart(void) :
    geometryObject(0)
{
    static const char *group = "Projection";
    static const char *sgroup = "HLR Parameters";
    nowUnsetting = false;
...
    //properties that affect Geometry
    ADD_PROPERTY_TYPE(Source ,(0),group,App::Prop_None,"3D Shape to view");
...
    ADD_PROPERTY_TYPE(XSource ,(0),group,App::Prop_None,"External 3D Shape to view");

    ADD_PROPERTY_TYPE(Direction ,(0.0,-1.0,0.0),
                      group,App::Prop_None,"Projection Plane normal. The direction you are looking from.");
    ADD_PROPERTY_TYPE(XDirection ,(0.0,0.0,0.0),
                      group,App::Prop_None,"Projection Plane X Axis in R3. Rotates/Mirrors View");
    ADD_PROPERTY_TYPE(Perspective ,(false),group,App::Prop_None,
                      "Perspective(true) or Orthographic(false) projection");
    ADD_PROPERTY_TYPE(Focus,(defDist),group,App::Prop_None,"Perspective view focus distance");

...
    //properties that control HLR algoaffect Appearance
    ADD_PROPERTY_TYPE(CoarseView, (coarseView), sgroup, App::Prop_None, "Coarse View on/off");
    ADD_PROPERTY_TYPE(SmoothVisible ,(prefSmoothViz()),sgroup,App::Prop_None,"Show Visible Smooth lines");
    ADD_PROPERTY_TYPE(SeamVisible ,(prefSeamViz()),sgroup,App::Prop_None,"Show Visible Seam lines");
    ADD_PROPERTY_TYPE(IsoVisible ,(prefIsoViz()),sgroup,App::Prop_None,"Show Visible Iso u,v lines");
    ADD_PROPERTY_TYPE(HardHidden ,(prefHardHid()),sgroup,App::Prop_None,"Show Hidden Hard lines");
    ADD_PROPERTY_TYPE(SmoothHidden ,(prefSmoothHid()),sgroup,App::Prop_None,"Show Hidden Smooth lines");
    ADD_PROPERTY_TYPE(SeamHidden ,(prefSeamHid()),sgroup,App::Prop_None,"Show Hidden Seam lines");
    ADD_PROPERTY_TYPE(IsoHidden ,(prefIsoHid()),sgroup,App::Prop_None,"Show Hidden Iso u,v lines");
    ADD_PROPERTY_TYPE(IsoCount ,(prefIsoCount()),sgroup,App::Prop_None,"Number of iso parameters lines");
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
carlopav
Veteran
Posts: 2062
Joined: Mon Dec 31, 2018 1:49 pm
Location: Venice, Italy

Re: [Proposal] Subdivision of Base ViewObject properties

Post by carlopav »

vocx wrote: Sun May 31, 2020 11:16 pm If you know C++ you can destroy the world and recreate it as you wish! It's that powerful. So, hit the books and try to learn it.
Scaring... let's not say it loud, the pope is quite near here in italy... :P

Precisely that! thanks, i'll investigate it :)
follow my experiments on BIM modelling for architecture design
Post Reply