Features

Download

Online

Gallery

Blog

  Index  | Recent Threads  | List Attachments  | Help  | 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: 7
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 1980 times and has 6 replies Next Thread
buzzz
Newbie



FR
Joined: Jun 25, 2017
Post Count: 6
Status: Offline
Reply to this Post  Reply with Quote 
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
[Jun 28, 2017 11:26: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 
bdfd
Advanced Member
Member's Avatar

FRANCE
Joined: Mar 29, 2014
Post Count: 1472
Status: Offline
Reply to this Post  Reply with Quote 
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
----------------------------------------
with W10 64b 1709 (16.299.125) / Core i7-4790 - RAM 16 MB / GeForce GTX770 2 Go Full HD
sh3d 5.6 with java 1.8.0_144 & java3D 1.6.0
[Jun 29, 2017 5:44:37 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
buzzz
Newbie



FR
Joined: Jun 25, 2017
Post Count: 6
Status: Offline
Reply to this Post  Reply with Quote 
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 :)
[Jun 29, 2017 8:35:25 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
buzzz
Newbie



FR
Joined: Jun 25, 2017
Post Count: 6
Status: Offline
Reply to this Post  Reply with Quote 
Re: real time surface

peux etre veux tu que je le mette d'abord sur github ou qqc comme cela pour voir le code ?
[Jun 29, 2017 8:37:03 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
buzzz
Newbie



FR
Joined: Jun 25, 2017
Post Count: 6
Status: Offline
Reply to this Post  Reply with Quote 
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...
[Jun 29, 2017 11:19:38 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: 5837
Status: Offline
Reply to this Post  Reply with Quote 
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 developer
[Jun 29, 2017 5:32:07 PM] Show Printable Version of Post    View Member Profile    Send Private Message    Hidden to Guest    http://www.eteks.com [Link] Report threatening or abusive post: please login first  Go to top 
buzzz
Newbie



FR
Joined: Jun 25, 2017
Post Count: 6
Status: Offline
Reply to this Post  Reply with Quote 
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
[Jun 29, 2017 10:13:55 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-2017 eTeks - All rights reserved