Eidolon
Public Member Functions | Public Attributes | List of all members
DrawContourMixin Class Reference
Inheritance diagram for DrawContourMixin:
Inheritance graph
Collaboration diagram for DrawContourMixin:
Collaboration graph

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
 

Detailed Description

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).

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self,
  numNodes,
  matname = 'newContour',
  drawcolor = color(1,0,0) 
)

Member Function Documentation

◆ drawMouseDrag()

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.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ drawMousePress()

def drawMousePress (   self,
  e 
)
Start drawing the contour, returns True if drawing was enabled and the contour started, False otherwise.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ drawMouseRelease()

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.
Here is the caller graph for this function:

◆ fillContourFig()

def fillContourFig (   self)
Fills the figure representing the drawn contour with lines so that it is visible on screen while drawing.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ startContourDraw()

def startContourDraw (   self)
Here is the caller graph for this function:

Member Data Documentation

◆ contour

contour

◆ contourFig

contourFig

◆ contourMat

contourMat

◆ drawcolor

drawcolor

◆ drawingContour

drawingContour

◆ numNodes

numNodes

The documentation for this class was generated from the following file: