24 |
from Thuban.UI.classifier import ClassDataPreviewer |
from Thuban.UI.classifier import ClassDataPreviewer |
25 |
from Thuban.UI.scalebar import ScaleBar |
from Thuban.UI.scalebar import ScaleBar |
26 |
|
|
27 |
from Thuban.Model.data import SHAPETYPE_POLYGON, SHAPETYPE_ARC, SHAPETYPE_POINT |
from Thuban.Model.data import SHAPETYPE_POLYGON, SHAPETYPE_ARC, \ |
28 |
|
SHAPETYPE_POINT, RAW_SHAPEFILE |
29 |
|
|
30 |
from Thuban.Model.color import Transparent |
from Thuban.Model.color import Transparent |
31 |
import Thuban.Model.resource |
import Thuban.Model.resource |
58 |
def low_level_renderer(self, layer): |
def low_level_renderer(self, layer): |
59 |
"""Override inherited method to provide more efficient renderers |
"""Override inherited method to provide more efficient renderers |
60 |
|
|
61 |
For point shapes, return self.draw_point_shape and layer just as |
If the underlying data format is not a shapefile or the layer |
62 |
the base class method. For arc and polygon use the more |
contains points shapes, simply use what the inherited method |
63 |
efficient wxproj.draw_polygon_shape and its corresponding |
returns. |
64 |
parameter created with wxproj.draw_polygon_init. |
|
65 |
|
Otherwise, i.e. for arc and polygon use the more efficient |
66 |
|
wxproj.draw_polygon_shape and its corresponding parameter |
67 |
|
created with wxproj.draw_polygon_init. |
68 |
""" |
""" |
69 |
shapetype = layer.ShapeType() |
if (layer.ShapeStore().RawShapeFormat() == RAW_SHAPEFILE |
70 |
if shapetype == SHAPETYPE_POINT: |
and layer.ShapeType() in (SHAPETYPE_ARC, SHAPETYPE_POLYGON)): |
|
func = self.draw_point_shape |
|
|
param = layer |
|
|
else: |
|
71 |
offx, offy = self.offset |
offx, offy = self.offset |
72 |
param = draw_polygon_init(layer.ShapeStore().Shapefile(), self.dc, |
return (draw_polygon_shape, |
73 |
self.map.projection, |
draw_polygon_init(layer.ShapeStore().Shapefile(), |
74 |
|
self.dc, self.map.projection, |
75 |
layer.projection, |
layer.projection, |
76 |
self.scale, -self.scale, |
self.scale, -self.scale, offx, offy)) |
77 |
offx, offy) |
else: |
78 |
func = draw_polygon_shape |
return BaseRenderer.low_level_renderer(self, layer) |
|
return func, param |
|
79 |
|
|
80 |
def label_font(self): |
def label_font(self): |
81 |
return wxFont(self.resolution * 10, wxSWISS, wxNORMAL, wxNORMAL) |
return wxFont(self.resolution * 10, wxSWISS, wxNORMAL, wxNORMAL) |