Files
qt5-legatus-legacy/Lts/Viewer/SituationMap/SymbologyXML/symbol.cpp
T
2026-08-13 18:33:10 +02:00

1200 lines
53 KiB
C++
Executable File

/**
* @RDE_HEADER@
* $Id$
* $HeadURL$
* $Author$
*/
#include "symbol.h"
#include "attribute_data.h"
#include "primitive.h"
#include "symbol_table.h"
#include "symbol_reader.h"
#include <algorithm>
#include <iostream>
#include <QLinkedListIterator>
#include <QList>
#include <QPointF>
#include <QTransform>
#include <NGLLogger/NGLLoggerBootstrap.h>
namespace SymbologyXML
{
SymbologyXML::SymbolTypes::t_affil Symbol::roleToAffiliation(AdvancedSymbology::Role role)
{
switch (role) {
case AdvancedSymbology::Role::Pending:
return SymbologyXML::SymbolTypes::PENDING;
case AdvancedSymbology::Role::Unknown:
return SymbologyXML::SymbolTypes::UNKNOWN;
case AdvancedSymbology::Role::AssumedFriend:
return SymbologyXML::SymbolTypes::ASSUMED_FRIEND;
case AdvancedSymbology::Role::Friend:
return SymbologyXML::SymbolTypes::FRIEND;
case AdvancedSymbology::Role::Neutral:
return SymbologyXML::SymbolTypes::NEUTRAL;
case AdvancedSymbology::Role::SuspectJoker:
return SymbologyXML::SymbolTypes::SUSPECT;
case AdvancedSymbology::Role::HostileFaker:
return SymbologyXML::SymbolTypes::ENEMY;
} // switch
return SymbologyXML::SymbolTypes::AFFIL_UNDEFINED;
} // SymbologyXML::SymbolTypes::t_affil Symbol::roleToAffiliation(Role role)
// 1.0 Guez & TES-UAE
// 2.0 APP6(C)-Erweiterung (ab 2011/07)
#ifdef APP6C
const char* Symbol::SymbolVersion = "2.0";
#else
const char* Symbol::SymbolVersion = "1.0";
#endif //APP6C
bool Symbol::initMatrixDone = false;
QMap<QPair<SymbolTypes::t_dimen, SymbolTypes::t_affil>, Symbol::Matrix> Symbol::_matrixMapBCDAB;
QMap<QPair<SymbolTypes::t_dimen, SymbolTypes::t_affil>, Symbol::Matrix> Symbol::_matrixMapCommandLevel;
QMap<QPair<SymbolTypes::t_dimen, SymbolTypes::t_affil>, Symbol::Matrix> Symbol::_matrixMapBranch;
Symbol::Symbol()
: logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("AdvSymbologyXML.Symbol")),
_bbCacheValid(false),
_id(0),
_name(QString()),
_textType(TEXT_UNDEFINED),
_maxStringLength(0),
_dimen(SymbolTypes::DIMEN_UNDEFINED),
_affil(SymbolTypes::AFFIL_UNDEFINED),
_bcd_ab(SymbolTypes::BCDAB_UNDEFINED),
_commandlevel(SymbolTypes::CL_UNDEFINED),
_headquarter(false),
_mob(SymbolTypes::MOB_UNDEFINED),
_vehicle(SymbolTypes::VEHICLE_UNDEFINED),
_intrinsicmob(SymbolTypes::INTRINSICMOB_UNDEFINED),
_arming(SymbolTypes::ARMING_UNDEFINED),
#ifdef APP6C
_sector1(SymbolTypes::SEC1_UNDEFINED),
_sectoricon(SymbolTypes::SECICON_UNDEFINED),
#endif // APP6C
_transformed(false),
_scale(1.0),
_changeCount(0),
_classId(0)
{
DEBUG_LOG(logger) << LOGFUNCTION ;
reset();
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
} // Symbol::Symbol()
Symbol::~Symbol() {
DEBUG_LOG(logger) << LOGFUNCTION ;
qDeleteAll(_primitives);
_primitives.clear();
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
} // ~Symbol()
Symbol::Symbol(const Symbol& other)
: logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("AdvSymbologyXML.Symbol")),
_changeCount(0)
{
DEBUG_LOG(logger) << LOGFUNCTION ;
reset();
*this = other;
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
} // Symbol::Symbol(const Symbol& other)
Symbol& Symbol::operator=(const Symbol& other) {
DEBUG_LOG(logger) << LOGFUNCTION ;
reset();
// Attributes
_id = other._id;
_dimen = other._dimen;
_affil = other._affil;
_bcd_ab = other._bcd_ab;
_commandlevel = other._commandlevel;
_headquarter = other._headquarter;
_mob = other._mob;
_vehicle = other._vehicle;
_intrinsicmob = other._intrinsicmob;
_arming = other._arming;
_miscTags = other._miscTags;
_transformed = other._transformed;
// Symbols name
_name = other._name;
_sector1 = other._sector1;
_sectoricon = other._sectoricon;
// Branches
_branchTags = other._branchTags;
// Text
_textType = other._textType;
_line1 = other._line1;
_line2 = other._line2;
_line3 = other._line3;
_align1 = other._align1;
_align2 = other._align2;
_align3 = other._align3;
_maxStringLength = other._maxStringLength;
// Primitives
QLinkedListIterator<Primitive*> pi(other._primitives);
while ( pi.hasNext() ) {
_primitives.append(new Primitive(*pi.next()));
}
_scale = other._scale;
_bbCacheValid = other._bbCacheValid;
++_changeCount;
// APP6-Classification
_classId = other._classId;
_className = other._className;
_classHierarchy = other._classHierarchy;
_classCodeId = other._classCodeId;
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
return *this;
} // Symbol& Symbol::operator=(const Symbol& other)
bool Symbol::operator==(const Symbol& other) const {
DEBUG_LOG(logger) << LOGFUNCTION ;
bool result = true;
// Attributes
result &= _dimen == other._dimen;
result &= _bcd_ab == other._bcd_ab;
result &= _commandlevel == other._commandlevel;
result &= _headquarter == other._headquarter;
result &= _mob == other._mob;
result &= _vehicle == other._vehicle;
result &= _intrinsicmob == other._intrinsicmob;
result &= _arming == other._arming;
result &= _miscTags == other._miscTags;
result &= _sector1 == other._sector1;
result &= _sectoricon == other._sectoricon;
// NOTE
// _affil is NOT compared, this is not an error, because _affil does not
// define a symbols property but a state.
//
// _id is not compared, because it is an identifier used in the database,
// but not really a part of the Symbols definition
//
// _name is not compared for the same reason. _name is used for describing
// the Symbols meaning in human-readable form.
// Branches
result &= _branchTags == other._branchTags;
// Text
result &= _textType == other._textType;
result &= _line1 == other._line1;
result &= _line2 == other._line2;
result &= _line3 == other._line3;
result &= _align1 == other._align1;
result &= _align2 == other._align2;
result &= _align3 == other._align3;
result &= _maxStringLength == other._maxStringLength;
// Primitives
if ( _primitives.count() != other._primitives.count() ) {
result = false;
} else {
QLinkedListIterator<Primitive*> pi0(other._primitives);
QLinkedListIterator<Primitive*> pi1(_primitives);
while ( pi0.hasNext() && pi1.hasNext() ) {
result &= *pi0.next() == *pi1.next();
}
}
result &= _scale == other._scale;
// APP6-Classification is NOT be compared
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
return result;
} // bool Symbol::operator==(const Symbol& other)
bool Symbol::operator!=(const Symbol& other) const {
DEBUG_LOG(logger) << LOGFUNCTION ;
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
return !(*this==other);
} // bool Symbol::operator!=(const Symbol& other)
bool Symbol::isAPP6() const {
DEBUG_LOG(logger) << LOGFUNCTION ;
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
return ((getAffil() != SymbolTypes::AFFIL_UNDEFINED) &&
(getDimen() != SymbolTypes::DIMEN_UNDEFINED));
} // bool Symbol::isAPP6() const
void Symbol::toZDv1_11(Symbol* dimen_affil,
Symbol* bcdab,
Symbol* commandlevel,
Symbol* mobility,
Symbol* vehicle,
Symbol* intrinsicMobility,
Symbol* arming,
const QList<Symbol*> &miscs,
const QList<Symbol*> &branches,
const SymbolTypes::AdditionalSymbolData &additionalData
) {
DEBUG_LOG(logger) << LOGFUNCTION ;
if ( dimen_affil != nullptr ) {
QLinkedListIterator<Primitive*> p_dimen_affil(dimen_affil->getPrimitives());
while ( p_dimen_affil.hasNext() ) {
Primitive *prim = new Primitive(*p_dimen_affil.next());
if(additionalData.m_filltype == SymbolTypes::FILLTYPE_FILLED) {
prim->setFill(true);
}
_primitives.append(prim);
}
_affil = SymbolTypes::AFFIL_UNDEFINED;
_dimen = SymbolTypes::DIMEN_UNDEFINED;
}
if ( bcdab != nullptr ) {
QLinkedListIterator<Primitive*> p_bcdab(bcdab->getPrimitives());
while ( p_bcdab.hasNext() ) {
_primitives.append(new Primitive(*p_bcdab.next()));
}
_bcd_ab = SymbolTypes::BCDAB_UNDEFINED;
}
if ( commandlevel != nullptr ) {
QLinkedListIterator<Primitive*> p_commandlevel(commandlevel->getPrimitives());
while ( p_commandlevel.hasNext() ) {
_primitives.append(new Primitive(*p_commandlevel.next()));
}
_commandlevel = SymbolTypes::CL_UNDEFINED;
}
if ( mobility != nullptr ) {
QLinkedListIterator<Primitive*> p_mob(mobility->getPrimitives());
while ( p_mob.hasNext() ) {
_primitives.append(new Primitive(*p_mob.next()));
}
_mob = SymbolTypes::MOB_UNDEFINED;
}
if ( vehicle != nullptr ) {
QLinkedListIterator<Primitive*> p_vehicle(vehicle->getPrimitives());
while ( p_vehicle.hasNext() ) {
_primitives.append(new Primitive(*p_vehicle.next()));
}
_vehicle = SymbolTypes::VEHICLE_UNDEFINED;
}
if ( intrinsicMobility != nullptr ) {
QLinkedListIterator<Primitive*> p_intrinsicmob(intrinsicMobility->getPrimitives());
while ( p_intrinsicmob.hasNext() ) {
_primitives.append(new Primitive(*p_intrinsicmob.next()));
}
_intrinsicmob = SymbolTypes::INTRINSICMOB_UNDEFINED;
}
if ( arming != nullptr ) {
QLinkedListIterator<Primitive*> p_arming(arming->getPrimitives());
while ( p_arming.hasNext() ) {
_primitives.append(new Primitive(*p_arming.next()));
}
_arming = SymbolTypes::ARMING_UNDEFINED;
}
for (Symbol* symbol : qAsConst(miscs)) {
if (symbol) {
QLinkedListIterator<Primitive*> p_miscs(symbol->getPrimitives());
while ( p_miscs.hasNext() ) {
_primitives.append(new Primitive(*p_miscs.next()));
}
}
_miscTags.fill(false);
}
for (Symbol* symbol : qAsConst(branches)) {
if (symbol) {
QLinkedListIterator<Primitive*> p_branches(symbol->getPrimitives());
while ( p_branches.hasNext() ) {
_primitives.append(new Primitive(*p_branches.next()));
}
}
_branchTags.fill(false);
}
// Fix Primitives
QMutableLinkedListIterator<Primitive*> pi(_primitives);
while ( pi.hasNext() ) {
Primitive *tmpP = pi.next();
if ( tmpP->getLineWidth() < 0.0 ) {
tmpP->setLineWidth(0.0);
}
}
++_changeCount;
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
} // void Symbol::toZDv1_11(Symbol* dimen_affil, ...)
void Symbol::reset() {
DEBUG_LOG(logger) << LOGFUNCTION ;
// Attributes
_dimen = SymbolTypes::DIMEN_UNDEFINED;
_affil = SymbolTypes::AFFIL_UNDEFINED;
_bcd_ab = SymbolTypes::BCDAB_UNDEFINED;
_commandlevel = SymbolTypes::CL_UNDEFINED;
_headquarter = false;
_mob = SymbolTypes::MOB_UNDEFINED;
_intrinsicmob = SymbolTypes::INTRINSICMOB_UNDEFINED;
_miscTags.clear();
_miscTags.resize(SymbolTypes::MISC_LAST);
_sector1 = SymbolTypes::SEC1_UNDEFINED;
_sectoricon = SymbolTypes::SECICON_UNDEFINED;
// Name and ID
_id = -1;
_name.clear();
// Reset Branch-Tags
_branchTags.clear();
_branchTags.resize(SymbolTypes::BRANCH_LAST);
// Reset text-type and texts
_textType = TEXT_UNDEFINED;
_line1.clear();
_line2.clear();
_line3.clear();
_align1 = ALIGNMENT_UNDEFINED;
_align2 = ALIGNMENT_UNDEFINED;
_align3 = ALIGNMENT_UNDEFINED;
// Remove all primitives
qDeleteAll(_primitives);
_primitives.clear();
_scale = 1.0;
_bbCacheValid = false;
_boundingBox[0] = 0.0;
_boundingBox[1] = 0.0;
_boundingBox[2] = 0.0;
_boundingBox[3] = 0.0;
// Init the Matrix-Maps for Primitive-Transformations
Symbol::initMatrixMaps();
// APP6-Classification
_classId = 0;
_className.clear();
_classHierarchy.clear();
_classCodeId.clear();
++_changeCount;
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
} // void Symbol::reset()
void Symbol::addBranch(SymbolTypes::t_branch branch) {
DEBUG_LOG(logger) << LOGFUNCTION ;
if (_branchTags.setBit(branch))
{
_bbCacheValid = false;
++_changeCount;
}
else
{
ERROR_LOG(logger) << "Branch out of range: " << branch ;
}
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
} // void Symbol::addBranch(t_branch branch)
void Symbol::removeBranch(SymbolTypes::t_branch branch) {
DEBUG_LOG(logger) << LOGFUNCTION ;
if (_branchTags.clearBit(branch))
{
_bbCacheValid = false;
++_changeCount;
}
else
{
ERROR_LOG(logger) << "Branch out of range: " << branch ;
}
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
} // void Symbol::removeBranch(t_branch branch)
void Symbol::setTextType(t_text t) {
DEBUG_LOG(logger) << LOGFUNCTION ;
_textType = t;
switch (t) {
case TEXT1:
setMaxStringLength(4);
break;
case TEXT2:
setMaxStringLength(5);
break;
case TEXT3:
default:
setMaxStringLength(6);
break;
}
++_changeCount;
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
} // void Symbol::setTextType(t_text t)
void Symbol::setText(const QString &line1, t_alignment align1,
const QString &line2, t_alignment align2,
const QString &line3, t_alignment align3) {
DEBUG_LOG(logger) << LOGFUNCTION ;
if ( _textType >= TEXT1 ) {
_line1 = line1;
_align1 = align1;
}
if ( _textType >= TEXT2 ) {
_line2 = line2;
_align2 = align2;
}
if ( _textType >= TEXT3 ) {
_line3 = line3;
_align3 = align3;
}
++_changeCount;
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
} // void Symbol::setText(const QString &line1, ...)
QString Symbol::getText(unsigned int line) const {
DEBUG_LOG(logger) << LOGFUNCTION ;
QString result;
switch (line) {
case 1:
result = _line1;
break;
case 2:
result = _line2;
break;
case 3:
result = _line3;
break;
default:
break;
}
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
return result;
} // QString Symbol::getText(unsigned int line) const
Symbol::t_alignment Symbol::getTextAlign(unsigned int line) const {
DEBUG_LOG(logger) << LOGFUNCTION ;
switch (line) {
case 1: return _align1;
case 2: return _align2;
case 3: return _align3;
default: return Symbol::ALIGNMENT_UNDEFINED;
}
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
} // t_alignment Symbol::getTextAlign(unsigned int line) const
void Symbol::addMisc(SymbolTypes::t_misc misc) {
DEBUG_LOG(logger) << LOGFUNCTION ;
if (_miscTags.setBit(misc))
{
_bbCacheValid = false;
++_changeCount;
}
else
{
ERROR_LOG(logger) << "Misc out of range: " << misc ;
}
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
} // void Symbol::addMisc(t_branch branch)
void Symbol::removeMisc(SymbolTypes::t_misc misc) {
DEBUG_LOG(logger) << LOGFUNCTION ;
if (_miscTags.clearBit(misc))
{
_bbCacheValid = false;
++_changeCount;
}
else
{
ERROR_LOG(logger) << "Misc out of range: " << misc ;
}
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
} // void Symbol::removeMisc(t_branch branch)
bool Symbol::addPrimitive(Primitive* p) {
DEBUG_LOG(logger) << LOGFUNCTION ;
QLinkedListIterator<Primitive*> pi(_primitives);
while ( pi.hasNext() ) {
unsigned int id = (pi.next())->id();
if ( id == p->id() ) {
return true;
}
}
_primitives.append(p);
_bbCacheValid = false;
_transformed = false;
++_changeCount;
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
return true;
} // bool Symbol::addPrimitive(Promitive* p)
void Symbol::removePrimitive(unsigned int id) {
DEBUG_LOG(logger) << LOGFUNCTION ;
QMutableLinkedListIterator<Primitive*> pi(_primitives);
while ( pi.hasNext() ) {
Primitive *tmpP = pi.next();
if ( tmpP->id() == id ) {
pi.remove();
delete tmpP;
_bbCacheValid = false;
++_changeCount;
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
return;
}
}
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
} // void Symbol::removePrimitive(unsigned int id)
void Symbol::removePrimitive(SymbolTypes::t_misc misc) {
DEBUG_LOG(logger) << LOGFUNCTION ;
QMutableLinkedListIterator<Primitive*> pi(_primitives);
while ( pi.hasNext() ) {
Primitive *tmpP = pi.next();
if ( (tmpP->iconType() == SymbolTypes::ICON_TYPE_MISC) &&
(tmpP->icon() == (int)misc)
) {
pi.remove();
delete tmpP;
_bbCacheValid = false;
++_changeCount;
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
return;
}
}
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
} // void Symbol::removePrimitive(SymbolTypes::t_misc misc)
void Symbol::removePrimitive(SymbolTypes::t_sectoricon sectoricon) {
DEBUG_LOG(logger) << LOGFUNCTION ;
QMutableLinkedListIterator<Primitive*> pi(_primitives);
while ( pi.hasNext() ) {
Primitive *tmpP = pi.next();
if ( (tmpP->iconType() == SymbolTypes::ICON_TYPE_SECTOR_ICON) &&
(tmpP->icon() == (int)sectoricon)
) {
pi.remove();
delete tmpP;
_bbCacheValid = false;
++_changeCount;
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
return;
}
}
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
} // void Symbol::removePrimitive(SymbolTypes::t_sectoricon sectoricon)
void Symbol::removePrimitive(SymbolTypes::t_sectoricon secicon,
SymbolTypes::t_sector_position sectorPosition) {
DEBUG_LOG(logger) << LOGFUNCTION ;
QMutableLinkedListIterator<Primitive*> pi(_primitives);
while ( pi.hasNext() ) {
Primitive *tmpP = pi.next();
if ( (tmpP->iconType() == SymbolTypes::ICON_TYPE_SECTOR_ICON) &&
(tmpP->icon() == (int)secicon) &&
(tmpP->position() == sectorPosition)
) {
pi.remove();
delete tmpP;
_bbCacheValid = false;
++_changeCount;
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
return;
}
}
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
} // void Symbol::removePrimitive(secicon, sectorPosition)
bool Symbol::containsPrimitive(SymbolTypes::t_misc misc) const {
DEBUG_LOG(logger) << LOGFUNCTION ;
bool retContains = false;
QLinkedListIterator<Primitive*> pi(_primitives);
while ( pi.hasNext() ) {
const Primitive *tmpP = pi.next();
if ( (tmpP->iconType() == SymbolTypes::ICON_TYPE_MISC) &&
(tmpP->icon() == (int)misc)
) {
retContains = true;
break;
}
}
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
return retContains;
} // Symbol::containsPrimitive
bool Symbol::containsPrimitive(SymbolTypes::t_sectoricon secicon) const {
DEBUG_LOG(logger) << LOGFUNCTION ;
bool retContains = false;
QLinkedListIterator<Primitive*> pi(_primitives);
while ( pi.hasNext() ) {
const Primitive *tmpP = pi.next();
if ( (tmpP->iconType() == SymbolTypes::ICON_TYPE_SECTOR_ICON) &&
(tmpP->icon() == (int)secicon)
) {
retContains = true;
break;
}
}
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
return retContains;
} // Symbol::containsPrimitive
bool Symbol::containsPrimitive(SymbolTypes::t_icon_type iconType,
SymbolTypes::t_sector_position sectorPosition,
int id) const
{
DEBUG_LOG(logger) << LOGFUNCTION ;
bool retContains = false;
QLinkedListIterator<Primitive*> pi(_primitives);
while ( pi.hasNext() ) {
const Primitive *tmpP = pi.next();
if ( (tmpP->iconType() == iconType) &&
(tmpP->position() == sectorPosition) &&
(tmpP->icon() == id) ) {
retContains = true;
break;
}
}
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
return retContains;
} // Symbol::containsPrimitive
void Symbol::raisePrimitive(unsigned int id) {
DEBUG_LOG(logger) << LOGFUNCTION ;
QLinkedListIterator<Primitive*> pi(_primitives);
while ( pi.hasNext() ) {
if ( (pi.next())->id() == id ) {
pi.toFront();
++_changeCount;
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
return;
}
}
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
} // void Symbol::raisePrimitive(unsigned int id)
void Symbol::lowerPrimitive(unsigned int id) {
DEBUG_LOG(logger) << LOGFUNCTION ;
QLinkedListIterator<Primitive*> pi(_primitives);
while ( pi.hasNext() ) {
if ( (pi.next())->id() == id ) {
pi.toBack();
++_changeCount;
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
return;
}
}
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
} // void Symbol::lowerPrimitive(unsigned int id)
bool Symbol::getBoundingBox(double* x0, double* y0, double* x1, double* y1,
Symbol* dimen_affil, Symbol* bcdab,
Symbol* commandlevel, Symbol* mobility) {
DEBUG_LOG(logger) << LOGFUNCTION ;
if ( (_primitives.size() == 0) && (dimen_affil == nullptr) &&
(bcdab == nullptr) && (commandlevel == nullptr) && (mobility == nullptr) ) {
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
return false;
}
if ( !_bbCacheValid ) {
QLinkedListIterator<Primitive*> plist(_primitives);
// get first bbox of first primitive
plist.next()->getBoundingBox(_boundingBox[0],
_boundingBox[1],
_boundingBox[2],
_boundingBox[3]);
// Merge with remaining primitive-bounding-boxes
double bb[4];
while ( plist.hasNext() ) {
plist.next()->getBoundingBox(bb[0], bb[1],
bb[2], bb[3]);
_boundingBox[0] = std::min(_boundingBox[0], bb[0]);
_boundingBox[1] = std::min(_boundingBox[1], bb[1]);
_boundingBox[2] = std::max(_boundingBox[2], bb[2]);
_boundingBox[3] = std::max(_boundingBox[3], bb[3]);
}
// Get bounding boxes from attributes, if not nullptr and merge
if ( dimen_affil != nullptr ) {
if ( dimen_affil->getBoundingBox(&bb[0], &bb[1],
&bb[2], &bb[3],
nullptr, nullptr, nullptr, nullptr) ) {
_boundingBox[0] = std::min(_boundingBox[0], bb[0]);
_boundingBox[1] = std::min(_boundingBox[1], bb[1]);
_boundingBox[2] = std::max(_boundingBox[2], bb[2]);
_boundingBox[3] = std::max(_boundingBox[3], bb[3]);
}
}
if ( bcdab != nullptr ) {
if ( bcdab->getBoundingBox(&bb[0], &bb[1],
&bb[2], &bb[3],
nullptr, nullptr, nullptr, nullptr) ) {
_boundingBox[0] = std::min(_boundingBox[0], bb[0]);
_boundingBox[1] = std::min(_boundingBox[1], bb[1]);
_boundingBox[2] = std::max(_boundingBox[2], bb[2]);
_boundingBox[3] = std::max(_boundingBox[3], bb[3]);
}
}
if ( commandlevel != nullptr ) {
if ( commandlevel->getBoundingBox(&bb[0], &bb[1],
&bb[2], &bb[3],
nullptr, nullptr, nullptr, nullptr) ) {
_boundingBox[0] = std::min(_boundingBox[0], bb[0]);
_boundingBox[1] = std::min(_boundingBox[1], bb[1]);
_boundingBox[2] = std::max(_boundingBox[2], bb[2]);
_boundingBox[3] = std::max(_boundingBox[3], bb[3]);
}
}
if ( mobility != nullptr ) {
if ( mobility->getBoundingBox(&bb[0], &bb[1],
&bb[2], &bb[3],
nullptr, nullptr, nullptr, nullptr) ) {
_boundingBox[0] = std::min(_boundingBox[0], bb[0]);
_boundingBox[1] = std::min(_boundingBox[1], bb[1]);
_boundingBox[2] = std::max(_boundingBox[2], bb[2]);
_boundingBox[3] = std::max(_boundingBox[3], bb[3]);
}
}
}
_bbCacheValid = true;
*x0 = _boundingBox[0];
*y0 = _boundingBox[1];
*x1 = _boundingBox[2];
*y1 = _boundingBox[3];
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
return true;
} // bool Symbol::getBoundingBox(double* x0, double* y0, double* x1, double* y1,...)
void Symbol::rotatePrimitives() {
DEBUG_LOG(logger) << LOGFUNCTION ;
QLinkedListIterator<Primitive*> plist(_primitives);
while ( plist.hasNext() ) {
Primitive *p = plist.next();
if ( p->getRotation() != 0.0 ) {
++_changeCount;
p->rotate();
}
}
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
} // void Symbol::rotatePrimitives()
void Symbol::transformSymbol(t_transformMatrixGroup group, SymbolTable *bestMatchTable) {
DEBUG_LOG(logger) << LOGFUNCTION ;
QPair<SymbolTypes::t_dimen, SymbolTypes::t_affil> key(_dimen, _affil);
// Check, if there is a bestMatchTable and if it contains an already transformed symbol
if ( bestMatchTable != nullptr ) {
if ( bestMatchTable->contains(id()) ) {
QList<Symbol*> bestMatchList = bestMatchTable->values(id());
SymbolTypes::t_dimen local_dimen = this->getDimen();
// LAND_UNITS und ACTIVITY sind,
// bezogen auf Form/Shape des Rollensymbols gleich:
if(local_dimen == SymbolTypes::ACTIVITY) {
local_dimen = SymbolTypes::LAND_UNITS;
}
SymbolTypes::t_affil local_affil = this->getAffil();
// Wenn affil eines der neuen APP6C-spezifischen ist - konkret
// pending, assumed friend, suspect - so nutzen wir die passenden Matrizen:
// (Passend im Sinne der Form/Shape des Rollensymbols)
if (local_affil == SymbolTypes::PENDING)
local_affil = SymbolTypes::UNKNOWN;
if (local_affil == SymbolTypes::ASSUMED_FRIEND)
local_affil = SymbolTypes::FRIEND;
if (local_affil == SymbolTypes::SUSPECT)
local_affil = SymbolTypes::ENEMY;
// (Somit benoetigen wir im Falle von bestMatchFiles
// nicht auch noch welche fuer diese 3 affils)
for (Symbol* symbol : qAsConst(bestMatchList)) {
if (!symbol)
continue;
// Compare id, dimen and affil
bool match = (symbol->getAffil() == local_affil );
match &= (symbol->getDimen() == local_dimen );
match &= (symbol->id() == id() );
if ( match && symbol->transformed() &&
(this != symbol ) ) {
// MATCH! - Replace primitives
clearPrimitives();
QLinkedListIterator<Primitive*> pList = symbol->getPrimitives();
while ( pList.hasNext() ) {
_primitives.append(new Primitive(*pList.next()));
}
_transformed = true;
++_changeCount;
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
return;
}
}
}
}
// Select the Matrix Group
QMap<QPair<SymbolTypes::t_dimen, SymbolTypes::t_affil>, Matrix> *_matrixMap;
switch (group) {
case TMG_BCDAB:
_matrixMap = &_matrixMapBCDAB;
break;
case TMG_COMMAND_LEVEL:
_matrixMap = &_matrixMapCommandLevel;
break;
case TMG_BRANCHES:
_matrixMap = &_matrixMapBranch;
break;
default:
ERROR_LOG(logger) << "Unknown Matrix-Group selected!" ;
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
return;
}
if ( ! _matrixMap->contains(key) ) {
// No matching transformation found
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
return;
}
Matrix m = _matrixMap->value(key);
transformSymbol(m);
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
} // void Symbol::transformSymbol(t_transformMatrixGroup group, SymbolTable *bestMatchTable)
void Symbol::transformSymbol(const Matrix &m, bool ignoreTransformFlag) {
DEBUG_LOG(logger) << LOGFUNCTION
<< " ignoreTransformFlag = " << ignoreTransformFlag
;
QTransform t(m.m11, m.m12, m.m13,
m.m21, m.m22, m.m23,
m.m31, m.m32, m.m33);
QLinkedListIterator<Primitive*> pi(_primitives);
while ( pi.hasNext() ) {
Primitive *tmpP = pi.next();
if ( tmpP->getTransform() || ignoreTransformFlag) {
QPolygonF points = tmpP->getPoints();
// transform all points
for (int i = 0; i < points.size(); ++i) {
points[i] = t.map(points.at(i));
}
tmpP->setPoints(points);
}
} // while
_transformed = true;
++_changeCount;
DEBUG_LOG(logger) << "END " << LOGFUNCTION ;
} // void Symbol::transformSymbol(const Matrix &m)
void Symbol::initMatrixMaps() {
if ( Symbol::initMatrixDone ) { return; }
using da = QPair<SymbolTypes::t_dimen,SymbolTypes:: t_affil>;
// Branches Map
_matrixMapBranch[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::AFFIL_UNDEFINED)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::AIR_SPACE , SymbolTypes::AFFIL_UNDEFINED)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::LAND_UNITS , SymbolTypes::AFFIL_UNDEFINED)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::AFFIL_UNDEFINED)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::OVER_WATER , SymbolTypes::AFFIL_UNDEFINED)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::UNDER_WATER , SymbolTypes::AFFIL_UNDEFINED)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::ACTIVITY , SymbolTypes::AFFIL_UNDEFINED)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::UNKNOWN)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::AIR_SPACE , SymbolTypes::UNKNOWN)] = Matrix(1.0, 0.0, 0.0, 0.0, 0.55, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::LAND_UNITS , SymbolTypes::UNKNOWN)] = Matrix(1.0, 0.0, 0.0, 0.0, 0.55, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::UNKNOWN)] = Matrix(1.0, 0.0, 0.0, 0.0, 0.55, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::OVER_WATER , SymbolTypes::UNKNOWN)] = Matrix(1.0, 0.0, 0.0, 0.0, 0.55, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::UNDER_WATER , SymbolTypes::UNKNOWN)] = Matrix(1.0, 0.0, 0.0, 0.0, 0.55, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::ACTIVITY , SymbolTypes::UNKNOWN)] = Matrix(1.0, 0.0, 0.0, 0.0, 0.55, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::PENDING)] = _matrixMapBranch[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::UNKNOWN)];
_matrixMapBranch[da(SymbolTypes::AIR_SPACE , SymbolTypes::PENDING)] = _matrixMapBranch[da(SymbolTypes::AIR_SPACE , SymbolTypes::UNKNOWN)];
_matrixMapBranch[da(SymbolTypes::LAND_UNITS , SymbolTypes::PENDING)] = _matrixMapBranch[da(SymbolTypes::LAND_UNITS , SymbolTypes::UNKNOWN)];
_matrixMapBranch[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::PENDING)] = _matrixMapBranch[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::UNKNOWN)];
_matrixMapBranch[da(SymbolTypes::OVER_WATER , SymbolTypes::PENDING)] = _matrixMapBranch[da(SymbolTypes::OVER_WATER , SymbolTypes::UNKNOWN)];
_matrixMapBranch[da(SymbolTypes::UNDER_WATER , SymbolTypes::PENDING)] = _matrixMapBranch[da(SymbolTypes::UNDER_WATER , SymbolTypes::UNKNOWN)];
_matrixMapBranch[da(SymbolTypes::ACTIVITY , SymbolTypes::PENDING)] = _matrixMapBranch[da(SymbolTypes::ACTIVITY , SymbolTypes::UNKNOWN)];
_matrixMapBranch[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::FRIEND)] = Matrix( 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::AIR_SPACE , SymbolTypes::FRIEND)] = Matrix(0.75, 0.0, 0.0, 0.0, 0.4, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::LAND_UNITS , SymbolTypes::FRIEND)] = Matrix(1.35, 0.0, 0.0, 0.0, 0.9, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::FRIEND)] = Matrix(0.75, 0.0, 0.0, 0.0, 0.75, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::OVER_WATER , SymbolTypes::FRIEND)] = Matrix(1.35, 0.0, 0.0, 0.0, 0.9, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::UNDER_WATER , SymbolTypes::FRIEND)] = Matrix(0.75, 0.0, 0.0, 0.0, 0.4, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::ACTIVITY , SymbolTypes::FRIEND)] = _matrixMapBranch[da(SymbolTypes::LAND_UNITS, SymbolTypes::FRIEND)];
_matrixMapBranch[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::ASSUMED_FRIEND)] = _matrixMapBranch[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::FRIEND)];
_matrixMapBranch[da(SymbolTypes::AIR_SPACE , SymbolTypes::ASSUMED_FRIEND)] = _matrixMapBranch[da(SymbolTypes::AIR_SPACE , SymbolTypes::FRIEND)];
_matrixMapBranch[da(SymbolTypes::LAND_UNITS , SymbolTypes::ASSUMED_FRIEND)] = _matrixMapBranch[da(SymbolTypes::LAND_UNITS , SymbolTypes::FRIEND)];
_matrixMapBranch[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::ASSUMED_FRIEND)] = _matrixMapBranch[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::FRIEND)];
_matrixMapBranch[da(SymbolTypes::OVER_WATER , SymbolTypes::ASSUMED_FRIEND)] = _matrixMapBranch[da(SymbolTypes::OVER_WATER , SymbolTypes::FRIEND)];
_matrixMapBranch[da(SymbolTypes::UNDER_WATER , SymbolTypes::ASSUMED_FRIEND)] = _matrixMapBranch[da(SymbolTypes::UNDER_WATER , SymbolTypes::FRIEND)];
_matrixMapBranch[da(SymbolTypes::ACTIVITY , SymbolTypes::ASSUMED_FRIEND)] = _matrixMapBranch[da(SymbolTypes::ACTIVITY , SymbolTypes::FRIEND)];
_matrixMapBranch[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::NEUTRAL)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::AIR_SPACE , SymbolTypes::NEUTRAL)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::LAND_UNITS , SymbolTypes::NEUTRAL)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::NEUTRAL)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::OVER_WATER , SymbolTypes::NEUTRAL)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::UNDER_WATER , SymbolTypes::NEUTRAL)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::ACTIVITY , SymbolTypes::NEUTRAL)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::ENEMY)] = Matrix( 1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::AIR_SPACE , SymbolTypes::ENEMY)] = Matrix(0.65, 0.0, 0.0, 0.0, 0.65, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::LAND_UNITS , SymbolTypes::ENEMY)] = Matrix(0.65, 0.0, 0.0, 0.0, 0.65, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::ENEMY)] = Matrix(0.65, 0.0, 0.0, 0.0, 0.65, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::OVER_WATER , SymbolTypes::ENEMY)] = Matrix(0.65, 0.0, 0.0, 0.0, 0.65, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::UNDER_WATER , SymbolTypes::ENEMY)] = Matrix(0.65, 0.0, 0.0, 0.0, 0.65, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::ACTIVITY , SymbolTypes::ENEMY)] = Matrix(0.65, 0.0, 0.0, 0.0, 0.65, 0.0, 0.0, 0.0, 1.0);
_matrixMapBranch[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::SUSPECT)] = _matrixMapBranch[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::ENEMY)];
_matrixMapBranch[da(SymbolTypes::AIR_SPACE , SymbolTypes::SUSPECT)] = _matrixMapBranch[da(SymbolTypes::AIR_SPACE , SymbolTypes::ENEMY)];
_matrixMapBranch[da(SymbolTypes::LAND_UNITS , SymbolTypes::SUSPECT)] = _matrixMapBranch[da(SymbolTypes::LAND_UNITS , SymbolTypes::ENEMY)];
_matrixMapBranch[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::SUSPECT)] = _matrixMapBranch[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::ENEMY)];
_matrixMapBranch[da(SymbolTypes::OVER_WATER , SymbolTypes::SUSPECT)] = _matrixMapBranch[da(SymbolTypes::OVER_WATER , SymbolTypes::ENEMY)];
_matrixMapBranch[da(SymbolTypes::UNDER_WATER , SymbolTypes::SUSPECT)] = _matrixMapBranch[da(SymbolTypes::UNDER_WATER , SymbolTypes::ENEMY)];
_matrixMapBranch[da(SymbolTypes::ACTIVITY , SymbolTypes::SUSPECT)] = _matrixMapBranch[da(SymbolTypes::ACTIVITY , SymbolTypes::ENEMY)];
// CommandLevel Map
_matrixMapCommandLevel[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::AFFIL_UNDEFINED)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::AIR_SPACE , SymbolTypes::AFFIL_UNDEFINED)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::LAND_UNITS , SymbolTypes::AFFIL_UNDEFINED)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::AFFIL_UNDEFINED)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::OVER_WATER , SymbolTypes::AFFIL_UNDEFINED)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::UNDER_WATER , SymbolTypes::AFFIL_UNDEFINED)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::ACTIVITY , SymbolTypes::AFFIL_UNDEFINED)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::UNKNOWN)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::AIR_SPACE , SymbolTypes::UNKNOWN)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.3, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::LAND_UNITS , SymbolTypes::UNKNOWN)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.3, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::UNKNOWN)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.3, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::OVER_WATER , SymbolTypes::UNKNOWN)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.3, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::UNDER_WATER , SymbolTypes::UNKNOWN)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.3, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::ACTIVITY , SymbolTypes::UNKNOWN)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.3, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::PENDING)] = _matrixMapCommandLevel[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::UNKNOWN)];
_matrixMapCommandLevel[da(SymbolTypes::AIR_SPACE , SymbolTypes::PENDING)] = _matrixMapCommandLevel[da(SymbolTypes::AIR_SPACE , SymbolTypes::UNKNOWN)];
_matrixMapCommandLevel[da(SymbolTypes::LAND_UNITS , SymbolTypes::PENDING)] = _matrixMapCommandLevel[da(SymbolTypes::LAND_UNITS , SymbolTypes::UNKNOWN)];
_matrixMapCommandLevel[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::PENDING)] = _matrixMapCommandLevel[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::UNKNOWN)];
_matrixMapCommandLevel[da(SymbolTypes::OVER_WATER , SymbolTypes::PENDING)] = _matrixMapCommandLevel[da(SymbolTypes::OVER_WATER , SymbolTypes::UNKNOWN)];
_matrixMapCommandLevel[da(SymbolTypes::UNDER_WATER , SymbolTypes::PENDING)] = _matrixMapCommandLevel[da(SymbolTypes::UNDER_WATER , SymbolTypes::UNKNOWN)];
_matrixMapCommandLevel[da(SymbolTypes::ACTIVITY , SymbolTypes::PENDING)] = _matrixMapCommandLevel[da(SymbolTypes::ACTIVITY , SymbolTypes::UNKNOWN)];
_matrixMapCommandLevel[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::FRIEND)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::AIR_SPACE , SymbolTypes::FRIEND)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::LAND_UNITS , SymbolTypes::FRIEND)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, -0.1, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::FRIEND)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::OVER_WATER , SymbolTypes::FRIEND)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::UNDER_WATER , SymbolTypes::FRIEND)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::ACTIVITY , SymbolTypes::FRIEND)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::ASSUMED_FRIEND)] = _matrixMapCommandLevel[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::FRIEND)];
_matrixMapCommandLevel[da(SymbolTypes::AIR_SPACE , SymbolTypes::ASSUMED_FRIEND)] = _matrixMapCommandLevel[da(SymbolTypes::AIR_SPACE , SymbolTypes::FRIEND)];
_matrixMapCommandLevel[da(SymbolTypes::LAND_UNITS , SymbolTypes::ASSUMED_FRIEND)] = _matrixMapCommandLevel[da(SymbolTypes::LAND_UNITS , SymbolTypes::FRIEND)];
_matrixMapCommandLevel[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::ASSUMED_FRIEND)] = _matrixMapCommandLevel[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::FRIEND)];
_matrixMapCommandLevel[da(SymbolTypes::OVER_WATER , SymbolTypes::ASSUMED_FRIEND)] = _matrixMapCommandLevel[da(SymbolTypes::OVER_WATER , SymbolTypes::FRIEND)];
_matrixMapCommandLevel[da(SymbolTypes::UNDER_WATER , SymbolTypes::ASSUMED_FRIEND)] = _matrixMapCommandLevel[da(SymbolTypes::UNDER_WATER , SymbolTypes::FRIEND)];
_matrixMapCommandLevel[da(SymbolTypes::ACTIVITY , SymbolTypes::ASSUMED_FRIEND)] = _matrixMapCommandLevel[da(SymbolTypes::ACTIVITY , SymbolTypes::FRIEND)];
_matrixMapCommandLevel[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::NEUTRAL)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::AIR_SPACE , SymbolTypes::NEUTRAL)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::LAND_UNITS , SymbolTypes::NEUTRAL)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::NEUTRAL)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::OVER_WATER , SymbolTypes::NEUTRAL)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::UNDER_WATER , SymbolTypes::NEUTRAL)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::ACTIVITY , SymbolTypes::NEUTRAL)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::ENEMY)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::AIR_SPACE , SymbolTypes::ENEMY)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::LAND_UNITS , SymbolTypes::ENEMY)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::ENEMY)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::OVER_WATER , SymbolTypes::ENEMY)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::UNDER_WATER , SymbolTypes::ENEMY)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::ACTIVITY , SymbolTypes::ENEMY)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapCommandLevel[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::SUSPECT)] = _matrixMapCommandLevel[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::ENEMY)];
_matrixMapCommandLevel[da(SymbolTypes::AIR_SPACE , SymbolTypes::SUSPECT)] = _matrixMapCommandLevel[da(SymbolTypes::AIR_SPACE , SymbolTypes::ENEMY)];
_matrixMapCommandLevel[da(SymbolTypes::LAND_UNITS , SymbolTypes::SUSPECT)] = _matrixMapCommandLevel[da(SymbolTypes::LAND_UNITS , SymbolTypes::ENEMY)];
_matrixMapCommandLevel[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::SUSPECT)] = _matrixMapCommandLevel[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::ENEMY)];
_matrixMapCommandLevel[da(SymbolTypes::OVER_WATER , SymbolTypes::SUSPECT)] = _matrixMapCommandLevel[da(SymbolTypes::OVER_WATER , SymbolTypes::ENEMY)];
_matrixMapCommandLevel[da(SymbolTypes::UNDER_WATER , SymbolTypes::SUSPECT)] = _matrixMapCommandLevel[da(SymbolTypes::UNDER_WATER , SymbolTypes::ENEMY)];
_matrixMapCommandLevel[da(SymbolTypes::ACTIVITY , SymbolTypes::SUSPECT)] = _matrixMapCommandLevel[da(SymbolTypes::ACTIVITY , SymbolTypes::ENEMY)];
// BCDAB Map
_matrixMapBCDAB[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::AFFIL_UNDEFINED)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBCDAB[da(SymbolTypes::AIR_SPACE , SymbolTypes::AFFIL_UNDEFINED)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBCDAB[da(SymbolTypes::LAND_UNITS , SymbolTypes::AFFIL_UNDEFINED)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBCDAB[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::AFFIL_UNDEFINED)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBCDAB[da(SymbolTypes::OVER_WATER , SymbolTypes::AFFIL_UNDEFINED)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBCDAB[da(SymbolTypes::UNDER_WATER , SymbolTypes::AFFIL_UNDEFINED)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBCDAB[da(SymbolTypes::ACTIVITY , SymbolTypes::AFFIL_UNDEFINED)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBCDAB[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::UNKNOWN)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBCDAB[da(SymbolTypes::AIR_SPACE , SymbolTypes::UNKNOWN)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.3, 1.0);
_matrixMapBCDAB[da(SymbolTypes::LAND_UNITS , SymbolTypes::UNKNOWN)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.3, 1.0);
_matrixMapBCDAB[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::UNKNOWN)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.3, 1.0);
_matrixMapBCDAB[da(SymbolTypes::OVER_WATER , SymbolTypes::UNKNOWN)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.3, 1.0);
_matrixMapBCDAB[da(SymbolTypes::UNDER_WATER , SymbolTypes::UNKNOWN)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.3, 1.0);
_matrixMapBCDAB[da(SymbolTypes::ACTIVITY , SymbolTypes::UNKNOWN)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.3, 1.0);
_matrixMapBCDAB[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::PENDING)] = _matrixMapBCDAB[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::UNKNOWN)];
_matrixMapBCDAB[da(SymbolTypes::AIR_SPACE , SymbolTypes::PENDING)] = _matrixMapBCDAB[da(SymbolTypes::AIR_SPACE , SymbolTypes::UNKNOWN)];
_matrixMapBCDAB[da(SymbolTypes::LAND_UNITS , SymbolTypes::PENDING)] = _matrixMapBCDAB[da(SymbolTypes::LAND_UNITS , SymbolTypes::UNKNOWN)];
_matrixMapBCDAB[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::PENDING)] = _matrixMapBCDAB[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::UNKNOWN)];
_matrixMapBCDAB[da(SymbolTypes::OVER_WATER , SymbolTypes::PENDING)] = _matrixMapBCDAB[da(SymbolTypes::OVER_WATER , SymbolTypes::UNKNOWN)];
_matrixMapBCDAB[da(SymbolTypes::UNDER_WATER , SymbolTypes::PENDING)] = _matrixMapBCDAB[da(SymbolTypes::UNDER_WATER , SymbolTypes::UNKNOWN)];
_matrixMapBCDAB[da(SymbolTypes::ACTIVITY , SymbolTypes::PENDING)] = _matrixMapBCDAB[da(SymbolTypes::ACTIVITY , SymbolTypes::UNKNOWN)];
_matrixMapBCDAB[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::FRIEND)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBCDAB[da(SymbolTypes::AIR_SPACE , SymbolTypes::FRIEND)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBCDAB[da(SymbolTypes::LAND_UNITS , SymbolTypes::FRIEND)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, -0.1, 1.0);
_matrixMapBCDAB[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::FRIEND)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.1, 1.0);
_matrixMapBCDAB[da(SymbolTypes::OVER_WATER , SymbolTypes::FRIEND)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.1, 1.0);
_matrixMapBCDAB[da(SymbolTypes::UNDER_WATER , SymbolTypes::FRIEND)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.1, 1.0);
_matrixMapBCDAB[da(SymbolTypes::ACTIVITY , SymbolTypes::FRIEND)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.1, 1.0);
_matrixMapBCDAB[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::ASSUMED_FRIEND)] = _matrixMapBCDAB[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::FRIEND)];
_matrixMapBCDAB[da(SymbolTypes::AIR_SPACE , SymbolTypes::ASSUMED_FRIEND)] = _matrixMapBCDAB[da(SymbolTypes::AIR_SPACE , SymbolTypes::FRIEND)];
_matrixMapBCDAB[da(SymbolTypes::LAND_UNITS , SymbolTypes::ASSUMED_FRIEND)] = _matrixMapBCDAB[da(SymbolTypes::LAND_UNITS , SymbolTypes::FRIEND)];
_matrixMapBCDAB[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::ASSUMED_FRIEND)] = _matrixMapBCDAB[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::FRIEND)];
_matrixMapBCDAB[da(SymbolTypes::OVER_WATER , SymbolTypes::ASSUMED_FRIEND)] = _matrixMapBCDAB[da(SymbolTypes::OVER_WATER , SymbolTypes::FRIEND)];
_matrixMapBCDAB[da(SymbolTypes::UNDER_WATER , SymbolTypes::ASSUMED_FRIEND)] = _matrixMapBCDAB[da(SymbolTypes::UNDER_WATER , SymbolTypes::FRIEND)];
_matrixMapBCDAB[da(SymbolTypes::ACTIVITY , SymbolTypes::ASSUMED_FRIEND)] = _matrixMapBCDAB[da(SymbolTypes::ACTIVITY , SymbolTypes::FRIEND)];
_matrixMapBCDAB[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::NEUTRAL)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBCDAB[da(SymbolTypes::AIR_SPACE , SymbolTypes::NEUTRAL)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBCDAB[da(SymbolTypes::LAND_UNITS , SymbolTypes::NEUTRAL)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBCDAB[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::NEUTRAL)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBCDAB[da(SymbolTypes::OVER_WATER , SymbolTypes::NEUTRAL)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBCDAB[da(SymbolTypes::UNDER_WATER , SymbolTypes::NEUTRAL)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBCDAB[da(SymbolTypes::ACTIVITY , SymbolTypes::NEUTRAL)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBCDAB[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::ENEMY)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0);
_matrixMapBCDAB[da(SymbolTypes::AIR_SPACE , SymbolTypes::ENEMY)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.2, 1.0);
_matrixMapBCDAB[da(SymbolTypes::LAND_UNITS , SymbolTypes::ENEMY)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.2, 1.0);
_matrixMapBCDAB[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::ENEMY)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.2, 1.0);
_matrixMapBCDAB[da(SymbolTypes::OVER_WATER , SymbolTypes::ENEMY)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.2, 1.0);
_matrixMapBCDAB[da(SymbolTypes::UNDER_WATER , SymbolTypes::ENEMY)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.2, 1.0);
_matrixMapBCDAB[da(SymbolTypes::ACTIVITY , SymbolTypes::ENEMY)] = Matrix(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.2, 1.0);
_matrixMapBCDAB[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::SUSPECT)] = _matrixMapBCDAB[da(SymbolTypes::DIMEN_UNDEFINED, SymbolTypes::ENEMY)];
_matrixMapBCDAB[da(SymbolTypes::AIR_SPACE , SymbolTypes::SUSPECT)] = _matrixMapBCDAB[da(SymbolTypes::AIR_SPACE , SymbolTypes::ENEMY)];
_matrixMapBCDAB[da(SymbolTypes::LAND_UNITS , SymbolTypes::SUSPECT)] = _matrixMapBCDAB[da(SymbolTypes::LAND_UNITS , SymbolTypes::ENEMY)];
_matrixMapBCDAB[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::SUSPECT)] = _matrixMapBCDAB[da(SymbolTypes::LAND_EQUIPMENT , SymbolTypes::ENEMY)];
_matrixMapBCDAB[da(SymbolTypes::OVER_WATER , SymbolTypes::SUSPECT)] = _matrixMapBCDAB[da(SymbolTypes::OVER_WATER , SymbolTypes::ENEMY)];
_matrixMapBCDAB[da(SymbolTypes::UNDER_WATER , SymbolTypes::SUSPECT)] = _matrixMapBCDAB[da(SymbolTypes::UNDER_WATER , SymbolTypes::ENEMY)];
_matrixMapBCDAB[da(SymbolTypes::ACTIVITY , SymbolTypes::SUSPECT)] = _matrixMapBCDAB[da(SymbolTypes::ACTIVITY , SymbolTypes::ENEMY)];
Symbol::initMatrixDone = true;
} // void Symbol::initMatrixMaps()
QRectF Symbol::getSymbolFrameRect(SymbolTypes::t_dimen dimen, SymbolTypes::t_affil affil)
{
// Symbol Frame Rectangles: x,y,w,h
QRectF bb_sqare(-1.1, -1.1, 2.2, 2.2); // e.g. Neutral
QRectF bb_circle(-1.2, -1.2, 2.4, 2.4); // e.g. Surface Friend
QRectF bb_hyperbola(-1.1, -1.1, 2.2, 2.2); // e.g. Air Friend
QRectF bb_rect(-1.5, -1.0, 3.0, 2.0); // e.g. Ground Friend
QRectF bb_flower(-1.44, -1.44, 2.88, 2.88); // e.g. Unknown
// QRectF bb_flower_bottomopen(-1.44, -0.7, 2.88, 2.14); // e.g. Air Unknown
// QRectF bb_flower_topopen(-1.44, -1.44, 2.88, 2.14); // e.g.SubSurface Unknown
QRectF bb_diamond(-1.44, -1.44, 2.88, 2.88); // e.g. Ground Hostile
QRectF retRect = bb_sqare;
if(dimen != SymbolTypes::DIMEN_UNDEFINED) {
switch(affil) {
case SymbolTypes::UNKNOWN:
case SymbolTypes::PENDING:
retRect = bb_flower;
/**
if(dimen == SymbolTypes::AIR_SPACE) {
retRect = bb_flower_bottomopen;
}
if(dimen == SymbolTypes::UNDER_WATER) {
retRect = bb_flower_topopen;
}
**/
break;
case SymbolTypes::FRIEND:
case SymbolTypes::ASSUMED_FRIEND:
retRect = bb_rect;
if(isAirSubsurface(dimen)) {
retRect = bb_hyperbola;
}
if(dimen == SymbolTypes::OVER_WATER) {
retRect = bb_circle;
}
break;
case SymbolTypes::ENEMY:
case SymbolTypes::SUSPECT:
retRect = bb_diamond;
break;
default:
break;
}
}
return retRect;
} // QRectF Symbol::getSymbolFrameRect()
bool Symbol::isAirSubsurface(SymbolTypes::t_dimen dimen)
{
if((dimen == SymbolTypes::AIR_SPACE) ||
(dimen == SymbolTypes::UNDER_WATER)) {
return true;
}
return false;
}
} // namespace SymbologyXML