\doxysection{Component.\+hpp}
\hypertarget{Component_8hpp_source}{}\label{Component_8hpp_source}\index{/home/chr/devel/PhD/Environment/pub/PCBEnv/pcbenv/cxx/Component.hpp@{/home/chr/devel/PhD/Environment/pub/PCBEnv/pcbenv/cxx/Component.hpp}}

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ }
\DoxyCodeLine{00002\ \textcolor{preprocessor}{\#ifndef\ GYM\_PCB\_COMPONENT\_H}}
\DoxyCodeLine{00003\ \textcolor{preprocessor}{\#define\ GYM\_PCB\_COMPONENT\_H}}
\DoxyCodeLine{00004\ }
\DoxyCodeLine{00005\ \textcolor{preprocessor}{\#include\ "{}Py.hpp"{}}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#include\ "{}Object.hpp"{}}}
\DoxyCodeLine{00007\ \textcolor{preprocessor}{\#include\ "{}Color.hpp"{}}}
\DoxyCodeLine{00008\ \textcolor{preprocessor}{\#include\ <map>}}
\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ <set>}}
\DoxyCodeLine{00010\ \textcolor{preprocessor}{\#include\ <string>}}
\DoxyCodeLine{00011\ \textcolor{preprocessor}{\#include\ <vector>}}
\DoxyCodeLine{00012\ }
\DoxyCodeLine{00013\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classCloneEnv}{CloneEnv}};}
\DoxyCodeLine{00014\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classPin}{Pin}};}
\DoxyCodeLine{00015\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classConnection}{Connection}};}
\DoxyCodeLine{00016\ }
\DoxyCodeLine{00017\ \textcolor{keyword}{class\ }Component\ :\ \textcolor{keyword}{public}\ Object}
\DoxyCodeLine{00018\ \{}
\DoxyCodeLine{00019\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00020\ \ \ \ \ Component(\textcolor{keyword}{const}\ std::string\ \&name);}
\DoxyCodeLine{00021\ \ \ \ \ \string~Component();}
\DoxyCodeLine{00022\ \ \ \ \ Object\ *clone(\mbox{\hyperlink{classCloneEnv}{CloneEnv}}\&)\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00023\ }
\DoxyCodeLine{00027\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{classComponent_a10a5dc3d2ca756358e86600e994d818e}{setLocation}}(\textcolor{keyword}{const}\ Point\_2\ \&refPoint,\ \textcolor{keywordtype}{int}\ layer\ =\ 0);}
\DoxyCodeLine{00028\ }
\DoxyCodeLine{00029\ \ \ \ \ \textcolor{keywordtype}{bool}\ isPlaced()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mLayerRange[0]\ >=\ 0;\ \}}
\DoxyCodeLine{00030\ \ \ \ \ \textcolor{keyword}{const}\ Point\_2\&\ getRefPoint()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mRefPoint;\ \}}
\DoxyCodeLine{00031\ }
\DoxyCodeLine{00032\ \ \ \ \ \textcolor{keyword}{const}\ std::vector<Object\ *>\&\ getPins()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ getChildren();\ \}}
\DoxyCodeLine{00033\ \ \ \ \ uint\ numPins()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ numChildren();\ \}}
\DoxyCodeLine{00034\ \ \ \ \ Pin\ *getPin(\textcolor{keyword}{const}\ std::string\ \&name)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00035\ \ \ \ \ Pin\&\ getPin(uint\ i)\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ *mChildren.at(i)-\/>as<Pin>();\ \}}
\DoxyCodeLine{00036\ }
\DoxyCodeLine{00042\ \ \ \ \ \mbox{\hyperlink{classPin}{Pin}}\ *\mbox{\hyperlink{classComponent_a16baebb0f4993352c87ca155af604708}{addPin}}(\textcolor{keyword}{const}\ std::string\ \&name);}
\DoxyCodeLine{00043\ }
\DoxyCodeLine{00048\ \ \ \ \ \mbox{\hyperlink{classPin}{Pin}}\ *\mbox{\hyperlink{classComponent_a8ec44875b057043d1c20f696082750d6}{removeAndDisconnectPin}}(\mbox{\hyperlink{classPin}{Pin}}\&);}
\DoxyCodeLine{00049\ }
\DoxyCodeLine{00053\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{classComponent_ac6a9649f2e6085253457ec41807c1f98}{gatherConnections}}(std::set<Connection\ *>\&)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00054\ }
\DoxyCodeLine{00058\ \ \ \ \ \textcolor{keyword}{static}\ uint\ \mbox{\hyperlink{classComponent_a8b81a57c7b10bcfe3bcead1c758b4c73}{connectivity}}(std::vector<std::pair<Pin\ *,\ Pin\ *>>\&,\ \textcolor{keyword}{const}\ Component\&,\ \textcolor{keyword}{const}\ Component\&);}
\DoxyCodeLine{00059\ }
\DoxyCodeLine{00064\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{classComponent_a23779994bf4a8280a31dc86eb3d4a8c6}{addOccludedObject}}(Object\&)\ \textcolor{keyword}{override};}
\DoxyCodeLine{00065\ }
\DoxyCodeLine{00066\ \ \ \ \ std::string\ str()\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00067\ \ \ \ \ PyObject\ *getPy(uint\ depth)\ \textcolor{keyword}{const\ override};}
\DoxyCodeLine{00068\ }
\DoxyCodeLine{00069\ \ \ \ \ \textcolor{comment}{//\ UI}}
\DoxyCodeLine{00070\ \ \ \ \ \textcolor{keywordtype}{void}\ setColors(\textcolor{keyword}{const}\ \mbox{\hyperlink{classColor}{Color}}\ \&line,\ \textcolor{keyword}{const}\ \mbox{\hyperlink{classColor}{Color}}\ \&fill)\ \{\ mColorLine\ =\ line;\ mColorFill\ =\ fill;\ \}}
\DoxyCodeLine{00071\ }
\DoxyCodeLine{00072\ \ \ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{classColor}{Color}}\&\ getLineColor()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mColorLine;\ \}}
\DoxyCodeLine{00073\ \ \ \ \ \textcolor{keyword}{const}\ Color\&\ getFillColor()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mColorFill;\ \}}
\DoxyCodeLine{00074\ }
\DoxyCodeLine{00075\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00076\ \ \ \ \ Point\_2\ mRefPoint;}
\DoxyCodeLine{00077\ \ \ \ \ std::map<std::string,\ Pin\ *>\ mPinMap;}
\DoxyCodeLine{00078\ \ \ \ \ Color\ mColorLine;}
\DoxyCodeLine{00079\ \ \ \ \ Color\ mColorFill;}
\DoxyCodeLine{00080\ \};}
\DoxyCodeLine{00081\ }
\DoxyCodeLine{00082\ \textcolor{keyword}{inline}\ \mbox{\hyperlink{classPin}{Pin}}\ *Component::getPin(\textcolor{keyword}{const}\ std::string\ \&name)\textcolor{keyword}{\ const}}
\DoxyCodeLine{00083\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00084\ \ \ \ \ \textcolor{keyword}{auto}\ I\ =\ mPinMap.find(name);}
\DoxyCodeLine{00085\ \ \ \ \ \textcolor{keywordflow}{if}\ (I\ ==\ mPinMap.end())}
\DoxyCodeLine{00086\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{return}\ 0;}
\DoxyCodeLine{00087\ \ \ \ \ \textcolor{keywordflow}{return}\ I-\/>second;}
\DoxyCodeLine{00088\ \}}
\DoxyCodeLine{00089\ }
\DoxyCodeLine{00090\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ GYM\_PCB\_COMPONENT\_H}}

\end{DoxyCode}
