示例#1
0
void Graph_Completer::run()
{
    stopped_ = false;

    //clock_t t0 = clock();
    compute_convex_hull();
    /*clock_t t1 = clock();
    std::cout << "Convex hull points: (computed in " << (t1 - t0)*1.0/CLOCKS_PER_SEC << "s)" << std::endl;
    unsigned int i;
    for (i=0; i<convex_hull_.size(); i++)
    {
        std::cout << convex_hull_[i] + 1 << " ";
    }
    std::cout << std::endl;*/

    //clock_t t2 = clock();
    complete_triangulation();
    /*clock_t t3 = clock();
    std::cout << "Triangulated in " << (t3 - t2)*1.0/CLOCKS_PER_SEC << "s, ";*/

    if (!stopped_)
    {
        add_zero();
        sort_everything();
    }

    /*clock_t t4 = clock();
    std::cout << "added zero in " << (t4 - t3)*1.0/CLOCKS_PER_SEC << "s" << std::endl;*/

    return;
}
void bhkProxyObject::BuildColConvex()
{
	proxyMesh.FreeAll();
	MeshDelta md(proxyMesh);
	for (int i = 0;i < pblock2->Count(PB_MESHLIST); i++) {
		INode *tnode = NULL;
		pblock2->GetValue(PB_MESHLIST,0,tnode,FOREVER,i);	
		if (tnode)
		{
			ObjectState os = tnode->EvalWorldState(0);
			Matrix3 wm = tnode->GetNodeTM(0);
			TriObject *tri = (TriObject *)os.obj->ConvertToType(0, Class_ID(TRIOBJ_CLASS_ID, 0));
			if (tri)
			{
				Mesh& mesh = tri->GetMesh();
				MeshDelta tmd (mesh);
				md.AttachMesh(proxyMesh, mesh, wm, 0);
				md.Apply(proxyMesh);
			}
		}
	}
	compute_convex_hull(proxyMesh, proxyMesh);

	BuildOptimize(proxyMesh);

	proxyPos = Point3::Origin;
	forceRedraw = true;
}
示例#3
0
void AbstractForm::update_values(){
    compute_convex_hull();
    compute_size_of_area();
    number_of_points = points.size();
}