void GRPositionTag::RangeEnd(GRStaff * grstaff) { if (grstaff == 0) return; GRSystemStartEndStruct * sse = getSystemStartEndStruct(grstaff->getGRSystem()); assert(sse); if (error) { setStartElement(grstaff,NULL); setEndElement(grstaff,NULL); return; } NEPointerList * associated = NULL; GRNotationElement * el = dynamic_cast<GRNotationElement *>(this); if (el) associated = el->getAssociations(); if (associated == 0) return; if (sse->startflag == GRSystemStartEndStruct::LEFTMOST && sse->startElement == NULL) { setStartElement(grstaff,associated->GetHead()); sse->startpos = associated->GetHeadPosition(); } setEndElement(grstaff,associated->GetTail()); sse->endflag = GRSystemStartEndStruct::RIGHTMOST; sse->endpos = associated->GetTailPosition(); }
void GRPositionTag::addAssociation(GRNotationElement * grnot) { if (error) return; const GRStaff * pstaff = grnot->getGRStaff(); assert(pstaff); GRSystemStartEndStruct * sse= getSystemStartEndStruct(pstaff->getGRSystem()); NEPointerList * associated = NULL; GRNotationElement * el = dynamic_cast<GRNotationElement *>(this); if (el) associated = el->getAssociations(); if (!associated) return; if (sse && sse->startflag == GRSystemStartEndStruct::OPENLEFT && sse->startpos == NULL) sse->startpos = associated->GetTailPosition(); }
void GRPositionTag::StaffFinished(GRStaff * grstaff) { if (!grstaff) return; GRSystemStartEndStruct * sse = getSystemStartEndStruct(grstaff->getGRSystem()); assert(sse); if (error) { setStartElement(grstaff,NULL); setEndElement(grstaff,NULL); lastendElement = NULL; return; } NEPointerList * associated = NULL; GRNotationElement * el = dynamic_cast<GRNotationElement *>(this); if (el) associated = el->getAssociations(); if (associated == 0) return; if (sse->startflag == GRSystemStartEndStruct::LEFTMOST && sse->startElement == NULL) { setStartElement(grstaff,associated->GetHead()); sse->startpos = associated->GetHeadPosition(); } lastendflag = sse->endflag; lastendElement = sse->endElement; lastendpos = sse->endpos; // there is no old lastendelement in this case assert(lastendElement == NULL); setEndElement(grstaff, /*ynamic_cast<GRNotationElement *>*/(grstaff->getEndGlue())); sse->endflag = GRSystemStartEndStruct::OPENRIGHT; sse->endpos = associated->GetTailPosition(); }