SDS2 Parametric API
 All Classes Namespaces Functions Variables Pages
List of all members
diagram.DiagramBuilder.DimensionItem Class Reference

A diagram item that adds a dimension to the canvas. More...

Inheritance diagram for diagram.DiagramBuilder.DimensionItem:
diagram.DiagramBuilder.CompositeItem diagram.DiagramBuilder.DiagramItem

Methods defined here:

def __init__

Methods inherited from CompositeItem:

def ClearHighlight
def Highlight

Methods inherited from DiagramItem:

def Draw
def Erase

Data and other attributes inherited from DiagramItem:

float expansion_factor = 100.0

Additional Inherited Members

- Public Member Functions inherited from diagram.DiagramBuilder.CompositeItem
- Public Member Functions inherited from diagram.DiagramBuilder.DiagramItem
- Static Public Attributes inherited from diagram.DiagramBuilder.CompositeItem
float expansion_factor = 100.0
- Static Public Attributes inherited from diagram.DiagramBuilder.DiagramItem
float expansion_factor = 100.0

Detailed Description

A diagram item that adds a dimension to the canvas.

Note: The dimension label will not scale with the reset of the diagram. You will need to adjust the font size and possibly the DiagramBuilder's scale adjustment (see DiagramBuilder.SetScaleAdjustment()) to make the label display as desired.

Method resolution order

DimensionItem
CompositeItem
DiagramItem

Constructor & Destructor Documentation

def diagram.DiagramBuilder.DimensionItem.__init__ (   args)
 Creates a new instance.
 Parameters:  
 leg1: The 2D location (tuple) of the base of the first leg.
 leg2: The 2D location (tuple) of the base of the second leg.
 leg_length: The length of the shortest dimension leg.
 pull_dir: A 2D vector (tuple) that gives the direction in which to pull
 the dimension line.
 line_args: A dictionary that gives the Tk canvas agruments for the lines
 that make up the dimension lines and legs. These are the same arguments 
 that are provided to Tkinter.Canvas.create_line with the addition of the 
 'highlight' argument for the highlight color.  If the 'highlight' argument 
 is not provided then calls to highlight the dimension lines will be ignored.
 label_args: A dictionary that gives the Tk canvas arguments for the label.
 These are the same arguments that are provided to 
 Tkinter.Canvas.create_text with the addition of the 'highlight' argument 
 for the highlight color.  If the 'highlight' argument is not provided 
 then calls to highlight the label will be ignored.

Reimplemented from diagram.DiagramBuilder.CompositeItem.

Member Function Documentation

def diagram.DiagramBuilder.DimensionItem.ClearHighlight (   args)
 ClearHighlight(args)

Reimplemented from diagram.DiagramBuilder.CompositeItem.

def diagram.DiagramBuilder.DimensionItem.Draw (   args)
 Draws the diagram item on the canvas.
 Parameters:
 canvas: The canvas widget.
 Returns A list of ids of items added to the canvas.

Reimplemented from diagram.DiagramBuilder.CompositeItem.

def diagram.DiagramBuilder.DimensionItem.Erase (   args)
 Erases the diagram item from the canvas.
 Parameters:
 canvas: The canvas widget.

Reimplemented from diagram.DiagramBuilder.CompositeItem.

def diagram.DiagramBuilder.DimensionItem.Highlight (   args)
 Highlight(args)

Reimplemented from diagram.DiagramBuilder.CompositeItem.

Member Data Documentation

float diagram.DiagramBuilder.DimensionItem.expansion_factor = 100.0
static