KiCad PCB EDA Suite
Loading...
Searching...
No Matches
array_axis.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) 2019 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 2
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/old-licenses/gpl-2.0.html
19 * or you may search the http://www.gnu.org website for the version 2 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 ARRAY_AXIS__H
25#define ARRAY_AXIS__H
26
27#include <kicommon.h>
28#include <optional>
29
30#include <wx/string.h>
31
40{
41public:
43 {
44 NUMBERING_NUMERIC = 0,
46 NUMBERING_ALPHA_NO_IOSQXZ,
53 };
54
55 ARRAY_AXIS();
56
62 const wxString& GetAlphabet() const;
63
67 void SetAxisType( NUMBERING_TYPE aType );
68
73 bool SetOffset( const wxString& aOffsetName );
74
81 void SetOffset( int aOffset );
82
88 int GetOffset() const;
89
94 void SetStep( int aStep );
95
102 wxString GetItemNumber( int n ) const;
103
104private:
111 std::optional<int> getNumberingOffset( const wxString& str ) const;
112
115
118};
119
120#endif // ARRAY_AXIS__H
Class that contains information about a single array axis and the numbering of items along that axis.
Definition: array_axis.h:40
int m_offset
Skip every 'n' numbers.
Definition: array_axis.h:114
NUMBERING_TYPE m_type
Definition: array_axis.h:113
@ NUMBERING_HEX
Definition: array_axis.h:45
@ NUMBERING_ALPHA_FULL
Full 26-character alphabet.
Definition: array_axis.h:52
#define KICOMMON_API
Definition: kicommon.h:28