-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
29538e2
commit 2626cd1
Showing
7 changed files
with
166 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
Extension { #name : 'RSParametricLine' } | ||
|
||
{ #category : '*Roassal3-Layouts' } | ||
RSParametricLine >> asGroupWithControlNet: aBlock [ | ||
|
||
| circles polyline labels location | | ||
polyline := RSPolyline new | ||
controlPoints: points; | ||
dotted; | ||
yourself. | ||
|
||
circles := Array new: pointsSize. | ||
labels := Array new: pointsSize. | ||
|
||
location := RSLocation new | ||
above; | ||
yourself. | ||
|
||
points withIndexCollect: [ :each :index | | ||
| circle label | | ||
circle := RSCircle new | ||
model: each; | ||
color: Color transparent; | ||
radius: polyline border width * Float goldenPlatinumRatio; | ||
draggable; | ||
withBorder; | ||
position: each; | ||
yourself. | ||
|
||
label := RSLabel new | ||
useDefaultCodeFont; | ||
text: (circle position asFloatPointRound: 3); | ||
yourself. | ||
|
||
location stick: label on: circle. | ||
|
||
circle | ||
when: RSPositionChangedEvent | ||
do: [ :ev | | ||
circle model: ev newPosition. | ||
label text: (ev newPosition asFloatPointRound: 3). | ||
|
||
points at: index put: ev newPosition. | ||
polyline controlPoints: points. | ||
|
||
self controlPoints: points ] | ||
for: self. | ||
|
||
|
||
circles at: index put: circle. | ||
labels at: index put: label ]. | ||
|
||
polyline color: polyline color translucent. | ||
self color: self color translucent. | ||
|
||
aBlock | ||
value: self | ||
value: circles | ||
value: labels | ||
value: polyline. | ||
|
||
^ RSGroup new | ||
addAll: circles , labels , { | ||
polyline. | ||
self }; | ||
yourself | ||
] | ||
|
||
{ #category : '*Roassal3-Layouts' } | ||
RSParametricLine >> asGroupWithControlNetColoured: aColor [ | ||
|
||
^ self asGroupWithControlNet: [ :bspline :circles :labels :line | | ||
| translucentColor | | ||
translucentColor := aColor translucent. | ||
|
||
bspline color: aColor. | ||
line color: translucentColor. | ||
circles with: labels do: [ :circle :label | | ||
circle border color: translucentColor. | ||
label color: translucentColor ] ] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
Extension { #name : 'RSShape' } | ||
|
||
{ #category : '*Roassal3-Layouts' } | ||
RSShape >> boxedWithPad: aPadding [ | ||
|
||
^ self padded: aPadding withBoxDo: [ :box | | ||
box | ||
color: Color white; | ||
borderDo: [ :aBorder | aBorder color: aBorder color translucent ] ] | ||
] | ||
|
||
{ #category : '*Roassal3-Layouts' } | ||
RSShape >> notedWithPad: aPadding [ | ||
|
||
^ self padded: aPadding withNoteDo: [ :box | | ||
box | ||
color: Color white; | ||
borderDo: [ :aBorder | aBorder color: aBorder color translucent ] ] | ||
] | ||
|
||
{ #category : '*Roassal3-Layouts' } | ||
RSShape >> padded: aPadding shape: boxShape do: aBlock [ | ||
|
||
| box | | ||
box := boxShape | ||
extent: self extent + (aPadding * 2); | ||
cornerRadius: aPadding; | ||
yourself. | ||
|
||
aBlock cull: box cull: self. | ||
|
||
RSLocation new | ||
center; | ||
stick: box on: self. | ||
|
||
^ RSComposite new | ||
shapes: { | ||
box. | ||
self }; | ||
yourself | ||
] | ||
|
||
{ #category : '*Roassal3-Layouts' } | ||
RSShape >> padded: aPadding withBoxDo: aBlock [ | ||
|
||
^ self padded: aPadding shape: RSBox new do: aBlock | ||
] | ||
|
||
{ #category : '*Roassal3-Layouts' } | ||
RSShape >> padded: aPadding withNoteDo: aBlock [ | ||
|
||
^ self padded: aPadding shape: RSNote new do: aBlock | ||
] | ||
|
||
{ #category : '*Roassal3-Layouts' } | ||
RSShape >> padded: aPadding withSimplerNoteDo: aBlock [ | ||
|
||
^ self padded: aPadding shape: RSSimplerNote new do: aBlock | ||
] | ||
|
||
{ #category : '*Roassal3-Layouts' } | ||
RSShape >> paddedWithGoldenRatio [ | ||
|
||
| pad | | ||
pad := self extent * Float silverRatio / 2 in: [ :extent | | ||
extent x max: extent y ]. | ||
|
||
^ RSComposite new | ||
shapes: { self }; | ||
padding: pad; | ||
yourself | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters