Bulgaria
Joined: Oct 15, 2009
Post Count: 7
Status:
Offline
Multi-connected walls
Hello, my company wants to create an application for sketching and measuring off light-weight panels used for division of big rooms to smaller ones. It seems that we need a multi-connected walls. I mean one joint must connect more than 2 walls. I've started subclassing all the needed classes. Up to now , I've made extensions in these files:
France
Joined: Nov 7, 2005
Post Count: 9426
Status:
Offline
Re: Multi-connected walls
I think you're on the good way.
The hardest problems to solve are: - the management of undo/redo but adapting PlanController.JoinedWall class shouldn't be so difficult, - how should walls corner points should be computed in Wall#getPoints method when their start or end point is connected to more than one wall (by the way, you'll see that most getPoints invokers expect 4 points so I wouldn't change that if you don't want to program too much things).
Please keep us informed about your program.
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
Bulgaria
Joined: Oct 15, 2009
Post Count: 7
Status:
Offline
Re: Multi-connected walls
Hi!
I'll keep you in touch. I'm still in the phase of rough modifications/additions. When I start to implement something real, I'll surely need your support. There's a small note about PlanController. Look at doReverseWallsDirection(). I suppose the lines
if (joinedAtEndOfWallAtStart) { wallAtStart.setWallAtEnd(wall); } else if (joinedAtStartOfWallAtStart) { wallAtStart.setWallAtStart(wall); }
if (joinedAtEndOfWallAtEnd) { wallAtEnd.setWallAtEnd(wall); } else if (joinedAtStartOfWallAtEnd) { wallAtEnd.setWallAtStart(wall); }
are not actually needed. The references from the neighbors' ends to the reversed wall are not modified during the reverse operation. I think you don't need to update them. You have connections "end->wall", not "end->end", that's why you probably missled yourself.
reset the reference to reversed wall stored by neighbor walls, that's why the other lines are necessary.
By the way, I see from your profile that you come from Bulgaria. Did you try the Bulgarian version available in CVS and in the current Beta version?
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
Bulgaria
Joined: Oct 15, 2009
Post Count: 7
Status:
Offline
Re: Multi-connected walls
Hi again!!
I've tried the Bulgarian translation. Looks very clear and correct! Now, about the multi-connected walls: First I've tried to put references to neighboring walls to each of the wall ends. But after a certain amount of time, the things got very complicated and messed up. So I've made a bold decision to add another intermediate object. This object is called Joint and serves as shared attach point for neighboring walls. All walls are connecting to joints not to each other and they don't directly know about each other. Some things like JoinedWall class became pretty more simple. I had little troubles except that I've redefined a lot of classes just about the limitation of the privates. Almost all of the changes that I've made to your code were "deprivatisations" and changing to protected. if everything was protected not private it would be perfect! I would like to post the most important classes for you to take a look. How and where could I do this? The other problem that I've faced today was the difficulty to achieve some direct interaction between to controllers or their views, because they don't have access to each other, only to the model. I have my own component called Detail View that shows some detailed info about the currently selected wall. I am trying to capture the moving of a door or window over a wall to update the info in Detail view. I have success when moving an existing door. But don't have success with a door dragged from the catalog, cause it's not yet added to the home model. I'm searching for a workarround for this.
Congratulations for the excellent software! It is a pleasure to work with it! Regards!