wxShapeFramework  1.13.0 beta
wxSFConnectionPoint Class Reference

Class encapsulating fixed connection point assignable to shapes. The assigned fixed connection points are the only places where connected lines can start/end. More...

#include <ShapeDockpoint.h>

Inheritance diagram for wxSFConnectionPoint:
Collaboration diagram for wxSFConnectionPoint:

Public Types

enum  CPTYPE {
  cpUNDEF , cpTOPLEFT , cpTOPMIDDLE , cpTOPRIGHT ,
  cpCENTERLEFT , cpCENTERMIDDLE , cpCENTERRIGHT , cpBOTTOMLEFT ,
  cpBOTTOMMIDDLE , cpBOTTOMRIGHT , cpCUSTOM
}
 Connection point type. More...
 
enum  CPORTHODIR { cpdUNDEF , cpdHORIZONTAL , cpdVERTICAL }
 Direction of orthogonal connection. More...
 
- Public Types inherited from xsSerializable
enum  SEARCHMODE { searchDFS , searchBFS }
 

Public Member Functions

 XS_DECLARE_CLONABLE_CLASS (wxSFConnectionPoint)
 
 wxSFConnectionPoint ()
 Basic constructor. More...
 
 wxSFConnectionPoint (wxSFShapeBase *parent, CPTYPE type)
 Enhanced constructor. More...
 
 wxSFConnectionPoint (wxSFShapeBase *parent, const wxRealPoint &relpos, long id=-1)
 Enhanced constructor. More...
 
 wxSFConnectionPoint (const wxSFConnectionPoint &obj)
 Copy constructor. More...
 
virtual ~wxSFConnectionPoint ()
 Destructor. More...
 
CPTYPE GetType () const
 Get connection point type. More...
 
void SetOrthoDirection (const CPORTHODIR &dir)
 Set direction of orthogonal line's connection. More...
 
const CPORTHODIRGetOrthoDirection () const
 Get direction of orthogonal line's connection. More...
 
void SetParentShape (wxSFShapeBase *parent)
 Set parent shape. More...
 
wxSFShapeBaseGetParentShape () const
 Get parent shape. More...
 
void SetRelativePosition (const wxRealPoint &relpos)
 Set relative position of custom connection point. More...
 
const wxRealPoint & GetRelativePosition () const
 Get relative position of custom connection point. More...
 
wxRealPoint GetConnectionPoint () const
 Get absolute position of the connection point. More...
 
virtual bool Contains (const wxPoint &pos) const
 Find out whether given point is inside the connection point. More...
 
void Draw (wxDC &dc)
 Draw connection point. More...
 
void Refresh ()
 Refresh (repaint) the dock point. 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 Member Functions

virtual void DrawNormal (wxDC &dc)
 Draw the connection point in the normal way. The function can be overrided if neccessary. More...
 
virtual void DrawHover (wxDC &dc)
 Draw the connection point in the hower mode (the mouse cursor is above the shape). The function can be overrided if neccessary. More...
 
- Protected Member Functions inherited from xsSerializable
void InitChild (xsSerializable *child)
 Initialize new child object. More...
 
virtual wxXmlNode * Serialize (wxXmlNode *node)
 Serialize stored properties to the given XML node. The serialization routine is automatically called by the framework and cares about serialization of all defined properties. More...
 
virtual void Deserialize (wxXmlNode *node)
 Deserialize object properties from the given XML node. The routine is automatically called by the framework and cares about deserialization of all defined properties. More...
 

Private Member Functions

void _OnMouseMove (const wxPoint &pos)
 Event handler called when the mouse pointer is moving above shape canvas. More...
 
void MarkSerializableDataMembers ()
 

Private Attributes

CPTYPE m_nType
 
CPORTHODIR m_nOrthoDir
 
wxSFShapeBasem_pParentShape
 
bool m_fMouseOver
 
wxRealPoint m_nRelPosition
 

Friends

class wxSFShapeBase
 

Additional Inherited Members

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

Detailed Description

Class encapsulating fixed connection point assignable to shapes. The assigned fixed connection points are the only places where connected lines can start/end.

See also
wxSFShapeBase::AddConnectionPoint()

Member Enumeration Documentation

◆ CPORTHODIR

Direction of orthogonal connection.

Enumerator
cpdUNDEF 
cpdHORIZONTAL 
cpdVERTICAL 

◆ CPTYPE

Connection point type.

Enumerator
cpUNDEF 
cpTOPLEFT 
cpTOPMIDDLE 
cpTOPRIGHT 
cpCENTERLEFT 
cpCENTERMIDDLE 
cpCENTERRIGHT 
cpBOTTOMLEFT 
cpBOTTOMMIDDLE 
cpBOTTOMRIGHT 
cpCUSTOM 

Constructor & Destructor Documentation

◆ wxSFConnectionPoint() [1/4]

wxSFConnectionPoint::wxSFConnectionPoint ( )

Basic constructor.

◆ wxSFConnectionPoint() [2/4]

wxSFConnectionPoint::wxSFConnectionPoint ( wxSFShapeBase parent,
CPTYPE  type 
)

Enhanced constructor.

Parameters
parentPointer to parent shape
typeConnection point type

◆ wxSFConnectionPoint() [3/4]

wxSFConnectionPoint::wxSFConnectionPoint ( wxSFShapeBase parent,
const wxRealPoint &  relpos,
long  id = -1 
)

Enhanced constructor.

Parameters
parentPointer to parent shape
relposRelative position in percentages
idConnection point ID

◆ wxSFConnectionPoint() [4/4]

wxSFConnectionPoint::wxSFConnectionPoint ( const wxSFConnectionPoint obj)

Copy constructor.

Parameters
objReference to source object

◆ ~wxSFConnectionPoint()

virtual wxSFConnectionPoint::~wxSFConnectionPoint ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ _OnMouseMove()

void wxSFConnectionPoint::_OnMouseMove ( const wxPoint &  pos)
private

Event handler called when the mouse pointer is moving above shape canvas.

Parameters
posCurrent mouse position

◆ Contains()

virtual bool wxSFConnectionPoint::Contains ( const wxPoint &  pos) const
virtual

Find out whether given point is inside the connection point.

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

◆ Draw()

void wxSFConnectionPoint::Draw ( wxDC &  dc)

Draw connection point.

Parameters
dcDevice context where the handle will be drawn

◆ DrawHover()

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

Draw the connection point 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

◆ DrawNormal()

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

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

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

◆ GetConnectionPoint()

wxRealPoint wxSFConnectionPoint::GetConnectionPoint ( ) const

Get absolute position of the connection point.

Returns
Absolute position of the connection point

◆ GetOrthoDirection()

const CPORTHODIR& wxSFConnectionPoint::GetOrthoDirection ( ) const
inline

Get direction of orthogonal line's connection.

Returns
Current direction
See also
CPORTHODIR

◆ GetParentShape()

wxSFShapeBase* wxSFConnectionPoint::GetParentShape ( ) const
inline

Get parent shape.

Returns
Pointer to parent shape

◆ GetRelativePosition()

const wxRealPoint& wxSFConnectionPoint::GetRelativePosition ( ) const
inline

Get relative position of custom connection point.

Returns
Relative position in percentages

◆ GetType()

CPTYPE wxSFConnectionPoint::GetType ( ) const
inline

Get connection point type.

Returns
Connection point type

◆ MarkSerializableDataMembers()

void wxSFConnectionPoint::MarkSerializableDataMembers ( )
private

◆ Refresh()

void wxSFConnectionPoint::Refresh ( )

Refresh (repaint) the dock point.

◆ SetOrthoDirection()

void wxSFConnectionPoint::SetOrthoDirection ( const CPORTHODIR dir)
inline

Set direction of orthogonal line's connection.

Parameters
dirRequired direction
See also
CPORTHODIR

◆ SetParentShape()

void wxSFConnectionPoint::SetParentShape ( wxSFShapeBase parent)
inline

Set parent shape.

Parameters
parentPointer to parent shape

◆ SetRelativePosition()

void wxSFConnectionPoint::SetRelativePosition ( const wxRealPoint &  relpos)
inline

Set relative position of custom connection point.

Parameters
relposRelative position in percetnages

◆ XS_DECLARE_CLONABLE_CLASS()

wxSFConnectionPoint::XS_DECLARE_CLONABLE_CLASS ( wxSFConnectionPoint  )

Friends And Related Function Documentation

◆ wxSFShapeBase

friend class wxSFShapeBase
friend

Member Data Documentation

◆ m_fMouseOver

bool wxSFConnectionPoint::m_fMouseOver
private

◆ m_nOrthoDir

CPORTHODIR wxSFConnectionPoint::m_nOrthoDir
private

◆ m_nRelPosition

wxRealPoint wxSFConnectionPoint::m_nRelPosition
private

◆ m_nType

CPTYPE wxSFConnectionPoint::m_nType
private

◆ m_pParentShape

wxSFShapeBase* wxSFConnectionPoint::m_pParentShape
private

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