26 const char *legacyT0Name,
const char *legacyT1Name)
const
29 xmlFile.WriteAttr(legacyT0Name, t0(), 10);
30 xmlFile.WriteAttr(legacyT1Name, t1(), 10);
31#ifdef EXPERIMENTAL_SPECTRAL_EDITING
41 const char *legacyT0Name,
const char *legacyT1Name)
46 if (attr == legacyT0Name)
48 else if (attr == legacyT1Name)
50#ifdef EXPERIMENTAL_SPECTRAL_EDITING
52 setter = &SelectedRegion::setF0;
54 setter = &SelectedRegion::setF1;
61 if (!value.
TryGet(dblValue))
65 (void)(this->*setter)(dblValue,
false);
71 const char *legacyT0Name,
const char *legacyT1Name)
75 { legacyT0Name, [=](
auto &selectedRegion,
auto value){
77 .HandleXMLAttribute(legacyT0Name, value,
78 legacyT0Name, legacyT1Name);
80 { legacyT1Name, [=](
auto &selectedRegion,
auto value){
82 .HandleXMLAttribute(legacyT1Name, value,
83 legacyT0Name, legacyT1Name);
85#ifdef EXPERIMENTAL_SPECTRAL_EDITING
Defines a selected portion of a project.
static XMLMethodRegistryBase::Mutators< SelectedRegion > Mutators(const char *legacyT0Name, const char *legacyT1Name)
void WriteXMLAttributes(XMLWriter &xmlFile, const char *legacyT0Name=sDefaultT0Name, const char *legacyT1Name=sDefaultT1Name) const
static const char * sDefaultT1Name
static const char * sDefaultT0Name
bool HandleXMLAttribute(const std::string_view &attr, const XMLAttributeValueView &value, const char *legacyT0Name=sDefaultT0Name, const char *legacyT1Name=sDefaultT1Name)
bool setT0(double t, bool maySwap=true)
bool setT1(double t, bool maySwap=true)
A view into an attribute value. The class does not take the ownership of the data.
bool TryGet(bool &value) const noexcept
Try to get a boolean value from the view.
std::vector< std::pair< std::string, Mutator< Substructure > > > Mutators
A helper type alias for a list of mutators, associated with tag strings.
Base class for XMLFileWriter and XMLStringWriter that provides the general functionality for creating...
const char * sDefaultF1Name
const char * sDefaultF0Name