Exemplo n.º 1
0
 def draw(self, turtleProxy, scale, longName, shortName, dxfIndex, partID):
     result = delphi_compatability.TRect()
     minZ = 0.0
     self.zForSorting = 0
     turtle = turtleProxy
     if turtle.ifExporting_exclude3DObject(scale):
         return result
     turtle.clearRecording()
     self.boundsRect = delphi_compatability.TRect()
     for point in self.points:
         u3dsupport.KfPoint3D_addPointToBoundsRect(
             self.boundsRect, turtle.transformAndRecord(point, scale))
     result = self.boundsRect
     if not turtle.drawOptions.draw3DObjects:
         return result
     if turtle.drawOptions.draw3DObjectsAsRects:
         turtle.drawTrianglesFromBoundsRect(self.boundsRect)
         return result
     # prepare
     turtle.ifExporting_start3DObject(longName + " 3D object", shortName,
                                      turtle.drawingSurface.foreColor,
                                      dxfIndex)
     if turtle.exportingToFile():
         # draw
         self.write3DExportElements(turtle, scale, partID)
     elif len(self.triangles) > 0:
         first = 1
         for triangle in self.triangles:
             realTriangle = turtle.drawTriangleFromIndexes(
                 triangle.pointIndexes[0], triangle.pointIndexes[1],
                 triangle.pointIndexes[2], partID)
             if (turtle.drawOptions.sortPolygons) and (
                     turtle.drawOptions.sortTdosAsOneItem) and (realTriangle
                                                                != None):
                 if first:
                     minZ = realTriangle.zForSorting
                     first = 0
                 elif realTriangle.zForSorting < minZ:
                     minZ = realTriangle.zForSorting
                 realTriangle.tdo = self
     self.zForSorting = minZ
     turtle.ifExporting_end3DObject()
     return result
Exemplo n.º 2
0
 def __init__(self):
     self.points = []
     self.originPointIndex = 0
     self.triangles = ucollect.TListCollection()
     self.name = ""
     self.originalIfCopy = None
     self.inUse = False
     self.zForSorting = 0.0
     self.indexWhenRemoved = 0
     self.selectedIndexWhenRemoved = 0
     self.boundsRect = delphi_compatability.TRect()
Exemplo n.º 3
0
 def bestPointForDrawingAtScale(self, turtleProxy, origin, bitmapSize, scale):
     turtle = turtleProxy
     self.boundsRect = delphi_compatability.TRect()
     turtle.reset()
     for point in self.points:
         u3dsupport.KfPoint3D_addPointToBoundsRect(self.boundsRect, turtle.transformAndRecord(point, scale))
         # PDF FIX -- no TPOINT?
     result = delphi_compatability.TPoint()
     result.X = origin.X + bitmapSize.X / 2 - usupport.rWidth(self.boundsRect) / 2 - self.boundsRect.Left
     result.Y = origin.Y + bitmapSize.Y / 2 - usupport.rHeight(self.boundsRect) / 2 - self.boundsRect.Top
     return result
Exemplo n.º 4
0
 def boundsRect(self):
     result = delphi_compatability.TRect()
     try:
         result.Top = int(self.realBoundsRect.top)
         result.Left = int(self.realBoundsRect.left)
         result.Bottom = int(self.realBoundsRect.bottom)
         result.Right = int(self.realBoundsRect.right)
     except:
         #might want to be more precise in assigning a rect
         result.Top = -32767
         result.Left = -32767
         result.Bottom = 32767
         result.Right = 32767
     return result
Exemplo n.º 5
0
 def __init__(self):
     self.plant = None
     self.liveBiomass_pctMPB = 0.0
     self.deadBiomass_pctMPB = 0.0
     self.biomassDemand_pctMPB = 0.0
     self.gender = 0
     self.age = 0L
     self.randomSwayIndex = 0.0
     self.hasFallenOff = False
     self.isSeedlingLeaf = False
     self.partID = 0L
     self.boundsRect = delphi_compatability.TRect()
     self.amendment = None
     self.parentAmendment = None
     self.biomassOfMeAndAllPartsAboveMe_pctMPB = 0.0