From f4da53bd1d59739092e7b08cf521c11c47d7432a Mon Sep 17 00:00:00 2001 From: Yorik van Havre Date: Tue, 19 Nov 2013 19:27:15 -0200 Subject: [PATCH] Material: Created material editor Materal editor is now funcional, abeit not complete. Can be used to create and save new cards. Lauch from within FreeCAD with import MaterialEditor; MaterialEditor.openEditor() --- src/Mod/Material/CMakeLists.txt | 9 + src/Mod/Material/MaterialEditor.py | 239 ++++++ .../Resources/icons/preview-rendered.svg | 99 +++ .../Resources/icons/preview-vector.svg | 107 +++ .../Material/StandardMaterial/Concrete.FCMat | 56 ++ src/Mod/Material/importFCMat.py | 86 +- src/Mod/Material/materials-editor.ui | 738 +++++++++++++++--- 7 files changed, 1209 insertions(+), 125 deletions(-) create mode 100644 src/Mod/Material/MaterialEditor.py create mode 100644 src/Mod/Material/Resources/icons/preview-rendered.svg create mode 100644 src/Mod/Material/Resources/icons/preview-vector.svg create mode 100644 src/Mod/Material/StandardMaterial/Concrete.FCMat diff --git a/src/Mod/Material/CMakeLists.txt b/src/Mod/Material/CMakeLists.txt index e84059861345..8175d1f7c563 100644 --- a/src/Mod/Material/CMakeLists.txt +++ b/src/Mod/Material/CMakeLists.txt @@ -4,6 +4,7 @@ SET(Material_SRCS InitGui.py Material.py importFCMat.py + MaterialEditor.py ) SOURCE_GROUP("" FILES ${Material_SRCS}) @@ -34,3 +35,11 @@ INSTALL( FILES ${Material_SRCS} DESTINATION Mod/Material ) + +INSTALL( + DIRECTORY + StandardMaterial + DESTINATION + ${CMAKE_INSTALL_DATADIR}/Mod/Material + FILES_MATCHING PATTERN "*.FCMat*" +) diff --git a/src/Mod/Material/MaterialEditor.py b/src/Mod/Material/MaterialEditor.py new file mode 100644 index 000000000000..5b482031f1af --- /dev/null +++ b/src/Mod/Material/MaterialEditor.py @@ -0,0 +1,239 @@ +#*************************************************************************** +#* * +#* Copyright (c) 2013 - Yorik van Havre * +#* * +#* This program is free software; you can redistribute it and/or modify * +#* it under the terms of the GNU Lesser General Public License (LGPL) * +#* as published by the Free Software Foundation; either version 2 of * +#* the License, or (at your option) any later version. * +#* for detail see the LICENCE text file. * +#* * +#* This program is distributed in the hope that it will be useful, * +#* but WITHOUT ANY WARRANTY; without even the implied warranty of * +#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * +#* GNU Library General Public License for more details. * +#* * +#* You should have received a copy of the GNU Library General Public * +#* License along with this program; if not, write to the Free Software * +#* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * +#* USA * +#* * +#*************************************************************************** + +import FreeCAD, os +from PyQt4 import QtCore, QtGui, uic + +__title__="FreeCAD material editor" +__author__ = "Yorik van Havre" +__url__ = "http://www.freecadweb.org" + +class MaterialEditor(QtGui.QDialog): + + def __init__(self, obj = None, prop = None): + "Initializes, optionally with an object name and a material property name to edit" + QtGui.QDialog.__init__(self) + self.obj = obj + self.prop = prop + self.customprops = [] + # load the UI file from the same directory as this script + uic.loadUi(os.path.dirname(__file__)+os.sep+"materials-editor.ui",self) + self.ui = self + # additional UI fixes and tweaks + self.ButtonURL.setIcon(QtGui.QIcon(":/icons/internet-web-browser.svg")) + self.ButtonDeleteProperty.setEnabled(False) + self.standardButtons.button(QtGui.QDialogButtonBox.Ok).setAutoDefault(False) + self.standardButtons.button(QtGui.QDialogButtonBox.Cancel).setAutoDefault(False) + self.updateCards() + self.Editor.header().resizeSection(0,200) + self.Editor.expandAll() + self.Editor.setFocus() + # TODO allow to enter a custom property by pressing Enter in the lineedit (currently closes the dialog) + self.Editor.setEditTriggers(QtGui.QAbstractItemView.NoEditTriggers) + QtCore.QObject.connect(self.ComboMaterial, QtCore.SIGNAL("currentIndexChanged(QString)"), self.updateContents) + QtCore.QObject.connect(self.ButtonURL, QtCore.SIGNAL("clicked()"), self.openProductURL) + QtCore.QObject.connect(self.standardButtons, QtCore.SIGNAL("accepted()"), self.accept) + QtCore.QObject.connect(self.standardButtons, QtCore.SIGNAL("rejected()"), self.reject) + QtCore.QObject.connect(self.ButtonAddProperty, QtCore.SIGNAL("clicked()"), self.addCustomProperty) + QtCore.QObject.connect(self.EditProperty, QtCore.SIGNAL("returnPressed()"), self.addCustomProperty) + QtCore.QObject.connect(self.ButtonDeleteProperty, QtCore.SIGNAL("clicked()"), self.deleteCustomProperty) + QtCore.QObject.connect(self.Editor, QtCore.SIGNAL("itemDoubleClicked(QTreeWidgetItem*,int)"), self.itemClicked) + QtCore.QObject.connect(self.Editor, QtCore.SIGNAL("currentItemChanged(QTreeWidgetItem*,QTreeWidgetItem*)"), self.checkDeletable) + QtCore.QObject.connect(self.ButtonOpen, QtCore.SIGNAL("clicked()"), self.openfile) + QtCore.QObject.connect(self.ButtonSave, QtCore.SIGNAL("clicked()"), self.savefile) + # update the editor with the contents of the property, if we have one + if self.prop and self.obj: + d = FreeCAD.ActiveDocument.getObject(self.obj).getPropertyByName(self.prop) + self.updateContents(d) + + def updateCards(self): + "updates the contents of the materials combo with existing material cards" + # look for cards in both resources dir and user folder. + # User cards with same name will override system cards + paths = [FreeCAD.getResourceDir() + os.sep + "Mod" + os.sep + "Material" + os.sep + "StandardMaterial"] + paths.append(FreeCAD.ConfigGet("UserAppData")) + self.cards = {} + for p in paths: + for f in os.listdir(p): + b,e = os.path.splitext(f) + if e.upper() == ".FCMAT": + self.cards[b] = p + os.sep + f + if self.cards: + self.ComboMaterial.clear() + self.ComboMaterial.addItem("") # add a blank item first + for k,i in self.cards.iteritems(): + self.ComboMaterial.addItem(k) + + def updateContents(self,data): + "updates the contents of the editor with the given data (can be the name of a card or a dictionary)" + if isinstance(data,dict): + self.clearEditor() + for k,i in data.iteritems(): + k = self.expandKey(k) + slot = self.Editor.findItems(k,QtCore.Qt.MatchRecursive,0) + if len(slot) == 1: + slot = slot[0] + slot.setText(1,i) + else: + self.addCustomProperty(k,i) + elif isinstance(data,QtCore.QString): + k = str(data) + if k: + if k in self.cards: + import importFCMat + d = importFCMat.read(self.cards[k]) + if d: + self.updateContents(d) + + def openProductURL(self): + "opens the contents of the ProductURL field in an external browser" + url = str(self.Editor.findItems(translate("Material","Product URL"),QtCore.Qt.MatchRecursive,0)[0].text(1)) + if url: + QtGui.QDesktopServices.openUrl(QtCore.QUrl(url, QtCore.QUrl.TolerantMode)) + + def accept(self): + "if we are editing a property, set the property values" + if self.prop and self.obj: + d = self.getDict() + o = FreeCAD.ActiveDocument.getObject(self.obj) + setattr(o,self.prop,d) + QtGui.QDialog.accept(self) + + def expandKey(self, key): + "adds spaces before caps in a KeyName" + nk = "" + for l in key: + if l.isupper(): + if nk: + # this allows for series of caps, such as ProductURL + if not nk[-1].isupper(): + nk += " " + nk += l + return nk + + def collapseKey(self, key): + "removes the spaces in a Key Name" + nk = "" + for l in key: + if l != " ": + nk += l + return nk + + def clearEditor(self): + "Clears the contents of the editor" + for i1 in range(self.Editor.topLevelItemCount()): + w = self.Editor.topLevelItem(i1) + for i2 in range(w.childCount()): + c = w.child(i2) + c.setText(1,"") + for k in self.customprops: + self.deleteCustomProperty(k) + + def addCustomProperty(self, key = None, value = None): + "Adds a custom property to the editor, optionally with a value" + if not key: + key = str(self.EditProperty.text()) + if key: + if not key in self.customprops: + if not self.Editor.findItems(key,QtCore.Qt.MatchRecursive,0): + top = self.Editor.findItems(translate("Material","User defined"),QtCore.Qt.MatchExactly,0) + if top: + i = QtGui.QTreeWidgetItem(top[0]) + i.setFlags(QtCore.Qt.ItemIsSelectable|QtCore.Qt.ItemIsEditable|QtCore.Qt.ItemIsDragEnabled|QtCore.Qt.ItemIsUserCheckable|QtCore.Qt.ItemIsEnabled) + i.setText(0,key) + self.customprops.append(key) + self.EditProperty.setText("") + if value: + i.setText(1,value) + + def deleteCustomProperty(self, key = None): + "Deletes a custom property from the editor" + if not key: + key = str(self.Editor.currentItem().text(0)) + if key: + if key in self.customprops: + i = self.Editor.findItems(key,QtCore.Qt.MatchRecursive,0) + if i: + top = self.Editor.findItems(translate("Material","User defined"),QtCore.Qt.MatchExactly,0) + if top: + top = top[0] + ii = top.indexOfChild(i[0]) + if ii >= 0: + top.takeChild(ii) + self.customprops.remove(key) + + def itemClicked(self, item, column): + "Edits an item if it is not in the first column" + if column > 0: + self.Editor.editItem(item, column) + + def checkDeletable(self,current,previous): + "Checks if the current item is a custom property, if yes enable the delete button" + if str(current.text(0)) in self.customprops: + self.ButtonDeleteProperty.setEnabled(True) + else: + self.ButtonDeleteProperty.setEnabled(False) + + def getDict(self): + "returns a dictionnary from the contents of the editor" + d = {} + for i1 in range(self.Editor.topLevelItemCount()): + w = self.Editor.topLevelItem(i1) + for i2 in range(w.childCount()): + c = w.child(i2) + # TODO the following should be translated back to english,since text(0) could be translated + d[self.collapseKey(str(c.text(0)))] = unicode(c.text(1)) + return d + + def openfile(self): + "Opens a FCMat file" + filename = QtGui.QFileDialog.getOpenFileName(QtGui.qApp.activeWindow(),'Open FreeCAD Material file','*.FCMat') + if filename: + self.clearEditor() + import importFCMat + d = importFCMat.read(filename) + if d: + self.updateContents(d) + + def savefile(self): + "Saves a FCMat file" + name = str(self.Editor.findItems(translate("Material","Name"),QtCore.Qt.MatchRecursive,0)[0].text(1)) + if not name: + name = "Material" + filename = QtGui.QFileDialog.getSaveFileName(QtGui.qApp.activeWindow(),'Save FreeCAD Material file',name+'.FCMat') + if filename: + d = self.getDict() + if d: + import importFCMat + importFCMat.write(filename,d) + + +def translate(context,text): + "translates text" + return text #TODO use Qt translation mechanism here + +def openEditor(obj = None, prop = None): + """openEditor([obj,prop]): opens the editor, optionally with + an object name and material property name to edit""" + editor = MaterialEditor(obj,prop) + editor.show() + diff --git a/src/Mod/Material/Resources/icons/preview-rendered.svg b/src/Mod/Material/Resources/icons/preview-rendered.svg new file mode 100644 index 000000000000..3504b3640e1d --- /dev/null +++ b/src/Mod/Material/Resources/icons/preview-rendered.svg @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + diff --git a/src/Mod/Material/Resources/icons/preview-vector.svg b/src/Mod/Material/Resources/icons/preview-vector.svg new file mode 100644 index 000000000000..9bfb93f1b379 --- /dev/null +++ b/src/Mod/Material/Resources/icons/preview-vector.svg @@ -0,0 +1,107 @@ + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/src/Mod/Material/StandardMaterial/Concrete.FCMat b/src/Mod/Material/StandardMaterial/Concrete.FCMat new file mode 100644 index 000000000000..99462b07e1bf --- /dev/null +++ b/src/Mod/Material/StandardMaterial/Concrete.FCMat @@ -0,0 +1,56 @@ +; Standard Concrete Material +; (c) 2013 Yorik van Havre (CC-BY 3.0) +; file produced by FreeCAD 0.14 2756 (Git) +; information about the content of this card can be found here: +; http://www.freecadweb.org/wiki/index.php?title=Material + +[General] +Vendor= +Name=Concrete +SpecificPrice= +Father=Aggregate +ProductURL=http://en.wikipedia.org/wiki/Concrete +SpecificWeight=2400 kg/m³ +Description=A standard C-25 construction concrete + +[Mechanical] +UltimateTensileStrength= +CompressiveStrength=25 Mpa +YoungsModulus= +Elasticity= +FractureToughness= + +[FEM] +PoissonRatio= + +[Architectural] +StandardCode=Masterformat 03 33 13 +EnvironmentalEfficiencyClass= +FireResistanceClass= +Finish= +Color= +ExecutionInstructions= +SoundTransmissionClass= +UnitsPerQuantity= +ThermalConductivity= +Model= + +[Rendering] +TextureScaling= +FragmentShader= +AmbientColor= +EmissiveColor= +DiffuseColor= +Shininess= +SpecularColor= +Transparency= +VertexShader= +TexturePath= + +[Vector rendering] +ViewLinewidth= +ViewFillPattern= +SectionLinewidth= +SectionFillPattern= +ViewColor= + diff --git a/src/Mod/Material/importFCMat.py b/src/Mod/Material/importFCMat.py index c69f1ae7326d..faf4475d9f01 100644 --- a/src/Mod/Material/importFCMat.py +++ b/src/Mod/Material/importFCMat.py @@ -26,6 +26,21 @@ __author__ = "Juergen Riegel" __url__ = "http://www.freecadweb.org" +# file structure - this affects how files are saved +FileStructure = [ + [ "Meta", ["CardName","AuthorAndLicense","Source"] ], + [ "General", ["Name","Father","Description","SpecificWeight","Vendor","ProductURL","SpecificPrice"] ], + [ "Mechanical", ["YoungsModulus","UltimateTensileStrength","CompressiveStrength","Elasticity","FractureToughness"] ], + [ "FEM", ["PoissonRatio"] ], + [ "Architectural", ["Model","ExecutionInstructions","FireResistanceClass","StandardCode","ThermalConductivity","SoundTransmissionClass","Color","Finish","UnitsPerQuantity","EnvironmentalEfficiencyClass"] ], + [ "Rendering", ["DiffuseColor","AmbientColor","SpecularColor","Shininess","EmissiveColor","Transparency","VertexShader","FragmentShader","TexturePath","TextureScaling"] ], + [ "Vector rendering",["ViewColor","ViewFillPattern","SectionFillPattern","ViewLinewidth","SectionLinewidth"] ], + [ "User defined", [] ] +] + +# to distinguish python built-in open function from the one declared below +if open.__module__ == '__builtin__': + pythonopen = open def open(filename): "called when freecad wants to open a file" @@ -45,6 +60,10 @@ def insert(filename,docname): FreeCAD.ActiveDocument = doc read(filename) return doc + +def export(exportList,filename): + "called when freecad exports a file" + return def decode(name): "decodes encoded strings" @@ -59,8 +78,65 @@ def decode(name): return decodedName def read(filename): - FreeCAD.Console.PrintError("Not implemented yet") - -def export(exportList,filename): - "called when freecad exports a file" - return + "reads a FCMat file and returns a dictionary from it" + f = pythonopen(filename) + d = {} + l = 0 + for line in f: + if l == 0: + d["CardName"] = line.split(";")[1].strip() + elif l == 1: + d["AuthorAndLicense"] = line.split(";")[1].strip() + else: + if not line[0] in ";#[": + k = line.split("=") + if len(k) == 2: + d[k[0].strip()] = k[1].strip().decode('utf-8') + l += 1 + return d + +def write(filename,dictionary): + "writes the given dictionary to the given file" + # sort the data into sections + contents = [] + for key in FileStructure: + contents.append({"keyname":key[0]}) + if key[0] == "Meta": + header = contents[-1] + elif key[0] == "User defined": + user = contents[-1] + for p in key[1]: + contents[-1][p] = "" + for k,i in dictionary.iteritems(): + found = False + for group in contents: + if not found: + if k in group.keys(): + group[k] = i + found = True + if not found: + user[k] = i + # write header + rev = FreeCAD.ConfigGet("BuildVersionMajor")+"."+FreeCAD.ConfigGet("BuildVersionMinor")+" "+FreeCAD.ConfigGet("BuildRevision") + f = pythonopen(filename,"wb") + f.write("; " + header["CardName"] + "\n") + f.write("; " + header["AuthorAndLicense"] + "\n") + f.write("; file produced by FreeCAD " + rev + "\n") + f.write("; information about the content of this card can be found here:\n") + f.write("; http://www.freecadweb.org/wiki/index.php?title=Material\n") + f.write("\n") + if header["Source"]: + f.write("; source of the data provided in this card:\n") + f.write("; " + header["Source"] + "\n") + f.write("\n") + # write sections + for s in contents: + if s["keyname"] != "Meta": + if len(s) > 1: + # if the section has no contents, we don't write it + f.write("[" + s["keyname"] + "]\n") + for k,i in s.iteritems(): + if k != "keyname": + f.write(k + "=" + i.encode('utf-8') + "\n") + f.write("\n") + f.close() diff --git a/src/Mod/Material/materials-editor.ui b/src/Mod/Material/materials-editor.ui index 29fdabdba9d0..d8fb395f1b90 100644 --- a/src/Mod/Material/materials-editor.ui +++ b/src/Mod/Material/materials-editor.ui @@ -1,56 +1,57 @@ - Dialog - + MaterialEditor + 0 0 - 422 - 470 + 450 + 599 - Dialog + Material Editor + + + + + 22 + 22 + + + + Opens the Product URL of this material in an external browser + + + + + + - Material + Material card: - + - 0 + 120 0 - - - Steel - - - - - - - - Wood - - - - - Brick - - + + Existing material cards + @@ -67,32 +68,100 @@ - - - Delete + + + Opens an existing material card - - - - - Import... + Open... - + + + Saves this material as a card + - Export... + Save as... + + + + Preview + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 96 + 96 + + + + + 96 + 96 + + + + + + + + + 96 + 96 + + + + + 96 + 96 + + + + + + + + + QLayout::SetMaximumSize + - + + + + 0 + 0 + + + + + 0 + 300 + + true @@ -118,10 +187,66 @@ Value + + + Meta information + + + Additional information that will be written in the material card. + + + + 75 + true + + + + + Card Name + + + This is a description of your material, for ex. "Standard Steel Material" + + + + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled + + + + + Author And License + + + Your name and license info, for ex. "John Smith, CC-BY 3.0" + + + + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled + + + + + Source + + + An optional description of where the informations included in this card come from + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled + + + General + + General properties of this material + 75 @@ -154,16 +279,92 @@ Name + + A uniquely identificable name, for ex. "Steel". This should match the name of the card. + - Steel + + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled + + + + + Father + + + An optional father material. Missing properties here will be taken from the father. For ex. "Metal" + + + + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled Description + + A longer and more precise description of your material + - A long description of this steel material and its milagrous properties + + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled + + + + + Specific Weight + + + Specific weight of this material, in kg/mm³. For ex. 7800.0e-12 + + + + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled + + + + + Vendor + + + The name of the vendor of this material + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled + + + + + Product URL + + + A URL where information about this material can be found + + + + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled + + + + + Specific Price + + + A price for this material, including the unit, for ex. 1.5 EUR/kg + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled @@ -174,6 +375,9 @@ Mechanical + + Mechanical properties of this material + 75 @@ -203,10 +407,91 @@ - Young Module + Youngs Modulus + + + Also called tensile modulus or elastic modulus, a measure of the stiffness of a material, in kPa + + + + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled + + + + + Ultimate Tensile Strength + + + The maximum stress that a material can withstand while being stretched or pulled before failing or breaking, in MPa + + + + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled + + + + + Compressive Strength + + + The capacity of a material or structure to withstand loads tending to reduce size + + + + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled + + + + + Elasticity + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled + + + + + Fracture Toughness + + + The ability of a material containing a crack to resist fracture + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled + + + + + + FEM + + + FEM-related properties + + + + 75 + true + + + + + Poisson Ratio + + + The Poisson ratio is the negative ratio of transverse to axial strain. - 0.00001 + + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled @@ -214,6 +499,9 @@ Architectural + + Architectural properties + 75 @@ -243,26 +531,115 @@ - Vendor + Model + + + The specific model of a certain product + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled + + - Steel Prod. Co. Inc. Ltd. Pty. + Execution Instructions + + + Specific execution or installation insstructions + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled - Product URL + Fire Resistance Class + + + Fire resistance standard and class, for ex. RF 1h or UL 350-2 + + + + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled + + + + + Standard Code + + + The standard and code this material is described in, for ex. MasterFormat 03-1113.310 + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled + + + + + Thermal Conductivity + + + The property of a material to conduct heat, in W/mK. + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled + + - http://www.steel.com/steel1234 + Sound Transmission Class + + + A standard and rating indicating how well a material attenuates airborne sound. For ex. STC 44 + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled - Other Property + Color + + + A specific color for this product + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled + + + + + Finish + + + A special finish specification for this product + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled + + + + + Units Per Quantity + + + In case this product is made of small units, this property describes how many units fit into a certain volume or area, for ex. 50 units/m³ + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled + + - Some absurd value + Environmental Efficiency Class + + + A standard and rating of this material regarding sustainability and environmental design + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled @@ -270,6 +647,9 @@ Rendering + + Properties used by the FreeCAD 3D view, but also by external renderers + 75 @@ -310,24 +690,131 @@ Diffuse Color + + A diffuse color, expressed with 3 comma-separated float values, for ex. 0.5,0.5,0.5 + - rgb(255,0,0) + + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled + + + + + Ambient Color + + + An ambient color, expressed with 3 comma-separated float values, for ex. 0.5,0.5,0.5 + + + + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled Specular Color + + A specular color, expressed with 3 comma-separated float values, for ex. 0.5,0.5,0.5 + + + + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled + + + + + Shininess + + + An intensity value for shininess/specularity, expressed as a float value between 0 and 1.0 + + + + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled + + + + + Emissive Color + + + An emission color, expressed with 3 comma-separated float values, for ex. 0.5,0.5,0.5 + + + + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled + + + + + Transparency + + + A transparency value, expressed as a float value between 0 (opaque) and 1.0 (fully transparent) + + + + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled + + + + + Vertex Shader + + + An optional vertex shader to be used by renderers that support it + - rgb(255,255,255) + + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled - Specular Intensity Item + Fragment Shader + + An optional fragment shader to be used by renderers that support it + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled + + + - 100 + Texture Path + + + A path to a texture image, to be used by the renderers that support it + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled + + + + + Texture Scaling + + + A scaling value for the texture, might be used differently by different renderes + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled @@ -335,6 +822,9 @@ Vector rendering + + Properties applicable in vector renderings + 75 @@ -366,119 +856,127 @@ View Color + + A base color for viewed faces, expressed with 3 comma-separated float values, for ex. 0.5,0.5,0.5 + - rgb(255,0,0) + + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled - Section Fill + View Fill Pattern + + An SVG pattern to apply on viewed faces, expressed as either a name of an existing pattern (such as "simple") or a complete <pattern>...</pattern> SVG element + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled + + + - slant fill + Section Fill Pattern + + + An SVG pattern to apply on cut faces, expressed as either a name of an existing pattern (such as "simple") or a complete <pattern>...</pattern> SVG element + + + + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled View Linewidth + + An optional linewidth factor for viewed faces + - 1px + + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled Section Linewidth + + An optional linewidth factor for cut faces + - 4px + + + + ItemIsSelectable|ItemIsEditable|ItemIsDragEnabled|ItemIsUserCheckable|ItemIsEnabled + + + User defined + + + Additional properties defined by the user + + + + 75 + true + + + - + - Add new property + Add / Remove - + - - - Group - - - - - + - - General - + - - Mechanical - + + + Add property + + - - Architectural - - - - - Rendering - + + + Delete property + + - - - - - - Name - - - - - + - - - - - - Add new property... - - - - - - - false - - - Delete property - - - - - - - QDialogButtonBox::Cancel|QDialogButtonBox::Ok - - - - - + + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + +