\section{lib/neatogen/legal.c File Reference}
\label{legal_8c}\index{lib/neatogen/legal.\-c@{lib/neatogen/legal.\-c}}
{\ttfamily \#include \char`\"{}neato.\-h\char`\"{}}\\*
{\ttfamily \#include \char`\"{}pathutil.\-h\char`\"{}}\\*
{\ttfamily \#include $<$setjmp.\-h$>$}\\*
Include dependency graph for legal.\-c\-:\nopagebreak
\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=350pt]{legal_8c__incl}
\end{center}
\end{figure}
\subsection*{Data Structures}
\begin{DoxyCompactItemize}
\item 
struct {\bf vertex}
\item 
struct {\bf polygon}
\item 
struct {\bf intersection}
\item 
struct {\bf active\-\_\-edge}
\item 
struct {\bf active\-\_\-edge\-\_\-list}
\item 
struct {\bf data}
\end{DoxyCompactItemize}
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define {\bf M\-A\-X\-I\-N\-T\-S}
\item 
\#define {\bf S\-L\-O\-P\-E}(p, q)~( ( ( p.\-y ) -\/ ( q.\-y ) ) / ( ( p.\-x ) -\/ ( q.\-x ) ) )
\item 
\#define {\bf E\-Q\-\_\-\-P\-T}(v, w)~(((v).x == (w).x) \&\& ((v).y == (w).y))
\item 
\#define {\bf after}(v)~(((v)==((v)-\/$>$poly-\/$>$finish))?((v)-\/$>$poly-\/$>$start)\-:((v)+1))
\item 
\#define {\bf prior}(v)~(((v)==((v)-\/$>$poly-\/$>$start))?((v)-\/$>$poly-\/$>$finish)\-:((v)-\/1))
\item 
\#define {\bf I\-N\-B\-O\-X}(p, bb)~((p.\-x $<$= bb.\-U\-R.\-x) \&\& (p.\-x $>$= bb.\-L\-L.\-x) \&\& (p.\-y $<$= bb.\-U\-R.\-y) \&\& (p.\-y $>$= bb.\-L\-L.\-y))
\item 
\#define {\bf N\-E\-S\-T\-E\-D}(a, b)~({\bf I\-N\-B\-O\-X}(a.\-L\-L,b) \&\& {\bf I\-N\-B\-O\-X}(a.\-U\-R,b))
\end{DoxyCompactItemize}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef struct {\bf active\-\_\-edge} {\bf active\-\_\-edge}
\item 
typedef struct {\bf polygon} {\bf polygon}
\item 
typedef struct {\bf active\-\_\-edge\-\_\-list} {\bf active\-\_\-edge\-\_\-list}
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
{\bf int} {\bf Plegal\-\_\-arrangement} ({\bf Ppoly\-\_\-t} $\ast$$\ast$polys, {\bf int} n\-\_\-polys)
\end{DoxyCompactItemize}


\subsection{Macro Definition Documentation}
\index{legal.\-c@{legal.\-c}!after@{after}}
\index{after@{after}!legal.c@{legal.\-c}}
\subsubsection[{after}]{\setlength{\rightskip}{0pt plus 5cm}\#define after(
\begin{DoxyParamCaption}
\item[{}]{v}
\end{DoxyParamCaption}
)~(((v)==((v)-\/$>$poly-\/$>$finish))?((v)-\/$>$poly-\/$>$start)\-:((v)+1))}\label{legal_8c_a5ab998f97c81f839618b74b716411e83}


Definition at line 27 of file legal.\-c.

\index{legal.\-c@{legal.\-c}!E\-Q\-\_\-\-P\-T@{E\-Q\-\_\-\-P\-T}}
\index{E\-Q\-\_\-\-P\-T@{E\-Q\-\_\-\-P\-T}!legal.c@{legal.\-c}}
\subsubsection[{E\-Q\-\_\-\-P\-T}]{\setlength{\rightskip}{0pt plus 5cm}\#define E\-Q\-\_\-\-P\-T(
\begin{DoxyParamCaption}
\item[{}]{v, }
\item[{}]{w}
\end{DoxyParamCaption}
)~(((v).x == (w).x) \&\& ((v).y == (w).y))}\label{legal_8c_af36c7c86530e64bae1826353f3df8f8e}


Definition at line 25 of file legal.\-c.

\index{legal.\-c@{legal.\-c}!I\-N\-B\-O\-X@{I\-N\-B\-O\-X}}
\index{I\-N\-B\-O\-X@{I\-N\-B\-O\-X}!legal.c@{legal.\-c}}
\subsubsection[{I\-N\-B\-O\-X}]{\setlength{\rightskip}{0pt plus 5cm}\#define I\-N\-B\-O\-X(
\begin{DoxyParamCaption}
\item[{}]{p, }
\item[{}]{bb}
\end{DoxyParamCaption}
)~((p.\-x $<$= bb.\-U\-R.\-x) \&\& (p.\-x $>$= bb.\-L\-L.\-x) \&\& (p.\-y $<$= bb.\-U\-R.\-y) \&\& (p.\-y $>$= bb.\-L\-L.\-y))}\label{legal_8c_a21def90732c056eadf2c678f7ddf33f2}


Definition at line 376 of file legal.\-c.

\index{legal.\-c@{legal.\-c}!M\-A\-X\-I\-N\-T\-S@{M\-A\-X\-I\-N\-T\-S}}
\index{M\-A\-X\-I\-N\-T\-S@{M\-A\-X\-I\-N\-T\-S}!legal.c@{legal.\-c}}
\subsubsection[{M\-A\-X\-I\-N\-T\-S}]{\setlength{\rightskip}{0pt plus 5cm}\#define M\-A\-X\-I\-N\-T\-S}\label{legal_8c_a159bf59b3b540a45dfc70f62543332cd}
{\bfseries Value\-:}
\begin{DoxyCode}
10000           \textcolor{comment}{/* modify this line to reflect the max no. of }
\textcolor{comment}{                                   intersections you want reported -- 50000 seems to break the program */}
\end{DoxyCode}


Definition at line 20 of file legal.\-c.



Referenced by Plegal\-\_\-arrangement().

\index{legal.\-c@{legal.\-c}!N\-E\-S\-T\-E\-D@{N\-E\-S\-T\-E\-D}}
\index{N\-E\-S\-T\-E\-D@{N\-E\-S\-T\-E\-D}!legal.c@{legal.\-c}}
\subsubsection[{N\-E\-S\-T\-E\-D}]{\setlength{\rightskip}{0pt plus 5cm}\#define N\-E\-S\-T\-E\-D(
\begin{DoxyParamCaption}
\item[{}]{a, }
\item[{}]{b}
\end{DoxyParamCaption}
)~({\bf I\-N\-B\-O\-X}(a.\-L\-L,b) \&\& {\bf I\-N\-B\-O\-X}(a.\-U\-R,b))}\label{legal_8c_ae4ba2c21add8d521820fc806d3a1b6ee}


Definition at line 377 of file legal.\-c.

\index{legal.\-c@{legal.\-c}!prior@{prior}}
\index{prior@{prior}!legal.c@{legal.\-c}}
\subsubsection[{prior}]{\setlength{\rightskip}{0pt plus 5cm}\#define prior(
\begin{DoxyParamCaption}
\item[{}]{v}
\end{DoxyParamCaption}
)~(((v)==((v)-\/$>$poly-\/$>$start))?((v)-\/$>$poly-\/$>$finish)\-:((v)-\/1))}\label{legal_8c_ae4ecf73f74f739bf42ecd7667655bfed}


Definition at line 28 of file legal.\-c.

\index{legal.\-c@{legal.\-c}!S\-L\-O\-P\-E@{S\-L\-O\-P\-E}}
\index{S\-L\-O\-P\-E@{S\-L\-O\-P\-E}!legal.c@{legal.\-c}}
\subsubsection[{S\-L\-O\-P\-E}]{\setlength{\rightskip}{0pt plus 5cm}\#define S\-L\-O\-P\-E(
\begin{DoxyParamCaption}
\item[{}]{p, }
\item[{}]{q}
\end{DoxyParamCaption}
)~( ( ( p.\-y ) -\/ ( q.\-y ) ) / ( ( p.\-x ) -\/ ( q.\-x ) ) )}\label{legal_8c_acb994ae0cff2f6627a41d3df41895339}


Definition at line 23 of file legal.\-c.



\subsection{Typedef Documentation}
\index{legal.\-c@{legal.\-c}!active\-\_\-edge@{active\-\_\-edge}}
\index{active\-\_\-edge@{active\-\_\-edge}!legal.c@{legal.\-c}}
\subsubsection[{active\-\_\-edge}]{\setlength{\rightskip}{0pt plus 5cm}typedef struct {\bf active\-\_\-edge} {\bf active\-\_\-edge}}\label{legal_8c_a8cce940fccc3eb9e4a44b09326e666b1}


Definition at line 30 of file legal.\-c.

\index{legal.\-c@{legal.\-c}!active\-\_\-edge\-\_\-list@{active\-\_\-edge\-\_\-list}}
\index{active\-\_\-edge\-\_\-list@{active\-\_\-edge\-\_\-list}!legal.c@{legal.\-c}}
\subsubsection[{active\-\_\-edge\-\_\-list}]{\setlength{\rightskip}{0pt plus 5cm}typedef struct {\bf active\-\_\-edge\-\_\-list}  {\bf active\-\_\-edge\-\_\-list}}\label{legal_8c_ade48d3788e8b6a3b05c3a2dbe86df115}
\index{legal.\-c@{legal.\-c}!polygon@{polygon}}
\index{polygon@{polygon}!legal.c@{legal.\-c}}
\subsubsection[{polygon}]{\setlength{\rightskip}{0pt plus 5cm}typedef struct {\bf polygon} {\bf polygon}}\label{legal_8c_a8d513fb6e2630a376152aad9ca7b54d7}


Definition at line 31 of file legal.\-c.



\subsection{Function Documentation}
\index{legal.\-c@{legal.\-c}!Plegal\-\_\-arrangement@{Plegal\-\_\-arrangement}}
\index{Plegal\-\_\-arrangement@{Plegal\-\_\-arrangement}!legal.c@{legal.\-c}}
\subsubsection[{Plegal\-\_\-arrangement}]{\setlength{\rightskip}{0pt plus 5cm}{\bf int} Plegal\-\_\-arrangement (
\begin{DoxyParamCaption}
\item[{{\bf Ppoly\-\_\-t} $\ast$$\ast$}]{polys, }
\item[{{\bf int}}]{n\-\_\-polys}
\end{DoxyParamCaption}
)}\label{legal_8c_a7e945f7ab281dd7194663fdea3c88b15}


Definition at line 412 of file legal.\-c.



References vertex\-::active, polygon\-::bb, polygon\-::finish, boxf\-::\-L\-L, M\-A\-X, M\-A\-X\-D\-O\-U\-B\-L\-E, M\-A\-X\-I\-N\-T\-S, M\-I\-N, N\-\_\-\-G\-N\-E\-W, data\-::npolygons, data\-::nvertices, Ppoly\-\_\-t\-::pn, vertex\-::poly, vertex\-::pos, Ppoly\-\_\-t\-::ps, polygon\-::start, boxf\-::\-U\-R, Pxy\-\_\-t\-::x, pointf\-\_\-s\-::x, Pxy\-\_\-t\-::y, and pointf\-\_\-s\-::y.



Referenced by compound\-Edges().

