Open
Graph Drawing
Framework

 v.2012.05
 

Ogml.h
Go to the documentation of this file.
00001 /*
00002  * $Revision: 2299 $
00003  * 
00004  * last checkin:
00005  *   $Author: gutwenger $ 
00006  *   $Date: 2012-05-07 15:57:08 +0200 (Mon, 07 May 2012) $ 
00007  ***************************************************************/
00008  
00044 #ifdef _MSC_VER
00045 #pragma once
00046 #endif
00047 
00048 #ifndef OGDF_OGML_H
00049 #define OGDF_OGML_H
00050 
00051 #include <ogdf/basic/String.h>
00052 
00053 namespace ogdf
00054 {
00055 
00056 
00059   const int TAG_NUM = 47, ATT_NUM = 48, ATT_VAL_NUM = 131;
00060 
00061 // max count of ogml tags
00062   const int MAX_TAG_COUNT = 4000;
00063 
00067   enum OgmlTagId
00068   {
00069     t_none = -1,
00070     t_bool,
00071     t_composed,
00072     t_constraint,
00073     t_constraints,
00074     t_content,
00075     t_data,
00076     t_default,
00077     t_edge,
00078     t_edgeRef,
00079     t_edgeStyle,
00080     t_edgeStyleTemplate,
00081     t_edgeStyleTemplateRef, //tag template within tag edgeStyle/-Template
00082     t_endpoint,
00083     t_fill,
00084     t_font,
00085     t_graph,
00086     t_graphStyle,
00087     t_int,
00088     t_label,
00089     t_labelRef,
00090     t_labelStyle,
00091     t_labelStyleTemplate,
00092     t_labelStyleTemplateRef,    //tag template within tag labelStyle/-Template 
00093     t_layout,
00094     t_line,
00095     t_location,
00096     t_node,
00097     t_nodeRef,
00098     t_nodeStyle,
00099     t_nodeStyleTemplate,
00100     t_nodeStyleTemplateRef, //tag template within tag nodeStyle/-Template
00101     t_num,
00102     t_ogml,
00103     t_point,
00104     t_port,
00105     t_segment,
00106     t_shape,
00107     t_source,
00108     t_sourceStyle,
00109     t_string,
00110     t_structure,
00111     t_styles,
00112     t_styleTemplates,
00113     t_target,
00114     t_targetStyle,
00115     t_text,
00116     t_image
00117   };
00118 
00121   const String ogmlTagNames[] = {
00122     //"none"
00123     "bool",
00124     "composed",
00125     "constraint",
00126     "constraints",
00127     "content",
00128     "data",
00129     "default",
00130     "edge",
00131     "edgeRef",
00132     "edgeStyle",
00133     "edgeStyleTemplate",
00134     "template",
00135     "endpoint",
00136     "fill",
00137     "font",
00138     "graph",
00139     "graphStyle",
00140     "int",
00141     "label",
00142     "labelRef",
00143     "labelStyle",
00144     "labelStyleTemplate",
00145     "template",
00146     "layout",
00147     "line",
00148     "location",
00149     "node",
00150     "nodeRef",
00151     "nodeStyle",
00152     "nodeStyleTemplate",
00153     "template",
00154     "num",
00155     "ogml",
00156     "point",
00157     "port",
00158     "segment",
00159     "shape",
00160     "source",
00161     "sourceStyle",
00162     "string",
00163     "structure",
00164     "styles",
00165     "styleTemplates",
00166     "target",
00167     "targetStyle",
00168     "text",
00169     "image"
00170   };
00171 
00175   enum OgmlAttributeId
00176   {
00177     a_none = -1,
00178     a_alignment,
00179     a_angle,
00180     a_color,
00181     a_decoration,
00182     a_defaultEdgeTemplate,
00183     a_defaultLabelTemplate,
00184     a_defaultNodeTemplate,
00185     a_family,
00186     a_height,
00187     a_id,           //id attribute
00188     a_nodeIdRef,        //attribute idRef of elements source, target, nodeRef, nodeStyle
00189     a_edgeIdRef,        //attribute idRef of elements edgeRef, edgeStyle
00190     a_labelIdRef,       //attribute idRef of elements edgeRef, edgeStyle
00191     a_sourceIdRef,      //attribute idRef of element endpoint
00192     a_targetIdRef,      //attribute idRef of element endpoint
00193     a_nodeStyleTemplateIdRef,   //attribute idRef of subelement template of element nodeStyle
00194     a_edgeStyleTemplateIdRef,   //attribute idRef of subelement template of element edgeStyle
00195     a_labelStyleTemplateIdRef,  //attribute idRef of subelement template of element labelStyle
00196     a_endpointIdRef,        //attribute idRef of subelement endpoint of element segment
00197     a_name,
00198     a_nLineType,        //attribute type of subelement line of tag nodeStyleTemplate
00199     a_nShapeType,       //attribute type of subelement shape of tag nodeStyleTemplate
00200     a_pattern,
00201     a_patternColor,
00202     a_rotation,
00203     a_size,
00204     a_stretch,
00205     a_style,
00206     a_transform,
00207     a_type,         //attribute type of subelements source-/targetStyle of tag edgeStyleTemplate
00208     a_uri,
00209     a_intValue,
00210     a_boolValue,
00211     a_numValue,
00212     a_variant,
00213     a_weight,
00214     a_width,
00215     a_x,
00216     a_y,
00217     a_z,
00218     a_imageUri,
00219     a_imageStyle,
00220     a_imageAlignment,
00221     a_imageDrawLine,
00222     a_imageWidth,
00223     a_imageHeight,
00224     a_constraintType,
00225     a_disabled
00226   };
00227 
00230 const String ogmlAttributeNames[] = {
00231     "alignment",
00232     "angle",
00233     "color",
00234     "decoration",
00235     "defaultEdgeTemplate",
00236     "defaultLabelTemplate",
00237     "defaultNodeTemplate",
00238     "family",
00239     "height",
00240     "id",           //id attribute
00241     "idRef",            //attribute idRef of elements source, target, nodeRef, nodeStyle
00242     "idRef",            //attribute idRef of elements edgeRef, edgeStyle
00243     "idRef",            //attribute idRef of elements edgeRef, edgeStyle
00244     "idRef",            //attribute idRef of element endpoint
00245     "idRef",            //attribute idRef of element endpoint
00246     "idRef",            //attribute idRef of subelement template of element nodeStyle
00247     "idRef",            //attribute idRef of subelement template of element edgeStyle
00248     "idRef",            //attribute idRef of subelement template of element labelStyle
00249     "idRef",            //attribute idRef of subelement endpoint of element segment
00250     "name",
00251     "type",         //attribute type of subelement line of tag nodeStyleTemplate
00252     "type",         //attribute type of subelement shape of tag nodeStyleTemplate
00253     "pattern",
00254     "patternColor",
00255     "rotation",
00256     "size",
00257     "stretch",
00258     "style",
00259     "transform",
00260     "type",         //attribute type of subelements source-/targetStyle of tag edgeStyleTemplate
00261     "uri",
00262     "value",
00263     "value",
00264     "value",
00265     "variant",
00266     "weight",
00267     "width",
00268     "x",
00269     "y",
00270     "z",
00271     "uri",
00272     "style",
00273     "alignment",
00274     "drawLine",
00275     "width",
00276     "height",
00277     "type",
00278     "disabled"
00279   };
00280 
00284   enum OgmlAttributeValueId
00285   {
00286     av_any = 0,         //for any attributeValue
00287     av_blink,
00288     av_bold,
00289     av_bolder,
00290     av_bool,
00291     av_box,
00292     av_capitalize,
00293     av_center,
00294     av_checked,
00295     av_circle,
00296     av_condensed,
00297     av_cursive,
00298     av_dashed,
00299     av_esNoPen, // values for line style
00300     av_esSolid,
00301     av_esDash,
00302     av_esDot,
00303     av_esDashdot,
00304     av_esDashdotdot,
00305     av_diamond,
00306     av_dotted,
00307     av_double,
00308     av_doubleSlash,
00309     av_ellipse,
00310     av_expanded,
00311     av_extraCondensed,
00312     av_extraExpanded,
00313     av_fantasy,
00314     av_filledBox,
00315     av_filledCircle,
00316     av_filledDiamond,
00317     av_filledHalfBox,
00318     av_filledHalfCircle,
00319     av_filledHalfDiamond,
00320     av_filledHalfRhomb,
00321     av_filledRhomb,
00322     av_smurf,
00323     av_arrow,
00324     av_groove,
00325     av_halfBox,
00326     av_halfCircle,
00327     av_halfDiamond,
00328     av_halfRhomb,
00329     av_hexagon,
00330     av_hex,         //hexadecimal value
00331     av_id,
00332     av_nodeIdRef,       //attribute idRef of elements source, target, nodeRef, nodeStyle
00333     av_edgeIdRef,       //attribute idRef of elements edgeRef, edgeStyle
00334     av_labelIdRef,      //attribute idRef of elements edgeRef, edgeStyle
00335     av_sourceIdRef,     //attribute idRef of element endpoint
00336     av_targetIdRef,     //attribute idRef of element endpoint
00337     av_nodeStyleTemplateIdRef,  //attribute idRef of subelement template of element nodeStyle
00338     av_edgeStyleTemplateIdRef,  //attribute idRef of subelement template of element edgeStyle
00339     av_labelStyleTemplateIdRef, //attribute idRef of subelement template of element labelStyle
00340     av_pointIdRef,      //attribute idRef of subelement endpoint of element segment 
00341     av_image,
00342     av_inset,
00343     av_int,         //integer value
00344     av_italic,
00345     av_justify,
00346     av_left,
00347     av_lighter,
00348     av_line,
00349     av_lineThrough,
00350     av_lowercase,
00351     av_lParallelogram,
00352     av_monospace,
00353     av_narrower,
00354     av_none,
00355     av_normal,
00356     av_num,         //real value
00357     av_oblique,
00358     av_oct,
00359     av_octagon,
00360     av_outset,
00361     av_overline,
00362     av_pentagon,
00363     av_rect,
00364     av_rectSimple,
00365     av_rhomb,
00366     av_ridge,
00367     av_right,
00368     av_rParallelogram,
00369     av_sansSerif,
00370     av_semiCondensed,
00371     av_semiExpanded,
00372     av_serif,
00373     av_slash,
00374     av_smallCaps,
00375     av_solid,
00376     av_bpNone, // values for node patterns
00377     av_bpSolid,
00378     av_bpDense1,
00379     av_bpDense2,
00380     av_bpDense3,
00381     av_bpDense4,
00382     av_bpDense5,
00383     av_bpDense6,
00384     av_bpDense7,
00385     av_bpHorizontal,
00386     av_bpVertical,
00387     av_bpCross,
00388     av_bpBackwardDiagonal,
00389     av_bpForwardDiagonal,
00390     av_bpDiagonalCross,
00391     av_string,
00392     av_striped,
00393     av_trapeze,
00394     av_triangle,
00395     av_triple,
00396     av_ultraCondensed,
00397     av_ultraExpanded,
00398     av_umlClass,
00399     av_underline,
00400     av_uppercase,
00401     av_upTrapeze,
00402     av_uri,
00403     av_wider,
00404     av_freeScale,   // image-style
00405     av_fixScale,    // image-style
00406     av_topLeft,     // image-alignemnt
00407     av_topCenter,   // image-alignemnt
00408     av_topRight,    // image-alignemnt
00409     av_centerLeft,  // image-alignemnt
00410 //  av_center,  // just defined // image-alignemnt
00411     av_centerRight, // image-alignemnt
00412     av_bottomLeft,  // image-alignemnt
00413     av_bottomCenter,// image-alignemnt
00414     av_bottomRight, // image-alignemnt
00415 // Constraint-Types:
00416     av_constraintAlignment,
00417     av_constraintAnchor,
00418     av_constraintSequence
00419   };
00420 
00423   const String ogmlAttributeValueNames[] = {
00424     "any",          //for any attributeValue
00425     "blink",
00426     "bold",
00427     "bolder",
00428     "bool",
00429     "box",
00430     "capitalize",
00431     "center",
00432     "checked",
00433     "circle",
00434     "condensed",
00435     "cursive",
00436     "dashed",
00437     "esNoPen",  // values for line style
00438     "esSolid",
00439     "esDash",
00440     "esDot",
00441     "esDashdot",
00442     "esDashdotdot",
00443     "diamond",
00444     "dotted",
00445     "double",
00446     "doubleSlash",
00447     "ellipse",
00448     "expanded",
00449     "extraCondensed",
00450     "extraExpanded",
00451     "fantasy",
00452     "filledBox",
00453     "filledCircle",
00454     "filledDiamond",
00455     "filledHalfBox",
00456     "filledHalfCircle",
00457     "filledHalfDiamond",
00458     "filledHalfRhomb",
00459     "filledRhomb",
00460     "smurf",
00461     "arrow",
00462     "groove",
00463     "halfBox",
00464     "halfCircle",
00465     "halfDiamond",
00466     "halfRhomb",
00467     "hexagon",
00468     "hex",
00469     "id",
00470     "nodeId",           //attribute idRef of elements source, target, nodeRef, nodeStyle
00471     "edgeId",           //attribute idRef of elements edgeRef, edgeStyle
00472     "labelId",          //attribute idRef of elements edgeRef, edgeStyle
00473     "sourceId",         //attribute idRef of element endpoint
00474     "targetId",         //attribute idRef of element endpoint
00475     "nodeStyleTemplateId",  //attribute idRef of subelement template of element nodeStyle
00476     "edgeStyleTemplateId",  //attribute idRef of subelement template of element edgeStyle
00477     "labelStyleTemplateId", //attribute idRef of subelement template of element labelStyle
00478     "pointId",          //attribute idRef of subelement endpoint of element segment
00479     "image",
00480     "inset",
00481     "int",
00482     "italic",
00483     "justify",
00484     "left",
00485     "lighter",
00486     "line",
00487     "lineThrough",
00488     "lowercase",
00489     "lParallelogram",
00490     "monospace",
00491     "narrower",
00492     "none",
00493     "normal",
00494     "num",
00495     "oblique",
00496     "oct",
00497     "octagon",
00498     "outset",
00499     "overline",
00500     "pentagon",
00501     "rect",
00502     "rectSimple",
00503     "rhomb",
00504     "ridge",
00505     "right",
00506     "rParallelogram",
00507     "sansSerif",
00508     "semiCondensed",
00509     "semiExpanded",
00510     "serif",
00511     "slash",
00512     "smallCaps",
00513     "solid",
00514     "bpNone", // values for node patterns
00515     "bpSolid",
00516     "bpDense1",
00517     "bpDense2",
00518     "bpDense3",
00519     "bpDense4",
00520     "bpDense5",
00521     "bpDense6",
00522     "bpDense7",
00523     "bpHorizontal",
00524     "bpVertical",
00525     "bpCross",
00526     "bpBackwardDiagonal",
00527     "bpForwardDiagonal",
00528     "bpDiagonalCross",
00529     "string",
00530     "striped",
00531     "trapeze",
00532     "triangle",
00533     "triple",
00534     "ultraCondensed",
00535     "ultraExpanded",
00536     "umlClass",
00537     "underline",
00538     "uppercase",
00539     "upTrapeze",
00540     "uri",
00541     "wider",
00542     "freeScale",    // image-style
00543     "fixScale",     // image-style
00544     "topLeft",      // image-alignemnt
00545     "topCenter",    // image-alignemnt
00546     "topRight",     // image-alignemnt
00547     "centerLeft",   // image-alignemnt
00548 //  "center",   // just defined // image-alignemnt
00549     "centerRight",  // image-alignemnt
00550     "bottomLeft",   // image-alignemnt
00551     "bottomCenter", // image-alignemnt
00552     "bottomRight",  // image-alignemnt
00553     "Alignment",
00554     "Anchor",
00555     "Sequence"
00556   };
00557 
00561   enum ValidityState
00562   {
00563     vs_tagEmptIncl = -10,   //empty tag inclusion
00564     vs_idNotUnique = -9,    //id already exhausted
00565     vs_idRefErr = -8,       //referenced id wasn't found or wrong type of referenced tag
00566     vs_unexpTag = -7,       //tag unexpected
00567     vs_unexpAtt = -6,       //attribute unexpected
00568     vs_expTagNotFound = -5, //expected tag not found
00569     vs_expAttNotFound = -4, //expected attribute not found
00570     vs_attValueErr = -3,    //attribute-value error
00571     vs_cardErr = -2,        //tag/attribute cardinality error
00572     vs_invalid = -1,        //tag/attribute is invalid (no detailled information)
00573     vs_valid = 1        //tag/attribute is valid
00574   };
00575 
00579   enum GraphType
00580   {
00581     graph,
00582     clusterGraph,
00583     compoundGraph,
00584     corruptCompoundGraph
00585   };
00586 
00587   const String graphTypeS[] = {
00588     "graph", 
00589     "clusterGraph", 
00590     "compoundGraph", 
00591     "corruptCompoundGraph"
00592   };
00593 
00594 };              //namspace ogdf
00595 
00596 #endif //OGDF_OGML_H