svghmi/geometry.ysl2
branchsvghmi
changeset 3165 2db69e2c5673
parent 2940 034b6ce4f885
child 3199 1582753e409b
equal deleted inserted replaced
3164:ea4a61b4a325 3165:2db69e2c5673
   129         }
   129         }
   130         otherwise result "0";
   130         otherwise result "0";
   131     }
   131     }
   132 }
   132 }
   133 
   133 
       
   134 const "groups", "/svg:svg | //svg:g";
       
   135 
   134 // return overlapping geometry for a given element
   136 // return overlapping geometry for a given element
   135 // all intersercting element are returned
   137 // all intersercting element are returned
   136 // except groups, that must be contained to be counted in
   138 // except groups, that must be contained to be counted in
   137 def "func:overlapping_geometry" {
   139 def "func:overlapping_geometry" {
   138     param "elt";
   140     param "elt";
   139     const "groups", "/svg:svg | //svg:g";
       
   140     const "g", "$geometry[@Id = $elt/@id]"; 
   141     const "g", "$geometry[@Id = $elt/@id]"; 
   141     const "candidates", "$geometry[@Id != $elt/@id]";
   142     const "candidates", "$geometry[@Id != $elt/@id]";
   142     result """$candidates[(@Id = $groups/@id and (func:intersect($g, .) = 9)) or 
   143     result """$candidates[(@Id = $groups/@id and (func:intersect($g, .) = 9)) or 
   143                           (not(@Id = $groups/@id) and (func:intersect($g, .) > 0 ))]""";
   144                           (not(@Id = $groups/@id) and (func:intersect($g, .) > 0 ))]""";
   144 }
   145 }