forked from rism-digital/verovio
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Init adjustyrelfortranscriptionfunction
- Loading branch information
1 parent
6066bb2
commit e73ba54
Showing
6 changed files
with
97 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
///////////////////////////////////////////////////////////////////////////// | ||
// Name: adjustyrelfortranscriptionfunctor.h | ||
// Author: Yinan Zhou | ||
// Created: 2024 | ||
// Copyright (c) Authors and others. All rights reserved. | ||
///////////////////////////////////////////////////////////////////////////// | ||
|
||
#ifndef __VRV_ADJUSTYRELFORTRANSCRIPTIONFUNCTOR_H__ | ||
#define __VRV_ADJUSTYRELFORTRANSCRIPTIONFUNCTOR_H__ | ||
|
||
#include "functor.h" | ||
|
||
namespace vrv { | ||
|
||
//---------------------------------------------------------------------------- | ||
// AdjustYRelForTranscriptionFunctor | ||
//---------------------------------------------------------------------------- | ||
|
||
/** | ||
* This class adjusts the YRel positions taking into account the bounding boxes. | ||
*/ | ||
class AdjustYRelForTranscriptionFunctor : public Functor { | ||
public: | ||
/** | ||
* @name Constructors, destructors | ||
*/ | ||
///@{ | ||
AdjustYRelForTranscriptionFunctor(); | ||
virtual ~AdjustYRelForTranscriptionFunctor() = default; | ||
///@} | ||
|
||
/* | ||
* Abstract base implementation | ||
*/ | ||
bool ImplementsEndInterface() const override { return false; } | ||
|
||
/* | ||
* Functor interface | ||
*/ | ||
///@{ | ||
FunctorCode VisitLayerElement(LayerElement *layerElement) override; | ||
///@} | ||
|
||
protected: | ||
// | ||
private: | ||
// | ||
public: | ||
// | ||
private: | ||
// | ||
}; | ||
|
||
} // namespace vrv | ||
|
||
#endif // __VRV_ADJUSTYRELFORTRANSCRIPTIONFUNCTOR_H__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
///////////////////////////////////////////////////////////////////////////// | ||
// Name: adjustyrelfortranscriptionfunctor.cpp | ||
// Author: Yinan Zhou | ||
// Created: 2024 | ||
// Copyright (c) Authors and others. All rights reserved. | ||
///////////////////////////////////////////////////////////////////////////// | ||
|
||
#include "adjustyrelfortranscriptionfunctor.h" | ||
|
||
//---------------------------------------------------------------------------- | ||
|
||
//---------------------------------------------------------------------------- | ||
|
||
namespace vrv { | ||
|
||
//---------------------------------------------------------------------------- | ||
// AdjustYRelForTranscriptionFunctor | ||
//---------------------------------------------------------------------------- | ||
|
||
AdjustYRelForTranscriptionFunctor::AdjustYRelForTranscriptionFunctor() : Functor() {} | ||
|
||
FunctorCode AdjustYRelForTranscriptionFunctor::VisitLayerElement(LayerElement *layerElement) | ||
{ | ||
if (layerElement->m_drawingFacsY == VRV_UNSET) return FUNCTOR_CONTINUE; | ||
|
||
if (layerElement->IsScoreDefElement()) return FUNCTOR_SIBLINGS; | ||
|
||
if (!layerElement->HasSelfBB()) return FUNCTOR_CONTINUE; | ||
|
||
layerElement->SetDrawingYRel(-layerElement->GetSelfY1()); | ||
|
||
return FUNCTOR_CONTINUE; | ||
} | ||
|
||
} // namespace vrv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters