Joined: May 28, 2013
Post Count: 2
Status:
Offline
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?
France
Joined: Nov 7, 2005
Post Count: 9426
Status:
Offline
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 creator
Joined: May 28, 2013
Post Count: 2
Status:
Offline
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...