42 const auto getUniquelyNumberedPads =
43 [](
const FOOTPRINT& fp ) -> std::unordered_map<wxString, VECTOR2I>
45 std::unordered_map<wxString, VECTOR2I>
result;
46 std::unordered_set<wxString> seenDuplicate;
48 for(
PAD*
pad : fp.Pads() )
50 const wxString& number =
pad->GetNumber();
54 if( seenDuplicate.find( number ) != seenDuplicate.end() )
62 seenDuplicate.insert( number );
69 result[number] =
pad->GetLibraryPosition();
75 std::unordered_map<wxString, VECTOR2I> existingPads = getUniquelyNumberedPads( aExisting );
76 std::unordered_map<wxString, VECTOR2I> newPads = getUniquelyNumberedPads( aNew );
84 for(
auto& [number, pos] : newPads )
88 std::vector<VECTOR2I> existingPoints;
89 std::vector<VECTOR2I> newPoints;
93 for(
const auto& [number, pos] : existingPads )
95 auto it = newPads.find( number );
97 if( it == newPads.end() )
100 existingPoints.push_back( pos );
101 newPoints.push_back( it->second );
106 std::optional<ITEM_REALIGNER_BASE::TRANSFORM> transform =
109 if( !transform.has_value() )
118 aAngleShift = transform->m_Rotation;
wxString result
Test unit parsing edge cases and error handling.
VECTOR2I GetRotated(const VECTOR2I &aVector, const EDA_ANGLE &aAngle)
Return a new VECTOR2I that is the result of rotating aVector by aAngle.