20 |
from Thuban.Model.label import ALIGN_CENTER, ALIGN_TOP, ALIGN_BOTTOM, \ |
from Thuban.Model.label import ALIGN_CENTER, ALIGN_TOP, ALIGN_BOTTOM, \ |
21 |
ALIGN_LEFT, ALIGN_RIGHT, ALIGN_BASELINE |
ALIGN_LEFT, ALIGN_RIGHT, ALIGN_BASELINE |
22 |
|
|
23 |
|
from Thuban.Model.classification import Classification |
24 |
|
|
25 |
|
|
26 |
class MapRenderer: |
class MapRenderer: |
27 |
|
|
79 |
for i in self.layer_ids(layer): |
for i in self.layer_ids(layer): |
80 |
value = None |
value = None |
81 |
shape = layer.Shape(i) |
shape = layer.Shape(i) |
82 |
field = layer.classification.field |
lc = layer.classification |
83 |
|
field = lc.field |
84 |
|
|
85 |
if field is not None: |
if field is not None: |
86 |
record = layer.table.read_record(i) |
record = layer.table.read_record(i) |
92 |
# be null, at which point this call will |
# be null, at which point this call will |
93 |
# at least retreive the NullData |
# at least retreive the NullData |
94 |
# |
# |
95 |
prop = layer.classification.getProperties(value) |
prop = lc.GetProperties(value) |
96 |
|
|
97 |
if prop != old_prop: |
if prop != old_prop: |
98 |
old_prop = prop |
old_prop = prop |
100 |
if shapetype == SHAPETYPE_ARC: |
if shapetype == SHAPETYPE_ARC: |
101 |
fill = None |
fill = None |
102 |
else: |
else: |
103 |
fill = prop['fill'] |
fill = prop.GetFill() |
104 |
|
|
105 |
if fill is None: |
if fill is None: |
106 |
brush = wxTRANSPARENT_BRUSH |
brush = wxTRANSPARENT_BRUSH |
110 |
fill.blue * 255) |
fill.blue * 255) |
111 |
brush = wxBrush(color, wxSOLID) |
brush = wxBrush(color, wxSOLID) |
112 |
|
|
113 |
stroke = prop['stroke'] |
stroke = prop.GetStroke() |
114 |
stroke_width = prop['stroke_width'] |
stroke_width = prop.GetStrokeWidth() |
115 |
if stroke is None: |
if stroke is None: |
116 |
pen = wxTRANSPARENT_PEN |
pen = wxTRANSPARENT_PEN |
117 |
else: |
else: |