Package mbdyn :: Package bindings :: Module groups :: Class ItemGroup
[hide private]

Class ItemGroup

source code

object --+    
         |    
      list --+
             |
            ItemGroup
Known Subclasses:
NodeGroup, ElementGroup

An element or node group used by MBDyn. It will contains for sure the pointers to the C++ Elem or Node instances that comes from the MBDyn DataManager. Those instances are however a very low interest for the scripting language interface, the user can just get the MBDyn label from it, see <mbdyn.bindings.basic_objects>.

To get down of the MBDyn polymorphism, the SWIG module (or swigModule in Python) provides a conversion function, that corresponds to a dynamic cast in C++. At that step the function exists because provided by Groups, the groups manager.

Instance Methods [hide private]
 
__init__(self, item_key, mbdyn_key, idx, nb_items)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
add_item(self, item)
Add an item to the list and keep track of its label
source code
 
get_from_label(self, label)
Return an item from its label
source code
 
common_conversion(self, convert_to_group_class)
Convert the pointers to the Elem class of MBDyn to the class of the group.
source code
 
clean_and_copy(self)
Clean the list, defined by self, and return a copy of it
source code
 
convert(self, convert_to_group_class)
Will execute a common conversion.
source code

Inherited from list: __add__, __contains__, __delitem__, __delslice__, __eq__, __ge__, __getattribute__, __getitem__, __getslice__, __gt__, __hash__, __iadd__, __imul__, __iter__, __le__, __len__, __lt__, __mul__, __ne__, __new__, __repr__, __reversed__, __rmul__, __setitem__, __setslice__, append, count, extend, index, insert, pop, remove, reverse, sort

Inherited from object: __delattr__, __reduce__, __reduce_ex__, __setattr__, __str__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, item_key, mbdyn_key, idx, nb_items)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Returns:
new list

Overrides: list.__init__
(inherited documentation)

common_conversion(self, convert_to_group_class)

source code 
Convert the pointers to the Elem class of MBDyn to the class of the group. Getting down of the MBDyn polymorphism and in the same time add a layer between the c_inst. For example, the pointer Elem, pointing to an Elem instance is converted to the pointer Force, pointing to a Force instance by a dynamic cast

convert(self, convert_to_group_class)

source code 
Will execute a common conversion. However this method is supposed to be overridden by every specific group.