Adaptagrams
Public Member Functions | List of all members
Avoid::ConnEnd Class Reference

The ConnEnd class represents different possible endpoints for connectors. More...

#include <connend.h>

Collaboration diagram for Avoid::ConnEnd:
Collaboration graph

Public Member Functions

 ConnEnd (const Point &point)
 Constructs a ConnEnd from a free-floating point. More...
 
 ConnEnd (const Point &point, const ConnDirFlags visDirs)
 Constructs a ConnEnd from a free-floating point as well as a set of flags specifying visibility for this point if it is located inside a shape. More...
 
 ConnEnd (ShapeRef *shapeRef, const unsigned int connectionPinClassID)
 Constructs a ConnEnd attached to one of a particular set of connection pins on a shape. More...
 
 ConnEnd (JunctionRef *junctionRef)
 Constructs a ConnEnd attached to one of the connection pins on a junction. More...
 
ConnEndType type (void) const
 Returns the kind of connection this ConnEnd represents. More...
 
const Point position (void) const
 Returns the position of this connector endpoint. More...
 
ConnDirFlags directions (void) const
 Returns the directions in which this connector endpoint should be given visibility. More...
 
ShapeRefshape (void) const
 Returns the shape this ConnEnd attaches to, or nullptr. More...
 
JunctionRefjunction (void) const
 Returns the junction this ConnEnd attaches to, or nullptr. More...
 
unsigned int pinClassId (void) const
 Returns the pin class ID for a ConnEnd attached to a shape. More...
 

Detailed Description

The ConnEnd class represents different possible endpoints for connectors.

ConnEnds may be free-floating points, points attached to junctions (between multiple connectors), or points attached to shapes (either to the centre of the shape or to particular pin positions on the shape).

Constructor & Destructor Documentation

◆ ConnEnd() [1/4]

Avoid::ConnEnd::ConnEnd ( const Point point)

Constructs a ConnEnd from a free-floating point.

Parameters
[in]pointThe position of the connector endpoint.

◆ ConnEnd() [2/4]

Avoid::ConnEnd::ConnEnd ( const Point point,
const ConnDirFlags  visDirs 
)

Constructs a ConnEnd from a free-floating point as well as a set of flags specifying visibility for this point if it is located inside a shape.

Parameters
[in]pointThe position of the connector endpoint.
[in]visDirsOne or more Avoid::ConnDirFlag options specifying the directions that this point should be given visibility if it is inside a shape. Currently has no effect if outside of shapes.

◆ ConnEnd() [3/4]

Avoid::ConnEnd::ConnEnd ( ShapeRef shapeRef,
const unsigned int  connectionPinClassID 
)

Constructs a ConnEnd attached to one of a particular set of connection pins on a shape.

This is the recommended method for connecting to shapes that may later be moved or resized and for which you don't want to track and specify the connector endpoints yourself. See the ShapeConnectionPin documentation for more information.

If you to just connect to the centre of a shape you should just create a centre connection pin

const unsigned int CENTRE = 1;
new Avoid::ShapeConnectionPin(shapeRef, CENTRE, Avoid::ATTACH_POS_CENTRE, Avoid::ATTACH_POS_CENTRE);

and attach to that with

ConnEnd(shapeRef, CENTRE);

If a pin with the specified pin class ID doesn't exist then you will get a warning and a straight-line path between the source and destination endpoints of the connector will be returned during routing.

Parameters
[in]shapeRefA pointer to the containing shape's ShapeRef.
[in]connectionPinClassIDA non-zero integer denoting the class ID for the set of pins to connect to.

◆ ConnEnd() [4/4]

Avoid::ConnEnd::ConnEnd ( JunctionRef junctionRef)

Constructs a ConnEnd attached to one of the connection pins on a junction.

This is the recommended method for connecting to junctions that may later be moved. See the ShapeConnectionPin documentation for more information.

Parameters
[in]junctionRefA pointer to the containing junction's junctionRef.

Member Function Documentation

◆ directions()

ConnDirFlags Avoid::ConnEnd::directions ( void  ) const

Returns the directions in which this connector endpoint should be given visibility.

Returns
The visibility directions for this connector endpoint.

References Avoid::ShapeConnectionPin::directions().

Here is the call graph for this function:

◆ junction()

JunctionRef * Avoid::ConnEnd::junction ( void  ) const

Returns the junction this ConnEnd attaches to, or nullptr.

Will be valid only if type() == ConnEndJunction.

Returns
The JunctionRef pointer that the ConnEnd attaches to, or nullptr.

◆ pinClassId()

unsigned int Avoid::ConnEnd::pinClassId ( void  ) const

Returns the pin class ID for a ConnEnd attached to a shape.

Will be valid only if type() == ConnEndShapePin.

Returns
An unsigned int representing the pin class ID for the ConnEnd.

◆ position()

const Point Avoid::ConnEnd::position ( void  ) const

Returns the position of this connector endpoint.

Returns
The position of this connector endpoint.

References Avoid::ShapeConnectionPin::position().

Here is the call graph for this function:

◆ shape()

ShapeRef * Avoid::ConnEnd::shape ( void  ) const

Returns the shape this ConnEnd attaches to, or nullptr.

Will be valid only if type() == ConnEndShapePin.

Returns
The ShapeRef pointer that the ConnEnd attaches to, or nullptr.

◆ type()

ConnEndType Avoid::ConnEnd::type ( void  ) const

Returns the kind of connection this ConnEnd represents.

Returns
The ConnEndType represented by this ConnEnd.

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