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 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
90
91#endif
bool operator==(const wxAuiPaneInfo &aLhs, const wxAuiPaneInfo &aRhs)
EDA_UNITS
Definition eda_units.h:48
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
int override_connected_idx
bool override_connected
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.
VECTOR2D ToDouble(EDA_IU_SCALE aScale) const
wxString x
wxString name
VECTOR2< double > VECTOR2D
Definition vector2d.h:694