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 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 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, see <https://www.gnu.org/licenses/>.
18 */
19
20#ifndef ARRAY_AXIS__H
21#define ARRAY_AXIS__H
22
23#include <kicommon.h>
24#include <optional>
25
26#include <wx/string.h>
27
36{
37public:
52
56 static bool TypeIsNumeric( NUMBERING_TYPE type )
57 {
58 return type == NUMBERING_NUMERIC || type == NUMBERING_HEX;
59 };
60
61 ARRAY_AXIS();
62
68 const wxString& GetAlphabet() const;
69
73 void SetAxisType( NUMBERING_TYPE aType );
74
79 bool SetOffset( const wxString& aOffsetName );
80
87 void SetOffset( int aOffset );
88
94 int GetOffset() const;
95
100 void SetStep( int aStep );
101
108 wxString GetItemNumber( int n ) const;
109
110private:
117 std::optional<int> getNumberingOffset( const wxString& str ) const;
118
121
124
127};
128
129#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:36
int m_step
Skip every 'n' numbers.
Definition array_axis.h:123
NUMBERING_TYPE m_type
Definition array_axis.h:119
bool m_useLowercase
Output lowercase letters when true (for alphabetic types).
Definition array_axis.h:126
static bool TypeIsNumeric(NUMBERING_TYPE type)
Check if a numbering type is a numeric type.
Definition array_axis.h:56
@ NUMBERING_NUMERIC
Arabic numerals: 0,1,2,3,4,5,6,7,8,9,10,11...
Definition array_axis.h:40
@ NUMBERING_ALPHA_NO_IOSQXZ
Alphabet, excluding IOSQXZ.
Definition array_axis.h:49
@ NUMBERING_ALPHA_FULL
Full 26-character alphabet.
Definition array_axis.h:50
#define KICOMMON_API
Definition kicommon.h:27