Arch: Renaming Hires to HiRes
This commit is contained in:
parent
5625bab170
commit
a6cfb18e37
|
@ -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","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
|
||||
|
@ -726,12 +726,12 @@ class ViewProviderComponent:
|
|||
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):
|
||||
|
@ -739,25 +739,25 @@ class ViewProviderComponent:
|
|||
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():
|
||||
|
@ -765,7 +765,7 @@ class ViewProviderComponent:
|
|||
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
|
||||
|
@ -810,7 +810,7 @@ class ViewProviderComponent:
|
|||
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:
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue
Block a user