mpacts.core. baseobject

In order to be able to use this module import it like this:

import mpacts.core.baseobject
#or assign it to a shorter name
import mpacts.core.baseobject as bas

BaseObject

class mpacts.core.baseobject.BaseObject

Bases: Boost.Python.instance

The base type of all pyDEMeter objects, provides general common functionality

object __init__(tuple args, dict kwds) :
args: name, parent kwds:
BaseObject(name, parent, **kwargs)
add_after((BaseObject)self, (BaseObject)sibling) → None :
Add another BaseObject after this BaseObject. This requires that:
-The childs name is not empty. The parent does not have a child with the same name.

Throws InvalidAction<TreeNodeBase> if either of the above conditions is violated.

add_before((BaseObject)self, (BaseObject)sibling) → None :
Add another BaseObject before this BaseObject. This requires that:
-The childs name is not empty. The parent does not have a child with the same name.

Throws InvalidAction<TreeNodeBase> if either of the above conditions is violated.

add_child((BaseObject)self, (BaseObject)child) → BaseObject :
Add a new child node. This requires that:
-The childs name is not empty. -The parent does not have a child with the same name.

Throws InvalidAction<TreeNodeBase> if either of the above conditions is violated.

bo_get_state((BaseObject)arg1) → tuple :

C++ function that returns all the state it can find. Used for saving simulations and objects. Has no direct use.

bo_set_state((BaseObject)arg1, (tuple)arg2) → None :

C++ function that sets all the state it gets. Used for loading objects. Has no direct use.

cast_to_intermediate((BaseObject)self) → object :

Returns the same child but then casted to intermediate type. Can be used to obtain eg. ContactModelBases when a BaseObject is returned. Should not be necessary to be used in most use-cases.

check_required_properties((BaseObject)arg1) → None :

Verifies that all required properties are set. Is normally called automatically, and this function is mainly provided for support of python properties.

default_location((BaseObject)arg1) → str
exchange((BaseObject)self, (BaseObject)exchange_with_me) → BaseObject :

Exchanges the current object with ‘exchange_with_me’. This implies exchange_with_me, gets this objects name and all of its children. Finally exchange_with_me takes the (exact) place of this in the tree.

find((BaseObject)self, (str)python string) → object :

find a child node, contrary to using the operator () this function does not throw when the key does not exist but returns a None value.

find_in_subtree((BaseObject)self, (str)python string) → list :

get all child nodes with that name in sub-tree (recusively)

for_each_child((BaseObject)arg1, (object)arg2) → None
for_each_child_recursive((BaseObject)arg1, (object)arg2) → None
get((BaseObject)arg1, (str)arg2) → object
get_type_information((BaseObject)arg1) → str :

returns a string with the most derived type name of the underlying C++ structure

get_value((BaseObject)arg1) → object
identify((BaseObject)arg1) → str :

Returns the memory location of ‘this’ as a string.

list_children((BaseObject)arg1) → list
name((BaseObject)self) → str :

Returns the name of the object, unique within its node

parent_node((BaseObject)arg1) → object
path((BaseObject)arg1, (BaseObject)self) → str :

Returns the full path of the node with respect to its root.

print_tree()
object print_tree(tuple args, dict kwds) :
kwds: detail
remove_child((BaseObject)arg1, (BaseObject)arg2) → BaseObject
rename((BaseObject)self, (str)python string) → None :

Changes the name of the object, checking that it stays unique within its parent node

root_node((BaseObject)arg1) → BaseObject
set()
object set(tuple args, dict kwds) :
For valid keywords that can be set, see the class documentation
set_value((BaseObject)arg1, (object)arg2) → None
set_with_dict((BaseObject)self, (dict)python dict) → None :

Initialize its childeren (properties, arrays, ...) with the given python dictionary