150 #include "polyarea.h"
152 #include "strflags.h"
168 #include <boost/math/constants/constants.hpp>
169 #include <boost/polygon/polygon.hpp>
170 #include <boost/foreach.hpp>
171 #include <boost/format.hpp>
172 #include <boost/regex.hpp>
173 #include <boost/lexical_cast.hpp>
174 #include <boost/geometry/geometries/geometries.hpp>
176 #include <boost/geometry.hpp>
177 #include <boost/geometry/geometries/point_xy.hpp>
178 #include <boost/geometry/geometries/polygon.hpp>
181 #define foreach BOOST_FOREACH
184 #define BoxTypePtr BoxType *
187 #define LayerTypePtr LayerType *
190 #define PointTypePtr PointType *
193 #define PolygonTypePtr PolygonType *
195 namespace gtl = boost::polygon;
205 typedef gtl::polygon_traits<b_polygon>::point_type
b_point;
208 typedef gtl::polygon_with_holes_traits<b_polygon>::hole_type
b_hole;
214 const double PI = boost::math::constants::pi<double>();
250 { MakeTopLayer, MakeBottomLayer, MakeBothLayers, MakeSelected, MakeDelete };
272 void Log(
const char *format, ...);
277 #define POLYGON_LP(layer) do { \
278 GList *__iter, *__next; \
280 for (__iter = (layer)->Polygon, __next = g_list_next (__iter); \
282 __iter = __next, __next = g_list_next (__iter), n++) { \
283 PolygonType *polygon = (PolygonType *)__iter->data;
288 #define POLYGONPOINT_LP(polygon) do { \
290 PointTypePtr point; \
291 for (n = (int)((polygon)->PointN) - 1; n != -1; n--) \
293 point = &(polygon)->Points[n]
298 #define VIA_LP(top) do { \
299 GList *__iter, *__next; \
301 for (__iter = (top)->Via, __next = g_list_next (__iter); \
303 __iter = __next, __next = g_list_next (__iter), n++) { \
304 PinType *via = (PinType *)__iter->data;
309 #define LINE_LP(layer) do { \
310 GList *__iter, *__next; \
312 for (__iter = (layer)->Line, __next = g_list_next (__iter); \
314 __iter = __next, __next = g_list_next (__iter), n++) { \
315 LineType *line = (LineType *)__iter->data;
320 #define ELEMENT_LP(top) do { \
321 GList *__iter, *__next; \
323 for (__iter = (top)->Element, __next = g_list_next (__iter); \
325 __iter = __next, __next = g_list_next (__iter), n++) { \
326 ElementType *element = (ElementType *)__iter->data;
331 #define PAD_LP(element) do { \
332 GList *__iter, *__next; \
334 for (__iter = (element)->Pad, __next = g_list_next (__iter); \
336 __iter = __next, __next = g_list_next (__iter), n++) { \
337 PadType *pad = (PadType *)__iter->data;
342 #define PIN_LP(element) do { \
343 GList *__iter, *__next; \
345 for (__iter = (element)->Pin, __next = g_list_next (__iter); \
347 __iter = __next, __next = g_list_next (__iter), n++) { \
348 PinType *pin = (PinType *)__iter->data;
375 long ReadDefault(
string File,
string Key, Coord Default);
383 static void ButtonPress( GtkButton *widget, gpointer data );
386 static void KeyPress( GtkButton *widget, gpointer data );
389 static gboolean UpdateProgress(GtkProgressBar *PB);
392 static void Progress(
float progress,
string Message);
395 static int PercentFill(
double Trace,
double Pitch);
419 Coord x, Coord y, Coord Radius,
int SegmentCount = 24);
423 Coord x0, Coord y0, Coord x1, Coord y1, Coord Thickness);
428 int x0,
int y0,
int x1,
int y1,
int Radius,
int Smoothness);
445 vector<StippledPolygon> CalculateStipples(
447 Coord Trace, Coord Pitch,
int i);
452 LayerTypePtr layer, vector<StippledPolygon> StippledPolygons);
459 void MakeLayer(
int i);
Worker thread for a single layer's stipple processing.
Definition: stipple.hpp:403
const Coord MilToNanometer
Unit translation: 1 mil (1/1000 of an inch) = 254 nanometers.
Definition: stipple.hpp:232
b_polygon_set Overlays
Overlays are solid shadows for lines, vias and pads which from (with clearance) featured borders with...
Definition: stipple.hpp:366
MakeLayers_t MakeLayers
The checkbox translation of the work order.
Definition: stipple.cpp:32
gtl::polygon_with_holes_data< int > b_polygon
A shorthand for a set of coordinates from a boost polygon.
Definition: stipple.hpp:202
Coord ComponentPitch
The pitch size (spacing) to be used on the component layer.
Definition: stipple.cpp:31
b_polygon Outline
Store the perimeter of a stippled region.
Definition: stipple.hpp:358
Coord SolderPitch
The pitch size (spacing) to be used on the solder layer.
Definition: stipple.cpp:31
std::vector< b_polygon > b_polygon_set
A shorthand for a boost collection of polygons.
Definition: stipple.hpp:211
void LayerFactory(int i)
Since Gnome threads can not use a C++ decorated function as an entry point, this serves as a thunk to...
Definition: glue.cpp:66
const string component_stipple
the PCB name of the component stipple layer.
Definition: stipple.hpp:220
bool Cancel
The dialog box is on its own thread, so a cancel request is signaled by setting this variable...
Definition: dialog.cpp:30
Coord ComponentTrace
The size trace to be used in stipples on the component layer.
Definition: stipple.cpp:31
b_polygon_set CutOuts
Cutouts are the holes in the regions.
Definition: stipple.hpp:361
const string component_perimeter
the PCB name of the component perimeter layer.
Definition: stipple.hpp:217
The main user interface.
Definition: stipple.hpp:370
const string solder_stipple
the PCB name of the solder stipple layer.
Definition: stipple.hpp:226
Coord SolderTrace
The size trace to be used in stipples on the solder layer.
Definition: stipple.cpp:31
const double NanometerToMil
Unit translation: 1 nanometer = .00003... mills.
Definition: stipple.hpp:229
void Log(const char *format,...)
A simple log print to stout.
Definition: glue.cpp:54
A single boost polygon with all of it's cutouts.
Definition: stipple.hpp:353
MakeLayers_t
These correspond to the work order filled in by the operator in the dialog.
Definition: stipple.hpp:249
const string solder_perimeter
the PCB name of the sodler perimeter layer.
Definition: stipple.hpp:223
gtl::polygon_traits< b_polygon >::point_type b_point
A shorthand for boost points (coordinates).
Definition: stipple.hpp:205
vector< string > MakeLayerNames
A list of layer names to be stippled.
Definition: stipple.cpp:33
const double PI
Used for rounding edges and drawing approximate circles.
Definition: stipple.hpp:214
gtl::polygon_with_holes_traits< b_polygon >::hole_type b_hole
A shorthand for the boost polygon holes.
Definition: stipple.hpp:208
#define LayerTypePtr
Shorthand for a PCB Layer.
Definition: stipple.hpp:187
void ParameterDialog()
The user interface.
void MakeAllLayers()
Since the dialog runs on the PCB GUI thread, a new spool thread is used to delegate all of the worker...
Definition: glue.cpp:72