00001 /* 00002 * PROPRIETARY INFORMATION. This software is proprietary to 00003 * Side Effects Software Inc., and is not to be reproduced, 00004 * transmitted, or disclosed in any way without written permission. 00005 * 00006 * Produced by: 00007 * Side Effects Software Inc 00008 * 123 Front Street West 00009 * Toronto, Ontario 00010 * Canada M5V 3E7 00011 * 416-504-9876 00012 * 00013 * NAME: MSS_KnifeState.h 00014 * 00015 * COMMENTS: 00016 * Knifes selected polygons using a plane that is 00017 * specified by the user. 00018 */ 00019 00020 #ifndef __MSS_KnifeState_H__ 00021 #define __MSS_KnifeState_H__ 00022 00023 #include "MSS_API.h" 00024 #include <UT/UT_Vector3.h> 00025 #include <UT/UT_Vector3Array.h> 00026 #include <UI/UI_Value.h> 00027 #include "MSS_SingleOpBaseState.h" 00028 00029 00030 class BM_View; 00031 class GU_Detail; 00032 class JEDI_View; 00033 class mss_UndoValues; 00034 00035 class MSS_API MSS_KnifeState : public MSS_SingleOpBaseState 00036 { 00037 friend class mss_UndoValues; 00038 00039 public: 00040 00041 // Class constructor and destructor. 00042 MSS_KnifeState(JEDI_View &view, PI_StateTemplate &templ, 00043 BM_SceneManager *scene); 00044 virtual ~MSS_KnifeState(); 00045 00046 // This constructor and parameter template list go into the 00047 // PI_StateTemplate for this state. 00048 static BM_State *ourConstructor(BM_View &view, 00049 PI_StateTemplate &templ, 00050 BM_SceneManager *scene); 00051 00052 static PRM_Template ourTemplateList[]; 00053 00054 // The name and type of this class: 00055 virtual const char *className() const; 00056 00057 // Mouse events are passed on to all visible PI's. 00058 virtual int handleMouseEvent(UI_Event *event); 00059 00060 int handlePickEvent(UI_Event *event); 00061 00062 virtual int handleKeyTypeEvent(UI_Event *event, 00063 BM_Viewport &/*viewport*/); 00064 00065 virtual int getToolboxCount() const; 00066 00067 protected: 00068 00069 // Enter or exit this state. 00070 // enter() returns 0 if entered and -1 if not. 00071 virtual int enter(BM_SimpleState::BM_EntryType how); 00072 virtual void exit(void); 00073 00074 // Interrupt this state or resume its activity. 00075 virtual void interrupt(BM_SimpleState * = 0); 00076 virtual void resume(BM_SimpleState * = 0); 00077 00078 // Remove the selected orientation and prompt for a new direction vector 00079 virtual void restart(void); 00080 00081 // Methods to undo and redo the build flags and the handle links. 00082 void undoBuild(); 00083 void redoBuild(); 00084 00085 // Set-up state for the first time 00086 virtual void doGenerate(); 00087 00088 // Show current mouse position and line path 00089 virtual void doRender(RE_Render *r, short x, short y, int ghost); 00090 00091 private: 00092 00093 // Sets the values in the clip sop to orient it in 00094 // the specified direction 00095 void setDirection(); 00096 00097 private: 00098 00099 // Start and End point that define the normal Vector for the Knife 00100 UT_Vector3 myStartPoint; 00101 UT_Vector3 myEndPoint; 00102 UT_Vector3 myMouseCoord; // Tracks current mouse position 00103 bool myMouseMoving; 00104 int mySelectCount; // Tracks the no. of points selected 00105 int myInputId; 00106 00107 // Direction vectors that define the clip plane 00108 UT_Vector3 myRay1, myRay2; 00109 }; 00110 00111 #endif 00112
1.5.9