def showGraph4File(self): import DDADisplay DDADisplay.clearDocument() from DDADatabase import dc_inputDatabase import Base Base.DDAObserver.lock = True from DDADatabase import dl_database as database boundaryNodes = database.boundaryNodes if len(boundaryNodes)>0: Base.addPolyLine2Document('BoundaryLine', ifStore2Database=False) # self.drawLines(boundaryNodes, 'BoundaryLine') print 'draw boundary lines : ' , len(boundaryNodes) nums = 0 lines = dc_inputDatabase.jointLines # the viewProvider will take data from dc_inputDatabase.jointLines # self.drawLines( [lines[0].startPoint , lines[0].endPoint] ,'JointLine' , 0) if len(lines)>0: Base.addLines2Document('JointLine') print 'draw joints : ' , len(lines) points = dc_inputDatabase.fixedPoints # self.drawCircles(points, Base.__radius4Points__, 'FixedPoint') if len(points)>0: Base.addCircles2Document('FixedPoint') print 'draw fixed points : ' , len(points) points = dc_inputDatabase.measuredPoints # self.drawCircles(points , Base.__radius4Points__, 'MeasuredPoint') if len(points)>0: Base.addCircles2Document('MeasuredPoint') print 'draw measured points : ' , len(points) points = dc_inputDatabase.loadingPoints # self.drawCircles(points , Base.__radius4Points__, 'LoadingPoint') if len(points)>0: Base.addCircles2Document('LoadingPoint') print 'draw loading points : ' , len(points) points = dc_inputDatabase.holePoints # self.drawCircles(points , Base.__radius4Points__, 'HolePoint') if len(points)>0: Base.addCircles2Document('HolePoint') print 'draw hole points : ' , len(points) Base.recomputeDocument() Base.DDAObserver.lock = False
def drawLine( self , pts , shapeType , materialIndex = 0): # v1 = self.getPointInBaseVectorType(p1) # v2 = self.getPointInBaseVectorType(p2) # if shapeType == 'BoundaryLine': Base.addLines2Document( pts , closed=False, face=False, fname = 'BoundaryLine') elif shapeType == 'JointLine': Base.addLines2Document( pts , closed=False, face=False, fname = 'JointLine', materialIndex = materialIndex) elif shapeType == 'TunnelLine': Base.addLines2Document( pts , closed=False, face=False, fname = 'TunnelLine', materialIndex = materialIndex) elif shapeType == 'AdditionalLine': Base.addLines2Document( pts , closed=False, face=False, fname = 'AdditionalLine') elif shapeType == 'MaterialLine': Base.addLines2Document( pts , closed=False, face=False, fname = 'MaterialLine') elif shapeType == 'BoltElemnet': Base.addLines2Document( pts , closed=False, face=False, fname = 'BoltElemnet') elif shapeType == 'Frame': # frame 其实没有用 Base.addLines2Document( pts , closed=False, face=False, fname = 'Frame') else : print 'Unkown Type : ' , shapeType