Engauge Digitizer
2
Toggle main menu visibility
Loading...
Searching...
No Matches
Centipede
CentipedeState.cpp
Go to the documentation of this file.
1
/******************************************************************************************************
2
* (C) 2020 markummitchell@github.com. This file is part of Engauge Centipeder, which is released *
3
* under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4
* LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5
******************************************************************************************************/
6
7
#include "
CentipedeState.h
"
8
#include <QHash>
9
10
typedef
QHash<CentipedeState, QString>
CentipedeStateHash
;
11
12
static
CentipedeStateHash
centipedeStateHash;
13
14
QString
centipedeStateAsString
(
CentipedeState
state)
15
{
16
if
(centipedeStateHash.size () == 0) {
17
18
// First time through we load the hash
19
centipedeStateHash [
CENTIPEDE_STATE_BUILD_CARTESIAN
] =
"CentipedeStateBuildCartesian"
;
20
centipedeStateHash [
CENTIPEDE_STATE_BUILD_POLAR
] =
"CentipedeStateBuildPolar"
;
21
centipedeStateHash [
CENTIPEDE_STATE_PREBUILD
] =
"CentipedeStatePrebuild"
;
22
}
23
24
if
(centipedeStateHash.contains (state)) {
25
return
centipedeStateHash [state];
26
}
else
{
27
return
"?"
;
28
}
29
}
CentipedeStateHash
QHash< CentipedeState, QString > CentipedeStateHash
Definition
CentipedeState.cpp:10
centipedeStateAsString
QString centipedeStateAsString(CentipedeState state)
Definition
CentipedeState.cpp:14
CentipedeState.h
CentipedeState
CentipedeState
Set of possible states of Centipede construction.
Definition
CentipedeState.h:13
CENTIPEDE_STATE_BUILD_CARTESIAN
@ CENTIPEDE_STATE_BUILD_CARTESIAN
Definition
CentipedeState.h:14
CENTIPEDE_STATE_PREBUILD
@ CENTIPEDE_STATE_PREBUILD
Definition
CentipedeState.h:16
CENTIPEDE_STATE_BUILD_POLAR
@ CENTIPEDE_STATE_BUILD_POLAR
Definition
CentipedeState.h:15
Generated on
for Engauge Digitizer by
1.17.0