PCB Environment 2
Loading...
Searching...
No Matches
Component Class Reference
Inheritance diagram for Component:
Object

Public Member Functions

 Component (const std::string &name)
Objectclone (CloneEnv &) const override
void setLocation (const Point_2 &refPoint, int layer=0)
bool isPlaced () const
const Point_2 & getRefPoint () const
const std::vector< Object * > & getPins () const
uint numPins () const
PingetPin (const std::string &name) const
PingetPin (uint i) const
PinaddPin (const std::string &name)
PinremoveAndDisconnectPin (Pin &)
void gatherConnections (std::set< Connection * > &) const
void addOccludedObject (Object &) override
std::string str () const override
PyObject * getPy (uint depth) const override
void setColors (const Color &line, const Color &fill)
const ColorgetLineColor () const
const ColorgetFillColor () const
Public Member Functions inherited from Object
const std::string & name () const
std::string getFullName () const
uint id () const
void setId (uint id)
bool hasParent () const
ObjectgetParent () const
ObjectgetChildAt (const Point_2 &) const
const std::vector< Object * > & getChildren () const
void addChild (Object &)
uint numChildren () const
bool hasChildren () const
void removeChild (Object &)
const Point_2 & getCenter () const
Point_25 getCenter25 () const
 Layer is set to max(LayerMin, parent.LayerMin) to account for bottom layer thru-hole pins.
const Bbox_2 getBbox () const
void translate (const Vector_2 &)
void transform (const Aff_transformation_2 &)
void rotateAround (const Point_2 &refPoint, Real angleRadians)
bool isOnLayer (int z) const
int minLayer () const
int maxLayer () const
void setLayer (int)
void setLayerRange (int, int)
int getSingleLayer () const
bool sharesLayer (const Object &) const
Real getClearance () const
void setClearance (Real c)
AShapegetShape () const
void setShape (const Circle_2 &)
void setShape (const Triangle_2 &)
void setShape (const Iso_rectangle_2 &)
void setShape (const Polygon_2 &)
void setShape (const WideSegment_25 &, Real angleTolerance=0.0)
void setShape (Polygon_2 &&)
bool canRouteInside () const
void setCanRouteInside (bool b)
bool canPlaceViasInside () const
void setCanPlaceViasInside (bool b)
bool isSelected () const
void setSelected (bool b)
void setSelected (bool b, uint recursion)
bool violatesClearance (const Via &, Real clearance, Point_25 *=0) const
bool violatesClearance (const WideSegment_25 &, Real clearance, Point_25 *=0) const
Real distanceTo (const Point_2 &v) const
bool contains2D (const Point_2 &v) const
bool contains3D (const Point_25 &v) const
bool isInsideBbox (const Point_2 &v) const
bool isInsideBbox (const Point_2 &v, int zmin, int zmax) const
bool intersects (const Bbox_2 &B) const
bool intersects (const WideSegment_25 &s) const
bool intersects (const Object &A) const
bool bboxTest (const Bbox_2 &B)
bool bboxTest (const Bbox_2 &B, int z0, int z1=-1)
bool isContainerOf (const Object &) const
void copyFrom (CloneEnv &, const Object &)
template<typename T>
bool is_a () const
template<typename T>
const T * as () const
template<typename T>
T * as ()

Static Public Member Functions

static uint connectivity (std::vector< std::pair< Pin *, Pin * > > &, const Component &, const Component &)

Additional Inherited Members

Protected Member Functions inherited from Object
 Object (Object *parent, const std::string &name)
Protected Attributes inherited from Object
std::unique_ptr< AShapemShape
Point_2 mCenter
Object *const mParent
std::vector< Object * > mChildren
std::string mName
uint mId
uint mChildIndex {std::numeric_limits<uint>::max()}
int mLayerRange [2] {-1,-1}
Real mClearance {0.0}
bool mCanRouteInside {false}
bool mCanPlaceViasInside {true}
bool mSelectionFlag {false}

Member Function Documentation

◆ addOccludedObject()

void Component::addOccludedObject ( Object & )
overridevirtual

Mark the given object as occluded by this component. At the moment this does only this->setCanRouteInside(true).

Reimplemented from Object.

◆ addPin()

Pin * Component::addPin ( const std::string & name)

Create a new pin with the given name. The pin's layer is initialized to the layer specified in setLocation().

Parameters
namemust be unique or empty (empty names result in "§getNumPins()").

◆ clone()

Object * Component::clone ( CloneEnv & ) const
overridevirtual

Reimplemented from Object.

◆ connectivity()

uint Component::connectivity ( std::vector< std::pair< Pin *, Pin * > > & ,
const Component & ,
const Component &  )
static

Add all pin pairs that are connected between the given components to the vector.

◆ gatherConnections()

void Component::gatherConnections ( std::set< Connection * > & ) const

Add all connections this component's pins participate in to the set.

◆ getPy()

PyObject * Component::getPy ( uint depth) const
overridevirtual

Reimplemented from Object.

◆ removeAndDisconnectPin()

Pin * Component::removeAndDisconnectPin ( Pin & )

Remove a pin from this component and its net.

Returns
pointer to the pin

◆ setLocation()

void Component::setLocation ( const Point_2 & refPoint,
int layer = 0 )

The location is for reference only, pins are not moved.

◆ str()

std::string Component::str ( ) const
overridevirtual

Reimplemented from Object.


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