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: 5
[ Jump to Last Post ]
Post new Thread
Author
Previous Thread This topic has been viewed 4072 times and has 4 replies Next Thread
Sv.Kostadinov
Newbie



Bulgaria
Joined: Oct 15, 2009
Post Count: 7
Status: Offline
Reply to this Post  Reply with Quote 
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:

HomeEx.java
PlanComponentEx.java
PlanControllerEx.java
SwingViewFactoryEx.java
WallEx.java
WallExController.java
WallExPanel.java

Mr.Puybaret, what do you think about this initiative? Could it be possible to fulfill it? Which could be the hardest problems to solve?

Regards!
(Excuse me about my bad english)
[Oct 23, 2009, 11:23:59 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: 9426
Status: Offline
Reply to this Post  Reply with Quote 
Re: Multi-connected walls

I think you're on the good way. smile

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
[Oct 26, 2009, 9:20:05 AM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Sv.Kostadinov
Newbie



Bulgaria
Joined: Oct 15, 2009
Post Count: 7
Status: Offline
Reply to this Post  Reply with Quote 
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

Wall wallAtStart = wall.getWallAtStart();
boolean joinedAtEndOfWallAtStart =
wallAtStart != null
&& wallAtStart.getWallAtEnd() == wall;
boolean joinedAtStartOfWallAtStart =
wallAtStart != null
&& wallAtStart.getWallAtStart() == wall;
Wall wallAtEnd = wall.getWallAtEnd();
boolean joinedAtEndOfWallAtEnd =
wallAtEnd != null
&& wallAtEnd.getWallAtEnd() == wall;
boolean joinedAtStartOfWallAtEnd =
wallAtEnd != null
&& wallAtEnd.getWallAtStart() == wall;

wall.setWallAtStart(wallAtEnd);
wall.setWallAtEnd(wallAtStart);

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.
[Oct 27, 2009, 4:47:50 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: 9426
Status: Offline
Reply to this Post  Reply with Quote 
Re: Multi-connected walls

Neighbors' ends to the reversed wall are not modified but the two lines
wall.setWallAtStart(wallAtEnd);
wall.setWallAtEnd(wallAtStart);

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. wink
Did you try the Bulgarian version available in CVS and in the current Beta version?
----------------------------------------
Emmanuel Puybaret, Sweet Home 3D creator
[Oct 27, 2009, 5:57:14 PM] Show Printable Version of Post    View Member Profile    Send Private Message [Link] Report threatening or abusive post: please login first  Go to top 
Sv.Kostadinov
Newbie



Bulgaria
Joined: Oct 15, 2009
Post Count: 7
Status: Offline
Reply to this Post  Reply with Quote 
smile Re: Multi-connected walls

Hi again!! smile

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! applause It is a pleasure to work with it! wink
Regards!
[Dec 12, 2009, 8:12:43 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 2024 Space Mushrooms - All rights reserved