wxShapeFramework
1.13.0 beta
|
Basic class encapsulating the multiline consisting of several line segments. More...
#include <LineShape.h>
Public Member Functions | |
XS_DECLARE_CLONABLE_CLASS (wxSFLineShape) | |
wxSFLineShape (void) | |
Default constructor. | |
wxSFLineShape (long src, long trg, const wxXS::RealPointList &path, wxSFDiagramManager *manager) | |
User constructor. | |
wxSFLineShape (const wxRealPoint &src, const wxRealPoint &trg, const wxXS::RealPointList &path, wxSFDiagramManager *manager) | |
User constructor. | |
wxSFLineShape (const wxSFLineShape &obj) | |
Copy constructor. | |
virtual | ~wxSFLineShape (void) |
Destructor. | |
void | SetSrcShapeId (long id) |
Set line source. | |
long | GetSrcShapeId () |
Get line source. | |
void | SetTrgShapeId (long id) |
Set line target. | |
long | GetTrgShapeId () |
Get line target. | |
void | SetSrcPoint (const wxRealPoint &src) |
Set user-defined starting line point. | |
wxRealPoint | GetSrcPoint () |
Get first line point. | |
void | SetTrgPoint (const wxRealPoint &trg) |
Set user-defined ending point. | |
wxRealPoint | GetTrgPoint () |
Get last line point. | |
void | GetDirectLine (wxRealPoint &src, wxRealPoint &trg) |
Get starting and ending line points. | |
void | SetSrcArrow (wxSFArrowBase *arrow) |
Set source arrow object. | |
void | SetTrgArrow (wxSFArrowBase *arrow) |
Set target arrow object. | |
wxSFArrowBase * | SetSrcArrow (wxClassInfo *arrowInfo) |
Set source arrow object created from its class info. | |
wxSFArrowBase * | GetSrcArrow () |
Get object of source arrow. | |
wxSFArrowBase * | SetTrgArrow (wxClassInfo *arrowInfo) |
Set target arrow object created from its class info. | |
wxSFArrowBase * | GetTrgArrow () |
Get object of target arrow. | |
void | SetLinePen (const wxPen &pen) |
Set line style. | |
wxPen | GetLinePen () const |
Get line style. | |
void | SetDockPoint (int index) |
Set the line dock point. It is a zerro based index of the line control point which will act as the shape position (value returned by GetRelativePosition() function). | |
int | GetDockPoint () |
Get the line dock point. It is a zerro based index of the line control point which will act as the shape position (value returned by GetRelativePosition() function). | |
wxXS::RealPointList & | GetControlPoints () |
Get a list of the line's contol points (their positions). | |
wxRealPoint | GetDockPointPosition (int dp) |
Get a position of given line dock point. | |
void | SetStartingConnectionPoint (const wxSFConnectionPoint *cp) |
Initialize line's starting point with existing fixed connection point. | |
void | SetEndingConnectionPoint (const wxSFConnectionPoint *cp) |
Initialize line's ending point with existing fixed connection point. | |
bool | GetLineSegment (size_t index, wxRealPoint &src, wxRealPoint &trg) |
Get starting and ending point of line segment defined by its index. | |
void | SetStandAlone (bool enab) |
Set stand-alone line mode. | |
bool | IsStandAlone () |
Get stand-alone line mode. | |
virtual wxRect | GetBoundingBox () |
Get line's bounding box. The function can be overrided if neccessary. | |
virtual wxRealPoint | GetAbsolutePosition () |
Get the shape's absolute position in the canvas. | |
virtual wxRealPoint | GetBorderPoint (const wxRealPoint &start, const wxRealPoint &end) |
Get intersection point of the shape border and a line leading from 'start' point to 'end' point. The function can be overrided if neccessary. | |
virtual bool | Contains (const wxPoint &pos) |
Test whether the given point is inside the shape. The function can be overrided if neccessary. | |
virtual void | MoveTo (double x, double y) |
Move the shape to the given absolute position. The function can be overrided if neccessary. | |
virtual void | MoveBy (double x, double y) |
Move the shape by the given offset. The function can be overrided if neccessary. | |
virtual void | CreateHandles () |
Function called by the framework responsible for creation of shape handles at the creation time. The function can be overrided if neccesary. | |
virtual void | OnHandle (wxSFShapeHandle &handle) |
Event handler called during dragging of the shape handle. The function can be overrided if necessary. | |
virtual void | OnEndHandle (wxSFShapeHandle &handle) |
Event handler called when the user finished dragging of the shape handle. The function can be overrided if necessary. | |
virtual void | OnBeginDrag (const wxPoint &pos) |
Event handler called at the begining of the shape dragging process. The function can be overrided if necessary. | |
virtual void | OnLeftDoubleClick (const wxPoint &pos) |
Event handler called when the shape is double-clicked by the left mouse button. The function can be overrided if necessary. | |
virtual void | Scale (double x, double y, bool children=sfWITHCHILDREN) |
Scale the shape size by in both directions. The function can be overrided if necessary (new implementation should call default one ore scale shape's children manualy if neccesary). | |
Protected Types | |
enum | LINEMODE { modeREADY, modeUNDERCONSTRUCTION, modeSRCCHANGE, modeTRGCHANGE } |
The modes in which the line shape can stay. More... | |
Protected Member Functions | |
virtual void | DrawNormal (wxDC &dc) |
Draw the shape in the normal way. The function can be overrided if neccessary. | |
virtual void | DrawHover (wxDC &dc) |
Draw the shape in the hower mode (the mouse cursor is above the shape). The function can be overrided if neccessary. | |
virtual void | DrawHighlighted (wxDC &dc) |
Draw the shape in the highlighted mode (another shape is dragged over this shape and this shape will accept the dragged one if it will be dropped on it). The function can be overrided if neccessary. | |
virtual void | DrawCompleteLine (wxDC &dc) |
Draw completed line. | |
virtual int | GetHitLinesegment (const wxPoint &pos) |
Get index of the line segment intersecting the given point. | |
void | SetLineMode (LINEMODE mode) |
Set line shape's working mode. | |
LINEMODE | GetLineMode () |
Get current working mode. | |
void | SetUnfinishedPoint (const wxPoint &pos) |
Set next potential control point position (usefull in modeUNDERCONSTRUCTION working mode). | |
wxRealPoint | GetModSrcPoint () |
Get modified starting line point . | |
wxRealPoint | GetModTrgPoint () |
Get modified ending line point . | |
Protected Attributes | |
wxXS::RealPointList | m_lstPoints |
List of the line's control points. | |
wxRealPoint | m_nPrevPosition |
wxPoint | m_nUnfinishedPoint |
LINEMODE | m_nMode |
int | m_nDockPoint |
Index of the line dock point. | |
long | m_nSrcShapeId |
long | m_nTrgShapeId |
wxSFArrowBase * | m_pSrcArrow |
wxSFArrowBase * | m_pTrgArrow |
bool | m_fStandAlone |
wxRealPoint | m_nSrcPoint |
Stand alone line's starting point. | |
wxRealPoint | m_nTrgPoint |
Stand alone line's ending point. | |
wxRealPoint | m_nSrcOffset |
Modification offset for starting line point. | |
wxRealPoint | m_nTrgOffset |
Modification offset for ending line point. | |
wxPen | m_Pen |
Private Member Functions | |
void | MarkSerializableDataMembers () |
Initialize serializable properties. | |
Friends | |
class | wxSFShapeCanvas |
Basic class encapsulating the multiline consisting of several line segments.
enum wxSFLineShape::LINEMODE [protected] |
wxSFLineShape::wxSFLineShape | ( | void | ) |
Default constructor.
wxSFLineShape::wxSFLineShape | ( | long | src, |
long | trg, | ||
const wxXS::RealPointList & | path, | ||
wxSFDiagramManager * | manager | ||
) |
User constructor.
src | ID of the source shape |
trg | ID of the target shape |
path | List of the line control points (can be empty) |
manager | Pointer to parent shape manager |
wxSFLineShape::wxSFLineShape | ( | const wxRealPoint & | src, |
const wxRealPoint & | trg, | ||
const wxXS::RealPointList & | path, | ||
wxSFDiagramManager * | manager | ||
) |
User constructor.
src | Starting line point |
trg | Ending line point |
path | List of the line control points (can be empty) |
manager | Pointer to parent shape manager |
wxSFLineShape::wxSFLineShape | ( | const wxSFLineShape & | obj | ) |
Copy constructor.
obj | Reference to the source object |
virtual wxSFLineShape::~wxSFLineShape | ( | void | ) | [virtual] |
Destructor.
virtual bool wxSFLineShape::Contains | ( | const wxPoint & | pos | ) | [virtual] |
Test whether the given point is inside the shape. The function can be overrided if neccessary.
pos | Examined point |
Reimplemented from wxSFShapeBase.
virtual void wxSFLineShape::CreateHandles | ( | ) | [virtual] |
Function called by the framework responsible for creation of shape handles at the creation time. The function can be overrided if neccesary.
Reimplemented from wxSFShapeBase.
virtual void wxSFLineShape::DrawCompleteLine | ( | wxDC & | dc | ) | [protected, virtual] |
Draw completed line.
Reimplemented in wxSFCurveShape, and wxSFOrthoLineShape.
virtual void wxSFLineShape::DrawHighlighted | ( | wxDC & | dc | ) | [protected, virtual] |
Draw the shape in the highlighted mode (another shape is dragged over this shape and this shape will accept the dragged one if it will be dropped on it). The function can be overrided if neccessary.
dc | Reference to device context where the shape will be drawn to |
Reimplemented from wxSFShapeBase.
virtual void wxSFLineShape::DrawHover | ( | wxDC & | dc | ) | [protected, virtual] |
Draw the shape in the hower mode (the mouse cursor is above the shape). The function can be overrided if neccessary.
dc | Reference to device context where the shape will be drawn to |
Reimplemented from wxSFShapeBase.
virtual void wxSFLineShape::DrawNormal | ( | wxDC & | dc | ) | [protected, virtual] |
Draw the shape in the normal way. The function can be overrided if neccessary.
dc | Reference to device context where the shape will be drawn to |
Reimplemented from wxSFShapeBase.
virtual wxRealPoint wxSFLineShape::GetAbsolutePosition | ( | ) | [virtual] |
Get the shape's absolute position in the canvas.
Reimplemented from wxSFShapeBase.
virtual wxRealPoint wxSFLineShape::GetBorderPoint | ( | const wxRealPoint & | start, |
const wxRealPoint & | end | ||
) | [virtual] |
Get intersection point of the shape border and a line leading from 'start' point to 'end' point. The function can be overrided if neccessary.
start | Starting point of the virtual intersection line |
end | Ending point of the virtual intersection line |
Reimplemented from wxSFShapeBase.
virtual wxRect wxSFLineShape::GetBoundingBox | ( | ) | [virtual] |
Get line's bounding box. The function can be overrided if neccessary.
Reimplemented from wxSFShapeBase.
Reimplemented in wxSFCurveShape.
wxXS::RealPointList& wxSFLineShape::GetControlPoints | ( | ) | [inline] |
Get a list of the line's contol points (their positions).
void wxSFLineShape::GetDirectLine | ( | wxRealPoint & | src, |
wxRealPoint & | trg | ||
) |
Get starting and ending line points.
src | Reference to real point value where starting line point will be stored |
trg | Reference to real point value where ending line point will be stored |
int wxSFLineShape::GetDockPoint | ( | ) | [inline] |
Get the line dock point. It is a zerro based index of the line control point which will act as the shape position (value returned by GetRelativePosition() function).
wxRealPoint wxSFLineShape::GetDockPointPosition | ( | int | dp | ) |
Get a position of given line dock point.
dp | Dock point |
virtual int wxSFLineShape::GetHitLinesegment | ( | const wxPoint & | pos | ) | [protected, virtual] |
Get index of the line segment intersecting the given point.
pos | Examined point |
Reimplemented in wxSFOrthoLineShape.
LINEMODE wxSFLineShape::GetLineMode | ( | ) | [inline, protected] |
wxPen wxSFLineShape::GetLinePen | ( | ) | const [inline] |
Get line style.
bool wxSFLineShape::GetLineSegment | ( | size_t | index, |
wxRealPoint & | src, | ||
wxRealPoint & | trg | ||
) |
Get starting and ending point of line segment defined by its index.
index | Index of desired line segment |
src | Reference to variable where starting point will be stored |
trg | Reference to variable where ending point will be stored |
wxRealPoint wxSFLineShape::GetModSrcPoint | ( | ) | [protected] |
Get modified starting line point .
wxRealPoint wxSFLineShape::GetModTrgPoint | ( | ) | [protected] |
Get modified ending line point .
wxSFArrowBase* wxSFLineShape::GetSrcArrow | ( | ) | [inline] |
Get object of source arrow.
wxRealPoint wxSFLineShape::GetSrcPoint | ( | ) |
Get first line point.
long wxSFLineShape::GetSrcShapeId | ( | ) | [inline] |
Get line source.
wxSFArrowBase* wxSFLineShape::GetTrgArrow | ( | ) | [inline] |
Get object of target arrow.
wxRealPoint wxSFLineShape::GetTrgPoint | ( | ) |
Get last line point.
long wxSFLineShape::GetTrgShapeId | ( | ) | [inline] |
Get line target.
bool wxSFLineShape::IsStandAlone | ( | ) | [inline] |
Get stand-alone line mode.
void wxSFLineShape::MarkSerializableDataMembers | ( | ) | [private] |
Initialize serializable properties.
Reimplemented from wxSFShapeBase.
virtual void wxSFLineShape::MoveBy | ( | double | x, |
double | y | ||
) | [virtual] |
Move the shape by the given offset. The function can be overrided if neccessary.
x | X offset |
y | Y offset |
Reimplemented from wxSFShapeBase.
virtual void wxSFLineShape::MoveTo | ( | double | x, |
double | y | ||
) | [virtual] |
Move the shape to the given absolute position. The function can be overrided if neccessary.
x | X coordinate |
y | Y coordinate |
Reimplemented from wxSFShapeBase.
virtual void wxSFLineShape::OnBeginDrag | ( | const wxPoint & | pos | ) | [virtual] |
Event handler called at the begining of the shape dragging process. The function can be overrided if necessary.
The function is called by the framework (by the shape canvas).
Reimplemented from wxSFShapeBase.
virtual void wxSFLineShape::OnEndHandle | ( | wxSFShapeHandle & | handle | ) | [virtual] |
Event handler called when the user finished dragging of the shape handle. The function can be overrided if necessary.
The function is called by the framework (by the shape canvas). Default implementation does nothing.
handle | Reference to dragged handle |
Reimplemented from wxSFShapeBase.
virtual void wxSFLineShape::OnHandle | ( | wxSFShapeHandle & | handle | ) | [virtual] |
Event handler called during dragging of the shape handle. The function can be overrided if necessary.
The function is called by the framework (by the shape canvas).
handle | Reference to dragged handle |
Reimplemented from wxSFShapeBase.
virtual void wxSFLineShape::OnLeftDoubleClick | ( | const wxPoint & | pos | ) | [virtual] |
Event handler called when the shape is double-clicked by the left mouse button. The function can be overrided if necessary.
The function is called by the framework (by the shape canvas).
pos | Current mouse position |
Reimplemented from wxSFShapeBase.
virtual void wxSFLineShape::Scale | ( | double | x, |
double | y, | ||
bool | children = sfWITHCHILDREN |
||
) | [virtual] |
Scale the shape size by in both directions. The function can be overrided if necessary (new implementation should call default one ore scale shape's children manualy if neccesary).
x | Horizontal scale factor |
y | Vertical scale factor |
children | TRUE if the shape's children shoould be scaled as well, otherwise the shape will be updated after scaling via Update() function. |
Reimplemented from wxSFShapeBase.
void wxSFLineShape::SetDockPoint | ( | int | index | ) | [inline] |
Set the line dock point. It is a zerro based index of the line control point which will act as the shape position (value returned by GetRelativePosition() function).
index | Zerro based index of the line control point |
void wxSFLineShape::SetEndingConnectionPoint | ( | const wxSFConnectionPoint * | cp | ) |
Initialize line's ending point with existing fixed connection point.
cp | Pointer to connection point |
void wxSFLineShape::SetLineMode | ( | LINEMODE | mode | ) | [inline, protected] |
void wxSFLineShape::SetLinePen | ( | const wxPen & | pen | ) | [inline] |
Set line style.
pen | Reference to wxPen object |
void wxSFLineShape::SetSrcArrow | ( | wxSFArrowBase * | arrow | ) |
Set source arrow object.
arrow | Pointer to the arrow object which will be assigned to the begin of the line |
wxSFArrowBase* wxSFLineShape::SetSrcArrow | ( | wxClassInfo * | arrowInfo | ) |
Set source arrow object created from its class info.
arrowInfo | Class info of the arrow class |
void wxSFLineShape::SetSrcPoint | ( | const wxRealPoint & | src | ) | [inline] |
Set user-defined starting line point.
src | Starting point |
void wxSFLineShape::SetSrcShapeId | ( | long | id | ) | [inline] |
Set line source.
id | ID of the source shape |
void wxSFLineShape::SetStandAlone | ( | bool | enab | ) | [inline] |
Set stand-alone line mode.
enab | TRUE for stand-alone line, otherwise FALSE |
void wxSFLineShape::SetStartingConnectionPoint | ( | const wxSFConnectionPoint * | cp | ) |
Initialize line's starting point with existing fixed connection point.
cp | Pointer to connection point |
void wxSFLineShape::SetTrgArrow | ( | wxSFArrowBase * | arrow | ) |
Set target arrow object.
arrow | Pointer to the arrow object which will be assigned to the end of the line |
wxSFArrowBase* wxSFLineShape::SetTrgArrow | ( | wxClassInfo * | arrowInfo | ) |
Set target arrow object created from its class info.
arrowInfo | Class info of the arrow class |
void wxSFLineShape::SetTrgPoint | ( | const wxRealPoint & | trg | ) | [inline] |
Set user-defined ending point.
trg | Ending point |
void wxSFLineShape::SetTrgShapeId | ( | long | id | ) | [inline] |
Set line target.
id | ID of the target shape |
void wxSFLineShape::SetUnfinishedPoint | ( | const wxPoint & | pos | ) | [inline, protected] |
Set next potential control point position (usefull in modeUNDERCONSTRUCTION working mode).
pos | New potential control point position |
friend class wxSFShapeCanvas [friend] |
Reimplemented from wxSFShapeBase.
bool wxSFLineShape::m_fStandAlone [protected] |
wxXS::RealPointList wxSFLineShape::m_lstPoints [protected] |
List of the line's control points.
int wxSFLineShape::m_nDockPoint [protected] |
Index of the line dock point.
LINEMODE wxSFLineShape::m_nMode [protected] |
wxRealPoint wxSFLineShape::m_nPrevPosition [protected] |
wxRealPoint wxSFLineShape::m_nSrcOffset [protected] |
Modification offset for starting line point.
wxRealPoint wxSFLineShape::m_nSrcPoint [protected] |
Stand alone line's starting point.
long wxSFLineShape::m_nSrcShapeId [protected] |
wxRealPoint wxSFLineShape::m_nTrgOffset [protected] |
Modification offset for ending line point.
wxRealPoint wxSFLineShape::m_nTrgPoint [protected] |
Stand alone line's ending point.
long wxSFLineShape::m_nTrgShapeId [protected] |
wxPoint wxSFLineShape::m_nUnfinishedPoint [protected] |
wxPen wxSFLineShape::m_Pen [protected] |
wxSFArrowBase* wxSFLineShape::m_pSrcArrow [protected] |
wxSFArrowBase* wxSFLineShape::m_pTrgArrow [protected] |