From c91d3e3cf994b9708fc3fa05806b4bdebaf1726e Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Sat, 1 Jan 2022 13:57:44 -0500 Subject: [PATCH] Remove some more wxPoint --- eeschema/sch_screen.h | 10 +++---- eeschema/sch_symbol.h | 4 +-- eeschema/tools/ee_grid_helper.cpp | 10 +++---- gerbview/am_primitive.cpp | 24 ++++++++--------- gerbview/excellon_image.h | 8 +++--- gerbview/gbr_layout.h | 6 ++--- gerbview/gerber_draw_item.h | 4 +-- gerbview/gerber_file_image.h | 18 ++++++------- gerbview/rs274_read_XY_and_IJ_coordinates.cpp | 16 ++++++------ include/board_item.h | 2 +- libs/kimath/include/trigo.h | 3 +-- libs/kimath/src/trigo.cpp | 23 +--------------- pcbnew/board.cpp | 8 +++--- pcbnew/board.h | 4 +-- pcbnew/fp_shape.cpp | 3 ++- pcbnew/fp_shape.h | 2 +- pcbnew/graphics_cleaner.cpp | 6 ++--- pcbnew/pcb_shape.cpp | 4 +-- pcbnew/pcb_track.cpp | 8 +++--- pcbnew/plugins/altium/altium_pcb.cpp | 26 +++++++++---------- pcbnew/plugins/pcad/pcb_arc.cpp | 8 +++--- pcbnew/plugins/pcad/pcb_footprint.cpp | 6 ++--- 22 files changed, 90 insertions(+), 113 deletions(-) diff --git a/eeschema/sch_screen.h b/eeschema/sch_screen.h index 4c9cb44204..f56ef0b353 100644 --- a/eeschema/sch_screen.h +++ b/eeschema/sch_screen.h @@ -150,8 +150,8 @@ public: void SetFileExists( bool aFileExists ) { m_fileExists = aFileExists; } bool FileExists() const { return m_fileExists; } - const wxPoint& GetAuxOrigin() const { return m_aux_origin; } - void SetAuxOrigin( const wxPoint& aPosition ) { m_aux_origin = aPosition; } + const VECTOR2I& GetAuxOrigin() const { return m_aux_origin; } + void SetAuxOrigin( const VECTOR2I& aPosition ) { m_aux_origin = aPosition; } const TITLE_BLOCK& GetTitleBlock() const { return m_titles; } @@ -410,7 +410,7 @@ public: /** * Return a line item located at \a aPosition. * - * @param[in] aPosition The wxPoint to test for a line item. + * @param[in] aPosition The VECTOR2I to test for a line item. * @param aAccuracy Amount to inflate the item hit test bounding box. * @param aLayer The layer the line is drawn upon. * @param aSearchType Additional line test criteria. @@ -435,7 +435,7 @@ public: /** * Return a label item located at \a aPosition. * - * @param[in] aPosition The wxPoint to test for label items. + * @param[in] aPosition The VECTOR2I to test for label items. * @param aAccuracy Amount to inflate the item hit test bounding box. * @return The SCH_TEXT* of the label item found at \a aPosition or NULL if item not * found. @@ -534,7 +534,7 @@ private: PAGE_INFO m_paper; // The size of the paper to print or plot on. TITLE_BLOCK m_titles; - wxPoint m_aux_origin; // Origin used for drill & place files by Pcbnew. + VECTOR2I m_aux_origin; // Origin used for drill & place files by Pcbnew. EE_RTREE m_rtree; int m_modification_sync; // Inequality with SYMBOL_LIBS::GetModificationHash() diff --git a/eeschema/sch_symbol.h b/eeschema/sch_symbol.h index cddc480c68..0f0362e683 100644 --- a/eeschema/sch_symbol.h +++ b/eeschema/sch_symbol.h @@ -473,7 +473,7 @@ public: * Print a symbol. * * @param aDC is the device context (can be null). - * @param aOffset is the drawing offset (usually wxPoint(0,0), but can be different when + * @param aOffset is the drawing offset (usually VECTOR2I(0,0), but can be different when * moving an object) */ void Print( const RENDER_SETTINGS* aSettings, const VECTOR2I& aOffset ) override; @@ -563,7 +563,7 @@ public: void Move( const VECTOR2I& aMoveVector ) override { - if( aMoveVector == wxPoint( 0, 0 ) ) + if( aMoveVector == VECTOR2I( 0, 0 ) ) return; m_pos += aMoveVector; diff --git a/eeschema/tools/ee_grid_helper.cpp b/eeschema/tools/ee_grid_helper.cpp index 9db9dfa356..c08f3bebe6 100644 --- a/eeschema/tools/ee_grid_helper.cpp +++ b/eeschema/tools/ee_grid_helper.cpp @@ -214,8 +214,8 @@ VECTOR2I EE_GRID_HELPER::BestSnapAnchor( const VECTOR2I& aOrigin, int aLayer, else if( snapPoint ) { m_snapItem = nearest; - m_viewSnapPoint.SetPosition( (wxPoint) pt ); - m_viewSnapLine.SetPosition( (wxPoint) pt ); + m_viewSnapPoint.SetPosition( pt ); + m_viewSnapLine.SetPosition( pt ); m_toolMgr->GetView()->SetVisible( &m_viewSnapLine, false ); @@ -316,16 +316,14 @@ void EE_GRID_HELPER::computeAnchors( SCH_ITEM *aItem, const VECTOR2I &aRefPos, b { VECTOR2I possible( line->GetStartPoint().x, pt.y ); - if( TestSegmentHit( wxPoint( possible ), line->GetStartPoint(), line->GetEndPoint(), - 0 ) ) + if( TestSegmentHit( possible, line->GetStartPoint(), line->GetEndPoint(), 0 ) ) addAnchor( possible, SNAPPABLE | VERTICAL, aItem ); } else if( line->GetStartPoint().y == line->GetEndPoint().y ) { VECTOR2I possible( pt.x, line->GetStartPoint().y ); - if( TestSegmentHit( wxPoint( possible ), line->GetStartPoint(), line->GetEndPoint(), - 0 ) ) + if( TestSegmentHit( possible, line->GetStartPoint(), line->GetEndPoint(), 0 ) ) addAnchor( possible, SNAPPABLE | HORIZONTAL, aItem ); } diff --git a/gerbview/am_primitive.cpp b/gerbview/am_primitive.cpp index ec35606264..4c6fdcfe37 100644 --- a/gerbview/am_primitive.cpp +++ b/gerbview/am_primitive.cpp @@ -48,9 +48,9 @@ extern int scaletoIU( double aCoord, bool isMetric ); * * @return The GerbView coordinate system vector. */ -static wxPoint mapPt( double x, double y, bool isMetric ) +static VECTOR2I mapPt( double x, double y, bool isMetric ) { - wxPoint ret( scaletoIU( x, isMetric ), scaletoIU( y, isMetric ) ); + VECTOR2I ret( scaletoIU( x, isMetric ), scaletoIU( y, isMetric ) ); return ret; } @@ -377,7 +377,7 @@ void AM_PRIMITIVE::DrawBasicShape( const GERBER_DRAW_ITEM* aParent, SHAPE_POLY_S // the shape rotation is the last param of list, after corners int last_prm = params.size() - 1; rotation = params[last_prm].GetValue( tool ) * 10.0; - wxPoint pos; + VECTOR2I pos; // Read points. // Note: numCorners is the polygon corner count, following the first corner @@ -498,17 +498,17 @@ void AM_PRIMITIVE::ConvertShapeToPolygon( const GERBER_DRAW_ITEM* aParent, case AMP_LINE2: case AMP_LINE20: // Line with rectangle ends. (Width, start and end pos + rotation) { - int width = scaletoIU( params[1].GetValue( tool ), m_GerbMetric ); - wxPoint start = mapPt( params[2].GetValue( tool ), - params[3].GetValue( tool ), m_GerbMetric ); - wxPoint end = mapPt( params[4].GetValue( tool ), - params[5].GetValue( tool ), m_GerbMetric ); - wxPoint delta = end - start; + int width = scaletoIU( params[1].GetValue( tool ), m_GerbMetric ); + VECTOR2I start = + mapPt( params[2].GetValue( tool ), params[3].GetValue( tool ), m_GerbMetric ); + VECTOR2I end = + mapPt( params[4].GetValue( tool ), params[5].GetValue( tool ), m_GerbMetric ); + VECTOR2I delta = end - start; int len = KiROUND( EuclideanNorm( delta ) ); // To build the polygon, we must create a horizontal polygon starting to "start" // and rotate it to have the end point to "end" - wxPoint currpt; + VECTOR2I currpt; currpt.y += width / 2; // Upper left aBuffer.push_back( currpt ); currpt.x = len; // Upper right @@ -676,8 +676,8 @@ void AM_PRIMITIVE::ConvertShapeToPolygon( const GERBER_DRAW_ITEM* aParent, for( int ii = 0; ii <= vertexcount; ii++ ) { - wxPoint pos( radius, 0); - RotatePoint( &pos, ii * 3600 / vertexcount ); + VECTOR2I pos( radius, 0 ); + RotatePoint( pos, ii * 3600 / vertexcount ); aBuffer.push_back( pos ); } diff --git a/gerbview/excellon_image.h b/gerbview/excellon_image.h index f83c4acfa4..c2d24fc491 100644 --- a/gerbview/excellon_image.h +++ b/gerbview/excellon_image.h @@ -106,25 +106,25 @@ struct EXCELLON_ROUTE_COORD m_rmode( 0 ), m_arc_type_info( 0 ) {} - EXCELLON_ROUTE_COORD( const wxPoint& aPos ): + EXCELLON_ROUTE_COORD( const VECTOR2I& aPos ) : m_x( aPos.x ), m_y( aPos.y ), m_cx( 0 ), m_cy( 0 ), m_radius( 0 ), m_rmode( 0 ), m_arc_type_info( ARC_INFO_TYPE_NONE ) {} - EXCELLON_ROUTE_COORD( const wxPoint& aPos, const wxPoint& aCenter, int aMode ): + EXCELLON_ROUTE_COORD( const VECTOR2I& aPos, const VECTOR2I& aCenter, int aMode ) : m_x( aPos.x ), m_y( aPos.y ), m_cx( aCenter.x ), m_cy( aCenter.y ), m_radius( 0 ), m_rmode( aMode ), m_arc_type_info( ARC_INFO_TYPE_CENTER ) {} - EXCELLON_ROUTE_COORD( const wxPoint& aPos, int aRadius, int aMode ): + EXCELLON_ROUTE_COORD( const VECTOR2I& aPos, int aRadius, int aMode ) : m_x( aPos.x ), m_y( aPos.y ), m_cx( 0 ), m_cy( 0 ), m_radius( aRadius ), m_rmode( aMode ), m_arc_type_info( ARC_INFO_TYPE_RADIUS ) {} - wxPoint GetPos() { return wxPoint( m_x, m_y ); } + VECTOR2I GetPos() { return VECTOR2I( m_x, m_y ); } }; /** diff --git a/gerbview/gbr_layout.h b/gerbview/gbr_layout.h index 35ec2a089b..7b714a7d6f 100644 --- a/gerbview/gbr_layout.h +++ b/gerbview/gbr_layout.h @@ -57,8 +57,8 @@ public: // which handles the list of gerber files (and drill files) images loaded GERBER_FILE_IMAGE_LIST* GetImagesList() const; - const wxPoint& GetAuxOrigin() const { return m_originAxisPosition; } - void SetAuxOrigin( const wxPoint& aPosition ) { m_originAxisPosition = aPosition; } + const VECTOR2I& GetAuxOrigin() const { return m_originAxisPosition; } + void SetAuxOrigin( const VECTOR2I& aPosition ) { m_originAxisPosition = aPosition; } TITLE_BLOCK& GetTitleBlock() { return m_titles; } void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) { m_titles = aTitleBlock; } @@ -87,7 +87,7 @@ public: private: mutable EDA_RECT m_BoundingBox; TITLE_BLOCK m_titles; - wxPoint m_originAxisPosition; + VECTOR2I m_originAxisPosition; }; #endif // #ifndef GBR_LAYOUT_H diff --git a/gerbview/gerber_draw_item.h b/gerbview/gerber_draw_item.h index 1d1d801112..e33b2c7fa2 100644 --- a/gerbview/gerber_draw_item.h +++ b/gerbview/gerber_draw_item.h @@ -285,8 +285,8 @@ private: bool m_swapAxis; // false if A = X, B = Y; true if A =Y, B = Y bool m_mirrorA; // true: mirror / axis A bool m_mirrorB; // true: mirror / ax's B - wxRealPoint m_drawScale; // A and B scaling factor - wxPoint m_layerOffset; // Offset for A and B axis, from OF parameter + VECTOR2I m_drawScale; // A and B scaling factor + VECTOR2I m_layerOffset; // Offset for A and B axis, from OF parameter double m_lyrRotation; // Fine rotation, from OR parameter, in degrees GBR_NETLIST_METADATA m_netAttributes; ///< the string given by a %TO attribute set in aperture ///< (dcode). Stored in each item, because %TO is diff --git a/gerbview/gerber_file_image.h b/gerbview/gerber_file_image.h index 348448a894..f5a72552e8 100644 --- a/gerbview/gerber_file_image.h +++ b/gerbview/gerber_file_image.h @@ -212,7 +212,7 @@ public: * it forces truncation of a digit string to a maximum length because the exact coordinate * format is not always known. */ - wxPoint ReadXYCoord( char*& aText, bool aExcellonMode = false ); + VECTOR2I ReadXYCoord( char*& aText, bool aExcellonMode = false ); /** * Return the current coordinate type pointed to by InnJnn Text (InnnnJmmmm) @@ -220,7 +220,7 @@ public: * These coordinates are relative, so if coordinate is absent, its value * defaults to 0 */ - wxPoint ReadIJCoord( char*& Text ); + VECTOR2I ReadIJCoord( char*& Text ); // functions to read G commands or D commands: int GCodeNumber( char*& Text ); @@ -377,13 +377,13 @@ public: bool m_ImageJustifyYCenter; ///< Image Justify Offset on XY axis (default = 0,0). - wxPoint m_ImageJustifyOffset; + VECTOR2I m_ImageJustifyOffset; bool m_GerbMetric; // false = Inches, true = metric ///< false = absolute Coord, true = relative Coord. bool m_Relative; bool m_NoTrailingZeros; // true: remove tailing zeros. - wxPoint m_ImageOffset; // Coord Offset, from IO command + VECTOR2I m_ImageOffset; // Coord Offset, from IO command ///< Fmt 2.3: m_FmtScale = 3, fmt 3.4: m_FmtScale = 4. wxSize m_FmtScale; @@ -397,8 +397,8 @@ public: ///< Local rotation in degrees added to m_ImageRotation. ///< @note This value is stored in 0.1 degrees. double m_LocalRotation; - wxPoint m_Offset; // Coord Offset, from OF command - wxRealPoint m_Scale; // scale (X and Y) of layer. + VECTOR2I m_Offset; // Coord Offset, from OF command + VECTOR2I m_Scale; // scale (X and Y) of layer. bool m_SwapAxis; // false (default) if A = X and B = Y // true if A = Y, B = X bool m_MirrorA; // true: mirror / axis A (X) @@ -412,9 +412,9 @@ public: ///< Line number of the gerber file while reading. int m_LineNum; - wxPoint m_CurrentPos; // current specified coord for plot - wxPoint m_PreviousPos; // old current specified coord for plot - wxPoint m_IJPos; // IJ coord (for arcs & circles ) + VECTOR2I m_CurrentPos; // current specified coord for plot + VECTOR2I m_PreviousPos; // old current specified coord for plot + VECTOR2I m_IJPos; // IJ coord (for arcs & circles ) ///< True if a IJ coord was read (for arcs & circles ). bool m_LastCoordIsIJPos; diff --git a/gerbview/rs274_read_XY_and_IJ_coordinates.cpp b/gerbview/rs274_read_XY_and_IJ_coordinates.cpp index 738152d60f..4634bb97ce 100644 --- a/gerbview/rs274_read_XY_and_IJ_coordinates.cpp +++ b/gerbview/rs274_read_XY_and_IJ_coordinates.cpp @@ -68,13 +68,13 @@ int scaletoIU( double aCoord, bool isMetric ) } -wxPoint GERBER_FILE_IMAGE::ReadXYCoord( char*& Text, bool aExcellonMode ) +VECTOR2I GERBER_FILE_IMAGE::ReadXYCoord( char*& Text, bool aExcellonMode ) { - wxPoint pos; - int type_coord = 0, current_coord, nbdigits; - bool is_float = false; - char* text; - char line[256]; + VECTOR2I pos; + int type_coord = 0, current_coord, nbdigits; + bool is_float = false; + char* text; + char line[256]; if( m_Relative ) @@ -190,9 +190,9 @@ wxPoint GERBER_FILE_IMAGE::ReadXYCoord( char*& Text, bool aExcellonMode ) } -wxPoint GERBER_FILE_IMAGE::ReadIJCoord( char*& Text ) +VECTOR2I GERBER_FILE_IMAGE::ReadIJCoord( char*& Text ) { - wxPoint pos( 0, 0 ); + VECTOR2I pos( 0, 0 ); int type_coord = 0, current_coord, nbdigits; bool is_float = false; diff --git a/include/board_item.h b/include/board_item.h index 8c439dbce5..56793bdbc8 100644 --- a/include/board_item.h +++ b/include/board_item.h @@ -117,7 +117,7 @@ public: /** * A value of wxPoint(0,0) which can be passed to the Draw() functions. */ - static wxPoint ZeroOffset; + static VECTOR2I ZeroOffset; /** * Some pad shapes can be complex (rounded/chamfered rectangle), even without considering diff --git a/libs/kimath/include/trigo.h b/libs/kimath/include/trigo.h index 757a5ce0a9..e72fd3e474 100644 --- a/libs/kimath/include/trigo.h +++ b/libs/kimath/include/trigo.h @@ -130,8 +130,7 @@ void RotatePoint( double *pX, double *pY, double cx, double cy, double angle ); */ const VECTOR2I CalcArcCenter( const VECTOR2I& aStart, const VECTOR2I& aMid, const VECTOR2I& aEnd ); const VECTOR2D CalcArcCenter( const VECTOR2D& aStart, const VECTOR2D& aMid, const VECTOR2D& aEnd ); -const wxPoint CalcArcCenter( const wxPoint& aStart, const wxPoint& aMid, const wxPoint& aEnd ); -const wxPoint CalcArcCenter( const VECTOR2I& aStart, const VECTOR2I& aEnd, double aAngle ); +const VECTOR2I CalcArcCenter( const VECTOR2I& aStart, const VECTOR2I& aEnd, double aAngle ); /** * Return the subtended angle for a given arc. diff --git a/libs/kimath/src/trigo.cpp b/libs/kimath/src/trigo.cpp index c9c4fd523e..4f333bd276 100644 --- a/libs/kimath/src/trigo.cpp +++ b/libs/kimath/src/trigo.cpp @@ -359,7 +359,7 @@ void RotatePoint( double* pX, double* pY, double angle ) } -const wxPoint CalcArcCenter( const VECTOR2I& aStart, const VECTOR2I& aEnd, double aAngle ) +const VECTOR2I CalcArcCenter( const VECTOR2I& aStart, const VECTOR2I& aEnd, double aAngle ) { VECTOR2I start = aStart; VECTOR2I end = aEnd; @@ -472,27 +472,6 @@ const VECTOR2I CalcArcCenter( const VECTOR2I& aStart, const VECTOR2I& aMid, cons } -const wxPoint CalcArcCenter( const wxPoint& aStart, const wxPoint& aMid, const wxPoint& aEnd ) -{ - VECTOR2D dStart( static_cast( aStart.x ), static_cast( aStart.y ) ); - VECTOR2D dMid( static_cast( aMid.x ), static_cast( aMid.y ) ); - VECTOR2D dEnd( static_cast( aEnd.x ), static_cast( aEnd.y ) ); - VECTOR2D dCenter = CalcArcCenter( dStart, dMid, dEnd ); - - wxPoint iCenter; - - iCenter.x = KiROUND( Clamp( double( std::numeric_limits::min() / 2.0 ), - dCenter.x, - double( std::numeric_limits::max() / 2.0 ) ) ); - - iCenter.y = KiROUND( Clamp( double( std::numeric_limits::min() / 2.0 ), - dCenter.y, - double( std::numeric_limits::max() / 2.0 ) ) ); - - return iCenter; -} - - double CalcArcAngle( const VECTOR2I& aStart, const VECTOR2I& aMid, const VECTOR2I& aEnd ) { VECTOR2I center = CalcArcCenter( aStart, aMid, aEnd ); diff --git a/pcbnew/board.cpp b/pcbnew/board.cpp index 2c374141ab..b596698520 100644 --- a/pcbnew/board.cpp +++ b/pcbnew/board.cpp @@ -57,7 +57,7 @@ // This is an odd place for this, but CvPcb won't link if it's in board_item.cpp like I first // tried it. -wxPoint BOARD_ITEM::ZeroOffset( 0, 0 ); +VECTOR2I BOARD_ITEM::ZeroOffset( 0, 0 ); BOARD::BOARD() : @@ -1747,7 +1747,7 @@ std::tuple BOARD::GetTrackLength( const PCB_TRACK& aTrack ) } -FOOTPRINT* BOARD::GetFootprint( const wxPoint& aPosition, PCB_LAYER_ID aActiveLayer, +FOOTPRINT* BOARD::GetFootprint( const VECTOR2I& aPosition, PCB_LAYER_ID aActiveLayer, bool aVisibleOnly, bool aIgnoreLocked ) const { FOOTPRINT* footprint = nullptr; @@ -1832,7 +1832,7 @@ std::list BOARD::GetZoneList( bool aIncludeZonesInFootprints ) const ZONE* BOARD::AddArea( PICKED_ITEMS_LIST* aNewZonesList, int aNetcode, PCB_LAYER_ID aLayer, - wxPoint aStartPointPosition, ZONE_BORDER_DISPLAY_STYLE aHatch ) + VECTOR2I aStartPointPosition, ZONE_BORDER_DISPLAY_STYLE aHatch ) { ZONE* new_area = new ZONE( this ); @@ -1882,7 +1882,7 @@ bool BOARD::NormalizeAreaPolygon( PICKED_ITEMS_LIST * aNewZonesList, ZONE* aCurr // Create new copper area and copy poly into it SHAPE_POLY_SET* new_p = new SHAPE_POLY_SET( aCurrArea->Outline()->UnitSet( ip ) ); NewArea = AddArea( aNewZonesList, aCurrArea->GetNetCode(), aCurrArea->GetLayer(), - wxPoint(0, 0), aCurrArea->GetHatchStyle() ); + VECTOR2I( 0, 0 ), aCurrArea->GetHatchStyle() ); // remove the poly that was automatically created for the new area // and replace it with a poly from NormalizeAreaOutlines diff --git a/pcbnew/board.h b/pcbnew/board.h index 5f7cb65383..6cd187481b 100644 --- a/pcbnew/board.h +++ b/pcbnew/board.h @@ -866,7 +866,7 @@ public: * @return a reference to the new area. */ ZONE* AddArea( PICKED_ITEMS_LIST* aNewZonesList, int aNetcode, PCB_LAYER_ID aLayer, - wxPoint aStartPointPosition, ZONE_BORDER_DISPLAY_STYLE aHatch ); + VECTOR2I aStartPointPosition, ZONE_BORDER_DISPLAY_STYLE aHatch ); /** * Process an area that has been modified, by normalizing its polygon against itself. @@ -1002,7 +1002,7 @@ public: * @param aVisibleOnly Search only the visible layers if true. * @param aIgnoreLocked Ignore locked footprints when true. */ - FOOTPRINT* GetFootprint( const wxPoint& aPosition, PCB_LAYER_ID aActiveLayer, + FOOTPRINT* GetFootprint( const VECTOR2I& aPosition, PCB_LAYER_ID aActiveLayer, bool aVisibleOnly, bool aIgnoreLocked = false ) const; /** diff --git a/pcbnew/fp_shape.cpp b/pcbnew/fp_shape.cpp index 9e84413e0d..afb0e79e86 100644 --- a/pcbnew/fp_shape.cpp +++ b/pcbnew/fp_shape.cpp @@ -195,7 +195,8 @@ void FP_SHAPE::SetArcAngleAndEnd0( double aAngle, bool aCheckNegativeAngle ) } -void FP_SHAPE::SetArcGeometry0( const wxPoint& aStart0, const wxPoint& aMid0, const wxPoint& aEnd0 ) +void FP_SHAPE::SetArcGeometry0( const VECTOR2I& aStart0, const VECTOR2I& aMid0, + const VECTOR2I& aEnd0 ) { m_start0 = aStart0; m_end0 = aEnd0; diff --git a/pcbnew/fp_shape.h b/pcbnew/fp_shape.h index f4be3f0e29..c991262fdc 100644 --- a/pcbnew/fp_shape.h +++ b/pcbnew/fp_shape.h @@ -73,7 +73,7 @@ public: */ void SetArcAngleAndEnd0( double aAngle, bool aCheckNegativeAngle = false ); - void SetArcGeometry0( const wxPoint& aStart, const wxPoint& aMid, const wxPoint& aEnd ); + void SetArcGeometry0( const VECTOR2I& aStart, const VECTOR2I& aMid, const VECTOR2I& aEnd ); /** * Move an edge of the footprint. diff --git a/pcbnew/graphics_cleaner.cpp b/pcbnew/graphics_cleaner.cpp index f38561a51d..7c0e66f3f9 100644 --- a/pcbnew/graphics_cleaner.cpp +++ b/pcbnew/graphics_cleaner.cpp @@ -189,13 +189,13 @@ void GRAPHICS_CLEANER::mergeRects() std::swap( start, end ); } - wxPoint start; - wxPoint end; + VECTOR2I start; + VECTOR2I end; PCB_SHAPE* shape; }; std::vector sides; - std::map> ptMap; + std::map> ptMap; // First load all the candidates into the side vector and layer maps for( BOARD_ITEM* item : m_drawings ) diff --git a/pcbnew/pcb_shape.cpp b/pcbnew/pcb_shape.cpp index ab1eec36fd..f0eb038b4e 100644 --- a/pcbnew/pcb_shape.cpp +++ b/pcbnew/pcb_shape.cpp @@ -61,7 +61,7 @@ const VECTOR2I PCB_SHAPE::GetFocusPosition() const { case SHAPE_T::CIRCLE: if( !IsFilled() ) - return wxPoint( GetCenter().x + GetRadius(), GetCenter().y ); + return VECTOR2I( GetCenter().x + GetRadius(), GetCenter().y ); else return GetCenter(); @@ -75,7 +75,7 @@ const VECTOR2I PCB_SHAPE::GetFocusPosition() const if( !IsFilled() ) { VECTOR2I pos = GetPolyShape().Outline(0).CPoint(0); - return wxPoint( pos.x, pos.y ); + return VECTOR2I( pos.x, pos.y ); } else { diff --git a/pcbnew/pcb_track.cpp b/pcbnew/pcb_track.cpp index bef6167ed1..f14a9aefd9 100644 --- a/pcbnew/pcb_track.cpp +++ b/pcbnew/pcb_track.cpp @@ -64,9 +64,9 @@ EDA_ITEM* PCB_TRACK::Clone() const PCB_ARC::PCB_ARC( BOARD_ITEM* aParent, const SHAPE_ARC* aArc ) : PCB_TRACK( aParent, PCB_ARC_T ) { - m_Start = wxPoint( aArc->GetP0() ); - m_End = wxPoint( aArc->GetP1() ); - m_Mid = wxPoint( aArc->GetArcMid() ); + m_Start = aArc->GetP0(); + m_End = aArc->GetP1(); + m_Mid = aArc->GetArcMid(); } @@ -250,7 +250,7 @@ const EDA_RECT PCB_TRACK::GetBoundingBox() const xmin -= radius; // return a rectangle which is [pos,dim) in nature. therefore the +1 - EDA_RECT ret( wxPoint( xmin, ymin ), wxSize( xmax - xmin + 1, ymax - ymin + 1 ) ); + EDA_RECT ret( VECTOR2I( xmin, ymin ), VECTOR2I( xmax - xmin + 1, ymax - ymin + 1 ) ); return ret; } diff --git a/pcbnew/plugins/altium/altium_pcb.cpp b/pcbnew/plugins/altium/altium_pcb.cpp index 9ddc1ace6b..da86f98636 100644 --- a/pcbnew/plugins/altium/altium_pcb.cpp +++ b/pcbnew/plugins/altium/altium_pcb.cpp @@ -2331,10 +2331,10 @@ void ALTIUM_PCB::HelperParsePad6NonCopper( const APAD6& aElem ) shape->SetLayer( klayer ); shape->SetStroke( STROKE_PARAMS( 0 ) ); - shape->SetPolyPoints( { aElem.position + wxPoint( aElem.topsize.x / 2, aElem.topsize.y / 2 ), - aElem.position + wxPoint( aElem.topsize.x / 2, -aElem.topsize.y / 2 ), - aElem.position + wxPoint( -aElem.topsize.x / 2, -aElem.topsize.y / 2 ), - aElem.position + wxPoint( -aElem.topsize.x / 2, aElem.topsize.y / 2 ) } ); + shape->SetPolyPoints( { aElem.position + VECTOR2I( aElem.topsize.x / 2, aElem.topsize.y / 2 ), + aElem.position + VECTOR2I( aElem.topsize.x / 2, -aElem.topsize.y / 2 ), + aElem.position + VECTOR2I( -aElem.topsize.x / 2, -aElem.topsize.y / 2 ), + aElem.position + VECTOR2I( -aElem.topsize.x / 2, aElem.topsize.y / 2 ) } ); if( aElem.direction != 0 ) shape->Rotate( aElem.position, aElem.direction * 10 ); @@ -2382,7 +2382,7 @@ void ALTIUM_PCB::HelperParsePad6NonCopper( const APAD6& aElem ) { // short vertical line shape->SetShape( SHAPE_T::SEGMENT ); - wxPoint pointOffset( 0, ( aElem.topsize.y - aElem.topsize.x ) / 2 ); + VECTOR2I pointOffset( 0, ( aElem.topsize.y - aElem.topsize.x ) / 2 ); shape->SetStart( aElem.position + pointOffset ); shape->SetEnd( aElem.position - pointOffset ); } @@ -2390,7 +2390,7 @@ void ALTIUM_PCB::HelperParsePad6NonCopper( const APAD6& aElem ) { // short horizontal line shape->SetShape( SHAPE_T::SEGMENT ); - wxPoint pointOffset( ( aElem.topsize.x - aElem.topsize.y ) / 2, 0 ); + VECTOR2I pointOffset( ( aElem.topsize.x - aElem.topsize.y ) / 2, 0 ); shape->SetStart( aElem.position + pointOffset ); shape->SetEnd( aElem.position - pointOffset ); } @@ -2423,13 +2423,13 @@ void ALTIUM_PCB::HelperParsePad6NonCopper( const APAD6& aElem ) if( aElem.topsize.x < aElem.topsize.y ) { - wxPoint offset( 0, ( aElem.topsize.y - aElem.topsize.x ) / 2 ); + VECTOR2I offset( 0, ( aElem.topsize.y - aElem.topsize.x ) / 2 ); shape->SetStart( aElem.position + offset ); shape->SetEnd( aElem.position - offset ); } else { - wxPoint offset( ( aElem.topsize.x - aElem.topsize.y ) / 2, 0 ); + VECTOR2I offset( ( aElem.topsize.x - aElem.topsize.y ) / 2, 0 ); shape->SetStart( aElem.position + offset ); shape->SetEnd( aElem.position - offset ); } @@ -2856,12 +2856,12 @@ void ALTIUM_PCB::ParseFills6Data( const CFB::CompoundFileReader& aReader, checkpoint(); AFILL6 elem( reader ); - wxPoint p11( elem.pos1.x, elem.pos1.y ); - wxPoint p12( elem.pos1.x, elem.pos2.y ); - wxPoint p22( elem.pos2.x, elem.pos2.y ); - wxPoint p21( elem.pos2.x, elem.pos1.y ); + VECTOR2I p11( elem.pos1.x, elem.pos1.y ); + VECTOR2I p12( elem.pos1.x, elem.pos2.y ); + VECTOR2I p22( elem.pos2.x, elem.pos2.y ); + VECTOR2I p21( elem.pos2.x, elem.pos1.y ); - wxPoint center( ( elem.pos1.x + elem.pos2.x ) / 2, ( elem.pos1.y + elem.pos2.y ) / 2 ); + VECTOR2I center( ( elem.pos1.x + elem.pos2.x ) / 2, ( elem.pos1.y + elem.pos2.y ) / 2 ); PCB_LAYER_ID klayer = GetKicadLayer( elem.layer ); diff --git a/pcbnew/plugins/pcad/pcb_arc.cpp b/pcbnew/plugins/pcad/pcb_arc.cpp index d55ef9a173..5738166891 100644 --- a/pcbnew/plugins/pcad/pcb_arc.cpp +++ b/pcbnew/plugins/pcad/pcb_arc.cpp @@ -174,8 +174,8 @@ void PCB_ARC::AddToFootprint( FOOTPRINT* aFootprint ) FP_SHAPE* arc = new FP_SHAPE( aFootprint, IsCircle() ? SHAPE_T::CIRCLE : SHAPE_T::ARC ); aFootprint->Add( arc ); - arc->SetCenter0( wxPoint( m_positionX, m_positionY ) ); - arc->SetStart0( wxPoint( m_StartX, m_StartY ) ); + arc->SetCenter0( VECTOR2I( m_positionX, m_positionY ) ); + arc->SetStart0( VECTOR2I( m_StartX, m_StartY ) ); arc->SetArcAngleAndEnd0( -m_Angle ); arc->SetStroke( STROKE_PARAMS( m_Width, PLOT_DASH_TYPE::SOLID ) ); @@ -194,8 +194,8 @@ void PCB_ARC::AddToBoard() arc->SetFilled( false ); arc->SetLayer( m_KiCadLayer ); - arc->SetCenter( wxPoint( m_positionX, m_positionY ) ); - arc->SetStart( wxPoint( m_StartX, m_StartY ) ); + arc->SetCenter( VECTOR2I( m_positionX, m_positionY ) ); + arc->SetStart( VECTOR2I( m_StartX, m_StartY ) ); arc->SetArcAngleAndEnd( -m_Angle ); arc->SetStroke( STROKE_PARAMS( m_Width, PLOT_DASH_TYPE::SOLID ) ); } diff --git a/pcbnew/plugins/pcad/pcb_footprint.cpp b/pcbnew/plugins/pcad/pcb_footprint.cpp index 63564c1f9e..9bde5795c5 100644 --- a/pcbnew/plugins/pcad/pcb_footprint.cpp +++ b/pcbnew/plugins/pcad/pcb_footprint.cpp @@ -508,7 +508,7 @@ void PCB_FOOTPRINT::AddToBoard() FOOTPRINT* footprint = new FOOTPRINT( m_board ); m_board->Add( footprint, ADD_MODE::APPEND ); - footprint->SetPosition( wxPoint( m_positionX, m_positionY ) ); + footprint->SetPosition( VECTOR2I( m_positionX, m_positionY ) ); footprint->SetLayer( m_Mirror ? B_Cu : F_Cu ); footprint->SetOrientation( m_rotation ); footprint->SetLastEditTime( 0 ); @@ -523,7 +523,7 @@ void PCB_FOOTPRINT::AddToBoard() ref_text->SetText( ValidateReference( m_name.text ) ); ref_text->SetType( FP_TEXT::TEXT_is_REFERENCE ); - ref_text->SetPos0( wxPoint( m_name.correctedPositionX, m_name.correctedPositionY ) ); + ref_text->SetPos0( VECTOR2I( m_name.correctedPositionX, m_name.correctedPositionY ) ); if( m_name.isTrueType ) SetTextSizeFromTrueTypeFontHeight( ref_text, m_name.textHeight ); @@ -551,7 +551,7 @@ void PCB_FOOTPRINT::AddToBoard() val_text->SetText( m_Value.text ); val_text->SetType( FP_TEXT::TEXT_is_VALUE ); - val_text->SetPos0( wxPoint( m_Value.correctedPositionX, m_Value.correctedPositionY ) ); + val_text->SetPos0( VECTOR2I( m_Value.correctedPositionX, m_Value.correctedPositionY ) ); if( m_Value.isTrueType ) SetTextSizeFromTrueTypeFontHeight( val_text, m_Value.textHeight );