use Icons for Refine and Increase tolerance features
This commit is contained in:
parent
f1283cf24c
commit
05af9207a3
|
@ -93,6 +93,8 @@ static char * openscadlogo_xpm[] = {
|
|||
MenuText = "OpenSCAD"
|
||||
ToolTip = "OpenSCAD workbench"
|
||||
def Initialize(self):
|
||||
def QT_TRANSLATE_NOOP(scope, text):
|
||||
return text
|
||||
import OpenSCAD_rc,OpenSCADCommands
|
||||
commands=['OpenSCAD_ReplaceObject','OpenSCAD_RemoveSubtree',\
|
||||
'OpenSCAD_RefineShapeFeature',\
|
||||
|
@ -124,9 +126,9 @@ static char * openscadlogo_xpm[] = {
|
|||
else:
|
||||
FreeCAD.Console.PrintWarning('OpenSCAD executable not found\n')
|
||||
|
||||
self.appendToolbar("OpenSCADTools",toolbarcommands)
|
||||
self.appendToolbar(QT_TRANSLATE_NOOP('Workbench','OpenSCADTools'),toolbarcommands)
|
||||
self.appendMenu('OpenSCAD',commands)
|
||||
self.appendToolbar('OpenSCAD Part tools',parttoolbarcommands)
|
||||
self.appendToolbar(QT_TRANSLATE_NOOP('Workbech','OpenSCAD Part tools'),parttoolbarcommands)
|
||||
#self.appendMenu('OpenSCAD',["AddOpenSCADElement"])
|
||||
###self.appendCommandbar("&Generic Tools",["ColorCodeShape"])
|
||||
FreeCADGui.addIconPath(":/icons")
|
||||
|
|
|
@ -77,7 +77,11 @@ class ViewProviderTree:
|
|||
return objs
|
||||
|
||||
def getIcon(self):
|
||||
#if self.Object.Proxy.__class__ == MatrixTransform:
|
||||
import OpenSCAD_rc
|
||||
if isinstance(self.Object.Proxy,RefineShape):
|
||||
return(":/icons/OpenSCAD_RefineShapeFeature.svg")
|
||||
if isinstance(self.Object.Proxy,IncreaseTolerance):
|
||||
return(":/icons/OpenSCAD_IncreaseToleranceFeature.svg")
|
||||
if isinstance(self.Object.Proxy,MatrixTransform):
|
||||
return """/* XPM */
|
||||
static char * matrix_xpm[] = {
|
||||
|
@ -101,64 +105,6 @@ static char * matrix_xpm[] = {
|
|||
" ............. .",
|
||||
" ......... .",
|
||||
"................"};"""
|
||||
elif False:
|
||||
return """/* XPM */
|
||||
static char * qm_xpm[] = {
|
||||
"16 16 37 1",
|
||||
" c None",
|
||||
". c #FFFFFF",
|
||||
"+ c #CBE3FF",
|
||||
"@ c #70B3FF",
|
||||
"# c #3092FF",
|
||||
"$ c #0D7FFF",
|
||||
"% c #047BFF",
|
||||
"& c #1885FF",
|
||||
"* c #56A6FF",
|
||||
"= c #CFE5FF",
|
||||
"- c #0079FF",
|
||||
"; c #067CFF",
|
||||
"> c #B9DAFF",
|
||||
", c #88C0FF",
|
||||
"' c #CAE3FF",
|
||||
") c #F2F8FF",
|
||||
"! c #FAFCFF",
|
||||
"~ c #CEE5FF",
|
||||
"{ c #459DFF",
|
||||
"] c #2D90FF",
|
||||
"^ c #EEF6FF",
|
||||
"/ c #077CFF",
|
||||
"( c #B1D6FF",
|
||||
"_ c #3494FF",
|
||||
": c #90C4FF",
|
||||
"< c #037AFF",
|
||||
"[ c #BCDBFF",
|
||||
"} c #6EB2FF",
|
||||
"| c #087DFF",
|
||||
"1 c #A8D1FF",
|
||||
"2 c #8AC1FF",
|
||||
"3 c #1C87FF",
|
||||
"4 c #CCE4FF",
|
||||
"5 c #1F89FF",
|
||||
"6 c #CDE4FF",
|
||||
"7 c #027AFF",
|
||||
"8 c #FDFDFF",
|
||||
"....+@#$%&*=....",
|
||||
"....-------;>...",
|
||||
"....#,')!~{-]...",
|
||||
"..........^-/...",
|
||||
"..........(-_...",
|
||||
".........:/<[...",
|
||||
"........}-|1....",
|
||||
".......2-34.....",
|
||||
".......5-6......",
|
||||
".......7-8......",
|
||||
".......--.......",
|
||||
"................",
|
||||
"................",
|
||||
".......--.......",
|
||||
".......--.......",
|
||||
".......--......."};
|
||||
"""
|
||||
else:
|
||||
return """/* XPM */
|
||||
static char * openscadlogo_xpm[] = {
|
||||
|
|
|
@ -251,7 +251,8 @@ def export(exportList,filename):
|
|||
csg = pythonopen(filename,'w')
|
||||
print "Write Inital Output"
|
||||
# Not sure if comments as per scad are allowed in csg file
|
||||
csg.write("// CSG file generated from FreeCAD Export 0.1d\n")
|
||||
csg.write("// CSG file generated from FreeCAD %s\n" % \
|
||||
'.'.join(FreeCAD.Version()[0:3]))
|
||||
#write initial group statements - not sure if required
|
||||
csg.write("group() {\n group(){\n")
|
||||
for ob in exportList:
|
||||
|
|
|
@ -92,7 +92,7 @@ def insert(filename,docname):
|
|||
groupname = os.path.splitext(os.path.basename(filename))[0]
|
||||
try:
|
||||
doc=FreeCAD.getDocument(docname)
|
||||
except FreeCAD.Base.FreeCADError:
|
||||
except NameError:
|
||||
doc=FreeCAD.newDocument(docname)
|
||||
#importgroup = doc.addObject("App::DocumentObjectGroup",groupname)
|
||||
if filename.lower().endswith('.scad'):
|
||||
|
|
Loading…
Reference in New Issue
Block a user