You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by Dmitrij Sakara <dm...@epfl.ch> on 2004/09/22 17:03:54 UTC

Defining of elements lying in rectangle

 Hello!
 
Is there is some way to obtain the list of SVG elements lying in some
rectangle (x1, y1, x2, y2 in screen coordinates) or I should study the
DOM tree and find them manually?
 
Thanks.
 
Dmitrij.
 
 

Re: Defining of elements lying in rectangle

Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi Jorg,

> Thomas DeWeese wrote:

>>    Well you should be able to call:
>>      svg.getIntersectionList(Rect, Element).
>>
>>    But that's currently not implemented.  If you do it with the
>> DOM don't forget to take transforms into account.  This is getting
>> high on my list of things to work on...

Jorg Heymans wrote:

> Indeed, this would be *extremely* handy for any GEO related application 
> where selecting "features" (ie svg elements) is considered standard 
> functionality. If this gets implemented, will it be possible to have 
> any selection shape (circle, ellipse, custom) ?

    As far as I can see the SVG DOM only supports using a Rect element.
However, I seem to recall an interface along these lines perhaps it
is in 1.2?

> What do you mean by "don't forget to take transforms into account" ?

    getBBox returns the bounding box in the local coordinate system,
so it needs to be transformed to what ever coordinate system you
defined your top level rectangle in.  Probably using 
getTransformToElement or getScreenCTM.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org


Re: Defining of elements lying in rectangle

Posted by Jorg Heymans <jh...@domek.be>.

Thomas DeWeese wrote:
> Hi,
> 
>    Well you should be able to call:
>      svg.getIntersectionList(Rect, Element).
> 
>    But that's currently not implemented.  If you do it with the
> DOM don't forget to take transforms into account.  This is getting
> high on my list of things to work on...
> 

Indeed, this would be *extremely* handy for any GEO related application 
where selecting "features" (ie svg elements) is considered standard 
functionality.
If this gets implemented, will it be possible to have any selection 
shape (circle, ellipse, custom) ?
What do you mean by "don't forget to take transforms into account" ?

Regards
Jorg


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org


Re: Defining of elements lying in rectangle

Posted by Thomas DeWeese <Th...@Kodak.com>.
Hi,

    Well you should be able to call:
	 svg.getIntersectionList(Rect, Element).

    But that's currently not implemented.  If you do it with the
DOM don't forget to take transforms into account.  This is getting
high on my list of things to work on...

Dmitrij wrote:
>>Is there is some way to obtain the list of SVG elements lying in some
>>rectangle (x1, y1, x2, y2 in screen coordinates) or I should study the
>>DOM tree and find them manually?

Tonny Kohar wrote:

> As far as I know there is none, I could be wrong.
> 
> However, you could traverse the dom and use boundingBox to check/compare
> with the rectangle.
> 
> Regards
> Tonny Kohar 


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org


Re: Defining of elements lying in rectangle

Posted by Tonny Kohar <to...@kiyut.com>.
Hi,

> Is there is some way to obtain the list of SVG elements lying in some
> rectangle (x1, y1, x2, y2 in screen coordinates) or I should study the
> DOM tree and find them manually?

As far as I know there is none, I could be wrong.

However, you could traverse the dom and use boundingBox to check/compare
with the rectangle.

Regards
Tonny Kohar 
-- 
Sketsa 
SVG Graphics Editor
http://www.kiyut.com



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xml.apache.org
For additional commands, e-mail: batik-dev-help@xml.apache.org