gen.lib.dotgen.class1__c Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plantuml-lgpl Show documentation
Show all versions of plantuml-lgpl Show documentation
PlantUML is a component that allows to quickly write diagrams from text.
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
/* +=======================================================================
* |
* | PlantUML : a free UML diagram generator
* |
* +=======================================================================
*
* (C) Copyright 2009-2024, Arnaud Roques
*
* Project Info: https://plantuml.com
*
* If you like this project or if you find it useful, you can support us at:
*
* https://plantuml.com/patreon (only 1$ per month!)
* https://plantuml.com/liberapay (only 1€ per month!)
* https://plantuml.com/paypal
*
*
* PlantUML is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* PlantUML distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
* License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see .
*
* PlantUML can occasionally display sponsored or advertising messages. Those
* messages are usually generated on welcome or error images and never on
* functional diagrams.
* See https://plantuml.com/professional if you want to remove them
*
* Images (whatever their format : PNG, SVG, EPS...) generated by running PlantUML
* are owned by the author of their corresponding sources code (that is, their
* textual description in PlantUML language). Those images are not covered by
* this LGPL license.
*
* The generated images can then be used without any reference to the LGPL license.
* It is not even necessary to stipulate that they have been generated with PlantUML,
* although this will be appreciated by the PlantUML team.
*
* There is an exception : if the textual description in PlantUML language is also covered
* by any license, then the generated images are logically covered
* by the very same license.
*
* This is the IGY distribution (Install GraphViz by Yourself).
* You have to install GraphViz and to setup the GRAPHVIZ_DOT environment variable
* (see https://plantuml.com/graphviz-dot )
*
* Icons provided by OpenIconic : https://useiconic.com/open
* Archimate sprites provided by Archi : http://www.archimatetool.com
* Stdlib AWS provided by https://github.com/milo-minderbinder/AWS-PlantUML
* Stdlib Icons provided https://github.com/tupadr3/plantuml-icon-font-sprites
* ASCIIMathML (c) Peter Jipsen http://www.chapman.edu/~jipsen
* ASCIIMathML (c) David Lippman http://www.pierce.ctc.edu/dlippman
* CafeUndZopfli ported by Eugene Klyuchnikov https://github.com/eustas/CafeUndZopfli
* Brotli (c) by the Brotli Authors https://github.com/google/brotli
* Themes (c) by Brett Schwarz https://github.com/bschwarz/puml-themes
* Twemoji (c) by Twitter at https://twemoji.twitter.com/
*
*/
package gen.lib.dotgen;
import static gen.lib.cgraph.attr__c.agxget;
import static gen.lib.cgraph.edge__c.agfstout;
import static gen.lib.cgraph.edge__c.aghead;
import static gen.lib.cgraph.edge__c.agnxtout;
import static gen.lib.cgraph.edge__c.agtail;
import static gen.lib.cgraph.node__c.agfstnode;
import static gen.lib.cgraph.node__c.agnxtnode;
import static gen.lib.common.utils__c.UF_find;
import static gen.lib.common.utils__c.mapbool;
import static gen.lib.dotgen.cluster__c.mark_clusters;
import static gen.lib.dotgen.fastgr__c.find_fast_edge;
import static gen.lib.dotgen.fastgr__c.merge_oneway;
import static gen.lib.dotgen.fastgr__c.virtual_edge;
import static gen.lib.dotgen.fastgr__c.virtual_node;
import static gen.lib.dotgen.position__c.make_aux_edge;
import static smetana.core.Macro.ED_minlen;
import static smetana.core.Macro.ED_to_orig;
import static smetana.core.Macro.ED_to_virt;
import static smetana.core.Macro.ED_weight;
import static smetana.core.Macro.GD_leader;
import static smetana.core.Macro.ND_clust;
import static smetana.core.Macro.ND_node_type;
import static smetana.core.Macro.ND_rank;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;
import gen.annotation.Original;
import gen.annotation.Reviewed;
import gen.annotation.Unused;
import h.ST_Agedge_s;
import h.ST_Agnode_s;
import h.ST_Agraph_s;
import smetana.core.CString;
import smetana.core.Globals;
public class class1__c {
// ::remove folder when __HAXE__
@Reviewed(when = "13/11/2020")
@Original(version="2.38.0", path="lib/dotgen/class1.c", name="nonconstraint_edge", key="2luyof8ca7ewf9r08z3os3lk7", definition="int nonconstraint_edge(edge_t * e)")
public static boolean nonconstraint_edge(Globals zz, ST_Agedge_s e) {
ENTERING("2luyof8ca7ewf9r08z3os3lk7","nonconstraint_edge");
try {
CString constr;
if (zz.E_constr!=null && (constr = agxget(e, zz.E_constr))!=null) {
if (constr.charAt(0)!='\0' && mapbool(constr) == false)
return true;
}
return false;
} finally {
LEAVING("2luyof8ca7ewf9r08z3os3lk7","nonconstraint_edge");
}
}
//3 dpimuv55sylui7jx8fh3ic1qc
// static void interclust1(graph_t * g, node_t * t, node_t * h, edge_t * e)
@Unused
@Original(version="2.38.0", path="lib/dotgen/class1.c", name="interclust1", key="dpimuv55sylui7jx8fh3ic1qc", definition="static void interclust1(graph_t * g, node_t * t, node_t * h, edge_t * e)")
public static void interclust1(ST_Agraph_s g, ST_Agnode_s t, ST_Agnode_s h, ST_Agedge_s e) {
ENTERING("dpimuv55sylui7jx8fh3ic1qc","interclust1");
try {
ST_Agnode_s v, t0, h0;
int offset, t_len, h_len, t_rank, h_rank;
ST_Agedge_s rt, rh;
if (ND_clust(agtail(e))!=null)
t_rank = ND_rank(agtail(e)) - ND_rank(GD_leader(ND_clust(agtail(e))));
else
t_rank = 0;
if (ND_clust(aghead(e))!=null)
h_rank = ND_rank(aghead(e)) - ND_rank(GD_leader(ND_clust(aghead(e))));
else
h_rank = 0;
offset = ED_minlen(e) + t_rank - h_rank;
if (offset > 0) {
t_len = 0;
h_len = offset;
} else {
t_len = -offset;
h_len = 0;
}
v = virtual_node(g);
ND_node_type(v, 2);
t0 = UF_find(t);
h0 = UF_find(h);
rt = make_aux_edge(v, t0, t_len, 10 * ED_weight(e));
rh = make_aux_edge(v, h0, h_len, ED_weight(e));
ED_to_orig(rt, e);
ED_to_orig(rh, e);
} finally {
LEAVING("dpimuv55sylui7jx8fh3ic1qc","interclust1");
}
}
@Reviewed(when = "13/11/2020")
@Original(version="2.38.0", path="lib/dotgen/class1.c", name="class1", key="acy5ct6402jgf0ga5oeeskx5m", definition="void class1(graph_t * g)")
public static void class1_(Globals zz, ST_Agraph_s g) {
ENTERING("acy5ct6402jgf0ga5oeeskx5m","class1_");
try {
ST_Agnode_s n, t, h;
ST_Agedge_s e, rep;
mark_clusters(zz, g);
for (n = agfstnode(zz, g); n!=null; n = agnxtnode(zz, g, n)) {
for (e = agfstout(zz, g, n); e!=null; e = agnxtout(zz, g, e)) {
/* skip edges already processed */
if (ED_to_virt(e)!=null)
continue;
/* skip edges that we want to ignore in this phase */
if (nonconstraint_edge(zz, e))
continue;
t = UF_find(agtail(e));
h = UF_find(aghead(e));
/* skip self, flat, and intra-cluster edges */
if (t == h)
continue;
/* inter-cluster edges require special treatment */
if (ND_clust(t)!=null || ND_clust(h)!=null) {
interclust1(g, agtail(e), aghead(e), e);
continue;
}
if ((rep = find_fast_edge(t, h))!=null)
merge_oneway(e, rep);
else
virtual_edge(t, h, e);
}
}
} finally {
LEAVING("acy5ct6402jgf0ga5oeeskx5m","class1_");
}
}
}