Hi,
is there any support for orthogonal lines in Roassal2? I've seen something similar (ROOrthoVerticalLineShape), however nothing of that sort in Roassal2. I would imagine it to behave similarly to RTBezierLine - having controllingElements to specify the corners. (While ROOrtholines did it automatically I was looking for something more manual, so it can go in both directions - thus the controllingElements).
Second thing I wasn't able to figure out is whether it is possible to create line from element to itself. All *AttachPoint classes aren't really able to cope with that. The best result I got was from Vertical/Horizontal AttachPoints (combined with BezierLine), however I would like to be able to specify which side it would start on and end on. Ideally not just middle of sides, but arbitrary part of the shape (I imagine that might be hard for non-rectangular shapes).
Thanks, Peter |
Hi Peter!
Even if trivial to add them, orthogonal lines are indeed missing in Roassal2. Having a way to indicate lines from an element to itself is also important. My first guess is that we need a class hierarchy to describe combination of control points. I can work on these point mid-next week. Else, you are very welcome to give a try. Cheers, Alexandre On Jul 26, 2014, at 3:57 PM, Peter Uhnák <[hidden email]> wrote: > Hi, > > is there any support for orthogonal lines in Roassal2? I've seen something similar (ROOrthoVerticalLineShape), however nothing of that sort in Roassal2. I would imagine it to behave similarly to RTBezierLine - having controllingElements to specify the corners. (While ROOrtholines did it automatically I was looking for something more manual, so it can go in both directions - thus the controllingElements). > > Second thing I wasn't able to figure out is whether it is possible to create line from element to itself. All *AttachPoint classes aren't really able to cope with that. The best result I got was from Vertical/Horizontal AttachPoints (combined with BezierLine), however I would like to be able to specify which side it would start on and end on. Ideally not just middle of sides, but arbitrary part of the shape (I imagine that might be hard for non-rectangular shapes). > > Thanks, > Peter -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. |
In reply to this post by Peter Uhnak
Hi Peter!
I’ve just added the orthogonal vertical and horizontal lines in Roassal2. Here are some screenshots. These last script has been made with: -=-=-=-=-=-=-=-=-=-=-=-= | v | v := RTView new. v addAll: ((RTEllipse new size: 20; color: (Color red alpha: 0.3)) elementsOn: (1 to: 20)). shape := RTMultiLine new. shape orthoVertical. shape color: (Color blue alpha: 0.3). RTEdge buildEdgesFromObjects: (1 to: 20) from: [ :n | n // 3 ] to: #yourself using: shape inView: v. v elements @ RTDraggable @ RTPopup. RTTreeLayout on: v elements. v open -=-=-=-=-=-=-=-=-=-=-=-= Cheers, Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. On Jul 26, 2014, at 3:57 PM, Peter Uhnák <[hidden email]> wrote:
|
Hi Alex!
I took a brief look at it and will play with it more tomorrow but it looks great! Especially the RTMultiLine>>block: message makes it is much more flexible for weird use cases (e.g. wanting to have control points while maintaining orthogonality etc).
Perhaps we don't even need to add extra option for control points per se and just let it be handled from outside? E.g. something like --------------------------------- v := RTView new.
e1 := (RTEllipse new size: 30) elementOn: 'A'. e2 := (RTEllipse new size: 30) elementOn: 'B'. ctrlShape := RTEllipse new size: 10; color: (Color purple alpha: 0.3).
ctrls := (ctrlShape elementsOn: (1 to: 2)). v add: e1; add: e2; addAll: ctrls.
v elements @ RTDraggable. e := RTEdge from: e1 to: e2. ctrls do: [ :el | el addConnectedEdge: e ]. shape := RTMultiLine new color: Color blue.
shape block: [ :fromPoint :toPoint | | points | points := ctrls collect: [ :el | el position ].
points addFirst: fromPoint; addLast: toPoint. points asArray. ]. e + shape. v add: e. RTCircleLayout on: v elements. v open.
------------------------- Thanks! Peter p.s. should I be CC-ing to moose-dev list? not sure what the proper mailing policy is On Wed, Jul 30, 2014 at 8:12 PM, Alexandre Bergel <[hidden email]> wrote:
|
If you wish to have some control points that may be manipulated with the mouse, then you need elements.
Just in case you have not seen it: -=-=-=-=-=-=-=-=-= | v shape edge els | v := RTView new. shape := RTEllipse new size: 10; color: (Color purple alpha: 0.3). els := (shape elementsOn: (1 to: 6)) @ RTDraggable. v addAll: els . RTHorizontalLineLayout on: v elements. v elements first translateBy: -50 @ 50. v elements third translateBy: -10 @ 20. v elements fifth translateBy: 0 @ -60. v elements last translateBy: 150 @ 100. edge := (RTBezierLine new controllingElements: v elements) edgeFrom: els first to: els last. v add: edge. v open. -=-=-=-=-=-=-=-=-= Alexandre On Jul 30, 2014, at 5:37 PM, Peter Uhnák <[hidden email]> wrote: > Hi Alex! > > I took a brief look at it and will play with it more tomorrow but it looks great! Especially the RTMultiLine>>block: message makes it is much more flexible for weird use cases (e.g. wanting to have control points while maintaining orthogonality etc). > Perhaps we don't even need to add extra option for control points per se and just let it be handled from outside? E.g. something like > --------------------------------- > v := RTView new. > > e1 := (RTEllipse new size: 30) elementOn: 'A'. > e2 := (RTEllipse new size: 30) elementOn: 'B'. > > ctrlShape := RTEllipse new size: 10; color: (Color purple alpha: 0.3). > ctrls := (ctrlShape elementsOn: (1 to: 2)). > > v > add: e1; > add: e2; > addAll: ctrls. > v elements @ RTDraggable. > > e := RTEdge from: e1 to: e2. > > ctrls do: [ :el | el addConnectedEdge: e ]. > > shape := RTMultiLine new color: Color blue. > shape block: [ :fromPoint :toPoint | > | points | > points := ctrls collect: [ :el | el position ]. > points > addFirst: fromPoint; > addLast: toPoint. > > points asArray. > ]. > > e + shape. > > v add: e. > > RTCircleLayout on: v elements. > v open. > ------------------------- > > Thanks! > > Peter > > p.s. should I be CC-ing to moose-dev list? not sure what the proper mailing policy is > > > On Wed, Jul 30, 2014 at 8:12 PM, Alexandre Bergel <[hidden email]> wrote: > Hi Peter! > > I’ve just added the orthogonal vertical and horizontal lines in Roassal2. Here are some screenshots. > > <Screen Shot 2014-07-30 at 2.04.23 PM.png> > <Screen Shot 2014-07-30 at 2.07.44 PM.png> > > These last script has been made with: > -=-=-=-=-=-=-=-=-=-=-=-= > | v | > v := RTView new. > > v addAll: ((RTEllipse new size: 20; color: (Color red alpha: 0.3)) elementsOn: (1 to: 20)). > > shape := RTMultiLine new. > shape orthoVertical. > shape color: (Color blue alpha: 0.3). > > RTEdge > buildEdgesFromObjects: (1 to: 20) from: [ :n | n // 3 ] to: #yourself using: shape inView: v. > > v elements @ RTDraggable @ RTPopup. > > RTTreeLayout on: v elements. > v open > -=-=-=-=-=-=-=-=-=-=-=-= > > Cheers, > Alexandre > -- > _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: > Alexandre Bergel http://www.bergel.eu > ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. > > > > On Jul 26, 2014, at 3:57 PM, Peter Uhnák <[hidden email]> wrote: > >> Hi, >> >> is there any support for orthogonal lines in Roassal2? I've seen something similar (ROOrthoVerticalLineShape), however nothing of that sort in Roassal2. I would imagine it to behave similarly to RTBezierLine - having controllingElements to specify the corners. (While ROOrtholines did it automatically I was looking for something more manual, so it can go in both directions - thus the controllingElements). >> >> Second thing I wasn't able to figure out is whether it is possible to create line from element to itself. All *AttachPoint classes aren't really able to cope with that. The best result I got was from Vertical/Horizontal AttachPoints (combined with BezierLine), however I would like to be able to specify which side it would start on and end on. Ideally not just middle of sides, but arbitrary part of the shape (I imagine that might be hard for non-rectangular shapes). >> >> Thanks, >> Peter > > -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. |
In reply to this post by Peter Uhnak
Forgot to answer this:
As you wish, there is no particular rule on this Alexandre On Jul 30, 2014, at 5:37 PM, Peter Uhnák <[hidden email]> wrote: > p.s. should I be CC-ing to moose-dev list? not sure what the proper mailing policy is > -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. |
In reply to this post by abergel
this is cool :)
On 30/7/14 20:12, Alexandre Bergel
wrote:
Hi Peter! |
I am familiar with RTBezierLine (I mentioned it in the original question), but what I was wondering about was whether controllingElements: should be added to RTMultiLine (so it will be handled internally just like in BezierLine), or leave it as is and let the user handle it from outside - as demonstrated by the example I posted.
On Thu, Jul 31, 2014 at 8:24 AM, stepharo <[hidden email]> wrote:
|
> I am familiar with RTBezierLine (I mentioned it in the original question), but what I was wondering about was whether controllingElements: should be added to RTMultiLine (so it will be handled internally just like in BezierLine), or leave it as is and let the user handle it from outside - as demonstrated by the example I posted.
Users of the API will decide :-) The way you are interacting with us is the right way. Keep asking questions and requesting for new features! Alexandre > > > On Thu, Jul 31, 2014 at 8:24 AM, stepharo <[hidden email]> wrote: > this is cool :) > > > On 30/7/14 20:12, Alexandre Bergel wrote: >> Hi Peter! >> >> I’ve just added the orthogonal vertical and horizontal lines in Roassal2. Here are some screenshots. >> >> <Mail Attachment.png> >> <Mail Attachment.png> >> >> These last script has been made with: >> -=-=-=-=-=-=-=-=-=-=-=-= >> | v | >> v := RTView new. >> >> v addAll: ((RTEllipse new size: 20; color: (Color red alpha: 0.3)) elementsOn: (1 to: 20)). >> >> shape := RTMultiLine new. >> shape orthoVertical. >> shape color: (Color blue alpha: 0.3). >> >> RTEdge >> buildEdgesFromObjects: (1 to: 20) from: [ :n | n // 3 ] to: #yourself using: shape inView: v. >> >> v elements @ RTDraggable @ RTPopup. >> >> RTTreeLayout on: v elements. >> v open >> -=-=-=-=-=-=-=-=-=-=-=-= >> >> Cheers, >> Alexandre >> -- >> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: >> Alexandre Bergel http://www.bergel.eu >> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. >> >> >> >> On Jul 26, 2014, at 3:57 PM, Peter Uhnák <[hidden email]> wrote: >> >>> Hi, >>> >>> is there any support for orthogonal lines in Roassal2? I've seen something similar (ROOrthoVerticalLineShape), however nothing of that sort in Roassal2. I would imagine it to behave similarly to RTBezierLine - having controllingElements to specify the corners. (While ROOrtholines did it automatically I was looking for something more manual, so it can go in both directions - thus the controllingElements). >>> >>> Second thing I wasn't able to figure out is whether it is possible to create line from element to itself. All *AttachPoint classes aren't really able to cope with that. The best result I got was from Vertical/Horizontal AttachPoints (combined with BezierLine), however I would like to be able to specify which side it would start on and end on. Ideally not just middle of sides, but arbitrary part of the shape (I imagine that might be hard for non-rectangular shapes). >>> >>> Thanks, >>> Peter >> > > -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. |
Hi Alex, is there a (simple) way to reset element's shape? When I add a new control point to RTMultiLine I need the trachelShape to be updated accordingly, however it is created only once and I don't see any way how to reset it apart from completely removing the element from canvas and recreating it.
I tried subclassing RTEdge (and altering RTElement>>addConnectedEdge: assert to isKindOf:) and setting trachelShape to nil, however that wasn't enough anyway since the shape is apparently also stored also elsewhere (TRCanvas I would assume).
So do I have to remove it and re-add it or am I missing something? Also, is there some document(atiton) explaining how all the things interact together (Roassal, Trachel, updates, redraws, ...) or is source code the only thing at the moment?
Thanks, Peter On Thu, Jul 31, 2014 at 3:22 PM, Alexandre Bergel <[hidden email]> wrote:
|
Good point. I will work on this today Alexandre
|
In reply to this post by Peter Uhnak
Again, sorry for the late answer.
How do you add a new control point? Using block? What is the code you are using? I just want to make sure your scenario will be covered by the tests. Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. On Aug 2, 2014, at 5:29 AM, Peter Uhnák <[hidden email]> wrote:
|
It's a bit longer since at the time I was trying to figure how to make it work at all, so it's not pretty: http://pastebin.com/5VmFC8cD In my adventure to reset the shape I subclassed RTEdge and added a method
------------- REEdge>>resetShape trachelShape := shape trachelShapeFor: self. ------------- Which wasn't enough since RTElement accepts RTEdge only, so I changed the assert to accept subclasses.
--------------- RTElement>>addConnectedEdge: anEdge [ anEdge isKindOf: RTEdge ] assert. self connectedEdges add: anEdge
-------------- I will refactor it to something like InteractiveMultiLine class however I'm not sure if the way it's currently done is even appropriate. It feels weird to change all these things from outside rather than from inside. But maybe that's just the effect of having it all flat in a workspace. Any comments and criticism is more than welcome.
Peter On Wed, Aug 13, 2014 at 2:46 AM, Alexandre Bergel <[hidden email]> wrote:
|
Hi Alex, I've refactored it a bit and created a RPControllable as a descendant of RTInteraction. You can see it in http://smalltalkhub.com/#!/~peteruhnak/RoassalPrototypes/
I also moved the >>resetShape method to Roassal's RTEdge as an extension package. But the way I reset the line remains quite daft. There's a simple usage example in RPControllable class side and a comment.
Also there may be problems with the fact that I am basically hiding both shapes of the controlling elements and RTMultiLine. This could be solved with accessors, but my question is more conceptual - should the interaction be even responsible for creating those shapes - especially RTMultiLine? But than again RTLabelled creates Label itself too.
Anyway... off to play with the grid now. P On Wed, Aug 13, 2014 at 10:00 AM, Peter Uhnák <[hidden email]> wrote:
|
Free forum by Nabble | Edit this page |