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: 3
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 5072 times and has 2 replies Next Thread
cnshibo
Newbie




Joined: May 28, 2013
Post Count: 2
Status: Offline
Reply to this Post  Reply with Quote 
How to add more properties to a wall?

My application needs to calculate the energy cost of a home, so I need to add more properties to every wall, window and door, such as material param, structure param and so on. I am new to sweet home 3D, can you give some suggestion, if I can implement this task? Can I implement it in plugin or need to change base code?

Thanks in advance.
[May 28, 2013, 3:50:03 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: 9178
Status: Offline
Reply to this Post  Reply with Quote 
Re: How to add more properties to a wall?

In the current version 4.0, the only method which let you add some private data in a home from a plug-in is setVisualProperty method in Home class. Normally, it's used to store some visual values, like the location and size of the main window, but you can store there whatever you want as long it uses some serializable classes of Java API or Sweet Home 3D API (not classes of your plug-in otherwise I don't think you would be able to open the file again).

If you don't choose the plug-in path, you could create a subclass of Wall that you'll instantiate in a createWall method overridden in a subclass of PlanController (PlanController instance is instantiated itself in HomeController#getPlanController that you can override too, etc... up to a subclass of SweetHome3D). This way of doing would avoid you to change existing source code, and will greatly simplify the maintenance of the future versions of your program.

In which context do you have to program this project?
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D developer
[May 29, 2013, 10:00:49 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
cnshibo
Newbie




Joined: May 28, 2013
Post Count: 2
Status: Offline
Reply to this Post  Reply with Quote 
Re: How to add more properties to a wall?

Thank you very much for replying.
we need a software to calculate the leak of heat of a house. But different house may have different material of wall, window, door, floor...
[May 29, 2013, 7:06:32 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