/** * @RDE_HEADER@ * Interface-Implementation of HitLine * $Id$ * $HeadURL$ * $Author$ */ // Own #include "hit_line_impl.h" #include #include #include #include // ESRI // Qt #include namespace SituationMap { //----------------------------------------------------------------------------- // class HitLineImpl //----------------------------------------------------------------------------- HitLineImpl::HitLineImpl(const QString &debugInfo) : HitLine() // Interface , BaseClass(debugInfo) // Implementation , m_logger(getLogger("HitLineImpl")) { TRACE_LOG(m_logger) << LOGFUNCTION << " START, debugInfo=" << m_debugInfo; setArrowHeadStart(true); TRACE_LOG(m_logger) << LOGFUNCTION << " END, debugInfo=" << m_debugInfo; } HitLineImpl::~HitLineImpl() { TRACE_LOG(m_logger) << LOGFUNCTION << " START, debugInfo=" << m_debugInfo; TRACE_LOG(m_logger) << LOGFUNCTION << " END, debugInfo=" << m_debugInfo; } QString HitLineImpl::identifier() const { return this->textOnSegment(0); } void HitLineImpl::setIdentifier(const QString &identifier) { this->setTextOnSegment(0, identifier); } Point3D HitLineImpl::startPoint() const { // !!! see setStartAndEndPoint() !!! const PositionCont &pos = m_positions.positions(); if (pos.size() < 2) return Point3D(); else return pos[1]; // !!! see setStartAndEndPoint() !!! } Point3D HitLineImpl::endPoint() const { // !!! see setStartAndEndPoint() !!! const PositionCont &pos = m_positions.positions(); if (pos.size() < 2) return Point3D(); else return pos[0]; // !!! see setStartAndEndPoint() !!! } void HitLineImpl::setStartAndEndPoint(const Point3D &start, const Point3D &end) { TRACE_LOG(m_logger) << LOGFUNCTION << " START" << " start=" << start << " end=" << end << ", debugInfo=" << m_debugInfo; // According MIL2525 a line (like attack) starts with an arrow. // But in this context (HitLine) // start == shooter -> no arrowHead // end == target -> with arrowHead // Therefore we have to add the 'end'/target point first: m_positions.setPositions(PositionCont() << end << start); TRACE_LOG(m_logger) << LOGFUNCTION << " END"; } bool HitLineImpl::updateViewImpl() { TRACE_LOG(m_logger) << LOGFUNCTION << " START" << " symbol=" << m_symbol.value().sidc << " visibility=" << m_visibility << " visiTechn=" << m_visibilityTechnical << " visiTact=" << m_visibilityTactical << ", debugInfo=" << m_debugInfo; setArrowHeadsSelected(m_selected); bool success = BaseClass::updateViewImpl(); if (!success) ERROR_LOG(m_logger) << LOGFUNCTION << " updateViewImpl failed"; TRACE_LOG(m_logger) << LOGFUNCTION << " END, success=" << success; return success; } bool HitLineImpl::init(MapImpl *mapImpl, const QString &logicalLayerName) { TRACE_LOG(m_logger) << LOGFUNCTION << " START"; if (mapImpl) { switch (mapImpl->symbologyType()) { case AdvancedSymbology::SymbologyType::APP6D: case AdvancedSymbology::SymbologyType::MIL2525D: m_symbol.refValue().sidc = AdvancedSymbology::SidcCodec::encodeComplete(mapImpl->symbologyType(), "10032500001406030000"); // SymbolSet = 25 140602 // ^^ ^^^^^^ break; case AdvancedSymbology::SymbologyType::MIL2525C: m_symbol.refValue().sidc = AdvancedSymbology::SidcCodec::encodeComplete(mapImpl->symbologyType(), "GFGPOLKGS-"); // 1047 - Direction Of Attack Ground Supporting Attack F // m_symbol.refValue().sidc = AdvancedSymbology::SidcCodec::encodeComplete(mapImpl->symbologyType(),"GHGPOLKA--"); // // m_symbol.refValue().sidc = AdvancedSymbology::SidcCodec::encodeComplete(mapImpl->symbologyType(),"GHGPOLKGM-"); // break; case AdvancedSymbology::SymbologyType::APP6B: m_symbol.refValue().sidc = AdvancedSymbology::SidcCodec::encodeComplete(mapImpl->symbologyType(), "GFCPMOLDS-"); // APP6B-3733 GFCPMOLDS- -> Direction Of Attack Ground Supporting Attack F break; case AdvancedSymbology::SymbologyType::None: // empty break; } // switch } // if (mapImpl) double maxSegmentLength = -1; // -> GeometryEngine::densifyGeodetic if (mapImpl && (mapImpl->mode() == Mode::Mode_3D)) maxSegmentLength = 10; // -> GeometryEngine::densifyGeodetic bool success = BaseClass::init(mapImpl, logicalLayerName, GraphicalObjectPathType::Polyline, maxSegmentLength); if (!success) ERROR_LOG(m_logger) << LOGFUNCTION << " init failed"; m_mainGraphicalObject->rLineStyle().setLinePattern(LinePattern::Dash); TRACE_LOG(m_logger) << LOGFUNCTION << " END, success=" << success; return success; } bool HitLineImpl::setPositions(const PositionCont &) { FATAL_LOG(m_logger) << LOGFUNCTION << " DO NOT CALL!!!"; assert(false); return false; } } // namespace SituationMap