2.2.12.5. graph/Printer.hpp

2.2.12.5.1. Class graph::Printer

class graph::Printer

This class is used to configure how graphs are visualised.

Warning

Some of these options greatly alter how graphs are depicted and the result may not accurately represent the underlying graph, and may make non-molecules look like molecules.

2.2.12.5.1.1. Synopsis

struct MOD_DECL Printer {
    Printer();
    Printer(const Printer &that);
    Printer &operator=(const Printer &that);
    ~Printer();
    const lib::IO::Graph::Write::Options &getOptions() const;
    MOD_DECL friend bool operator==(const Printer &a, const Printer &b);
    MOD_DECL friend bool operator!=(const Printer &a, const Printer &b);
    void setMolDefault();
    void setReactionDefault();
    void disableAll();
    void enableAll();
    void setEdgesAsBonds(bool value);
    bool getEdgesAsBonds() const;
    void setCollapseHydrogens(bool value);
    bool getCollapseHydrogens() const;
    void setRaiseCharges(bool value);
    bool getRaiseCharges() const;
    void setSimpleCarbons(bool value);
    bool getSimpleCarbons() const;
    void setThick(bool value);
    bool getThick() const;
    void setWithColour(bool value);
    bool getWithColour() const;
    void setWithIndex(bool value);
    bool getWithIndex() const;
    void setWithTexttt(bool value);
    bool getWithTexttt() const;
    void setWithRawStereo(bool value);
    bool getWithRawStereo() const;
    void setWithPrettyStereo(bool value);
    bool getWithPrettyStereo() const;
    void setRotation(int degrees);
    int getRotation() const;
    void setMirror(bool value);
    bool getMirror() const;
private:
    std::unique_ptr<lib::IO::Graph::Write::Options> options;
};

2.2.12.5.1.2. Details

friend bool operator==(const Printer &a, const Printer &b)
friend bool operator!=(const Printer &a, const Printer &b)
void setMolDefault()

Shortcut for enabling all but thickening and index printing.

void setReactionDefault()

Shortcut for enabling all but thickening, index printing and simplification of carbon atoms.

void disableAll()

Disable all special printing features.

void enableAll()

Enable all special printing features, except typewriter font.

void setEdgesAsBonds(bool value)
bool getEdgesAsBonds() const

Control whether edges with special labels are drawn as chemical bonds.

void setCollapseHydrogens(bool value)
bool getCollapseHydrogens() const

Control whether vertices representing hydrogen atoms are collapsed into their neighbours labels.

void setRaiseCharges(bool value)
bool getRaiseCharges() const

Control whether a vertex label suffix encoding a charge is written as a superscript to the rest of the label.

void setSimpleCarbons(bool value)
bool getSimpleCarbons() const

Control whether some vertices encoding carbon atoms are depicted without any label.

void setThick(bool value)
bool getThick() const

Control whether all edges are drawn thicker than normal and all labels are written in bold.

void setWithColour(bool value)
bool getWithColour() const

Control whether colour is applied to certain elements of the graph which are molecule-like.

void setWithIndex(bool value)
bool getWithIndex() const

Control whether the underlying indices of the vertices are printed.

void setWithTexttt(bool value)
bool getWithTexttt() const

Control whether the vertex and edge labels are written with typewriter font.

void setWithRawStereo(bool value)
bool getWithRawStereo() const

Control whether the vertices and edges are annotated with the raw stereo properties.

void setWithPrettyStereo(bool value)
bool getWithPrettyStereo() const

Control whether the vertices and edges are annotated with stylized stereo properties.

void setRotation(int degrees)
int getRotation() const

Rotation of internally computed coordinates.

void setMirror(bool value)
bool getMirror() const

Mirror internally computed coordinates in the y-axis.