将VTK结合到MFC中
像下面这样的一个简单的算法,要是添加到MFC中,请问怎么添加?添加到哪一部分?其中MFC是基于单文档的 谢谢!
virtual void Execute(vtkObject *caller,unsigned long,void*)
{
int n=ContourRep1->GetNumberOfNodes();
double pos0[3];
double pos1[3];
double pos2[3];
double area=0.0;
double Sj=0;
for(int j=0; j<n; j++)
{
//ContourRep1->GetNthNodeWorldPosition(0,pos0);
ContourRep1->GetNthNodeWorldPosition(j,pos1);
ContourRep1->GetNthNodeWorldPosition((j+1)%n,pos2);
printf("该点的坐标为:%f,%f,%f\n",pos1[0],pos1[1],pos1[2]);
Sj+=((double)pos1[0]*pos2[1]-(double)pos2[0]*pos1[1])/2;
Sj=fabs(Sj);
}
printf("一共有多少点:%d\n",n);
printf("该区域面积为:%f\n",Sj);
printf("一共有多少点:********************************************************************\n");
}