Documentation of MARTY
A Modern ARtificial Theoretical phYsicist
Data Structures | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes | Friends
drawer::LatexLinker Class Reference

Data Structures

struct  Color
 
struct  Edge
 
struct  Node
 

Public Types

enum  NodeType {
  None = 0,
  Operator,
  Cross,
  PlainDisk,
  HatchedDisk,
  None = 0,
  Operator,
  Cross,
  PlainDisk,
  HatchedDisk
}
 
enum  NodeType {
  None = 0,
  Operator,
  Cross,
  PlainDisk,
  HatchedDisk,
  None = 0,
  Operator,
  Cross,
  PlainDisk,
  HatchedDisk
}
 

Public Member Functions

 LatexLinker (Graph const &graph)
 
 LatexLinker (LatexLinker const &)=default
 
 LatexLinker (LatexLinker &&)=default
 
LatexLinkeroperator= (LatexLinker const &)=default
 
LatexLinkeroperator= (LatexLinker &&)=default
 
drawer::Graph const & getGraph () const
 
drawer::GraphgetGraph ()
 
std::string getName () const
 
void setName (std::string const &t_name)
 
void clear ()
 
void setGraph (drawer::Graph const &t_graph)
 
void setParticlesType (size_t i, size_t j, ParticleType type=ParticleType::Scalar, std::string const &t_name="", bool sign=true, double curve=0, bool flipped=false, Color color=Black, int lineWidth=3)
 
void addOperator (size_t pos)
 
void replaceParticlesType (size_t i, size_t j, ParticleType type=ParticleType::Scalar, bool sign=true)
 
void removeEdge (size_t i, size_t j)
 
void setVertexName (size_t pos, std::string const &name)
 
void setEdgeName (size_t i, size_t j, std::string const &name)
 
void setEdgeSign (size_t i, size_t j, bool sign)
 
void write (std::ostream &out)
 
void saveToNode (JSON::Node *node) const
 
void save (std::string const &fileName) const
 
void loadFromNode (JSON::Node *node)
 
void load (std::string const &fileName)
 
void exportPDF (std::string const &fileName, std::string const &path=".")
 
void exportPNG (std::string const &fileName, std::string const &path=".")
 
void scale (float factor)
 
std::vector< Node > & getNodes ()
 
std::vector< Node > const & getNodes () const
 
std::vector< Edge > & getEdges ()
 
std::vector< Edge > const & getEdges () const
 
void removeNode (size_t pos)
 
void addNode ()
 
std::string getNameExternal (size_t i) const
 
 LatexLinker (Graph const &graph)
 
 LatexLinker (LatexLinker const &)=default
 
 LatexLinker (LatexLinker &&)=default
 
LatexLinkeroperator= (LatexLinker const &)=default
 
LatexLinkeroperator= (LatexLinker &&)=default
 
drawer::Graph const & getGraph () const
 
drawer::GraphgetGraph ()
 
std::string getName () const
 
void setName (std::string const &t_name)
 
void clear ()
 
void setGraph (drawer::Graph const &t_graph)
 
void setParticlesType (size_t i, size_t j, ParticleType type=ParticleType::Scalar, std::string const &t_name="", bool sign=true, double curve=0, bool flipped=false, Color color=Black, int lineWidth=3)
 
void addOperator (size_t pos)
 
void replaceParticlesType (size_t i, size_t j, ParticleType type=ParticleType::Scalar, bool sign=true)
 
void removeEdge (size_t i, size_t j)
 
void setVertexName (size_t pos, std::string const &name)
 
void setEdgeName (size_t i, size_t j, std::string const &name)
 
void setEdgeSign (size_t i, size_t j, bool sign)
 
void write (std::ostream &out)
 
void saveToNode (JSON::Node *node) const
 
void save (std::string const &fileName) const
 
void loadFromNode (JSON::Node *node)
 
void load (std::string const &fileName)
 
void exportPDF (std::string const &fileName, std::string const &path=".")
 
void exportPNG (std::string const &fileName, std::string const &path=".")
 
void scale (float factor)
 
std::vector< Node > & getNodes ()
 
std::vector< Node > const & getNodes () const
 
std::vector< Edge > & getEdges ()
 
std::vector< Edge > const & getEdges () const
 
void removeNode (size_t pos)
 
void addNode ()
 
std::string getNameExternal (size_t i) const
 

Static Public Member Functions

static void saveMultiple (std::string const &fileName, std::vector< LatexLinker > const &links)
 
static std::vector< LatexLinkerloadMultiple (std::string const &fileName)
 
static void saveMultiple (std::string const &fileName, std::vector< LatexLinker > const &links)
 
static std::vector< LatexLinkerloadMultiple (std::string const &fileName)
 

Static Public Attributes

static constexpr Color Black {0, 0, 0, 255}
 
static constexpr Color White {255, 255, 255, 255}
 
static constexpr Color Red {255, 0, 0, 255}
 
static constexpr Color Blue {0, 0, 255, 255}
 
static constexpr Color Green {0, 255, 0, 255}
 
static bool autoLabel = true
 
static const std::string nameOrigin = "O"
 

Private Member Functions

void getFlippedEdgeLabels () const
 
void getStringValue (std::ostream &out, double value)
 
void writeVertex (std::ostream &out, size_t i, Point const &vertex, std::string const &nameVertex, std::string const &nameParticle="")
 
void writeEdge (std::ostream &out, ParticleType type, std::string const &nameA, std::string const &nameB, bool sign=true, std::string const &nameEdge="", bool flipLabel=false)
 
void writeLoopEdge (std::ostream &out, ParticleType type, std::string const &nameA, std::string const &nameB, int mode, bool sign=true, std::string const &nameEdge="", bool flipLabel=false)
 
void getFlippedEdgeLabels () const
 
void getStringValue (std::ostream &out, double value)
 
void writeVertex (std::ostream &out, size_t i, Point const &vertex, std::string const &nameVertex, std::string const &nameParticle="")
 
void writeEdge (std::ostream &out, ParticleType type, std::string const &nameA, std::string const &nameB, bool sign=true, std::string const &nameEdge="", bool flipLabel=false)
 
void writeLoopEdge (std::ostream &out, ParticleType type, std::string const &nameA, std::string const &nameB, int mode, bool sign=true, std::string const &nameEdge="", bool flipLabel=false)
 

Static Private Member Functions

static std::string getNameVertex (size_t pos)
 
static std::string getNameVertex (size_t pos)
 

Private Attributes

std::string name
 
float scaleFactor = 1.3
 
Graph graph
 
std::vector< Edgeedges
 
std::map< std::pair< size_t, size_t >, int > multiplicity
 
std::vector< Nodenodes
 

Friends

std::ostream & operator<< (std::ostream &out, LatexLinker &linker)
 
std::ostream & operator<< (std::ostream &out, LatexLinker &linker)
 

The documentation for this class was generated from the following files: