A diagram item that adds a dimension to the canvas.
More...
Methods inherited from DiagramItem: |
def | Draw |
def | Erase |
Data and other attributes inherited from 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 | ) |
|
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 | ) |
|
def diagram.DiagramBuilder.DimensionItem.Highlight |
( |
|
args | ) |
|
Member Data Documentation
float diagram.DiagramBuilder.DimensionItem.expansion_factor = 100.0 |
|
static |