Engauge Digitizer 2
Loading...
Searching...
No Matches
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
10typedef QHash<CentipedeState, QString> CentipedeStateHash;
11
12static CentipedeStateHash centipedeStateHash;
13
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}
QHash< CentipedeState, QString > CentipedeStateHash
QString centipedeStateAsString(CentipedeState state)
CentipedeState
Set of possible states of Centipede construction.
@ CENTIPEDE_STATE_BUILD_CARTESIAN
@ CENTIPEDE_STATE_PREBUILD
@ CENTIPEDE_STATE_BUILD_POLAR