#ifndef _cgfxShaderCmd_h_
#define _cgfxShaderCmd_h_
#include "cgfxShaderCommon.h"
#include <maya/MPxCommand.h>
#include <maya/MSyntax.h>
#include <maya/MArgList.h>
#include <maya/MSelectionList.h>
#include <maya/MString.h>
#include <maya/MStringArray.h>
#include <maya/MDGModifier.h>
#include "cgfxRCPtr.h"
#include "cgfxAttrDef.h"
#include "cgfxEffectDef.h"
#include "cgfxShaderNode.h"
#include <Cg/cg.h>
#include <Cg/cgGL.h>
class MArgList;
class cgfxShaderCmd : public MPxCommand
{
public:
cgfxShaderCmd();
virtual ~cgfxShaderCmd();
MStatus doIt( const MArgList& );
MStatus redoIt();
MStatus undoIt();
bool isUndoable() const;
static MSyntax newSyntax();
static void* creator();
static MString sPluginPath;
private:
MStatus doCmd( const MArgList& );
MStatus redoCmd(
MObject& oNode,
MFnDependencyNode& fnNode,
cgfxShaderNode* pNode );
MStatus undoCmd();
MStatus parseArgs(const MArgList& args,
MSelectionList& selList);
void getNodesToUpdate(const cgfxRCPtr<const cgfxEffect>& effect, cgfxShaderNode* currNode, cgfxShaderNode::NodeList& nodes) const;
MString fArgString;
bool fIsEdit;
bool fIsQuery;
bool fFxFile;
bool fFxPath;
bool fTechnique;
bool fProfile;
bool fMaxTexCoords;
bool fPluginPath;
bool fEmptyUV;
bool fEmptyUVShapes;
bool fListParameters;
bool fListTechniques;
bool fListProfiles;
bool fTexCoordSource;
#if MAYA_API_VERSION >= 700
bool fColorSource;
#endif
bool fCaseInsensitive;
bool fDescription;
MString fParameterName;
typedef std::map<cgfxShaderNode*, MStringArray > NodeAttributeList;
typedef std::map<cgfxShaderNode*, cgfxRCPtr<cgfxAttrDefList> > NodeAttrDefList;
MString fOldFxFile;
MString fOldTechnique;
MString fOldProfile;
NodeAttributeList fOldAttributeList;
cgfxRCPtr<const cgfxEffect> fOldEffect;
NodeAttrDefList fOldAttrDefList;
MSelectionList fOldSelection;
MString fNewFxFile;
MString fNewTechnique;
MString fNewProfile;
NodeAttributeList fNewAttributeList;
cgfxRCPtr<const cgfxEffect> fNewEffect;
NodeAttrDefList fNewAttrDefList;
MSelectionList fNodeSelection;
MString fNodeName;
MDGModifier* fDagMod;
void reportInternalError( const char* function, size_t errcode );
};
#endif