V2: renames inside files
This commit is contained in:
parent
2272bc1356
commit
ab0e6012c9
|
@ -21,8 +21,8 @@
|
||||||
#* *
|
#* *
|
||||||
#***************************************************************************
|
#***************************************************************************
|
||||||
|
|
||||||
from latticeCommon import *
|
from lattice2Common import *
|
||||||
import latticeMarkers as markers
|
import lattice2Markers as markers
|
||||||
import math
|
import math
|
||||||
|
|
||||||
__title__="CompoundFilter module for FreeCAD"
|
__title__="CompoundFilter module for FreeCAD"
|
||||||
|
@ -31,10 +31,10 @@ __url__ = ""
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from latticeBaseFeature import isObjectLattice
|
from lattice2BaseFeature import isObjectLattice2
|
||||||
except Exception:
|
except Exception:
|
||||||
# I want to keep the module easy to strip off Lattice wb, so:
|
# I want to keep the module easy to strip off Lattice2 wb, so:
|
||||||
def isObjectLattice(obj):
|
def isObjectLattice2(obj):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# -------------------------- common stuff --------------------------------------------------
|
# -------------------------- common stuff --------------------------------------------------
|
||||||
|
@ -77,9 +77,9 @@ class _CompoundFilter:
|
||||||
|
|
||||||
def execute(self,obj):
|
def execute(self,obj):
|
||||||
#validity check
|
#validity check
|
||||||
if isObjectLattice(obj.Base):
|
if isObjectLattice2(obj.Base):
|
||||||
import latticeExecuter
|
import lattice2Executer
|
||||||
latticeExecuter.warning(obj,"A generic shape is expected, but a lattice object was supplied. It will be treated as a generic shape.")
|
lattice2Executer.warning(obj,"A generic shape is expected, but a lattice2 object was supplied. It will be treated as a generic shape.")
|
||||||
|
|
||||||
rst = [] #variable to receive the final list of shapes
|
rst = [] #variable to receive the final list of shapes
|
||||||
shps = obj.Base.Shape.childShapes()
|
shps = obj.Base.Shape.childShapes()
|
||||||
|
@ -177,7 +177,7 @@ class _ViewProviderCompoundFilter:
|
||||||
vobj.setEditorMode("DontUnhideOnDelete", 2) # set hidden
|
vobj.setEditorMode("DontUnhideOnDelete", 2) # set hidden
|
||||||
|
|
||||||
def getIcon(self):
|
def getIcon(self):
|
||||||
return getIconPath("Lattice_CompoundFilter.svg")
|
return getIconPath("Lattice2_CompoundFilter.svg")
|
||||||
|
|
||||||
def attach(self, vobj):
|
def attach(self, vobj):
|
||||||
self.ViewObject = vobj
|
self.ViewObject = vobj
|
||||||
|
@ -216,7 +216,7 @@ def CreateCompoundFilter(name):
|
||||||
sel = FreeCADGui.Selection.getSelection()
|
sel = FreeCADGui.Selection.getSelection()
|
||||||
FreeCAD.ActiveDocument.openTransaction("Create CompoundFilter")
|
FreeCAD.ActiveDocument.openTransaction("Create CompoundFilter")
|
||||||
FreeCADGui.addModule("CompoundFilter")
|
FreeCADGui.addModule("CompoundFilter")
|
||||||
FreeCADGui.addModule("latticeExecuter")
|
FreeCADGui.addModule("lattice2Executer")
|
||||||
FreeCADGui.doCommand("f = CompoundFilter.makeCompoundFilter(name = '"+name+"')")
|
FreeCADGui.doCommand("f = CompoundFilter.makeCompoundFilter(name = '"+name+"')")
|
||||||
FreeCADGui.doCommand("f.Base = App.ActiveDocument."+sel[0].Name)
|
FreeCADGui.doCommand("f.Base = App.ActiveDocument."+sel[0].Name)
|
||||||
FreeCADGui.doCommand("f.Base.ViewObject.hide()")
|
FreeCADGui.doCommand("f.Base.ViewObject.hide()")
|
||||||
|
@ -226,7 +226,7 @@ def CreateCompoundFilter(name):
|
||||||
FreeCADGui.doCommand("f.FilterType = 'collision-pass'")
|
FreeCADGui.doCommand("f.FilterType = 'collision-pass'")
|
||||||
else:
|
else:
|
||||||
FreeCADGui.doCommand("f.FilterType = 'window-volume'")
|
FreeCADGui.doCommand("f.FilterType = 'window-volume'")
|
||||||
FreeCADGui.doCommand("latticeExecuter.executeFeature(f)")
|
FreeCADGui.doCommand("lattice2Executer.executeFeature(f)")
|
||||||
FreeCADGui.doCommand("f = None")
|
FreeCADGui.doCommand("f = None")
|
||||||
FreeCAD.ActiveDocument.commitTransaction()
|
FreeCAD.ActiveDocument.commitTransaction()
|
||||||
|
|
||||||
|
@ -238,10 +238,10 @@ def CreateCompoundFilter(name):
|
||||||
class _CommandCompoundFilter:
|
class _CommandCompoundFilter:
|
||||||
"Command to create CompoundFilter feature"
|
"Command to create CompoundFilter feature"
|
||||||
def GetResources(self):
|
def GetResources(self):
|
||||||
return {'Pixmap' : getIconPath("Lattice_CompoundFilter.svg"),
|
return {'Pixmap' : getIconPath("Lattice2_CompoundFilter.svg"),
|
||||||
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice_CompoundFilter","Compound Filter"),
|
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice2_CompoundFilter","Compound Filter"),
|
||||||
'Accel': "",
|
'Accel': "",
|
||||||
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Lattice_CompoundFilter","Compound Filter: remove some childs from a compound")}
|
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Lattice2_CompoundFilter","Compound Filter: remove some childs from a compound")}
|
||||||
|
|
||||||
def Activated(self):
|
def Activated(self):
|
||||||
if len(FreeCADGui.Selection.getSelection()) == 1 or len(FreeCADGui.Selection.getSelection()) == 2 :
|
if len(FreeCADGui.Selection.getSelection()) == 1 or len(FreeCADGui.Selection.getSelection()) == 2 :
|
||||||
|
@ -249,8 +249,8 @@ class _CommandCompoundFilter:
|
||||||
else:
|
else:
|
||||||
mb = QtGui.QMessageBox()
|
mb = QtGui.QMessageBox()
|
||||||
mb.setIcon(mb.Icon.Warning)
|
mb.setIcon(mb.Icon.Warning)
|
||||||
mb.setText(translate("Lattice_CompoundFilter", "Select a shape that is a compound, first! Second selected item (optional) will be treated as a stencil.", None))
|
mb.setText(translate("Lattice2_CompoundFilter", "Select a shape that is a compound, first! Second selected item (optional) will be treated as a stencil.", None))
|
||||||
mb.setWindowTitle(translate("Lattice_CompoundFilter","Bad selection", None))
|
mb.setWindowTitle(translate("Lattice2_CompoundFilter","Bad selection", None))
|
||||||
mb.exec_()
|
mb.exec_()
|
||||||
|
|
||||||
def IsActive(self):
|
def IsActive(self):
|
||||||
|
@ -259,15 +259,15 @@ class _CommandCompoundFilter:
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
FreeCADGui.addCommand('Lattice_CompoundFilter', _CommandCompoundFilter())
|
FreeCADGui.addCommand('Lattice2_CompoundFilter', _CommandCompoundFilter())
|
||||||
|
|
||||||
class _CommandExplode:
|
class _CommandExplode:
|
||||||
"Command to explode compound with parametric links to its children"
|
"Command to explode compound with parametric links to its children"
|
||||||
def GetResources(self):
|
def GetResources(self):
|
||||||
return {'Pixmap' : getIconPath("Lattice_Explode.svg"),
|
return {'Pixmap' : getIconPath("Lattice2_Explode.svg"),
|
||||||
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice_CompoundFilter","Explode compound"),
|
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice2_CompoundFilter","Explode compound"),
|
||||||
'Accel': "",
|
'Accel': "",
|
||||||
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Lattice_CompoundFilter","Explode compound: each member of compound as a separate object")}
|
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Lattice2_CompoundFilter","Explode compound: each member of compound as a separate object")}
|
||||||
|
|
||||||
def Activated(self):
|
def Activated(self):
|
||||||
if len(FreeCADGui.Selection.getSelection()) == 1 :
|
if len(FreeCADGui.Selection.getSelection()) == 1 :
|
||||||
|
@ -294,8 +294,8 @@ class _CommandExplode:
|
||||||
else:
|
else:
|
||||||
mb = QtGui.QMessageBox()
|
mb = QtGui.QMessageBox()
|
||||||
mb.setIcon(mb.Icon.Warning)
|
mb.setIcon(mb.Icon.Warning)
|
||||||
mb.setText(translate("Lattice_CompoundFilter", "Select a shape that is a compound, first!", None))
|
mb.setText(translate("Lattice2_CompoundFilter", "Select a shape that is a compound, first!", None))
|
||||||
mb.setWindowTitle(translate("Lattice_CompoundFilter","Bad selection", None))
|
mb.setWindowTitle(translate("Lattice2_CompoundFilter","Bad selection", None))
|
||||||
mb.exec_()
|
mb.exec_()
|
||||||
|
|
||||||
def IsActive(self):
|
def IsActive(self):
|
||||||
|
@ -304,8 +304,8 @@ class _CommandExplode:
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
FreeCADGui.addCommand('Lattice_Explode', _CommandExplode())
|
FreeCADGui.addCommand('Lattice2_Explode', _CommandExplode())
|
||||||
|
|
||||||
exportedCommands = ['Lattice_CompoundFilter', 'Lattice_Explode']
|
exportedCommands = ['Lattice2_CompoundFilter', 'Lattice2_Explode']
|
||||||
|
|
||||||
# -------------------------- /Gui command --------------------------------------------------
|
# -------------------------- /Gui command --------------------------------------------------
|
||||||
|
|
|
@ -74,9 +74,9 @@ class Lattice2Workbench (Workbench):
|
||||||
import lattice2Downgrade as mod
|
import lattice2Downgrade as mod
|
||||||
|
|
||||||
cmdsCompoundTools = cmdsCompoundTools + mod.exportedCommands
|
cmdsCompoundTools = cmdsCompoundTools + mod.exportedCommands
|
||||||
import CompoundFilter as mod
|
import CompoundFilter2 as mod
|
||||||
cmdsCompoundTools = cmdsCompoundTools + mod.exportedCommands
|
cmdsCompoundTools = cmdsCompoundTools + mod.exportedCommands
|
||||||
import FuseCompound as mod
|
import FuseCompound2 as mod
|
||||||
cmdsCompoundTools = cmdsCompoundTools + mod.exportedCommands
|
cmdsCompoundTools = cmdsCompoundTools + mod.exportedCommands
|
||||||
import lattice2Inspect as mod
|
import lattice2Inspect as mod
|
||||||
cmdsCompoundTools = cmdsCompoundTools + mod.exportedCommands
|
cmdsCompoundTools = cmdsCompoundTools + mod.exportedCommands
|
||||||
|
|
|
@ -30,10 +30,10 @@ import math
|
||||||
import FreeCAD as App
|
import FreeCAD as App
|
||||||
import Part
|
import Part
|
||||||
|
|
||||||
from latticeCommon import *
|
from lattice2Common import *
|
||||||
import latticeBaseFeature
|
import lattice2BaseFeature
|
||||||
import latticeCompoundExplorer as LCE
|
import lattice2CompoundExplorer as LCE
|
||||||
import latticeExecuter
|
import lattice2Executer
|
||||||
|
|
||||||
# -------------------------- document object --------------------------------------------------
|
# -------------------------- document object --------------------------------------------------
|
||||||
|
|
||||||
|
@ -113,7 +113,7 @@ class LatticeApply(latticeBaseFeature.LatticeFeature):
|
||||||
class ViewProviderLatticeApply(latticeBaseFeature.ViewProviderLatticeFeature):
|
class ViewProviderLatticeApply(latticeBaseFeature.ViewProviderLatticeFeature):
|
||||||
|
|
||||||
def getIcon(self):
|
def getIcon(self):
|
||||||
return getIconPath("Lattice_Apply.svg")
|
return getIconPath("Lattice2_Apply.svg")
|
||||||
|
|
||||||
def claimChildren(self):
|
def claimChildren(self):
|
||||||
return [self.Object.Base, self.Object.Tool]
|
return [self.Object.Base, self.Object.Tool]
|
||||||
|
@ -140,10 +140,10 @@ def CreateLatticeApply(name):
|
||||||
class _CommandLatticeApply:
|
class _CommandLatticeApply:
|
||||||
"Command to create LatticeApply feature"
|
"Command to create LatticeApply feature"
|
||||||
def GetResources(self):
|
def GetResources(self):
|
||||||
return {'Pixmap' : getIconPath("Lattice_Apply.svg"),
|
return {'Pixmap' : getIconPath("Lattice2_Apply.svg"),
|
||||||
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice_Apply","Apply array"),
|
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice2_Apply","Apply array"),
|
||||||
'Accel': "",
|
'Accel': "",
|
||||||
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Lattice_Apply","Lattice Apply: put copies of an object at every placement in an array.")}
|
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Lattice2_Apply","Lattice Apply: put copies of an object at every placement in an array.")}
|
||||||
|
|
||||||
def Activated(self):
|
def Activated(self):
|
||||||
if len(FreeCADGui.Selection.getSelection()) == 2 :
|
if len(FreeCADGui.Selection.getSelection()) == 2 :
|
||||||
|
@ -151,8 +151,8 @@ class _CommandLatticeApply:
|
||||||
else:
|
else:
|
||||||
mb = QtGui.QMessageBox()
|
mb = QtGui.QMessageBox()
|
||||||
mb.setIcon(mb.Icon.Warning)
|
mb.setIcon(mb.Icon.Warning)
|
||||||
mb.setText(translate("Lattice_Apply", "Please select two objects, first. The fist object is Base, second is Tool. Base can be a lattice or any shape, that is to be arrayed. Tool must be a lattice object.", None))
|
mb.setText(translate("Lattice2_Apply", "Please select two objects, first. The fist object is Base, second is Tool. Base can be a lattice or any shape, that is to be arrayed. Tool must be a lattice object.", None))
|
||||||
mb.setWindowTitle(translate("Lattice_Apply","Bad selection", None))
|
mb.setWindowTitle(translate("Lattice2_Apply","Bad selection", None))
|
||||||
mb.exec_()
|
mb.exec_()
|
||||||
|
|
||||||
def IsActive(self):
|
def IsActive(self):
|
||||||
|
@ -161,9 +161,9 @@ class _CommandLatticeApply:
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
FreeCADGui.addCommand('Lattice_Apply', _CommandLatticeApply())
|
FreeCADGui.addCommand('Lattice2_Apply', _CommandLatticeApply())
|
||||||
|
|
||||||
exportedCommands = ['Lattice_Apply']
|
exportedCommands = ['Lattice2_Apply']
|
||||||
|
|
||||||
# -------------------------- /Gui command --------------------------------------------------
|
# -------------------------- /Gui command --------------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -24,10 +24,10 @@
|
||||||
import FreeCAD as App
|
import FreeCAD as App
|
||||||
import Part
|
import Part
|
||||||
|
|
||||||
from latticeCommon import *
|
from lattice2Common import *
|
||||||
import latticeBaseFeature
|
import lattice2BaseFeature
|
||||||
import latticeCompoundExplorer as LCE
|
import lattice2CompoundExplorer as LCE
|
||||||
import latticeExecuter
|
import lattice2Executer
|
||||||
|
|
||||||
|
|
||||||
__title__="Lattice ArrayFilter module for FreeCAD"
|
__title__="Lattice ArrayFilter module for FreeCAD"
|
||||||
|
@ -134,7 +134,7 @@ class ViewProviderArrayFilter(latticeBaseFeature.ViewProviderLatticeFeature):
|
||||||
"A View Provider for the Lattice ArrayFilter object"
|
"A View Provider for the Lattice ArrayFilter object"
|
||||||
|
|
||||||
def getIcon(self):
|
def getIcon(self):
|
||||||
return getIconPath("Lattice_ArrayFilter.svg")
|
return getIconPath("Lattice2_ArrayFilter.svg")
|
||||||
|
|
||||||
def claimChildren(self):
|
def claimChildren(self):
|
||||||
children = [self.Object.Base]
|
children = [self.Object.Base]
|
||||||
|
@ -224,10 +224,10 @@ class _CommandArrayFilterItems:
|
||||||
"Command to create Lattice ArrayFilter feature in 'specific items' mode based on current selection"
|
"Command to create Lattice ArrayFilter feature in 'specific items' mode based on current selection"
|
||||||
|
|
||||||
def GetResources(self):
|
def GetResources(self):
|
||||||
return {'Pixmap' : getIconPath("Lattice_ArrayFilter.svg"),
|
return {'Pixmap' : getIconPath("Lattice2_ArrayFilter.svg"),
|
||||||
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice_ArrayFilter","Array Filter: selected items"),
|
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice2_ArrayFilter","Array Filter: selected items"),
|
||||||
'Accel': "",
|
'Accel': "",
|
||||||
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Lattice_ArrayFilter","Array Filter: keep only items that are currently selected.")}
|
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Lattice2_ArrayFilter","Array Filter: keep only items that are currently selected.")}
|
||||||
|
|
||||||
def Activated(self):
|
def Activated(self):
|
||||||
sel = FreeCADGui.Selection.getSelectionEx()
|
sel = FreeCADGui.Selection.getSelectionEx()
|
||||||
|
@ -236,8 +236,8 @@ class _CommandArrayFilterItems:
|
||||||
else:
|
else:
|
||||||
mb = QtGui.QMessageBox()
|
mb = QtGui.QMessageBox()
|
||||||
mb.setIcon(mb.Icon.Warning)
|
mb.setIcon(mb.Icon.Warning)
|
||||||
mb.setText(translate("Lattice_ArrayFilter", "Select elements of a lattice feature, first! Placements other than those that were selected are going to be rejected. The order of selection matters.", None))
|
mb.setText(translate("Lattice2_ArrayFilter", "Select elements of a lattice feature, first! Placements other than those that were selected are going to be rejected. The order of selection matters.", None))
|
||||||
mb.setWindowTitle(translate("Lattice_ArrayFilter","Bad selection", None))
|
mb.setWindowTitle(translate("Lattice2_ArrayFilter","Bad selection", None))
|
||||||
mb.exec_()
|
mb.exec_()
|
||||||
|
|
||||||
def IsActive(self):
|
def IsActive(self):
|
||||||
|
@ -246,8 +246,8 @@ class _CommandArrayFilterItems:
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
FreeCADGui.addCommand('Lattice_ArrayFilter_Items', _CommandArrayFilterItems())
|
FreeCADGui.addCommand('Lattice2_ArrayFilter_Items', _CommandArrayFilterItems())
|
||||||
_listOfSubCommands.append('Lattice_ArrayFilter_Items')
|
_listOfSubCommands.append('Lattice2_ArrayFilter_Items')
|
||||||
|
|
||||||
class _CommandArrayFilterStencilBased:
|
class _CommandArrayFilterStencilBased:
|
||||||
"Command to create Lattice ArrayFilter feature in 'specific items' mode based on current selection"
|
"Command to create Lattice ArrayFilter feature in 'specific items' mode based on current selection"
|
||||||
|
@ -256,7 +256,7 @@ class _CommandArrayFilterStencilBased:
|
||||||
self.mode = mode
|
self.mode = mode
|
||||||
|
|
||||||
def GetResources(self):
|
def GetResources(self):
|
||||||
return {'Pixmap' : getIconPath("Lattice_ArrayFilter.svg"),
|
return {'Pixmap' : getIconPath("Lattice2_ArrayFilter.svg"),
|
||||||
'MenuText': "Array Filter: " + {"collision-pass":"touching",
|
'MenuText': "Array Filter: " + {"collision-pass":"touching",
|
||||||
"window-distance":"within distance window",
|
"window-distance":"within distance window",
|
||||||
"pointing-at":"pointing at shape"}[mode],
|
"pointing-at":"pointing at shape"}[mode],
|
||||||
|
@ -272,8 +272,8 @@ class _CommandArrayFilterStencilBased:
|
||||||
else:
|
else:
|
||||||
mb = QtGui.QMessageBox()
|
mb = QtGui.QMessageBox()
|
||||||
mb.setIcon(mb.Icon.Warning)
|
mb.setIcon(mb.Icon.Warning)
|
||||||
mb.setText(translate("Lattice_ArrayFilter", "Select a lattice array and a stencil shape, first!", None))
|
mb.setText(translate("Lattice2_ArrayFilter", "Select a lattice array and a stencil shape, first!", None))
|
||||||
mb.setWindowTitle(translate("Lattice_ArrayFilter","Bad selection", None))
|
mb.setWindowTitle(translate("Lattice2_ArrayFilter","Bad selection", None))
|
||||||
mb.exec_()
|
mb.exec_()
|
||||||
|
|
||||||
def IsActive(self):
|
def IsActive(self):
|
||||||
|
@ -283,7 +283,7 @@ class _CommandArrayFilterStencilBased:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
for mode in LatticeArrayFilter.stencilModeList:
|
for mode in LatticeArrayFilter.stencilModeList:
|
||||||
cmdName = 'Lattice_ArrayFilter'+mode.replace("-","_")
|
cmdName = 'Lattice2_ArrayFilter'+mode.replace("-","_")
|
||||||
FreeCADGui.addCommand(cmdName, _CommandArrayFilterStencilBased(mode))
|
FreeCADGui.addCommand(cmdName, _CommandArrayFilterStencilBased(mode))
|
||||||
_listOfSubCommands.append(cmdName)
|
_listOfSubCommands.append(cmdName)
|
||||||
|
|
||||||
|
@ -297,21 +297,21 @@ class GroupCommandLatticeArrayFilter:
|
||||||
|
|
||||||
def GetResources(self):
|
def GetResources(self):
|
||||||
return { 'MenuText': 'Array filter:',
|
return { 'MenuText': 'Array filter:',
|
||||||
'ToolTip': 'Array filter: tool to exctract specific elements from lattice arrays.'}
|
'ToolTip': 'Array filter: tool to exctract specific elements from lattice2 arrays.'}
|
||||||
|
|
||||||
def IsActive(self): # optional
|
def IsActive(self): # optional
|
||||||
return bool(App.ActiveDocument)
|
return bool(App.ActiveDocument)
|
||||||
|
|
||||||
FreeCADGui.addCommand('Lattice_ArrayFilter_GroupCommand',GroupCommandLatticeArrayFilter())
|
FreeCADGui.addCommand('Lattice2_ArrayFilter_GroupCommand',GroupCommandLatticeArrayFilter())
|
||||||
|
|
||||||
|
|
||||||
class _CommandExplodeArray:
|
class _CommandExplodeArray:
|
||||||
"Command to explode array with parametric links to its elements"
|
"Command to explode array with parametric links to its elements"
|
||||||
def GetResources(self):
|
def GetResources(self):
|
||||||
return {'Pixmap' : getIconPath("Lattice_ExplodeArray.svg"),
|
return {'Pixmap' : getIconPath("Lattice2_ExplodeArray.svg"),
|
||||||
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice_ArrayFilter","Explode array"),
|
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice2_ArrayFilter","Explode array"),
|
||||||
'Accel': "",
|
'Accel': "",
|
||||||
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Lattice_ArrayFilter","Explode array: get each element of array as a separate object")}
|
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Lattice2_ArrayFilter","Explode array: get each element of array as a separate object")}
|
||||||
|
|
||||||
def Activated(self):
|
def Activated(self):
|
||||||
if len(FreeCADGui.Selection.getSelection()) == 1 :
|
if len(FreeCADGui.Selection.getSelection()) == 1 :
|
||||||
|
@ -344,8 +344,8 @@ class _CommandExplodeArray:
|
||||||
else:
|
else:
|
||||||
mb = QtGui.QMessageBox()
|
mb = QtGui.QMessageBox()
|
||||||
mb.setIcon(mb.Icon.Warning)
|
mb.setIcon(mb.Icon.Warning)
|
||||||
mb.setText(translate("Lattice_ArrayFilter", "Select a lattice object, first!", None))
|
mb.setText(translate("Lattice2_ArrayFilter", "Select a lattice object, first!", None))
|
||||||
mb.setWindowTitle(translate("Lattice_ArrayFilter","Bad selection", None))
|
mb.setWindowTitle(translate("Lattice2_ArrayFilter","Bad selection", None))
|
||||||
mb.exec_()
|
mb.exec_()
|
||||||
|
|
||||||
def IsActive(self):
|
def IsActive(self):
|
||||||
|
@ -354,8 +354,8 @@ class _CommandExplodeArray:
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
FreeCADGui.addCommand('Lattice_ExplodeArray', _CommandExplodeArray())
|
FreeCADGui.addCommand('Lattice2_ExplodeArray', _CommandExplodeArray())
|
||||||
|
|
||||||
exportedCommands = ['Lattice_ArrayFilter_GroupCommand', 'Lattice_ExplodeArray']
|
exportedCommands = ['Lattice2_ArrayFilter_GroupCommand', 'Lattice2_ExplodeArray']
|
||||||
|
|
||||||
# -------------------------- /Gui command --------------------------------------------------
|
# -------------------------- /Gui command --------------------------------------------------
|
||||||
|
|
|
@ -28,10 +28,10 @@ __url__ = ""
|
||||||
import FreeCAD as App
|
import FreeCAD as App
|
||||||
import Part
|
import Part
|
||||||
|
|
||||||
from latticeCommon import *
|
from lattice2Common import *
|
||||||
import latticeCompoundExplorer as LCE
|
import lattice2CompoundExplorer as LCE
|
||||||
import latticeMarkers
|
import lattice2Markers
|
||||||
import latticeExecuter
|
import lattice2Executer
|
||||||
|
|
||||||
def getDefLatticeFaceColor():
|
def getDefLatticeFaceColor():
|
||||||
return (1.0, 0.7019608020782471, 0.0, 0.0) #orange
|
return (1.0, 0.7019608020782471, 0.0, 0.0) #orange
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
#***************************************************************************
|
#***************************************************************************
|
||||||
|
|
||||||
|
|
||||||
from latticeCommon import *
|
from lattice2Common import *
|
||||||
|
|
||||||
|
|
||||||
__title__="BoundingBox module for FreeCAD"
|
__title__="BoundingBox module for FreeCAD"
|
||||||
|
@ -158,7 +158,7 @@ class _ViewProviderBoundBox:
|
||||||
vobj.DisplayMode = "Wireframe"
|
vobj.DisplayMode = "Wireframe"
|
||||||
|
|
||||||
def getIcon(self):
|
def getIcon(self):
|
||||||
return getIconPath("Lattice_BoundBox.svg")
|
return getIconPath("Lattice2_BoundBox.svg")
|
||||||
|
|
||||||
def attach(self, vobj):
|
def attach(self, vobj):
|
||||||
self.ViewObject = vobj
|
self.ViewObject = vobj
|
||||||
|
@ -195,10 +195,10 @@ def CreateBoundBox(name):
|
||||||
class _CommandBoundBox:
|
class _CommandBoundBox:
|
||||||
"Command to create BoundBox feature"
|
"Command to create BoundBox feature"
|
||||||
def GetResources(self):
|
def GetResources(self):
|
||||||
return {'Pixmap' : getIconPath("Lattice_BoundBox.svg"),
|
return {'Pixmap' : getIconPath("Lattice2_BoundBox.svg"),
|
||||||
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice_BoundBox","Parametric bounding box"),
|
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice2_BoundBox","Parametric bounding box"),
|
||||||
'Accel': "",
|
'Accel': "",
|
||||||
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Lattice_BoundBox","Make a box that precisely fits the object")}
|
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Lattice2_BoundBox","Make a box that precisely fits the object")}
|
||||||
|
|
||||||
def Activated(self):
|
def Activated(self):
|
||||||
if len(FreeCADGui.Selection.getSelection()) == 1 :
|
if len(FreeCADGui.Selection.getSelection()) == 1 :
|
||||||
|
@ -206,8 +206,8 @@ class _CommandBoundBox:
|
||||||
else:
|
else:
|
||||||
mb = QtGui.QMessageBox()
|
mb = QtGui.QMessageBox()
|
||||||
mb.setIcon(mb.Icon.Warning)
|
mb.setIcon(mb.Icon.Warning)
|
||||||
mb.setText(translate("Lattice_BoundBox", "Select a shape to make a bounding box for, first!", None))
|
mb.setText(translate("Lattice2_BoundBox", "Select a shape to make a bounding box for, first!", None))
|
||||||
mb.setWindowTitle(translate("Lattice_BoundBox","Bad selection", None))
|
mb.setWindowTitle(translate("Lattice2_BoundBox","Bad selection", None))
|
||||||
mb.exec_()
|
mb.exec_()
|
||||||
|
|
||||||
def IsActive(self):
|
def IsActive(self):
|
||||||
|
@ -216,8 +216,8 @@ class _CommandBoundBox:
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
FreeCADGui.addCommand('Lattice_BoundBox', _CommandBoundBox())
|
FreeCADGui.addCommand('Lattice2_BoundBox', _CommandBoundBox())
|
||||||
|
|
||||||
exportedCommands = ['Lattice_BoundBox']
|
exportedCommands = ['Lattice2_BoundBox']
|
||||||
|
|
||||||
# -------------------------- /Gui command --------------------------------------------------
|
# -------------------------- /Gui command --------------------------------------------------
|
||||||
|
|
|
@ -55,4 +55,4 @@ def getIconPath(icon_dot_svg):
|
||||||
DistConfusion = 1e-7
|
DistConfusion = 1e-7
|
||||||
ParaConfusion = 1e-8
|
ParaConfusion = 1e-8
|
||||||
|
|
||||||
import lattice_rc
|
import lattice2_rc
|
|
@ -30,10 +30,10 @@ import math
|
||||||
import FreeCAD as App
|
import FreeCAD as App
|
||||||
import Part
|
import Part
|
||||||
|
|
||||||
from latticeCommon import *
|
from lattice2Common import *
|
||||||
import latticeBaseFeature
|
import lattice2BaseFeature
|
||||||
import latticeCompoundExplorer as LCE
|
import lattice2CompoundExplorer as LCE
|
||||||
import latticeExecuter
|
import lattice2Executer
|
||||||
|
|
||||||
# -------------------------- document object --------------------------------------------------
|
# -------------------------- document object --------------------------------------------------
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ class Compose(latticeBaseFeature.LatticeFeature):
|
||||||
class ViewProviderCompose(latticeBaseFeature.ViewProviderLatticeFeature):
|
class ViewProviderCompose(latticeBaseFeature.ViewProviderLatticeFeature):
|
||||||
|
|
||||||
def getIcon(self):
|
def getIcon(self):
|
||||||
return getIconPath('Lattice_Compose.svg')
|
return getIconPath('Lattice2_Compose.svg')
|
||||||
|
|
||||||
def claimChildren(self):
|
def claimChildren(self):
|
||||||
return [self.Object.Base, self.Object.Tool]
|
return [self.Object.Base, self.Object.Tool]
|
||||||
|
@ -195,10 +195,10 @@ def CreateCompose(name):
|
||||||
class _CommandCompose:
|
class _CommandCompose:
|
||||||
"Command to create Compose feature"
|
"Command to create Compose feature"
|
||||||
def GetResources(self):
|
def GetResources(self):
|
||||||
return {'Pixmap' : getIconPath("Lattice_Compose.svg"),
|
return {'Pixmap' : getIconPath("Lattice2_Compose.svg"),
|
||||||
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice_Compose","Compose arrays"),
|
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice2_Compose","Compose arrays"),
|
||||||
'Accel': "",
|
'Accel': "",
|
||||||
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Lattice_Compose","Lattice Compose: element-wise operations between compounds")}
|
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Lattice2_Compose","Lattice Compose: element-wise operations between compounds")}
|
||||||
|
|
||||||
def Activated(self):
|
def Activated(self):
|
||||||
if len(FreeCADGui.Selection.getSelection()) == 2 :
|
if len(FreeCADGui.Selection.getSelection()) == 2 :
|
||||||
|
@ -206,8 +206,8 @@ class _CommandCompose:
|
||||||
else:
|
else:
|
||||||
mb = QtGui.QMessageBox()
|
mb = QtGui.QMessageBox()
|
||||||
mb.setIcon(mb.Icon.Warning)
|
mb.setIcon(mb.Icon.Warning)
|
||||||
mb.setText(translate("Lattice_Compose", "Please select two objects, first. The fist object is Base, second is Tool. Base can contain real shapes, as well as be a lattice object. Tool is typically a lattice object.", None))
|
mb.setText(translate("Lattice2_Compose", "Please select two objects, first. The fist object is Base, second is Tool. Base can contain real shapes, as well as be a lattice object. Tool is typically a lattice object.", None))
|
||||||
mb.setWindowTitle(translate("Lattice_Compose","Bad selection", None))
|
mb.setWindowTitle(translate("Lattice2_Compose","Bad selection", None))
|
||||||
mb.exec_()
|
mb.exec_()
|
||||||
|
|
||||||
def IsActive(self):
|
def IsActive(self):
|
||||||
|
@ -216,9 +216,9 @@ class _CommandCompose:
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
FreeCADGui.addCommand('Lattice_Compose', _CommandCompose())
|
FreeCADGui.addCommand('Lattice2_Compose', _CommandCompose())
|
||||||
|
|
||||||
exportedCommands = ['Lattice_Compose']
|
exportedCommands = ['Lattice2_Compose']
|
||||||
|
|
||||||
# -------------------------- /Gui command --------------------------------------------------
|
# -------------------------- /Gui command --------------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -21,8 +21,8 @@
|
||||||
#* *
|
#* *
|
||||||
#***************************************************************************
|
#***************************************************************************
|
||||||
|
|
||||||
from latticeCommon import *
|
from lattice2Common import *
|
||||||
import latticeMarkers as markers
|
import lattice2Markers as markers
|
||||||
import math
|
import math
|
||||||
|
|
||||||
__title__="latticeDowngrade module for FreeCAD"
|
__title__="latticeDowngrade module for FreeCAD"
|
||||||
|
@ -117,7 +117,7 @@ class _ViewProviderLatticeDowngrade:
|
||||||
vobj.Proxy = self
|
vobj.Proxy = self
|
||||||
|
|
||||||
def getIcon(self):
|
def getIcon(self):
|
||||||
return getIconPath("Lattice_Downgrade.svg")
|
return getIconPath("Lattice2_Downgrade.svg")
|
||||||
|
|
||||||
def attach(self, vobj):
|
def attach(self, vobj):
|
||||||
self.ViewObject = vobj
|
self.ViewObject = vobj
|
||||||
|
@ -177,10 +177,10 @@ class _CommandLatticeDowngrade:
|
||||||
self.mode = mode
|
self.mode = mode
|
||||||
|
|
||||||
def GetResources(self):
|
def GetResources(self):
|
||||||
return {'Pixmap' : getIconPath("Lattice_Downgrade.svg"),
|
return {'Pixmap' : getIconPath("Lattice2_Downgrade.svg"),
|
||||||
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice_Downgrade","Downgrade to ") + self.mode, # FIXME: not translation-friendly!
|
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice2_Downgrade","Downgrade to ") + self.mode, # FIXME: not translation-friendly!
|
||||||
'Accel': "",
|
'Accel': "",
|
||||||
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Lattice_Downgrade","Parametric Downgrade: downgrade and put results into a compound.")}
|
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Lattice2_Downgrade","Parametric Downgrade: downgrade and put results into a compound.")}
|
||||||
|
|
||||||
def Activated(self):
|
def Activated(self):
|
||||||
if len(FreeCADGui.Selection.getSelection()) == 1 :
|
if len(FreeCADGui.Selection.getSelection()) == 1 :
|
||||||
|
@ -188,8 +188,8 @@ class _CommandLatticeDowngrade:
|
||||||
else:
|
else:
|
||||||
mb = QtGui.QMessageBox()
|
mb = QtGui.QMessageBox()
|
||||||
mb.setIcon(mb.Icon.Warning)
|
mb.setIcon(mb.Icon.Warning)
|
||||||
mb.setText(translate("Lattice_Downgrade", "Select a shape to downgrade, first!", None))
|
mb.setText(translate("Lattice2_Downgrade", "Select a shape to downgrade, first!", None))
|
||||||
mb.setWindowTitle(translate("Lattice_Downgrade","Bad selection", None))
|
mb.setWindowTitle(translate("Lattice2_Downgrade","Bad selection", None))
|
||||||
mb.exec_()
|
mb.exec_()
|
||||||
|
|
||||||
def IsActive(self):
|
def IsActive(self):
|
||||||
|
@ -200,7 +200,7 @@ class _CommandLatticeDowngrade:
|
||||||
|
|
||||||
_listOfSubCommands = []
|
_listOfSubCommands = []
|
||||||
for mode in _latticeDowngrade._DowngradeModeList:
|
for mode in _latticeDowngrade._DowngradeModeList:
|
||||||
cmdName = 'Lattice_Downgrade' + mode
|
cmdName = 'Lattice2_Downgrade' + mode
|
||||||
FreeCADGui.addCommand(cmdName, _CommandLatticeDowngrade(mode))
|
FreeCADGui.addCommand(cmdName, _CommandLatticeDowngrade(mode))
|
||||||
_listOfSubCommands.append(cmdName)
|
_listOfSubCommands.append(cmdName)
|
||||||
|
|
||||||
|
@ -219,11 +219,11 @@ class GroupCommandLatticeDowngrade:
|
||||||
def IsActive(self): # optional
|
def IsActive(self): # optional
|
||||||
return True
|
return True
|
||||||
|
|
||||||
FreeCADGui.addCommand('Lattice_Downgrade_GroupCommand',GroupCommandLatticeDowngrade())
|
FreeCADGui.addCommand('Lattice2_Downgrade_GroupCommand',GroupCommandLatticeDowngrade())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
exportedCommands = ['Lattice_Downgrade_GroupCommand']
|
exportedCommands = ['Lattice2_Downgrade_GroupCommand']
|
||||||
|
|
||||||
# -------------------------- /Gui command --------------------------------------------------
|
# -------------------------- /Gui command --------------------------------------------------
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
|
|
||||||
import FreeCAD as App
|
import FreeCAD as App
|
||||||
|
|
||||||
from latticeCommon import *
|
from lattice2Common import *
|
||||||
|
|
||||||
__title__="Geometric utility routines for Lattice workbench for FreeCAD"
|
__title__="Geometric utility routines for Lattice workbench for FreeCAD"
|
||||||
__author__ = "DeepSOIC"
|
__author__ = "DeepSOIC"
|
||||||
|
|
|
@ -28,9 +28,9 @@ __url__ = ""
|
||||||
import FreeCAD as App
|
import FreeCAD as App
|
||||||
import Part
|
import Part
|
||||||
|
|
||||||
from latticeCommon import *
|
from lattice2Common import *
|
||||||
import latticeCompoundExplorer as LCE
|
import lattice2CompoundExplorer as LCE
|
||||||
import latticeBaseFeature
|
import lattice2BaseFeature
|
||||||
|
|
||||||
def shapeInfoString(shape):
|
def shapeInfoString(shape):
|
||||||
strMsg = shape.ShapeType
|
strMsg = shape.ShapeType
|
||||||
|
@ -59,10 +59,10 @@ class _CommandInspect:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
def GetResources(self):
|
def GetResources(self):
|
||||||
return {'Pixmap' : getIconPath("Lattice_Inspect.svg"),
|
return {'Pixmap' : getIconPath("Lattice2_Inspect.svg"),
|
||||||
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice_Inspect","Inspect selection") , # FIXME: not translation-friendly!
|
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice2_Inspect","Inspect selection") , # FIXME: not translation-friendly!
|
||||||
'Accel': "",
|
'Accel': "",
|
||||||
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Lattice_Inspect","Lattice Inspect: display info on compounding structure of selected object.")}
|
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Lattice2_Inspect","Lattice Inspect: display info on compounding structure of selected object.")}
|
||||||
|
|
||||||
def Activated(self):
|
def Activated(self):
|
||||||
sel = FreeCADGui.Selection.getSelectionEx()[0]
|
sel = FreeCADGui.Selection.getSelectionEx()[0]
|
||||||
|
@ -115,7 +115,7 @@ class _CommandInspect:
|
||||||
mb = QtGui.QMessageBox()
|
mb = QtGui.QMessageBox()
|
||||||
mb.setIcon(mb.Icon.Information)
|
mb.setIcon(mb.Icon.Information)
|
||||||
mb.setText(allText)
|
mb.setText(allText)
|
||||||
mb.setWindowTitle(translate("Lattice_Inspect","Selection info", None))
|
mb.setWindowTitle(translate("Lattice2_Inspect","Selection info", None))
|
||||||
|
|
||||||
btnClose = mb.addButton(QtGui.QMessageBox.StandardButton.Close)
|
btnClose = mb.addButton(QtGui.QMessageBox.StandardButton.Close)
|
||||||
btnCopy = mb.addButton("Copy to clipboard",QtGui.QMessageBox.ButtonRole.ActionRole)
|
btnCopy = mb.addButton("Copy to clipboard",QtGui.QMessageBox.ButtonRole.ActionRole)
|
||||||
|
@ -132,7 +132,7 @@ class _CommandInspect:
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
FreeCADGui.addCommand('Lattice_Inspect',_CommandInspect())
|
FreeCADGui.addCommand('Lattice2_Inspect',_CommandInspect())
|
||||||
|
|
||||||
exportedCommands = ['Lattice_Inspect']
|
exportedCommands = ['Lattice2_Inspect']
|
||||||
|
|
||||||
|
|
|
@ -28,10 +28,10 @@ __url__ = ""
|
||||||
import FreeCAD as App
|
import FreeCAD as App
|
||||||
import Part
|
import Part
|
||||||
|
|
||||||
from latticeCommon import *
|
from lattice2Common import *
|
||||||
import latticeBaseFeature
|
import lattice2BaseFeature
|
||||||
import latticeCompoundExplorer as LCE
|
import lattice2CompoundExplorer as LCE
|
||||||
import latticeExecuter
|
import lattice2Executer
|
||||||
|
|
||||||
# -------------------------- document object --------------------------------------------------
|
# -------------------------- document object --------------------------------------------------
|
||||||
|
|
||||||
|
@ -90,7 +90,7 @@ class JoinArrays(latticeBaseFeature.LatticeFeature):
|
||||||
class ViewProviderJoinArrays(latticeBaseFeature.ViewProviderLatticeFeature):
|
class ViewProviderJoinArrays(latticeBaseFeature.ViewProviderLatticeFeature):
|
||||||
|
|
||||||
def getIcon(self):
|
def getIcon(self):
|
||||||
return getIconPath('Lattice_JoinArrays.svg')
|
return getIconPath('Lattice2_JoinArrays.svg')
|
||||||
|
|
||||||
def claimChildren(self):
|
def claimChildren(self):
|
||||||
return self.Object.Links
|
return self.Object.Links
|
||||||
|
@ -119,10 +119,10 @@ def CreateJoinArrays(name):
|
||||||
class _CommandJoinArrays:
|
class _CommandJoinArrays:
|
||||||
"Command to create JoinArrays feature"
|
"Command to create JoinArrays feature"
|
||||||
def GetResources(self):
|
def GetResources(self):
|
||||||
return {'Pixmap' : getIconPath("Lattice_JoinArrays.svg"),
|
return {'Pixmap' : getIconPath("Lattice2_JoinArrays.svg"),
|
||||||
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice_JoinArrays","Join arrays"),
|
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice2_JoinArrays","Join arrays"),
|
||||||
'Accel': "",
|
'Accel': "",
|
||||||
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Lattice_JoinArrays","Lattice JoinArrays: concatenate or interleave two or more arrays.")}
|
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Lattice2_JoinArrays","Lattice JoinArrays: concatenate or interleave two or more arrays.")}
|
||||||
|
|
||||||
def Activated(self):
|
def Activated(self):
|
||||||
if len(FreeCADGui.Selection.getSelection()) > 1 :
|
if len(FreeCADGui.Selection.getSelection()) > 1 :
|
||||||
|
@ -130,8 +130,8 @@ class _CommandJoinArrays:
|
||||||
else:
|
else:
|
||||||
mb = QtGui.QMessageBox()
|
mb = QtGui.QMessageBox()
|
||||||
mb.setIcon(mb.Icon.Warning)
|
mb.setIcon(mb.Icon.Warning)
|
||||||
mb.setText(translate("Lattice_JoinArrays", "Please select at least two lattice objects. Selected lattice objects will be concatenated or interleaved into one array.", None))
|
mb.setText(translate("Lattice2_JoinArrays", "Please select at least two lattice objects. Selected lattice objects will be concatenated or interleaved into one array.", None))
|
||||||
mb.setWindowTitle(translate("Lattice_JoinArrays","Bad selection", None))
|
mb.setWindowTitle(translate("Lattice2_JoinArrays","Bad selection", None))
|
||||||
mb.exec_()
|
mb.exec_()
|
||||||
|
|
||||||
def IsActive(self):
|
def IsActive(self):
|
||||||
|
@ -140,9 +140,9 @@ class _CommandJoinArrays:
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
FreeCADGui.addCommand('Lattice_JoinArrays', _CommandJoinArrays())
|
FreeCADGui.addCommand('Lattice2_JoinArrays', _CommandJoinArrays())
|
||||||
|
|
||||||
exportedCommands = ['Lattice_JoinArrays']
|
exportedCommands = ['Lattice2_JoinArrays']
|
||||||
|
|
||||||
# -------------------------- /Gui command --------------------------------------------------
|
# -------------------------- /Gui command --------------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -30,10 +30,10 @@ import math
|
||||||
import FreeCAD as App
|
import FreeCAD as App
|
||||||
import Part
|
import Part
|
||||||
|
|
||||||
from latticeCommon import *
|
from lattice2Common import *
|
||||||
import latticeBaseFeature
|
import lattice2BaseFeature
|
||||||
import latticeExecuter
|
import lattice2Executer
|
||||||
import latticeGeomUtils
|
import lattice2GeomUtils
|
||||||
|
|
||||||
def makeLinearArray(name):
|
def makeLinearArray(name):
|
||||||
'''makeLinearArray(name): makes a LinearArray object.'''
|
'''makeLinearArray(name): makes a LinearArray object.'''
|
||||||
|
@ -219,7 +219,7 @@ class LinearArray(latticeBaseFeature.LatticeFeature):
|
||||||
class ViewProviderLinearArray(latticeBaseFeature.ViewProviderLatticeFeature):
|
class ViewProviderLinearArray(latticeBaseFeature.ViewProviderLatticeFeature):
|
||||||
|
|
||||||
def getIcon(self):
|
def getIcon(self):
|
||||||
return getIconPath('Lattice_LinearArray.svg')
|
return getIconPath('Lattice2_LinearArray.svg')
|
||||||
|
|
||||||
# -------------------------- /document object --------------------------------------------------
|
# -------------------------- /document object --------------------------------------------------
|
||||||
|
|
||||||
|
@ -243,10 +243,10 @@ def CreateLinearArray(name):
|
||||||
class _CommandLinearArray:
|
class _CommandLinearArray:
|
||||||
"Command to create LinearArray feature"
|
"Command to create LinearArray feature"
|
||||||
def GetResources(self):
|
def GetResources(self):
|
||||||
return {'Pixmap' : getIconPath("Lattice_LinearArray.svg"),
|
return {'Pixmap' : getIconPath("Lattice2_LinearArray.svg"),
|
||||||
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice_LinearArray","Generate linear array"),
|
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice2_LinearArray","Generate linear array"),
|
||||||
'Accel': "",
|
'Accel': "",
|
||||||
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Lattice_LinearArray","Make a linear array lattice object (array of placements)")}
|
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Lattice2_LinearArray","Make a linear array lattice object (array of placements)")}
|
||||||
|
|
||||||
def Activated(self):
|
def Activated(self):
|
||||||
if len(FreeCADGui.Selection.getSelection()) < 2 :
|
if len(FreeCADGui.Selection.getSelection()) < 2 :
|
||||||
|
@ -254,8 +254,8 @@ class _CommandLinearArray:
|
||||||
else:
|
else:
|
||||||
mb = QtGui.QMessageBox()
|
mb = QtGui.QMessageBox()
|
||||||
mb.setIcon(mb.Icon.Warning)
|
mb.setIcon(mb.Icon.Warning)
|
||||||
mb.setText(translate("Lattice_LinearArray", "Either don't select anything, or select a linear edge to serve an axis. More than one object was selected, not supported.", None))
|
mb.setText(translate("Lattice2_LinearArray", "Either don't select anything, or select a linear edge to serve an axis. More than one object was selected, not supported.", None))
|
||||||
mb.setWindowTitle(translate("Lattice_LinearArray","Bad selection", None))
|
mb.setWindowTitle(translate("Lattice2_LinearArray","Bad selection", None))
|
||||||
mb.exec_()
|
mb.exec_()
|
||||||
|
|
||||||
def IsActive(self):
|
def IsActive(self):
|
||||||
|
@ -264,9 +264,9 @@ class _CommandLinearArray:
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
FreeCADGui.addCommand('Lattice_LinearArray', _CommandLinearArray())
|
FreeCADGui.addCommand('Lattice2_LinearArray', _CommandLinearArray())
|
||||||
|
|
||||||
exportedCommands = ['Lattice_LinearArray']
|
exportedCommands = ['Lattice2_LinearArray']
|
||||||
|
|
||||||
# -------------------------- /Gui command --------------------------------------------------
|
# -------------------------- /Gui command --------------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -30,8 +30,8 @@ import math
|
||||||
import FreeCAD as App
|
import FreeCAD as App
|
||||||
import Part
|
import Part
|
||||||
|
|
||||||
from latticeCommon import *
|
from lattice2Common import *
|
||||||
import latticeBaseFeature
|
import lattice2BaseFeature
|
||||||
|
|
||||||
def makeLatticePlacement(name):
|
def makeLatticePlacement(name):
|
||||||
'''makePlacement(name): makes a Placement object.'''
|
'''makePlacement(name): makes a Placement object.'''
|
||||||
|
@ -93,7 +93,7 @@ class LatticePlacement(latticeBaseFeature.LatticeFeature):
|
||||||
class ViewProviderLatticePlacement(latticeBaseFeature.ViewProviderLatticeFeature):
|
class ViewProviderLatticePlacement(latticeBaseFeature.ViewProviderLatticeFeature):
|
||||||
|
|
||||||
def getIcon(self):
|
def getIcon(self):
|
||||||
return getIconPath('Lattice_Placement.svg')
|
return getIconPath('Lattice2_Placement.svg')
|
||||||
|
|
||||||
# -------------------------- /document object --------------------------------------------------
|
# -------------------------- /document object --------------------------------------------------
|
||||||
|
|
||||||
|
@ -118,10 +118,10 @@ class _CommandPlacement:
|
||||||
self.mode = mode
|
self.mode = mode
|
||||||
|
|
||||||
def GetResources(self):
|
def GetResources(self):
|
||||||
return {'Pixmap' : getIconPath("Lattice_Placement.svg"),
|
return {'Pixmap' : getIconPath("Lattice2_Placement.svg"),
|
||||||
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice_Placement","Single Placement: ") + self.mode, # FIXME: not translation-friendly!
|
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice2_Placement","Single Placement: ") + self.mode, # FIXME: not translation-friendly!
|
||||||
'Accel': "",
|
'Accel': "",
|
||||||
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Lattice_Placement","Lattice Placement: Create lattice object with single item")}
|
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Lattice2_Placement","Lattice Placement: Create lattice object with single item")}
|
||||||
|
|
||||||
def Activated(self):
|
def Activated(self):
|
||||||
CreateLatticePlacement(name= "Placement", mode= self.mode)
|
CreateLatticePlacement(name= "Placement", mode= self.mode)
|
||||||
|
@ -134,11 +134,11 @@ class _CommandPlacement:
|
||||||
|
|
||||||
_listOfSubCommands = []
|
_listOfSubCommands = []
|
||||||
for mode in LatticePlacement._PlacementChoiceList:
|
for mode in LatticePlacement._PlacementChoiceList:
|
||||||
cmdName = 'Lattice_Placement' + mode
|
cmdName = 'Lattice2_Placement' + mode
|
||||||
FreeCADGui.addCommand(cmdName, _CommandPlacement(mode))
|
FreeCADGui.addCommand(cmdName, _CommandPlacement(mode))
|
||||||
_listOfSubCommands.append(cmdName)
|
_listOfSubCommands.append(cmdName)
|
||||||
import latticeArrayFromShape
|
import lattice2ArrayFromShape
|
||||||
_listOfSubCommands.append('Lattice_PlacementFromShape')
|
_listOfSubCommands.append('Lattice2_PlacementFromShape')
|
||||||
|
|
||||||
class GroupCommandPlacement:
|
class GroupCommandPlacement:
|
||||||
def GetCommands(self):
|
def GetCommands(self):
|
||||||
|
@ -154,11 +154,11 @@ class GroupCommandPlacement:
|
||||||
def IsActive(self): # optional
|
def IsActive(self): # optional
|
||||||
return True
|
return True
|
||||||
|
|
||||||
FreeCADGui.addCommand('Lattice_Placement_GroupCommand',GroupCommandPlacement())
|
FreeCADGui.addCommand('Lattice2_Placement_GroupCommand',GroupCommandPlacement())
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
exportedCommands = ['Lattice_Placement_GroupCommand']
|
exportedCommands = ['Lattice2_Placement_GroupCommand']
|
||||||
|
|
||||||
# -------------------------- /Gui command --------------------------------------------------
|
# -------------------------- /Gui command --------------------------------------------------
|
||||||
|
|
|
@ -30,10 +30,10 @@ import math
|
||||||
import FreeCAD as App
|
import FreeCAD as App
|
||||||
import Part
|
import Part
|
||||||
|
|
||||||
from latticeCommon import *
|
from lattice2Common import *
|
||||||
import latticeBaseFeature
|
import lattice2BaseFeature
|
||||||
import latticeExecuter
|
import lattice2Executer
|
||||||
import latticeGeomUtils
|
import lattice2GeomUtils
|
||||||
|
|
||||||
def makePolarArray(name):
|
def makePolarArray(name):
|
||||||
'''makePolarArray(name): makes a PolarArray object.'''
|
'''makePolarArray(name): makes a PolarArray object.'''
|
||||||
|
@ -212,7 +212,7 @@ class PolarArray(latticeBaseFeature.LatticeFeature):
|
||||||
class ViewProviderPolarArray(latticeBaseFeature.ViewProviderLatticeFeature):
|
class ViewProviderPolarArray(latticeBaseFeature.ViewProviderLatticeFeature):
|
||||||
|
|
||||||
def getIcon(self):
|
def getIcon(self):
|
||||||
return getIconPath('Lattice_PolarArray.svg')
|
return getIconPath('Lattice2_PolarArray.svg')
|
||||||
|
|
||||||
# -------------------------- /document object --------------------------------------------------
|
# -------------------------- /document object --------------------------------------------------
|
||||||
|
|
||||||
|
@ -236,10 +236,10 @@ def CreatePolarArray(name):
|
||||||
class _CommandPolarArray:
|
class _CommandPolarArray:
|
||||||
"Command to create PolarArray feature"
|
"Command to create PolarArray feature"
|
||||||
def GetResources(self):
|
def GetResources(self):
|
||||||
return {'Pixmap' : getIconPath("Lattice_PolarArray.svg"),
|
return {'Pixmap' : getIconPath("Lattice2_PolarArray.svg"),
|
||||||
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice_PolarArray","Generate polar array"),
|
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice2_PolarArray","Generate polar array"),
|
||||||
'Accel': "",
|
'Accel': "",
|
||||||
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Lattice_PolarArray","Make a polar array lattice object (array of placements)")}
|
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Lattice2_PolarArray","Make a polar array lattice object (array of placements)")}
|
||||||
|
|
||||||
def Activated(self):
|
def Activated(self):
|
||||||
if len(FreeCADGui.Selection.getSelection()) < 2 :
|
if len(FreeCADGui.Selection.getSelection()) < 2 :
|
||||||
|
@ -247,8 +247,8 @@ class _CommandPolarArray:
|
||||||
else:
|
else:
|
||||||
mb = QtGui.QMessageBox()
|
mb = QtGui.QMessageBox()
|
||||||
mb.setIcon(mb.Icon.Warning)
|
mb.setIcon(mb.Icon.Warning)
|
||||||
mb.setText(translate("Lattice_PolarArray", "Either don't select anything, or select an object to serve an axis. More than one object was selected, not supported.", None))
|
mb.setText(translate("Lattice2_PolarArray", "Either don't select anything, or select an object to serve an axis. More than one object was selected, not supported.", None))
|
||||||
mb.setWindowTitle(translate("Lattice_PolarArray","Bad selection", None))
|
mb.setWindowTitle(translate("Lattice2_PolarArray","Bad selection", None))
|
||||||
mb.exec_()
|
mb.exec_()
|
||||||
|
|
||||||
def IsActive(self):
|
def IsActive(self):
|
||||||
|
@ -257,9 +257,9 @@ class _CommandPolarArray:
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
FreeCADGui.addCommand('Lattice_PolarArray', _CommandPolarArray())
|
FreeCADGui.addCommand('Lattice2_PolarArray', _CommandPolarArray())
|
||||||
|
|
||||||
exportedCommands = ['Lattice_PolarArray']
|
exportedCommands = ['Lattice2_PolarArray']
|
||||||
|
|
||||||
# -------------------------- /Gui command --------------------------------------------------
|
# -------------------------- /Gui command --------------------------------------------------
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ __author__ = "DeepSOIC"
|
||||||
import FreeCAD as App
|
import FreeCAD as App
|
||||||
|
|
||||||
from replaceobj import replaceobj #from OpenSCAD wb, the code that drives replaceChild
|
from replaceobj import replaceobj #from OpenSCAD wb, the code that drives replaceChild
|
||||||
from latticeCommon import *
|
from lattice2Common import *
|
||||||
|
|
||||||
def substituteobj(oldobj, newobj):
|
def substituteobj(oldobj, newobj):
|
||||||
'Replaces all links to oldobj in the document with links to newobj'
|
'Replaces all links to oldobj in the document with links to newobj'
|
||||||
|
@ -38,10 +38,10 @@ def substituteobj(oldobj, newobj):
|
||||||
class CommandSubstituteObject:
|
class CommandSubstituteObject:
|
||||||
"Command to substitute object"
|
"Command to substitute object"
|
||||||
def GetResources(self):
|
def GetResources(self):
|
||||||
return {'Pixmap' : getIconPath("Lattice_SubstituteObject.svg"),
|
return {'Pixmap' : getIconPath("Lattice2_SubstituteObject.svg"),
|
||||||
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice_SubstituteObject","Substitute object"),
|
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice2_SubstituteObject","Substitute object"),
|
||||||
'Accel': "",
|
'Accel': "",
|
||||||
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Lattice_SubstituteObject","Substitute Object: find all links to one of the selected objects, and rediret them all to another object")}
|
'ToolTip': QtCore.QT_TRANSLATE_NOOP("Lattice2_SubstituteObject","Substitute Object: find all links to one of the selected objects, and rediret them all to another object")}
|
||||||
|
|
||||||
def Activated(self):
|
def Activated(self):
|
||||||
sel = FreeCADGui.Selection.getSelectionEx()
|
sel = FreeCADGui.Selection.getSelectionEx()
|
||||||
|
@ -58,18 +58,18 @@ class CommandSubstituteObject:
|
||||||
if len(sel[0].Object.InList) != 0:
|
if len(sel[0].Object.InList) != 0:
|
||||||
mb = QtGui.QMessageBox()
|
mb = QtGui.QMessageBox()
|
||||||
mb.setIcon(mb.Icon.Warning)
|
mb.setIcon(mb.Icon.Warning)
|
||||||
msg = translate("Lattice_SubstituteObject", "Some of the links coudn't be redirected, because they are not supported by the tool. Objects still linking to the object that was replaced are: \n%1\nTo redirect these links, the objects have to be edited manually. Sorry!", None)
|
msg = translate("Lattice2_SubstituteObject", "Some of the links coudn't be redirected, because they are not supported by the tool. Objects still linking to the object that was replaced are: \n%1\nTo redirect these links, the objects have to be edited manually. Sorry!", None)
|
||||||
rem_links = [lnk.Label for lnk in sel[0].Object.InList]
|
rem_links = [lnk.Label for lnk in sel[0].Object.InList]
|
||||||
mb.setText(msg.replace(u"%1", u"\n".join(rem_links)))
|
mb.setText(msg.replace(u"%1", u"\n".join(rem_links)))
|
||||||
mb.setWindowTitle(translate("Lattice_SubstituteObject","Error", None))
|
mb.setWindowTitle(translate("Lattice2_SubstituteObject","Error", None))
|
||||||
mb.exec_()
|
mb.exec_()
|
||||||
|
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
mb = QtGui.QMessageBox()
|
mb = QtGui.QMessageBox()
|
||||||
mb.setIcon(mb.Icon.Warning)
|
mb.setIcon(mb.Icon.Warning)
|
||||||
mb.setText(translate("Lattice_SubstituteObject", "An error occured while substituting object:", None)+ u"\n"
|
mb.setText(translate("Lattice2_SubstituteObject", "An error occured while substituting object:", None)+ u"\n"
|
||||||
+ unicode(err.message))
|
+ unicode(err.message))
|
||||||
mb.setWindowTitle(translate("Lattice_SubstituteObject","Error", None))
|
mb.setWindowTitle(translate("Lattice2_SubstituteObject","Error", None))
|
||||||
mb.exec_()
|
mb.exec_()
|
||||||
App.ActiveDocument.abortTransaction()
|
App.ActiveDocument.abortTransaction()
|
||||||
return
|
return
|
||||||
|
@ -85,8 +85,8 @@ class CommandSubstituteObject:
|
||||||
else:
|
else:
|
||||||
mb = QtGui.QMessageBox()
|
mb = QtGui.QMessageBox()
|
||||||
mb.setIcon(mb.Icon.Warning)
|
mb.setIcon(mb.Icon.Warning)
|
||||||
mb.setText(translate("Lattice_SubstituteObject", "Select two objects, first! The first one is the one to be substituted, and the second one is the object to redirect all links to.", None))
|
mb.setText(translate("Lattice2_SubstituteObject", "Select two objects, first! The first one is the one to be substituted, and the second one is the object to redirect all links to.", None))
|
||||||
mb.setWindowTitle(translate("Lattice_SubstituteObject","Bad selection", None))
|
mb.setWindowTitle(translate("Lattice2_SubstituteObject","Bad selection", None))
|
||||||
mb.exec_()
|
mb.exec_()
|
||||||
|
|
||||||
def IsActive(self):
|
def IsActive(self):
|
||||||
|
@ -95,6 +95,6 @@ class CommandSubstituteObject:
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
FreeCADGui.addCommand('Lattice_SubstituteObject', CommandSubstituteObject())
|
FreeCADGui.addCommand('Lattice2_SubstituteObject', CommandSubstituteObject())
|
||||||
|
|
||||||
exportedCommands = ['Lattice_SubstituteObject']
|
exportedCommands = ['Lattice2_SubstituteObject']
|
||||||
|
|
Loading…
Reference in New Issue
Block a user