Eidolon
|
Public Member Functions | |
def | __init__ (self, numNodes, matname='newContour', drawcolor=color(1, 0, 0)) |
def | startContourDraw (self) |
def | fillContourFig (self) |
def | drawMousePress (self, e) |
def | drawMouseDrag (self, e, dx, dy) |
def | drawMouseRelease (self, e) |
Public Attributes | |
numNodes | |
drawingContour | |
contour | |
drawcolor | |
contourMat | |
contourFig | |
Mixin representing the UI for drawing a contour in the 2D window. It relies on the mixed subtype calling drawMouse* methods when mouse events are caught and reacting appropriately when drawing occurs (ie. when those methods return True). When drawing is done the final contour is in self.contour and can then be accessed by the mixed subtype. The method fillContourFig() must be called whenever the view is updated (ie. updateView() as in BaseCamera2DWidget).
def __init__ | ( | self, | |
numNodes, | |||
matname = 'newContour' , |
|||
drawcolor = color(1,0,0) |
|||
) |
def drawMouseDrag | ( | self, | |
e, | |||
dx, | |||
dy | |||
) |
Add points to the contour when the mouse is dragged with position delta (dx,dy). This will interpolate over large distances to (mostly) ensure a uniform distribution of points along the drawn contour. Returns True if the contour was drawn, False otherwise.
def drawMousePress | ( | self, | |
e | |||
) |
Start drawing the contour, returns True if drawing was enabled and the contour started, False otherwise.
def drawMouseRelease | ( | self, | |
e | |||
) |
Finish drawing the contour, returns True if the drawing was enabled and enough contour points were present to form a correct contour, False otherwise. The resulting contour is stored in self.contour if True is returned.
def fillContourFig | ( | self | ) |
Fills the figure representing the drawn contour with lines so that it is visible on screen while drawing.
def startContourDraw | ( | self | ) |
contour |
contourFig |
contourMat |
drawcolor |
drawingContour |
numNodes |