Skip to content

Commit

Permalink
Arch: Renaming Hires to HiRes
Browse files Browse the repository at this point in the history
  • Loading branch information
yorikvanhavre committed Mar 7, 2017
1 parent 5625bab commit a6cfb18
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 28 deletions.
34 changes: 17 additions & 17 deletions src/Mod/Arch/ArchComponent.py
Expand Up @@ -323,7 +323,7 @@ def __init__(self,obj):
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::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
self.Type = "Component"
self.Subvolume = None
Expand Down Expand Up @@ -726,46 +726,46 @@ def attach(self,vobj):
self.hiresgroup = coin.SoSeparator()
self.meshcolor = coin.SoBaseColor()
self.hiresgroup.addChild(self.meshcolor)
self.hiresgroup.setName("Hires")
vobj.addDisplayMode(self.hiresgroup,"Hires");
self.hiresgroup.setName("HiRes")
vobj.addDisplayMode(self.hiresgroup,"HiRes");
return

def getDisplayModes(self,vobj):
modes=["Hires"]
modes=["HiRes"]
return modes

def setDisplayMode(self,mode):
if hasattr(self,"meshnode"):
if self.meshnode:
self.hiresgroup.removeChild(self.meshnode)
del self.meshnode
if mode == "Hires":
if mode == "HiRes":
from pivy import coin
m = None
if hasattr(self,"Object"):
if hasattr(self.Object,"Hires"):
if self.Object.Hires:
if hasattr(self.Object,"HiRes"):
if self.Object.HiRes:
# if the file was recently loaded, the node is not present yet
self.Object.Hires.ViewObject.show()
self.Object.Hires.ViewObject.hide()
m = self.Object.Hires.ViewObject.RootNode
self.Object.HiRes.ViewObject.show()
self.Object.HiRes.ViewObject.hide()
m = self.Object.HiRes.ViewObject.RootNode
if not m:
if hasattr(self.Object,"CloneOf"):
if self.Object.CloneOf:
if hasattr(self.Object.CloneOf,"Hires"):
if self.Object.CloneOf.Hires:
if hasattr(self.Object.CloneOf,"HiRes"):
if self.Object.CloneOf.HiRes:
# if the file was recently loaded, the node is not present yet
self.Object.CloneOf.Hires.ViewObject.show()
self.Object.CloneOf.Hires.ViewObject.hide()
m = self.Object.CloneOf.Hires.ViewObject.RootNode
self.Object.CloneOf.HiRes.ViewObject.show()
self.Object.CloneOf.HiRes.ViewObject.hide()
m = self.Object.CloneOf.HiRes.ViewObject.RootNode
if m:
self.meshnode = m.copy()
for c in self.meshnode.getChildren():
# switch the first found SoSwitch on
if isinstance(c,coin.SoSwitch):
num = 0
if c.getNumChildren() > 0:
if c.getChild(0).getName() == "Hires":
if c.getChild(0).getName() == "HiRes":
num = 1
print "getting node ",num," for ",self.Object.Label
c.whichChild = num
Expand Down Expand Up @@ -810,7 +810,7 @@ def claimChildren(self):
if hasattr(self.Object,link):
objlink = getattr(self.Object,link)
c.extend(objlink)
for link in ["Tool","Subvolume","Mesh","Hires"]:
for link in ["Tool","Subvolume","Mesh","HiRes"]:
if hasattr(self.Object,link):
objlink = getattr(self.Object,link)
if objlink:
Expand Down
22 changes: 11 additions & 11 deletions src/Mod/Arch/importOBJ.py
Expand Up @@ -128,25 +128,25 @@ def export(exportList,filename):
hires = None
if FreeCAD.GuiUp:
visible = obj.ViewObject.isVisible()
if obj.ViewObject.DisplayMode == "Hires":
if obj.ViewObject.DisplayMode == "HiRes":
# check if high-resolution object is available
if hasattr(obj,"Hires"):
if obj.Hires:
if obj.Hires.isDerivedFrom("Mesh::Feature"):
m = obj.Hires.Mesh
if hasattr(obj,"HiRes"):
if obj.HiRes:
if obj.HiRes.isDerivedFrom("Mesh::Feature"):
m = obj.HiRes.Mesh
else:
m = obj.Hires.Shape
m = obj.HiRes.Shape
hires = m.copy()
hires.Placement = obj.Placement.multiply(m.Placement)
if not hires:
if hasattr(obj,"CloneOf"):
if obj.CloneOf:
if hasattr(obj.CloneOf,"Hires"):
if obj.CloneOf.Hires:
if obj.CloneOf.Hires.isDerivedFrom("Mesh::Feature"):
m = obj.CloneOf.Hires.Mesh
if hasattr(obj.CloneOf,"HiRes"):
if obj.CloneOf.HiRes:
if obj.CloneOf.HiRes.isDerivedFrom("Mesh::Feature"):
m = obj.CloneOf.HiRes.Mesh
else:
m = obj.CloneOf.Hires.Shape
m = obj.CloneOf.HiRes.Shape
hires = m.copy()
hires.Placement = obj.Placement.multiply(obj.CloneOf.Placement).multiply(m.Placement)
else:
Expand Down

0 comments on commit a6cfb18

Please sign in to comment.