Print at Dec 20, 2025, 10:27:39 AM View all posts in this thread on one page
Posted by trojanrob at May 15, 2013, 10:20:10 AM
It is possible modify export to SVG format ?
Hello,

I want to add <rect class="btn" ... /> in SVG file after each <image ... />

This change is needed to image was clickable.

Any solutions , please.

Robert

Posted by Puybaret at May 15, 2013, 1:01:19 PM
Re: It is possible modify export to SVG format ?
If you want to change SVG export, you should change the implementation of exportToSVG method in the PlanComponent class. In your case, maybe you could simply modify the end of paintFurniture method, to draw your rectangle when the paintMode is equal to PaintMode.EXPORT (you'll see there are already some similar tests for PAINT mode).
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by trojanrob at May 15, 2013, 8:41:40 PM
Re: It is possible modify export to SVG format ?
I think I described it wrong. sad

See my example
(transparent rectangle added manually) When click on image appears message box

<svg
...
...
>
...
<g ... >
<g ... >
<g ... >
<image x="0" y="0" width="256" height="256"... />
<rect class="btn" x="0" y="0" width="256" height="256" stroke="#fff" fill="#fff" fill-opacity="0" stroke-opacity="0" onclick="action" />
</g> <!-- transform -->
</g> <!-- transform -->
</g> <!-- default stroke -->
</svg> <!-- bounding box -->

This rectangle is transparent and clickable.

I don't want draw separate rectangle.

Posted by Puybaret at May 15, 2013, 8:48:19 PM
Re: It is possible modify export to SVG format ?
Look at exportToSVG code, you'll see that SVGGraphics2D class coming from FreeHep library is used to generate SVG code. No idea what you can override there.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by trojanrob at May 16, 2013, 1:23:28 PM
Re: It is possible modify export to SVG format ?
Problem solved. smile

Added "freehep-graphicsio-svg-2.2.1-sources" to SH3D source and modifiy class "SVGGraphics2D"

Thanks for the tip.
Robert