morphic construction question

Ned Konz ned at bike-nomad.com
Fri Oct 3 19:25:56 UTC 2003


Douglas McPherson wrote:

> I am doing some simulation work on cellular (wireless) telecommunication 
> systems. I am trying to programmatically create a Morph with the 
> following properties:
> 
> A 'map' consisting of lattice of hexagons covering a 2-dimensional area. 
> Each hexagon represents a cell site, the area served by a particular 
> cellular base station. Each cellSite (hexagon) is further subdivided 
> into a number of identical angular Sectors - typically 3 or 6. I would 
> like to be able to manipulate such a morph at either the map level, the 
> cellSite level, or the sector level with respect to resizing, etc.
> 
> So far, I have created sectors using polygon morphs. By combining sector 
> morphs I can create  cellSite morphs, and by specifying a number of 
> appropriately positioned cellSites, I can create a map. However I am not 
> sure what kind of morphs the composites (cellSite and map) should be.  I 
> image that the container morphs contain a collection of subMorphs - ie a 
> Map containes several cellSite subMorphs, a cell site contains several 
> sectors, etc. Resizing a map should resize all constituent cellSites, etc.

The choice of a base class isn't too important unless there's some other 
behavior you need.

I'd subclass Morph for both of these, and override layoutInBounds: to do 
the proper child layout.





More information about the Squeak-dev mailing list