svghmi/gen_index_xhtml.xslt
branchsvghmi
changeset 2845 61548f7d1bef
parent 2844 eee5dcd9fc92
child 2846 7b1db17287b6
equal deleted inserted replaced
2844:eee5dcd9fc92 2845:61548f7d1bef
    73         <func:result select="3"/>
    73         <func:result select="3"/>
    74       </xsl:when>
    74       </xsl:when>
    75       <xsl:when test="$d0 and not($d1)">
    75       <xsl:when test="$d0 and not($d1)">
    76         <func:result select="2"/>
    76         <func:result select="2"/>
    77       </xsl:when>
    77       </xsl:when>
    78       <xsl:when test="$d0 = $d1 and $b0 &lt; $a1">
    78       <xsl:when test="$d0 and $d1 and $a0 &lt; $b1">
       
    79         <func:result select="1"/>
       
    80       </xsl:when>
       
    81       <xsl:when test="not($d0) and not($d1) and $b0 &lt; $a1">
    79         <func:result select="1"/>
    82         <func:result select="1"/>
    80       </xsl:when>
    83       </xsl:when>
    81       <xsl:otherwise>
    84       <xsl:otherwise>
    82         <func:result select="0"/>
    85         <func:result select="0"/>
    83       </xsl:otherwise>
    86       </xsl:otherwise>
    87     <xsl:param name="a"/>
    90     <xsl:param name="a"/>
    88     <xsl:param name="b"/>
    91     <xsl:param name="b"/>
    89     <xsl:variable name="x_intersect" select="func:intersect_1d($a/@x, $a/@x+$a/@w, $b/@x, $b/@x+$b/@w)"/>
    92     <xsl:variable name="x_intersect" select="func:intersect_1d($a/@x, $a/@x+$a/@w, $b/@x, $b/@x+$b/@w)"/>
    90     <xsl:choose>
    93     <xsl:choose>
    91       <xsl:when test="$x_intersect != 0">
    94       <xsl:when test="$x_intersect != 0">
    92         <xsl:variable name="y_intersect" select="func:intersect_1d($a/@y, $a/@y+$a/@w, $b/@y, $b/@y+$b/@w)"/>
    95         <xsl:variable name="y_intersect" select="func:intersect_1d($a/@y, $a/@y+$a/@h, $b/@y, $b/@y+$b/@h)"/>
    93         <func:result select="$x_intersect * $y_intersect"/>
    96         <func:result select="$x_intersect * $y_intersect"/>
    94       </xsl:when>
    97       </xsl:when>
    95       <xsl:otherwise>
    98       <xsl:otherwise>
    96         <func:result select="0"/>
    99         <func:result select="0"/>
    97       </xsl:otherwise>
   100       </xsl:otherwise>
    98     </xsl:choose>
   101     </xsl:choose>
    99   </func:function>
   102   </func:function>
   100   <func:function name="func:overlapping_geometry">
   103   <func:function name="func:overlapping_geometry">
   101     <xsl:param name="elt"/>
   104     <xsl:param name="elt"/>
   102     <xsl:variable name="g" select="$geometry[@Id = $elt/@id]"/>
   105     <xsl:variable name="g" select="$geometry[@Id = $elt/@id]"/>
   103     <func:result select="$geometry[@Id != $elt/@id and func:intersect(., $g) = 4]"/>
   106     <xsl:variable name="candidates" select="$geometry[@Id != $elt/@id]"/>
       
   107     <func:result select="$candidates[func:intersect($g, .) = 9]"/>
   104   </func:function>
   108   </func:function>
   105   <func:function name="func:sumarized_elements">
   109   <func:function name="func:sumarized_elements">
   106     <xsl:param name="elements"/>
   110     <xsl:param name="elements"/>
   107     <xsl:variable name="short_list" select="$elements[not(ancestor::*/@id = $elements/@id)]"/>
   111     <xsl:variable name="short_list" select="$elements[not(ancestor::*/@id = $elements/@id)]"/>
   108     <xsl:variable name="filled_groups" select="$short_list/parent::svg:*[not(descendant::*[not(self::svg:g)][not(@id = $short_list/descendant-or-self::*[not(self::svg:g)]/@id)])]"/>
   112     <xsl:variable name="filled_groups" select="$short_list/parent::svg:*[not(descendant::*[not(self::svg:g)][not(@id = $short_list/descendant-or-self::*[not(self::svg:g)]/@id)])]"/>