hwUnlitShader/NodeMonitor.h
#ifndef __NodeMonitor_h__
#define __NodeMonitor_h__
#include <maya/MFnDagNode.h>
#include <maya/MFnDependencyNode.h>
#include <maya/MString.h>
#include <maya/MNodeMessage.h>
#include <maya/MObject.h>
#include <maya/MSelectionList.h>
#include <maya/MStatus.h>
class NodeMonitorManager
{
public:
};
class NodeMonitor
{
public:
NodeMonitor(NodeMonitorManager* manager = NULL);
~NodeMonitor();
void stopWatching();
bool dirty();
void cleanIt();
void setManager(NodeMonitorManager* manager) { fManager = manager; }
private:
bool attachCallbacks();
void detachCallbacks();
void callbackOccured();
static void watchedObjectDirtyCallback(void* clientData);
static void watchedObjectRenamedCallback(
MObject & node,
void* clientData);
private:
bool fIsDirty;
MCallbackId fRenamedCallbackId;
MCallbackId fDirtyCallbackId;
NodeMonitorManager* fManager;
};
#endif // MAYA_ShadingConnection