2.2.12. GraphPrinter.h Class GraphPrinter

class GraphPrinter

This class is used to configure how graphs are visualised.


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. Synopsis

struct GraphPrinter {
    GraphPrinter(const GraphPrinter&) = delete;
    GraphPrinter &operator=(const GraphPrinter&) = delete;
    const lib::IO::Graph::Write::Options &getOptions() const;
    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 setRotation(int degrees);
    int getRotation() const;
    std::unique_ptr<lib::IO::Graph::Write::Options> options;
}; Details

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 setRotation(int degrees)
int getRotation() const

Rotation of internally computed coordinates.