diff --git a/src/fgt/editpaint/editpaint.cpp b/src/fgt/editpaint/editpaint.cpp index 46293b26c..89471b658 100644 --- a/src/fgt/editpaint/editpaint.cpp +++ b/src/fgt/editpaint/editpaint.cpp @@ -152,6 +152,18 @@ void EditPaintPlugin::projectCursor(MeshModel & m, GLArea * gla) } } +void EditPaintPlugin::setToolType(ToolType t) +{ + current_type = t; + switch(current_type) + { + case COLOR_PAINT: + current_settings = EPP_PICK_VERTICES | EPP_DRAW_CURSOR; + default: + current_settings = EPP_NONE; + } +} + /** * Since only on a Decorate call it is possible to obtain correct values * from OpenGL, all operations are performed during the execution of this diff --git a/src/fgt/editpaint/editpaint.h b/src/fgt/editpaint/editpaint.h index 468b8f19a..61ff5c75c 100644 --- a/src/fgt/editpaint/editpaint.h +++ b/src/fgt/editpaint/editpaint.h @@ -41,11 +41,18 @@ #include "paintbox.h" +/** + * These options are chosen by each tool in the method setToolType(TolType t) + */ enum PaintOptions { - EPP_NONE = 0x0000, - EPP_FIND_VERTICES = 0x0001, + EPP_NONE = 0x00000, + EPP_PICK_FACES = 0x00001, //On press, pick faces + EPP_PICK_VERTICES = 0x00003, //On press, find the vertices (implies face picking too) + EPP_AVG_NORMAL = 0x00007, //During vertex picking, find the average normal of all vertices (implies vertex picking) + EPP_DRAW_CURSOR = 0x00008 //On mouse move display a shape representing the given cursor }; + /** * EditPaint plugin main class (MeshEditing plugin) */ @@ -72,6 +79,7 @@ public: public slots: void update(); + void setToolType(ToolType t); private: struct VertexDistance { QPoint position; QPointF rel_position; float distance;}; @@ -124,6 +132,10 @@ private: std::vector * dense_circle; std::vector * square; std::vector * dense_square; + + ToolType current_type; + int current_settings; + }; /**