added read_local_features

develop
doomchild 2011-03-14 15:01:09 -05:00
parent e126f21e4b
commit fda4ad94cd
1 changed files with 19 additions and 1 deletions

@ -239,6 +239,24 @@ class Maps(object):
veg = [i for i in dftypes.pointer_dict[veg_ptr][1]] veg = [i for i in dftypes.pointer_dict[veg_ptr][1]]
del dftypes.pointer_dict[veg_ptr] del dftypes.pointer_dict[veg_ptr]
def read_local_features(self):
f = libdfhack.Maps_ReadLocalFeatures(self._map_ptr)
feature_dict = {}
f_arr = None
if f in dftypes.pointer_dict:
f_arr = dftypes.pointer_dict[f][1]
del dftypes.pointer_dict[f]
if f_arr is not None:
for node in f_arr:
c = node.coordinate.xyz
coord = MapPoint(c.x, c.y, c.z)
f_list = [node.features[i] for i in xrange(node.feature_length)]
feature_dict[coord] = f_list
return feature_dict
@property @property
def size(self): def size(self):
x = c_uint() x = c_uint()