cmdmode.h

Go to the documentation of this file.
00001 //
00002 // Copyright 2010 Autodesk, Inc.  All rights reserved.
00003 //
00004 // Use of this software is subject to the terms of the Autodesk license
00005 // agreement provided at the time of installation or download, or which
00006 // otherwise accompanies this software in either electronic or hard copy form.  
00007 //
00008 //
00009 
00010 #pragma once
00011 #include "maxheap.h"
00012 #include <WTypes.h>
00013 
00014 // This file can be included in plug-in modules so
00015 // it shouldn't reference/include private classes or functions.
00016 class MouseCallBack;
00017 class ChangeForegroundCallback;
00018 class HitByNameDlgCallback;
00019 class PickModeCallback;
00020 class PickNodeCallback;
00021 
00029 class CommandMode: public MaxHeapOperators {
00030     public:
00032         virtual ~CommandMode() {} 
00038         virtual int Class()=0;
00039 
00041         virtual int SuperClass() { return 0; }
00042 
00060         virtual int ID()=0;
00061 
00072         virtual MouseCallBack *MouseProc(int *numPoints)=0;
00073 
00091         virtual ChangeForegroundCallback *ChangeFGProc()=0;
00092 
00108         virtual BOOL ChangeFG( CommandMode* oldMode )=0;
00122         virtual void EnterMode()=0;
00123 
00131         virtual void ExitMode()=0;      
00132     };
00133 
00138 class XFormModes: public MaxHeapOperators {
00139     public:
00140         CommandMode *move;      
00141         CommandMode *rotate;    
00142         CommandMode *scale;     
00143         CommandMode *uscale;    
00144         CommandMode *squash;    
00145         CommandMode *select;    
00146 
00148         XFormModes( 
00149             CommandMode *move_,
00150             CommandMode *rotate_,
00151             CommandMode *scale_,
00152             CommandMode *uscale_,
00153             CommandMode *squash_,
00154             CommandMode *select_ )
00155             {
00156             this->move   = move_;
00157             this->rotate = rotate_;
00158             this->scale  = scale_;
00159             this->uscale = uscale_;
00160             this->squash = squash_;
00161             this->select = select_;
00162             }
00164         XFormModes() { move = rotate = scale = uscale = squash = select = NULL; } 
00165     };
00166 
00167 
00168 // These can be returned from ChangeFGProc() instead of an actual FG proc
00169 // to use predefined FG sets.
00170 #define CHANGE_FG_SELECTED      ((ChangeForegroundCallback *)1) //!< Selected nodes are flagged.
00171 #define CHANGE_FG_ANIMATED      ((ChangeForegroundCallback *)2) //!< Nodes that are animated are flagged. 
00172 
00174 
00175 #define TRANSFORM_CMD_SUPER     1
00176 
00177 
00179 
00180 #define VIEWPORT_COMMAND        1
00181 #define MOVE_COMMAND                2
00182 #define ROTATE_COMMAND          3
00183 #define SCALE_COMMAND               4
00184 #define USCALE_COMMAND          5
00185 #define SQUASH_COMMAND          6
00186 #define SELECT_COMMAND          7
00187 #define HIERARCHY_COMMAND       8
00188 #define CREATE_COMMAND          9
00189 #define MODIFY_COMMAND          10
00190 #define MOTION_COMMAND          11
00191 #define ANIMATION_COMMAND       12
00192 #define CAMERA_COMMAND          13
00193 #define NULL_COMMAND                14
00194 #define DISPLAY_COMMAND         15
00195 #define SPOTLIGHT_COMMAND       16
00196 #define PICK_COMMAND                17
00197 #define MANIPULATE_COMMAND  18
00198 #define PICK_EX_COMMAND         19 //!< Extended Pick Command Mode
00199 
00200 
00202 
00203 #define CID_USER                0x0000ffff
00204 
00205 
00206 
00211 
00212 
00213 #define CID_OBJMOVE             1       //!< Max Transform Move Modes
00214 #define CID_OBJROTATE           2       //!< Max Transform Rotate Modes
00215 #define CID_OBJSCALE            3       //!< Max Transform Scale Modes
00216 #define CID_OBJUSCALE           4       //!< Max Transform Uniform Scale Modes
00217 #define CID_OBJSQUASH           5       //!< Max Transform Squash Modes
00218 #define CID_OBJSELECT           6       //!< Max Transform Select Modes
00219 
00220 
00221 
00222 
00227 #define CID_SUBOBJMOVE          7       //!< \internal This is not to be used externally
00228 #define CID_SUBOBJROTATE        8       //!< \internal This is not to be used externally
00229 #define CID_SUBOBJSCALE         9       //!< \internal This is not to be used externally
00230 #define CID_SUBOBJUSCALE        10      //!< \internal This is not to be used externally
00231 #define CID_SUBOBJSQUASH        11      //!< \internal This is not to be used externally
00232 #define CID_SUBOBJSELECT        12      //!< \internal This is not to be used externally
00233 
00234 
00238 #define CID_UNFREEZE            13      //!< \internal This is not to be used externally
00239 #define CID_UNHIDE              14      //!< \internal This is not to be used externally
00240 
00241 
00243 
00244 #define CID_LINK                100
00245 #define CID_BINDWSM             110     // I guess this is a heirarchy command... sort of
00246 
00247 
00249 
00250 #define CID_ZOOMVIEW            200
00251 #define CID_ZOOMREGION          201
00252 #define CID_PANVIEW             202
00253 #define CID_ROTATEVIEW          203
00254 #define CID_ZOOMALL             204
00255 #define CID_RNDREGION           205
00256 
00257 
00259 
00260 #define CID_CAMFOV              210
00261 #define CID_CAMDOLLY            211
00262 #define CID_CAMPERSP            212
00263 #define CID_CAMTRUCK            213
00264 #define CID_CAMROTATE           214
00265 #define CID_CAMROLL             215
00266 
00267 
00268 #define CID_PLAYANIMATION       300 //!< Animation Command
00269 
00270 
00272 
00273 #define CID_SIMPLECREATE        400 //!< Create Command
00274 
00275 #define CID_MODIFYPARAM         500 //!< Modify Command
00276 
00279 #define CID_EDITSOFTSELECTION   525
00280 
00281 #define CID_NULL                600 //!< Motion Command
00282 
00284 
00285 #define CID_STDPICK             710
00286 #define CID_PICKAXISOBJECT      700
00287 
00288 
00290 
00291 #define CID_GRP_ATTACH          800
00292 #define CID_ASSEMBLY_ATTACH 810
00293 
00294 
00295 #define CID_MANIPULATE          900 //!< Manipulate Command Mode
00296 
00301 #define CID_FREE_AXIS_ROTATE    -INT_MAX
00302 #define CID_SCREEN_SPACE_ROTATE -INT_MAX+1
00303 
00304 
00305 
00309 class PickCommandMode : public CommandMode
00310 {
00311     public:
00312         virtual ~PickCommandMode() { };
00313         virtual int Class() { return PICK_EX_COMMAND; }
00314         virtual HitByNameDlgCallback* GetHitByNameDlgCallback() = 0;
00315         virtual PickModeCallback* GetPickModeCallback() = 0;
00316         virtual PickNodeCallback* GetPickNodeCallback() = 0;
00317 };
00318 
00319