147 |
# tries to set its parent layer the variable will exist |
# tries to set its parent layer the variable will exist |
148 |
# |
# |
149 |
self.__classification = None |
self.__classification = None |
150 |
|
self.__setClassLock = False |
151 |
|
|
152 |
|
|
153 |
self.SetClassification(None) |
self.SetClassification(None) |
191 |
self.shapefile.close() |
self.shapefile.close() |
192 |
self.shapefile = None |
self.shapefile = None |
193 |
self.shapetree = None |
self.shapetree = None |
194 |
|
self.SetClassification(None) |
195 |
self.table.Destroy() |
self.table.Destroy() |
196 |
|
|
197 |
def BoundingBox(self): |
def BoundingBox(self): |
278 |
If 'clazz' is None a default classification is created |
If 'clazz' is None a default classification is created |
279 |
""" |
""" |
280 |
|
|
281 |
|
# prevent infinite recursion when calling SetLayer() |
282 |
|
if self.__setClassLock: return |
283 |
|
|
284 |
|
self.__setClassLock = True |
285 |
|
|
286 |
if clazz is None: |
if clazz is None: |
287 |
|
if self.__classification is not None: |
288 |
|
self.__classification.SetLayer(None) |
289 |
self.__classification = classification.Classification() |
self.__classification = classification.Classification() |
290 |
else: |
else: |
|
|
|
|
# prevent infinite recursion when calling SetLayer() |
|
|
if clazz == self.__classification: |
|
|
return |
|
|
|
|
291 |
self.__classification = clazz |
self.__classification = clazz |
292 |
self.__classification.SetLayer(self) |
try: |
293 |
|
self.__classification.SetLayer(self) |
294 |
|
except ValueError: |
295 |
|
self.__setClassLock = False |
296 |
|
raise ValueError |
297 |
|
|
298 |
self.changed(LAYER_LEGEND_CHANGED, self) |
self.changed(LAYER_LEGEND_CHANGED, self) |
299 |
|
|
300 |
|
self.__setClassLock = False |
301 |
|
|
302 |
def ClassChanged(self): |
def ClassChanged(self): |
303 |
"""Called from the classification object when it has changed.""" |
"""Called from the classification object when it has changed.""" |
304 |
self.changed(LAYER_LEGEND_CHANGED, self) |
self.changed(LAYER_LEGEND_CHANGED, self) |