All Downloads are FREE. Search and download functionalities are using the official Maven repository.

gen.lib.label.node__c Maven / Gradle / Ivy

The newest version!
// 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 Apache Software License.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * 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 APACHE license.
 *
 * The generated images can then be used without any reference to the APACHE 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.label;
import static gen.lib.label.rectangle__c.CombineRect;
import static gen.lib.label.rectangle__c.InitRect;
import static gen.lib.label.rectangle__c.RectArea;
import static gen.lib.label.split_q__c.SplitNode;
import static smetana.core.Macro.UNSUPPORTED;
import static smetana.core.debug.SmetanaDebug.ENTERING;
import static smetana.core.debug.SmetanaDebug.LEAVING;

import gen.annotation.Original;
import gen.annotation.Unused;
import h.ST_Branch_t;
import h.ST_Node_t___;
import h.ST_RTree;
import h.ST_Rect_t;

public class node__c {


//3 9uj7ni1m6q6drtoh56w82d6m4
// Node_t *RTreeNewNode(RTree_t * rtp) 
@Unused
@Original(version="2.38.0", path="lib/label/node.c", name="", key="9uj7ni1m6q6drtoh56w82d6m4", definition="Node_t *RTreeNewNode(RTree_t * rtp)")
public static ST_Node_t___ RTreeNewNode(ST_RTree rtp) {
ENTERING("9uj7ni1m6q6drtoh56w82d6m4","RTreeNewNode");
try {
	ST_Node_t___ n;
	rtp.NodeCount = rtp.NodeCount + 1;
	n = new ST_Node_t___();
     InitNode(n);
     return n;
} finally {
LEAVING("9uj7ni1m6q6drtoh56w82d6m4","RTreeNewNode");
}
}





//3 4qk9wkm05q2pwf20ud6g2tufg
// void InitNode(Node_t * n) 
@Unused
@Original(version="2.38.0", path="lib/label/node.c", name="InitNode", key="4qk9wkm05q2pwf20ud6g2tufg", definition="void InitNode(Node_t * n)")
public static void InitNode(ST_Node_t___ n) {
ENTERING("4qk9wkm05q2pwf20ud6g2tufg","InitNode");
try {
     int i;
     n.count = 0;
     n.level = -1;
     for (i = 0; i < 64; i++)
    	 InitBranch(n.branch[i]);
     // InitBranch(&(n->branch[i]));
} finally {
LEAVING("4qk9wkm05q2pwf20ud6g2tufg","InitNode");
}
}




//3 ruhxixxei7au9z1iaj0zggwo
// void InitBranch(Branch_t * b) 
@Unused
@Original(version="2.38.0", path="lib/label/node.c", name="InitBranch", key="ruhxixxei7au9z1iaj0zggwo", definition="void InitBranch(Branch_t * b)")
public static void InitBranch(ST_Branch_t b) {
ENTERING("ruhxixxei7au9z1iaj0zggwo","InitBranch");
try {
	InitRect(b.rect);
	b.child = null;
} finally {
LEAVING("ruhxixxei7au9z1iaj0zggwo","InitBranch");
}
}




//3 42vjqe8n5yeq2jjby00xzrotk
// Rect_t NodeCover(Node_t * n) 
@Unused
@Original(version="2.38.0", path="lib/label/node.c", name="NodeCover", key="42vjqe8n5yeq2jjby00xzrotk", definition="Rect_t NodeCover(Node_t * n)")
public static ST_Rect_t NodeCover(ST_Node_t___ n) {
ENTERING("42vjqe8n5yeq2jjby00xzrotk","NodeCover");
try {
     int i, flag;
     final ST_Rect_t r = new ST_Rect_t();
     //     assert(n);
     InitRect(r);
     flag = 1;
     for (i = 0; i < 64; i++)
 	if (n.branch[i].child!=null) {
 	    if (flag!=0) {
 		r.___(n.branch[i].rect);
 		flag = 0;
 	    } else
 		r.___(CombineRect(r, (ST_Rect_t) n.branch[i].rect));
 	}
     return r;
} finally {
LEAVING("42vjqe8n5yeq2jjby00xzrotk","NodeCover");
}
}




//3 bek56v2skz6jfvw4uggy2h5w3
// int PickBranch(Rect_t * r, Node_t * n) 
@Unused
@Original(version="2.38.0", path="lib/label/node.c", name="PickBranch", key="bek56v2skz6jfvw4uggy2h5w3", definition="int PickBranch(Rect_t * r, Node_t * n)")
public static int PickBranch(ST_Rect_t r, ST_Node_t___ n) {
	ENTERING("bek56v2skz6jfvw4uggy2h5w3","PickBranch");
	try {
     ST_Rect_t rr=null;
     int i=0, flag=1, increase=0, bestIncr=0, area=0, bestArea=0;
     int best=0;
//     assert(r && n);
     for (i = 0; i < 64; i++) {
 	if (n.branch[i].child!=null) {
 	    final ST_Rect_t rect = new ST_Rect_t();
 	    rr = (ST_Rect_t) n.branch[i].rect;
 	    area = RectArea((ST_Rect_t) rr);
 	    /* increase = RectArea(&CombineRect(r, rr)) - area; */
 	    rect.___(CombineRect((ST_Rect_t) r, rr));
 	    increase = RectArea((ST_Rect_t) rect) - area;
 	    if (increase < bestIncr || flag!=0) {
 		best = i;
 		bestArea = area;
 		bestIncr = increase;
 		flag = 0;
 	    } else if (increase == bestIncr && area < bestArea) {
 		best = i;
 		bestArea = area;
 		bestIncr = increase;
 	    }
 	}
     }
     return best;
} finally {
LEAVING("bek56v2skz6jfvw4uggy2h5w3","PickBranch");
}
}




//3 2njctcrpeff95ysmv9ji34x4s
// int AddBranch(RTree_t * rtp, Branch_t * b, Node_t * n, Node_t ** new) 
@Unused
@Original(version="2.38.0", path="lib/label/node.c", name="AddBranch", key="2njctcrpeff95ysmv9ji34x4s", definition="int AddBranch(RTree_t * rtp, Branch_t * b, Node_t * n, Node_t ** new)")
public static int AddBranch(ST_RTree rtp, ST_Branch_t b, ST_Node_t___ n, ST_Node_t___ new_[]) {
ENTERING("2njctcrpeff95ysmv9ji34x4s","AddBranch");
try {
     int i;
//     assert(b);
//     assert(n);
     if (n.count < 64) {	/* split won't be necessary */
 	for (i = 0; i < 64; i++) {	/* find empty branch */
 	    if (n.branch[i].child == null) {
 		n.branch[i].___(b);
 		n.count = n.count+1;
 		break;
 	    }
}
// 	assert(i < 64);
 	return 0;
     } else {
 	if (rtp.StatFlag!=0) {
UNSUPPORTED("2y8kv6b3ysrr61q7tqn76rhhc"); // 	    if (rtp->Deleting)
UNSUPPORTED("dn4oynmx9ugizzs5pkxiyptbi"); // 		rtp->DeTouchCount++;
UNSUPPORTED("5c97f6vfxny0zz35l2bu4maox"); // 	    else
UNSUPPORTED("2u8wpa4w1q7rg14t07bny6p8i"); // 		rtp->InTouchCount++;
 	}
// 	assert(new);
 	SplitNode(rtp, n, b, new_);
 	if (n.level == 0)
 		rtp.LeafCount = rtp.LeafCount+1;
 	else
UNSUPPORTED("6tkfiebspy7ecivrzb3l5y7jd"); // 	    rtp->NonLeafCount++;
 	return 1;
     }
} finally {
LEAVING("2njctcrpeff95ysmv9ji34x4s","AddBranch");
}
}




//3 eqzamflj58f43cflwns9cemnk
// void DisconBranch(Node_t * n, int i) 
@Unused
@Original(version="2.38.0", path="lib/label/node.c", name="DisconBranch", key="eqzamflj58f43cflwns9cemnk", definition="void DisconBranch(Node_t * n, int i)")
public static void DisconBranch(ST_Node_t___ n, int i) {
ENTERING("eqzamflj58f43cflwns9cemnk","DisconBranch");
try {
//     assert(n && i >= 0 && i < 64);
//     assert(n->branch[i].child);
     InitBranch(n.branch[i]);
     n.count = n.count-1;
} finally {
LEAVING("eqzamflj58f43cflwns9cemnk","DisconBranch");
}
}


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy