1 |
# Copyright (c) 2001 by Intevation GmbH |
# Copyright (c) 2001, 2002 by Intevation GmbH |
2 |
# Authors: |
# Authors: |
3 |
# Bernhard Herzog <[email protected]> |
# Bernhard Herzog <[email protected]> |
4 |
# |
# |
507 |
dc = wxClientDC(self) |
dc = wxClientDC(self) |
508 |
font = wxFont(10, wx.wxSWISS, wx.wxNORMAL, wx.wxNORMAL) |
font = wxFont(10, wx.wxSWISS, wx.wxNORMAL, wx.wxNORMAL) |
509 |
dc.SetFont(font) |
dc.SetFont(font) |
510 |
for i in range(len(labels)): |
for i in range(len(labels) - 1, -1, -1): |
511 |
label = labels[i] |
label = labels[i] |
512 |
x = label.x |
x = label.x |
513 |
y = label.y |
y = label.y |
565 |
|
|
566 |
select_shape = -1 |
select_shape = -1 |
567 |
if shapetype == SHAPETYPE_POLYGON: |
if shapetype == SHAPETYPE_POLYGON: |
568 |
for i in range(layer.NumShapes()): |
for i in range(layer.NumShapes() - 1, -1, -1): |
569 |
result = point_in_polygon_shape(layer.shapefile.cobject(), |
result = point_in_polygon_shape(layer.shapefile.cobject(), |
570 |
i, |
i, |
571 |
filled, stroked, |
filled, stroked, |
576 |
select_shape = i |
select_shape = i |
577 |
break |
break |
578 |
elif shapetype == SHAPETYPE_ARC: |
elif shapetype == SHAPETYPE_ARC: |
579 |
for i in range(layer.NumShapes()): |
for i in range(layer.NumShapes() - 1, -1, -1): |
580 |
result = point_in_polygon_shape(layer.shapefile.cobject(), |
result = point_in_polygon_shape(layer.shapefile.cobject(), |
581 |
i, 0, 1, |
i, 0, 1, |
582 |
map_proj, layer_proj, |
map_proj, layer_proj, |
586 |
select_shape = i |
select_shape = i |
587 |
break |
break |
588 |
elif shapetype == SHAPETYPE_POINT: |
elif shapetype == SHAPETYPE_POINT: |
589 |
for i in range(layer.NumShapes()): |
for i in range(layer.NumShapes() - 1, -1, -1): |
590 |
shape = layer.Shape(i) |
shape = layer.Shape(i) |
591 |
x, y = shape.Points()[0] |
x, y = shape.Points()[0] |
592 |
if inverse: |
if inverse: |
604 |
return None, None |
return None, None |
605 |
|
|
606 |
def SelectShapeAt(self, x, y): |
def SelectShapeAt(self, x, y): |
607 |
layer, shape = self.find_shape_at(x, y) |
layer, shape = self.find_shape_at(x, y, selected_layer = 0) |
608 |
# If layer is None, then shape will also be None. We don't want |
# If layer is None, then shape will also be None. We don't want |
609 |
# to deselect the currently selected layer, so we simply select |
# to deselect the currently selected layer, so we simply select |
610 |
# the already selected layer again. |
# the already selected layer again. |