本文整理汇总了C++中Note::GetDrawingY方法的典型用法代码示例。如果您正苦于以下问题:C++ Note::GetDrawingY方法的具体用法?C++ Note::GetDrawingY怎么用?C++ Note::GetDrawingY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Note
的用法示例。
在下文中一共展示了Note::GetDrawingY方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetYExtremes
void Chord::GetYExtremes(int *yMax, int *yMin)
{
bool passed = false;
int y1;
ListOfObjects* childList = this->GetList(this); //make sure it's initialized
for (ListOfObjects::iterator it = childList->begin(); it != childList->end(); it++) {
Note *note = dynamic_cast<Note*>(*it);
if (!note) continue;
y1 = note->GetDrawingY();
if (!passed) {
*yMax = y1;
*yMin = y1;
passed = true;
}
else {
if (y1 > *yMax) *yMax = y1;
else if (y1 < *yMin) *yMin = y1;
}
}
}
示例2: DrawSlurInitial
void View::DrawSlurInitial(FloatingCurvePositioner *curve, Slur *slur, int x1, int x2, Staff *staff, char spanningType)
{
Beam *parentBeam = NULL;
Chord *startParentChord = NULL;
Chord *endParentChord = NULL;
Note *startNote = NULL;
Note *endNote = NULL;
Chord *startChord = NULL;
Chord *endChord = NULL;
curvature_CURVEDIR drawingCurveDir = curvature_CURVEDIR_above;
data_STEMDIRECTION startStemDir = STEMDIRECTION_NONE;
data_STEMDIRECTION endStemDir = STEMDIRECTION_NONE;
data_STEMDIRECTION stemDir = STEMDIRECTION_NONE;
bool isGraceToNoteSlur = false;
int y1 = staff->GetDrawingY();
int y2 = staff->GetDrawingY();
/************** parent layers **************/
LayerElement *start = dynamic_cast<LayerElement *>(slur->GetStart());
LayerElement *end = dynamic_cast<LayerElement *>(slur->GetEnd());
if (!start || !end) {
// no start and end, obviously nothing to do...
return;
}
if (start->Is(TIMESTAMP_ATTR) && end->Is(TIMESTAMP_ATTR)) {
// for now ignore slur using 2 tstamps
return;
}
if (start->Is(NOTE)) {
startNote = dynamic_cast<Note *>(start);
assert(startNote);
startParentChord = startNote->IsChordTone();
startStemDir = startNote->GetDrawingStemDir();
}
else if (start->Is(CHORD)) {
startChord = dynamic_cast<Chord *>(start);
assert(startChord);
startStemDir = startChord->GetDrawingStemDir();
}
if (end->Is(NOTE)) {
endNote = dynamic_cast<Note *>(end);
assert(endNote);
endParentChord = endNote->IsChordTone();
endStemDir = endNote->GetDrawingStemDir();
}
else if (end->Is(CHORD)) {
endChord = dynamic_cast<Chord *>(end);
assert(endChord);
endStemDir = endChord->GetDrawingStemDir();
}
if (startNote && endNote && startNote->IsGraceNote() && !endNote->IsGraceNote()) {
isGraceToNoteSlur = true;
}
Layer *layer = NULL;
LayerElement *layerElement = NULL;
// For now, with timestamps, get the first layer. We should eventually look at the @layerident (not implemented)
if (!start->Is(TIMESTAMP_ATTR)) {
layer = dynamic_cast<Layer *>(start->GetFirstParent(LAYER));
layerElement = start;
}
else {
layer = dynamic_cast<Layer *>(end->GetFirstParent(LAYER));
layerElement = end;
}
assert(layer);
if (!start->Is(TIMESTAMP_ATTR) && !end->Is(TIMESTAMP_ATTR) && (spanningType == SPANNING_START_END)) {
System *system = dynamic_cast<System *>(staff->GetFirstParent(SYSTEM));
assert(system);
// If we have a start to end situation, then store the curvedir in the slur for mixed drawing stem dir
// situations
if (system->HasMixedDrawingStemDir(start, end)) {
slur->SetDrawingCurvedir(curvature_CURVEDIR_above);
}
}
/************** calculate the radius for adjusting the x position **************/
int startRadius = 0;
if (!start->Is(TIMESTAMP_ATTR)) {
startRadius = start->GetDrawingRadius(m_doc);
}
int endRadius = 0;
if (!end->Is(TIMESTAMP_ATTR)) {
endRadius = end->GetDrawingRadius(m_doc);
}
/************** note stem dir **************/
if (spanningType == SPANNING_START_END) {
stemDir = startStemDir;
}
//.........这里部分代码省略.........