本文整理汇总了C++中eigen::MatrixXi::rowwise方法的典型用法代码示例。如果您正苦于以下问题:C++ MatrixXi::rowwise方法的具体用法?C++ MatrixXi::rowwise怎么用?C++ MatrixXi::rowwise使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eigen::MatrixXi
的用法示例。
在下文中一共展示了MatrixXi::rowwise方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char *argv[])
{
using namespace Eigen;
using namespace std;
cout<<"Usage:"<<endl;
cout<<"[space] toggle showing input mesh, output mesh or slice "<<endl;
cout<<" through tet-mesh of convex hull."<<endl;
cout<<"'.'/',' push back/pull forward slicing plane."<<endl;
cout<<endl;
// Load mesh: (V,T) tet-mesh of convex hull, F contains facets of input
// surface mesh _after_ self-intersection resolution
igl::readMESH(TUTORIAL_SHARED_PATH "/big-sigcat.mesh",V,T,F);
// Compute barycenters of all tets
igl::barycenter(V,T,BC);
// Compute generalized winding number at all barycenters
cout<<"Computing winding number over all "<<T.rows()<<" tets..."<<endl;
igl::winding_number(V,F,BC,W);
// Extract interior tets
MatrixXi CT((W.array()>0.5).count(),4);
{
size_t k = 0;
for(size_t t = 0;t<T.rows();t++)
{
if(W(t)>0.5)
{
CT.row(k) = T.row(t);
k++;
}
}
}
// find bounary facets of interior tets
igl::boundary_facets(CT,G);
// boundary_facets seems to be reversed...
G = G.rowwise().reverse().eval();
// normalize
W = (W.array() - W.minCoeff())/(W.maxCoeff()-W.minCoeff());
// Plot the generated mesh
igl::opengl::glfw::Viewer viewer;
update_visualization(viewer);
viewer.callback_key_down = &key_down;
viewer.launch();
}
示例2: key
void key(unsigned char key, int mouse_x, int mouse_y)
{
using namespace std;
using namespace Eigen;
using namespace igl;
int mod = glutGetModifiers();
switch(key)
{
// ESC
case char(27):
rebar.save(REBAR_NAME);
// ^C
case char(3):
exit(0);
case 'I':
case 'i':
{
push_undo();
s.N *= -1.0;
F = F.rowwise().reverse().eval();
break;
}
case 'z':
case 'Z':
if(mod & GLUT_ACTIVE_COMMAND)
{
if(mod & GLUT_ACTIVE_SHIFT)
{
redo();
}else
{
undo();
}
}else
{
push_undo();
Quaterniond q;
snap_to_canonical_view_quat(s.camera.m_rotation_conj,1.0,q);
switch(center_type)
{
default:
case CENTER_TYPE_ORBIT:
s.camera.orbit(q.conjugate());
break;
case CENTER_TYPE_FPS:
s.camera.turn_eye(q.conjugate());
break;
}
}
break;
case 'u':
mouse_wheel(0, 1,mouse_x,mouse_y);
break;
case 'j':
mouse_wheel(0,-1,mouse_x,mouse_y);
break;
case 'n':
cc_selected = (cc_selected + 1) % (CC.maxCoeff() + 2);
cout << "selected cc: " << cc_selected << endl;
glutPostRedisplay();
break;
default:
if(!TwEventKeyboardGLUT(key,mouse_x,mouse_y))
{
cout<<"Unknown key command: "<<key<<" "<<int(key)<<endl;
}
}
}