material editor

A forum to discuss the implementation of a good Materials system in FreeCAD
User avatar
bernd
Posts: 5817
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: material editor

Postby bernd » Wed Jun 13, 2018 8:17 pm

thanks guys for the links. I will add some comment in the code where to find the property definition.
damian
Posts: 536
Joined: Sun May 31, 2015 6:16 pm

Re: material editor

Postby damian » Thu Jun 14, 2018 7:14 am

Good morning:
yorik wrote:
Mon Jun 11, 2018 3:36 pm
Yeah the model view thing in Qt is not simple...
yorik wrote: Basically you need to use a QTreeView instead of a QTreeWidget, and make a model yourself, which is the "entity" whick keeps/organizes the data of a tree widget, and give it a custom QStyledItemDelegate which handles the actions when you want to edit an item of the tree
In this link, https://github.com/caceres/FreeCAD/commits/mat, there is a draft about the migration to model/view.

I've read all the threads and posted documentation. I'll read again.

Thank you.
damian
Posts: 536
Joined: Sun May 31, 2015 6:16 pm

Re: material editor

Postby damian » Mon Jun 18, 2018 11:35 am

yorik wrote:
Mon Jun 11, 2018 3:36 pm
That is easy for the "fixed" properties (we know their type), but when the user adds custom properties, I'm not sure. Ideally there should be a way to specify the property type. Maybe we need one more column that says the type?
Good morning:
The last weekend I've been dealing with a very similar model with properties. I'm experimenting with a property's definition like
[Name, Type, Value, Units, Constraints, Comments ...]
Perhaps the end user must be allowed to define all characteristics of the custom properties
The next months I'll be working intensively with models ...
damian
Posts: 536
Joined: Sun May 31, 2015 6:16 pm

Re: material editor

Postby damian » Thu Jun 28, 2018 9:22 pm

bernd wrote:
Sun Jun 10, 2018 4:07 am
@damian:

do you still do some dev for material editor? What I would like to see is a nice Gui::Input field to change the material attributes, like we have in FEM


Screenshot_20180610_060454.png


Do you do development in this regard? With such an input field in material editor, I would totally switch to the material editor for material editing in FEM.

Bernd
Hello. No. I don't achieve Gui::InputField working in the delegate class. For a strange reason after finish successful setEditorData, setModelData seems to lose the editor signal. I don't understand it.
I have examples with QLineEdit, QSpinBox, and QComboBox all working fine, and with all type of data. But with Gui::InputField no.
User avatar
bernd
Posts: 5817
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: material editor

Postby bernd » Fri Jun 29, 2018 12:35 pm

You may make an small explizit code example and describe the problem in a new topic in the developer part of the forum. There might be someone who could help. May be there is a limitation in th Gui::InputField which could be changed ...

bernd
User avatar
bernd
Posts: 5817
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: material editor

Postby bernd » Fri Jun 29, 2018 4:48 pm

BTW: the material editor has no icon ... https://forum.freecadweb.org/viewtopic.php?f=34&t=29528
damian
Posts: 536
Joined: Sun May 31, 2015 6:16 pm

Re: material editor

Postby damian » Mon Jul 02, 2018 7:02 am

Good morning:

from my point of view Gui::InputField has two inconvenient:

1º) A field with units meters shows green painted with 10 Pa or 10 l

2º) No possible to impose constraints on the values, at least in an obvious way
User avatar
bernd
Posts: 5817
Joined: Sun Sep 08, 2013 8:07 pm
Location: Zürich, Switzerland

Re: material editor

Postby bernd » Wed Jul 04, 2018 4:41 am

damian wrote:
Mon Jul 02, 2018 7:02 am
from my point of view Gui::InputField has two inconvenient:
1º) A field with units meters shows green painted with 10 Pa or 10 l
Mhh strange we do not have this problem in FEM material task panel ...


damian wrote:
Mon Jul 02, 2018 7:02 am
from my point of view Gui::InputField has two inconvenient:
2º) No possible to impose constraints on the values, at least in an obvious way
What do you mean by this?