212
212
// - the string shown in the dialog
213
213
// - the default value
214
214
// - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog)
215
void FilterFunctionPlugin::initParameterSet(QAction *action,MeshModel &m, FilterParameterSet & parlst)
215
void FilterFunctionPlugin::initParameterSet(QAction *action,MeshModel &m, RichParameterSet & parlst)
218
218
switch(ID(action)) {
220
220
case FF_VERT_SELECTION :
221
parlst.addString("condSelect","(q < 0)", "boolean function",
221
parlst.addParam(new RichString("condSelect","(q < 0)", "boolean function",
222
222
"type a boolean function that will be evaluated in order to select a subset of vertices<br>"
223
"example: (y > 0) and (ny > 0)");
223
"example: (y > 0) and (ny > 0)"));
225
parlst.addBool("strictSelect",true,"Strict face selection", "If checked a face is selected if <b>ALL</b> its vertices are selected. <br>"
226
"If unchecked a face is selected if <b>at least one</b> of its vertices is selected");
225
parlst.addParam(new RichBool("strictSelect",true,"Strict face selection", "If checked a face is selected if <b>ALL</b> its vertices are selected. <br>"
226
"If unchecked a face is selected if <b>at least one</b> of its vertices is selected"));
229
229
case FF_FACE_SELECTION :
230
parlst.addString("condSelect","(fi == 0)", "boolean function",
231
"type a boolean function that will be evaluated in order to select a subset of faces<br>");
230
parlst.addParam(new RichString("condSelect","(fi == 0)", "boolean function",
231
"type a boolean function that will be evaluated in order to select a subset of faces<br>"));
234
234
case FF_GEOM_FUNC :
235
parlst.addString("x","x", "func x = ", "insert function to generate new coord for x");
236
parlst.addString("y","y", "func y = ", "insert function to generate new coord for y");
237
parlst.addString("z","sin(x+y)", "func z = ", "insert function to generate new coord for z");
235
parlst.addParam(new RichString("x","x", "func x = ", "insert function to generate new coord for x"));
236
parlst.addParam(new RichString("y","y", "func y = ", "insert function to generate new coord for y"));
237
parlst.addParam(new RichString("z","sin(x+y)", "func z = ", "insert function to generate new coord for z"));
240
240
case FF_FACE_COLOR:
241
parlst.addString("r","255", "func r = ", "function to generate Red component. Expected Range 0-255");
242
parlst.addString("g","0", "func g = ", "function to generate Green component. Expected Range 0-255");
243
parlst.addString("b","255", "func b = ", "function to generate Blue component. Expected Range 0-255");
241
parlst.addParam(new RichString("r","255", "func r = ", "function to generate Red component. Expected Range 0-255"));
242
parlst.addParam(new RichString("g","0", "func g = ", "function to generate Green component. Expected Range 0-255"));
243
parlst.addParam(new RichString("b","255", "func b = ", "function to generate Blue component. Expected Range 0-255"));
246
246
case FF_FACE_QUALITY:
247
parlst.addString("q","x0+y0+z0", "func q0 = ", "function to generate new Quality foreach face");
248
parlst.addBool("normalize",false,"normalize","if checked normalize all quality values in range [0..1]");
249
parlst.addBool("map",false,"map into color", "if checked map quality generated values into per-vertex color");
247
parlst.addParam(new RichString("q","x0+y0+z0", "func q0 = ", "function to generate new Quality foreach face"));
248
parlst.addParam(new RichBool("normalize",false,"normalize","if checked normalize all quality values in range [0..1]"));
249
parlst.addParam(new RichBool("map",false,"map into color", "if checked map quality generated values into per-vertex color"));
252
252
case FF_VERT_COLOR:
253
parlst.addString("x","255", "func r = ", "function to generate Red component. Expected Range 0-255");
254
parlst.addString("y","255", "func g = ", "function to generate Green component. Expected Range 0-255");
255
parlst.addString("z","0", "func b = ", "function to generate Blue component. Expected Range 0-255");
253
parlst.addParam(new RichString("x","255", "func r = ", "function to generate Red component. Expected Range 0-255"));
254
parlst.addParam(new RichString("y","255", "func g = ", "function to generate Green component. Expected Range 0-255"));
255
parlst.addParam(new RichString("z","0", "func b = ", "function to generate Blue component. Expected Range 0-255"));
258
258
case FF_VERT_QUALITY:
259
parlst.addString("q","vi", "func q = ", "function to generate new Quality for every vertex");
260
parlst.addBool("normalize",false,"normalize","if checked normalize all quality values in range [0..1]");
261
parlst.addBool("map",false,"map into color", "if checked map quality generated values into per-vertex color");
259
parlst.addParam(new RichString("q","vi", "func q = ", "function to generate new Quality for every vertex"));
260
parlst.addParam(new RichBool("normalize",false,"normalize","if checked normalize all quality values in range [0..1]"));
261
parlst.addParam(new RichBool("map",false,"map into color", "if checked map quality generated values into per-vertex color"));
264
264
case FF_DEF_VERT_ATTRIB:
265
parlst.addString("name","Radiosity","Name", "the name of new attribute. you can access attribute in other filters through this name");
266
parlst.addString("expr","x","Function =", "function to calculate custom attribute value for each vertex");
265
parlst.addParam(new RichString("name","Radiosity","Name", "the name of new attribute. you can access attribute in other filters through this name"));
266
parlst.addParam(new RichString("expr","x","Function =", "function to calculate custom attribute value for each vertex"));
269
269
case FF_DEF_FACE_ATTRIB:
270
parlst.addString("name","Radiosity","Name", "the name of new attribute. you can access attribute in other filters through this name");
271
parlst.addString("expr","fi","Function =", "function to calculate custom attribute value for each vertex");
270
parlst.addParam(new RichString("name","Radiosity","Name", "the name of new attribute. you can access attribute in other filters through this name"));
271
parlst.addParam(new RichString("expr","fi","Function =", "function to calculate custom attribute value for each vertex"));
275
parlst.addInt("numVertX", 10, "num vertices on x", "number of vertices on x. it must be positive");
276
parlst.addInt("numVertY", 10, "num vertices on y", "number of vertices on y. it must be positive");
277
parlst.addFloat("absScaleX", 0.3f, "x scale", "absolute scale on x (float)");
278
parlst.addFloat("absScaleY", 0.3f, "y scale", "absolute scale on y (float)");
279
parlst.addBool("center",false,"centered on origin", "center grid generated by filter on origin.<br>"
280
"Grid is first generated and than moved into origin (using muparser lib to perform fast calc on every vertex)");
275
parlst.addParam(new RichInt("numVertX", 10, "num vertices on x", "number of vertices on x. it must be positive"));
276
parlst.addParam(new RichInt("numVertY", 10, "num vertices on y", "number of vertices on y. it must be positive"));
277
parlst.addParam(new RichFloat("absScaleX", 0.3f, "x scale", "absolute scale on x (float)"));
278
parlst.addParam(new RichFloat("absScaleY", 0.3f, "y scale", "absolute scale on y (float)"));
279
parlst.addParam(new RichBool("center",false,"centered on origin", "center grid generated by filter on origin.<br>"
280
"Grid is first generated and than moved into origin (using muparser lib to perform fast calc on every vertex)"));
282
282
case FF_ISOSURFACE :
283
parlst.addFloat("voxelSize", 0.05, "Size of Voxel", "Size of the voxel that is used by for the grid where the field is sampled. Smaller this value, higher precision, but higher processing times.");
284
parlst.addFloat("minX", -1, "Min X", "Range where the field is sampled");
285
parlst.addFloat("minY", -1, "Min Y", "Range where the field is sampled");
286
parlst.addFloat("minZ", -1, "Min Z", "Range where the field is sampled");
287
parlst.addFloat("maxX", 1, "Max X", "Range where the field is sampled");
288
parlst.addFloat("maxY", 1, "Max Y", "Range where the field is sampled");
289
parlst.addFloat("maxZ", 1, "Max Z", "Range where the field is sampled");
290
parlst.addString("expr","x*x+y*y+z*z-0.5","Function =", "This expression is evaluated for each voxel of the grid. The surface passing through the zero valued points of this field is then extracted using marching cube.");
283
parlst.addParam(new RichFloat("voxelSize", 0.05, "Size of Voxel", "Size of the voxel that is used by for the grid where the field is sampled. Smaller this value, higher precision, but higher processing times."));
284
parlst.addParam(new RichFloat("minX", -1, "Min X", "Range where the field is sampled"));
285
parlst.addParam(new RichFloat("minY", -1, "Min Y", "Range where the field is sampled"));
286
parlst.addParam(new RichFloat("minZ", -1, "Min Z", "Range where the field is sampled"));
287
parlst.addParam(new RichFloat("maxX", 1, "Max X", "Range where the field is sampled"));
288
parlst.addParam(new RichFloat("maxY", 1, "Max Y", "Range where the field is sampled"));
289
parlst.addParam(new RichFloat("maxZ", 1, "Max Z", "Range where the field is sampled"));
290
parlst.addParam(new RichString("expr","x*x+y*y+z*z-0.5","Function =", "This expression is evaluated for each voxel of the grid. The surface passing through the zero valued points of this field is then extracted using marching cube."));
295
parlst.addString("condSelect","(q0 >= 0 and q1 >= 0)","boolean function","type a boolean function that will be evaluated on every edge");
296
parlst.addString("x","(x0+x1)/2","x =","function to generate x coord of new vertex in [x0,x1].<br>For example (x0+x1)/2");
297
parlst.addString("y","(y0+y1)/2","y =","function to generate x coord of new vertex in [y0,y1].<br>For example (y0+y1)/2");
298
parlst.addString("z","(z0+z1)/2","z =","function to generate x coord of new vertex in [z0,z1].<br>For example (z0+z1)/2");
295
parlst.addParam(new RichString("condSelect","(q0 >= 0 and q1 >= 0)","boolean function","type a boolean function that will be evaluated on every edge"));
296
parlst.addParam(new RichString("x","(x0+x1)/2","x =","function to generate x coord of new vertex in [x0,x1].<br>For example (x0+x1)/2"));
297
parlst.addParam(new RichString("y","(y0+y1)/2","y =","function to generate x coord of new vertex in [y0,y1].<br>For example (y0+y1)/2"));
298
parlst.addParam(new RichString("z","(z0+z1)/2","z =","function to generate x coord of new vertex in [z0,z1].<br>For example (z0+z1)/2"));
301
301
default : assert(0);