How do I query the geometry model?

classic Classic list List threaded Threaded
4 messages Options
HJH
Reply | Threaded
Open this post in threaded view
|

How do I query the geometry model?

HJH
Hello Hilaire

Assuming I have created a sketch such as the  one done here
http://forum.drgeo.eu/Euclid-book-IV-proposition-15-td4025456.html

How do I query the geometry model?

Regards
Hannes
HJH
Reply | Threaded
Open this post in threaded view
|

Re: How do I query the geometry model?

HJH
An example of a query could be to go for all labels and then replace the label string with a translation of it. E.g. I have buttons or a list box to select the language and then all the text in the sketch is translated.

Another example could be to walk through the object model and produce an SVG representation of it.
Reply | Threaded
Open this post in threaded view
|

Re: How do I query the geometry model?

Hilaire Fernandes
Administrator
In reply to this post by HJH
Le 19/10/2018 à 09:23, HJH [via Dr. Geo Forum] a écrit :
Assuming I have created a sketch such as the  one done here
http://forum.drgeo.eu/Euclid-book-IV-proposition-15-td4025456.html

How do I query the geometry model?


Short answer: you are not supposed to access it from Smalltalk Sketch.

Long answer: you have to access it through the factory


| s |

s:= DrGeoCanvas new.

s app domain factory pool "The models compositing your sketch"

Was this message helpful?
Tell us!
Reply | Threaded
Open this post in threaded view
|

Re: How do I query the geometry model?

Hilaire Fernandes
Administrator
In reply to this post by HJH
Le 19/10/2018 à 09:40, HJH [via Dr. Geo Forum] a écrit :
> An example of a query could be to go for all labels and then replace
> the label string with a translation of it. E.g. I have buttons or a
> list box to select the language and then all the text in the sketch is
> translated.
>
DrGeo hanldes translation by the mean of Gettext, selected from the
locale context of the host.

> Another example could be to walk through the object model and produce
> an SVG representation of it.

You may better visit the costume

Hilaire

Was this message helpful?
Tell us!