cPickle fixes in Arch objects
This commit is contained in:
parent
d26ba5f11b
commit
bf6b5f6210
|
@ -68,10 +68,8 @@ class _Axis:
|
||||||
obj.addProperty("App::PropertyFloatList","Angles","Base", "The angles of each axis")
|
obj.addProperty("App::PropertyFloatList","Angles","Base", "The angles of each axis")
|
||||||
obj.addProperty("App::PropertyFloat","Length","Base", "The length of the axes")
|
obj.addProperty("App::PropertyFloat","Length","Base", "The length of the axes")
|
||||||
self.Type = "Axis"
|
self.Type = "Axis"
|
||||||
|
|
||||||
obj.Length=1.0
|
obj.Length=1.0
|
||||||
obj.Proxy = self
|
obj.Proxy = self
|
||||||
self.Object = obj
|
|
||||||
|
|
||||||
def execute(self,obj):
|
def execute(self,obj):
|
||||||
self.createGeometry(obj)
|
self.createGeometry(obj)
|
||||||
|
@ -121,7 +119,6 @@ class _ViewProviderAxis:
|
||||||
return []
|
return []
|
||||||
|
|
||||||
def attach(self, vobj):
|
def attach(self, vobj):
|
||||||
self.Object = vobj.Object
|
|
||||||
self.ViewObject = vobj
|
self.ViewObject = vobj
|
||||||
self.bubbles = None
|
self.bubbles = None
|
||||||
|
|
||||||
|
@ -186,9 +183,9 @@ class _ViewProviderAxis:
|
||||||
self.bubblestyle = coin.SoDrawStyle()
|
self.bubblestyle = coin.SoDrawStyle()
|
||||||
self.bubblestyle.linePattern = 0xffff
|
self.bubblestyle.linePattern = 0xffff
|
||||||
self.bubbles.addChild(self.bubblestyle)
|
self.bubbles.addChild(self.bubblestyle)
|
||||||
for i in range(len(self.Object.Distances)):
|
for i in range(len(self.ViewObject.Object.Distances)):
|
||||||
invpl = self.Object.Placement.inverse()
|
invpl = self.ViewObject.Object.Placement.inverse()
|
||||||
verts = self.Object.Shape.Edges[i].Vertexes
|
verts = self.ViewObject.Object.Shape.Edges[i].Vertexes
|
||||||
p1 = invpl.multVec(verts[0].Point)
|
p1 = invpl.multVec(verts[0].Point)
|
||||||
p2 = invpl.multVec(verts[1].Point)
|
p2 = invpl.multVec(verts[1].Point)
|
||||||
dv = p2.sub(p1)
|
dv = p2.sub(p1)
|
||||||
|
@ -245,6 +242,13 @@ class _ViewProviderAxis:
|
||||||
FreeCADGui.Control.closeDialog()
|
FreeCADGui.Control.closeDialog()
|
||||||
return
|
return
|
||||||
|
|
||||||
|
def __getstate__(self):
|
||||||
|
return None
|
||||||
|
|
||||||
|
def __setstate__(self,state):
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class _AxisTaskPanel:
|
class _AxisTaskPanel:
|
||||||
'''The editmode TaskPanel for Axis objects'''
|
'''The editmode TaskPanel for Axis objects'''
|
||||||
|
|
|
@ -256,7 +256,6 @@ class Component:
|
||||||
"The normal extrusion direction of this wall (keep (0,0,0) for automatic normal)")
|
"The normal extrusion direction of this wall (keep (0,0,0) for automatic normal)")
|
||||||
obj.Proxy = self
|
obj.Proxy = self
|
||||||
self.Type = "Component"
|
self.Type = "Component"
|
||||||
self.Object = obj
|
|
||||||
self.Subvolume = None
|
self.Subvolume = None
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -99,14 +99,16 @@ class _Structure(ArchComponent.Component):
|
||||||
"returns the gridpoints of linked axes"
|
"returns the gridpoints of linked axes"
|
||||||
from draftlibs import fcgeo
|
from draftlibs import fcgeo
|
||||||
pts = []
|
pts = []
|
||||||
if len(obj.Axes) >= 2:
|
if len(obj.Axes) == 1:
|
||||||
|
for e in obj.Axes[0].Shape.Edges:
|
||||||
|
pts.append(e.Vertexes[0].Point)
|
||||||
|
elif len(obj.Axes) >= 2:
|
||||||
set1 = obj.Axes[0].Shape.Edges
|
set1 = obj.Axes[0].Shape.Edges
|
||||||
set2 = obj.Axes[1].Shape.Edges
|
set2 = obj.Axes[1].Shape.Edges
|
||||||
for e1 in set1:
|
for e1 in set1:
|
||||||
for e2 in set2:
|
for e2 in set2:
|
||||||
pts.extend(fcgeo.findIntersection(e1,e2))
|
pts.extend(fcgeo.findIntersection(e1,e2))
|
||||||
return pts
|
return pts
|
||||||
return None
|
|
||||||
|
|
||||||
def createGeometry(self,obj):
|
def createGeometry(self,obj):
|
||||||
import Part
|
import Part
|
||||||
|
|
Loading…
Reference in New Issue
Block a user