void Beam::InitCoords( ListOfObjects *childList ) { ClearCoords(); m_beamElementCoords.reserve( childList->size() ); int i; for (i = 0; i < childList->size(); i++ ) { m_beamElementCoords.push_back( new BeamElementCoord() ); } }
void FTrem::InitCoords(ListOfObjects *childList) { ClearCoords(); if (childList->empty()) { return; } BeamElementCoord *firstElement = new BeamElementCoord; BeamElementCoord *secondElement = new BeamElementCoord; m_beamElementCoords.push_back(firstElement); m_beamElementCoords.push_back(secondElement); // current point to the first Note in the layed out layer firstElement->m_element = dynamic_cast<LayerElement *>(childList->front()); // fTrem list should contain only DurationInterface objects assert(firstElement->m_element->GetDurationInterface()); // current point to the first Note in the layed out layer secondElement->m_element = dynamic_cast<LayerElement *>(childList->back()); // fTrem list should contain only DurationInterface objects assert(secondElement->m_element->GetDurationInterface()); // Should we assert this at the beginning? if (firstElement->m_element == secondElement->m_element) { return; } this->m_drawingParams.m_changingDur = false; this->m_drawingParams.m_beamHasChord = false; this->m_drawingParams.m_hasMultipleStemDir = false; this->m_drawingParams.m_cueSize = false; // adjust beam->m_drawingParams.m_shortestDur depending on the number of slashes this->m_drawingParams.m_shortestDur = std::max(DUR_8, DUR_1 + this->GetBeams()); this->m_drawingParams.m_stemDir = STEMDIRECTION_NONE; if (firstElement->m_element->Is(CHORD)) { this->m_drawingParams.m_beamHasChord = true; } if (secondElement->m_element->Is(CHORD)) { this->m_drawingParams.m_beamHasChord = true; } // For now look at the stemDir only on the first note assert(dynamic_cast<AttStems *>(firstElement->m_element)); this->m_drawingParams.m_stemDir = (dynamic_cast<AttStems *>(firstElement->m_element))->GetStemDir(); // We look only at the first note for checking if cue-sized. Somehow arbitrarily this->m_drawingParams.m_cueSize = firstElement->m_element->GetDrawingCueSize(); }
Beam::~Beam() { ClearCoords(); }
FTrem::~FTrem() { ClearCoords(); }