wxShapeFramework  1.13.0 beta
wxSFLineShape Class Reference

Basic class encapsulating the multiline consisting of several line segments. More...

#include <LineShape.h>

Inheritance diagram for wxSFLineShape:
Collaboration diagram for wxSFLineShape:

Public Member Functions

 XS_DECLARE_CLONABLE_CLASS (wxSFLineShape)
 
 wxSFLineShape (void)
 Default constructor. More...
 
 wxSFLineShape (long src, long trg, const wxXS::RealPointList &path, wxSFDiagramManager *manager)
 User constructor. More...
 
 wxSFLineShape (const wxRealPoint &src, const wxRealPoint &trg, const wxXS::RealPointList &path, wxSFDiagramManager *manager)
 User constructor. More...
 
 wxSFLineShape (const wxSFLineShape &obj)
 Copy constructor. More...
 
virtual ~wxSFLineShape (void)
 Destructor. More...
 
void SetSrcShapeId (long id)
 Set line source. More...
 
long GetSrcShapeId ()
 Get line source. More...
 
void SetTrgShapeId (long id)
 Set line target. More...
 
long GetTrgShapeId ()
 Get line target. More...
 
void SetSrcPoint (const wxRealPoint &src)
 Set user-defined starting line point. More...
 
wxRealPoint GetSrcPoint ()
 Get first line point. More...
 
void SetTrgPoint (const wxRealPoint &trg)
 Set user-defined ending point. More...
 
wxRealPoint GetTrgPoint ()
 Get last line point. More...
 
void GetDirectLine (wxRealPoint &src, wxRealPoint &trg)
 Get starting and ending line points. More...
 
void SetSrcArrow (wxSFArrowBase *arrow)
 Set source arrow object. More...
 
void SetTrgArrow (wxSFArrowBase *arrow)
 Set target arrow object. More...
 
wxSFArrowBaseSetSrcArrow (wxClassInfo *arrowInfo)
 Set source arrow object created from its class info. More...
 
wxSFArrowBaseGetSrcArrow ()
 Get object of source arrow. More...
 
wxSFArrowBaseSetTrgArrow (wxClassInfo *arrowInfo)
 Set target arrow object created from its class info. More...
 
wxSFArrowBaseGetTrgArrow ()
 Get object of target arrow. More...
 
void SetLinePen (const wxPen &pen)
 Set line style. More...
 
wxPen GetLinePen () const
 Get line style. More...
 
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). More...
 
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). More...
 
wxXS::RealPointList & GetControlPoints ()
 Get a list of the line's contol points (their positions). More...
 
wxRealPoint GetDockPointPosition (int dp)
 Get a position of given line dock point. More...
 
void SetStartingConnectionPoint (const wxSFConnectionPoint *cp)
 Initialize line's starting point with existing fixed connection point. More...
 
void SetEndingConnectionPoint (const wxSFConnectionPoint *cp)
 Initialize line's ending point with existing fixed connection point. More...
 
bool GetLineSegment (size_t index, wxRealPoint &src, wxRealPoint &trg)
 Get starting and ending point of line segment defined by its index. More...
 
void SetStandAlone (bool enab)
 Set stand-alone line mode. More...
 
bool IsStandAlone ()
 Get stand-alone line mode. More...
 
virtual wxRect GetBoundingBox ()
 
virtual wxRealPoint GetAbsolutePosition ()
 Get the shape's absolute position in the canvas. More...
 
virtual wxRealPoint GetBorderPoint (const wxRealPoint &start, const wxRealPoint &end)
 
virtual bool Contains (const wxPoint &pos)
 
virtual void MoveTo (double x, double y)
 
virtual void MoveBy (double x, double y)
 Move the shape by the given offset. The function can be overrided if neccessary. More...
 
virtual void CreateHandles ()
 
virtual void OnHandle (wxSFShapeHandle &handle)
 Event handler called during dragging of the shape handle. The function can be overrided if necessary. More...
 
virtual void OnEndHandle (wxSFShapeHandle &handle)
 Event handler called when the user finished dragging of the shape handle. The function can be overrided if necessary. More...
 
virtual void OnBeginDrag (const wxPoint &pos)
 Event handler called at the begining of the shape dragging process. The function can be overrided if necessary. More...
 
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. More...
 
virtual void Scale (double x, double y, bool children=sfWITHCHILDREN)
 
- Public Member Functions inherited from wxSFShapeBase
 XS_DECLARE_CLONABLE_CLASS (wxSFShapeBase)
 
 wxSFShapeBase (void)
 Basic constructor. More...
 
 wxSFShapeBase (const wxRealPoint &pos, wxSFDiagramManager *manager)
 Enhanced constructor. More...
 
 wxSFShapeBase (const wxSFShapeBase &obj)
 Copy constructor. More...
 
virtual ~wxSFShapeBase (void)
 Destructor. More...
 
void Refresh (bool delayed=false)
 Refresh (redraw) the shape. More...
 
virtual void Draw (wxDC &dc, bool children=sfWITHCHILDREN)
 Draw shape. Default implementation tests basic shape visual states (normal/ready, mouse is over the shape, dragged shape can be accepted) and call appropriate virtual functions (DrawNormal, DrawHover, DrawHighlighted) for its visualisation. The function can be overrided if neccessary. More...
 
virtual bool IsInside (const wxRect &rct)
 
virtual bool Intersects (const wxRect &rct)
 Test whether the given rectangle intersects the shape. More...
 
virtual wxRealPoint GetCenter ()
 Get shape's center. Default implementation does nothing. The function can be overrided if neccessary. More...
 
void ShowHandles (bool show)
 Show/hide shape handles. Hidden handles are inactive. More...
 
void SetStyle (long style)
 Set shape's style. More...
 
long GetStyle () const
 Get current shape style. More...
 
void AddStyle (STYLE style)
 
void RemoveStyle (STYLE style)
 
bool ContainsStyle (STYLE style) const
 
void GetChildShapes (wxClassInfo *type, ShapeList &children, bool recursive=false, xsSerializable::SEARCHMODE mode=xsSerializable::searchBFS)
 
void GetNeighbours (ShapeList &neighbours, wxClassInfo *shapeInfo, CONNECTMODE condir, bool direct=true)
 Get neighbour shapes connected to this shape. More...
 
void GetAssignedConnections (wxClassInfo *shapeInfo, wxSFShapeBase::CONNECTMODE mode, ShapeList &lines)
 Get list of connections assigned to this shape. More...
 
void GetCompleteBoundingBox (wxRect &rct, int mask=bbALL)
 Get shape's bounding box which includes also associated child shapes and connections. More...
 
void Scale (const wxRealPoint &scale, bool children=sfWITHCHILDREN)
 
void ScaleChildren (double x, double y)
 Scale shape's children. More...
 
void MoveTo (const wxRealPoint &pos)
 Move the shape to the given absolute position. More...
 
void MoveBy (const wxRealPoint &delta)
 Move the shape by the given offset. More...
 
void DoAlignment ()
 Update the shape's position in order to its alignment. More...
 
virtual void Update ()
 Upate shape (align all child shapes an resize it to fit them) More...
 
virtual void FitToChildren ()
 Resize the shape to bound all child shapes. The function can be overrided if neccessary. More...
 
bool IsSelected () const
 Function returns TRUE if the shape is selected, otherwise returns FALSE. More...
 
void Select (bool state)
 Set the shape as a selected/deselected one. More...
 
void SetRelativePosition (const wxRealPoint &pos)
 
void SetRelativePosition (double x, double y)
 
wxRealPoint GetRelativePosition () const
 
void SetVAlign (VALIGN val)
 Set vertical alignment of this shape inside its parent. More...
 
VALIGN GetVAlign () const
 Get vertical alignment of this shape inside its parent. More...
 
void SetHAlign (HALIGN val)
 Set horizontal alignment of this shape inside its parent. More...
 
HALIGN GetHAlign () const
 Get horizontal alignment of this shape inside its parent. More...
 
void SetVBorder (double border)
 Set vertical border between this shape and its parent (is vertical alignment is set). More...
 
double GetVBorder () const
 Get vertical border between this shape and its parent (is vertical alignment is set). More...
 
void SetHBorder (double border)
 Set horizontal border between this shape and its parent (is horizontal alignment is set). More...
 
double GetHBorder () const
 Get horizontal border between this shape and its parent (is horizontal alignment is set). More...
 
void SetCustomDockPoint (int dp)
 Set custom dock point used if the shape is child shape of a line shape. More...
 
int GetCustomDockPoint ()
 Get custom dock point used if the shape is child shape of a line shape. More...
 
wxSFShapeBaseGetParentShape ()
 Get pointer to a parent shape. More...
 
wxSFShapeBaseGetGrandParentShape ()
 Get pointer to the topmost parent shape. More...
 
bool IsAncestor (wxSFShapeBase *child)
 Determine whether this shape is ancestor of given child shape. More...
 
bool IsDescendant (wxSFShapeBase *parent)
 Determine whether this shape is descendant of given parent shape. More...
 
void SetUserData (xsSerializable *data)
 Associate user data with the shape. More...
 
xsSerializableGetUserData ()
 Get associated user data. More...
 
wxSFDiagramManagerGetShapeManager ()
 Get shape's parent diagram manager. More...
 
wxSFShapeCanvasGetParentCanvas ()
 Get shape's parent canvas. More...
 
bool IsVisible () const
 Get the shape's visibility status. More...
 
void Show (bool show)
 Show/hide shape. More...
 
void SetHoverColour (const wxColour &col)
 Set shape's hover color. More...
 
wxColour GetHoverColour () const
 Get shape's hover color. More...
 
bool IsActive () const
 Function returns value of a shape's activation flag. More...
 
void Activate (bool active)
 Shape's activation/deactivation. More...
 
bool IsChildAccepted (const wxString &type)
 Tells whether the given shape type is accepted by this shape (it means whether this shape can be its parent). More...
 
bool AcceptCurrentlyDraggedShapes ()
 Function returns TRUE if all currently dragged shapes can be accepted as children of this shape. More...
 
void AcceptChild (const wxString &type)
 Add given shape type to an acceptance list. The acceptance list contains class names of the shapes which can be accepted as children of this shape. Note: Keyword 'All' behaves like any class name. More...
 
wxArrayString & GetAcceptedChildren ()
 Get shape types acceptance list. More...
 
bool IsConnectionAccepted (const wxString &type)
 Tells whether the given connection type is accepted by this shape (it means whether this shape can be connected to another one by a connection of given type). More...
 
void AcceptConnection (const wxString &type)
 Add given connection type to an acceptance list. The acceptance list contains class names of the connection which can be accepted by this shape. Note: Keyword 'All' behaves like any class name. More...
 
wxArrayString & GetAcceptedConnections ()
 Get connection types acceptance list. More...
 
bool IsSrcNeighbourAccepted (const wxString &type)
 Tells whether the given shape type is accepted by this shape as its source neighbour(it means whether this shape can be connected from another one of given type). More...
 
void AcceptSrcNeighbour (const wxString &type)
 Add given shape type to an source neighbours' acceptance list. The acceptance list contains class names of the shape types which can be accepted by this shape as its source neighbour. Note: Keyword 'All' behaves like any class name. More...
 
wxArrayString & GetAcceptedSrcNeighbours ()
 Get source neighbour types acceptance list. More...
 
bool IsTrgNeighbourAccepted (const wxString &type)
 Tells whether the given shape type is accepted by this shape as its target neighbour(it means whether this shape can be connected to another one of given type). More...
 
void AcceptTrgNeighbour (const wxString &type)
 Add given shape type to an target neighbours' acceptance list. The acceptance list contains class names of the shape types which can be accepted by this shape as its target neighbour. Note: Keyword 'All' behaves like any class name. More...
 
wxArrayString & GetAcceptedTrgNeighbours ()
 Get target neighbour types acceptance list. More...
 
void ClearAcceptedChilds ()
 Clear shape object acceptance list. More...
 
void ClearAcceptedConnections ()
 Clear connection object acceptance list. More...
 
void ClearAcceptedSrcNeighbours ()
 Clear source neighbour objects acceptance list. More...
 
void ClearAcceptedTrgNeighbours ()
 Clear target neighbour objects acceptance list. More...
 
HandleList & GetHandles ()
 Get list of currently assigned shape handles. More...
 
wxSFShapeHandleGetHandle (wxSFShapeHandle::HANDLETYPE type, long id=-1)
 Get shape handle. More...
 
void AddHandle (wxSFShapeHandle::HANDLETYPE type, long id=-1)
 Add new handle to the shape. More...
 
void RemoveHandle (wxSFShapeHandle::HANDLETYPE type, long id=-1)
 Remove given shape handle (if exists). More...
 
ConnectionPointListGetConnectionPoints ()
 Get reference to connection points list. More...
 
wxSFConnectionPointGetConnectionPoint (wxSFConnectionPoint::CPTYPE type, long id=-1)
 Get connection point of given type assigned to the shape. More...
 
wxSFConnectionPointGetNearestConnectionPoint (const wxRealPoint &pos)
 Get connection point closest to the diven position. More...
 
wxSFConnectionPointAddConnectionPoint (wxSFConnectionPoint::CPTYPE type, bool persistent=true)
 Assign connection point of given type to the shape. More...
 
void AddConnectionPoint (wxSFConnectionPoint *cp, bool persistent=true)
 Assigned given connection point to the shape. More...
 
wxSFConnectionPointAddConnectionPoint (const wxRealPoint &relpos, long id=-1, bool persistent=true)
 Assign custom connection point to the shape. More...
 
void RemoveConnectionPoint (wxSFConnectionPoint::CPTYPE type)
 Remove connection point of given type from the shape (if pressent). More...
 
virtual void OnLeftClick (const wxPoint &pos)
 Event handler called when the shape is clicked by the left mouse button. The function can be overrided if necessary. More...
 
virtual void OnRightClick (const wxPoint &pos)
 Event handler called when the shape is clicked by the right mouse button. The function can be overrided if necessary. More...
 
virtual void OnRightDoubleClick (const wxPoint &pos)
 Event handler called when the shape is double-clicked by the right mouse button. The function can be overrided if necessary. More...
 
virtual void OnDragging (const wxPoint &pos)
 Event handler called during the shape dragging process. The function can be overrided if necessary. More...
 
virtual void OnEndDrag (const wxPoint &pos)
 Event handler called at the end of the shape dragging process. The function can be overrided if necessary. More...
 
virtual void OnBeginHandle (wxSFShapeHandle &handle)
 Event handler called when the user started to drag the shape handle. The function can be overrided if necessary. More...
 
virtual void OnMouseEnter (const wxPoint &pos)
 Event handler called when a mouse pointer enters the shape area. The function can be overrided if necessary. More...
 
virtual void OnMouseOver (const wxPoint &pos)
 Event handler called when a mouse pointer moves above the shape area. The function can be overrided if necessary. More...
 
virtual void OnMouseLeave (const wxPoint &pos)
 Event handler called when a mouse pointer leaves the shape area. The function can be overrided if necessary. More...
 
virtual bool OnKey (int key)
 Event handler called when any key is pressed (in the shape canvas). The function can be overrided if necessary. More...
 
virtual void OnChildDropped (const wxRealPoint &pos, wxSFShapeBase *child)
 Event handler called when any shape is dropped above this shape (and the dropped shape is accepted as a child of this shape). The function can be overrided if necessary. More...
 
- Public Member Functions inherited from xsSerializable
 XS_DECLARE_CLONABLE_CLASS (xsSerializable)
 
 xsSerializable ()
 Constructor. More...
 
 xsSerializable (const xsSerializable &obj)
 Copy constructor. More...
 
 ~xsSerializable ()
 Destructor. More...
 
xsSerializableGetParent ()
 Get serializable parent object. More...
 
wxXmlSerializerGetParentManager ()
 Get parent data manager (instance of wxXmlSerializer). More...
 
xsSerializableGetFirstChild ()
 Get first serializable child object. More...
 
xsSerializableGetFirstChild (wxClassInfo *type)
 Get first serializable child object of given type. More...
 
xsSerializableGetLastChild ()
 Get last serializable child object. More...
 
xsSerializableGetLastChild (wxClassInfo *type)
 Get last serializable child object of given type. More...
 
xsSerializableGetSibbling ()
 Get next serializable sibbling object. More...
 
xsSerializableGetSibbling (wxClassInfo *type)
 Get next serializable sibbling object of given type. More...
 
xsSerializableGetChild (long id, bool recursive=xsNORECURSIVE)
 Get child item with given ID if exists. More...
 
bool HasChildren () const
 Function finds out whether this serializable item has some children. More...
 
SerializableListGetChildrenList ()
 Get list of children (serializable objects) of this object. More...
 
void GetChildren (wxClassInfo *type, SerializableList &list)
 Get children of given type. More...
 
void GetChildrenRecursively (wxClassInfo *type, SerializableList &list, SEARCHMODE mode=searchBFS)
 Get all children of given type recursively (i.e. children of children of .... ). More...
 
SerializableList::compatibility_iterator GetFirstChildNode () const
 Get pointer to list node containing first serializable child object. More...
 
SerializableList::compatibility_iterator GetLastChildNode () const
 Get pointer to list node containing last serializable child object. More...
 
void SetParent (xsSerializable *parent)
 Set serializable parent object. More...
 
void SetParentManager (wxXmlSerializer *parent)
 Set parent data manager. More...
 
xsSerializableAddChild (xsSerializable *child)
 Add serializable child object to this object. More...
 
xsSerializableInsertChild (size_t pos, xsSerializable *child)
 Insert serializable child object to this object at given position. More...
 
void RemoveChild (xsSerializable *child)
 Remove serializable child item from this object (the child item will be destroyed). More...
 
void RemoveChildren ()
 Remove all child items (all items will be destroyed). More...
 
void Reparent (xsSerializable *parent)
 Assign this object as a child to given parent object. More...
 
void SetId (long id)
 Set ID of this object. Can be used for further objects' handling by wxXmlSerializer class (default ID value is -1). This functions should NOT be used directly; it is called by wxXmlSerializer object in the case that this serializable object is attached to another one (or directly to root node of wxXmlSerializer) by wxXmlSerializer::AddItem() member function. More...
 
long GetId () const
 Get object ID. More...
 
wxXmlNode * SerializeObject (wxXmlNode *node)
 Create new 'object' XML node and serialize all marked class data members (properties) into it. More...
 
void DeserializeObject (wxXmlNode *node)
 Deserialize marked class data members (properties) from appropriate fields of given parent 'object' XML node. More...
 
void AddProperty (xsProperty *property)
 Add new property to the property list. More...
 
void RemoveProperty (xsProperty *property)
 Remove given property from the property list. More...
 
xsPropertyGetProperty (const wxString &field)
 Get serialized property of given name. More...
 
PropertyList & GetProperties ()
 Get reference to properties list. More...
 
void EnablePropertySerialization (const wxString &field, bool enab)
 Enable/disable serialization of given property. More...
 
bool IsPropertySerialized (const wxString &field)
 Returns information whether the given property is serialized or not. More...
 
void EnableSerialization (bool enab)
 Enable/disable object serialization. More...
 
bool IsSerialized () const
 Returns information whether the object can be serialized or not. More...
 
void EnableCloning (bool enab)
 Enable/disable object cloning. More...
 
bool IsCloningEnabled () const
 Returns information whether the object can be cloned or not. More...
 
xsSerializableoperator<< (xsSerializable *child)
 Add serializable child object to this object. More...
 

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. More...
 
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. More...
 
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. More...
 
virtual void DrawCompleteLine (wxDC &dc)
 Draw completed line. More...
 
virtual int GetHitLinesegment (const wxPoint &pos)
 Get index of the line segment intersecting the given point. More...
 
void SetLineMode (LINEMODE mode)
 Set line shape's working mode. More...
 
LINEMODE GetLineMode ()
 Get current working mode. More...
 
void SetUnfinishedPoint (const wxPoint &pos)
 Set next potential control point position (usefull in modeUNDERCONSTRUCTION working mode). More...
 
wxRealPoint GetModSrcPoint ()
 Get modified starting line point . More...
 
wxRealPoint GetModTrgPoint ()
 Get modified ending line point . More...
 
- Protected Member Functions inherited from wxSFShapeBase
virtual void DrawSelected (wxDC &dc)
 Draw the shape in the selected way. The function can be overrided if neccessary. More...
 
virtual void DrawShadow (wxDC &dc)
 Draw shadow under the shape. The function can be overrided if neccessary. More...
 
virtual wxXmlNode * Serialize (wxXmlNode *node)
 Serialize shape's properties to the given XML node. The serialization routine is automatically called by the framework and should take care about serialization of all specific (non-standard) shape's properties. More...
 
virtual void Deserialize (wxXmlNode *node)
 Deserialize shape's properties from the given XML node. The routine is automatically called by the framework and should take care about deserialization of all specific (non-standard) shape's properties. More...
 
void Refresh (const wxRect &rct, bool delayed=false)
 Repaint the shape. More...
 
wxRealPoint GetParentAbsolutePosition ()
 Get absolute position of the shape parent. More...
 
- Protected Member Functions inherited from xsSerializable
void InitChild (xsSerializable *child)
 Initialize new child object. More...
 

Protected Attributes

wxXS::RealPointList m_lstPoints
 List of the line's control points. More...
 
wxRealPoint m_nPrevPosition
 
wxPoint m_nUnfinishedPoint
 
LINEMODE m_nMode
 
int m_nDockPoint
 Index of the line dock point. More...
 
long m_nSrcShapeId
 
long m_nTrgShapeId
 
wxSFArrowBasem_pSrcArrow
 
wxSFArrowBasem_pTrgArrow
 
bool m_fStandAlone
 
wxRealPoint m_nSrcPoint
 Stand alone line's starting point. More...
 
wxRealPoint m_nTrgPoint
 Stand alone line's ending point. More...
 
wxRealPoint m_nSrcOffset
 Modification offset for starting line point. More...
 
wxRealPoint m_nTrgOffset
 Modification offset for ending line point. More...
 
wxPen m_Pen
 
- Protected Attributes inherited from wxSFShapeBase
bool m_fSelected
 Selection flag. More...
 
bool m_fVisible
 Visibility flag. More...
 
bool m_fActive
 Activation flag. More...
 
long m_nStyle
 Shape's style mask. More...
 
wxColour m_nHoverColor
 
wxRealPoint m_nRelativePosition
 
wxArrayString m_arrAcceptedChildren
 String list with class names of accepted child shapes. More...
 
wxArrayString m_arrAcceptedConnections
 String list with class names of accepted connections. More...
 
wxArrayString m_arrAcceptedSrcNeighbours
 String list with class names of accepted source neighbour shapes. More...
 
wxArrayString m_arrAcceptedTrgNeighbours
 String list with class names of accepted target neighbour shapes. More...
 
double m_nVBorder
 Value of vertical border used by AlignV function. More...
 
double m_nHBorder
 Value of horizontal border used by AlignH function. More...
 
VALIGN m_nVAlign
 Vertical alignment of child shapes. More...
 
HALIGN m_nHAlign
 Horizontal alignment of child shapes. More...
 
int m_nCustomDockPoint
 Custom line dock point. More...
 
HandleList m_lstHandles
 Handle list. More...
 
ConnectionPointList m_lstConnectionPts
 
xsSerializablem_pUserData
 Container for serializable user data associated with the shape. More...
 
- Protected Attributes inherited from xsSerializable
PropertyList m_lstProperties
 List of serialized properties. More...
 
SerializableList m_lstChildItems
 List of child objects. More...
 
xsSerializablem_pParentItem
 Pointer to parent serializable object. More...
 
wxXmlSerializerm_pParentManager
 Pointer to parent data manager. More...
 
bool m_fSerialize
 Object serialization flag. More...
 
bool m_fClone
 Object cloning flag. More...
 

Private Member Functions

void MarkSerializableDataMembers ()
 Initialize serializable properties. More...
 

Friends

class wxSFShapeCanvas
 

Additional Inherited Members

- Public Types inherited from wxSFShapeBase
enum  BBMODE {
  bbSELF = 1 , bbCHILDREN = 2 , bbCONNECTIONS = 4 , bbSHADOW = 8 ,
  bbALL = 15
}
 Bit flags for wxSFShapeBase::GetCompleteBoundingBox function. More...
 
enum  CONNECTMODE { lineSTARTING , lineENDING , lineBOTH }
 Search mode flags for GetAssignedConnections function. More...
 
enum  VALIGN {
  valignNONE , valignTOP , valignMIDDLE , valignBOTTOM ,
  valignEXPAND , valignLINE_START , valignLINE_END
}
 Flags for SetVAlign function. More...
 
enum  HALIGN {
  halignNONE , halignLEFT , halignCENTER , halignRIGHT ,
  halignEXPAND , halignLINE_START , halignLINE_END
}
 Flags for SetHAlign function. More...
 
enum  STYLE {
  sfsPARENT_CHANGE = 1 , sfsPOSITION_CHANGE = 2 , sfsSIZE_CHANGE = 4 , sfsHOVERING = 8 ,
  sfsHIGHLIGHTING = 16 , sfsALWAYS_INSIDE = 32 , sfsDELETE_USER_DATA = 64 , sfsPROCESS_DEL = 128 ,
  sfsSHOW_HANDLES = 256 , sfsSHOW_SHADOW = 512 , sfsLOCK_CHILDREN = 1024 , sfsEMIT_EVENTS = 2048 ,
  sfsPROPAGATE_DRAGGING = 4096 , sfsPROPAGATE_SELECTION = 8192 , sfsPROPAGATE_INTERACTIVE_CONNECTION = 16384 , sfsNO_FIT_TO_CHILDREN = 32768 ,
  sfsPROPAGATE_HOVERING = 65536 , sfsPROPAGATE_HIGHLIGHTING = 131072 , sfsDEFAULT_SHAPE_STYLE = sfsPARENT_CHANGE | sfsPOSITION_CHANGE | sfsSIZE_CHANGE | sfsHOVERING | sfsHIGHLIGHTING | sfsSHOW_HANDLES | sfsALWAYS_INSIDE | sfsDELETE_USER_DATA
}
 Basic shape's styles used with SetStyle() function. More...
 
- Public Types inherited from xsSerializable
enum  SEARCHMODE { searchDFS , searchBFS }
 

Detailed Description

Basic class encapsulating the multiline consisting of several line segments.

Member Enumeration Documentation

◆ LINEMODE

enum wxSFLineShape::LINEMODE
protected

The modes in which the line shape can stay.

Enumerator
modeREADY 
modeUNDERCONSTRUCTION 
modeSRCCHANGE 
modeTRGCHANGE 

Constructor & Destructor Documentation

◆ wxSFLineShape() [1/4]

wxSFLineShape::wxSFLineShape ( void  )

Default constructor.

◆ wxSFLineShape() [2/4]

wxSFLineShape::wxSFLineShape ( long  src,
long  trg,
const wxXS::RealPointList &  path,
wxSFDiagramManager manager 
)

User constructor.

Parameters
srcID of the source shape
trgID of the target shape
pathList of the line control points (can be empty)
managerPointer to parent shape manager

◆ wxSFLineShape() [3/4]

wxSFLineShape::wxSFLineShape ( const wxRealPoint &  src,
const wxRealPoint &  trg,
const wxXS::RealPointList &  path,
wxSFDiagramManager manager 
)

User constructor.

Parameters
srcStarting line point
trgEnding line point
pathList of the line control points (can be empty)
managerPointer to parent shape manager

◆ wxSFLineShape() [4/4]

wxSFLineShape::wxSFLineShape ( const wxSFLineShape obj)

Copy constructor.

Parameters
objReference to the source object

◆ ~wxSFLineShape()

virtual wxSFLineShape::~wxSFLineShape ( void  )
virtual

Destructor.

Member Function Documentation

◆ Contains()

virtual bool wxSFLineShape::Contains ( const wxPoint &  pos)
virtual
\brief Test whether the given point is inside the shape. The function

can be overrided if neccessary.

Parameters
posExamined point
Returns
TRUE if the point is inside the shape area, otherwise FALSE

Reimplemented from wxSFShapeBase.

◆ CreateHandles()

virtual void wxSFLineShape::CreateHandles ( )
virtual
\brief 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.

◆ DrawCompleteLine()

virtual void wxSFLineShape::DrawCompleteLine ( wxDC &  dc)
protectedvirtual

Draw completed line.

Reimplemented in wxSFOrthoLineShape, and wxSFCurveShape.

◆ DrawHighlighted()

virtual void wxSFLineShape::DrawHighlighted ( wxDC &  dc)
protectedvirtual

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.

Parameters
dcReference to device context where the shape will be drawn to

Reimplemented from wxSFShapeBase.

◆ DrawHover()

virtual void wxSFLineShape::DrawHover ( wxDC &  dc)
protectedvirtual

Draw the shape in the hower mode (the mouse cursor is above the shape). The function can be overrided if neccessary.

Parameters
dcReference to device context where the shape will be drawn to

Reimplemented from wxSFShapeBase.

◆ DrawNormal()

virtual void wxSFLineShape::DrawNormal ( wxDC &  dc)
protectedvirtual

Draw the shape in the normal way. The function can be overrided if neccessary.

Parameters
dcReference to device context where the shape will be drawn to

Reimplemented from wxSFShapeBase.

◆ GetAbsolutePosition()

virtual wxRealPoint wxSFLineShape::GetAbsolutePosition ( )
virtual

Get the shape's absolute position in the canvas.

Returns
Shape's position

Reimplemented from wxSFShapeBase.

◆ GetBorderPoint()

virtual wxRealPoint wxSFLineShape::GetBorderPoint ( const wxRealPoint &  start,
const wxRealPoint &  end 
)
virtual
\brief Get intersection point of the shape border and a line leading from
'start' point to 'end' point. The function can be overrided if neccessary.
\param start Starting point of the virtual intersection line
Parameters
endEnding point of the virtual intersection line
Returns
Intersection point

Reimplemented from wxSFShapeBase.

◆ GetBoundingBox()

virtual wxRect wxSFLineShape::GetBoundingBox ( )
virtual
\brief Get line's bounding box. The function can be overrided if neccessary.
Returns
Bounding rectangle

Reimplemented from wxSFShapeBase.

Reimplemented in wxSFCurveShape.

◆ GetControlPoints()

wxXS::RealPointList& wxSFLineShape::GetControlPoints ( )
inline

Get a list of the line's contol points (their positions).

Returns
List of control points' positions

◆ GetDirectLine()

void wxSFLineShape::GetDirectLine ( wxRealPoint &  src,
wxRealPoint &  trg 
)

Get starting and ending line points.

Parameters
srcReference to real point value where starting line point will be stored
trgReference to real point value where ending line point will be stored

◆ GetDockPoint()

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).

Returns
Zerro based index of the line control point (-1 means UNDEFINED)

◆ GetDockPointPosition()

wxRealPoint wxSFLineShape::GetDockPointPosition ( int  dp)

Get a position of given line dock point.

Parameters
dpDock point
Returns
The dock point's position if exists, otherwise the line center

◆ GetHitLinesegment()

virtual int wxSFLineShape::GetHitLinesegment ( const wxPoint &  pos)
protectedvirtual

Get index of the line segment intersecting the given point.

Parameters
posExamined point
Returns
Zero-based index of line segment located under the given point

Reimplemented in wxSFOrthoLineShape.

◆ GetLineMode()

LINEMODE wxSFLineShape::GetLineMode ( )
inlineprotected

Get current working mode.

Returns
Current working mode
See also
LINEMODE

◆ GetLinePen()

wxPen wxSFLineShape::GetLinePen ( ) const
inline

Get line style.

Returns
wxPen class

◆ GetLineSegment()

bool wxSFLineShape::GetLineSegment ( size_t  index,
wxRealPoint &  src,
wxRealPoint &  trg 
)

Get starting and ending point of line segment defined by its index.

Parameters
indexIndex of desired line segment
srcReference to variable where starting point will be stored
trgReference to variable where ending point will be stored
Returns
TRUE if a line segment of given index exists, otherwise FALSE

◆ GetModSrcPoint()

wxRealPoint wxSFLineShape::GetModSrcPoint ( )
protected

Get modified starting line point .

Returns
Modified starting line point

◆ GetModTrgPoint()

wxRealPoint wxSFLineShape::GetModTrgPoint ( )
protected

Get modified ending line point .

Returns
Modified ending line point

◆ GetSrcArrow()

wxSFArrowBase* wxSFLineShape::GetSrcArrow ( )
inline

Get object of source arrow.

Returns
Pointer to the arrow object if exists, otherwise NULL

◆ GetSrcPoint()

wxRealPoint wxSFLineShape::GetSrcPoint ( )

Get first line point.

Returns
First line point

◆ GetSrcShapeId()

long wxSFLineShape::GetSrcShapeId ( )
inline

Get line source.

Returns
ID of the source shape

◆ GetTrgArrow()

wxSFArrowBase* wxSFLineShape::GetTrgArrow ( )
inline

Get object of target arrow.

Returns
Pointer to the arrow object if exists, otherwise NULL

◆ GetTrgPoint()

wxRealPoint wxSFLineShape::GetTrgPoint ( )

Get last line point.

Returns
Last line point

◆ GetTrgShapeId()

long wxSFLineShape::GetTrgShapeId ( )
inline

Get line target.

Returns
ID of the target shape

◆ IsStandAlone()

bool wxSFLineShape::IsStandAlone ( )
inline

Get stand-alone line mode.

Returns
TRUE, if the line is stand-alone, otherwise FALSE

◆ MarkSerializableDataMembers()

void wxSFLineShape::MarkSerializableDataMembers ( )
private

Initialize serializable properties.

◆ MoveBy()

virtual void wxSFLineShape::MoveBy ( double  x,
double  y 
)
virtual

Move the shape by the given offset. The function can be overrided if neccessary.

Parameters
xX offset
yY offset

Reimplemented from wxSFShapeBase.

◆ MoveTo()

virtual void wxSFLineShape::MoveTo ( double  x,
double  y 
)
virtual
\brief Move the shape to the given absolute position. The function

can be overrided if neccessary.

Parameters
xX coordinate
yY coordinate

Reimplemented from wxSFShapeBase.

◆ OnBeginDrag()

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).

See also
wxSFShapeCanvas

Reimplemented from wxSFShapeBase.

◆ OnEndHandle()

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.

Parameters
handleReference to dragged handle

Reimplemented from wxSFShapeBase.

◆ OnHandle()

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).

Parameters
handleReference to dragged handle

Reimplemented from wxSFShapeBase.

◆ OnLeftDoubleClick()

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).

Parameters
posCurrent mouse position
See also
wxSFShapeCanvas

Reimplemented from wxSFShapeBase.

◆ Scale()

virtual void wxSFLineShape::Scale ( double  x,
double  y,
bool  children = sfWITHCHILDREN 
)
virtual
\brief 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).

Parameters
xHorizontal scale factor
yVertical scale factor
childrenTRUE if the shape's children shoould be scaled as well, otherwise the shape will be updated after scaling via Update() function.

Reimplemented from wxSFShapeBase.

◆ SetDockPoint()

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).

Parameters
indexZerro based index of the line control point
See also
sfdvLINESHAPE_DOCKPOINT_START, sfdvLINESHAPE_DOCKPOINT_END, sfdvLINESHAPE_DOCKPOINT_CENTER

◆ SetEndingConnectionPoint()

void wxSFLineShape::SetEndingConnectionPoint ( const wxSFConnectionPoint cp)

Initialize line's ending point with existing fixed connection point.

Parameters
cpPointer to connection point

◆ SetLineMode()

void wxSFLineShape::SetLineMode ( LINEMODE  mode)
inlineprotected

Set line shape's working mode.

Parameters
modeWorking mode
See also
LINEMODE

◆ SetLinePen()

void wxSFLineShape::SetLinePen ( const wxPen &  pen)
inline

Set line style.

Parameters
penReference to wxPen object

◆ SetSrcArrow() [1/2]

wxSFArrowBase* wxSFLineShape::SetSrcArrow ( wxClassInfo *  arrowInfo)

Set source arrow object created from its class info.

Parameters
arrowInfoClass info of the arrow class
Returns
New arrow object

◆ SetSrcArrow() [2/2]

void wxSFLineShape::SetSrcArrow ( wxSFArrowBase arrow)

Set source arrow object.

Parameters
arrowPointer to the arrow object which will be assigned to the begin of the line

◆ SetSrcPoint()

void wxSFLineShape::SetSrcPoint ( const wxRealPoint &  src)
inline

Set user-defined starting line point.

Parameters
srcStarting point

◆ SetSrcShapeId()

void wxSFLineShape::SetSrcShapeId ( long  id)
inline

Set line source.

Parameters
idID of the source shape

◆ SetStandAlone()

void wxSFLineShape::SetStandAlone ( bool  enab)
inline

Set stand-alone line mode.

Parameters
enabTRUE for stand-alone line, otherwise FALSE

◆ SetStartingConnectionPoint()

void wxSFLineShape::SetStartingConnectionPoint ( const wxSFConnectionPoint cp)

Initialize line's starting point with existing fixed connection point.

Parameters
cpPointer to connection point

◆ SetTrgArrow() [1/2]

wxSFArrowBase* wxSFLineShape::SetTrgArrow ( wxClassInfo *  arrowInfo)

Set target arrow object created from its class info.

Parameters
arrowInfoClass info of the arrow class
Returns
New arrow object

◆ SetTrgArrow() [2/2]

void wxSFLineShape::SetTrgArrow ( wxSFArrowBase arrow)

Set target arrow object.

Parameters
arrowPointer to the arrow object which will be assigned to the end of the line

◆ SetTrgPoint()

void wxSFLineShape::SetTrgPoint ( const wxRealPoint &  trg)
inline

Set user-defined ending point.

Parameters
trgEnding point

◆ SetTrgShapeId()

void wxSFLineShape::SetTrgShapeId ( long  id)
inline

Set line target.

Parameters
idID of the target shape

◆ SetUnfinishedPoint()

void wxSFLineShape::SetUnfinishedPoint ( const wxPoint &  pos)
inlineprotected

Set next potential control point position (usefull in modeUNDERCONSTRUCTION working mode).

Parameters
posNew potential control point position
See also
LINEMODE

◆ XS_DECLARE_CLONABLE_CLASS()

wxSFLineShape::XS_DECLARE_CLONABLE_CLASS ( wxSFLineShape  )

Friends And Related Function Documentation

◆ wxSFShapeCanvas

friend class wxSFShapeCanvas
friend

Member Data Documentation

◆ m_fStandAlone

bool wxSFLineShape::m_fStandAlone
protected

◆ m_lstPoints

wxXS::RealPointList wxSFLineShape::m_lstPoints
protected

List of the line's control points.

◆ m_nDockPoint

int wxSFLineShape::m_nDockPoint
protected

Index of the line dock point.

◆ m_nMode

LINEMODE wxSFLineShape::m_nMode
protected

◆ m_nPrevPosition

wxRealPoint wxSFLineShape::m_nPrevPosition
protected

◆ m_nSrcOffset

wxRealPoint wxSFLineShape::m_nSrcOffset
protected

Modification offset for starting line point.

◆ m_nSrcPoint

wxRealPoint wxSFLineShape::m_nSrcPoint
protected

Stand alone line's starting point.

◆ m_nSrcShapeId

long wxSFLineShape::m_nSrcShapeId
protected

◆ m_nTrgOffset

wxRealPoint wxSFLineShape::m_nTrgOffset
protected

Modification offset for ending line point.

◆ m_nTrgPoint

wxRealPoint wxSFLineShape::m_nTrgPoint
protected

Stand alone line's ending point.

◆ m_nTrgShapeId

long wxSFLineShape::m_nTrgShapeId
protected

◆ m_nUnfinishedPoint

wxPoint wxSFLineShape::m_nUnfinishedPoint
protected

◆ m_Pen

wxPen wxSFLineShape::m_Pen
protected

◆ m_pSrcArrow

wxSFArrowBase* wxSFLineShape::m_pSrcArrow
protected

◆ m_pTrgArrow

wxSFArrowBase* wxSFLineShape::m_pTrgArrow
protected

The documentation for this class was generated from the following file: