# HG changeset patch # User Edouard Tisserant # Date 1584379669 -3600 # Node ID 83adf8859c55d7c000e3ba4c0c3ffbec3748ed02 # Parent ed9b16b336287c4573ba3eef7be86a36898736d8 SVGHMI: created bbox_intersect.ysl2 diff -r ed9b16b33628 -r 83adf8859c55 svghmi/Makefile --- a/svghmi/Makefile Mon Mar 16 17:09:23 2020 +0100 +++ b/svghmi/Makefile Mon Mar 16 18:27:49 2020 +0100 @@ -11,7 +11,7 @@ yml2path ?= $(abspath ../../yml2) -ysl2files := $(wildcard *.ysl2) +ysl2files := gen_index_xhtml.ysl2 xsltfiles := $(patsubst %.ysl2, %.xslt, $(ysl2files)) all:$(xsltfiles) diff -r ed9b16b33628 -r 83adf8859c55 svghmi/bbox_intersect.ysl2 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/svghmi/bbox_intersect.ysl2 Mon Mar 16 18:27:49 2020 +0100 @@ -0,0 +1,120 @@ +// bbox_intersect.ysl2 +// +// bounding boxes intersection tests + +// Rates 1D intersection of 2 segments A and B +// described respectively with a0,a1 and b0,b1 +def "func:intersect_1d" { + // it is assumed that a1 > a0 and b1 > b0 + param "a0"; + param "a1"; + param "b0"; + param "b1"; + + const "d0", "$a0 >= $b0"; + const "d1", "$a1 >= $b1"; + choose { + when "not($d0) and $d1" + // b contained in a + // a0 } - /* TODO deal with multiple paths - - and dispatch according to index+page_offset */ - - /*else if(typeof(d) == "object" && d.length >= idxidx){ + else if(typeof(d) == "object" && d.length >= idxidx){ d[idxidx].call(widget, value, oldval); - }*/ + } /* else dispatch_0, ..., dispatch_n ? */ diff -r ed9b16b33628 -r 83adf8859c55 svghmi/gen_index_xhtml.ysl2 --- a/svghmi/gen_index_xhtml.ysl2 Mon Mar 16 17:09:23 2020 +0100 +++ b/svghmi/gen_index_xhtml.ysl2 Mon Mar 16 18:27:49 2020 +0100 @@ -85,114 +85,7 @@ } } - def "func:intersect_1d" { - // it is assumed that a1 > a0 and b1 > b0 - param "a0"; - param "a1"; - param "b0"; - param "b1"; - - const "d0", "$a0 >= $b0"; - const "d1", "$a1 >= $b1"; - choose { - when "not($d0) and $d1" - // b contained in a - // a0