SlideShare a Scribd company logo
1 of 27
Download to read offline
Graphics and Visualization
Yuriy Tymchuk
(almost) Alain Plantec
Guillaume Larcheveque
What are Athens?
aCanvas createPath: [:builder |
builder
absolute;
moveTo: 70@100;
lineTo: 330@100;
cwArcTo: 350@120
angle: 90 degreesToRadians;
lineTo: 350@280;
cwArcTo: 330@300
angle: 90 degreesToRadians;
lineTo: 70@300;
cwArcTo: 50@280
angle: 90 degreesToRadians;
lineTo: 50@120;
cwArcTo: 70@100
angle: 90 degreesToRadians
p := aCanvas createPath:[ :b | b
moveTo: 0.3@0.3 ;
lineTo: 0.4@0;
curveVia: 0.1@0 to: 0.1@0.1;
lineTo: 0@0.2;
curveVia: 0@0.1 to: -0.1@0.1;
lineTo: -0.4@0;
curveVia: -0.1@0 to: (0.1@0.1) negated;
lineTo: 0@0.2 negated ;
curveVia: 0@0.1 negated to: 0.1@0.1 negated ].
aCanvas
setPaint: self coloredCarColor;
drawShape: p.
stroke := aCanvas setStrokePaint: self wheelColor.
stroke width: 0.01.
aCanvas draw.
wheel := aCanvas createPath:[ :b | b
moveTo: 0.3@0.3;
cwArcTo: 0.15@0 angle: Float halfPi;
moveTo: 0.1@0;
cwArcTo: 0.15@0 angle: Float halfPi;
moveTo: 0.0@0.4;
cwArcTo: 0.15 negated@0 angle: Float halfPi;
moveTo: -0.1@0;
cwArcTo: 0.15 negated@0 angle: Float halfPi ].
aCanvas
setPaint: self wheelColor;
drawShape: wheel.
decorator := aCanvas createPath:[ :b | b
moveTo: 0.2@0.45;
lineTo: 0.225@0 ;
cwArcTo: 0.15@0 angle: Float halfPi;
lineTo: 0.225@0;
lineTo: 0@0.1 ;
lineTo: -0.225@ 0;
cwArcTo: -0.15@0 angle: Float halfPi;
lineTo: -0.225@ 0 ;
lineTo: 0@0.1 negated].
stroke := aCanvas setStrokePaint: self chasisDecoratorColor.
stroke width: 0.01.
aCanvas drawShape: decorator.
aCanvas setPaint: self chasisLineColor.
aCanvas draw.
http://agilevisualization.com
Athens
Trachel
Roassal
Amber
stuff?
Trachel
Roassal
Nicolas Lusa
Michele Lanza
Nicolas Lusa
Michele Lanza
Arc de Triomphe
Champs-Élysées
ViDI
http://vidi.inf.usi.ch
Bloc
A new 2D graphics framework for Pharo
Bloc
• a new Morph hierarchy
• a new event framework
• new layout strategies
• a new Halo framework
• new World management
• new widgets
Bloc = new Morphic implementation
+ OSWindows + Athens + TxtText
New Morph hierarchy
BlView for the rendering
BlMorph for events management
Less Morph subclasses
A Morph is associated with a View
A View can be a composite
New layout strategies
Anchors, Box, Border, Stack
An more to come:
We are ready to build new widgets
Stay tuned!
Telescope

More Related Content

More from Pharo

Object-Centric Debugging: a preview
Object-Centric Debugging: a previewObject-Centric Debugging: a preview
Object-Centric Debugging: a previewPharo
 
The future of testing in Pharo
The future of testing in PharoThe future of testing in Pharo
The future of testing in PharoPharo
 
Spec 2.0: The next step on desktop UI
Spec 2.0: The next step on desktop UI Spec 2.0: The next step on desktop UI
Spec 2.0: The next step on desktop UI Pharo
 
UI Testing with Spec
 UI Testing with Spec UI Testing with Spec
UI Testing with SpecPharo
 
Pharo 7.0 and 8.0 alpha
Pharo 7.0 and 8.0 alphaPharo 7.0 and 8.0 alpha
Pharo 7.0 and 8.0 alphaPharo
 
PHARO IoT: Installation Improvements and Continuous Integration
PHARO IoT: Installation Improvements and Continuous IntegrationPHARO IoT: Installation Improvements and Continuous Integration
PHARO IoT: Installation Improvements and Continuous IntegrationPharo
 
Easy REST with OpenAPI
Easy REST with OpenAPIEasy REST with OpenAPI
Easy REST with OpenAPIPharo
 
Comment soup with a pinch of types, served in a leaky bowl
Comment soup with a pinch of types, served in a leaky bowlComment soup with a pinch of types, served in a leaky bowl
Comment soup with a pinch of types, served in a leaky bowlPharo
 
apart Framework: Porting from VisualWorks
apart Framework: Porting from VisualWorksapart Framework: Porting from VisualWorks
apart Framework: Porting from VisualWorksPharo
 
XmppTalk
XmppTalkXmppTalk
XmppTalkPharo
 
A living programming environment for blockchain
A living programming environment for blockchainA living programming environment for blockchain
A living programming environment for blockchainPharo
 
Raspberry and Pharo
Raspberry and PharoRaspberry and Pharo
Raspberry and PharoPharo
 
Welcome: PharoDays 2017
Welcome: PharoDays 2017Welcome: PharoDays 2017
Welcome: PharoDays 2017Pharo
 
Pharo 6
Pharo 6Pharo 6
Pharo 6Pharo
 
Robotic Exploration and Mapping with Pharo
Robotic Exploration and Mapping with PharoRobotic Exploration and Mapping with Pharo
Robotic Exploration and Mapping with PharoPharo
 
Pharo 64bits
Pharo 64bitsPharo 64bits
Pharo 64bitsPharo
 
Smack: Behind the Refactorings
Smack: Behind the RefactoringsSmack: Behind the Refactorings
Smack: Behind the RefactoringsPharo
 
Pharo VM Performance
Pharo VM PerformancePharo VM Performance
Pharo VM PerformancePharo
 
Git with Style
Git with StyleGit with Style
Git with StylePharo
 
Pharo JS
Pharo JSPharo JS
Pharo JSPharo
 

More from Pharo (20)

Object-Centric Debugging: a preview
Object-Centric Debugging: a previewObject-Centric Debugging: a preview
Object-Centric Debugging: a preview
 
The future of testing in Pharo
The future of testing in PharoThe future of testing in Pharo
The future of testing in Pharo
 
Spec 2.0: The next step on desktop UI
Spec 2.0: The next step on desktop UI Spec 2.0: The next step on desktop UI
Spec 2.0: The next step on desktop UI
 
UI Testing with Spec
 UI Testing with Spec UI Testing with Spec
UI Testing with Spec
 
Pharo 7.0 and 8.0 alpha
Pharo 7.0 and 8.0 alphaPharo 7.0 and 8.0 alpha
Pharo 7.0 and 8.0 alpha
 
PHARO IoT: Installation Improvements and Continuous Integration
PHARO IoT: Installation Improvements and Continuous IntegrationPHARO IoT: Installation Improvements and Continuous Integration
PHARO IoT: Installation Improvements and Continuous Integration
 
Easy REST with OpenAPI
Easy REST with OpenAPIEasy REST with OpenAPI
Easy REST with OpenAPI
 
Comment soup with a pinch of types, served in a leaky bowl
Comment soup with a pinch of types, served in a leaky bowlComment soup with a pinch of types, served in a leaky bowl
Comment soup with a pinch of types, served in a leaky bowl
 
apart Framework: Porting from VisualWorks
apart Framework: Porting from VisualWorksapart Framework: Porting from VisualWorks
apart Framework: Porting from VisualWorks
 
XmppTalk
XmppTalkXmppTalk
XmppTalk
 
A living programming environment for blockchain
A living programming environment for blockchainA living programming environment for blockchain
A living programming environment for blockchain
 
Raspberry and Pharo
Raspberry and PharoRaspberry and Pharo
Raspberry and Pharo
 
Welcome: PharoDays 2017
Welcome: PharoDays 2017Welcome: PharoDays 2017
Welcome: PharoDays 2017
 
Pharo 6
Pharo 6Pharo 6
Pharo 6
 
Robotic Exploration and Mapping with Pharo
Robotic Exploration and Mapping with PharoRobotic Exploration and Mapping with Pharo
Robotic Exploration and Mapping with Pharo
 
Pharo 64bits
Pharo 64bitsPharo 64bits
Pharo 64bits
 
Smack: Behind the Refactorings
Smack: Behind the RefactoringsSmack: Behind the Refactorings
Smack: Behind the Refactorings
 
Pharo VM Performance
Pharo VM PerformancePharo VM Performance
Pharo VM Performance
 
Git with Style
Git with StyleGit with Style
Git with Style
 
Pharo JS
Pharo JSPharo JS
Pharo JS
 

Graphics and Visualization Techniques

  • 1. Graphics and Visualization Yuriy Tymchuk (almost) Alain Plantec Guillaume Larcheveque
  • 3.
  • 4.
  • 5.
  • 6. aCanvas createPath: [:builder | builder absolute; moveTo: 70@100; lineTo: 330@100; cwArcTo: 350@120 angle: 90 degreesToRadians; lineTo: 350@280; cwArcTo: 330@300 angle: 90 degreesToRadians; lineTo: 70@300; cwArcTo: 50@280 angle: 90 degreesToRadians; lineTo: 50@120; cwArcTo: 70@100 angle: 90 degreesToRadians
  • 7. p := aCanvas createPath:[ :b | b moveTo: 0.3@0.3 ; lineTo: 0.4@0; curveVia: 0.1@0 to: 0.1@0.1; lineTo: 0@0.2; curveVia: 0@0.1 to: -0.1@0.1; lineTo: -0.4@0; curveVia: -0.1@0 to: (0.1@0.1) negated; lineTo: 0@0.2 negated ; curveVia: 0@0.1 negated to: 0.1@0.1 negated ]. aCanvas setPaint: self coloredCarColor; drawShape: p. stroke := aCanvas setStrokePaint: self wheelColor. stroke width: 0.01. aCanvas draw. wheel := aCanvas createPath:[ :b | b moveTo: 0.3@0.3; cwArcTo: 0.15@0 angle: Float halfPi; moveTo: 0.1@0; cwArcTo: 0.15@0 angle: Float halfPi; moveTo: 0.0@0.4; cwArcTo: 0.15 negated@0 angle: Float halfPi; moveTo: -0.1@0; cwArcTo: 0.15 negated@0 angle: Float halfPi ]. aCanvas setPaint: self wheelColor; drawShape: wheel. decorator := aCanvas createPath:[ :b | b moveTo: 0.2@0.45; lineTo: 0.225@0 ; cwArcTo: 0.15@0 angle: Float halfPi; lineTo: 0.225@0; lineTo: 0@0.1 ; lineTo: -0.225@ 0; cwArcTo: -0.15@0 angle: Float halfPi; lineTo: -0.225@ 0 ; lineTo: 0@0.1 negated]. stroke := aCanvas setStrokePaint: self chasisDecoratorColor. stroke width: 0.01. aCanvas drawShape: decorator. aCanvas setPaint: self chasisLineColor. aCanvas draw.
  • 8.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 19. Nicolas Lusa Michele Lanza Arc de Triomphe Champs-Élysées
  • 21. Bloc A new 2D graphics framework for Pharo
  • 22. Bloc • a new Morph hierarchy • a new event framework • new layout strategies • a new Halo framework • new World management • new widgets Bloc = new Morphic implementation + OSWindows + Athens + TxtText
  • 23. New Morph hierarchy BlView for the rendering BlMorph for events management
  • 24. Less Morph subclasses A Morph is associated with a View A View can be a composite
  • 25. New layout strategies Anchors, Box, Border, Stack
  • 26. An more to come: We are ready to build new widgets Stay tuned!