Horizon
Public Types | Public Member Functions | Static Public Member Functions | List of all members
PNS::LINE Class Reference
Inheritance diagram for PNS::LINE:
PNS::ITEM

Public Types

typedef std::vector< SEGMENT * > SEGMENT_REFS
 
- Public Types inherited from PNS::ITEM
enum  PnsKind {
  SOLID_T = 1, LINE_T = 2, JOINT_T = 4, SEGMENT_T = 8,
  VIA_T = 16, DIFF_PAIR_T = 32, ANY_T = 0xff
}
 

Supported item types


 

Public Member Functions

 LINE ()
 Constructor Makes an empty line.
 
 LINE (const LINE &aOther)
 
 LINE (const LINE &aBase, const SHAPE_LINE_CHAIN &aLine)
 Constructor Copies properties (net, layers, etc.) from a base line and replaces the shape by another.
 
virtual LINEClone () const override
 Function Clone() More...
 
const LINEoperator= (const LINE &aOther)
 
void SetShape (const SHAPE_LINE_CHAIN &aLine)
 

Assigns a shape to the line (a polyline/line chain)


 
const SHAPEShape () const override
 

Returns the shape of the line


 
SHAPE_LINE_CHAINLine ()
 

Modifiable accessor to the underlying shape


 
const SHAPE_LINE_CHAINCLine () const
 

Const accessor to the underlying shape


 
int SegmentCount () const
 

Returns the number of segments in the line


 
int PointCount () const
 

Returns the number of points in the line


 
const VECTOR2ICPoint (int aIdx) const
 

Returns the aIdx-th point of the line


 
const SEG CSegment (int aIdx) const
 

Returns the aIdx-th segment of the line


 
void SetWidth (int aWidth)
 

Sets line width


 
int Width () const
 

Returns line width


 
bool CompareGeometry (const LINE &aOther)
 

Returns true if the line is geometrically identical as line aOther


 
void Reverse ()
 

Reverses the point/vertex order


 
void LinkSegment (SEGMENT *aSeg)
 

Adds a reference to a segment registered in a NODE that is a part of this line.


 
SEGMENT_REFS & LinkedSegments ()
 

Returns the list of segments from the owning node that constitute this line (or NULL if the line is not linked)


 
bool IsLinked () const
 
bool IsLinkedChecked () const
 
bool ContainsSegment (SEGMENT *aSeg) const
 

Checks if the segment aSeg is a part of the line.


 
SEGMENTGetLink (int aIndex) const
 
void ClearSegmentLinks ()
 

Erases the linking information. Used to detach the line from the owning node.


 
int LinkCount () const
 

Returns the number of segments that were assembled together to form this line.


 
const LINE ClipToNearestObstacle (NODE *aNode) const
 

Clips the line to the nearest obstacle, traversing from the line's start vertex (0).

More...
 
void ClipVertexRange (int aStart, int aEnd)
 

Clips the line to a given range of vertices.


 
int CountCorners (int aAngles) const
 

Returns the number of corners of angles specified by mask aAngles.


 
bool Walkaround (SHAPE_LINE_CHAIN aObstacle, SHAPE_LINE_CHAIN &aPre, SHAPE_LINE_CHAIN &aWalk, SHAPE_LINE_CHAIN &aPost, bool aCw) const
 

Calculates a line thightly wrapping a convex hull of an obstacle object (aObstacle).

More...
 
bool Walkaround (const SHAPE_LINE_CHAIN &aObstacle, SHAPE_LINE_CHAIN &aPath, bool aCw) const
 
bool Is45Degree () const
 
void ShowLinks () const
 

Prints out all linked segments


 
bool EndsWithVia () const
 
void AppendVia (const VIA &aVia)
 
void RemoveVia ()
 
const VIAVia () const
 
virtual void Mark (int aMarker) override
 
virtual void Unmark (int aMarker=-1) override
 
virtual int Marker () const override
 
void DragSegment (const VECTOR2I &aP, int aIndex, int aSnappingThreshold=0, bool aFreeAngle=false)
 
void DragCorner (const VECTOR2I &aP, int aIndex, int aSnappingThreshold=0, bool aFreeAngle=false)
 
void SetRank (int aRank) override
 
int Rank () const override
 
bool HasLoops () const
 
bool HasLockedSegments () const
 
OPT_BOX2I ChangedArea (const LINE *aOther) const
 
- Public Member Functions inherited from PNS::ITEM
 ITEM (PnsKind aKind)
 
 ITEM (const ITEM &aOther)
 
virtual const SHAPE_LINE_CHAIN Hull (int aClearance=0, int aWalkaroundThickness=0) const
 
PnsKind Kind () const
 Function Kind() More...
 
bool OfKind (int aKindMask) const
 Function OfKind() More...
 
const std::string KindStr () const
 Function KindStr() More...
 
void SetParent (const PNS_HORIZON_PARENT_ITEM *aParent)
 Function SetParent() More...
 
auto Parent () const
 Function Parent() More...
 
void SetNet (int aNet)
 Function SetNet() More...
 
int Net () const
 Function Net() More...
 
void SetLayers (const LAYER_RANGE &aLayers)
 Function SetLayers() More...
 
void SetLayer (int aLayer)
 Function SetLayer() More...
 
const LAYER_RANGELayers () const
 Function Layers() More...
 
virtual int Layer () const
 Function Layer() More...
 
bool LayersOverlap (const ITEM *aOther) const
 Function LayersOverlap() More...
 
void SetOwner (NODE *aOwner)
 Functon SetOwner() More...
 
bool BelongsTo (NODE *aNode) const
 Function BelongsTo() More...
 
NODEOwner () const
 Function Owner() More...
 
virtual bool Collide (const ITEM *aOther, int aClearance, bool aNeedMTV, VECTOR2I &aMTV, bool aDifferentNetsOnly=true) const
 Function Collide() More...
 
bool Collide (const ITEM *aOther, int aClearance, bool aDifferentNetsOnly=true) const
 Function Collide() More...
 
virtual VECTOR2I Anchor (int n) const
 
virtual int AnchorCount () const
 
bool IsLocked () const
 
void SetRoutable (bool aRoutable)
 
bool IsRoutable () const
 

Static Public Member Functions

static bool ClassOf (const ITEM *aItem)
 

Additional Inherited Members

- Static Public Attributes inherited from PNS::ITEM
static const int UnusedNet = INT_MAX
 
- Protected Attributes inherited from PNS::ITEM
PnsKind m_kind
 
const PNS_HORIZON_PARENT_ITEMm_parent
 
NODEm_owner
 
LAYER_RANGE m_layers
 
bool m_movable
 
int m_net
 
int m_marker
 
int m_rank
 
bool m_routable
 

Member Function Documentation

◆ ClipToNearestObstacle()

const LINE PNS::LINE::ClipToNearestObstacle ( NODE aNode) const

Clips the line to the nearest obstacle, traversing from the line's start vertex (0).

Returns the clipped line.

◆ Clone()

LINE * PNS::LINE::Clone ( ) const
overridevirtual

Function Clone()

Returns a deep copy of the item

Implements PNS::ITEM.

◆ Walkaround()

bool PNS::LINE::Walkaround ( SHAPE_LINE_CHAIN  aObstacle,
SHAPE_LINE_CHAIN aPre,
SHAPE_LINE_CHAIN aWalk,
SHAPE_LINE_CHAIN aPost,
bool  aCw 
) const

Calculates a line thightly wrapping a convex hull of an obstacle object (aObstacle).

aPrePath = path from origin to the obstacle aWalkaroundPath = path around the obstacle aPostPath = past from obstacle till the end aCW = whether to walk around in clockwise or counter-clockwise direction.


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