macrorec.h

Go to the documentation of this file.
00001 //
00002 // Copyright 2010 Autodesk, Inc.  All rights reserved. 
00003 //
00004 // This computer source code and related instructions and comments are the
00005 // unpublished confidential and proprietary information of Autodesk, Inc. and
00006 // are protected under applicable copyright and trade secret law.  They may
00007 // not be disclosed to, copied or used by any third party without the prior
00008 // written consent of Autodesk, Inc.
00009 
00010 #pragma once
00011 #include "maxheap.h"
00012 #include "baseinterface.h"
00013 #include "maxapi.h"
00014 #include "GetCOREInterface.h"
00015 #include "matrix3.h"
00016 #include "maxscript/ScripterExport.h"
00017 
00018 // forward declarations
00019 class ClassDesc;
00020 class INode;
00021 class ParamBlock;
00022 class IParamBlock2;
00023 class ReferenceTarget;
00024 class Mtl;
00025 class Interface;
00026 class ParamBlock2;
00027 
00028 
00052 class MacroRecorder : public BaseInterfaceServer
00053 {
00054 public:
00055     class MacroRecorderDisable;
00056 
00077     virtual BOOL BeginCreate(ClassDesc* cd, int flags = 0) = 0;
00078 
00080     virtual void SetNodeTM(INode* n, Matrix3 m) = 0;
00081 
00083     virtual void ParamBlockSetValue(ParamBlock* pb, int i, BYTE type, ...) = 0;
00084 
00086     virtual void ParamBlock2SetValue(IParamBlock2* pb, int i, int tabIndex, BYTE type, ...) = 0;
00087 
00089     virtual void ParamBlock2SetCount(IParamBlock2* pb, int i, int n) = 0;
00090 
00100     virtual void SetProperty(ReferenceTarget* targ, MCHAR* prop_name, BYTE type, ...) = 0;
00119     virtual void SetCopy(ReferenceTarget* to_copy) = 0;
00120     
00132     virtual void SetSelProperty(MCHAR* prop_name, BYTE type, ...) = 0;
00133     
00158     virtual void FunctionCall(MCHAR* op_name, int arg_count, int keyarg_count, ...) = 0;
00159     
00169     virtual void ScriptString(MCHAR* s) = 0;
00170     
00178     virtual void Assign(MCHAR* var_name, BYTE type, ...) = 0;
00179     
00180     virtual void Assign(BYTE type, ...) = 0;
00181     
00182     virtual void OpAssign(MCHAR* op, BYTE type, ...) = 0;
00183     
00184     virtual void OperandSequence(int count, BYTE type, ...) = 0;
00185     
00187     virtual BOOL BeginSelectNode() = 0;
00188     
00190     virtual void Select(INode*) = 0;
00191     
00193     virtual void DeSelect(INode*) = 0;
00194     
00196     virtual void MAXCommand(int com) = 0;
00197     
00198     virtual void AddComment(MCHAR* str) = 0;
00199     
00205     virtual void Cancel() = 0;
00206     
00215     virtual void EmitScript() = 0;
00216     
00221     virtual MSTR GetSubMtlPropName(Mtl* m, int i) = 0;
00222     
00228     virtual MSTR GetSubTexmapPropName(ReferenceTarget* m, int i) = 0;
00229     
00233     virtual void Enable() = 0;
00234     
00237     virtual void Disable() = 0;
00238     
00241     virtual BOOL Enabled() = 0;
00242     
00248     virtual BOOL MasterEnable() = 0;
00249     
00254     virtual void MasterEnable(BOOL onOff) = 0;
00255     
00258     virtual BOOL ShowCommandPanelSwitch() = 0;
00259     
00263     virtual void ShowCommandPanelSwitch(BOOL onOff) = 0;
00264     
00267     virtual BOOL ShowToolSelections() = 0;
00268     
00272     virtual void ShowToolSelections(BOOL onOff) = 0;
00273     
00276     virtual BOOL ShowMenuSelections() = 0;
00277     
00281     virtual void ShowMenuSelections(BOOL onOff) = 0;
00282     
00285     virtual BOOL EmitAbsoluteSceneNames() = 0;
00286     
00290     virtual void EmitAbsoluteSceneNames(BOOL onOff) = 0;
00291     
00294     virtual BOOL EmitAbsoluteSubObjects() = 0;
00295     
00300     virtual void EmitAbsoluteSubObjects(BOOL onOff) = 0;
00301     
00306     virtual BOOL EmitAbsoluteTransforms() = 0;
00307     
00311     virtual void EmitAbsoluteTransforms(BOOL onOff) = 0;
00312 };
00313    
00314 #if defined(BLD_CORE) || defined(BLD_PARAMBLK2)
00315     extern MacroRecorder *macroRecorder;
00316 #else
00317     extern ScripterExport MacroRecorder *macroRecorder;
00318 #endif
00319 
00322 extern ScripterExport void InitMacroRecorder();
00323 
00325 enum {  mr_int,             
00326         mr_float,           
00327         mr_string,          
00328         mr_bool,            
00329         mr_point3,          
00330         mr_color,           
00331         mr_angaxis,         
00332         mr_quat,            
00333         mr_time,            
00334         mr_reftarg,         
00335         mr_bitarray,        
00336         mr_pbbitmap,        
00337         mr_matrix3,         
00338         mr_nurbssel,         
00339         mr_meshselbits,      
00340         mr_meshsel, 
00341         mr_subanim, 
00342         mr_animatable,
00343         mr_classid, 
00344         mr_nurbsselbits, 
00345         mr_point4, 
00346         mr_acolor,
00347         mr_sel,             
00348         mr_funcall,         
00349         mr_varname,         
00350         mr_create,          
00351         mr_angle,           
00352         mr_percent, 
00353         mr_index, 
00354         mr_prop,
00355         mr_name, 
00356         mr_dimfloat,        
00357         mr_dimpoint3,       
00358         mr_point2, 
00359     };
00360 
00362 #define macroRec GetCOREInterface()->GetMacroRecorder()
00363 
00369 class MacroRecorder::MacroRecorderDisable : public MaxHeapOperators {
00370 public:
00372     MacroRecorderDisable() {
00373         MacroRecorder* recorder = GetCOREInterface()->GetMacroRecorder();
00374         if(recorder != NULL)
00375             recorder->Disable();
00376     }
00377 
00379     ~MacroRecorderDisable() {
00380         MacroRecorder* recorder = GetCOREInterface()->GetMacroRecorder();
00381         if(recorder != NULL)
00382             recorder->Enable();
00383     }
00384 };
00385