CODPortComponent Class

class CODPortComponent: public CODPointComponent

A port defines a location on a symbol at which other symbols can be attached. Symbols are attached by creating connections between ports using  CODConnection objects. The connection binds together two ports and maintains the relationship between the two symbols. A port is always owned by exactly one symbol. Ports are components, and therefore can be visible or invisible. Derived port classes must override  CODComponent::OnDraw in order to provide a visual representation of the port.

Defined in: OdPortComp.h

Class Members

 CODPortComponent()

Constructor.

 CODPortComponent(CODSymbolComponent* pOwner)

Constructor.

 CODPortComponent(const CODPortComponent& src)

Copy constructor.

virtual  ~CODPortComponent()

Destructor.

BOOL  Create(const CPoint& ptLocation)

Creates the component and initializes the data members.

CODPortComponent&  operator=(const CODPortComponent& src)

Sets this port equal to the one passed in.

virtual CODComponent*  Dup() const

Creates a new copy of this port.

CODSymbolComponent* m_pOwner

A pointer to the symbol which owns this port.

BOOL m_bAttachAtPerimeter

Indicates if symbols linking to this port can cross or overlap the bounds of the owner symbol.

CODSymbolComponent*  GetOwner()

Get pointer to symbol that owns this port.

void  SetOwner(CODSymbolComponent* pOwner)

Set pointer to symbol that owns this port.

CPoint  GetLocation() const

Gets the location of the port.

void  SetLocation(const CPoint& ptLocation)

Sets the location of the port.

void  SetPerimeterAttachFlag(const BOOL bAttachAtPerimeter)

Sets flag that indicates if symbols linking to this port can cross or overlap the bounds of the owner symbol.

BOOL  MustAttachAtPerimeter() const

Indicates if symbols linking to this port can cross or overlap the bounds of the owner symbol.

BOOL  AcceptConnection(CODPortComponent* pPort)

Returns boolean that indicates if the port can accept a new connection.

virtual void  OnDraw(CDC* pDC)

Draws the port.

BOOL  HitTest(const CPoint& ptTest, const int nSlop = 0)

Tests to see if the port contains the given point.

virtual void  GetHandles(CODPointArray* pHandleArray, BOOL bVertexHandles = FALSE)

Gets the center points of the control handles. Ports do not have selection handles, so in this case an empty list is returned.

virtual void  Serialize(CArchive& ar)

Serialize the component.