libXpertMass Developer Documentation
  • libXpertMass
  • MonomerSpec
  • MonomerSpec Class

    class MsXpS::libXpertMass::MonomerSpec

    The MonomerSpec class provides the specification about how Monomer objects are represented. More...

    Header: #include <MonomerSpec.hpp>

    Public Functions

    MonomerSpec()
    virtual ~MonomerSpec()
    const QString &code()
    const QString &codeSound()
    const QString &name()
    const QString &nameSound()
    const QString &raster()
    void setCode(const QString &code)
    void setCodeSound(const QString &sound)
    void setName(const QString &name)
    void setNameSound(const QString &sound)
    void setRaster(const QString &raster)
    void setVector(const QString &vector)
    const QString &vector()

    Static Public Members

    bool parseFile(QString &file_path, QList<MonomerSpec *> *monomer_spec_list)

    Protected Variables

    QString m_code
    QString m_codeSound
    QString m_name
    QString m_nameSound
    QString m_raster
    QString m_vector

    Detailed Description

    The MonomerSpec class specifies how a Monomer object is represented graphically, mainly by connecting its monomer code to a graphics SVG file that is located in the Polymer chemistry definition directory. That connection is performed in the "monomer_dictionary" dictionary file itself also located in the polymer chemistry definition directory. Its contents look like this:

    A%alanine.svg
    C%cysteine.svg
    D%aspartate.svg
    E%glutamate.svg
    F%phenylalanine.svg
    G%glycine.svg
    H%histidine.svg"
    

    The A%alanine.svg line indicates that, when a Monomer object by code 'A' is to be rendered graphically, the corresponding vignette to be used is in the file named "alanine.svg" in the polymer chemistry definition directory.

    Member Function Documentation

    MonomerSpec::MonomerSpec()

    Constructs a MonomerSpec instance.

    [virtual noexcept] MonomerSpec::~MonomerSpec()

    Destructs this MonomerSpec instance.

    const QString &MonomerSpec::code()

    Returns the monomer code.

    See also setCode().

    const QString &MonomerSpec::codeSound()

    Returns the file name of the Monomer's code sound file.

    See also setCodeSound().

    const QString &MonomerSpec::name()

    Returns the monomer name.

    See also setName().

    const QString &MonomerSpec::nameSound()

    Returns the file name of the Monomer's name sound file.

    See also setNameSound().

    [static] bool MonomerSpec::parseFile(QString &file_path, QList<MonomerSpec *> *monomer_spec_list)

    Parses the file_path dictionary containing the Monomer specifications.

    At the moment the file has this format:

    A%alanine.svg
    C%cysteine.svg
    D%aspartate.svg
    E%glutamate.svg

    Upon parsing, the monomer_spec_list of MonomerSpec instances will be filled with instances created on the basis of each parsed line in the file.

    Returns true if the parsing was successful, false otherwise.

    const QString &MonomerSpec::raster()

    Returns the raster image file name.

    See also setRaster().

    void MonomerSpec::setCode(const QString &code)

    Sets the monomer code.

    See also code().

    void MonomerSpec::setCodeSound(const QString &sound)

    Sets the file name of the Monomer's code sound file.

    See also codeSound().

    void MonomerSpec::setName(const QString &name)

    Sets the monomer name.

    See also name().

    void MonomerSpec::setNameSound(const QString &sound)

    Sets the file name of the Monomer's name sound file.

    See also nameSound().

    void MonomerSpec::setRaster(const QString &raster)

    Sets the raster image file name to raster.

    See also raster().

    void MonomerSpec::setVector(const QString &vector)

    Sets the vector image file name to vector.

    See also vector().

    const QString &MonomerSpec::vector()

    Returns the vector image file name.

    See also setVector().

    Member Variable Documentation

    QString MonomerSpec::m_code

    This variable holds the code of the monomer.

    QString MonomerSpec::m_codeSound

    This variable holds the file name of the sound for the code of the monomer.

    QString MonomerSpec::m_name

    This variable holds the name of the monomer.

    QString MonomerSpec::m_nameSound

    This variable holds the file name of the sound for the name of the monomer.

    QString MonomerSpec::m_raster

    This variable holds the file name of the raster representation of the monomer.

    QString MonomerSpec::m_vector

    This variable holds the filename of the vector representation of the monomer.