Classes | Macros | Typedefs | Enumerations | Functions | Variables
stipple.hpp File Reference

Data definitions. More...

#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include "config.h"
#include "global.h"
#include "data.h"
#include "macro.h"
#include "create.h"
#include "remove.h"
#include "hid.h"
#include "error.h"
#include "rtree.h"
#include "polygon.h"
#include "polyarea.h"
#include "assert.h"
#include "strflags.h"
#include "find.h"
#include "misc.h"
#include "draw.h"
#include "undo.h"
#include <gtk/gtk.h>
#include <iostream>
#include <fstream>
#include <string>
#include <iterator>
#include <algorithm>
#include <deque>
#include <boost/math/constants/constants.hpp>
#include <boost/polygon/polygon.hpp>
#include <boost/foreach.hpp>
#include <boost/format.hpp>
#include <boost/regex.hpp>
#include <boost/lexical_cast.hpp>
#include <boost/geometry/geometries/geometries.hpp>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include <boost/geometry/geometries/polygon.hpp>

Go to the source code of this file.

Classes

class  StippledPolygon
 A single boost polygon with all of it's cutouts. More...
 
class  StippleDialog
 The main user interface. More...
 
class  Layer
 Worker thread for a single layer's stipple processing. More...
 

Macros

#define foreach   BOOST_FOREACH
 Shorthand for a boost iterator.
 
#define BoxTypePtr   BoxType *
 Shorthand for a PCB Box.
 
#define LayerTypePtr   LayerType *
 Shorthand for a PCB Layer.
 
#define PointTypePtr   PointType *
 Shorthand for a PCB Point.
 
#define PolygonTypePtr   PolygonType *
 Shorthand for a PCB Polygon.
 
#define POLYGON_LP(layer)
 This loop replaces POLYGON_LOOP(layer); The loop had to unrolled from its macro because of the rvalue typecast on pcb_polygon assignment. More...
 
#define POLYGONPOINT_LP(polygon)
 This loop replaces POLYGONPOINT_LOOP(layer); The loop had to unrolled from its macro because of the rvalue typecast on pcb_polygon assignment. More...
 
#define VIA_LP(top)
 This loop replaces VIA_LOOP(layer); The loop had to unrolled from its macro because of the rvalue typecast on pcb_polygon assignment. More...
 
#define LINE_LP(layer)
 This loop replaces LINE_LOOP(layer); The loop had to unrolled from its macro because of the rvalue typecast on pcb_polygon assignment. More...
 
#define ELEMENT_LP(top)
 This loop replaces ELEMENT_LOOP(layer); The loop had to unrolled from its macro because of the rvalue typecast on pcb_polygon assignment. More...
 
#define PAD_LP(element)
 This loop replaces PAD_LOOP(layer); The loop had to unrolled from its macro because of the rvalue typecast on pcb_polygon assignment. More...
 
#define PIN_LP(element)
 This loop replaces PIN_LOOP(layer); The loop had to unrolled from its macro because of the rvalue typecast on pcb_polygon assignment. More...
 

Typedefs

typedef gtl::polygon_with_holes_data< int > b_polygon
 A shorthand for a set of coordinates from a boost polygon.
 
typedef gtl::polygon_traits< b_polygon >::point_type b_point
 A shorthand for boost points (coordinates).
 
typedef gtl::polygon_with_holes_traits< b_polygon >::hole_type b_hole
 A shorthand for the boost polygon holes.
 
typedef std::vector< b_polygonb_polygon_set
 A shorthand for a boost collection of polygons.
 

Enumerations

enum  MakeLayers_t {
  MakeTopLayer, MakeBottomLayer, MakeBothLayers, MakeSelected,
  MakeDelete
}
 These correspond to the work order filled in by the operator in the dialog.
 

Functions

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 layer threads. More...
 
void LayerFactory (int i)
 Since Gnome threads can not use a C++ decorated function as an entry point, this serves as a thunk to the Layer worker class.
 
void Log (const char *format,...)
 A simple log print to stout.
 

Variables

const double PI = boost::math::constants::pi<double>()
 Used for rounding edges and drawing approximate circles.
 
const string component_perimeter = "comp-perim"
 the PCB name of the component perimeter layer.
 
const string component_stipple = "comp-stipple"
 the PCB name of the component stipple layer.
 
const string solder_perimeter = "solder-perim"
 the PCB name of the sodler perimeter layer.
 
const string solder_stipple = "solder-stipple"
 the PCB name of the solder stipple layer.
 
const double NanometerToMil = 3.93700787E10-5
 Unit translation: 1 nanometer = .00003... mills.
 
const Coord MilToNanometer = 254
 Unit translation: 1 mil (1/1000 of an inch) = 254 nanometers.
 
bool Cancel
 The dialog box is on its own thread, so a cancel request is signaled by setting this variable. More...
 
Coord ComponentTrace
 The size trace to be used in stipples on the component layer.
 
Coord SolderTrace
 The size trace to be used in stipples on the solder layer.
 
Coord ComponentPitch
 The pitch size (spacing) to be used on the component layer.
 
Coord SolderPitch
 The pitch size (spacing) to be used on the solder layer.
 
MakeLayers_t MakeLayers
 The checkbox translation of the work order.
 
vector< string > MakeLayerNames
 A list of layer names to be stippled.
 

Detailed Description

Data definitions.

Macro Definition Documentation

#define ELEMENT_LP (   top)
Value:
do { \
GList *__iter, *__next; \
Cardinal n = 0; \
for (__iter = (top)->Element, __next = g_list_next (__iter); \
__iter != NULL; \
__iter = __next, __next = g_list_next (__iter), n++) { \
ElementType *element = (ElementType *)__iter->data;

This loop replaces ELEMENT_LOOP(layer); The loop had to unrolled from its macro because of the rvalue typecast on pcb_polygon assignment.

#define LINE_LP (   layer)
Value:
do { \
GList *__iter, *__next; \
Cardinal n = 0; \
for (__iter = (layer)->Line, __next = g_list_next (__iter); \
__iter != NULL; \
__iter = __next, __next = g_list_next (__iter), n++) { \
LineType *line = (LineType *)__iter->data;

This loop replaces LINE_LOOP(layer); The loop had to unrolled from its macro because of the rvalue typecast on pcb_polygon assignment.

#define PAD_LP (   element)
Value:
do { \
GList *__iter, *__next; \
Cardinal n = 0; \
for (__iter = (element)->Pad, __next = g_list_next (__iter); \
__iter != NULL; \
__iter = __next, __next = g_list_next (__iter), n++) { \
PadType *pad = (PadType *)__iter->data;

This loop replaces PAD_LOOP(layer); The loop had to unrolled from its macro because of the rvalue typecast on pcb_polygon assignment.

#define PIN_LP (   element)
Value:
do { \
GList *__iter, *__next; \
Cardinal n = 0; \
for (__iter = (element)->Pin, __next = g_list_next (__iter); \
__iter != NULL; \
__iter = __next, __next = g_list_next (__iter), n++) { \
PinType *pin = (PinType *)__iter->data;

This loop replaces PIN_LOOP(layer); The loop had to unrolled from its macro because of the rvalue typecast on pcb_polygon assignment.

#define POLYGON_LP (   layer)
Value:
do { \
GList *__iter, *__next; \
Cardinal n = 0; \
for (__iter = (layer)->Polygon, __next = g_list_next (__iter); \
__iter != NULL; \
__iter = __next, __next = g_list_next (__iter), n++) { \
PolygonType *polygon = (PolygonType *)__iter->data;

This loop replaces POLYGON_LOOP(layer); The loop had to unrolled from its macro because of the rvalue typecast on pcb_polygon assignment.

#define POLYGONPOINT_LP (   polygon)
Value:
do { \
int n; \
PointTypePtr point; \
for (n = (int)((polygon)->PointN) - 1; n != -1; n--) \
{ \
point = &(polygon)->Points[n]
#define PointTypePtr
Shorthand for a PCB Point.
Definition: stipple.hpp:190

This loop replaces POLYGONPOINT_LOOP(layer); The loop had to unrolled from its macro because of the rvalue typecast on pcb_polygon assignment.

#define VIA_LP (   top)
Value:
do { \
GList *__iter, *__next; \
Cardinal n = 0; \
for (__iter = (top)->Via, __next = g_list_next (__iter); \
__iter != NULL; \
__iter = __next, __next = g_list_next (__iter), n++) { \
PinType *via = (PinType *)__iter->data;

This loop replaces VIA_LOOP(layer); The loop had to unrolled from its macro because of the rvalue typecast on pcb_polygon assignment.

Function Documentation

void MakeAllLayers ( )

Since the dialog runs on the PCB GUI thread, a new spool thread is used to delegate all of the worker layer threads.

This allows a "cancel" button to remain active in the dialog as the sometimes lengthy stipple threads do their work.

Variable Documentation

bool Cancel

The dialog box is on its own thread, so a cancel request is signaled by setting this variable.