本文整理汇总了C++中eigen::PlainObjectBase::conservativeResize方法的典型用法代码示例。如果您正苦于以下问题:C++ PlainObjectBase::conservativeResize方法的具体用法?C++ PlainObjectBase::conservativeResize怎么用?C++ PlainObjectBase::conservativeResize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eigen::PlainObjectBase
的用法示例。
在下文中一共展示了PlainObjectBase::conservativeResize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: reorient_facets_raycast
IGL_INLINE void igl::reorient_facets_raycast(
const Eigen::PlainObjectBase<DerivedV> & V,
const Eigen::PlainObjectBase<DerivedF> & F,
Eigen::PlainObjectBase<DerivedFF> & FF,
Eigen::PlainObjectBase<DerivedI> & I)
{
const int rays_total = F.rows()*100;
const int rays_minimum = 10;
const bool facet_wise = false;
const bool use_parity = false;
const bool is_verbose = false;
Eigen::VectorXi C;
reorient_facets_raycast(
V,F,rays_total,rays_minimum,facet_wise,use_parity,is_verbose,I,C);
// Conservative in case FF = F
FF.conservativeResize(F.rows(),F.cols());
for(int i = 0;i<I.rows();i++)
{
if(I(i))
{
FF.row(i) = (F.row(i).reverse()).eval();
}else
{
FF.row(i) = F.row(i);
}
}
}
示例2: cut_mesh
IGL_INLINE void igl::cut_mesh(
const Eigen::PlainObjectBase<DerivedV> &V,
const Eigen::PlainObjectBase<DerivedF> &F,
const std::vector<std::vector<VFType> >& VF,
const std::vector<std::vector<VFType> >& VFi,
const Eigen::PlainObjectBase<DerivedTT>& TT,
const Eigen::PlainObjectBase<DerivedTT>& TTi,
const std::vector<bool> &V_border,
const Eigen::PlainObjectBase<DerivedC> &cuts,
Eigen::PlainObjectBase<DerivedV> &Vcut,
Eigen::PlainObjectBase<DerivedF> &Fcut)
{
//finding the cuts is done, now we need to actually generate a cut mesh
igl::MeshCutterMini<DerivedV, DerivedF, VFType, DerivedTT, DerivedC> mc(V, F, TT, TTi, VF, VFi, V_border, cuts);
mc.InitMappingSeam();
Fcut = mc.HandleS_Index;
//we have the faces, we need the vertices;
int newNumV = Fcut.maxCoeff()+1;
Vcut.setZero(newNumV,3);
for (int vi=0; vi<V.rows(); ++vi)
for (int i=0; i<mc.HandleV_Integer[vi].size();++i)
Vcut.row(mc.HandleV_Integer[vi][i]) = V.row(vi);
//ugly hack to fix some problematic cases (border vertex that is also on the boundary of the hole
for (int fi =0; fi<Fcut.rows(); ++fi)
for (int k=0; k<3; ++k)
if (Fcut(fi,k)==-1)
{
//we need to add a vertex
Fcut(fi,k) = newNumV;
newNumV ++;
Vcut.conservativeResize(newNumV, Eigen::NoChange);
Vcut.row(newNumV-1) = V.row(F(fi,k));
}
}