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

VIEWS_API CODPortComponent()

Constructor.

VIEWS_API CODPortComponent(CODSymbolComponent* pOwner)

Constructor.

VIEWS_API CODPortComponent(const CODPortComponent& src)

Copy constructor.

VIEWS_API virtual ~CODPortComponent()

Destructor.

VIEWS_API BOOL Create(const CPoint& ptLocation)

Creates the component and initializes the data members.

VIEWS_API CODPortComponent& operator=(const CODPortComponent& src)

Sets this port equal to the one passed in.

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

VIEWS_API CODSymbolComponent* GetOwner()

Get pointer to symbol that owns this port.

VIEWS_API void SetOwner(CODSymbolComponent* pOwner)

Set pointer to symbol that owns this port.

VIEWS_API CPoint GetLocation() const

Gets the location of the port.

VIEWS_API void SetLocation(const CPoint& ptLocation)

Sets the location of the port.

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

VIEWS_API BOOL MustAttachAtPerimeter() const

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

VIEWS_API BOOL AcceptConnection(CODPortComponent* pPort)

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

VIEWS_API virtual void OnDraw(CDC* pDC)

Draws the port.

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

Tests to see if the port contains the given point.

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

VIEWS_API virtual void Serialize(CArchive& ar)

Serialize the component.