Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
2019 posts
|
Hi
I'm trying to draw an ellipse inside another ellipse but to no avail. I've tried using RTCompositeShape but that just expands the size of the smaller shape. Is there something else I'm missing (like fixing dimensions so they won't get updated) or should I subclass RTAbstractCompositeShape and try to make something on my own?
Thanks, Peter |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
CONTENTS DELETED
The author has deleted this message.
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
5677 posts
|
In reply to this post by Peter Uhnak
Hi Peter,
I am not sure what you try to do. Having two ellipses with the same center? But different radius? Something like that maybe: -=-=-=-=-=-=-=-=-= | v | v := RTView new. v @ RTDraggableView. shape := RTMultiCompositeShape new. shape add: (RTEllipse new color: (Color yellow alpha: 0.3); size: [:c | c numberOfMethods sqrt * 10 ]). shape add: (RTEllipse new color: (Color green alpha: 0.3); size: [:c | c numberOfLinesOfCode sqrt * 10 ]). v addAll: (shape elementsOn: RTShape withAllSubclasses). RTFlowLayout on: v elements. v -=-=-=-=-=-=-=-=-= ![]() Alexandre On Jul 11, 2014, at 11:05 PM, Peter Uhnák <[hidden email]> wrote: Hi -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
2019 posts
|
Thank you both for suggestions. According to Monticello I have latest Roassal2 and yet I don't see RTMultiCompositeShape, but I would assume it should be what I was looking for originally.
In the meantime I chose to do it manually - creating a custom shape in both Roassal and Trachert: I've done it in a single path because it seems that having multiple separate paths just creates more trouble.
======== computePath canvas ifNil: [ ^ self ]. path := self athensCanvas createPath: [ :builder |
builder absolute. self ccwCirclePath: builder radius: 0.5. "building circular path with specified radius"
self cwCirclePath: builder radius: 0.48. self ccwCirclePath: builder radius: 0.4 ] ========
But even if I could manage to do this with MultiCompositeShape I'm not sure about the rest of the shapes (see attachment). Peter On Sun, Jul 13, 2014 at 1:18 AM, Alexandre Bergel <[hidden email]> wrote:
... [show rest of quote] |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
5677 posts
|
Sorry, the version was not properly saved in SmalltalkHub. If you update Roassal2 and Trachel, you should be able to execute the code snippet I’ve sent you. Maybe you want to add “v open” at the end. If you are using GTInspector, this is not necessary.
As far as I understand your description of the problem, you do not need to create your own shape. Let me know how it goes. Cheers, Alexandre On Jul 13, 2014, at 10:38 AM, Peter Uhnák <[hidden email]> wrote: > Thank you both for suggestions. > > According to Monticello I have latest Roassal2 and yet I don't see RTMultiCompositeShape, but I would assume it should be what I was looking for originally. > > In the meantime I chose to do it manually - creating a custom shape in both Roassal and Trachert: > I've done it in a single path because it seems that having multiple separate paths just creates more trouble. > ======== > computePath > canvas ifNil: [ ^ self ]. > path := self athensCanvas > createPath: [ :builder | > builder absolute. > self ccwCirclePath: builder radius: 0.5. "building circular path with specified radius" > self cwCirclePath: builder radius: 0.48. > self ccwCirclePath: builder radius: 0.4 ] > ======== > > But even if I could manage to do this with MultiCompositeShape I'm not sure about the rest of the shapes (see attachment). > > Peter > > > > > On Sun, Jul 13, 2014 at 1:18 AM, Alexandre Bergel <[hidden email]> wrote: > Hi Peter, > > I am not sure what you try to do. Having two ellipses with the same center? But different radius? > > Something like that maybe: > -=-=-=-=-=-=-=-=-= > | v | > v := RTView new. > v @ RTDraggableView. > > shape := RTMultiCompositeShape new. > shape add: (RTEllipse new color: (Color yellow alpha: 0.3); size: [:c | c numberOfMethods sqrt * 10 ]). > shape add: (RTEllipse new color: (Color green alpha: 0.3); size: [:c | c numberOfLinesOfCode sqrt * 10 ]). > > v addAll: (shape elementsOn: RTShape withAllSubclasses). > RTFlowLayout on: v elements. > > v > -=-=-=-=-=-=-=-=-= > > <Screen Shot 2014-07-13 at 1.18.36 AM.png> > > Alexandre > > > On Jul 11, 2014, at 11:05 PM, Peter Uhnák <[hidden email]> wrote: > >> Hi >> >> I'm trying to draw an ellipse inside another ellipse but to no avail. I've tried using RTCompositeShape but that just expands the size of the smaller shape. Is there something else I'm missing (like fixing dimensions so they won't get updated) or should I subclass RTAbstractCompositeShape and try to make something on my own? >> >> Thanks, >> Peter > > -- > _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: > Alexandre Bergel http://www.bergel.eu > ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. > > > > > <shapes.png> ... [show rest of quote] -- _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
2019 posts
|
Thank you, the example now works. However as I've mentioned in
previous post I'm not sure about the rest of the shapes posted in the attachment. E.g. I haven't seen any notion of "box with rounded corners". I could compose it from four RTArc nad four RTLine but it seems to me overly complex compared to creating new Trachert/Roassal classes. The same would go for the other shapes. What are your thoughts/recommendations on that? Peter On Sun, Jul 13, 2014 at 3:25 PM, Alexandre Bergel <[hidden email]> wrote: > Sorry, the version was not properly saved in SmalltalkHub. If you update Roassal2 and Trachel, you should be able to execute the code snippet I’ve sent you. Maybe you want to add “v open” at the end. If you are using GTInspector, this is not necessary. > > As far as I understand your description of the problem, you do not need to create your own shape. > > Let me know how it goes. > > Cheers, > Alexandre > > > On Jul 13, 2014, at 10:38 AM, Peter Uhnák <[hidden email]> wrote: > >> Thank you both for suggestions. >> >> According to Monticello I have latest Roassal2 and yet I don't see RTMultiCompositeShape, but I would assume it should be what I was looking for originally. >> >> In the meantime I chose to do it manually - creating a custom shape in both Roassal and Trachert: >> I've done it in a single path because it seems that having multiple separate paths just creates more trouble. >> ======== >> computePath >> canvas ifNil: [ ^ self ]. >> path := self athensCanvas >> createPath: [ :builder | >> builder absolute. >> self ccwCirclePath: builder radius: 0.5. "building circular path with specified radius" >> self cwCirclePath: builder radius: 0.48. >> self ccwCirclePath: builder radius: 0.4 ] >> ======== >> >> But even if I could manage to do this with MultiCompositeShape I'm not sure about the rest of the shapes (see attachment). >> >> Peter >> >> >> >> >> On Sun, Jul 13, 2014 at 1:18 AM, Alexandre Bergel <[hidden email]> wrote: >> Hi Peter, >> >> I am not sure what you try to do. Having two ellipses with the same center? But different radius? >> >> Something like that maybe: >> -=-=-=-=-=-=-=-=-= >> | v | >> v := RTView new. >> v @ RTDraggableView. >> >> shape := RTMultiCompositeShape new. >> shape add: (RTEllipse new color: (Color yellow alpha: 0.3); size: [:c | c numberOfMethods sqrt * 10 ]). >> shape add: (RTEllipse new color: (Color green alpha: 0.3); size: [:c | c numberOfLinesOfCode sqrt * 10 ]). >> >> v addAll: (shape elementsOn: RTShape withAllSubclasses). >> RTFlowLayout on: v elements. >> >> v >> -=-=-=-=-=-=-=-=-= >> >> <Screen Shot 2014-07-13 at 1.18.36 AM.png> >> >> Alexandre >> >> >> On Jul 11, 2014, at 11:05 PM, Peter Uhnák <[hidden email]> wrote: >> >>> Hi >>> >>> I'm trying to draw an ellipse inside another ellipse but to no avail. I've tried using RTCompositeShape but that just expands the size of the smaller shape. Is there something else I'm missing (like fixing dimensions so they won't get updated) or should I subclass RTAbstractCompositeShape and try to make something on my own? >>> >>> Thanks, >>> Peter >> >> -- >> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: >> Alexandre Bergel http://www.bergel.eu >> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. >> >> >> >> >> <shapes.png> > > -- > _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: > Alexandre Bergel http://www.bergel.eu > ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. > > > > ... [show rest of quote] |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
5677 posts
|
Indeed, Roassal does not have a rectangle with rounded corner. Having it in Roassal means you need a new TRShape and a new RTShape.
I could easily do the RTShape. But we need the TRShape first. Do you feel like doing it? This will be a valuable addition to Roassal. Cheers, Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. On Jul 13, 2014, at 9:57 AM, Peter Uhnák <[hidden email]> wrote: Thank you, the example now works. However as I've mentioned in ... [show rest of quote] |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
2019 posts
|
Well in the long run I will probably need much more shapes that are currently present so I will probably end up making both TRShape and RTShape anyway. As far as contribution goes, I'd be happy to contribute but I'm still quite new to both Pharo and Smalltalk so I'm quite skeptical about the code quality. I've actually already made both shapes for rounded box but it will need some testing first; so I'll keep you posted. Peter
On Mon, Jul 14, 2014 at 10:47 PM, Alexandre Bergel <[hidden email]> wrote:
... [show rest of quote] |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
5447 posts
|
Peter Uhnák wrote:
Alexandre was always receptive of my rough contributions, and I learnt a lot about improving code quality from him. So I'd encourage you to give it a go. cheers -ben
... [show rest of quote]
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
5677 posts
|
In reply to this post by Peter Uhnak
Defining new shapes is not complicated at all, and we will review your code. The first thing is to define a trshape, you just have to override how you compute the path, and checking for point inclusion (I.e., is a point inside the shape or not). But beside that, this is all trivial. Let us know how it goes. Alexandre
... [show rest of quote]
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
5677 posts
|
In reply to this post by Ben Coman
Thanks Ben for your nice words Alexandre
... [show rest of quote]
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
In reply to this post by Peter Uhnak
CONTENTS DELETED
The author has deleted this message.
|
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
5677 posts
|
Well seen!! Good point!
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;: Alexandre Bergel http://www.bergel.eu ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;. On Jul 15, 2014, at 9:46 PM, Juraj Kubelka <[hidden email]> wrote:
... [show rest of quote] |
Free forum by Nabble | Edit this page |