// Validate that the edge members are sane void Edge::validate() const { const Edge* pTwin = getTwin(); std::string m_v1 = getMatchStr(); std::string m_v2 = pTwin->getMatchStr(); if(getComp() == EC_REVERSE) m_v2 = reverseComplement(m_v2); bool error = false; if(m_v1.length() != m_v2.length()) { std::cerr << "Error, matching strings are not the same length\n"; error = true; } if(error) { std::cerr << "V1M: " << m_v1 << "\n"; std::cerr << "V2M: " << m_v2 << "\n"; std::cerr << "V1MC: " << getMatchCoord() << "\n"; std::cerr << "V2MC: " << pTwin->getMatchCoord() << "\n"; std::cerr << "V1: " << getStart()->getSeq() << "\n"; std::cerr << "Validation failed for edge " << *this << "\n"; assert(false); } }
char Edge::isReal() const { Edge *opp = getTwin(); if(!opp) return 1; Facet *f0 = (Facet *)getFace(); Facet *f1 = (Facet *)opp->getFace(); return f0->getPolygonIndex() != f1->getPolygonIndex(); }
// Get the edge's label std::string Edge::getLabel() const { const Edge* pTwin = getTwin(); const Vertex* pEndpoint = m_pEnd; // get the unmatched coordinates in V2 SeqCoord unmatched = pTwin->getMatchCoord().complement(); std::string seq = unmatched.getSubstring(pEndpoint->getStr()); if(getComp() == EC_REVERSE) seq = reverseComplement(seq); return seq; }
void QBlockDiagramLinkEnd::paint( QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget /*= 0 */ ) { painter->setPen(m_pOwnerLink->m_Pens[m_pOwnerLink->dominantPenState()]); painter->setBrush(m_pOwnerLink->m_Brushes[m_pOwnerLink->dominantBrushState()]); painter->drawEllipse(boundingRect()); if(getConnectedSlot() && !isMoving() && !getTwin()->isMoving()) { if(getConnectedSlot()->getConnectionCount() > 1 && !getConnectedSlot()->areConnectionNodesExpanded()) { QFont f = painter->font(); f.setPointSize(7); f.setWeight(99); painter->setFont(f); painter->drawText(boundingRect(), Qt::AlignCenter, QString::number(getConnectedSlot()->getConnectionCount())); } } }