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::PropertyFloat","Length","Base", "The length of the axes")
|
||||
self.Type = "Axis"
|
||||
|
||||
obj.Length=1.0
|
||||
obj.Proxy = self
|
||||
self.Object = obj
|
||||
|
||||
def execute(self,obj):
|
||||
self.createGeometry(obj)
|
||||
|
@ -121,7 +119,6 @@ class _ViewProviderAxis:
|
|||
return []
|
||||
|
||||
def attach(self, vobj):
|
||||
self.Object = vobj.Object
|
||||
self.ViewObject = vobj
|
||||
self.bubbles = None
|
||||
|
||||
|
@ -186,9 +183,9 @@ class _ViewProviderAxis:
|
|||
self.bubblestyle = coin.SoDrawStyle()
|
||||
self.bubblestyle.linePattern = 0xffff
|
||||
self.bubbles.addChild(self.bubblestyle)
|
||||
for i in range(len(self.Object.Distances)):
|
||||
invpl = self.Object.Placement.inverse()
|
||||
verts = self.Object.Shape.Edges[i].Vertexes
|
||||
for i in range(len(self.ViewObject.Object.Distances)):
|
||||
invpl = self.ViewObject.Object.Placement.inverse()
|
||||
verts = self.ViewObject.Object.Shape.Edges[i].Vertexes
|
||||
p1 = invpl.multVec(verts[0].Point)
|
||||
p2 = invpl.multVec(verts[1].Point)
|
||||
dv = p2.sub(p1)
|
||||
|
@ -245,6 +242,13 @@ class _ViewProviderAxis:
|
|||
FreeCADGui.Control.closeDialog()
|
||||
return
|
||||
|
||||
def __getstate__(self):
|
||||
return None
|
||||
|
||||
def __setstate__(self,state):
|
||||
return None
|
||||
|
||||
|
||||
|
||||
class _AxisTaskPanel:
|
||||
'''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)")
|
||||
obj.Proxy = self
|
||||
self.Type = "Component"
|
||||
self.Object = obj
|
||||
self.Subvolume = None
|
||||
|
||||
|
||||
|
|
|
@ -99,14 +99,16 @@ class _Structure(ArchComponent.Component):
|
|||
"returns the gridpoints of linked axes"
|
||||
from draftlibs import fcgeo
|
||||
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
|
||||
set2 = obj.Axes[1].Shape.Edges
|
||||
for e1 in set1:
|
||||
for e2 in set2:
|
||||
pts.extend(fcgeo.findIntersection(e1,e2))
|
||||
return pts
|
||||
return None
|
||||
return pts
|
||||
|
||||
def createGeometry(self,obj):
|
||||
import Part
|
||||
|
@ -183,7 +185,7 @@ class _Structure(ArchComponent.Component):
|
|||
obj.Shape = Part.makeCompound(fsh)
|
||||
else:
|
||||
obj.Shape = base
|
||||
if not fcgeo.isNull(pl): obj.Placement = pl
|
||||
if not fcgeo.isNull(pl): obj.Placement = pl
|
||||
|
||||
class _ViewProviderStructure(ArchComponent.ViewProviderComponent):
|
||||
"A View Provider for the Structure object"
|
||||
|
|
Loading…
Reference in New Issue
Block a user