On Mar 23, 2004, at 3:42 PM, George Uecker wrote:
> Hi Brian,
>
> Fedor Brian J Contr AFRL/IFEC wrote:
>
>> Hello Don, everybody:
>> I have a situation where I plot in the magnitude of 10K+ objects
>> and have to interact with any one of these objects at the time. What
>> I have done is modified the LocationLayer code to continuously
>> receive data at various data rates and for 3 different types of
>> objects ( objects with an error Ellipse ). The problem I am having
>> is that after I receive an object I call the doPrepare() method after
>> every object is received. So, I'll explain my dilemmas below:
>> 1) The update gets slow if I get 200-300 objects per minute (or
>> faster) as expected because of the number of objects plus the
>> redrawing of all the data every time I receive data for plotting or
>> have moved or zoomed the map. Is there a way I can only update just
>> the latest object that was received versus all the objects (outside
>> of the map moving or zooming)?
>>
>
> There are a couple of things you can do, and the best choice may
> depend on what you're plotting. If you're plotting simple geometric
> shapes, you might be able to use XOR drawing mode. With XOR, you draw
> an object once, and then to erase it you simply draw it again. Here's
> a typical sequence:
>
> 1. you receive new data, create an OMGraphic for it, and draw the
> graphic at the given location using XOR mode
> 2. you receive an update for that object, so you draw it again in XOR
> mode at the original location to erase the old one
> 3. you then draw the updated object at the new location.
> 4. repeat steps 2-3 as necessary
>
> This is relatively fast because it only needs to paints the pixels of
> the new/modified object, not the whole screen. The downside is that
> you don't have as much control over object color because of the way
> XOR mode works, so it's no good for painting icons and the like. This
> approach would also likely require that you develop your own custom
> layer(s).
XOR drawing can be pretty tricky for a layer, you also have to pay
attention to the MapBean repainting for other reasons, so that you
truly cover up what you want to erase instead of having something else
paint into the Graphics object and then you end up rendering something
for the first time, instead of painting over it. The DrawingTool
uses XOR mode, but also uses the PainterListener mechanism to cover
itself for these situations.
> Another tactic is to draw everything each time, but to manage your
> repainting a little differently. We have a radar display application
> that continually plots thousands of radar contacts (as tiny
> color-coded OMRects or OMCircles) in addition to a clutter isoline
> layer (of complex OMPolys) and a variety of other radar-specific
> graphics. The data for each custom layer is received via a separate
> thread and stored temporarily in a queue. As the data is pulled from
> the queue and processed, OMGraphics are created for it and stored in a
> special ring buffer that can be resized to allow shorter or longer
> radar scan histories.
>
> Repainting is not driven by the incoming data; rather, it's driven by
> a Timer. Note that it's not necessary to generate() your OMGraphics
> every time you repaint - in fact it would cause a huge performance hit
> to do so, and you may already be experiencing this via doPrepare().
> For highly dynamic displays like this, you should only generate() your
> OMGraphics a) when the data is first received or b) when the
> projection changes.
This is a good point. You don't want to be calling doPrepare() after
every OMGraphic arrives.
> When I originally started using OpenMap for my project, I too used
> LocationLayers, but I eventually moved away from them and developed my
> own custom layers to get more control over the data storage/graphic
> generation/repainting sequence. (Note that I'm still using OM 4.5.4).
I would take a look at the GraphicLoader package
(com.bbn.openmap.graphicLoader). You can create a GraphicLoader
representing your data source, creating an OMGraphicList, and then
setting it on some listener that will end up being a
GraphicLoaderPlugIn/PlugInLayer. All you have to do is add the
GraphicLoaderConnector and your GraphicLoader to the openmap.components
property, and everything else is taken care of. If you want to get
back more if the functionality of the LocationLayer (with regard to
menus, I'm supposing) you can then work on creating a Layer that uses
your GraphicLoader explicitly for additional functionality. There's a
lot in the OMGraphicHandlerLayer that will handle that for you,
event-wise.
- Don
>
>> 2) Can or should I create new LocationLayers on the fly to only
>> support so many objects per layer? How can this be done from the
>> original point of entry layer?
>
> You could, but I don't see that it would gain you anything. The only
> suggestion I would make is maybe having 3 different layers
> corresponding to the 3 different types of objects you mention, if that
> fits in with your application. Each of these layers could be an
> instance of the same class, the difference being that they get their
> data from different sources or whatever. Then you could turn the
> layers on/off individually based on object type.
>
>> 3) Is there an easier and faster way to do what I am doing?
>
> Faster, probably. Easier, doubtful.
>
>> 4) Jumping off of a bridge is not an option! :-)
>>
>
> It's *always* an option ;-)
>
> Regards,
>
> George
>
>> Thank you in advance everybody. Please excuse my ignorance to
>> OpenMap as I have only been using this since late last Summer and
>> have only known how to spell Java a little before then!
>> Sincerely,
>> Brian
>>
>> * \\// -(@ @)-
>> --oOO-- (_)-- OOo--*
>>
>> Brian J. Fedor
>> Research Engineer
>> Syracuse Research Corporation
>> 32 Brooks Road, Building 240
>> Rome, New York 13441
>> (315) 330-7163
>>
>>
>
>
>
> --
> George Uecker george.uecker@dot21rts.com
> Software Engineer (410) 480-7236 voice
> Dot21 Real-Time Systems Inc. (410) 480-7237 fax
>
>
>
> --
> [To unsubscribe to this list send an email to "majdart@bbn.com"
> with the following text in the BODY of the message "unsubscribe
> openmap-users"]
>
-- [To unsubscribe to this list send an email to "majdart@bbn.com" with the following text in the BODY of the message "unsubscribe openmap-users"]Received on Thu Mar 25 10:20:08 2004
This archive was generated by hypermail 2.1.8 : Thu May 12 2005 - 07:18:38 EDT