27
/************************/
28
/* class ZONE_CONTAINER */
29
/************************/
31
/* handle a list of polygons delimiting a copper zone
32
* a zone is described by a main polygon, a time stamp, a layer and a net name.
33
* others polygons inside this main polygon are holes.
32
* @class ZONE_CONTAINER
33
* Handle a list of polygons delimiting a copper zone a zone is described by a
34
* main polygon, a time stamp, a layer and a net name. Others polygons inside
35
* this main polygon are holes.
37
* Zones can occur on any layer. On some layers, zones have special meanings
41
* Provides copper zones for ground and power planes.
44
* Provides outline of embedded passives.
47
* Provides a general purpose imaging area.
50
* Provides a general purpose imaging area.
53
* Provide outline of board keep-out areas.
56
* Provides a general purpose imaging area.
59
* Provides a general purpose imaging area. This can be used for removal of
60
* primary mask from board edge connectors and removal of primary mask from
61
* around microstrip traces. Because zones on soldermask layers overlap the
62
* zone outline by 1/2 of the line thickness, minimum thickness can be
63
* adjusted to match the primary mask registration tolerance. (This data is
64
* available in the process specification.)
67
* Provides a general purpose imaging area. This can be used for outline of
68
* contact finish areas where multiple immersion finishes are required.
71
* Provides a general purpose imaging area. This can be used for outlining
72
* areas of removable or peelable masks. Because zones on removable mask
73
* layers overlap the zone outlin by 1/2 the line thickness, minimum
74
* thickness can be adjusted to match the removable maks registration
75
* tolerance. (This data is available in the process specification.)
78
* Provides a general purpose imaging area. This can be used for outlining
79
* areas of separate finishes for boards with multiple finishes. This data
80
* is used to provide plots for imaging of resists for applying finishes.
83
* Provides a general purpose imaging area.
86
* Provides a general purpose imaging area. This can be used to apply or
87
* remove solder paste to or from specific areas. It has marginal utility at
88
* the board level. Polylines on modules can be used for the same purpose.
91
* Provides a general purpose imaging area. This can be used to apply or
92
* remove adhesive from specific areas. It has marginal utility at the board
93
* level. Polylines on modules can be used for the same purpose.
96
* Provides outline of general component keep-outs, for example, for
97
* outlining rework areas.
100
* Provides a general purpose drawing capability on component outline
101
* assembly drawings. Zones defined in this layer appear on component
102
* outline assembly drawings.
105
* Provides a general purpose imaging area. This can be used to apply or
106
* remove coatings. Zones defined in this layer appear on coating layer
110
* Provides the ability to describe cutouts and wells not related to a
111
* particular module. Zones defined in this area generate route tool paths
112
* for NC routing files. They can also be used to remove primary mask and
113
* legend. They can also be used to define trace and component keep-out
114
* areas. They can also be used to remove from near board edges. They can
115
* also be used to define hole filling for cutouts and wells.
118
* Provides a general purpose imaging area.
121
* Provides the ability to describe probe keep-out areas. Zones defined in
122
* this area affect accessiblity of probe points in netlist files (IPC-D-356)
123
* and can affect pad-master plots for probe testing (removal of pads in the
124
* inaccessible areas).
127
* Provides the ability to describe test fixture keep-out areas.
130
* Provides a general purpose drawing area.
133
* Provides a general purpose drawing area.
136
* Zones need to be equipped to understand polarity and information layers.
137
* Zones merging need to not merge zones that have a different polarity or
138
* information layer. Also, zones need to display reversed when poliarity is
139
* clear. 2.5D and 3D board imaging needs to be taught polarity and
140
* information layer. To simplify the task (and to simplify plot creation),
141
* only one dark and one clear information layer need be handled initially.
36
143
class ZONE_CONTAINER : public BOARD_CONNECTED_ITEM
145
wxPoint m_CornerPosition; // reference corner position
39
wxString m_Netname; // Net Name
40
CPolyLine* m_Poly; // outlines
41
int m_CornerSelection; // For corner moving, corner index to drag, or -1 if no selection
42
int m_ZoneClearance; // clearance value
43
int m_ZoneMinThickness; // Min thickness value in filled areas
44
int m_FillMode; // How to fillingareas: 0 = use polygonal areas , != 0 fill with segments
45
int m_ArcToSegmentsCount; // number of segments to convert a circle to a polygon
46
// (uses ARC_APPROX_SEGMENTS_COUNT_LOW_DEF or ARC_APPROX_SEGMENTS_COUNT_HIGHT_DEF)
48
int m_ThermalReliefGapValue; // tickness of the gap in thermal reliefs
49
int m_ThermalReliefCopperBridgeValue; // tickness of the copper bridge in thermal reliefs
50
int utility, utility2; // flags used in polygon calculations
51
bool m_IsFilled; // true when a zone was filled, false after deleting the filled areas
52
std::vector <CPolyPt> m_FilledPolysList; /* set of filled polygons used to draw a zone as a filled area.
53
* from outlines (m_Poly) but unlike m_Poly these filled polygons have no hole (they are all in one piece)
54
* In very simple cases m_FilledPolysList is same as m_Poly
55
* In less simple cases (when m_Poly has holes) m_FilledPolysList is a polygon equivalent to m_Poly, without holes
56
* but with extra outline segment connecting "holes" with external main outline
57
* In complex cases an ouline decribed by m_Poly can have many filled areas
59
std::vector <SEGMENT> m_FillSegmList; /* set of segments used to fill area, when fill zone by segment is used.
61
* in this case segments have m_ZoneMinThickness width
147
wxString m_Netname; // Net Name
148
CPolyLine* m_Poly; // outlines
149
int m_CornerSelection; // For corner moving, corner index to drag, or -1 if no selection
150
int m_ZoneClearance; // clearance value
151
int m_ZoneMinThickness; // Min thickness value in filled areas
152
int m_FillMode; // How to fillingareas: 0 = use polygonal areas , != 0 fill with segments
153
int m_ArcToSegmentsCount; // number of segments to convert a circle to a polygon
154
// (uses ARC_APPROX_SEGMENTS_COUNT_LOW_DEF or ARC_APPROX_SEGMENTS_COUNT_HIGHT_DEF)
156
int m_ThermalReliefGapValue; // tickness of the gap in thermal reliefs
157
int m_ThermalReliefCopperBridgeValue; // tickness of the copper bridge in thermal reliefs
158
int utility, utility2; // flags used in polygon calculations
159
bool m_IsFilled; // true when a zone was filled, false after deleting the filled areas
161
/** Set of filled polygons used to draw a zone as a filled area. From
162
* outlines (m_Poly) but unlike m_Poly these filled polygons have no hole
163
* (they are all in one piece) In very simple cases m_FilledPolysList is
164
* same as m_Poly. In less simple cases (when m_Poly has holes),
165
* m_FilledPolysList is a polygon equivalent to m_Poly, without holes but
166
* with extra outline segment connecting "holes" with external main outline
167
* In complex cases an ouline decribed by m_Poly can have many filled
170
std::vector <CPolyPt> m_FilledPolysList;
172
/** set of segments used to fill area, when fill zone by segment is used.
173
* ( m_FillMode == 1 ) in this case segments have m_ZoneMinThickness width
175
std::vector <SEGMENT> m_FillSegmList;
65
177
ZONE_CONTAINER( BOARD* parent );
66
178
~ZONE_CONTAINER();
68
bool Save( FILE* aFile ) const;
69
int ReadDescr( FILE* aFile, int* aLineNum = NULL );
180
/// For processing deferred updates.
181
virtual int Cleanup( int what = -1 );
183
virtual void ProxMapRefresh( void );
71
185
/** virtual function GetPosition
72
186
* @return a wxPoint, position of the first point of the outline
74
wxPoint& GetPosition();
188
virtual wxPoint GetPosition() const;
189
virtual wxPoint GetEndpoint() const;
190
virtual void SetPosition( const wxPoint& aPos );
191
virtual void SetEndpoint( const wxPoint& aPos );
79
* copy usefull data from the source.
80
* flags and linked list pointers are NOT copied
196
* copies usefull data from the source.
197
* Flags and linked list pointers are NOT copied.
82
199
void Copy( ZONE_CONTAINER* src );
84
void DisplayInfo( WinEDA_DrawFrame* frame );
201
virtual double GetItemLength( ) const { return 0.0; }
203
/** Board item identification and information display methods.
205
virtual wxString MenuText( ) const;
206
virtual const char** MenuIcon( ) const;
207
virtual void DisplayInfo( WinEDA_DrawFrame* frame ) const;
210
/** Read and write PCB files: implemented in pcbnew/ioascii.cpp.
213
/// Save this zone container to a PCB file.
214
virtual bool SaveDescr( PCB_File_Context& aFC );
216
/// Create and read a zone container from a PCB file.
217
static ZONE_CONTAINER* ReadDescr( PCB_File_Context& aFC, BOARD* aParent );