Tim Ansell wrote:
> What I want to do, is display on the starmap little pie graphs which 
> show the concentration of resources in each system. The size of the
> pie will show the relative amount of resource in each system (big ==
> more resources, smaller == less resources), while the pie pieces show
> the break down (IE Red == Resource 1, Blue == Resource 2).
> 
> Thus the pie graph's diameter doesn't change relative to the zoom
> level.

Go it. There are a number of Objects that have a "Scaled" and "UnScaled"
  version: Points vs. Circles, Text vs. ScaledText. I guess I should have
a cleaner naming scheme, and/or combine the code more (having "scaled"
be a keyword flag or something)

> I'm afraid I'm in the tab camp. Feel free to convert to 4 spaces if
> you want to include in the FloatCanvas core.

Will do, we definitely need the same style in all included code.

> On another note, I also have the following objects, * "PolygonStatic"
> which is like a point in that it never changes size, just it
> position. (You can see it used for the little ship icons and the Red
> arrow). * "RelativePoint" exactly like a normal point but can also
> have a *pixel* offset. (I use this to draw the little orbit dots in
> the above screenshots.)
> 
> Are either of them useful to you?

Yes, they sure are.

> I use to be a believer in "duck typing", then none of my software
> ended up working in strange cases. I now do quite a bit of type
> checking (and I have found it is often best to subclass the real
> types).

True, without any checking, it can get ugly sometimes. However, I like
to catch the exception, rather than check the type.
> I'm actually using a dict in the demo :)

I saw that, but didn't think that applied to how it's used inside the
loop building the Objects -- but maybe I'm wrong there...however, in that
case, it will always be dict, 'cause you check that above.

> Technically you could subclass dict and you would also pass that
> test. I actually don't know any other way to tell apart a dict from a
> list. Both have getitem methods.

yes, but both won't work if you pass in a key that isn't an integer --
so you can catch the exception. In this case, however, I guess you are
testing to see if you can pass it in as **args, so you may need to check.

Anyway, I'm working on it a bit, which should fix a few things, and make
it conform to my style more. I'll post when I've got the next stage working.

> I don't use numpy often, so feel free to improve it.

You should, it's fabulous!

> Well, I would actually like anti-aliasing for the whole thing. Speed
> isn't that a huge issue as 90% of my things are static (and hence in the
> "background" which wouldn't need re-rendering often).

I have thought about how to make it optional, but haven't had the time 
to play around with it. With the GraphicsContextDC, it should be pretty 
easy, if not optimal.

> Is the DC stuff already using this stuff on Mac OS X? The lines looks
> "cleaner" but there seem some "movement" of the pixel aligned points.
> See this screen shot -> http://www.guitsaru.com/TP-OSX-Popup.png

Well, the OS-X version uses CoreGraphics now, but I don't think it 
anti-aliases with a DC . Maybe it does for Text.

>> So you want to be able to specify the diameter of your pie chart in 
>> Pixel coords, and it's location in world coords, just like a point? 

> Yes, exactly.

Maybe I'll try this one with a keyword.

The question is -- do we make an unscaled ArcObject, or just make a 
PieChart a self-contained object?

-Chris






-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R            (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

[EMAIL PROTECTED]
_______________________________________________
FloatCanvas mailing list
[email protected]
http://mail.mithis.com/cgi-bin/mailman/listinfo/floatcanvas

Reply via email to