Mercurial > MadButterfly
comparison pyink/MBScene.py @ 1203:b90a1e2eb9ec
Add document for methods
author | Thinker K.F. Li <thinker@codemud.net> |
---|---|
date | Mon, 03 Jan 2011 14:18:03 +0800 |
parents | 2f3d523a3871 |
children | 78925515836f |
comparison
equal
deleted
inserted
replaced
1202:2f3d523a3871 | 1203:b90a1e2eb9ec |
---|---|
247 self._group2scene[new_value] = node | 247 self._group2scene[new_value] = node |
248 pass | 248 pass |
249 return | 249 return |
250 pass | 250 pass |
251 | 251 |
252 ## \brief Collect ID of nodes in the document. | |
253 # | |
254 # It is used to implement a fast mapping from an ID to the respective node. | |
255 # | |
252 def _collect_node_ids(self): | 256 def _collect_node_ids(self): |
253 self._id2node = {} | 257 self._id2node = {} |
254 root = self._root | 258 root = self._root |
255 for n in root.childList(): | 259 for n in root.childList(): |
256 self._collect_node_ids_recursive(n) | 260 self._collect_node_ids_recursive(n) |
267 for n in node.childList(): | 271 for n in node.childList(): |
268 self._collect_node_ids_recursive(n) | 272 self._collect_node_ids_recursive(n) |
269 pass | 273 pass |
270 pass | 274 pass |
271 | 275 |
276 ## \brief Return the node with given ID. | |
277 # | |
272 def get_node(self, node_id): | 278 def get_node(self, node_id): |
273 return self._id2node[node_id] | 279 return self._id2node[node_id] |
274 | 280 |
281 ## \brief Return a scene node corresponding to a scene group of given ID. | |
282 # | |
275 def get_scene(self, group_id): | 283 def get_scene(self, group_id): |
276 return self._group2scene[group_id] | 284 return self._group2scene[group_id] |
277 | 285 |
278 def new_id(self): | 286 def new_id(self): |
279 while True: | 287 while True: |