This class allows clients to be notified whenever any ModelImport's state has changed.
To use the ImportStateChangedListener class:
from NodeListeners import ImportStateChangedListener
class your-client-class:
def __init__( self, etc. ): ImportStateChangedListener.instance().register( self ) etc.
def onStateChanged( self, modelImport ): process-the-import-node-based-on-state
The client's onStateChanged() method is provided with the ModelImport whose state has changed.
Implementation note: We store a list of weak references to the clients; if we stored strong references, then this class could end up being the only reference to the client, preventing it from being finalized.
#include
<class_node_listeners_1_1_import_state_changed_listener.h>
Public Member Functions |
|
__init__ () | |
instance () | |
Returns a reference to the singleton
instance. |
|
destruct () | |
Destroys the singleton instance. |
|
register () | |
Registers a client that will receive a
callback whenever any awScene node is deleted. |
|
deregister () | |
Deregisters a client that no longer wants to
receive callbacks. |
|
onStateChanged () | |
An ModelImport's state has changed - inform
all clients. |
NodeListeners.ImportStateChangedListener.__init__ | ( | ) |
NodeListeners.ImportStateChangedListener.instance | ( | ) |
Returns a reference to the singleton instance.
NodeListeners.ImportStateChangedListener.destruct | ( | ) |
Destroys the singleton instance.
NodeListeners.ImportStateChangedListener.register | ( | ) |
Registers a client that will receive a callback whenever any awScene node is deleted.
NodeListeners.ImportStateChangedListener.deregister | ( | ) |
Deregisters a client that no longer wants to receive callbacks.
NodeListeners.ImportStateChangedListener.onStateChanged | ( | ) |
An ModelImport's state has changed - inform all clients.