KiCad PCB EDA Suite
Loading...
Searching...
No Matches
grid_settings.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 (C) 2023 Mike Williams <[email protected]>
5 * Copyright (C) 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, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21#ifndef _GRID_SETTINGS_H
22#define _GRID_SETTINGS_H
23
24#include <eda_units.h>
25#include <wx/string.h>
26#include <nlohmann/json_fwd.hpp>
27
28class UNITS_PROVIDER;
29
34{
35 bool operator==( const GRID& aOther ) const;
36
41 wxString MessageText( EDA_IU_SCALE aScale, EDA_UNITS aUnits, bool aDisplayUnits = true ) const;
42
47 wxString UserUnitsMessageText( UNITS_PROVIDER* aProvider, bool aDisplayUnits = true ) const;
48
49 VECTOR2D ToDouble( EDA_IU_SCALE aScale ) const;
50
51 wxString name;
52 wxString x;
53 wxString y;
54};
55
56KICOMMON_API bool operator!=( const GRID& lhs, const GRID& rhs );
57KICOMMON_API bool operator<( const GRID& lhs, const GRID& rhs );
58
59KICOMMON_API void to_json( nlohmann::json& j, const GRID& g );
60KICOMMON_API void from_json( const nlohmann::json& j, GRID& g );
61
62
64{
66 std::vector<GRID> grids;
67 wxString user_grid_x;
68 wxString user_grid_y;
72 double line_width;
74 bool show;
75 int style;
76 int snap;
89};
90
91#endif
bool operator==(const wxAuiPaneInfo &aLhs, const wxAuiPaneInfo &aRhs)
EDA_UNITS
Definition: eda_units.h:46
KICOMMON_API bool operator<(const GRID &lhs, const GRID &rhs)
KICOMMON_API void to_json(nlohmann::json &j, const GRID &g)
KICOMMON_API void from_json(const nlohmann::json &j, GRID &g)
KICOMMON_API bool operator!=(const GRID &lhs, const GRID &rhs)
#define KICOMMON_API
Definition: kicommon.h:28
wxString user_grid_x
Definition: grid_settings.h:67
int override_connected_idx
Definition: grid_settings.h:80
double line_width
Definition: grid_settings.h:72
bool overrides_enabled
Definition: grid_settings.h:78
bool override_graphics
Definition: grid_settings.h:87
bool override_connected
Definition: grid_settings.h:79
bool force_component_snap
Definition: grid_settings.h:77
std::vector< GRID > grids
Definition: grid_settings.h:66
int override_graphics_idx
Definition: grid_settings.h:88
int override_wires_idx
Definition: grid_settings.h:82
wxString user_grid_y
Definition: grid_settings.h:68
double min_spacing
Definition: grid_settings.h:73
Common grid settings, available to every frame.
Definition: grid_settings.h:34
wxString y
Definition: grid_settings.h:53
wxString x
Definition: grid_settings.h:52
wxString name
Definition: grid_settings.h:51