2018-10-25 00:19:38 +00:00
|
|
|
#ifndef DUST3D_BONE_MARK_H
|
|
|
|
#define DUST3D_BONE_MARK_H
|
|
|
|
#include <QColor>
|
|
|
|
#include <QString>
|
|
|
|
|
|
|
|
enum class BoneMark
|
|
|
|
{
|
|
|
|
None = 0,
|
|
|
|
Neck,
|
2018-11-01 15:24:06 +00:00
|
|
|
Limb,
|
2018-11-06 16:26:19 +00:00
|
|
|
Tail,
|
2018-11-01 15:24:06 +00:00
|
|
|
Joint,
|
2018-10-25 00:19:38 +00:00
|
|
|
Count
|
|
|
|
};
|
2018-11-06 16:26:19 +00:00
|
|
|
#define BoneMarkHasSide(mark) ((mark) == BoneMark::Limb)
|
2018-10-25 00:19:38 +00:00
|
|
|
QColor BoneMarkToColor(BoneMark mark);
|
|
|
|
#define IMPL_BoneMarkToColor \
|
|
|
|
QColor BoneMarkToColor(BoneMark mark) \
|
|
|
|
{ \
|
|
|
|
switch (mark) { \
|
|
|
|
case BoneMark::Neck: \
|
2018-11-07 08:02:55 +00:00
|
|
|
return QColor(0xfd, 0x64, 0x61); \
|
2018-11-06 16:26:19 +00:00
|
|
|
case BoneMark::Limb: \
|
2018-10-25 00:19:38 +00:00
|
|
|
return QColor(0x29, 0xfd, 0x2f); \
|
2018-11-06 16:26:19 +00:00
|
|
|
case BoneMark::Tail: \
|
2018-10-25 00:19:38 +00:00
|
|
|
return QColor(0xff, 0xfd, 0x38); \
|
2018-11-01 15:24:06 +00:00
|
|
|
case BoneMark::Joint: \
|
2018-11-06 16:26:19 +00:00
|
|
|
return QColor(0xcf, 0x83, 0xe1); \
|
2018-10-25 00:19:38 +00:00
|
|
|
case BoneMark::None: \
|
|
|
|
return Qt::transparent; \
|
|
|
|
default: \
|
|
|
|
return Qt::transparent; \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
const char *BoneMarkToString(BoneMark mark);
|
|
|
|
#define IMPL_BoneMarkToString \
|
|
|
|
const char *BoneMarkToString(BoneMark mark) \
|
|
|
|
{ \
|
|
|
|
switch (mark) { \
|
|
|
|
case BoneMark::Neck: \
|
|
|
|
return "Neck"; \
|
2018-11-01 15:24:06 +00:00
|
|
|
case BoneMark::Limb: \
|
|
|
|
return "Limb"; \
|
2018-11-06 16:26:19 +00:00
|
|
|
case BoneMark::Tail: \
|
|
|
|
return "Tail"; \
|
2018-11-01 15:24:06 +00:00
|
|
|
case BoneMark::Joint: \
|
|
|
|
return "Joint"; \
|
2018-10-25 00:19:38 +00:00
|
|
|
case BoneMark::None: \
|
|
|
|
return "None"; \
|
|
|
|
default: \
|
|
|
|
return "None"; \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
BoneMark BoneMarkFromString(const char *markString);
|
|
|
|
#define IMPL_BoneMarkFromString \
|
|
|
|
BoneMark BoneMarkFromString(const char *markString) \
|
|
|
|
{ \
|
|
|
|
QString mark = markString; \
|
|
|
|
if (mark == "Neck") \
|
|
|
|
return BoneMark::Neck; \
|
2018-11-01 15:24:06 +00:00
|
|
|
if (mark == "Limb") \
|
|
|
|
return BoneMark::Limb; \
|
2018-11-06 16:26:19 +00:00
|
|
|
if (mark == "Tail") \
|
|
|
|
return BoneMark::Tail; \
|
2018-11-01 15:24:06 +00:00
|
|
|
if (mark == "Joint") \
|
|
|
|
return BoneMark::Joint; \
|
2018-10-25 00:19:38 +00:00
|
|
|
return BoneMark::None; \
|
|
|
|
}
|
|
|
|
QString BoneMarkToDispName(BoneMark mark);
|
|
|
|
#define IMPL_BoneMarkToDispName \
|
|
|
|
QString BoneMarkToDispName(BoneMark mark) \
|
|
|
|
{ \
|
|
|
|
switch (mark) { \
|
|
|
|
case BoneMark::Neck: \
|
|
|
|
return QObject::tr("Neck"); \
|
2018-11-01 15:24:06 +00:00
|
|
|
case BoneMark::Limb: \
|
2018-11-06 16:26:19 +00:00
|
|
|
return QObject::tr("Limb"); \
|
|
|
|
case BoneMark::Tail: \
|
|
|
|
return QObject::tr("Tail"); \
|
2018-11-01 15:24:06 +00:00
|
|
|
case BoneMark::Joint: \
|
2018-11-06 16:26:19 +00:00
|
|
|
return QObject::tr("Joint"); \
|
2018-10-25 00:19:38 +00:00
|
|
|
case BoneMark::None: \
|
|
|
|
return QObject::tr("None"); \
|
|
|
|
default: \
|
|
|
|
return ""; \
|
|
|
|
} \
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|