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

\begin{DoxyCode}{0}
\DoxyCodeLine{00001\ \textcolor{preprocessor}{\#ifndef\ GYM\_PCB\_TRACK\_H}}
\DoxyCodeLine{00002\ \textcolor{preprocessor}{\#define\ GYM\_PCB\_TRACK\_H}}
\DoxyCodeLine{00003\ }
\DoxyCodeLine{00004\ \textcolor{preprocessor}{\#include\ "{}AShape.hpp"{}}}
\DoxyCodeLine{00005\ \textcolor{preprocessor}{\#include\ "{}Path.hpp"{}}}
\DoxyCodeLine{00006\ \textcolor{preprocessor}{\#include\ "{}Via.hpp"{}}}
\DoxyCodeLine{00007\ }
\DoxyCodeLine{00008\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classNavGrid}{NavGrid}};}
\DoxyCodeLine{00009\ \textcolor{keyword}{class\ }\mbox{\hyperlink{classConnection}{Connection}};}
\DoxyCodeLine{00010\ }
\DoxyCodeLine{00011\ \textcolor{keyword}{enum\ class}\ ContactType}
\DoxyCodeLine{00012\ \{}
\DoxyCodeLine{00013\ \ \ \ \ NONE\ =\ 0,}
\DoxyCodeLine{00014\ \ \ \ \ END\_TO\_START\ =\ 1,}
\DoxyCodeLine{00015\ \ \ \ \ END\_TO\_END\ =\ 2,}
\DoxyCodeLine{00016\ \ \ \ \ START\_TO\_END\ =\ 3,}
\DoxyCodeLine{00017\ \ \ \ \ START\_TO\_START\ =\ 4}
\DoxyCodeLine{00018\ \};}
\DoxyCodeLine{00019\ }
\DoxyCodeLine{00020\ \textcolor{keyword}{class\ }Track}
\DoxyCodeLine{00021\ \{}
\DoxyCodeLine{00022\ \textcolor{keyword}{public}:}
\DoxyCodeLine{00023\ \ \ \ \ Track(\textcolor{keyword}{const}\ \mbox{\hyperlink{classPoint__25}{Point\_25}}\ \&start)\ :\ mStart(start),\ mEnd(start)\ \{\ \}}
\DoxyCodeLine{00024\ }
\DoxyCodeLine{00025\ \ \ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{classPoint__25}{Point\_25}}\&\ start()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mStart;\ \}}
\DoxyCodeLine{00026\ \ \ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{classPoint__25}{Point\_25}}\&\ end()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mEnd;\ \}}
\DoxyCodeLine{00027\ }
\DoxyCodeLine{00028\ \ \ \ \ \textcolor{keywordtype}{bool}\ empty()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mSegments.empty()\ \&\&\ mVias.empty();\ \}}
\DoxyCodeLine{00029\ }
\DoxyCodeLine{00030\ \ \ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{classWideSegment__25}{WideSegment\_25}}\&\ getSegment(uint\ i)\textcolor{keyword}{\ const\ }\{\ assert(i\ <\ mSegments.size());\ \textcolor{keywordflow}{return}\ mSegments[i];\ \}}
\DoxyCodeLine{00031\ \ \ \ \ \textcolor{keyword}{const}\ std::vector<WideSegment\_25>\&\ getSegments()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mSegments;\ \}}
\DoxyCodeLine{00032\ \ \ \ \ uint\ numSegments()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mSegments.size();\ \}}
\DoxyCodeLine{00033\ \ \ \ \ \textcolor{keywordtype}{bool}\ hasSegments()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ !mSegments.empty();\ \}}
\DoxyCodeLine{00034\ \ \ \ \ \textcolor{keywordtype}{void}\ setSegments(\textcolor{keyword}{const}\ std::vector<Segment\_25>\&);}
\DoxyCodeLine{00035\ \ \ \ \ \textcolor{keywordtype}{void}\ setSegments(\textcolor{keyword}{const}\ std::vector<WideSegment\_25>\&);}
\DoxyCodeLine{00036\ \ \ \ \ \textcolor{keywordtype}{void}\ setSegments(std::vector<WideSegment\_25>\&\&);}
\DoxyCodeLine{00037\ }
\DoxyCodeLine{00038\ \ \ \ \ \textcolor{keyword}{const}\ \mbox{\hyperlink{classVia}{Via}}\&\ getVia(uint\ i)\textcolor{keyword}{\ const\ }\{\ assert(i\ <\ mVias.size());\ \textcolor{keywordflow}{return}\ mVias[i];\ \}}
\DoxyCodeLine{00039\ \ \ \ \ \textcolor{keyword}{const}\ std::vector<Via>\&\ getVias()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mVias;\ \}}
\DoxyCodeLine{00040\ \ \ \ \ uint\ numVias()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mVias.size();\ \}}
\DoxyCodeLine{00041\ \ \ \ \ \textcolor{keywordtype}{bool}\ hasVias()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ !mVias.empty();\ \}}
\DoxyCodeLine{00042\ \ \ \ \ \textcolor{keywordtype}{bool}\ startsWithVia()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00043\ \ \ \ \ \textcolor{keywordtype}{bool}\ endsWithVia()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00044\ \ \ \ \ \textcolor{keywordtype}{bool}\ inferStartsWithVia()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00045\ \ \ \ \ \textcolor{keywordtype}{bool}\ inferEndsWithVia()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00046\ }
\DoxyCodeLine{00047\ \ \ \ \ ContactType\ canAttach(\textcolor{keyword}{const}\ Track\&)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00048\ \ \ \ \ \textcolor{keywordtype}{bool}\ touchesEndToStart(\textcolor{keyword}{const}\ Track\&)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00049\ \ \ \ \ \textcolor{keywordtype}{bool}\ touchesEndToEnd(\textcolor{keyword}{const}\ Track\&)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00050\ \ \ \ \ \textcolor{keywordtype}{bool}\ touchesStartToStart(\textcolor{keyword}{const}\ Track\&)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00051\ \ \ \ \ \textcolor{keywordtype}{bool}\ touchesStartToEnd(\textcolor{keyword}{const}\ Track\&)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00052\ }
\DoxyCodeLine{00053\ \ \ \ \ \textcolor{keywordtype}{void}\ setStart(\textcolor{keyword}{const}\ \mbox{\hyperlink{classPoint__25}{Point\_25}}\&);}
\DoxyCodeLine{00054\ \ \ \ \ \textcolor{keywordtype}{void}\ setEnd(\textcolor{keyword}{const}\ \mbox{\hyperlink{classPoint__25}{Point\_25}}\&);}
\DoxyCodeLine{00055\ \ \ \ \ \textcolor{keywordtype}{void}\ \_setEnd(\textcolor{keyword}{const}\ \mbox{\hyperlink{classPoint__25}{Point\_25}}\ \&v);}
\DoxyCodeLine{00056\ \ \ \ \ \textcolor{keywordtype}{void}\ moveStartTo(\textcolor{keyword}{const}\ \mbox{\hyperlink{classPoint__25}{Point\_25}}\&);}
\DoxyCodeLine{00057\ \ \ \ \ \textcolor{keywordtype}{void}\ moveEndTo(\textcolor{keyword}{const}\ \mbox{\hyperlink{classPoint__25}{Point\_25}}\&);}
\DoxyCodeLine{00058\ \ \ \ \ \textcolor{keywordtype}{void}\ \_setEndLayer(uint);}
\DoxyCodeLine{00059\ \ \ \ \ \textcolor{keywordtype}{void}\ \_setEndLayer(\textcolor{keyword}{const}\ \mbox{\hyperlink{classPoint__25}{Point\_25}}\&);}
\DoxyCodeLine{00060\ \ \ \ \ \textcolor{keywordtype}{void}\ inferStart();}
\DoxyCodeLine{00061\ \ \ \ \ \textcolor{keywordtype}{void}\ inferEnd();}
\DoxyCodeLine{00062\ \ \ \ \ \textcolor{keywordtype}{void}\ inferEndpoints();}
\DoxyCodeLine{00063\ }
\DoxyCodeLine{00064\ \ \ \ \ \textcolor{keywordtype}{void}\ setPath(\textcolor{keyword}{const}\ \mbox{\hyperlink{classPath}{Path}}\&,\ \textcolor{keywordtype}{bool}\ updateStart\ =\ \textcolor{keyword}{false});}
\DoxyCodeLine{00065\ \ \ \ \ \textcolor{keywordtype}{void}\ \_setPath(\textcolor{keyword}{const}\ \mbox{\hyperlink{classPath}{Path}}\&);}
\DoxyCodeLine{00066\ \ \ \ \ \textcolor{keywordtype}{void}\ getPath(\mbox{\hyperlink{classPath}{Path}}\&)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00067\ \ \ \ \ \textcolor{keywordtype}{void}\ setVias(\textcolor{keyword}{const}\ std::vector<Via>\ \&vias)\ \{\ setModified();\ mVias\ =\ vias;\ \}}
\DoxyCodeLine{00068\ \ \ \ \ \textcolor{keywordtype}{void}\ setVias(std::vector<Via>\ \&\&vias)\ \{\ setModified();\ mVias\ =\ std::move(vias);\ \}}
\DoxyCodeLine{00069\ \ \ \ \ \textcolor{keywordtype}{void}\ autocreateVias(\textcolor{keyword}{const}\ \mbox{\hyperlink{classPoint__25}{Point\_25}}\ \&end);}
\DoxyCodeLine{00070\ }
\DoxyCodeLine{00071\ \ \ \ \ \textcolor{keywordtype}{void}\ setModified()\ \{\ mCacheDirty\ =\ \textcolor{keyword}{true};\ \}}
\DoxyCodeLine{00072\ }
\DoxyCodeLine{00073\ \ \ \ \ \textcolor{keywordtype}{void}\ append(\textcolor{keyword}{const}\ Track\&);}
\DoxyCodeLine{00074\ \ \ \ \ \textcolor{keywordtype}{void}\ appendMove(Track\ *);}
\DoxyCodeLine{00075\ \ \ \ \ \textcolor{keywordtype}{void}\ append(\textcolor{keyword}{const}\ \mbox{\hyperlink{classWideSegment__25}{WideSegment\_25}}\&);}
\DoxyCodeLine{00076\ \ \ \ \ \textcolor{keywordtype}{void}\ appendSegment(\textcolor{keyword}{const}\ \mbox{\hyperlink{classPoint__25}{Point\_25}}\&,\ \textcolor{keyword}{const}\ \mbox{\hyperlink{classPoint__25}{Point\_25}}\&);}
\DoxyCodeLine{00077\ \ \ \ \ \textcolor{keywordtype}{void}\ append(\textcolor{keyword}{const}\ \mbox{\hyperlink{classVia}{Via}}\&);}
\DoxyCodeLine{00078\ \ \ \ \ \textcolor{keywordtype}{void}\ appendVia(\textcolor{keyword}{const}\ Point\_2\&,\ uint\ z0,\ uint\ z1,\ Real\ r\ =\ std::numeric\_limits<Real>::quiet\_NaN());}
\DoxyCodeLine{00079\ \ \ \ \ \textcolor{keywordtype}{void}\ prepend(\textcolor{keyword}{const}\ \mbox{\hyperlink{classVia}{Via}}\&);}
\DoxyCodeLine{00080\ \ \ \ \ \mbox{\hyperlink{classVia}{Via}}\ popVia();}
\DoxyCodeLine{00081\ \ \ \ \ \mbox{\hyperlink{classWideSegment__25}{WideSegment\_25}}\ popSegment();}
\DoxyCodeLine{00082\ \ \ \ \ \textcolor{keywordtype}{void}\ popSafe();}
\DoxyCodeLine{00083\ \ \ \ \ \textcolor{keywordtype}{void}\ \_append(\textcolor{keyword}{const}\ \mbox{\hyperlink{classWideSegment__25}{WideSegment\_25}}\&);}
\DoxyCodeLine{00084\ \ \ \ \ \textcolor{keywordtype}{void}\ \_append(\textcolor{keyword}{const}\ \mbox{\hyperlink{classSegment__25}{Segment\_25}}\&);}
\DoxyCodeLine{00085\ \ \ \ \ \textcolor{keywordtype}{void}\ \_appendVia(\textcolor{keyword}{const}\ Point\_2\&,\ uint\ z0,\ uint\ z1,\ Real\ r);}
\DoxyCodeLine{00086\ }
\DoxyCodeLine{00087\ \ \ \ \ \textcolor{keywordtype}{void}\ extendTo(\textcolor{keyword}{const}\ \mbox{\hyperlink{classPoint__25}{Point\_25}}\&,\ uint\ viaLocation);}
\DoxyCodeLine{00088\ \ \ \ \ \textcolor{keywordtype}{void}\ \_extendTo(\textcolor{keyword}{const}\ \mbox{\hyperlink{classPoint__25}{Point\_25}}\&);}
\DoxyCodeLine{00089\ \ \ \ \ \textcolor{keywordtype}{void}\ extendToLayer(uint\ z);}
\DoxyCodeLine{00090\ }
\DoxyCodeLine{00091\ \ \ \ \ \textcolor{keywordtype}{bool}\ isContiguous()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00092\ \ \ \ \ \textcolor{keywordtype}{bool}\ hasValidEnds()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00093\ }
\DoxyCodeLine{00094\ \ \ \ \ \textcolor{keywordtype}{void}\ clear();}
\DoxyCodeLine{00095\ \ \ \ \ Real\ reduceBy\_cells(Real\ len\_cells,\ \textcolor{keyword}{const}\ Real\ len\_perLayer,\ \textcolor{keyword}{const}\ Real\ tolerance);}
\DoxyCodeLine{00096\ \ \ \ \ Real\ reduceSegmentsBy\_cells(Real\ len\_cells,\ \textcolor{keyword}{const}\ Real\ tolerance);}
\DoxyCodeLine{00097\ \ \ \ \ Real\ reduceViaBy\_cells(Real\ len\_cells,\ \textcolor{keyword}{const}\ Real\ len\_perLayer,\ \textcolor{keyword}{const}\ Real\ tolerance);}
\DoxyCodeLine{00098\ }
\DoxyCodeLine{00099\ \ \ \ \ \textcolor{keywordtype}{void}\ reverse();}
\DoxyCodeLine{00100\ \ \ \ \ \textcolor{keyword}{static}\ \textcolor{keywordtype}{void}\ \_reverseSegments(std::vector<WideSegment\_25>\&);}
\DoxyCodeLine{00101\ }
\DoxyCodeLine{00102\ \ \ \ \ Real\ defaultWidth()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mWidth;\ \}}
\DoxyCodeLine{00103\ \ \ \ \ Real\ defaultViaDiameter()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mViaDiameter;\ \}}
\DoxyCodeLine{00104\ \ \ \ \ Real\ defaultViaRadius()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mViaDiameter\ *\ 0.5;\ \}}
\DoxyCodeLine{00105\ }
\DoxyCodeLine{00106\ \ \ \ \ \textcolor{keywordtype}{void}\ setDefaultWidth(\textcolor{keywordtype}{float}\ w)\ \{\ mWidth\ =\ w;\ \}}
\DoxyCodeLine{00107\ \ \ \ \ \textcolor{keywordtype}{void}\ setDefaultViaDiameter(Real\ d)\ \{\ mViaDiameter\ =\ d;\ \}}
\DoxyCodeLine{00108\ }
\DoxyCodeLine{00109\ \ \ \ \ Real\ length()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mLength;\ \}}
\DoxyCodeLine{00110\ \ \ \ \ \textcolor{keywordtype}{void}\ computeLength();}
\DoxyCodeLine{00111\ }
\DoxyCodeLine{00112\ \ \ \ \ \textcolor{keywordtype}{void}\ setSegmentCapsMask(uint8\_t\ m)\ \{\ mSegmentCapsMask\ =\ m;\ \}}
\DoxyCodeLine{00113\ \ \ \ \ \textcolor{keywordtype}{bool}\ hasStartCap()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mSegmentCapsMask\ \&\ 0x1;\ \}}
\DoxyCodeLine{00114\ \ \ \ \ \textcolor{keywordtype}{bool}\ hasEndCap()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mSegmentCapsMask\ \&\ 0x2;\ \}}
\DoxyCodeLine{00115\ \ \ \ \ \textcolor{keywordtype}{bool}\ hasSegmentJoints()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mSegmentCapsMask\ \&\ 0x4;\ \}}
\DoxyCodeLine{00116\ }
\DoxyCodeLine{00118\ \ \ \ \ Bbox\_2\ \mbox{\hyperlink{classTrack_a3cf4051119d06cef301be50007d19c0c}{bbox}}(Real\ clearance,\ \textcolor{keywordtype}{int}\ z\ =\ -\/1)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00119\ }
\DoxyCodeLine{00120\ \ \ \ \ \textcolor{keywordtype}{bool}\ snapToStart(\mbox{\hyperlink{classPoint__25}{Point\_25}}\&,\ \textcolor{keyword}{const}\ \mbox{\hyperlink{classPoint__25}{Point\_25}}\&,\ Real\ maxDistance\ =\ 0.0)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00121\ \ \ \ \ \textcolor{keywordtype}{bool}\ snapToEnd(\mbox{\hyperlink{classPoint__25}{Point\_25}}\&,\ \textcolor{keyword}{const}\ \mbox{\hyperlink{classPoint__25}{Point\_25}}\&,\ Real\ maxDistance\ =\ 0.0)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00122\ \ \ \ \ \textcolor{keywordtype}{int}\ snapToEndpoint(\mbox{\hyperlink{classPoint__25}{Point\_25}}\&,\ \textcolor{keyword}{const}\ \mbox{\hyperlink{classPoint__25}{Point\_25}}\&,\ Real\ maxDistance\ =\ 0.0)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00123\ }
\DoxyCodeLine{00124\ \ \ \ \ \textcolor{keywordtype}{void}\ determineForks(std::vector<uint>\ \&indices,\ \textcolor{keyword}{const}\ \mbox{\hyperlink{classConnection}{Connection}}\&);}
\DoxyCodeLine{00125\ \ \ \ \ Real\ shortcutBetween(uint\ sourcePos,\ uint\ targetPos);}
\DoxyCodeLine{00126\ }
\DoxyCodeLine{00128\ \ \ \ \ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{classTrack_a392a64c793034647eb548c3b0a7c12d8}{violatesClearance}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{classPin}{Pin}}\&,\ Real\ clearance,\ \mbox{\hyperlink{classPoint__25}{Point\_25}}\ *\ =\ 0)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00129\ \ \ \ \ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{classTrack_a392a64c793034647eb548c3b0a7c12d8}{violatesClearance}}(\textcolor{keyword}{const}\ Track\&,\ Real\ clearance,\ \mbox{\hyperlink{classPoint__25}{Point\_25}}\ *\ =\ 0)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00130\ \ \ \ \ \textcolor{keywordtype}{bool}\ violatesClearance2D(\textcolor{keyword}{const}\ Track\&,\ Real\ clearance,\ \mbox{\hyperlink{classPoint__25}{Point\_25}}\ *\ =\ 0)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00131\ \ \ \ \ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{classTrack_a392a64c793034647eb548c3b0a7c12d8}{violatesClearance}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{classVia}{Via}}\&,\ Real\ clearance,\ \mbox{\hyperlink{classPoint__25}{Point\_25}}\ *\ =\ 0)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00132\ \ \ \ \ \textcolor{keywordtype}{bool}\ \mbox{\hyperlink{classTrack_a392a64c793034647eb548c3b0a7c12d8}{violatesClearance}}(\textcolor{keyword}{const}\ \mbox{\hyperlink{classWideSegment__25}{WideSegment\_25}}\&,\ Real\ clearance,\ \mbox{\hyperlink{classPoint__25}{Point\_25}}\ *\ =\ 0)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00133\ \ \ \ \ \textcolor{keywordtype}{bool}\ intersects(\textcolor{keyword}{const}\ Bbox\_2\&,\ uint\ zmin,\ uint\ zmax)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00134\ }
\DoxyCodeLine{00135\ \ \ \ \ \textcolor{keywordtype}{bool}\ isRasterized()\textcolor{keyword}{\ const\ }\{\ \textcolor{keywordflow}{return}\ mRasterizedCount\ >\ 0;\ \}}
\DoxyCodeLine{00136\ \ \ \ \ \textcolor{keywordtype}{void}\ resetRasterizedCount()\ \{\ mRasterizedCount\ =\ 0;\ \}}
\DoxyCodeLine{00137\ \ \ \ \ \textcolor{keywordtype}{void}\ addRasterizedCount(\textcolor{keywordtype}{int}\ count)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00138\ \ \ \ \ \textcolor{keywordtype}{bool}\ checkRasterization(\textcolor{keyword}{const}\ NavGrid\&)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00139\ }
\DoxyCodeLine{00140\ \ \ \ \ \textcolor{keywordtype}{bool}\ updateForRemovedLayers(uint\ zmin,\ uint\ zmax);}
\DoxyCodeLine{00141\ }
\DoxyCodeLine{00142\ \ \ \ \ std::string\ str()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00143\ \ \ \ \ \textcolor{keywordtype}{void}\ setPy(PyObject\ *);}
\DoxyCodeLine{00144\ \ \ \ \ PyObject\ *getViasPy()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00145\ \ \ \ \ PyObject\ *getViasNumpy()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00146\ \ \ \ \ PyObject\ *getSegmentsPy()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00147\ \ \ \ \ PyObject\ *getSegmentsNumpy()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00148\ \ \ \ \ PyObject\ *getPathPy()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00149\ \ \ \ \ PyObject\ *getPathNumpy()\ \textcolor{keyword}{const};}
\DoxyCodeLine{00150\ \ \ \ \ PyObject\ *getPy(\textcolor{keywordtype}{bool}\ asNumpy)\ \textcolor{keyword}{const};}
\DoxyCodeLine{00151\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00152\ \ \ \ \ std::vector<WideSegment\_25>\ mSegments;}
\DoxyCodeLine{00153\ \ \ \ \ std::vector<Via>\ mVias;}
\DoxyCodeLine{00154\ \ \ \ \ Point\_25\ mStart;}
\DoxyCodeLine{00155\ \ \ \ \ Point\_25\ mEnd;}
\DoxyCodeLine{00156\ \ \ \ \ Real\ mWidth\{0.0\};}
\DoxyCodeLine{00157\ \ \ \ \ Real\ mViaDiameter\{0.0\};}
\DoxyCodeLine{00158\ \ \ \ \ Real\ mLength\{0.0\};}
\DoxyCodeLine{00159\ \ \ \ \ \textcolor{keyword}{mutable}\ Bbox\_2\ mCachedBbox;}
\DoxyCodeLine{00160\ \ \ \ \ \textcolor{keyword}{mutable}\ \textcolor{keywordtype}{bool}\ mCacheDirty\{\textcolor{keyword}{true}\};}
\DoxyCodeLine{00161\ \ \ \ \ uint8\_t\ mSegmentCapsMask\{0x7\};\ \textcolor{comment}{//\ 0x4|0x2|0x1\ for\ joints|track\ end|track\ start}}
\DoxyCodeLine{00162\ \textcolor{keyword}{private}:}
\DoxyCodeLine{00163\ \ \ \ \ \textcolor{keyword}{mutable}\ \textcolor{keywordtype}{int}\ mRasterizedCount\{0\};}
\DoxyCodeLine{00164\ \};}
\DoxyCodeLine{00165\ }
\DoxyCodeLine{00166\ \textcolor{keyword}{inline}\ \mbox{\hyperlink{classVia}{Via}}\ Track::popVia()}
\DoxyCodeLine{00167\ \{}
\DoxyCodeLine{00168\ \ \ \ \ assert(endsWithVia());}
\DoxyCodeLine{00169\ \ \ \ \ setModified();}
\DoxyCodeLine{00170\ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ via\ =\ mVias.back();}
\DoxyCodeLine{00171\ \ \ \ \ mVias.pop\_back();}
\DoxyCodeLine{00172\ \ \ \ \ mEnd\ =\ hasSegments()\ ?\ mSegments.back().target()\ :\ mStart;}
\DoxyCodeLine{00173\ \ \ \ \ \textcolor{keywordflow}{return}\ via;}
\DoxyCodeLine{00174\ \}}
\DoxyCodeLine{00175\ \textcolor{keyword}{inline}\ \mbox{\hyperlink{classWideSegment__25}{WideSegment\_25}}\ Track::popSegment()}
\DoxyCodeLine{00176\ \{}
\DoxyCodeLine{00177\ \ \ \ \ assert(hasSegments()\ \&\&\ !endsWithVia());}
\DoxyCodeLine{00178\ \ \ \ \ setModified();}
\DoxyCodeLine{00179\ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keyword}{auto}\ s\ =\ mSegments.back();}
\DoxyCodeLine{00180\ \ \ \ \ mSegments.pop\_back();}
\DoxyCodeLine{00181\ \ \ \ \ inferEnd();}
\DoxyCodeLine{00182\ \ \ \ \ mLength\ -\/=\ s.base().length();}
\DoxyCodeLine{00183\ \ \ \ \ \textcolor{keywordflow}{return}\ s;}
\DoxyCodeLine{00184\ \}}
\DoxyCodeLine{00185\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ Track::popSafe()}
\DoxyCodeLine{00186\ \{}
\DoxyCodeLine{00187\ \ \ \ \ \textcolor{keywordflow}{if}\ (endsWithVia())}
\DoxyCodeLine{00188\ \ \ \ \ \ \ \ \ popVia();}
\DoxyCodeLine{00189\ \ \ \ \ \textcolor{keywordflow}{else}\ \textcolor{keywordflow}{if}\ (hasSegments())}
\DoxyCodeLine{00190\ \ \ \ \ \ \ \ \ popSegment();}
\DoxyCodeLine{00191\ \}}
\DoxyCodeLine{00192\ }
\DoxyCodeLine{00193\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ Track::appendMove(\mbox{\hyperlink{classTrack}{Track}}\ *T)}
\DoxyCodeLine{00194\ \{}
\DoxyCodeLine{00195\ \ \ \ \ append(*T);}
\DoxyCodeLine{00196\ \ \ \ \ T-\/>clear();}
\DoxyCodeLine{00197\ \}}
\DoxyCodeLine{00198\ }
\DoxyCodeLine{00199\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ Track::prepend(\textcolor{keyword}{const}\ \mbox{\hyperlink{classVia}{Via}}\ \&v)}
\DoxyCodeLine{00200\ \{}
\DoxyCodeLine{00201\ \ \ \ \ assert(v.contains(mStart));}
\DoxyCodeLine{00202\ \ \ \ \ setModified();}
\DoxyCodeLine{00203\ \ \ \ \ mVias.insert(mVias.begin(),\ v);}
\DoxyCodeLine{00204\ \}}
\DoxyCodeLine{00205\ }
\DoxyCodeLine{00206\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ Track::startsWithVia()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00207\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00208\ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{bool}\ rv\ =\ hasSegments()\ ?\ (mStart.z()\ !=\ mSegments.front().z())\ :\ hasVias();}
\DoxyCodeLine{00209\ \ \ \ \ assert(!rv\ ||\ (hasVias()\ \&\&\ mVias.front().contains(mStart)));}
\DoxyCodeLine{00210\ \ \ \ \ \textcolor{keywordflow}{return}\ rv;}
\DoxyCodeLine{00211\ \}}
\DoxyCodeLine{00212\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{bool}\ Track::endsWithVia()\textcolor{keyword}{\ const}}
\DoxyCodeLine{00213\ \textcolor{keyword}{}\{}
\DoxyCodeLine{00214\ \ \ \ \ \textcolor{keyword}{const}\ \textcolor{keywordtype}{bool}\ rv\ =\ hasSegments()\ ?\ (mEnd.z()\ !=\ mSegments.back().z())\ :\ hasVias();}
\DoxyCodeLine{00215\ \ \ \ \ assert(!rv\ ||\ (hasVias()\ \&\&\ mVias.back().contains(mEnd)));}
\DoxyCodeLine{00216\ \ \ \ \ \textcolor{keywordflow}{return}\ rv;}
\DoxyCodeLine{00217\ \}}
\DoxyCodeLine{00218\ }
\DoxyCodeLine{00219\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ Track::\_setEnd(\textcolor{keyword}{const}\ \mbox{\hyperlink{classPoint__25}{Point\_25}}\ \&v)}
\DoxyCodeLine{00220\ \{}
\DoxyCodeLine{00221\ \ \ \ \ mEnd\ =\ v;}
\DoxyCodeLine{00222\ \}}
\DoxyCodeLine{00223\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ Track::\_setEndLayer(uint\ z)}
\DoxyCodeLine{00224\ \{}
\DoxyCodeLine{00225\ \ \ \ \ mEnd\ =\ Point\_25(mEnd.xy(),\ z);}
\DoxyCodeLine{00226\ \}}
\DoxyCodeLine{00227\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ Track::\_setEndLayer(\textcolor{keyword}{const}\ \mbox{\hyperlink{classPoint__25}{Point\_25}}\ \&v)}
\DoxyCodeLine{00228\ \{}
\DoxyCodeLine{00229\ \ \ \ \ \textcolor{keywordflow}{if}\ (mEnd.xy()\ !=\ v.xy())}
\DoxyCodeLine{00230\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ std::runtime\_error(\textcolor{stringliteral}{"{}track\ end\ does\ not\ match\ specified\ endpoint"{}});}
\DoxyCodeLine{00231\ \ \ \ \ \_setEndLayer(v.z());}
\DoxyCodeLine{00232\ \}}
\DoxyCodeLine{00233\ }
\DoxyCodeLine{00234\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ Track::appendSegment(\textcolor{keyword}{const}\ \mbox{\hyperlink{classPoint__25}{Point\_25}}\ \&v0,\ \textcolor{keyword}{const}\ \mbox{\hyperlink{classPoint__25}{Point\_25}}\ \&v1)}
\DoxyCodeLine{00235\ \{}
\DoxyCodeLine{00236\ \ \ \ \ \textcolor{keywordflow}{if}\ (v0.z()\ ==\ v1.z())}
\DoxyCodeLine{00237\ \ \ \ \ \ \ \ \ \textcolor{keywordflow}{throw}\ std::invalid\_argument(\textcolor{stringliteral}{"{}segment\ points\ must\ be\ on\ the\ same\ layer"{}});}
\DoxyCodeLine{00238\ \ \ \ \ append(WideSegment\_25(v0.xy(),\ v1.xy(),\ v0.z(),\ mWidth\ *\ 0.5));}
\DoxyCodeLine{00239\ \}}
\DoxyCodeLine{00240\ }
\DoxyCodeLine{00241\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ Track::\_append(\textcolor{keyword}{const}\ \mbox{\hyperlink{classWideSegment__25}{WideSegment\_25}}\ \&s)}
\DoxyCodeLine{00242\ \{}
\DoxyCodeLine{00243\ \ \ \ \ setModified();}
\DoxyCodeLine{00244\ \ \ \ \ mSegments.emplace\_back(s);}
\DoxyCodeLine{00245\ \}}
\DoxyCodeLine{00246\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ Track::\_append(\textcolor{keyword}{const}\ \mbox{\hyperlink{classSegment__25}{Segment\_25}}\ \&s)}
\DoxyCodeLine{00247\ \{}
\DoxyCodeLine{00248\ \ \ \ \ setModified();}
\DoxyCodeLine{00249\ \ \ \ \ mSegments.emplace\_back(s,\ mWidth\ *\ 0.5);}
\DoxyCodeLine{00250\ \}}
\DoxyCodeLine{00251\ \textcolor{keyword}{inline}\ \textcolor{keywordtype}{void}\ Track::\_appendVia(\textcolor{keyword}{const}\ Point\_2\ \&c,\ uint\ z0,\ uint\ z1,\ Real\ r)}
\DoxyCodeLine{00252\ \{}
\DoxyCodeLine{00253\ \ \ \ \ setModified();}
\DoxyCodeLine{00254\ \ \ \ \ mVias.emplace\_back(c,\ z0,\ z1,\ r);}
\DoxyCodeLine{00255\ \}}
\DoxyCodeLine{00256\ }
\DoxyCodeLine{00257\ \textcolor{preprocessor}{\#endif\ }\textcolor{comment}{//\ GYM\_PCB\_TRACK\_H}}

\end{DoxyCode}
