KiCad PCB EDA Suite
Loading...
Searching...
No Matches
dialog_kicad_merge_3way.h
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 The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License
8 * as published by the Free Software Foundation; either version 3
9 * of the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, you may find one here:
18 * http://www.gnu.org/licenses/gpl-3.0.html
19 * or you may search the http://www.gnu.org website for the version 3 license,
20 * or you may write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
22 */
23
24#ifndef DIALOG_KICAD_MERGE_3WAY_H
25#define DIALOG_KICAD_MERGE_3WAY_H
26
28
31
32#include <map>
33
34
36
37
52{
53public:
74
75 DIALOG_KICAD_MERGE_3WAY( wxWindow* aParent, const KICAD_DIFF::MERGE_PLAN& aPlan,
76 CONFLICT_CONTEXT aContext = {} );
77
78 ~DIALOG_KICAD_MERGE_3WAY() override = default;
79
83
84protected:
85 void OnClose( wxCloseEvent& aEvent ) override;
86 void OnConflictSelected( wxCommandEvent& aEvent ) override;
87 void OnResolutionChanged( wxCommandEvent& aEvent ) override;
88 void OnApply( wxCommandEvent& aEvent ) override;
89 void OnCancel( wxCommandEvent& aEvent ) override;
90
91private:
93 void buildList();
94
96 void showConflict( int aIndex );
97
101 void rebuildCanvas();
102
104 enum class SIDE { OURS, THEIRS, ANCESTOR };
105 SIDE activeSide() const;
106
109
111 std::vector<std::size_t> m_conflictActionIndex;
112
115
119};
120
121#endif // DIALOG_KICAD_MERGE_3WAY_H
DIALOG_KICAD_MERGE_3WAY_BASE(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &title=_("Resolve Merge Conflicts"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(950, 700), long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
const KICAD_DIFF::MERGE_PLAN & GetResolvedPlan() const
Returns the plan with the user's resolutions applied.
void OnConflictSelected(wxCommandEvent &aEvent) override
DIALOG_KICAD_MERGE_3WAY(wxWindow *aParent, const KICAD_DIFF::MERGE_PLAN &aPlan, CONFLICT_CONTEXT aContext={})
void OnApply(wxCommandEvent &aEvent) override
void OnCancel(wxCommandEvent &aEvent) override
void rebuildCanvas()
Rebuild the canvas scene from the current side (per radio) and the active conflict's bbox.
void OnClose(wxCloseEvent &aEvent) override
WIDGET_DIFF_CANVAS * m_canvas
GAL-backed conflict viewer injected into the resolution panel.
KICAD_DIFF::MERGE_PLAN m_plan
int m_currentConflict
Currently-displayed conflict (index into m_conflictActionIndex), -1 if none.
void showConflict(int aIndex)
Update the detail panel for the selected conflict.
void buildList()
Populate the conflict list from the plan's unresolved items.
SIDE
Which side's geometry the canvas should currently display.
void OnResolutionChanged(wxCommandEvent &aEvent) override
~DIALOG_KICAD_MERGE_3WAY() override=default
std::vector< std::size_t > m_conflictActionIndex
Indices into m_plan.actions matching the order of m_listConflicts.
GAL-backed canvas for visualizing a KICAD_DIFF::DIFF_SCENE.
Phase 8 context for the conflict canvas.
std::map< KIID_PATH, BOX2I > ancestorBBoxes
Per-side bbox of each conflicting item.
Aggregate of background geometry extracted from one source document.
Definition diff_scene.h:163
Result of planning a 3-way merge.