Arch: Renaming Hires to HiRes

This commit is contained in:
Yorik van Havre 2017-03-07 13:36:33 -03:00
parent 5625bab170
commit a6cfb18e37
2 changed files with 28 additions and 28 deletions

View File

@ -323,7 +323,7 @@ class Component:
obj.addProperty("App::PropertyArea","VerticalArea","Arch",QT_TRANSLATE_NOOP("App::Property","The area of all vertical faces of this object")) obj.addProperty("App::PropertyArea","VerticalArea","Arch",QT_TRANSLATE_NOOP("App::Property","The area of all vertical faces of this object"))
obj.addProperty("App::PropertyArea","HorizontalArea","Arch",QT_TRANSLATE_NOOP("App::Property","The area of the projection of this object onto the XY plane")) obj.addProperty("App::PropertyArea","HorizontalArea","Arch",QT_TRANSLATE_NOOP("App::Property","The area of the projection of this object onto the XY plane"))
obj.addProperty("App::PropertyLength","PerimeterLength","Arch",QT_TRANSLATE_NOOP("App::Property","The perimeter length of the horizontal area")) obj.addProperty("App::PropertyLength","PerimeterLength","Arch",QT_TRANSLATE_NOOP("App::Property","The perimeter length of the horizontal area"))
obj.addProperty("App::PropertyLink","Hires","Arch",QT_TRANSLATE_NOOP("App::Property","An optional higher-resolution mesh or shape for this object")) obj.addProperty("App::PropertyLink","HiRes","Arch",QT_TRANSLATE_NOOP("App::Property","An optional higher-resolution mesh or shape for this object"))
obj.Proxy = self obj.Proxy = self
self.Type = "Component" self.Type = "Component"
self.Subvolume = None self.Subvolume = None
@ -726,12 +726,12 @@ class ViewProviderComponent:
self.hiresgroup = coin.SoSeparator() self.hiresgroup = coin.SoSeparator()
self.meshcolor = coin.SoBaseColor() self.meshcolor = coin.SoBaseColor()
self.hiresgroup.addChild(self.meshcolor) self.hiresgroup.addChild(self.meshcolor)
self.hiresgroup.setName("Hires") self.hiresgroup.setName("HiRes")
vobj.addDisplayMode(self.hiresgroup,"Hires"); vobj.addDisplayMode(self.hiresgroup,"HiRes");
return return
def getDisplayModes(self,vobj): def getDisplayModes(self,vobj):
modes=["Hires"] modes=["HiRes"]
return modes return modes
def setDisplayMode(self,mode): def setDisplayMode(self,mode):
@ -739,25 +739,25 @@ class ViewProviderComponent:
if self.meshnode: if self.meshnode:
self.hiresgroup.removeChild(self.meshnode) self.hiresgroup.removeChild(self.meshnode)
del self.meshnode del self.meshnode
if mode == "Hires": if mode == "HiRes":
from pivy import coin from pivy import coin
m = None m = None
if hasattr(self,"Object"): if hasattr(self,"Object"):
if hasattr(self.Object,"Hires"): if hasattr(self.Object,"HiRes"):
if self.Object.Hires: if self.Object.HiRes:
# if the file was recently loaded, the node is not present yet # if the file was recently loaded, the node is not present yet
self.Object.Hires.ViewObject.show() self.Object.HiRes.ViewObject.show()
self.Object.Hires.ViewObject.hide() self.Object.HiRes.ViewObject.hide()
m = self.Object.Hires.ViewObject.RootNode m = self.Object.HiRes.ViewObject.RootNode
if not m: if not m:
if hasattr(self.Object,"CloneOf"): if hasattr(self.Object,"CloneOf"):
if self.Object.CloneOf: if self.Object.CloneOf:
if hasattr(self.Object.CloneOf,"Hires"): if hasattr(self.Object.CloneOf,"HiRes"):
if self.Object.CloneOf.Hires: if self.Object.CloneOf.HiRes:
# if the file was recently loaded, the node is not present yet # if the file was recently loaded, the node is not present yet
self.Object.CloneOf.Hires.ViewObject.show() self.Object.CloneOf.HiRes.ViewObject.show()
self.Object.CloneOf.Hires.ViewObject.hide() self.Object.CloneOf.HiRes.ViewObject.hide()
m = self.Object.CloneOf.Hires.ViewObject.RootNode m = self.Object.CloneOf.HiRes.ViewObject.RootNode
if m: if m:
self.meshnode = m.copy() self.meshnode = m.copy()
for c in self.meshnode.getChildren(): for c in self.meshnode.getChildren():
@ -765,7 +765,7 @@ class ViewProviderComponent:
if isinstance(c,coin.SoSwitch): if isinstance(c,coin.SoSwitch):
num = 0 num = 0
if c.getNumChildren() > 0: if c.getNumChildren() > 0:
if c.getChild(0).getName() == "Hires": if c.getChild(0).getName() == "HiRes":
num = 1 num = 1
print "getting node ",num," for ",self.Object.Label print "getting node ",num," for ",self.Object.Label
c.whichChild = num c.whichChild = num
@ -810,7 +810,7 @@ class ViewProviderComponent:
if hasattr(self.Object,link): if hasattr(self.Object,link):
objlink = getattr(self.Object,link) objlink = getattr(self.Object,link)
c.extend(objlink) c.extend(objlink)
for link in ["Tool","Subvolume","Mesh","Hires"]: for link in ["Tool","Subvolume","Mesh","HiRes"]:
if hasattr(self.Object,link): if hasattr(self.Object,link):
objlink = getattr(self.Object,link) objlink = getattr(self.Object,link)
if objlink: if objlink:

View File

@ -128,25 +128,25 @@ def export(exportList,filename):
hires = None hires = None
if FreeCAD.GuiUp: if FreeCAD.GuiUp:
visible = obj.ViewObject.isVisible() visible = obj.ViewObject.isVisible()
if obj.ViewObject.DisplayMode == "Hires": if obj.ViewObject.DisplayMode == "HiRes":
# check if high-resolution object is available # check if high-resolution object is available
if hasattr(obj,"Hires"): if hasattr(obj,"HiRes"):
if obj.Hires: if obj.HiRes:
if obj.Hires.isDerivedFrom("Mesh::Feature"): if obj.HiRes.isDerivedFrom("Mesh::Feature"):
m = obj.Hires.Mesh m = obj.HiRes.Mesh
else: else:
m = obj.Hires.Shape m = obj.HiRes.Shape
hires = m.copy() hires = m.copy()
hires.Placement = obj.Placement.multiply(m.Placement) hires.Placement = obj.Placement.multiply(m.Placement)
if not hires: if not hires:
if hasattr(obj,"CloneOf"): if hasattr(obj,"CloneOf"):
if obj.CloneOf: if obj.CloneOf:
if hasattr(obj.CloneOf,"Hires"): if hasattr(obj.CloneOf,"HiRes"):
if obj.CloneOf.Hires: if obj.CloneOf.HiRes:
if obj.CloneOf.Hires.isDerivedFrom("Mesh::Feature"): if obj.CloneOf.HiRes.isDerivedFrom("Mesh::Feature"):
m = obj.CloneOf.Hires.Mesh m = obj.CloneOf.HiRes.Mesh
else: else:
m = obj.CloneOf.Hires.Shape m = obj.CloneOf.HiRes.Shape
hires = m.copy() hires = m.copy()
hires.Placement = obj.Placement.multiply(obj.CloneOf.Placement).multiply(m.Placement) hires.Placement = obj.Placement.multiply(obj.CloneOf.Placement).multiply(m.Placement)
else: else: