KiCad PCB EDA Suite
Loading...
Searching...
No Matches
pcbnew/dialogs/dialog_shape_properties.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright (C) 2019 Jean-Pierre Charras jp.charras at wanadoo.fr
5 * Copyright (C) 1992-2023 KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software: you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation, either version 3 of the License, or (at your
10 * option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, you may find one here:
19 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
20 * or you may search the http://www.gnu.org website for the version 2 license,
21 * or you may write to the Free Software Foundation, Inc.,
22 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
23 */
24
25/*
26 * Edit properties of Lines, Circles, Arcs and Polygons for PCBNew and Footprint Editor
27 */
28
29#include <pcb_base_edit_frame.h>
30#include <pcb_edit_frame.h>
31#include <wx/valnum.h>
32#include <board_commit.h>
35#include <tool/tool_manager.h>
36#include <tool/actions.h>
37#include <pcb_shape.h>
38#include <macros.h>
39#include <widgets/unit_binder.h>
40
42#include <tools/drawing_tool.h>
43
44
46{
47public:
50
51private:
52 bool TransferDataToWindow() override;
53 bool TransferDataFromWindow() override;
54
55 void onFilledCheckbox( wxCommandEvent& event ) override;
56
57 void onLayerSelection( wxCommandEvent& event ) override;
58
59 bool Validate() override;
60
61 // Show/hide the widgets used in net selection (shown only for copper layers)
63 {
66 }
67
68
69private:
72
83
85};
86
89 m_parent( aParent ),
90 m_item( aShape ),
91 m_startX( aParent, m_startXLabel, m_startXCtrl, m_startXUnits ),
92 m_startY( aParent, m_startYLabel, m_startYCtrl, m_startYUnits ),
93 m_endX( aParent, m_endXLabel, m_endXCtrl, m_endXUnits ),
94 m_endY( aParent, m_endYLabel, m_endYCtrl, m_endYUnits ),
95 m_thickness( aParent, m_thicknessLabel, m_thicknessCtrl, m_thicknessUnits ),
96 m_segmentLength( aParent, m_segmentLengthLabel, m_segmentLengthCtrl, m_segmentLengthUnits ),
97 m_segmentAngle( aParent, m_segmentAngleLabel, m_segmentAngleCtrl, m_segmentAngleUnits ),
98 m_angle( aParent, m_angleLabel, m_angleCtrl, m_angleUnits ),
99 m_rectangleHeight( aParent, m_rectangleHeightLabel, m_rectangleHeightCtrl, m_rectangleHeightUnits ),
100 m_rectangleWidth( aParent, m_rectangleWidthLabel, m_rectangleWidthCtrl, m_rectangleWidthUnits ),
101 m_bezierCtrl1X( aParent, m_BezierPointC1XLabel, m_BezierC1X_Ctrl, m_BezierPointC1XUnit ),
102 m_bezierCtrl1Y( aParent, m_BezierPointC1YLabel, m_BezierC1Y_Ctrl, m_BezierPointC1YUnit ),
103 m_bezierCtrl2X( aParent, m_BezierPointC2XLabel, m_BezierC2X_Ctrl, m_BezierPointC2XUnit ),
104 m_bezierCtrl2Y( aParent, m_BezierPointC2YLabel, m_BezierC2Y_Ctrl, m_BezierPointC2YUnit ),
105 m_flipStartEnd( false )
106{
107 SetTitle( wxString::Format( GetTitle(), m_item->GetFriendlyName() ) );
108 m_hash_key = TO_UTF8( GetTitle() );
109
110 // Configure display origin transforms
119
120 m_segmentAngle.SetUnits( EDA_UNITS::DEGREES );
122
123 m_angle.SetUnits( EDA_UNITS::DEGREES );
124
125 // Do not allow locking items in the footprint editor
126 m_locked->Show( dynamic_cast<PCB_EDIT_FRAME*>( aParent ) != nullptr );
127
128 // Configure the layers list selector
130 {
131 LSET forbiddenLayers = LSET::ForbiddenFootprintLayers();
132
133 // If someone went to the trouble of setting the layer in a text editor, then there's
134 // very little sense in nagging them about it.
135 forbiddenLayers.set( m_item->GetLayer(), false );
136
138 }
139
140 for( const auto& [ lineStyle, lineStyleDesc ] : lineTypeNames )
141 m_lineStyleCombo->Append( lineStyleDesc.name, KiBitmap( lineStyleDesc.bitmap ) );
142
144
148
149 m_netSelector->SetBoard( aParent->GetBoard() );
150 m_netSelector->SetNetInfo( &aParent->GetBoard()->GetNetInfo() );
151
152 int net = aShape->GetNetCode();
153
154 if( net >= 0 )
155 {
157 }
158 else
159 {
162 }
163
164 if( m_item->GetShape() == SHAPE_T::POLY )
165 m_sizerStartEnd->Show( false );
166
167 // Only a Bezeier curve has control points. So do not show these parameters for other shapes
168 if( m_item->GetShape() != SHAPE_T::BEZIER )
169 m_sizerBezier->Show( false );
170
171 // Only a segment has this format
172 if( m_item->GetShape() != SHAPE_T::SEGMENT )
173 {
174 m_segmentLength.Show( false );
175 m_segmentAngle.Show( false );
176 }
177
178 if( m_item->GetShape() != SHAPE_T::RECTANGLE )
179 {
180 m_rectangleHeight.Show( false );
181 m_rectangleWidth.Show( false );
182 }
183
184 // Only an arc has a angle parameter. So do not show this parameter for other shapes
185 if( m_item->GetShape() != SHAPE_T::ARC )
186 m_angle.Show( false );
187
188 if( m_item->GetShape() == SHAPE_T::ARC || m_item->GetShape() == SHAPE_T::SEGMENT )
189 m_filledCtrl->Show( false );
190
191 // Change texts for circles:
192 if( m_item->GetShape() == SHAPE_T::CIRCLE )
193 {
194 m_startPointLabel->SetLabel( _( "Center Point" ) );
195 m_endPointLabel->SetLabel( _( "Radius" ) );
196
197 m_endXLabel->Show( false );
199 m_endY.Show( false );
200 }
201
203
205
207
208 // Now all widgets have the size fixed, call FinishDialogSettings
210 Layout();
211}
212
213
215{
216 wxCHECK_RET( aShape, wxT( "ShowGraphicItemPropertiesDialog() error: NULL item" ) );
217
218 DIALOG_SHAPE_PROPERTIES dlg( this, aShape );
219
220 if( dlg.ShowQuasiModal() == wxID_OK )
221 {
222 if( aShape->IsOnLayer( GetActiveLayer() ) )
223 {
225 drawingTool->SetStroke( aShape->GetStroke(), GetActiveLayer() );
226 }
227 }
228}
229
230
231void DIALOG_SHAPE_PROPERTIES::onLayerSelection( wxCommandEvent& event )
232{
234 {
237 }
238}
239
240
241void DIALOG_SHAPE_PROPERTIES::onFilledCheckbox( wxCommandEvent& event )
242{
243 if( m_filledCtrl->GetValue() )
244 {
245 m_lineStyleCombo->SetSelection( 0 );
246 m_lineStyleLabel->Enable( false );
247 m_lineStyleCombo->Enable( false );
248 }
249 else
250 {
252
253 if( style == LINE_STYLE::DEFAULT )
254 style = LINE_STYLE::SOLID;
255
256 if( (int) style < (int) lineTypeNames.size() )
257 m_lineStyleCombo->SetSelection( (int) style );
258
259 m_lineStyleLabel->Enable( true );
260 m_lineStyleCombo->Enable( true );
261 }
262}
263
265{
266 if( !m_item )
267 return false;
268
269 if( m_item->GetShape() == SHAPE_T::ARC )
271
272 if( m_item->GetShape() == SHAPE_T::RECTANGLE )
273 {
276 }
277
278 if( m_item->GetShape() == SHAPE_T::SEGMENT )
279 {
280 if( m_item->GetStart().x == m_item->GetEnd().x )
282 else
284
287 }
288
289 if( m_flipStartEnd && m_item->GetShape() != SHAPE_T::ARC )
290 {
293 }
294 else
295 {
298 }
299
300 if( m_item->GetShape() == SHAPE_T::CIRCLE )
301 {
303 }
304 else if( m_flipStartEnd && m_item->GetShape() != SHAPE_T::ARC )
305 {
308 }
309 else
310 {
313 }
314
315 if( m_item->GetShape() == SHAPE_T::BEZIER )
316 {
321 }
322
323 m_filledCtrl->SetValue( m_item->IsFilled() );
324 m_locked->SetValue( m_item->IsLocked() );
325
327
328 int style = static_cast<int>( m_item->GetStroke().GetLineStyle() );
329
330 if( style == -1 )
331 m_lineStyleCombo->SetStringSelection( DEFAULT_STYLE );
332 else if( style < (int) lineTypeNames.size() )
333 m_lineStyleCombo->SetSelection( style );
334 else
335 wxFAIL_MSG( "Line type not found in the type lookup map" );
336
338
339 return DIALOG_SHAPE_PROPERTIES_BASE::TransferDataToWindow();
340}
341
342
344{
345 if( !DIALOG_SHAPE_PROPERTIES_BASE::TransferDataFromWindow() )
346 return false;
347
348 if( !m_item )
349 return true;
350
352 VECTOR2I begin_point = m_item->GetStart();
353 VECTOR2I end_point = m_item->GetEnd();
354 int segment_length = 0;
355 EDA_ANGLE segment_angle = EDA_ANGLE( 0, RADIANS_T );
356 int rectangle_height = 0;
357 int rectangle_width = 0;
358
359 BOARD_COMMIT commit( m_parent );
360
361 commit.Modify( m_item );
362
363 if( m_item->GetShape() == SHAPE_T::SEGMENT )
364 {
365 segment_length = KiROUND( m_item->GetLength() );
366 segment_angle = m_item->GetSegmentAngle().Round( 3 );
367 }
368
369 if( m_item->GetShape() == SHAPE_T::RECTANGLE )
370 {
371 rectangle_height = m_item->GetRectangleHeight();
372 rectangle_width = m_item->GetRectangleWidth();
373 }
374
375 if( m_flipStartEnd && m_item->GetShape() != SHAPE_T::ARC )
376 {
379 }
380 else
381 {
384 }
385
386 if( m_item->GetShape() == SHAPE_T::CIRCLE )
387 {
389 }
390 else if( m_flipStartEnd && m_item->GetShape() != SHAPE_T::ARC )
391 {
394 }
395 else
396 {
399 }
400
401 if( m_item->GetShape() == SHAPE_T::SEGMENT )
402 {
403 bool change_begin = ( begin_point != m_item->GetStart() );
404 bool change_end = ( end_point != m_item->GetEnd() );
405 bool change_length = ( segment_length != m_segmentLength.GetValue() );
406 EDA_ANGLE difference = std::abs( segment_angle - m_segmentAngle.GetAngleValue() );
407 bool change_angle = ( difference >= EDA_ANGLE( 0.00049, DEGREES_T ) );
408
409 if( !( change_begin && change_end ) )
410 {
411 segment_length = m_segmentLength.GetIntValue();
412 segment_angle = m_segmentAngle.GetAngleValue().Round( 3 );
413
414 if( change_length || change_angle )
415 {
416 if( change_end )
417 {
419 - KiROUND( segment_length * segment_angle.Cos() ) );
421 + KiROUND( segment_length * segment_angle.Sin() ) );
422 }
423 else
424 {
426 + KiROUND( segment_length * segment_angle.Cos() ) );
428 - KiROUND( segment_length * segment_angle.Sin() ) );
429 }
430 }
431 }
432
433 if( change_length )
435 else
437
438 if( change_angle )
440 else
442 }
443
444 if( m_item->GetShape() == SHAPE_T::RECTANGLE )
445 {
446 bool change_begin = ( begin_point != m_item->GetStart() );
447 bool change_end = ( end_point != m_item->GetEnd() );
448 bool change_height = ( rectangle_height != m_rectangleHeight.GetValue() );
449 bool change_width = ( rectangle_width != m_rectangleWidth.GetValue() );
450
451 if( !( change_begin && change_end ) )
452 {
453 rectangle_height = m_rectangleHeight.GetIntValue();
454 rectangle_width = m_rectangleWidth.GetIntValue();
455
456 if( change_height || change_width )
457 {
458 if( change_end )
459 {
460 m_item->SetStartX( m_item->GetEndX() - rectangle_width );
461 m_item->SetStartY( m_item->GetEndY() - rectangle_height );
462 }
463 else
464 {
465 m_item->SetEndX( m_item->GetStartX() + rectangle_width );
466 m_item->SetEndY( m_item->GetStartY() + rectangle_height );
467 }
468 }
469 }
470
472 }
473
474
475 // For Bezier curve: Set the two control points
476 if( m_item->GetShape() == SHAPE_T::BEZIER )
477 {
480 }
481
482 if( m_item->GetShape() == SHAPE_T::ARC )
483 {
485
486 m_item->SetCenter( c );
487 }
488
489 bool wasLocked = m_item->IsLocked();
490
491 m_item->SetFilled( m_filledCtrl->GetValue() );
492 m_item->SetLocked( m_locked->GetValue() );
493
494 STROKE_PARAMS stroke = m_item->GetStroke();
495
496 stroke.SetWidth( m_thickness.GetIntValue() );
497
498 auto it = lineTypeNames.begin();
499 std::advance( it, m_lineStyleCombo->GetSelection() );
500
501 if( it == lineTypeNames.end() )
502 stroke.SetLineStyle( LINE_STYLE::DEFAULT );
503 else
504 stroke.SetLineStyle( it->first );
505
506 m_item->SetStroke( stroke );
507
508 m_item->SetLayer( ToLAYER_ID( layer ) );
509
511
512 if( m_item->IsOnCopperLayer() )
514 else
515 m_item->SetNetCode( -1 );
516
517 commit.Push( _( "Modify drawing properties" ) );
518
519 // Notify clients which treat locked and unlocked items differently (ie: POINT_EDITOR)
520 if( wasLocked != m_item->IsLocked() )
522
523 return true;
524}
525
526
528{
529 wxArrayString errors;
530
531 if( !DIALOG_SHAPE_PROPERTIES_BASE::Validate() )
532 return false;
533
534 // Type specific checks.
535 switch( m_item->GetShape() )
536 {
537 case SHAPE_T::ARC:
538 // Check angle of arc.
539 if( m_angle.GetAngleValue() == ANGLE_0 )
540 errors.Add( _( "Arc angle cannot be zero." ) );
541
543 {
544 errors.Add( wxString::Format( _( "Invalid Arc with radius %f and angle %f." ),
545 0.0, m_angle.GetDoubleValue() ) );
546 }
547 else
548 {
551 VECTOR2D center = CalcArcCenter( start, end, m_angle.GetAngleValue() );
552
553 double radius = ( center - start ).EuclideanNorm();
554 double max_offset = std::max( std::abs( center.x ) + radius,
555 std::abs( center.y ) + radius );
556
557 if( max_offset >= ( std::numeric_limits<VECTOR2I::coord_type>::max() / 2.0 )
558 || center == start || center == end )
559 {
560 errors.Add( wxString::Format( _( "Invalid Arc with radius %f and angle %f." ),
561 radius, m_angle.GetDoubleValue() ) );
562 }
563 }
564
565 if( m_thickness.GetValue() <= 0 )
566 errors.Add( _( "Line width must be greater than zero." ) );
567
568 break;
569
570 case SHAPE_T::CIRCLE:
571 // Check radius.
572 if( m_endX.GetValue() <= 0 )
573 errors.Add( _( "Radius must be greater than zero." ) );
574
575 if( !m_filledCtrl->GetValue() && m_thickness.GetValue() <= 0 )
576 errors.Add( _( "Line width must be greater than zero for an unfilled circle." ) );
577
578 break;
579
580 case SHAPE_T::RECTANGLE:
581 // Check for null rect.
583 errors.Add( _( "Rectangle cannot be empty." ) );
584
585 if( !m_filledCtrl->GetValue() && m_thickness.GetValue() <= 0 )
586 errors.Add( _( "Line width must be greater than zero for an unfilled rectangle." ) );
587
588 break;
589
590 case SHAPE_T::POLY:
591 if( !m_filledCtrl->GetValue() && m_thickness.GetValue() <= 0 )
592 errors.Add( _( "Line width must be greater than zero for an unfilled polygon." ) );
593
594 break;
595
596 case SHAPE_T::SEGMENT:
597 if( m_thickness.GetValue() <= 0 )
598 errors.Add( _( "Line width must be greater than zero." ) );
599
600 break;
601
602 case SHAPE_T::BEZIER:
603 if( !m_filledCtrl->GetValue() && m_thickness.GetValue() <= 0 )
604 errors.Add( _( "Line width must be greater than zero for an unfilled curve." ) );
605
606 break;
607
608 default:
610 break;
611 }
612
613 if( errors.GetCount() )
614 {
615 HTML_MESSAGE_BOX dlg( this, _( "Error List" ) );
616 dlg.ListSet( errors );
617 dlg.ShowModal();
618 }
619
620 return errors.GetCount() == 0;
621}
wxBitmap KiBitmap(BITMAPS aBitmap, int aHeightTag)
Construct a wxBitmap from an image identifier Returns the image from the active theme if the image ha...
Definition: bitmap.cpp:104
bool SetNetCode(int aNetCode, bool aNoAssert)
Set net using a net code.
virtual void SetLocked(bool aLocked)
Definition: board_item.h:299
virtual bool IsOnLayer(PCB_LAYER_ID aLayer) const
Test to see if this object is on the given layer.
Definition: board_item.h:290
virtual bool IsLocked() const
Definition: board_item.cpp:73
virtual bool IsOnCopperLayer() const
Definition: board_item.h:151
const NETINFO_LIST & GetNetInfo() const
Definition: board.h:827
bool TransferDataToWindow() override
DIALOG_SHAPE_PROPERTIES(SCH_EDIT_FRAME *aParent, SCH_SHAPE *aShape)
void onLayerSelection(wxCommandEvent &event) override
void onFilledCheckbox(wxCommandEvent &event) override
bool TransferDataFromWindow() override
void SetInitialFocus(wxWindow *aWindow)
Sets the window (usually a wxTextCtrl) that should be focused when the dialog is shown.
Definition: dialog_shim.h:97
void SetupStandardButtons(std::map< int, wxString > aLabels={})
int ShowQuasiModal()
std::string m_hash_key
Definition: dialog_shim.h:205
void finishDialogSettings()
In all dialogs, we must call the same functions to fix minimal dlg size, the default position and per...
Tool responsible for drawing graphical elements like lines, arcs, circles, etc.
Definition: drawing_tool.h:55
void SetStroke(const STROKE_PARAMS &aStroke, PCB_LAYER_ID aLayer)
Definition: drawing_tool.h:221
double Sin() const
Definition: eda_angle.h:206
EDA_ANGLE Round(int digits) const
Definition: eda_angle.h:312
double Cos() const
Definition: eda_angle.h:221
FRAME_T GetFrameType() const
EDA_ANGLE GetArcAngle() const
Definition: eda_shape.cpp:656
void SetStartX(int x)
Definition: eda_shape.h:142
const VECTOR2I & GetBezierC2() const
Definition: eda_shape.h:185
void SetBezierC2(const VECTOR2I &aPt)
Definition: eda_shape.h:184
void SetCenter(const VECTOR2I &aCenter)
Definition: eda_shape.cpp:538
int GetStartY() const
Definition: eda_shape.h:127
void SetLength(const double &aLength)
Definition: eda_shape.cpp:174
void SetEndY(int y)
Definition: eda_shape.h:161
void RebuildBezierToSegmentsPointsList(int aMinSegLen)
Rebuild the m_bezierPoints vertex list that approximate the Bezier curve by a list of segments.
Definition: eda_shape.cpp:473
int GetEndX() const
Definition: eda_shape.h:153
int GetRectangleWidth() const
Definition: eda_shape.cpp:162
void SetStartY(int y)
Definition: eda_shape.h:136
bool IsFilled() const
Definition: eda_shape.h:90
void SetFilled(bool aFlag)
Definition: eda_shape.h:95
int GetRadius() const
Definition: eda_shape.cpp:586
SHAPE_T GetShape() const
Definition: eda_shape.h:119
int GetEndY() const
Definition: eda_shape.h:152
void SetEndX(int x)
Definition: eda_shape.h:167
const VECTOR2I & GetEnd() const
Return the ending point of the graphic.
Definition: eda_shape.h:151
const VECTOR2I & GetStart() const
Return the starting point of the graphic.
Definition: eda_shape.h:126
void SetRectangle(const long long int &aHeight, const long long int &aWidth)
Definition: eda_shape.cpp:185
void SetSegmentAngle(const EDA_ANGLE &aAngle)
Definition: eda_shape.cpp:199
void SetEnd(const VECTOR2I &aEnd)
Definition: eda_shape.h:155
void SetBezierC1(const VECTOR2I &aPt)
Definition: eda_shape.h:181
double GetLength() const
Definition: eda_shape.cpp:120
wxString SHAPE_T_asString() const
Definition: eda_shape.cpp:87
int GetStartX() const
Definition: eda_shape.h:128
const VECTOR2I & GetBezierC1() const
Definition: eda_shape.h:182
int GetRectangleHeight() const
Definition: eda_shape.cpp:150
EDA_ANGLE GetSegmentAngle() const
Definition: eda_shape.cpp:647
static const TOOL_EVENT SelectedEvent
Definition: actions.h:233
void ListSet(const wxString &aList)
Add a list of items.
int SetLayerSelection(int layer)
bool SetLayersHotkeys(bool value)
LSET is a set of PCB_LAYER_IDs.
Definition: layer_ids.h:556
static LSET ForbiddenFootprintLayers()
Layers which are not allowed within footprint definitions.
Definition: lset.cpp:924
void SetNetInfo(const NETINFO_LIST *aNetInfoList)
void SetBoard(BOARD *aBoard)
int GetSelectedNetcode()
void SetIndeterminateString(const wxString &aString)
void SetSelectedNetcode(int aNetcode)
void SetIndeterminate()
Common, abstract interface for edit frames.
void ShowGraphicItemPropertiesDialog(PCB_SHAPE *aShape)
virtual PCB_LAYER_ID GetActiveLayer() const
BOARD * GetBoard() const
The main frame for Pcbnew.
void SetBoardFrame(PCB_BASE_FRAME *aFrame)
void SetNotAllowedLayerSet(LSET aMask)
int GetWidth() const override
Definition: pcb_shape.cpp:149
void SetLayer(PCB_LAYER_ID aLayer) override
Set the layer this item is on.
Definition: pcb_shape.cpp:97
wxString GetFriendlyName() const override
Definition: pcb_shape.h:62
STROKE_PARAMS GetStroke() const override
Definition: pcb_shape.h:82
void SetStroke(const STROKE_PARAMS &aStroke) override
Definition: pcb_shape.h:83
PCB_LAYER_ID GetLayer() const override
Return the primary layer this item is on.
Definition: pcb_shape.h:67
Simple container to manage line stroke parameters.
Definition: stroke_params.h:81
int GetWidth() const
Definition: stroke_params.h:91
void SetLineStyle(LINE_STYLE aLineStyle)
Definition: stroke_params.h:95
void SetWidth(int aWidth)
Definition: stroke_params.h:92
LINE_STYLE GetLineStyle() const
Definition: stroke_params.h:94
TOOL_MANAGER * m_toolManager
Definition: tools_holder.h:165
TOOL_MANAGER * GetToolManager() const
Return the MVC controller.
Definition: tools_holder.h:55
void PostEvent(const TOOL_EVENT &aEvent)
Put an event to the event queue to be processed at the end of event processing cycle.
int GetIntValue()
Definition: unit_binder.h:127
virtual long long int GetValue()
Return the current value in Internal Units.
virtual void SetPrecision(int aLength)
Normally not needed, but can be used to set the precision when using internal units that are floats (...
virtual void SetUnits(EDA_UNITS aUnits)
Normally not needed (as the UNIT_BINDER inherits from the parent frame), but can be used to set to DE...
virtual EDA_ANGLE GetAngleValue()
virtual double GetDoubleValue()
Return the current value in Internal Units.
virtual void SetAngleValue(const EDA_ANGLE &aValue)
virtual void SetValue(long long int aValue)
Set new value (in Internal Units) for the text field, taking care of units conversion.
void Show(bool aShow, bool aResize=false)
Show/hide the label, widget and units label.
void SetCoordType(ORIGIN_TRANSFORMS::COORD_TYPES_T aCoordType)
Set the current origin transform mode.
Definition: unit_binder.h:189
#define _(s)
@ RADIANS_T
Definition: eda_angle.h:32
@ DEGREES_T
Definition: eda_angle.h:31
static constexpr EDA_ANGLE & ANGLE_0
Definition: eda_angle.h:437
@ FRAME_FOOTPRINT_EDITOR
Definition: frame_type.h:43
PCB_LAYER_ID ToLAYER_ID(int aLayer)
Definition: lset.cpp:941
This file contains miscellaneous commonly used macros and functions.
#define UNIMPLEMENTED_FOR(type)
Definition: macros.h:96
EDA_ANGLE abs(const EDA_ANGLE &aAngle)
Definition: eda_angle.h:426
#define TO_UTF8(wxstring)
Convert a wxString to a UTF8 encoded C string for all wxWidgets build modes.
Definition: string_utils.h:391
const std::map< LINE_STYLE, struct LINE_STYLE_DESC > lineTypeNames
LINE_STYLE
Dashed line types.
Definition: stroke_params.h:48
const VECTOR2I CalcArcCenter(const VECTOR2I &aStart, const VECTOR2I &aMid, const VECTOR2I &aEnd)
Determine the center of an arc or circle given three points on its circumference.
Definition: trigo.cpp:520
double EuclideanNorm(const VECTOR2I &vector)
Definition: trigo.h:128
#define INDETERMINATE_STATE
Used for holding indeterminate values, such as with multiple selections holding different values or c...
Definition: ui_common.h:44
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:85
VECTOR2< int > VECTOR2I
Definition: vector2d.h:588