A wxLineShape 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
Members
wxLineShape::wxLineShape
wxLineShape::~wxLineShape
wxLineShape::AddArrow
wxLineShape::AddArrowOrdered
wxLineShape::ClearArrow
wxLineShape::ClearArrowsAtPosition
wxLineShape::DrawArrow
wxLineShape::DeleteArrowHead
wxLineShape::DeleteLineControlPoint
wxLineShape::DrawArrows
wxLineShape::DrawRegion
wxLineShape::EraseRegion
wxLineShape::FindArrowHead
wxLineShape::FindLineEndPoints
wxLineShape::FindLinePosition
wxLineShape::FindMinimumWidth
wxLineShape::FindNth
wxLineShape::GetAttachmentFrom
wxLineShape::GetAttachmentTo
wxLineShape::GetEnds
wxLineShape::GetFrom
wxLineShape::GetLabelPosition
wxLineShape::GetNextControlPoint
wxLineShape::GetTo
wxLineShape::Initialise
wxLineShape::InsertLineControlPoint
wxLineShape::IsEnd
wxLineShape::IsSpline
wxLineShape::MakeLineControlPoints
wxLineShape::OnMoveLink
wxLineShape::SetAttachmentFrom
wxLineShape::SetAttachments
wxLineShape::SetAttachmentTo
wxLineShape::SetEnds
wxLineShape::SetFrom
wxLineShape::SetIgnoreOffsets
wxLineShape::SetSpline
wxLineShape::SetTo
wxLineShape::Straighten
wxLineShape::Unlink
wxLineShape()
Constructor.
Usually you will call wxLineShape::MakeLineControlPoints to specify the number of segments in the line.
~wxLineShape()
Destructor.
void AddArrow(WXTYPE type, bool end = ARROW_POSITION_END, double arrowSize = 10.0, double xOffset = 0.0, const wxString& name = "", wxPseudoMetaFile *mf = NULL, long arrowId = -1)
Adds an arrow (or annotation) to the line.
type may currently be one of:
end may currently be one of:
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.
void AddArrowOrdered(wxArrowHead *arrow, wxList& referenceList, int 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 dAdd 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.
bool ClearArrow(const wxString& name)
Delete the arrow with the given name.
void ClearArrowsAtPosition(int position = -1)
Delete the arrows at the specified position, or at any position if position is -1.
void DrawArrow(ArrowHead *arrow, double xOffset, bool proportionalOffset)
Draws the given arrowhead (or annotation).
bool DeleteArrowHead(long arrowId)
bool DeleteArrowHead(int position, const wxString& name)
Delete arrowhead by id or position and name.
bool DeleteLineControlPoint()
Deletes an arbitary point on the line.
void DrawArrows(wxDC& dc)
Draws all arrows.
void DrawRegion(wxDC& dc, wxShapeRegion *region, double x, double y)
Format one region at this position.
void EraseRegion(wxDC& dc, wxShapeRegion *region, double x, double y)
Format one region at this position.
wxArrowHead * FindArrowHead(long arrowId)
wxArrowHead * FindArrowHead(int position, const wxString& name)
Find arrowhead by id or position and name.
void FindLineEndPoints(double *fromX, double *fromY, double *toX, double *toY)
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.
int FindLinePosition(double x, double y)
Find which position we're talking about at this x, y. Returns ARROW_POSITION_START, ARROW_POSITION_MIDDLE, ARROW_POSITION_END.
double FindMinimumWidth()
Finds the horizontal width for drawing a line with arrows in minimum space. Assume arrows at end only.
void FindNth(wxShape *image, int *nth, int *noArcs, bool incoming)
Finds the position of the line on the given object. Specify whether incoming or outgoing lines are being considered with incoming.
int GetAttachmentFrom() const
Returns the attachment point on the 'from' node.
int GetAttachmentTo() const
Returns the attachment point on the 'to' node.
void GetEnds(double *x1, double *y1, double *x2, double *y2)
Gets the visible endpoints of the lines for drawing between two objects.
wxShape * GetFrom() const
Gets the 'from' object.
void GetLabelPosition(int position, double *x, double *y)
Get the reference point for a label. Region x and y are offsets from this. position is 0 (middle), 1 (start), 2 (end).
wxPoint * GetNextControlPoint(wxShape *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.
wxShape * GetTo()
Gets the 'to' object.
void Initialise()
Initialises the line object.
void InsertLineControlPoint()
Inserts a control point at an arbitrary position.
bool IsEnd(wxShape *shape)
Returns TRUE if shape is at the end of the line.
bool IsSpline()
Returns TRUE if a spline is drawn through the control points, and FALSE otherwise.
void MakeLineControlPoints(int n)
Make a given number of control points (minimum of two).
void OnMoveLink(wxDC& dc, bool moveControlPoints = TRUE)
Called when a connected object has moved, to move the link to correct position.
void SetAttachmentTo(int fromAttach)
Sets the 'from' shape attachment.
void SetAttachments(int fromAttach, int toAttach)
Specifies which object attachment points should be used at each end of the line.
void SetAttachmentTo(int toAttach)
Sets the 'to' shape attachment.
void SetEnds(double x1, double y1, double x2, double y2)
Sets the end positions of the line.
void SetFrom(wxShape *object)
Sets the 'from' object for the line.
void SetIgnoreOffsets(bool ignore)
Tells the shape whether to ignore offsets from the end of the line when drawing.
void SetSpline(bool spline)
Specifies whether a spline is to be drawn through the control points (TRUE), or a line (FALSE).
void SetTo(wxShape *object)
Sets the 'to' object for the line.
void Straighten(wxDC* dc = NULL)
Straighten verticals and horizontals. dc is optional.
void Unlink()
Unlinks the line from the nodes at either end.