本文整理汇总了C++中MyMesh::FN方法的典型用法代码示例。如果您正苦于以下问题:C++ MyMesh::FN方法的具体用法?C++ MyMesh::FN怎么用?C++ MyMesh::FN使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MyMesh
的用法示例。
在下文中一共展示了MyMesh::FN方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: refine
char* refine(int num)
{
MyMesh m;
int t0=clock();
int loadmask;
printf("Buffer ptr is '%i'\n",buf);
printf("Buffer[0] is '%c'\n",buf[0]);
int ret = tri::io::ImporterOFF<MyMesh>::OpenMem(m,buf,strlen(buf),loadmask);
int t1=clock();
if(ret != 0)
{
printf("Error in opening file\n");
exit(-1);
}
int t2=clock();
printf("Read mesh %i %i\n",m.FN(),m.VN());
tri::UpdateTopology<MyMesh>::FaceFace(m);
tri::EdgeLen<MyMesh,float> edgePred(0);
tri::MidPoint<MyMesh> midFun(&m);
tri::RefineE(m,midFun,edgePred);
int t3=clock();
printf("Refined mesh %i %i\n",m.FN(),m.VN());
printf("Opening time %5.2f \n Refinement time %5.2f",float(t1-t0)/CLOCKS_PER_SEC,float(t3-t2)/CLOCKS_PER_SEC);
char *bufMeshOut = tri::io::ExporterOFF<MyMesh>::SaveStream(m);
return bufMeshOut;
}
示例2: getFaceVector
inline uintptr_t getFaceVector() {
int * f = new int[m.FN()*3];
int k=0;
for (int i = 0; i < m.FN(); i++)
for (int j = 0; j < 3; j++){
f[k] = (int)tri::Index(m,m.face[i].cV(j));
k++;
}
return (uintptr_t)f;
}
示例3: main
int main( int /*argc*/, char **/*argv*/ )
{
MyMesh m;
vcg::tri::Torus(m,30,10);
vcg::tri::io::ExporterOFF<MyMesh>::Save(m,"torus.off");
vcg::tri::UpdateTopology<MyMesh>::FaceFace(m);
// vcg::tri::UpdateCurvature<MyMesh>::VertexCurvature(m);
vcg::tri::UpdateCurvature<MyMesh>::MeanAndGaussian(m);
vcg::tri::UpdateCurvature<MyMesh>::PrincipalDirections(m);
//vcg::tri::UpdateCurvature<MyMesh>::PrincipalDirectionsNormalCycles(m);
vcg::tri::UpdateCurvature<MyMesh>::PrincipalDirectionsPCA(m,m.bbox.Diag()/100);
vcg::tri::UpdateNormal<MyMesh>::PerVertexNormalized(m);
printf("Input mesh vn:%i fn:%i\n",m.VN(),m.FN());
printf( "Mesh has %i vert and %i faces\n", m.VN(), m.FN() );
return 0;
}
示例4: SmoothPlugin
void SmoothPlugin(uintptr_t _m, int step)
{
MyMesh *n = (MyMesh*) _m;
int t2=clock();
tri::UpdateTopology<MyMesh>::VertexFace(*n);
tri::Smooth<MyMesh>::VertexCoordLaplacian(*n, step, false, true);
tri::UpdateNormal<MyMesh>::PerVertexPerFace(*n);
int t3=clock();
printf("Smooth mesh %i vert - %i face \n",n->VN(),n->FN());
printf("Smooth time %5.2f\n",float(t3-t2)/CLOCKS_PER_SEC);
}
示例5: openMesh
int openMesh() {
int loadmask;
int ret = tri::io::ImporterOFF<MyMesh>::OpenMem(m,buf,strlen(buf),loadmask);
if(ret != 0)
{
printf("Error in opening file\n");
exit(-1);
}
printf("Read mesh %i %i\n",m.FN(),m.VN());
return ret;
}
示例6: main
int main( int argc, char **argv )
{
if(argc<2)
{
printf("Usage trimesh_base <meshfilename.obj>\n");
return -1;
}
/*!
*/
MyMesh m;
if(vcg::tri::io::ImporterOFF<MyMesh>::Open(m,argv[1])!=vcg::tri::io::ImporterOFF<MyMesh>::NoError)
{
printf("Error reading file %s\n",argv[1]);
exit(0);
}
vcg::tri::RequirePerVertexNormal(m);
vcg::tri::UpdateNormal<MyMesh>::PerVertexNormalized(m);
printf("Input mesh vn:%i fn:%i\n",m.VN(),m.FN());
printf( "Mesh has %i vert and %i faces\n", m.VN(), m.FN() );
return 0;
}
示例7: mySmooth
void mySmooth(int step)
{
int t2=clock();
tri::RequirePerVertexNormal(*n);
tri::UpdateTopology<MyMesh>::VertexFace(*n);
tri::Smooth<MyMesh>::VertexCoordLaplacian(*n, step, false, true);
tri::UpdateNormal<MyMesh>::PerVertexPerFace(*n);
int t3=clock();
printf("Smooth mesh %i vert - %i face \n",n->VN(),n->FN());
printf("Smooth time %5.2f\n",float(t3-t2)/CLOCKS_PER_SEC);
}
示例8: getFaceNumber
int getFaceNumber() {
return m.FN();
}