00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef __MSS_CaptureLayerPaintState_H__
00020 #define __MSS_CaptureLayerPaintState_H__
00021
00022 #include "MSS_API.h"
00023 #include <BM/BM_SimpleState.h>
00024 #include <OP/OP_Value.h>
00025 #include <PRM/PRM_ChoiceList.h>
00026 #include <UT/UT_PtrArray.h>
00027 #include <UT/UT_RefArray.h>
00028 #include <UT/UT_String.h>
00029 #include "MSS_PaintBaseState.h"
00030
00031 class OP_Node;
00032 class SOP_CaptureLayerPaint;
00033
00034 class MSS_API MSS_CaptureLayerPaintState : public MSS_PaintBaseState
00035 {
00036 public:
00037
00038 MSS_CaptureLayerPaintState(JEDI_View &view,
00039 PI_StateTemplate &templ,
00040 BM_SceneManager *scene,
00041 const char *cursor = BM_DEFAULT_CURSOR);
00042 virtual ~MSS_CaptureLayerPaintState();
00043
00044
00045
00046 static BM_State *ourConstructor(BM_View &view, PI_StateTemplate &templ,
00047 BM_SceneManager *scene);
00048 static PRM_Template *getTemplateList();
00049
00050
00051 virtual const char *className() const;
00052
00053
00054 virtual int enter(BM_SimpleState::BM_EntryType how);
00055
00056
00057
00058
00059 virtual void status(UT_String &status_string) const;
00060
00061
00062 virtual void renderStatusExtras(RE_Render *r);
00063
00064
00065 static void buildLayerMenu( void *data, PRM_Name *menu, int count,
00066 const PRM_SpareData *, PRM_Parm * );
00067
00068
00069 static void buildRegionMenu(void *data, PRM_Name *menu, int count,
00070 const PRM_SpareData *sd, PRM_Parm *p);
00071
00072 protected:
00073
00074
00075 virtual SOP_BrushOp menuToBrushOp(const UI_Value &menuvalue) const;
00076 virtual int handleMouseEvent(UI_Event *event);
00077 virtual int handleKeyTypeEvent(UI_Event *, BM_Viewport &);
00078
00079 virtual bool getSelectionBoundingBox( DM_Viewport &vport,
00080 UT_BoundingBox &bbox );
00081 virtual void updatePrompt();
00082
00083 virtual void doRender(RE_Render *r, short x, short y, int ghost);
00084
00085
00086 virtual void doRenderBoneHighlight(RE_Render *r, short x,
00087 short y, int ghost,
00088 SOP_CaptureLayerPaint *captSop);
00089
00090
00091 static int handleRegionMenuStatic(void *o, int index, float t,
00092 const PRM_Template *);
00093
00094
00095 static bool buildLayerMenuCallback(OP_Node &op, void *o);
00096 static int handleLayerMenuStatic(void *o, int index, float t,
00097 const PRM_Template *);
00098
00099
00100 virtual void handleOpEvent(OP_Node *caller, OP_EventType event_type,
00101 void *data );
00102
00103
00104 virtual int handleParameterEvent( UI_Event *event );
00105
00106
00107
00108
00109 const char *getOpName(UI_Value &val);
00110
00111
00112 virtual void setNode(OP_Node *node);
00113
00114 static PRM_ChoiceList theLMBMenu;
00115 static PRM_ChoiceList theMMBMenu;
00116
00117 private:
00118
00119 UT_String myPreviousBone;
00120
00121 UT_PtrArray<OP_Node *> myLayers;
00122 };
00123
00124 #endif