-
Notifications
You must be signed in to change notification settings - Fork 74
Improving ECC transition routing #2228
Hi @azoitl and 4diac-ide Community
As suggested to there is a problem in transition when drawn between two states it bends ,The currently applied spline has a strange trajectory at the start and end which need improvement and Also source and end location calculation will need some improvements.
I have been looking into the transition routing issue. I found two problems:
First in CreateTransitionCommand the sourceLocation and destLocation are set using toScreenPoint() which gives the top-left corner of the state instead of the center. I think this bendpoint is calculated from the wrong position. and the second is
in SplineConnection.getPath(), the control points for the cubic spline are calculated using startMid and midEnd vectors. When the destination state are drawn directly below these vectors cause a strange hook at the start of the transition.
For the location fix, I think the center can be obtained from ECStateEditPart using nameLabel.getBounds().getCenter(). But the viewer is only available in ECCEditorEditDomain, not in CreateTransitionCommand. Would it be correct to pass the viewer to CreateTransitionCommand to get the figure bounds?
For the spline fix, I am not sure about the best approach. Could you give some guidance?"
This is the finding which on which i start work when the existing PR's will get merged.
All reactions
Replies: 5 comments 55 replies
@vikash1703 there are two things that I want to point out in your investigation on this.
- the source and destination location are only used to get the start and end state of the transition. It think that we are using here positions is just wrong and the code should be changed that it is just using ECStaes for the start and end. This will make the commands reusable and more independent from ui code.
- For the real start and endpoints of the spline that is drawn GEF Classic uses
ConnectionAnchors. An EditPart that has target or source connection endpoints provides these via thegetTargetConnectionAnchor()andgetSourceConnectionAnchor()method of theEditPartfor the ECC Editor this is done in theECStateEditPart. More information on the connection routing behavior can be found in the Eclipse GEF Classic Wiki.
All reactions
Very thanks for this explaination now it get clear to me i will do as it is and update you.
All reactions
-
❤️ 1
After reading a second time your question I think I forgot one thing. In
SplineConnectionthere shouldn't be any point calculations anymore. There based on the given seven points (the 2 green and the 5 orange) thePathfor drawing should be created. I think with such a design the overall code will simplify a lot.What you can also do to get better feedback is that in
SplineConnectionyou draw in addition to the Path also the points. This can help you to find issues in the calculations of the points.
Hii today i tried as per your instruction i know what you want ,How spline and transition would like to draw i follow the approach i taken the refrence from the 3 wiki that you have provided what problem i face when i give the points it does not form the curved D line shape that you like and that must be formed when the user drag transition it somewhat form a sharp shape in one image you can see that the spline ki curved forming D line shape but when another transition drawn from the same state it refresh now i have understand that i need to calculate at what pixel my 7 points are to be placed sorry for this much disturbance,and big thanks for this much patience.
image
image
All reactions
@vikash1703 I expected that this will not be just straight forward. I like the screenshots with the dots. At lest for me they explain a lot. Also I think fixing the spline should be done after PR #2369. Because otherwise some control points will be hard to determine, or?
All reactions
@vikash1703 I expected that this will not be just straight forward. I like the screenshots with the dots. At lest for me they explain a lot. Also I think fixing the spline should be done after PR #2369. Because otherwise some control points will be hard to determine, or?
@azoitl
Ooh. Then I will do it by tomorrow and after that I will start doing spline part I also worried about that that's why I am not touch my pr that I have raised
All reactions
@vikash1703 I expected that this will not be just straight forward. I like the screenshots with the dots. At lest for me they explain a lot. Also I think fixing the spline should be done after PR #2369. Because otherwise some control points will be hard to determine, or?
Any suggestion for me !
All reactions
I have a hakathon and and interview at infosys on 21 april thats why i am busy in that i will continue after 21 april.
All reactions
-
👍 1
@vikash1703 only if you need one. I see you for now nicely on track. But if you want to meet I would be available 1pm my time.
All reactions
@vikash1703 only if you need one. I see you for now nicely on track. But if you want to meet I would be available 1pm my time.
lets connect at 1 pm your time
All reactions
-
👍 1
I have a exam tomorrow thats why i am not regular i will starting regular from 21
All reactions
All the best for your exam @vikash1703.
All reactions
Hii i will update you tomorrow i have did some works some are pending.
All reactions
-
👍 1
Now finally we have did the spline work almost done only strigth line i think still there what should i do next i will update my work today
All reactions
i have started exploring the self loop part which we have discussed in meeting