Beginnings of new settings mechanism

This commit is contained in:
Andrea Bernabei bernabei 2008-05-09 16:07:43 +00:00
parent 229129c678
commit 5d16509277
2 changed files with 26 additions and 2 deletions

View File

@ -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

View File

@ -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<QPointF> * dense_circle;
std::vector<QPointF> * square;
std::vector<QPointF> * dense_square;
ToolType current_type;
int current_settings;
};
/**