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 The 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
18 * along with this program. If not, see <https://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
30namespace KIGFX
31{
32enum class GRID_STYLE;
33enum class GRID_SNAPPING;
34} // namespace KIGFX
35
40{
41 bool operator==( const GRID& aOther ) const;
42
47 wxString MessageText( EDA_IU_SCALE aScale, EDA_UNITS aUnits, bool aDisplayUnits = true ) const;
48
53 wxString UserUnitsMessageText( UNITS_PROVIDER* aProvider, bool aDisplayUnits = true ) const;
54
55 VECTOR2D ToDouble( EDA_IU_SCALE aScale ) const;
56
57 wxString name;
58 wxString x;
59 wxString y;
60};
61
62KICOMMON_API bool operator!=( const GRID& lhs, const GRID& rhs );
63KICOMMON_API bool operator<( const GRID& lhs, const GRID& rhs );
64
65KICOMMON_API void to_json( nlohmann::json& j, const GRID& g );
66KICOMMON_API void from_json( const nlohmann::json& j, GRID& g );
67
68
97
98#endif
bool operator==(const wxAuiPaneInfo &aLhs, const wxAuiPaneInfo &aRhs)
EDA_UNITS
Definition eda_units.h:44
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:27
The Cairo implementation of the graphics abstraction layer.
Definition eda_group.h:30
GRID_STYLE
Type definition of the grid style.
KIGFX::GRID_SNAPPING snap
wxString user_grid_x
int override_connected_idx
bool override_connected
KIGFX::GRID_STYLE style
bool force_component_snap
std::vector< GRID > grids
int override_graphics_idx
wxString user_grid_y
Common grid settings, available to every frame.
wxString UserUnitsMessageText(UNITS_PROVIDER *aProvider, bool aDisplayUnits=true) const
Returns a string representation of the grid in the user's units.
wxString y
wxString MessageText(EDA_IU_SCALE aScale, EDA_UNITS aUnits, bool aDisplayUnits=true) const
Returns a string representation of the grid in specified units.
wxString x
wxString name
VECTOR2< double > VECTOR2D
Definition vector2d.h:707
double ToDouble(KI_INT128 aValue)
Definition wide_int.h:94