Print at Dec 19, 2025, 9:36:27 PM View all posts in this thread on one page
Posted by buzzz at Jun 29, 2017, 1:26:32 AM
real time surface
I try to create a plugin that prints the current surface of all rooms dynamically.

I start learning the compute surface plugin, ok

I succeed in adding a roomlistener and it works. Nevertheless, this callback is called only at the beginning of the creation of a new room.

Can I intercept any other updates like : point moved, drawing finished ?

At present, the last room has a surface of zero. This value is updated only with the correct value when a new room is created

Posted by bdfd at Jun 29, 2017, 7:44:37 AM
Re: real time surface
I try to create a plugin that prints the current surface of all rooms dynamically.
I start learning the compute surface plugin, ok
I succeed in adding a roomlistener and it works. Nevertheless, this callback is called only at the beginning of the creation of a new room.
Can I intercept any other updates like : point moved, drawing finished ?
At present, the last room has a surface of zero. This value is updated only with the correct value when a new room is created
Hi,

I'm very interested in your plugin.
Can you add as a test: adds the surface of the room if the button 'Display area' is checked stp ?

Please let us know.

I hope you distribute your plugin. applause
----------------------------------------
Evil progresses when good people do nothing!
---
SH3D 7.1 and nothing else - W11 64b in 4K

Posted by buzzz at Jun 29, 2017, 10:35:25 AM
Re: real time surface
oui je veux bien le distribuer mais mon soucis n'est pas là

j'ai du mal à savoir comment récuper les mises à jour de la zone de dessin. Apparement le listener de room n'est déclenché que lors du premier clic pour créer le polygone, après je n'ai plus rien

mon idée était de faire une fenêtre qui par affiche la surface totale mais surtout qui la mette dynamiquement a jour

je ne sais pas trop si cela correspond à la philosophie des plugins sweethome. De ce que je vois on les lance et => il effectue une action

ici, en fait, j'essaye de créer un peu l'équivalent de la fenêtre des fournitures qui listent dynamiquement les meubles de l'appartement

mon problème est que l'on peut modifier les sommets des rooms => modification de la surface totale

mais je ne sais pas par quel listener attraper cette modification

je ne suis pas contre un peu d'aide car l'API est vaste :)

désolé, j'ai craqué pour le francais :)

Posted by buzzz at Jun 29, 2017, 10:37:03 AM
Re: real time surface
peux etre veux tu que je le mette d'abord sur github ou qqc comme cela pour voir le code ?

Posted by buzzz at Jun 29, 2017, 1:19:38 PM
Re: real time surface
ok, c'est bon, j'ai trouvé

c'est le plugin 19

bon, il n'est pas aussi dynamique que ce que j'aurais aimé... si vous avez une idée

il me faudrait un evenement lorsque la géométrie d'une room est modifée... mais la...

Posted by Puybaret at Jun 29, 2017, 7:32:07 PM
Re: real time surface
Adding a CollectionListener<Room> to home will inform you only on new and deleted rooms, as you noticed. If you want to listen to changes to the room points, you'll have to add a PropertyChangeListener on each room (and remove it when the room is deleted), and update your text area when the property name in the event is equal to Room.Property.POINTS.name().

[Please continue this thread in English because you started in English]
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator

Posted by buzzz at Jun 30, 2017, 12:13:55 AM
Re: real time surface
ok I succeed

Everything has been sent in the new version of demo plugin 19

I'm not a pure Java Dev, so, code may not be perfect, but the example is there for sweethome users