2#ifndef GYM_PCB_COMPONENT_H
3#define GYM_PCB_COMPONENT_H
17class Component :
public Object
20 Component(
const std::string &name);
22 Object *clone(
CloneEnv&)
const override;
29 bool isPlaced()
const {
return mLayerRange[0] >= 0; }
30 const Point_2& getRefPoint()
const {
return mRefPoint; }
32 const std::vector<Object *>& getPins()
const {
return getChildren(); }
33 uint numPins()
const {
return numChildren(); }
34 Pin *getPin(
const std::string &name)
const;
35 Pin& getPin(uint i)
const {
return *mChildren.at(i)->as<Pin>(); }
58 static uint
connectivity(std::vector<std::pair<Pin *, Pin *>>&,
const Component&,
const Component&);
66 std::string str()
const override;
67 PyObject *getPy(uint depth)
const override;
70 void setColors(
const Color &line,
const Color &fill) { mColorLine = line; mColorFill = fill; }
72 const Color& getLineColor()
const {
return mColorLine; }
73 const Color& getFillColor()
const {
return mColorFill; }
77 std::map<std::string, Pin *> mPinMap;
82inline Pin *Component::getPin(
const std::string &name)
const
84 auto I = mPinMap.find(name);
85 if (I == mPinMap.end())
void setLocation(const Point_2 &refPoint, int layer=0)
Pin * addPin(const std::string &name)
void addOccludedObject(Object &) override
static uint connectivity(std::vector< std::pair< Pin *, Pin * > > &, const Component &, const Component &)
Pin * removeAndDisconnectPin(Pin &)
void gatherConnections(std::set< Connection * > &) const
Definition Connection.hpp:17