Ignore:
Timestamp:
2011-01-31T14:18:47+01:00 (15 years ago)
Author:
bastiK
Message:

mappaint restructuring aimed at mapcss support:

  • area- and line style of multipolygon outer & inner ways are no longer determined by MapPaintVisitor, but the information is calculated in advance and cached
  • cache is aware of zoom level
  • z_index property to allow more fancy styles in future

Performance: when the style cache is filled, painting is the same or ~5% faster. The first painting, which includes style generation, takes ~30% longer than before. (There is potential for optimization, though.) Memory usage unchanged.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java

    r3824 r3836  
    300300     *--------*/
    301301    public StyleCache mappaintStyle = null;
    302     public int mappaintDrawnCode = 0;
    303302
    304303    /* This should not be called from outside. Fixing the UI to add relevant
     
    307306    public void clearCached()
    308307    {
    309         mappaintDrawnCode = 0;
    310308        mappaintStyle = null;
    311309    }
     
    808806    public boolean isSelected() {
    809807        return dataSet != null && dataSet.isSelected(this);
     808    }
     809
     810    public boolean isMemberOfSelected() {
     811        if (referrers == null)
     812            return false;
     813        if (referrers instanceof OsmPrimitive)
     814            return referrers instanceof Relation && ((OsmPrimitive) referrers).isSelected();
     815        for (OsmPrimitive ref : (OsmPrimitive[]) referrers) {
     816            if (ref instanceof Relation && ref.isSelected())
     817                return true;
     818        }
     819        return false;
    810820    }
    811821
Note: See TracChangeset for help on using the changeset viewer.