Package pyffi :: Package formats :: Package nif :: Class NifFormat :: Class NiObject
[hide private]
[frames] | no frames]

Class NiObject

source code

                  object --+                
                           |                
      utils.graph.DetailNode --+            
                               |            
          utils.graph.GlobalNode --+        
                                   |        
object_models.xml.struct_.StructBase --+    
                                       |    
                     NifFormat._NiObject --+
                                           |
                                          NifFormat.NiObject
Known Subclasses:

Nested Classes [hide private]

Inherited from object_models.xml.struct_.StructBase: __metaclass__

Instance Methods [hide private]
 
find(self, block_name=None, block_type=None) source code
 
find_chain(self, block, block_type=None)
Finds a chain of blocks going from C{self} to C{block}.
source code
 
apply_scale(self, scale)
Scale data in this block.
source code
 
tree(self, block_type=None, follow_all=True, unique=False)
A generator for parsing all blocks in the tree (starting from and including C{self}).
source code
 
_validateTree(self)
Raises ValueError if there is a cycle in the tree.
source code
 
is_interchangeable(self, other)
Are the two blocks interchangeable?
source code

Inherited from object_models.xml.struct_.StructBase: __init__, __str__, deepcopy, fix_links, get_attribute, get_basic_attribute, get_detail_child_names, get_detail_child_nodes, get_global_child_nodes, get_global_display, get_hash, get_links, get_refs, get_size, get_strings, get_template_attribute, read, replace_global_node, set_attribute, set_basic_attribute, set_template_attribute, write

Inherited from utils.graph.GlobalNode: get_global_child_edge_types, get_global_iterator

Inherited from utils.graph.DetailNode: get_detail_child_edge_types, get_detail_display, get_detail_iterator

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __subclasshook__

Class Methods [hide private]

Inherited from object_models.xml.struct_.StructBase: get_games, get_versions

Class Variables [hide private]

Inherited from object_models.xml.struct_.StructBase: arg

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

find_chain(self, block, block_type=None)

source code 
Finds a chain of blocks going from C{self} to C{block}. If found, self is the first element and block is the last element. If no branch found, returns an empty list. Does not check whether there is more than one branch; if so, the first one found is returned.
Parameters:
  • block - The block to find a chain to.
  • block_type - The type that blocks should have in this chain.

apply_scale(self, scale)

source code 
Scale data in this block. This implementation does nothing. Override this method if it contains geometry data that can be scaled.

tree(self, block_type=None, follow_all=True, unique=False)

source code 
A generator for parsing all blocks in the tree (starting from and including C{self}).
Parameters:
  • block_type - If not None, yield only blocks of the type C{block_type}.
  • follow_all - If C{block_type} is not None, then if this is True the function will parse the whole tree. Otherwise, the function will not follow branches that start by a non-C{block_type} block.
  • unique - Whether the generator can return the same block twice or not.
Overrides: object_models.xml.struct_.StructBase.tree

is_interchangeable(self, other)

source code 

Are the two blocks interchangeable?

@todo: Rely on AnyType, SimpleType, ComplexType, etc. implementation.