MStatus cgfxShaderCmd::undoIt() { #ifdef KH_DEBUG MString ss = " .. Undo "; ss += fArgString; ss += "\n"; ::OutputDebugString( ss.asChar() ); #endif MStatus stat; try { stat = undoCmd(); } catch ( cgfxShaderCommon::InternalError* e ) { reportInternalError( __FILE__, (size_t)e ); stat = MS::kFailure; } catch ( ... ) { reportInternalError( __FILE__, __LINE__ ); stat = MS::kFailure; } #ifdef KH_DEBUG ss = " .. undone\n"; ::OutputDebugString( ss.asChar() ); #endif return stat; } // MStatus cgfxShaderCmd::undoIt
cgfxShaderCmd::~cgfxShaderCmd() // // Description: // cgfxShaderCmd destructor // { try { #ifdef KH_DEBUG if ( !fIsQuery ) { MString ss = " .. ~cmd "; ss += fArgString; ss += "\n"; ::OutputDebugString( ss.asChar() ); } #endif fOldAttrDefList.clear(); fNewAttrDefList.clear(); delete fDagMod; } catch ( cgfxShaderCommon::InternalError* e ) { reportInternalError( __FILE__, (size_t)e ); } catch ( ... ) { reportInternalError( __FILE__, __LINE__ ); } }
void reportInternalError (const std::string& errorMsg, const char* file, unsigned int lineNumber) { std::ostringstream err; err << errorMsg << '\n' << "The internal error occured in file " << file << " on line " << lineNumber << '.'; reportInternalError(err.str()); }
MStatus cgfxShaderCmd::redoIt() { #ifdef KH_DEBUG MString ss = " .. Redo "; ss += fArgString; ss += "\n"; ::OutputDebugString( ss.asChar() ); #endif MStatus stat; try { // Get the node object from the selection list. MObject oNode; stat = fNodeSelection.getDependNode( 0, oNode ); M_CHECK( stat ); MFnDependencyNode fnNode( oNode, &stat ); M_CHECK( stat && fnNode.typeId() == cgfxShaderNode::sId ); cgfxShaderNode* pNode = (cgfxShaderNode*)fnNode.userNode(); M_CHECK( pNode ); // Re-create or re-edit the node. stat = redoCmd( oNode, fnNode, pNode ); } catch ( cgfxShaderCommon::InternalError* e ) { reportInternalError( __FILE__, (size_t)e ); stat = MS::kFailure; } catch ( ... ) { reportInternalError( __FILE__, __LINE__ ); stat = MS::kFailure; } #ifdef KH_DEBUG ss = " .. redone\n"; ::OutputDebugString( ss.asChar() ); #endif return stat; } // MStatus cgfxShaderCmd::redoIt
MStatus cgfxShaderCmd::doIt( const MArgList& args ) { MStatus stat; try { stat = doCmd( args ); } catch ( cgfxShaderCommon::InternalError* e ) { reportInternalError( __FILE__, (size_t)e ); stat = MS::kFailure; } catch ( ... ) { reportInternalError( __FILE__, __LINE__ ); stat = MS::kFailure; } return stat; } // MStatus cgfxShaderCmd::doIt