Package mrv :: Module dgfe :: Class OIFacadePlug
[hide private]
[frames] | no frames]

Class OIFacadePlug

source code

object --+    
         |    
     tuple --+
             |
object --+   |
         |   |
 dge.iPlug --+
             |
            OIFacadePlug

Facade Plugs are meant to be stored on instance level overriding the respective class level plug descriptor. If used directly, it will facade the internal affects relationships and just return what really is affected on the facade node

Additionally they are associated to a node instance, and can thus be used to find the original node once the plug is used in an OI facacde shell

Its a tuple as it will be more memory efficient that way. Additionally one automatically has a proper hash and comparison if the same objects come together

Instance Methods [hide private]
 
_affectedList(self, direction)
Get affected shells into the given direction
source code

Inherited from tuple: __add__, __contains__, __eq__, __ge__, __getattribute__, __getitem__, __getnewargs__, __getslice__, __gt__, __hash__, __iter__, __le__, __len__, __lt__, __mul__, __ne__, __repr__, __rmul__, __sizeof__, count, index

Inherited from object: __delattr__, __format__, __init__, __reduce__, __reduce_ex__, __setattr__, __subclasshook__

    Object Overridden Methods
 
__getattr__(self, attr)
Allow easy attribute access inode: the internal node iplug: the internal plug
source code
    Base Implementation

Inherited from dge.iPlug: __str__

    Interface
 
name(self)
Get name of facade plug
source code
 
affects(self, otherplug)
Affects relationships will be set on the original plug only
source code
 
affected(self)
Walk the internal affects using an internal plugshell
source code
 
affectedBy(self)
Walk the graph upwards and return all input plugs that are being facaded :return: tuple containing plugs that affect us ( plugs affecting our value )
source code
 
providesOutput(self)
Returns: True if this is an output plug that can trigger computations
source code
 
providesInput(self)
Returns: True if this is an input plug that will never cause computations
source code
Static Methods [hide private]
    Object Overridden Methods
a new object with type S, a subtype of T
__new__(cls, *args)
Store only weakrefs, throw if we do not get 3 inputs
source code
Class Variables [hide private]
  _fp_prefix = '_FP_'

Inherited from dge.iPlug: kGood, kNo, kPerfect

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__new__(cls, *args)
Static Method

source code 
Store only weakrefs, throw if we do not get 3 inputs
Parameters:
  • args -
    • arg[0] = internal node
    • arg[1] = internal plug
Returns: a new object with type S, a subtype of T
Overrides: object.__new__

__getattr__(self, attr)
(Qualification operator)

source code 

Allow easy attribute access inode: the internal node iplug: the internal plug

Thus we must:
  • Act as IOFacade returning additional information
  • Act as original plug for attribute access

This will work as long as the method names are unique

name(self)

source code 
Get name of facade plug
Returns:
name of (internal) plug - must be a unique key, unique enough to allow connections to several nodes of the same type
Overrides: dge.iPlug.name

_affectedList(self, direction)

source code 
Get affected shells into the given direction
Returns:
list of all oiplugs looking in direction, if plugtestfunc says: False, do not prune the given shell

affects(self, otherplug)

source code 
Affects relationships will be set on the original plug only
Overrides: dge.iPlug.affects

affected(self)

source code 
Walk the internal affects using an internal plugshell
Returns:
tuple containing affected plugs ( plugs that are affected by our value )
Overrides: dge.iPlug.affected

Note: only output plugs can be affected - this is a rule followed throughout the system

affectedBy(self)

source code 
Walk the graph upwards and return all input plugs that are being facaded :return: tuple containing plugs that affect us ( plugs affecting our value )
Returns:
tuple containing plugs that affect us ( plugs affecting our value )
Overrides: dge.iPlug.affectedBy

providesOutput(self)

source code 
Returns:
True if this is an output plug that can trigger computations
Overrides: dge.iPlug.providesOutput

providesInput(self)

source code 
Returns:
True if this is an input plug that will never cause computations
Overrides: dge.iPlug.providesInput