Example #1
0
void MeshSubFilter::initParameterSet(QAction*, MeshDocument&, RichParameterSet & par){
    par.addParam(new RichInt("fps", 100, "Frames per second", "The number of times per second the physics simulation is updated"));
    par.addParam(new RichInt("iterations", 20, "Physics method iterations", "The number of iterations of the iterative physics equation solver method"));
    par.addParam(new RichInt("contacts", 20, "Max contacts", "Maximum number of contact points to generate per object pair"));
    par.addParam(new RichFloat("bounciness", 0.1f, "Bounciness", "The amount of bounciness of a collision: 0 means the surfaces are not bouncy at all, 1 is the maximum bounciness"));
    par.addParam(new RichFloat("friction", 10, "Friction", "The coulomb friction coefficient of a collision"));
}
Example #2
0
void DecorateShadowPlugin::initGlobalParameterSet(QAction *action, RichParameterSet &parset)
{
    switch(ID(action)){
        case DP_SHOW_SHADOW : {
            assert(!(parset.hasParameter(this->DecorateShadowMethod())));
            int method = SH_MAP_VSM_BLUR;
            parset.addParam(
                    new RichEnum(
                        this->DecorateShadowMethod(),
                        method,
                        getSHMethods(),
                        "Shader used to perform shadow mapping decoration",
                        "Shadow mapping method")
                    );
            break;
        }

        case DP_SHOW_SSAO : {
            assert(!(parset.hasParameter(this->DecorateShadowSSAORadius())));
            float radius = 0.25f;
            parset.addParam(
                    new RichFloat(this->DecorateShadowSSAORadius(),
                    radius,
                    "Uniform parameter for SSAO shader",
                    "SSAO radius"));
            break;
        }

        default: assert(0);
    }
}		
Example #3
0
void FilterSSynth::initParameterSet(QAction* filter,MeshDocument &md, RichParameterSet &par)
{
   par.addParam(new RichString("grammar","set maxdepth 40 R1 R2 rule R1 { { x 1 rz 6 ry 6 s 0.99 } R1 { s 2 } sphere } rule R2 {{ x -1 rz 6 ry 6 s 0.99 } R2 { s 2 } sphere} ","Eisen Script grammar","Write a grammar according to Eisen Script specification and using the primitives box, sphere, mesh, dot and triangle "));
   par.addParam(new RichInt("seed",1,"seed for random construction","Seed needed to build the mesh"));
   par.addParam(new RichInt("sphereres",1,"set maximum resolution of sphere primitves, it must be included between 1 and 4","increasing the resolution of the spheres will improve the quality of the mesh "));
   return;
}
Example #4
0
//
// Filter interface start up
//
void FilterTopoPlugin::initParameterSet(QAction *action, MeshDocument & md, RichParameterSet & parlst) 
{
	MeshModel *target= md.mm();
	foreach (target, md.meshList) 
		if (target != md.mm())  break;

	doc = &md;

	 switch(ID(action))	 {
		case FP_RE_TOPO :  
			// Iterations editbox
			parlst.addParam(new RichInt(	"it", 
							4,
							"Number of refinement iterations used to build the new mesh", 
							"As higher is this value, as well defined will be the new mesh. Consider that more than 5 iterations may slow down your system"));
			// Distance editbox
			parlst.addParam(new RichAbsPerc(	"dist", 0.3f, 0.01f, 0.99f, 
								"Incremental distance %", 
								"This param represents the % distance for the local search algorithm used for new vertices allocation. Generally, 0.25-0.30 is a good value"));
			// Topology mesh list
			parlst.addParam(new RichMesh(	"userMesh", md.mm(), 
							"Topology mesh",
							"This mesh will be used as the new base topology, and will be replaced by the new mesh"));
			// Original mesh list
			parlst.addParam(new RichMesh( "inMesh", target,
							"Original mesh",
							"The new mesh will be elaborated using this model"));
		break;
											
		default : assert(0); 
	}
}
Example #5
0
void SdfGpuPlugin::initParameterSet(QAction *action, MeshModel &/*m*/, RichParameterSet &par)
{

    qDebug() << "called here!";
     mAction = ID(action);
    QStringList onPrimitive; onPrimitive.push_back("On vertices"); onPrimitive.push_back("On Faces");
   par.addParam( new RichEnum("onPrimitive", 0, onPrimitive, "Metric:",
                    "Choose whether to trace rays from faces or from vertices. " ));
   par.addParam(  new RichInt("numberRays",128, "Number of rays: ",
                    "The number of rays that will be casted around "
                    "the normals."));
   par.addParam(new RichInt("DepthTextureSize", 512, "Depth texture size",
                    "Size of the depth texture for depth peeling. Higher resolutions provide better sampling of the mesh, with a small performance penalty."));
   par.addParam(new RichInt("peelingIteration", 10, "Peeling Iteration",
                                "Number of depth peeling iteration. Actually is the maximum number of layers that a ray can hit while traversing the mesh. "
                                "For example, in the case of a sphere, you should specify 2 in this parameter. For a torus, specify 4. "
                                "<b>For more complex geometry you should run the depth complexity filter to know the exact value</b>."));
   par.addParam(new RichFloat("peelingTolerance", 0.0000001f, "Peeling Tolerance",
                            "Depth tolerance used during depth peeling. This is the threshold used to differentiate layers between each others."
                            "Two elements whose distance is below this value will be considered as belonging to the same layer."));

   if(mAction != SDF_DEPTH_COMPLEXITY)
        par.addParam(new RichFloat("coneAngle",120,"Cone amplitude", "Cone amplitude around normals in degrees. Rays are traced within this cone."));



   switch(mAction)
    {
            case SDF_OBSCURANCE:
                 par.addParam(new RichFloat("obscuranceExponent", 0.1f, "Obscurance Exponent",
                                          "This parameter controls the spatial decay term in the obscurance formula. "
                                          "The greater the exponent, the greater the influence of distance; that is: "
                                          "even if a ray is blocked by an occluder its contribution to the obscurance term is non zero, but proportional to this parameter. "
                                          "It turs out that if you choose a value of zero, you get the standard ambient occlusion term. "
                                          "<b>(In this case, only a value of two, in the peeling iteration parameter, has a sense)</b>"));
                 break;

            default:
                {
                    break;
                }
    }

   par.addParam(new RichBool("useVBO",USEVBO_BY_DEFAULT,"Use VBO if supported","By using VBO, Meshlab loads all the vertex structure in the VRam, greatly increasing rendering speed (for both CPU and GPU mode). Disable it if problem occurs"));

   if(mAction == SDF_SDF)
   {
        par.addParam(new RichBool("removeFalse",true,"Remove false intersections","For each"
                                  "ray we check the normal at the point of intersection,"
                                  "and ignore intersections where the normal at the intersection"
                                  "points is in the same direction as the point-of-origin"
                                  "(the same direction is defined as an angle difference less"
                                  "than 90) "));

        par.addParam(new RichBool("removeOutliers",false,"Remove outliers","The outliers removal is made on the fly with a supersampling of the depth buffer. "
                                  "For each ray that we trace, we take multiple depth values near the point of intersection and we output only the median of these values. "
                                  "Some mesh can benefit from this additional calculation. "));
   }
}
Example #6
0
// This function define the needed parameters for each filter.
// Return true if the filter has some parameters
// it is called every time, so you can set the default value of parameters according to the mesh
// For each parmeter you need to define, 
// - the name of the parameter, 
// - the string shown in the dialog 
// - the default value
// - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog)
void TriOptimizePlugin::initParameterSet(QAction *action, MeshModel &m, RichParameterSet & parlst)
{
	if (ID(action) == FP_CURVATURE_EDGE_FLIP) {
		parlst.addParam(new RichBool("selection", m.cm.sfn > 0, tr("Update selection"), tr("Apply edge flip optimization on selected faces only")));
		parlst.addParam(new RichFloat("pthreshold", 1.0f,
											tr("Angle Thr (deg)"),
											tr("To avoid excessive flipping/swapping we consider only couple of faces with a significant diedral angle (e.g. greater than the indicated threshold). ")));
		
		QStringList cmetrics;
		cmetrics.push_back("mean");
		cmetrics.push_back("norm squared");
		cmetrics.push_back("absolute");
		
		parlst.addParam(new RichEnum("curvtype", 0, cmetrics, tr("Curvature metric"),
		        tr("<p style=\'white-space:pre\'>"
			        "Choose a metric to compute surface curvature on vertices<br>"
			        "H = mean curv, K = gaussian curv, A = area per vertex<br><br>"
			        "1: Mean curvature = H<br>"
			        "2: Norm squared mean curvature = (H * H) / A<br>"
			        "3: Absolute curvature:<br>"
			        "     if(K >= 0) return 2 * H<br>"
			        "     else return 2 * sqrt(H ^ 2 - A * K)")));
		}
	
		if (ID(action) == FP_PLANAR_EDGE_FLIP) {
			parlst.addParam(new RichBool("selection", m.cm.sfn > 0, tr("Update selection"), tr("Apply edge flip optimization on selected faces only")));

		parlst.addParam(new RichFloat("pthreshold", 1.0f,
											tr("Planar threshold (deg)"),
											tr("angle threshold for planar faces (degrees)")));
			
		QStringList pmetrics;
		pmetrics.push_back("area/max side");
		pmetrics.push_back("inradius/circumradius");
		pmetrics.push_back("mean ratio");
		pmetrics.push_back("delaunay");
		pmetrics.push_back("topology");
		parlst.addParam(new RichEnum("planartype", 0, pmetrics, tr("Planar metric"),
		        tr("<p style=\'white-space:pre\'>"
			        "Choose a metric to define the planar flip operation<br><br>"
			        "Triangle quality based<br>"
			        "1: minimum ratio height/edge among the edges<br>"
			        "2: ratio between radii of incenter and circumcenter<br>"
			        "3: 2*sqrt(a, b)/(a+b), a, b the eigenvalues of M^tM,<br>"
			        "     M transform triangle into equilateral<br><br>"
			        "Others<br>"
			        "4: Fix the Delaunay condition between two faces<br>"
			        "5: Do the flip to improve local topology<br>")));
		parlst.addParam(new RichInt("iterations", 1, "Post optimization relax iter", tr("number of a planar laplacian smooth iterations that have to be performed after every run")));

	}
	
	if (ID(action) == FP_NEAR_LAPLACIAN_SMOOTH) {
		parlst.addParam(new RichBool("selection", false, tr("Update selection"),	tr("Apply laplacian smooth on selected faces only")));
		parlst.addParam(new RichFloat("AngleDeg", 0.5f,	tr("Max Normal Dev (deg)"),	tr("maximum mean normal angle displacement (degrees) from old to new faces")));
		parlst.addParam(new RichInt("iterations", 1, "Iterations", tr("number of laplacian smooth iterations in every run")));
	}
}
Example #7
0
void FilterGeodesic::initParameterSet(QAction *action,MeshModel &m, RichParameterSet & parlst)
{
    switch(ID(action))
        {
            case FP_QUALITY_POINT_GEODESIC :
                    parlst.addParam(new RichPoint3f("startPoint",m.cm.bbox.min,"Starting point","The starting point from which geodesic distance has to be computed. If it is not a surface vertex, the closest vertex to the specified point is used as starting seed point."));
          parlst.addParam(new RichAbsPerc("maxDistance",m.cm.bbox.Diag(),0,m.cm.bbox.Diag()*2,"Max Distance","If not zero it indicates a cut off value to be used during geodesic distance computation."));
                    break;
    default: break; // do not add any parameter for the other filters
    }
    return;
}
Example #8
0
int test_richparametersframe(){
    ParametersFrame f;    
    RichParameterSet p;
    p.addParam(new RichFloat ("RichFloatExample1", 100.2f));
    p.addParam(new RichFloat ("RichFloatExample2", 100.3f));
    p.addParam(new RichInt   ("RichIntExample1", 100));
    p.addParam(new RichInt   ("RichIntExample2", 23));
    p.addParam(new RichBool  ("RichBoolExample1",  1.0f));
    p.addParam(new RichBool  ("RichBoolExample2",  2.0f));
    p.addParam(new RichString("RichStringExample1","something1"));
    p.addParam(new RichString("RichStringExample2","something2"));
    f.loadFrameContent(p);
    return QApplication::exec(); //Starts the GUIs
}
Example #9
0
// This function define the needed parameters for each filter. Return true if the filter has some parameters
// it is called every time, so you can set the default value of parameters according to the mesh
// For each parmeter you need to define,
// - the name of the parameter,
// - the string shown in the dialog
// - the default value
// - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog)
void FilterAutoalign::initParameterSet(QAction *action,MeshDocument & md/*m*/, RichParameterSet & parlst)
{
   MeshModel *target;
   switch(ID(action))	 {
    case FP_AUTOALIGN :
        target= md.mm();
        foreach (target, md.meshList)
            if (target != md.mm())  break;

        parlst.addParam(new RichMesh ("FirstMesh", md.mm(),&md, "First Mesh",
                        "The mesh were the coplanar bases are sampled (it will contain the trasformation)"));
        parlst.addParam(new RichMesh ("SecondMesh", target,&md, "Second Mesh",
                        "The mesh were similar coplanar based are searched."));
        parlst.addParam(new RichFloat("overlapping",0.5f,"Estimated fraction of the\n first mesh overlapped by the second"));
        parlst.addParam(new RichFloat("tolerance [0.0,1.0]",0.3f,"Error tolerance"));
     break;
       case FP_BEST_ROTATION :
       target= md.mm();
       foreach (target, md.meshList)
       if (target != md.mm())  break;

       parlst.addParam(new RichMesh ("FirstMesh", md.mm(),&md, "First Mesh",
                       "The mesh that will be moved"));
       parlst.addParam(new RichMesh ("SecondMesh", target,&md, "Second Mesh",
                       "The mesh that will be kept fixed."));
       parlst.addParam(new RichInt("GridSize",10,"Grid Size", "The size of the uniform grid that is used for searching the best translation for a given rotation"));
       parlst.addParam(new RichInt("Rotation Num",64,"RotationNumber", "sss"));
       break;

   default: break; // do not add any parameter for the other filters
  }
}
Example #10
0
// This function define the needed parameters for each filter. 
void FilterMeasurePlugin::initParameterSet(QAction *action, MeshDocument &m, RichParameterSet & par)
{
	 switch(ID(action))	 
	 {
   case FP_MEASURE_FACE_QUALITY_HISTOGRAM :
   case FP_MEASURE_VERTEX_QUALITY_HISTOGRAM:
         {
         pair<float,float> minmax = tri::Stat<CMeshO>::ComputePerVertexQualityMinMax(m.mm()->cm);
         par.addParam(new RichFloat("minVal",minmax.first,"Min","The value that is used as a lower bound for the set of bins (all the value smaller this one will be put in the first bin)"));
         par.addParam(new RichFloat("maxVal",minmax.second,"Max","The value that is used as a upper bound for the set of bins (all the value over this one will be put in the last bin)"));
         par.addParam(new RichInt("binNum",20,"Number of bins","Number of bins in which the range of values is subdivided"));
        } break;
	}
}
Example #11
0
void FilterHarmonicPlugin::initParameterSet(QAction * action, MeshModel & m, RichParameterSet & parlst)
{
	switch(ID(action))
	{
	case FP_SCALAR_HARMONIC_FIELD :
		parlst.addParam(new RichPoint3f("point1", m.cm.bbox.min,"Point 1","A vertex on the mesh that represent one harmonic field boundary condition."));
		parlst.addParam(new RichPoint3f("point2", m.cm.bbox.min,"Point 2","A vertex on the mesh that represent one harmonic field boundary condition."));
		parlst.addParam(new RichDynamicFloat("value1", 0.0f, 0.0f, 1.0f,"value for the 1st point","Harmonic field value for the vertex."));
		parlst.addParam(new RichDynamicFloat("value2", 1.0f, 0.0f, 1.0f,"value for the 2nd point","Harmonic field value for the vertex."));
		parlst.addParam(new RichBool("colorize", true, "Colorize", "Colorize the mesh to provide an indication of the obtained harmonic field."));
		break;
	default : assert(0);
	}
}
Example #12
0
void U3DIOPlugin::initSaveParameter(const QString &format, MeshModel &m, RichParameterSet &par) 
{
	_param._campar = new vcg::tri::io::u3dparametersclasses::Movie15Parameters::CameraParameters(m.cm.bbox.Center(),m.cm.bbox.Diag());
	//vcg::Point3f pos = avoidExponentialNotation(_param._campar->_obj_pos,_param._campar->_obj_bbox_diag);
	vcg::Point3f pos = _param._campar->_obj_pos;
	vcg::Point3f dir(0.0f,0.0f,-1.0f * _param._campar->_obj_bbox_diag);
	par.addParam(new RichPoint3f("position_val",dir, "Camera Position",
		"The position in which the camera is set. The default value is derived by the 3d mesh's bounding box."));		
	//vcg::Point3f dir(0.0f,0.0f,avoidExponentialNotation(-1.0f * _param._campar->_obj_bbox_diag,_param._campar->_obj_bbox_diag));
	par.addParam(new RichPoint3f("target_val",pos, "Camera target point",
		"The point towards the camera is seeing. The default value is derived by the 3d mesh's bounding box."));
	par.addParam(new RichFloat("fov_val",60.0f,"Camera's FOV Angle 0..180","Camera's FOV Angle. The values' range is between 0-180 degree. The default value is 60."));
	par.addParam(new RichInt("compression_val",500,"U3D quality 0..1000","U3D mesh's compression ratio. The values' range is between 0-1000 degree. The default value is 500."));
}
Example #13
0
void AlgoDemoPlugin::initParameterSet(QAction *action, MeshModel &m, RichParameterSet &parlst)
{

    MeshDocument *md = m.parent;
	
    if(md == NULL){
        qDebug()<<"meshDOC is NULL";
        return;
    }

    QStringList curvNameList = QStringList();
    for(int ii = 0; ii < md->meshList.size();++ii)
    {
         curvNameList.push_back(md->meshList[ii]->shortName());
    }
    int li = (md->meshList.size()>=1)?0:-1;
    int ri = (md->meshList.size()>=2)?1:-1;


								
    switch(ID(action))
    {
        case FP_DUAL_ALGO_DEMO:
            parlst.addParam(new RichEnum("originmesh", li, curvNameList, tr("Original Mesh:"),
                    QString("Choose mesh for left window")));
            parlst.addParam(new RichEnum("targetmesh", ri, curvNameList, tr("Target Right:"),
                    QString("Choose mesh for right window")));
            break;
        case FP_SINGLE_ALGO_DEMO:
            parlst.addParam(new RichEnum("originmesh", li, curvNameList, tr("Original Mesh:"),
                    QString("Choose mesh for left window")));
            break;
        default: break; // do not add any parameter for the other algos
    }
	/*
	parlst.addParam(new RichFloat("",0,"Directional Bias [0..1]","The balance between a uniform and a directionally biased set of lighting direction<br>:"
									" - 0 means light came only uniformly from any direction<br>"
									" - 1 means that all the light cames from the specified cone of directions <br>"
									" - other values mix the two set of lighting directions "));
	parlst.addParam(new RichInt ("loops",AMBOCC_DEFAULT_NUM_VIEWS,"Requested views", "Number of different views uniformly placed around the mesh. More views means better accuracy at the cost of increased calculation time"));
	parlst.addParam(new RichPoint3f("coneDir",Point3f(0,1,0),"Lighting Direction", "Number of different views placed around the mesh. More views means better accuracy at the cost of increased calculation time"));
	parlst.addParam(new RichFloat("coneAngle",30,"Cone amplitude", "Number of different views uniformly placed around the mesh. More views means better accuracy at the cost of increased calculation time"));
	parlst.addParam(new RichBool("useGPU",AMBOCC_USEGPU_BY_DEFAULT,"Use GPU acceleration","In order to use GPU-Mode, your hardware must support FBOs, FP32 Textures and Shaders. Normally increases the performance by a factor of 4x-5x"));
	parlst.addParam(new RichBool("useVBO",AMBOCC_USEVBO_BY_DEFAULT,"Use VBO if supported","By using VBO, Meshlab loads all the vertex structure in the VRam, greatly increasing rendering speed (for both CPU and GPU mode). Disable it if problem occurs"));
	parlst.addParam(new RichInt ("depthTexSize",AMBOCC_DEFAULT_TEXTURE_SIZE,"Depth texture size(should be 2^n)", "Defines the depth texture size used to compute occlusion from each point of view. Higher values means better accuracy usually with low impact on performance"));
	*/
	parlst.addParam(new RichInt ("loops",100,"loop times", "loop times"));
	parlst.addParam(new RichFloat("epsilon",0.01,"epsilon", "epsilon"));
}
Example #14
0
void AlignTools::buildParameterSet(MeshDocument &md,RichParameterSet & parlst)
{
	vcg::AlignPair::Param ICPParameters;
	AlignParameter::buildRichParameterSet(ICPParameters, parlst);

	parlst.addParam(new RichBool(UseMarkers, true, "Use Markers for Alignment","if true (default), then use the user picked markers to do an alignment (or pre alignment if you also use ICP)."));
	parlst.addParam(new RichBool(AllowScaling, false, "Scale the mesh","if true (false by default), in addition to the alignment, scale the mesh based on the points picked"));
	
	parlst.addParam(new RichBool(UseICP, true, "Use ICP for Alignment","if true (default), then use the ICP to align the two meshes."));
	
	parlst.addParam(new RichMesh (StuckMesh, md.mm(), &md,"Stuck Mesh",
			"The mesh that will not move."));
	parlst.addParam(new RichMesh (MeshToMove, md.mm(), &md, "Mesh to Move",
			"The mesh that will move to fit close to the Stuck Mesh."));
}
Example #15
0
// This function define the needed parameters for each filter. Return true if the filter has some parameters
// it is called every time, so you can set the default value of parameters according to the mesh
// For each parmeter you need to define,
// - the name of the parameter,
// - the string shown in the dialog
// - the default value
// - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog)
void FilterCreate::initParameterSet(QAction *action, MeshModel & /*m*/, RichParameterSet & parlst)
{
	 switch(ID(action))	 {

    case CR_BOX :
      parlst.addParam(new RichFloat("size",1,"Scale factor","Scales the new mesh"));
      break;
    case CR_CONE:
      parlst.addParam(new RichFloat("r0",1,"Radius 1","Radius of the bottom circumference"));
      parlst.addParam(new RichFloat("r1",2,"Radius 2","Radius of the top circumference"));
      parlst.addParam(new RichFloat("h",3,"Height","Height of the Cone"));
      parlst.addParam(new RichInt("subdiv",36,"Side","Number of sides of the polygonal approximation of the cone"));
      break;
		default : return;
	}
}
Example #16
0
// This function define the needed parameters for each filter. Return true if the filter has some parameters
// it is called every time, so you can set the default value of parameters according to the mesh
// For each parameter you need to define,
// - the name of the parameter,
// - the string shown in the dialog
// - the default value
// - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog)
void ExtraSampleGPUPlugin::initParameterSet(QAction * action, MeshModel & m, RichParameterSet & parlst)
{
	(void)m;

	switch(ID(action))
	{
		case FP_GPU_EXAMPLE :
		{
			parlst.addParam(new RichColor    ("ImageBackgroundColor", QColor(50, 50, 50),                 "Image Background Color", "The color used as image background."        ));
			parlst.addParam(new RichInt      ("ImageWidth",           512,                                "Image Width",            "The width in pixels of the produced image." ));
			parlst.addParam(new RichInt      ("ImageHeight",          512,                                "Image Height",           "The height in pixels of the produced image."));
			parlst.addParam(new RichSaveFile ("ImageFileName",        "gpu_generated_image.png", "*.png", "Image File Name",        "The file name used to save the image."      ));
			break;
		}
		default : assert(0);
	}
}
Example #17
0
// This function define the needed parameters for each filter. Return true if the filter has some parameters
// it is called every time, so you can set the default value of parameters according to the mesh
// For each parameter you need to define, 
// - the name of the parameter, 
// - the string shown in the dialog 
// - the default value
// - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog)
void ExtraSamplePlugin::initParameterSet(QAction *action,MeshModel &m, RichParameterSet & parlst) 
{
	 switch(ID(action))	 {
		case FP_MOVE_VERTEX :  
 		  parlst.addParam(new RichBool ("UpdateNormals",
											true,
											"Recompute normals",
											"Toggle the recomputation of the normals after the random displacement.\n\n"
											"If disabled the face normals will remains unchanged resulting in a visually pleasant effect."));
			parlst.addParam(new RichAbsPerc("Displacement",
												m.cm.bbox.Diag()/100.0,0,m.cm.bbox.Diag(),
												"Max displacement",
												"The vertex are displaced of a vector whose norm is bounded by this value"));
											break;
											
		default : assert(0); 
	}
}
Example #18
0
// This function define the needed parameters for each filter. Return true if the filter has some parameters
// it is called every time, so you can set the default value of parameters according to the mesh
// For each parmeter you need to define, 
// - the name of the parameter, 
// - the string shown in the dialog 
// - the default value
// - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog)
void PoissonPlugin::initParameterSet(QAction *action,MeshModel &m, RichParameterSet & parlst) 
//void PoissonPlugin::initParList(QAction *action, MeshModel &m, RichParameterSet &parlst)
{
	 switch(ID(action))	 {
		case FP_POISSON_RECON :  
 		  //parlst.addParam(new RichBool ("RecomputeNormals",
			//								false,
			//								"Recompute normals",
			//								"Do not use the current normals, but recompute them from scratch considering the vertices of the mesh as an unstructured point cloud.");
 		  //parlst.addParam(new RichBool ("UseConfidence",
			//								true,
			//								"Use Quality",
			//								"Use the per vertex quality as a confidence value\n");
			parlst.addParam(new RichInt ("OctDepth",
											6,
											"Octree Depth",
											"Set the depth of the Octree used for extracting the final surface. Suggested range 5..10. Higher numbers mean higher precision in the reconstruction but also higher processing times. Be patient.\n"));
			parlst.addParam(new RichInt ("SolverDivide",
											6,
											"Solver Divide",
											"This integer argument specifies the depth at which a block Gauss-Seidel solver is used to solve the Laplacian equation.\n"
											"Using this parameter helps reduce the memory overhead at the cost of a small increase in reconstruction time. \n"
											"In practice, the authors have found that for reconstructions of depth 9 or higher a subdivide depth of 7 or 8 can reduce the memory usage.\n"
											"The default value is 8.\n"));
			parlst.addParam(new RichFloat ("SamplesPerNode",
											1.0,
											"Samples per Node",
											"This floating point value specifies the minimum number of sample points that should fall within an octree node as the octree\n"
											"construction is adapted to sampling density. For noise-free samples, small values in the range [1.0 - 5.0] can be used.\n"
											"For more noisy samples, larger values in the range [15.0 - 20.0] may be needed to provide a smoother, noise-reduced, reconstruction.\n"
											"The default value is 1.0."));
			parlst.addParam(new RichFloat ("Offset",
											 1.0,
											 "Surface offsetting",
											 "This floating point value specifies a correction value for the isosurface threshold that is chosen.\n"
											 "Values < 1 means internal offsetting, >1 external offsetting."
											 "Good values are in the range 0.5 .. 2.\n"
											 "The default value is 1.0 (no offsetting)."));
			
			break;
   default: break; // do not add any parameter for the other filters
  }
}
Example #19
0
int test_subsubparset(){
    RichParameterSet p("PARAMETERSROOT");
    p.addParam(new RichBool("LV1_BOOL", false));
    p.addParam(new RichFloat("LV1_FLOAT", 0.0f));
    { 
        RichParameterSet* subpar = new RichParameterSet("LV1_GROUP");
        subpar->addParam(new RichBool("LV2_BOOL", false));
        subpar->addParam(new RichFloat("LV2_FLOAT", 0.0f));
        p.addParam(subpar);
        {
            RichParameterSet* subsubpar = new RichParameterSet("LV2_GROUP");
            subsubpar->addParam(new RichBool("LV3_BOOL", false));
            subsubpar->addParam(new RichFloat("LV3_FLOAT", 0.0f));            
            subpar->addParam(subsubpar);
        }
    }   
    qDebug() << qPrintable(p.toString());    
    return 0;
}
 void FilterCreateIso::initParameterSet(QAction *action,MeshModel &m, RichParameterSet & parlst)
{
    pair<float,float> qualityRange;
  switch(ID(action))
  {
    case FP_CREATEISO :
          parlst.addParam(new RichInt("Resolution",64,"Grid Resolution","Resolution of the side of the cubic grid used for the volume creation"));
          break;
  default: break; // do not add any parameter for the other filters
  }
}
Example #21
0
void FilterGeodesic::initParameterSet(QAction *action,MeshModel &m, RichParameterSet & parlst)
{
	switch(ID(action))	 
		{
			case FP_QUALITY_POINT_GEODESIC :
					parlst.addParam(new RichPoint3f("startPoint",m.cm.bbox.min,"Starting point","The starting point from which geodesic distance has to be computed. If it is not a surface vertex, the closest vertex to the specified point is used as starting seed point."));
					break;
    default: break; // do not add any parameter for the other filters
    }
	return;
}
Example #22
0
void RandomFillFilter::initParameterSet(QAction* action,MeshDocument& md, RichParameterSet & par){
    MeshSubFilter::initParameterSet(action, md, par);
    par.addParam(new RichMesh("container", 0, &md, "Container mesh", "This mesh will act as a container for the filling mesh"));
    par.addParam(new RichMesh("filler", 0, &md, "Filler mesh", "The container mesh will be filled with this mesh"));
    par.addParam(new RichFloat("factor", 0.5f, "Volume ratio factor", "The ratio between the container and the filler object will be multiplied by this factor. The volume ratio determines the number of filling objects to be spawn."));
    par.addParam(new RichFloat("seconds", 1.f, "Simulation interval (sec)", "Physics simulation update interval in seconds"));
    par.addParam(new RichFloat("updateFrequency", 1.f, "Update frequency", "The frequency with which the simulation gets updated in case the objects spawn at the center of mass"));
    par.addParam(new RichBool("flipNormal", false, "Flip container normals", "If true the container normals will be flipped."));
    par.addParam(new RichBool("useRandomVertices", true, "Random spawn points", "If true the filling objects will spawn at random positions in the container mesh instead of being spawn at the center of mass"));
}
// This function define the needed parameters for each filter. Return true if the filter has some parameters
// it is called every time, so you can set the default value of parameters according to the mesh
// For each parameter you need to define, 
// - the name of the parameter, 
// - the string shown in the dialog 
// - the default value
// - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog)
void FilterWebExportVMustPlugin::initParameterSet(QAction *action, MeshDocument &md, RichParameterSet & parlst) 
{
	int meshCount = md.meshList.size();

	// tries to detect the target mesh
	MeshModel* target = md.mm();
  
	parlst.addParam(new RichMesh("target_mesh", target, &md, "Target mesh:", "The mesh to export."));

	templateNamesHR << "Basic Viewer" << "Standard Viewer" << "Fullsize Viewer" << "Radiance Scaling" <<
		"Walk Through" << "POP Geometry" << "Nexus conversion";
	parlst.addParam(new RichEnum("template", 1, templateNamesHR, "Web Template:", "Web template to use."));
	parlst.addParam(new RichString("notification_email", "*****@*****.**", "Notification email:", 
		"A link to download the exported model will be send at this email address."));

	// names to be used with the CIF API
	templateNames << "basic" << "standard" << "fullsize" << "radianceScaling" << "walkthrough" 
		<< "pop" << "nexus";

	return;
}
Example #24
0
// initialize importing parameters
void BaseMeshIOPlugin::initPreOpenParameter(const QString &formatName, const QString &/*filename*/, RichParameterSet &parlst)
{
	if (formatName.toUpper() == tr("PTX"))
	{
		parlst.addParam(new RichInt("meshindex",0,"Index of Range Map to be Imported",
						"PTX files may contain more than one range map. 0 is the first range map. If the number if higher than the actual mesh number, the import will fail"));
		parlst.addParam(new RichBool("anglecull",true,"Cull faces by angle","short"));
		parlst.addParam(new RichFloat("angle",85.0,"Angle limit for face culling","short"));
		parlst.addParam(new RichBool("usecolor",true,"import color","Read color from PTX, if color is not present, uses reflectance instead"));
		parlst.addParam(new RichBool("pointcull",true,"delete unsampled points","Deletes unsampled points in the grid that are normally located in [0,0,0]"));
    parlst.addParam(new RichBool("pointsonly",false,"Keep only points","Import points a point cloud only, with radius and normals, no triangulation involved, isolated points and points with normals with steep angles are removed."));
		parlst.addParam(new RichBool("switchside",false,"Swap rows/columns","On some PTX, the rows and columns number are switched over"));
		parlst.addParam(new RichBool("flipfaces",false,"Flip all faces","Flip the orientation of all the triangles"));
	}
}
// given an alignment parameter builds the corresponding RichParameterSet (dual of the retrieveParemeterSet)
void AlignParameter::buildRichParameterSet(AlignPair::Param &app, RichParameterSet &fps)
{
	fps.clear();
	fps.addParam(new RichInt("SampleNum",app.SampleNum,"Sample Number","Number of samples that we try to choose at each ICP iteration"));
	fps.addParam(new RichFloat("MinDistAbs",app.MinDistAbs,"Minimal Starting Distance","For all the chosen sample on one mesh we consider for ICP only the samples nearer than this value."
							                             "If MSD is too large outliers could be included, if it is too small convergence will be very slow. "
							                             "A good guess is needed here, suggested values are in the range of 10-100 times of the device scanning error."
							                             "This value is also dynamically changed by the 'Reduce Distance Factor'"));
	fps.addParam(new RichFloat("TrgDistAbs",app.TrgDistAbs,"Target Distance","When 50% of the chosen samples are below this distance we consider the two mesh aligned. Usually it should be a value lower than the error of the scanning device. "));
	fps.addParam(new RichInt("MaxIterNum",app.MaxIterNum,"Max Iteration Num","The maximum number of iteration that the ICP is allowed to perform."));
	fps.addParam(new RichBool("SampleMode",app.SampleMode == AlignPair::Param::SMNormalEqualized,"Normal Equalized Sampling","if true (default) the sample points of icp are choosen with a  distribution uniform with respect to the normals of the surface. Otherwise they are distributed in a spatially uniform way."));
  fps.addParam(new RichFloat("ReduceFactorPerc",app.ReduceFactorPerc,"MSD Reduce Factor","At each ICP iteration the Minimal Starting Distance is reduced to be 5 times the <Reduce Factor> percentile of the sample distances (e.g. if RF is 0.9 the new Minimal Starting Distance is 5 times the value <X> such that 90% of the sample lies at a distance lower than <X>."));
  fps.addParam(new RichFloat("PassHiFilter",app.PassHiFilter,"Sample Cut High","At each ICP iteration all the sample that are farther than the <cuth high> percentile are discarded ( In practice we use only the <cut high> best results )."));
	fps.addParam(new RichBool("MatchMode",app.MatchMode == AlignPair::Param::MMRigid,"Rigid matching","If true the ICP is cosntrained to perform matching only throug roto-translations (no scaling allowed). If false a more relaxed transformation matrix is allowed (scaling and shearing can appear)."));
}
Example #26
0
int test_simple(){
    RichParameterSet p;
    p.addParam(new RichBool("RichBoolExample", false));
    p.addParam(new RichFloat("RichFloatExample", 0.0f));
    p.addParam(new RichInt("RichIntExample", 0));
    p.addParam(new RichString("RichStringExample","something"));
    p.addParam(new RichColor("RichColorExample",Qt::black));
    p.addParam(new RichAbsPerc("RichAbsPercExample",.5));
    p.addParam(new RichFilePath("RichFilePathExample","pathexample"));   
    qDebug() << qPrintable( p.toString() );
    return 0;
}
Example #27
0
void SdfPlugin::initParameterSet(MeshDocument&, RichParameterSet& par){
  QStringList onPrimitive; onPrimitive.push_back("On vertices"); onPrimitive.push_back("On Faces");
  par.addParam( new RichEnum("onPrimitive", 0, onPrimitive, "Metric:", 
                             "Choose whether to trace rays from faces or from vertices. "
                             "Recall that tracing from vertices will use vertex normal "
                             "estimation."));
  par.addParam(new RichFloat("coneWidth", 20, "Cone width: ",
                             "The standard deviation of the rays that will be casted around "
                             "the anti-normals. Remember that most sampled directions are "
                             "expected to fall within 3x this value."));
  par.addParam(  new RichInt("numberRays", 50, "Number of rays: ",
                             "The standard deviation of the rays that will be casted around "
                             "the anti-normals. Remember that most sampled directions are "
                             "expected to fall within 3x this value."));
  par.addParam(new RichFloat("lowQuantile", .1, "Bottom quantile",
                             "We will throw away the set of ray distances for each cone which distance "
                             "value falls under this quantile. Value in between [0,1]. 0 Implies all "
                             "values are kept"));
  par.addParam(new RichFloat("hiQuantile", .9, "Top quantile",
                             "We will throw away the set of ray distances for each cone which distance "
                             "value falls under this quantile. Value in between [0,1]. 1 Implies all "
                             "values are kept"));
}
Example #28
0
// This function define the needed parameters for each filter. Return true if the filter has some parameters
// it is called every time, so you can set the default value of parameters according to the mesh
// For each parameter you need to define, 
// - the name of the parameter, 
// - the string shown in the dialog 
// - the default value
// - a possibly long string describing the meaning of that parameter (shown as a popup help in the dialog)
void FilterMutualInfoPlugin::initParameterSet(QAction *action,MeshDocument & md, RichParameterSet & parlst) 
{
	QStringList rendList; 
	switch(ID(action))	 {
		case FP_IMAGE_GLOBALIGN :  
			//parlst.addParam(new RichMesh ("SourceMesh", md.mm(),&md, "Source Mesh",
				//								"The mesh on which the image must be aligned"));
			/*parlst.addParam(new RichRaster ("SourceRaster", md.rm(),&md, "Source Raster",
												"The mesh on which the image must be aligned"));*/
			
			
			rendList.push_back("Combined");
			rendList.push_back("Normal map");
			rendList.push_back("Color per vertex");
			rendList.push_back("Specular");
			rendList.push_back("Silhouette");
			rendList.push_back("Specular combined");

			//rendList.push_back("ABS Curvature");
			parlst.addParam(new RichEnum("RenderingMode", 0, rendList, tr("Rendering mode:"),
                                QString("Rendering modes")));
			
			//parlst.addParam(new RichShotf  ("Shot", vcg::Shotf(),"Smoothing steps", "The number of times that the whole algorithm (normal smoothing + vertex fitting) is iterated."));
			
			parlst.addParam(new RichInt ("Max number of refinement steps",
				5,
				"Maximum number of minimizations step",
				"Maximum number of minimizations step on the global graph"));
			parlst.addParam(new RichFloat ("Threshold for refinement convergence",
				1.2,
				"Threshold for refinement convergence (in pixels)",
				"The threshold (average quadratic variation in the projection on image plane of some samples of the mesh before and after each step of refinement) that stops the refinement"));

			parlst.addParam(new RichBool("Pre-alignment",false,"Pre-alignment step","Pre-alignment step"));
			parlst.addParam(new RichBool("Estimate Focal",true,"Estimate focal length","Estimate focal length"));
			parlst.addParam(new RichBool("Fine",true,"Fine Alignment","Fine alignment"));

 		  /*parlst.addParam(new RichBool ("UpdateNormals",
											true,
											"Recompute normals",
											"Toggle the recomputation of the normals after the random displacement.\n\n"
											"If disabled the face normals will remains unchanged resulting in a visually pleasant effect."));
			parlst.addParam(new RichAbsPerc("Displacement",
												m.cm.bbox.Diag()/100.0,0,m.cm.bbox.Diag(),
												"Max displacement",
												"The vertex are displaced of a vector whose norm is bounded by this value"));*/
											break;


		
											
		default : assert(0); 
	}
}
Example #29
0
void MeshGridPlugin::initParameterSet(QAction *action, MeshModel &m, RichParameterSet &parlst)
{




    switch(ID(action))
    {
    case FP_MESH_GRID:
        parlst.addParam(new RichInt("numVertX", 100, "num vertices on x", "number of vertices on x. it must be positive"));
        parlst.addParam(new RichInt("numVertY", 100, "num vertices on y", "number of vertices on y. it must be positive"));
        break;
    default:
        break; // do not add any parameter for the other algos
    }

}
Example #30
0
//farsi passare due Point3f sulla mesh dai quali risalire alle facce sorgente/pozzo
void ExtraSamplePlugin::initParameterSet(QAction *action,MeshModel &m, RichParameterSet & parlst)
{
    switch(ID(action))	 {
    case FP_DECOMPOSER :
        parlst.addParam(new RichPoint3f("upperPoint",m.cm.bbox.min,"Start Surf. Pos","This face will be connected to the SOURCE in the graph over which the mincut algorithm will be applied."));
        parlst.addParam(new RichPoint3f("lowerPoint",m.cm.bbox.min,"End Surf. Pos","This face will be connected to the SINK in the graph over which the mincut algorithm will be applied."));
        parlst.addParam(new RichDynamicFloat("geodesic", 0.2f, 0.0f, 1.0f,"Geodesic Weight Factor","Factor to model the geodesic distance impact on the edge weight: The geodesic distance is inteded from a certain face to the Start or End faces."));
        parlst.addParam(new RichDynamicFloat("geo-factor-min", 0.25f, 0.0f, 1.0f,"Min Dist. Factor","Factor to model the desidered minimum distance of the cut from the Start pos."));
        parlst.addParam(new RichDynamicFloat("geo-factor-max", 0.75f, 0.0f, 1.0f,"Max Dist. Factor","Factor to model the desidered maximum distance of the cut from the Start pos."));
        parlst.addParam(new RichDynamicFloat("dihedral", 0.2f, 0.0f, 1.0f,"Dihedral Weight Factor","Factor to model the dihedral angle impact on the edge weight: Concave angles between faces will be privileged."));
        parlst.addParam(new RichDynamicFloat("ambient", 0.2f, 0.0f, 1.0f,"Ambient Weight Factor","Factor to model the ambient occlusion impact on the edge weight: Faces with low value of ambient occlusion will be privileged."));
        parlst.addParam(new RichDynamicFloat("e-length", 0.2f, 0.0f, 1.0f,"Edge Length Factor","Factor to model the edge length impact on the edge weight: shorter edges will be privileged."));
        break;
    default : assert(0);
    }
}