From 6d05ef624340fba31c3ce65fe19d221321a8f804 Mon Sep 17 00:00:00 2001 From: Laurent Pugin Date: Fri, 29 Dec 2023 11:58:11 +0100 Subject: [PATCH] Rename m_*Abs members to m_drawingFacs* --- include/vrv/doc.h | 2 +- include/vrv/layerelement.h | 2 +- include/vrv/measure.h | 4 +-- include/vrv/staff.h | 2 +- include/vrv/system.h | 4 +-- src/adjustxrelfortranscriptionfunctor.cpp | 2 +- src/facsimilefunctor.cpp | 12 ++++---- src/iomei.cpp | 34 +++++++++++------------ src/layerelement.cpp | 8 +++--- src/measure.cpp | 16 +++++------ src/miscfunctor.cpp | 12 ++++---- src/staff.cpp | 4 +-- src/system.cpp | 8 +++--- 13 files changed, 55 insertions(+), 55 deletions(-) diff --git a/include/vrv/doc.h b/include/vrv/doc.h index 3a60bfe6c6b..8b387ef995a 100644 --- a/include/vrv/doc.h +++ b/include/vrv/doc.h @@ -370,7 +370,7 @@ class Doc : public Object { void ConvertMarkupDoc(bool permanent = true); /** - * Sync the coordinate provided trought to m_Abs. + * Sync the coordinate provided trought to m_drawingFacsX/Y. * Call the SyncToFacsimile functor. */ void SyncFromFacsimileDoc(); diff --git a/include/vrv/layerelement.h b/include/vrv/layerelement.h index af0917a61d7..085fa811845 100644 --- a/include/vrv/layerelement.h +++ b/include/vrv/layerelement.h @@ -386,7 +386,7 @@ class LayerElement : public Object, public: /** Absolute position X. This is used for facsimile (transcription) encoding */ - int m_xAbs; + int m_drawingFacsX; /** * This stores a pointer to the cross-staff (if any) and the appropriate layer * See PrepareCrossStaffFunctor diff --git a/include/vrv/measure.h b/include/vrv/measure.h index e76832df519..49ab432a0d7 100644 --- a/include/vrv/measure.h +++ b/include/vrv/measure.h @@ -371,8 +371,8 @@ class Measure : public Object, * This is the left and right position of the measure. */ ///@{ - int m_xAbs; - int m_xAbs2; + int m_drawingFacsX1; + int m_drawingFacsX2; ///@} /** diff --git a/include/vrv/staff.h b/include/vrv/staff.h index db2edc25618..51cbdbd9346 100644 --- a/include/vrv/staff.h +++ b/include/vrv/staff.h @@ -226,7 +226,7 @@ class Staff : public Object, * The Y absolute position of the staff for facsimile (transcription) encodings. * This is the top left corner of the staff (the X position is the position of the system). */ - int m_yAbs; + int m_drawingFacsY; StaffDef *m_drawingStaffDef; diff --git a/include/vrv/system.h b/include/vrv/system.h index a8900f2a9c5..7485e2abfbe 100644 --- a/include/vrv/system.h +++ b/include/vrv/system.h @@ -191,12 +191,12 @@ class System : public Object, public DrawingListInterface, public AttTyped { * The Y absolute position of the staff for facsimile (transcription) encodings. * This is the top left corner of the system. */ - int m_yAbs; + int m_drawingFacsY; /** * The x absolute position of the system for facsimile layouts. * This is the top left corner of the system. */ - int m_xAbs; + int m_drawingFacsX; /** * The width used by the abbreviated labels at the left of the system. * It is used internally when calculating the layout and it is not stored in the file. diff --git a/src/adjustxrelfortranscriptionfunctor.cpp b/src/adjustxrelfortranscriptionfunctor.cpp index c4e4c1f20d4..be005259ec4 100644 --- a/src/adjustxrelfortranscriptionfunctor.cpp +++ b/src/adjustxrelfortranscriptionfunctor.cpp @@ -21,7 +21,7 @@ AdjustXRelForTranscriptionFunctor::AdjustXRelForTranscriptionFunctor() : Functor FunctorCode AdjustXRelForTranscriptionFunctor::VisitLayerElement(LayerElement *layerElement) { - if (layerElement->m_xAbs == VRV_UNSET) return FUNCTOR_CONTINUE; + if (layerElement->m_drawingFacsX == VRV_UNSET) return FUNCTOR_CONTINUE; if (layerElement->IsScoreDefElement()) return FUNCTOR_SIBLINGS; diff --git a/src/facsimilefunctor.cpp b/src/facsimilefunctor.cpp index eb97b6ed18d..73ec1ef23ca 100644 --- a/src/facsimilefunctor.cpp +++ b/src/facsimilefunctor.cpp @@ -43,7 +43,7 @@ FunctorCode SyncFromFacsimileFunctor::VisitLayerElement(LayerElement *layerEleme Zone *zone = layerElement->GetZone(); assert(zone); - layerElement->m_xAbs = m_view.ToLogicalX(zone->GetUlx() * DEFINITION_FACTOR); + layerElement->m_drawingFacsX = m_view.ToLogicalX(zone->GetUlx() * DEFINITION_FACTOR); return FUNCTOR_CONTINUE; } @@ -52,8 +52,8 @@ FunctorCode SyncFromFacsimileFunctor::VisitMeasure(Measure *measure) { Zone *zone = measure->GetZone(); assert(zone); - measure->m_xAbs = m_view.ToLogicalX(zone->GetUlx() * DEFINITION_FACTOR); - measure->m_xAbs2 = m_view.ToLogicalX(zone->GetLrx() * DEFINITION_FACTOR); + measure->m_drawingFacsX1 = m_view.ToLogicalX(zone->GetUlx() * DEFINITION_FACTOR); + measure->m_drawingFacsX2 = m_view.ToLogicalX(zone->GetLrx() * DEFINITION_FACTOR); return FUNCTOR_CONTINUE; } @@ -97,8 +97,8 @@ FunctorCode SyncFromFacsimileFunctor::VisitSb(Sb *sb) Zone *zone = sb->GetZone(); assert(zone); - m_currentSystem->m_xAbs = m_view.ToLogicalX(zone->GetUlx() * DEFINITION_FACTOR); - m_currentSystem->m_yAbs = m_view.ToLogicalY(zone->GetUly() * DEFINITION_FACTOR); + m_currentSystem->m_drawingFacsX = m_view.ToLogicalX(zone->GetUlx() * DEFINITION_FACTOR); + m_currentSystem->m_drawingFacsY = m_view.ToLogicalY(zone->GetUly() * DEFINITION_FACTOR); return FUNCTOR_CONTINUE; } @@ -107,7 +107,7 @@ FunctorCode SyncFromFacsimileFunctor::VisitStaff(Staff *staff) { Zone *zone = staff->GetZone(); assert(zone); - staff->m_yAbs = m_view.ToLogicalY(zone->GetUly() * DEFINITION_FACTOR); + staff->m_drawingFacsY = m_view.ToLogicalY(zone->GetUly() * DEFINITION_FACTOR); return FUNCTOR_CONTINUE; } diff --git a/src/iomei.cpp b/src/iomei.cpp index 66c7cf2076c..d9487f9020d 100644 --- a/src/iomei.cpp +++ b/src/iomei.cpp @@ -1640,8 +1640,8 @@ void MEIOutput::WriteSystem(pugi::xml_node currentNode, System *system) currentNode.append_attribute("system.rightmar") = StringFormat("%d", system->m_systemRightMar / DEFINITION_FACTOR).c_str(); // y positions - if (system->m_yAbs != VRV_UNSET) { - currentNode.append_attribute("uly") = StringFormat("%d", system->m_yAbs / DEFINITION_FACTOR).c_str(); + if (system->m_drawingFacsY != VRV_UNSET) { + currentNode.append_attribute("uly") = StringFormat("%d", system->m_drawingFacsY / DEFINITION_FACTOR).c_str(); } system->WriteTyped(currentNode); } @@ -1894,9 +1894,9 @@ void MEIOutput::WriteMeasure(pugi::xml_node currentNode, Measure *measure) measure->WritePointing(currentNode); measure->WriteTyped(currentNode); // For now we copy the adjusted value of coord.x1 and coord.x2 to xAbs and xAbs2 respectively - if ((measure->m_xAbs != VRV_UNSET) && (measure->m_xAbs2 != VRV_UNSET)) { - measure->SetCoordX1(measure->m_xAbs / DEFINITION_FACTOR); - measure->SetCoordX2(measure->m_xAbs2 / DEFINITION_FACTOR); + if ((measure->m_drawingFacsX1 != VRV_UNSET) && (measure->m_drawingFacsX2 != VRV_UNSET)) { + measure->SetCoordX1(measure->m_drawingFacsX1 / DEFINITION_FACTOR); + measure->SetCoordX2(measure->m_drawingFacsX2 / DEFINITION_FACTOR); measure->WriteCoordX1(currentNode); measure->WriteCoordX2(currentNode); } @@ -2226,8 +2226,8 @@ void MEIOutput::WriteStaff(pugi::xml_node currentNode, Staff *staff) staff->WriteVisibility(currentNode); // y position - if (staff->m_yAbs != VRV_UNSET) { - staff->SetCoordY1(staff->m_yAbs / DEFINITION_FACTOR); + if (staff->m_drawingFacsY != VRV_UNSET) { + staff->SetCoordY1(staff->m_drawingFacsY / DEFINITION_FACTOR); staff->WriteCoordY1(currentNode); } } @@ -2306,8 +2306,8 @@ void MEIOutput::WriteLayerElement(pugi::xml_node currentNode, LayerElement *elem this->WriteLinkingInterface(currentNode, element); element->WriteLabelled(currentNode); element->WriteTyped(currentNode); - if (element->m_xAbs != VRV_UNSET) { - element->SetCoordX1(element->m_xAbs / DEFINITION_FACTOR); + if (element->m_drawingFacsX != VRV_UNSET) { + element->SetCoordX1(element->m_drawingFacsX / DEFINITION_FACTOR); element->WriteCoordX1(currentNode); } } @@ -4578,7 +4578,7 @@ bool MEIInput::ReadSystem(Object *parent, pugi::xml_node system) system.remove_attribute("system.rightmar"); } if (system.attribute("uly") && m_doc->IsTranscription()) { - vrvSystem->m_yAbs = system.attribute("uly").as_int() * DEFINITION_FACTOR; + vrvSystem->m_drawingFacsY = system.attribute("uly").as_int() * DEFINITION_FACTOR; system.remove_attribute("uly"); } @@ -5370,8 +5370,8 @@ bool MEIInput::ReadMeasure(Object *parent, pugi::xml_node measure) if (measure.attribute("coord.x1") && measure.attribute("coord.x2") && m_doc->IsTranscription()) { vrvMeasure->ReadCoordX1(measure); vrvMeasure->ReadCoordX2(measure); - vrvMeasure->m_xAbs = vrvMeasure->GetCoordX1() * DEFINITION_FACTOR; - vrvMeasure->m_xAbs2 = vrvMeasure->GetCoordX2() * DEFINITION_FACTOR; + vrvMeasure->m_drawingFacsX1 = vrvMeasure->GetCoordX1() * DEFINITION_FACTOR; + vrvMeasure->m_drawingFacsX2 = vrvMeasure->GetCoordX2() * DEFINITION_FACTOR; } parent->AddChild(vrvMeasure); @@ -6063,7 +6063,7 @@ bool MEIInput::ReadStaff(Object *parent, pugi::xml_node staff) if (staff.attribute("coord.y1") && m_doc->IsTranscription()) { vrvStaff->ReadCoordY1(staff); - vrvStaff->m_yAbs = vrvStaff->GetCoordY1() * DEFINITION_FACTOR; + vrvStaff->m_drawingFacsY = vrvStaff->GetCoordY1() * DEFINITION_FACTOR; } if (!vrvStaff->HasN() || (vrvStaff->GetN() == 0)) { @@ -6303,7 +6303,7 @@ bool MEIInput::ReadLayerElement(pugi::xml_node element, LayerElement *object) if (element.attribute("coord.x1") && m_doc->IsTranscription()) { object->ReadCoordX1(element); - object->m_xAbs = object->GetCoordX1() * DEFINITION_FACTOR; + object->m_drawingFacsX = object->GetCoordX1() * DEFINITION_FACTOR; } return true; @@ -8471,14 +8471,14 @@ void MEIInput::UpgradeMeasureTo_3_0_0(Measure *measure, System *system) assert(system); assert(!measure->IsMeasuredMusic()); - if (system->m_yAbs == VRV_UNSET) return; + if (system->m_drawingFacsY == VRV_UNSET) return; if (system->m_systemRightMar == VRV_UNSET) return; if (system->m_systemRightMar == VRV_UNSET) return; Page *page = vrv_cast(system->GetFirstAncestor(PAGE)); assert(page); - measure->m_xAbs = system->m_systemLeftMar; - measure->m_xAbs2 = page->m_pageWidth - system->m_systemRightMar; + measure->m_drawingFacsX1 = system->m_systemLeftMar; + measure->m_drawingFacsX2 = page->m_pageWidth - system->m_systemRightMar; } void MEIInput::UpgradePageTo_3_0_0(Page *page, Doc *doc) diff --git a/src/layerelement.cpp b/src/layerelement.cpp index 90d453f4569..459d4c505df 100644 --- a/src/layerelement.cpp +++ b/src/layerelement.cpp @@ -127,7 +127,7 @@ void LayerElement::Reset() this->ResetLabelled(); this->ResetTyped(); - m_xAbs = VRV_UNSET; + m_drawingFacsX = VRV_UNSET; m_drawingYRel = 0; m_drawingXRel = 0; m_drawingCueSize = false; @@ -405,8 +405,8 @@ int LayerElement::GetDrawingX() const } } - // Since m_xAbs is the left position, we adjust the XRel accordingly in AdjustXRelForTranscription - if (m_xAbs != VRV_UNSET) return m_xAbs + this->GetDrawingXRel(); + // Since m_drawingFacsX is the left position, we adjust the XRel accordingly in AdjustXRelForTranscription + if (m_drawingFacsX != VRV_UNSET) return m_drawingFacsX + this->GetDrawingXRel(); if (m_cachedDrawingX != VRV_UNSET) return m_cachedDrawingX; @@ -532,7 +532,7 @@ void LayerElement::CacheYRel(bool restore) void LayerElement::CenterDrawingX() { - if (m_xAbs != VRV_UNSET) return; + if (m_drawingFacsX != VRV_UNSET) return; this->SetDrawingXRel(0); diff --git a/src/measure.cpp b/src/measure.cpp index 3e5cf77f2db..4439fe36ce8 100644 --- a/src/measure.cpp +++ b/src/measure.cpp @@ -137,8 +137,8 @@ void Measure::Reset() this->ResetDrawingScoreDef(); m_timestampAligner.Reset(); - m_xAbs = VRV_UNSET; - m_xAbs2 = VRV_UNSET; + m_drawingFacsX1 = VRV_UNSET; + m_drawingFacsX2 = VRV_UNSET; m_drawingXRel = 0; m_cachedXRel = VRV_UNSET; @@ -150,8 +150,8 @@ void Measure::Reset() m_leftBarLine.SetForm(this->GetLeft()); if (!m_measuredMusic) { - m_xAbs = VRV_UNSET; - m_xAbs2 = VRV_UNSET; + m_drawingFacsX1 = VRV_UNSET; + m_drawingFacsX2 = VRV_UNSET; } m_drawingEnding = NULL; @@ -216,12 +216,12 @@ int Measure::GetDrawingX() const if (!this->IsMeasuredMusic()) { const System *system = vrv_cast(this->GetFirstAncestor(SYSTEM)); assert(system); - if (system->m_yAbs != VRV_UNSET) { + if (system->m_drawingFacsY != VRV_UNSET) { return (system->m_systemLeftMar); } } - if (m_xAbs != VRV_UNSET) return m_xAbs; + if (m_drawingFacsX1 != VRV_UNSET) return m_drawingFacsX1; if (m_cachedDrawingX != VRV_UNSET) return m_cachedDrawingX; @@ -356,7 +356,7 @@ int Measure::GetWidth() const if (!this->IsMeasuredMusic()) { const System *system = vrv_cast(this->GetFirstAncestor(SYSTEM)); assert(system); - if (system->m_yAbs != VRV_UNSET) { + if (system->m_drawingFacsY != VRV_UNSET) { const Page *page = vrv_cast(system->GetFirstAncestor(PAGE)); assert(page); // xAbs2 = page->m_pageWidth - system->m_systemRightMar; @@ -364,7 +364,7 @@ int Measure::GetWidth() const } } - if (m_xAbs2 != VRV_UNSET) return (m_xAbs2 - m_xAbs); + if (m_drawingFacsX2 != VRV_UNSET) return (m_drawingFacsX2 - m_drawingFacsX1); assert(m_measureAligner.GetRightAlignment()); return m_measureAligner.GetRightAlignment()->GetXRel(); diff --git a/src/miscfunctor.cpp b/src/miscfunctor.cpp index c592281c499..9c3677a2823 100644 --- a/src/miscfunctor.cpp +++ b/src/miscfunctor.cpp @@ -32,15 +32,15 @@ FunctorCode ApplyPPUFactorFunctor::VisitLayerElement(LayerElement *layerElement) { if (layerElement->IsScoreDefElement()) return FUNCTOR_SIBLINGS; - if (layerElement->m_xAbs != VRV_UNSET) layerElement->m_xAbs /= m_page->GetPPUFactor(); + if (layerElement->m_drawingFacsX != VRV_UNSET) layerElement->m_drawingFacsX /= m_page->GetPPUFactor(); return FUNCTOR_CONTINUE; } FunctorCode ApplyPPUFactorFunctor::VisitMeasure(Measure *measure) { - if (measure->m_xAbs != VRV_UNSET) measure->m_xAbs /= m_page->GetPPUFactor(); - if (measure->m_xAbs2 != VRV_UNSET) measure->m_xAbs2 /= m_page->GetPPUFactor(); + if (measure->m_drawingFacsX1 != VRV_UNSET) measure->m_drawingFacsX1 /= m_page->GetPPUFactor(); + if (measure->m_drawingFacsX2 != VRV_UNSET) measure->m_drawingFacsX2 /= m_page->GetPPUFactor(); return FUNCTOR_CONTINUE; } @@ -60,15 +60,15 @@ FunctorCode ApplyPPUFactorFunctor::VisitPage(Page *page) FunctorCode ApplyPPUFactorFunctor::VisitStaff(Staff *staff) { - if (staff->m_yAbs != VRV_UNSET) staff->m_yAbs /= m_page->GetPPUFactor(); + if (staff->m_drawingFacsY != VRV_UNSET) staff->m_drawingFacsY /= m_page->GetPPUFactor(); return FUNCTOR_CONTINUE; } FunctorCode ApplyPPUFactorFunctor::VisitSystem(System *system) { - if (system->m_xAbs != VRV_UNSET) system->m_xAbs /= m_page->GetPPUFactor(); - if (system->m_yAbs != VRV_UNSET) system->m_yAbs /= m_page->GetPPUFactor(); + if (system->m_drawingFacsX != VRV_UNSET) system->m_drawingFacsX /= m_page->GetPPUFactor(); + if (system->m_drawingFacsY != VRV_UNSET) system->m_drawingFacsY /= m_page->GetPPUFactor(); system->m_systemLeftMar *= m_page->GetPPUFactor(); system->m_systemRightMar *= m_page->GetPPUFactor(); diff --git a/src/staff.cpp b/src/staff.cpp index 9a01f64d063..28b69219213 100644 --- a/src/staff.cpp +++ b/src/staff.cpp @@ -66,7 +66,7 @@ void Staff::Reset() this->ResetTyped(); this->ResetVisibility(); - m_yAbs = VRV_UNSET; + m_drawingFacsY = VRV_UNSET; m_drawingStaffSize = 100; m_drawingLines = 5; @@ -142,7 +142,7 @@ int Staff::GetDrawingY() const } } - if (m_yAbs != VRV_UNSET) return m_yAbs; + if (m_drawingFacsY != VRV_UNSET) return m_drawingFacsY; if (!m_staffAlignment) return 0; diff --git a/src/system.cpp b/src/system.cpp index f7deae78600..2a070dba54f 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -74,9 +74,9 @@ void System::Reset() m_systemLeftMar = 0; m_systemRightMar = 0; - m_xAbs = VRV_UNSET; + m_drawingFacsX = VRV_UNSET; m_drawingXRel = 0; - m_yAbs = VRV_UNSET; + m_drawingFacsY = VRV_UNSET; m_drawingYRel = 0; m_drawingTotalWidth = 0; m_drawingJustifiableWidth = 0; @@ -111,7 +111,7 @@ bool System::IsSupportedChild(Object *child) int System::GetDrawingX() const { - if (m_xAbs != VRV_UNSET) return m_xAbs; + if (m_drawingFacsX != VRV_UNSET) return m_drawingFacsX; m_cachedDrawingX = 0; return m_drawingXRel; @@ -119,7 +119,7 @@ int System::GetDrawingX() const int System::GetDrawingY() const { - if (m_yAbs != VRV_UNSET) return m_yAbs; + if (m_drawingFacsY != VRV_UNSET) return m_drawingFacsY; m_cachedDrawingY = 0; return m_drawingYRel;