# -*- coding: utf-8 -*- """ Created on Tue Nov 27 16:46:58 2018 @author: noordam """ import readAndWriteFiles import helpFunctions class SurfaceLine: def __init__(self): self.xCoordsOriginalSurfaceLine=[] self.yCoordsOriginalSurfaceLine=[] self.xCoordsNewSurfaceLine=[] self.yCoordsNewSurfaceLine=[] self.info=[] self.surfaceLineDefinitions =[] def ReadSurfaceLine(self,surfaceLineFileName,lineInOriginalFile) : self.xCoordsOriginalSurfaceLine, self.yCoordsOriginalSurfaceLine, self.info, self.surfaceLineDefinitions = readAndWriteFiles.ReadSurfaceLine(surfaceLineFileName,lineInOriginalFile) def WriteSurfaceLine(self,jj,safeFileNameNewSurfaceLine): readAndWriteFiles.WriteSurfaceLine(jj,self.surfaceLineDefinitions,self.xCoordsNewSurfaceLine,self.yCoordsNewSurfaceLine,self.info,safeFileNameNewSurfaceLine) #readAndWriteFiles.WriteCharacteristicPoints(jj,list(reversed(newCharaterisitcDefinitions)),list(reversed(xCoordsNewCharacteristicPoints)),list(reversed(yCoordsNewCharacteristicPoints)),profileName,safeFileNameCharacteristicPoints) def CreateNewSurfaceLine(self,nwo): x1Glob = nwo.globalXCoords[0] x2Glob = nwo.globalXCoords[1] x3Glob = nwo.globalXCoords[2] x4Glob = nwo.globalXCoords[3] y1Glob = nwo.globalYCoords[0] y2Glob = nwo.globalYCoords[1] y3Glob = nwo.globalYCoords[2] y4Glob = nwo.globalYCoords[3] #============================================================================== # Create new surfaceLine #============================================================================== self.xCoordsNewSurfaceLine = self.xCoordsOriginalSurfaceLine[:] self.yCoordsNewSurfaceLine = self.yCoordsOriginalSurfaceLine[:] # replace the y coordinates of the existing points indexesWithinNWO = helpFunctions.FindIndexesInRange(x1Glob,x4Glob,self.xCoordsOriginalSurfaceLine,"surfaceLine") for ii in range(len(indexesWithinNWO)): if self.xCoordsNewSurfaceLine[indexesWithinNWO[ii]]