Draft+Arch: Fix crash related to SoBrepEdgeSet

This commit is contained in:
Roy-043
2022-09-28 17:31:12 +02:00
parent 849305b88a
commit 8a91607778
5 changed files with 8 additions and 1 deletions

View File

@@ -658,6 +658,7 @@ class ViewProviderBuildingPart:
self.sep.addChild(self.dst)
self.lco = coin.SoCoordinate3()
self.sep.addChild(self.lco)
import PartGui # Required for "SoBrepEdgeSet" (because a BuildingPart is not a Part::FeaturePython object).
lin = coin.SoType.fromName("SoBrepEdgeSet").createInstance()
if lin:
lin.coordIndex.setValues([0,1,-1,2,3,-1,4,5,-1])

View File

@@ -1054,6 +1054,7 @@ class _ViewProviderSectionPlane:
self.drawstyle = coin.SoDrawStyle()
self.drawstyle.style = coin.SoDrawStyle.LINES
self.lcoords = coin.SoCoordinate3()
import PartGui # Required for "SoBrepEdgeSet" (because a SectionPlane is not a Part::FeaturePython object).
ls = coin.SoType.fromName("SoBrepEdgeSet").createInstance()
ls.coordIndex.setValues(0,57,[0,1,-1,2,3,4,5,-1,6,7,8,9,-1,10,11,-1,12,13,14,15,-1,16,17,18,19,-1,20,21,-1,22,23,24,25,-1,26,27,28,29,-1,30,31,-1,32,33,34,35,-1,36,37,38,39,-1,40,41,42,43,44])
self.txtcoords = coin.SoTransform()

View File

@@ -397,6 +397,7 @@ class ViewProviderLinearDimension(ViewProviderDimensionBase):
self.marksDimOvershoot = coin.SoSeparator()
self.marksExtOvershoot = coin.SoSeparator()
self.drawstyle = coin.SoDrawStyle()
import PartGui # Required for "SoBrepEdgeSet" (because a dimension is not a Part::FeaturePython object).
self.line = coin.SoType.fromName("SoBrepEdgeSet").createInstance()
self.coords = coin.SoCoordinate3()
@@ -959,6 +960,7 @@ class ViewProviderAngularDimension(ViewProviderDimensionBase):
self.marks = coin.SoSeparator()
self.drawstyle = coin.SoDrawStyle()
self.coords = coin.SoCoordinate3()
import PartGui # Required for "SoBrepEdgeSet" (because a dimension is not a Part::FeaturePython object).
self.arc = coin.SoType.fromName("SoBrepEdgeSet").createInstance()
self.node = coin.SoGroup()

View File

@@ -207,6 +207,8 @@ class ViewProviderLabel(ViewProviderDraftAnnotation):
self.drawstyle = coin.SoDrawStyle()
self.drawstyle.style = coin.SoDrawStyle.LINES
import PartGui # Required for "SoBrepEdgeSet" (because a label is not a Part::FeaturePython object).
self.lcoords = coin.SoCoordinate3()
self.line = coin.SoType.fromName("SoBrepEdgeSet").createInstance()

View File

@@ -73,7 +73,7 @@ class ViewProviderWorkingPlaneProxy:
param = App.ParamGet("User parameter:BaseApp/Preferences/Mod/Arch")
c = param.GetUnsigned("ColorHelpers",674321151)
vobj.LineColor = (float((c>>24)&0xFF)/255.0,float((c>>16)&0xFF)/255.0,float((c>>8)&0xFF)/255.0,0.0)
vobj.Proxy = self
vobj.RestoreView = True
vobj.RestoreState = True
@@ -133,6 +133,7 @@ class ViewProviderWorkingPlaneProxy:
self.drawstyle = coin.SoDrawStyle()
self.drawstyle.style = coin.SoDrawStyle.LINES
self.lcoords = coin.SoCoordinate3()
import PartGui # Required for "SoBrepEdgeSet" (because a WorkingPlaneProxy is not a Part::FeaturePython object).
ls = coin.SoType.fromName("SoBrepEdgeSet").createInstance()
ls.coordIndex.setValues(0,28,[0,1,-1,2,3,4,5,-1,6,7,-1,8,9,10,11,-1,12,13,-1,14,15,16,17,-1,18,19,20,21])
sep = coin.SoSeparator()