V2: renames inside files

This commit is contained in:
DeepSOIC 2015-11-26 23:53:58 +03:00
parent 2272bc1356
commit ab0e6012c9
16 changed files with 169 additions and 169 deletions

View File

@ -21,8 +21,8 @@
#* *
#***************************************************************************
from latticeCommon import *
import latticeMarkers as markers
from lattice2Common import *
import lattice2Markers as markers
import math
__title__="CompoundFilter module for FreeCAD"
@ -31,10 +31,10 @@ __url__ = ""
try:
from latticeBaseFeature import isObjectLattice
from lattice2BaseFeature import isObjectLattice2
except Exception:
# I want to keep the module easy to strip off Lattice wb, so:
def isObjectLattice(obj):
# I want to keep the module easy to strip off Lattice2 wb, so:
def isObjectLattice2(obj):
return False
# -------------------------- common stuff --------------------------------------------------
@ -77,9 +77,9 @@ class _CompoundFilter:
def execute(self,obj):
#validity check
if isObjectLattice(obj.Base):
import latticeExecuter
latticeExecuter.warning(obj,"A generic shape is expected, but a lattice object was supplied. It will be treated as a generic shape.")
if isObjectLattice2(obj.Base):
import lattice2Executer
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
shps = obj.Base.Shape.childShapes()
@ -177,7 +177,7 @@ class _ViewProviderCompoundFilter:
vobj.setEditorMode("DontUnhideOnDelete", 2) # set hidden
def getIcon(self):
return getIconPath("Lattice_CompoundFilter.svg")
return getIconPath("Lattice2_CompoundFilter.svg")
def attach(self, vobj):
self.ViewObject = vobj
@ -216,7 +216,7 @@ def CreateCompoundFilter(name):
sel = FreeCADGui.Selection.getSelection()
FreeCAD.ActiveDocument.openTransaction("Create CompoundFilter")
FreeCADGui.addModule("CompoundFilter")
FreeCADGui.addModule("latticeExecuter")
FreeCADGui.addModule("lattice2Executer")
FreeCADGui.doCommand("f = CompoundFilter.makeCompoundFilter(name = '"+name+"')")
FreeCADGui.doCommand("f.Base = App.ActiveDocument."+sel[0].Name)
FreeCADGui.doCommand("f.Base.ViewObject.hide()")
@ -226,7 +226,7 @@ def CreateCompoundFilter(name):
FreeCADGui.doCommand("f.FilterType = 'collision-pass'")
else:
FreeCADGui.doCommand("f.FilterType = 'window-volume'")
FreeCADGui.doCommand("latticeExecuter.executeFeature(f)")
FreeCADGui.doCommand("lattice2Executer.executeFeature(f)")
FreeCADGui.doCommand("f = None")
FreeCAD.ActiveDocument.commitTransaction()
@ -238,10 +238,10 @@ def CreateCompoundFilter(name):
class _CommandCompoundFilter:
"Command to create CompoundFilter feature"
def GetResources(self):
return {'Pixmap' : getIconPath("Lattice_CompoundFilter.svg"),
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice_CompoundFilter","Compound Filter"),
return {'Pixmap' : getIconPath("Lattice2_CompoundFilter.svg"),
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice2_CompoundFilter","Compound Filter"),
'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):
if len(FreeCADGui.Selection.getSelection()) == 1 or len(FreeCADGui.Selection.getSelection()) == 2 :
@ -249,8 +249,8 @@ class _CommandCompoundFilter:
else:
mb = QtGui.QMessageBox()
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.setWindowTitle(translate("Lattice_CompoundFilter","Bad selection", 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("Lattice2_CompoundFilter","Bad selection", None))
mb.exec_()
def IsActive(self):
@ -259,15 +259,15 @@ class _CommandCompoundFilter:
else:
return False
FreeCADGui.addCommand('Lattice_CompoundFilter', _CommandCompoundFilter())
FreeCADGui.addCommand('Lattice2_CompoundFilter', _CommandCompoundFilter())
class _CommandExplode:
"Command to explode compound with parametric links to its children"
def GetResources(self):
return {'Pixmap' : getIconPath("Lattice_Explode.svg"),
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice_CompoundFilter","Explode compound"),
return {'Pixmap' : getIconPath("Lattice2_Explode.svg"),
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice2_CompoundFilter","Explode compound"),
'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):
if len(FreeCADGui.Selection.getSelection()) == 1 :
@ -294,8 +294,8 @@ class _CommandExplode:
else:
mb = QtGui.QMessageBox()
mb.setIcon(mb.Icon.Warning)
mb.setText(translate("Lattice_CompoundFilter", "Select a shape that is a compound, first!", None))
mb.setWindowTitle(translate("Lattice_CompoundFilter","Bad selection", None))
mb.setText(translate("Lattice2_CompoundFilter", "Select a shape that is a compound, first!", None))
mb.setWindowTitle(translate("Lattice2_CompoundFilter","Bad selection", None))
mb.exec_()
def IsActive(self):
@ -304,8 +304,8 @@ class _CommandExplode:
else:
return False
FreeCADGui.addCommand('Lattice_Explode', _CommandExplode())
FreeCADGui.addCommand('Lattice2_Explode', _CommandExplode())
exportedCommands = ['Lattice_CompoundFilter', 'Lattice_Explode']
exportedCommands = ['Lattice2_CompoundFilter', 'Lattice2_Explode']
# -------------------------- /Gui command --------------------------------------------------

View File

@ -74,9 +74,9 @@ class Lattice2Workbench (Workbench):
import lattice2Downgrade as mod
cmdsCompoundTools = cmdsCompoundTools + mod.exportedCommands
import CompoundFilter as mod
import CompoundFilter2 as mod
cmdsCompoundTools = cmdsCompoundTools + mod.exportedCommands
import FuseCompound as mod
import FuseCompound2 as mod
cmdsCompoundTools = cmdsCompoundTools + mod.exportedCommands
import lattice2Inspect as mod
cmdsCompoundTools = cmdsCompoundTools + mod.exportedCommands

View File

@ -30,10 +30,10 @@ import math
import FreeCAD as App
import Part
from latticeCommon import *
import latticeBaseFeature
import latticeCompoundExplorer as LCE
import latticeExecuter
from lattice2Common import *
import lattice2BaseFeature
import lattice2CompoundExplorer as LCE
import lattice2Executer
# -------------------------- document object --------------------------------------------------
@ -113,7 +113,7 @@ class LatticeApply(latticeBaseFeature.LatticeFeature):
class ViewProviderLatticeApply(latticeBaseFeature.ViewProviderLatticeFeature):
def getIcon(self):
return getIconPath("Lattice_Apply.svg")
return getIconPath("Lattice2_Apply.svg")
def claimChildren(self):
return [self.Object.Base, self.Object.Tool]
@ -140,10 +140,10 @@ def CreateLatticeApply(name):
class _CommandLatticeApply:
"Command to create LatticeApply feature"
def GetResources(self):
return {'Pixmap' : getIconPath("Lattice_Apply.svg"),
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice_Apply","Apply array"),
return {'Pixmap' : getIconPath("Lattice2_Apply.svg"),
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice2_Apply","Apply array"),
'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):
if len(FreeCADGui.Selection.getSelection()) == 2 :
@ -151,8 +151,8 @@ class _CommandLatticeApply:
else:
mb = QtGui.QMessageBox()
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.setWindowTitle(translate("Lattice_Apply","Bad selection", 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("Lattice2_Apply","Bad selection", None))
mb.exec_()
def IsActive(self):
@ -161,9 +161,9 @@ class _CommandLatticeApply:
else:
return False
FreeCADGui.addCommand('Lattice_Apply', _CommandLatticeApply())
FreeCADGui.addCommand('Lattice2_Apply', _CommandLatticeApply())
exportedCommands = ['Lattice_Apply']
exportedCommands = ['Lattice2_Apply']
# -------------------------- /Gui command --------------------------------------------------

View File

@ -24,10 +24,10 @@
import FreeCAD as App
import Part
from latticeCommon import *
import latticeBaseFeature
import latticeCompoundExplorer as LCE
import latticeExecuter
from lattice2Common import *
import lattice2BaseFeature
import lattice2CompoundExplorer as LCE
import lattice2Executer
__title__="Lattice ArrayFilter module for FreeCAD"
@ -134,7 +134,7 @@ class ViewProviderArrayFilter(latticeBaseFeature.ViewProviderLatticeFeature):
"A View Provider for the Lattice ArrayFilter object"
def getIcon(self):
return getIconPath("Lattice_ArrayFilter.svg")
return getIconPath("Lattice2_ArrayFilter.svg")
def claimChildren(self):
children = [self.Object.Base]
@ -224,10 +224,10 @@ class _CommandArrayFilterItems:
"Command to create Lattice ArrayFilter feature in 'specific items' mode based on current selection"
def GetResources(self):
return {'Pixmap' : getIconPath("Lattice_ArrayFilter.svg"),
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice_ArrayFilter","Array Filter: selected items"),
return {'Pixmap' : getIconPath("Lattice2_ArrayFilter.svg"),
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice2_ArrayFilter","Array Filter: selected items"),
'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):
sel = FreeCADGui.Selection.getSelectionEx()
@ -236,8 +236,8 @@ class _CommandArrayFilterItems:
else:
mb = QtGui.QMessageBox()
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.setWindowTitle(translate("Lattice_ArrayFilter","Bad selection", 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("Lattice2_ArrayFilter","Bad selection", None))
mb.exec_()
def IsActive(self):
@ -246,8 +246,8 @@ class _CommandArrayFilterItems:
else:
return False
FreeCADGui.addCommand('Lattice_ArrayFilter_Items', _CommandArrayFilterItems())
_listOfSubCommands.append('Lattice_ArrayFilter_Items')
FreeCADGui.addCommand('Lattice2_ArrayFilter_Items', _CommandArrayFilterItems())
_listOfSubCommands.append('Lattice2_ArrayFilter_Items')
class _CommandArrayFilterStencilBased:
"Command to create Lattice ArrayFilter feature in 'specific items' mode based on current selection"
@ -256,7 +256,7 @@ class _CommandArrayFilterStencilBased:
self.mode = mode
def GetResources(self):
return {'Pixmap' : getIconPath("Lattice_ArrayFilter.svg"),
return {'Pixmap' : getIconPath("Lattice2_ArrayFilter.svg"),
'MenuText': "Array Filter: " + {"collision-pass":"touching",
"window-distance":"within distance window",
"pointing-at":"pointing at shape"}[mode],
@ -272,8 +272,8 @@ class _CommandArrayFilterStencilBased:
else:
mb = QtGui.QMessageBox()
mb.setIcon(mb.Icon.Warning)
mb.setText(translate("Lattice_ArrayFilter", "Select a lattice array and a stencil shape, first!", None))
mb.setWindowTitle(translate("Lattice_ArrayFilter","Bad selection", None))
mb.setText(translate("Lattice2_ArrayFilter", "Select a lattice array and a stencil shape, first!", None))
mb.setWindowTitle(translate("Lattice2_ArrayFilter","Bad selection", None))
mb.exec_()
def IsActive(self):
@ -283,7 +283,7 @@ class _CommandArrayFilterStencilBased:
return False
for mode in LatticeArrayFilter.stencilModeList:
cmdName = 'Lattice_ArrayFilter'+mode.replace("-","_")
cmdName = 'Lattice2_ArrayFilter'+mode.replace("-","_")
FreeCADGui.addCommand(cmdName, _CommandArrayFilterStencilBased(mode))
_listOfSubCommands.append(cmdName)
@ -297,21 +297,21 @@ class GroupCommandLatticeArrayFilter:
def GetResources(self):
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
return bool(App.ActiveDocument)
FreeCADGui.addCommand('Lattice_ArrayFilter_GroupCommand',GroupCommandLatticeArrayFilter())
FreeCADGui.addCommand('Lattice2_ArrayFilter_GroupCommand',GroupCommandLatticeArrayFilter())
class _CommandExplodeArray:
"Command to explode array with parametric links to its elements"
def GetResources(self):
return {'Pixmap' : getIconPath("Lattice_ExplodeArray.svg"),
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice_ArrayFilter","Explode array"),
return {'Pixmap' : getIconPath("Lattice2_ExplodeArray.svg"),
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice2_ArrayFilter","Explode array"),
'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):
if len(FreeCADGui.Selection.getSelection()) == 1 :
@ -344,8 +344,8 @@ class _CommandExplodeArray:
else:
mb = QtGui.QMessageBox()
mb.setIcon(mb.Icon.Warning)
mb.setText(translate("Lattice_ArrayFilter", "Select a lattice object, first!", None))
mb.setWindowTitle(translate("Lattice_ArrayFilter","Bad selection", None))
mb.setText(translate("Lattice2_ArrayFilter", "Select a lattice object, first!", None))
mb.setWindowTitle(translate("Lattice2_ArrayFilter","Bad selection", None))
mb.exec_()
def IsActive(self):
@ -354,8 +354,8 @@ class _CommandExplodeArray:
else:
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 --------------------------------------------------

View File

@ -28,10 +28,10 @@ __url__ = ""
import FreeCAD as App
import Part
from latticeCommon import *
import latticeCompoundExplorer as LCE
import latticeMarkers
import latticeExecuter
from lattice2Common import *
import lattice2CompoundExplorer as LCE
import lattice2Markers
import lattice2Executer
def getDefLatticeFaceColor():
return (1.0, 0.7019608020782471, 0.0, 0.0) #orange

View File

@ -22,7 +22,7 @@
#***************************************************************************
from latticeCommon import *
from lattice2Common import *
__title__="BoundingBox module for FreeCAD"
@ -158,7 +158,7 @@ class _ViewProviderBoundBox:
vobj.DisplayMode = "Wireframe"
def getIcon(self):
return getIconPath("Lattice_BoundBox.svg")
return getIconPath("Lattice2_BoundBox.svg")
def attach(self, vobj):
self.ViewObject = vobj
@ -195,10 +195,10 @@ def CreateBoundBox(name):
class _CommandBoundBox:
"Command to create BoundBox feature"
def GetResources(self):
return {'Pixmap' : getIconPath("Lattice_BoundBox.svg"),
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice_BoundBox","Parametric bounding box"),
return {'Pixmap' : getIconPath("Lattice2_BoundBox.svg"),
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice2_BoundBox","Parametric bounding box"),
'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):
if len(FreeCADGui.Selection.getSelection()) == 1 :
@ -206,8 +206,8 @@ class _CommandBoundBox:
else:
mb = QtGui.QMessageBox()
mb.setIcon(mb.Icon.Warning)
mb.setText(translate("Lattice_BoundBox", "Select a shape to make a bounding box for, first!", None))
mb.setWindowTitle(translate("Lattice_BoundBox","Bad selection", None))
mb.setText(translate("Lattice2_BoundBox", "Select a shape to make a bounding box for, first!", None))
mb.setWindowTitle(translate("Lattice2_BoundBox","Bad selection", None))
mb.exec_()
def IsActive(self):
@ -216,8 +216,8 @@ class _CommandBoundBox:
else:
return False
FreeCADGui.addCommand('Lattice_BoundBox', _CommandBoundBox())
FreeCADGui.addCommand('Lattice2_BoundBox', _CommandBoundBox())
exportedCommands = ['Lattice_BoundBox']
exportedCommands = ['Lattice2_BoundBox']
# -------------------------- /Gui command --------------------------------------------------

View File

@ -55,4 +55,4 @@ def getIconPath(icon_dot_svg):
DistConfusion = 1e-7
ParaConfusion = 1e-8
import lattice_rc
import lattice2_rc

View File

@ -30,10 +30,10 @@ import math
import FreeCAD as App
import Part
from latticeCommon import *
import latticeBaseFeature
import latticeCompoundExplorer as LCE
import latticeExecuter
from lattice2Common import *
import lattice2BaseFeature
import lattice2CompoundExplorer as LCE
import lattice2Executer
# -------------------------- document object --------------------------------------------------
@ -168,7 +168,7 @@ class Compose(latticeBaseFeature.LatticeFeature):
class ViewProviderCompose(latticeBaseFeature.ViewProviderLatticeFeature):
def getIcon(self):
return getIconPath('Lattice_Compose.svg')
return getIconPath('Lattice2_Compose.svg')
def claimChildren(self):
return [self.Object.Base, self.Object.Tool]
@ -195,10 +195,10 @@ def CreateCompose(name):
class _CommandCompose:
"Command to create Compose feature"
def GetResources(self):
return {'Pixmap' : getIconPath("Lattice_Compose.svg"),
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice_Compose","Compose arrays"),
return {'Pixmap' : getIconPath("Lattice2_Compose.svg"),
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice2_Compose","Compose arrays"),
'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):
if len(FreeCADGui.Selection.getSelection()) == 2 :
@ -206,8 +206,8 @@ class _CommandCompose:
else:
mb = QtGui.QMessageBox()
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.setWindowTitle(translate("Lattice_Compose","Bad selection", 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("Lattice2_Compose","Bad selection", None))
mb.exec_()
def IsActive(self):
@ -216,9 +216,9 @@ class _CommandCompose:
else:
return False
FreeCADGui.addCommand('Lattice_Compose', _CommandCompose())
FreeCADGui.addCommand('Lattice2_Compose', _CommandCompose())
exportedCommands = ['Lattice_Compose']
exportedCommands = ['Lattice2_Compose']
# -------------------------- /Gui command --------------------------------------------------

View File

@ -21,8 +21,8 @@
#* *
#***************************************************************************
from latticeCommon import *
import latticeMarkers as markers
from lattice2Common import *
import lattice2Markers as markers
import math
__title__="latticeDowngrade module for FreeCAD"
@ -117,7 +117,7 @@ class _ViewProviderLatticeDowngrade:
vobj.Proxy = self
def getIcon(self):
return getIconPath("Lattice_Downgrade.svg")
return getIconPath("Lattice2_Downgrade.svg")
def attach(self, vobj):
self.ViewObject = vobj
@ -177,10 +177,10 @@ class _CommandLatticeDowngrade:
self.mode = mode
def GetResources(self):
return {'Pixmap' : getIconPath("Lattice_Downgrade.svg"),
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice_Downgrade","Downgrade to ") + self.mode, # FIXME: not translation-friendly!
return {'Pixmap' : getIconPath("Lattice2_Downgrade.svg"),
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice2_Downgrade","Downgrade to ") + self.mode, # FIXME: not translation-friendly!
'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):
if len(FreeCADGui.Selection.getSelection()) == 1 :
@ -188,8 +188,8 @@ class _CommandLatticeDowngrade:
else:
mb = QtGui.QMessageBox()
mb.setIcon(mb.Icon.Warning)
mb.setText(translate("Lattice_Downgrade", "Select a shape to downgrade, first!", None))
mb.setWindowTitle(translate("Lattice_Downgrade","Bad selection", None))
mb.setText(translate("Lattice2_Downgrade", "Select a shape to downgrade, first!", None))
mb.setWindowTitle(translate("Lattice2_Downgrade","Bad selection", None))
mb.exec_()
def IsActive(self):
@ -200,7 +200,7 @@ class _CommandLatticeDowngrade:
_listOfSubCommands = []
for mode in _latticeDowngrade._DowngradeModeList:
cmdName = 'Lattice_Downgrade' + mode
cmdName = 'Lattice2_Downgrade' + mode
FreeCADGui.addCommand(cmdName, _CommandLatticeDowngrade(mode))
_listOfSubCommands.append(cmdName)
@ -219,11 +219,11 @@ class GroupCommandLatticeDowngrade:
def IsActive(self): # optional
return True
FreeCADGui.addCommand('Lattice_Downgrade_GroupCommand',GroupCommandLatticeDowngrade())
FreeCADGui.addCommand('Lattice2_Downgrade_GroupCommand',GroupCommandLatticeDowngrade())
exportedCommands = ['Lattice_Downgrade_GroupCommand']
exportedCommands = ['Lattice2_Downgrade_GroupCommand']
# -------------------------- /Gui command --------------------------------------------------

View File

@ -24,7 +24,7 @@
import FreeCAD as App
from latticeCommon import *
from lattice2Common import *
__title__="Geometric utility routines for Lattice workbench for FreeCAD"
__author__ = "DeepSOIC"

View File

@ -28,9 +28,9 @@ __url__ = ""
import FreeCAD as App
import Part
from latticeCommon import *
import latticeCompoundExplorer as LCE
import latticeBaseFeature
from lattice2Common import *
import lattice2CompoundExplorer as LCE
import lattice2BaseFeature
def shapeInfoString(shape):
strMsg = shape.ShapeType
@ -59,10 +59,10 @@ class _CommandInspect:
pass
def GetResources(self):
return {'Pixmap' : getIconPath("Lattice_Inspect.svg"),
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice_Inspect","Inspect selection") , # FIXME: not translation-friendly!
return {'Pixmap' : getIconPath("Lattice2_Inspect.svg"),
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice2_Inspect","Inspect selection") , # FIXME: not translation-friendly!
'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):
sel = FreeCADGui.Selection.getSelectionEx()[0]
@ -115,7 +115,7 @@ class _CommandInspect:
mb = QtGui.QMessageBox()
mb.setIcon(mb.Icon.Information)
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)
btnCopy = mb.addButton("Copy to clipboard",QtGui.QMessageBox.ButtonRole.ActionRole)
@ -132,7 +132,7 @@ class _CommandInspect:
else:
return False
FreeCADGui.addCommand('Lattice_Inspect',_CommandInspect())
FreeCADGui.addCommand('Lattice2_Inspect',_CommandInspect())
exportedCommands = ['Lattice_Inspect']
exportedCommands = ['Lattice2_Inspect']

View File

@ -28,10 +28,10 @@ __url__ = ""
import FreeCAD as App
import Part
from latticeCommon import *
import latticeBaseFeature
import latticeCompoundExplorer as LCE
import latticeExecuter
from lattice2Common import *
import lattice2BaseFeature
import lattice2CompoundExplorer as LCE
import lattice2Executer
# -------------------------- document object --------------------------------------------------
@ -90,7 +90,7 @@ class JoinArrays(latticeBaseFeature.LatticeFeature):
class ViewProviderJoinArrays(latticeBaseFeature.ViewProviderLatticeFeature):
def getIcon(self):
return getIconPath('Lattice_JoinArrays.svg')
return getIconPath('Lattice2_JoinArrays.svg')
def claimChildren(self):
return self.Object.Links
@ -119,10 +119,10 @@ def CreateJoinArrays(name):
class _CommandJoinArrays:
"Command to create JoinArrays feature"
def GetResources(self):
return {'Pixmap' : getIconPath("Lattice_JoinArrays.svg"),
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice_JoinArrays","Join arrays"),
return {'Pixmap' : getIconPath("Lattice2_JoinArrays.svg"),
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice2_JoinArrays","Join arrays"),
'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):
if len(FreeCADGui.Selection.getSelection()) > 1 :
@ -130,8 +130,8 @@ class _CommandJoinArrays:
else:
mb = QtGui.QMessageBox()
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.setWindowTitle(translate("Lattice_JoinArrays","Bad selection", 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("Lattice2_JoinArrays","Bad selection", None))
mb.exec_()
def IsActive(self):
@ -140,9 +140,9 @@ class _CommandJoinArrays:
else:
return False
FreeCADGui.addCommand('Lattice_JoinArrays', _CommandJoinArrays())
FreeCADGui.addCommand('Lattice2_JoinArrays', _CommandJoinArrays())
exportedCommands = ['Lattice_JoinArrays']
exportedCommands = ['Lattice2_JoinArrays']
# -------------------------- /Gui command --------------------------------------------------

View File

@ -30,10 +30,10 @@ import math
import FreeCAD as App
import Part
from latticeCommon import *
import latticeBaseFeature
import latticeExecuter
import latticeGeomUtils
from lattice2Common import *
import lattice2BaseFeature
import lattice2Executer
import lattice2GeomUtils
def makeLinearArray(name):
'''makeLinearArray(name): makes a LinearArray object.'''
@ -219,7 +219,7 @@ class LinearArray(latticeBaseFeature.LatticeFeature):
class ViewProviderLinearArray(latticeBaseFeature.ViewProviderLatticeFeature):
def getIcon(self):
return getIconPath('Lattice_LinearArray.svg')
return getIconPath('Lattice2_LinearArray.svg')
# -------------------------- /document object --------------------------------------------------
@ -243,10 +243,10 @@ def CreateLinearArray(name):
class _CommandLinearArray:
"Command to create LinearArray feature"
def GetResources(self):
return {'Pixmap' : getIconPath("Lattice_LinearArray.svg"),
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice_LinearArray","Generate linear array"),
return {'Pixmap' : getIconPath("Lattice2_LinearArray.svg"),
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice2_LinearArray","Generate linear array"),
'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):
if len(FreeCADGui.Selection.getSelection()) < 2 :
@ -254,8 +254,8 @@ class _CommandLinearArray:
else:
mb = QtGui.QMessageBox()
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.setWindowTitle(translate("Lattice_LinearArray","Bad selection", 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("Lattice2_LinearArray","Bad selection", None))
mb.exec_()
def IsActive(self):
@ -264,9 +264,9 @@ class _CommandLinearArray:
else:
return False
FreeCADGui.addCommand('Lattice_LinearArray', _CommandLinearArray())
FreeCADGui.addCommand('Lattice2_LinearArray', _CommandLinearArray())
exportedCommands = ['Lattice_LinearArray']
exportedCommands = ['Lattice2_LinearArray']
# -------------------------- /Gui command --------------------------------------------------

View File

@ -30,8 +30,8 @@ import math
import FreeCAD as App
import Part
from latticeCommon import *
import latticeBaseFeature
from lattice2Common import *
import lattice2BaseFeature
def makeLatticePlacement(name):
'''makePlacement(name): makes a Placement object.'''
@ -93,7 +93,7 @@ class LatticePlacement(latticeBaseFeature.LatticeFeature):
class ViewProviderLatticePlacement(latticeBaseFeature.ViewProviderLatticeFeature):
def getIcon(self):
return getIconPath('Lattice_Placement.svg')
return getIconPath('Lattice2_Placement.svg')
# -------------------------- /document object --------------------------------------------------
@ -118,10 +118,10 @@ class _CommandPlacement:
self.mode = mode
def GetResources(self):
return {'Pixmap' : getIconPath("Lattice_Placement.svg"),
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice_Placement","Single Placement: ") + self.mode, # FIXME: not translation-friendly!
return {'Pixmap' : getIconPath("Lattice2_Placement.svg"),
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice2_Placement","Single Placement: ") + self.mode, # FIXME: not translation-friendly!
'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):
CreateLatticePlacement(name= "Placement", mode= self.mode)
@ -134,11 +134,11 @@ class _CommandPlacement:
_listOfSubCommands = []
for mode in LatticePlacement._PlacementChoiceList:
cmdName = 'Lattice_Placement' + mode
cmdName = 'Lattice2_Placement' + mode
FreeCADGui.addCommand(cmdName, _CommandPlacement(mode))
_listOfSubCommands.append(cmdName)
import latticeArrayFromShape
_listOfSubCommands.append('Lattice_PlacementFromShape')
import lattice2ArrayFromShape
_listOfSubCommands.append('Lattice2_PlacementFromShape')
class GroupCommandPlacement:
def GetCommands(self):
@ -154,11 +154,11 @@ class GroupCommandPlacement:
def IsActive(self): # optional
return True
FreeCADGui.addCommand('Lattice_Placement_GroupCommand',GroupCommandPlacement())
FreeCADGui.addCommand('Lattice2_Placement_GroupCommand',GroupCommandPlacement())
exportedCommands = ['Lattice_Placement_GroupCommand']
exportedCommands = ['Lattice2_Placement_GroupCommand']
# -------------------------- /Gui command --------------------------------------------------

View File

@ -30,10 +30,10 @@ import math
import FreeCAD as App
import Part
from latticeCommon import *
import latticeBaseFeature
import latticeExecuter
import latticeGeomUtils
from lattice2Common import *
import lattice2BaseFeature
import lattice2Executer
import lattice2GeomUtils
def makePolarArray(name):
'''makePolarArray(name): makes a PolarArray object.'''
@ -212,7 +212,7 @@ class PolarArray(latticeBaseFeature.LatticeFeature):
class ViewProviderPolarArray(latticeBaseFeature.ViewProviderLatticeFeature):
def getIcon(self):
return getIconPath('Lattice_PolarArray.svg')
return getIconPath('Lattice2_PolarArray.svg')
# -------------------------- /document object --------------------------------------------------
@ -236,10 +236,10 @@ def CreatePolarArray(name):
class _CommandPolarArray:
"Command to create PolarArray feature"
def GetResources(self):
return {'Pixmap' : getIconPath("Lattice_PolarArray.svg"),
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice_PolarArray","Generate polar array"),
return {'Pixmap' : getIconPath("Lattice2_PolarArray.svg"),
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice2_PolarArray","Generate polar array"),
'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):
if len(FreeCADGui.Selection.getSelection()) < 2 :
@ -247,8 +247,8 @@ class _CommandPolarArray:
else:
mb = QtGui.QMessageBox()
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.setWindowTitle(translate("Lattice_PolarArray","Bad selection", 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("Lattice2_PolarArray","Bad selection", None))
mb.exec_()
def IsActive(self):
@ -257,9 +257,9 @@ class _CommandPolarArray:
else:
return False
FreeCADGui.addCommand('Lattice_PolarArray', _CommandPolarArray())
FreeCADGui.addCommand('Lattice2_PolarArray', _CommandPolarArray())
exportedCommands = ['Lattice_PolarArray']
exportedCommands = ['Lattice2_PolarArray']
# -------------------------- /Gui command --------------------------------------------------

View File

@ -27,7 +27,7 @@ __author__ = "DeepSOIC"
import FreeCAD as App
from replaceobj import replaceobj #from OpenSCAD wb, the code that drives replaceChild
from latticeCommon import *
from lattice2Common import *
def substituteobj(oldobj, newobj):
'Replaces all links to oldobj in the document with links to newobj'
@ -38,10 +38,10 @@ def substituteobj(oldobj, newobj):
class CommandSubstituteObject:
"Command to substitute object"
def GetResources(self):
return {'Pixmap' : getIconPath("Lattice_SubstituteObject.svg"),
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice_SubstituteObject","Substitute object"),
return {'Pixmap' : getIconPath("Lattice2_SubstituteObject.svg"),
'MenuText': QtCore.QT_TRANSLATE_NOOP("Lattice2_SubstituteObject","Substitute object"),
'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):
sel = FreeCADGui.Selection.getSelectionEx()
@ -58,18 +58,18 @@ class CommandSubstituteObject:
if len(sel[0].Object.InList) != 0:
mb = QtGui.QMessageBox()
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]
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_()
except Exception as err:
mb = QtGui.QMessageBox()
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))
mb.setWindowTitle(translate("Lattice_SubstituteObject","Error", None))
mb.setWindowTitle(translate("Lattice2_SubstituteObject","Error", None))
mb.exec_()
App.ActiveDocument.abortTransaction()
return
@ -85,8 +85,8 @@ class CommandSubstituteObject:
else:
mb = QtGui.QMessageBox()
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.setWindowTitle(translate("Lattice_SubstituteObject","Bad selection", 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("Lattice2_SubstituteObject","Bad selection", None))
mb.exec_()
def IsActive(self):
@ -95,6 +95,6 @@ class CommandSubstituteObject:
else:
return False
FreeCADGui.addCommand('Lattice_SubstituteObject', CommandSubstituteObject())
FreeCADGui.addCommand('Lattice2_SubstituteObject', CommandSubstituteObject())
exportedCommands = ['Lattice_SubstituteObject']
exportedCommands = ['Lattice2_SubstituteObject']