Package wx :: Package lib :: Package ogl :: Class LineShape

[frames | no frames]

## Type LineShape

         object --+
                  |
    ShapeEvtHandler --+
                      |
                  Shape --+
                          |
                         LineShape

LineShape may be attached to two nodes; it may be segmented, in which case a control point is drawn for each joint.

A wxLineShape may have arrows at the beginning, end and centre.

Derived from:
  Shape

Method Summary
| `__init__(self)`
| ``AddArrow`(self, type, end, size, xOffset, name, mf, arrowId)` Add an arrow (or annotation) to the line.
| ``AddArrowOrdered`(self, arrow, referenceList, end)` Add an arrowhead in the position indicated by the reference list of arrowheads, which contains all legal arrowheads for this line, in the correct order.
| ``ClearArrow`(self, name)` Delete the arrow with the given name.
| ``ClearArrowsAtPosition`(self, end)` Delete the arrows at the specified position, or at any position if position is -1.
| ``DeleteArrowHead`(self, position, name)` Delete arrowhead by position and name.
| ``DeleteArrowHeadId`(self, id)` Delete arrowhead by id.
| ``DeleteLineControlPoint`(self)` Delete an arbitary point on the line.
| ``Draggable`(self)` TRUE if the shape may be dragged by the user.
| ``DrawArrow`(self, dc, arrow, XOffset, proportionalOffset)` Draw the given arrowhead (or annotation).
| ``DrawArrows`(self, dc)` Draw all arrows.
| ``DrawRegion`(self, dc, region, x, y)` Format one region at this position.
| ``EraseRegion`(self, dc, region, x, y)` Erase one region at this position.
| ``FindArrowHead`(self, position, name)` Find arrowhead by position and name.
| ``FindArrowHeadId`(self, arrowId)` Find arrowhead by id.
| ``FindLineEndPoints`(self)` Finds the x, y points at the two ends of the line.
| ``FindLinePosition`(self, x, y)` Find which position we're talking about at this x, y.
| ``FindMinimumWidth`(self)` Find the horizontal width for drawing a line with arrows in minimum space.
| ``FindNth`(self, image, incoming)` Find the position of the line on the given object.
| ``FormatText`(self, dc, s, i)` Format a text string according to the region size, adding strings with positions to region text list.
| `GetAlignmentEnd(self)`
| `GetAlignmentOrientation(self, isEnd)`
| `GetAlignmentStart(self)`
| `GetAlignmentType(self, isEnd)`
| `GetArrows(self)`
| ``GetAttachmentFrom`(self)` Return the attachment point on the 'from' node.
| ``GetAttachmentTo`(self)` Return the attachment point on the 'to' node.
| ``GetBoundingBoxMin`(self)` Get the minimum bounding box for the shape, that defines the area available for drawing the contents (such as text).
| ``GetEnds`(self)` Get the visible endpoints of the lines for drawing between two objects.
| ``GetFrom`(self)` Return the 'from' object.
| ``GetLabelPosition`(self, position)` Get the reference point for a label.
| `GetLineControlPoints(self)`
| ``GetNextControlPoint`(self, shape)` Find the next control point in the line after the start / end point, depending on whether the shape is at the start or end.
| ``GetTo`(self)` Return the 'to' object.
| ``HitTest`(self, x, y)` Given a point on a canvas, returns TRUE if the point was on the shape, and returns the nearest attachment point and distance from the given point and target.
| ``Initialise`(self)` Initialise the line object.
| ``InsertLineControlPoint`(self, dc, point)` Insert a control point at an optional given position.
| ``IsEnd`(self, nodeObject)` TRUE if shape is at the end of the line.
| ``IsSpline`(self)` TRUE if a spline is drawn through the control points.
| ``MakeControlPoints`(self)` Make handle control points.
| ``MakeLineControlPoints`(self, n)` Make a given number of control points (minimum of two).
| `OnBeginDragLeft(self, x, y, keys, attachment)`
| `OnCreateLabelShape(self, parent, region, w, h)`
| `OnDragLeft(self, draw, x, y, keys, attachment)`
| `OnDraw(self, dc)`
| `OnDrawContents(self, dc)`
| `OnDrawControlPoints(self, dc)`
| `OnDrawOutline(self, dc, x, y, w, h)`
| `OnEndDragLeft(self, x, y, keys, attachment)`
| `OnErase(self, dc)`
| `OnEraseControlPoints(self, dc)`
| `OnLabelMovePre(self, dc, labelShape, x, y, old_x, old_y, display)`
| ``OnMoveLink`(self, dc, moveControlPoints)` Called when a connected object has moved, to move the link to correct position
| `OnMoveMiddleControlPoint(self, dc, lpt, pt)`
| `OnMovePre(self, dc, x, y, old_x, old_y, display)`
| `OnSizingBeginDragLeft(self, pt, x, y, keys, attachment)`
| `OnSizingDragLeft(self, pt, draw, x, y, keys, attachment)`
| `OnSizingEndDragLeft(self, pt, x, y, keys, attachment)`
| ``ResetControlPoints`(self)` Reset the positions of the control points (for instance when the shape's shape has changed).
| ``Select`(self, select, dc)` Select or deselect the given shape, drawing or erasing control points (handles) as necessary.
| `SetAlignmentOrientation(self, isEnd, isHoriz)`
| `SetAlignmentType(self, isEnd, alignType)`
| ``SetAttachmentFrom`(self, attach)` Set the 'from' shape attachment.
| ``SetAttachments`(self, from_attach, to_attach)` Specify which object attachment points should be used at each end of the line.
| ``SetAttachmentTo`(self, attach)` Set the 'to' shape attachment.
| ``SetEnds`(self, x1, y1, x2, y2)` Set the end positions of the line.
| ``SetFrom`(self, object)` Set the 'from' object for the line.
| ``SetIgnoreOffsets`(self, ignore)` Set whether to ignore offsets from the end of the line when drawing.
| ``SetSpline`(self, spline)` Specifies whether a spline is to be drawn through the control points.
| ``SetTo`(self, object)` Set the 'to' object for the line.
| ``Straighten`(self, dc)` Straighten verticals and horizontals.
| ``Unlink`(self)` Unlink the line from the nodes at either end.

Class Variable Summary

Method Details

### AddArrow(self, type, end=1, size=10.0, xOffset=0.0, name='', mf=None, arrowId=-1)

Add an arrow (or annotation) to the line.

type may currently be one of:

ARROW_HOLLOW_CIRCLE
  Hollow circle.
ARROW_FILLED_CIRCLE
  Filled circle.
ARROW_ARROW
  Conventional arrowhead.
ARROW_SINGLE_OBLIQUE
  Single oblique stroke.
ARROW_DOUBLE_OBLIQUE
  Double oblique stroke.
ARROW_DOUBLE_METAFILE
  Custom arrowhead.

end may currently be one of:

ARROW_POSITION_END
  Arrow appears at the end.
ARROW_POSITION_START
  Arrow appears at the start.

arrowSize specifies the length of the arrow.

xOffset specifies the offset from the end of the line.

name specifies a name for the arrow.

mf can be a wxPseduoMetaFile, perhaps loaded from a simple Windows metafile.

arrowId is the id for the arrow.

### AddArrowOrdered(self, arrow, referenceList, end)

Add an arrowhead in the position indicated by the reference list of arrowheads, which contains all legal arrowheads for this line, in the correct order. E.g.

Reference list: a b c d e Current line list: a d

Add c, then line list is: a c d.

If no legal arrowhead position, return FALSE. Assume reference list is for one end only, since it potentially defines the ordering for any one of the 3 positions. So we don't check the reference list for arrowhead position.

### ClearArrow(self, name)

Delete the arrow with the given name.

### ClearArrowsAtPosition(self, end)

Delete the arrows at the specified position, or at any position if position is -1.

### DeleteArrowHead(self, position, name)

Delete arrowhead by position and name.

if position is -1, matches any position.

### DeleteArrowHeadId(self, id)

Delete arrowhead by id.

### DeleteLineControlPoint(self)

Delete an arbitary point on the line.

### Draggable(self)

TRUE if the shape may be dragged by the user.

  Overrides:
    `wx.lib.ogl.Shape.Draggable` (inherited documentation)

### DrawArrow(self, dc, arrow, XOffset, proportionalOffset)

Draw the given arrowhead (or annotation).

### DrawArrows(self, dc)

Draw all arrows.

### DrawRegion(self, dc, region, x, y)

Format one region at this position.

### EraseRegion(self, dc, region, x, y)

Erase one region at this position.

### FindArrowHead(self, position, name)

Find arrowhead by position and name.

if position is -1, matches any position.

### FindArrowHeadId(self, arrowId)

Find arrowhead by id.

### FindLineEndPoints(self)

Finds the x, y points at the two ends of the line.

This function can be used by e.g. line-routing routines to get the actual points on the two node images where the lines will be drawn to / from.

### FindLinePosition(self, x, y)

Find which position we're talking about at this x, y.

Returns ARROW_POSITION_START, ARROW_POSITION_MIDDLE, ARROW_POSITION_END.

### FindMinimumWidth(self)

Find the horizontal width for drawing a line with arrows in minimum space. Assume arrows at end only.

### FindNth(self, image, incoming)

Find the position of the line on the given object.

Specify whether incoming or outgoing lines are being considered with incoming.

### FormatText(self, dc, s, i)

Format a text string according to the region size, adding strings with positions to region text list.

  Overrides:
    `wx.lib.ogl.Shape.FormatText`

### GetAttachmentFrom(self)

Return the attachment point on the 'from' node.

### GetAttachmentTo(self)

Return the attachment point on the 'to' node.

### GetBoundingBoxMin(self)

Get the minimum bounding box for the shape, that defines the area available for drawing the contents (such as text).

Must be overridden.

  Overrides:
    `wx.lib.ogl.Shape.GetBoundingBoxMin` (inherited documentation)

### GetEnds(self)

Get the visible endpoints of the lines for drawing between two objects.

### GetFrom(self)

Return the 'from' object.

### GetLabelPosition(self, position)

Get the reference point for a label.

Region x and y are offsets from this. position is 0 (middle), 1 (start), 2 (end).

### GetNextControlPoint(self, shape)

Find the next control point in the line after the start / end point, depending on whether the shape is at the start or end.

### GetTo(self)

Return the 'to' object.

### HitTest(self, x, y)

Given a point on a canvas, returns TRUE if the point was on the shape, and returns the nearest attachment point and distance from the given point and target.

  Overrides:
    `wx.lib.ogl.Shape.HitTest` (inherited documentation)

### Initialise(self)

Initialise the line object.

### InsertLineControlPoint(self, dc=None, point=None)

Insert a control point at an optional given position.

### IsEnd(self, nodeObject)

TRUE if shape is at the end of the line.

### IsSpline(self)

TRUE if a spline is drawn through the control points.

### MakeControlPoints(self)

Make handle control points.

  Overrides:
    `wx.lib.ogl.Shape.MakeControlPoints`

### MakeLineControlPoints(self, n)

Make a given number of control points (minimum of two).

### OnMoveLink(self, dc, moveControlPoints=True)

Called when a connected object has moved, to move the link to correct position

  Overrides:
    `wx.lib.ogl.ShapeEvtHandler.OnMoveLink`

### ResetControlPoints(self)

Reset the positions of the control points (for instance when the shape's shape has changed).

  Overrides:
    `wx.lib.ogl.Shape.ResetControlPoints` (inherited documentation)

### Select(self, select, dc=None)

Select or deselect the given shape, drawing or erasing control points (handles) as necessary.

  Overrides:
    `wx.lib.ogl.Shape.Select` (inherited documentation)

### SetAttachmentFrom(self, attach)

Set the 'from' shape attachment.

### SetAttachments(self, from_attach, to_attach)

Specify which object attachment points should be used at each end of the line.

### SetAttachmentTo(self, attach)

Set the 'to' shape attachment.

### SetEnds(self, x1, y1, x2, y2)

Set the end positions of the line.

### SetFrom(self, object)

Set the 'from' object for the line.

### SetIgnoreOffsets(self, ignore)

Set whether to ignore offsets from the end of the line when drawing.

### SetSpline(self, spline)

Specifies whether a spline is to be drawn through the control points.

### SetTo(self, object)

Set the 'to' object for the line.

### Straighten(self, dc=None)

Straighten verticals and horizontals.

### Unlink(self)

Unlink the line from the nodes at either end.

Generated by Epydoc 2.1.20050511.rpd on Thu Mar 22 12:08:01 2007 | http://epydoc.sf.net