26 #include "wx/canvas/settingsdlg.h"
31 #define ID_UNITS 10005
32 #define ID_settings 10010
33 #define ID_displaySettings 10013
34 #define ID_display 10017
35 #define ID_objectThreshold 10018
36 #define ID_TEXTCTRL1 10019
37 #define ID_CHECKBOX1 10020
38 #define ID_TEXTCTRL8 10028
39 #define ID_CHECKBOX4 10038
40 #define ID_PANEL2 10023
41 #define ID_TEXTCTRL2 10021
42 #define ID_TEXTCTRL3 10022
43 #define ID_TEXTCTRL4 10024
44 #define ID_TEXTCTRL9 10029
45 #define ID_TEXTCTRL5 10025
46 #define ID_TEXTCTRL6 10026
47 #define ID_TEXTCTRL7 10027
48 #define ID_CHECKBOX2 10030
49 #define ID_CHECKBOX3 10031
50 #define ID_PANEL1 10032
51 #define ID_TEXTCTRL10 10033
52 #define ID_TEXTCTRL12 10035
53 #define ID_TEXTCTRL11 10034
54 #define ID_TEXTCTRL13 10036
55 #define ID_BUTTON1 10037
56 #define ID_SnapGrid_X 10038
57 #define ID_SnapGrid_Y 10038
71 EVT_CLOSE( a2dSettings::OnCloseWindow )
73 EVT_CHOICE( ID_UNITS, a2dSettings::OnUnitsSelected )
80 a2dSettings::a2dSettings()
99 Create( parent,
id, caption, pos, size, style );
107 bool a2dSettings::Create( wxWindow* parent, wxWindowID
id,
const wxString& caption,
const wxPoint& pos,
const wxSize& size,
long style )
110 SetExtraStyle( wxWS_EX_BLOCK_EVENTS );
111 wxDialog::Create( parent,
id, caption, pos, size, style );
116 GetSizer()->SetSizeHints(
this );
130 return wxDialog::Show( show );
153 m_settingsTabs = NULL;
155 m_displayAberation = NULL;
156 m_objectThreshold = NULL;
157 m_primThreshold = NULL;
158 m_drawRectangle = NULL;
159 m_selectionDistance = NULL;
163 m_roundFactor = NULL;
166 m_maxLineMerge = NULL;
167 m_intersectionGrid = NULL;
168 m_fillRuleWinding = NULL;
173 m_poly2arcAber = NULL;
174 m_arc2polyAber = NULL;
178 void a2dSettings::UpdateEntries()
187 fromMeters = 1 / fromMeters;
204 m_roundFactor->SetValue( number );
206 number.Printf( wxT(
"%ld" ), i );
207 m_intersectionGrid->SetValue( number );
209 m_units->SetStringSelection( unitstr );
221 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer( wxVERTICAL );
222 itemDialog1->SetSizer( itemBoxSizer2 );
224 m_settingsTabs =
new wxNotebook( itemDialog1, ID_settings, wxDefaultPosition, wxDefaultSize, wxBK_DEFAULT );
225 m_settingsTabs->SetHelpText( _(
"settings" ) );
227 m_settingsTabs->SetToolTip( _(
"settings" ) );
228 m_settingsTabs->SetName( _T(
"Settings" ) );
230 m_displaySet =
new wxPanel( m_settingsTabs, ID_displaySettings, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER | wxTAB_TRAVERSAL );
231 m_displaySet->SetHelpText( _(
"displaySettings" ) );
233 m_displaySet->SetToolTip( _(
"displaySettings" ) );
234 m_displaySet->SetName( _T(
"displaySettings" ) );
235 wxBoxSizer* itemBoxSizer5 =
new wxBoxSizer( wxVERTICAL );
236 m_displaySet->SetSizer( itemBoxSizer5 );
238 m_unitsStrings.Add( wxT(
"non" ) );
239 m_unitsStrings.Add( wxT(
"pm" ) );
240 m_unitsStrings.Add( wxT(
"nm" ) );
241 m_unitsStrings.Add( wxT(
"um" ) );
242 m_unitsStrings.Add( wxT(
"mm" ) );
243 m_unitsStrings.Add( wxT(
"cm" ) );
244 m_unitsStrings.Add( wxT(
"dm" ) );
245 m_unitsStrings.Add( wxT(
"m" ) );
246 m_unitsStrings.Add( wxT(
"mil" ) );
247 m_unitsStrings.Add( wxT(
"inch" ) );
248 m_unitsStrings.Add( wxT(
"foot" ) );
250 m_units =
new wxChoice( m_displaySet, ID_UNITS, wxDefaultPosition, wxSize( 60, -1 ), m_unitsStrings, 0 );
251 m_units->SetStringSelection( _(
"um" ) );
252 m_units->SetHelpText( _(
"Units used in document" ) );
254 m_units->SetToolTip( _(
"Units used in document" ) );
255 m_units->SetName( _T(
"Units" ) );
256 itemBoxSizer5->Add( m_units, 0, wxALIGN_LEFT | wxALL, 5 );
258 wxBoxSizer* itemBoxSizer20 =
new wxBoxSizer( wxHORIZONTAL );
259 itemBoxSizer5->Add( itemBoxSizer20, 0, wxALIGN_LEFT | wxALL, 5 );
260 wxStaticText* itemStaticText21 =
new wxStaticText( m_displaySet, wxID_STATIC, _(
"Grid X-Y" ), wxDefaultPosition, wxDefaultSize, 0 );
261 itemStaticText21->SetHelpText( _(
"Canvas grid distance in X and Y in meters, e.g. 100 um" ) );
263 itemStaticText21->SetToolTip( _(
"Canvas grid distance in X and Y e.g. 100 um" ) );
264 itemBoxSizer20->Add( itemStaticText21, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
265 m_gridDistX =
new wxTextCtrl( m_displaySet, ID_SnapGrid_X, _T(
"" ), wxDefaultPosition, wxSize( 60, -1 ), wxTE_PROCESS_ENTER );
266 itemBoxSizer20->Add( m_gridDistX, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
267 m_gridDistY =
new wxTextCtrl( m_displaySet, ID_SnapGrid_Y, _T(
"" ), wxDefaultPosition, wxSize( 60, -1 ), wxTE_PROCESS_ENTER );
268 itemBoxSizer20->Add( m_gridDistY, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
270 wxBoxSizer* itemBoxSizer6 =
new wxBoxSizer( wxHORIZONTAL );
271 itemBoxSizer5->Add( itemBoxSizer6, 0, wxALIGN_LEFT | wxALL, 5 );
272 m_displayAberation =
new wxTextCtrl( m_displaySet, ID_display, _(
"-1" ), wxDefaultPosition, wxDefaultSize, 0 );
273 m_displayAberation->SetName( _T(
"displayAberation" ) );
274 itemBoxSizer6->Add( m_displayAberation, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
275 wxStaticText* itemStaticText8 =
new wxStaticText( m_displaySet, wxID_STATIC, _(
"Display aberation" ), wxDefaultPosition, wxDefaultSize, 0 );
276 itemBoxSizer6->Add( itemStaticText8, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
278 wxBoxSizer* itemBoxSizer9 =
new wxBoxSizer( wxHORIZONTAL );
279 itemBoxSizer5->Add( itemBoxSizer9, 0, wxALIGN_LEFT | wxALL, 5 );
280 m_objectThreshold =
new wxTextCtrl( m_displaySet, ID_objectThreshold, _(
"-1" ), wxDefaultPosition, wxDefaultSize, 0 );
281 m_objectThreshold->SetName( _T(
"objectThreshold" ) );
282 itemBoxSizer9->Add( m_objectThreshold, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
284 wxStaticText* itemStaticText11 =
new wxStaticText( m_displaySet, wxID_STATIC, _(
"Object Threshold" ), wxDefaultPosition, wxDefaultSize, 0 );
285 itemStaticText11->SetHelpText( _(
"Object Threshold below this number of pixels no display" ) );
287 itemStaticText11->SetToolTip( _(
"Object Threshold below this number of pixels no display" ) );
288 itemBoxSizer9->Add( itemStaticText11, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
290 wxBoxSizer* itemBoxSizer12 =
new wxBoxSizer( wxHORIZONTAL );
291 itemBoxSizer5->Add( itemBoxSizer12, 0, wxALIGN_LEFT | wxALL, 2 );
292 m_primThreshold =
new wxTextCtrl( m_displaySet, ID_TEXTCTRL1, _(
"-1" ), wxDefaultPosition, wxDefaultSize, 0 );
293 m_primThreshold->SetName( _T(
"primThreshold" ) );
294 itemBoxSizer12->Add( m_primThreshold, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
296 wxStaticText* itemStaticText14 =
new wxStaticText( m_displaySet, wxID_STATIC, _(
"Primitive Threshold" ), wxDefaultPosition, wxDefaultSize, 0 );
297 itemStaticText14->SetHelpText( _(
"Primitive Threshold below this number of pixels no display" ) );
299 itemStaticText14->SetToolTip( _(
"Primitive Threshold below this number of pixels no display" ) );
300 itemBoxSizer12->Add( itemStaticText14, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
302 wxBoxSizer* itemBoxSizer15 =
new wxBoxSizer( wxHORIZONTAL );
303 itemBoxSizer5->Add( itemBoxSizer15, 0, wxALIGN_LEFT | wxALL, 5 );
304 m_drawRectangle =
new wxCheckBox( m_displaySet, ID_CHECKBOX1, _(
"Draw Rectangle" ), wxDefaultPosition, wxDefaultSize, 0 );
305 m_drawRectangle->SetValue(
true );
306 m_drawRectangle->SetHelpText( _(
"Draw Rectangle at threshold of object or primitive" ) );
308 m_drawRectangle->SetToolTip( _(
"Draw Rectangle at threshold of object or primitive" ) );
309 m_drawRectangle->SetName( _T(
"drawRectangle" ) );
310 itemBoxSizer15->Add( m_drawRectangle, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
312 wxBoxSizer* itemBoxSizer17 =
new wxBoxSizer( wxHORIZONTAL );
313 itemBoxSizer5->Add( itemBoxSizer17, 0, wxALIGN_LEFT | wxALL, 2 );
314 m_selectionDistance =
new wxTextCtrl( m_displaySet, ID_TEXTCTRL8, _(
"0" ), wxDefaultPosition, wxDefaultSize, 0 );
315 m_selectionDistance->SetName( _T(
"selectionDistance" ) );
316 itemBoxSizer17->Add( m_selectionDistance, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
318 wxStaticText* itemStaticText19 =
new wxStaticText( m_displaySet, wxID_STATIC, _(
"Selection distance" ), wxDefaultPosition, wxDefaultSize, 0 );
319 itemStaticText19->SetHelpText( _(
"Selection will hit if within this amount of pixels" ) );
321 itemStaticText19->SetToolTip( _(
"Selection will hit if within this amount of pixels" ) );
322 itemBoxSizer17->Add( itemStaticText19, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
324 m_drawOutline =
new wxCheckBox( m_displaySet, ID_CHECKBOX4, _(
"Draw Only Outlines" ), wxDefaultPosition, wxDefaultSize, 0 );
325 m_drawOutline->SetValue(
false );
326 m_drawOutline->SetHelpText( _(
"Draw filled or outline" ) );
328 m_drawOutline->SetToolTip( _(
"Draw filled or outline" ) );
329 m_drawOutline->SetName( _T(
"m_outline" ) );
330 itemBoxSizer5->Add( m_drawOutline, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 );
332 m_settingsTabs->AddPage( m_displaySet, _(
"Display" ) );
334 m_booleanSet =
new wxPanel( m_settingsTabs, ID_PANEL2, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER | wxTAB_TRAVERSAL );
335 wxBoxSizer* itemBoxSizer22 =
new wxBoxSizer( wxVERTICAL );
336 m_booleanSet->SetSizer( itemBoxSizer22 );
338 wxBoxSizer* itemBoxSizer23 =
new wxBoxSizer( wxHORIZONTAL );
339 itemBoxSizer22->Add( itemBoxSizer23, 0, wxALIGN_LEFT | wxALL, 5 );
340 m_snapfactor =
new wxTextCtrl( m_booleanSet, ID_TEXTCTRL2, _(
"-1" ), wxDefaultPosition, wxDefaultSize, 0 );
341 itemBoxSizer23->Add( m_snapfactor, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
343 wxStaticText* itemStaticText25 =
new wxStaticText( m_booleanSet, wxID_STATIC, _(
"Snap Factor" ), wxDefaultPosition, wxDefaultSize, 0 );
344 itemStaticText25->SetHelpText( _(
"Point closer to Segments will be snapped to segment" ) );
346 itemStaticText25->SetToolTip( _(
"Point closer to Segments will be snapped to segment" ) );
347 itemBoxSizer23->Add( itemStaticText25, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
349 wxBoxSizer* itemBoxSizer26 =
new wxBoxSizer( wxHORIZONTAL );
350 itemBoxSizer22->Add( itemBoxSizer26, 0, wxALIGN_LEFT | wxALL, 5 );
351 m_offsetAber =
new wxTextCtrl( m_booleanSet, ID_TEXTCTRL3, _(
"-1" ), wxDefaultPosition, wxDefaultSize, 0 );
352 itemBoxSizer26->Add( m_offsetAber, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
354 wxStaticText* itemStaticText28 =
new wxStaticText( m_booleanSet, wxID_STATIC, _(
"Offset Aberation" ), wxDefaultPosition, wxDefaultSize, 0 );
355 itemStaticText28->SetHelpText( _(
"Correction/Offset arc segments, will deviate this maximal amount" ) );
357 itemStaticText28->SetToolTip( _(
"Correction/Offset arc segments, will deviate this maximal amount" ) );
358 itemBoxSizer26->Add( itemStaticText28, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
360 wxBoxSizer* itemBoxSizer29 =
new wxBoxSizer( wxHORIZONTAL );
361 itemBoxSizer22->Add( itemBoxSizer29, 0, wxALIGN_LEFT | wxALL, 5 );
362 m_roundFactor =
new wxTextCtrl( m_booleanSet, ID_TEXTCTRL4, _(
"1.5" ), wxDefaultPosition, wxDefaultSize, 0 );
363 itemBoxSizer29->Add( m_roundFactor, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
365 wxStaticText* itemStaticText31 =
new wxStaticText( m_booleanSet, wxID_STATIC, _(
"Rounding Factor" ), wxDefaultPosition, wxDefaultSize, 0 );
366 itemStaticText31->SetHelpText( _(
"Offset and path 2 polygon, will use this to define arc or angle at corners" ) );
368 itemStaticText31->SetToolTip( _(
"Offset and path 2 polygon, will use this to define arc or angle at corners" ) );
369 itemBoxSizer29->Add( itemStaticText31, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
371 wxBoxSizer* itemBoxSizer32 =
new wxBoxSizer( wxHORIZONTAL );
372 itemBoxSizer22->Add( itemBoxSizer32, 0, wxALIGN_LEFT | wxALL, 5 );
373 m_offset =
new wxTextCtrl( m_booleanSet, ID_TEXTCTRL9, _(
"0" ), wxDefaultPosition, wxDefaultSize, 0 );
374 itemBoxSizer32->Add( m_offset, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
376 wxStaticText* itemStaticText34 =
new wxStaticText( m_booleanSet, wxID_STATIC, _(
"Offset Amount" ), wxDefaultPosition, wxDefaultSize, 0 );
377 itemStaticText34->SetHelpText( _(
"How far will the offset be from original (neg also possible)" ) );
379 itemStaticText34->SetToolTip( _(
"How far will the offset be from original (neg also possible)" ) );
380 itemBoxSizer32->Add( itemStaticText34, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
382 wxBoxSizer* itemBoxSizer35 =
new wxBoxSizer( wxHORIZONTAL );
383 itemBoxSizer22->Add( itemBoxSizer35, 0, wxALIGN_LEFT | wxALL, 5 );
384 m_smoothAber =
new wxTextCtrl( m_booleanSet, ID_TEXTCTRL5, _(
"0" ), wxDefaultPosition, wxDefaultSize, 0 );
385 itemBoxSizer35->Add( m_smoothAber, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
387 wxStaticText* itemStaticText37 =
new wxStaticText( m_booleanSet, wxID_STATIC, _(
"Smoothing abberation" ), wxDefaultPosition, wxDefaultSize, 0 );
388 itemStaticText37->SetHelpText( _(
"when simplyfying polygons in boolean operation, this is maximal deviation" ) );
390 itemStaticText37->SetToolTip( _(
"when simplyfying polygons in boolean operation, this is maximal deviation" ) );
391 itemBoxSizer35->Add( itemStaticText37, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
393 wxBoxSizer* itemBoxSizer38 =
new wxBoxSizer( wxHORIZONTAL );
394 itemBoxSizer22->Add( itemBoxSizer38, 0, wxALIGN_LEFT | wxALL, 5 );
395 m_maxLineMerge =
new wxTextCtrl( m_booleanSet, ID_TEXTCTRL6, _(
"-1" ), wxDefaultPosition, wxDefaultSize, 0 );
396 itemBoxSizer38->Add( m_maxLineMerge, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
398 wxStaticText* itemStaticText40 =
new wxStaticText( m_booleanSet, wxID_STATIC, _(
"Maximum Line Merge" ), wxDefaultPosition, wxDefaultSize, 0 );
399 itemStaticText40->SetHelpText( _(
"lines to a lenght of this can be combined with other lines" ) );
401 itemStaticText40->SetToolTip( _(
"lines to a lenght of this can be combined with other lines" ) );
402 itemBoxSizer38->Add( itemStaticText40, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
404 wxBoxSizer* itemBoxSizer41 =
new wxBoxSizer( wxHORIZONTAL );
405 itemBoxSizer22->Add( itemBoxSizer41, 0, wxALIGN_LEFT | wxALL, 5 );
406 m_intersectionGrid =
new wxTextCtrl( m_booleanSet, ID_TEXTCTRL7, _(
"100" ), wxDefaultPosition, wxDefaultSize, 0 );
407 itemBoxSizer41->Add( m_intersectionGrid, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
409 wxStaticText* itemStaticText43 =
new wxStaticText( m_booleanSet, wxID_STATIC, _(
"Grid for intersections" ), wxDefaultPosition, wxDefaultSize, 0 );
410 itemStaticText43->SetHelpText( _(
"How accurate will intersections in boolean algorithm be" ) );
412 itemStaticText43->SetToolTip( _(
"How accurate will intersections in boolean algorithm be" ) );
413 itemBoxSizer41->Add( itemStaticText43, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
415 wxBoxSizer* itemBoxSizer44 =
new wxBoxSizer( wxHORIZONTAL );
416 itemBoxSizer22->Add( itemBoxSizer44, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 );
417 m_fillRuleWinding =
new wxCheckBox( m_booleanSet, ID_CHECKBOX2, _(
"Winding Rule" ), wxDefaultPosition, wxDefaultSize, 0 );
418 m_fillRuleWinding->SetValue(
false );
419 m_fillRuleWinding->SetHelpText( _(
"Winding Rule if set else alternate filling" ) );
421 m_fillRuleWinding->SetToolTip( _(
"Winding Rule if set else alternate filling" ) );
422 itemBoxSizer44->Add( m_fillRuleWinding, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
424 m_linkHoles =
new wxCheckBox( m_booleanSet, ID_CHECKBOX3, _(
"Link Holes" ), wxDefaultPosition, wxDefaultSize, 0 );
425 m_linkHoles->SetValue(
false );
426 m_linkHoles->SetHelpText( _(
"connect holes in polygons to outer contour, result is polygon.\nOr use vector path as output." ) );
428 m_linkHoles->SetToolTip( _(
"connect holes in polygons to outer contour, result is polygon.\nOr use vector path as output." ) );
429 itemBoxSizer44->Add( m_linkHoles, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
431 m_settingsTabs->AddPage( m_booleanSet, _(
"Boolean Operations" ) );
433 m_arcpolySet =
new wxPanel( m_settingsTabs, ID_PANEL1, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER | wxTAB_TRAVERSAL );
434 wxBoxSizer* itemBoxSizer48 =
new wxBoxSizer( wxVERTICAL );
435 m_arcpolySet->SetSizer( itemBoxSizer48 );
437 wxBoxSizer* itemBoxSizer49 =
new wxBoxSizer( wxHORIZONTAL );
438 itemBoxSizer48->Add( itemBoxSizer49, 0, wxALIGN_LEFT | wxALL, 5 );
439 m_minRadius =
new wxTextCtrl( m_arcpolySet, ID_TEXTCTRL10, _(
"0" ), wxDefaultPosition, wxDefaultSize, 0 );
440 itemBoxSizer49->Add( m_minRadius, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
442 wxStaticText* itemStaticText51 =
new wxStaticText( m_arcpolySet, wxID_STATIC, _(
"Minimum Radius" ), wxDefaultPosition, wxDefaultSize, 0 );
443 itemStaticText51->SetHelpText( _(
"found arc segments with a radius above this will be converted from polygon" ) );
445 itemStaticText51->SetToolTip( _(
"found arc segments with a radius above this will be converted from polygon" ) );
446 itemBoxSizer49->Add( itemStaticText51, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
448 wxBoxSizer* itemBoxSizer52 =
new wxBoxSizer( wxHORIZONTAL );
449 itemBoxSizer48->Add( itemBoxSizer52, 0, wxALIGN_LEFT | wxALL, 5 );
450 m_maxRadius =
new wxTextCtrl( m_arcpolySet, ID_TEXTCTRL12, _T(
"" ), wxDefaultPosition, wxDefaultSize, 0 );
451 itemBoxSizer52->Add( m_maxRadius, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
453 wxStaticText* itemStaticText54 =
new wxStaticText( m_arcpolySet, wxID_STATIC, _(
"Maximum Radius" ), wxDefaultPosition, wxDefaultSize, 0 );
454 itemStaticText54->SetHelpText( _(
"found arc segments with a radius below this will be converted from polygon" ) );
456 itemStaticText54->SetToolTip( _(
"found arc segments with a radius below this will be converted from polygon" ) );
457 itemBoxSizer52->Add( itemStaticText54, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
459 wxBoxSizer* itemBoxSizer55 =
new wxBoxSizer( wxHORIZONTAL );
460 itemBoxSizer48->Add( itemBoxSizer55, 0, wxALIGN_LEFT | wxALL, 5 );
461 m_poly2arcAber =
new wxTextCtrl( m_arcpolySet, ID_TEXTCTRL11, _T(
"" ), wxDefaultPosition, wxDefaultSize, 0 );
462 itemBoxSizer55->Add( m_poly2arcAber, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
464 wxStaticText* itemStaticText57 =
new wxStaticText( m_arcpolySet, wxID_STATIC, _(
"Conversion Aberration" ), wxDefaultPosition, wxDefaultSize, 0 );
465 itemStaticText57->SetHelpText( _(
"polygon segments must be this close to a perfect arc" ) );
467 itemStaticText57->SetToolTip( _(
"polygon segments must be this close to a perfect arc" ) );
468 itemBoxSizer55->Add( itemStaticText57, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
470 wxStaticLine* itemStaticLine58 =
new wxStaticLine( m_arcpolySet, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
471 itemBoxSizer48->Add( itemStaticLine58, 0, wxGROW | wxALL, 5 );
473 wxBoxSizer* itemBoxSizer59 =
new wxBoxSizer( wxHORIZONTAL );
474 itemBoxSizer48->Add( itemBoxSizer59, 0, wxALIGN_LEFT | wxALL, 5 );
475 m_arc2polyAber =
new wxTextCtrl( m_arcpolySet, ID_TEXTCTRL13, _T(
"" ), wxDefaultPosition, wxDefaultSize, 0 );
476 itemBoxSizer59->Add( m_arc2polyAber, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
478 wxStaticText* itemStaticText61 =
new wxStaticText( m_arcpolySet, wxID_STATIC, _(
"Arc conversion aberration" ), wxDefaultPosition, wxDefaultSize, 0 );
479 itemStaticText61->SetHelpText( _(
"polygon segments will be this close to a perfect arc after conversion" ) );
481 itemStaticText61->SetToolTip( _(
"polygon segments will be this close to a perfect arc after conversion" ) );
482 itemBoxSizer59->Add( itemStaticText61, 0, wxALIGN_CENTER_VERTICAL | wxALL, 2 );
484 m_settingsTabs->AddPage( m_arcpolySet, _(
"arc<=>polygon conversion" ) );
486 itemBoxSizer2->Add( m_settingsTabs, 1, wxGROW | wxALL, 5 );
488 wxButton* itemButton62 =
new wxButton( itemDialog1, ID_BUTTON1, _(
"Apply" ), wxDefaultPosition, wxDefaultSize, 0 );
489 itemButton62->SetHelpText( _(
"Apply settings in current tab" ) );
491 itemButton62->SetToolTip( _(
"Apply settings in current tab" ) );
492 itemBoxSizer2->Add( itemButton62, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 2 );
495 itemButton62->Connect( ID_BUTTON1, wxEVT_LEFT_DOWN, wxMouseEventHandler(
a2dSettings::OnLeftDown ), NULL,
this );
552 wxString unitOfMeasure = m_unitsStrings[m_units->GetSelection()];
559 snapfactor.
Eval( m_snapfactor->GetValue() );
563 smoothAber.
Eval( m_smoothAber->GetValue() );
564 m_habitat->SetBooleanEngineSmoothAber( smoothAber );
569 offsetAber.
Eval( m_offsetAber->GetValue() );
573 offset.
Eval( m_offset->GetValue() );
577 maxLineMerge.
Eval( m_maxLineMerge->GetValue() );
581 minRadius.
Eval( m_minRadius->GetValue() );
585 maxRadius.
Eval( m_maxRadius->GetValue() );
589 aberPolyToArc.
Eval( m_poly2arcAber->GetValue() );
594 aberArcToPoly.
Eval( m_arc2polyAber->GetValue() );
599 m_habitat->SetBooleanEngineLinkHoles( m_linkHoles->GetValue() );
603 if ( m_drawOutline->GetValue() )
609 gridX.
Eval( m_gridDistX->GetValue() );
612 gridY.
Eval( m_gridDistY->GetValue() );
616 void a2dSettings::OnUnitsSelected( wxCommandEvent& event )
636 #define ID_UNITSDOC 10003
654 Create( parent,
id, caption, pos, size, style );
657 bool a2dNewDocumentSize::Create( wxWindow* parent, wxWindowID
id,
const wxString& caption,
const wxPoint& pos,
const wxSize& size,
long style )
659 SetExtraStyle( wxWS_EX_BLOCK_EVENTS );
660 wxDialog::Create( parent,
id, caption, pos, size, style );
665 GetSizer()->SetSizeHints(
this );
686 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer( wxVERTICAL );
687 itemDialog1->SetSizer( itemBoxSizer2 );
689 wxBoxSizer* itemBoxSizer3 =
new wxBoxSizer( wxHORIZONTAL );
690 itemBoxSizer2->Add( itemBoxSizer3, 0, wxALIGN_LEFT | wxALL, 5 );
692 wxStaticText* itemStaticText4 =
new wxStaticText( itemDialog1, wxID_STATIC, _(
"Size in X" ), wxDefaultPosition, wxDefaultSize, 0 );
693 itemBoxSizer3->Add( itemStaticText4, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
695 m_x =
new wxTextCtrl( itemDialog1, ID_X, _(
"1000" ), wxDefaultPosition, wxDefaultSize, 0 );
696 m_x->SetHelpText( _(
"Document size in X" ) );
698 m_x->SetToolTip( _(
"Document size in X" ) );
699 itemBoxSizer3->Add( m_x, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
701 wxBoxSizer* itemBoxSizer6 =
new wxBoxSizer( wxHORIZONTAL );
702 itemBoxSizer2->Add( itemBoxSizer6, 0, wxALIGN_LEFT | wxALL, 5 );
704 wxStaticText* itemStaticText7 =
new wxStaticText( itemDialog1, wxID_STATIC, _(
"Size in Y" ), wxDefaultPosition, wxDefaultSize, 0 );
705 itemBoxSizer6->Add( itemStaticText7, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
707 m_y =
new wxTextCtrl( itemDialog1, ID_Y, _(
"1000" ), wxDefaultPosition, wxDefaultSize, 0 );
708 m_y->SetHelpText( _(
"Document size in Y" ) );
710 m_y->SetToolTip( _(
"Document size in Y" ) );
711 itemBoxSizer6->Add( m_y, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
713 wxBoxSizer* itemBoxSizer9 =
new wxBoxSizer( wxHORIZONTAL );
714 itemBoxSizer2->Add( itemBoxSizer9, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 );
716 wxStaticText* itemStaticText10 =
new wxStaticText( itemDialog1, wxID_STATIC, _(
"Units" ), wxDefaultPosition, wxDefaultSize, 0 );
717 itemBoxSizer9->Add( itemStaticText10, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
719 m_unitsStrings.Add( wxT(
"non" ) );
720 m_unitsStrings.Add( wxT(
"pm" ) );
721 m_unitsStrings.Add( wxT(
"nm" ) );
722 m_unitsStrings.Add( wxT(
"um" ) );
723 m_unitsStrings.Add( wxT(
"mm" ) );
724 m_unitsStrings.Add( wxT(
"cm" ) );
725 m_unitsStrings.Add( wxT(
"dm" ) );
726 m_unitsStrings.Add( wxT(
"m" ) );
727 m_unitsStrings.Add( wxT(
"mil" ) );
728 m_unitsStrings.Add( wxT(
"inch" ) );
729 m_unitsStrings.Add( wxT(
"foot" ) );
731 m_units =
new wxChoice( itemDialog1, ID_UNITSDOC, wxDefaultPosition, wxDefaultSize, m_unitsStrings, 0 );
732 m_units->SetStringSelection( _(
"um" ) );
733 m_units->SetHelpText( _(
"Units used for document" ) );
735 m_units->SetToolTip( _(
"Units used for document" ) );
736 itemBoxSizer9->Add( m_units, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5 );
738 wxButton* itemButton12 =
new wxButton( itemDialog1, ID_oke, _(
"Oke" ), wxDefaultPosition, wxDefaultSize, 0 );
739 itemBoxSizer2->Add( itemButton12, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 5 );
765 wxString unitOfMeasure = m_unitsStrings[m_units->GetSelection()];
770 double a2dNewDocumentSize::GetSizeX()
const
773 sizex.
Eval( m_x->GetValue() );
777 double a2dNewDocumentSize::GetSizeY()
const
780 sizey.
Eval( m_y->GetValue() );
784 wxString a2dNewDocumentSize::GetUnit()
const
786 return m_unitsStrings[m_units->GetSelection()];
Display Part of a a2dDrawing, in which a2dCanvasObjects are shown.
void OnOkeClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_oke
wxString GetValueString() const
get the number 1.1 um -> "1.1 um"
void OnCloseWindow(wxCloseEvent &event)
wxEVT_CLOSE_WINDOW event handler for ID_A2DSETTINGS
~a2dNewDocumentSize()
Destructor.
void SetBooleanEngineCorrectionFactor(const a2dDoMu &aber)
boolean engine setting
void SetGridX(const a2dDoMu &gridX)
grid setting X
void CreateControls()
Creates the controls and sizers.
void SetDocumentDrawStyle(wxUint32 drawstyle)
set drawstyles to use for drawing the document
a2dNewDocumentSize()
Constructors.
void OnXEnter(wxCommandEvent &event)
wxEVT_COMMAND_TEXT_ENTER event handler for ID_X
double GetBooleanEngineRoundfactor() const
boolean engine setting
store and convert number to number with unit and visa versa. e.g. 1.23e-6 => 1.23 * 1e-6 ...
a2dDrawingPart * GetActiveDrawingPart()
return the currently/last active drawing part.
const a2dDoMu & GetRadiusMin() const
Polygon/polyline to Arc Minimum radius to test.
double GetNumber() const
get the number 1.1 um -> 1.1
bool Show(bool show=true)
Show and intialize.
const a2dDoMu & GetBooleanEngineCorrectionAber() const
boolean engine setting
void SetBooleanEngineCorrectionAber(const a2dDoMu &aber)
boolean engine setting
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
bool Eval(const wxString ¶m)
compose a unit based a string "1.1um"
void SetRadiusMax(const a2dDoMu &radiusMax)
Polygon/polyline to Arc Maximum radius to test.
void Init()
Initialises member variables.
void CreateControls()
Creates the controls and sizers.
void OnYEnter(wxCommandEvent &event)
wxEVT_COMMAND_TEXT_ENTER event handler for ID_Y
static bool GetMultiplierFromString(const wxString &mul, double &multi)
calculate how to get to meters from a multiplier string e.g. um => 1e-6
void SetBooleanEngineMaxlinemerge(const a2dDoMu &maxline)
boolean engine setting
static bool ShowToolTips()
Should we show tooltips?
void SetBooleanEngineRoundfactor(double roundfac)
boolean engine setting
void OnLeftDown(wxMouseEvent &event)
wxEVT_LEFT_DOWN event handler for ID_BUTTON1
bool GetBooleanEngineWindingRule() const
boolean engine setting
defines common settinsg for a habitat for a set of a2dCameleons.
bool Create(wxWindow *parent, wxWindowID id=SYMBOL_A2DSETTINGS_IDNAME, const wxString &caption=SYMBOL_A2DSETTINGS_TITLE, const wxPoint &pos=SYMBOL_A2DSETTINGS_POSITION, const wxSize &size=SYMBOL_A2DSETTINGS_SIZE, long style=SYMBOL_A2DSETTINGS_STYLE)
Creation.
void SetRadiusMin(const a2dDoMu &radiusMin)
Polygon/polyline to Arc Minimum radius to test.
const a2dDoMu & GetBooleanEngineCorrectionFactor() const
boolean engine setting
void SetBooleanEngineGrid(long grid)
boolean engine setting
const a2dDoMu & GetBooleanEngineMarge() const
boolean engine setting
bool Create(wxWindow *parent, wxWindowID id=SYMBOL_A2DNEWDOCUMENTSIZE_IDNAME, const wxString &caption=SYMBOL_A2DNEWDOCUMENTSIZE_TITLE, const wxPoint &pos=SYMBOL_A2DNEWDOCUMENTSIZE_POSITION, const wxSize &size=SYMBOL_A2DNEWDOCUMENTSIZE_SIZE, long style=SYMBOL_A2DNEWDOCUMENTSIZE_STYLE)
Creation.
void SetAberPolyToArc(const a2dDoMu &aber)
Polygon/polyline to Arc Maximum abberation.
void SetBooleanEngineMarge(const a2dDoMu &marge)
boolean engine setting
long GetBooleanEngineGrid() const
boolean engine setting
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
wxString GetUnits()
this string defines the unit e.g. meters / inch/ etc.
const a2dDoMu & GetBooleanEngineSmoothAber() const
boolean engine setting
const a2dDoMu & GetRadiusMax() const
Polygon/polyline to Arc Maximum radius to test.
void OnUnitsSelected(wxCommandEvent &event)
wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_UNITS
void SetUnits(const wxString &unitString)
this string defines the unit e.g. meters / inch/ etc.
a2dDrawing * GetDrawing() const
get drawing via top object
void SetGridY(const a2dDoMu &gridY)
grid setting Y
a2dCanvasGlobal * a2dCanvasGlobals
global a2dCanvasGlobal to have easy access to global settings
all headers of the canvas module
static bool ShowToolTips()
Should we show tooltips?
bool GetBooleanEngineLinkHoles() const
boolean engine setting
void Init()
Initialises member variables.
void SetBooleanEngineWindingRule(bool rule)
boolean engine setting
const a2dDoMu & GetAberPolyToArc() const
Polygon/polyline to Arc Maximum abberation.
~a2dSettings()
Destructor.
const a2dDoMu & GetAberArcToPoly() const
Arc to Polygon/polyline Maximum abberation.
const a2dDoMu & GetBooleanEngineMaxlinemerge() const
boolean engine setting
a2dSettings()
Constructors.
void SetAberArcToPoly(const a2dDoMu &aber)
Arc to Polygon/polyline Maximum abberation.