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

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ }
\DoxyCodeLine{00002\ \textcolor{preprocessor}{\#ifndef\ GYM\_PCB\_NET\_H}}
\DoxyCodeLine{00003\ \textcolor{preprocessor}{\#define\ GYM\_PCB\_NET\_H}}
\DoxyCodeLine{00004\ }
\DoxyCodeLine{00005\ \textcolor{preprocessor}{\#include\ "{}Defs.hpp"{}}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#include\ "{}Color.hpp"{}}}
\DoxyCodeLine{00007\ \textcolor{preprocessor}{\#include\ "{}Connection.hpp"{}}}
\DoxyCodeLine{00008\ \textcolor{preprocessor}{\#include\ "{}Layer.hpp"{}}}
\DoxyCodeLine{00009\ \textcolor{preprocessor}{\#include\ <set>}}
\DoxyCodeLine{00010\ \textcolor{preprocessor}{\#include\ <string>}}
\DoxyCodeLine{00011\ }
\DoxyCodeLine{00012\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classCloneEnv}{CloneEnv}};}
\DoxyCodeLine{00013\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classPCBoard}{PCBoard}};}
\DoxyCodeLine{00014\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classPin}{Pin}};}
\DoxyCodeLine{00015\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classNavGrid}{NavGrid}};}
\DoxyCodeLine{00016\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classTrack}{Track}};}
\DoxyCodeLine{00017\ }
\DoxyCodeLine{00018\ \textcolor{keyword}{class\ }Net}
\DoxyCodeLine{00019\ \{}
\DoxyCodeLine{00020\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00021\ \ \ \ \ Net(\textcolor{keyword}{const}\ std::string\ \&name);}
\DoxyCodeLine{00022\ \ \ \ \ \string~Net();}
\DoxyCodeLine{00023\ \ \ \ \ Net\ *clone(\mbox{\hyperlink{classCloneEnv}{CloneEnv}}\&)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00024\ }
\DoxyCodeLine{00026\ \ \ \ \ \mbox{\hyperlink{classPCBoard}{PCBoard}}\ *\mbox{\hyperlink{classNet_a0cb2a8347480cb56287157a707d8bf4f}{getBoard}}()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mBoard;\ \}}
\DoxyCodeLine{00027\ \ \ \ \ std::string\ name()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mName;\ \}}
\DoxyCodeLine{00028\ \ \ \ \ uint\ id()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mId;\ \}}
\DoxyCodeLine{00029\ \ \ \ \ \textcolor{keyword}{const}\ Color\&\ getColor()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mColor;\ \}}
\DoxyCodeLine{00030\ }
\DoxyCodeLine{00031\ \ \ \ \ \textcolor{keyword}{const}\ std::set<Pin\ *>\&\ getPins()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mPins;\ \}}
\DoxyCodeLine{00032\ \ \ \ \ uint\ numPins()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mPins.size();\ \}}
\DoxyCodeLine{00033\ \ \ \ \ \textcolor{keywordtype}{bool}\ contains(\textcolor{keyword}{const}\ Pin\ *T)\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mPins.find(\textcolor{keyword}{const\_cast<}Pin\ *\textcolor{keyword}{>}(T))\ !=\ mPins.end();\ \}}
\DoxyCodeLine{00034\ \ \ \ \ \textcolor{keywordtype}{bool}\ empty()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mPins.empty();\ \}}
\DoxyCodeLine{00035\ }
\DoxyCodeLine{00036\ \ \ \ \ uint\ numConnections()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mConnections.size();\ \}}
\DoxyCodeLine{00037\ \ \ \ \ \textcolor{keyword}{const}\ std::vector<Connection\ *>\&\ connections()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mConnections;\ \}}
\DoxyCodeLine{00038\ \ \ \ \ Connection\ *connection(uint\ i)\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mConnections.at(i);\ \}}
\DoxyCodeLine{00039\ \ \ \ \ Connection\ *getConnectionBetween(\textcolor{keyword}{const}\ Pin\&,\ \textcolor{keyword}{const}\ Pin\&)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00040\ }
\DoxyCodeLine{00041\ \ \ \ \ \textcolor{comment}{//\ Return\ if\ the\ track\ is\ valid\ for\ this\ net\ (0x1)\ and\ board\ (0x2,\ if\ this\ is\ not\ set\ the\ track\ must\ not\ be\ used).}}
\DoxyCodeLine{00042\ \ \ \ \ uint\ validateTrack(\textcolor{keyword}{const}\ Track\&)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00043\ }
\DoxyCodeLine{00044\ \ \ \ \ Real\ getMinTrackWidth()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mMinTrackWidth;\ \}}
\DoxyCodeLine{00045\ \ \ \ \ Real\ getMinClearance()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mMinClearance;\ \}}
\DoxyCodeLine{00047\ \ \ \ \ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{classNet_ab182740b06ad9c7cd1fd0ae7fecfe3ec}{hasViaExtent}}()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mViaHeight\ !=\ 0;\ \}}
\DoxyCodeLine{00048\ \ \ \ \ uint\ getViaStartLayer()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mViaStartLayer;\ \}}
\DoxyCodeLine{00049\ \ \ \ \ uint\ getViaHeight()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mViaHeight;\ \}}
\DoxyCodeLine{00050\ \ \ \ \ Real\ getViaDiameter()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mViaDiameter;\ \}}
\DoxyCodeLine{00051\ \ \ \ \ \textcolor{keywordtype}{bool}\ buriedViasOK()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mBuriedViasOK;\ \}}
\DoxyCodeLine{00052\ \ \ \ \ uint32\_t\ getLayerMask()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mLayerMask;\ \}}
\DoxyCodeLine{00053\ \ \ \ \ \textcolor{keywordtype}{bool}\ isGroundOrPower()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mSignalType\ \&\ SignalType::POWER\_GROUND;\ \}}
\DoxyCodeLine{00054\ \ \ \ \ \textcolor{keywordtype}{bool}\ isGround()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mSignalType\ ==\ SignalType::GROUND;\ \}}
\DoxyCodeLine{00055\ \ \ \ \ SignalType\ signalType()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mSignalType;\ \}}
\DoxyCodeLine{00056\ }
\DoxyCodeLine{00057\ \ \ \ \ \textcolor{keywordtype}{void}\ insert(Pin\&);}
\DoxyCodeLine{00058\ \ \ \ \ \textcolor{keywordtype}{void}\ remove(Pin\&);}
\DoxyCodeLine{00059\ \ \ \ \ Connection\ *addConnection(Pin\ *sourcePin,\ \textcolor{keyword}{const}\ Point\_25\&\ source,\ Pin\ *targetPin,\ \textcolor{keyword}{const}\ Point\_25\&\ target);}
\DoxyCodeLine{00061\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{classNet_a7c37004c6f41af89c2d2ff7eaa514dda}{autocreateConnections}}();}
\DoxyCodeLine{00062\ \ \ \ \ \textcolor{keywordtype}{void}\ sortConnections();}
\DoxyCodeLine{00063\ }
\DoxyCodeLine{00064\ \ \ \ \ \textcolor{keywordtype}{void}\ setMinTrackWidth(Real);}
\DoxyCodeLine{00065\ \ \ \ \ \textcolor{keywordtype}{void}\ setMinClearance(Real\ c);}
\DoxyCodeLine{00066\ \ \ \ \ \textcolor{keywordtype}{void}\ setViaExtent(uint\ start,\ uint\ h)\ \{\ mViaStartLayer\ =\ start;\ mViaHeight\ =\ h;\ \}}
\DoxyCodeLine{00067\ \ \ \ \ \textcolor{keywordtype}{void}\ setViaDiameter(Real\ d);}
\DoxyCodeLine{00068\ \ \ \ \ \textcolor{keywordtype}{void}\ setLayerMask(uint32\_t\ m);}
\DoxyCodeLine{00069\ \ \ \ \ \textcolor{keywordtype}{void}\ setLayerMaskFromSignalType();}
\DoxyCodeLine{00070\ \ \ \ \ \textcolor{keywordtype}{void}\ setSignalType(SignalType\ t)\ \{\ mSignalType\ =\ t;\ \}}
\DoxyCodeLine{00071\ }
\DoxyCodeLine{00072\ \ \ \ \ \textcolor{keyword}{static}\ SignalType\ getLikelySignalTypeForName(\textcolor{keyword}{const}\ std::string\&);}
\DoxyCodeLine{00073\ }
\DoxyCodeLine{00074\ \ \ \ \ \textcolor{keywordtype}{void}\ setBoard(PCBoard\ *board)\ \{\ mBoard\ =\ board;\ \}}
\DoxyCodeLine{00076\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{classNet_a7b58c028ea883b362ba2a96d04e9808d}{setId}}(uint\ \textcolor{keywordtype}{id});}
\DoxyCodeLine{00077\ \ \ \ \ \textcolor{keywordtype}{void}\ setColor(\textcolor{keyword}{const}\ \mbox{\hyperlink{classColor}{Color}}\ \&c)\ \{\ mColor\ =\ c;\ \}}
\DoxyCodeLine{00079\ \ \ \ \ \textcolor{keywordtype}{void}\ \mbox{\hyperlink{classNet_a36275be8b8dac4390ae741bcc9b9e024}{setColorAuto}}(\textcolor{keywordtype}{bool}\ singleColorPerType\ =\ \textcolor{keyword}{false});}
\DoxyCodeLine{00080\ }
\DoxyCodeLine{00082\ \ \ \ \ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{classNet_afefbb35251b8f46a89bed64bfe994443}{extract}}(\mbox{\hyperlink{classComponent}{Component}}\&);}
\DoxyCodeLine{00084\ \ \ \ \ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{classNet_abf6eca1428d970834cab29633d5948c6}{pruneConnections}}(std::set<Connection\ *>\ \&keep);}
\DoxyCodeLine{00085\ }
\DoxyCodeLine{00086\ \ \ \ \ std::string\ str()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00087\ \ \ \ \ PyObject\ *getConnectionsPy(uint\ depth,\ \textcolor{keywordtype}{bool}\ asNumpy)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00088\ \ \ \ \ PyObject\ *getPinsPy()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00089\ \ \ \ \ PyObject\ *getPy(uint\ depth,\ \textcolor{keywordtype}{bool}\ asNumpy)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00090\ }
\DoxyCodeLine{00091\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00092\ \ \ \ \ std::set<Pin\ *>\ mPins;}
\DoxyCodeLine{00093\ \ \ \ \ std::vector<Connection\ *>\ mConnections;\ \textcolor{comment}{//\ These\ are\ owned\ by\ the\ net!}}
\DoxyCodeLine{00094\ \ \ \ \ \textcolor{keyword}{const}\ std::string\ mName;}
\DoxyCodeLine{00095\ \ \ \ \ \mbox{\hyperlink{classPCBoard}{PCBoard}}\ *mBoard\{0\};}
\DoxyCodeLine{00096\ \ \ \ \ uint\ mId;}
\DoxyCodeLine{00097\ \ \ \ \ uint\ mViaStartLayer\{0\};}
\DoxyCodeLine{00098\ \ \ \ \ uint\ mViaHeight\{0\};}
\DoxyCodeLine{00099\ \ \ \ \ \textcolor{keywordtype}{bool}\ mBuriedViasOK\{\textcolor{keyword}{false}\};}
\DoxyCodeLine{00100\ \ \ \ \ Real\ mViaDiameter\{0.0\};}
\DoxyCodeLine{00101\ \ \ \ \ Real\ mMinTrackWidth\{0.0\};}
\DoxyCodeLine{00102\ \ \ \ \ Real\ mMinClearance\{0.0\};}
\DoxyCodeLine{00103\ \ \ \ \ uint32\_t\ mLayerMask\{0xffffffff\};}
\DoxyCodeLine{00104\ \ \ \ \ Color\ mColor;}
\DoxyCodeLine{00105\ \ \ \ \ SignalType\ mSignalType\{SignalType::ANY\};}
\DoxyCodeLine{00106\ }
\DoxyCodeLine{00107\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00108\ \ \ \ \ \textcolor{keywordtype}{void}\ removeConnectionsWithNonmemberPins();}
\DoxyCodeLine{00109\ \ \ \ \ \textcolor{keywordtype}{void}\ rebuildPinSetFromConnections();}
\DoxyCodeLine{00110\ \};}
\DoxyCodeLine{00111\ }
\DoxyCodeLine{00112\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ GYM\_PCB\_NET\_H}}

\end{DoxyCode}
