Skip to content

Commit

Permalink
Rename m_*Abs members to m_drawingFacs*
Browse files Browse the repository at this point in the history
  • Loading branch information
lpugin committed Dec 29, 2023
1 parent 972ae2c commit 6d05ef6
Show file tree
Hide file tree
Showing 13 changed files with 55 additions and 55 deletions.
2 changes: 1 addition & 1 deletion include/vrv/doc.h
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ class Doc : public Object {
void ConvertMarkupDoc(bool permanent = true);

/**
* Sync the coordinate provided trought <facsimile> to m_Abs.
* Sync the coordinate provided trought <facsimile> to m_drawingFacsX/Y.
* Call the SyncToFacsimile functor.
*/
void SyncFromFacsimileDoc();
Expand Down
2 changes: 1 addition & 1 deletion include/vrv/layerelement.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions include/vrv/measure.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
///@}

/**
Expand Down
2 changes: 1 addition & 1 deletion include/vrv/staff.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 2 additions & 2 deletions include/vrv/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/adjustxrelfortranscriptionfunctor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
12 changes: 6 additions & 6 deletions src/facsimilefunctor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down
34 changes: 17 additions & 17 deletions src/iomei.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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);
}
}
Expand Down Expand Up @@ -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");
}

Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)) {
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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<Page *>(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)
Expand Down
8 changes: 4 additions & 4 deletions src/layerelement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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);

Expand Down
16 changes: 8 additions & 8 deletions src/measure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -216,12 +216,12 @@ int Measure::GetDrawingX() const
if (!this->IsMeasuredMusic()) {
const System *system = vrv_cast<const System *>(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;

Expand Down Expand Up @@ -356,15 +356,15 @@ int Measure::GetWidth() const
if (!this->IsMeasuredMusic()) {
const System *system = vrv_cast<const System *>(this->GetFirstAncestor(SYSTEM));
assert(system);
if (system->m_yAbs != VRV_UNSET) {
if (system->m_drawingFacsY != VRV_UNSET) {
const Page *page = vrv_cast<const Page *>(system->GetFirstAncestor(PAGE));
assert(page);
// xAbs2 = page->m_pageWidth - system->m_systemRightMar;
return page->m_pageWidth - system->m_systemLeftMar - system->m_systemRightMar;
}
}

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();
Expand Down
12 changes: 6 additions & 6 deletions src/miscfunctor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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();

Expand Down
4 changes: 2 additions & 2 deletions src/staff.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;

Expand Down
8 changes: 4 additions & 4 deletions src/system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -111,15 +111,15 @@ 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;
}

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;
Expand Down

0 comments on commit 6d05ef6

Please sign in to comment.