Open
Graph Drawing
Framework

 v.2012.05
 

ogdf::OgmlParser Class Reference

#include <ogdf/fileformats/OgmlParser.h>

List of all members.

Public Member Functions

 OgmlParser ()
 ~OgmlParser ()
bool read (const char *fileName, Graph &G, ClusterGraph &CG)
bool read (const char *fileName, Graph &G, ClusterGraph &CG, ClusterGraphAttributes &CGA)

Private Member Functions

int validate (const XmlTagObject *xmlTag, int ogmlTag)
void printValidityInfo (const OgmlTag &ot, const XmlTagObject &xto, int valStatus, int line)
bool checkGraphType (const XmlTagObject *xmlTag) const
bool isGraphHierarchical (const XmlTagObject *xmlTag) const
bool isNodeHierarchical (const XmlTagObject *xmlTag) const
GraphType getGraphType ()
bool buildGraph (Graph &G)
bool buildCluster (const XmlTagObject *rootTag, Graph &G, ClusterGraph &CG)
bool buildClusterRecursive (const XmlTagObject *xmlTag, cluster parent, Graph &G, ClusterGraph &CG)
bool buildAttributedClusterGraph (Graph &G, ClusterGraphAttributes &CGA, const XmlTagObject *root)
bool setLabelsRecursive (Graph &G, ClusterGraphAttributes &CGA, XmlTagObject *root)
int getBrushPatternAsInt (String s)
int getShapeAsInt (String s)
String getNodeTemplateFromOgmlValue (String s)
int getLineTypeAsInt (String s)
int getImageStyleAsInt (String s)
int getImageAlignmentAsInt (String s)
int getArrowStyleAsInt (String s, String sot)
GraphAttributes::EdgeArrow getArrowStyle (int i)
String getLabelCaptionFromString (String str)
bool getIdFromString (String str, int id)
void validate (const char *fileName)

Static Private Member Functions

static void buildHashTables ()

Private Attributes

GraphType graphType
Hashing< String, const
XmlTagObject * > 
ids
Hashing< String, nodem_nodes
Hashing< String, edgem_edges
Hashing< String, clusterm_clusters
Hashing< String, DPointpoints
Hashing< int, Stringm_nodeIds
Hashing< int, Stringm_edgeIds
Hashing< int, Stringm_clusterIds
XmlTagObjectm_constraintsTag
Hashing< String,
OgmlNodeTemplate * > 
m_ogmlNodeTemplates
Hashing< String,
OgmlEdgeTemplate * > 
m_ogmlEdgeTemplates

Static Private Attributes

static Hashing< int, OgmlTagtags
static Hashing< int,
OgmlAttribute
attributes
static Hashing< int,
OgmlAttributeValue
attValues
static bool hashTablesBuilt

Detailed Description

Objects of this class represent a validating parser for files in Ogml.

Definition at line 810 of file OgmlParser.h.


Constructor & Destructor Documentation

Definition at line 1022 of file OgmlParser.h.

Definition at line 1024 of file OgmlParser.h.


Member Function Documentation

bool ogdf::OgmlParser::buildAttributedClusterGraph ( Graph G,
ClusterGraphAttributes CGA,
const XmlTagObject root 
) [private]
bool ogdf::OgmlParser::buildCluster ( const XmlTagObject rootTag,
Graph G,
ClusterGraph CG 
) [private]
bool ogdf::OgmlParser::buildClusterRecursive ( const XmlTagObject xmlTag,
cluster  parent,
Graph G,
ClusterGraph CG 
) [private]
bool ogdf::OgmlParser::buildGraph ( Graph G) [private]
static void ogdf::OgmlParser::buildHashTables ( ) [static, private]

Builds all hashtables above.

bool ogdf::OgmlParser::checkGraphType ( const XmlTagObject xmlTag) const [private]

Finds the OGML-tag in the parse tree with the specified id, stores the tag in xmlTag recTag is the tag for recursive calls returns false if something goes wrongChecks the graph type and stores it in the member variable m_graphType xmlTag has to be the root or the graph or the structure Ogml-tag returns false if something goes wrong

int ogdf::OgmlParser::getArrowStyleAsInt ( String  s,
String  sot 
) [private]

Definition at line 883 of file OgmlParser.h.

bool ogdf::OgmlParser::getIdFromString ( String  str,
int  id 
) [private]
bool ogdf::OgmlParser::isGraphHierarchical ( const XmlTagObject xmlTag) const [private]

true if subgraph is an hierarchical graph

bool ogdf::OgmlParser::isNodeHierarchical ( const XmlTagObject xmlTag) const [private]

true if node contains other nodes

void ogdf::OgmlParser::printValidityInfo ( const OgmlTag ot,
const XmlTagObject xto,
int  valStatus,
int  line 
) [private]

Wrapper method for validate method above. Returns true when validation is successfull, false otherwise.Prints some useful information about un-/successful validation.

bool ogdf::OgmlParser::read ( const char *  fileName,
Graph G,
ClusterGraph CG 
)
bool ogdf::OgmlParser::read ( const char *  fileName,
Graph G,
ClusterGraph CG,
ClusterGraphAttributes CGA 
)
bool ogdf::OgmlParser::setLabelsRecursive ( Graph G,
ClusterGraphAttributes CGA,
XmlTagObject root 
) [private]
int ogdf::OgmlParser::validate ( const XmlTagObject xmlTag,
int  ogmlTag 
) [private]

Checks if all tags (XmlTagObject), their attributes (XmlAttributeObject) and their values are valid (are tags expected, do they own the rigth attributes...) and sets a valid flag to these. Furthermore it checks if ids of tags are unique and if id references are valid. See OgmlTag.h for semantics of the encodings. Returns the validity state of the current processed tag.

void ogdf::OgmlParser::validate ( const char *  fileName) [private]

Member Data Documentation

Hashtable for saving all ogml attributes.

Definition at line 819 of file OgmlParser.h.

Hashtable for saving all values of ogml attributes.

Definition at line 823 of file OgmlParser.h.

Saves a graph type. Is set by checkGraphType.

Definition at line 835 of file OgmlParser.h.

bool ogdf::OgmlParser::hashTablesBuilt [static, private]

Flag denotes whether hashtables above were built or not.

Definition at line 827 of file OgmlParser.h.

Saves all ids of an ogml-file.

Definition at line 839 of file OgmlParser.h.

Definition at line 901 of file OgmlParser.h.

Definition at line 891 of file OgmlParser.h.

Definition at line 971 of file OgmlParser.h.

Definition at line 900 of file OgmlParser.h.

Definition at line 890 of file OgmlParser.h.

Definition at line 899 of file OgmlParser.h.

Definition at line 883 of file OgmlParser.h.

Definition at line 894 of file OgmlParser.h.

Hashing<int, OgmlTag> ogdf::OgmlParser::tags [static, private]

Hashtable for saving all ogml tags.

Definition at line 815 of file OgmlParser.h.


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