Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | Search
 Welcome Guest  |  Register  |  Login
Login Name  Password
 

Sweet Home 3D Forum



No member browsing this thread
Thread Status: Active
Total posts in this thread: 5
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 5531 times and has 4 replies Next Thread
trojanrob
Newbie



Poland
Joined: Apr 17, 2013
Post Count: 6
Status: Offline
Reply to this Post  Reply with Quote 
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
[May 15, 2013, 10:20:10 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9180
Status: Offline
Reply to this Post  Reply with Quote 
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 developer
[May 15, 2013, 1:01:19 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
trojanrob
Newbie



Poland
Joined: Apr 17, 2013
Post Count: 6
Status: Offline
Reply to this Post  Reply with Quote 
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.
[May 15, 2013, 8:41:40 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Puybaret
Expert
Member's Avatar

France
Joined: Nov 7, 2005
Post Count: 9180
Status: Offline
Reply to this Post  Reply with Quote 
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 developer
[May 15, 2013, 8:48:19 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
trojanrob
Newbie



Poland
Joined: Apr 17, 2013
Post Count: 6
Status: Offline
Reply to this Post  Reply with Quote 
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
[May 16, 2013, 1:23:28 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
[ Jump to Last Post ]
Show Printable Version of Thread  Post new Thread

    Get Sweet Home 3D at SourceForge.net. Fast, secure and Free Open Source software downloads
   
© Copyright 2006-2024 eTeks - All rights reserved